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.
Files changed (237) hide show
  1. package/README.md +8 -8
  2. package/chunks/{MaxSizedBox-VMVLMS4X.js → MaxSizedBox-QCIXIS4P.js} +1 -1
  3. package/chunks/{StandaloneSessionPicker-UNORCVYY.js → StandaloneSessionPicker-BAFAIRT7.js} +1 -1
  4. package/chunks/{acp-subagent-executor-623ZUTJT.js → acp-subagent-executor-TPVXURLW.js} +1 -1
  5. package/chunks/{acpAgent-MTTDTK2C.js → acpAgent-67UN66PB.js} +3 -3
  6. package/chunks/{advisor-ANUGICJ5.js → advisor-SAXMI4QZ.js} +1 -1
  7. package/chunks/{agent-GNCQDICJ.js → agent-KV7BXY6C.js} +1 -1
  8. package/chunks/{agent-headless-OPUXAXQM.js → agent-headless-FQX3JGG6.js} +1 -1
  9. package/chunks/{agent-host-client-K6GRPTFD.js → agent-host-client-L5EHC4AC.js} +1 -1
  10. package/chunks/{agent-host-connections-MF3YBZU2.js → agent-host-connections-EDBMCVQF.js} +1 -1
  11. package/chunks/{anthropicContentGenerator-OK4PFE5Y.js → anthropicContentGenerator-V7TX2NXP.js} +1 -1
  12. package/chunks/{autofix-pr-MABTGEHZ.js → autofix-pr-WP34NYHL.js} +1 -1
  13. package/chunks/{batch-V2NJT3M5.js → batch-XFVQ4BLM.js} +1 -1
  14. package/chunks/{bridge-BJQ627CX.js → bridge-AE7AFEXB.js} +1 -1
  15. package/chunks/{channel-settings-store-4JMCI4UR.js → channel-settings-store-X63P5OVT.js} +1 -1
  16. package/chunks/{chunk-ZN57TOVA.js → chunk-2DU2WMTL.js} +1 -1
  17. package/chunks/{chunk-Z5XENA4A.js → chunk-2JGTWRZJ.js} +8 -7
  18. package/chunks/{chunk-MTW3A3KT.js → chunk-2LWJGXTW.js} +1 -1
  19. package/chunks/{chunk-OCBJCZC2.js → chunk-2N3NBTYJ.js} +1 -1
  20. package/chunks/{chunk-WI4UMN3Q.js → chunk-2TAJ5STJ.js} +1 -1
  21. package/chunks/{chunk-EIILQ6KT.js → chunk-32XHDDIA.js} +1 -1
  22. package/chunks/{chunk-FNXO5KWB.js → chunk-34HC2AXI.js} +2 -2
  23. package/chunks/{chunk-2X3UF2CF.js → chunk-3W32X2DH.js} +1 -1
  24. package/chunks/{chunk-CKZRJP4F.js → chunk-4ME3BUJK.js} +1 -1
  25. package/chunks/{chunk-NVSKOSFG.js → chunk-4NDJKNN6.js} +1 -1
  26. package/chunks/{chunk-BRPJ5EHA.js → chunk-5EXL4TKQ.js} +1 -1
  27. package/chunks/{chunk-3XBJYUWP.js → chunk-65ME4BOH.js} +1 -1
  28. package/chunks/{chunk-TQTIEK2W.js → chunk-7453BHJO.js} +1 -1
  29. package/chunks/{chunk-HSYBIGMS.js → chunk-76FSYQTG.js} +1 -1
  30. package/chunks/{chunk-FNB3DPQZ.js → chunk-7RNOS7R4.js} +1 -1
  31. package/chunks/{chunk-H57IX45A.js → chunk-AEKEZRIU.js} +1 -1
  32. package/chunks/{chunk-CXGGC4NO.js → chunk-AEZYXPFS.js} +1 -1
  33. package/chunks/{chunk-NGOIJH7K.js → chunk-AFO5ER23.js} +1 -1
  34. package/chunks/{chunk-UY2ET2AL.js → chunk-AYVCT5FF.js} +1 -1
  35. package/chunks/{chunk-QOYRDEXR.js → chunk-B37YY4XU.js} +1 -1
  36. package/chunks/{chunk-IDUGQMTP.js → chunk-BAUMVH4Q.js} +1 -1
  37. package/chunks/{chunk-CAPG7UVH.js → chunk-BCI62WSL.js} +1 -1
  38. package/chunks/{chunk-USJFJZ23.js → chunk-BGELKSQ4.js} +1 -1
  39. package/chunks/{chunk-6X73W4TL.js → chunk-BHIDG6VZ.js} +1 -1
  40. package/chunks/{chunk-26ISBUM7.js → chunk-BPFFRPWE.js} +6 -6
  41. package/chunks/{chunk-YGHM5CDT.js → chunk-BQZF3UKI.js} +1 -1
  42. package/chunks/{chunk-3NQESE5K.js → chunk-CBE6ZIHU.js} +1 -1
  43. package/chunks/{chunk-DEMXCA3K.js → chunk-CF6SZJNP.js} +1 -1
  44. package/chunks/{chunk-2VCDJ6UF.js → chunk-CGDFZEER.js} +1 -1
  45. package/chunks/{chunk-3WQPUP5U.js → chunk-CUP2TNJK.js} +1 -1
  46. package/chunks/{chunk-2IGE2K5V.js → chunk-DA6LOBSB.js} +1 -1
  47. package/chunks/{chunk-HFV6CQWE.js → chunk-EFIRES46.js} +1 -1
  48. package/chunks/{chunk-E5YRAQXM.js → chunk-EKRUF347.js} +1 -1
  49. package/chunks/{chunk-KN27BFXM.js → chunk-ELDZ4MNL.js} +1 -1
  50. package/chunks/{chunk-ADTFKUH2.js → chunk-ET5M5WFN.js} +1 -1
  51. package/chunks/{chunk-IBYFSHBB.js → chunk-EXIFPXMB.js} +1 -1
  52. package/chunks/{chunk-IA4K4PGK.js → chunk-EYPLBTMI.js} +1 -1
  53. package/chunks/{chunk-DTTC4ZKY.js → chunk-FEP6W4NJ.js} +1 -1
  54. package/chunks/{chunk-FHBGTZ4K.js → chunk-FKL3V5BO.js} +1 -1
  55. package/chunks/{chunk-Q5E5SOY2.js → chunk-FKZ46GKL.js} +1 -1
  56. package/chunks/{chunk-OPYGNTZP.js → chunk-FYBJGRX7.js} +1 -1
  57. package/chunks/{chunk-FPZPCZFS.js → chunk-G6DALGGS.js} +1 -1
  58. package/chunks/{chunk-3Y6LSWEW.js → chunk-GBSRWT7J.js} +1 -1
  59. package/chunks/{chunk-SMYBY353.js → chunk-GHIFIXNX.js} +1 -1
  60. package/chunks/{chunk-DE53B2R7.js → chunk-GRAECADD.js} +1 -1
  61. package/chunks/{chunk-UJYOILZR.js → chunk-GSPGIGO5.js} +3 -3
  62. package/chunks/{chunk-5UZT4SXG.js → chunk-H3IR3GIE.js} +1 -1
  63. package/chunks/{chunk-ADZI3OFT.js → chunk-HOG66S6K.js} +1 -1
  64. package/chunks/{chunk-WB34KMOT.js → chunk-HTAUIJB4.js} +1 -1
  65. package/chunks/{chunk-MPAR4JBP.js → chunk-I6PUY2T3.js} +1 -1
  66. package/chunks/{chunk-5ZQWQ3RK.js → chunk-IZ5MWA6E.js} +1 -1
  67. package/chunks/{chunk-7IERHQ63.js → chunk-JEDL4IKF.js} +1 -1
  68. package/chunks/{chunk-RVJJFDF3.js → chunk-JH3V5SPA.js} +1 -1
  69. package/chunks/{chunk-SELRSZFK.js → chunk-JRTOPEM3.js} +1 -1
  70. package/chunks/{chunk-SQQORHMS.js → chunk-JWNKPINR.js} +1 -1
  71. package/chunks/{chunk-55RVKT4O.js → chunk-KJGRCIVY.js} +1 -1
  72. package/chunks/{chunk-GSOBASYW.js → chunk-KZNYALFU.js} +1 -1
  73. package/chunks/{chunk-FDUXQAGW.js → chunk-LBLLWAKK.js} +1 -1
  74. package/chunks/{chunk-ZSVSRF4C.js → chunk-LT3J74BZ.js} +1 -1
  75. package/chunks/{chunk-AMTFJVDD.js → chunk-LTE4N6L3.js} +1 -1
  76. package/chunks/{chunk-F26LTWDZ.js → chunk-M6KB5RVD.js} +1 -1
  77. package/chunks/{chunk-2PY7R7GG.js → chunk-MGATL4OA.js} +1 -1
  78. package/chunks/{chunk-KGJ47CI5.js → chunk-MPVQDYPH.js} +1 -1
  79. package/chunks/{chunk-BBOJUFMW.js → chunk-MTDBCIDA.js} +1 -1
  80. package/chunks/{chunk-ZYTG6R7S.js → chunk-MYV7GY3H.js} +1 -1
  81. package/chunks/{chunk-4GC5HJZO.js → chunk-N7PWZBXV.js} +1 -1
  82. package/chunks/{chunk-2NOMOJWE.js → chunk-NA4ZF2FE.js} +2 -2
  83. package/chunks/{chunk-7MTBINFX.js → chunk-NEKPQLFY.js} +2 -2
  84. package/chunks/{chunk-ABJGFEES.js → chunk-NO7VTKRL.js} +1 -1
  85. package/chunks/{chunk-OHXQYU6S.js → chunk-NONBHCXP.js} +1 -1
  86. package/chunks/{chunk-ZOBX6C7E.js → chunk-NVOI6UDQ.js} +1 -1
  87. package/chunks/{chunk-YLAI26PX.js → chunk-OJ4K62S2.js} +1 -1
  88. package/chunks/{chunk-CCOUFBOY.js → chunk-OK7LBM5G.js} +1 -1
  89. package/chunks/{chunk-POA4NX4N.js → chunk-OOJ2AQT3.js} +1 -1
  90. package/chunks/{chunk-5WLKN3GD.js → chunk-OU7CEG7Q.js} +1 -1
  91. package/chunks/{chunk-4TYTJQWR.js → chunk-P3JEEDQZ.js} +1 -1
  92. package/chunks/{chunk-AQWHCRKY.js → chunk-P62S5JGM.js} +1 -1
  93. package/chunks/{chunk-B6D3KTUK.js → chunk-QDCUR3JB.js} +1 -1
  94. package/chunks/{chunk-XFLLE2J3.js → chunk-RSLTOIG5.js} +2 -2
  95. package/chunks/{chunk-ISGF3BVD.js → chunk-RXN7DUMP.js} +2 -2
  96. package/chunks/{chunk-PN62SUYK.js → chunk-SKGJ26HQ.js} +1 -1
  97. package/chunks/{chunk-62NLMVVT.js → chunk-SP6CQ3MO.js} +1 -1
  98. package/chunks/{chunk-4EQWJTJR.js → chunk-T2YTHAJW.js} +1 -1
  99. package/chunks/{chunk-NO26JN24.js → chunk-T53VMDXH.js} +1 -1
  100. package/chunks/{chunk-X4BFEDWU.js → chunk-T5DKF33F.js} +1 -1
  101. package/chunks/{chunk-KKBOCRPF.js → chunk-TB4AUC2L.js} +1 -1
  102. package/chunks/{chunk-Q6QS5JTK.js → chunk-U3Q72OGV.js} +1 -1
  103. package/chunks/{chunk-FLJLUMQF.js → chunk-UKLXKJKL.js} +1 -1
  104. package/chunks/{chunk-IH2PFVWO.js → chunk-VD2GSW64.js} +1 -1
  105. package/chunks/{chunk-VDRE7U3P.js → chunk-VRKYBH5G.js} +5 -5
  106. package/chunks/{chunk-MOPJNP5I.js → chunk-W2RQIZ6B.js} +1 -1
  107. package/chunks/{chunk-2LLPGSUK.js → chunk-W5Z4BWWA.js} +1 -1
  108. package/chunks/{chunk-CNFA5UUM.js → chunk-W66WWTOP.js} +1 -1
  109. package/chunks/{chunk-C56YJIEI.js → chunk-WGFX3EL3.js} +1 -1
  110. package/chunks/{chunk-6NI33TVK.js → chunk-X2TY7VTY.js} +1 -1
  111. package/chunks/{chunk-FIM7MM25.js → chunk-XISR37DQ.js} +1 -1
  112. package/chunks/{chunk-KDYUZBZC.js → chunk-YH2XRWRF.js} +1 -1
  113. package/chunks/{chunk-UBXLQ6TP.js → chunk-ZENMAISJ.js} +1 -1
  114. package/chunks/{codex-subagent-executor-EK3A2WBH.js → codex-subagent-executor-OLMGVPVS.js} +1 -1
  115. package/chunks/{config-utils-DLOK7OLM.js → config-utils-OWY5G5Y2.js} +1 -1
  116. package/chunks/{contextCommand-AVCUCHQC.js → contextCommand-IXFUZH65.js} +1 -1
  117. package/chunks/{core-runtime-QSS4ZTG6.js → core-runtime-O4LC4NY3.js} +1 -1
  118. package/chunks/{create-sub-session-PNF7QDKC.js → create-sub-session-6F7C3TMT.js} +1 -1
  119. package/chunks/{cron-create-C6JOFIU4.js → cron-create-2422NBSJ.js} +1 -1
  120. package/chunks/{daemon-git-worktree-guard-5XZAZ7D2.js → daemon-git-worktree-guard-EWPQA6NO.js} +1 -1
  121. package/chunks/{daemon-status-provider-MRNELSNJ.js → daemon-status-provider-FAHOXNFW.js} +1 -1
  122. package/chunks/{daemon-trust-policy-26CMW3WY.js → daemon-trust-policy-L3DM6AI5.js} +1 -1
  123. package/chunks/{daemon-trust-policy-monitor-3DWO6NQY.js → daemon-trust-policy-monitor-HNPY5KJ4.js} +1 -1
  124. package/chunks/{deferred-core-runtime-DEC3N46T.js → deferred-core-runtime-JF42NQJK.js} +1 -1
  125. package/chunks/{edit-3HMQPCHN.js → edit-E5LEI2LL.js} +1 -1
  126. package/chunks/{enterPlanMode-QHJF4JXZ.js → enterPlanMode-3COTUV5V.js} +1 -1
  127. package/chunks/{environment-NGIBJWOT.js → environment-XBBIB3VA.js} +1 -1
  128. package/chunks/{errors-MSTGCVGJ.js → errors-LNMQ7TUK.js} +1 -1
  129. package/chunks/{execution-tool-VR4TGOI4.js → execution-tool-QDDKJD2K.js} +1 -1
  130. package/chunks/{execution-worker-EJH7HIE2.js → execution-worker-TXGZRZXE.js} +1 -1
  131. package/chunks/{exitPlanMode-P25OHQJ6.js → exitPlanMode-Z7QEMWPE.js} +1 -1
  132. package/chunks/{fast-path-II433ZDP.js → fast-path-M6K2RACY.js} +1 -1
  133. package/chunks/{glob-4Q6DCT3F.js → glob-N2QT4U7U.js} +1 -1
  134. package/chunks/{goal-tools-FFMAJW6V.js → goal-tools-CUSQD3DG.js} +1 -1
  135. package/chunks/{handleAutoUpdate-QNM26NZK.js → handleAutoUpdate-QF2YQHF6.js} +1 -1
  136. package/chunks/{i18n-L5URVOBB.js → i18n-AGOA6MUI.js} +1 -1
  137. package/chunks/{initializer-NQ2NECYP.js → initializer-FRKYDUSX.js} +1 -1
  138. package/chunks/{installationInfo-BCTXASUM.js → installationInfo-OKA4WXAS.js} +1 -1
  139. package/chunks/{interactive-mod-session-PPTBI37E.js → interactive-mod-session-MWYN5IFK.js} +1 -1
  140. package/chunks/{list-7TE5TUZJ.js → list-DE7VUIR2.js} +1 -1
  141. package/chunks/{llm-BWWKUBBZ.js → llm-N3JGJHYC.js} +4 -4
  142. package/chunks/{llm-content-generator-QOTGPBYC.js → llm-content-generator-VMUBA7OJ.js} +1 -1
  143. package/chunks/{loadedSettingsAdapter-THAGI5M2.js → loadedSettingsAdapter-5C36OZ7N.js} +1 -1
  144. package/chunks/{local-7BTAGV4J.js → local-BE624O3A.js} +1 -1
  145. package/chunks/{local-execution-environment-S3OR4KSC.js → local-execution-environment-OPGM7Y6L.js} +1 -1
  146. package/chunks/{loggingContentGenerator-AXJ5E5RS.js → loggingContentGenerator-2MHAI6JR.js} +1 -1
  147. package/chunks/{loop-wakeup-AJTLMLRX.js → loop-wakeup-BDLATBXH.js} +1 -1
  148. package/chunks/{manage-memory-JHTUVMDJ.js → manage-memory-BBCEIIWB.js} +1 -1
  149. package/chunks/{managed-execution-engine-U6GNJ4U4.js → managed-execution-engine-SRFALTCX.js} +1 -1
  150. package/chunks/{managed-local-serve-P4ZXVRBU.js → managed-local-serve-ICNAS3E6.js} +1 -1
  151. package/chunks/{managed-npm-update-UDUILNR5.js → managed-npm-update-CTL6LH5Z.js} +1 -1
  152. package/chunks/{managed-runtime-attestation-worker-P34ZBNRG.js → managed-runtime-attestation-worker-ZRDWKXCI.js} +1 -1
  153. package/chunks/{managed-runtime-bootstrap-CLMYNPH5.js → managed-runtime-bootstrap-6NTGZXQL.js} +1 -1
  154. package/chunks/{managed-runtime-session-worker-7H7AZJBV.js → managed-runtime-session-worker-RKQBBFR6.js} +1 -1
  155. package/chunks/{managed-runtime-ssh-worker-5KEMC7FD.js → managed-runtime-ssh-worker-FCGV6FSW.js} +1 -1
  156. package/chunks/{managed-session-authority-CFUZ45HT.js → managed-session-authority-C7IW6TJX.js} +1 -1
  157. package/chunks/{mcp-YMG4RVMC.js → mcp-VC4CJPE5.js} +1 -1
  158. package/chunks/{memory-7STURUXK.js → memory-S6OJA3ZD.js} +1 -1
  159. package/chunks/mn-JMS6SWTO.js +8 -0
  160. package/chunks/{model-call-collection-WBWTO3EG.js → model-call-collection-MJZWRQSU.js} +1 -1
  161. package/chunks/{model-configuration-6KCZZSZD.js → model-configuration-SKU6L3QI.js} +1 -1
  162. package/chunks/{modelConfigUtils-Z2EKFSPN.js → modelConfigUtils-TJCB6NXT.js} +1 -1
  163. package/chunks/{monitor-U5E33JO6.js → monitor-M3PNLCYP.js} +1 -1
  164. package/chunks/{nonInteractiveCli-BVCL5I5R.js → nonInteractiveCli-MR7JLAWU.js} +1 -1
  165. package/chunks/{nonInteractiveToolExecutor-B4EUOMYF.js → nonInteractiveToolExecutor-YKA6JMTY.js} +1 -1
  166. package/chunks/{notebook-edit-MXKD5J2C.js → notebook-edit-ENTFB5D7.js} +1 -1
  167. package/chunks/{omni-I5YECZBW.js → omni-6YBX4R6K.js} +1 -1
  168. package/chunks/{openaiContentGenerator-Q5SINFJJ.js → openaiContentGenerator-XRXX33FY.js} +1 -1
  169. package/chunks/{openaiResponsesContentGenerator-R3XCZLZY.js → openaiResponsesContentGenerator-L6ONEHMR.js} +1 -1
  170. package/chunks/{pidfile-UOGUNUTK.js → pidfile-XR4JF2Z6.js} +1 -1
  171. package/chunks/{processUtils-QGQGZHBA.js → processUtils-GQYNJRBJ.js} +1 -1
  172. package/chunks/{prompt-terminal-ledger-L57JMVSR.js → prompt-terminal-ledger-7BM7YDLG.js} +1 -1
  173. package/chunks/{qwenContentGenerator-UKZ237LC.js → qwenContentGenerator-QSA32XEL.js} +1 -1
  174. package/chunks/{reactive-degrade-3OM3HWVA.js → reactive-degrade-TFNBAAPZ.js} +1 -1
  175. package/chunks/{read-file-63ZLWMOW.js → read-file-VD7OFO2E.js} +1 -1
  176. package/chunks/{resumeHistoryUtils-R5YQS4YQ.js → resumeHistoryUtils-2B4KPI7G.js} +1 -1
  177. package/chunks/{review-AT6OWVDO.js → review-C365WGCW.js} +1 -1
  178. package/chunks/{ripGrep-7KBZGTPV.js → ripGrep-D7WPMBXR.js} +1 -1
  179. package/chunks/{run-qwen-serve-CLBG7W6F.js → run-qwen-serve-NZWQHWQA.js} +1 -1
  180. package/chunks/{runtime-R3QIGB7U.js → runtime-J6SPBSCS.js} +1 -1
  181. package/chunks/{sandboxConfig-PM3ZRQYV.js → sandboxConfig-QS2XBPZG.js} +1 -1
  182. package/chunks/{scheduled-tasks-PUMNN5XV.js → scheduled-tasks-YNNIOOPM.js} +1 -1
  183. package/chunks/{scheduler-KTPM226B.js → scheduler-KCMSPHON.js} +1 -1
  184. package/chunks/{search-memory-7I5MGDNV.js → search-memory-EUBJ7IAV.js} +1 -1
  185. package/chunks/{send-message-J526AEBI.js → send-message-CWWZUPSK.js} +1 -1
  186. package/chunks/{serve-KLTMPK4W.js → serve-4CB4BWJ5.js} +1 -1
  187. package/chunks/{server-VLRNY6KG.js → server-JNANUIGC.js} +3 -3
  188. package/chunks/{session-2EB57NXY.js → session-3LQLXPUA.js} +1 -1
  189. package/chunks/{session-attachments-root-I7TESMWL.js → session-attachments-root-BWIVWFHJ.js} +1 -1
  190. package/chunks/{session-execution-engine-selector-5FAMSPSO.js → session-execution-engine-selector-5OLRX57L.js} +1 -1
  191. package/chunks/{session-pr-refresh-JCPVQPNJ.js → session-pr-refresh-RLF3EXS3.js} +1 -1
  192. package/chunks/{sessionService-YRW2IFPR.js → sessionService-U7ACD2HP.js} +1 -1
  193. package/chunks/{settings-KO2Q47JP.js → settings-FTGWYTUH.js} +1 -1
  194. package/chunks/{shell-OLZVNTQZ.js → shell-E4RENYQC.js} +1 -1
  195. package/chunks/{skill-XW2AQS7M.js → skill-OLNPHRWB.js} +1 -1
  196. package/chunks/{skill-settings-TKAVQ4XP.js → skill-settings-R2BV2GEK.js} +1 -1
  197. package/chunks/{spawnChannel-MBGCTK2J.js → spawnChannel-LOPAR5T2.js} +1 -1
  198. package/chunks/{standalone-update-A3YLLIAN.js → standalone-update-IGDX2RGN.js} +1 -1
  199. package/chunks/{start-opentui-ui-G5ROAR4V.js → start-opentui-ui-33QLBNRC.js} +1 -1
  200. package/chunks/{startInteractiveUI-PZQR4U53.js → startInteractiveUI-RQKHD7MM.js} +1 -1
  201. package/chunks/{team-create-S5ZY2UMF.js → team-create-HAVKHNU5.js} +1 -1
  202. package/chunks/{team-plan-approval-KX6RXEST.js → team-plan-approval-7MCQX67C.js} +1 -1
  203. package/chunks/{terminal-image-renderer-SCJREXE6.js → terminal-image-renderer-XT5JVEO6.js} +1 -1
  204. package/chunks/{theme-manager-DZSM4EBR.js → theme-manager-DR5EYGLT.js} +1 -1
  205. package/chunks/{tool-call-UK56SWCT.js → tool-call-LZHZ5RVH.js} +1 -1
  206. package/chunks/{tool-result-media-JLLSLGFL.js → tool-result-media-XCXCF4YC.js} +1 -1
  207. package/chunks/{tool-search-OWPFLVV5.js → tool-search-K6S3ON7M.js} +1 -1
  208. package/chunks/{total-session-admission-NQU4ACKH.js → total-session-admission-LGSS2VWS.js} +1 -1
  209. package/chunks/{trustedFolders-N7GXFYSF.js → trustedFolders-IIR2UZRL.js} +1 -1
  210. package/chunks/{update-relaunch-5SPXXHM2.js → update-relaunch-WVIFX5CN.js} +1 -1
  211. package/chunks/{updateCheck-VXUIX2XG.js → updateCheck-CMEWLLZJ.js} +1 -1
  212. package/chunks/{upload-config-OWLL4SRQ.js → upload-config-TCCFCNCD.js} +1 -1
  213. package/chunks/{useAutoAcceptIndicator-OUYRR56F.js → useAutoAcceptIndicator-5RTTH3OW.js} +1 -1
  214. package/chunks/{validateNonInterActiveAuth-PSVJO5HK.js → validateNonInterActiveAuth-AO336KDX.js} +1 -1
  215. package/chunks/{version-C26S7UAW.js → version-JYWKKMNP.js} +1 -1
  216. package/chunks/{web-fetch-AYOYV7R4.js → web-fetch-HWTAWXFM.js} +1 -1
  217. package/chunks/{web-search-DAREKD3Z.js → web-search-HAI5LW3G.js} +1 -1
  218. package/chunks/{workflow-WBGPKVO6.js → workflow-BZ2YFGF6.js} +1 -1
  219. package/chunks/{workflow-ancestor-trust-GEEB53TB.js → workflow-ancestor-trust-26TFXFPO.js} +1 -1
  220. package/chunks/{workspace-agents-IMAQME4W.js → workspace-agents-DLI4JQJZ.js} +1 -1
  221. package/chunks/{workspace-providers-status-VALHVEU2.js → workspace-providers-status-64C7DJZU.js} +1 -1
  222. package/chunks/{workspace-recovery-worker-AIAVRDGU.js → workspace-recovery-worker-IFRT3KKP.js} +1 -1
  223. package/chunks/{workspace-registration-store-FXEGZG3L.js → workspace-registration-store-MYKJM2SK.js} +1 -1
  224. package/chunks/{workspace-registry-GYFFHWCD.js → workspace-registry-GZJRONAY.js} +1 -1
  225. package/chunks/{workspace-runtime-coordinator-VZ462TLU.js → workspace-runtime-coordinator-44KW6HSN.js} +1 -1
  226. package/chunks/{workspace-service-5DIZM4IZ.js → workspace-service-YHTSZYYD.js} +1 -1
  227. package/chunks/{workspace-skills-status-DOOBVL5N.js → workspace-skills-status-NEB62X24.js} +1 -1
  228. package/chunks/{workspace-trust-reconciler-LOICVUVW.js → workspace-trust-reconciler-HZLOOZWM.js} +1 -1
  229. package/chunks/{write-file-EJNMAHQD.js → write-file-HD5LHXGL.js} +1 -1
  230. package/chunks/{zoom-image-S3OARMYP.js → zoom-image-W4BMRC5T.js} +1 -1
  231. package/cli.js +2 -2
  232. package/execution-worker.js +1 -1
  233. package/export-transcript-document.js +1 -1
  234. package/gerege.mjs +53 -15
  235. package/locales/mn.js +2702 -3774
  236. package/package.json +3 -3
  237. 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{memoryImportReservation,validateMemoryImportBatchProposal}from"./chunk-7IERHQ63.js";import{MEMORY_IMPORT_BUDGET,MemoryImportRequestError,digest,packMemoryImportSections,previewSource}from"./chunk-HSYBIGMS.js";import{rebuildAutoMemoryIndexAtRoot,tokenizeMemoryRecallTerms,tokenizeMemoryRecallText}from"./chunk-Z5XENA4A.js";import{parseAutoMemoryTopicDocument,resolveTrustedMemoryFile,scanAutoMemorySnapshot}from"./chunk-FUBDS3AV.js";import{require_proper_lockfile}from"./chunk-YIW3H46P.js";import{getImportedProjectMemoryRoot,getMemoryRootTrustedAnchor,getUserAutoMemoryRoot}from"./chunk-KVA6DHHF.js";import{Storage}from"./chunk-EPODBRBP.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 fs from"node:fs/promises";import{constants}from"node:fs";import{randomUUID}from"node:crypto";import{AsyncLocalStorage}from"node:async_hooks";import path from"node:path";var MemoryImportNotFoundError=class extends Error{static{__name(this,"MemoryImportNotFoundError")}code="ENOENT"};var ImportBudgetError=class extends Error{static{__name(this,"ImportBudgetError")}};var ImportContextError=class extends Error{static{__name(this,"ImportContextError")}};var heldLocks=new AsyncLocalStorage;var exists=__name(async file=>fs.lstat(file).then(()=>true,error=>{if(error.code==="ENOENT")return false;throw error}),"exists");async function privateDirectory(directory,anchor){const relative=path.relative(anchor,directory);if(relative.startsWith("..")||path.isAbsolute(relative))throw new Error("Import path escapes runtime.");let current=anchor;for(const part of["",...relative.split(path.sep).filter(Boolean)]){if(part)current=path.join(current,part);await fs.mkdir(current,{mode:448}).catch(error=>{if(error.code!=="EEXIST")throw error});const stat=await fs.lstat(current);if(!stat.isDirectory()||stat.isSymbolicLink())throw new Error("Import runtime directory must not be a symlink.")}}__name(privateDirectory,"privateDirectory");async function readJson(file){const handle=await fs.open(file,constants.O_RDONLY|constants.O_NOFOLLOW|constants.O_NONBLOCK);try{const stat=await handle.stat();if(!stat.isFile()||stat.size>16*1024*1024)throw new Error("Invalid import state file.");const buffer=Buffer.alloc(stat.size+1);const{bytesRead}=await handle.read(buffer,0,buffer.length,0);if(bytesRead>stat.size)throw new Error("Import state exceeds the supported limit.");return JSON.parse(buffer.subarray(0,bytesRead).toString("utf8"))}finally{await handle.close()}}__name(readJson,"readJson");async function writeJson(file,value){heldLocks.getStore()?.throwIfAborted();const tmp=`${file}.${randomUUID()}.tmp`;await fs.writeFile(tmp,JSON.stringify(value),{mode:384,flag:"wx"});try{heldLocks.getStore()?.throwIfAborted();await fs.rename(tmp,file)}finally{await fs.rm(tmp,{force:true})}}__name(writeJson,"writeJson");async function abortable(signal,work){signal.throwIfAborted();let abort;const cancelled=new Promise((_resolve,reject)=>{abort=__name(()=>reject(new Error("Import cancelled.")),"abort");signal.addEventListener("abort",abort,{once:true})});try{return await Promise.race([work(),cancelled])}finally{signal.removeEventListener("abort",abort)}}__name(abortable,"abortable");function publicTask(task){const{requestDigest:_requestDigest,...result}=task;return structuredClone({...result,usage:task.usage??{modelCalls:0,reservedTokens:0},budget:task.budget??{maxCalls:0,maxReservedTokens:0},result:{sourceSections:task.items.length,newDocuments:task.items.filter(item=>item.status==="added").reduce((n,item)=>n+(item.refs?.length??0),0),duplicateSections:task.items.filter(item=>item.status==="duplicate").length,conflictSections:task.items.filter(item=>item.status==="conflict").length,failedSections:task.items.filter(item=>item.status==="failed").length}})}__name(publicTask,"publicTask");function selectImportContext(existing,sources){const queries=sources.map(source=>({text:source.normalize("NFKC").toLowerCase(),terms:tokenizeMemoryRecallTerms(source)}));const index=existing.map(item=>{const parsed=parseAutoMemoryTopicDocument("existing.md",item.content);if(!parsed)throw new ImportContextError("Existing memory has no bounded metadata index. Repair its native metadata before importing.");const metadata=JSON.stringify({name:parsed.title,description:parsed.description,type:parsed.type,category:parsed.category,keywords:parsed.keywords,usage_scenarios:parsed.usageScenarios});const words=tokenizeMemoryRecallText([parsed.title,...parsed.keywords].join(" "));const anchors=[parsed.title,parsed.description].map(text=>text.normalize("NFKC").toLowerCase().trim()).filter(text=>tokenizeMemoryRecallText(text).length>=2);const body=parsed.body.normalize("NFKC").toLowerCase().trim();const relevant=queries.some(({text,terms})=>{if(anchors.some(anchor=>text.includes(anchor))||body.length>0&&text.includes(body))return true;const shared=words.filter(word=>terms.has(word));return shared.length>=2&&shared.length>=words.length/2});return{ref:item.ref,content:relevant?item.content:metadata,indexOnly:!relevant}});const context=[];let bytes=2;for(const entry of[...index.filter(item=>!item.indexOnly),...index.filter(item=>item.indexOnly)]){const size=Buffer.byteLength(JSON.stringify(entry))+(context.length?1:0);if(bytes+size>MEMORY_IMPORT_BUDGET.contextBytes){if(!entry.indexOnly)throw new ImportContextError("Relevant existing evidence exceeds the 32 KiB import context budget. Select a narrower source group or consolidate existing memory before retrying. No model call was made.");continue}bytes+=size;context.push(entry)}return context}__name(selectImportContext,"selectImportContext");function respectsImportScope(proposal,scope){return scope!=="user"||proposal.documents.every(content=>{const type=parseAutoMemoryTopicDocument("import.md",content)?.type;return type==="user"||type==="feedback"})}__name(respectsImportScope,"respectsImportScope");var MemoryImportService=class{constructor(options){this.options=options;this.owner=digest(path.resolve(options.projectRoot))}static{__name(this,"MemoryImportService")}base=Storage.getRuntimeBaseDir();state=path.join(this.base,"memory-import");owner;workers=new Map;controllers=new Map;async readState(file){const relative=path.relative(this.base,path.dirname(file));if(relative.startsWith("..")||path.isAbsolute(relative))throw new Error("Import state escapes runtime.");let current=this.base;for(const part of["",...relative.split(path.sep).filter(Boolean)]){if(part)current=path.join(current,part);const stat=await fs.lstat(current);if(!stat.isDirectory()||stat.isSymbolicLink())throw new Error("Invalid import state directory.")}return readJson(file)}taskDir(id){if(!/^[a-f0-9]{64}$/.test(id))throw new MemoryImportRequestError("Invalid import batch ID.");return path.join(this.state,"batches",this.owner,id)}async assertRuntimeOutsideGit(){let current=path.resolve(this.base);while(true){if(await exists(path.join(current,".git")))throw new Error("Memory import requires a runtime directory outside Git checkouts.");const parent=path.dirname(current);if(parent===current)break;current=parent}await fs.mkdir(this.base,{recursive:true,mode:448});current=await fs.realpath(this.base);while(true){if(await exists(path.join(current,".git")))throw new Error("Memory import requires a private runtime outside Git checkouts.");const parent=path.dirname(current);if(parent===current)break;current=parent}}async prepare(){this.options.assertActive();await this.assertRuntimeOutsideGit();await privateDirectory(path.join(this.state,"batches",this.owner),this.base)}async locked(directory,run,signal){await privateDirectory(directory,this.base);const ownership=new AbortController;const parent=heldLocks.getStore();const held=parent?AbortSignal.any([parent,ownership.signal]):ownership.signal;const work=signal?AbortSignal.any([signal,held]):held;let release;while(!release){work.throwIfAborted();this.options.assertActive();try{release=await import_proper_lockfile.default.lock(directory,{realpath:false,stale:12e4,update:1e4,retries:0,onCompromised:__name(()=>{ownership.abort(new Error("Import lock lost."))},"onCompromised")})}catch(error){if(error.code!=="ELOCKED")throw error;await new Promise(resolve=>setTimeout(resolve,250))}}try{work.throwIfAborted();const result=await heldLocks.run(held,()=>run(work));held.throwIfAborted();return result}finally{try{if(!ownership.signal.aborted)await release()}finally{ownership.abort(new Error("Import lock released."))}}}async submit(input,selections,key){this.options.assertActive();const preview=previewSource(input);if(typeof key!=="string"||!/^[\w-]{1,128}$/.test(key)||!Array.isArray(selections)||!selections.length||selections.length>2048)throw new MemoryImportRequestError("Provide an idempotency key and explicit non-empty selection.");const seen=new Set;const selected=selections.map(value=>{if(!value||typeof value!=="object")throw new MemoryImportRequestError("Invalid selection.");const selection=value;const section=preview.sections.find(item=>item.id===selection.id&&item.selectable);if(!section||seen.has(selection.id)||!["project","user"].includes(selection.scope))throw new MemoryImportRequestError("Invalid, duplicate or unavailable section selection.");seen.add(selection.id);return{...section,scope:selection.scope}}).sort((a,b)=>a.id.localeCompare(b.id));const retained=JSON.stringify({sections:selected});if(Buffer.byteLength(retained)>16*1024*1024)throw new MemoryImportRequestError("Selected contextual source exceeds the retained snapshot limit.");const requestDigest=digest(JSON.stringify(selected));const id=digest(`${this.owner}\0${key}`);await this.prepare();const dir=this.taskDir(id);return this.locked(path.join(this.state,"admission",this.owner),async()=>{this.options.assertActive();if(await exists(path.join(dir,"task.json"))){const task2=await this.readState(path.join(dir,"task.json"));if(task2.requestDigest!==requestDigest)throw new MemoryImportRequestError("Idempotency key was already used with a different selection.");this.kick(id);return publicTask(task2)}await privateDirectory(dir,this.base);await writeJson(path.join(dir,"source.json"),{sections:selected});const now=new Date().toISOString();const task={version:1,kind:"task",id,status:"queued",createdAt:now,updatedAt:now,requestDigest,usage:{modelCalls:0,reservedTokens:0},budget:{maxCalls:MEMORY_IMPORT_BUDGET.maxCalls,maxReservedTokens:MEMORY_IMPORT_BUDGET.maxReservedTokens},items:selected.map(section=>({id:section.id,scope:section.scope,status:"pending"}))};await writeJson(path.join(dir,"task.json"),task);this.kick(id);return publicTask(task)})}kick(id){if(this.workers.has(id))return;const worker=heldLocks.exit(()=>this.run(id)).catch(()=>{}).finally(()=>{this.workers.delete(id);this.controllers.delete(id)});this.workers.set(id,worker)}async recover(){this.options.assertActive();const root=path.join(this.state,"batches",this.owner);if(!await exists(root))return;await this.assertRuntimeOutsideGit();await privateDirectory(root,this.base);for(const id of(await fs.readdir(root)).filter(id2=>/^[a-f0-9]{64}$/.test(id2))){const task=await this.readState(path.join(this.taskDir(id),"task.json")).catch(()=>void 0);if(task&&(task.status==="running"||task.status==="queued"))this.kick(id)}}async list(){this.options.assertActive();const root=path.join(this.state,"batches",this.owner);if(!await exists(root))return[];await privateDirectory(root,this.base);const result=[];for(const id of(await fs.readdir(root)).filter(id2=>/^[a-f0-9]{64}$/.test(id2))){const task=await this.get(id).catch(()=>void 0);if(task)result.push(task)}return result.sort((a,b)=>b.createdAt.localeCompare(a.createdAt))}async get(id){this.options.assertActive();const task=await this.readState(path.join(this.taskDir(id),"task.json")).catch(cause=>{if(cause.code==="ENOENT")throw new MemoryImportNotFoundError("Import batch not found.",{cause});throw cause});if(task.status!=="completed"&&await exists(path.join(this.taskDir(id),"cancel.json")))task.status="cancelled";return publicTask(task)}async source(id,sectionId){await this.get(id);const source=await this.readState(path.join(this.taskDir(id),"source.json"));const section=source.sections.find(item=>item.id===sectionId);if(!section)throw new MemoryImportRequestError("Source section not found in this batch.");return section}async cancel(id){this.options.assertActive();this.controllers.get(id)?.abort();const task=await this.get(id);if(task.status==="completed")return task;await writeJson(path.join(this.taskDir(id),"cancel.json"),{cancelled:true});this.controllers.get(id)?.abort();await this.workers.get(id);return this.get(id)}async retry(id){await this.get(id);await this.prepare();await this.workers.get(id);const dir=this.taskDir(id);const result=await this.locked(dir,async()=>{const task=await this.readState(path.join(dir,"task.json"));if(task.status==="completed")return publicTask(task);await fs.rm(path.join(dir,"cancel.json"),{force:true});for(const item of task.items)if(item.status==="failed"){item.status="pending";delete item.reason}task.status="queued";task.updatedAt=new Date().toISOString();await writeJson(path.join(dir,"task.json"),task);return publicTask(task)});this.kick(id);return result}async idle(id){await this.workers.get(id);return this.get(id)}async run(id){const dir=this.taskDir(id);const controller=new AbortController;this.controllers.set(id,controller);await this.locked(dir,async signal=>{const task=await this.readState(path.join(dir,"task.json"));if(!["queued","running"].includes(task.status))return;const source=await this.readState(path.join(dir,"source.json"));if(!task.usage){task.usage={modelCalls:0,reservedTokens:0};task.budget={maxCalls:0,maxReservedTokens:0}}task.budget??={maxCalls:0,maxReservedTokens:0};task.status="running";await writeJson(path.join(dir,"task.json"),task);for(const section of packMemoryImportSections(source.sections).flat()){const item=task.items.find(item2=>item2.id===section.id);if(item.status!=="pending")continue;if(await exists(path.join(dir,"cancel.json")))controller.abort();if(controller.signal.aborted)break;try{this.options.assertActive();Object.assign(item,await this.importSection(section,id,signal,(before,ledger,proposalSignal)=>this.prepareProposal(section,source,task,before,ledger,proposalSignal),async()=>{if(await exists(path.join(dir,"cancel.json")))controller.abort();controller.signal.throwIfAborted();this.options.assertActive()}))}catch(error){if(controller.signal.aborted)break;item.status="failed";item.reason=error instanceof ImportBudgetError||error instanceof ImportContextError?error.message:"Import could not finish. Existing memories were preserved; retry after resolving runtime, model or storage availability."}task.updatedAt=new Date().toISOString();await writeJson(path.join(dir,"task.json"),task)}task.status=controller.signal.aborted?"cancelled":task.items.some(item=>item.status==="failed")?"partial":"completed";task.updatedAt=new Date().toISOString();await writeJson(path.join(dir,"task.json"),task)},controller.signal)}async prepareProposal(section,source,task,before,ledger,signal){const dir=this.taskDir(task.id);const journalFile=path.join(dir,"proposals.json");const journals=await exists(journalFile)?await this.readState(journalFile):[];let journal=journals.find(entry=>entry.scope===section.scope&&entry.sections.some(item=>item.id===section.id));if(journal&&!respectsImportScope(journal.proposal.items.find(item=>item.id===section.id),section.scope)){journal.sections=journal.sections.filter(item=>item.id!==section.id);journal.proposal.items=journal.proposal.items.filter(item=>item.id!==section.id);if(!journal.sections.length)journals.splice(journals.indexOf(journal),1);await writeJson(journalFile,journals);journal=void 0}if(!journal){const eligible=source.sections.filter(candidate=>candidate.scope===section.scope&&candidate.groupId===section.groupId&&task.items.some(item=>item.id===candidate.id&&item.status==="pending")&&!ledger[candidate.id]&&!journals.some(entry=>entry.sections.some(item=>item.id===candidate.id)));const batch=packMemoryImportSections(eligible).find(items=>items.some(item=>item.id===section.id));if(!batch)throw new Error("Source batch is unavailable.");const input={scope:section.scope,sources:batch.map(({id,content})=>({id,content})),existing:selectImportContext(before.existing,batch.map(item=>item.content))};const reserved=memoryImportReservation(input);if(task.usage.modelCalls>=Math.min(task.budget.maxCalls,MEMORY_IMPORT_BUDGET.maxCalls)||task.usage.reservedTokens+reserved>Math.min(task.budget.maxReservedTokens,MEMORY_IMPORT_BUDGET.maxReservedTokens))throw new ImportBudgetError("Import budget exhausted. Retry preserves this budget; split remaining sources into an explicitly confirmed new task.");signal.throwIfAborted();task.usage.modelCalls++;task.usage.reservedTokens+=reserved;await writeJson(path.join(dir,"task.json"),task);let proposal;try{proposal=validateMemoryImportBatchProposal(await abortable(signal,()=>this.options.propose(input,signal)),batch.map(item=>item.id));if(proposal.items.some(item=>!respectsImportScope(item,section.scope)))throw new ImportContextError("Model returned project knowledge for user memory. Retry to request a scope-valid response; consumed budget is retained.")}catch(error){if(!signal.aborted){for(const item of task.items)if(batch.some(section2=>section2.id===item.id)){item.status="failed";item.reason="Model batch failed validation or execution; explicit retry retains its consumed budget."}}throw error}signal.throwIfAborted();journal={scope:section.scope,sections:batch.map(item=>({id:item.id,key:item.id})),baseline:before.existing.map(item=>({ref:item.ref,digest:digest(item.content)})),proposal};journals.push(journal);await writeJson(journalFile,journals)}const expected=new Map(journal.baseline.map(item=>[item.ref,item.digest]));for(const record of Object.values(ledger)){if(record.phase==="committed")for(const output of record.outputs){const ref=`${section.scope}:${output.relativePath}`;if(!expected.has(ref))expected.set(ref,output.digest)}}if(expected.size!==before.existing.length||before.existing.some(item=>expected.get(item.ref)!==digest(item.content)))return{decision:"conflict",reason:"Existing memory changed since this batch was consolidated; retained proposals cannot overwrite edits or restore forgotten knowledge.",documents:[]};return journal.proposal.items.find(item=>item.id===section.id)}async snapshot(scope){const snapshot=await scanAutoMemorySnapshot(this.options.projectRoot,{scopes:[scope],trustedProject:true,uncapped:true});if(!snapshot.sourceStatus.complete)throw new Error("Existing memory scan is incomplete.");const existing=[];for(const doc of snapshot.docs)existing.push({ref:`${scope}:${doc.relativePath}`,content:await fs.readFile(doc.filePath,"utf8")});existing.sort((a,b)=>a.ref.localeCompare(b.ref));return{version:digest(JSON.stringify(existing)),existing}}async importSection(section,batchId,signal,propose,assertCommit){const root=section.scope==="user"?getUserAutoMemoryRoot():getImportedProjectMemoryRoot(this.options.projectRoot,true);const scopeState=path.join(this.state,"scopes",digest(root));return this.locked(scopeState,async signal2=>{signal2.throwIfAborted();this.options.assertActive();if(await exists(root)&&(await fs.lstat(root)).isSymbolicLink())throw new ImportContextError("Memory import does not support a symlinked memory root. Use a non-symlink memory root before retrying; existing memories were not changed.");const ledgerPath=path.join(scopeState,"ledger.json");const ledger=await exists(ledgerPath)?await this.readState(ledgerPath):{};const key=section.id;let previous=ledger[key];const discardUnpublishedIntent=__name(async stage2=>{signal2.throwIfAborted();this.options.assertActive();delete ledger[key];await writeJson(ledgerPath,ledger);heldLocks.getStore()?.throwIfAborted();await fs.rm(stage2,{recursive:true,force:true})},"discardUnpublishedIntent");const outcome=__name((status,reason)=>({id:section.id,scope:section.scope,status,...reason?{reason}:{}}),"outcome");if(previous?.phase==="intent"){const stage2=path.join(scopeState,previous.stage);if(await exists(stage2)&&!await exists(path.join(root,"imported",key))&&(await this.snapshot(section.scope)).version!==previous.memoryVersion){await discardUnpublishedIntent(stage2);previous=void 0}}if(previous){const stage2=path.join(scopeState,previous.stage);const destination=path.join(root,"imported",key);if(previous.phase==="intent"&&await exists(stage2)&&!await exists(destination)){for(const output of previous.outputs){const file=path.join(stage2,path.basename(output.relativePath));if(digest(await fs.readFile(file,"utf8"))!==output.digest)throw new Error("Invalid staged import.")}signal2.throwIfAborted();this.options.assertActive();await privateDirectory(path.join(root,"imported"),this.base);signal2.throwIfAborted();this.options.assertActive();await assertCommit();heldLocks.getStore()?.throwIfAborted();await fs.rename(stage2,destination)}for(const output of previous.outputs){const file=await resolveTrustedMemoryFile(root,getMemoryRootTrustedAnchor(root),output.relativePath);if(!file||digest(await fs.readFile(file,"utf8"))!==output.digest)return outcome("conflict","Previously imported memory was edited or forgotten; it will not be restored.")}previous.phase="committed";await writeJson(ledgerPath,ledger);await rebuildAutoMemoryIndexAtRoot(root,section.scope);if(previous.batchId===batchId)return{...previous.outcome,id:section.id,scope:section.scope};return outcome(previous.outcome.status==="added"?"duplicate":previous.outcome.status,"This source has already been processed.")}const before=await this.snapshot(section.scope);const proposal=await propose(before,ledger,signal2);signal2.throwIfAborted();this.options.assertActive();if((await this.snapshot(section.scope)).version!==before.version)return outcome("conflict","Existing memory changed during consolidation; preview and retry the source.");await assertCommit();if(proposal.decision==="conflict")return outcome("conflict",proposal.reason);if(proposal.decision!=="new"){const result2=outcome(proposal.decision==="skip"?"skipped":"duplicate",proposal.reason);ledger[key]={batchId,phase:"committed",outputs:[],stage:"",outcome:result2};await writeJson(ledgerPath,ledger);return result2}const documents=[];for(const content of new Set(proposal.documents)){const parsed=parseAutoMemoryTopicDocument("import.md",content);if(!parsed)throw new Error("Invalid native memory.");if(section.scope==="user"&&parsed.type!=="user"&&parsed.type!=="feedback")throw new Error("Project knowledge cannot be imported into user memory.");const bodyDigest=digest(parsed.body.trim());for(const[sourceId,record]of Object.entries(ledger)){if(record.outputs.some(output=>output.bodyDigest===bodyDigest)){if(record.phase==="intent"&&!await exists(path.join(root,"imported",sourceId)))continue;for(const output of record.outputs){const file=await resolveTrustedMemoryFile(root,getMemoryRootTrustedAnchor(root),output.relativePath);if(!file||digest(await fs.readFile(file,"utf8"))!==output.digest)return outcome("conflict","Previously edited or forgotten imported knowledge cannot be recreated.")}}}if(before.existing.some(existing=>parseAutoMemoryTopicDocument("existing.md",existing.content)?.body.trim()===parsed.body.trim()))continue;if(!documents.some(existing=>parseAutoMemoryTopicDocument("new.md",existing)?.body.trim()===parsed.body.trim()))documents.push(content)}if(!documents.length){const result2=outcome("duplicate","All proposed knowledge already exists.");ledger[key]={batchId,phase:"committed",outputs:[],stage:"",outcome:result2};await writeJson(ledgerPath,ledger);return result2}const stageName=`stage-${key}`;const stage=path.join(scopeState,stageName);if(await exists(stage)){await privateDirectory(stage,this.base);await fs.rm(stage,{recursive:true})}await privateDirectory(stage,this.base);const outputs=[];for(const[index,content]of documents.entries()){const filename=`${index}.md`;await fs.writeFile(path.join(stage,filename),content,{flag:"wx",mode:384});outputs.push({relativePath:`imported/${key}/${filename}`,digest:digest(content),bodyDigest:digest(parseAutoMemoryTopicDocument("import.md",content).body.trim())})}const result={...outcome("added",proposal.reason),refs:outputs.map(output=>`${section.scope}:${output.relativePath}`)};ledger[key]={batchId,phase:"intent",outputs,stage:stageName,memoryVersion:before.version,outcome:result};await writeJson(ledgerPath,ledger);signal2.throwIfAborted();this.options.assertActive();await privateDirectory(path.join(root,"imported"),this.base);signal2.throwIfAborted();this.options.assertActive();if((await this.snapshot(section.scope)).version!==before.version){await discardUnpublishedIntent(stage);return outcome("conflict","Existing memory changed before publication.")}await assertCommit();heldLocks.getStore()?.throwIfAborted();await fs.rename(stage,path.join(root,"imported",key));ledger[key].phase="committed";await writeJson(ledgerPath,ledger);await rebuildAutoMemoryIndexAtRoot(root,section.scope);return result},signal)}};export{MemoryImportNotFoundError,MemoryImportService};
3
+ import{memoryImportReservation,validateMemoryImportBatchProposal}from"./chunk-JEDL4IKF.js";import{MEMORY_IMPORT_BUDGET,MemoryImportRequestError,digest,packMemoryImportSections,previewSource}from"./chunk-76FSYQTG.js";import{rebuildAutoMemoryIndexAtRoot,tokenizeMemoryRecallTerms,tokenizeMemoryRecallText}from"./chunk-2JGTWRZJ.js";import{parseAutoMemoryTopicDocument,resolveTrustedMemoryFile,scanAutoMemorySnapshot}from"./chunk-FUBDS3AV.js";import{require_proper_lockfile}from"./chunk-YIW3H46P.js";import{getImportedProjectMemoryRoot,getMemoryRootTrustedAnchor,getUserAutoMemoryRoot}from"./chunk-KVA6DHHF.js";import{Storage}from"./chunk-EPODBRBP.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 fs from"node:fs/promises";import{constants}from"node:fs";import{randomUUID}from"node:crypto";import{AsyncLocalStorage}from"node:async_hooks";import path from"node:path";var MemoryImportNotFoundError=class extends Error{static{__name(this,"MemoryImportNotFoundError")}code="ENOENT"};var ImportBudgetError=class extends Error{static{__name(this,"ImportBudgetError")}};var ImportContextError=class extends Error{static{__name(this,"ImportContextError")}};var heldLocks=new AsyncLocalStorage;var exists=__name(async file=>fs.lstat(file).then(()=>true,error=>{if(error.code==="ENOENT")return false;throw error}),"exists");async function privateDirectory(directory,anchor){const relative=path.relative(anchor,directory);if(relative.startsWith("..")||path.isAbsolute(relative))throw new Error("Import path escapes runtime.");let current=anchor;for(const part of["",...relative.split(path.sep).filter(Boolean)]){if(part)current=path.join(current,part);await fs.mkdir(current,{mode:448}).catch(error=>{if(error.code!=="EEXIST")throw error});const stat=await fs.lstat(current);if(!stat.isDirectory()||stat.isSymbolicLink())throw new Error("Import runtime directory must not be a symlink.")}}__name(privateDirectory,"privateDirectory");async function readJson(file){const handle=await fs.open(file,constants.O_RDONLY|constants.O_NOFOLLOW|constants.O_NONBLOCK);try{const stat=await handle.stat();if(!stat.isFile()||stat.size>16*1024*1024)throw new Error("Invalid import state file.");const buffer=Buffer.alloc(stat.size+1);const{bytesRead}=await handle.read(buffer,0,buffer.length,0);if(bytesRead>stat.size)throw new Error("Import state exceeds the supported limit.");return JSON.parse(buffer.subarray(0,bytesRead).toString("utf8"))}finally{await handle.close()}}__name(readJson,"readJson");async function writeJson(file,value){heldLocks.getStore()?.throwIfAborted();const tmp=`${file}.${randomUUID()}.tmp`;await fs.writeFile(tmp,JSON.stringify(value),{mode:384,flag:"wx"});try{heldLocks.getStore()?.throwIfAborted();await fs.rename(tmp,file)}finally{await fs.rm(tmp,{force:true})}}__name(writeJson,"writeJson");async function abortable(signal,work){signal.throwIfAborted();let abort;const cancelled=new Promise((_resolve,reject)=>{abort=__name(()=>reject(new Error("Import cancelled.")),"abort");signal.addEventListener("abort",abort,{once:true})});try{return await Promise.race([work(),cancelled])}finally{signal.removeEventListener("abort",abort)}}__name(abortable,"abortable");function publicTask(task){const{requestDigest:_requestDigest,...result}=task;return structuredClone({...result,usage:task.usage??{modelCalls:0,reservedTokens:0},budget:task.budget??{maxCalls:0,maxReservedTokens:0},result:{sourceSections:task.items.length,newDocuments:task.items.filter(item=>item.status==="added").reduce((n,item)=>n+(item.refs?.length??0),0),duplicateSections:task.items.filter(item=>item.status==="duplicate").length,conflictSections:task.items.filter(item=>item.status==="conflict").length,failedSections:task.items.filter(item=>item.status==="failed").length}})}__name(publicTask,"publicTask");function selectImportContext(existing,sources){const queries=sources.map(source=>({text:source.normalize("NFKC").toLowerCase(),terms:tokenizeMemoryRecallTerms(source)}));const index=existing.map(item=>{const parsed=parseAutoMemoryTopicDocument("existing.md",item.content);if(!parsed)throw new ImportContextError("Existing memory has no bounded metadata index. Repair its native metadata before importing.");const metadata=JSON.stringify({name:parsed.title,description:parsed.description,type:parsed.type,category:parsed.category,keywords:parsed.keywords,usage_scenarios:parsed.usageScenarios});const words=tokenizeMemoryRecallText([parsed.title,...parsed.keywords].join(" "));const anchors=[parsed.title,parsed.description].map(text=>text.normalize("NFKC").toLowerCase().trim()).filter(text=>tokenizeMemoryRecallText(text).length>=2);const body=parsed.body.normalize("NFKC").toLowerCase().trim();const relevant=queries.some(({text,terms})=>{if(anchors.some(anchor=>text.includes(anchor))||body.length>0&&text.includes(body))return true;const shared=words.filter(word=>terms.has(word));return shared.length>=2&&shared.length>=words.length/2});return{ref:item.ref,content:relevant?item.content:metadata,indexOnly:!relevant}});const context=[];let bytes=2;for(const entry of[...index.filter(item=>!item.indexOnly),...index.filter(item=>item.indexOnly)]){const size=Buffer.byteLength(JSON.stringify(entry))+(context.length?1:0);if(bytes+size>MEMORY_IMPORT_BUDGET.contextBytes){if(!entry.indexOnly)throw new ImportContextError("Relevant existing evidence exceeds the 32 KiB import context budget. Select a narrower source group or consolidate existing memory before retrying. No model call was made.");continue}bytes+=size;context.push(entry)}return context}__name(selectImportContext,"selectImportContext");function respectsImportScope(proposal,scope){return scope!=="user"||proposal.documents.every(content=>{const type=parseAutoMemoryTopicDocument("import.md",content)?.type;return type==="user"||type==="feedback"})}__name(respectsImportScope,"respectsImportScope");var MemoryImportService=class{constructor(options){this.options=options;this.owner=digest(path.resolve(options.projectRoot))}static{__name(this,"MemoryImportService")}base=Storage.getRuntimeBaseDir();state=path.join(this.base,"memory-import");owner;workers=new Map;controllers=new Map;async readState(file){const relative=path.relative(this.base,path.dirname(file));if(relative.startsWith("..")||path.isAbsolute(relative))throw new Error("Import state escapes runtime.");let current=this.base;for(const part of["",...relative.split(path.sep).filter(Boolean)]){if(part)current=path.join(current,part);const stat=await fs.lstat(current);if(!stat.isDirectory()||stat.isSymbolicLink())throw new Error("Invalid import state directory.")}return readJson(file)}taskDir(id){if(!/^[a-f0-9]{64}$/.test(id))throw new MemoryImportRequestError("Invalid import batch ID.");return path.join(this.state,"batches",this.owner,id)}async assertRuntimeOutsideGit(){let current=path.resolve(this.base);while(true){if(await exists(path.join(current,".git")))throw new Error("Memory import requires a runtime directory outside Git checkouts.");const parent=path.dirname(current);if(parent===current)break;current=parent}await fs.mkdir(this.base,{recursive:true,mode:448});current=await fs.realpath(this.base);while(true){if(await exists(path.join(current,".git")))throw new Error("Memory import requires a private runtime outside Git checkouts.");const parent=path.dirname(current);if(parent===current)break;current=parent}}async prepare(){this.options.assertActive();await this.assertRuntimeOutsideGit();await privateDirectory(path.join(this.state,"batches",this.owner),this.base)}async locked(directory,run,signal){await privateDirectory(directory,this.base);const ownership=new AbortController;const parent=heldLocks.getStore();const held=parent?AbortSignal.any([parent,ownership.signal]):ownership.signal;const work=signal?AbortSignal.any([signal,held]):held;let release;while(!release){work.throwIfAborted();this.options.assertActive();try{release=await import_proper_lockfile.default.lock(directory,{realpath:false,stale:12e4,update:1e4,retries:0,onCompromised:__name(()=>{ownership.abort(new Error("Import lock lost."))},"onCompromised")})}catch(error){if(error.code!=="ELOCKED")throw error;await new Promise(resolve=>setTimeout(resolve,250))}}try{work.throwIfAborted();const result=await heldLocks.run(held,()=>run(work));held.throwIfAborted();return result}finally{try{if(!ownership.signal.aborted)await release()}finally{ownership.abort(new Error("Import lock released."))}}}async submit(input,selections,key){this.options.assertActive();const preview=previewSource(input);if(typeof key!=="string"||!/^[\w-]{1,128}$/.test(key)||!Array.isArray(selections)||!selections.length||selections.length>2048)throw new MemoryImportRequestError("Provide an idempotency key and explicit non-empty selection.");const seen=new Set;const selected=selections.map(value=>{if(!value||typeof value!=="object")throw new MemoryImportRequestError("Invalid selection.");const selection=value;const section=preview.sections.find(item=>item.id===selection.id&&item.selectable);if(!section||seen.has(selection.id)||!["project","user"].includes(selection.scope))throw new MemoryImportRequestError("Invalid, duplicate or unavailable section selection.");seen.add(selection.id);return{...section,scope:selection.scope}}).sort((a,b)=>a.id.localeCompare(b.id));const retained=JSON.stringify({sections:selected});if(Buffer.byteLength(retained)>16*1024*1024)throw new MemoryImportRequestError("Selected contextual source exceeds the retained snapshot limit.");const requestDigest=digest(JSON.stringify(selected));const id=digest(`${this.owner}\0${key}`);await this.prepare();const dir=this.taskDir(id);return this.locked(path.join(this.state,"admission",this.owner),async()=>{this.options.assertActive();if(await exists(path.join(dir,"task.json"))){const task2=await this.readState(path.join(dir,"task.json"));if(task2.requestDigest!==requestDigest)throw new MemoryImportRequestError("Idempotency key was already used with a different selection.");this.kick(id);return publicTask(task2)}await privateDirectory(dir,this.base);await writeJson(path.join(dir,"source.json"),{sections:selected});const now=new Date().toISOString();const task={version:1,kind:"task",id,status:"queued",createdAt:now,updatedAt:now,requestDigest,usage:{modelCalls:0,reservedTokens:0},budget:{maxCalls:MEMORY_IMPORT_BUDGET.maxCalls,maxReservedTokens:MEMORY_IMPORT_BUDGET.maxReservedTokens},items:selected.map(section=>({id:section.id,scope:section.scope,status:"pending"}))};await writeJson(path.join(dir,"task.json"),task);this.kick(id);return publicTask(task)})}kick(id){if(this.workers.has(id))return;const worker=heldLocks.exit(()=>this.run(id)).catch(()=>{}).finally(()=>{this.workers.delete(id);this.controllers.delete(id)});this.workers.set(id,worker)}async recover(){this.options.assertActive();const root=path.join(this.state,"batches",this.owner);if(!await exists(root))return;await this.assertRuntimeOutsideGit();await privateDirectory(root,this.base);for(const id of(await fs.readdir(root)).filter(id2=>/^[a-f0-9]{64}$/.test(id2))){const task=await this.readState(path.join(this.taskDir(id),"task.json")).catch(()=>void 0);if(task&&(task.status==="running"||task.status==="queued"))this.kick(id)}}async list(){this.options.assertActive();const root=path.join(this.state,"batches",this.owner);if(!await exists(root))return[];await privateDirectory(root,this.base);const result=[];for(const id of(await fs.readdir(root)).filter(id2=>/^[a-f0-9]{64}$/.test(id2))){const task=await this.get(id).catch(()=>void 0);if(task)result.push(task)}return result.sort((a,b)=>b.createdAt.localeCompare(a.createdAt))}async get(id){this.options.assertActive();const task=await this.readState(path.join(this.taskDir(id),"task.json")).catch(cause=>{if(cause.code==="ENOENT")throw new MemoryImportNotFoundError("Import batch not found.",{cause});throw cause});if(task.status!=="completed"&&await exists(path.join(this.taskDir(id),"cancel.json")))task.status="cancelled";return publicTask(task)}async source(id,sectionId){await this.get(id);const source=await this.readState(path.join(this.taskDir(id),"source.json"));const section=source.sections.find(item=>item.id===sectionId);if(!section)throw new MemoryImportRequestError("Source section not found in this batch.");return section}async cancel(id){this.options.assertActive();this.controllers.get(id)?.abort();const task=await this.get(id);if(task.status==="completed")return task;await writeJson(path.join(this.taskDir(id),"cancel.json"),{cancelled:true});this.controllers.get(id)?.abort();await this.workers.get(id);return this.get(id)}async retry(id){await this.get(id);await this.prepare();await this.workers.get(id);const dir=this.taskDir(id);const result=await this.locked(dir,async()=>{const task=await this.readState(path.join(dir,"task.json"));if(task.status==="completed")return publicTask(task);await fs.rm(path.join(dir,"cancel.json"),{force:true});for(const item of task.items)if(item.status==="failed"){item.status="pending";delete item.reason}task.status="queued";task.updatedAt=new Date().toISOString();await writeJson(path.join(dir,"task.json"),task);return publicTask(task)});this.kick(id);return result}async idle(id){await this.workers.get(id);return this.get(id)}async run(id){const dir=this.taskDir(id);const controller=new AbortController;this.controllers.set(id,controller);await this.locked(dir,async signal=>{const task=await this.readState(path.join(dir,"task.json"));if(!["queued","running"].includes(task.status))return;const source=await this.readState(path.join(dir,"source.json"));if(!task.usage){task.usage={modelCalls:0,reservedTokens:0};task.budget={maxCalls:0,maxReservedTokens:0}}task.budget??={maxCalls:0,maxReservedTokens:0};task.status="running";await writeJson(path.join(dir,"task.json"),task);for(const section of packMemoryImportSections(source.sections).flat()){const item=task.items.find(item2=>item2.id===section.id);if(item.status!=="pending")continue;if(await exists(path.join(dir,"cancel.json")))controller.abort();if(controller.signal.aborted)break;try{this.options.assertActive();Object.assign(item,await this.importSection(section,id,signal,(before,ledger,proposalSignal)=>this.prepareProposal(section,source,task,before,ledger,proposalSignal),async()=>{if(await exists(path.join(dir,"cancel.json")))controller.abort();controller.signal.throwIfAborted();this.options.assertActive()}))}catch(error){if(controller.signal.aborted)break;item.status="failed";item.reason=error instanceof ImportBudgetError||error instanceof ImportContextError?error.message:"Import could not finish. Existing memories were preserved; retry after resolving runtime, model or storage availability."}task.updatedAt=new Date().toISOString();await writeJson(path.join(dir,"task.json"),task)}task.status=controller.signal.aborted?"cancelled":task.items.some(item=>item.status==="failed")?"partial":"completed";task.updatedAt=new Date().toISOString();await writeJson(path.join(dir,"task.json"),task)},controller.signal)}async prepareProposal(section,source,task,before,ledger,signal){const dir=this.taskDir(task.id);const journalFile=path.join(dir,"proposals.json");const journals=await exists(journalFile)?await this.readState(journalFile):[];let journal=journals.find(entry=>entry.scope===section.scope&&entry.sections.some(item=>item.id===section.id));if(journal&&!respectsImportScope(journal.proposal.items.find(item=>item.id===section.id),section.scope)){journal.sections=journal.sections.filter(item=>item.id!==section.id);journal.proposal.items=journal.proposal.items.filter(item=>item.id!==section.id);if(!journal.sections.length)journals.splice(journals.indexOf(journal),1);await writeJson(journalFile,journals);journal=void 0}if(!journal){const eligible=source.sections.filter(candidate=>candidate.scope===section.scope&&candidate.groupId===section.groupId&&task.items.some(item=>item.id===candidate.id&&item.status==="pending")&&!ledger[candidate.id]&&!journals.some(entry=>entry.sections.some(item=>item.id===candidate.id)));const batch=packMemoryImportSections(eligible).find(items=>items.some(item=>item.id===section.id));if(!batch)throw new Error("Source batch is unavailable.");const input={scope:section.scope,sources:batch.map(({id,content})=>({id,content})),existing:selectImportContext(before.existing,batch.map(item=>item.content))};const reserved=memoryImportReservation(input);if(task.usage.modelCalls>=Math.min(task.budget.maxCalls,MEMORY_IMPORT_BUDGET.maxCalls)||task.usage.reservedTokens+reserved>Math.min(task.budget.maxReservedTokens,MEMORY_IMPORT_BUDGET.maxReservedTokens))throw new ImportBudgetError("Import budget exhausted. Retry preserves this budget; split remaining sources into an explicitly confirmed new task.");signal.throwIfAborted();task.usage.modelCalls++;task.usage.reservedTokens+=reserved;await writeJson(path.join(dir,"task.json"),task);let proposal;try{proposal=validateMemoryImportBatchProposal(await abortable(signal,()=>this.options.propose(input,signal)),batch.map(item=>item.id));if(proposal.items.some(item=>!respectsImportScope(item,section.scope)))throw new ImportContextError("Model returned project knowledge for user memory. Retry to request a scope-valid response; consumed budget is retained.")}catch(error){if(!signal.aborted){for(const item of task.items)if(batch.some(section2=>section2.id===item.id)){item.status="failed";item.reason="Model batch failed validation or execution; explicit retry retains its consumed budget."}}throw error}signal.throwIfAborted();journal={scope:section.scope,sections:batch.map(item=>({id:item.id,key:item.id})),baseline:before.existing.map(item=>({ref:item.ref,digest:digest(item.content)})),proposal};journals.push(journal);await writeJson(journalFile,journals)}const expected=new Map(journal.baseline.map(item=>[item.ref,item.digest]));for(const record of Object.values(ledger)){if(record.phase==="committed")for(const output of record.outputs){const ref=`${section.scope}:${output.relativePath}`;if(!expected.has(ref))expected.set(ref,output.digest)}}if(expected.size!==before.existing.length||before.existing.some(item=>expected.get(item.ref)!==digest(item.content)))return{decision:"conflict",reason:"Existing memory changed since this batch was consolidated; retained proposals cannot overwrite edits or restore forgotten knowledge.",documents:[]};return journal.proposal.items.find(item=>item.id===section.id)}async snapshot(scope){const snapshot=await scanAutoMemorySnapshot(this.options.projectRoot,{scopes:[scope],trustedProject:true,uncapped:true});if(!snapshot.sourceStatus.complete)throw new Error("Existing memory scan is incomplete.");const existing=[];for(const doc of snapshot.docs)existing.push({ref:`${scope}:${doc.relativePath}`,content:await fs.readFile(doc.filePath,"utf8")});existing.sort((a,b)=>a.ref.localeCompare(b.ref));return{version:digest(JSON.stringify(existing)),existing}}async importSection(section,batchId,signal,propose,assertCommit){const root=section.scope==="user"?getUserAutoMemoryRoot():getImportedProjectMemoryRoot(this.options.projectRoot,true);const scopeState=path.join(this.state,"scopes",digest(root));return this.locked(scopeState,async signal2=>{signal2.throwIfAborted();this.options.assertActive();if(await exists(root)&&(await fs.lstat(root)).isSymbolicLink())throw new ImportContextError("Memory import does not support a symlinked memory root. Use a non-symlink memory root before retrying; existing memories were not changed.");const ledgerPath=path.join(scopeState,"ledger.json");const ledger=await exists(ledgerPath)?await this.readState(ledgerPath):{};const key=section.id;let previous=ledger[key];const discardUnpublishedIntent=__name(async stage2=>{signal2.throwIfAborted();this.options.assertActive();delete ledger[key];await writeJson(ledgerPath,ledger);heldLocks.getStore()?.throwIfAborted();await fs.rm(stage2,{recursive:true,force:true})},"discardUnpublishedIntent");const outcome=__name((status,reason)=>({id:section.id,scope:section.scope,status,...reason?{reason}:{}}),"outcome");if(previous?.phase==="intent"){const stage2=path.join(scopeState,previous.stage);if(await exists(stage2)&&!await exists(path.join(root,"imported",key))&&(await this.snapshot(section.scope)).version!==previous.memoryVersion){await discardUnpublishedIntent(stage2);previous=void 0}}if(previous){const stage2=path.join(scopeState,previous.stage);const destination=path.join(root,"imported",key);if(previous.phase==="intent"&&await exists(stage2)&&!await exists(destination)){for(const output of previous.outputs){const file=path.join(stage2,path.basename(output.relativePath));if(digest(await fs.readFile(file,"utf8"))!==output.digest)throw new Error("Invalid staged import.")}signal2.throwIfAborted();this.options.assertActive();await privateDirectory(path.join(root,"imported"),this.base);signal2.throwIfAborted();this.options.assertActive();await assertCommit();heldLocks.getStore()?.throwIfAborted();await fs.rename(stage2,destination)}for(const output of previous.outputs){const file=await resolveTrustedMemoryFile(root,getMemoryRootTrustedAnchor(root),output.relativePath);if(!file||digest(await fs.readFile(file,"utf8"))!==output.digest)return outcome("conflict","Previously imported memory was edited or forgotten; it will not be restored.")}previous.phase="committed";await writeJson(ledgerPath,ledger);await rebuildAutoMemoryIndexAtRoot(root,section.scope);if(previous.batchId===batchId)return{...previous.outcome,id:section.id,scope:section.scope};return outcome(previous.outcome.status==="added"?"duplicate":previous.outcome.status,"This source has already been processed.")}const before=await this.snapshot(section.scope);const proposal=await propose(before,ledger,signal2);signal2.throwIfAborted();this.options.assertActive();if((await this.snapshot(section.scope)).version!==before.version)return outcome("conflict","Existing memory changed during consolidation; preview and retry the source.");await assertCommit();if(proposal.decision==="conflict")return outcome("conflict",proposal.reason);if(proposal.decision!=="new"){const result2=outcome(proposal.decision==="skip"?"skipped":"duplicate",proposal.reason);ledger[key]={batchId,phase:"committed",outputs:[],stage:"",outcome:result2};await writeJson(ledgerPath,ledger);return result2}const documents=[];for(const content of new Set(proposal.documents)){const parsed=parseAutoMemoryTopicDocument("import.md",content);if(!parsed)throw new Error("Invalid native memory.");if(section.scope==="user"&&parsed.type!=="user"&&parsed.type!=="feedback")throw new Error("Project knowledge cannot be imported into user memory.");const bodyDigest=digest(parsed.body.trim());for(const[sourceId,record]of Object.entries(ledger)){if(record.outputs.some(output=>output.bodyDigest===bodyDigest)){if(record.phase==="intent"&&!await exists(path.join(root,"imported",sourceId)))continue;for(const output of record.outputs){const file=await resolveTrustedMemoryFile(root,getMemoryRootTrustedAnchor(root),output.relativePath);if(!file||digest(await fs.readFile(file,"utf8"))!==output.digest)return outcome("conflict","Previously edited or forgotten imported knowledge cannot be recreated.")}}}if(before.existing.some(existing=>parseAutoMemoryTopicDocument("existing.md",existing.content)?.body.trim()===parsed.body.trim()))continue;if(!documents.some(existing=>parseAutoMemoryTopicDocument("new.md",existing)?.body.trim()===parsed.body.trim()))documents.push(content)}if(!documents.length){const result2=outcome("duplicate","All proposed knowledge already exists.");ledger[key]={batchId,phase:"committed",outputs:[],stage:"",outcome:result2};await writeJson(ledgerPath,ledger);return result2}const stageName=`stage-${key}`;const stage=path.join(scopeState,stageName);if(await exists(stage)){await privateDirectory(stage,this.base);await fs.rm(stage,{recursive:true})}await privateDirectory(stage,this.base);const outputs=[];for(const[index,content]of documents.entries()){const filename=`${index}.md`;await fs.writeFile(path.join(stage,filename),content,{flag:"wx",mode:384});outputs.push({relativePath:`imported/${key}/${filename}`,digest:digest(content),bodyDigest:digest(parseAutoMemoryTopicDocument("import.md",content).body.trim())})}const result={...outcome("added",proposal.reason),refs:outputs.map(output=>`${section.scope}:${output.relativePath}`)};ledger[key]={batchId,phase:"intent",outputs,stage:stageName,memoryVersion:before.version,outcome:result};await writeJson(ledgerPath,ledger);signal2.throwIfAborted();this.options.assertActive();await privateDirectory(path.join(root,"imported"),this.base);signal2.throwIfAborted();this.options.assertActive();if((await this.snapshot(section.scope)).version!==before.version){await discardUnpublishedIntent(stage);return outcome("conflict","Existing memory changed before publication.")}await assertCommit();heldLocks.getStore()?.throwIfAborted();await fs.rename(stage,path.join(root,"imported",key));ledger[key].phase="committed";await writeJson(ledgerPath,ledger);await rebuildAutoMemoryIndexAtRoot(root,section.scope);return result},signal)}};export{MemoryImportNotFoundError,MemoryImportService};
4
4
  /**
5
5
  * @license
6
6
  * Copyright 2026 Qwen Team
@@ -1,10 +1,10 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import{appEvents}from"./chunk-VDRE7U3P.js";import{loadUndici}from"./chunk-XKSB7VTV.js";import{CUSTOM_SANDBOX_IMAGE_ENV_VAR,HOST_UPDATE_RELAUNCH_ENV_VAR,SKIP_UPDATE_CHECK_ENV_VAR,requestUpdateOnExit}from"./chunk-F26LTWDZ.js";import{IdeClient}from"./chunk-Z5XENA4A.js";import{getAllProviderBaseUrls}from"./chunk-ET2Z7ZGF.js";import{detectRuntime,getOrCreateSharedDispatcher,preloadRuntimeFetchModule,redactProxyCredentials}from"./chunk-ZZZAYAJW.js";import{initializeTelemetry}from"./chunk-3XVPZY7X.js";import{recordStartupEvent}from"./chunk-H4XFFVZ2.js";import{createDebugLogger}from"./chunk-JAUJI56S.js";import{init_esbuild_shims}from"./chunk-VKDAXTCZ.js";import{__name}from"./chunk-KBWJGX7I.js";init_esbuild_shims();init_esbuild_shims();var debugLogger=createDebugLogger("PRECONNECT");var preconnectFired=false;var preconnectInFlight;var DEFAULT_BASE_URLS={openai:"https://api.openai.com","qwen-oauth":"https://coding.dashscope.aliyuncs.com",anthropic:"https://api.anthropic.com",dashscope:"https://dashscope.aliyuncs.com"};var ALL_DEFAULT_URLS=[...Object.values(DEFAULT_BASE_URLS),...getAllProviderBaseUrls()];function shouldSkipPreconnect(){if(process.env["NODE_EXTRA_CA_CERTS"]){debugLogger.debug("Skipping preconnect: custom CA certificate configured");return true}return false}__name(shouldSkipPreconnect,"shouldSkipPreconnect");function isInSandboxMode(){return process.env["SANDBOX"]!==void 0}__name(isInSandboxMode,"isInSandboxMode");function isDefaultBaseUrl(baseUrl){const normalizedInput=baseUrl.toLowerCase().replace(/^https?:\/\//,"").replace(/\/+$/,"");return ALL_DEFAULT_URLS.some(defaultUrl=>{const normalizedDefault=defaultUrl.toLowerCase().replace(/^https?:\/\//,"").replace(/\/+$/,"");return normalizedInput===normalizedDefault||normalizedInput.startsWith(normalizedDefault+"/")})}__name(isDefaultBaseUrl,"isDefaultBaseUrl");function getPreconnectTargetUrl(authType,resolvedBaseUrl){if(resolvedBaseUrl&&/^https?:\/\//i.test(resolvedBaseUrl)){if(isDefaultBaseUrl(resolvedBaseUrl)){return resolvedBaseUrl}debugLogger.debug("Skipping preconnect: resolved baseUrl is not a default URL");return void 0}if(authType&&DEFAULT_BASE_URLS[authType]){return DEFAULT_BASE_URLS[authType]}return void 0}__name(getPreconnectTargetUrl,"getPreconnectTargetUrl");function preconnectApi(authType,options={}){if(preconnectFired){return}if(process.env["QWEN_CODE_DISABLE_PRECONNECT"]==="1"){debugLogger.debug("Preconnect disabled by environment variable");preconnectFired=true;return}if(isInSandboxMode()){debugLogger.debug("Skipping preconnect: sandbox mode detected");preconnectFired=true;return}if(shouldSkipPreconnect()){preconnectFired=true;return}if(detectRuntime()!=="node"){debugLogger.debug("Skipping preconnect: unsupported runtime");preconnectFired=true;return}if(!options.proxy){debugLogger.debug("Skipping preconnect dispatcher: no proxy configured");return}const proxy=options.proxy;const targetUrl=getPreconnectTargetUrl(authType,options.resolvedBaseUrl);if(!targetUrl){debugLogger.debug("No target URL for preconnect");return}preconnectFired=true;debugLogger.debug(`Preconnecting to: ${targetUrl}`);preconnectInFlight=(async()=>{await preloadRuntimeFetchModule();const dispatcher=getOrCreateSharedDispatcher(proxy);const{fetch:undiciFetch}=await loadUndici();await undiciFetch(targetUrl,{method:"HEAD",signal:AbortSignal.timeout(5e3),headers:{"User-Agent":"QwenCode-Preconnect/1.0"},dispatcher});debugLogger.debug("Preconnect completed")})().catch(error=>{const redactedError=redactProxyCredentials(String(error));debugLogger.debug(`Preconnect failed (ignored): ${redactedError}`)})}__name(preconnectApi,"preconnectApi");var debugLogger2=createDebugLogger("STARTUP_PREFETCH");var DEFERRED_IDE_CONNECT_TIMEOUT_MS=15e3;var earlyStarted=new WeakSet;var postRenderStarted=new WeakSet;function withTimeout(promise,name,timeoutMs,onTimeout=()=>{}){let timeoutId;let timedOut=false;const runTimeoutCleanup=__name(()=>{void Promise.resolve().then(onTimeout).catch(err=>{debugLogger2.debug(`${name} timeout cleanup failed:`,err)})},"runTimeoutCleanup");const timeout=new Promise((_,reject)=>{timeoutId=setTimeout(()=>{timedOut=true;runTimeoutCleanup();reject(new Error(`${name} timed out after ${timeoutMs}ms`))},timeoutMs);timeoutId.unref?.()});void promise.then(()=>{if(timedOut){runTimeoutCleanup()}},err=>{if(timedOut){debugLogger2.debug(`${name} underlying error after timeout:`,err)}});return Promise.race([promise,timeout]).finally(()=>{if(timeoutId){clearTimeout(timeoutId)}})}__name(withTimeout,"withTimeout");function runDeferredTask(name,task){recordStartupEvent("startup_prefetch_started",{name});void Promise.resolve().then(task).then(()=>{recordStartupEvent("startup_prefetch_completed",{name})}).catch(err=>{recordStartupEvent("startup_prefetch_failed",{name});debugLogger2.warn(`${name} failed:`,err)})}__name(runDeferredTask,"runDeferredTask");async function disconnectIdeAfterDeferredTimeout(){const ideClient=await IdeClient.getInstance();await ideClient.disconnect()}__name(disconnectIdeAfterDeferredTimeout,"disconnectIdeAfterDeferredTimeout");function startEarlyStartupPrefetches(config){if(earlyStarted.has(config))return;earlyStarted.add(config);try{const modelsConfig=config.getModelsConfig();const authType=modelsConfig.getCurrentAuthType();const resolvedBaseUrl=modelsConfig.getGenerationConfig().baseUrl;const proxy=config.getProxy();preconnectApi(authType,{resolvedBaseUrl,proxy})}catch(error){debugLogger2.debug(`Preconnect skipped due to error getting authType: ${error}`)}}__name(startEarlyStartupPrefetches,"startEarlyStartupPrefetches");var UPDATE_CHECK_DELAY_MS=3e3;function startPostRenderPrefetches(config,settings,options={}){if(postRenderStarted.has(config))return;postRenderStarted.add(config);if(settings.merged.general?.enableAutoUpdate!==false&&process.env[SKIP_UPDATE_CHECK_ENV_VAR]!=="true"&&!process.env[CUSTOM_SANDBOX_IMAGE_ENV_VAR]){runDeferredTask("update_check",async()=>{await new Promise(resolve=>{setTimeout(resolve,UPDATE_CHECK_DELAY_MS).unref?.()});const[{checkForUpdatesDetailed,describeUpdateCheckFailure},{handleAutoUpdate},{getInstallationInfo},{updateEventEmitter},{t}]=await Promise.all([import("./updateCheck-VXUIX2XG.js"),import("./handleAutoUpdate-QNM26NZK.js"),import("./installationInfo-BCTXASUM.js"),import("./updateEventEmitter-HCGBOCP2.js"),import("./i18n-L5URVOBB.js")]);const updateCheckSkippedMessage=__name(error=>t("Update check skipped ({{reason}}) \u2014 run /update to retry.",{reason:describeUpdateCheckFailure(error)}),"updateCheckSkippedMessage");try{const result=await checkForUpdatesDetailed();if(result.status==="update"){const projectRoot=config.getProjectRoot();const hostUpdateRelaunch=process.env[HOST_UPDATE_RELAUNCH_ENV_VAR];if(hostUpdateRelaunch==="true"){updateEventEmitter.emit("update-info",{message:`${result.info.message}
3
+ import{appEvents}from"./chunk-VRKYBH5G.js";import{loadUndici}from"./chunk-XKSB7VTV.js";import{CUSTOM_SANDBOX_IMAGE_ENV_VAR,HOST_UPDATE_RELAUNCH_ENV_VAR,SKIP_UPDATE_CHECK_ENV_VAR,requestUpdateOnExit}from"./chunk-M6KB5RVD.js";import{IdeClient}from"./chunk-2JGTWRZJ.js";import{getAllProviderBaseUrls}from"./chunk-ET2Z7ZGF.js";import{detectRuntime,getOrCreateSharedDispatcher,preloadRuntimeFetchModule,redactProxyCredentials}from"./chunk-ZZZAYAJW.js";import{initializeTelemetry}from"./chunk-3XVPZY7X.js";import{recordStartupEvent}from"./chunk-H4XFFVZ2.js";import{createDebugLogger}from"./chunk-JAUJI56S.js";import{init_esbuild_shims}from"./chunk-VKDAXTCZ.js";import{__name}from"./chunk-KBWJGX7I.js";init_esbuild_shims();init_esbuild_shims();var debugLogger=createDebugLogger("PRECONNECT");var preconnectFired=false;var preconnectInFlight;var DEFAULT_BASE_URLS={openai:"https://api.openai.com","qwen-oauth":"https://coding.dashscope.aliyuncs.com",anthropic:"https://api.anthropic.com",dashscope:"https://dashscope.aliyuncs.com"};var ALL_DEFAULT_URLS=[...Object.values(DEFAULT_BASE_URLS),...getAllProviderBaseUrls()];function shouldSkipPreconnect(){if(process.env["NODE_EXTRA_CA_CERTS"]){debugLogger.debug("Skipping preconnect: custom CA certificate configured");return true}return false}__name(shouldSkipPreconnect,"shouldSkipPreconnect");function isInSandboxMode(){return process.env["SANDBOX"]!==void 0}__name(isInSandboxMode,"isInSandboxMode");function isDefaultBaseUrl(baseUrl){const normalizedInput=baseUrl.toLowerCase().replace(/^https?:\/\//,"").replace(/\/+$/,"");return ALL_DEFAULT_URLS.some(defaultUrl=>{const normalizedDefault=defaultUrl.toLowerCase().replace(/^https?:\/\//,"").replace(/\/+$/,"");return normalizedInput===normalizedDefault||normalizedInput.startsWith(normalizedDefault+"/")})}__name(isDefaultBaseUrl,"isDefaultBaseUrl");function getPreconnectTargetUrl(authType,resolvedBaseUrl){if(resolvedBaseUrl&&/^https?:\/\//i.test(resolvedBaseUrl)){if(isDefaultBaseUrl(resolvedBaseUrl)){return resolvedBaseUrl}debugLogger.debug("Skipping preconnect: resolved baseUrl is not a default URL");return void 0}if(authType&&DEFAULT_BASE_URLS[authType]){return DEFAULT_BASE_URLS[authType]}return void 0}__name(getPreconnectTargetUrl,"getPreconnectTargetUrl");function preconnectApi(authType,options={}){if(preconnectFired){return}if(process.env["QWEN_CODE_DISABLE_PRECONNECT"]==="1"){debugLogger.debug("Preconnect disabled by environment variable");preconnectFired=true;return}if(isInSandboxMode()){debugLogger.debug("Skipping preconnect: sandbox mode detected");preconnectFired=true;return}if(shouldSkipPreconnect()){preconnectFired=true;return}if(detectRuntime()!=="node"){debugLogger.debug("Skipping preconnect: unsupported runtime");preconnectFired=true;return}if(!options.proxy){debugLogger.debug("Skipping preconnect dispatcher: no proxy configured");return}const proxy=options.proxy;const targetUrl=getPreconnectTargetUrl(authType,options.resolvedBaseUrl);if(!targetUrl){debugLogger.debug("No target URL for preconnect");return}preconnectFired=true;debugLogger.debug(`Preconnecting to: ${targetUrl}`);preconnectInFlight=(async()=>{await preloadRuntimeFetchModule();const dispatcher=getOrCreateSharedDispatcher(proxy);const{fetch:undiciFetch}=await loadUndici();await undiciFetch(targetUrl,{method:"HEAD",signal:AbortSignal.timeout(5e3),headers:{"User-Agent":"QwenCode-Preconnect/1.0"},dispatcher});debugLogger.debug("Preconnect completed")})().catch(error=>{const redactedError=redactProxyCredentials(String(error));debugLogger.debug(`Preconnect failed (ignored): ${redactedError}`)})}__name(preconnectApi,"preconnectApi");var debugLogger2=createDebugLogger("STARTUP_PREFETCH");var DEFERRED_IDE_CONNECT_TIMEOUT_MS=15e3;var earlyStarted=new WeakSet;var postRenderStarted=new WeakSet;function withTimeout(promise,name,timeoutMs,onTimeout=()=>{}){let timeoutId;let timedOut=false;const runTimeoutCleanup=__name(()=>{void Promise.resolve().then(onTimeout).catch(err=>{debugLogger2.debug(`${name} timeout cleanup failed:`,err)})},"runTimeoutCleanup");const timeout=new Promise((_,reject)=>{timeoutId=setTimeout(()=>{timedOut=true;runTimeoutCleanup();reject(new Error(`${name} timed out after ${timeoutMs}ms`))},timeoutMs);timeoutId.unref?.()});void promise.then(()=>{if(timedOut){runTimeoutCleanup()}},err=>{if(timedOut){debugLogger2.debug(`${name} underlying error after timeout:`,err)}});return Promise.race([promise,timeout]).finally(()=>{if(timeoutId){clearTimeout(timeoutId)}})}__name(withTimeout,"withTimeout");function runDeferredTask(name,task){recordStartupEvent("startup_prefetch_started",{name});void Promise.resolve().then(task).then(()=>{recordStartupEvent("startup_prefetch_completed",{name})}).catch(err=>{recordStartupEvent("startup_prefetch_failed",{name});debugLogger2.warn(`${name} failed:`,err)})}__name(runDeferredTask,"runDeferredTask");async function disconnectIdeAfterDeferredTimeout(){const ideClient=await IdeClient.getInstance();await ideClient.disconnect()}__name(disconnectIdeAfterDeferredTimeout,"disconnectIdeAfterDeferredTimeout");function startEarlyStartupPrefetches(config){if(earlyStarted.has(config))return;earlyStarted.add(config);try{const modelsConfig=config.getModelsConfig();const authType=modelsConfig.getCurrentAuthType();const resolvedBaseUrl=modelsConfig.getGenerationConfig().baseUrl;const proxy=config.getProxy();preconnectApi(authType,{resolvedBaseUrl,proxy})}catch(error){debugLogger2.debug(`Preconnect skipped due to error getting authType: ${error}`)}}__name(startEarlyStartupPrefetches,"startEarlyStartupPrefetches");var UPDATE_CHECK_DELAY_MS=3e3;function startPostRenderPrefetches(config,settings,options={}){if(postRenderStarted.has(config))return;postRenderStarted.add(config);if(settings.merged.general?.enableAutoUpdate!==false&&process.env[SKIP_UPDATE_CHECK_ENV_VAR]!=="true"&&!process.env[CUSTOM_SANDBOX_IMAGE_ENV_VAR]){runDeferredTask("update_check",async()=>{await new Promise(resolve=>{setTimeout(resolve,UPDATE_CHECK_DELAY_MS).unref?.()});const[{checkForUpdatesDetailed,describeUpdateCheckFailure},{handleAutoUpdate},{getInstallationInfo},{updateEventEmitter},{t}]=await Promise.all([import("./updateCheck-CMEWLLZJ.js"),import("./handleAutoUpdate-QF2YQHF6.js"),import("./installationInfo-OKA4WXAS.js"),import("./updateEventEmitter-HCGBOCP2.js"),import("./i18n-AGOA6MUI.js")]);const updateCheckSkippedMessage=__name(error=>t("Update check skipped ({{reason}}) \u2014 run /update to retry.",{reason:describeUpdateCheckFailure(error)}),"updateCheckSkippedMessage");try{const result=await checkForUpdatesDetailed();if(result.status==="update"){const projectRoot=config.getProjectRoot();const hostUpdateRelaunch=process.env[HOST_UPDATE_RELAUNCH_ENV_VAR];if(hostUpdateRelaunch==="true"){updateEventEmitter.emit("update-info",{message:`${result.info.message}
4
4
  ${t("Run /update to install the update on the host.")}`});return}if(hostUpdateRelaunch==="false"){updateEventEmitter.emit("update-info",{message:`${result.info.message}
5
5
  ${t("Update Qwen Code on the host, then restart the sandbox.")}`});return}const installationInfo=getInstallationInfo(projectRoot,true);if(installationInfo.packageManager==="npm"){void handleAutoUpdate(result.info,settings,projectRoot);return}if(installationInfo.updateCommand||installationInfo.isStandalone&&installationInfo.standaloneDir){if(requestUpdateOnExit()){updateEventEmitter.emit("update-info",{message:`${result.info.message}
6
6
  ${t("The update will be installed after you exit this session.")}`})}else{updateEventEmitter.emit("update-info",{message:`${result.info.message}
7
- ${t("Run /update to install the update.")}`})}}else{void handleAutoUpdate(result.info,settings,projectRoot)}}else if(result.status==="error"){updateEventEmitter.emit("update-failed",{message:updateCheckSkippedMessage(result.error),severity:"warning"})}}catch(error){updateEventEmitter.emit("update-failed",{message:updateCheckSkippedMessage(error),severity:"warning"});throw error}})}if(options.connectIde&&config.getIdeMode()){runDeferredTask("ide_connect",async()=>{appEvents.emit("startup-ide-connection-status-changed",{state:"connecting"});try{const{connectIdeForStartup}=await import("./initializer-NQ2NECYP.js");await withTimeout(connectIdeForStartup(config),"ide_connect",DEFERRED_IDE_CONNECT_TIMEOUT_MS,disconnectIdeAfterDeferredTimeout);appEvents.emit("startup-ide-connection-status-changed",{state:"connected"})}catch(err){appEvents.emit("startup-ide-connection-status-changed",{state:"failed",message:err instanceof Error?err.message:String(err)});throw err}})}if(options.initializeTelemetry){runDeferredTask("telemetry_init",()=>initializeTelemetry(config))}if(config.isInteractive()&&settings.merged.general?.batchAutoCollect!==false){runDeferredTask("batch_auto_collect",async()=>{const[{startBatchAutoCollect},{resolveEndpoint},{updateEventEmitter}]=await Promise.all([import("./batch-auto-collect-ANURZLEZ.js"),import("./batch-V2NJT3M5.js"),import("./updateEventEmitter-HCGBOCP2.js")]);startBatchAutoCollect({projectRoot:config.getWorkingDir(),notify:__name(message=>updateEventEmitter.emit("update-info",{message}),"notify"),resolveEndpoint:__name(()=>resolveEndpoint(process.env,{settings:settings.merged,warn:__name(message=>debugLogger2.debug(message),"warn")}),"resolveEndpoint"),log:__name(message=>debugLogger2.debug(message),"log")})})}if(config.isInteractive()){runDeferredTask("background_housekeeping",async()=>{const{startBackgroundHousekeeping}=await import("./scheduler-KTPM226B.js");startBackgroundHousekeeping(config,settings)})}}__name(startPostRenderPrefetches,"startPostRenderPrefetches");export{startEarlyStartupPrefetches,startPostRenderPrefetches};
7
+ ${t("Run /update to install the update.")}`})}}else{void handleAutoUpdate(result.info,settings,projectRoot)}}else if(result.status==="error"){updateEventEmitter.emit("update-failed",{message:updateCheckSkippedMessage(result.error),severity:"warning"})}}catch(error){updateEventEmitter.emit("update-failed",{message:updateCheckSkippedMessage(error),severity:"warning"});throw error}})}if(options.connectIde&&config.getIdeMode()){runDeferredTask("ide_connect",async()=>{appEvents.emit("startup-ide-connection-status-changed",{state:"connecting"});try{const{connectIdeForStartup}=await import("./initializer-FRKYDUSX.js");await withTimeout(connectIdeForStartup(config),"ide_connect",DEFERRED_IDE_CONNECT_TIMEOUT_MS,disconnectIdeAfterDeferredTimeout);appEvents.emit("startup-ide-connection-status-changed",{state:"connected"})}catch(err){appEvents.emit("startup-ide-connection-status-changed",{state:"failed",message:err instanceof Error?err.message:String(err)});throw err}})}if(options.initializeTelemetry){runDeferredTask("telemetry_init",()=>initializeTelemetry(config))}if(config.isInteractive()&&settings.merged.general?.batchAutoCollect!==false){runDeferredTask("batch_auto_collect",async()=>{const[{startBatchAutoCollect},{resolveEndpoint},{updateEventEmitter}]=await Promise.all([import("./batch-auto-collect-ANURZLEZ.js"),import("./batch-XFVQ4BLM.js"),import("./updateEventEmitter-HCGBOCP2.js")]);startBatchAutoCollect({projectRoot:config.getWorkingDir(),notify:__name(message=>updateEventEmitter.emit("update-info",{message}),"notify"),resolveEndpoint:__name(()=>resolveEndpoint(process.env,{settings:settings.merged,warn:__name(message=>debugLogger2.debug(message),"warn")}),"resolveEndpoint"),log:__name(message=>debugLogger2.debug(message),"log")})})}if(config.isInteractive()){runDeferredTask("background_housekeeping",async()=>{const{startBackgroundHousekeeping}=await import("./scheduler-KCMSPHON.js");startBackgroundHousekeeping(config,settings)})}}__name(startPostRenderPrefetches,"startPostRenderPrefetches");export{startEarlyStartupPrefetches,startPostRenderPrefetches};
8
8
  /**
9
9
  * @license
10
10
  * Copyright 2026 Qwen Team