@qwen-code/qwen-code 0.22.2-preview.0 → 0.22.2

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 (379) hide show
  1. package/bundled/goal-draft/SKILL.md +109 -0
  2. package/bundled/qc-helper/docs/configuration/settings.md +12 -12
  3. package/bundled/qc-helper/docs/features/_meta.ts +1 -0
  4. package/bundled/qc-helper/docs/features/commands.md +2 -1
  5. package/bundled/qc-helper/docs/features/goals.md +58 -0
  6. package/bundled/qc-helper/docs/features/headless.md +13 -11
  7. package/bundled/qc-helper/docs/features/status-line.md +3 -3
  8. package/chunks/MaxSizedBox-X5FZSNAJ.js +112 -0
  9. package/chunks/{StandaloneSessionPicker-KFMJILVY.js → StandaloneSessionPicker-AVLI6VJP.js} +76 -76
  10. package/chunks/{acpAgent-KNFTTDWL.js → acpAgent-MXEAN54C.js} +994 -277
  11. package/chunks/{agent-6V6MZOA7.js → agent-PJIPDWHB.js} +41 -41
  12. package/chunks/agent-headless-B4JVD7UK.js +87 -0
  13. package/chunks/{anthropicContentGenerator-U76GTVB6.js → anthropicContentGenerator-HGMBACVE.js} +7 -7
  14. package/chunks/{artifact-tool-XDJCZZCF.js → artifact-tool-5YT4QF7Y.js} +2 -2
  15. package/chunks/{askUserQuestion-ZXXERLEV.js → askUserQuestion-4SWJY65V.js} +2 -2
  16. package/chunks/bridge-FKZTVIS3.js +121 -0
  17. package/chunks/{channel-management-service-HXXS3HOZ.js → channel-management-service-X4AZ6IXX.js} +1 -1
  18. package/chunks/channel-settings-store-4UFCLBBG.js +117 -0
  19. package/chunks/{channel-worker-group-EVDC2P4K.js → channel-worker-group-27HMGD5S.js} +7 -6
  20. package/chunks/{channel-worker-manager-IJJZHGEI.js → channel-worker-manager-QEGX646Z.js} +9 -7
  21. package/chunks/{channel-worker-supervisor-YSKB5GVB.js → channel-worker-supervisor-UEW2WWCC.js} +5 -4
  22. package/chunks/{chunk-7QGEJI7M.js → chunk-23RFD54N.js} +1 -1
  23. package/chunks/{chunk-K5PNJ6VL.js → chunk-2K6ORIHJ.js} +13 -13
  24. package/chunks/{chunk-OGZAQWJP.js → chunk-2NYCN6F2.js} +11 -11
  25. package/chunks/chunk-2TNL5KPM.js +49 -0
  26. package/chunks/{chunk-ZEADBZLO.js → chunk-3AFMQUTI.js} +3 -3
  27. package/chunks/{chunk-LRLMDV5X.js → chunk-3DXFGHAJ.js} +185 -174
  28. package/chunks/{chunk-73WFGVIZ.js → chunk-3FDFA4MZ.js} +3 -3
  29. package/chunks/{chunk-WBT3STGU.js → chunk-3I6UTTDX.js} +1 -1
  30. package/chunks/{chunk-FVDQ5E67.js → chunk-3JGZSIDA.js} +3 -3
  31. package/chunks/{chunk-JJJD6QCC.js → chunk-3SGB2UHX.js} +15 -10
  32. package/chunks/{chunk-77TOMRBG.js → chunk-43GGFFLY.js} +3 -3
  33. package/chunks/{chunk-ZJG323IA.js → chunk-43UYNAWX.js} +6 -4
  34. package/chunks/{chunk-T2HMXHYA.js → chunk-4CDSK5AZ.js} +6 -6
  35. package/chunks/chunk-4CMJKUND.js +95 -0
  36. package/chunks/{chunk-EB4VDXNI.js → chunk-4FTKQNWJ.js} +1 -1
  37. package/chunks/{chunk-PAJGKZAA.js → chunk-4HV6HH33.js} +10 -8
  38. package/chunks/{chunk-BQBUZDDH.js → chunk-4J657AJR.js} +3 -3
  39. package/chunks/{chunk-BU7OUDQB.js → chunk-4JWNNLPT.js} +4 -4
  40. package/chunks/{chunk-4N6UAPD3.js → chunk-4MQEPP3Y.js} +9 -84
  41. package/chunks/{chunk-I6HWGOWD.js → chunk-5O72BNDD.js} +93 -14
  42. package/chunks/{chunk-IKN3IUJP.js → chunk-5XBFCMWD.js} +2 -2
  43. package/chunks/{chunk-2YDYDDE2.js → chunk-66KDY3LV.js} +3 -3
  44. package/chunks/{chunk-UVDOONRU.js → chunk-6CGL7E7G.js} +2 -2
  45. package/chunks/{chunk-SLEWBQWM.js → chunk-6DIGWMGT.js} +2 -2
  46. package/chunks/{chunk-SKNVVYIJ.js → chunk-6IUNAPLR.js} +3 -3
  47. package/chunks/{chunk-VUZY6MEQ.js → chunk-6LFJEACX.js} +4 -4
  48. package/chunks/{chunk-H2MDBYLL.js → chunk-6LFTG244.js} +8 -8
  49. package/chunks/{chunk-PVBT5QPD.js → chunk-6PJOTWAN.js} +1 -1
  50. package/chunks/{chunk-4IDJQOCO.js → chunk-77RG5SFQ.js} +1 -1
  51. package/chunks/{chunk-SDVF6A42.js → chunk-7DJCPZE3.js} +3 -3
  52. package/chunks/{chunk-ELY4QVIB.js → chunk-7EQQR46F.js} +1 -1
  53. package/chunks/{chunk-H4JK2A2V.js → chunk-7UYV53BC.js} +1 -1
  54. package/chunks/{chunk-6HOU52QX.js → chunk-A7YP63XN.js} +4 -4
  55. package/chunks/{chunk-E4I5MVBR.js → chunk-ABS25QER.js} +1 -1
  56. package/chunks/{chunk-XO4NGYRP.js → chunk-AGR5UROZ.js} +5 -5
  57. package/chunks/{chunk-5T4LWWNX.js → chunk-B7CDU2SL.js} +2 -2
  58. package/chunks/{chunk-GQAIZL3H.js → chunk-BAJKAAOY.js} +68 -64
  59. package/chunks/{chunk-DWRFOH3G.js → chunk-BBWV7ONL.js} +3 -3
  60. package/chunks/{chunk-4TPAG3O7.js → chunk-BFPESSTR.js} +1 -1
  61. package/chunks/{chunk-RUJTCU46.js → chunk-BNMF3K5X.js} +20 -19
  62. package/chunks/{chunk-IPQA4SR5.js → chunk-BWORX6FA.js} +1 -1
  63. package/chunks/{chunk-BKDAF7ES.js → chunk-BXDAPVQU.js} +2 -2
  64. package/chunks/{chunk-FY62MBPS.js → chunk-C6K43ZDE.js} +4 -4
  65. package/chunks/{chunk-JUIJ3FXC.js → chunk-CAJTKR6W.js} +5 -5
  66. package/chunks/{chunk-EADEZDPO.js → chunk-CCBZDVUA.js} +30 -25
  67. package/chunks/{chunk-DP7LABIB.js → chunk-CMHFCLBU.js} +1 -1
  68. package/chunks/{chunk-5AFPOEY3.js → chunk-CPGJJJLU.js} +1 -1
  69. package/chunks/{chunk-LRKMQPMD.js → chunk-CQH5KTKC.js} +1 -1
  70. package/chunks/{chunk-EWBY3PFB.js → chunk-CSMI4FP5.js} +1 -1
  71. package/chunks/{chunk-JECO75XD.js → chunk-D5LUXLUH.js} +2 -2
  72. package/chunks/{chunk-TQYZG5DU.js → chunk-DZWPESIF.js} +3 -3
  73. package/chunks/{chunk-5Y2JCJAH.js → chunk-EFUM7RVY.js} +15 -2
  74. package/chunks/{chunk-3UZCLCXR.js → chunk-EKSCLBBF.js} +3 -3
  75. package/chunks/{chunk-LJP2BBMK.js → chunk-EOGELB3H.js} +4 -4
  76. package/chunks/{chunk-624NHDGB.js → chunk-ERFDKH32.js} +11 -0
  77. package/chunks/{chunk-RQAMNZ4Y.js → chunk-F5SZP77N.js} +310 -78
  78. package/chunks/{chunk-SQPOJ4ZI.js → chunk-F6FV3C5K.js} +12 -7
  79. package/chunks/{chunk-C2BAEV64.js → chunk-F7TNAPZ4.js} +9 -7
  80. package/chunks/{chunk-OAAPGZVH.js → chunk-FBSSIAAQ.js} +6 -6
  81. package/chunks/{chunk-2FN2HNTI.js → chunk-FDY5RMGH.js} +2 -2
  82. package/chunks/{chunk-U66FXEH2.js → chunk-FY76G3G5.js} +5 -5
  83. package/chunks/{chunk-LKOSBI2M.js → chunk-G34IR3D6.js} +9 -9
  84. package/chunks/{chunk-ZWKGZB2K.js → chunk-H2WDGQ6D.js} +3 -3
  85. package/chunks/chunk-H72BQNM3.js +645 -0
  86. package/chunks/{chunk-ILPXSKGQ.js → chunk-HVEYF6VT.js} +2 -2
  87. package/chunks/{chunk-EAV3TENS.js → chunk-HVQ3B7FF.js} +2 -2
  88. package/chunks/{chunk-MI7CMXPU.js → chunk-IJKTMLBE.js} +1 -1
  89. package/chunks/{chunk-IN66KO3N.js → chunk-IK5BW3CS.js} +2 -2
  90. package/chunks/{chunk-5NV2AN56.js → chunk-IOPCFOTF.js} +3 -3
  91. package/chunks/{chunk-O3BUXIPM.js → chunk-IZIVM7LZ.js} +3 -3
  92. package/chunks/{chunk-I6VVOZDK.js → chunk-J2OSJFP3.js} +2 -2
  93. package/chunks/{chunk-AYVIGUUK.js → chunk-JB4JIVTJ.js} +1 -1
  94. package/chunks/{chunk-76WGY6LW.js → chunk-JCQD3INC.js} +3 -3
  95. package/chunks/{chunk-CITGRGCM.js → chunk-JHS74YAB.js} +4 -1
  96. package/chunks/{chunk-GXWY24QS.js → chunk-JSC3H3TD.js} +33 -10
  97. package/chunks/{chunk-NUHCXGAD.js → chunk-JSHHYW6T.js} +4 -4
  98. package/chunks/{chunk-5CW26JIE.js → chunk-JU4EEXC7.js} +2 -2
  99. package/chunks/{chunk-T6OODF2U.js → chunk-JWALNCLT.js} +1 -1
  100. package/chunks/{chunk-DX5FZGHZ.js → chunk-K2NQPH5D.js} +3 -3
  101. package/chunks/{chunk-VLY6XOBY.js → chunk-KEKZFOL6.js} +1 -1
  102. package/chunks/{chunk-RUQBJS34.js → chunk-KUX5D6DK.js} +1200 -339
  103. package/chunks/{chunk-UX3IFLJM.js → chunk-L2M46FP5.js} +149 -22
  104. package/chunks/{chunk-6US7BF3G.js → chunk-L6BZRIUL.js} +2 -2
  105. package/chunks/{chunk-BGWT7VBV.js → chunk-L6YT5H34.js} +4 -4
  106. package/chunks/{chunk-W2WRNJKX.js → chunk-LDP5OD6N.js} +5 -5
  107. package/chunks/{chunk-QB5DD75E.js → chunk-LXIBMVRN.js} +7 -7
  108. package/chunks/{chunk-GNMJNDZE.js → chunk-M6FOJXW3.js} +1 -1
  109. package/chunks/{chunk-OX44MOAN.js → chunk-MIIVI25Q.js} +3 -3
  110. package/chunks/{chunk-K3LPAED5.js → chunk-MQM5PJML.js} +24 -4
  111. package/chunks/{chunk-27ONXAFY.js → chunk-NIFYWDYN.js} +1 -1
  112. package/chunks/{chunk-IJVDHPKD.js → chunk-NU7RKEZR.js} +2 -2
  113. package/chunks/{chunk-MB4OCRQ2.js → chunk-O2UN57NX.js} +2 -2
  114. package/chunks/{chunk-TWUA5EIL.js → chunk-OIP7C4FE.js} +5 -5
  115. package/chunks/{chunk-UCSV2IZW.js → chunk-OIVXBW3W.js} +3 -3
  116. package/chunks/{chunk-TOF4UZHH.js → chunk-P2SU6ZTI.js} +3 -3
  117. package/chunks/{chunk-N4B7VPXK.js → chunk-P5GGM4KS.js} +5 -5
  118. package/chunks/{chunk-ZKAZP2ZG.js → chunk-PDMJ3KGS.js} +2 -2
  119. package/chunks/{chunk-RRKNX553.js → chunk-PDQGMSZK.js} +1 -1
  120. package/chunks/{chunk-3UXJFOB3.js → chunk-PFCQ62V4.js} +5 -5
  121. package/chunks/{chunk-JLGFGPZJ.js → chunk-PKAYJDB3.js} +2 -2
  122. package/chunks/{chunk-GTUKW3I6.js → chunk-PPKZ7JOE.js} +1 -1
  123. package/chunks/{chunk-HOANA6GC.js → chunk-Q26AYA62.js} +4 -4
  124. package/chunks/{chunk-WEGXPP5E.js → chunk-QFCDF5PL.js} +1 -1
  125. package/chunks/{chunk-4PLAO7FS.js → chunk-QP4C6WCE.js} +3 -3
  126. package/chunks/{chunk-3B5DCAQU.js → chunk-R4PMVSR5.js} +27 -25
  127. package/chunks/{chunk-7JJUFI36.js → chunk-RIEFGNTP.js} +579 -3419
  128. package/chunks/{chunk-7XKW4CVK.js → chunk-RJC5EIKY.js} +4 -4
  129. package/chunks/chunk-RKFGE7JH.js +93 -0
  130. package/chunks/{chunk-CPPYZHBN.js → chunk-RU7BK6B3.js} +1 -1
  131. package/chunks/{chunk-GZJUCMH4.js → chunk-RUGNCYNO.js} +11 -633
  132. package/chunks/{chunk-ZLTEQYNC.js → chunk-SFPGAQUL.js} +2 -2
  133. package/chunks/{chunk-K6FURWIX.js → chunk-SJ3ZUWFK.js} +26 -4
  134. package/chunks/{chunk-DEYPMJPD.js → chunk-SMPR7SPO.js} +1 -1
  135. package/chunks/{chunk-7CWEZQ6T.js → chunk-STUJ7IMZ.js} +0 -77
  136. package/chunks/{chunk-O5YGAEQS.js → chunk-T32W2JHI.js} +6 -6
  137. package/chunks/chunk-T3WXYEZ4.js +304 -0
  138. package/chunks/{chunk-D6XO27Z5.js → chunk-TGWAQ5RB.js} +750 -296
  139. package/chunks/{chunk-EC5BONC3.js → chunk-TPI7O7HR.js} +1 -1
  140. package/chunks/{chunk-OI2DR6QB.js → chunk-TRZTNIQ6.js} +2 -2
  141. package/chunks/{chunk-T2CRBIDJ.js → chunk-TTX2JUE6.js} +1 -1
  142. package/chunks/{chunk-2NNTE2ED.js → chunk-UHQFIS7N.js} +15 -0
  143. package/chunks/{chunk-KOJ6MHD5.js → chunk-UTLCH2FK.js} +1 -1
  144. package/chunks/{chunk-7DPKPBOQ.js → chunk-V2NDP3I4.js} +2 -2
  145. package/chunks/{chunk-RQ5ASDFQ.js → chunk-V4QXXQJ2.js} +3 -3
  146. package/chunks/{chunk-BVE5EMIG.js → chunk-V5J4J5TP.js} +2 -2
  147. package/chunks/{chunk-X2UOOG5V.js → chunk-VQUGEVGR.js} +1 -1
  148. package/chunks/{chunk-XJS54K4A.js → chunk-VTHREBQM.js} +2 -2
  149. package/chunks/{chunk-V3GINY6K.js → chunk-VVW4ZNFY.js} +3 -3
  150. package/chunks/{chunk-YT5XN3HV.js → chunk-W5MJJ2V7.js} +1 -1
  151. package/chunks/{chunk-FPH6TXD3.js → chunk-WAOIHTJS.js} +1 -1
  152. package/chunks/{chunk-FN5C6C7G.js → chunk-WKK5BQNP.js} +151 -60
  153. package/chunks/chunk-XDFHY4R3.js +1584 -0
  154. package/chunks/{chunk-L436XFLJ.js → chunk-XDLEZ5HX.js} +1 -1
  155. package/chunks/{chunk-VL4YX3FH.js → chunk-XF63PKEN.js} +1 -1
  156. package/chunks/{chunk-3FSBMAYD.js → chunk-XQFT3QUF.js} +1 -1
  157. package/chunks/{chunk-2MHGD7EE.js → chunk-XRSOI3DL.js} +1 -1
  158. package/chunks/{chunk-FJWICLG7.js → chunk-Y3QL45LS.js} +1 -1
  159. package/chunks/{chunk-RCDXSEJ5.js → chunk-Y6LSMB6J.js} +1 -1
  160. package/chunks/{chunk-2SERYG4T.js → chunk-YTDVNSUQ.js} +1 -1
  161. package/chunks/{chunk-4X5GYZFO.js → chunk-Z7FLBQPR.js} +7 -7
  162. package/chunks/{chunk-3BV7TZNQ.js → chunk-Z7TGYN5F.js} +3 -3
  163. package/chunks/{chunk-4Z3PSHN4.js → chunk-ZFKOCECU.js} +2 -2
  164. package/chunks/chunk-ZGXYO7DY.js +3416 -0
  165. package/chunks/{chunk-E6FGMDFQ.js → chunk-ZU4UDIWX.js} +19 -1
  166. package/chunks/config-utils-BBOCOGZW.js +113 -0
  167. package/chunks/contextCommand-EET67MQ2.js +108 -0
  168. package/chunks/{core-runtime-6TBMEULI.js → core-runtime-677KFX6Q.js} +53 -53
  169. package/chunks/{create-sub-session-RVHSWVAP.js → create-sub-session-23ITIELI.js} +3 -3
  170. package/chunks/{create-sub-session-SAOMTP62.js → create-sub-session-JKZAYZX7.js} +160 -79
  171. package/chunks/{cron-create-IJGVR5R2.js → cron-create-KJ4IY6PP.js} +57 -10
  172. package/chunks/{cron-delete-4N5BI6GL.js → cron-delete-MBLQCAYY.js} +4 -4
  173. package/chunks/{cron-list-2CATIPUX.js → cron-list-DWH2PQ47.js} +4 -4
  174. package/chunks/{daemon-NAYK4XXU.js → daemon-MJQUO7RA.js} +28 -1
  175. package/chunks/{daemon-git-worktree-guard-TYLESM6G.js → daemon-git-worktree-guard-6MVAAZZZ.js} +53 -53
  176. package/chunks/daemon-status-provider-RFKZOK3S.js +119 -0
  177. package/chunks/daemon-trust-policy-DRZPFB4Q.js +114 -0
  178. package/chunks/{daemon-trust-policy-monitor-WWX7I7P6.js → daemon-trust-policy-monitor-B5U6TQX5.js} +59 -59
  179. package/chunks/deferred-core-runtime-BBVIOP24.js +116 -0
  180. package/chunks/{display-image-DR55LL6M.js → display-image-BE7I6ZB6.js} +5 -5
  181. package/chunks/{dist-FVJZSIO4.js → dist-ILDBUWDB.js} +71 -19
  182. package/chunks/{dist-6H6RZ5H6.js → dist-QODVOVWI.js} +58 -35
  183. package/chunks/earlyInputCapture-2JOMMNQ4.js +109 -0
  184. package/chunks/{edit-GBDKI5DZ.js → edit-BSV6YRVW.js} +42 -42
  185. package/chunks/{en-6MDBWMTG.js → en-YLXBXM4Z.js} +2 -1
  186. package/chunks/{enter-worktree-UOZ6ZTP7.js → enter-worktree-MQXFFPKM.js} +7 -7
  187. package/chunks/{enterPlanMode-2KTIPPM3.js → enterPlanMode-PKNF35FE.js} +41 -41
  188. package/chunks/{environment-XJ75LJ6N.js → environment-MOZMPUHR.js} +55 -55
  189. package/chunks/errors-DMPQVYJL.js +115 -0
  190. package/chunks/{exit-worktree-G2QATUCV.js → exit-worktree-L344UY7K.js} +7 -7
  191. package/chunks/{exitPlanMode-AUMYTFIQ.js → exitPlanMode-UE4FGCY4.js} +41 -41
  192. package/chunks/{fast-path-TU7U2ETU.js → fast-path-773PV7PU.js} +5 -5
  193. package/chunks/{gemini-FKMYDP64.js → gemini-IP4FJAP5.js} +101 -100
  194. package/chunks/{geminiContentGenerator-WSHP7CSR.js → geminiContentGenerator-PUNEBWJW.js} +8 -8
  195. package/chunks/{glob-EOM6XK7H.js → glob-CZHOWUEA.js} +41 -41
  196. package/chunks/{goal-tools-CNVXMSZD.js → goal-tools-YZQJXTGH.js} +9 -8
  197. package/chunks/{grep-3NLSS32D.js → grep-5GPICQBU.js} +6 -6
  198. package/chunks/handleAutoUpdate-SGXKTQM6.js +111 -0
  199. package/chunks/{i18n-XX7U2Q3X.js → i18n-B42HKHKH.js} +54 -54
  200. package/chunks/{image-gen-63NN2H5N.js → image-gen-HAYOEQ4O.js} +9 -9
  201. package/chunks/initializer-FB66WYR3.js +115 -0
  202. package/chunks/installationInfo-Y7AULNMX.js +109 -0
  203. package/chunks/{keychain-token-storage-3MGFRYGM.js → keychain-token-storage-37XPR34V.js} +2 -2
  204. package/chunks/list-2HWGSVRA.js +118 -0
  205. package/chunks/{list-agents-EXRSHIDJ.js → list-agents-DI3YFTDT.js} +2 -2
  206. package/chunks/loadedSettingsAdapter-7Y7IEI6T.js +112 -0
  207. package/chunks/{loggingContentGenerator-TUDGCVUG.js → loggingContentGenerator-2GGZNGLG.js} +35 -22
  208. package/chunks/{loop-wakeup-XBPB2BRO.js → loop-wakeup-XJFONSQ7.js} +5 -5
  209. package/chunks/{ls-WFONAND2.js → ls-3VAT2J7A.js} +4 -4
  210. package/chunks/{lsp-DUKPDUXN.js → lsp-5W7IRUBH.js} +2 -2
  211. package/chunks/{managed-npm-update-5K4FWFX2.js → managed-npm-update-5TEV2E3J.js} +54 -54
  212. package/chunks/mcp-QGG5NMJJ.js +112 -0
  213. package/chunks/{monitor-UUHIAGT7.js → monitor-FI7PY36Z.js} +41 -41
  214. package/chunks/nonInteractiveCli-4LO2TL72.js +186 -0
  215. package/chunks/{notebook-edit-GZPB3Q57.js → notebook-edit-TPGMGBST.js} +42 -42
  216. package/chunks/{openaiContentGenerator-RPP6YBS3.js → openaiContentGenerator-SUCYANUZ.js} +24 -24
  217. package/chunks/pidfile-JMF2CLMY.js +113 -0
  218. package/chunks/{processUtils-ENAY2GSA.js → processUtils-IQZBYWSB.js} +2 -2
  219. package/chunks/prompt-terminal-ledger-DCZO6S7C.js +107 -0
  220. package/chunks/{qwenContentGenerator-GLUZVJAU.js → qwenContentGenerator-J4TXFGJT.js} +46 -46
  221. package/chunks/{qwenOAuth2-JIYAWXTW.js → qwenOAuth2-RF33DNZW.js} +8 -8
  222. package/chunks/{read-file-75R5LUWQ.js → read-file-QE2B5FTX.js} +12 -12
  223. package/chunks/{read-mcp-resource-7A7NFSFL.js → read-mcp-resource-XD257PGJ.js} +2 -2
  224. package/chunks/{record-artifact-CPJ4IJSD.js → record-artifact-RZGZBENU.js} +4 -4
  225. package/chunks/{report-findings-VFM5DENC.js → report-findings-Q3SYKKW5.js} +5 -5
  226. package/chunks/{request-shutdown-AXVOFN5C.js → request-shutdown-BCLA3JV2.js} +7 -7
  227. package/chunks/resumeHistoryUtils-CZ4JRDVW.js +120 -0
  228. package/chunks/{ripGrep-FNLXQYBS.js → ripGrep-R6B6HWPX.js} +17 -17
  229. package/chunks/{run-qwen-serve-FJD4VMI2.js → run-qwen-serve-TPHZMSXJ.js} +148 -319
  230. package/chunks/{runtime-INDSJB4K.js → runtime-TTIGSBM4.js} +62 -62
  231. package/chunks/scheduled-tasks-QB4ZVUQS.js +129 -0
  232. package/chunks/{scheduler-Z52TCSUG.js → scheduler-YRUG22M7.js} +55 -55
  233. package/chunks/{sdk-exporters-http-XXSKBD2C.js → sdk-exporters-http-KCJ4ZFG7.js} +2 -2
  234. package/chunks/{sdk-impl-VPNBLV7I.js → sdk-impl-HLSEDAEP.js} +4 -4
  235. package/chunks/{send-message-A2GXDX3B.js → send-message-Y5I6NYAM.js} +7 -7
  236. package/chunks/serve-MXXCDAQN.js +120 -0
  237. package/chunks/{server-PSN5OOSX.js → server-DFUSSSHI.js} +19760 -19444
  238. package/chunks/{session-JPE34X6Q.js → session-3TEHNENZ.js} +100 -99
  239. package/chunks/{settings-IVGC4UYK.js → settings-VOZYKLTT.js} +58 -58
  240. package/chunks/{shell-A5PZGPBR.js → shell-6RTKZVMI.js} +41 -41
  241. package/chunks/{skill-UUXQPDEH.js → skill-FEOKFX26.js} +22 -21
  242. package/chunks/{skill-settings-WVRXLTK4.js → skill-settings-VA4XVYVL.js} +58 -58
  243. package/chunks/spawnChannel-F6WVP723.js +114 -0
  244. package/chunks/{standalone-update-IRFRNGAA.js → standalone-update-RGILUQVK.js} +55 -55
  245. package/chunks/{startInteractiveUI-MC4GLL6G.js → startInteractiveUI-WHJPFOGH.js} +2757 -2223
  246. package/chunks/{syntheticOutput-5AJ444QT.js → syntheticOutput-ML43GEFN.js} +3 -3
  247. package/chunks/{task-create-CDJSOEQD.js → task-create-TMSV7RD5.js} +11 -11
  248. package/chunks/{task-list-BELMPA75.js → task-list-W55RBFRX.js} +5 -5
  249. package/chunks/{task-stop-U3S3KZG2.js → task-stop-CXEH5L2D.js} +2 -2
  250. package/chunks/{task-update-77VCFDDZ.js → task-update-N536I4GQ.js} +11 -11
  251. package/chunks/{team-create-WO5ZBCFW.js → team-create-QYSWCYCL.js} +41 -41
  252. package/chunks/{team-delete-YWFXX77L.js → team-delete-FJRFX33M.js} +5 -5
  253. package/chunks/{team-plan-approval-KAVKRN7U.js → team-plan-approval-P7DAD644.js} +41 -41
  254. package/chunks/{terminal-image-renderer-SMRRNI6Z.js → terminal-image-renderer-SMQE46UJ.js} +55 -55
  255. package/chunks/theme-manager-RFO5WWFF.js +104 -0
  256. package/chunks/{todoWrite-435EO2CS.js → todoWrite-WDJNQEMW.js} +43 -25
  257. package/chunks/{tool-search-FBN6OC6U.js → tool-search-F2EMIAPV.js} +17 -17
  258. package/chunks/total-session-admission-HTVTP4BS.js +116 -0
  259. package/chunks/{trustedFolders-B4LPJBFK.js → trustedFolders-7OCNMUQE.js} +54 -54
  260. package/chunks/{update-relaunch-X5TJVKVG.js → update-relaunch-4GF3OXMB.js} +5 -5
  261. package/chunks/{updateCheck-JCLP5JFT.js → updateCheck-7QBDXZRT.js} +56 -56
  262. package/chunks/useAutoAcceptIndicator-UI4SNL2O.js +122 -0
  263. package/chunks/{validateNonInterActiveAuth-W7HYH5ZN.js → validateNonInterActiveAuth-BPPA563H.js} +96 -95
  264. package/chunks/{version-JG4J76GL.js → version-ANP4TS6O.js} +1 -1
  265. package/chunks/{web-fetch-SPLMEDWF.js → web-fetch-QJADSAH3.js} +16 -16
  266. package/chunks/{web-search-PNW6OEH6.js → web-search-7TTQKEKM.js} +9 -9
  267. package/chunks/{workflow-QHOIIXJO.js → workflow-5XN6XSOT.js} +105 -60
  268. package/chunks/workspace-providers-status-PDFZWL5Q.js +116 -0
  269. package/chunks/{workspace-registration-store-H375IYR2.js → workspace-registration-store-XKVW2YVH.js} +1 -1
  270. package/chunks/{workspace-registry-XTLCD7Z2.js → workspace-registry-23R7XRB5.js} +61 -59
  271. package/chunks/workspace-service-MUYO2QIC.js +131 -0
  272. package/chunks/workspace-skills-status-IKECTOOQ.js +115 -0
  273. package/chunks/{workspace-trust-reconciler-6SC6RKQE.js → workspace-trust-reconciler-KLGOB53D.js} +67 -65
  274. package/chunks/write-file-GGRBB5TZ.js +90 -0
  275. package/chunks/{zh-TW-MV4FWFB6.js → zh-TW-RPTMRTHG.js} +2 -1
  276. package/chunks/{zh-X3WGU6SI.js → zh-UNY63FR3.js} +2 -1
  277. package/chunks/{zoom-image-WGNPZ572.js → zoom-image-6ASG6J4C.js} +12 -12
  278. package/cli.js +14 -14
  279. package/locales/en.js +2 -0
  280. package/locales/zh-TW.js +2 -0
  281. package/locales/zh.js +2 -0
  282. package/package.json +3 -3
  283. package/web-shell/assets/{abnfDiagram-VCTEODGH-yq7z7Anb.js → abnfDiagram-VCTEODGH-uS-vtfs3.js} +1 -1
  284. package/web-shell/assets/{arc-CbJO0xnT.js → arc-BSTnk5pu.js} +1 -1
  285. package/web-shell/assets/{architectureDiagram-5GKGNRK7-CRh89421.js → architectureDiagram-5GKGNRK7-DCMyiqzy.js} +1 -1
  286. package/web-shell/assets/{blockDiagram-NRAW4CY4-C75KAhKv.js → blockDiagram-NRAW4CY4-C7_gt0r1.js} +1 -1
  287. package/web-shell/assets/{c4Diagram-UCG6FXSJ-BzlMveFB.js → c4Diagram-UCG6FXSJ-BeQg2L8B.js} +1 -1
  288. package/web-shell/assets/channel-CENAhErJ.js +1 -0
  289. package/web-shell/assets/{chunk-2Q5K7J3B-DA8QDX3a.js → chunk-2Q5K7J3B-DnV9bKBe.js} +1 -1
  290. package/web-shell/assets/{chunk-5VM5RSS4-Bgu7gQ7Y.js → chunk-5VM5RSS4-rT1GAcT7.js} +1 -1
  291. package/web-shell/assets/{chunk-F27PBJKO-BOew7pIK.js → chunk-F27PBJKO-BcgSxqGA.js} +1 -1
  292. package/web-shell/assets/{chunk-G27WJ6UU-DHx1I-hO.js → chunk-G27WJ6UU-Bw1ZhyZq.js} +1 -1
  293. package/web-shell/assets/{chunk-JWPE2WC7-SarFW0WU.js → chunk-JWPE2WC7-D4iDw-96.js} +1 -1
  294. package/web-shell/assets/{chunk-LCL6LL3I-BLzP083Z.js → chunk-LCL6LL3I-D3MB3GTZ.js} +1 -1
  295. package/web-shell/assets/{chunk-POPQ4Y6H-Bmkv_iKm.js → chunk-POPQ4Y6H-Cep2ndrS.js} +1 -1
  296. package/web-shell/assets/{chunk-SVP7TREG-MPx9r1N2.js → chunk-SVP7TREG-BuahMHJc.js} +1 -1
  297. package/web-shell/assets/{chunk-XXDRQBXY-Ck-09rKG.js → chunk-XXDRQBXY-BdujIvJY.js} +1 -1
  298. package/web-shell/assets/classDiagram-DTDB5LWJ-CM6FArGH.js +1 -0
  299. package/web-shell/assets/classDiagram-v2-JRS7N3AN-CM6FArGH.js +1 -0
  300. package/web-shell/assets/{cose-bilkent-JH36ORCC-DWm6lfOG.js → cose-bilkent-JH36ORCC-CGLLUbF8.js} +1 -1
  301. package/web-shell/assets/{cynefin-OW5HDTMX-DcBUyr5R.js → cynefin-OW5HDTMX-D6kDsRSh.js} +1 -1
  302. package/web-shell/assets/{cynefinDiagram-5FMLGOSQ-Df8qmd_p.js → cynefinDiagram-5FMLGOSQ-CCy78qZx.js} +1 -1
  303. package/web-shell/assets/{dagre-3AP2YEHR-DDmGspD7.js → dagre-3AP2YEHR-D5gJuJsf.js} +1 -1
  304. package/web-shell/assets/{diagram-S7CK7UJ4-BK_qFvbi.js → diagram-S7CK7UJ4-ZwEZ5W__.js} +1 -1
  305. package/web-shell/assets/{diagram-UQ7AKVKN-Uw3AP_bi.js → diagram-UQ7AKVKN-B036APjv.js} +1 -1
  306. package/web-shell/assets/{diagram-VSXAHHWV-CJOQKxY7.js → diagram-VSXAHHWV-BfDJ57Fq.js} +1 -1
  307. package/web-shell/assets/{diagram-VX7I27RA-DhdvZna5.js → diagram-VX7I27RA-Wha0p5rT.js} +1 -1
  308. package/web-shell/assets/{diagram-Z3DM3KII-edQU0nlP.js → diagram-Z3DM3KII-L20bz2K1.js} +1 -1
  309. package/web-shell/assets/{ebnfDiagram-PWID7BFC-4kugBEsO.js → ebnfDiagram-PWID7BFC-D1ZM0Cp7.js} +1 -1
  310. package/web-shell/assets/{erDiagram-SSCWMZ5O-BMkFivWO.js → erDiagram-SSCWMZ5O-CMtA19v8.js} +1 -1
  311. package/web-shell/assets/{flowDiagram-A5DVABFB-BM1ea8g-.js → flowDiagram-A5DVABFB-D96m326S.js} +1 -1
  312. package/web-shell/assets/{ganttDiagram-EL5Y4UJY-CXj_cKRf.js → ganttDiagram-EL5Y4UJY-BuHiYG2o.js} +1 -1
  313. package/web-shell/assets/{gitGraphDiagram-WWUBYQGX-D0nEqwqu.js → gitGraphDiagram-WWUBYQGX-Ck3NmkSw.js} +1 -1
  314. package/web-shell/assets/index-8hXIpvo4.js +1865 -0
  315. package/web-shell/assets/{index-B6JN54Pd.js → index-CBGz4Qjl.js} +1 -1
  316. package/web-shell/assets/{index-C-XlQn24.css → index-DclEv91i.css} +1 -1
  317. package/web-shell/assets/{infoDiagram-RXCK75RN-DF7aGGbQ.js → infoDiagram-RXCK75RN-B6DAOyXe.js} +1 -1
  318. package/web-shell/assets/{ishikawaDiagram-5VMMS53U-CZYNX1lL.js → ishikawaDiagram-5VMMS53U-Bpg-joFo.js} +1 -1
  319. package/web-shell/assets/{journeyDiagram-EYS64GPL-CvrqMUz1.js → journeyDiagram-EYS64GPL-BclrHzGa.js} +1 -1
  320. package/web-shell/assets/{kanban-definition-3QL26DDD-BZNJQZBj.js → kanban-definition-3QL26DDD-5gJzNTYG.js} +1 -1
  321. package/web-shell/assets/{layout-Bf83x7D6.js → layout-CEz_1L8z.js} +1 -1
  322. package/web-shell/assets/{linear-Bkc3ES2f.js → linear-CBjTq9Hc.js} +1 -1
  323. package/web-shell/assets/{mermaid.core-C6xuovwz.js → mermaid.core-Dzhbxx_I.js} +6 -6
  324. package/web-shell/assets/{mindmap-definition-FBJOCRG2-DzH6gVRg.js → mindmap-definition-FBJOCRG2-DQdVqlBF.js} +1 -1
  325. package/web-shell/assets/{pegDiagram-XKGWAZYB-DCvLh2fa.js → pegDiagram-XKGWAZYB-D1JZlYXL.js} +1 -1
  326. package/web-shell/assets/{pieDiagram-E7YTZNPT-BtjVlx_6.js → pieDiagram-E7YTZNPT-BmkpYL0w.js} +1 -1
  327. package/web-shell/assets/{quadrantDiagram-AXDQQJYC-IbroqxFe.js → quadrantDiagram-AXDQQJYC-DRvD6co5.js} +1 -1
  328. package/web-shell/assets/{railroadDiagram-O6MQD6OU-BvMykiWW.js → railroadDiagram-O6MQD6OU-CEdjDuoo.js} +1 -1
  329. package/web-shell/assets/{requirementDiagram-EFPCY7ZU-D-HHMyrh.js → requirementDiagram-EFPCY7ZU-BCHG-ie8.js} +1 -1
  330. package/web-shell/assets/{sankeyDiagram-P5KCCOFB-C0XXhB6d.js → sankeyDiagram-P5KCCOFB-C9cZMnye.js} +1 -1
  331. package/web-shell/assets/{sequenceDiagram-WJ2MYXX4-DseAXj5d.js → sequenceDiagram-WJ2MYXX4-DYHRV4zL.js} +1 -1
  332. package/web-shell/assets/{sizeCapture-X5ZJPWSS-Cek2EweK.js → sizeCapture-X5ZJPWSS-DlK21aye.js} +1 -1
  333. package/web-shell/assets/{stateDiagram-HBIQ2CUA-yLv8wafW.js → stateDiagram-HBIQ2CUA-BrmZssvk.js} +1 -1
  334. package/web-shell/assets/stateDiagram-v2-4QOOHH4V-B2Q7XDaE.js +1 -0
  335. package/web-shell/assets/{swimlanes-XN3QIQJK-Cwz-opvE.js → swimlanes-XN3QIQJK-D9xfcayR.js} +1 -1
  336. package/web-shell/assets/swimlanesDiagram-VK2B7HYN-DpZPOSbX.js +8 -0
  337. package/web-shell/assets/{timeline-definition-24CTP7MA-BJuFD7OG.js → timeline-definition-24CTP7MA-D4gdDL_d.js} +1 -1
  338. package/web-shell/assets/{vennDiagram-4TSXK5OY-CNAavdoV.js → vennDiagram-4TSXK5OY-DdhIExjI.js} +1 -1
  339. package/web-shell/assets/{wardleyDiagram-VM6X3IG4-DaIjAidq.js → wardleyDiagram-VM6X3IG4-C9RS_Zof.js} +1 -1
  340. package/web-shell/assets/{xychartDiagram-S5SC5T6Z-DkcQXjTy.js → xychartDiagram-S5SC5T6Z-orRgmxWk.js} +1 -1
  341. package/web-shell/index.html +2 -2
  342. package/chunks/MaxSizedBox-XYQOMOBE.js +0 -112
  343. package/chunks/agent-headless-3ZC4LX3E.js +0 -87
  344. package/chunks/bridge-LFFLHLU5.js +0 -119
  345. package/chunks/channel-settings-store-CAL2HWAH.js +0 -117
  346. package/chunks/chunk-JS73NNWF.js +0 -30
  347. package/chunks/chunk-VGHZT6JR.js +0 -51
  348. package/chunks/config-utils-YMJNA25D.js +0 -113
  349. package/chunks/contextCommand-WMPSNKPG.js +0 -108
  350. package/chunks/daemon-status-provider-YBQAZD3G.js +0 -118
  351. package/chunks/daemon-trust-policy-O75ZSIJN.js +0 -114
  352. package/chunks/deferred-core-runtime-MGCCR6LA.js +0 -116
  353. package/chunks/earlyInputCapture-2EJKJET3.js +0 -109
  354. package/chunks/errors-XEI3SJRV.js +0 -115
  355. package/chunks/handleAutoUpdate-S4CLP36D.js +0 -111
  356. package/chunks/initializer-D3CA3272.js +0 -115
  357. package/chunks/installationInfo-HVDQOSIE.js +0 -109
  358. package/chunks/list-XUDSTGT3.js +0 -118
  359. package/chunks/loadedSettingsAdapter-ZOJ4QEID.js +0 -112
  360. package/chunks/mcp-QJ6AUYE5.js +0 -112
  361. package/chunks/nonInteractiveCli-PAWO75YO.js +0 -185
  362. package/chunks/pidfile-RF3WUFKR.js +0 -113
  363. package/chunks/prompt-terminal-ledger-4CCXZ2LF.js +0 -107
  364. package/chunks/resumeHistoryUtils-GFPJD2XB.js +0 -120
  365. package/chunks/serve-GVD2WXVL.js +0 -120
  366. package/chunks/spawnChannel-KTURLD4B.js +0 -113
  367. package/chunks/theme-manager-A7CPN7F4.js +0 -104
  368. package/chunks/total-session-admission-B7U6UWKQ.js +0 -114
  369. package/chunks/useAutoAcceptIndicator-VBT3NKDM.js +0 -122
  370. package/chunks/workspace-providers-status-653DTR35.js +0 -116
  371. package/chunks/workspace-service-KVJWACCS.js +0 -131
  372. package/chunks/workspace-skills-status-TRJ2VWGU.js +0 -115
  373. package/chunks/write-file-EAZSJZKR.js +0 -90
  374. package/web-shell/assets/channel-B3sGR79J.js +0 -1
  375. package/web-shell/assets/classDiagram-DTDB5LWJ-sTGo0K3v.js +0 -1
  376. package/web-shell/assets/classDiagram-v2-JRS7N3AN-sTGo0K3v.js +0 -1
  377. package/web-shell/assets/index-DLjXM0dn.js +0 -1860
  378. package/web-shell/assets/stateDiagram-v2-4QOOHH4V-DeThXnol.js +0 -1
  379. package/web-shell/assets/swimlanesDiagram-VK2B7HYN-GW0R1ZSv.js +0 -8
@@ -1,5 +1,8 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
+ import {
4
+ recomputeMcpGating
5
+ } from "./chunk-P5GGM4KS.js";
3
6
  import {
4
7
  classifyApiError,
5
8
  fireSessionDeleteHook
@@ -14,7 +17,7 @@ import {
14
17
  normalizePartList,
15
18
  parseExtensionRef,
16
19
  parseMcpServerRef
17
- } from "./chunk-TWUA5EIL.js";
20
+ } from "./chunk-OIP7C4FE.js";
18
21
  import {
19
22
  getAvailableCommands,
20
23
  getSlashCommandFirstToken,
@@ -23,14 +26,7 @@ import {
23
26
  isSlashCommand,
24
27
  recordDaemonSessionModel,
25
28
  restoreSessionModelThenAuthenticate
26
- } from "./chunk-RQAMNZ4Y.js";
27
- import {
28
- collectContextData,
29
- formatContextUsageText
30
- } from "./chunk-XO4NGYRP.js";
31
- import {
32
- recomputeMcpGating
33
- } from "./chunk-N4B7VPXK.js";
29
+ } from "./chunk-F5SZP77N.js";
34
30
  import {
35
31
  SessionIdConflictError,
36
32
  appEvents,
@@ -38,41 +34,45 @@ import {
38
34
  cleanupReviewWorktreeLeases,
39
35
  loadCliConfig,
40
36
  normalizeDisabledToolList
41
- } from "./chunk-GQAIZL3H.js";
37
+ } from "./chunk-BAJKAAOY.js";
38
+ import "./chunk-NYX53SV4.js";
39
+ import {
40
+ collectContextData,
41
+ formatContextUsageText
42
+ } from "./chunk-AGR5UROZ.js";
42
43
  import {
43
44
  getCommandSubcommandNames
44
- } from "./chunk-MI7CMXPU.js";
45
+ } from "./chunk-IJKTMLBE.js";
45
46
  import {
46
47
  getEffectiveSupportedModes
47
- } from "./chunk-DX5FZGHZ.js";
48
- import "./chunk-2FN2HNTI.js";
48
+ } from "./chunk-K2NQPH5D.js";
49
+ import "./chunk-FDY5RMGH.js";
49
50
  import "./chunk-4WGODMVR.js";
50
51
  import "./chunk-3SH53ANB.js";
51
- import "./chunk-NYX53SV4.js";
52
52
  import {
53
53
  isGoalStatusKind
54
54
  } from "./chunk-EKTCKZV5.js";
55
- import "./chunk-4PLAO7FS.js";
56
- import "./chunk-WEGXPP5E.js";
55
+ import "./chunk-QP4C6WCE.js";
56
+ import "./chunk-YAF2MQZ6.js";
57
+ import "./chunk-QFCDF5PL.js";
57
58
  import {
58
59
  startNonInteractiveOpenAILogHousekeeping
59
- } from "./chunk-NUHCXGAD.js";
60
+ } from "./chunk-JSHHYW6T.js";
60
61
  import "./chunk-KW7NOTN6.js";
62
+ import "./chunk-C6K43ZDE.js";
63
+ import "./chunk-6H67XLET.js";
61
64
  import {
62
65
  beginAcpBootstrapConfigProfiling,
63
66
  buildAndFreezeAcpStartupProfile,
64
67
  endAcpBootstrapConfigProfiling,
65
68
  markAcpStartup
66
69
  } from "./chunk-5JTIYALA.js";
67
- import "./chunk-6HOU52QX.js";
68
- import "./chunk-BGWT7VBV.js";
69
- import "./chunk-EWBY3PFB.js";
70
- import "./chunk-YAF2MQZ6.js";
70
+ import "./chunk-A7YP63XN.js";
71
+ import "./chunk-L6YT5H34.js";
72
+ import "./chunk-CSMI4FP5.js";
71
73
  import {
72
74
  computeCpuPercent
73
75
  } from "./chunk-LBOVL47Y.js";
74
- import "./chunk-FY62MBPS.js";
75
- import "./chunk-6H67XLET.js";
76
76
  import {
77
77
  GENERATION_MAX_PROMPT_BYTES,
78
78
  GENERATION_TIMEOUT_MS,
@@ -87,7 +87,6 @@ import {
87
87
  formatWorkspaceMemoryForgetSummary,
88
88
  isCompatibleLiveSessionSource,
89
89
  isValidServerName,
90
- normalizeChannelDeliveryText,
91
90
  projectAcpToolResultUpdate,
92
91
  redactMcpServerSecrets,
93
92
  replayTranscriptRecordPage,
@@ -95,7 +94,7 @@ import {
95
94
  shouldSuppressRememberErrorDetails,
96
95
  workspaceMemoryFailureCode,
97
96
  workspaceMemoryFailureDiagnostics
98
- } from "./chunk-4N6UAPD3.js";
97
+ } from "./chunk-4MQEPP3Y.js";
99
98
  import {
100
99
  BaseEmitter,
101
100
  HistoryReplayer,
@@ -106,48 +105,54 @@ import {
106
105
  hasFullSessionContext,
107
106
  observeAcpToolResultProjection,
108
107
  observeAcpToolResultWire
109
- } from "./chunk-JJJD6QCC.js";
110
- import "./chunk-4TPAG3O7.js";
108
+ } from "./chunk-3SGB2UHX.js";
109
+ import "./chunk-BFPESSTR.js";
111
110
  import "./chunk-E7REAOTN.js";
112
- import "./chunk-L436XFLJ.js";
111
+ import "./chunk-XDLEZ5HX.js";
113
112
  import "./chunk-2MIN6GRR.js";
114
113
  import "./chunk-QHTIBUWB.js";
115
114
  import "./chunk-TXASDT2M.js";
116
115
  import {
117
- buildToolWriteOriginMeta
118
- } from "./chunk-VGHZT6JR.js";
116
+ DAEMON_OWNED_STANDALONE_CREATION_KEY,
117
+ SESSION_SOURCE_META_KEY,
118
+ isReservedStandaloneSessionSourceType,
119
+ parseSessionSource
120
+ } from "./chunk-2TNL5KPM.js";
121
+ import {
122
+ buildToolWriteOriginMeta,
123
+ getConversationDirectoryName,
124
+ isSameConversationPath
125
+ } from "./chunk-T3WXYEZ4.js";
126
+ import "./chunk-UXEO7E3V.js";
127
+ import "./chunk-RXFQM6FQ.js";
128
+ import {
129
+ normalizeChannelDeliveryText
130
+ } from "./chunk-4CMJKUND.js";
119
131
  import {
120
132
  normalizeSessionIdForLookup,
121
133
  parseCallerSuppliedSessionId
122
134
  } from "./chunk-ZEZKIS2K.js";
123
- import "./chunk-RXFQM6FQ.js";
124
- import "./chunk-UXEO7E3V.js";
125
135
  import {
126
136
  PERMISSION_RULE_TYPES,
127
137
  PermissionRulesValidationError,
128
138
  buildPermissionSettings,
129
139
  normalizePermissionRules,
130
140
  readPermissionRuleSet
131
- } from "./chunk-VLY6XOBY.js";
141
+ } from "./chunk-KEKZFOL6.js";
132
142
  import {
133
143
  MAX_AUDIO_BYTES,
134
144
  sanitizeVoiceErrorMessage,
135
145
  transcribeVoiceAudio
136
- } from "./chunk-76WGY6LW.js";
146
+ } from "./chunk-JCQD3INC.js";
137
147
  import {
138
148
  readVoiceModel
139
- } from "./chunk-2MHGD7EE.js";
140
- import "./chunk-2SERYG4T.js";
141
- import "./chunk-JS73NNWF.js";
142
- import "./chunk-7XKW4CVK.js";
143
- import "./chunk-UVDOONRU.js";
144
- import {
145
- SESSION_SOURCE_META_KEY,
146
- parseSessionSource
147
- } from "./chunk-7JJUFI36.js";
149
+ } from "./chunk-XRSOI3DL.js";
150
+ import "./chunk-YTDVNSUQ.js";
151
+ import "./chunk-RJC5EIKY.js";
152
+ import "./chunk-6CGL7E7G.js";
153
+ import "./chunk-ZGXYO7DY.js";
148
154
  import "./chunk-7U5G6JXI.js";
149
155
  import "./chunk-WCCLLK7X.js";
150
- import "./chunk-OCPBI7J5.js";
151
156
  import {
152
157
  REASONING_EFFORT_DEFAULT,
153
158
  REASONING_EFFORT_NAMES,
@@ -164,26 +169,26 @@ import {
164
169
  parseAcpModelOption,
165
170
  resolveAcpModelOption,
166
171
  sanitizeProviderBaseUrl
167
- } from "./chunk-HOANA6GC.js";
172
+ } from "./chunk-Q26AYA62.js";
168
173
  import {
169
174
  mapSkillConfigToStatus
170
175
  } from "./chunk-BGXZBI5B.js";
171
176
  import {
172
177
  resolveSkillSettings
173
178
  } from "./chunk-Z4X5MTRT.js";
174
- import "./chunk-OAAPGZVH.js";
175
- import "./chunk-3UXJFOB3.js";
179
+ import "./chunk-FBSSIAAQ.js";
180
+ import "./chunk-PFCQ62V4.js";
176
181
  import "./chunk-57OAHC2Y.js";
177
- import "./chunk-EAV3TENS.js";
182
+ import "./chunk-HVQ3B7FF.js";
178
183
  import "./chunk-7JPW6IYH.js";
179
- import "./chunk-IKN3IUJP.js";
184
+ import "./chunk-5XBFCMWD.js";
180
185
  import "./chunk-V6WHFGST.js";
181
186
  import {
182
187
  createLoadedSettingsAdapter
183
- } from "./chunk-5AFPOEY3.js";
188
+ } from "./chunk-CPGJJJLU.js";
184
189
  import {
185
190
  ndJsonStream
186
- } from "./chunk-GZJUCMH4.js";
191
+ } from "./chunk-H72BQNM3.js";
187
192
  import {
188
193
  ACP_PREFLIGHT_KINDS,
189
194
  IDLE_HOOK_EVENTS,
@@ -191,7 +196,7 @@ import {
191
196
  SERVE_STATUS_EXT_METHODS,
192
197
  STATUS_SCHEMA_VERSION,
193
198
  mapDomainErrorToErrorKind
194
- } from "./chunk-CITGRGCM.js";
199
+ } from "./chunk-JHS74YAB.js";
195
200
  import "./chunk-MZS7GEC7.js";
196
201
  import {
197
202
  ACTIVE_WORK_CLOSE_IF_UNHELD_PARAM,
@@ -232,15 +237,15 @@ import {
232
237
  import {
233
238
  NOT_CURRENTLY_GENERATING_CANCEL_MESSAGE,
234
239
  isNotCurrentlyGeneratingCancelError
235
- } from "./chunk-624NHDGB.js";
240
+ } from "./chunk-ERFDKH32.js";
236
241
  import "./chunk-6PLDPT2C.js";
237
242
  import "./chunk-FYJ7W2PI.js";
238
- import "./chunk-7CWEZQ6T.js";
243
+ import "./chunk-STUJ7IMZ.js";
239
244
  import "./chunk-JVPFTDBK.js";
240
- import "./chunk-GYTKQYDB.js";
241
245
  import "./chunk-ALMR3E6Q.js";
246
+ import "./chunk-GYTKQYDB.js";
247
+ import "./chunk-RKFGE7JH.js";
242
248
  import "./chunk-UDG5EZJI.js";
243
- import "./chunk-M5GB774H.js";
244
249
  import {
245
250
  EXTERNAL_TOOL_GUARD_READY_META_KEY,
246
251
  EXTERNAL_TOOL_GUARD_REQUIRED_VALUE,
@@ -250,7 +255,8 @@ import {
250
255
  SHELL_EXECUTING_TOOL_NAMES,
251
256
  isValidExternalToolGuardDenialReason
252
257
  } from "./chunk-3VUENPWF.js";
253
- import "./chunk-ELY4QVIB.js";
258
+ import "./chunk-M5GB774H.js";
259
+ import "./chunk-7EQQR46F.js";
254
260
  import {
255
261
  ACP_EVENT_LOOP_STALL_RESTART_MS,
256
262
  CHANNEL_PROMPT_META_KEY
@@ -263,7 +269,7 @@ import {
263
269
  import {
264
270
  assembleMcpServers,
265
271
  loadMcpApprovals
266
- } from "./chunk-I6HWGOWD.js";
272
+ } from "./chunk-5O72BNDD.js";
267
273
  import {
268
274
  getOutputLanguageFilePath,
269
275
  getPersistScopeForModelSelection,
@@ -272,9 +278,9 @@ import {
272
278
  resolveOutputLanguageOrPreserveAuto,
273
279
  updateOutputLanguageFile,
274
280
  writeOutputLanguageAndRegisterPath
275
- } from "./chunk-C2BAEV64.js";
281
+ } from "./chunk-F7TNAPZ4.js";
276
282
  import "./chunk-RKUWKYED.js";
277
- import "./chunk-GXWY24QS.js";
283
+ import "./chunk-JSC3H3TD.js";
278
284
  import "./chunk-GOXKNSDZ.js";
279
285
  import {
280
286
  getSystemDefaultsPath,
@@ -283,7 +289,7 @@ import {
283
289
  import {
284
290
  getCurrentLanguage,
285
291
  setLanguageAsync
286
- } from "./chunk-W2WRNJKX.js";
292
+ } from "./chunk-LDP5OD6N.js";
287
293
  import {
288
294
  SUPPORTED_LANGUAGES
289
295
  } from "./chunk-5EJZE3FP.js";
@@ -291,19 +297,19 @@ import {
291
297
  findEnvFiles,
292
298
  preResolveHomeEnvOverrides,
293
299
  reloadEnvironment
294
- } from "./chunk-IN66KO3N.js";
300
+ } from "./chunk-IK5BW3CS.js";
295
301
  import {
296
302
  ENV_ACP_REPEATED_TOOL_FAILURE_GUARD,
297
303
  QWEN_CODE_SERVE_ENV
298
304
  } from "./chunk-5PA6UEYA.js";
299
- import "./chunk-7DPKPBOQ.js";
300
- import "./chunk-H4JK2A2V.js";
305
+ import "./chunk-V2NDP3I4.js";
306
+ import "./chunk-7UYV53BC.js";
301
307
  import "./chunk-W3N5XAZ6.js";
302
308
  import {
303
309
  isFolderTrustEnabled,
304
310
  isWorkspaceTrusted,
305
311
  loadTrustedFolders
306
- } from "./chunk-RQ5ASDFQ.js";
312
+ } from "./chunk-V4QXXQJ2.js";
307
313
  import "./chunk-NPQ5ZKRP.js";
308
314
  import "./chunk-MR3PXB6E.js";
309
315
  import {
@@ -333,30 +339,30 @@ import {
333
339
  resolveBaseUrl,
334
340
  runManagedRememberByAgent,
335
341
  subagentGenerator
336
- } from "./chunk-RUQBJS34.js";
337
- import "./chunk-LRLMDV5X.js";
342
+ } from "./chunk-KUX5D6DK.js";
343
+ import "./chunk-3DXFGHAJ.js";
338
344
  import "./chunk-XFSFZCM5.js";
339
345
  import "./chunk-2EAZ43JQ.js";
340
346
  import "./chunk-NF5J2WFA.js";
341
347
  import {
342
348
  CreateSubSessionTool
343
- } from "./chunk-LRKMQPMD.js";
349
+ } from "./chunk-CQH5KTKC.js";
344
350
  import "./chunk-LJZSMWOH.js";
345
- import "./chunk-H2MDBYLL.js";
346
- import "./chunk-JLGFGPZJ.js";
347
- import "./chunk-SKNVVYIJ.js";
351
+ import "./chunk-6LFTG244.js";
352
+ import "./chunk-PKAYJDB3.js";
353
+ import "./chunk-6IUNAPLR.js";
348
354
  import {
349
355
  restoreWorktreeContext
350
- } from "./chunk-UCSV2IZW.js";
351
- import "./chunk-T2HMXHYA.js";
352
- import "./chunk-3FSBMAYD.js";
353
- import "./chunk-XJS54K4A.js";
356
+ } from "./chunk-OIVXBW3W.js";
357
+ import "./chunk-4CDSK5AZ.js";
358
+ import "./chunk-XQFT3QUF.js";
359
+ import "./chunk-VTHREBQM.js";
354
360
  import "./chunk-ZPJWUGCS.js";
355
361
  import {
356
362
  clearCachedCredentialFile,
357
363
  qwenOAuth2Events
358
- } from "./chunk-ZWKGZB2K.js";
359
- import "./chunk-OX44MOAN.js";
364
+ } from "./chunk-H2WDGQ6D.js";
365
+ import "./chunk-MIIVI25Q.js";
360
366
  import {
361
367
  APPROVAL_MODE_INFO,
362
368
  BranchPointInvalidError,
@@ -473,43 +479,43 @@ import {
473
479
  updateSetting,
474
480
  validatePlanModeShellApproval,
475
481
  validatePlanModeShellContext
476
- } from "./chunk-D6XO27Z5.js";
482
+ } from "./chunk-TGWAQ5RB.js";
477
483
  import "./chunk-GOFAQQZA.js";
478
484
  import "./chunk-5M6IDOMF.js";
479
485
  import "./chunk-TWPJO254.js";
480
486
  import {
481
487
  external_exports
482
488
  } from "./chunk-CQ35AJ4Z.js";
483
- import "./chunk-3UZCLCXR.js";
484
- import "./chunk-TOF4UZHH.js";
485
- import "./chunk-O3BUXIPM.js";
486
- import "./chunk-ZLTEQYNC.js";
489
+ import "./chunk-EKSCLBBF.js";
490
+ import "./chunk-P2SU6ZTI.js";
491
+ import "./chunk-IZIVM7LZ.js";
492
+ import "./chunk-SFPGAQUL.js";
487
493
  import {
488
494
  parsePositiveIntegerEnv
489
495
  } from "./chunk-6PVPNMXU.js";
490
496
  import {
491
497
  RUNTIME_SNAPSHOT_PREFIX
492
- } from "./chunk-AYVIGUUK.js";
498
+ } from "./chunk-JB4JIVTJ.js";
493
499
  import "./chunk-IRH27ZC2.js";
494
500
  import "./chunk-QHWCP53L.js";
495
- import "./chunk-JECO75XD.js";
501
+ import "./chunk-D5LUXLUH.js";
496
502
  import {
497
503
  promptIdContext,
498
504
  todoWorkChainContext
499
505
  } from "./chunk-O6GEWCJA.js";
500
506
  import "./chunk-T26EAKDL.js";
501
- import "./chunk-LJP2BBMK.js";
507
+ import "./chunk-EOGELB3H.js";
502
508
  import "./chunk-CPBF7KYF.js";
503
- import "./chunk-5Y2JCJAH.js";
509
+ import "./chunk-EFUM7RVY.js";
504
510
  import {
505
511
  HookEventName,
506
512
  createHookOutput
507
- } from "./chunk-T2CRBIDJ.js";
508
- import "./chunk-77TOMRBG.js";
509
- import "./chunk-DEYPMJPD.js";
510
- import "./chunk-T6OODF2U.js";
511
- import "./chunk-27ONXAFY.js";
512
- import "./chunk-ZEADBZLO.js";
513
+ } from "./chunk-TTX2JUE6.js";
514
+ import "./chunk-43GGFFLY.js";
515
+ import "./chunk-SMPR7SPO.js";
516
+ import "./chunk-JWALNCLT.js";
517
+ import "./chunk-NIFYWDYN.js";
518
+ import "./chunk-3AFMQUTI.js";
513
519
  import {
514
520
  GoalConflictError,
515
521
  GoalInvalidTransitionError,
@@ -520,14 +526,14 @@ import {
520
526
  parseGoalSnapshotV2,
521
527
  parseGoalStateCause,
522
528
  wrapUserPromptSubmitContext
523
- } from "./chunk-FN5C6C7G.js";
529
+ } from "./chunk-WKK5BQNP.js";
524
530
  import {
525
531
  APPROVAL_MODES
526
- } from "./chunk-BVE5EMIG.js";
532
+ } from "./chunk-V5J4J5TP.js";
527
533
  import "./chunk-MLXTMF7H.js";
528
534
  import "./chunk-NAVJD2PQ.js";
529
- import "./chunk-FVDQ5E67.js";
530
- import "./chunk-V3GINY6K.js";
535
+ import "./chunk-3JGZSIDA.js";
536
+ import "./chunk-VVW4ZNFY.js";
531
537
  import "./chunk-QHMLYMMS.js";
532
538
  import {
533
539
  AgentOutputMessageCapture,
@@ -536,32 +542,32 @@ import {
536
542
  addToolCallResultAttributes,
537
543
  registerAcpEventLoopLagGauge,
538
544
  startEventLoopLagMonitor
539
- } from "./chunk-SDVF6A42.js";
545
+ } from "./chunk-7DJCPZE3.js";
540
546
  import "./chunk-P3QQPMQA.js";
541
547
  import {
542
548
  addDaemonRequestAttribute,
543
549
  extractDaemonTraceContext,
544
550
  withDaemonSpan
545
- } from "./chunk-ILPXSKGQ.js";
551
+ } from "./chunk-HVEYF6VT.js";
546
552
  import "./chunk-VNOVK4I7.js";
547
553
  import "./chunk-SAH4BD2J.js";
548
- import "./chunk-ZKAZP2ZG.js";
554
+ import "./chunk-PDMJ3KGS.js";
549
555
  import {
550
556
  runWithRuntimeContentGenerator
551
- } from "./chunk-DP7LABIB.js";
557
+ } from "./chunk-CMHFCLBU.js";
552
558
  import "./chunk-S6LOFUVP.js";
553
559
  import {
554
560
  REASONING_EFFORT_TIERS,
555
561
  applyReasoningEffort
556
562
  } from "./chunk-2LD5U7Q3.js";
557
563
  import "./chunk-DJ2GSRLV.js";
558
- import "./chunk-I6VVOZDK.js";
564
+ import "./chunk-J2OSJFP3.js";
559
565
  import "./chunk-K2OJUPOE.js";
560
566
  import {
561
567
  getToolCallPreparations
562
568
  } from "./chunk-CFKIH3D3.js";
563
- import "./chunk-EB4VDXNI.js";
564
- import "./chunk-FJWICLG7.js";
569
+ import "./chunk-4FTKQNWJ.js";
570
+ import "./chunk-Y3QL45LS.js";
565
571
  import {
566
572
  ConversationFinishedEvent,
567
573
  DiscoveredMCPTool,
@@ -592,35 +598,35 @@ import {
592
598
  shouldRunVisionBridge,
593
599
  splitImageParts,
594
600
  uiTelemetryService
595
- } from "./chunk-UX3IFLJM.js";
601
+ } from "./chunk-L2M46FP5.js";
596
602
  import "./chunk-YRLW2MSX.js";
597
603
  import "./chunk-VGC4I5JJ.js";
598
604
  import {
599
605
  getAllGeminiMdFilenames,
600
606
  getSpecificMimeType
601
- } from "./chunk-WBT3STGU.js";
607
+ } from "./chunk-3I6UTTDX.js";
602
608
  import {
603
609
  getAutoMemoryRoot,
604
610
  getUserAutoMemoryRoot
605
- } from "./chunk-PVBT5QPD.js";
611
+ } from "./chunk-6PJOTWAN.js";
606
612
  import {
607
613
  runSideQuery
608
- } from "./chunk-IPQA4SR5.js";
614
+ } from "./chunk-BWORX6FA.js";
609
615
  import "./chunk-WZAD4ZNJ.js";
610
616
  import {
611
617
  DEFAULT_TOKEN_LIMIT,
612
618
  tokenLimit
613
619
  } from "./chunk-FPGTNKCP.js";
614
- import "./chunk-SLEWBQWM.js";
620
+ import "./chunk-6DIGWMGT.js";
615
621
  import {
616
622
  hasVertexProjectConfigured,
617
623
  preloadContentGenerator
618
- } from "./chunk-4X5GYZFO.js";
624
+ } from "./chunk-Z7FLBQPR.js";
619
625
  import "./chunk-XZA32HII.js";
620
- import "./chunk-7QGEJI7M.js";
626
+ import "./chunk-23RFD54N.js";
621
627
  import {
622
628
  AuthType
623
- } from "./chunk-GTUKW3I6.js";
629
+ } from "./chunk-PPKZ7JOE.js";
624
630
  import "./chunk-HHJLM3WQ.js";
625
631
  import {
626
632
  endToolExecutionSpan,
@@ -632,17 +638,17 @@ import {
632
638
  startToolExecutionSpan,
633
639
  startToolSpan,
634
640
  withInteractionSpan
635
- } from "./chunk-6US7BF3G.js";
641
+ } from "./chunk-L6BZRIUL.js";
636
642
  import "./chunk-74TONY4F.js";
637
- import "./chunk-VL4YX3FH.js";
643
+ import "./chunk-XF63PKEN.js";
638
644
  import {
639
645
  FORK_SUBAGENT_TYPE,
640
646
  getStartupContextLength,
641
647
  isSystemReminderContent
642
- } from "./chunk-JUIJ3FXC.js";
643
- import "./chunk-E6FGMDFQ.js";
648
+ } from "./chunk-CAJTKR6W.js";
649
+ import "./chunk-ZU4UDIWX.js";
644
650
  import "./chunk-AQ37AY7B.js";
645
- import "./chunk-RRKNX553.js";
651
+ import "./chunk-PDQGMSZK.js";
646
652
  import {
647
653
  BaseDeclarativeTool,
648
654
  BaseToolInvocation,
@@ -650,7 +656,7 @@ import {
650
656
  ToolNames,
651
657
  canonicalToolName,
652
658
  isShellProgressData
653
- } from "./chunk-KOJ6MHD5.js";
659
+ } from "./chunk-UTLCH2FK.js";
654
660
  import {
655
661
  Storage,
656
662
  createDebugLogger,
@@ -658,11 +664,11 @@ import {
658
664
  getErrorStatus,
659
665
  isSubpath,
660
666
  sessionIdContext
661
- } from "./chunk-2NNTE2ED.js";
662
- import "./chunk-YT5XN3HV.js";
667
+ } from "./chunk-UHQFIS7N.js";
668
+ import "./chunk-W5MJJ2V7.js";
663
669
  import {
664
670
  runExitCleanup
665
- } from "./chunk-RCDXSEJ5.js";
671
+ } from "./chunk-Y6LSMB6J.js";
666
672
  import {
667
673
  writeStderrLine,
668
674
  writeStderrLineSafe
@@ -1952,6 +1958,19 @@ var basicPermissionOptions = [
1952
1958
  kind: "reject_once"
1953
1959
  }
1954
1960
  ];
1961
+ function filterPermissionPersistenceOptions(options, policy) {
1962
+ if (!policy) return options;
1963
+ return options.filter((option) => {
1964
+ if (option.optionId === "proceed_always_project" /* ProceedAlwaysProject */ && !policy.allowProjectPersistence) {
1965
+ return false;
1966
+ }
1967
+ if (option.optionId === "proceed_always_user" /* ProceedAlwaysUser */ && !policy.allowUserPersistence) {
1968
+ return false;
1969
+ }
1970
+ return true;
1971
+ });
1972
+ }
1973
+ __name(filterPermissionPersistenceOptions, "filterPermissionPersistenceOptions");
1955
1974
  function supportsHideAlwaysAllow(confirmation) {
1956
1975
  return confirmation.type !== "ask_user_question";
1957
1976
  }
@@ -2087,7 +2106,7 @@ function resolvePermissionOutcome(response, offeredOptions) {
2087
2106
  return optionId;
2088
2107
  }
2089
2108
  __name(resolvePermissionOutcome, "resolvePermissionOutcome");
2090
- function toPermissionOptions(confirmation, forceHideAlwaysAllow = false) {
2109
+ function toPermissionOptions(confirmation, forceHideAlwaysAllow = false, persistencePolicy) {
2091
2110
  switch (confirmation.type) {
2092
2111
  case "edit":
2093
2112
  return filterAlwaysAllowOptions(
@@ -2106,56 +2125,65 @@ function toPermissionOptions(confirmation, forceHideAlwaysAllow = false) {
2106
2125
  const label = formatExecPermissionScopeLabel(confirmation);
2107
2126
  return filterAlwaysAllowOptions(
2108
2127
  confirmation,
2109
- [
2110
- {
2111
- optionId: "proceed_always_project" /* ProceedAlwaysProject */,
2112
- name: `Always Allow in project: ${label}`,
2113
- kind: "allow_always"
2114
- },
2115
- {
2116
- optionId: "proceed_always_user" /* ProceedAlwaysUser */,
2117
- name: `Always Allow for user: ${label}`,
2118
- kind: "allow_always"
2119
- },
2120
- ...basicPermissionOptions
2121
- ],
2128
+ filterPermissionPersistenceOptions(
2129
+ [
2130
+ {
2131
+ optionId: "proceed_always_project" /* ProceedAlwaysProject */,
2132
+ name: `Always Allow in project: ${label}`,
2133
+ kind: "allow_always"
2134
+ },
2135
+ {
2136
+ optionId: "proceed_always_user" /* ProceedAlwaysUser */,
2137
+ name: `Always Allow for user: ${label}`,
2138
+ kind: "allow_always"
2139
+ },
2140
+ ...basicPermissionOptions
2141
+ ],
2142
+ persistencePolicy
2143
+ ),
2122
2144
  forceHideAlwaysAllow
2123
2145
  );
2124
2146
  }
2125
2147
  case "mcp":
2126
2148
  return filterAlwaysAllowOptions(
2127
2149
  confirmation,
2128
- [
2129
- {
2130
- optionId: "proceed_always_project" /* ProceedAlwaysProject */,
2131
- name: `Always Allow in project: ${confirmation.toolName}`,
2132
- kind: "allow_always"
2133
- },
2134
- {
2135
- optionId: "proceed_always_user" /* ProceedAlwaysUser */,
2136
- name: `Always Allow for user: ${confirmation.toolName}`,
2137
- kind: "allow_always"
2138
- },
2139
- ...basicPermissionOptions
2140
- ],
2150
+ filterPermissionPersistenceOptions(
2151
+ [
2152
+ {
2153
+ optionId: "proceed_always_project" /* ProceedAlwaysProject */,
2154
+ name: `Always Allow in project: ${confirmation.toolName}`,
2155
+ kind: "allow_always"
2156
+ },
2157
+ {
2158
+ optionId: "proceed_always_user" /* ProceedAlwaysUser */,
2159
+ name: `Always Allow for user: ${confirmation.toolName}`,
2160
+ kind: "allow_always"
2161
+ },
2162
+ ...basicPermissionOptions
2163
+ ],
2164
+ persistencePolicy
2165
+ ),
2141
2166
  forceHideAlwaysAllow
2142
2167
  );
2143
2168
  case "info":
2144
2169
  return filterAlwaysAllowOptions(
2145
2170
  confirmation,
2146
- [
2147
- {
2148
- optionId: "proceed_always_project" /* ProceedAlwaysProject */,
2149
- name: "Always Allow in project",
2150
- kind: "allow_always"
2151
- },
2152
- {
2153
- optionId: "proceed_always_user" /* ProceedAlwaysUser */,
2154
- name: "Always Allow for user",
2155
- kind: "allow_always"
2156
- },
2157
- ...basicPermissionOptions
2158
- ],
2171
+ filterPermissionPersistenceOptions(
2172
+ [
2173
+ {
2174
+ optionId: "proceed_always_project" /* ProceedAlwaysProject */,
2175
+ name: "Always Allow in project",
2176
+ kind: "allow_always"
2177
+ },
2178
+ {
2179
+ optionId: "proceed_always_user" /* ProceedAlwaysUser */,
2180
+ name: "Always Allow for user",
2181
+ kind: "allow_always"
2182
+ },
2183
+ ...basicPermissionOptions
2184
+ ],
2185
+ persistencePolicy
2186
+ ),
2159
2187
  forceHideAlwaysAllow
2160
2188
  );
2161
2189
  case "plan":
@@ -2205,11 +2233,12 @@ __name(toPermissionOptions, "toPermissionOptions");
2205
2233
  // packages/cli/src/acp-integration/session/SubAgentTracker.ts
2206
2234
  var debugLogger3 = createDebugLogger("ACP_SUBAGENT_TRACKER");
2207
2235
  var SubAgentTracker = class {
2208
- constructor(ctx, client, parentToolCallId, subagentType, onPermissionCancel, permissionRequester = (params, signal) => requestPermissionWithAbort(this.client, params, signal)) {
2236
+ constructor(ctx, client, parentToolCallId, subagentType, onPermissionCancel, permissionRequester = (params, signal) => requestPermissionWithAbort(this.client, params, signal), permissionPersistencePolicy) {
2209
2237
  this.ctx = ctx;
2210
2238
  this.client = client;
2211
2239
  this.onPermissionCancel = onPermissionCancel;
2212
2240
  this.permissionRequester = permissionRequester;
2241
+ this.permissionPersistencePolicy = permissionPersistencePolicy;
2213
2242
  this.toolCallEmitter = new ToolCallEmitter(ctx);
2214
2243
  this.messageEmitter = new MessageEmitter(ctx);
2215
2244
  this.subagentMeta = { parentToolCallId, subagentType };
@@ -2325,7 +2354,11 @@ var SubAgentTracker = class {
2325
2354
  }, "onConfirm")
2326
2355
  };
2327
2356
  const { title, locations, kind } = this.toolCallEmitter.resolveToolMetadata(event.name, state?.args);
2328
- const permissionOptions = toPermissionOptions(fullConfirmationDetails);
2357
+ const permissionOptions = toPermissionOptions(
2358
+ fullConfirmationDetails,
2359
+ false,
2360
+ this.permissionPersistencePolicy
2361
+ );
2329
2362
  const offeredPermissionOptions = permissionOptions.map((option) => ({
2330
2363
  ...option
2331
2364
  }));
@@ -3248,6 +3281,18 @@ var LOOP_DETECTED_CONTEXT_MESSAGE = "System: this turn was terminated because th
3248
3281
  var LOOP_DETECTED_TURN_ERROR_MESSAGE = "Tool-call loop protection stopped this turn. The session is still available; send a more specific instruction to continue.";
3249
3282
  var TOOL_EXECUTION_CANCELLED_MESSAGE = "Tool execution was cancelled.";
3250
3283
  var TOOL_POST_EXECUTION_CANCELLED_MESSAGE = "The tool had already completed; its output was discarded.";
3284
+ function sameManagedConversationExpectation(left, right) {
3285
+ return left.canonicalSessionId === right.canonicalSessionId && left.root.canonicalPath === right.root.canonicalPath && left.root.device === right.root.device && left.root.inode === right.root.inode && left.child.name === right.child.name && left.child.canonicalPath === right.child.canonicalPath && left.child.device === right.child.device && left.child.inode === right.child.inode;
3286
+ }
3287
+ __name(sameManagedConversationExpectation, "sameManagedConversationExpectation");
3288
+ function managedConversationBindingError() {
3289
+ return new RequestError(
3290
+ -32004,
3291
+ "The standalone working directory is missing.",
3292
+ { errorKind: "working_directory_missing" }
3293
+ );
3294
+ }
3295
+ __name(managedConversationBindingError, "managedConversationBindingError");
3251
3296
  function createDaemonToolLoopState(repeatedToolFailureMode) {
3252
3297
  return {
3253
3298
  totalToolCalls: 0,
@@ -3814,22 +3859,55 @@ async function registerCreateSubSessionTool(config) {
3814
3859
  return;
3815
3860
  }
3816
3861
  const permissionManager = config.getPermissionManager();
3817
- if (permissionManager && !await permissionManager.isToolEnabled(ToolNames.CREATE_SUB_SESSION)) {
3862
+ const registrationStatus = permissionManager ? await permissionManager.getToolRegistrationStatus(
3863
+ ToolNames.CREATE_SUB_SESSION
3864
+ ) : "registered";
3865
+ if (registrationStatus === "disabled") {
3818
3866
  return;
3819
3867
  }
3820
3868
  const toolRegistry = config.getToolRegistry();
3869
+ if (registrationStatus === "deferred") {
3870
+ toolRegistry.registerPermissionDeferredFactory(
3871
+ ToolNames.CREATE_SUB_SESSION,
3872
+ async () => new CreateSubSessionTool(config)
3873
+ );
3874
+ await config.getGeminiClient().setTools();
3875
+ return;
3876
+ }
3821
3877
  toolRegistry.registerTool(new CreateSubSessionTool(config));
3822
3878
  toolRegistry.revealDeferredTool(ToolNames.CREATE_SUB_SESSION);
3823
3879
  toolRegistry.pinDeferredToolReveal(ToolNames.CREATE_SUB_SESSION);
3824
3880
  await config.getGeminiClient().setTools();
3825
3881
  }
3826
3882
  __name(registerCreateSubSessionTool, "registerCreateSubSessionTool");
3827
- async function buildAvailableCommandsSnapshot(config, abortSignal = AbortSignal.timeout(1e4), settings) {
3883
+ var STANDALONE_SLASH_COMMAND_POLICY = Object.freeze({
3884
+ allowSessionReset: false,
3885
+ allowWorkspaceSettingsWrite: false,
3886
+ persistModelSelection: false,
3887
+ blockedBuiltinCommandNames: Object.freeze([
3888
+ "cd",
3889
+ "clear",
3890
+ "directory",
3891
+ "diff",
3892
+ "dream",
3893
+ "export",
3894
+ "learn",
3895
+ "curator",
3896
+ "workflows"
3897
+ ])
3898
+ });
3899
+ var STANDALONE_PERMISSION_PERSISTENCE_POLICY = Object.freeze({
3900
+ allowProjectPersistence: false,
3901
+ allowUserPersistence: true
3902
+ });
3903
+ var STANDALONE_WORKTREE_ACTION_ERROR = "Standalone sessions cannot change or override their working directory.";
3904
+ async function buildAvailableCommandsSnapshot(config, abortSignal = AbortSignal.timeout(1e4), settings, executionPolicy) {
3828
3905
  const slashCommands = await getAvailableCommands(
3829
3906
  config,
3830
3907
  abortSignal,
3831
3908
  "acp",
3832
- settings
3909
+ settings,
3910
+ executionPolicy
3833
3911
  );
3834
3912
  const disabledSkillNames = config.getDisabledSkillNames();
3835
3913
  const inactiveSkillRefs = inactiveExtensionSkillRefs(config);
@@ -3923,6 +4001,11 @@ var Session = class {
3923
4001
  this.runExclusiveAutomaticHistoryMutation = runExclusiveAutomaticHistoryMutation;
3924
4002
  this.onActiveWorkChanged = onActiveWorkChanged;
3925
4003
  this.sessionId = id;
4004
+ this.requiresManagedConversationBinding = isReservedStandaloneSessionSourceType(
4005
+ this.config.getSessionSourceType?.()
4006
+ );
4007
+ this.requiresManagedConversationActivation = this.requiresManagedConversationBinding && this.config.isProvisionalWorkspace?.() === true;
4008
+ this.slashCommandPolicy = this.requiresManagedConversationBinding ? STANDALONE_SLASH_COMMAND_POLICY : void 0;
3926
4009
  this.runtimeBaseDir = config.storage.getRuntimeBaseDir();
3927
4010
  const todoStopGuardEnabled = this.settings.merged.experimental?.todoStopGuard === true && !this.config.getBareMode() && !this.config.isSafeMode();
3928
4011
  this.todoStopGuard = new DaemonTodoStopGuard(todoStopGuardEnabled);
@@ -3942,6 +4025,7 @@ var Session = class {
3942
4025
  this.#bindGoalRuntime();
3943
4026
  this.#registerBackgroundNotificationCallbacks();
3944
4027
  this.#registerSubSessionSpawner();
4028
+ this.#registerCurrentSessionScheduledTaskCreator();
3945
4029
  this.config.getWorkflowRunRegistry?.().setApprovalRequestCallback(
3946
4030
  (entry, approval, rawArgs, signal) => this.#requestWorkflowApproval(entry.runId, approval, rawArgs, signal)
3947
4031
  );
@@ -4066,6 +4150,11 @@ var Session = class {
4066
4150
  liveSpeakToUserTool;
4067
4151
  liveConversationActive;
4068
4152
  liveEndInstructionPending = false;
4153
+ requiresManagedConversationBinding;
4154
+ requiresManagedConversationActivation;
4155
+ slashCommandPolicy;
4156
+ managedConversationBinding;
4157
+ managedConversationActivation;
4069
4158
  // Message rewrite middleware (optional, installed after history replay)
4070
4159
  messageRewriter;
4071
4160
  /**
@@ -4122,6 +4211,7 @@ var Session = class {
4122
4211
  controller: new AbortController(),
4123
4212
  origin: "runtime",
4124
4213
  continuationContext: input.continuationContext,
4214
+ ...input.windDown ? { windDown: true } : {},
4125
4215
  ...input.verifierFeedback ? { verifierFeedback: input.verifierFeedback } : {},
4126
4216
  modelStarted: false
4127
4217
  });
@@ -4278,13 +4368,14 @@ var Session = class {
4278
4368
  return publication;
4279
4369
  }
4280
4370
  async #drainGoalQueue() {
4371
+ if (this.#isAutomaticWorkHeld()) return;
4281
4372
  if (this.goalQueue.length === 0) return;
4282
4373
  await this.runExclusiveAutomaticHistoryMutation(
4283
4374
  () => this.#drainGoalQueueExclusive()
4284
4375
  );
4285
4376
  }
4286
4377
  async #drainGoalQueueExclusive() {
4287
- if (this.disposed || this.closing || this.goalProcessing || this.pendingPrompt || this.pendingPromptCompletion || this.cronProcessing || this.cronAbortController || this.notificationProcessing || this.notificationAbortController) {
4378
+ if (this.disposed || this.closing || this.goalProcessing || this.pendingPrompt || this.pendingPromptCompletion || this.cronProcessing || this.cronAbortController || this.notificationProcessing || this.notificationAbortController || this.#isAutomaticWorkHeld()) {
4288
4379
  return;
4289
4380
  }
4290
4381
  const turn = this.goalQueue.shift();
@@ -4826,6 +4917,48 @@ var Session = class {
4826
4917
  };
4827
4918
  });
4828
4919
  }
4920
+ #registerCurrentSessionScheduledTaskCreator() {
4921
+ if (process.env[QWEN_CODE_SERVE_ENV] !== "1") {
4922
+ return;
4923
+ }
4924
+ this.config.setCurrentSessionScheduledTaskCreator(async (req) => {
4925
+ let resp;
4926
+ try {
4927
+ resp = await this.client.extMethod(
4928
+ SERVE_CONTROL_EXT_METHODS.createCurrentSessionScheduledTask,
4929
+ {
4930
+ callerSessionId: this.sessionId,
4931
+ promptId: getInvocationContext()?.promptId ?? req.promptId,
4932
+ cron: req.cron,
4933
+ prompt: req.prompt,
4934
+ recurring: req.recurring
4935
+ }
4936
+ );
4937
+ } catch (error) {
4938
+ const code = error && typeof error === "object" && "code" in error ? error.code : void 0;
4939
+ if (code === -32601) {
4940
+ throw new Error(
4941
+ "current_session_scheduling_unavailable: The daemon does not support current-session scheduling."
4942
+ );
4943
+ }
4944
+ const data = isRecord2(error) && isRecord2(error["data"]) ? error["data"] : void 0;
4945
+ const errorKind = data?.["errorKind"];
4946
+ if (typeof errorKind === "string") {
4947
+ const hint = data?.["hint"];
4948
+ throw new Error(
4949
+ `${errorKind}: ${typeof hint === "string" && hint.length > 0 ? hint : "Current-session scheduled task creation was rejected."}`
4950
+ );
4951
+ }
4952
+ throw error;
4953
+ }
4954
+ if (typeof resp["id"] !== "string" || resp["id"].length === 0 || typeof resp["cron"] !== "string" || resp["cron"].length === 0) {
4955
+ throw new Error(
4956
+ "cron_create: bridge returned an invalid scheduled-task result"
4957
+ );
4958
+ }
4959
+ return { id: resp["id"], cron: resp["cron"] };
4960
+ });
4961
+ }
4829
4962
  async enableLiveScreenContext() {
4830
4963
  const registry = this.config.getToolRegistry();
4831
4964
  const existing = registry.getTool(CAPTURE_SCREEN_CONTEXT_TOOL_NAME);
@@ -4984,6 +5117,7 @@ var Session = class {
4984
5117
  * mount.
4985
5118
  */
4986
5119
  startCronScheduler() {
5120
+ if (this.#isAutomaticWorkHeld()) return;
4987
5121
  this.#startCronSchedulerInRuntime().catch((error) => {
4988
5122
  debugLogger6.warn(
4989
5123
  `Cron scheduler startup failed [session ${this.sessionId}]: ${error}`
@@ -4993,6 +5127,113 @@ var Session = class {
4993
5127
  getConfig() {
4994
5128
  return this.config;
4995
5129
  }
5130
+ installPendingManagedConversationBinding(expectation, assertIdentity) {
5131
+ if (!this.requiresManagedConversationBinding || expectation.canonicalSessionId !== this.sessionId) {
5132
+ throw managedConversationBindingError();
5133
+ }
5134
+ if (this.managedConversationBinding && this.managedConversationBinding.state !== "released" && !sameManagedConversationExpectation(
5135
+ this.managedConversationBinding.expectation,
5136
+ expectation
5137
+ )) {
5138
+ throw managedConversationBindingError();
5139
+ }
5140
+ this.managedConversationBinding = {
5141
+ expectation,
5142
+ assertIdentity,
5143
+ state: "pending"
5144
+ };
5145
+ }
5146
+ installManagedConversationActivation(run, onRelease) {
5147
+ if (!this.requiresManagedConversationActivation || this.managedConversationActivation) {
5148
+ throw managedConversationBindingError();
5149
+ }
5150
+ this.managedConversationActivation = {
5151
+ run,
5152
+ ...onRelease ? { onRelease } : {},
5153
+ releaseScheduled: false,
5154
+ state: "pending"
5155
+ };
5156
+ }
5157
+ async activateManagedConversation() {
5158
+ if (!this.requiresManagedConversationActivation) return;
5159
+ const activation = this.managedConversationActivation;
5160
+ if (!activation) throw managedConversationBindingError();
5161
+ if (activation.state === "ready") return;
5162
+ if (activation.state === "poisoned") throw activation.error;
5163
+ if (activation.promise) return activation.promise;
5164
+ activation.state = "activating";
5165
+ const promise = activation.run().then(() => {
5166
+ activation.state = "ready";
5167
+ }).catch((error) => {
5168
+ activation.state = "poisoned";
5169
+ activation.error = error;
5170
+ throw error;
5171
+ });
5172
+ activation.promise = promise;
5173
+ return promise;
5174
+ }
5175
+ async commitManagedConversationBinding(expectation) {
5176
+ const binding = this.managedConversationBinding;
5177
+ if (!this.requiresManagedConversationBinding || !binding || !sameManagedConversationExpectation(binding.expectation, expectation)) {
5178
+ throw managedConversationBindingError();
5179
+ }
5180
+ if (binding.state === "committed" || binding.state === "released") return;
5181
+ if (!isSameConversationPath(
5182
+ this.config.getTargetDir(),
5183
+ binding.expectation.child.canonicalPath
5184
+ )) {
5185
+ throw managedConversationBindingError();
5186
+ }
5187
+ await binding.assertIdentity();
5188
+ await this.activateManagedConversation();
5189
+ await binding.assertIdentity();
5190
+ binding.state = "committed";
5191
+ }
5192
+ async releaseManagedConversationBinding(expectation) {
5193
+ const binding = this.managedConversationBinding;
5194
+ if (!this.requiresManagedConversationBinding || !binding || binding.state === "pending" || !sameManagedConversationExpectation(binding.expectation, expectation)) {
5195
+ throw managedConversationBindingError();
5196
+ }
5197
+ if (binding.state === "released") return;
5198
+ if (!isSameConversationPath(
5199
+ this.config.getTargetDir(),
5200
+ binding.expectation.child.canonicalPath
5201
+ )) {
5202
+ throw managedConversationBindingError();
5203
+ }
5204
+ await binding.assertIdentity();
5205
+ binding.state = "released";
5206
+ const activation = this.managedConversationActivation;
5207
+ if (activation && !activation.releaseScheduled) {
5208
+ activation.releaseScheduled = true;
5209
+ try {
5210
+ activation.onRelease?.();
5211
+ } catch (error) {
5212
+ debugLogger6.warn(
5213
+ `Managed conversation release callback failed [session ${this.sessionId}]: ${error}`
5214
+ );
5215
+ }
5216
+ }
5217
+ this.startCronScheduler();
5218
+ void this.sendAvailableCommandsUpdate();
5219
+ void this.#drainGoalQueue();
5220
+ void this.#drainCronQueue();
5221
+ void this.#drainNotificationQueue();
5222
+ }
5223
+ async assertManagedConversationBindingReady() {
5224
+ if (!this.requiresManagedConversationBinding) return;
5225
+ const binding = this.managedConversationBinding;
5226
+ if (binding?.state !== "released" || !isSameConversationPath(
5227
+ this.config.getTargetDir(),
5228
+ binding.expectation.child.canonicalPath
5229
+ )) {
5230
+ throw managedConversationBindingError();
5231
+ }
5232
+ await binding.assertIdentity();
5233
+ }
5234
+ #isAutomaticWorkHeld() {
5235
+ return this.requiresManagedConversationBinding && this.managedConversationBinding?.state !== "released";
5236
+ }
4996
5237
  shouldHintAskUserQuestionRestore() {
4997
5238
  if (this.config.getRestoreAskUserQuestion?.() !== true) return false;
4998
5239
  if (this.pendingPrompt && !this.pendingPrompt.signal.aborted) return false;
@@ -5010,6 +5251,9 @@ var Session = class {
5010
5251
  "Session history mutation is in progress"
5011
5252
  );
5012
5253
  }
5254
+ if (this.requiresManagedConversationBinding) {
5255
+ await this.assertManagedConversationBindingReady();
5256
+ }
5013
5257
  try {
5014
5258
  await this.config.assertCanStartTurn();
5015
5259
  } catch (error) {
@@ -5020,6 +5264,9 @@ var Session = class {
5020
5264
  }
5021
5265
  throw error;
5022
5266
  }
5267
+ if (this.requiresManagedConversationBinding) {
5268
+ await this.assertManagedConversationBindingReady();
5269
+ }
5023
5270
  if (this.closing) {
5024
5271
  throw RequestError.invalidParams(void 0, "Session is closing");
5025
5272
  }
@@ -5081,6 +5328,9 @@ var Session = class {
5081
5328
  }
5082
5329
  return holds;
5083
5330
  }
5331
+ hasStandaloneRelocationBlockers() {
5332
+ return this.collectActiveWorkHolds().length > 0 || this.config.getMonitorRegistry().getAll().some((monitor) => monitor.status === "running");
5333
+ }
5084
5334
  #activeWorkChanged() {
5085
5335
  this.onActiveWorkChanged?.();
5086
5336
  }
@@ -5236,6 +5486,7 @@ var Session = class {
5236
5486
  this.unsubscribeChatRecordingFailure?.();
5237
5487
  this.unsubscribeChatRecordingFailure = void 0;
5238
5488
  this.config.setSubSessionSpawner(void 0);
5489
+ this.config.setCurrentSessionScheduledTaskCreator(void 0);
5239
5490
  this.config.getWorkflowRunRegistry?.().setApprovalRequestCallback(void 0);
5240
5491
  this.workflowApprovalAbortController.abort(SESSION_DISPOSE_ABORT_REASON);
5241
5492
  }
@@ -5926,6 +6177,7 @@ var Session = class {
5926
6177
  return goalTurn ? goalTurnContext.run(goalTurn.permit, execute) : goalTurnContext.exit(execute);
5927
6178
  }
5928
6179
  async #executePromptInner(params, pendingSend, responseCapture, modelPrompt, rejectOnLoopDetected = false, goalTurn, channelTurn = false) {
6180
+ let managedMemoryRecallStarted = false;
5929
6181
  return Storage.runWithRuntimeBaseDir(
5930
6182
  this.runtimeBaseDir,
5931
6183
  this.config.getWorkingDir(),
@@ -6071,7 +6323,8 @@ var Session = class {
6071
6323
  // long-lived Session; without this the goal-state
6072
6324
  // subscription stays on the disposed instance.
6073
6325
  startNewSession: /* @__PURE__ */ __name(() => this.rebindGoalRuntimeForNewSession(), "startNewSession")
6074
- }
6326
+ },
6327
+ this.slashCommandPolicy
6075
6328
  );
6076
6329
  if (slashCommandName === "advisor" && pendingSend.signal.aborted && slashCommandResult.type === "message") {
6077
6330
  this.todoStopGuard.suspend();
@@ -6137,6 +6390,7 @@ var Session = class {
6137
6390
  const hooksEnabled = !this.config.getDisableAllHooks?.();
6138
6391
  const messageBus = this.config.getMessageBus?.();
6139
6392
  const isRuntimeContinuation = goalTurn?.origin === "runtime";
6393
+ const isFreshUserTurn = !isRetry && !isContinue && !isRestoreAskUserQuestion && !isRuntimeContinuation;
6140
6394
  if (!isContinue && !isRestoreAskUserQuestion && !isRuntimeContinuation && hooksEnabled && messageBus && this.config.hasHooksForEvent?.("UserPromptSubmit")) {
6141
6395
  const response = await messageBus.request(
6142
6396
  {
@@ -6165,6 +6419,10 @@ var Session = class {
6165
6419
  ];
6166
6420
  }
6167
6421
  }
6422
+ if (isFreshUserTurn) {
6423
+ managedMemoryRecallStarted = true;
6424
+ this.config.getGeminiClient().beginManagedAutoMemoryRecall(promptText, pendingSend.signal);
6425
+ }
6168
6426
  if (!continuesCurrentWorkChain && !this.todoStopGuard.enabled) {
6169
6427
  this.#resetTodoStopGuardBackgroundLineage();
6170
6428
  }
@@ -6190,6 +6448,12 @@ var Session = class {
6190
6448
  }
6191
6449
  }
6192
6450
  const systemReminders = await this.#buildInitialSystemReminders();
6451
+ if (isFreshUserTurn) {
6452
+ const memory = await this.config.getGeminiClient().consumeManagedAutoMemoryRecall("initial");
6453
+ if (memory?.prompt) {
6454
+ systemReminders.unshift({ text: memory.prompt });
6455
+ }
6456
+ }
6193
6457
  if (systemReminders.length > 0 && !isRestoreAskUserQuestion) {
6194
6458
  const alreadyHasReminder = isContinue && parts.some(
6195
6459
  (part) => isSystemReminderContent({ role: "user", parts: [part] })
@@ -6587,7 +6851,32 @@ ${this.pendingRecoveredAgentsNotice}
6587
6851
  getActiveInteractionSpan()
6588
6852
  );
6589
6853
  }
6590
- return result;
6854
+ if (isFreshUserTurn && result.stopReason === "end_turn" && !result.loopProtectionStopped && this.config.getManagedAutoMemoryEnabled()) {
6855
+ const memoryManager = this.config.getMemoryManager();
6856
+ const history = this.#getCurrentChat().getHistoryShallow();
6857
+ void memoryManager.scheduleExtract({
6858
+ projectRoot: this.config.getProjectRoot(),
6859
+ sessionId: this.config.getSessionId(),
6860
+ history,
6861
+ config: this.config
6862
+ }).catch((error) => {
6863
+ debugLogger6.warn(
6864
+ "Failed to schedule ACP managed auto-memory extraction.",
6865
+ error
6866
+ );
6867
+ });
6868
+ void memoryManager.scheduleDream({
6869
+ projectRoot: this.config.getProjectRoot(),
6870
+ sessionId: this.config.getSessionId(),
6871
+ config: this.config
6872
+ }).catch((error) => {
6873
+ debugLogger6.warn(
6874
+ "Failed to schedule ACP managed auto-memory dream.",
6875
+ error
6876
+ );
6877
+ });
6878
+ }
6879
+ return { stopReason: result.stopReason };
6591
6880
  } finally {
6592
6881
  logConversationFinishedEvent(
6593
6882
  this.config,
@@ -6606,7 +6895,11 @@ ${this.pendingRecoveredAgentsNotice}
6606
6895
  (result) => result.stopReason === "cancelled" ? "cancelled" : "ok"
6607
6896
  );
6608
6897
  }
6609
- );
6898
+ ).finally(() => {
6899
+ if (managedMemoryRecallStarted) {
6900
+ this.config.getGeminiClient().finishManagedAutoMemoryRecall();
6901
+ }
6902
+ });
6610
6903
  }
6611
6904
  async #handleStopHookLoop(pendingSend, promptId, hooksEnabled, messageBus, allowExternalHooks = true, modelOverride, responseCapture, rejectOnLoopDetected = false) {
6612
6905
  const stopHookBlockingCap = this.config.getStopHookBlockingCap();
@@ -6673,7 +6966,7 @@ ${this.pendingRecoveredAgentsNotice}
6673
6966
  }
6674
6967
  );
6675
6968
  if (continuation2.kind === "terminal") {
6676
- return { stopReason: continuation2.stopReason };
6969
+ return continuation2;
6677
6970
  }
6678
6971
  continue;
6679
6972
  }
@@ -6758,7 +7051,7 @@ ${this.pendingRecoveredAgentsNotice}
6758
7051
  }
6759
7052
  );
6760
7053
  if (continuation2.kind === "terminal") {
6761
- return { stopReason: continuation2.stopReason };
7054
+ return continuation2;
6762
7055
  }
6763
7056
  continue;
6764
7057
  }
@@ -6862,7 +7155,7 @@ ${this.pendingRecoveredAgentsNotice}
6862
7155
  stopHookReasons = stopHookReasons.slice(0, -1);
6863
7156
  }
6864
7157
  if (continuation.kind === "terminal") {
6865
- return { stopReason: continuation.stopReason };
7158
+ return continuation;
6866
7159
  }
6867
7160
  }
6868
7161
  }
@@ -7317,6 +7610,7 @@ ${this.pendingRecoveredAgentsNotice}
7317
7610
  // and background-notification turns keep the graceful end-turn
7318
7611
  // handling they had before loop stops became rejections.
7319
7612
  stopReason: options.rejectOnLoopDetected ? cancelledOrThrowLoopDetected(pendingSend.signal, toolLoopState) : getAbortAwareEndTurnStopReason(pendingSend.signal),
7613
+ loopProtectionStopped: true,
7320
7614
  ...supersededAutomaticContinuation ? { supersededAutomaticContinuation: true } : {}
7321
7615
  };
7322
7616
  }
@@ -7329,6 +7623,14 @@ ${this.pendingRecoveredAgentsNotice}
7329
7623
  options.rejectOnLoopDetected ?? false
7330
7624
  );
7331
7625
  nextMessage = nextAfterTools.message;
7626
+ if (nextAfterTools.stoppedByRepeatedToolFailure) {
7627
+ return {
7628
+ kind: "terminal",
7629
+ stopReason: options.rejectOnLoopDetected ? cancelledOrThrowLoopDetected(pendingSend.signal, toolLoopState) : getAbortAwareEndTurnStopReason(pendingSend.signal),
7630
+ loopProtectionStopped: true,
7631
+ ...supersededAutomaticContinuation ? { supersededAutomaticContinuation: true } : {}
7632
+ };
7633
+ }
7332
7634
  if (nextAfterTools.hadMidTurnUserInput) {
7333
7635
  nextGuardContinuation = void 0;
7334
7636
  continue;
@@ -7627,6 +7929,14 @@ ${this.pendingRecoveredAgentsNotice}
7627
7929
  );
7628
7930
  return { responseStream: null, stopReason: "cancelled" };
7629
7931
  }
7932
+ if (message[0]?.functionResponse) {
7933
+ const memory = await geminiClient.consumeManagedAutoMemoryRecall("tool_result");
7934
+ if (memory?.prompt) {
7935
+ message = insertAfterFunctionResponses(message, [
7936
+ { text: memory.prompt }
7937
+ ]);
7938
+ }
7939
+ }
7630
7940
  const chat = this.#getCurrentChat();
7631
7941
  const model = options.getModelOverride?.() ?? options.modelOverride ?? this.config.getModel();
7632
7942
  const request = {
@@ -8000,13 +8310,23 @@ ${this.pendingRecoveredAgentsNotice}
8000
8310
  const displayText = message.kind === "text" ? message.message : message.displayText;
8001
8311
  let rawParts;
8002
8312
  try {
8003
- rawParts = message.kind === "text" ? [{ text: message.message }] : await withTimeoutSignal(
8004
- abortSignal,
8005
- MID_TURN_QUEUE_RESOLVE_TIMEOUT_MS,
8006
- (signal) => this.#resolvePrompt(message.content, signal, {
8007
- onFullTurnModel: options.onFullTurnModel
8008
- })
8009
- );
8313
+ if (message.kind === "text") {
8314
+ rawParts = [{ text: message.message }];
8315
+ } else {
8316
+ rawParts = await withTimeoutSignal(
8317
+ abortSignal,
8318
+ MID_TURN_QUEUE_RESOLVE_TIMEOUT_MS,
8319
+ (signal) => this.#resolvePrompt(message.content, signal, {
8320
+ deferBridgeConversions: true
8321
+ })
8322
+ );
8323
+ rawParts = await this.#applyBridgeConversionsIfNeeded(
8324
+ rawParts,
8325
+ abortSignal,
8326
+ options.onFullTurnModel
8327
+ );
8328
+ abortSignal.throwIfAborted();
8329
+ }
8010
8330
  } catch (messageError) {
8011
8331
  if (abortSignal.aborted && !options.preserveFallbackOnAbort) {
8012
8332
  return parts;
@@ -8052,15 +8372,18 @@ ${this.pendingRecoveredAgentsNotice}
8052
8372
  */
8053
8373
  async #startCronSchedulerIfNeeded() {
8054
8374
  if (this.disposed) return;
8375
+ if (this.#isAutomaticWorkHeld()) return;
8055
8376
  if (!this.config.isCronEnabled()) return;
8056
8377
  if (this.cronDisabledByTokenLimit) return;
8057
8378
  const scheduler = this.config.getCronScheduler();
8058
- try {
8059
- await scheduler.enableDurable(this.sessionId);
8060
- } catch (err) {
8061
- debugLogger6.warn(
8062
- `Durable cron init failed \u2014 persistent tasks will not fire in this session: ${err}`
8063
- );
8379
+ if (!this.requiresManagedConversationBinding) {
8380
+ try {
8381
+ await scheduler.enableDurable(this.sessionId);
8382
+ } catch (err) {
8383
+ debugLogger6.warn(
8384
+ `Durable cron init failed \u2014 persistent tasks will not fire in this session: ${err}`
8385
+ );
8386
+ }
8064
8387
  }
8065
8388
  if (this.disposed) return;
8066
8389
  if (!scheduler.hasPendingWork) return;
@@ -8136,6 +8459,7 @@ ${this.pendingRecoveredAgentsNotice}
8136
8459
  async #drainCronQueue() {
8137
8460
  if (this.disposed) return;
8138
8461
  if (this.closing) return;
8462
+ if (this.#isAutomaticWorkHeld()) return;
8139
8463
  if (this.cronProcessing) return;
8140
8464
  if (this.pendingPrompt) return;
8141
8465
  if (this.goalProcessing) return;
@@ -8148,6 +8472,7 @@ ${this.pendingRecoveredAgentsNotice}
8148
8472
  }
8149
8473
  async #drainCronQueueExclusive() {
8150
8474
  if (this.disposed || this.closing || this.cronProcessing) return;
8475
+ if (this.#isAutomaticWorkHeld()) return;
8151
8476
  if (this.pendingPrompt || this.notificationProcessing) return;
8152
8477
  if (this.#deferAutomaticQueueDrainUntilTurnsSettle()) return;
8153
8478
  if (this.#nextCronQueueIndex() < 0) return;
@@ -8741,6 +9066,7 @@ ${this.pendingRecoveredAgentsNotice}
8741
9066
  async #drainNotificationQueue() {
8742
9067
  if (this.disposed) return;
8743
9068
  if (this.closing) return;
9069
+ if (this.#isAutomaticWorkHeld()) return;
8744
9070
  if (this.notificationProcessing) return;
8745
9071
  if (this.pendingPrompt || this.goalProcessing || this.cronProcessing || this.cronAbortController) {
8746
9072
  return;
@@ -8754,6 +9080,7 @@ ${this.pendingRecoveredAgentsNotice}
8754
9080
  }
8755
9081
  async #drainNotificationQueueExclusive() {
8756
9082
  if (this.disposed || this.closing || this.notificationProcessing) return;
9083
+ if (this.#isAutomaticWorkHeld()) return;
8757
9084
  if (this.pendingPrompt || this.cronProcessing || this.cronAbortController) {
8758
9085
  return;
8759
9086
  }
@@ -9173,12 +9500,17 @@ ${this.pendingRecoveredAgentsNotice}
9173
9500
  reloadSkillSettings() {
9174
9501
  this.settings.reloadScopeFromDisk("Workspace" /* Workspace */);
9175
9502
  }
9176
- async sendAvailableCommandsUpdateOrThrow() {
9177
- const { availableCommands, availableSkills, availableSkillDetails } = await buildAvailableCommandsSnapshot(
9503
+ buildAvailableCommandsSnapshot() {
9504
+ return buildAvailableCommandsSnapshot(
9178
9505
  this.config,
9179
9506
  void 0,
9180
- this.settings
9507
+ this.settings,
9508
+ this.slashCommandPolicy
9181
9509
  );
9510
+ }
9511
+ async sendAvailableCommandsUpdateOrThrow() {
9512
+ if (this.#isAutomaticWorkHeld()) return;
9513
+ const { availableCommands, availableSkills, availableSkillDetails } = await this.buildAvailableCommandsSnapshot();
9182
9514
  const update = {
9183
9515
  sessionUpdate: "available_commands_update",
9184
9516
  availableCommands,
@@ -9321,7 +9653,8 @@ ${this.pendingRecoveredAgentsNotice}
9321
9653
  }).catch((error) => {
9322
9654
  debugLogger6.debug("model-update extNotification failed", error);
9323
9655
  });
9324
- if (options.persistDefault ?? true) {
9656
+ const persistDefault = !this.requiresManagedConversationBinding && (options.persistDefault ?? true);
9657
+ if (persistDefault) {
9325
9658
  const persistScope = getPersistScopeForModelSelection(this.settings);
9326
9659
  this.settings.setValue(
9327
9660
  persistScope,
@@ -9936,11 +10269,6 @@ ${this.pendingRecoveredAgentsNotice}
9936
10269
  * branches in `GeminiClient.sendMessageStream` (`client.ts:848-878`) —
9937
10270
  * the ACP path bypasses that code, so without this helper plan mode is
9938
10271
  * silently inert and subagent/arena sessions lose context.
9939
- *
9940
- * Scope note: the `relevantAutoMemory` reminder is intentionally NOT
9941
- * included here. Managed auto-memory requires a prefetch pipeline that
9942
- * lives in `GeminiClient`, and porting it into the ACP path is tracked
9943
- * separately as part of the broader middleware-alignment work.
9944
10272
  */
9945
10273
  async #buildInitialSystemReminders() {
9946
10274
  const reminders = [];
@@ -10221,6 +10549,18 @@ ${this.pendingRecoveredAgentsNotice}
10221
10549
  const isAgentTool = tool.name === ToolNames.AGENT;
10222
10550
  const isExitPlanModeTool = tool.name === ToolNames.EXIT_PLAN_MODE;
10223
10551
  const isEnterPlanModeTool = tool.name === ToolNames.ENTER_PLAN_MODE;
10552
+ const requestsAgentWorkingDirectory = isAgentTool && (args["isolation"] === "worktree" || typeof args["working_dir"] === "string" && args["working_dir"].trim().length > 0);
10553
+ if (this.requiresManagedConversationBinding && (requestsAgentWorkingDirectory || tool.name === ToolNames.ENTER_WORKTREE || tool.name === ToolNames.EXIT_WORKTREE)) {
10554
+ return earlyErrorResponse(
10555
+ new Error(STANDALONE_WORKTREE_ACTION_ERROR),
10556
+ toolName,
10557
+ {
10558
+ status: "error",
10559
+ errorType: "execution_denied" /* EXECUTION_DENIED */,
10560
+ executionStatus: "not_started"
10561
+ }
10562
+ );
10563
+ }
10224
10564
  if (isAgentTool) {
10225
10565
  agentToolAbortController = new AbortController();
10226
10566
  activeToolAbortSignal = agentToolAbortController.signal;
@@ -10260,7 +10600,8 @@ ${this.pendingRecoveredAgentsNotice}
10260
10600
  agentToolAbortController?.abort(USER_CANCEL_ABORT_REASON);
10261
10601
  onStopAfterPermissionCancel?.();
10262
10602
  },
10263
- (params, signal) => this.#requestPermissionQueued(params, signal)
10603
+ (params, signal) => this.#requestPermissionQueued(params, signal),
10604
+ this.requiresManagedConversationBinding ? STANDALONE_PERMISSION_PERSISTENCE_POLICY : void 0
10264
10605
  );
10265
10606
  subAgentCleanupFunctions = subSubAgentTracker.setup(
10266
10607
  taskEventEmitter,
@@ -10678,7 +11019,8 @@ ${this.pendingRecoveredAgentsNotice}
10678
11019
  }
10679
11020
  const permissionOptions = toPermissionOptions(
10680
11021
  confirmationDetails,
10681
- pmForcedAsk
11022
+ pmForcedAsk,
11023
+ this.requiresManagedConversationBinding ? STANDALONE_PERMISSION_PERSISTENCE_POLICY : void 0
10682
11024
  );
10683
11025
  const offeredPermissionOptions = permissionOptions.map(
10684
11026
  (option) => ({ ...option })
@@ -10831,7 +11173,7 @@ ${this.pendingRecoveredAgentsNotice}
10831
11173
  const modeUpdateCancellation = cancelBeforeExecutionIfAborted(toolName);
10832
11174
  if (modeUpdateCancellation) return modeUpdateCancellation;
10833
11175
  }
10834
- if (outcome === "proceed_always" /* ProceedAlways */ || outcome === "proceed_always_project" /* ProceedAlwaysProject */ || outcome === "proceed_always_user" /* ProceedAlwaysUser */) {
11176
+ if (outcome === "proceed_always_project" /* ProceedAlwaysProject */ || outcome === "proceed_always_user" /* ProceedAlwaysUser */) {
10835
11177
  await persistPermissionOutcome(
10836
11178
  outcome,
10837
11179
  confirmationDetails,
@@ -11469,6 +11811,9 @@ ${this.pendingRecoveredAgentsNotice}
11469
11811
  executionStatus
11470
11812
  });
11471
11813
  } finally {
11814
+ if (terminalStatus && terminalStatus !== "cancelled") {
11815
+ this.config.getGeminiClient().recordCompletedToolCall(toolName, args);
11816
+ }
11472
11817
  if (terminalStatus === "cancelled") {
11473
11818
  endToolSpan(toolSpan, { success: false, cancelled: true });
11474
11819
  } else {
@@ -11541,6 +11886,13 @@ ${this.pendingRecoveredAgentsNotice}
11541
11886
  return null;
11542
11887
  }
11543
11888
  case "unsupported": {
11889
+ if (result.originalType === "unsupported_action") {
11890
+ throw new RequestError(
11891
+ -32004,
11892
+ "This action is not supported in this standalone session.",
11893
+ { errorKind: "unsupported_action" }
11894
+ );
11895
+ }
11544
11896
  const unsupportedError = `Slash command not supported in ACP integration: ${result.reason}`;
11545
11897
  throw new Error(unsupportedError);
11546
11898
  }
@@ -11575,6 +11927,11 @@ ${this.pendingRecoveredAgentsNotice}
11575
11927
  const preserveUnsupportedImageForBridge = shouldRunVisionBridge(
11576
11928
  this.config
11577
11929
  );
11930
+ const finish = /* @__PURE__ */ __name((parts2) => options.deferBridgeConversions ? parts2 : this.#applyBridgeConversionsIfNeeded(
11931
+ parts2,
11932
+ abortSignal,
11933
+ options.onFullTurnModel
11934
+ ), "finish");
11578
11935
  const parts = message.map((part) => {
11579
11936
  switch (part.type) {
11580
11937
  case "text":
@@ -11680,18 +12037,10 @@ ${this.pendingRecoveredAgentsNotice}
11680
12037
  (part) => !("fileData" in part) || acceptedFileUris.has(part.fileData.fileUri)
11681
12038
  );
11682
12039
  if (pathSpecsToRead.length === 0 && embeddedContext.length === 0 && extensionParts.length === 0 && mcpServerParts.length === 0) {
11683
- return this.#applyBridgeConversionsIfNeeded(
11684
- partsToSend,
11685
- abortSignal,
11686
- options.onFullTurnModel
11687
- );
12040
+ return finish(partsToSend);
11688
12041
  }
11689
12042
  if (pathSpecsToRead.length === 0 && embeddedContext.length === 0) {
11690
- return this.#applyBridgeConversionsIfNeeded(
11691
- [...partsToSend, ...extensionParts, ...mcpServerParts],
11692
- abortSignal,
11693
- options.onFullTurnModel
11694
- );
12043
+ return finish([...partsToSend, ...extensionParts, ...mcpServerParts]);
11695
12044
  }
11696
12045
  let initialQueryText = "";
11697
12046
  for (let i = 0; i < partsToSend.length; i++) {
@@ -11752,11 +12101,7 @@ ${contextPart.text}`
11752
12101
  const promptText = pathSpecsToRead.length > 0 ? initialQueryText : initialQueryText.trim();
11753
12102
  const promptPart = { text: promptText };
11754
12103
  const processedQueryParts = options.promptLast ? [...referenceParts, promptPart] : [promptPart, ...referenceParts];
11755
- return this.#applyBridgeConversionsIfNeeded(
11756
- processedQueryParts,
11757
- abortSignal,
11758
- options.onFullTurnModel
11759
- );
12104
+ return finish(processedQueryParts);
11760
12105
  }
11761
12106
  async #applyBridgeConversionsIfNeeded(originalParts, abortSignal, onFullTurnModel) {
11762
12107
  const parts = await this.#applyVoiceBridgeIfNeeded(
@@ -13703,7 +14048,8 @@ function getSessionSource(params) {
13703
14048
  }
13704
14049
  return {
13705
14050
  sourceType: value["sourceType"],
13706
- ...typeof value["sourceId"] === "string" ? { sourceId: value["sourceId"] } : {}
14051
+ ...typeof value["sourceId"] === "string" ? { sourceId: value["sourceId"] } : {},
14052
+ ...value[DAEMON_OWNED_STANDALONE_CREATION_KEY] === true ? { daemonOwnedStandaloneCreation: true } : {}
13707
14053
  };
13708
14054
  }
13709
14055
  __name(getSessionSource, "getSessionSource");
@@ -15149,6 +15495,100 @@ function isOwnerOnlyDirectory(stats) {
15149
15495
  return (stats.mode & 63) === 0;
15150
15496
  }
15151
15497
  __name(isOwnerOnlyDirectory, "isOwnerOnlyDirectory");
15498
+ function hasOnlyKeys(value, keys) {
15499
+ const actual = Object.keys(value).sort();
15500
+ const expected = [...keys].sort();
15501
+ return actual.length === expected.length && actual.every((key, index) => key === expected[index]);
15502
+ }
15503
+ __name(hasOnlyKeys, "hasOnlyKeys");
15504
+ function isManagedConversationPath(value) {
15505
+ return typeof value === "string" && value.length > 0 && !value.includes("\0") && path6.isAbsolute(value);
15506
+ }
15507
+ __name(isManagedConversationPath, "isManagedConversationPath");
15508
+ function isManagedConversationIdentityNumber(value) {
15509
+ return typeof value === "number" && Number.isSafeInteger(value) && value >= 0;
15510
+ }
15511
+ __name(isManagedConversationIdentityNumber, "isManagedConversationIdentityNumber");
15512
+ function parseConversationDirectoryExpectation(value) {
15513
+ if (value === void 0) return void 0;
15514
+ if (!isObjectRecord(value) || !hasOnlyKeys(value, ["canonicalSessionId", "root", "child"])) {
15515
+ throw RequestError.invalidParams(
15516
+ void 0,
15517
+ "Invalid managed conversation directory expectation"
15518
+ );
15519
+ }
15520
+ const canonicalSessionId = value["canonicalSessionId"];
15521
+ const root = value["root"];
15522
+ const child = value["child"];
15523
+ const parsedSessionId = parseCallerSuppliedSessionId(canonicalSessionId);
15524
+ if (parsedSessionId.kind !== "valid" || parsedSessionId.sessionId !== canonicalSessionId || !isObjectRecord(root) || !hasOnlyKeys(root, ["canonicalPath", "device", "inode"]) || !isManagedConversationPath(root["canonicalPath"]) || !isManagedConversationIdentityNumber(root["device"]) || !isManagedConversationIdentityNumber(root["inode"]) || !isObjectRecord(child) || !hasOnlyKeys(child, ["name", "canonicalPath", "device", "inode"]) || typeof child["name"] !== "string" || child["name"] !== getConversationDirectoryName(canonicalSessionId) || !isManagedConversationPath(child["canonicalPath"]) || !isManagedConversationIdentityNumber(child["device"]) || !isManagedConversationIdentityNumber(child["inode"]) || !isSameConversationPath(
15525
+ path6.dirname(child["canonicalPath"]),
15526
+ root["canonicalPath"]
15527
+ ) || path6.basename(child["canonicalPath"]) !== child["name"]) {
15528
+ throw RequestError.invalidParams(
15529
+ void 0,
15530
+ "Invalid managed conversation directory expectation"
15531
+ );
15532
+ }
15533
+ return {
15534
+ canonicalSessionId,
15535
+ root: {
15536
+ canonicalPath: root["canonicalPath"],
15537
+ device: root["device"],
15538
+ inode: root["inode"]
15539
+ },
15540
+ child: {
15541
+ name: child["name"],
15542
+ canonicalPath: child["canonicalPath"],
15543
+ device: child["device"],
15544
+ inode: child["inode"]
15545
+ }
15546
+ };
15547
+ }
15548
+ __name(parseConversationDirectoryExpectation, "parseConversationDirectoryExpectation");
15549
+ function managedConversationDirectoryError(missing) {
15550
+ return new RequestError(
15551
+ -32004,
15552
+ missing ? "The standalone working directory is missing." : "The standalone working directory identity is compromised.",
15553
+ {
15554
+ errorKind: missing ? "working_directory_missing" : "working_directory_compromised"
15555
+ }
15556
+ );
15557
+ }
15558
+ __name(managedConversationDirectoryError, "managedConversationDirectoryError");
15559
+ async function assertManagedConversationDirectoryIdentity(expectation) {
15560
+ let rootBefore;
15561
+ let canonicalRoot;
15562
+ let rootAfter;
15563
+ try {
15564
+ rootBefore = await fs3.lstat(expectation.root.canonicalPath);
15565
+ canonicalRoot = await fs3.realpath(expectation.root.canonicalPath);
15566
+ rootAfter = await fs3.lstat(canonicalRoot);
15567
+ } catch (error) {
15568
+ throw managedConversationDirectoryError(
15569
+ error.code === "ENOENT"
15570
+ );
15571
+ }
15572
+ if (!isOwnerOnlyDirectory(rootBefore) || !isOwnerOnlyDirectory(rootAfter) || !isSameConversationPath(canonicalRoot, expectation.root.canonicalPath) || rootBefore.dev !== expectation.root.device || rootBefore.ino !== expectation.root.inode || rootAfter.dev !== expectation.root.device || rootAfter.ino !== expectation.root.inode) {
15573
+ throw managedConversationDirectoryError(false);
15574
+ }
15575
+ let childBefore;
15576
+ let canonicalChild;
15577
+ let childAfter;
15578
+ try {
15579
+ childBefore = await fs3.lstat(expectation.child.canonicalPath);
15580
+ canonicalChild = await fs3.realpath(expectation.child.canonicalPath);
15581
+ childAfter = await fs3.lstat(canonicalChild);
15582
+ } catch (error) {
15583
+ throw managedConversationDirectoryError(
15584
+ error.code === "ENOENT"
15585
+ );
15586
+ }
15587
+ if (!isOwnerOnlyDirectory(childBefore) || !isOwnerOnlyDirectory(childAfter) || !isSameConversationPath(canonicalChild, expectation.child.canonicalPath) || childBefore.dev !== expectation.child.device || childBefore.ino !== expectation.child.inode || childAfter.dev !== expectation.child.device || childAfter.ino !== expectation.child.inode) {
15588
+ throw managedConversationDirectoryError(false);
15589
+ }
15590
+ }
15591
+ __name(assertManagedConversationDirectoryIdentity, "assertManagedConversationDirectoryIdentity");
15152
15592
  var QwenAgent = class {
15153
15593
  constructor(config, settings, argv, connection, expectedPrivateParentCapability, sessionWriterLeaseEnabledAtStartup = false, managedToolInvocationGuard, externalToolGuardProviderAttached = false) {
15154
15594
  this.config = config;
@@ -16043,7 +16483,7 @@ var QwenAgent = class {
16043
16483
  }
16044
16484
  this.clientCapabilities = args.clientCapabilities;
16045
16485
  const authMethods = buildAuthMethods();
16046
- const version = "0.22.2-preview.0";
16486
+ const version = "0.22.2";
16047
16487
  const response = {
16048
16488
  protocolVersion: PROTOCOL_VERSION,
16049
16489
  agentInfo: {
@@ -16180,6 +16620,15 @@ var QwenAgent = class {
16180
16620
  const releaseStartingSessionId = requestedSessionId ? this.reserveStartingSessionId(requestedSessionId) : void 0;
16181
16621
  try {
16182
16622
  const sessionSource = getSessionSource(params);
16623
+ const provisionalStandalone = isReservedStandaloneSessionSourceType(
16624
+ sessionSource?.sourceType
16625
+ );
16626
+ if (sessionSource && isReservedStandaloneSessionSourceType(sessionSource.sourceType) && (sessionSource.daemonOwnedStandaloneCreation !== true || !this.isTrustedManagedParent())) {
16627
+ throw RequestError.invalidParams(
16628
+ void 0,
16629
+ "`standalone` is reserved for daemon-owned session creation"
16630
+ );
16631
+ }
16183
16632
  const parentContext = extractDaemonTraceContext(params);
16184
16633
  return await withDaemonSpan(
16185
16634
  "qwen-code.daemon.session_start",
@@ -16205,14 +16654,21 @@ var QwenAgent = class {
16205
16654
  );
16206
16655
  let session;
16207
16656
  try {
16208
- await profiler.time("auth", () => this.ensureAuthenticated(config));
16209
- profiler.timeSync(
16210
- "file_system_setup",
16211
- () => this.setupFileSystem(config)
16212
- );
16657
+ if (!provisionalStandalone) {
16658
+ await profiler.time(
16659
+ "auth",
16660
+ () => this.ensureAuthenticated(config)
16661
+ );
16662
+ profiler.timeSync(
16663
+ "file_system_setup",
16664
+ () => this.setupFileSystem(config)
16665
+ );
16666
+ }
16213
16667
  session = await profiler.time(
16214
16668
  "session_register",
16215
- () => this.createAndStoreSession(config, settings)
16669
+ () => this.createAndStoreSession(config, settings, void 0, {
16670
+ deferWorkspaceActivation: provisionalStandalone
16671
+ })
16216
16672
  );
16217
16673
  } catch (error) {
16218
16674
  return this.cleanupAfterRequestFailure(error, async () => {
@@ -16256,6 +16712,15 @@ var QwenAgent = class {
16256
16712
  async loadSessionWithProfiler(params, initialSessionId, profiler) {
16257
16713
  let sessionId = initialSessionId;
16258
16714
  const sessionSource = getSessionSource(params);
16715
+ const provisionalStandalone = isReservedStandaloneSessionSourceType(
16716
+ sessionSource?.sourceType
16717
+ );
16718
+ if (provisionalStandalone && (sessionSource?.daemonOwnedStandaloneCreation !== true || !this.isTrustedManagedParent())) {
16719
+ throw RequestError.invalidParams(
16720
+ void 0,
16721
+ "`standalone` is reserved for daemon-owned session restore"
16722
+ );
16723
+ }
16259
16724
  const restoreOptions = loadRestoreOptions(params);
16260
16725
  const suppressRestoreAskUserQuestion = params._meta?.[DAEMON_SUPPRESS_RESTORE_ASK_USER_QUESTION_META_KEY] === true;
16261
16726
  const withRestoreHint = /* @__PURE__ */ __name((session, response) => suppressRestoreAskUserQuestion ? response : this.withAskUserQuestionRestoreHint(session, response), "withRestoreHint");
@@ -16418,21 +16883,37 @@ var QwenAgent = class {
16418
16883
  } : {}
16419
16884
  })), "buildResponse");
16420
16885
  try {
16421
- await profiler.time(
16422
- "restore_session_model",
16423
- () => restoreSessionModelThenAuthenticate(
16424
- config,
16425
- projection,
16426
- () => profiler.time("auth", () => this.ensureAuthenticated(config))
16427
- )
16428
- );
16429
- profiler.timeSync(
16430
- "file_system_setup",
16431
- () => this.setupFileSystem(config)
16432
- );
16886
+ if (!provisionalStandalone) {
16887
+ await profiler.time(
16888
+ "restore_session_model",
16889
+ () => restoreSessionModelThenAuthenticate(
16890
+ config,
16891
+ projection,
16892
+ () => profiler.time("auth", () => this.ensureAuthenticated(config))
16893
+ )
16894
+ );
16895
+ profiler.timeSync(
16896
+ "file_system_setup",
16897
+ () => this.setupFileSystem(config)
16898
+ );
16899
+ }
16433
16900
  await profiler.time(
16434
16901
  "session_register",
16435
16902
  () => this.createAndStoreSession(config, settings, void 0, {
16903
+ deferWorkspaceActivation: provisionalStandalone,
16904
+ ...provisionalStandalone ? {
16905
+ beforeDeferredWorkspaceActivation: /* @__PURE__ */ __name(() => profiler.time(
16906
+ "restore_session_model",
16907
+ () => restoreSessionModelThenAuthenticate(
16908
+ config,
16909
+ projection,
16910
+ () => profiler.time(
16911
+ "auth",
16912
+ () => this.ensureAuthenticated(config)
16913
+ )
16914
+ )
16915
+ ), "beforeDeferredWorkspaceActivation")
16916
+ } : {},
16436
16917
  enableLiveScreenContext: isCompatibleLiveSessionSource(
16437
16918
  sessionSource ?? {}
16438
16919
  ),
@@ -16578,7 +17059,9 @@ var QwenAgent = class {
16578
17059
  }
16579
17060
  }
16580
17061
  await profiler.time("post_replay_services", async () => {
16581
- await this.#restoreWorktreeOnResume(config, createdSession);
17062
+ if (!provisionalStandalone) {
17063
+ await this.#restoreWorktreeOnResume(config, createdSession);
17064
+ }
16582
17065
  await this.#restoreBackgroundAgentsOnResume(
16583
17066
  config,
16584
17067
  createdSession
@@ -16627,6 +17110,15 @@ var QwenAgent = class {
16627
17110
  async resumeSessionWithProfiler(params, initialSessionId, profiler) {
16628
17111
  let sessionId = initialSessionId;
16629
17112
  const sessionSource = getSessionSource(params);
17113
+ const provisionalStandalone = isReservedStandaloneSessionSourceType(
17114
+ sessionSource?.sourceType
17115
+ );
17116
+ if (provisionalStandalone && (sessionSource?.daemonOwnedStandaloneCreation !== true || !this.isTrustedManagedParent())) {
17117
+ throw RequestError.invalidParams(
17118
+ void 0,
17119
+ "`standalone` is reserved for daemon-owned session restore"
17120
+ );
17121
+ }
16630
17122
  const suppressRestoreAskUserQuestion = params._meta?.[DAEMON_SUPPRESS_RESTORE_ASK_USER_QUESTION_META_KEY] === true;
16631
17123
  const withRestoreHint = /* @__PURE__ */ __name((session, response) => suppressRestoreAskUserQuestion ? response : this.withAskUserQuestionRestoreHint(session, response), "withRestoreHint");
16632
17124
  const liveSession = this.sessions.get(sessionId);
@@ -16697,21 +17189,37 @@ var QwenAgent = class {
16697
17189
  const projection = config.consumeSessionRestoreProjection?.();
16698
17190
  let response;
16699
17191
  try {
16700
- await profiler.time(
16701
- "restore_session_model",
16702
- () => restoreSessionModelThenAuthenticate(
16703
- config,
16704
- projection,
16705
- () => profiler.time("auth", () => this.ensureAuthenticated(config))
16706
- )
16707
- );
16708
- profiler.timeSync(
16709
- "file_system_setup",
16710
- () => this.setupFileSystem(config)
16711
- );
17192
+ if (!provisionalStandalone) {
17193
+ await profiler.time(
17194
+ "restore_session_model",
17195
+ () => restoreSessionModelThenAuthenticate(
17196
+ config,
17197
+ projection,
17198
+ () => profiler.time("auth", () => this.ensureAuthenticated(config))
17199
+ )
17200
+ );
17201
+ profiler.timeSync(
17202
+ "file_system_setup",
17203
+ () => this.setupFileSystem(config)
17204
+ );
17205
+ }
16712
17206
  await profiler.time(
16713
17207
  "session_register",
16714
17208
  () => this.createAndStoreSession(config, settings, void 0, {
17209
+ deferWorkspaceActivation: provisionalStandalone,
17210
+ ...provisionalStandalone ? {
17211
+ beforeDeferredWorkspaceActivation: /* @__PURE__ */ __name(() => profiler.time(
17212
+ "restore_session_model",
17213
+ () => restoreSessionModelThenAuthenticate(
17214
+ config,
17215
+ projection,
17216
+ () => profiler.time(
17217
+ "auth",
17218
+ () => this.ensureAuthenticated(config)
17219
+ )
17220
+ )
17221
+ ), "beforeDeferredWorkspaceActivation")
17222
+ } : {},
16715
17223
  enableLiveScreenContext: isCompatibleLiveSessionSource(
16716
17224
  sessionSource ?? {}
16717
17225
  ),
@@ -16735,7 +17243,9 @@ var QwenAgent = class {
16735
17243
  }, "primeSession"),
16736
17244
  beforeStartPostReplayServices: /* @__PURE__ */ __name(async (createdSession) => {
16737
17245
  await profiler.time("post_replay_services", async () => {
16738
- await this.#restoreWorktreeOnResume(config, createdSession);
17246
+ if (!provisionalStandalone) {
17247
+ await this.#restoreWorktreeOnResume(config, createdSession);
17248
+ }
16739
17249
  await this.#restoreBackgroundAgentsOnResume(
16740
17250
  config,
16741
17251
  createdSession
@@ -18296,7 +18806,7 @@ var QwenAgent = class {
18296
18806
  }
18297
18807
  async buildSessionSupportedCommandsStatus(sessionId) {
18298
18808
  const session = this.sessionOrThrow(sessionId);
18299
- const { availableCommands, availableSkills } = await buildAvailableCommandsSnapshot(session.getConfig());
18809
+ const { availableCommands, availableSkills } = await session.buildAvailableCommandsSnapshot();
18300
18810
  return {
18301
18811
  v: STATUS_SCHEMA_VERSION,
18302
18812
  sessionId,
@@ -18341,12 +18851,26 @@ var QwenAgent = class {
18341
18851
  const now = Date.now();
18342
18852
  const createdAt = session.getCreatedAt();
18343
18853
  const models = {};
18344
- for (const [name, m] of Object.entries(metrics.models)) {
18854
+ for (const [name, rawMetrics] of Object.entries(metrics.models)) {
18855
+ const m = metrics.statsModels?.[name] ?? rawMetrics;
18345
18856
  models[name] = {
18346
18857
  api: { ...m.api },
18347
18858
  tokens: { ...m.tokens }
18348
18859
  };
18349
18860
  }
18861
+ const sources = [];
18862
+ for (const [id, source] of Object.entries(metrics.sourceMetrics ?? {})) {
18863
+ const meta = metrics.sourceMeta?.[id];
18864
+ sources.push({
18865
+ id,
18866
+ type: meta?.type ?? "",
18867
+ name: meta?.name ?? id,
18868
+ tokens: { ...source.tokens }
18869
+ });
18870
+ }
18871
+ sources.sort(
18872
+ (a, b) => b.tokens.total - a.tokens.total || a.id.localeCompare(b.id)
18873
+ );
18350
18874
  const byName = {};
18351
18875
  for (const [name, t] of Object.entries(metrics.tools.byName)) {
18352
18876
  byName[name] = {
@@ -18389,6 +18913,7 @@ var QwenAgent = class {
18389
18913
  durationMs: now - createdAt,
18390
18914
  promptCount: session.getTurnCount(),
18391
18915
  models,
18916
+ sources,
18392
18917
  tools: {
18393
18918
  totalCalls: metrics.tools.totalCalls,
18394
18919
  totalSuccess: metrics.tools.totalSuccess,
@@ -20064,6 +20589,17 @@ var QwenAgent = class {
20064
20589
  "error" in source ? source.error : "Invalid or missing sourceType"
20065
20590
  );
20066
20591
  }
20592
+ if (isReservedStandaloneSessionSourceType(source.sourceType)) {
20593
+ const standaloneSession = this.sessionOrThrow(sessionId);
20594
+ if (params[DAEMON_OWNED_STANDALONE_CREATION_KEY] !== true || this.privateParentState !== "trusted" || !isReservedStandaloneSessionSourceType(
20595
+ standaloneSession.getConfig().getSessionSourceType()
20596
+ )) {
20597
+ throw RequestError.invalidParams(
20598
+ void 0,
20599
+ "`standalone` is reserved for daemon-owned session creation"
20600
+ );
20601
+ }
20602
+ }
20067
20603
  const session = this.sessionOrThrow(sessionId);
20068
20604
  if (isCompatibleLiveSessionSource(source)) {
20069
20605
  await session.enableLiveScreenContext();
@@ -20260,9 +20796,41 @@ var QwenAgent = class {
20260
20796
  "Invalid managed relocation capability"
20261
20797
  );
20262
20798
  }
20799
+ const conversationDirectoryExpectation = parseConversationDirectoryExpectation(
20800
+ params["conversationDirectoryExpectation"]
20801
+ );
20802
+ if (conversationDirectoryExpectation !== void 0 && managedRelocation !== "live-conversation") {
20803
+ throw RequestError.invalidParams(
20804
+ void 0,
20805
+ "Managed conversation directory expectation requires managed relocation"
20806
+ );
20807
+ }
20263
20808
  const allowedRoots = params["allowedRoots"];
20264
20809
  const session = this.sessionOrThrow(sessionId);
20265
20810
  const config = session.getConfig();
20811
+ const standalone = isReservedStandaloneSessionSourceType(
20812
+ config.getSessionSourceType()
20813
+ );
20814
+ if (standalone && (managedRelocation !== "live-conversation" || conversationDirectoryExpectation === void 0)) {
20815
+ throw RequestError.invalidParams(
20816
+ void 0,
20817
+ "Standalone relocation requires an exact managed directory expectation"
20818
+ );
20819
+ }
20820
+ if (conversationDirectoryExpectation !== void 0) {
20821
+ if (this.privateParentState !== "trusted" || conversationDirectoryExpectation.canonicalSessionId !== normalizeSessionIdForLookup(sessionId) || !Array.isArray(allowedRoots) || allowedRoots.length !== 1 || typeof allowedRoots[0] !== "string" || !isSameConversationPath(
20822
+ allowedRoots[0],
20823
+ conversationDirectoryExpectation.root.canonicalPath
20824
+ ) || !isSameConversationPath(
20825
+ targetPath,
20826
+ conversationDirectoryExpectation.child.canonicalPath
20827
+ )) {
20828
+ throw managedConversationDirectoryError(false);
20829
+ }
20830
+ await assertManagedConversationDirectoryIdentity(
20831
+ conversationDirectoryExpectation
20832
+ );
20833
+ }
20266
20834
  if (config.isRestrictiveSandbox()) {
20267
20835
  throw new RequestError(-32003, "Restrictive sandbox mode active", {
20268
20836
  errorKind: "restrictive_sandbox"
@@ -20272,18 +20840,34 @@ var QwenAgent = class {
20272
20840
  try {
20273
20841
  stats = await fs3.stat(targetPath);
20274
20842
  } catch {
20843
+ if (conversationDirectoryExpectation !== void 0) {
20844
+ throw managedConversationDirectoryError(true);
20845
+ }
20275
20846
  throw new RequestError(-32002, `Directory not found: ${targetPath}`, {
20276
20847
  errorKind: "directory_not_found",
20277
20848
  path: targetPath
20278
20849
  });
20279
20850
  }
20280
20851
  if (!stats.isDirectory()) {
20852
+ if (conversationDirectoryExpectation !== void 0) {
20853
+ throw managedConversationDirectoryError(false);
20854
+ }
20281
20855
  throw new RequestError(-32002, `Not a directory: ${targetPath}`, {
20282
20856
  errorKind: "directory_not_found",
20283
20857
  path: targetPath
20284
20858
  });
20285
20859
  }
20286
- const canonicalPath = await fs3.realpath(targetPath);
20860
+ let canonicalPath;
20861
+ try {
20862
+ canonicalPath = await fs3.realpath(targetPath);
20863
+ } catch (error) {
20864
+ if (conversationDirectoryExpectation !== void 0) {
20865
+ throw managedConversationDirectoryError(
20866
+ error.code === "ENOENT"
20867
+ );
20868
+ }
20869
+ throw error;
20870
+ }
20287
20871
  let containmentRoots = allowedRoots;
20288
20872
  let managedTrustAllowed = false;
20289
20873
  if (managedRelocation === "live-conversation") {
@@ -20308,13 +20892,22 @@ var QwenAgent = class {
20308
20892
  canonicalRoot = await fs3.realpath(rootPath);
20309
20893
  rootAfter = await fs3.lstat(canonicalRoot);
20310
20894
  } catch {
20895
+ if (conversationDirectoryExpectation !== void 0) {
20896
+ throw managedConversationDirectoryError(false);
20897
+ }
20311
20898
  throw new RequestError(
20312
20899
  -32004,
20313
20900
  "Live managed relocation requires an owner-only allowed root",
20314
20901
  { errorKind: "containment_violation", path: rootPath }
20315
20902
  );
20316
20903
  }
20317
- if (!isOwnerOnlyDirectory(rootBefore) || !isOwnerOnlyDirectory(rootAfter) || rootBefore.dev !== rootAfter.dev || rootBefore.ino !== rootAfter.ino) {
20904
+ if (!isOwnerOnlyDirectory(rootBefore) || !isOwnerOnlyDirectory(rootAfter) || rootBefore.dev !== rootAfter.dev || rootBefore.ino !== rootAfter.ino || conversationDirectoryExpectation !== void 0 && (!isSameConversationPath(
20905
+ canonicalRoot,
20906
+ conversationDirectoryExpectation.root.canonicalPath
20907
+ ) || rootAfter.dev !== conversationDirectoryExpectation.root.device || rootAfter.ino !== conversationDirectoryExpectation.root.inode)) {
20908
+ if (conversationDirectoryExpectation !== void 0) {
20909
+ throw managedConversationDirectoryError(false);
20910
+ }
20318
20911
  throw new RequestError(
20319
20912
  -32004,
20320
20913
  "Live managed relocation requires an owner-only allowed root",
@@ -20326,7 +20919,12 @@ var QwenAgent = class {
20326
20919
  try {
20327
20920
  targetBefore = await fs3.lstat(targetPath);
20328
20921
  targetAfter = await fs3.lstat(canonicalPath);
20329
- } catch {
20922
+ } catch (error) {
20923
+ if (conversationDirectoryExpectation !== void 0) {
20924
+ throw managedConversationDirectoryError(
20925
+ error.code === "ENOENT"
20926
+ );
20927
+ }
20330
20928
  throw new RequestError(
20331
20929
  -32004,
20332
20930
  "Live managed relocation requires an owner-only direct child",
@@ -20334,7 +20932,13 @@ var QwenAgent = class {
20334
20932
  );
20335
20933
  }
20336
20934
  const relativeTarget = path6.relative(canonicalRoot, canonicalPath);
20337
- if (!isOwnerOnlyDirectory(targetBefore) || !isOwnerOnlyDirectory(targetAfter) || targetBefore.dev !== targetAfter.dev || targetBefore.ino !== targetAfter.ino || relativeTarget.length === 0 || relativeTarget.startsWith("..") || path6.isAbsolute(relativeTarget) || relativeTarget.includes(path6.sep)) {
20935
+ if (!isOwnerOnlyDirectory(targetBefore) || !isOwnerOnlyDirectory(targetAfter) || targetBefore.dev !== targetAfter.dev || targetBefore.ino !== targetAfter.ino || conversationDirectoryExpectation !== void 0 && (!isSameConversationPath(
20936
+ canonicalPath,
20937
+ conversationDirectoryExpectation.child.canonicalPath
20938
+ ) || targetAfter.dev !== conversationDirectoryExpectation.child.device || targetAfter.ino !== conversationDirectoryExpectation.child.inode) || relativeTarget.length === 0 || relativeTarget.startsWith("..") || path6.isAbsolute(relativeTarget) || relativeTarget.includes(path6.sep)) {
20939
+ if (conversationDirectoryExpectation !== void 0) {
20940
+ throw managedConversationDirectoryError(false);
20941
+ }
20338
20942
  throw new RequestError(
20339
20943
  -32004,
20340
20944
  "Live managed relocation requires an owner-only direct child",
@@ -20345,13 +20949,19 @@ var QwenAgent = class {
20345
20949
  try {
20346
20950
  rootFinal = await fs3.lstat(canonicalRoot);
20347
20951
  } catch {
20952
+ if (conversationDirectoryExpectation !== void 0) {
20953
+ throw managedConversationDirectoryError(false);
20954
+ }
20348
20955
  throw new RequestError(
20349
20956
  -32004,
20350
20957
  "Live managed relocation allowed root changed during validation",
20351
20958
  { errorKind: "containment_violation", path: canonicalRoot }
20352
20959
  );
20353
20960
  }
20354
- if (!isOwnerOnlyDirectory(rootFinal) || rootFinal.dev !== rootAfter.dev || rootFinal.ino !== rootAfter.ino) {
20961
+ if (!isOwnerOnlyDirectory(rootFinal) || rootFinal.dev !== rootAfter.dev || rootFinal.ino !== rootAfter.ino || conversationDirectoryExpectation !== void 0 && (rootFinal.dev !== conversationDirectoryExpectation.root.device || rootFinal.ino !== conversationDirectoryExpectation.root.inode)) {
20962
+ if (conversationDirectoryExpectation !== void 0) {
20963
+ throw managedConversationDirectoryError(false);
20964
+ }
20355
20965
  throw new RequestError(
20356
20966
  -32004,
20357
20967
  "Live managed relocation allowed root changed during validation",
@@ -20368,6 +20978,9 @@ var QwenAgent = class {
20368
20978
  return !rel.startsWith("..") && !path6.isAbsolute(rel);
20369
20979
  });
20370
20980
  if (!contained) {
20981
+ if (conversationDirectoryExpectation !== void 0) {
20982
+ throw managedConversationDirectoryError(false);
20983
+ }
20371
20984
  throw new RequestError(
20372
20985
  -32004,
20373
20986
  `Path outside allowed roots: ${canonicalPath}`,
@@ -20401,7 +21014,7 @@ var QwenAgent = class {
20401
21014
  );
20402
21015
  try {
20403
21016
  const settledPreviousCwd = config.getTargetDir();
20404
- if (canonicalPath === settledPreviousCwd) {
21017
+ if (canonicalPath === settledPreviousCwd && conversationDirectoryExpectation === void 0) {
20405
21018
  return {
20406
21019
  previousCwd: settledPreviousCwd,
20407
21020
  newCwd: canonicalPath,
@@ -20417,12 +21030,30 @@ var QwenAgent = class {
20417
21030
  SESSION_DRAIN_TIMEOUT_MS,
20418
21031
  "close"
20419
21032
  );
21033
+ if (conversationDirectoryExpectation !== void 0 && session.hasStandaloneRelocationBlockers()) {
21034
+ throw new RequestError(
21035
+ -32602,
21036
+ "Cannot relocate while standalone background work is active",
21037
+ { errorKind: "session_busy" }
21038
+ );
21039
+ }
20420
21040
  const warnings = [];
20421
21041
  const relocation = await config.relocateWorkingDirectory(
20422
21042
  canonicalPath,
20423
21043
  canonicalPath,
20424
21044
  { skipProcessChdir: true, skipArtifactMigration: true }
20425
21045
  );
21046
+ if (conversationDirectoryExpectation !== void 0) {
21047
+ await assertManagedConversationDirectoryIdentity(
21048
+ conversationDirectoryExpectation
21049
+ );
21050
+ session.installPendingManagedConversationBinding(
21051
+ conversationDirectoryExpectation,
21052
+ () => assertManagedConversationDirectoryIdentity(
21053
+ conversationDirectoryExpectation
21054
+ )
21055
+ );
21056
+ }
20426
21057
  if (relocation.memoryRefreshError) {
20427
21058
  warnings.push(
20428
21059
  `Memory refresh failed: ${relocation.memoryRefreshError instanceof Error ? relocation.memoryRefreshError.message : String(relocation.memoryRefreshError)}`
@@ -20452,6 +21083,41 @@ var QwenAgent = class {
20452
21083
  releaseGate();
20453
21084
  }
20454
21085
  }
21086
+ case SERVE_CONTROL_EXT_METHODS.sessionManagedConversationBindingCommit:
21087
+ case SERVE_CONTROL_EXT_METHODS.sessionManagedConversationBindingRelease: {
21088
+ const sessionId = params["sessionId"];
21089
+ if (typeof sessionId !== "string" || sessionId.length === 0) {
21090
+ throw RequestError.invalidParams(
21091
+ void 0,
21092
+ "Invalid or missing sessionId"
21093
+ );
21094
+ }
21095
+ if (this.privateParentState !== "trusted") {
21096
+ throw RequestError.invalidParams(
21097
+ void 0,
21098
+ "Managed conversation binding requires a trusted private ACP parent"
21099
+ );
21100
+ }
21101
+ const expectation = parseConversationDirectoryExpectation(
21102
+ params["conversationDirectoryExpectation"]
21103
+ );
21104
+ if (expectation === void 0 || expectation.canonicalSessionId !== normalizeSessionIdForLookup(sessionId)) {
21105
+ throw managedConversationDirectoryError(false);
21106
+ }
21107
+ const session = this.sessionOrThrow(sessionId);
21108
+ if (!isReservedStandaloneSessionSourceType(
21109
+ session.getConfig().getSessionSourceType()
21110
+ )) {
21111
+ throw managedConversationDirectoryError(false);
21112
+ }
21113
+ await assertManagedConversationDirectoryIdentity(expectation);
21114
+ if (method === SERVE_CONTROL_EXT_METHODS.sessionManagedConversationBindingCommit) {
21115
+ await session.commitManagedConversationBinding(expectation);
21116
+ return { sessionId, committed: true };
21117
+ }
21118
+ await session.releaseManagedConversationBinding(expectation);
21119
+ return { sessionId, released: true };
21120
+ }
20455
21121
  case SERVE_CONTROL_EXT_METHODS.sessionApprovalMode: {
20456
21122
  const sessionId = params["sessionId"];
20457
21123
  const mode = params["mode"];
@@ -22175,6 +22841,9 @@ ${outputText}
22175
22841
  }
22176
22842
  }
22177
22843
  async newSessionConfigInRuntimeContext(cwd, mcpServers, settings, sessionSource, sessionId, resume, initializeOptions = {}, chatRecording, restoreOptions) {
22844
+ const provisionalWorkspace = isReservedStandaloneSessionSourceType(
22845
+ sessionSource?.sourceType
22846
+ );
22178
22847
  const sessionMcpServers = {};
22179
22848
  for (const server of mcpServers) {
22180
22849
  const stdioServer = toStdioServer(server);
@@ -22236,6 +22905,7 @@ ${outputText}
22236
22905
  const sessionArg = resume === true ? { resume: sessionId, sessionId: void 0 } : { sessionId, resume: void 0 };
22237
22906
  const argvForSession = {
22238
22907
  ...this.argv,
22908
+ ...provisionalWorkspace ? { experimentalLsp: false } : {},
22239
22909
  // Docker sandbox relaunch injects a fixed --sandbox-session-id into
22240
22910
  // the ACP process argv. Without clearing it, every newSession()
22241
22911
  // inherits the same ID and the second session collides with the
@@ -22272,7 +22942,8 @@ ${outputText}
22272
22942
  // not process.exit(1) the shared ACP child and every session on its
22273
22943
  // channel. newSessionConfig maps the throw to a RequestError.
22274
22944
  true,
22275
- this.managedToolInvocationGuard || restoreOptions ? {
22945
+ this.managedToolInvocationGuard || restoreOptions || provisionalWorkspace ? {
22946
+ ...provisionalWorkspace ? { provisionalWorkspace: true } : {},
22276
22947
  ...this.managedToolInvocationGuard ? { toolInvocationGuard: this.managedToolInvocationGuard } : {},
22277
22948
  ...restoreOptions && sessionId ? {
22278
22949
  sessionRestore: {
@@ -22351,8 +23022,12 @@ ${outputText}
22351
23022
  () => this.cleanupUnstoredConfig(config)
22352
23023
  );
22353
23024
  }
22354
- startNonInteractiveOpenAILogHousekeeping(config, settings);
22355
- void this.surfaceMcpFailuresWhenReady(config);
23025
+ if (!provisionalWorkspace) {
23026
+ startNonInteractiveOpenAILogHousekeeping(config, settings);
23027
+ }
23028
+ if (!provisionalWorkspace) {
23029
+ void this.surfaceMcpFailuresWhenReady(config);
23030
+ }
22356
23031
  return config;
22357
23032
  }
22358
23033
  async surfaceMcpFailuresWhenReady(config) {
@@ -22410,7 +23085,7 @@ ${outputText}
22410
23085
  const sessionId = normalizeSessionIdForLookup(config.getSessionId());
22411
23086
  const geminiClient = config.getGeminiClient();
22412
23087
  const needsInitialize = !geminiClient.isInitialized();
22413
- if (needsInitialize) {
23088
+ if (needsInitialize && options.deferWorkspaceActivation !== true) {
22414
23089
  await geminiClient.initialize();
22415
23090
  }
22416
23091
  this.assertManagedSessionAdmission();
@@ -22439,11 +23114,59 @@ ${outputText}
22439
23114
  (operation) => this.runExclusiveHistoryMutation(sessionId, operation),
22440
23115
  () => this.activeWorkReporter?.notifyChanged()
22441
23116
  );
23117
+ const replaySessionHistory = /* @__PURE__ */ __name(async () => {
23118
+ if (options.replayHistory === false || !sessionData?.conversation.messages) {
23119
+ return;
23120
+ }
23121
+ await session.replayHistory(
23122
+ sessionData.conversation.messages,
23123
+ sessionData.historyGaps
23124
+ );
23125
+ try {
23126
+ await session.publishRecoveredGoalState(
23127
+ sessionData.conversation.messages
23128
+ );
23129
+ } catch (error) {
23130
+ debugLogger9.debug(
23131
+ `Failed to publish recovered Goal state: ${error instanceof Error ? error.message : String(error)}`
23132
+ );
23133
+ }
23134
+ }, "replaySessionHistory");
23135
+ if (options.deferWorkspaceActivation === true) {
23136
+ session.installManagedConversationActivation(
23137
+ async () => {
23138
+ this.assertManagedSessionAdmission();
23139
+ if (options.beforeDeferredWorkspaceActivation) {
23140
+ await options.beforeDeferredWorkspaceActivation();
23141
+ } else {
23142
+ await this.ensureAuthenticated(config);
23143
+ }
23144
+ this.assertManagedSessionAdmission();
23145
+ await config.activateProvisionalWorkspace();
23146
+ this.assertManagedSessionAdmission();
23147
+ this.setupFileSystem(config);
23148
+ config.hydrateSessionRestoreFileHistory?.();
23149
+ if (sessionData?.fileHistorySnapshots?.length) {
23150
+ config.getFileHistoryService().restoreFromSnapshots(sessionData.fileHistorySnapshots);
23151
+ }
23152
+ await replaySessionHistory();
23153
+ await options.beforeStartPostReplayServices?.(session);
23154
+ session.installRewriter();
23155
+ config.finalizeSessionRestore?.();
23156
+ startNonInteractiveOpenAILogHousekeeping(config, settings);
23157
+ },
23158
+ () => {
23159
+ void this.surfaceMcpFailuresWhenReady(config);
23160
+ }
23161
+ );
23162
+ }
22442
23163
  let published = false;
22443
23164
  try {
22444
23165
  await registerCreateSubSessionTool(config);
22445
23166
  options.primeSession?.(session);
22446
- config.hydrateSessionRestoreFileHistory?.();
23167
+ if (options.deferWorkspaceActivation !== true) {
23168
+ config.hydrateSessionRestoreFileHistory?.();
23169
+ }
22447
23170
  this.sessions.set(sessionId, session);
22448
23171
  published = true;
22449
23172
  this.activeWorkReporter?.notifyChanged();
@@ -22451,30 +23174,24 @@ ${outputText}
22451
23174
  if (options.enableLiveScreenContext) {
22452
23175
  await session.enableLiveScreenContext();
22453
23176
  }
22454
- if (sessionData?.fileHistorySnapshots?.length) {
23177
+ if (options.deferWorkspaceActivation !== true && sessionData?.fileHistorySnapshots?.length) {
22455
23178
  config.getFileHistoryService().restoreFromSnapshots(sessionData.fileHistorySnapshots);
22456
23179
  }
22457
23180
  if (sessionData?.conversation.messages) {
22458
23181
  config.getChatRecordingService()?.rebuildTurnBoundaries(sessionData.conversation.messages);
22459
23182
  }
22460
- if (options.replayHistory !== false && sessionData?.conversation.messages) {
22461
- await session.replayHistory(
22462
- sessionData.conversation.messages,
22463
- sessionData.historyGaps
22464
- );
22465
- try {
22466
- await session.publishRecoveredGoalState(
22467
- sessionData.conversation.messages
22468
- );
22469
- } catch (error) {
22470
- debugLogger9.debug(
22471
- `Failed to publish recovered Goal state: ${error instanceof Error ? error.message : String(error)}`
22472
- );
22473
- }
23183
+ if (options.deferWorkspaceActivation !== true) {
23184
+ await replaySessionHistory();
23185
+ }
23186
+ if (options.deferWorkspaceActivation !== true) {
23187
+ await options.beforeStartPostReplayServices?.(session);
23188
+ }
23189
+ if (options.deferWorkspaceActivation !== true) {
23190
+ session.installRewriter();
23191
+ }
23192
+ if (options.deferWorkspaceActivation !== true) {
23193
+ config.finalizeSessionRestore?.();
22474
23194
  }
22475
- await options.beforeStartPostReplayServices?.(session);
22476
- session.installRewriter();
22477
- config.finalizeSessionRestore?.();
22478
23195
  session.startCronScheduler();
22479
23196
  setTimeout(() => {
22480
23197
  void session.sendAvailableCommandsUpdate();