gerege-cli 0.26.5 → 0.26.6
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-QCIXIS4P.js} +1 -1
- package/chunks/{StandaloneSessionPicker-UNORCVYY.js → StandaloneSessionPicker-BAFAIRT7.js} +1 -1
- package/chunks/{acp-subagent-executor-623ZUTJT.js → acp-subagent-executor-TPVXURLW.js} +1 -1
- package/chunks/{acpAgent-MTTDTK2C.js → acpAgent-67UN66PB.js} +3 -3
- package/chunks/{advisor-ANUGICJ5.js → advisor-SAXMI4QZ.js} +1 -1
- package/chunks/{agent-GNCQDICJ.js → agent-KV7BXY6C.js} +1 -1
- package/chunks/{agent-headless-OPUXAXQM.js → agent-headless-FQX3JGG6.js} +1 -1
- package/chunks/{agent-host-client-K6GRPTFD.js → agent-host-client-L5EHC4AC.js} +1 -1
- package/chunks/{agent-host-connections-MF3YBZU2.js → agent-host-connections-EDBMCVQF.js} +1 -1
- package/chunks/{anthropicContentGenerator-OK4PFE5Y.js → anthropicContentGenerator-V7TX2NXP.js} +1 -1
- package/chunks/{autofix-pr-MABTGEHZ.js → autofix-pr-WP34NYHL.js} +1 -1
- package/chunks/{batch-V2NJT3M5.js → batch-XFVQ4BLM.js} +1 -1
- package/chunks/{bridge-BJQ627CX.js → bridge-AE7AFEXB.js} +1 -1
- package/chunks/{channel-settings-store-4JMCI4UR.js → channel-settings-store-X63P5OVT.js} +1 -1
- package/chunks/{chunk-ZN57TOVA.js → chunk-2DU2WMTL.js} +1 -1
- package/chunks/{chunk-Z5XENA4A.js → chunk-2JGTWRZJ.js} +8 -7
- package/chunks/{chunk-MTW3A3KT.js → chunk-2LWJGXTW.js} +1 -1
- package/chunks/{chunk-OCBJCZC2.js → chunk-2N3NBTYJ.js} +1 -1
- package/chunks/{chunk-WI4UMN3Q.js → chunk-2TAJ5STJ.js} +1 -1
- package/chunks/{chunk-EIILQ6KT.js → chunk-32XHDDIA.js} +1 -1
- package/chunks/{chunk-FNXO5KWB.js → chunk-34HC2AXI.js} +2 -2
- package/chunks/{chunk-2X3UF2CF.js → chunk-3W32X2DH.js} +1 -1
- package/chunks/{chunk-CKZRJP4F.js → chunk-4ME3BUJK.js} +1 -1
- package/chunks/{chunk-NVSKOSFG.js → chunk-4NDJKNN6.js} +1 -1
- package/chunks/{chunk-BRPJ5EHA.js → chunk-5EXL4TKQ.js} +1 -1
- package/chunks/{chunk-3XBJYUWP.js → chunk-65ME4BOH.js} +1 -1
- package/chunks/{chunk-TQTIEK2W.js → chunk-7453BHJO.js} +1 -1
- package/chunks/{chunk-HSYBIGMS.js → chunk-76FSYQTG.js} +1 -1
- package/chunks/{chunk-FNB3DPQZ.js → chunk-7RNOS7R4.js} +1 -1
- package/chunks/{chunk-H57IX45A.js → chunk-AEKEZRIU.js} +1 -1
- package/chunks/{chunk-CXGGC4NO.js → chunk-AEZYXPFS.js} +1 -1
- package/chunks/{chunk-NGOIJH7K.js → chunk-AFO5ER23.js} +1 -1
- package/chunks/{chunk-UY2ET2AL.js → chunk-AYVCT5FF.js} +1 -1
- package/chunks/{chunk-QOYRDEXR.js → chunk-B37YY4XU.js} +1 -1
- package/chunks/{chunk-IDUGQMTP.js → chunk-BAUMVH4Q.js} +1 -1
- package/chunks/{chunk-CAPG7UVH.js → chunk-BCI62WSL.js} +1 -1
- package/chunks/{chunk-USJFJZ23.js → chunk-BGELKSQ4.js} +1 -1
- package/chunks/{chunk-6X73W4TL.js → chunk-BHIDG6VZ.js} +1 -1
- package/chunks/{chunk-26ISBUM7.js → chunk-BPFFRPWE.js} +6 -6
- package/chunks/{chunk-YGHM5CDT.js → chunk-BQZF3UKI.js} +1 -1
- package/chunks/{chunk-3NQESE5K.js → chunk-CBE6ZIHU.js} +1 -1
- package/chunks/{chunk-DEMXCA3K.js → chunk-CF6SZJNP.js} +1 -1
- package/chunks/{chunk-2VCDJ6UF.js → chunk-CGDFZEER.js} +1 -1
- package/chunks/{chunk-3WQPUP5U.js → chunk-CUP2TNJK.js} +1 -1
- package/chunks/{chunk-2IGE2K5V.js → chunk-DA6LOBSB.js} +1 -1
- package/chunks/{chunk-HFV6CQWE.js → chunk-EFIRES46.js} +1 -1
- package/chunks/{chunk-E5YRAQXM.js → chunk-EKRUF347.js} +1 -1
- package/chunks/{chunk-KN27BFXM.js → chunk-ELDZ4MNL.js} +1 -1
- package/chunks/{chunk-ADTFKUH2.js → chunk-ET5M5WFN.js} +1 -1
- package/chunks/{chunk-IBYFSHBB.js → chunk-EXIFPXMB.js} +1 -1
- package/chunks/{chunk-IA4K4PGK.js → chunk-EYPLBTMI.js} +1 -1
- package/chunks/{chunk-DTTC4ZKY.js → chunk-FEP6W4NJ.js} +1 -1
- package/chunks/{chunk-FHBGTZ4K.js → chunk-FKL3V5BO.js} +1 -1
- package/chunks/{chunk-Q5E5SOY2.js → chunk-FKZ46GKL.js} +1 -1
- package/chunks/{chunk-OPYGNTZP.js → chunk-FYBJGRX7.js} +1 -1
- package/chunks/{chunk-FPZPCZFS.js → chunk-G6DALGGS.js} +1 -1
- package/chunks/{chunk-3Y6LSWEW.js → chunk-GBSRWT7J.js} +1 -1
- package/chunks/{chunk-SMYBY353.js → chunk-GHIFIXNX.js} +1 -1
- package/chunks/{chunk-DE53B2R7.js → chunk-GRAECADD.js} +1 -1
- package/chunks/{chunk-UJYOILZR.js → chunk-GSPGIGO5.js} +3 -3
- package/chunks/{chunk-5UZT4SXG.js → chunk-H3IR3GIE.js} +1 -1
- package/chunks/{chunk-ADZI3OFT.js → chunk-HOG66S6K.js} +1 -1
- package/chunks/{chunk-WB34KMOT.js → chunk-HTAUIJB4.js} +1 -1
- package/chunks/{chunk-MPAR4JBP.js → chunk-I6PUY2T3.js} +1 -1
- package/chunks/{chunk-5ZQWQ3RK.js → chunk-IZ5MWA6E.js} +1 -1
- package/chunks/{chunk-7IERHQ63.js → chunk-JEDL4IKF.js} +1 -1
- package/chunks/{chunk-RVJJFDF3.js → chunk-JH3V5SPA.js} +1 -1
- package/chunks/{chunk-SELRSZFK.js → chunk-JRTOPEM3.js} +1 -1
- package/chunks/{chunk-SQQORHMS.js → chunk-JWNKPINR.js} +1 -1
- package/chunks/{chunk-55RVKT4O.js → chunk-KJGRCIVY.js} +1 -1
- package/chunks/{chunk-GSOBASYW.js → chunk-KZNYALFU.js} +1 -1
- package/chunks/{chunk-FDUXQAGW.js → chunk-LBLLWAKK.js} +1 -1
- package/chunks/{chunk-ZSVSRF4C.js → chunk-LT3J74BZ.js} +1 -1
- package/chunks/{chunk-AMTFJVDD.js → chunk-LTE4N6L3.js} +1 -1
- package/chunks/{chunk-F26LTWDZ.js → chunk-M6KB5RVD.js} +1 -1
- package/chunks/{chunk-2PY7R7GG.js → chunk-MGATL4OA.js} +1 -1
- package/chunks/{chunk-KGJ47CI5.js → chunk-MPVQDYPH.js} +1 -1
- package/chunks/{chunk-BBOJUFMW.js → chunk-MTDBCIDA.js} +1 -1
- package/chunks/{chunk-ZYTG6R7S.js → chunk-MYV7GY3H.js} +1 -1
- package/chunks/{chunk-4GC5HJZO.js → chunk-N7PWZBXV.js} +1 -1
- package/chunks/{chunk-2NOMOJWE.js → chunk-NA4ZF2FE.js} +2 -2
- package/chunks/{chunk-7MTBINFX.js → chunk-NEKPQLFY.js} +2 -2
- package/chunks/{chunk-ABJGFEES.js → chunk-NO7VTKRL.js} +1 -1
- package/chunks/{chunk-OHXQYU6S.js → chunk-NONBHCXP.js} +1 -1
- package/chunks/{chunk-ZOBX6C7E.js → chunk-NVOI6UDQ.js} +1 -1
- package/chunks/{chunk-YLAI26PX.js → chunk-OJ4K62S2.js} +1 -1
- package/chunks/{chunk-CCOUFBOY.js → chunk-OK7LBM5G.js} +1 -1
- package/chunks/{chunk-POA4NX4N.js → chunk-OOJ2AQT3.js} +1 -1
- package/chunks/{chunk-5WLKN3GD.js → chunk-OU7CEG7Q.js} +1 -1
- package/chunks/{chunk-4TYTJQWR.js → chunk-P3JEEDQZ.js} +1 -1
- package/chunks/{chunk-AQWHCRKY.js → chunk-P62S5JGM.js} +1 -1
- package/chunks/{chunk-B6D3KTUK.js → chunk-QDCUR3JB.js} +1 -1
- package/chunks/{chunk-XFLLE2J3.js → chunk-RSLTOIG5.js} +2 -2
- package/chunks/{chunk-ISGF3BVD.js → chunk-RXN7DUMP.js} +2 -2
- package/chunks/{chunk-PN62SUYK.js → chunk-SKGJ26HQ.js} +1 -1
- package/chunks/{chunk-62NLMVVT.js → chunk-SP6CQ3MO.js} +1 -1
- package/chunks/{chunk-4EQWJTJR.js → chunk-T2YTHAJW.js} +1 -1
- package/chunks/{chunk-NO26JN24.js → chunk-T53VMDXH.js} +1 -1
- package/chunks/{chunk-X4BFEDWU.js → chunk-T5DKF33F.js} +1 -1
- package/chunks/{chunk-KKBOCRPF.js → chunk-TB4AUC2L.js} +1 -1
- package/chunks/{chunk-Q6QS5JTK.js → chunk-U3Q72OGV.js} +1 -1
- package/chunks/{chunk-FLJLUMQF.js → chunk-UKLXKJKL.js} +1 -1
- package/chunks/{chunk-IH2PFVWO.js → chunk-VD2GSW64.js} +1 -1
- package/chunks/{chunk-VDRE7U3P.js → chunk-VRKYBH5G.js} +5 -5
- package/chunks/{chunk-MOPJNP5I.js → chunk-W2RQIZ6B.js} +1 -1
- package/chunks/{chunk-2LLPGSUK.js → chunk-W5Z4BWWA.js} +1 -1
- package/chunks/{chunk-CNFA5UUM.js → chunk-W66WWTOP.js} +1 -1
- package/chunks/{chunk-C56YJIEI.js → chunk-WGFX3EL3.js} +1 -1
- package/chunks/{chunk-6NI33TVK.js → chunk-X2TY7VTY.js} +1 -1
- package/chunks/{chunk-FIM7MM25.js → chunk-XISR37DQ.js} +1 -1
- package/chunks/{chunk-KDYUZBZC.js → chunk-YH2XRWRF.js} +1 -1
- package/chunks/{chunk-UBXLQ6TP.js → chunk-ZENMAISJ.js} +1 -1
- package/chunks/{codex-subagent-executor-EK3A2WBH.js → codex-subagent-executor-OLMGVPVS.js} +1 -1
- package/chunks/{config-utils-DLOK7OLM.js → config-utils-OWY5G5Y2.js} +1 -1
- package/chunks/{contextCommand-AVCUCHQC.js → contextCommand-IXFUZH65.js} +1 -1
- package/chunks/{core-runtime-QSS4ZTG6.js → core-runtime-O4LC4NY3.js} +1 -1
- package/chunks/{create-sub-session-PNF7QDKC.js → create-sub-session-6F7C3TMT.js} +1 -1
- package/chunks/{cron-create-C6JOFIU4.js → cron-create-2422NBSJ.js} +1 -1
- package/chunks/{daemon-git-worktree-guard-5XZAZ7D2.js → daemon-git-worktree-guard-EWPQA6NO.js} +1 -1
- package/chunks/{daemon-status-provider-MRNELSNJ.js → daemon-status-provider-FAHOXNFW.js} +1 -1
- package/chunks/{daemon-trust-policy-26CMW3WY.js → daemon-trust-policy-L3DM6AI5.js} +1 -1
- package/chunks/{daemon-trust-policy-monitor-3DWO6NQY.js → daemon-trust-policy-monitor-HNPY5KJ4.js} +1 -1
- package/chunks/{deferred-core-runtime-DEC3N46T.js → deferred-core-runtime-JF42NQJK.js} +1 -1
- package/chunks/{edit-3HMQPCHN.js → edit-E5LEI2LL.js} +1 -1
- package/chunks/{enterPlanMode-QHJF4JXZ.js → enterPlanMode-3COTUV5V.js} +1 -1
- package/chunks/{environment-NGIBJWOT.js → environment-XBBIB3VA.js} +1 -1
- package/chunks/{errors-MSTGCVGJ.js → errors-LNMQ7TUK.js} +1 -1
- package/chunks/{execution-tool-VR4TGOI4.js → execution-tool-QDDKJD2K.js} +1 -1
- package/chunks/{execution-worker-EJH7HIE2.js → execution-worker-TXGZRZXE.js} +1 -1
- package/chunks/{exitPlanMode-P25OHQJ6.js → exitPlanMode-Z7QEMWPE.js} +1 -1
- package/chunks/{fast-path-II433ZDP.js → fast-path-M6K2RACY.js} +1 -1
- package/chunks/{glob-4Q6DCT3F.js → glob-N2QT4U7U.js} +1 -1
- package/chunks/{goal-tools-FFMAJW6V.js → goal-tools-CUSQD3DG.js} +1 -1
- package/chunks/{handleAutoUpdate-QNM26NZK.js → handleAutoUpdate-QF2YQHF6.js} +1 -1
- package/chunks/{i18n-L5URVOBB.js → i18n-AGOA6MUI.js} +1 -1
- package/chunks/{initializer-NQ2NECYP.js → initializer-FRKYDUSX.js} +1 -1
- package/chunks/{installationInfo-BCTXASUM.js → installationInfo-OKA4WXAS.js} +1 -1
- package/chunks/{interactive-mod-session-PPTBI37E.js → interactive-mod-session-MWYN5IFK.js} +1 -1
- package/chunks/{list-7TE5TUZJ.js → list-DE7VUIR2.js} +1 -1
- package/chunks/{llm-BWWKUBBZ.js → llm-N3JGJHYC.js} +4 -4
- package/chunks/{llm-content-generator-QOTGPBYC.js → llm-content-generator-VMUBA7OJ.js} +1 -1
- package/chunks/{loadedSettingsAdapter-THAGI5M2.js → loadedSettingsAdapter-5C36OZ7N.js} +1 -1
- package/chunks/{local-7BTAGV4J.js → local-BE624O3A.js} +1 -1
- package/chunks/{local-execution-environment-S3OR4KSC.js → local-execution-environment-OPGM7Y6L.js} +1 -1
- package/chunks/{loggingContentGenerator-AXJ5E5RS.js → loggingContentGenerator-2MHAI6JR.js} +1 -1
- package/chunks/{loop-wakeup-AJTLMLRX.js → loop-wakeup-BDLATBXH.js} +1 -1
- package/chunks/{manage-memory-JHTUVMDJ.js → manage-memory-BBCEIIWB.js} +1 -1
- package/chunks/{managed-execution-engine-U6GNJ4U4.js → managed-execution-engine-SRFALTCX.js} +1 -1
- package/chunks/{managed-local-serve-P4ZXVRBU.js → managed-local-serve-ICNAS3E6.js} +1 -1
- package/chunks/{managed-npm-update-UDUILNR5.js → managed-npm-update-CTL6LH5Z.js} +1 -1
- package/chunks/{managed-runtime-attestation-worker-P34ZBNRG.js → managed-runtime-attestation-worker-ZRDWKXCI.js} +1 -1
- package/chunks/{managed-runtime-bootstrap-CLMYNPH5.js → managed-runtime-bootstrap-6NTGZXQL.js} +1 -1
- package/chunks/{managed-runtime-session-worker-7H7AZJBV.js → managed-runtime-session-worker-RKQBBFR6.js} +1 -1
- package/chunks/{managed-runtime-ssh-worker-5KEMC7FD.js → managed-runtime-ssh-worker-FCGV6FSW.js} +1 -1
- package/chunks/{managed-session-authority-CFUZ45HT.js → managed-session-authority-C7IW6TJX.js} +1 -1
- package/chunks/{mcp-YMG4RVMC.js → mcp-VC4CJPE5.js} +1 -1
- package/chunks/{memory-7STURUXK.js → memory-S6OJA3ZD.js} +1 -1
- package/chunks/mn-JMS6SWTO.js +8 -0
- package/chunks/{model-call-collection-WBWTO3EG.js → model-call-collection-MJZWRQSU.js} +1 -1
- package/chunks/{model-configuration-6KCZZSZD.js → model-configuration-SKU6L3QI.js} +1 -1
- package/chunks/{modelConfigUtils-Z2EKFSPN.js → modelConfigUtils-TJCB6NXT.js} +1 -1
- package/chunks/{monitor-U5E33JO6.js → monitor-M3PNLCYP.js} +1 -1
- package/chunks/{nonInteractiveCli-BVCL5I5R.js → nonInteractiveCli-MR7JLAWU.js} +1 -1
- package/chunks/{nonInteractiveToolExecutor-B4EUOMYF.js → nonInteractiveToolExecutor-YKA6JMTY.js} +1 -1
- package/chunks/{notebook-edit-MXKD5J2C.js → notebook-edit-ENTFB5D7.js} +1 -1
- package/chunks/{omni-I5YECZBW.js → omni-6YBX4R6K.js} +1 -1
- package/chunks/{openaiContentGenerator-Q5SINFJJ.js → openaiContentGenerator-XRXX33FY.js} +1 -1
- package/chunks/{openaiResponsesContentGenerator-R3XCZLZY.js → openaiResponsesContentGenerator-L6ONEHMR.js} +1 -1
- package/chunks/{pidfile-UOGUNUTK.js → pidfile-XR4JF2Z6.js} +1 -1
- package/chunks/{processUtils-QGQGZHBA.js → processUtils-GQYNJRBJ.js} +1 -1
- package/chunks/{prompt-terminal-ledger-L57JMVSR.js → prompt-terminal-ledger-7BM7YDLG.js} +1 -1
- package/chunks/{qwenContentGenerator-UKZ237LC.js → qwenContentGenerator-QSA32XEL.js} +1 -1
- package/chunks/{reactive-degrade-3OM3HWVA.js → reactive-degrade-TFNBAAPZ.js} +1 -1
- package/chunks/{read-file-63ZLWMOW.js → read-file-VD7OFO2E.js} +1 -1
- package/chunks/{resumeHistoryUtils-R5YQS4YQ.js → resumeHistoryUtils-2B4KPI7G.js} +1 -1
- package/chunks/{review-AT6OWVDO.js → review-C365WGCW.js} +1 -1
- package/chunks/{ripGrep-7KBZGTPV.js → ripGrep-D7WPMBXR.js} +1 -1
- package/chunks/{run-qwen-serve-CLBG7W6F.js → run-qwen-serve-NZWQHWQA.js} +1 -1
- package/chunks/{runtime-R3QIGB7U.js → runtime-J6SPBSCS.js} +1 -1
- package/chunks/{sandboxConfig-PM3ZRQYV.js → sandboxConfig-QS2XBPZG.js} +1 -1
- package/chunks/{scheduled-tasks-PUMNN5XV.js → scheduled-tasks-YNNIOOPM.js} +1 -1
- package/chunks/{scheduler-KTPM226B.js → scheduler-KCMSPHON.js} +1 -1
- package/chunks/{search-memory-7I5MGDNV.js → search-memory-EUBJ7IAV.js} +1 -1
- package/chunks/{send-message-J526AEBI.js → send-message-CWWZUPSK.js} +1 -1
- package/chunks/{serve-KLTMPK4W.js → serve-4CB4BWJ5.js} +1 -1
- package/chunks/{server-VLRNY6KG.js → server-JNANUIGC.js} +3 -3
- package/chunks/{session-2EB57NXY.js → session-3LQLXPUA.js} +1 -1
- package/chunks/{session-attachments-root-I7TESMWL.js → session-attachments-root-BWIVWFHJ.js} +1 -1
- package/chunks/{session-execution-engine-selector-5FAMSPSO.js → session-execution-engine-selector-5OLRX57L.js} +1 -1
- package/chunks/{session-pr-refresh-JCPVQPNJ.js → session-pr-refresh-RLF3EXS3.js} +1 -1
- package/chunks/{sessionService-YRW2IFPR.js → sessionService-U7ACD2HP.js} +1 -1
- package/chunks/{settings-KO2Q47JP.js → settings-FTGWYTUH.js} +1 -1
- package/chunks/{shell-OLZVNTQZ.js → shell-E4RENYQC.js} +1 -1
- package/chunks/{skill-XW2AQS7M.js → skill-OLNPHRWB.js} +1 -1
- package/chunks/{skill-settings-TKAVQ4XP.js → skill-settings-R2BV2GEK.js} +1 -1
- package/chunks/{spawnChannel-MBGCTK2J.js → spawnChannel-LOPAR5T2.js} +1 -1
- package/chunks/{standalone-update-A3YLLIAN.js → standalone-update-IGDX2RGN.js} +1 -1
- package/chunks/{start-opentui-ui-G5ROAR4V.js → start-opentui-ui-33QLBNRC.js} +1 -1
- package/chunks/{startInteractiveUI-PZQR4U53.js → startInteractiveUI-RQKHD7MM.js} +1 -1
- package/chunks/{team-create-S5ZY2UMF.js → team-create-HAVKHNU5.js} +1 -1
- package/chunks/{team-plan-approval-KX6RXEST.js → team-plan-approval-7MCQX67C.js} +1 -1
- package/chunks/{terminal-image-renderer-SCJREXE6.js → terminal-image-renderer-XT5JVEO6.js} +1 -1
- package/chunks/{theme-manager-DZSM4EBR.js → theme-manager-DR5EYGLT.js} +1 -1
- package/chunks/{tool-call-UK56SWCT.js → tool-call-LZHZ5RVH.js} +1 -1
- package/chunks/{tool-result-media-JLLSLGFL.js → tool-result-media-XCXCF4YC.js} +1 -1
- package/chunks/{tool-search-OWPFLVV5.js → tool-search-K6S3ON7M.js} +1 -1
- package/chunks/{total-session-admission-NQU4ACKH.js → total-session-admission-LGSS2VWS.js} +1 -1
- package/chunks/{trustedFolders-N7GXFYSF.js → trustedFolders-IIR2UZRL.js} +1 -1
- package/chunks/{update-relaunch-5SPXXHM2.js → update-relaunch-WVIFX5CN.js} +1 -1
- package/chunks/{updateCheck-VXUIX2XG.js → updateCheck-CMEWLLZJ.js} +1 -1
- package/chunks/{upload-config-OWLL4SRQ.js → upload-config-TCCFCNCD.js} +1 -1
- package/chunks/{useAutoAcceptIndicator-OUYRR56F.js → useAutoAcceptIndicator-5RTTH3OW.js} +1 -1
- package/chunks/{validateNonInterActiveAuth-PSVJO5HK.js → validateNonInterActiveAuth-AO336KDX.js} +1 -1
- package/chunks/{version-C26S7UAW.js → version-JYWKKMNP.js} +1 -1
- package/chunks/{web-fetch-AYOYV7R4.js → web-fetch-HWTAWXFM.js} +1 -1
- package/chunks/{web-search-DAREKD3Z.js → web-search-HAI5LW3G.js} +1 -1
- package/chunks/{workflow-WBGPKVO6.js → workflow-BZ2YFGF6.js} +1 -1
- package/chunks/{workflow-ancestor-trust-GEEB53TB.js → workflow-ancestor-trust-26TFXFPO.js} +1 -1
- package/chunks/{workspace-agents-IMAQME4W.js → workspace-agents-DLI4JQJZ.js} +1 -1
- package/chunks/{workspace-providers-status-VALHVEU2.js → workspace-providers-status-64C7DJZU.js} +1 -1
- package/chunks/{workspace-recovery-worker-AIAVRDGU.js → workspace-recovery-worker-IFRT3KKP.js} +1 -1
- package/chunks/{workspace-registration-store-FXEGZG3L.js → workspace-registration-store-MYKJM2SK.js} +1 -1
- package/chunks/{workspace-registry-GYFFHWCD.js → workspace-registry-GZJRONAY.js} +1 -1
- package/chunks/{workspace-runtime-coordinator-VZ462TLU.js → workspace-runtime-coordinator-44KW6HSN.js} +1 -1
- package/chunks/{workspace-service-5DIZM4IZ.js → workspace-service-YHTSZYYD.js} +1 -1
- package/chunks/{workspace-skills-status-DOOBVL5N.js → workspace-skills-status-NEB62X24.js} +1 -1
- package/chunks/{workspace-trust-reconciler-LOICVUVW.js → workspace-trust-reconciler-HZLOOZWM.js} +1 -1
- package/chunks/{write-file-EJNMAHQD.js → write-file-HD5LHXGL.js} +1 -1
- package/chunks/{zoom-image-S3OARMYP.js → zoom-image-W4BMRC5T.js} +1 -1
- package/cli.js +2 -2
- package/execution-worker.js +1 -1
- package/export-transcript-document.js +1 -1
- package/gerege.mjs +53 -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{buildTrustPrecedenceRules,resolveTrustDecision,resolveTrustRule}from"./chunk-EIPLDYEY.js";import{arePathsEquivalent,getPathComparisonVariants}from"./chunk-IDXJIDME.js";import{ideContextStore}from"./chunk-Z5XENA4A.js";import{require_proper_lockfile}from"./chunk-YIW3H46P.js";import{atomicWriteFileSync}from"./chunk-BMHYEQTI.js";import{writeStderrLine}from"./chunk-M4ECEHLX.js";import{createDebugLogger}from"./chunk-JAUJI56S.js";import{Storage}from"./chunk-EPODBRBP.js";import{FatalConfigError,getErrorMessage}from"./chunk-XYB7GC5U.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*as fs4 from"node:fs";import*as path3 from"node:path";init_esbuild_shims();import*as fs2 from"node:fs";import{isDeepStrictEqual}from"node:util";init_esbuild_shims();init_esbuild_shims();init_esbuild_shims();function createScanner(text,ignoreTrivia=false){const len=text.length;let pos=0,value="",tokenOffset=0,token=16,lineNumber=0,lineStartOffset=0,tokenLineStartOffset=0,prevTokenLineStartOffset=0,scanError=0;function scanHexDigits(count,exact){let digits=0;let value2=0;while(digits<count||!exact){let ch=text.charCodeAt(pos);if(ch>=48&&ch<=57){value2=value2*16+ch-48}else if(ch>=65&&ch<=70){value2=value2*16+ch-65+10}else if(ch>=97&&ch<=102){value2=value2*16+ch-97+10}else{break}pos++;digits++}if(digits<count){value2=-1}return value2}__name(scanHexDigits,"scanHexDigits");function setPosition(newPosition){pos=newPosition;value="";tokenOffset=0;token=16;scanError=0}__name(setPosition,"setPosition");function scanNumber(){let start=pos;if(text.charCodeAt(pos)===48){pos++}else{pos++;while(pos<text.length&&isDigit(text.charCodeAt(pos))){pos++}}if(pos<text.length&&text.charCodeAt(pos)===46){pos++;if(pos<text.length&&isDigit(text.charCodeAt(pos))){pos++;while(pos<text.length&&isDigit(text.charCodeAt(pos))){pos++}}else{scanError=3;return text.substring(start,pos)}}let end=pos;if(pos<text.length&&(text.charCodeAt(pos)===69||text.charCodeAt(pos)===101)){pos++;if(pos<text.length&&text.charCodeAt(pos)===43||text.charCodeAt(pos)===45){pos++}if(pos<text.length&&isDigit(text.charCodeAt(pos))){pos++;while(pos<text.length&&isDigit(text.charCodeAt(pos))){pos++}end=pos}else{scanError=3}}return text.substring(start,end)}__name(scanNumber,"scanNumber");function scanString(){let result="",start=pos;while(true){if(pos>=len){result+=text.substring(start,pos);scanError=2;break}const ch=text.charCodeAt(pos);if(ch===34){result+=text.substring(start,pos);pos++;break}if(ch===92){result+=text.substring(start,pos);pos++;if(pos>=len){scanError=2;break}const ch2=text.charCodeAt(pos++);switch(ch2){case 34:result+='"';break;case 92:result+="\\";break;case 47:result+="/";break;case 98:result+="\b";break;case 102:result+="\f";break;case 110:result+="\n";break;case 114:result+="\r";break;case 116:result+=" ";break;case 117:const ch3=scanHexDigits(4,true);if(ch3>=0){result+=String.fromCharCode(ch3)}else{scanError=4}break;default:scanError=5}start=pos;continue}if(ch>=0&&ch<=31){if(isLineBreak(ch)){result+=text.substring(start,pos);scanError=2;break}else{scanError=6}}pos++}return result}__name(scanString,"scanString");function scanNext(){value="";scanError=0;tokenOffset=pos;lineStartOffset=lineNumber;prevTokenLineStartOffset=tokenLineStartOffset;if(pos>=len){tokenOffset=len;return token=17}let code=text.charCodeAt(pos);if(isWhiteSpace(code)){do{pos++;value+=String.fromCharCode(code);code=text.charCodeAt(pos)}while(isWhiteSpace(code));return token=15}if(isLineBreak(code)){pos++;value+=String.fromCharCode(code);if(code===13&&text.charCodeAt(pos)===10){pos++;value+="\n"}lineNumber++;tokenLineStartOffset=pos;return token=14}switch(code){case 123:pos++;return token=1;case 125:pos++;return token=2;case 91:pos++;return token=3;case 93:pos++;return token=4;case 58:pos++;return token=6;case 44:pos++;return token=5;case 34:pos++;value=scanString();return token=10;case 47:const start=pos-1;if(text.charCodeAt(pos+1)===47){pos+=2;while(pos<len){if(isLineBreak(text.charCodeAt(pos))){break}pos++}value=text.substring(start,pos);return token=12}if(text.charCodeAt(pos+1)===42){pos+=2;const safeLength=len-1;let commentClosed=false;while(pos<safeLength){const ch=text.charCodeAt(pos);if(ch===42&&text.charCodeAt(pos+1)===47){pos+=2;commentClosed=true;break}pos++;if(isLineBreak(ch)){if(ch===13&&text.charCodeAt(pos)===10){pos++}lineNumber++;tokenLineStartOffset=pos}}if(!commentClosed){pos++;scanError=1}value=text.substring(start,pos);return token=13}value+=String.fromCharCode(code);pos++;return token=16;case 45:value+=String.fromCharCode(code);pos++;if(pos===len||!isDigit(text.charCodeAt(pos))){return token=16}case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:value+=scanNumber();return token=11;default:while(pos<len&&isUnknownContentCharacter(code)){pos++;code=text.charCodeAt(pos)}if(tokenOffset!==pos){value=text.substring(tokenOffset,pos);switch(value){case"true":return token=8;case"false":return token=9;case"null":return token=7}return token=16}value+=String.fromCharCode(code);pos++;return token=16}}__name(scanNext,"scanNext");function isUnknownContentCharacter(code){if(isWhiteSpace(code)||isLineBreak(code)){return false}switch(code){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return false}return true}__name(isUnknownContentCharacter,"isUnknownContentCharacter");function scanNextNonTrivia(){let result;do{result=scanNext()}while(result>=12&&result<=15);return result}__name(scanNextNonTrivia,"scanNextNonTrivia");return{setPosition,getPosition:__name(()=>pos,"getPosition"),scan:ignoreTrivia?scanNextNonTrivia:scanNext,getToken:__name(()=>token,"getToken"),getTokenValue:__name(()=>value,"getTokenValue"),getTokenOffset:__name(()=>tokenOffset,"getTokenOffset"),getTokenLength:__name(()=>pos-tokenOffset,"getTokenLength"),getTokenStartLine:__name(()=>lineStartOffset,"getTokenStartLine"),getTokenStartCharacter:__name(()=>tokenOffset-prevTokenLineStartOffset,"getTokenStartCharacter"),getTokenError:__name(()=>scanError,"getTokenError")}}__name(createScanner,"createScanner");function isWhiteSpace(ch){return ch===32||ch===9}__name(isWhiteSpace,"isWhiteSpace");function isLineBreak(ch){return ch===10||ch===13}__name(isLineBreak,"isLineBreak");function isDigit(ch){return ch>=48&&ch<=57}__name(isDigit,"isDigit");var CharacterCodes;(function(CharacterCodes2){CharacterCodes2[CharacterCodes2["lineFeed"]=10]="lineFeed";CharacterCodes2[CharacterCodes2["carriageReturn"]=13]="carriageReturn";CharacterCodes2[CharacterCodes2["space"]=32]="space";CharacterCodes2[CharacterCodes2["_0"]=48]="_0";CharacterCodes2[CharacterCodes2["_1"]=49]="_1";CharacterCodes2[CharacterCodes2["_2"]=50]="_2";CharacterCodes2[CharacterCodes2["_3"]=51]="_3";CharacterCodes2[CharacterCodes2["_4"]=52]="_4";CharacterCodes2[CharacterCodes2["_5"]=53]="_5";CharacterCodes2[CharacterCodes2["_6"]=54]="_6";CharacterCodes2[CharacterCodes2["_7"]=55]="_7";CharacterCodes2[CharacterCodes2["_8"]=56]="_8";CharacterCodes2[CharacterCodes2["_9"]=57]="_9";CharacterCodes2[CharacterCodes2["a"]=97]="a";CharacterCodes2[CharacterCodes2["b"]=98]="b";CharacterCodes2[CharacterCodes2["c"]=99]="c";CharacterCodes2[CharacterCodes2["d"]=100]="d";CharacterCodes2[CharacterCodes2["e"]=101]="e";CharacterCodes2[CharacterCodes2["f"]=102]="f";CharacterCodes2[CharacterCodes2["g"]=103]="g";CharacterCodes2[CharacterCodes2["h"]=104]="h";CharacterCodes2[CharacterCodes2["i"]=105]="i";CharacterCodes2[CharacterCodes2["j"]=106]="j";CharacterCodes2[CharacterCodes2["k"]=107]="k";CharacterCodes2[CharacterCodes2["l"]=108]="l";CharacterCodes2[CharacterCodes2["m"]=109]="m";CharacterCodes2[CharacterCodes2["n"]=110]="n";CharacterCodes2[CharacterCodes2["o"]=111]="o";CharacterCodes2[CharacterCodes2["p"]=112]="p";CharacterCodes2[CharacterCodes2["q"]=113]="q";CharacterCodes2[CharacterCodes2["r"]=114]="r";CharacterCodes2[CharacterCodes2["s"]=115]="s";CharacterCodes2[CharacterCodes2["t"]=116]="t";CharacterCodes2[CharacterCodes2["u"]=117]="u";CharacterCodes2[CharacterCodes2["v"]=118]="v";CharacterCodes2[CharacterCodes2["w"]=119]="w";CharacterCodes2[CharacterCodes2["x"]=120]="x";CharacterCodes2[CharacterCodes2["y"]=121]="y";CharacterCodes2[CharacterCodes2["z"]=122]="z";CharacterCodes2[CharacterCodes2["A"]=65]="A";CharacterCodes2[CharacterCodes2["B"]=66]="B";CharacterCodes2[CharacterCodes2["C"]=67]="C";CharacterCodes2[CharacterCodes2["D"]=68]="D";CharacterCodes2[CharacterCodes2["E"]=69]="E";CharacterCodes2[CharacterCodes2["F"]=70]="F";CharacterCodes2[CharacterCodes2["G"]=71]="G";CharacterCodes2[CharacterCodes2["H"]=72]="H";CharacterCodes2[CharacterCodes2["I"]=73]="I";CharacterCodes2[CharacterCodes2["J"]=74]="J";CharacterCodes2[CharacterCodes2["K"]=75]="K";CharacterCodes2[CharacterCodes2["L"]=76]="L";CharacterCodes2[CharacterCodes2["M"]=77]="M";CharacterCodes2[CharacterCodes2["N"]=78]="N";CharacterCodes2[CharacterCodes2["O"]=79]="O";CharacterCodes2[CharacterCodes2["P"]=80]="P";CharacterCodes2[CharacterCodes2["Q"]=81]="Q";CharacterCodes2[CharacterCodes2["R"]=82]="R";CharacterCodes2[CharacterCodes2["S"]=83]="S";CharacterCodes2[CharacterCodes2["T"]=84]="T";CharacterCodes2[CharacterCodes2["U"]=85]="U";CharacterCodes2[CharacterCodes2["V"]=86]="V";CharacterCodes2[CharacterCodes2["W"]=87]="W";CharacterCodes2[CharacterCodes2["X"]=88]="X";CharacterCodes2[CharacterCodes2["Y"]=89]="Y";CharacterCodes2[CharacterCodes2["Z"]=90]="Z";CharacterCodes2[CharacterCodes2["asterisk"]=42]="asterisk";CharacterCodes2[CharacterCodes2["backslash"]=92]="backslash";CharacterCodes2[CharacterCodes2["closeBrace"]=125]="closeBrace";CharacterCodes2[CharacterCodes2["closeBracket"]=93]="closeBracket";CharacterCodes2[CharacterCodes2["colon"]=58]="colon";CharacterCodes2[CharacterCodes2["comma"]=44]="comma";CharacterCodes2[CharacterCodes2["dot"]=46]="dot";CharacterCodes2[CharacterCodes2["doubleQuote"]=34]="doubleQuote";CharacterCodes2[CharacterCodes2["minus"]=45]="minus";CharacterCodes2[CharacterCodes2["openBrace"]=123]="openBrace";CharacterCodes2[CharacterCodes2["openBracket"]=91]="openBracket";CharacterCodes2[CharacterCodes2["plus"]=43]="plus";CharacterCodes2[CharacterCodes2["slash"]=47]="slash";CharacterCodes2[CharacterCodes2["formFeed"]=12]="formFeed";CharacterCodes2[CharacterCodes2["tab"]=9]="tab"})(CharacterCodes||(CharacterCodes={}));init_esbuild_shims();var cachedSpaces=new Array(20).fill(0).map((_,index)=>{return" ".repeat(index)});var maxCachedValues=200;var cachedBreakLinesWithSpaces={" ":{"\n":new Array(maxCachedValues).fill(0).map((_,index)=>{return"\n"+" ".repeat(index)}),"\r":new Array(maxCachedValues).fill(0).map((_,index)=>{return"\r"+" ".repeat(index)}),"\r\n":new Array(maxCachedValues).fill(0).map((_,index)=>{return"\r\n"+" ".repeat(index)})}," ":{"\n":new Array(maxCachedValues).fill(0).map((_,index)=>{return"\n"+" ".repeat(index)}),"\r":new Array(maxCachedValues).fill(0).map((_,index)=>{return"\r"+" ".repeat(index)}),"\r\n":new Array(maxCachedValues).fill(0).map((_,index)=>{return"\r\n"+" ".repeat(index)})}};var supportedEols=["\n","\r","\r\n"];function format(documentText,range,options){let initialIndentLevel;let formatText;let formatTextStart;let rangeStart;let rangeEnd;if(range){rangeStart=range.offset;rangeEnd=rangeStart+range.length;formatTextStart=rangeStart;while(formatTextStart>0&&!isEOL(documentText,formatTextStart-1)){formatTextStart--}let endOffset=rangeEnd;while(endOffset<documentText.length&&!isEOL(documentText,endOffset)){endOffset++}formatText=documentText.substring(formatTextStart,endOffset);initialIndentLevel=computeIndentLevel(formatText,options)}else{formatText=documentText;initialIndentLevel=0;formatTextStart=0;rangeStart=0;rangeEnd=documentText.length}const eol=getEOL(options,documentText);const eolFastPathSupported=supportedEols.includes(eol);let numberLineBreaks=0;let indentLevel=0;let indentValue;if(options.insertSpaces){indentValue=cachedSpaces[options.tabSize||4]??repeat(cachedSpaces[1],options.tabSize||4)}else{indentValue=" "}const indentType=indentValue===" "?" ":" ";let scanner=createScanner(formatText,false);let hasError=false;function newLinesAndIndent(){if(numberLineBreaks>1){return repeat(eol,numberLineBreaks)+repeat(indentValue,initialIndentLevel+indentLevel)}const amountOfSpaces=indentValue.length*(initialIndentLevel+indentLevel);if(!eolFastPathSupported||amountOfSpaces>cachedBreakLinesWithSpaces[indentType][eol].length){return eol+repeat(indentValue,initialIndentLevel+indentLevel)}if(amountOfSpaces<=0){return eol}return cachedBreakLinesWithSpaces[indentType][eol][amountOfSpaces]}__name(newLinesAndIndent,"newLinesAndIndent");function scanNext(){let token=scanner.scan();numberLineBreaks=0;while(token===15||token===14){if(token===14&&options.keepLines){numberLineBreaks+=1}else if(token===14){numberLineBreaks=1}token=scanner.scan()}hasError=token===16||scanner.getTokenError()!==0;return token}__name(scanNext,"scanNext");const editOperations=[];function addEdit(text,startOffset,endOffset){if(!hasError&&(!range||startOffset<rangeEnd&&endOffset>rangeStart)&&documentText.substring(startOffset,endOffset)!==text){editOperations.push({offset:startOffset,length:endOffset-startOffset,content:text})}}__name(addEdit,"addEdit");let firstToken=scanNext();if(options.keepLines&&numberLineBreaks>0){addEdit(repeat(eol,numberLineBreaks),0,0)}if(firstToken!==17){let firstTokenStart=scanner.getTokenOffset()+formatTextStart;let initialIndent=indentValue.length*initialIndentLevel<20&&options.insertSpaces?cachedSpaces[indentValue.length*initialIndentLevel]:repeat(indentValue,initialIndentLevel);addEdit(initialIndent,formatTextStart,firstTokenStart)}while(firstToken!==17){let firstTokenEnd=scanner.getTokenOffset()+scanner.getTokenLength()+formatTextStart;let secondToken=scanNext();let replaceContent="";let needsLineBreak=false;while(numberLineBreaks===0&&(secondToken===12||secondToken===13)){let commentTokenStart=scanner.getTokenOffset()+formatTextStart;addEdit(cachedSpaces[1],firstTokenEnd,commentTokenStart);firstTokenEnd=scanner.getTokenOffset()+scanner.getTokenLength()+formatTextStart;needsLineBreak=secondToken===12;replaceContent=needsLineBreak?newLinesAndIndent():"";secondToken=scanNext()}if(secondToken===2){if(firstToken!==1){indentLevel--};if(options.keepLines&&numberLineBreaks>0||!options.keepLines&&firstToken!==1){replaceContent=newLinesAndIndent()}else if(options.keepLines){replaceContent=cachedSpaces[1]}}else if(secondToken===4){if(firstToken!==3){indentLevel--};if(options.keepLines&&numberLineBreaks>0||!options.keepLines&&firstToken!==3){replaceContent=newLinesAndIndent()}else if(options.keepLines){replaceContent=cachedSpaces[1]}}else{switch(firstToken){case 3:case 1:indentLevel++;if(options.keepLines&&numberLineBreaks>0||!options.keepLines){replaceContent=newLinesAndIndent()}else{replaceContent=cachedSpaces[1]}break;case 5:if(options.keepLines&&numberLineBreaks>0||!options.keepLines){replaceContent=newLinesAndIndent()}else{replaceContent=cachedSpaces[1]}break;case 12:replaceContent=newLinesAndIndent();break;case 13:if(numberLineBreaks>0){replaceContent=newLinesAndIndent()}else if(!needsLineBreak){replaceContent=cachedSpaces[1]}break;case 6:if(options.keepLines&&numberLineBreaks>0){replaceContent=newLinesAndIndent()}else if(!needsLineBreak){replaceContent=cachedSpaces[1]}break;case 10:if(options.keepLines&&numberLineBreaks>0){replaceContent=newLinesAndIndent()}else if(secondToken===6&&!needsLineBreak){replaceContent=""}break;case 7:case 8:case 9:case 11:case 2:case 4:if(options.keepLines&&numberLineBreaks>0){replaceContent=newLinesAndIndent()}else{if((secondToken===12||secondToken===13)&&!needsLineBreak){replaceContent=cachedSpaces[1]}else if(secondToken!==5&&secondToken!==17){hasError=true}}break;case 16:hasError=true;break}if(numberLineBreaks>0&&(secondToken===12||secondToken===13)){replaceContent=newLinesAndIndent()}}if(secondToken===17){if(options.keepLines&&numberLineBreaks>0){replaceContent=newLinesAndIndent()}else{replaceContent=options.insertFinalNewline?eol:""}}const secondTokenStart=scanner.getTokenOffset()+formatTextStart;addEdit(replaceContent,firstTokenEnd,secondTokenStart);firstToken=secondToken}return editOperations}__name(format,"format");function repeat(s,count){let result="";for(let i=0;i<count;i++){result+=s}return result}__name(repeat,"repeat");function computeIndentLevel(content,options){let i=0;let nChars=0;const tabSize=options.tabSize||4;while(i<content.length){let ch=content.charAt(i);if(ch===cachedSpaces[1]){nChars++}else if(ch===" "){nChars+=tabSize}else{break}i++}return Math.floor(nChars/tabSize)}__name(computeIndentLevel,"computeIndentLevel");function getEOL(options,text){for(let i=0;i<text.length;i++){const ch=text.charAt(i);if(ch==="\r"){if(i+1<text.length&&text.charAt(i+1)==="\n"){return"\r\n"}return"\r"}else if(ch==="\n"){return"\n"}}return options&&options.eol||"\n"}__name(getEOL,"getEOL");function isEOL(text,offset){return"\r\n".indexOf(text.charAt(offset))!==-1}__name(isEOL,"isEOL");init_esbuild_shims();init_esbuild_shims();var ParseOptions;(function(ParseOptions2){ParseOptions2.DEFAULT={allowTrailingComma:false}})(ParseOptions||(ParseOptions={}));function parseTree(text,errors=[],options=ParseOptions.DEFAULT){let currentParent={type:"array",offset:-1,length:-1,children:[],parent:void 0};function ensurePropertyComplete(endOffset){if(currentParent.type==="property"){currentParent.length=endOffset-currentParent.offset;currentParent=currentParent.parent}}__name(ensurePropertyComplete,"ensurePropertyComplete");function onValue(valueNode){currentParent.children.push(valueNode);return valueNode}__name(onValue,"onValue");const visitor={onObjectBegin:__name(offset=>{currentParent=onValue({type:"object",offset,length:-1,parent:currentParent,children:[]})},"onObjectBegin"),onObjectProperty:__name((name,offset,length)=>{currentParent=onValue({type:"property",offset,length:-1,parent:currentParent,children:[]});currentParent.children.push({type:"string",value:name,offset,length,parent:currentParent})},"onObjectProperty"),onObjectEnd:__name((offset,length)=>{ensurePropertyComplete(offset+length);currentParent.length=offset+length-currentParent.offset;currentParent=currentParent.parent;ensurePropertyComplete(offset+length)},"onObjectEnd"),onArrayBegin:__name((offset,length)=>{currentParent=onValue({type:"array",offset,length:-1,parent:currentParent,children:[]})},"onArrayBegin"),onArrayEnd:__name((offset,length)=>{currentParent.length=offset+length-currentParent.offset;currentParent=currentParent.parent;ensurePropertyComplete(offset+length)},"onArrayEnd"),onLiteralValue:__name((value,offset,length)=>{onValue({type:getNodeType(value),offset,length,parent:currentParent,value});ensurePropertyComplete(offset+length)},"onLiteralValue"),onSeparator:__name((sep,offset,length)=>{if(currentParent.type==="property"){if(sep===":"){currentParent.colonOffset=offset}else if(sep===","){ensurePropertyComplete(offset)}}},"onSeparator"),onError:__name((error,offset,length)=>{errors.push({error,offset,length})},"onError")};visit(text,visitor,options);const result=currentParent.children[0];if(result){delete result.parent}return result}__name(parseTree,"parseTree");function findNodeAtLocation(root,path4){if(!root){return void 0}let node=root;for(let segment of path4){if(typeof segment==="string"){if(node.type!=="object"||!Array.isArray(node.children)){return void 0}let found=false;for(const propertyNode of node.children){if(Array.isArray(propertyNode.children)&&propertyNode.children[0].value===segment&&propertyNode.children.length===2){node=propertyNode.children[1];found=true;break}}if(!found){return void 0}}else{const index=segment;if(node.type!=="array"||index<0||!Array.isArray(node.children)||index>=node.children.length){return void 0}node=node.children[index]}}return node}__name(findNodeAtLocation,"findNodeAtLocation");function getNodeValue(node){switch(node.type){case"array":return node.children.map(getNodeValue);case"object":const obj=Object.create(null);for(let prop of node.children){const valueNode=prop.children[1];if(valueNode){obj[prop.children[0].value]=getNodeValue(valueNode)}}return obj;case"null":case"string":case"number":case"boolean":return node.value;default:return void 0}}__name(getNodeValue,"getNodeValue");function visit(text,visitor,options=ParseOptions.DEFAULT){const _scanner=createScanner(text,false);const _jsonPath=[];let suppressedCallbacks=0;function toNoArgVisit(visitFunction){return visitFunction?()=>suppressedCallbacks===0&&visitFunction(_scanner.getTokenOffset(),_scanner.getTokenLength(),_scanner.getTokenStartLine(),_scanner.getTokenStartCharacter()):()=>true}__name(toNoArgVisit,"toNoArgVisit");function toOneArgVisit(visitFunction){return visitFunction?arg=>suppressedCallbacks===0&&visitFunction(arg,_scanner.getTokenOffset(),_scanner.getTokenLength(),_scanner.getTokenStartLine(),_scanner.getTokenStartCharacter()):()=>true}__name(toOneArgVisit,"toOneArgVisit");function toOneArgVisitWithPath(visitFunction){return visitFunction?arg=>suppressedCallbacks===0&&visitFunction(arg,_scanner.getTokenOffset(),_scanner.getTokenLength(),_scanner.getTokenStartLine(),_scanner.getTokenStartCharacter(),()=>_jsonPath.slice()):()=>true}__name(toOneArgVisitWithPath,"toOneArgVisitWithPath");function toBeginVisit(visitFunction){return visitFunction?()=>{if(suppressedCallbacks>0){suppressedCallbacks++}else{let cbReturn=visitFunction(_scanner.getTokenOffset(),_scanner.getTokenLength(),_scanner.getTokenStartLine(),_scanner.getTokenStartCharacter(),()=>_jsonPath.slice());if(cbReturn===false){suppressedCallbacks=1}}}:()=>true}__name(toBeginVisit,"toBeginVisit");function toEndVisit(visitFunction){return visitFunction?()=>{if(suppressedCallbacks>0){suppressedCallbacks--}if(suppressedCallbacks===0){visitFunction(_scanner.getTokenOffset(),_scanner.getTokenLength(),_scanner.getTokenStartLine(),_scanner.getTokenStartCharacter())}}:()=>true}__name(toEndVisit,"toEndVisit");const onObjectBegin=toBeginVisit(visitor.onObjectBegin),onObjectProperty=toOneArgVisitWithPath(visitor.onObjectProperty),onObjectEnd=toEndVisit(visitor.onObjectEnd),onArrayBegin=toBeginVisit(visitor.onArrayBegin),onArrayEnd=toEndVisit(visitor.onArrayEnd),onLiteralValue=toOneArgVisitWithPath(visitor.onLiteralValue),onSeparator=toOneArgVisit(visitor.onSeparator),onComment=toNoArgVisit(visitor.onComment),onError=toOneArgVisit(visitor.onError);const disallowComments=options&&options.disallowComments;const allowTrailingComma=options&&options.allowTrailingComma;function scanNext(){while(true){const token=_scanner.scan();switch(_scanner.getTokenError()){case 4:handleError(14);break;case 5:handleError(15);break;case 3:handleError(13);break;case 1:if(!disallowComments){handleError(11)}break;case 2:handleError(12);break;case 6:handleError(16);break}switch(token){case 12:case 13:if(disallowComments){handleError(10)}else{onComment()}break;case 16:handleError(1);break;case 15:case 14:break;default:return token}}}__name(scanNext,"scanNext");function handleError(error,skipUntilAfter=[],skipUntil=[]){onError(error);if(skipUntilAfter.length+skipUntil.length>0){let token=_scanner.getToken();while(token!==17){if(skipUntilAfter.indexOf(token)!==-1){scanNext();break}else if(skipUntil.indexOf(token)!==-1){break}token=scanNext()}}}__name(handleError,"handleError");function parseString(isValue){const value=_scanner.getTokenValue();if(isValue){onLiteralValue(value)}else{onObjectProperty(value);_jsonPath.push(value)}scanNext();return true}__name(parseString,"parseString");function parseLiteral(){switch(_scanner.getToken()){case 11:const tokenValue=_scanner.getTokenValue();let value=Number(tokenValue);if(isNaN(value)){handleError(2);value=0}onLiteralValue(value);break;case 7:onLiteralValue(null);break;case 8:onLiteralValue(true);break;case 9:onLiteralValue(false);break;default:return false}scanNext();return true}__name(parseLiteral,"parseLiteral");function parseProperty(){if(_scanner.getToken()!==10){handleError(3,[],[2,5]);return false}parseString(false);if(_scanner.getToken()===6){onSeparator(":");scanNext();if(!parseValue()){handleError(4,[],[2,5])}}else{handleError(5,[],[2,5])}_jsonPath.pop();return true}__name(parseProperty,"parseProperty");function parseObject(){onObjectBegin();scanNext();let needsComma=false;while(_scanner.getToken()!==2&&_scanner.getToken()!==17){if(_scanner.getToken()===5){if(!needsComma){handleError(4,[],[])}onSeparator(",");scanNext();if(_scanner.getToken()===2&&allowTrailingComma){break}}else if(needsComma){handleError(6,[],[])}if(!parseProperty()){handleError(4,[],[2,5])}needsComma=true}onObjectEnd();if(_scanner.getToken()!==2){handleError(7,[2],[])}else{scanNext()}return true}__name(parseObject,"parseObject");function parseArray(){onArrayBegin();scanNext();let isFirstElement=true;let needsComma=false;while(_scanner.getToken()!==4&&_scanner.getToken()!==17){if(_scanner.getToken()===5){if(!needsComma){handleError(4,[],[])}onSeparator(",");scanNext();if(_scanner.getToken()===4&&allowTrailingComma){break}}else if(needsComma){handleError(6,[],[])}if(isFirstElement){_jsonPath.push(0);isFirstElement=false}else{_jsonPath[_jsonPath.length-1]++}if(!parseValue()){handleError(4,[],[4,5])}needsComma=true}onArrayEnd();if(!isFirstElement){_jsonPath.pop()}if(_scanner.getToken()!==4){handleError(8,[4],[])}else{scanNext()}return true}__name(parseArray,"parseArray");function parseValue(){switch(_scanner.getToken()){case 3:return parseArray();case 1:return parseObject();case 10:return parseString(true);default:return parseLiteral()}}__name(parseValue,"parseValue");scanNext();if(_scanner.getToken()===17){if(options.allowEmptyContent){return true}handleError(4,[],[]);return false}if(!parseValue()){handleError(4,[],[]);return false}if(_scanner.getToken()!==17){handleError(9,[],[])}return true}__name(visit,"visit");function getNodeType(value){switch(typeof value){case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"object":{if(!value){return"null"}else if(Array.isArray(value)){return"array"}return"object"}default:return"null"}}__name(getNodeType,"getNodeType");function setProperty(text,originalPath,value,options){const path4=originalPath.slice();const errors=[];const root=parseTree(text,errors);let parent=void 0;let lastSegment=void 0;while(path4.length>0){lastSegment=path4.pop();parent=findNodeAtLocation(root,path4);if(parent===void 0&&value!==void 0){if(typeof lastSegment==="string"){value={[lastSegment]:value}}else{value=[value]}}else{break}}if(!parent){if(value===void 0){throw new Error("Can not delete in empty document")}return withFormatting(text,{offset:root?root.offset:0,length:root?root.length:0,content:JSON.stringify(value)},options)}else if(parent.type==="object"&&typeof lastSegment==="string"&&Array.isArray(parent.children)){const existing=findNodeAtLocation(parent,[lastSegment]);if(existing!==void 0){if(value===void 0){if(!existing.parent){throw new Error("Malformed AST")}const propertyIndex=parent.children.indexOf(existing.parent);let removeBegin;let removeEnd=existing.parent.offset+existing.parent.length;if(propertyIndex>0){let previous=parent.children[propertyIndex-1];removeBegin=previous.offset+previous.length}else{removeBegin=parent.offset+1;if(parent.children.length>1){let next=parent.children[1];removeEnd=next.offset}}return withFormatting(text,{offset:removeBegin,length:removeEnd-removeBegin,content:""},options)}else{return withFormatting(text,{offset:existing.offset,length:existing.length,content:JSON.stringify(value)},options)}}else{if(value===void 0){return[]}const newProperty=`${JSON.stringify(lastSegment)}: ${JSON.stringify(value)}`;const index=options.getInsertionIndex?options.getInsertionIndex(parent.children.map(p=>p.children[0].value)):parent.children.length;let edit;if(index>0){let previous=parent.children[index-1];edit={offset:previous.offset+previous.length,length:0,content:","+newProperty}}else if(parent.children.length===0){edit={offset:parent.offset+1,length:0,content:newProperty}}else{edit={offset:parent.offset+1,length:0,content:newProperty+","}}return withFormatting(text,edit,options)}}else if(parent.type==="array"&&typeof lastSegment==="number"&&Array.isArray(parent.children)){const insertIndex=lastSegment;if(insertIndex===-1){const newProperty=`${JSON.stringify(value)}`;let edit;if(parent.children.length===0){edit={offset:parent.offset+1,length:0,content:newProperty}}else{const previous=parent.children[parent.children.length-1];edit={offset:previous.offset+previous.length,length:0,content:","+newProperty}}return withFormatting(text,edit,options)}else if(value===void 0&&parent.children.length>=0){const removalIndex=lastSegment;const toRemove=parent.children[removalIndex];let edit;if(parent.children.length===1){edit={offset:parent.offset+1,length:parent.length-2,content:""}}else if(parent.children.length-1===removalIndex){let previous=parent.children[removalIndex-1];let offset=previous.offset+previous.length;let parentEndOffset=parent.offset+parent.length;edit={offset,length:parentEndOffset-2-offset,content:""}}else{edit={offset:toRemove.offset,length:parent.children[removalIndex+1].offset-toRemove.offset,content:""}}return withFormatting(text,edit,options)}else if(value!==void 0){let edit;const newProperty=`${JSON.stringify(value)}`;if(!options.isArrayInsertion&&parent.children.length>lastSegment){const toModify=parent.children[lastSegment];edit={offset:toModify.offset,length:toModify.length,content:newProperty}}else if(parent.children.length===0||lastSegment===0){edit={offset:parent.offset+1,length:0,content:parent.children.length===0?newProperty:newProperty+","}}else{const index=lastSegment>parent.children.length?parent.children.length:lastSegment;const previous=parent.children[index-1];edit={offset:previous.offset+previous.length,length:0,content:","+newProperty}}return withFormatting(text,edit,options)}else{throw new Error(`Can not ${value===void 0?"remove":options.isArrayInsertion?"insert":"modify"} Array index ${insertIndex} as length is not sufficient`)}}else{throw new Error(`Can not add ${typeof lastSegment!=="number"?"index":"property"} to parent of type ${parent.type}`)}}__name(setProperty,"setProperty");function withFormatting(text,edit,options){if(!options.formattingOptions){return[edit]}let newText=applyEdit(text,edit);let begin=edit.offset;let end=edit.offset+edit.content.length;if(edit.length===0||edit.content.length===0){while(begin>0&&!isEOL(newText,begin-1)){begin--}while(end<newText.length&&!isEOL(newText,end)){end++}}const edits=format(newText,{offset:begin,length:end-begin},{...options.formattingOptions,keepLines:false});for(let i=edits.length-1;i>=0;i--){const edit2=edits[i];newText=applyEdit(newText,edit2);begin=Math.min(begin,edit2.offset);end=Math.max(end,edit2.offset+edit2.length);end+=edit2.content.length-edit2.length}const editLength=text.length-(newText.length-end)-begin;return[{offset:begin,length:editLength,content:newText.substring(begin,end)}]}__name(withFormatting,"withFormatting");function applyEdit(text,edit){return text.substring(0,edit.offset)+edit.content+text.substring(edit.offset+edit.length)}__name(applyEdit,"applyEdit");var ScanError;(function(ScanError2){ScanError2[ScanError2["None"]=0]="None";ScanError2[ScanError2["UnexpectedEndOfComment"]=1]="UnexpectedEndOfComment";ScanError2[ScanError2["UnexpectedEndOfString"]=2]="UnexpectedEndOfString";ScanError2[ScanError2["UnexpectedEndOfNumber"]=3]="UnexpectedEndOfNumber";ScanError2[ScanError2["InvalidUnicode"]=4]="InvalidUnicode";ScanError2[ScanError2["InvalidEscapeCharacter"]=5]="InvalidEscapeCharacter";ScanError2[ScanError2["InvalidCharacter"]=6]="InvalidCharacter"})(ScanError||(ScanError={}));var SyntaxKind;(function(SyntaxKind2){SyntaxKind2[SyntaxKind2["OpenBraceToken"]=1]="OpenBraceToken";SyntaxKind2[SyntaxKind2["CloseBraceToken"]=2]="CloseBraceToken";SyntaxKind2[SyntaxKind2["OpenBracketToken"]=3]="OpenBracketToken";SyntaxKind2[SyntaxKind2["CloseBracketToken"]=4]="CloseBracketToken";SyntaxKind2[SyntaxKind2["CommaToken"]=5]="CommaToken";SyntaxKind2[SyntaxKind2["ColonToken"]=6]="ColonToken";SyntaxKind2[SyntaxKind2["NullKeyword"]=7]="NullKeyword";SyntaxKind2[SyntaxKind2["TrueKeyword"]=8]="TrueKeyword";SyntaxKind2[SyntaxKind2["FalseKeyword"]=9]="FalseKeyword";SyntaxKind2[SyntaxKind2["StringLiteral"]=10]="StringLiteral";SyntaxKind2[SyntaxKind2["NumericLiteral"]=11]="NumericLiteral";SyntaxKind2[SyntaxKind2["LineCommentTrivia"]=12]="LineCommentTrivia";SyntaxKind2[SyntaxKind2["BlockCommentTrivia"]=13]="BlockCommentTrivia";SyntaxKind2[SyntaxKind2["LineBreakTrivia"]=14]="LineBreakTrivia";SyntaxKind2[SyntaxKind2["Trivia"]=15]="Trivia";SyntaxKind2[SyntaxKind2["Unknown"]=16]="Unknown";SyntaxKind2[SyntaxKind2["EOF"]=17]="EOF"})(SyntaxKind||(SyntaxKind={}));var parseTree2=parseTree;var findNodeAtLocation2=findNodeAtLocation;var getNodeValue2=getNodeValue;var ParseErrorCode;(function(ParseErrorCode2){ParseErrorCode2[ParseErrorCode2["InvalidSymbol"]=1]="InvalidSymbol";ParseErrorCode2[ParseErrorCode2["InvalidNumberFormat"]=2]="InvalidNumberFormat";ParseErrorCode2[ParseErrorCode2["PropertyNameExpected"]=3]="PropertyNameExpected";ParseErrorCode2[ParseErrorCode2["ValueExpected"]=4]="ValueExpected";ParseErrorCode2[ParseErrorCode2["ColonExpected"]=5]="ColonExpected";ParseErrorCode2[ParseErrorCode2["CommaExpected"]=6]="CommaExpected";ParseErrorCode2[ParseErrorCode2["CloseBraceExpected"]=7]="CloseBraceExpected";ParseErrorCode2[ParseErrorCode2["CloseBracketExpected"]=8]="CloseBracketExpected";ParseErrorCode2[ParseErrorCode2["EndOfFileExpected"]=9]="EndOfFileExpected";ParseErrorCode2[ParseErrorCode2["InvalidCommentToken"]=10]="InvalidCommentToken";ParseErrorCode2[ParseErrorCode2["UnexpectedEndOfComment"]=11]="UnexpectedEndOfComment";ParseErrorCode2[ParseErrorCode2["UnexpectedEndOfString"]=12]="UnexpectedEndOfString";ParseErrorCode2[ParseErrorCode2["UnexpectedEndOfNumber"]=13]="UnexpectedEndOfNumber";ParseErrorCode2[ParseErrorCode2["InvalidUnicode"]=14]="InvalidUnicode";ParseErrorCode2[ParseErrorCode2["InvalidEscapeCharacter"]=15]="InvalidEscapeCharacter";ParseErrorCode2[ParseErrorCode2["InvalidCharacter"]=16]="InvalidCharacter"})(ParseErrorCode||(ParseErrorCode={}));function printParseErrorCode(code){switch(code){case 1:return"InvalidSymbol";case 2:return"InvalidNumberFormat";case 3:return"PropertyNameExpected";case 4:return"ValueExpected";case 5:return"ColonExpected";case 6:return"CommaExpected";case 7:return"CloseBraceExpected";case 8:return"CloseBracketExpected";case 9:return"EndOfFileExpected";case 10:return"InvalidCommentToken";case 11:return"UnexpectedEndOfComment";case 12:return"UnexpectedEndOfString";case 13:return"UnexpectedEndOfNumber";case 14:return"InvalidUnicode";case 15:return"InvalidEscapeCharacter";case 16:return"InvalidCharacter"}return"<unknown ParseErrorCode>"}__name(printParseErrorCode,"printParseErrorCode");function modify(text,path4,value,options){return setProperty(text,path4,value,options)}__name(modify,"modify");function applyEdits(text,edits){let sortedEdits=edits.slice(0).sort((a,b)=>{const diff=a.offset-b.offset;if(diff===0){return a.length-b.length}return diff});let lastModifiedOffset=text.length;for(let i=sortedEdits.length-1;i>=0;i--){let e=sortedEdits[i];if(e.offset+e.length<=lastModifiedOffset){text=applyEdit(text,e)}else{throw new Error("Overlapping edit")}lastModifiedOffset=e.offset}return text}__name(applyEdits,"applyEdits");init_esbuild_shims();import*as fs from"node:fs";import path from"node:path";function writeWithBackupSync(targetPath,content,options={}){const{backupSuffix=".orig",encoding="utf-8"}=options;const existing=fs.existsSync(targetPath)?fs.statSync(targetPath):void 0;if(existing?.isDirectory()){throw new Error(`Cannot write to '${targetPath}' because it is a directory`)}const workingDirectory=fs.mkdtempSync(`${targetPath}.write-`);const basename=path.basename(targetPath);const tempPath=path.join(workingDirectory,`${basename}.tmp`);const backupPath=path.join(workingDirectory,`${basename}${backupSuffix}`);let backupCreated=false;try{const mode=existing&&fs.lstatSync(targetPath,{throwIfNoEntry:false})?.isFile()?existing.mode&511:void 0;fs.writeFileSync(tempPath,content,{encoding,flag:"wx",flush:true,mode});if(mode!==void 0){try{fs.chmodSync(tempPath,mode)}catch(error){const code=error instanceof Error&&"code"in error?error.code:void 0;if(code!=="ENOSYS"&&code!=="ENOTSUP"&&code!=="EPERM"||(fs.statSync(tempPath).mode&511&~mode)!==0){throw error}}}if(fs.existsSync(targetPath)){try{fs.copyFileSync(targetPath,backupPath,fs.constants.COPYFILE_EXCL);backupCreated=true}catch(backupError){throw new Error(`Failed to backup existing file: ${backupError instanceof Error?backupError.message:String(backupError)}`)}}fs.renameSync(tempPath,targetPath)}catch(error){const recoveryRetained=backupCreated&&!sameContents(backupPath,targetPath);try{if(recoveryRetained){fs.unlinkSync(tempPath)}else{fs.rmSync(workingDirectory,{recursive:true,force:true})}}catch{}if(recoveryRetained){throw new Error(`Failed to write file: ${error instanceof Error?error.message:String(error)}. Recovery copy retained at '${backupPath}'; inspect the current target before restoring it.`)}throw error}try{fs.rmSync(workingDirectory,{recursive:true,force:true})}catch{}}__name(writeWithBackupSync,"writeWithBackupSync");function sameContents(first,second){try{return fs.readFileSync(first).equals(fs.readFileSync(second))}catch{return false}}__name(sameContents,"sameContents");var PARSE_OPTIONS={allowTrailingComma:true};function updateSettingsFilePreservingFormat(filePath,updates,sync=false,replacePath=[]){if(!fs2.existsSync(filePath)){const content=JSON.stringify(updates,null,2);writeWithBackupSync(filePath,content);return true}const originalContent=fs2.readFileSync(filePath,"utf-8");try{parseJsoncObject(originalContent)}catch(_error){writeStderrLine("Error parsing settings file.");writeStderrLine(`Settings file may be corrupted: ${_error instanceof Error?_error.message:String(_error)}`);return false}let updatedContent;try{updatedContent=updateJsoncContent(originalContent,updates,sync,replacePath)}catch(validationError){writeStderrLine("Error: Refusing to write settings file \u2014 the result would not be valid JSON.");writeStderrLine(validationError instanceof Error?validationError.message:String(validationError));return false}writeWithBackupSync(filePath,updatedContent);return true}__name(updateSettingsFilePreservingFormat,"updateSettingsFilePreservingFormat");function parseJsoncObject(content){const errors=[];const root=parseTree2(stripBom(content),errors,PARSE_OPTIONS);if(errors.length>0){const error=errors[0];throw new Error(`${printParseErrorCode(error.error)} at offset ${error.offset}`)}if(root?.type!=="object"){throw new Error("JSONC document root is not a JSON object.")}return JSON.parse(JSON.stringify(getNodeValue2(root)))}__name(parseJsoncObject,"parseJsoncObject");function updateJsoncContent(content,updates,sync=false,replacePath=[]){const bom=content.startsWith("\uFEFF")?"\uFEFF":"";const editableContent=stripBom(content);const parsed=parseJsoncObject(editableContent);const targetWithUndefined=applyUpdates(structuredClone(parsed),updates,sync,replacePath);const target=JSON.parse(JSON.stringify(targetWithUndefined));const options={formattingOptions:detectFormattingOptions(editableContent)};let updated=normalizeDuplicateProperties(editableContent,options);const current=parseJsoncObject(updated);for(const operation of collectOperations(current,target)){if(operation.value===void 0){updated=removeTrailingInlineComment(updated,operation.path)}updated=applyEdits(updated,modify(updated,operation.path,operation.value,options))}const reparsed=parseJsoncObject(updated);if(!isDeepStrictEqual(reparsed,target)){throw new Error("Edited JSONC does not match the intended settings.")}return bom+updated}__name(updateJsoncContent,"updateJsoncContent");function applyUpdates(current,updates,sync=false,replacePath=[],currentPath=[]){const result=current;if(sync){const keysToRemove=Object.keys(result).filter(key=>!Object.hasOwn(updates,key));for(const key of keysToRemove){delete result[key]}}for(const key of Object.getOwnPropertyNames(updates)){if(key==="__proto__"||key==="constructor"||key==="prototype"){continue}const value=updates[key];const nextPath=[...currentPath,key];const valueIsObject=typeof value==="object"&&value!==null&&!Array.isArray(value)&&Object.keys(value).length>0;if(pathsEqual(nextPath,replacePath)){result[key]=valueIsObject?applyUpdates({},value):value;continue}if(valueIsObject&&(typeof result[key]!=="object"||result[key]===null||Array.isArray(result[key]))){result[key]=applyUpdates({},value,sync,replacePath,nextPath)}else if(valueIsObject&&typeof result[key]==="object"&&result[key]!==null&&!Array.isArray(result[key])){result[key]=applyUpdates(result[key],value,sync,replacePath,nextPath)}else{result[key]=value}}return result}__name(applyUpdates,"applyUpdates");function stripBom(content){return content.startsWith("\uFEFF")?content.slice(1):content}__name(stripBom,"stripBom");function isRecord(value){return typeof value==="object"&&value!==null&&!Array.isArray(value)}__name(isRecord,"isRecord");function detectFormattingOptions(content){const root=parseTree2(content,[],PARSE_OPTIONS);const firstKey=root?.children?.[0]?.children?.[0];const lineStart=firstKey===void 0?-1:content.lastIndexOf("\n",firstKey.offset-1);const candidate=firstKey===void 0?void 0:content.slice(lineStart+1,firstKey.offset);const indentation=candidate!==void 0&&/^[ \t]*$/.test(candidate)?candidate:" ";return{eol:content.includes("\r\n")?"\r\n":"\n",insertSpaces:!indentation.startsWith(" "),tabSize:indentation.startsWith(" ")?1:indentation.length,insertFinalNewline:content.endsWith("\n")}}__name(detectFormattingOptions,"detectFormattingOptions");function collectOperations(current,target,path4=[],operations=[]){for(const key of Object.keys(current)){if(!Object.hasOwn(target,key)){operations.push({path:[...path4,key],value:void 0})}}for(const key of Object.keys(target)){const nextPath=[...path4,key];if(!Object.hasOwn(current,key)){operations.push({path:nextPath,value:target[key]})}else if(isRecord(current[key])&&isRecord(target[key])){collectOperations(current[key],target[key],nextPath,operations)}else if(!isDeepStrictEqual(current[key],target[key])){operations.push({path:nextPath,value:target[key]})}}return operations}__name(collectOperations,"collectOperations");function findDuplicateProperty(node,path4=[]){if(node.type!=="object"||node.children===void 0){return void 0}const properties=new Map;for(const property of node.children){const keyNode=property.children?.[0];const key=keyNode?.value;if(typeof key!=="string"||keyNode===void 0){continue}const previous=properties.get(key);if(previous!==void 0){return{objectPath:[...path4],keyNode:previous,propertyNames:new Set(properties.keys())}}properties.set(key,keyNode)}for(const property of node.children){const key=property.children?.[0]?.value;const valueNode=property.children?.[1];if(typeof key!=="string"||valueNode===void 0){continue}const duplicate=findDuplicateProperty(valueNode,[...path4,key]);if(duplicate!==void 0){return duplicate}}return void 0}__name(findDuplicateProperty,"findDuplicateProperty");function normalizeDuplicateProperties(content,options){let normalized=content;let duplicateIndex=0;while(true){const root=parseTree2(normalized,[],PARSE_OPTIONS);if(root===void 0){return normalized}const duplicate=findDuplicateProperty(root);if(duplicate===void 0){return normalized}let temporaryKey;do{temporaryKey=`__qwen_duplicate_${duplicateIndex}`;duplicateIndex+=1}while(duplicate.propertyNames.has(temporaryKey));let renamed=normalized.slice(0,duplicate.keyNode.offset)+JSON.stringify(temporaryKey)+normalized.slice(duplicate.keyNode.offset+duplicate.keyNode.length);renamed=removeTrailingInlineComment(renamed,[...duplicate.objectPath,temporaryKey]);normalized=applyEdits(renamed,modify(renamed,[...duplicate.objectPath,temporaryKey],void 0,options))}}__name(normalizeDuplicateProperties,"normalizeDuplicateProperties");function removeTrailingInlineComment(content,path4){const root=parseTree2(content,[],PARSE_OPTIONS);if(root===void 0){return content}const node=findNodeAtLocation2(root,[...path4]);if(node===void 0){return content}const tail=content.slice(node.offset+node.length);const match=tail.match(/^[ \t]*(?:,[ \t]*)?(\/\/[^\r\n]*|\/\*[\s\S]*?\*\/)/);const comment=match?.[1];if(comment===void 0||match===null){return content}const commentOffset=node.offset+node.length+match[0].indexOf(comment);return content.slice(0,commentOffset)+content.slice(commentOffset+comment.length)}__name(removeTrailingInlineComment,"removeTrailingInlineComment");function pathsEqual(left,right){return left.length===right.length&&left.every((segment,index)=>segment===right[index])}__name(pathsEqual,"pathsEqual");init_esbuild_shims();import*as fs3 from"node:fs";import*as path2 from"node:path";function isWorkflowAncestorDirectorySafe(directory){if(process.platform==="win32")return true;for(const location of[directory,path2.join(directory,".qwen"),path2.join(directory,".qwen","workflows")]){try{if((fs3.statSync(location).mode&2)!==0)return false}catch(error){const code=error.code;if(location===directory)return false;if(code==="ENOENT"||code==="ENOTDIR")break;return false}}return true}__name(isWorkflowAncestorDirectorySafe,"isWorkflowAncestorDirectorySafe");var debugLogger=createDebugLogger("TRUSTED_FOLDERS");var TRUSTED_FOLDERS_FILENAME="trustedFolders.json";function getTrustedFoldersPath(){if(process.env["QWEN_CODE_TRUSTED_FOLDERS_PATH"]){return process.env["QWEN_CODE_TRUSTED_FOLDERS_PATH"]}return path3.join(Storage.getGlobalQwenDir(),TRUSTED_FOLDERS_FILENAME)}__name(getTrustedFoldersPath,"getTrustedFoldersPath");var TrustLevel=(TrustLevel2=>{TrustLevel2["TRUST_FOLDER"]="TRUST_FOLDER";TrustLevel2["TRUST_PARENT"]="TRUST_PARENT";TrustLevel2["DO_NOT_TRUST"]="DO_NOT_TRUST";return TrustLevel2})(TrustLevel||{});var trustedFoldersChangeListeners=new Set;function onTrustedFoldersChanged(listener){trustedFoldersChangeListeners.add(listener);return()=>trustedFoldersChangeListeners.delete(listener)}__name(onTrustedFoldersChanged,"onTrustedFoldersChanged");function notifyTrustedFoldersChanged(){for(const listener of trustedFoldersChangeListeners)listener()}__name(notifyTrustedFoldersChanged,"notifyTrustedFoldersChanged");var LoadedTrustedFolders=class{constructor(user,errors){this.user=user;this.errors=errors}static{__name(this,"LoadedTrustedFolders")}get rules(){return Object.entries(this.user.config).map(([path4,trustLevel])=>({path:path4,trustLevel}))}isPathTrusted(location){return resolveTrustDecision(buildTrustPrecedenceRules(this.rules),getPathComparisonVariants(location))}setValue(path4,trustLevel,preserveExistingTrust=false){const committedConfig=writeTrustedFolders(this.user.path,diskConfig=>{const existing=diskConfig[path4];if(preserveExistingTrust&&(existing==="TRUST_FOLDER"||existing==="TRUST_PARENT")){return diskConfig}return{...diskConfig,[path4]:trustLevel}});this.user.config=committedConfig;notifyTrustedFoldersChanged()}};var loadedTrustedFolders;function resetTrustedFoldersForTesting(){loadedTrustedFolders=void 0}__name(resetTrustedFoldersForTesting,"resetTrustedFoldersForTesting");function loadTrustedFolders(){loadedTrustedFolders??=readTrustedFoldersFile(false);return loadedTrustedFolders}__name(loadTrustedFolders,"loadTrustedFolders");function loadTrustedFoldersFresh(){return readTrustedFoldersFile(true)}__name(loadTrustedFoldersFresh,"loadTrustedFoldersFresh");function readTrustedFoldersFile(validateRules){const errors=[];let userConfig={};const userPath=getTrustedFoldersPath();try{if(fs4.existsSync(userPath)){const content=fs4.readFileSync(userPath,"utf-8");const parsed=parseJsoncObject(content);if(validateRules)assertTrustedFoldersConfig(parsed);userConfig=parsed}}catch(error){errors.push({message:error instanceof Error&&error.message==="JSONC document root is not a JSON object."?"Trusted folders file is not a valid JSON object.":getErrorMessage(error),path:userPath})}return new LoadedTrustedFolders({path:userPath,config:userConfig},errors)}__name(readTrustedFoldersFile,"readTrustedFoldersFile");function createLocalWorkflowAncestorTrustProvider(settings){return async(ancestorDirs,canonicalTargetDir)=>{if(!isFolderTrustEnabled(settings)){return ancestorDirs.map(isWorkflowAncestorDirectorySafe)}if(ideContextStore.get()?.workspaceState?.isTrusted===false){return ancestorDirs.map(()=>false)}const folders=loadTrustedFoldersFresh();if(folders.errors.length>0){debugLogger.warn("Workflow ancestor trust denied: invalid trusted folders snapshot:",folders.errors.map(error=>`${error.path}: ${error.message}`).join("; "));return ancestorDirs.map(()=>false)}if(folders.isPathTrusted(canonicalTargetDir)!==true){return ancestorDirs.map(()=>false)}return ancestorDirs.map(directory=>folders.isPathTrusted(directory)===true)}}__name(createLocalWorkflowAncestorTrustProvider,"createLocalWorkflowAncestorTrustProvider");function saveTrustedFolders(trustedFoldersFile){writeTrustedFolders(trustedFoldersFile.path,()=>({...trustedFoldersFile.config}))}__name(saveTrustedFolders,"saveTrustedFolders");function assertTrustedFoldersConfig(config){for(const[rulePath,trustLevel]of Object.entries(config)){if(!Object.values(TrustLevel).includes(trustLevel)){throw new FatalConfigError(`Invalid trusted folder rule for ${JSON.stringify(rulePath)}.`)}}}__name(assertTrustedFoldersConfig,"assertTrustedFoldersConfig");function writeTrustedFolders(filePath,update){const dirPath=path3.dirname(filePath);if(!fs4.existsSync(dirPath)){fs4.mkdirSync(dirPath,{recursive:true})}const release=import_proper_lockfile.default.lockSync(filePath,{realpath:false,stale:1e4,onCompromised:__name(err=>{debugLogger.warn("trusted folders lock compromised:",err)},"onCompromised")});try{let originalContent="{}";if(fs4.existsSync(filePath)){const stat=fs4.lstatSync(filePath);if(stat.isSymbolicLink()||!stat.isFile()){throw new FatalConfigError("Trusted folders path must be a regular file.")}originalContent=fs4.readFileSync(filePath,"utf-8")}let parsed;try{parsed=parseJsoncObject(originalContent)}catch(error){if(error instanceof Error&&error.message==="JSONC document root is not a JSON object."){throw new FatalConfigError("Trusted folders file is not a valid JSON object.")}throw error}const diskConfig=Object.fromEntries(Object.entries(parsed));assertTrustedFoldersConfig(diskConfig);const nextConfig=update({...diskConfig});assertTrustedFoldersConfig(nextConfig);const content=updateJsoncContent(originalContent,nextConfig,true);atomicWriteFileSync(filePath,content,{encoding:"utf-8",mode:384,forceMode:true,noFollow:true});return nextConfig}finally{try{release()}catch{}}}__name(writeTrustedFolders,"writeTrustedFolders");function isFolderTrustEnabled(settings){const folderTrustSetting=settings.security?.folderTrust?.enabled??false;return folderTrustSetting}__name(isFolderTrustEnabled,"isFolderTrustEnabled");function getExplicitTrustLevel(trustConfig,workspaceCwd){const winner=resolveTrustRule(buildTrustPrecedenceRules(Object.entries(trustConfig).map(([rulePath,trustLevel])=>({path:rulePath,trustLevel}))),getPathComparisonVariants(workspaceCwd));return winner?.payload??null}__name(getExplicitTrustLevel,"getExplicitTrustLevel");function loadTrustedFoldersWithOverrides(trustConfig){const folders=loadTrustedFolders();if(folders.errors.length>0){const errorMessages=folders.errors.map(error=>`Error in ${error.path}: ${error.message}`);throw new FatalConfigError(`${errorMessages.join("\n")}
|
|
3
|
+
import{buildTrustPrecedenceRules,resolveTrustDecision,resolveTrustRule}from"./chunk-EIPLDYEY.js";import{arePathsEquivalent,getPathComparisonVariants}from"./chunk-IDXJIDME.js";import{ideContextStore}from"./chunk-2JGTWRZJ.js";import{require_proper_lockfile}from"./chunk-YIW3H46P.js";import{atomicWriteFileSync}from"./chunk-BMHYEQTI.js";import{writeStderrLine}from"./chunk-M4ECEHLX.js";import{createDebugLogger}from"./chunk-JAUJI56S.js";import{Storage}from"./chunk-EPODBRBP.js";import{FatalConfigError,getErrorMessage}from"./chunk-XYB7GC5U.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*as fs4 from"node:fs";import*as path3 from"node:path";init_esbuild_shims();import*as fs2 from"node:fs";import{isDeepStrictEqual}from"node:util";init_esbuild_shims();init_esbuild_shims();init_esbuild_shims();function createScanner(text,ignoreTrivia=false){const len=text.length;let pos=0,value="",tokenOffset=0,token=16,lineNumber=0,lineStartOffset=0,tokenLineStartOffset=0,prevTokenLineStartOffset=0,scanError=0;function scanHexDigits(count,exact){let digits=0;let value2=0;while(digits<count||!exact){let ch=text.charCodeAt(pos);if(ch>=48&&ch<=57){value2=value2*16+ch-48}else if(ch>=65&&ch<=70){value2=value2*16+ch-65+10}else if(ch>=97&&ch<=102){value2=value2*16+ch-97+10}else{break}pos++;digits++}if(digits<count){value2=-1}return value2}__name(scanHexDigits,"scanHexDigits");function setPosition(newPosition){pos=newPosition;value="";tokenOffset=0;token=16;scanError=0}__name(setPosition,"setPosition");function scanNumber(){let start=pos;if(text.charCodeAt(pos)===48){pos++}else{pos++;while(pos<text.length&&isDigit(text.charCodeAt(pos))){pos++}}if(pos<text.length&&text.charCodeAt(pos)===46){pos++;if(pos<text.length&&isDigit(text.charCodeAt(pos))){pos++;while(pos<text.length&&isDigit(text.charCodeAt(pos))){pos++}}else{scanError=3;return text.substring(start,pos)}}let end=pos;if(pos<text.length&&(text.charCodeAt(pos)===69||text.charCodeAt(pos)===101)){pos++;if(pos<text.length&&text.charCodeAt(pos)===43||text.charCodeAt(pos)===45){pos++}if(pos<text.length&&isDigit(text.charCodeAt(pos))){pos++;while(pos<text.length&&isDigit(text.charCodeAt(pos))){pos++}end=pos}else{scanError=3}}return text.substring(start,end)}__name(scanNumber,"scanNumber");function scanString(){let result="",start=pos;while(true){if(pos>=len){result+=text.substring(start,pos);scanError=2;break}const ch=text.charCodeAt(pos);if(ch===34){result+=text.substring(start,pos);pos++;break}if(ch===92){result+=text.substring(start,pos);pos++;if(pos>=len){scanError=2;break}const ch2=text.charCodeAt(pos++);switch(ch2){case 34:result+='"';break;case 92:result+="\\";break;case 47:result+="/";break;case 98:result+="\b";break;case 102:result+="\f";break;case 110:result+="\n";break;case 114:result+="\r";break;case 116:result+=" ";break;case 117:const ch3=scanHexDigits(4,true);if(ch3>=0){result+=String.fromCharCode(ch3)}else{scanError=4}break;default:scanError=5}start=pos;continue}if(ch>=0&&ch<=31){if(isLineBreak(ch)){result+=text.substring(start,pos);scanError=2;break}else{scanError=6}}pos++}return result}__name(scanString,"scanString");function scanNext(){value="";scanError=0;tokenOffset=pos;lineStartOffset=lineNumber;prevTokenLineStartOffset=tokenLineStartOffset;if(pos>=len){tokenOffset=len;return token=17}let code=text.charCodeAt(pos);if(isWhiteSpace(code)){do{pos++;value+=String.fromCharCode(code);code=text.charCodeAt(pos)}while(isWhiteSpace(code));return token=15}if(isLineBreak(code)){pos++;value+=String.fromCharCode(code);if(code===13&&text.charCodeAt(pos)===10){pos++;value+="\n"}lineNumber++;tokenLineStartOffset=pos;return token=14}switch(code){case 123:pos++;return token=1;case 125:pos++;return token=2;case 91:pos++;return token=3;case 93:pos++;return token=4;case 58:pos++;return token=6;case 44:pos++;return token=5;case 34:pos++;value=scanString();return token=10;case 47:const start=pos-1;if(text.charCodeAt(pos+1)===47){pos+=2;while(pos<len){if(isLineBreak(text.charCodeAt(pos))){break}pos++}value=text.substring(start,pos);return token=12}if(text.charCodeAt(pos+1)===42){pos+=2;const safeLength=len-1;let commentClosed=false;while(pos<safeLength){const ch=text.charCodeAt(pos);if(ch===42&&text.charCodeAt(pos+1)===47){pos+=2;commentClosed=true;break}pos++;if(isLineBreak(ch)){if(ch===13&&text.charCodeAt(pos)===10){pos++}lineNumber++;tokenLineStartOffset=pos}}if(!commentClosed){pos++;scanError=1}value=text.substring(start,pos);return token=13}value+=String.fromCharCode(code);pos++;return token=16;case 45:value+=String.fromCharCode(code);pos++;if(pos===len||!isDigit(text.charCodeAt(pos))){return token=16}case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:value+=scanNumber();return token=11;default:while(pos<len&&isUnknownContentCharacter(code)){pos++;code=text.charCodeAt(pos)}if(tokenOffset!==pos){value=text.substring(tokenOffset,pos);switch(value){case"true":return token=8;case"false":return token=9;case"null":return token=7}return token=16}value+=String.fromCharCode(code);pos++;return token=16}}__name(scanNext,"scanNext");function isUnknownContentCharacter(code){if(isWhiteSpace(code)||isLineBreak(code)){return false}switch(code){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return false}return true}__name(isUnknownContentCharacter,"isUnknownContentCharacter");function scanNextNonTrivia(){let result;do{result=scanNext()}while(result>=12&&result<=15);return result}__name(scanNextNonTrivia,"scanNextNonTrivia");return{setPosition,getPosition:__name(()=>pos,"getPosition"),scan:ignoreTrivia?scanNextNonTrivia:scanNext,getToken:__name(()=>token,"getToken"),getTokenValue:__name(()=>value,"getTokenValue"),getTokenOffset:__name(()=>tokenOffset,"getTokenOffset"),getTokenLength:__name(()=>pos-tokenOffset,"getTokenLength"),getTokenStartLine:__name(()=>lineStartOffset,"getTokenStartLine"),getTokenStartCharacter:__name(()=>tokenOffset-prevTokenLineStartOffset,"getTokenStartCharacter"),getTokenError:__name(()=>scanError,"getTokenError")}}__name(createScanner,"createScanner");function isWhiteSpace(ch){return ch===32||ch===9}__name(isWhiteSpace,"isWhiteSpace");function isLineBreak(ch){return ch===10||ch===13}__name(isLineBreak,"isLineBreak");function isDigit(ch){return ch>=48&&ch<=57}__name(isDigit,"isDigit");var CharacterCodes;(function(CharacterCodes2){CharacterCodes2[CharacterCodes2["lineFeed"]=10]="lineFeed";CharacterCodes2[CharacterCodes2["carriageReturn"]=13]="carriageReturn";CharacterCodes2[CharacterCodes2["space"]=32]="space";CharacterCodes2[CharacterCodes2["_0"]=48]="_0";CharacterCodes2[CharacterCodes2["_1"]=49]="_1";CharacterCodes2[CharacterCodes2["_2"]=50]="_2";CharacterCodes2[CharacterCodes2["_3"]=51]="_3";CharacterCodes2[CharacterCodes2["_4"]=52]="_4";CharacterCodes2[CharacterCodes2["_5"]=53]="_5";CharacterCodes2[CharacterCodes2["_6"]=54]="_6";CharacterCodes2[CharacterCodes2["_7"]=55]="_7";CharacterCodes2[CharacterCodes2["_8"]=56]="_8";CharacterCodes2[CharacterCodes2["_9"]=57]="_9";CharacterCodes2[CharacterCodes2["a"]=97]="a";CharacterCodes2[CharacterCodes2["b"]=98]="b";CharacterCodes2[CharacterCodes2["c"]=99]="c";CharacterCodes2[CharacterCodes2["d"]=100]="d";CharacterCodes2[CharacterCodes2["e"]=101]="e";CharacterCodes2[CharacterCodes2["f"]=102]="f";CharacterCodes2[CharacterCodes2["g"]=103]="g";CharacterCodes2[CharacterCodes2["h"]=104]="h";CharacterCodes2[CharacterCodes2["i"]=105]="i";CharacterCodes2[CharacterCodes2["j"]=106]="j";CharacterCodes2[CharacterCodes2["k"]=107]="k";CharacterCodes2[CharacterCodes2["l"]=108]="l";CharacterCodes2[CharacterCodes2["m"]=109]="m";CharacterCodes2[CharacterCodes2["n"]=110]="n";CharacterCodes2[CharacterCodes2["o"]=111]="o";CharacterCodes2[CharacterCodes2["p"]=112]="p";CharacterCodes2[CharacterCodes2["q"]=113]="q";CharacterCodes2[CharacterCodes2["r"]=114]="r";CharacterCodes2[CharacterCodes2["s"]=115]="s";CharacterCodes2[CharacterCodes2["t"]=116]="t";CharacterCodes2[CharacterCodes2["u"]=117]="u";CharacterCodes2[CharacterCodes2["v"]=118]="v";CharacterCodes2[CharacterCodes2["w"]=119]="w";CharacterCodes2[CharacterCodes2["x"]=120]="x";CharacterCodes2[CharacterCodes2["y"]=121]="y";CharacterCodes2[CharacterCodes2["z"]=122]="z";CharacterCodes2[CharacterCodes2["A"]=65]="A";CharacterCodes2[CharacterCodes2["B"]=66]="B";CharacterCodes2[CharacterCodes2["C"]=67]="C";CharacterCodes2[CharacterCodes2["D"]=68]="D";CharacterCodes2[CharacterCodes2["E"]=69]="E";CharacterCodes2[CharacterCodes2["F"]=70]="F";CharacterCodes2[CharacterCodes2["G"]=71]="G";CharacterCodes2[CharacterCodes2["H"]=72]="H";CharacterCodes2[CharacterCodes2["I"]=73]="I";CharacterCodes2[CharacterCodes2["J"]=74]="J";CharacterCodes2[CharacterCodes2["K"]=75]="K";CharacterCodes2[CharacterCodes2["L"]=76]="L";CharacterCodes2[CharacterCodes2["M"]=77]="M";CharacterCodes2[CharacterCodes2["N"]=78]="N";CharacterCodes2[CharacterCodes2["O"]=79]="O";CharacterCodes2[CharacterCodes2["P"]=80]="P";CharacterCodes2[CharacterCodes2["Q"]=81]="Q";CharacterCodes2[CharacterCodes2["R"]=82]="R";CharacterCodes2[CharacterCodes2["S"]=83]="S";CharacterCodes2[CharacterCodes2["T"]=84]="T";CharacterCodes2[CharacterCodes2["U"]=85]="U";CharacterCodes2[CharacterCodes2["V"]=86]="V";CharacterCodes2[CharacterCodes2["W"]=87]="W";CharacterCodes2[CharacterCodes2["X"]=88]="X";CharacterCodes2[CharacterCodes2["Y"]=89]="Y";CharacterCodes2[CharacterCodes2["Z"]=90]="Z";CharacterCodes2[CharacterCodes2["asterisk"]=42]="asterisk";CharacterCodes2[CharacterCodes2["backslash"]=92]="backslash";CharacterCodes2[CharacterCodes2["closeBrace"]=125]="closeBrace";CharacterCodes2[CharacterCodes2["closeBracket"]=93]="closeBracket";CharacterCodes2[CharacterCodes2["colon"]=58]="colon";CharacterCodes2[CharacterCodes2["comma"]=44]="comma";CharacterCodes2[CharacterCodes2["dot"]=46]="dot";CharacterCodes2[CharacterCodes2["doubleQuote"]=34]="doubleQuote";CharacterCodes2[CharacterCodes2["minus"]=45]="minus";CharacterCodes2[CharacterCodes2["openBrace"]=123]="openBrace";CharacterCodes2[CharacterCodes2["openBracket"]=91]="openBracket";CharacterCodes2[CharacterCodes2["plus"]=43]="plus";CharacterCodes2[CharacterCodes2["slash"]=47]="slash";CharacterCodes2[CharacterCodes2["formFeed"]=12]="formFeed";CharacterCodes2[CharacterCodes2["tab"]=9]="tab"})(CharacterCodes||(CharacterCodes={}));init_esbuild_shims();var cachedSpaces=new Array(20).fill(0).map((_,index)=>{return" ".repeat(index)});var maxCachedValues=200;var cachedBreakLinesWithSpaces={" ":{"\n":new Array(maxCachedValues).fill(0).map((_,index)=>{return"\n"+" ".repeat(index)}),"\r":new Array(maxCachedValues).fill(0).map((_,index)=>{return"\r"+" ".repeat(index)}),"\r\n":new Array(maxCachedValues).fill(0).map((_,index)=>{return"\r\n"+" ".repeat(index)})}," ":{"\n":new Array(maxCachedValues).fill(0).map((_,index)=>{return"\n"+" ".repeat(index)}),"\r":new Array(maxCachedValues).fill(0).map((_,index)=>{return"\r"+" ".repeat(index)}),"\r\n":new Array(maxCachedValues).fill(0).map((_,index)=>{return"\r\n"+" ".repeat(index)})}};var supportedEols=["\n","\r","\r\n"];function format(documentText,range,options){let initialIndentLevel;let formatText;let formatTextStart;let rangeStart;let rangeEnd;if(range){rangeStart=range.offset;rangeEnd=rangeStart+range.length;formatTextStart=rangeStart;while(formatTextStart>0&&!isEOL(documentText,formatTextStart-1)){formatTextStart--}let endOffset=rangeEnd;while(endOffset<documentText.length&&!isEOL(documentText,endOffset)){endOffset++}formatText=documentText.substring(formatTextStart,endOffset);initialIndentLevel=computeIndentLevel(formatText,options)}else{formatText=documentText;initialIndentLevel=0;formatTextStart=0;rangeStart=0;rangeEnd=documentText.length}const eol=getEOL(options,documentText);const eolFastPathSupported=supportedEols.includes(eol);let numberLineBreaks=0;let indentLevel=0;let indentValue;if(options.insertSpaces){indentValue=cachedSpaces[options.tabSize||4]??repeat(cachedSpaces[1],options.tabSize||4)}else{indentValue=" "}const indentType=indentValue===" "?" ":" ";let scanner=createScanner(formatText,false);let hasError=false;function newLinesAndIndent(){if(numberLineBreaks>1){return repeat(eol,numberLineBreaks)+repeat(indentValue,initialIndentLevel+indentLevel)}const amountOfSpaces=indentValue.length*(initialIndentLevel+indentLevel);if(!eolFastPathSupported||amountOfSpaces>cachedBreakLinesWithSpaces[indentType][eol].length){return eol+repeat(indentValue,initialIndentLevel+indentLevel)}if(amountOfSpaces<=0){return eol}return cachedBreakLinesWithSpaces[indentType][eol][amountOfSpaces]}__name(newLinesAndIndent,"newLinesAndIndent");function scanNext(){let token=scanner.scan();numberLineBreaks=0;while(token===15||token===14){if(token===14&&options.keepLines){numberLineBreaks+=1}else if(token===14){numberLineBreaks=1}token=scanner.scan()}hasError=token===16||scanner.getTokenError()!==0;return token}__name(scanNext,"scanNext");const editOperations=[];function addEdit(text,startOffset,endOffset){if(!hasError&&(!range||startOffset<rangeEnd&&endOffset>rangeStart)&&documentText.substring(startOffset,endOffset)!==text){editOperations.push({offset:startOffset,length:endOffset-startOffset,content:text})}}__name(addEdit,"addEdit");let firstToken=scanNext();if(options.keepLines&&numberLineBreaks>0){addEdit(repeat(eol,numberLineBreaks),0,0)}if(firstToken!==17){let firstTokenStart=scanner.getTokenOffset()+formatTextStart;let initialIndent=indentValue.length*initialIndentLevel<20&&options.insertSpaces?cachedSpaces[indentValue.length*initialIndentLevel]:repeat(indentValue,initialIndentLevel);addEdit(initialIndent,formatTextStart,firstTokenStart)}while(firstToken!==17){let firstTokenEnd=scanner.getTokenOffset()+scanner.getTokenLength()+formatTextStart;let secondToken=scanNext();let replaceContent="";let needsLineBreak=false;while(numberLineBreaks===0&&(secondToken===12||secondToken===13)){let commentTokenStart=scanner.getTokenOffset()+formatTextStart;addEdit(cachedSpaces[1],firstTokenEnd,commentTokenStart);firstTokenEnd=scanner.getTokenOffset()+scanner.getTokenLength()+formatTextStart;needsLineBreak=secondToken===12;replaceContent=needsLineBreak?newLinesAndIndent():"";secondToken=scanNext()}if(secondToken===2){if(firstToken!==1){indentLevel--};if(options.keepLines&&numberLineBreaks>0||!options.keepLines&&firstToken!==1){replaceContent=newLinesAndIndent()}else if(options.keepLines){replaceContent=cachedSpaces[1]}}else if(secondToken===4){if(firstToken!==3){indentLevel--};if(options.keepLines&&numberLineBreaks>0||!options.keepLines&&firstToken!==3){replaceContent=newLinesAndIndent()}else if(options.keepLines){replaceContent=cachedSpaces[1]}}else{switch(firstToken){case 3:case 1:indentLevel++;if(options.keepLines&&numberLineBreaks>0||!options.keepLines){replaceContent=newLinesAndIndent()}else{replaceContent=cachedSpaces[1]}break;case 5:if(options.keepLines&&numberLineBreaks>0||!options.keepLines){replaceContent=newLinesAndIndent()}else{replaceContent=cachedSpaces[1]}break;case 12:replaceContent=newLinesAndIndent();break;case 13:if(numberLineBreaks>0){replaceContent=newLinesAndIndent()}else if(!needsLineBreak){replaceContent=cachedSpaces[1]}break;case 6:if(options.keepLines&&numberLineBreaks>0){replaceContent=newLinesAndIndent()}else if(!needsLineBreak){replaceContent=cachedSpaces[1]}break;case 10:if(options.keepLines&&numberLineBreaks>0){replaceContent=newLinesAndIndent()}else if(secondToken===6&&!needsLineBreak){replaceContent=""}break;case 7:case 8:case 9:case 11:case 2:case 4:if(options.keepLines&&numberLineBreaks>0){replaceContent=newLinesAndIndent()}else{if((secondToken===12||secondToken===13)&&!needsLineBreak){replaceContent=cachedSpaces[1]}else if(secondToken!==5&&secondToken!==17){hasError=true}}break;case 16:hasError=true;break}if(numberLineBreaks>0&&(secondToken===12||secondToken===13)){replaceContent=newLinesAndIndent()}}if(secondToken===17){if(options.keepLines&&numberLineBreaks>0){replaceContent=newLinesAndIndent()}else{replaceContent=options.insertFinalNewline?eol:""}}const secondTokenStart=scanner.getTokenOffset()+formatTextStart;addEdit(replaceContent,firstTokenEnd,secondTokenStart);firstToken=secondToken}return editOperations}__name(format,"format");function repeat(s,count){let result="";for(let i=0;i<count;i++){result+=s}return result}__name(repeat,"repeat");function computeIndentLevel(content,options){let i=0;let nChars=0;const tabSize=options.tabSize||4;while(i<content.length){let ch=content.charAt(i);if(ch===cachedSpaces[1]){nChars++}else if(ch===" "){nChars+=tabSize}else{break}i++}return Math.floor(nChars/tabSize)}__name(computeIndentLevel,"computeIndentLevel");function getEOL(options,text){for(let i=0;i<text.length;i++){const ch=text.charAt(i);if(ch==="\r"){if(i+1<text.length&&text.charAt(i+1)==="\n"){return"\r\n"}return"\r"}else if(ch==="\n"){return"\n"}}return options&&options.eol||"\n"}__name(getEOL,"getEOL");function isEOL(text,offset){return"\r\n".indexOf(text.charAt(offset))!==-1}__name(isEOL,"isEOL");init_esbuild_shims();init_esbuild_shims();var ParseOptions;(function(ParseOptions2){ParseOptions2.DEFAULT={allowTrailingComma:false}})(ParseOptions||(ParseOptions={}));function parseTree(text,errors=[],options=ParseOptions.DEFAULT){let currentParent={type:"array",offset:-1,length:-1,children:[],parent:void 0};function ensurePropertyComplete(endOffset){if(currentParent.type==="property"){currentParent.length=endOffset-currentParent.offset;currentParent=currentParent.parent}}__name(ensurePropertyComplete,"ensurePropertyComplete");function onValue(valueNode){currentParent.children.push(valueNode);return valueNode}__name(onValue,"onValue");const visitor={onObjectBegin:__name(offset=>{currentParent=onValue({type:"object",offset,length:-1,parent:currentParent,children:[]})},"onObjectBegin"),onObjectProperty:__name((name,offset,length)=>{currentParent=onValue({type:"property",offset,length:-1,parent:currentParent,children:[]});currentParent.children.push({type:"string",value:name,offset,length,parent:currentParent})},"onObjectProperty"),onObjectEnd:__name((offset,length)=>{ensurePropertyComplete(offset+length);currentParent.length=offset+length-currentParent.offset;currentParent=currentParent.parent;ensurePropertyComplete(offset+length)},"onObjectEnd"),onArrayBegin:__name((offset,length)=>{currentParent=onValue({type:"array",offset,length:-1,parent:currentParent,children:[]})},"onArrayBegin"),onArrayEnd:__name((offset,length)=>{currentParent.length=offset+length-currentParent.offset;currentParent=currentParent.parent;ensurePropertyComplete(offset+length)},"onArrayEnd"),onLiteralValue:__name((value,offset,length)=>{onValue({type:getNodeType(value),offset,length,parent:currentParent,value});ensurePropertyComplete(offset+length)},"onLiteralValue"),onSeparator:__name((sep,offset,length)=>{if(currentParent.type==="property"){if(sep===":"){currentParent.colonOffset=offset}else if(sep===","){ensurePropertyComplete(offset)}}},"onSeparator"),onError:__name((error,offset,length)=>{errors.push({error,offset,length})},"onError")};visit(text,visitor,options);const result=currentParent.children[0];if(result){delete result.parent}return result}__name(parseTree,"parseTree");function findNodeAtLocation(root,path4){if(!root){return void 0}let node=root;for(let segment of path4){if(typeof segment==="string"){if(node.type!=="object"||!Array.isArray(node.children)){return void 0}let found=false;for(const propertyNode of node.children){if(Array.isArray(propertyNode.children)&&propertyNode.children[0].value===segment&&propertyNode.children.length===2){node=propertyNode.children[1];found=true;break}}if(!found){return void 0}}else{const index=segment;if(node.type!=="array"||index<0||!Array.isArray(node.children)||index>=node.children.length){return void 0}node=node.children[index]}}return node}__name(findNodeAtLocation,"findNodeAtLocation");function getNodeValue(node){switch(node.type){case"array":return node.children.map(getNodeValue);case"object":const obj=Object.create(null);for(let prop of node.children){const valueNode=prop.children[1];if(valueNode){obj[prop.children[0].value]=getNodeValue(valueNode)}}return obj;case"null":case"string":case"number":case"boolean":return node.value;default:return void 0}}__name(getNodeValue,"getNodeValue");function visit(text,visitor,options=ParseOptions.DEFAULT){const _scanner=createScanner(text,false);const _jsonPath=[];let suppressedCallbacks=0;function toNoArgVisit(visitFunction){return visitFunction?()=>suppressedCallbacks===0&&visitFunction(_scanner.getTokenOffset(),_scanner.getTokenLength(),_scanner.getTokenStartLine(),_scanner.getTokenStartCharacter()):()=>true}__name(toNoArgVisit,"toNoArgVisit");function toOneArgVisit(visitFunction){return visitFunction?arg=>suppressedCallbacks===0&&visitFunction(arg,_scanner.getTokenOffset(),_scanner.getTokenLength(),_scanner.getTokenStartLine(),_scanner.getTokenStartCharacter()):()=>true}__name(toOneArgVisit,"toOneArgVisit");function toOneArgVisitWithPath(visitFunction){return visitFunction?arg=>suppressedCallbacks===0&&visitFunction(arg,_scanner.getTokenOffset(),_scanner.getTokenLength(),_scanner.getTokenStartLine(),_scanner.getTokenStartCharacter(),()=>_jsonPath.slice()):()=>true}__name(toOneArgVisitWithPath,"toOneArgVisitWithPath");function toBeginVisit(visitFunction){return visitFunction?()=>{if(suppressedCallbacks>0){suppressedCallbacks++}else{let cbReturn=visitFunction(_scanner.getTokenOffset(),_scanner.getTokenLength(),_scanner.getTokenStartLine(),_scanner.getTokenStartCharacter(),()=>_jsonPath.slice());if(cbReturn===false){suppressedCallbacks=1}}}:()=>true}__name(toBeginVisit,"toBeginVisit");function toEndVisit(visitFunction){return visitFunction?()=>{if(suppressedCallbacks>0){suppressedCallbacks--}if(suppressedCallbacks===0){visitFunction(_scanner.getTokenOffset(),_scanner.getTokenLength(),_scanner.getTokenStartLine(),_scanner.getTokenStartCharacter())}}:()=>true}__name(toEndVisit,"toEndVisit");const onObjectBegin=toBeginVisit(visitor.onObjectBegin),onObjectProperty=toOneArgVisitWithPath(visitor.onObjectProperty),onObjectEnd=toEndVisit(visitor.onObjectEnd),onArrayBegin=toBeginVisit(visitor.onArrayBegin),onArrayEnd=toEndVisit(visitor.onArrayEnd),onLiteralValue=toOneArgVisitWithPath(visitor.onLiteralValue),onSeparator=toOneArgVisit(visitor.onSeparator),onComment=toNoArgVisit(visitor.onComment),onError=toOneArgVisit(visitor.onError);const disallowComments=options&&options.disallowComments;const allowTrailingComma=options&&options.allowTrailingComma;function scanNext(){while(true){const token=_scanner.scan();switch(_scanner.getTokenError()){case 4:handleError(14);break;case 5:handleError(15);break;case 3:handleError(13);break;case 1:if(!disallowComments){handleError(11)}break;case 2:handleError(12);break;case 6:handleError(16);break}switch(token){case 12:case 13:if(disallowComments){handleError(10)}else{onComment()}break;case 16:handleError(1);break;case 15:case 14:break;default:return token}}}__name(scanNext,"scanNext");function handleError(error,skipUntilAfter=[],skipUntil=[]){onError(error);if(skipUntilAfter.length+skipUntil.length>0){let token=_scanner.getToken();while(token!==17){if(skipUntilAfter.indexOf(token)!==-1){scanNext();break}else if(skipUntil.indexOf(token)!==-1){break}token=scanNext()}}}__name(handleError,"handleError");function parseString(isValue){const value=_scanner.getTokenValue();if(isValue){onLiteralValue(value)}else{onObjectProperty(value);_jsonPath.push(value)}scanNext();return true}__name(parseString,"parseString");function parseLiteral(){switch(_scanner.getToken()){case 11:const tokenValue=_scanner.getTokenValue();let value=Number(tokenValue);if(isNaN(value)){handleError(2);value=0}onLiteralValue(value);break;case 7:onLiteralValue(null);break;case 8:onLiteralValue(true);break;case 9:onLiteralValue(false);break;default:return false}scanNext();return true}__name(parseLiteral,"parseLiteral");function parseProperty(){if(_scanner.getToken()!==10){handleError(3,[],[2,5]);return false}parseString(false);if(_scanner.getToken()===6){onSeparator(":");scanNext();if(!parseValue()){handleError(4,[],[2,5])}}else{handleError(5,[],[2,5])}_jsonPath.pop();return true}__name(parseProperty,"parseProperty");function parseObject(){onObjectBegin();scanNext();let needsComma=false;while(_scanner.getToken()!==2&&_scanner.getToken()!==17){if(_scanner.getToken()===5){if(!needsComma){handleError(4,[],[])}onSeparator(",");scanNext();if(_scanner.getToken()===2&&allowTrailingComma){break}}else if(needsComma){handleError(6,[],[])}if(!parseProperty()){handleError(4,[],[2,5])}needsComma=true}onObjectEnd();if(_scanner.getToken()!==2){handleError(7,[2],[])}else{scanNext()}return true}__name(parseObject,"parseObject");function parseArray(){onArrayBegin();scanNext();let isFirstElement=true;let needsComma=false;while(_scanner.getToken()!==4&&_scanner.getToken()!==17){if(_scanner.getToken()===5){if(!needsComma){handleError(4,[],[])}onSeparator(",");scanNext();if(_scanner.getToken()===4&&allowTrailingComma){break}}else if(needsComma){handleError(6,[],[])}if(isFirstElement){_jsonPath.push(0);isFirstElement=false}else{_jsonPath[_jsonPath.length-1]++}if(!parseValue()){handleError(4,[],[4,5])}needsComma=true}onArrayEnd();if(!isFirstElement){_jsonPath.pop()}if(_scanner.getToken()!==4){handleError(8,[4],[])}else{scanNext()}return true}__name(parseArray,"parseArray");function parseValue(){switch(_scanner.getToken()){case 3:return parseArray();case 1:return parseObject();case 10:return parseString(true);default:return parseLiteral()}}__name(parseValue,"parseValue");scanNext();if(_scanner.getToken()===17){if(options.allowEmptyContent){return true}handleError(4,[],[]);return false}if(!parseValue()){handleError(4,[],[]);return false}if(_scanner.getToken()!==17){handleError(9,[],[])}return true}__name(visit,"visit");function getNodeType(value){switch(typeof value){case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"object":{if(!value){return"null"}else if(Array.isArray(value)){return"array"}return"object"}default:return"null"}}__name(getNodeType,"getNodeType");function setProperty(text,originalPath,value,options){const path4=originalPath.slice();const errors=[];const root=parseTree(text,errors);let parent=void 0;let lastSegment=void 0;while(path4.length>0){lastSegment=path4.pop();parent=findNodeAtLocation(root,path4);if(parent===void 0&&value!==void 0){if(typeof lastSegment==="string"){value={[lastSegment]:value}}else{value=[value]}}else{break}}if(!parent){if(value===void 0){throw new Error("Can not delete in empty document")}return withFormatting(text,{offset:root?root.offset:0,length:root?root.length:0,content:JSON.stringify(value)},options)}else if(parent.type==="object"&&typeof lastSegment==="string"&&Array.isArray(parent.children)){const existing=findNodeAtLocation(parent,[lastSegment]);if(existing!==void 0){if(value===void 0){if(!existing.parent){throw new Error("Malformed AST")}const propertyIndex=parent.children.indexOf(existing.parent);let removeBegin;let removeEnd=existing.parent.offset+existing.parent.length;if(propertyIndex>0){let previous=parent.children[propertyIndex-1];removeBegin=previous.offset+previous.length}else{removeBegin=parent.offset+1;if(parent.children.length>1){let next=parent.children[1];removeEnd=next.offset}}return withFormatting(text,{offset:removeBegin,length:removeEnd-removeBegin,content:""},options)}else{return withFormatting(text,{offset:existing.offset,length:existing.length,content:JSON.stringify(value)},options)}}else{if(value===void 0){return[]}const newProperty=`${JSON.stringify(lastSegment)}: ${JSON.stringify(value)}`;const index=options.getInsertionIndex?options.getInsertionIndex(parent.children.map(p=>p.children[0].value)):parent.children.length;let edit;if(index>0){let previous=parent.children[index-1];edit={offset:previous.offset+previous.length,length:0,content:","+newProperty}}else if(parent.children.length===0){edit={offset:parent.offset+1,length:0,content:newProperty}}else{edit={offset:parent.offset+1,length:0,content:newProperty+","}}return withFormatting(text,edit,options)}}else if(parent.type==="array"&&typeof lastSegment==="number"&&Array.isArray(parent.children)){const insertIndex=lastSegment;if(insertIndex===-1){const newProperty=`${JSON.stringify(value)}`;let edit;if(parent.children.length===0){edit={offset:parent.offset+1,length:0,content:newProperty}}else{const previous=parent.children[parent.children.length-1];edit={offset:previous.offset+previous.length,length:0,content:","+newProperty}}return withFormatting(text,edit,options)}else if(value===void 0&&parent.children.length>=0){const removalIndex=lastSegment;const toRemove=parent.children[removalIndex];let edit;if(parent.children.length===1){edit={offset:parent.offset+1,length:parent.length-2,content:""}}else if(parent.children.length-1===removalIndex){let previous=parent.children[removalIndex-1];let offset=previous.offset+previous.length;let parentEndOffset=parent.offset+parent.length;edit={offset,length:parentEndOffset-2-offset,content:""}}else{edit={offset:toRemove.offset,length:parent.children[removalIndex+1].offset-toRemove.offset,content:""}}return withFormatting(text,edit,options)}else if(value!==void 0){let edit;const newProperty=`${JSON.stringify(value)}`;if(!options.isArrayInsertion&&parent.children.length>lastSegment){const toModify=parent.children[lastSegment];edit={offset:toModify.offset,length:toModify.length,content:newProperty}}else if(parent.children.length===0||lastSegment===0){edit={offset:parent.offset+1,length:0,content:parent.children.length===0?newProperty:newProperty+","}}else{const index=lastSegment>parent.children.length?parent.children.length:lastSegment;const previous=parent.children[index-1];edit={offset:previous.offset+previous.length,length:0,content:","+newProperty}}return withFormatting(text,edit,options)}else{throw new Error(`Can not ${value===void 0?"remove":options.isArrayInsertion?"insert":"modify"} Array index ${insertIndex} as length is not sufficient`)}}else{throw new Error(`Can not add ${typeof lastSegment!=="number"?"index":"property"} to parent of type ${parent.type}`)}}__name(setProperty,"setProperty");function withFormatting(text,edit,options){if(!options.formattingOptions){return[edit]}let newText=applyEdit(text,edit);let begin=edit.offset;let end=edit.offset+edit.content.length;if(edit.length===0||edit.content.length===0){while(begin>0&&!isEOL(newText,begin-1)){begin--}while(end<newText.length&&!isEOL(newText,end)){end++}}const edits=format(newText,{offset:begin,length:end-begin},{...options.formattingOptions,keepLines:false});for(let i=edits.length-1;i>=0;i--){const edit2=edits[i];newText=applyEdit(newText,edit2);begin=Math.min(begin,edit2.offset);end=Math.max(end,edit2.offset+edit2.length);end+=edit2.content.length-edit2.length}const editLength=text.length-(newText.length-end)-begin;return[{offset:begin,length:editLength,content:newText.substring(begin,end)}]}__name(withFormatting,"withFormatting");function applyEdit(text,edit){return text.substring(0,edit.offset)+edit.content+text.substring(edit.offset+edit.length)}__name(applyEdit,"applyEdit");var ScanError;(function(ScanError2){ScanError2[ScanError2["None"]=0]="None";ScanError2[ScanError2["UnexpectedEndOfComment"]=1]="UnexpectedEndOfComment";ScanError2[ScanError2["UnexpectedEndOfString"]=2]="UnexpectedEndOfString";ScanError2[ScanError2["UnexpectedEndOfNumber"]=3]="UnexpectedEndOfNumber";ScanError2[ScanError2["InvalidUnicode"]=4]="InvalidUnicode";ScanError2[ScanError2["InvalidEscapeCharacter"]=5]="InvalidEscapeCharacter";ScanError2[ScanError2["InvalidCharacter"]=6]="InvalidCharacter"})(ScanError||(ScanError={}));var SyntaxKind;(function(SyntaxKind2){SyntaxKind2[SyntaxKind2["OpenBraceToken"]=1]="OpenBraceToken";SyntaxKind2[SyntaxKind2["CloseBraceToken"]=2]="CloseBraceToken";SyntaxKind2[SyntaxKind2["OpenBracketToken"]=3]="OpenBracketToken";SyntaxKind2[SyntaxKind2["CloseBracketToken"]=4]="CloseBracketToken";SyntaxKind2[SyntaxKind2["CommaToken"]=5]="CommaToken";SyntaxKind2[SyntaxKind2["ColonToken"]=6]="ColonToken";SyntaxKind2[SyntaxKind2["NullKeyword"]=7]="NullKeyword";SyntaxKind2[SyntaxKind2["TrueKeyword"]=8]="TrueKeyword";SyntaxKind2[SyntaxKind2["FalseKeyword"]=9]="FalseKeyword";SyntaxKind2[SyntaxKind2["StringLiteral"]=10]="StringLiteral";SyntaxKind2[SyntaxKind2["NumericLiteral"]=11]="NumericLiteral";SyntaxKind2[SyntaxKind2["LineCommentTrivia"]=12]="LineCommentTrivia";SyntaxKind2[SyntaxKind2["BlockCommentTrivia"]=13]="BlockCommentTrivia";SyntaxKind2[SyntaxKind2["LineBreakTrivia"]=14]="LineBreakTrivia";SyntaxKind2[SyntaxKind2["Trivia"]=15]="Trivia";SyntaxKind2[SyntaxKind2["Unknown"]=16]="Unknown";SyntaxKind2[SyntaxKind2["EOF"]=17]="EOF"})(SyntaxKind||(SyntaxKind={}));var parseTree2=parseTree;var findNodeAtLocation2=findNodeAtLocation;var getNodeValue2=getNodeValue;var ParseErrorCode;(function(ParseErrorCode2){ParseErrorCode2[ParseErrorCode2["InvalidSymbol"]=1]="InvalidSymbol";ParseErrorCode2[ParseErrorCode2["InvalidNumberFormat"]=2]="InvalidNumberFormat";ParseErrorCode2[ParseErrorCode2["PropertyNameExpected"]=3]="PropertyNameExpected";ParseErrorCode2[ParseErrorCode2["ValueExpected"]=4]="ValueExpected";ParseErrorCode2[ParseErrorCode2["ColonExpected"]=5]="ColonExpected";ParseErrorCode2[ParseErrorCode2["CommaExpected"]=6]="CommaExpected";ParseErrorCode2[ParseErrorCode2["CloseBraceExpected"]=7]="CloseBraceExpected";ParseErrorCode2[ParseErrorCode2["CloseBracketExpected"]=8]="CloseBracketExpected";ParseErrorCode2[ParseErrorCode2["EndOfFileExpected"]=9]="EndOfFileExpected";ParseErrorCode2[ParseErrorCode2["InvalidCommentToken"]=10]="InvalidCommentToken";ParseErrorCode2[ParseErrorCode2["UnexpectedEndOfComment"]=11]="UnexpectedEndOfComment";ParseErrorCode2[ParseErrorCode2["UnexpectedEndOfString"]=12]="UnexpectedEndOfString";ParseErrorCode2[ParseErrorCode2["UnexpectedEndOfNumber"]=13]="UnexpectedEndOfNumber";ParseErrorCode2[ParseErrorCode2["InvalidUnicode"]=14]="InvalidUnicode";ParseErrorCode2[ParseErrorCode2["InvalidEscapeCharacter"]=15]="InvalidEscapeCharacter";ParseErrorCode2[ParseErrorCode2["InvalidCharacter"]=16]="InvalidCharacter"})(ParseErrorCode||(ParseErrorCode={}));function printParseErrorCode(code){switch(code){case 1:return"InvalidSymbol";case 2:return"InvalidNumberFormat";case 3:return"PropertyNameExpected";case 4:return"ValueExpected";case 5:return"ColonExpected";case 6:return"CommaExpected";case 7:return"CloseBraceExpected";case 8:return"CloseBracketExpected";case 9:return"EndOfFileExpected";case 10:return"InvalidCommentToken";case 11:return"UnexpectedEndOfComment";case 12:return"UnexpectedEndOfString";case 13:return"UnexpectedEndOfNumber";case 14:return"InvalidUnicode";case 15:return"InvalidEscapeCharacter";case 16:return"InvalidCharacter"}return"<unknown ParseErrorCode>"}__name(printParseErrorCode,"printParseErrorCode");function modify(text,path4,value,options){return setProperty(text,path4,value,options)}__name(modify,"modify");function applyEdits(text,edits){let sortedEdits=edits.slice(0).sort((a,b)=>{const diff=a.offset-b.offset;if(diff===0){return a.length-b.length}return diff});let lastModifiedOffset=text.length;for(let i=sortedEdits.length-1;i>=0;i--){let e=sortedEdits[i];if(e.offset+e.length<=lastModifiedOffset){text=applyEdit(text,e)}else{throw new Error("Overlapping edit")}lastModifiedOffset=e.offset}return text}__name(applyEdits,"applyEdits");init_esbuild_shims();import*as fs from"node:fs";import path from"node:path";function writeWithBackupSync(targetPath,content,options={}){const{backupSuffix=".orig",encoding="utf-8"}=options;const existing=fs.existsSync(targetPath)?fs.statSync(targetPath):void 0;if(existing?.isDirectory()){throw new Error(`Cannot write to '${targetPath}' because it is a directory`)}const workingDirectory=fs.mkdtempSync(`${targetPath}.write-`);const basename=path.basename(targetPath);const tempPath=path.join(workingDirectory,`${basename}.tmp`);const backupPath=path.join(workingDirectory,`${basename}${backupSuffix}`);let backupCreated=false;try{const mode=existing&&fs.lstatSync(targetPath,{throwIfNoEntry:false})?.isFile()?existing.mode&511:void 0;fs.writeFileSync(tempPath,content,{encoding,flag:"wx",flush:true,mode});if(mode!==void 0){try{fs.chmodSync(tempPath,mode)}catch(error){const code=error instanceof Error&&"code"in error?error.code:void 0;if(code!=="ENOSYS"&&code!=="ENOTSUP"&&code!=="EPERM"||(fs.statSync(tempPath).mode&511&~mode)!==0){throw error}}}if(fs.existsSync(targetPath)){try{fs.copyFileSync(targetPath,backupPath,fs.constants.COPYFILE_EXCL);backupCreated=true}catch(backupError){throw new Error(`Failed to backup existing file: ${backupError instanceof Error?backupError.message:String(backupError)}`)}}fs.renameSync(tempPath,targetPath)}catch(error){const recoveryRetained=backupCreated&&!sameContents(backupPath,targetPath);try{if(recoveryRetained){fs.unlinkSync(tempPath)}else{fs.rmSync(workingDirectory,{recursive:true,force:true})}}catch{}if(recoveryRetained){throw new Error(`Failed to write file: ${error instanceof Error?error.message:String(error)}. Recovery copy retained at '${backupPath}'; inspect the current target before restoring it.`)}throw error}try{fs.rmSync(workingDirectory,{recursive:true,force:true})}catch{}}__name(writeWithBackupSync,"writeWithBackupSync");function sameContents(first,second){try{return fs.readFileSync(first).equals(fs.readFileSync(second))}catch{return false}}__name(sameContents,"sameContents");var PARSE_OPTIONS={allowTrailingComma:true};function updateSettingsFilePreservingFormat(filePath,updates,sync=false,replacePath=[]){if(!fs2.existsSync(filePath)){const content=JSON.stringify(updates,null,2);writeWithBackupSync(filePath,content);return true}const originalContent=fs2.readFileSync(filePath,"utf-8");try{parseJsoncObject(originalContent)}catch(_error){writeStderrLine("Error parsing settings file.");writeStderrLine(`Settings file may be corrupted: ${_error instanceof Error?_error.message:String(_error)}`);return false}let updatedContent;try{updatedContent=updateJsoncContent(originalContent,updates,sync,replacePath)}catch(validationError){writeStderrLine("Error: Refusing to write settings file \u2014 the result would not be valid JSON.");writeStderrLine(validationError instanceof Error?validationError.message:String(validationError));return false}writeWithBackupSync(filePath,updatedContent);return true}__name(updateSettingsFilePreservingFormat,"updateSettingsFilePreservingFormat");function parseJsoncObject(content){const errors=[];const root=parseTree2(stripBom(content),errors,PARSE_OPTIONS);if(errors.length>0){const error=errors[0];throw new Error(`${printParseErrorCode(error.error)} at offset ${error.offset}`)}if(root?.type!=="object"){throw new Error("JSONC document root is not a JSON object.")}return JSON.parse(JSON.stringify(getNodeValue2(root)))}__name(parseJsoncObject,"parseJsoncObject");function updateJsoncContent(content,updates,sync=false,replacePath=[]){const bom=content.startsWith("\uFEFF")?"\uFEFF":"";const editableContent=stripBom(content);const parsed=parseJsoncObject(editableContent);const targetWithUndefined=applyUpdates(structuredClone(parsed),updates,sync,replacePath);const target=JSON.parse(JSON.stringify(targetWithUndefined));const options={formattingOptions:detectFormattingOptions(editableContent)};let updated=normalizeDuplicateProperties(editableContent,options);const current=parseJsoncObject(updated);for(const operation of collectOperations(current,target)){if(operation.value===void 0){updated=removeTrailingInlineComment(updated,operation.path)}updated=applyEdits(updated,modify(updated,operation.path,operation.value,options))}const reparsed=parseJsoncObject(updated);if(!isDeepStrictEqual(reparsed,target)){throw new Error("Edited JSONC does not match the intended settings.")}return bom+updated}__name(updateJsoncContent,"updateJsoncContent");function applyUpdates(current,updates,sync=false,replacePath=[],currentPath=[]){const result=current;if(sync){const keysToRemove=Object.keys(result).filter(key=>!Object.hasOwn(updates,key));for(const key of keysToRemove){delete result[key]}}for(const key of Object.getOwnPropertyNames(updates)){if(key==="__proto__"||key==="constructor"||key==="prototype"){continue}const value=updates[key];const nextPath=[...currentPath,key];const valueIsObject=typeof value==="object"&&value!==null&&!Array.isArray(value)&&Object.keys(value).length>0;if(pathsEqual(nextPath,replacePath)){result[key]=valueIsObject?applyUpdates({},value):value;continue}if(valueIsObject&&(typeof result[key]!=="object"||result[key]===null||Array.isArray(result[key]))){result[key]=applyUpdates({},value,sync,replacePath,nextPath)}else if(valueIsObject&&typeof result[key]==="object"&&result[key]!==null&&!Array.isArray(result[key])){result[key]=applyUpdates(result[key],value,sync,replacePath,nextPath)}else{result[key]=value}}return result}__name(applyUpdates,"applyUpdates");function stripBom(content){return content.startsWith("\uFEFF")?content.slice(1):content}__name(stripBom,"stripBom");function isRecord(value){return typeof value==="object"&&value!==null&&!Array.isArray(value)}__name(isRecord,"isRecord");function detectFormattingOptions(content){const root=parseTree2(content,[],PARSE_OPTIONS);const firstKey=root?.children?.[0]?.children?.[0];const lineStart=firstKey===void 0?-1:content.lastIndexOf("\n",firstKey.offset-1);const candidate=firstKey===void 0?void 0:content.slice(lineStart+1,firstKey.offset);const indentation=candidate!==void 0&&/^[ \t]*$/.test(candidate)?candidate:" ";return{eol:content.includes("\r\n")?"\r\n":"\n",insertSpaces:!indentation.startsWith(" "),tabSize:indentation.startsWith(" ")?1:indentation.length,insertFinalNewline:content.endsWith("\n")}}__name(detectFormattingOptions,"detectFormattingOptions");function collectOperations(current,target,path4=[],operations=[]){for(const key of Object.keys(current)){if(!Object.hasOwn(target,key)){operations.push({path:[...path4,key],value:void 0})}}for(const key of Object.keys(target)){const nextPath=[...path4,key];if(!Object.hasOwn(current,key)){operations.push({path:nextPath,value:target[key]})}else if(isRecord(current[key])&&isRecord(target[key])){collectOperations(current[key],target[key],nextPath,operations)}else if(!isDeepStrictEqual(current[key],target[key])){operations.push({path:nextPath,value:target[key]})}}return operations}__name(collectOperations,"collectOperations");function findDuplicateProperty(node,path4=[]){if(node.type!=="object"||node.children===void 0){return void 0}const properties=new Map;for(const property of node.children){const keyNode=property.children?.[0];const key=keyNode?.value;if(typeof key!=="string"||keyNode===void 0){continue}const previous=properties.get(key);if(previous!==void 0){return{objectPath:[...path4],keyNode:previous,propertyNames:new Set(properties.keys())}}properties.set(key,keyNode)}for(const property of node.children){const key=property.children?.[0]?.value;const valueNode=property.children?.[1];if(typeof key!=="string"||valueNode===void 0){continue}const duplicate=findDuplicateProperty(valueNode,[...path4,key]);if(duplicate!==void 0){return duplicate}}return void 0}__name(findDuplicateProperty,"findDuplicateProperty");function normalizeDuplicateProperties(content,options){let normalized=content;let duplicateIndex=0;while(true){const root=parseTree2(normalized,[],PARSE_OPTIONS);if(root===void 0){return normalized}const duplicate=findDuplicateProperty(root);if(duplicate===void 0){return normalized}let temporaryKey;do{temporaryKey=`__qwen_duplicate_${duplicateIndex}`;duplicateIndex+=1}while(duplicate.propertyNames.has(temporaryKey));let renamed=normalized.slice(0,duplicate.keyNode.offset)+JSON.stringify(temporaryKey)+normalized.slice(duplicate.keyNode.offset+duplicate.keyNode.length);renamed=removeTrailingInlineComment(renamed,[...duplicate.objectPath,temporaryKey]);normalized=applyEdits(renamed,modify(renamed,[...duplicate.objectPath,temporaryKey],void 0,options))}}__name(normalizeDuplicateProperties,"normalizeDuplicateProperties");function removeTrailingInlineComment(content,path4){const root=parseTree2(content,[],PARSE_OPTIONS);if(root===void 0){return content}const node=findNodeAtLocation2(root,[...path4]);if(node===void 0){return content}const tail=content.slice(node.offset+node.length);const match=tail.match(/^[ \t]*(?:,[ \t]*)?(\/\/[^\r\n]*|\/\*[\s\S]*?\*\/)/);const comment=match?.[1];if(comment===void 0||match===null){return content}const commentOffset=node.offset+node.length+match[0].indexOf(comment);return content.slice(0,commentOffset)+content.slice(commentOffset+comment.length)}__name(removeTrailingInlineComment,"removeTrailingInlineComment");function pathsEqual(left,right){return left.length===right.length&&left.every((segment,index)=>segment===right[index])}__name(pathsEqual,"pathsEqual");init_esbuild_shims();import*as fs3 from"node:fs";import*as path2 from"node:path";function isWorkflowAncestorDirectorySafe(directory){if(process.platform==="win32")return true;for(const location of[directory,path2.join(directory,".qwen"),path2.join(directory,".qwen","workflows")]){try{if((fs3.statSync(location).mode&2)!==0)return false}catch(error){const code=error.code;if(location===directory)return false;if(code==="ENOENT"||code==="ENOTDIR")break;return false}}return true}__name(isWorkflowAncestorDirectorySafe,"isWorkflowAncestorDirectorySafe");var debugLogger=createDebugLogger("TRUSTED_FOLDERS");var TRUSTED_FOLDERS_FILENAME="trustedFolders.json";function getTrustedFoldersPath(){if(process.env["QWEN_CODE_TRUSTED_FOLDERS_PATH"]){return process.env["QWEN_CODE_TRUSTED_FOLDERS_PATH"]}return path3.join(Storage.getGlobalQwenDir(),TRUSTED_FOLDERS_FILENAME)}__name(getTrustedFoldersPath,"getTrustedFoldersPath");var TrustLevel=(TrustLevel2=>{TrustLevel2["TRUST_FOLDER"]="TRUST_FOLDER";TrustLevel2["TRUST_PARENT"]="TRUST_PARENT";TrustLevel2["DO_NOT_TRUST"]="DO_NOT_TRUST";return TrustLevel2})(TrustLevel||{});var trustedFoldersChangeListeners=new Set;function onTrustedFoldersChanged(listener){trustedFoldersChangeListeners.add(listener);return()=>trustedFoldersChangeListeners.delete(listener)}__name(onTrustedFoldersChanged,"onTrustedFoldersChanged");function notifyTrustedFoldersChanged(){for(const listener of trustedFoldersChangeListeners)listener()}__name(notifyTrustedFoldersChanged,"notifyTrustedFoldersChanged");var LoadedTrustedFolders=class{constructor(user,errors){this.user=user;this.errors=errors}static{__name(this,"LoadedTrustedFolders")}get rules(){return Object.entries(this.user.config).map(([path4,trustLevel])=>({path:path4,trustLevel}))}isPathTrusted(location){return resolveTrustDecision(buildTrustPrecedenceRules(this.rules),getPathComparisonVariants(location))}setValue(path4,trustLevel,preserveExistingTrust=false){const committedConfig=writeTrustedFolders(this.user.path,diskConfig=>{const existing=diskConfig[path4];if(preserveExistingTrust&&(existing==="TRUST_FOLDER"||existing==="TRUST_PARENT")){return diskConfig}return{...diskConfig,[path4]:trustLevel}});this.user.config=committedConfig;notifyTrustedFoldersChanged()}};var loadedTrustedFolders;function resetTrustedFoldersForTesting(){loadedTrustedFolders=void 0}__name(resetTrustedFoldersForTesting,"resetTrustedFoldersForTesting");function loadTrustedFolders(){loadedTrustedFolders??=readTrustedFoldersFile(false);return loadedTrustedFolders}__name(loadTrustedFolders,"loadTrustedFolders");function loadTrustedFoldersFresh(){return readTrustedFoldersFile(true)}__name(loadTrustedFoldersFresh,"loadTrustedFoldersFresh");function readTrustedFoldersFile(validateRules){const errors=[];let userConfig={};const userPath=getTrustedFoldersPath();try{if(fs4.existsSync(userPath)){const content=fs4.readFileSync(userPath,"utf-8");const parsed=parseJsoncObject(content);if(validateRules)assertTrustedFoldersConfig(parsed);userConfig=parsed}}catch(error){errors.push({message:error instanceof Error&&error.message==="JSONC document root is not a JSON object."?"Trusted folders file is not a valid JSON object.":getErrorMessage(error),path:userPath})}return new LoadedTrustedFolders({path:userPath,config:userConfig},errors)}__name(readTrustedFoldersFile,"readTrustedFoldersFile");function createLocalWorkflowAncestorTrustProvider(settings){return async(ancestorDirs,canonicalTargetDir)=>{if(!isFolderTrustEnabled(settings)){return ancestorDirs.map(isWorkflowAncestorDirectorySafe)}if(ideContextStore.get()?.workspaceState?.isTrusted===false){return ancestorDirs.map(()=>false)}const folders=loadTrustedFoldersFresh();if(folders.errors.length>0){debugLogger.warn("Workflow ancestor trust denied: invalid trusted folders snapshot:",folders.errors.map(error=>`${error.path}: ${error.message}`).join("; "));return ancestorDirs.map(()=>false)}if(folders.isPathTrusted(canonicalTargetDir)!==true){return ancestorDirs.map(()=>false)}return ancestorDirs.map(directory=>folders.isPathTrusted(directory)===true)}}__name(createLocalWorkflowAncestorTrustProvider,"createLocalWorkflowAncestorTrustProvider");function saveTrustedFolders(trustedFoldersFile){writeTrustedFolders(trustedFoldersFile.path,()=>({...trustedFoldersFile.config}))}__name(saveTrustedFolders,"saveTrustedFolders");function assertTrustedFoldersConfig(config){for(const[rulePath,trustLevel]of Object.entries(config)){if(!Object.values(TrustLevel).includes(trustLevel)){throw new FatalConfigError(`Invalid trusted folder rule for ${JSON.stringify(rulePath)}.`)}}}__name(assertTrustedFoldersConfig,"assertTrustedFoldersConfig");function writeTrustedFolders(filePath,update){const dirPath=path3.dirname(filePath);if(!fs4.existsSync(dirPath)){fs4.mkdirSync(dirPath,{recursive:true})}const release=import_proper_lockfile.default.lockSync(filePath,{realpath:false,stale:1e4,onCompromised:__name(err=>{debugLogger.warn("trusted folders lock compromised:",err)},"onCompromised")});try{let originalContent="{}";if(fs4.existsSync(filePath)){const stat=fs4.lstatSync(filePath);if(stat.isSymbolicLink()||!stat.isFile()){throw new FatalConfigError("Trusted folders path must be a regular file.")}originalContent=fs4.readFileSync(filePath,"utf-8")}let parsed;try{parsed=parseJsoncObject(originalContent)}catch(error){if(error instanceof Error&&error.message==="JSONC document root is not a JSON object."){throw new FatalConfigError("Trusted folders file is not a valid JSON object.")}throw error}const diskConfig=Object.fromEntries(Object.entries(parsed));assertTrustedFoldersConfig(diskConfig);const nextConfig=update({...diskConfig});assertTrustedFoldersConfig(nextConfig);const content=updateJsoncContent(originalContent,nextConfig,true);atomicWriteFileSync(filePath,content,{encoding:"utf-8",mode:384,forceMode:true,noFollow:true});return nextConfig}finally{try{release()}catch{}}}__name(writeTrustedFolders,"writeTrustedFolders");function isFolderTrustEnabled(settings){const folderTrustSetting=settings.security?.folderTrust?.enabled??false;return folderTrustSetting}__name(isFolderTrustEnabled,"isFolderTrustEnabled");function getExplicitTrustLevel(trustConfig,workspaceCwd){const winner=resolveTrustRule(buildTrustPrecedenceRules(Object.entries(trustConfig).map(([rulePath,trustLevel])=>({path:rulePath,trustLevel}))),getPathComparisonVariants(workspaceCwd));return winner?.payload??null}__name(getExplicitTrustLevel,"getExplicitTrustLevel");function loadTrustedFoldersWithOverrides(trustConfig){const folders=loadTrustedFolders();if(folders.errors.length>0){const errorMessages=folders.errors.map(error=>`Error in ${error.path}: ${error.message}`);throw new FatalConfigError(`${errorMessages.join("\n")}
|
|
4
4
|
Please fix the configuration file and try again.`)}if(trustConfig){return new LoadedTrustedFolders({...folders.user,config:trustConfig},folders.errors)}return folders}__name(loadTrustedFoldersWithOverrides,"loadTrustedFoldersWithOverrides");function trustStatusToResult(status){if(status.effective.source==="disabled"){return{isTrusted:true,source:void 0}}return{isTrusted:status.effective.state==="trusted"?true:status.effective.state==="untrusted"?false:void 0,source:status.effective.source==="file"||status.effective.source==="ide"?status.effective.source:void 0}}__name(trustStatusToResult,"trustStatusToResult");function getWorkspaceTrustStatus(settings,workspaceCwd,trustConfig){if(!isFolderTrustEnabled(settings)){return{v:1,workspaceCwd,folderTrustEnabled:false,effective:{state:"trusted",source:"disabled"},explicitTrustLevel:null,requiresDaemonRestartForChanges:true}}const ideTrust=ideContextStore.get()?.workspaceState?.isTrusted;if(ideTrust!==void 0&&arePathsEquivalent(workspaceCwd,process.cwd())){return{v:1,workspaceCwd,folderTrustEnabled:true,effective:{state:ideTrust?"trusted":"untrusted",source:"ide"},explicitTrustLevel:null,requiresDaemonRestartForChanges:true}}const folders=loadTrustedFoldersWithOverrides(trustConfig);const isTrusted=folders.isPathTrusted(workspaceCwd);const state=isTrusted===true?"trusted":isTrusted===false?"untrusted":"unknown";return{v:1,workspaceCwd,folderTrustEnabled:true,effective:{state,source:isTrusted===void 0?"none":"file"},explicitTrustLevel:getExplicitTrustLevel(folders.user.config,workspaceCwd),requiresDaemonRestartForChanges:true}}__name(getWorkspaceTrustStatus,"getWorkspaceTrustStatus");function isWorkspaceTrusted(settings,trustConfig,workspacePath){if(!isFolderTrustEnabled(settings)){return{isTrusted:true,source:void 0}}const ideTrust=ideContextStore.get()?.workspaceState?.isTrusted;if(ideTrust!==void 0&&(workspacePath===void 0||arePathsEquivalent(workspacePath,process.cwd()))){return{isTrusted:ideTrust,source:"ide"}}return trustStatusToResult(getWorkspaceTrustStatus(settings,workspacePath??process.cwd(),trustConfig))}__name(isWorkspaceTrusted,"isWorkspaceTrusted");export{writeWithBackupSync,updateSettingsFilePreservingFormat,parseJsoncObject,isWorkflowAncestorDirectorySafe,TRUSTED_FOLDERS_FILENAME,getTrustedFoldersPath,TrustLevel,onTrustedFoldersChanged,LoadedTrustedFolders,resetTrustedFoldersForTesting,loadTrustedFolders,loadTrustedFoldersFresh,createLocalWorkflowAncestorTrustProvider,saveTrustedFolders,isFolderTrustEnabled,getExplicitTrustLevel,getWorkspaceTrustStatus,isWorkspaceTrusted};
|
|
5
5
|
/**
|
|
6
6
|
* @license
|