@qwen-code/qwen-code 0.22.2-preview.1 → 0.22.3

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 (437) hide show
  1. package/bundled/computer-use/SKILL.md +3 -3
  2. package/bundled/goal-draft/SKILL.md +109 -0
  3. package/bundled/qc-helper/docs/configuration/settings.md +37 -36
  4. package/bundled/qc-helper/docs/features/_meta.ts +1 -0
  5. package/bundled/qc-helper/docs/features/channels/dws.md +2 -0
  6. package/bundled/qc-helper/docs/features/channels/overview.md +34 -3
  7. package/bundled/qc-helper/docs/features/code-review.md +3 -3
  8. package/bundled/qc-helper/docs/features/commands.md +2 -1
  9. package/bundled/qc-helper/docs/features/computer-use.md +2 -2
  10. package/bundled/qc-helper/docs/features/goals.md +58 -0
  11. package/bundled/qc-helper/docs/features/headless.md +13 -11
  12. package/bundled/qc-helper/docs/features/status-line.md +3 -3
  13. package/bundled/qc-helper/docs/features/tool-use-summaries.md +1 -1
  14. package/bundled/qc-helper/docs/qwen-serve.md +1 -1
  15. package/bundled/review/SKILL.md +81 -31
  16. package/bundled/review/references/persistence.md +7 -3
  17. package/bundled/review/references/posting.md +10 -4
  18. package/chunks/MaxSizedBox-X42SXBJH.js +110 -0
  19. package/chunks/{StandaloneSessionPicker-5D2L22SF.js → StandaloneSessionPicker-2FJAOLGG.js} +81 -83
  20. package/chunks/{acpAgent-4DCKLA32.js → acpAgent-2ZMIJAFV.js} +1153 -357
  21. package/chunks/{agent-B4AFZL6H.js → agent-X5WX3L2I.js} +44 -46
  22. package/chunks/agent-headless-IZM25LJA.js +85 -0
  23. package/chunks/{anthropicContentGenerator-U76GTVB6.js → anthropicContentGenerator-YVTB6QX7.js} +46 -50
  24. package/chunks/{artifact-tool-XDJCZZCF.js → artifact-tool-XSMPHZBT.js} +11 -3
  25. package/chunks/{askUserQuestion-ZXXERLEV.js → askUserQuestion-4SWJY65V.js} +2 -2
  26. package/chunks/bridge-ME6QXZNA.js +119 -0
  27. package/chunks/{channel-management-service-HXXS3HOZ.js → channel-management-service-HQ6KDS7C.js} +6 -6
  28. package/chunks/channel-settings-store-PEOI7XCG.js +120 -0
  29. package/chunks/{channel-worker-group-EVDC2P4K.js → channel-worker-group-6NA6BBZV.js} +8 -7
  30. package/chunks/{channel-worker-manager-IJJZHGEI.js → channel-worker-manager-NEZ2J6RK.js} +10 -8
  31. package/chunks/{channel-worker-supervisor-YSKB5GVB.js → channel-worker-supervisor-FKU7DIHJ.js} +6 -5
  32. package/chunks/{chunk-7QGEJI7M.js → chunk-23RFD54N.js} +1 -1
  33. package/chunks/{chunk-JLU3FPQR.js → chunk-2HYKTO7V.js} +5 -5
  34. package/chunks/chunk-2LNNVAUV.js +1584 -0
  35. package/chunks/{chunk-FJAITR4L.js → chunk-2OBKDPZZ.js} +2 -2
  36. package/chunks/{chunk-JSY43GMI.js → chunk-2OUD5T67.js} +185 -174
  37. package/chunks/{chunk-LJP2BBMK.js → chunk-2SXSLSQE.js} +4 -4
  38. package/chunks/chunk-2TNL5KPM.js +49 -0
  39. package/chunks/{chunk-XMSMTU6H.js → chunk-2YOHKHYR.js} +4 -4
  40. package/chunks/{chunk-MCKJTBZN.js → chunk-36GSQ3MM.js} +2 -2
  41. package/chunks/chunk-36LGBEM6.js +130 -0
  42. package/chunks/{chunk-ZWKGZB2K.js → chunk-3JXM2CVW.js} +3 -3
  43. package/chunks/{chunk-X3XGCJ32.js → chunk-3SZC4VP4.js} +28 -111
  44. package/chunks/{chunk-ILPXSKGQ.js → chunk-3WK3QDNV.js} +2 -2
  45. package/chunks/{chunk-IKN3IUJP.js → chunk-3XKLXHGK.js} +17 -9
  46. package/chunks/{chunk-ZLTEQYNC.js → chunk-42IDLQWS.js} +26 -20
  47. package/chunks/chunk-4CMJKUND.js +95 -0
  48. package/chunks/{chunk-77TOMRBG.js → chunk-4K7KNVWH.js} +3 -3
  49. package/chunks/{chunk-SQPOJ4ZI.js → chunk-4NDLQAY2.js} +27 -270
  50. package/chunks/{chunk-V3GINY6K.js → chunk-4QHPPXK2.js} +16 -8
  51. package/chunks/{chunk-VBF4KZRQ.js → chunk-4TT3IVGA.js} +1 -1
  52. package/chunks/{chunk-IOGKXPL3.js → chunk-4VPCTGH6.js} +6 -6
  53. package/chunks/chunk-4VQBQLIZ.js +293 -0
  54. package/chunks/{chunk-UCSV2IZW.js → chunk-62GQFYID.js} +3 -3
  55. package/chunks/{chunk-SLEWBQWM.js → chunk-6DIGWMGT.js} +2 -2
  56. package/chunks/{chunk-BRVWYMKV.js → chunk-6MBXY6WM.js} +1 -1
  57. package/chunks/{chunk-PVBT5QPD.js → chunk-6PJOTWAN.js} +1 -1
  58. package/chunks/{chunk-WZ3QKPMQ.js → chunk-6X7EU5TI.js} +19 -31
  59. package/chunks/{chunk-KQYW2GB5.js → chunk-6ZPDLGHN.js} +6 -6
  60. package/chunks/{chunk-AKQA3WCH.js → chunk-734C6JGI.js} +723 -3399
  61. package/chunks/{chunk-F7M6ZFGU.js → chunk-73RM4POK.js} +8 -8
  62. package/chunks/{chunk-ELY4QVIB.js → chunk-7EQQR46F.js} +1 -1
  63. package/chunks/{chunk-KGJGEEVR.js → chunk-7FA2II6K.js} +10 -1
  64. package/chunks/chunk-7J6OTNGO.js +424 -0
  65. package/chunks/{chunk-LWLEPXKK.js → chunk-7LOELM2I.js} +19 -2
  66. package/chunks/{chunk-DIMEPKCW.js → chunk-7S226YTK.js} +1 -1
  67. package/chunks/{chunk-AWFZDYSD.js → chunk-7T52W4SW.js} +1 -1
  68. package/chunks/{chunk-3JKUX4PB.js → chunk-7VMIMAVB.js} +9 -9
  69. package/chunks/{chunk-2MHGD7EE.js → chunk-A3LWD5MK.js} +1 -1
  70. package/chunks/{chunk-E4I5MVBR.js → chunk-ABS25QER.js} +1 -1
  71. package/chunks/{chunk-TDQBVEPK.js → chunk-AIAOIFY4.js} +10 -8
  72. package/chunks/{chunk-NEZZHGEI.js → chunk-AYFA7MZV.js} +6 -6
  73. package/chunks/{chunk-FVDQ5E67.js → chunk-B466ZSHZ.js} +3 -3
  74. package/chunks/{chunk-6US7BF3G.js → chunk-B5PHIJGI.js} +183 -5
  75. package/chunks/{chunk-4TPAG3O7.js → chunk-BFPESSTR.js} +1 -1
  76. package/chunks/{chunk-WBT3STGU.js → chunk-BKWNKLZB.js} +20 -20
  77. package/chunks/{chunk-T45CL2NT.js → chunk-BOWFGCEU.js} +3 -3
  78. package/chunks/{chunk-IPQA4SR5.js → chunk-BWORX6FA.js} +1 -1
  79. package/chunks/{chunk-BKDAF7ES.js → chunk-BXDAPVQU.js} +2 -2
  80. package/chunks/{chunk-ZEADBZLO.js → chunk-C2X7KY45.js} +3 -3
  81. package/chunks/{chunk-PTQF7WRA.js → chunk-C3PEFRKD.js} +6 -6
  82. package/chunks/{chunk-7OBH4AM2.js → chunk-CAJTKR6W.js} +5 -5
  83. package/chunks/{chunk-2FN2HNTI.js → chunk-CFJY4DGX.js} +2 -2
  84. package/chunks/{chunk-SUE2ZMUH.js → chunk-CIZCL2MW.js} +49 -31
  85. package/chunks/{chunk-W2WRNJKX.js → chunk-CLWO3B77.js} +6 -6
  86. package/chunks/{chunk-U45D46O5.js → chunk-CMHFCLBU.js} +1 -1
  87. package/chunks/{chunk-LRKMQPMD.js → chunk-CQH5KTKC.js} +1 -1
  88. package/chunks/{chunk-JECO75XD.js → chunk-D5LUXLUH.js} +2 -2
  89. package/chunks/chunk-DJBQCO2E.js +842 -0
  90. package/chunks/{chunk-BQBUZDDH.js → chunk-DJECZIJX.js} +42 -42
  91. package/chunks/{chunk-GTUZ3R6I.js → chunk-DJEZ55D4.js} +351 -113
  92. package/chunks/{chunk-HPECDZ6X.js → chunk-DJPASAUV.js} +3866 -1077
  93. package/chunks/{chunk-VYWCFWI5.js → chunk-DMLVSW7L.js} +542 -654
  94. package/chunks/{chunk-EB4VDXNI.js → chunk-DYXFD5RO.js} +182 -3
  95. package/chunks/{chunk-ZKAZP2ZG.js → chunk-EB6QRGHM.js} +3 -3
  96. package/chunks/{chunk-UWICO5KN.js → chunk-EFWRMA2I.js} +3 -3
  97. package/chunks/{chunk-3UZCLCXR.js → chunk-EKSCLBBF.js} +3 -3
  98. package/chunks/{chunk-ALTQLFEG.js → chunk-EQSBPBZ3.js} +5 -194
  99. package/chunks/{chunk-624NHDGB.js → chunk-ERFDKH32.js} +11 -0
  100. package/chunks/{chunk-4K44OMLI.js → chunk-FROAFEFB.js} +3 -3
  101. package/chunks/{chunk-MZS7GEC7.js → chunk-FTF2YIZ5.js} +1 -1
  102. package/chunks/{chunk-Z7VOMGDC.js → chunk-FTJMWDND.js} +0 -24
  103. package/chunks/{chunk-ZJG323IA.js → chunk-G6FECKTJ.js} +7 -5
  104. package/chunks/{chunk-TMGAS5TO.js → chunk-GBJBJ4HX.js} +26 -4
  105. package/chunks/{chunk-UCQOSV6A.js → chunk-GPGU4S2N.js} +3 -3
  106. package/chunks/{chunk-BHTJAO36.js → chunk-GVIVASYK.js} +7 -7
  107. package/chunks/chunk-H72BQNM3.js +645 -0
  108. package/chunks/{chunk-Z4X5MTRT.js → chunk-HCOBAG2L.js} +2 -4
  109. package/chunks/{chunk-FCSWZAS3.js → chunk-HP5LR5HL.js} +5 -5
  110. package/chunks/{chunk-7JPW6IYH.js → chunk-HVC3PNVC.js} +1 -1
  111. package/chunks/{chunk-OI2DR6QB.js → chunk-I6LYRJPB.js} +3 -3
  112. package/chunks/{chunk-E55H6BZ7.js → chunk-ICURCKIU.js} +1335 -119
  113. package/chunks/{chunk-PAJGKZAA.js → chunk-ISKH4QX3.js} +14 -12
  114. package/chunks/{chunk-AYVIGUUK.js → chunk-JB4JIVTJ.js} +1 -1
  115. package/chunks/{chunk-FN5C6C7G.js → chunk-JHYH6PYQ.js} +192 -478
  116. package/chunks/{chunk-T6OODF2U.js → chunk-JWALNCLT.js} +1 -1
  117. package/chunks/{chunk-SKNVVYIJ.js → chunk-K5KXUXWC.js} +3 -3
  118. package/chunks/{chunk-XUX6O2ZT.js → chunk-KID24ZFN.js} +4 -1
  119. package/chunks/{chunk-I6DY753S.js → chunk-KJO2LBUK.js} +944 -18
  120. package/chunks/{chunk-5T4LWWNX.js → chunk-KYWTPLBJ.js} +18 -21
  121. package/chunks/{chunk-CZFQ62RM.js → chunk-LHBUKJG2.js} +4 -4
  122. package/chunks/{chunk-TOF4UZHH.js → chunk-LUEHOUHM.js} +3 -3
  123. package/chunks/{chunk-2YDYDDE2.js → chunk-M3QRM3DE.js} +3 -3
  124. package/chunks/{chunk-GNMJNDZE.js → chunk-M6FOJXW3.js} +1 -1
  125. package/chunks/{chunk-ZGWDHSUM.js → chunk-MF7HCQWZ.js} +4 -4
  126. package/chunks/{chunk-66GIFJ63.js → chunk-MK2GIB46.js} +1 -1
  127. package/chunks/{chunk-TFV4RXPU.js → chunk-MO3FC2WT.js} +1 -1
  128. package/chunks/{chunk-TR7G7XFQ.js → chunk-MPNBVAEU.js} +5 -5
  129. package/chunks/{chunk-K3LPAED5.js → chunk-MQM5PJML.js} +24 -4
  130. package/chunks/{chunk-3WBMPR3S.js → chunk-MSBO7X2W.js} +1 -1
  131. package/chunks/{chunk-5PA6UEYA.js → chunk-MZCJWS5Y.js} +1 -1
  132. package/chunks/{chunk-BGXZBI5B.js → chunk-N4X7G4J2.js} +2 -1
  133. package/chunks/{chunk-27ONXAFY.js → chunk-NIFYWDYN.js} +1 -1
  134. package/chunks/{chunk-AP7WZONS.js → chunk-NMOD2FXQ.js} +19 -9
  135. package/chunks/{chunk-IJVDHPKD.js → chunk-NU7RKEZR.js} +2 -2
  136. package/chunks/{chunk-5URK47RN.js → chunk-NV55WWD6.js} +11595 -10375
  137. package/chunks/{chunk-HABT2Z7R.js → chunk-OU5APVWO.js} +4 -4
  138. package/chunks/{chunk-QR4AHMGQ.js → chunk-P2G476QN.js} +13 -13
  139. package/chunks/{chunk-5SM2AK65.js → chunk-PADPMMYM.js} +5 -5
  140. package/chunks/{chunk-RRKNX553.js → chunk-PDQGMSZK.js} +1 -1
  141. package/chunks/{chunk-GTUKW3I6.js → chunk-PPKZ7JOE.js} +1 -1
  142. package/chunks/{chunk-SAH4BD2J.js → chunk-PQEISIKS.js} +67 -0
  143. package/chunks/{chunk-XIRDDFRS.js → chunk-PZ66FRIC.js} +2644 -2296
  144. package/chunks/{chunk-H3HZ4AWW.js → chunk-Q2MSPKIJ.js} +1 -1
  145. package/chunks/{chunk-WEGXPP5E.js → chunk-QFCDF5PL.js} +1 -1
  146. package/chunks/{chunk-OF2DPXUS.js → chunk-QYMAKPY5.js} +119 -24
  147. package/chunks/{chunk-JVPFTDBK.js → chunk-RFIDDFAL.js} +1 -1
  148. package/chunks/chunk-RKFGE7JH.js +93 -0
  149. package/chunks/{chunk-CPPYZHBN.js → chunk-RU7BK6B3.js} +1 -1
  150. package/chunks/chunk-SEONHUS3.js +275 -0
  151. package/chunks/{chunk-DEYPMJPD.js → chunk-SMPR7SPO.js} +1 -1
  152. package/chunks/chunk-SS4MRMKE.js +3525 -0
  153. package/chunks/{chunk-BPMVPWBT.js → chunk-SS5SDCD3.js} +6 -6
  154. package/chunks/{chunk-J3CBIEDS.js → chunk-ST5MDGH3.js} +32 -15
  155. package/chunks/{chunk-J5352S3S.js → chunk-ST5V3ZOC.js} +3 -3
  156. package/chunks/{chunk-7CWEZQ6T.js → chunk-STUJ7IMZ.js} +0 -77
  157. package/chunks/{chunk-4K7NQDCG.js → chunk-T4EFG2P5.js} +18 -9
  158. package/chunks/{chunk-TWSKM647.js → chunk-T7KMERIX.js} +1 -1
  159. package/chunks/{chunk-5CMWFBML.js → chunk-TEBDFQBZ.js} +1 -1
  160. package/chunks/{chunk-EC5BONC3.js → chunk-TPI7O7HR.js} +1 -1
  161. package/chunks/{chunk-T2CRBIDJ.js → chunk-TTX2JUE6.js} +1 -1
  162. package/chunks/{chunk-VOEMVOM4.js → chunk-TVC6HQ2U.js} +2 -2
  163. package/chunks/{chunk-WXDZZFH3.js → chunk-TZBSGJ6C.js} +6 -6
  164. package/chunks/chunk-U54AYGEC.js +337 -0
  165. package/chunks/{chunk-2NNTE2ED.js → chunk-UHQFIS7N.js} +15 -0
  166. package/chunks/{chunk-76WGY6LW.js → chunk-URE3QBBB.js} +3 -3
  167. package/chunks/{chunk-KOJ6MHD5.js → chunk-UTLCH2FK.js} +1 -1
  168. package/chunks/{chunk-7DPKPBOQ.js → chunk-V2NDP3I4.js} +2 -2
  169. package/chunks/{chunk-FJWICLG7.js → chunk-V4264FEG.js} +9 -9
  170. package/chunks/{chunk-XR7OIAQF.js → chunk-V5J4J5TP.js} +2 -2
  171. package/chunks/{chunk-7UJTY5V3.js → chunk-V7EESTJV.js} +1 -1
  172. package/chunks/{chunk-Z6L3C4VF.js → chunk-VBCPNIQD.js} +39 -39
  173. package/chunks/{chunk-ATLGYSYH.js → chunk-VGIFXISB.js} +4 -4
  174. package/chunks/{chunk-X2UOOG5V.js → chunk-VQUGEVGR.js} +1 -1
  175. package/chunks/{chunk-XJS54K4A.js → chunk-VTHREBQM.js} +2 -2
  176. package/chunks/{chunk-AA7VBRBG.js → chunk-W3JH33JE.js} +8 -8
  177. package/chunks/{chunk-FPH6TXD3.js → chunk-WAOIHTJS.js} +1 -1
  178. package/chunks/{chunk-CDUN63IN.js → chunk-WGY3AVGM.js} +3 -3
  179. package/chunks/{chunk-JLGFGPZJ.js → chunk-WNPDGUJO.js} +22 -3
  180. package/chunks/{chunk-O3BUXIPM.js → chunk-WXEA74YB.js} +3 -3
  181. package/chunks/{chunk-YRLW2MSX.js → chunk-XBVNNDPK.js} +11 -4
  182. package/chunks/{chunk-VL4YX3FH.js → chunk-XF63PKEN.js} +1 -1
  183. package/chunks/{chunk-R7G7GKOX.js → chunk-XHF7WQ6B.js} +3 -3
  184. package/chunks/{chunk-3FSBMAYD.js → chunk-XQFT3QUF.js} +1 -1
  185. package/chunks/{chunk-3D6PDLNJ.js → chunk-XSG6G3G6.js} +49 -32
  186. package/chunks/{chunk-5JCZ3UKB.js → chunk-Y5S7LBOZ.js} +44 -7
  187. package/chunks/{chunk-OLS3MAXQ.js → chunk-YLSQLSH7.js} +15 -9
  188. package/chunks/{chunk-2SERYG4T.js → chunk-YTDVNSUQ.js} +1 -1
  189. package/chunks/{chunk-KPF2K55D.js → chunk-ZEYFMJQA.js} +39 -8
  190. package/chunks/{chunk-OT4YKUUV.js → chunk-ZU4UDIWX.js} +2 -2
  191. package/chunks/chunk-ZWJDJ6RU.js +2597 -0
  192. package/chunks/{chunk-R3T33BG5.js → chunk-ZYMLPEZQ.js} +3 -3
  193. package/chunks/{chunk-DID6IRGC.js → chunk-ZZMSC3RG.js} +56 -39
  194. package/chunks/{chunk-L436XFLJ.js → chunk-ZZUKP7HV.js} +1 -1
  195. package/chunks/config-utils-R6M3TA34.js +113 -0
  196. package/chunks/contextCommand-ZCAP23J6.js +106 -0
  197. package/chunks/{core-runtime-CEJRHCRF.js → core-runtime-AXB6SK5D.js} +59 -61
  198. package/chunks/{create-sub-session-RVHSWVAP.js → create-sub-session-23ITIELI.js} +3 -3
  199. package/chunks/{create-sub-session-DFZVIG56.js → create-sub-session-4QNE64MR.js} +164 -85
  200. package/chunks/{cron-create-IJGVR5R2.js → cron-create-KJ4IY6PP.js} +57 -10
  201. package/chunks/{cron-delete-4N5BI6GL.js → cron-delete-MBLQCAYY.js} +4 -4
  202. package/chunks/{cron-list-2CATIPUX.js → cron-list-DWH2PQ47.js} +4 -4
  203. package/chunks/{daemon-NAYK4XXU.js → daemon-3GNHB3M2.js} +523 -8
  204. package/chunks/{daemon-git-worktree-guard-L6ZUFKF7.js → daemon-git-worktree-guard-IVAJJWYK.js} +56 -58
  205. package/chunks/daemon-status-provider-K3SJ5C2U.js +117 -0
  206. package/chunks/daemon-trust-policy-DOR3YG62.js +112 -0
  207. package/chunks/{daemon-trust-policy-monitor-2G3EKQEU.js → daemon-trust-policy-monitor-KGGROSIV.js} +64 -66
  208. package/chunks/deferred-core-runtime-WOYLUQQ7.js +114 -0
  209. package/chunks/{display-image-6KHQNEAE.js → display-image-BE7I6ZB6.js} +5 -5
  210. package/chunks/{dist-DJBNNPLN.js → dist-4WXLCBDR.js} +1 -1
  211. package/chunks/{dist-TJUDJTCB.js → dist-5VXFRTWU.js} +280 -48
  212. package/chunks/{dist-6H6RZ5H6.js → dist-6BPYWHVD.js} +89 -65
  213. package/chunks/{dist-ZBVOXSKF.js → dist-GFN5DCBX.js} +74 -65
  214. package/chunks/{dist-SATKXKUR.js → dist-HZNT6GQS.js} +1 -1
  215. package/chunks/{dist-FVJZSIO4.js → dist-LVZCXVPF.js} +72 -20
  216. package/chunks/{dist-7CKN54NL.js → dist-N6W6E753.js} +71 -64
  217. package/chunks/{dist-4Q7NTUNB.js → dist-NSV4NBPK.js} +31 -14
  218. package/chunks/{dist-UQUFZDIY.js → dist-SWQMYP2Q.js} +18 -16
  219. package/chunks/earlyInputCapture-OHBEVO4K.js +107 -0
  220. package/chunks/{edit-ZERGX3RV.js → edit-LEQLAGPZ.js} +45 -47
  221. package/chunks/{en-6MDBWMTG.js → en-YLXBXM4Z.js} +2 -1
  222. package/chunks/{enter-worktree-UOZ6ZTP7.js → enter-worktree-35QCAAFP.js} +7 -7
  223. package/chunks/{enterPlanMode-W2RP3P5B.js → enterPlanMode-ONQN3WHE.js} +47 -49
  224. package/chunks/{environment-ZBJ23YVR.js → environment-UANTR7A4.js} +60 -62
  225. package/chunks/errors-WAK6KFBC.js +113 -0
  226. package/chunks/{exit-worktree-G2QATUCV.js → exit-worktree-XQD6D543.js} +7 -7
  227. package/chunks/exitPlanMode-UEYBG6P5.js +83 -0
  228. package/chunks/{fast-path-4MWBCEUF.js → fast-path-WUL7UZ6H.js} +7 -7
  229. package/chunks/{fast-path-settings-XMFBYFUH.js → fast-path-settings-XH426LUU.js} +3 -3
  230. package/chunks/{glob-DKTNG32L.js → glob-Y54QUWDY.js} +44 -46
  231. package/chunks/{goal-tools-CNVXMSZD.js → goal-tools-PTD3MBA7.js} +10 -8
  232. package/chunks/{grep-3NLSS32D.js → grep-5GPICQBU.js} +6 -6
  233. package/chunks/handleAutoUpdate-FP3NWNSG.js +109 -0
  234. package/chunks/i18n-INIU5X7A.js +124 -0
  235. package/chunks/{image-gen-63NN2H5N.js → image-gen-J6FDGUZP.js} +8 -10
  236. package/chunks/initializer-TYODV6GE.js +113 -0
  237. package/chunks/installationInfo-AAPKYDSZ.js +107 -0
  238. package/chunks/{keychain-token-storage-3MGFRYGM.js → keychain-token-storage-37XPR34V.js} +2 -2
  239. package/chunks/list-TUODDN6J.js +116 -0
  240. package/chunks/{list-agents-EXRSHIDJ.js → list-agents-DI3YFTDT.js} +2 -2
  241. package/chunks/{gemini-X5GQHQYF.js → llm-NSAVK5V3.js} +117 -114
  242. package/chunks/{geminiContentGenerator-UDSWXZXL.js → llm-content-generator-AY2QKXHE.js} +29 -29
  243. package/chunks/loadedSettingsAdapter-KJCLZ3C4.js +110 -0
  244. package/chunks/{loggingContentGenerator-73C7TKDK.js → loggingContentGenerator-DSFQHXIF.js} +328 -37
  245. package/chunks/{loop-wakeup-XBPB2BRO.js → loop-wakeup-XJFONSQ7.js} +5 -5
  246. package/chunks/{ls-WFONAND2.js → ls-3VAT2J7A.js} +4 -4
  247. package/chunks/{lsp-DUKPDUXN.js → lsp-5W7IRUBH.js} +2 -2
  248. package/chunks/{managed-npm-update-H2KOLQZU.js → managed-npm-update-TSWENTK5.js} +57 -59
  249. package/chunks/mcp-MWSAPFOL.js +110 -0
  250. package/chunks/{monitor-TGCMNJJH.js → monitor-RW4GWJHB.js} +44 -46
  251. package/chunks/nonInteractiveCli-JXKL343Q.js +185 -0
  252. package/chunks/{notebook-edit-YEUNZYDX.js → notebook-edit-CQNYS5OR.js} +45 -47
  253. package/chunks/{open-with-auth-4UI3KHUR.js → open-with-auth-YN3QZHVM.js} +1 -1
  254. package/chunks/{openaiContentGenerator-J7LD4VSL.js → openaiContentGenerator-J6QIF7EX.js} +26 -28
  255. package/chunks/pidfile-QOIQZFT2.js +111 -0
  256. package/chunks/process-registry-OAEG6WGC.js +662 -0
  257. package/chunks/{processUtils-ZHFC7CSL.js → processUtils-GPHNANKZ.js} +2 -2
  258. package/chunks/prompt-terminal-ledger-FOMFTYOM.js +105 -0
  259. package/chunks/{qwenContentGenerator-YEWWK3JQ.js → qwenContentGenerator-WWDXPYQI.js} +49 -51
  260. package/chunks/{qwenOAuth2-JIYAWXTW.js → qwenOAuth2-OF5WRBQT.js} +7 -9
  261. package/chunks/{read-file-ZQI3WPVK.js → read-file-FQUQHC6N.js} +13 -13
  262. package/chunks/{read-mcp-resource-7A7NFSFL.js → read-mcp-resource-XD257PGJ.js} +2 -2
  263. package/chunks/{record-artifact-CPJ4IJSD.js → record-artifact-VW23GS4F.js} +4 -4
  264. package/chunks/{report-findings-VFM5DENC.js → report-findings-AO5VYFLR.js} +9 -5
  265. package/chunks/{request-shutdown-6IW46GD7.js → request-shutdown-BCLA3JV2.js} +7 -7
  266. package/chunks/resumeHistoryUtils-NSGF3UCB.js +118 -0
  267. package/chunks/ripGrep-4CAT6SKV.js +39 -0
  268. package/chunks/{run-qwen-serve-WHWU7NZ6.js → run-qwen-serve-5X6IDZER.js} +371 -357
  269. package/chunks/{runtime-E7BSPWQP.js → runtime-HK27GMPF.js} +69 -71
  270. package/chunks/scheduled-tasks-MN2ZZ5P6.js +127 -0
  271. package/chunks/{scheduler-TJPATFOM.js → scheduler-WD4MHMO5.js} +58 -60
  272. package/chunks/{sdk-exporters-http-XXSKBD2C.js → sdk-exporters-http-TTU2CHBU.js} +2 -2
  273. package/chunks/{sdk-impl-VPNBLV7I.js → sdk-impl-UUMVYMAL.js} +11 -5
  274. package/chunks/{send-message-OXZK6USO.js → send-message-AJ4OCUBV.js} +25 -9
  275. package/chunks/serve-2XCHPPGG.js +118 -0
  276. package/chunks/{server-AXCN7QBJ.js → server-GO2N5DH7.js} +6080 -4964
  277. package/chunks/{session-HO4US3AG.js → session-IFNHTUBT.js} +112 -112
  278. package/chunks/session-pr-refresh-I3UBWMVP.js +364 -0
  279. package/chunks/{settings-B2PFJJN4.js → settings-L6N54CU6.js} +63 -65
  280. package/chunks/{shell-7XMSANI3.js → shell-4Y5LLW6N.js} +44 -46
  281. package/chunks/{skill-NL3VH562.js → skill-YOWTRAKQ.js} +68 -24
  282. package/chunks/skill-settings-ZL4JY5UE.js +118 -0
  283. package/chunks/spawnChannel-ZST6XJVJ.js +112 -0
  284. package/chunks/standalone-update-THVU3OKY.js +118 -0
  285. package/chunks/{startInteractiveUI-G2XKSCQ7.js → startInteractiveUI-XDFSHBZD.js} +3076 -2475
  286. package/chunks/{stdioHelpers-7A2EE64Z.js → stdioHelpers-AY6XCDY2.js} +3 -1
  287. package/chunks/{syntheticOutput-5AJ444QT.js → syntheticOutput-ML43GEFN.js} +3 -3
  288. package/chunks/{task-create-TY7P6UHG.js → task-create-QN4LYRSE.js} +11 -11
  289. package/chunks/{task-list-BELMPA75.js → task-list-JPLGK45U.js} +5 -5
  290. package/chunks/{task-stop-U3S3KZG2.js → task-stop-CXEH5L2D.js} +2 -2
  291. package/chunks/{task-update-O4IGDPCK.js → task-update-IWEOJFV2.js} +11 -11
  292. package/chunks/{team-create-IYBUOORE.js → team-create-OOPXCDBA.js} +44 -46
  293. package/chunks/{team-delete-YWFXX77L.js → team-delete-RZVVSGCY.js} +5 -5
  294. package/chunks/{team-plan-approval-YKU57LBM.js → team-plan-approval-DSX5EWAT.js} +44 -46
  295. package/chunks/terminal-image-renderer-KS25G33E.js +114 -0
  296. package/chunks/theme-manager-YMZNG45F.js +102 -0
  297. package/chunks/{todoWrite-435EO2CS.js → todoWrite-WDJNQEMW.js} +43 -25
  298. package/chunks/{tool-search-4Q3KASIQ.js → tool-search-J5Q6U7DN.js} +22 -22
  299. package/chunks/total-session-admission-PVN64JVV.js +114 -0
  300. package/chunks/trustedFolders-FATSC4YI.js +122 -0
  301. package/chunks/{types-WYCFCEHR.js → types-HKLPXZB3.js} +1 -3
  302. package/chunks/{update-relaunch-4DC2KKFS.js → update-relaunch-SIKHLHVR.js} +6 -6
  303. package/chunks/updateCheck-D3YG2WCD.js +118 -0
  304. package/chunks/useAutoAcceptIndicator-ILINOSAS.js +120 -0
  305. package/chunks/{validateNonInterActiveAuth-YAE4YPO3.js → validateNonInterActiveAuth-JUDQP6V4.js} +105 -105
  306. package/chunks/{version-QFP7OGWX.js → version-C63GDDWN.js} +1 -1
  307. package/chunks/{web-fetch-6T23IK6Q.js → web-fetch-FOQZMNSC.js} +16 -18
  308. package/chunks/{web-search-WBWTCZK2.js → web-search-PUJTBFUC.js} +9 -11
  309. package/chunks/{web-shell-static-A6QMUNNV.js → web-shell-static-HNB4FDOE.js} +2 -2
  310. package/chunks/{workflow-FMAA3D4R.js → workflow-Y5IPINVH.js} +128 -94
  311. package/chunks/workspace-providers-status-IJ4VHFMB.js +114 -0
  312. package/chunks/{workspace-registration-store-CMMX7EPX.js → workspace-registration-store-SMJWI2AI.js} +1 -1
  313. package/chunks/workspace-registry-BTGZIMPK.js +123 -0
  314. package/chunks/workspace-service-SIN67ITC.js +126 -0
  315. package/chunks/workspace-skills-status-F3RKCUIX.js +113 -0
  316. package/chunks/{workspace-trust-reconciler-PJDQUTJL.js → workspace-trust-reconciler-PLIDLJZX.js} +72 -72
  317. package/chunks/write-file-PAIGB33C.js +88 -0
  318. package/chunks/{zh-TW-MV4FWFB6.js → zh-TW-RPTMRTHG.js} +2 -1
  319. package/chunks/{zh-X3WGU6SI.js → zh-UNY63FR3.js} +2 -1
  320. package/chunks/{zoom-image-WVYVFRXF.js → zoom-image-LYQD7BQA.js} +13 -13
  321. package/cli.js +16 -16
  322. package/locales/en.js +2 -0
  323. package/locales/zh-TW.js +2 -0
  324. package/locales/zh.js +2 -0
  325. package/package.json +3 -3
  326. package/web-shell/assets/{abnfDiagram-VCTEODGH-d-8xa8uz.js → abnfDiagram-VCTEODGH-TRCMSA_6.js} +1 -1
  327. package/web-shell/assets/{arc-BhB7CrGK.js → arc-D9Uls5b3.js} +1 -1
  328. package/web-shell/assets/{architectureDiagram-5GKGNRK7-BDCd_IcJ.js → architectureDiagram-5GKGNRK7-Bwb8jPXg.js} +1 -1
  329. package/web-shell/assets/{blockDiagram-NRAW4CY4-C-AHu6mi.js → blockDiagram-NRAW4CY4-DHj71TSX.js} +1 -1
  330. package/web-shell/assets/{c4Diagram-UCG6FXSJ-CFjQt0vl.js → c4Diagram-UCG6FXSJ-uKBBdbyr.js} +1 -1
  331. package/web-shell/assets/channel-CXjVLaBa.js +1 -0
  332. package/web-shell/assets/{chunk-2Q5K7J3B-DRjwqaDq.js → chunk-2Q5K7J3B-BZd0Phrl.js} +1 -1
  333. package/web-shell/assets/{chunk-5VM5RSS4-eHM9noJE.js → chunk-5VM5RSS4-7KNeNBqN.js} +1 -1
  334. package/web-shell/assets/{chunk-F27PBJKO-CcSWUYn1.js → chunk-F27PBJKO-BeboS7Fi.js} +1 -1
  335. package/web-shell/assets/{chunk-G27WJ6UU-DNr-RF5S.js → chunk-G27WJ6UU-RV3JONoj.js} +1 -1
  336. package/web-shell/assets/{chunk-JWPE2WC7-rVJHoNF8.js → chunk-JWPE2WC7-Yw9FCFsP.js} +1 -1
  337. package/web-shell/assets/{chunk-LCL6LL3I-B2aX0Gzy.js → chunk-LCL6LL3I-GIMnydDe.js} +1 -1
  338. package/web-shell/assets/{chunk-POPQ4Y6H-DVp07n32.js → chunk-POPQ4Y6H-Cfrux7bL.js} +1 -1
  339. package/web-shell/assets/{chunk-SVP7TREG-C6QB_KUr.js → chunk-SVP7TREG-BlvIN0CO.js} +1 -1
  340. package/web-shell/assets/{chunk-XXDRQBXY-CLVxDNCy.js → chunk-XXDRQBXY-DMs7Rr4t.js} +1 -1
  341. package/web-shell/assets/classDiagram-DTDB5LWJ-DANEijO3.js +1 -0
  342. package/web-shell/assets/classDiagram-v2-JRS7N3AN-DANEijO3.js +1 -0
  343. package/web-shell/assets/{cose-bilkent-JH36ORCC-B_aKX3A3.js → cose-bilkent-JH36ORCC-DNGqTNwI.js} +1 -1
  344. package/web-shell/assets/{cynefin-OW5HDTMX-BBw2pPUa.js → cynefin-OW5HDTMX-CojMpaoH.js} +1 -1
  345. package/web-shell/assets/{cynefinDiagram-5FMLGOSQ-WWPiBTwk.js → cynefinDiagram-5FMLGOSQ-DF07YXGo.js} +1 -1
  346. package/web-shell/assets/{dagre-3AP2YEHR-CPtIdka-.js → dagre-3AP2YEHR-17-4WtCH.js} +1 -1
  347. package/web-shell/assets/{diagram-S7CK7UJ4-Dj5og1Xi.js → diagram-S7CK7UJ4-G3Wuyz9m.js} +1 -1
  348. package/web-shell/assets/{diagram-UQ7AKVKN-CC_x70YC.js → diagram-UQ7AKVKN-nyWIKZ8P.js} +1 -1
  349. package/web-shell/assets/{diagram-VSXAHHWV-rXMfsO4n.js → diagram-VSXAHHWV-tKHhmYSC.js} +1 -1
  350. package/web-shell/assets/{diagram-VX7I27RA-DEmLYQbh.js → diagram-VX7I27RA-CpDf1hYk.js} +1 -1
  351. package/web-shell/assets/{diagram-Z3DM3KII-B0ys6Vxx.js → diagram-Z3DM3KII-Cah2IFXG.js} +1 -1
  352. package/web-shell/assets/{ebnfDiagram-PWID7BFC-Bq6y6lKH.js → ebnfDiagram-PWID7BFC-DNaCkgxy.js} +1 -1
  353. package/web-shell/assets/{erDiagram-SSCWMZ5O-l69JeBZ4.js → erDiagram-SSCWMZ5O-CAdRgcf1.js} +1 -1
  354. package/web-shell/assets/{flowDiagram-A5DVABFB-Cm-EzGY4.js → flowDiagram-A5DVABFB-CMUJAShL.js} +1 -1
  355. package/web-shell/assets/{ganttDiagram-EL5Y4UJY-BRS9ZOp7.js → ganttDiagram-EL5Y4UJY-o-_MUNey.js} +1 -1
  356. package/web-shell/assets/{gitGraphDiagram-WWUBYQGX-DAMRKgLk.js → gitGraphDiagram-WWUBYQGX-_aG-2Z7O.js} +1 -1
  357. package/web-shell/assets/{index-Bncx8E8M.js → index-BK_NKxiJ.js} +1 -1
  358. package/web-shell/assets/index-Ci-z4zWY.js +1913 -0
  359. package/web-shell/assets/index-LDlXZRHA.css +36 -0
  360. package/web-shell/assets/{infoDiagram-RXCK75RN-DasffaZp.js → infoDiagram-RXCK75RN-qJPeZbGP.js} +1 -1
  361. package/web-shell/assets/{ishikawaDiagram-5VMMS53U-CmRUt3C-.js → ishikawaDiagram-5VMMS53U-7Om4vNo1.js} +1 -1
  362. package/web-shell/assets/{journeyDiagram-EYS64GPL-DzhE_c1Z.js → journeyDiagram-EYS64GPL-BNtXqmBW.js} +1 -1
  363. package/web-shell/assets/{kanban-definition-3QL26DDD-BH5b6nn3.js → kanban-definition-3QL26DDD-COgFec8P.js} +1 -1
  364. package/web-shell/assets/{layout-BxoLK-LY.js → layout-B9n81PC9.js} +1 -1
  365. package/web-shell/assets/{linear-CqDPvVI7.js → linear-Bb6nXZQq.js} +1 -1
  366. package/web-shell/assets/{mermaid.core-DBoN4plo.js → mermaid.core-Cgrm3JVT.js} +6 -6
  367. package/web-shell/assets/{mindmap-definition-FBJOCRG2-DJJtXPEM.js → mindmap-definition-FBJOCRG2-TKwLTjnG.js} +1 -1
  368. package/web-shell/assets/{pegDiagram-XKGWAZYB-DmgPXP5l.js → pegDiagram-XKGWAZYB-BJPuvlpi.js} +1 -1
  369. package/web-shell/assets/{pieDiagram-E7YTZNPT-1ezjzcI5.js → pieDiagram-E7YTZNPT-D01VkNsW.js} +1 -1
  370. package/web-shell/assets/{quadrantDiagram-AXDQQJYC-ChKARz3k.js → quadrantDiagram-AXDQQJYC-C4hHsiv-.js} +1 -1
  371. package/web-shell/assets/{railroadDiagram-O6MQD6OU-k7mNB_QT.js → railroadDiagram-O6MQD6OU-CuEO4xK2.js} +1 -1
  372. package/web-shell/assets/{requirementDiagram-EFPCY7ZU-B0XFsii0.js → requirementDiagram-EFPCY7ZU-D5J_vIo5.js} +1 -1
  373. package/web-shell/assets/{sankeyDiagram-P5KCCOFB-repJ2Ukk.js → sankeyDiagram-P5KCCOFB-DQKY223V.js} +1 -1
  374. package/web-shell/assets/{sequenceDiagram-WJ2MYXX4-D0gUSKGu.js → sequenceDiagram-WJ2MYXX4-D27YV_cm.js} +1 -1
  375. package/web-shell/assets/{sizeCapture-X5ZJPWSS-CE463F74.js → sizeCapture-X5ZJPWSS-TJg8UcwV.js} +1 -1
  376. package/web-shell/assets/{stateDiagram-HBIQ2CUA-003zYtJa.js → stateDiagram-HBIQ2CUA-CmnPzUIx.js} +1 -1
  377. package/web-shell/assets/stateDiagram-v2-4QOOHH4V-DNKPyrDc.js +1 -0
  378. package/web-shell/assets/{swimlanes-XN3QIQJK-DBj8MFpu.js → swimlanes-XN3QIQJK-ByeP3_Nu.js} +1 -1
  379. package/web-shell/assets/swimlanesDiagram-VK2B7HYN-ZL1HPC6w.js +8 -0
  380. package/web-shell/assets/{timeline-definition-24CTP7MA-D2aCh4a9.js → timeline-definition-24CTP7MA-BsFA5juR.js} +1 -1
  381. package/web-shell/assets/{vennDiagram-4TSXK5OY-BHMfWBpl.js → vennDiagram-4TSXK5OY-DREP2ECo.js} +1 -1
  382. package/web-shell/assets/{wardleyDiagram-VM6X3IG4-RdHAj66j.js → wardleyDiagram-VM6X3IG4-iyd9lKi2.js} +1 -1
  383. package/web-shell/assets/{xychartDiagram-S5SC5T6Z-BgJWOvq0.js → xychartDiagram-S5SC5T6Z-CVr1_j9q.js} +1 -1
  384. package/web-shell/index.html +3 -3
  385. package/chunks/MaxSizedBox-BFVLZP2E.js +0 -112
  386. package/chunks/agent-headless-UCBCS4V4.js +0 -87
  387. package/chunks/bridge-FRNYLYY7.js +0 -119
  388. package/chunks/channel-settings-store-IV4KDL7N.js +0 -117
  389. package/chunks/chunk-I6VVOZDK.js +0 -202
  390. package/chunks/chunk-JS73NNWF.js +0 -30
  391. package/chunks/chunk-K2OJUPOE.js +0 -78
  392. package/chunks/chunk-P3QQPMQA.js +0 -19
  393. package/chunks/chunk-SDVF6A42.js +0 -945
  394. package/chunks/chunk-VGHZT6JR.js +0 -51
  395. package/chunks/config-utils-PMX4QZ5Y.js +0 -113
  396. package/chunks/contextCommand-NZRLVAFC.js +0 -108
  397. package/chunks/daemon-status-provider-FTTYZEKN.js +0 -118
  398. package/chunks/daemon-trust-policy-WMGFPA3Z.js +0 -114
  399. package/chunks/deferred-core-runtime-BUFEFYNA.js +0 -116
  400. package/chunks/earlyInputCapture-ROPLMXA7.js +0 -109
  401. package/chunks/errors-U5KNAADB.js +0 -115
  402. package/chunks/exitPlanMode-VFJ5R5DD.js +0 -85
  403. package/chunks/handleAutoUpdate-W4BUYFT7.js +0 -111
  404. package/chunks/i18n-KX7FEKJJ.js +0 -126
  405. package/chunks/initializer-SNVVLS7Y.js +0 -115
  406. package/chunks/installationInfo-D4XGQNHJ.js +0 -109
  407. package/chunks/list-WYECMLXZ.js +0 -118
  408. package/chunks/loadedSettingsAdapter-5WZBXBCR.js +0 -112
  409. package/chunks/mcp-CBWAROY3.js +0 -112
  410. package/chunks/nonInteractiveCli-O232UUV7.js +0 -185
  411. package/chunks/pidfile-MSPQ255Y.js +0 -113
  412. package/chunks/process-registry-PMJOA5CO.js +0 -172
  413. package/chunks/prompt-terminal-ledger-YPGMNDXT.js +0 -107
  414. package/chunks/resumeHistoryUtils-35D4KAVT.js +0 -120
  415. package/chunks/ripGrep-46N4FLOS.js +0 -39
  416. package/chunks/serve-WQ54UIYG.js +0 -120
  417. package/chunks/skill-settings-SKMN5YXC.js +0 -120
  418. package/chunks/spawnChannel-NE43EEO3.js +0 -113
  419. package/chunks/standalone-update-XOCWGXAH.js +0 -120
  420. package/chunks/terminal-image-renderer-NREKYTAD.js +0 -116
  421. package/chunks/theme-manager-IJS6OICX.js +0 -104
  422. package/chunks/total-session-admission-L5RPEFZ2.js +0 -114
  423. package/chunks/trustedFolders-OILZCHRD.js +0 -124
  424. package/chunks/updateCheck-AK4COHNK.js +0 -120
  425. package/chunks/useAutoAcceptIndicator-O2N2Q6KG.js +0 -122
  426. package/chunks/workspace-providers-status-OCFEWIPQ.js +0 -116
  427. package/chunks/workspace-registry-WJLZPRTG.js +0 -123
  428. package/chunks/workspace-service-5ZOBMMIB.js +0 -131
  429. package/chunks/workspace-skills-status-B6NJZD4B.js +0 -115
  430. package/chunks/write-file-B2RNX6SU.js +0 -90
  431. package/web-shell/assets/channel-CU-Zyv0r.js +0 -1
  432. package/web-shell/assets/classDiagram-DTDB5LWJ-C0J2_LKs.js +0 -1
  433. package/web-shell/assets/classDiagram-v2-JRS7N3AN-C0J2_LKs.js +0 -1
  434. package/web-shell/assets/index-C-XlQn24.css +0 -5
  435. package/web-shell/assets/index-gdvMN4J1.js +0 -1860
  436. package/web-shell/assets/stateDiagram-v2-4QOOHH4V-2uACDdJN.js +0 -1
  437. package/web-shell/assets/swimlanesDiagram-VK2B7HYN-C4JJkavU.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-2HYKTO7V.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-5SM2AK65.js";
20
+ } from "./chunk-PADPMMYM.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-GTUZ3R6I.js";
27
- import {
28
- collectContextData,
29
- formatContextUsageText
30
- } from "./chunk-WZ3QKPMQ.js";
31
- import {
32
- recomputeMcpGating
33
- } from "./chunk-JLU3FPQR.js";
29
+ } from "./chunk-DJEZ55D4.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-HPECDZ6X.js";
37
+ } from "./chunk-DJPASAUV.js";
38
+ import "./chunk-NYX53SV4.js";
39
+ import {
40
+ collectContextData,
41
+ formatContextUsageText
42
+ } from "./chunk-6X7EU5TI.js";
42
43
  import {
43
44
  getCommandSubcommandNames
44
- } from "./chunk-VBF4KZRQ.js";
45
+ } from "./chunk-4TT3IVGA.js";
45
46
  import {
46
47
  getEffectiveSupportedModes
47
- } from "./chunk-CDUN63IN.js";
48
- import "./chunk-2FN2HNTI.js";
48
+ } from "./chunk-WGY3AVGM.js";
49
+ import "./chunk-CFJY4DGX.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-R3T33BG5.js";
56
- import "./chunk-WEGXPP5E.js";
55
+ import "./chunk-ZYMLPEZQ.js";
56
+ import "./chunk-YAF2MQZ6.js";
57
+ import "./chunk-QFCDF5PL.js";
57
58
  import {
58
59
  startNonInteractiveOpenAILogHousekeeping
59
- } from "./chunk-CZFQ62RM.js";
60
+ } from "./chunk-LHBUKJG2.js";
60
61
  import "./chunk-KW7NOTN6.js";
62
+ import "./chunk-4VPCTGH6.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-FCSWZAS3.js";
68
- import "./chunk-TR7G7XFQ.js";
69
- import "./chunk-3WBMPR3S.js";
70
- import "./chunk-YAF2MQZ6.js";
70
+ import "./chunk-HP5LR5HL.js";
71
+ import "./chunk-MPNBVAEU.js";
72
+ import "./chunk-MSBO7X2W.js";
71
73
  import {
72
74
  computeCpuPercent
73
75
  } from "./chunk-LBOVL47Y.js";
74
- import "./chunk-IOGKXPL3.js";
75
- import "./chunk-6H67XLET.js";
76
76
  import {
77
77
  GENERATION_MAX_PROMPT_BYTES,
78
78
  GENERATION_TIMEOUT_MS,
@@ -85,9 +85,7 @@ import {
85
85
  createWorkspaceMemoryExtractionErrorLogger,
86
86
  executeGeneration,
87
87
  formatWorkspaceMemoryForgetSummary,
88
- isCompatibleLiveSessionSource,
89
88
  isValidServerName,
90
- normalizeChannelDeliveryText,
91
89
  projectAcpToolResultUpdate,
92
90
  redactMcpServerSecrets,
93
91
  replayTranscriptRecordPage,
@@ -95,7 +93,7 @@ import {
95
93
  shouldSuppressRememberErrorDetails,
96
94
  workspaceMemoryFailureCode,
97
95
  workspaceMemoryFailureDiagnostics
98
- } from "./chunk-ALTQLFEG.js";
96
+ } from "./chunk-EQSBPBZ3.js";
99
97
  import {
100
98
  BaseEmitter,
101
99
  HistoryReplayer,
@@ -106,48 +104,58 @@ import {
106
104
  hasFullSessionContext,
107
105
  observeAcpToolResultProjection,
108
106
  observeAcpToolResultWire
109
- } from "./chunk-J3CBIEDS.js";
110
- import "./chunk-4TPAG3O7.js";
107
+ } from "./chunk-ST5MDGH3.js";
108
+ import "./chunk-BFPESSTR.js";
111
109
  import "./chunk-E7REAOTN.js";
112
- import "./chunk-L436XFLJ.js";
110
+ import "./chunk-ZZUKP7HV.js";
113
111
  import "./chunk-2MIN6GRR.js";
114
112
  import "./chunk-QHTIBUWB.js";
115
113
  import "./chunk-TXASDT2M.js";
116
114
  import {
117
- buildToolWriteOriginMeta
118
- } from "./chunk-VGHZT6JR.js";
115
+ isCompatibleLiveSessionSource
116
+ } from "./chunk-36LGBEM6.js";
117
+ import "./chunk-4VQBQLIZ.js";
118
+ import {
119
+ DAEMON_OWNED_STANDALONE_CREATION_KEY,
120
+ SESSION_SOURCE_META_KEY,
121
+ isReservedStandaloneSessionSourceType,
122
+ parseSessionSource
123
+ } from "./chunk-2TNL5KPM.js";
124
+ import {
125
+ buildToolWriteOriginMeta,
126
+ getConversationDirectoryName,
127
+ isSameConversationPath
128
+ } from "./chunk-U54AYGEC.js";
129
+ import "./chunk-RXFQM6FQ.js";
130
+ import "./chunk-UXEO7E3V.js";
131
+ import {
132
+ normalizeChannelDeliveryText
133
+ } from "./chunk-4CMJKUND.js";
119
134
  import {
120
135
  normalizeSessionIdForLookup,
121
136
  parseCallerSuppliedSessionId
122
137
  } from "./chunk-ZEZKIS2K.js";
123
- import "./chunk-RXFQM6FQ.js";
124
- import "./chunk-UXEO7E3V.js";
125
138
  import {
126
139
  PERMISSION_RULE_TYPES,
127
140
  PermissionRulesValidationError,
128
141
  buildPermissionSettings,
129
142
  normalizePermissionRules,
130
143
  readPermissionRuleSet
131
- } from "./chunk-7UJTY5V3.js";
144
+ } from "./chunk-V7EESTJV.js";
132
145
  import {
133
146
  MAX_AUDIO_BYTES,
134
147
  sanitizeVoiceErrorMessage,
135
148
  transcribeVoiceAudio
136
- } from "./chunk-76WGY6LW.js";
149
+ } from "./chunk-URE3QBBB.js";
137
150
  import {
138
151
  readVoiceModel
139
- } from "./chunk-2MHGD7EE.js";
140
- import "./chunk-2SERYG4T.js";
141
- import "./chunk-JS73NNWF.js";
142
- import "./chunk-ATLGYSYH.js";
143
- import "./chunk-VOEMVOM4.js";
144
- import {
145
- SESSION_SOURCE_META_KEY,
146
- parseSessionSource
147
- } from "./chunk-AKQA3WCH.js";
152
+ } from "./chunk-A3LWD5MK.js";
153
+ import "./chunk-YTDVNSUQ.js";
154
+ import "./chunk-VGIFXISB.js";
155
+ import "./chunk-TVC6HQ2U.js";
156
+ import "./chunk-SS4MRMKE.js";
148
157
  import "./chunk-7U5G6JXI.js";
149
158
  import "./chunk-WCCLLK7X.js";
150
- import "./chunk-OCPBI7J5.js";
151
159
  import {
152
160
  REASONING_EFFORT_DEFAULT,
153
161
  REASONING_EFFORT_NAMES,
@@ -155,7 +163,7 @@ import {
155
163
  buildModelReasoningConfigOption,
156
164
  buildModelReasoningConfigPreview,
157
165
  getModelConfiguration
158
- } from "./chunk-4K7NQDCG.js";
166
+ } from "./chunk-T4EFG2P5.js";
159
167
  import {
160
168
  ACP_ROUTE_ID_PREFIX,
161
169
  buildAcpModelOptions,
@@ -164,26 +172,26 @@ import {
164
172
  parseAcpModelOption,
165
173
  resolveAcpModelOption,
166
174
  sanitizeProviderBaseUrl
167
- } from "./chunk-HABT2Z7R.js";
175
+ } from "./chunk-OU5APVWO.js";
168
176
  import {
169
177
  mapSkillConfigToStatus
170
- } from "./chunk-BGXZBI5B.js";
178
+ } from "./chunk-N4X7G4J2.js";
171
179
  import {
172
180
  resolveSkillSettings
173
- } from "./chunk-Z4X5MTRT.js";
174
- import "./chunk-F7M6ZFGU.js";
175
- import "./chunk-KQYW2GB5.js";
181
+ } from "./chunk-HCOBAG2L.js";
182
+ import "./chunk-73RM4POK.js";
183
+ import "./chunk-6ZPDLGHN.js";
176
184
  import "./chunk-57OAHC2Y.js";
177
- import "./chunk-5JCZ3UKB.js";
178
- import "./chunk-7JPW6IYH.js";
179
- import "./chunk-IKN3IUJP.js";
185
+ import "./chunk-Y5S7LBOZ.js";
186
+ import "./chunk-3XKLXHGK.js";
187
+ import "./chunk-HVC3PNVC.js";
180
188
  import "./chunk-V6WHFGST.js";
181
189
  import {
182
190
  createLoadedSettingsAdapter
183
- } from "./chunk-AWFZDYSD.js";
191
+ } from "./chunk-7T52W4SW.js";
184
192
  import {
185
193
  ndJsonStream
186
- } from "./chunk-VYWCFWI5.js";
194
+ } from "./chunk-H72BQNM3.js";
187
195
  import {
188
196
  ACP_PREFLIGHT_KINDS,
189
197
  IDLE_HOOK_EVENTS,
@@ -191,8 +199,8 @@ import {
191
199
  SERVE_STATUS_EXT_METHODS,
192
200
  STATUS_SCHEMA_VERSION,
193
201
  mapDomainErrorToErrorKind
194
- } from "./chunk-XUX6O2ZT.js";
195
- import "./chunk-MZS7GEC7.js";
202
+ } from "./chunk-KID24ZFN.js";
203
+ import "./chunk-FTF2YIZ5.js";
196
204
  import {
197
205
  ACTIVE_WORK_CLOSE_IF_UNHELD_PARAM,
198
206
  ACTIVE_WORK_HEARTBEAT_META_KEY,
@@ -232,15 +240,15 @@ import {
232
240
  import {
233
241
  NOT_CURRENTLY_GENERATING_CANCEL_MESSAGE,
234
242
  isNotCurrentlyGeneratingCancelError
235
- } from "./chunk-624NHDGB.js";
243
+ } from "./chunk-ERFDKH32.js";
236
244
  import "./chunk-6PLDPT2C.js";
237
245
  import "./chunk-FYJ7W2PI.js";
238
- import "./chunk-7CWEZQ6T.js";
239
- import "./chunk-JVPFTDBK.js";
246
+ import "./chunk-STUJ7IMZ.js";
240
247
  import "./chunk-GYTKQYDB.js";
248
+ import "./chunk-RFIDDFAL.js";
241
249
  import "./chunk-ALMR3E6Q.js";
250
+ import "./chunk-RKFGE7JH.js";
242
251
  import "./chunk-UDG5EZJI.js";
243
- import "./chunk-M5GB774H.js";
244
252
  import {
245
253
  EXTERNAL_TOOL_GUARD_READY_META_KEY,
246
254
  EXTERNAL_TOOL_GUARD_REQUIRED_VALUE,
@@ -250,11 +258,12 @@ import {
250
258
  SHELL_EXECUTING_TOOL_NAMES,
251
259
  isValidExternalToolGuardDenialReason
252
260
  } from "./chunk-3VUENPWF.js";
253
- import "./chunk-ELY4QVIB.js";
261
+ import "./chunk-M5GB774H.js";
262
+ import "./chunk-7EQQR46F.js";
254
263
  import {
255
264
  ACP_EVENT_LOOP_STALL_RESTART_MS,
256
265
  CHANNEL_PROMPT_META_KEY
257
- } from "./chunk-E55H6BZ7.js";
266
+ } from "./chunk-ICURCKIU.js";
258
267
  import {
259
268
  AgentSideConnection,
260
269
  PROTOCOL_VERSION,
@@ -263,7 +272,7 @@ import {
263
272
  import {
264
273
  assembleMcpServers,
265
274
  loadMcpApprovals
266
- } from "./chunk-3JKUX4PB.js";
275
+ } from "./chunk-7VMIMAVB.js";
267
276
  import {
268
277
  getOutputLanguageFilePath,
269
278
  getPersistScopeForModelSelection,
@@ -272,9 +281,9 @@ import {
272
281
  resolveOutputLanguageOrPreserveAuto,
273
282
  updateOutputLanguageFile,
274
283
  writeOutputLanguageAndRegisterPath
275
- } from "./chunk-TDQBVEPK.js";
284
+ } from "./chunk-AIAOIFY4.js";
276
285
  import "./chunk-RKUWKYED.js";
277
- import "./chunk-KPF2K55D.js";
286
+ import "./chunk-ZEYFMJQA.js";
278
287
  import "./chunk-GOXKNSDZ.js";
279
288
  import {
280
289
  getSystemDefaultsPath,
@@ -283,7 +292,7 @@ import {
283
292
  import {
284
293
  getCurrentLanguage,
285
294
  setLanguageAsync
286
- } from "./chunk-W2WRNJKX.js";
295
+ } from "./chunk-CLWO3B77.js";
287
296
  import {
288
297
  SUPPORTED_LANGUAGES
289
298
  } from "./chunk-5EJZE3FP.js";
@@ -291,19 +300,19 @@ import {
291
300
  findEnvFiles,
292
301
  preResolveHomeEnvOverrides,
293
302
  reloadEnvironment
294
- } from "./chunk-R7G7GKOX.js";
303
+ } from "./chunk-XHF7WQ6B.js";
295
304
  import {
296
305
  ENV_ACP_REPEATED_TOOL_FAILURE_GUARD,
297
306
  QWEN_CODE_SERVE_ENV
298
- } from "./chunk-5PA6UEYA.js";
299
- import "./chunk-7DPKPBOQ.js";
300
- import "./chunk-H3HZ4AWW.js";
307
+ } from "./chunk-MZCJWS5Y.js";
308
+ import "./chunk-V2NDP3I4.js";
309
+ import "./chunk-Q2MSPKIJ.js";
301
310
  import "./chunk-W3N5XAZ6.js";
302
311
  import {
303
312
  isFolderTrustEnabled,
304
313
  isWorkspaceTrusted,
305
314
  loadTrustedFolders
306
- } from "./chunk-ZGWDHSUM.js";
315
+ } from "./chunk-MF7HCQWZ.js";
307
316
  import "./chunk-NPQ5ZKRP.js";
308
317
  import "./chunk-MR3PXB6E.js";
309
318
  import {
@@ -333,30 +342,30 @@ import {
333
342
  resolveBaseUrl,
334
343
  runManagedRememberByAgent,
335
344
  subagentGenerator
336
- } from "./chunk-5URK47RN.js";
337
- import "./chunk-JSY43GMI.js";
345
+ } from "./chunk-NV55WWD6.js";
346
+ import "./chunk-2OUD5T67.js";
338
347
  import "./chunk-XFSFZCM5.js";
339
348
  import "./chunk-2EAZ43JQ.js";
340
349
  import "./chunk-NF5J2WFA.js";
341
350
  import {
342
351
  CreateSubSessionTool
343
- } from "./chunk-LRKMQPMD.js";
352
+ } from "./chunk-CQH5KTKC.js";
344
353
  import "./chunk-LJZSMWOH.js";
345
- import "./chunk-AP7WZONS.js";
346
- import "./chunk-JLGFGPZJ.js";
347
- import "./chunk-SKNVVYIJ.js";
354
+ import "./chunk-NMOD2FXQ.js";
355
+ import "./chunk-WNPDGUJO.js";
356
+ import "./chunk-K5KXUXWC.js";
348
357
  import {
349
358
  restoreWorktreeContext
350
- } from "./chunk-UCSV2IZW.js";
351
- import "./chunk-NEZZHGEI.js";
352
- import "./chunk-3FSBMAYD.js";
353
- import "./chunk-XJS54K4A.js";
359
+ } from "./chunk-62GQFYID.js";
360
+ import "./chunk-AYFA7MZV.js";
361
+ import "./chunk-XQFT3QUF.js";
362
+ import "./chunk-VTHREBQM.js";
354
363
  import "./chunk-ZPJWUGCS.js";
355
364
  import {
356
365
  clearCachedCredentialFile,
357
366
  qwenOAuth2Events
358
- } from "./chunk-ZWKGZB2K.js";
359
- import "./chunk-J5352S3S.js";
367
+ } from "./chunk-3JXM2CVW.js";
368
+ import "./chunk-ST5V3ZOC.js";
360
369
  import {
361
370
  APPROVAL_MODE_INFO,
362
371
  BranchPointInvalidError,
@@ -374,7 +383,6 @@ import {
374
383
  MessageDisplayDispatcher,
375
384
  PLAN_MODE_ENTRY_SIBLING_SKIP_MESSAGE,
376
385
  POOLED_TRANSPORTS_DEFAULT,
377
- SESSION_ARTIFACT_PERSISTENCE_VERSION,
378
386
  SESSION_TITLE_MAX_LENGTH,
379
387
  SESSION_TRANSCRIPT_MAX_LIMIT,
380
388
  SESSION_TRANSCRIPT_MAX_PAGE_BYTES,
@@ -391,6 +399,7 @@ import {
391
399
  TURN_RESULT_TEXT_MAX_CHARS,
392
400
  abortGoalForStopHookCap,
393
401
  acquireSleepInhibitor,
402
+ ambientGoalToolResultProvenance,
394
403
  applyAutoModeDecision,
395
404
  approxBase64Bytes,
396
405
  bridgeToolResultImages,
@@ -448,8 +457,6 @@ import {
448
457
  mcpServerRequiresOAuth,
449
458
  needsConfirmation,
450
459
  normalizeDerivedBranchTitle,
451
- normalizeEventPayload,
452
- normalizeSnapshotPayload,
453
460
  normalizeTurnResultError,
454
461
  observeToolResultBoundary,
455
462
  persistPermissionOutcome,
@@ -473,43 +480,55 @@ import {
473
480
  updateSetting,
474
481
  validatePlanModeShellApproval,
475
482
  validatePlanModeShellContext
476
- } from "./chunk-XIRDDFRS.js";
483
+ } from "./chunk-PZ66FRIC.js";
477
484
  import "./chunk-GOFAQQZA.js";
478
485
  import "./chunk-5M6IDOMF.js";
479
486
  import "./chunk-TWPJO254.js";
480
487
  import {
481
488
  external_exports
482
489
  } from "./chunk-CQ35AJ4Z.js";
483
- import "./chunk-3UZCLCXR.js";
484
- import "./chunk-TOF4UZHH.js";
485
- import "./chunk-O3BUXIPM.js";
486
- import "./chunk-ZLTEQYNC.js";
490
+ import "./chunk-EKSCLBBF.js";
491
+ import "./chunk-LUEHOUHM.js";
492
+ import "./chunk-WXEA74YB.js";
493
+ import "./chunk-42IDLQWS.js";
487
494
  import {
488
495
  parsePositiveIntegerEnv
489
496
  } from "./chunk-6PVPNMXU.js";
490
497
  import {
491
498
  RUNTIME_SNAPSHOT_PREFIX
492
- } from "./chunk-AYVIGUUK.js";
499
+ } from "./chunk-JB4JIVTJ.js";
500
+ import {
501
+ SESSION_ARTIFACT_PERSISTENCE_VERSION,
502
+ normalizeEventPayload,
503
+ normalizeSnapshotPayload
504
+ } from "./chunk-DJBQCO2E.js";
493
505
  import "./chunk-IRH27ZC2.js";
494
506
  import "./chunk-QHWCP53L.js";
495
- import "./chunk-JECO75XD.js";
507
+ import "./chunk-D5LUXLUH.js";
496
508
  import {
497
509
  promptIdContext,
498
510
  todoWorkChainContext
499
511
  } from "./chunk-O6GEWCJA.js";
500
512
  import "./chunk-T26EAKDL.js";
501
- import "./chunk-LJP2BBMK.js";
513
+ import "./chunk-2SXSLSQE.js";
502
514
  import "./chunk-CPBF7KYF.js";
503
- import "./chunk-I6DY753S.js";
515
+ import {
516
+ AgentOutputMessageCapture,
517
+ addAgentInputMessageAttributes,
518
+ addToolArgumentsAttributes,
519
+ addToolCallResultAttributes,
520
+ registerAcpEventLoopLagGauge,
521
+ startEventLoopLagMonitor
522
+ } from "./chunk-KJO2LBUK.js";
504
523
  import {
505
524
  HookEventName,
506
525
  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";
526
+ } from "./chunk-TTX2JUE6.js";
527
+ import "./chunk-4K7KNVWH.js";
528
+ import "./chunk-SMPR7SPO.js";
529
+ import "./chunk-JWALNCLT.js";
530
+ import "./chunk-NIFYWDYN.js";
531
+ import "./chunk-C2X7KY45.js";
513
532
  import {
514
533
  GoalConflictError,
515
534
  GoalInvalidTransitionError,
@@ -518,50 +537,41 @@ import {
518
537
  goalTurnContext,
519
538
  parseGoalControlRequest,
520
539
  parseGoalSnapshotV2,
521
- parseGoalStateCause,
540
+ parseGoalStateCause
541
+ } from "./chunk-JHYH6PYQ.js";
542
+ import {
522
543
  wrapUserPromptSubmitContext
523
- } from "./chunk-FN5C6C7G.js";
544
+ } from "./chunk-7J6OTNGO.js";
524
545
  import {
525
546
  APPROVAL_MODES
526
- } from "./chunk-XR7OIAQF.js";
547
+ } from "./chunk-V5J4J5TP.js";
527
548
  import "./chunk-MLXTMF7H.js";
528
549
  import "./chunk-NAVJD2PQ.js";
529
- import "./chunk-FVDQ5E67.js";
530
- import "./chunk-V3GINY6K.js";
550
+ import "./chunk-B466ZSHZ.js";
551
+ import "./chunk-4QHPPXK2.js";
531
552
  import "./chunk-QHMLYMMS.js";
532
- import {
533
- AgentOutputMessageCapture,
534
- addAgentInputMessageAttributes,
535
- addToolArgumentsAttributes,
536
- addToolCallResultAttributes,
537
- registerAcpEventLoopLagGauge,
538
- startEventLoopLagMonitor
539
- } from "./chunk-SDVF6A42.js";
540
- import "./chunk-P3QQPMQA.js";
541
553
  import {
542
554
  addDaemonRequestAttribute,
543
555
  extractDaemonTraceContext,
544
556
  withDaemonSpan
545
- } from "./chunk-ILPXSKGQ.js";
557
+ } from "./chunk-3WK3QDNV.js";
546
558
  import "./chunk-VNOVK4I7.js";
547
- import "./chunk-SAH4BD2J.js";
548
- import "./chunk-ZKAZP2ZG.js";
559
+ import "./chunk-PQEISIKS.js";
560
+ import "./chunk-EB6QRGHM.js";
549
561
  import {
550
562
  runWithRuntimeContentGenerator
551
- } from "./chunk-U45D46O5.js";
563
+ } from "./chunk-CMHFCLBU.js";
552
564
  import "./chunk-S6LOFUVP.js";
565
+ import {
566
+ getToolCallPreparations
567
+ } from "./chunk-CFKIH3D3.js";
553
568
  import {
554
569
  REASONING_EFFORT_TIERS,
555
570
  applyReasoningEffort
556
571
  } from "./chunk-2LD5U7Q3.js";
557
572
  import "./chunk-DJ2GSRLV.js";
558
- import "./chunk-I6VVOZDK.js";
559
- import "./chunk-K2OJUPOE.js";
560
- import {
561
- getToolCallPreparations
562
- } from "./chunk-CFKIH3D3.js";
563
- import "./chunk-EB4VDXNI.js";
564
- import "./chunk-FJWICLG7.js";
573
+ import "./chunk-DYXFD5RO.js";
574
+ import "./chunk-V4264FEG.js";
565
575
  import {
566
576
  ConversationFinishedEvent,
567
577
  DiscoveredMCPTool,
@@ -592,35 +602,35 @@ import {
592
602
  shouldRunVisionBridge,
593
603
  splitImageParts,
594
604
  uiTelemetryService
595
- } from "./chunk-OF2DPXUS.js";
596
- import "./chunk-YRLW2MSX.js";
605
+ } from "./chunk-QYMAKPY5.js";
606
+ import "./chunk-XBVNNDPK.js";
597
607
  import "./chunk-VGC4I5JJ.js";
598
608
  import {
599
- getAllGeminiMdFilenames,
609
+ getAllMemoryFilenames,
600
610
  getSpecificMimeType
601
- } from "./chunk-WBT3STGU.js";
611
+ } from "./chunk-BKWNKLZB.js";
602
612
  import {
603
613
  getAutoMemoryRoot,
604
614
  getUserAutoMemoryRoot
605
- } from "./chunk-PVBT5QPD.js";
615
+ } from "./chunk-6PJOTWAN.js";
606
616
  import {
607
617
  runSideQuery
608
- } from "./chunk-IPQA4SR5.js";
618
+ } from "./chunk-BWORX6FA.js";
609
619
  import "./chunk-WZAD4ZNJ.js";
610
620
  import {
611
621
  DEFAULT_TOKEN_LIMIT,
612
622
  tokenLimit
613
623
  } from "./chunk-FPGTNKCP.js";
614
- import "./chunk-SLEWBQWM.js";
624
+ import "./chunk-6DIGWMGT.js";
615
625
  import {
616
626
  hasVertexProjectConfigured,
617
627
  preloadContentGenerator
618
- } from "./chunk-AA7VBRBG.js";
628
+ } from "./chunk-W3JH33JE.js";
619
629
  import "./chunk-XZA32HII.js";
620
- import "./chunk-7QGEJI7M.js";
630
+ import "./chunk-23RFD54N.js";
621
631
  import {
622
632
  AuthType
623
- } from "./chunk-GTUKW3I6.js";
633
+ } from "./chunk-PPKZ7JOE.js";
624
634
  import "./chunk-HHJLM3WQ.js";
625
635
  import {
626
636
  endToolExecutionSpan,
@@ -632,17 +642,17 @@ import {
632
642
  startToolExecutionSpan,
633
643
  startToolSpan,
634
644
  withInteractionSpan
635
- } from "./chunk-6US7BF3G.js";
645
+ } from "./chunk-B5PHIJGI.js";
636
646
  import "./chunk-74TONY4F.js";
637
- import "./chunk-VL4YX3FH.js";
647
+ import "./chunk-XF63PKEN.js";
638
648
  import {
639
649
  FORK_SUBAGENT_TYPE,
640
650
  getStartupContextLength,
641
651
  isSystemReminderContent
642
- } from "./chunk-7OBH4AM2.js";
643
- import "./chunk-OT4YKUUV.js";
652
+ } from "./chunk-CAJTKR6W.js";
653
+ import "./chunk-ZU4UDIWX.js";
644
654
  import "./chunk-AQ37AY7B.js";
645
- import "./chunk-RRKNX553.js";
655
+ import "./chunk-PDQGMSZK.js";
646
656
  import {
647
657
  BaseDeclarativeTool,
648
658
  BaseToolInvocation,
@@ -650,7 +660,7 @@ import {
650
660
  ToolNames,
651
661
  canonicalToolName,
652
662
  isShellProgressData
653
- } from "./chunk-KOJ6MHD5.js";
663
+ } from "./chunk-UTLCH2FK.js";
654
664
  import {
655
665
  Storage,
656
666
  createDebugLogger,
@@ -658,15 +668,15 @@ import {
658
668
  getErrorStatus,
659
669
  isSubpath,
660
670
  sessionIdContext
661
- } from "./chunk-2NNTE2ED.js";
662
- import "./chunk-66GIFJ63.js";
671
+ } from "./chunk-UHQFIS7N.js";
672
+ import "./chunk-MK2GIB46.js";
663
673
  import {
664
674
  runExitCleanup
665
- } from "./chunk-TFV4RXPU.js";
675
+ } from "./chunk-MO3FC2WT.js";
666
676
  import {
667
677
  writeStderrLine,
668
678
  writeStderrLineSafe
669
- } from "./chunk-KGJGEEVR.js";
679
+ } from "./chunk-7FA2II6K.js";
670
680
  import "./chunk-75DOP5OR.js";
671
681
  import "./chunk-DMTGGOSA.js";
672
682
  import "./chunk-YQ3U5MUC.js";
@@ -1044,9 +1054,6 @@ function inactiveExtensionSkillRefs(config) {
1044
1054
  if (extension.isActive) continue;
1045
1055
  for (const skill of extension.skills ?? []) {
1046
1056
  refs.add(extensionSkillRef(extension.name, skill.name));
1047
- if (extension.displayName) {
1048
- refs.add(extensionSkillRef(extension.displayName, skill.name));
1049
- }
1050
1057
  }
1051
1058
  }
1052
1059
  return refs;
@@ -1952,6 +1959,19 @@ var basicPermissionOptions = [
1952
1959
  kind: "reject_once"
1953
1960
  }
1954
1961
  ];
1962
+ function filterPermissionPersistenceOptions(options, policy) {
1963
+ if (!policy) return options;
1964
+ return options.filter((option) => {
1965
+ if (option.optionId === "proceed_always_project" /* ProceedAlwaysProject */ && !policy.allowProjectPersistence) {
1966
+ return false;
1967
+ }
1968
+ if (option.optionId === "proceed_always_user" /* ProceedAlwaysUser */ && !policy.allowUserPersistence) {
1969
+ return false;
1970
+ }
1971
+ return true;
1972
+ });
1973
+ }
1974
+ __name(filterPermissionPersistenceOptions, "filterPermissionPersistenceOptions");
1955
1975
  function supportsHideAlwaysAllow(confirmation) {
1956
1976
  return confirmation.type !== "ask_user_question";
1957
1977
  }
@@ -2087,7 +2107,7 @@ function resolvePermissionOutcome(response, offeredOptions) {
2087
2107
  return optionId;
2088
2108
  }
2089
2109
  __name(resolvePermissionOutcome, "resolvePermissionOutcome");
2090
- function toPermissionOptions(confirmation, forceHideAlwaysAllow = false) {
2110
+ function toPermissionOptions(confirmation, forceHideAlwaysAllow = false, persistencePolicy) {
2091
2111
  switch (confirmation.type) {
2092
2112
  case "edit":
2093
2113
  return filterAlwaysAllowOptions(
@@ -2106,56 +2126,65 @@ function toPermissionOptions(confirmation, forceHideAlwaysAllow = false) {
2106
2126
  const label = formatExecPermissionScopeLabel(confirmation);
2107
2127
  return filterAlwaysAllowOptions(
2108
2128
  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
- ],
2129
+ filterPermissionPersistenceOptions(
2130
+ [
2131
+ {
2132
+ optionId: "proceed_always_project" /* ProceedAlwaysProject */,
2133
+ name: `Always Allow in project: ${label}`,
2134
+ kind: "allow_always"
2135
+ },
2136
+ {
2137
+ optionId: "proceed_always_user" /* ProceedAlwaysUser */,
2138
+ name: `Always Allow for user: ${label}`,
2139
+ kind: "allow_always"
2140
+ },
2141
+ ...basicPermissionOptions
2142
+ ],
2143
+ persistencePolicy
2144
+ ),
2122
2145
  forceHideAlwaysAllow
2123
2146
  );
2124
2147
  }
2125
2148
  case "mcp":
2126
2149
  return filterAlwaysAllowOptions(
2127
2150
  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
- ],
2151
+ filterPermissionPersistenceOptions(
2152
+ [
2153
+ {
2154
+ optionId: "proceed_always_project" /* ProceedAlwaysProject */,
2155
+ name: `Always Allow in project: ${confirmation.toolName}`,
2156
+ kind: "allow_always"
2157
+ },
2158
+ {
2159
+ optionId: "proceed_always_user" /* ProceedAlwaysUser */,
2160
+ name: `Always Allow for user: ${confirmation.toolName}`,
2161
+ kind: "allow_always"
2162
+ },
2163
+ ...basicPermissionOptions
2164
+ ],
2165
+ persistencePolicy
2166
+ ),
2141
2167
  forceHideAlwaysAllow
2142
2168
  );
2143
2169
  case "info":
2144
2170
  return filterAlwaysAllowOptions(
2145
2171
  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
- ],
2172
+ filterPermissionPersistenceOptions(
2173
+ [
2174
+ {
2175
+ optionId: "proceed_always_project" /* ProceedAlwaysProject */,
2176
+ name: "Always Allow in project",
2177
+ kind: "allow_always"
2178
+ },
2179
+ {
2180
+ optionId: "proceed_always_user" /* ProceedAlwaysUser */,
2181
+ name: "Always Allow for user",
2182
+ kind: "allow_always"
2183
+ },
2184
+ ...basicPermissionOptions
2185
+ ],
2186
+ persistencePolicy
2187
+ ),
2159
2188
  forceHideAlwaysAllow
2160
2189
  );
2161
2190
  case "plan":
@@ -2205,11 +2234,12 @@ __name(toPermissionOptions, "toPermissionOptions");
2205
2234
  // packages/cli/src/acp-integration/session/SubAgentTracker.ts
2206
2235
  var debugLogger3 = createDebugLogger("ACP_SUBAGENT_TRACKER");
2207
2236
  var SubAgentTracker = class {
2208
- constructor(ctx, client, parentToolCallId, subagentType, onPermissionCancel, permissionRequester = (params, signal) => requestPermissionWithAbort(this.client, params, signal)) {
2237
+ constructor(ctx, client, parentToolCallId, subagentType, onPermissionCancel, permissionRequester = (params, signal) => requestPermissionWithAbort(this.client, params, signal), permissionPersistencePolicy) {
2209
2238
  this.ctx = ctx;
2210
2239
  this.client = client;
2211
2240
  this.onPermissionCancel = onPermissionCancel;
2212
2241
  this.permissionRequester = permissionRequester;
2242
+ this.permissionPersistencePolicy = permissionPersistencePolicy;
2213
2243
  this.toolCallEmitter = new ToolCallEmitter(ctx);
2214
2244
  this.messageEmitter = new MessageEmitter(ctx);
2215
2245
  this.subagentMeta = { parentToolCallId, subagentType };
@@ -2325,7 +2355,11 @@ var SubAgentTracker = class {
2325
2355
  }, "onConfirm")
2326
2356
  };
2327
2357
  const { title, locations, kind } = this.toolCallEmitter.resolveToolMetadata(event.name, state?.args);
2328
- const permissionOptions = toPermissionOptions(fullConfirmationDetails);
2358
+ const permissionOptions = toPermissionOptions(
2359
+ fullConfirmationDetails,
2360
+ false,
2361
+ this.permissionPersistencePolicy
2362
+ );
2329
2363
  const offeredPermissionOptions = permissionOptions.map((option) => ({
2330
2364
  ...option
2331
2365
  }));
@@ -3248,6 +3282,18 @@ var LOOP_DETECTED_CONTEXT_MESSAGE = "System: this turn was terminated because th
3248
3282
  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
3283
  var TOOL_EXECUTION_CANCELLED_MESSAGE = "Tool execution was cancelled.";
3250
3284
  var TOOL_POST_EXECUTION_CANCELLED_MESSAGE = "The tool had already completed; its output was discarded.";
3285
+ function sameManagedConversationExpectation(left, right) {
3286
+ 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;
3287
+ }
3288
+ __name(sameManagedConversationExpectation, "sameManagedConversationExpectation");
3289
+ function managedConversationBindingError() {
3290
+ return new RequestError(
3291
+ -32004,
3292
+ "The standalone working directory is missing.",
3293
+ { errorKind: "working_directory_missing" }
3294
+ );
3295
+ }
3296
+ __name(managedConversationBindingError, "managedConversationBindingError");
3251
3297
  function createDaemonToolLoopState(repeatedToolFailureMode) {
3252
3298
  return {
3253
3299
  totalToolCalls: 0,
@@ -3814,22 +3860,55 @@ async function registerCreateSubSessionTool(config) {
3814
3860
  return;
3815
3861
  }
3816
3862
  const permissionManager = config.getPermissionManager();
3817
- if (permissionManager && !await permissionManager.isToolEnabled(ToolNames.CREATE_SUB_SESSION)) {
3863
+ const registrationStatus = permissionManager ? await permissionManager.getToolRegistrationStatus(
3864
+ ToolNames.CREATE_SUB_SESSION
3865
+ ) : "registered";
3866
+ if (registrationStatus === "disabled") {
3818
3867
  return;
3819
3868
  }
3820
3869
  const toolRegistry = config.getToolRegistry();
3870
+ if (registrationStatus === "deferred") {
3871
+ toolRegistry.registerPermissionDeferredFactory(
3872
+ ToolNames.CREATE_SUB_SESSION,
3873
+ async () => new CreateSubSessionTool(config)
3874
+ );
3875
+ await config.getLlmClient().setTools();
3876
+ return;
3877
+ }
3821
3878
  toolRegistry.registerTool(new CreateSubSessionTool(config));
3822
3879
  toolRegistry.revealDeferredTool(ToolNames.CREATE_SUB_SESSION);
3823
3880
  toolRegistry.pinDeferredToolReveal(ToolNames.CREATE_SUB_SESSION);
3824
- await config.getGeminiClient().setTools();
3881
+ await config.getLlmClient().setTools();
3825
3882
  }
3826
3883
  __name(registerCreateSubSessionTool, "registerCreateSubSessionTool");
3827
- async function buildAvailableCommandsSnapshot(config, abortSignal = AbortSignal.timeout(1e4), settings) {
3884
+ var STANDALONE_SLASH_COMMAND_POLICY = Object.freeze({
3885
+ allowSessionReset: false,
3886
+ allowWorkspaceSettingsWrite: false,
3887
+ persistModelSelection: false,
3888
+ blockedBuiltinCommandNames: Object.freeze([
3889
+ "cd",
3890
+ "clear",
3891
+ "directory",
3892
+ "diff",
3893
+ "dream",
3894
+ "export",
3895
+ "learn",
3896
+ "curator",
3897
+ "workflows"
3898
+ ])
3899
+ });
3900
+ var STANDALONE_PERMISSION_PERSISTENCE_POLICY = Object.freeze({
3901
+ allowProjectPersistence: false,
3902
+ allowUserPersistence: true
3903
+ });
3904
+ var STANDALONE_WORKTREE_ACTION_ERROR = "Standalone sessions cannot change or override their working directory.";
3905
+ async function buildAvailableCommandsSnapshot(config, abortSignal = AbortSignal.timeout(1e4), settings, executionPolicy) {
3828
3906
  const slashCommands = await getAvailableCommands(
3829
3907
  config,
3830
3908
  abortSignal,
3831
3909
  "acp",
3832
- settings
3910
+ settings,
3911
+ executionPolicy
3833
3912
  );
3834
3913
  const disabledSkillNames = config.getDisabledSkillNames();
3835
3914
  const inactiveSkillRefs = inactiveExtensionSkillRefs(config);
@@ -3923,6 +4002,11 @@ var Session = class {
3923
4002
  this.runExclusiveAutomaticHistoryMutation = runExclusiveAutomaticHistoryMutation;
3924
4003
  this.onActiveWorkChanged = onActiveWorkChanged;
3925
4004
  this.sessionId = id;
4005
+ this.requiresManagedConversationBinding = isReservedStandaloneSessionSourceType(
4006
+ this.config.getSessionSourceType?.()
4007
+ );
4008
+ this.requiresManagedConversationActivation = this.requiresManagedConversationBinding && this.config.isProvisionalWorkspace?.() === true;
4009
+ this.slashCommandPolicy = this.requiresManagedConversationBinding ? STANDALONE_SLASH_COMMAND_POLICY : void 0;
3926
4010
  this.runtimeBaseDir = config.storage.getRuntimeBaseDir();
3927
4011
  const todoStopGuardEnabled = this.settings.merged.experimental?.todoStopGuard === true && !this.config.getBareMode() && !this.config.isSafeMode();
3928
4012
  this.todoStopGuard = new DaemonTodoStopGuard(todoStopGuardEnabled);
@@ -3942,6 +4026,7 @@ var Session = class {
3942
4026
  this.#bindGoalRuntime();
3943
4027
  this.#registerBackgroundNotificationCallbacks();
3944
4028
  this.#registerSubSessionSpawner();
4029
+ this.#registerCurrentSessionScheduledTaskCreator();
3945
4030
  this.config.getWorkflowRunRegistry?.().setApprovalRequestCallback(
3946
4031
  (entry, approval, rawArgs, signal) => this.#requestWorkflowApproval(entry.runId, approval, rawArgs, signal)
3947
4032
  );
@@ -4066,6 +4151,11 @@ var Session = class {
4066
4151
  liveSpeakToUserTool;
4067
4152
  liveConversationActive;
4068
4153
  liveEndInstructionPending = false;
4154
+ requiresManagedConversationBinding;
4155
+ requiresManagedConversationActivation;
4156
+ slashCommandPolicy;
4157
+ managedConversationBinding;
4158
+ managedConversationActivation;
4069
4159
  // Message rewrite middleware (optional, installed after history replay)
4070
4160
  messageRewriter;
4071
4161
  /**
@@ -4122,6 +4212,8 @@ var Session = class {
4122
4212
  controller: new AbortController(),
4123
4213
  origin: "runtime",
4124
4214
  continuationContext: input.continuationContext,
4215
+ ...input.objectiveUpdated ? { objectiveUpdated: input.objectiveUpdated } : {},
4216
+ ...input.windDown ? { windDown: true } : {},
4125
4217
  ...input.verifierFeedback ? { verifierFeedback: input.verifierFeedback } : {},
4126
4218
  modelStarted: false
4127
4219
  });
@@ -4278,13 +4370,14 @@ var Session = class {
4278
4370
  return publication;
4279
4371
  }
4280
4372
  async #drainGoalQueue() {
4373
+ if (this.#isAutomaticWorkHeld()) return;
4281
4374
  if (this.goalQueue.length === 0) return;
4282
4375
  await this.runExclusiveAutomaticHistoryMutation(
4283
4376
  () => this.#drainGoalQueueExclusive()
4284
4377
  );
4285
4378
  }
4286
4379
  async #drainGoalQueueExclusive() {
4287
- if (this.disposed || this.closing || this.goalProcessing || this.pendingPrompt || this.pendingPromptCompletion || this.cronProcessing || this.cronAbortController || this.notificationProcessing || this.notificationAbortController) {
4380
+ if (this.disposed || this.closing || this.goalProcessing || this.pendingPrompt || this.pendingPromptCompletion || this.cronProcessing || this.cronAbortController || this.notificationProcessing || this.notificationAbortController || this.#isAutomaticWorkHeld()) {
4288
4381
  return;
4289
4382
  }
4290
4383
  const turn = this.goalQueue.shift();
@@ -4322,6 +4415,24 @@ var Session = class {
4322
4415
  void this.#drainGoalQueue();
4323
4416
  }
4324
4417
  }
4418
+ /**
4419
+ * Confirms the continuation's prompt reached the model.
4420
+ *
4421
+ * `startGoalTurn` resolves at enqueue time, so the runtime cannot tell a
4422
+ * delivered turn from a queued one when it settles; `#settleGoalTurn`'s
4423
+ * degraded-persistence fallback settles a model-started turn through
4424
+ * `releaseTurn`, and only this confirmation keeps that turn's objective
4425
+ * announcement from rolling back and re-firing on the next continuation.
4426
+ */
4427
+ #markGoalTurnDelivered(turnKey) {
4428
+ try {
4429
+ this.config.getGoalRuntime().markTurnDelivered(turnKey);
4430
+ } catch (error) {
4431
+ debugLogger6.debug(
4432
+ `Failed to confirm ACP Goal turn delivery: ${error instanceof Error ? error.message : String(error)}`
4433
+ );
4434
+ }
4435
+ }
4325
4436
  async #settleGoalTurn(turn, result, failed) {
4326
4437
  try {
4327
4438
  const runtime = await this.config.getGoalRuntimeReady();
@@ -4826,6 +4937,48 @@ var Session = class {
4826
4937
  };
4827
4938
  });
4828
4939
  }
4940
+ #registerCurrentSessionScheduledTaskCreator() {
4941
+ if (process.env[QWEN_CODE_SERVE_ENV] !== "1") {
4942
+ return;
4943
+ }
4944
+ this.config.setCurrentSessionScheduledTaskCreator(async (req) => {
4945
+ let resp;
4946
+ try {
4947
+ resp = await this.client.extMethod(
4948
+ SERVE_CONTROL_EXT_METHODS.createCurrentSessionScheduledTask,
4949
+ {
4950
+ callerSessionId: this.sessionId,
4951
+ promptId: getInvocationContext()?.promptId ?? req.promptId,
4952
+ cron: req.cron,
4953
+ prompt: req.prompt,
4954
+ recurring: req.recurring
4955
+ }
4956
+ );
4957
+ } catch (error) {
4958
+ const code = error && typeof error === "object" && "code" in error ? error.code : void 0;
4959
+ if (code === -32601) {
4960
+ throw new Error(
4961
+ "current_session_scheduling_unavailable: The daemon does not support current-session scheduling."
4962
+ );
4963
+ }
4964
+ const data = isRecord2(error) && isRecord2(error["data"]) ? error["data"] : void 0;
4965
+ const errorKind = data?.["errorKind"];
4966
+ if (typeof errorKind === "string") {
4967
+ const hint = data?.["hint"];
4968
+ throw new Error(
4969
+ `${errorKind}: ${typeof hint === "string" && hint.length > 0 ? hint : "Current-session scheduled task creation was rejected."}`
4970
+ );
4971
+ }
4972
+ throw error;
4973
+ }
4974
+ if (typeof resp["id"] !== "string" || resp["id"].length === 0 || typeof resp["cron"] !== "string" || resp["cron"].length === 0) {
4975
+ throw new Error(
4976
+ "cron_create: bridge returned an invalid scheduled-task result"
4977
+ );
4978
+ }
4979
+ return { id: resp["id"], cron: resp["cron"] };
4980
+ });
4981
+ }
4829
4982
  async enableLiveScreenContext() {
4830
4983
  const registry = this.config.getToolRegistry();
4831
4984
  const existing = registry.getTool(CAPTURE_SCREEN_CONTEXT_TOOL_NAME);
@@ -4911,11 +5064,11 @@ var Session = class {
4911
5064
  await this.#syncLiveToolDeclarations();
4912
5065
  }
4913
5066
  async #syncLiveToolDeclarations() {
4914
- const geminiClient = this.config.getGeminiClient();
4915
- if (!geminiClient) {
5067
+ const llmClient = this.config.getLlmClient();
5068
+ if (!llmClient) {
4916
5069
  throw new Error("The Live backend model client is unavailable.");
4917
5070
  }
4918
- await geminiClient.setTools();
5071
+ await llmClient.setTools();
4919
5072
  }
4920
5073
  async setLiveConversationActive(active) {
4921
5074
  if (this.liveConversationActive === active) return;
@@ -4932,7 +5085,7 @@ var Session = class {
4932
5085
  this.liveEndInstructionPending = true;
4933
5086
  this.config.setLiveAppendSystemPrompt(LIVE_BACKEND_END_INSTRUCTIONS);
4934
5087
  }
4935
- await this.config.getGeminiClient()?.refreshSystemInstruction();
5088
+ await this.config.getLlmClient()?.refreshSystemInstruction();
4936
5089
  }
4937
5090
  async appendLiveConversationTranscript(entries, model) {
4938
5091
  if (this.liveConversationActive !== true) {
@@ -4970,7 +5123,7 @@ var Session = class {
4970
5123
  if (this.liveConversationActive || !this.liveEndInstructionPending) return;
4971
5124
  this.liveEndInstructionPending = false;
4972
5125
  this.config.setLiveAppendSystemPrompt(void 0);
4973
- await this.config.getGeminiClient()?.refreshSystemInstruction();
5126
+ await this.config.getLlmClient()?.refreshSystemInstruction();
4974
5127
  }
4975
5128
  getId() {
4976
5129
  return this.sessionId;
@@ -4984,6 +5137,7 @@ var Session = class {
4984
5137
  * mount.
4985
5138
  */
4986
5139
  startCronScheduler() {
5140
+ if (this.#isAutomaticWorkHeld()) return;
4987
5141
  this.#startCronSchedulerInRuntime().catch((error) => {
4988
5142
  debugLogger6.warn(
4989
5143
  `Cron scheduler startup failed [session ${this.sessionId}]: ${error}`
@@ -4993,6 +5147,113 @@ var Session = class {
4993
5147
  getConfig() {
4994
5148
  return this.config;
4995
5149
  }
5150
+ installPendingManagedConversationBinding(expectation, assertIdentity) {
5151
+ if (!this.requiresManagedConversationBinding || expectation.canonicalSessionId !== this.sessionId) {
5152
+ throw managedConversationBindingError();
5153
+ }
5154
+ if (this.managedConversationBinding && this.managedConversationBinding.state !== "released" && !sameManagedConversationExpectation(
5155
+ this.managedConversationBinding.expectation,
5156
+ expectation
5157
+ )) {
5158
+ throw managedConversationBindingError();
5159
+ }
5160
+ this.managedConversationBinding = {
5161
+ expectation,
5162
+ assertIdentity,
5163
+ state: "pending"
5164
+ };
5165
+ }
5166
+ installManagedConversationActivation(run, onRelease) {
5167
+ if (!this.requiresManagedConversationActivation || this.managedConversationActivation) {
5168
+ throw managedConversationBindingError();
5169
+ }
5170
+ this.managedConversationActivation = {
5171
+ run,
5172
+ ...onRelease ? { onRelease } : {},
5173
+ releaseScheduled: false,
5174
+ state: "pending"
5175
+ };
5176
+ }
5177
+ async activateManagedConversation() {
5178
+ if (!this.requiresManagedConversationActivation) return;
5179
+ const activation = this.managedConversationActivation;
5180
+ if (!activation) throw managedConversationBindingError();
5181
+ if (activation.state === "ready") return;
5182
+ if (activation.state === "poisoned") throw activation.error;
5183
+ if (activation.promise) return activation.promise;
5184
+ activation.state = "activating";
5185
+ const promise = activation.run().then(() => {
5186
+ activation.state = "ready";
5187
+ }).catch((error) => {
5188
+ activation.state = "poisoned";
5189
+ activation.error = error;
5190
+ throw error;
5191
+ });
5192
+ activation.promise = promise;
5193
+ return promise;
5194
+ }
5195
+ async commitManagedConversationBinding(expectation) {
5196
+ const binding = this.managedConversationBinding;
5197
+ if (!this.requiresManagedConversationBinding || !binding || !sameManagedConversationExpectation(binding.expectation, expectation)) {
5198
+ throw managedConversationBindingError();
5199
+ }
5200
+ if (binding.state === "committed" || binding.state === "released") return;
5201
+ if (!isSameConversationPath(
5202
+ this.config.getTargetDir(),
5203
+ binding.expectation.child.canonicalPath
5204
+ )) {
5205
+ throw managedConversationBindingError();
5206
+ }
5207
+ await binding.assertIdentity();
5208
+ await this.activateManagedConversation();
5209
+ await binding.assertIdentity();
5210
+ binding.state = "committed";
5211
+ }
5212
+ async releaseManagedConversationBinding(expectation) {
5213
+ const binding = this.managedConversationBinding;
5214
+ if (!this.requiresManagedConversationBinding || !binding || binding.state === "pending" || !sameManagedConversationExpectation(binding.expectation, expectation)) {
5215
+ throw managedConversationBindingError();
5216
+ }
5217
+ if (binding.state === "released") return;
5218
+ if (!isSameConversationPath(
5219
+ this.config.getTargetDir(),
5220
+ binding.expectation.child.canonicalPath
5221
+ )) {
5222
+ throw managedConversationBindingError();
5223
+ }
5224
+ await binding.assertIdentity();
5225
+ binding.state = "released";
5226
+ const activation = this.managedConversationActivation;
5227
+ if (activation && !activation.releaseScheduled) {
5228
+ activation.releaseScheduled = true;
5229
+ try {
5230
+ activation.onRelease?.();
5231
+ } catch (error) {
5232
+ debugLogger6.warn(
5233
+ `Managed conversation release callback failed [session ${this.sessionId}]: ${error}`
5234
+ );
5235
+ }
5236
+ }
5237
+ this.startCronScheduler();
5238
+ void this.sendAvailableCommandsUpdate();
5239
+ void this.#drainGoalQueue();
5240
+ void this.#drainCronQueue();
5241
+ void this.#drainNotificationQueue();
5242
+ }
5243
+ async assertManagedConversationBindingReady() {
5244
+ if (!this.requiresManagedConversationBinding) return;
5245
+ const binding = this.managedConversationBinding;
5246
+ if (binding?.state !== "released" || !isSameConversationPath(
5247
+ this.config.getTargetDir(),
5248
+ binding.expectation.child.canonicalPath
5249
+ )) {
5250
+ throw managedConversationBindingError();
5251
+ }
5252
+ await binding.assertIdentity();
5253
+ }
5254
+ #isAutomaticWorkHeld() {
5255
+ return this.requiresManagedConversationBinding && this.managedConversationBinding?.state !== "released";
5256
+ }
4996
5257
  shouldHintAskUserQuestionRestore() {
4997
5258
  if (this.config.getRestoreAskUserQuestion?.() !== true) return false;
4998
5259
  if (this.pendingPrompt && !this.pendingPrompt.signal.aborted) return false;
@@ -5010,6 +5271,9 @@ var Session = class {
5010
5271
  "Session history mutation is in progress"
5011
5272
  );
5012
5273
  }
5274
+ if (this.requiresManagedConversationBinding) {
5275
+ await this.assertManagedConversationBindingReady();
5276
+ }
5013
5277
  try {
5014
5278
  await this.config.assertCanStartTurn();
5015
5279
  } catch (error) {
@@ -5020,6 +5284,9 @@ var Session = class {
5020
5284
  }
5021
5285
  throw error;
5022
5286
  }
5287
+ if (this.requiresManagedConversationBinding) {
5288
+ await this.assertManagedConversationBindingReady();
5289
+ }
5023
5290
  if (this.closing) {
5024
5291
  throw RequestError.invalidParams(void 0, "Session is closing");
5025
5292
  }
@@ -5081,6 +5348,9 @@ var Session = class {
5081
5348
  }
5082
5349
  return holds;
5083
5350
  }
5351
+ hasStandaloneRelocationBlockers() {
5352
+ return this.collectActiveWorkHolds().length > 0 || this.config.getMonitorRegistry().getAll().some((monitor) => monitor.status === "running");
5353
+ }
5084
5354
  #activeWorkChanged() {
5085
5355
  this.onActiveWorkChanged?.();
5086
5356
  }
@@ -5236,6 +5506,7 @@ var Session = class {
5236
5506
  this.unsubscribeChatRecordingFailure?.();
5237
5507
  this.unsubscribeChatRecordingFailure = void 0;
5238
5508
  this.config.setSubSessionSpawner(void 0);
5509
+ this.config.setCurrentSessionScheduledTaskCreator(void 0);
5239
5510
  this.config.getWorkflowRunRegistry?.().setApprovalRequestCallback(void 0);
5240
5511
  this.workflowApprovalAbortController.abort(SESSION_DISPOSE_ABORT_REASON);
5241
5512
  }
@@ -5304,7 +5575,7 @@ var Session = class {
5304
5575
  "Cannot rewind while a prompt is running"
5305
5576
  );
5306
5577
  }
5307
- const chat = this.config.getGeminiClient().getChat();
5578
+ const chat = this.config.getLlmClient().getChat();
5308
5579
  const apiHistory = chat.getHistoryShallow();
5309
5580
  const apiTruncateIndex = this.#computeApiTruncationIndexForUserTurn(
5310
5581
  apiHistory,
@@ -5340,7 +5611,7 @@ var Session = class {
5340
5611
  return { targetTurnIndex, apiTruncateIndex };
5341
5612
  }
5342
5613
  captureHistorySnapshot() {
5343
- return this.config.getGeminiClient().getChat().getHistoryShallow();
5614
+ return this.config.getLlmClient().getChat().getHistoryShallow();
5344
5615
  }
5345
5616
  getRewindableUserTurnCount() {
5346
5617
  const apiHistory = this.captureHistorySnapshot();
@@ -5362,7 +5633,7 @@ var Session = class {
5362
5633
  "Cannot restore history while a prompt is running"
5363
5634
  );
5364
5635
  }
5365
- this.config.getGeminiClient().getChat().setHistory(structuredClone(history));
5636
+ this.config.getLlmClient().getChat().setHistory(structuredClone(history));
5366
5637
  this.activeTodoPlanRevision = void 0;
5367
5638
  this.#clearTodoStopGuardTrustAndDrainAutomaticQueues();
5368
5639
  }
@@ -5789,8 +6060,8 @@ var Session = class {
5789
6060
  * authoritatively. Powers `qwen/control/session/continue`.
5790
6061
  */
5791
6062
  async continueLastTurn() {
5792
- const geminiClient = this.config.getGeminiClient();
5793
- if (!geminiClient || !geminiClient.isInitialized()) {
6063
+ const llmClient = this.config.getLlmClient();
6064
+ if (!llmClient || !llmClient.isInitialized()) {
5794
6065
  return { accepted: false, interruption: "none" };
5795
6066
  }
5796
6067
  const chat = this.#getCurrentChat();
@@ -5839,7 +6110,7 @@ var Session = class {
5839
6110
  }
5840
6111
  if (this.settings.merged.ui?.enableFollowupSuggestions === false) return;
5841
6112
  if (this.config.getApprovalMode() === "plan" /* PLAN */) return;
5842
- const chat = this.config.getGeminiClient()?.getChat();
6113
+ const chat = this.config.getLlmClient()?.getChat();
5843
6114
  if (!chat) return;
5844
6115
  const ac = new AbortController();
5845
6116
  this.followupAbort = ac;
@@ -5926,6 +6197,7 @@ var Session = class {
5926
6197
  return goalTurn ? goalTurnContext.run(goalTurn.permit, execute) : goalTurnContext.exit(execute);
5927
6198
  }
5928
6199
  async #executePromptInner(params, pendingSend, responseCapture, modelPrompt, rejectOnLoopDetected = false, goalTurn, channelTurn = false) {
6200
+ let managedMemoryRecallStarted = false;
5929
6201
  return Storage.runWithRuntimeBaseDir(
5930
6202
  this.runtimeBaseDir,
5931
6203
  this.config.getWorkingDir(),
@@ -6071,7 +6343,8 @@ var Session = class {
6071
6343
  // long-lived Session; without this the goal-state
6072
6344
  // subscription stays on the disposed instance.
6073
6345
  startNewSession: /* @__PURE__ */ __name(() => this.rebindGoalRuntimeForNewSession(), "startNewSession")
6074
- }
6346
+ },
6347
+ this.slashCommandPolicy
6075
6348
  );
6076
6349
  if (slashCommandName === "advisor" && pendingSend.signal.aborted && slashCommandResult.type === "message") {
6077
6350
  this.todoStopGuard.suspend();
@@ -6137,6 +6410,7 @@ var Session = class {
6137
6410
  const hooksEnabled = !this.config.getDisableAllHooks?.();
6138
6411
  const messageBus = this.config.getMessageBus?.();
6139
6412
  const isRuntimeContinuation = goalTurn?.origin === "runtime";
6413
+ const isFreshUserTurn = !isRetry && !isContinue && !isRestoreAskUserQuestion && !isRuntimeContinuation;
6140
6414
  if (!isContinue && !isRestoreAskUserQuestion && !isRuntimeContinuation && hooksEnabled && messageBus && this.config.hasHooksForEvent?.("UserPromptSubmit")) {
6141
6415
  const response = await messageBus.request(
6142
6416
  {
@@ -6165,6 +6439,10 @@ var Session = class {
6165
6439
  ];
6166
6440
  }
6167
6441
  }
6442
+ if (isFreshUserTurn) {
6443
+ managedMemoryRecallStarted = true;
6444
+ this.config.getLlmClient().beginManagedAutoMemoryRecall(promptText, pendingSend.signal);
6445
+ }
6168
6446
  if (!continuesCurrentWorkChain && !this.todoStopGuard.enabled) {
6169
6447
  this.#resetTodoStopGuardBackgroundLineage();
6170
6448
  }
@@ -6190,6 +6468,12 @@ var Session = class {
6190
6468
  }
6191
6469
  }
6192
6470
  const systemReminders = await this.#buildInitialSystemReminders();
6471
+ if (isFreshUserTurn) {
6472
+ const memory = await this.config.getLlmClient().consumeManagedAutoMemoryRecall("initial");
6473
+ if (memory?.prompt) {
6474
+ systemReminders.unshift({ text: memory.prompt });
6475
+ }
6476
+ }
6193
6477
  if (systemReminders.length > 0 && !isRestoreAskUserQuestion) {
6194
6478
  const alreadyHasReminder = isContinue && parts.some(
6195
6479
  (part) => isSystemReminderContent({ role: "user", parts: [part] })
@@ -6366,7 +6650,12 @@ ${this.pendingRecoveredAgentsNotice}
6366
6650
  let channelDeliveryResponseBlock;
6367
6651
  let channelDeliveryCheckpoint = 0;
6368
6652
  try {
6369
- if (goalTurn) goalTurn.modelStarted = true;
6653
+ if (goalTurn) {
6654
+ goalTurn.modelStarted = true;
6655
+ if (goalTurn.origin === "runtime") {
6656
+ this.#markGoalTurnDelivered(goalTurn.turnKey);
6657
+ }
6658
+ }
6370
6659
  const sendResult = await this.#sendMessageStreamWithAutoCompression(
6371
6660
  promptId,
6372
6661
  nextMessage?.parts ?? [],
@@ -6587,7 +6876,32 @@ ${this.pendingRecoveredAgentsNotice}
6587
6876
  getActiveInteractionSpan()
6588
6877
  );
6589
6878
  }
6590
- return result;
6879
+ if (isFreshUserTurn && result.stopReason === "end_turn" && !result.loopProtectionStopped && this.config.getManagedAutoMemoryEnabled()) {
6880
+ const memoryManager = this.config.getMemoryManager();
6881
+ const history = this.#getCurrentChat().getHistoryShallow();
6882
+ void memoryManager.scheduleExtract({
6883
+ projectRoot: this.config.getProjectRoot(),
6884
+ sessionId: this.config.getSessionId(),
6885
+ history,
6886
+ config: this.config
6887
+ }).catch((error) => {
6888
+ debugLogger6.warn(
6889
+ "Failed to schedule ACP managed auto-memory extraction.",
6890
+ error
6891
+ );
6892
+ });
6893
+ void memoryManager.scheduleDream({
6894
+ projectRoot: this.config.getProjectRoot(),
6895
+ sessionId: this.config.getSessionId(),
6896
+ config: this.config
6897
+ }).catch((error) => {
6898
+ debugLogger6.warn(
6899
+ "Failed to schedule ACP managed auto-memory dream.",
6900
+ error
6901
+ );
6902
+ });
6903
+ }
6904
+ return { stopReason: result.stopReason };
6591
6905
  } finally {
6592
6906
  logConversationFinishedEvent(
6593
6907
  this.config,
@@ -6606,7 +6920,11 @@ ${this.pendingRecoveredAgentsNotice}
6606
6920
  (result) => result.stopReason === "cancelled" ? "cancelled" : "ok"
6607
6921
  );
6608
6922
  }
6609
- );
6923
+ ).finally(() => {
6924
+ if (managedMemoryRecallStarted) {
6925
+ this.config.getLlmClient().finishManagedAutoMemoryRecall();
6926
+ }
6927
+ });
6610
6928
  }
6611
6929
  async #handleStopHookLoop(pendingSend, promptId, hooksEnabled, messageBus, allowExternalHooks = true, modelOverride, responseCapture, rejectOnLoopDetected = false) {
6612
6930
  const stopHookBlockingCap = this.config.getStopHookBlockingCap();
@@ -6673,7 +6991,7 @@ ${this.pendingRecoveredAgentsNotice}
6673
6991
  }
6674
6992
  );
6675
6993
  if (continuation2.kind === "terminal") {
6676
- return { stopReason: continuation2.stopReason };
6994
+ return continuation2;
6677
6995
  }
6678
6996
  continue;
6679
6997
  }
@@ -6758,7 +7076,7 @@ ${this.pendingRecoveredAgentsNotice}
6758
7076
  }
6759
7077
  );
6760
7078
  if (continuation2.kind === "terminal") {
6761
- return { stopReason: continuation2.stopReason };
7079
+ return continuation2;
6762
7080
  }
6763
7081
  continue;
6764
7082
  }
@@ -6862,7 +7180,7 @@ ${this.pendingRecoveredAgentsNotice}
6862
7180
  stopHookReasons = stopHookReasons.slice(0, -1);
6863
7181
  }
6864
7182
  if (continuation.kind === "terminal") {
6865
- return { stopReason: continuation.stopReason };
7183
+ return continuation;
6866
7184
  }
6867
7185
  }
6868
7186
  }
@@ -7317,6 +7635,7 @@ ${this.pendingRecoveredAgentsNotice}
7317
7635
  // and background-notification turns keep the graceful end-turn
7318
7636
  // handling they had before loop stops became rejections.
7319
7637
  stopReason: options.rejectOnLoopDetected ? cancelledOrThrowLoopDetected(pendingSend.signal, toolLoopState) : getAbortAwareEndTurnStopReason(pendingSend.signal),
7638
+ loopProtectionStopped: true,
7320
7639
  ...supersededAutomaticContinuation ? { supersededAutomaticContinuation: true } : {}
7321
7640
  };
7322
7641
  }
@@ -7329,6 +7648,14 @@ ${this.pendingRecoveredAgentsNotice}
7329
7648
  options.rejectOnLoopDetected ?? false
7330
7649
  );
7331
7650
  nextMessage = nextAfterTools.message;
7651
+ if (nextAfterTools.stoppedByRepeatedToolFailure) {
7652
+ return {
7653
+ kind: "terminal",
7654
+ stopReason: options.rejectOnLoopDetected ? cancelledOrThrowLoopDetected(pendingSend.signal, toolLoopState) : getAbortAwareEndTurnStopReason(pendingSend.signal),
7655
+ loopProtectionStopped: true,
7656
+ ...supersededAutomaticContinuation ? { supersededAutomaticContinuation: true } : {}
7657
+ };
7658
+ }
7332
7659
  if (nextAfterTools.hadMidTurnUserInput) {
7333
7660
  nextGuardContinuation = void 0;
7334
7661
  continue;
@@ -7490,7 +7817,7 @@ ${this.pendingRecoveredAgentsNotice}
7490
7817
  }
7491
7818
  }
7492
7819
  #getCurrentChat() {
7493
- return this.config.getGeminiClient().getChat();
7820
+ return this.config.getLlmClient().getChat();
7494
7821
  }
7495
7822
  async #runWithFullTurnModel(modelOverride, fn) {
7496
7823
  if (!modelOverride?.endsWith("\0")) {
@@ -7502,9 +7829,9 @@ ${this.pendingRecoveredAgentsNotice}
7502
7829
  /**
7503
7830
  * Create the MessageDisplay hook dispatcher for one model call's streamed
7504
7831
  * reply, or null when the hook isn't registered (the common case — keeps
7505
- * the streaming loops zero-cost). The ACP surface consumes GeminiChat's
7832
+ * the streaming loops zero-cost). The ACP surface consumes LlmChat's
7506
7833
  * raw stream directly rather than going through
7507
- * GeminiClient.sendMessageStream, so it has to fire this hook itself —
7834
+ * LlmClient.sendMessageStream, so it has to fire this hook itself —
7508
7835
  * with the same contract as the terminal UI path in client.ts: debounced
7509
7836
  * cumulative text, one message_id per model call, and an is_final firing
7510
7837
  * on every non-aborted exit (delivered by awaiting `finish()` in a
@@ -7530,7 +7857,7 @@ ${this.pendingRecoveredAgentsNotice}
7530
7857
  * was cancelled or the session token limit was exceeded.
7531
7858
  */
7532
7859
  async #sendMessageStreamWithAutoCompression(promptId, message, abortSignal, options = {}) {
7533
- const geminiClient = this.config.getGeminiClient();
7860
+ const llmClient = this.config.getLlmClient();
7534
7861
  if (options.prepareBeforeCompression) {
7535
7862
  const decision = await options.prepareBeforeCompression();
7536
7863
  if (decision.kind === "stop") {
@@ -7549,7 +7876,7 @@ ${this.pendingRecoveredAgentsNotice}
7549
7876
  let compressionFailed = false;
7550
7877
  if (!options.skipCompression && !(options.getModelOverride?.() ?? options.modelOverride)) {
7551
7878
  try {
7552
- const compressed = await geminiClient.tryCompressChat(
7879
+ const compressed = await llmClient.tryCompressChat(
7553
7880
  promptId,
7554
7881
  false,
7555
7882
  abortSignal
@@ -7627,6 +7954,14 @@ ${this.pendingRecoveredAgentsNotice}
7627
7954
  );
7628
7955
  return { responseStream: null, stopReason: "cancelled" };
7629
7956
  }
7957
+ if (message[0]?.functionResponse) {
7958
+ const memory = await llmClient.consumeManagedAutoMemoryRecall("tool_result");
7959
+ if (memory?.prompt) {
7960
+ message = insertAfterFunctionResponses(message, [
7961
+ { text: memory.prompt }
7962
+ ]);
7963
+ }
7964
+ }
7630
7965
  const chat = this.#getCurrentChat();
7631
7966
  const model = options.getModelOverride?.() ?? options.modelOverride ?? this.config.getModel();
7632
7967
  const request = {
@@ -8062,15 +8397,18 @@ ${this.pendingRecoveredAgentsNotice}
8062
8397
  */
8063
8398
  async #startCronSchedulerIfNeeded() {
8064
8399
  if (this.disposed) return;
8400
+ if (this.#isAutomaticWorkHeld()) return;
8065
8401
  if (!this.config.isCronEnabled()) return;
8066
8402
  if (this.cronDisabledByTokenLimit) return;
8067
8403
  const scheduler = this.config.getCronScheduler();
8068
- try {
8069
- await scheduler.enableDurable(this.sessionId);
8070
- } catch (err) {
8071
- debugLogger6.warn(
8072
- `Durable cron init failed \u2014 persistent tasks will not fire in this session: ${err}`
8073
- );
8404
+ if (!this.requiresManagedConversationBinding) {
8405
+ try {
8406
+ await scheduler.enableDurable(this.sessionId);
8407
+ } catch (err) {
8408
+ debugLogger6.warn(
8409
+ `Durable cron init failed \u2014 persistent tasks will not fire in this session: ${err}`
8410
+ );
8411
+ }
8074
8412
  }
8075
8413
  if (this.disposed) return;
8076
8414
  if (!scheduler.hasPendingWork) return;
@@ -8146,6 +8484,7 @@ ${this.pendingRecoveredAgentsNotice}
8146
8484
  async #drainCronQueue() {
8147
8485
  if (this.disposed) return;
8148
8486
  if (this.closing) return;
8487
+ if (this.#isAutomaticWorkHeld()) return;
8149
8488
  if (this.cronProcessing) return;
8150
8489
  if (this.pendingPrompt) return;
8151
8490
  if (this.goalProcessing) return;
@@ -8158,6 +8497,7 @@ ${this.pendingRecoveredAgentsNotice}
8158
8497
  }
8159
8498
  async #drainCronQueueExclusive() {
8160
8499
  if (this.disposed || this.closing || this.cronProcessing) return;
8500
+ if (this.#isAutomaticWorkHeld()) return;
8161
8501
  if (this.pendingPrompt || this.notificationProcessing) return;
8162
8502
  if (this.#deferAutomaticQueueDrainUntilTurnsSettle()) return;
8163
8503
  if (this.#nextCronQueueIndex() < 0) return;
@@ -8234,11 +8574,13 @@ ${this.pendingRecoveredAgentsNotice}
8234
8574
  * `_meta.source='cron'`, streams the model response, and handles tool calls.
8235
8575
  */
8236
8576
  async #executeCronPrompt(item) {
8237
- return runWithInvocationContext(
8238
- void 0,
8239
- () => sessionIdContext.run(
8240
- this.config.getSessionId(),
8241
- () => this.#executeCronPromptInner(item)
8577
+ return goalTurnContext.exit(
8578
+ () => runWithInvocationContext(
8579
+ void 0,
8580
+ () => sessionIdContext.run(
8581
+ this.config.getSessionId(),
8582
+ () => this.#executeCronPromptInner(item)
8583
+ )
8242
8584
  )
8243
8585
  );
8244
8586
  }
@@ -8751,6 +9093,7 @@ ${this.pendingRecoveredAgentsNotice}
8751
9093
  async #drainNotificationQueue() {
8752
9094
  if (this.disposed) return;
8753
9095
  if (this.closing) return;
9096
+ if (this.#isAutomaticWorkHeld()) return;
8754
9097
  if (this.notificationProcessing) return;
8755
9098
  if (this.pendingPrompt || this.goalProcessing || this.cronProcessing || this.cronAbortController) {
8756
9099
  return;
@@ -8764,6 +9107,7 @@ ${this.pendingRecoveredAgentsNotice}
8764
9107
  }
8765
9108
  async #drainNotificationQueueExclusive() {
8766
9109
  if (this.disposed || this.closing || this.notificationProcessing) return;
9110
+ if (this.#isAutomaticWorkHeld()) return;
8767
9111
  if (this.pendingPrompt || this.cronProcessing || this.cronAbortController) {
8768
9112
  return;
8769
9113
  }
@@ -8800,11 +9144,13 @@ ${this.pendingRecoveredAgentsNotice}
8800
9144
  this.currentShellNotificationActive = item.kind === "shell";
8801
9145
  this.#activeWorkChanged();
8802
9146
  try {
8803
- await runWithInvocationContext(
8804
- void 0,
8805
- () => sessionIdContext.run(
8806
- this.config.getSessionId(),
8807
- () => this.#executeBackgroundNotificationPromptInner(item)
9147
+ await goalTurnContext.exit(
9148
+ () => runWithInvocationContext(
9149
+ void 0,
9150
+ () => sessionIdContext.run(
9151
+ this.config.getSessionId(),
9152
+ () => this.#executeBackgroundNotificationPromptInner(item)
9153
+ )
8808
9154
  )
8809
9155
  );
8810
9156
  } finally {
@@ -9183,12 +9529,17 @@ ${this.pendingRecoveredAgentsNotice}
9183
9529
  reloadSkillSettings() {
9184
9530
  this.settings.reloadScopeFromDisk("Workspace" /* Workspace */);
9185
9531
  }
9186
- async sendAvailableCommandsUpdateOrThrow() {
9187
- const { availableCommands, availableSkills, availableSkillDetails } = await buildAvailableCommandsSnapshot(
9532
+ buildAvailableCommandsSnapshot() {
9533
+ return buildAvailableCommandsSnapshot(
9188
9534
  this.config,
9189
9535
  void 0,
9190
- this.settings
9536
+ this.settings,
9537
+ this.slashCommandPolicy
9191
9538
  );
9539
+ }
9540
+ async sendAvailableCommandsUpdateOrThrow() {
9541
+ if (this.#isAutomaticWorkHeld()) return;
9542
+ const { availableCommands, availableSkills, availableSkillDetails } = await this.buildAvailableCommandsSnapshot();
9192
9543
  const update = {
9193
9544
  sessionUpdate: "available_commands_update",
9194
9545
  availableCommands,
@@ -9331,7 +9682,8 @@ ${this.pendingRecoveredAgentsNotice}
9331
9682
  }).catch((error) => {
9332
9683
  debugLogger6.debug("model-update extNotification failed", error);
9333
9684
  });
9334
- if (options.persistDefault ?? true) {
9685
+ const persistDefault = !this.requiresManagedConversationBinding && (options.persistDefault ?? true);
9686
+ if (persistDefault) {
9335
9687
  const persistScope = getPersistScopeForModelSelection(this.settings);
9336
9688
  this.settings.setValue(
9337
9689
  persistScope,
@@ -9455,11 +9807,16 @@ ${this.pendingRecoveredAgentsNotice}
9455
9807
  if (record.skipPersistence === true || this.#shouldSkipRestoredAskUserQuestionPersistence(record.callId)) {
9456
9808
  return;
9457
9809
  }
9458
- this.config.getChatRecordingService()?.recordToolResult(finalized[index].responseParts, {
9459
- ...record.metadata,
9460
- persistedOutputFiles: finalized[index].persistedOutputFiles,
9461
- artifacts: finalized[index].artifacts
9462
- });
9810
+ const goalProvenance = ambientGoalToolResultProvenance(record.toolName);
9811
+ this.config.getChatRecordingService()?.recordToolResult(
9812
+ finalized[index].responseParts,
9813
+ {
9814
+ ...record.metadata,
9815
+ persistedOutputFiles: finalized[index].persistedOutputFiles,
9816
+ artifacts: finalized[index].artifacts
9817
+ },
9818
+ ...goalProvenance ? [goalProvenance] : []
9819
+ );
9463
9820
  });
9464
9821
  return {
9465
9822
  ...result,
@@ -9943,13 +10300,13 @@ ${this.pendingRecoveredAgentsNotice}
9943
10300
  /**
9944
10301
  * Assemble the per-turn system reminders the model needs to see at the
9945
10302
  * start of a user query or cron fire. Mirrors the subagent/plan/arena
9946
- * branches in `GeminiClient.sendMessageStream` (`client.ts:848-878`) —
10303
+ * branches in `LlmClient.sendMessageStream` (`client.ts:848-878`) —
9947
10304
  * the ACP path bypasses that code, so without this helper plan mode is
9948
10305
  * silently inert and subagent/arena sessions lose context.
9949
10306
  *
9950
10307
  * Scope note: the `relevantAutoMemory` reminder is intentionally NOT
9951
10308
  * included here. Managed auto-memory requires a prefetch pipeline that
9952
- * lives in `GeminiClient`, and porting it into the ACP path is tracked
10309
+ * lives in `LlmClient`, and porting it into the ACP path is tracked
9953
10310
  * separately as part of the broader middleware-alignment work.
9954
10311
  */
9955
10312
  async #buildInitialSystemReminders() {
@@ -10231,6 +10588,18 @@ ${this.pendingRecoveredAgentsNotice}
10231
10588
  const isAgentTool = tool.name === ToolNames.AGENT;
10232
10589
  const isExitPlanModeTool = tool.name === ToolNames.EXIT_PLAN_MODE;
10233
10590
  const isEnterPlanModeTool = tool.name === ToolNames.ENTER_PLAN_MODE;
10591
+ const requestsAgentWorkingDirectory = isAgentTool && (args["isolation"] === "worktree" || typeof args["working_dir"] === "string" && args["working_dir"].trim().length > 0);
10592
+ if (this.requiresManagedConversationBinding && (requestsAgentWorkingDirectory || tool.name === ToolNames.ENTER_WORKTREE || tool.name === ToolNames.EXIT_WORKTREE)) {
10593
+ return earlyErrorResponse(
10594
+ new Error(STANDALONE_WORKTREE_ACTION_ERROR),
10595
+ toolName,
10596
+ {
10597
+ status: "error",
10598
+ errorType: "execution_denied" /* EXECUTION_DENIED */,
10599
+ executionStatus: "not_started"
10600
+ }
10601
+ );
10602
+ }
10234
10603
  if (isAgentTool) {
10235
10604
  agentToolAbortController = new AbortController();
10236
10605
  activeToolAbortSignal = agentToolAbortController.signal;
@@ -10270,7 +10639,8 @@ ${this.pendingRecoveredAgentsNotice}
10270
10639
  agentToolAbortController?.abort(USER_CANCEL_ABORT_REASON);
10271
10640
  onStopAfterPermissionCancel?.();
10272
10641
  },
10273
- (params, signal) => this.#requestPermissionQueued(params, signal)
10642
+ (params, signal) => this.#requestPermissionQueued(params, signal),
10643
+ this.requiresManagedConversationBinding ? STANDALONE_PERMISSION_PERSISTENCE_POLICY : void 0
10274
10644
  );
10275
10645
  subAgentCleanupFunctions = subSubAgentTracker.setup(
10276
10646
  taskEventEmitter,
@@ -10398,7 +10768,7 @@ ${this.pendingRecoveredAgentsNotice}
10398
10768
  if (!autoModeAllowed && !requiresUserInteraction && shouldRunAutoModeForCall(approvalMode, policyToolName)) {
10399
10769
  const denialState = this.config.getAutoModeDenialState();
10400
10770
  const fallback = shouldFallback(denialState);
10401
- const messages = this.config.getGeminiClient?.()?.getHistoryTail(MAX_TRANSCRIPT_MESSAGES, false) ?? [];
10771
+ const messages = this.config.getLlmClient?.()?.getHistoryTail(MAX_TRANSCRIPT_MESSAGES, false) ?? [];
10402
10772
  const decision = await evaluateAutoMode({
10403
10773
  ctx: pmCtx,
10404
10774
  pmForcedAsk,
@@ -10688,7 +11058,8 @@ ${this.pendingRecoveredAgentsNotice}
10688
11058
  }
10689
11059
  const permissionOptions = toPermissionOptions(
10690
11060
  confirmationDetails,
10691
- pmForcedAsk
11061
+ pmForcedAsk,
11062
+ this.requiresManagedConversationBinding ? STANDALONE_PERMISSION_PERSISTENCE_POLICY : void 0
10692
11063
  );
10693
11064
  const offeredPermissionOptions = permissionOptions.map(
10694
11065
  (option) => ({ ...option })
@@ -10841,7 +11212,7 @@ ${this.pendingRecoveredAgentsNotice}
10841
11212
  const modeUpdateCancellation = cancelBeforeExecutionIfAborted(toolName);
10842
11213
  if (modeUpdateCancellation) return modeUpdateCancellation;
10843
11214
  }
10844
- if (outcome === "proceed_always" /* ProceedAlways */ || outcome === "proceed_always_project" /* ProceedAlwaysProject */ || outcome === "proceed_always_user" /* ProceedAlwaysUser */) {
11215
+ if (outcome === "proceed_always_project" /* ProceedAlwaysProject */ || outcome === "proceed_always_user" /* ProceedAlwaysUser */) {
10845
11216
  await persistPermissionOutcome(
10846
11217
  outcome,
10847
11218
  confirmationDetails,
@@ -11479,6 +11850,9 @@ ${this.pendingRecoveredAgentsNotice}
11479
11850
  executionStatus
11480
11851
  });
11481
11852
  } finally {
11853
+ if (terminalStatus && terminalStatus !== "cancelled") {
11854
+ this.config.getLlmClient().recordCompletedToolCall(toolName, args);
11855
+ }
11482
11856
  if (terminalStatus === "cancelled") {
11483
11857
  endToolSpan(toolSpan, { success: false, cancelled: true });
11484
11858
  } else {
@@ -11551,6 +11925,13 @@ ${this.pendingRecoveredAgentsNotice}
11551
11925
  return null;
11552
11926
  }
11553
11927
  case "unsupported": {
11928
+ if (result.originalType === "unsupported_action") {
11929
+ throw new RequestError(
11930
+ -32004,
11931
+ "This action is not supported in this standalone session.",
11932
+ { errorKind: "unsupported_action" }
11933
+ );
11934
+ }
11554
11935
  const unsupportedError = `Slash command not supported in ACP integration: ${result.reason}`;
11555
11936
  throw new Error(unsupportedError);
11556
11937
  }
@@ -13706,7 +14087,8 @@ function getSessionSource(params) {
13706
14087
  }
13707
14088
  return {
13708
14089
  sourceType: value["sourceType"],
13709
- ...typeof value["sourceId"] === "string" ? { sourceId: value["sourceId"] } : {}
14090
+ ...typeof value["sourceId"] === "string" ? { sourceId: value["sourceId"] } : {},
14091
+ ...value[DAEMON_OWNED_STANDALONE_CREATION_KEY] === true ? { daemonOwnedStandaloneCreation: true } : {}
13710
14092
  };
13711
14093
  }
13712
14094
  __name(getSessionSource, "getSessionSource");
@@ -14524,7 +14906,7 @@ function readScopeSettings(settings, scope) {
14524
14906
  }
14525
14907
  __name(readScopeSettings, "readScopeSettings");
14526
14908
  async function resolvePreferredMemoryFile(dir, fallbackFilename) {
14527
- for (const filename of getAllGeminiMdFilenames()) {
14909
+ for (const filename of getAllMemoryFilenames()) {
14528
14910
  const filePath = path6.join(dir, filename);
14529
14911
  try {
14530
14912
  await fs3.access(filePath);
@@ -14536,7 +14918,7 @@ async function resolvePreferredMemoryFile(dir, fallbackFilename) {
14536
14918
  }
14537
14919
  __name(resolvePreferredMemoryFile, "resolvePreferredMemoryFile");
14538
14920
  async function resolveQwenMemoryPaths(params) {
14539
- const fallbackFilename = getAllGeminiMdFilenames()[0] ?? "QWEN.md";
14921
+ const fallbackFilename = getAllMemoryFilenames()[0] ?? "QWEN.md";
14540
14922
  const userMemoryFile = await resolvePreferredMemoryFile(
14541
14923
  Storage.getGlobalQwenDir(),
14542
14924
  fallbackFilename
@@ -14760,7 +15142,7 @@ async function runAcpAgent(config, settings, argv, options) {
14760
15142
  beginAcpBootstrapConfigProfiling();
14761
15143
  try {
14762
15144
  await config.initialize({
14763
- skipGeminiInitialization: true,
15145
+ skipLlmInitialization: true,
14764
15146
  // Bootstrap skips MCP discovery — each session runs its own
14765
15147
  // pool-routed discovery, so bootstrap-level spawns would be
14766
15148
  // redundant subprocess leaks (W119).
@@ -15152,6 +15534,100 @@ function isOwnerOnlyDirectory(stats) {
15152
15534
  return (stats.mode & 63) === 0;
15153
15535
  }
15154
15536
  __name(isOwnerOnlyDirectory, "isOwnerOnlyDirectory");
15537
+ function hasOnlyKeys(value, keys) {
15538
+ const actual = Object.keys(value).sort();
15539
+ const expected = [...keys].sort();
15540
+ return actual.length === expected.length && actual.every((key, index) => key === expected[index]);
15541
+ }
15542
+ __name(hasOnlyKeys, "hasOnlyKeys");
15543
+ function isManagedConversationPath(value) {
15544
+ return typeof value === "string" && value.length > 0 && !value.includes("\0") && path6.isAbsolute(value);
15545
+ }
15546
+ __name(isManagedConversationPath, "isManagedConversationPath");
15547
+ function isManagedConversationIdentityNumber(value) {
15548
+ return typeof value === "number" && Number.isSafeInteger(value) && value >= 0;
15549
+ }
15550
+ __name(isManagedConversationIdentityNumber, "isManagedConversationIdentityNumber");
15551
+ function parseConversationDirectoryExpectation(value) {
15552
+ if (value === void 0) return void 0;
15553
+ if (!isObjectRecord(value) || !hasOnlyKeys(value, ["canonicalSessionId", "root", "child"])) {
15554
+ throw RequestError.invalidParams(
15555
+ void 0,
15556
+ "Invalid managed conversation directory expectation"
15557
+ );
15558
+ }
15559
+ const canonicalSessionId = value["canonicalSessionId"];
15560
+ const root = value["root"];
15561
+ const child = value["child"];
15562
+ const parsedSessionId = parseCallerSuppliedSessionId(canonicalSessionId);
15563
+ 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(
15564
+ path6.dirname(child["canonicalPath"]),
15565
+ root["canonicalPath"]
15566
+ ) || path6.basename(child["canonicalPath"]) !== child["name"]) {
15567
+ throw RequestError.invalidParams(
15568
+ void 0,
15569
+ "Invalid managed conversation directory expectation"
15570
+ );
15571
+ }
15572
+ return {
15573
+ canonicalSessionId,
15574
+ root: {
15575
+ canonicalPath: root["canonicalPath"],
15576
+ device: root["device"],
15577
+ inode: root["inode"]
15578
+ },
15579
+ child: {
15580
+ name: child["name"],
15581
+ canonicalPath: child["canonicalPath"],
15582
+ device: child["device"],
15583
+ inode: child["inode"]
15584
+ }
15585
+ };
15586
+ }
15587
+ __name(parseConversationDirectoryExpectation, "parseConversationDirectoryExpectation");
15588
+ function managedConversationDirectoryError(missing) {
15589
+ return new RequestError(
15590
+ -32004,
15591
+ missing ? "The standalone working directory is missing." : "The standalone working directory identity is compromised.",
15592
+ {
15593
+ errorKind: missing ? "working_directory_missing" : "working_directory_compromised"
15594
+ }
15595
+ );
15596
+ }
15597
+ __name(managedConversationDirectoryError, "managedConversationDirectoryError");
15598
+ async function assertManagedConversationDirectoryIdentity(expectation) {
15599
+ let rootBefore;
15600
+ let canonicalRoot;
15601
+ let rootAfter;
15602
+ try {
15603
+ rootBefore = await fs3.lstat(expectation.root.canonicalPath);
15604
+ canonicalRoot = await fs3.realpath(expectation.root.canonicalPath);
15605
+ rootAfter = await fs3.lstat(canonicalRoot);
15606
+ } catch (error) {
15607
+ throw managedConversationDirectoryError(
15608
+ error.code === "ENOENT"
15609
+ );
15610
+ }
15611
+ 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) {
15612
+ throw managedConversationDirectoryError(false);
15613
+ }
15614
+ let childBefore;
15615
+ let canonicalChild;
15616
+ let childAfter;
15617
+ try {
15618
+ childBefore = await fs3.lstat(expectation.child.canonicalPath);
15619
+ canonicalChild = await fs3.realpath(expectation.child.canonicalPath);
15620
+ childAfter = await fs3.lstat(canonicalChild);
15621
+ } catch (error) {
15622
+ throw managedConversationDirectoryError(
15623
+ error.code === "ENOENT"
15624
+ );
15625
+ }
15626
+ 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) {
15627
+ throw managedConversationDirectoryError(false);
15628
+ }
15629
+ }
15630
+ __name(assertManagedConversationDirectoryIdentity, "assertManagedConversationDirectoryIdentity");
15155
15631
  var QwenAgent = class {
15156
15632
  constructor(config, settings, argv, connection, expectedPrivateParentCapability, sessionWriterLeaseEnabledAtStartup = false, managedToolInvocationGuard, externalToolGuardProviderAttached = false) {
15157
15633
  this.config = config;
@@ -15447,9 +15923,9 @@ var QwenAgent = class {
15447
15923
  const registry = config.getToolRegistry();
15448
15924
  if (operation === "discover") {
15449
15925
  await registry?.discoverToolsForServer(serverName);
15450
- const geminiClient = config.getGeminiClient?.();
15451
- if (geminiClient?.isInitialized?.()) {
15452
- await geminiClient.setTools?.();
15926
+ const llmClient = config.getLlmClient?.();
15927
+ if (llmClient?.isInitialized?.()) {
15928
+ await llmClient.setTools?.();
15453
15929
  }
15454
15930
  } else if (operation === "disable") {
15455
15931
  await registry?.disableMcpServer(serverName);
@@ -15519,7 +15995,7 @@ var QwenAgent = class {
15519
15995
  config.setMcpTransportPool(this.mcpPool);
15520
15996
  try {
15521
15997
  await config.initialize({
15522
- skipGeminiInitialization: true,
15998
+ skipLlmInitialization: true,
15523
15999
  skipFileCheckpointing: true,
15524
16000
  skipHooks: true,
15525
16001
  skipSkillManager: true,
@@ -15635,9 +16111,9 @@ var QwenAgent = class {
15635
16111
  }
15636
16112
  await Promise.all(
15637
16113
  this.getLiveMcpConfigs(serverName).map(async (config) => {
15638
- const geminiClient = config.getGeminiClient?.();
15639
- if (geminiClient?.isInitialized?.()) {
15640
- await geminiClient.setTools?.();
16114
+ const llmClient = config.getLlmClient?.();
16115
+ if (llmClient?.isInitialized?.()) {
16116
+ await llmClient.setTools?.();
15641
16117
  }
15642
16118
  })
15643
16119
  );
@@ -16046,7 +16522,7 @@ var QwenAgent = class {
16046
16522
  }
16047
16523
  this.clientCapabilities = args.clientCapabilities;
16048
16524
  const authMethods = buildAuthMethods();
16049
- const version = "0.22.2-preview.1";
16525
+ const version = "0.22.3";
16050
16526
  const response = {
16051
16527
  protocolVersion: PROTOCOL_VERSION,
16052
16528
  agentInfo: {
@@ -16183,6 +16659,15 @@ var QwenAgent = class {
16183
16659
  const releaseStartingSessionId = requestedSessionId ? this.reserveStartingSessionId(requestedSessionId) : void 0;
16184
16660
  try {
16185
16661
  const sessionSource = getSessionSource(params);
16662
+ const provisionalStandalone = isReservedStandaloneSessionSourceType(
16663
+ sessionSource?.sourceType
16664
+ );
16665
+ if (sessionSource && isReservedStandaloneSessionSourceType(sessionSource.sourceType) && (sessionSource.daemonOwnedStandaloneCreation !== true || !this.isTrustedManagedParent())) {
16666
+ throw RequestError.invalidParams(
16667
+ void 0,
16668
+ "`standalone` is reserved for daemon-owned session creation"
16669
+ );
16670
+ }
16186
16671
  const parentContext = extractDaemonTraceContext(params);
16187
16672
  return await withDaemonSpan(
16188
16673
  "qwen-code.daemon.session_start",
@@ -16208,14 +16693,21 @@ var QwenAgent = class {
16208
16693
  );
16209
16694
  let session;
16210
16695
  try {
16211
- await profiler.time("auth", () => this.ensureAuthenticated(config));
16212
- profiler.timeSync(
16213
- "file_system_setup",
16214
- () => this.setupFileSystem(config)
16215
- );
16696
+ if (!provisionalStandalone) {
16697
+ await profiler.time(
16698
+ "auth",
16699
+ () => this.ensureAuthenticated(config)
16700
+ );
16701
+ profiler.timeSync(
16702
+ "file_system_setup",
16703
+ () => this.setupFileSystem(config)
16704
+ );
16705
+ }
16216
16706
  session = await profiler.time(
16217
16707
  "session_register",
16218
- () => this.createAndStoreSession(config, settings)
16708
+ () => this.createAndStoreSession(config, settings, void 0, {
16709
+ deferWorkspaceActivation: provisionalStandalone
16710
+ })
16219
16711
  );
16220
16712
  } catch (error) {
16221
16713
  return this.cleanupAfterRequestFailure(error, async () => {
@@ -16259,6 +16751,15 @@ var QwenAgent = class {
16259
16751
  async loadSessionWithProfiler(params, initialSessionId, profiler) {
16260
16752
  let sessionId = initialSessionId;
16261
16753
  const sessionSource = getSessionSource(params);
16754
+ const provisionalStandalone = isReservedStandaloneSessionSourceType(
16755
+ sessionSource?.sourceType
16756
+ );
16757
+ if (provisionalStandalone && (sessionSource?.daemonOwnedStandaloneCreation !== true || !this.isTrustedManagedParent())) {
16758
+ throw RequestError.invalidParams(
16759
+ void 0,
16760
+ "`standalone` is reserved for daemon-owned session restore"
16761
+ );
16762
+ }
16262
16763
  const restoreOptions = loadRestoreOptions(params);
16263
16764
  const suppressRestoreAskUserQuestion = params._meta?.[DAEMON_SUPPRESS_RESTORE_ASK_USER_QUESTION_META_KEY] === true;
16264
16765
  const withRestoreHint = /* @__PURE__ */ __name((session, response) => suppressRestoreAskUserQuestion ? response : this.withAskUserQuestionRestoreHint(session, response), "withRestoreHint");
@@ -16421,21 +16922,37 @@ var QwenAgent = class {
16421
16922
  } : {}
16422
16923
  })), "buildResponse");
16423
16924
  try {
16424
- await profiler.time(
16425
- "restore_session_model",
16426
- () => restoreSessionModelThenAuthenticate(
16427
- config,
16428
- projection,
16429
- () => profiler.time("auth", () => this.ensureAuthenticated(config))
16430
- )
16431
- );
16432
- profiler.timeSync(
16433
- "file_system_setup",
16434
- () => this.setupFileSystem(config)
16435
- );
16925
+ if (!provisionalStandalone) {
16926
+ await profiler.time(
16927
+ "restore_session_model",
16928
+ () => restoreSessionModelThenAuthenticate(
16929
+ config,
16930
+ projection,
16931
+ () => profiler.time("auth", () => this.ensureAuthenticated(config))
16932
+ )
16933
+ );
16934
+ profiler.timeSync(
16935
+ "file_system_setup",
16936
+ () => this.setupFileSystem(config)
16937
+ );
16938
+ }
16436
16939
  await profiler.time(
16437
16940
  "session_register",
16438
16941
  () => this.createAndStoreSession(config, settings, void 0, {
16942
+ deferWorkspaceActivation: provisionalStandalone,
16943
+ ...provisionalStandalone ? {
16944
+ beforeDeferredWorkspaceActivation: /* @__PURE__ */ __name(() => profiler.time(
16945
+ "restore_session_model",
16946
+ () => restoreSessionModelThenAuthenticate(
16947
+ config,
16948
+ projection,
16949
+ () => profiler.time(
16950
+ "auth",
16951
+ () => this.ensureAuthenticated(config)
16952
+ )
16953
+ )
16954
+ ), "beforeDeferredWorkspaceActivation")
16955
+ } : {},
16439
16956
  enableLiveScreenContext: isCompatibleLiveSessionSource(
16440
16957
  sessionSource ?? {}
16441
16958
  ),
@@ -16581,7 +17098,9 @@ var QwenAgent = class {
16581
17098
  }
16582
17099
  }
16583
17100
  await profiler.time("post_replay_services", async () => {
16584
- await this.#restoreWorktreeOnResume(config, createdSession);
17101
+ if (!provisionalStandalone) {
17102
+ await this.#restoreWorktreeOnResume(config, createdSession);
17103
+ }
16585
17104
  await this.#restoreBackgroundAgentsOnResume(
16586
17105
  config,
16587
17106
  createdSession
@@ -16630,6 +17149,15 @@ var QwenAgent = class {
16630
17149
  async resumeSessionWithProfiler(params, initialSessionId, profiler) {
16631
17150
  let sessionId = initialSessionId;
16632
17151
  const sessionSource = getSessionSource(params);
17152
+ const provisionalStandalone = isReservedStandaloneSessionSourceType(
17153
+ sessionSource?.sourceType
17154
+ );
17155
+ if (provisionalStandalone && (sessionSource?.daemonOwnedStandaloneCreation !== true || !this.isTrustedManagedParent())) {
17156
+ throw RequestError.invalidParams(
17157
+ void 0,
17158
+ "`standalone` is reserved for daemon-owned session restore"
17159
+ );
17160
+ }
16633
17161
  const suppressRestoreAskUserQuestion = params._meta?.[DAEMON_SUPPRESS_RESTORE_ASK_USER_QUESTION_META_KEY] === true;
16634
17162
  const withRestoreHint = /* @__PURE__ */ __name((session, response) => suppressRestoreAskUserQuestion ? response : this.withAskUserQuestionRestoreHint(session, response), "withRestoreHint");
16635
17163
  const liveSession = this.sessions.get(sessionId);
@@ -16700,21 +17228,37 @@ var QwenAgent = class {
16700
17228
  const projection = config.consumeSessionRestoreProjection?.();
16701
17229
  let response;
16702
17230
  try {
16703
- await profiler.time(
16704
- "restore_session_model",
16705
- () => restoreSessionModelThenAuthenticate(
16706
- config,
16707
- projection,
16708
- () => profiler.time("auth", () => this.ensureAuthenticated(config))
16709
- )
16710
- );
16711
- profiler.timeSync(
16712
- "file_system_setup",
16713
- () => this.setupFileSystem(config)
16714
- );
17231
+ if (!provisionalStandalone) {
17232
+ await profiler.time(
17233
+ "restore_session_model",
17234
+ () => restoreSessionModelThenAuthenticate(
17235
+ config,
17236
+ projection,
17237
+ () => profiler.time("auth", () => this.ensureAuthenticated(config))
17238
+ )
17239
+ );
17240
+ profiler.timeSync(
17241
+ "file_system_setup",
17242
+ () => this.setupFileSystem(config)
17243
+ );
17244
+ }
16715
17245
  await profiler.time(
16716
17246
  "session_register",
16717
17247
  () => this.createAndStoreSession(config, settings, void 0, {
17248
+ deferWorkspaceActivation: provisionalStandalone,
17249
+ ...provisionalStandalone ? {
17250
+ beforeDeferredWorkspaceActivation: /* @__PURE__ */ __name(() => profiler.time(
17251
+ "restore_session_model",
17252
+ () => restoreSessionModelThenAuthenticate(
17253
+ config,
17254
+ projection,
17255
+ () => profiler.time(
17256
+ "auth",
17257
+ () => this.ensureAuthenticated(config)
17258
+ )
17259
+ )
17260
+ ), "beforeDeferredWorkspaceActivation")
17261
+ } : {},
16718
17262
  enableLiveScreenContext: isCompatibleLiveSessionSource(
16719
17263
  sessionSource ?? {}
16720
17264
  ),
@@ -16738,7 +17282,9 @@ var QwenAgent = class {
16738
17282
  }, "primeSession"),
16739
17283
  beforeStartPostReplayServices: /* @__PURE__ */ __name(async (createdSession) => {
16740
17284
  await profiler.time("post_replay_services", async () => {
16741
- await this.#restoreWorktreeOnResume(config, createdSession);
17285
+ if (!provisionalStandalone) {
17286
+ await this.#restoreWorktreeOnResume(config, createdSession);
17287
+ }
16742
17288
  await this.#restoreBackgroundAgentsOnResume(
16743
17289
  config,
16744
17290
  createdSession
@@ -16874,15 +17420,17 @@ var QwenAgent = class {
16874
17420
  break;
16875
17421
  }
16876
17422
  case "reasoning_effort": {
17423
+ const generation = session.getConfig().getContentGeneratorConfig();
17424
+ const thinkingMandatory = generation.thinkingMandatory === true;
16877
17425
  const modelReasoning = this.getModelReasoningConfiguration(
16878
17426
  session.getConfig()
16879
17427
  );
16880
17428
  if (modelReasoning) {
16881
17429
  const effortValues = modelReasoning.toggleOnly ? void 0 : modelReasoning.efforts;
16882
- const selected = value === REASONING_EFFORT_NONE ? REASONING_EFFORT_NONE : modelReasoning.toggleOnly ? value === REASONING_EFFORT_DEFAULT ? REASONING_EFFORT_DEFAULT : void 0 : effortValues?.find((effort2) => effort2 === value);
17430
+ const selected = value === REASONING_EFFORT_NONE && !thinkingMandatory ? REASONING_EFFORT_NONE : modelReasoning.toggleOnly ? value === REASONING_EFFORT_DEFAULT ? REASONING_EFFORT_DEFAULT : void 0 : effortValues?.find((effort2) => effort2 === value);
16883
17431
  if (!selected) {
16884
17432
  const choices = [
16885
- REASONING_EFFORT_NONE,
17433
+ ...thinkingMandatory ? [] : [REASONING_EFFORT_NONE],
16886
17434
  ...effortValues ?? [REASONING_EFFORT_DEFAULT]
16887
17435
  ];
16888
17436
  throw RequestError.invalidParams(
@@ -16890,7 +17438,17 @@ var QwenAgent = class {
16890
17438
  `Unknown reasoning effort: ${value}. Choose one of: ${choices.join(", ")}`
16891
17439
  );
16892
17440
  }
16893
- const generation = session.getConfig().getContentGeneratorConfig();
17441
+ if (!modelReasoning.toggleOnly) {
17442
+ for (const source of ["extra_body", "samplingParams"]) {
17443
+ const layer = generation[source];
17444
+ if (!layer) continue;
17445
+ const next = { ...layer };
17446
+ delete next["enable_thinking"];
17447
+ delete next["reasoning_effort"];
17448
+ delete next["thinking_budget"];
17449
+ generation[source] = next;
17450
+ }
17451
+ }
16894
17452
  if (selected === REASONING_EFFORT_NONE) {
16895
17453
  generation.reasoning = false;
16896
17454
  } else if (selected === REASONING_EFFORT_DEFAULT) {
@@ -17774,18 +18332,17 @@ var QwenAgent = class {
17774
18332
  for (const extension of config.getExtensions()) {
17775
18333
  if (extension.isActive) continue;
17776
18334
  for (const skill of extension.skills ?? []) {
17777
- const extensionName = extension.displayName ?? extension.name;
18335
+ const extensionName = extension.name;
17778
18336
  const key = `extension:${extensionName}:${skill.name}`;
17779
- if (skillsByKey.has(`extension:${extension.name}:${skill.name}`) || skillsByKey.has(key)) {
17780
- continue;
17781
- }
18337
+ if (skillsByKey.has(key)) continue;
17782
18338
  skillsByKey.set(
17783
18339
  key,
17784
18340
  mapSkillConfigToStatus(
17785
18341
  {
17786
18342
  ...skill,
17787
18343
  level: "extension",
17788
- extensionName
18344
+ extensionName,
18345
+ extensionDisplayName: extension.displayName
17789
18346
  },
17790
18347
  disablements,
17791
18348
  { disabled: true }
@@ -17844,7 +18401,13 @@ var QwenAgent = class {
17844
18401
  providers.set(authType, provider);
17845
18402
  }
17846
18403
  const isCurrent = currentAuth === model.authType && currentAcpModelId === modelId;
17847
- const configOptions = model.isRuntimeModel || modelId.startsWith(ACP_ROUTE_ID_PREFIX) ? void 0 : buildModelReasoningConfigPreview(model.id);
18404
+ const configOptions = model.isRuntimeModel || modelId.startsWith(ACP_ROUTE_ID_PREFIX) ? void 0 : buildModelReasoningConfigPreview(model.id, {
18405
+ thinkingMandatory: config.getResolvedModelConfig?.(
18406
+ model.authType,
18407
+ model.id,
18408
+ model.registryBaseUrl ?? model.baseUrl
18409
+ )?.generationConfig.thinkingMandatory === true
18410
+ });
17848
18411
  const providerModel = {
17849
18412
  modelId,
17850
18413
  baseModelId: parseAcpBaseModelId(effectiveModelId),
@@ -18299,7 +18862,7 @@ var QwenAgent = class {
18299
18862
  }
18300
18863
  async buildSessionSupportedCommandsStatus(sessionId) {
18301
18864
  const session = this.sessionOrThrow(sessionId);
18302
- const { availableCommands, availableSkills } = await buildAvailableCommandsSnapshot(session.getConfig());
18865
+ const { availableCommands, availableSkills } = await session.buildAvailableCommandsSnapshot();
18303
18866
  return {
18304
18867
  v: STATUS_SCHEMA_VERSION,
18305
18868
  sessionId,
@@ -18344,12 +18907,26 @@ var QwenAgent = class {
18344
18907
  const now = Date.now();
18345
18908
  const createdAt = session.getCreatedAt();
18346
18909
  const models = {};
18347
- for (const [name, m] of Object.entries(metrics.models)) {
18910
+ for (const [name, rawMetrics] of Object.entries(metrics.models)) {
18911
+ const m = metrics.statsModels?.[name] ?? rawMetrics;
18348
18912
  models[name] = {
18349
18913
  api: { ...m.api },
18350
18914
  tokens: { ...m.tokens }
18351
18915
  };
18352
18916
  }
18917
+ const sources = [];
18918
+ for (const [id, source] of Object.entries(metrics.sourceMetrics ?? {})) {
18919
+ const meta = metrics.sourceMeta?.[id];
18920
+ sources.push({
18921
+ id,
18922
+ type: meta?.type ?? "",
18923
+ name: meta?.name ?? id,
18924
+ tokens: { ...source.tokens }
18925
+ });
18926
+ }
18927
+ sources.sort(
18928
+ (a, b) => b.tokens.total - a.tokens.total || a.id.localeCompare(b.id)
18929
+ );
18353
18930
  const byName = {};
18354
18931
  for (const [name, t] of Object.entries(metrics.tools.byName)) {
18355
18932
  byName[name] = {
@@ -18392,6 +18969,7 @@ var QwenAgent = class {
18392
18969
  durationMs: now - createdAt,
18393
18970
  promptCount: session.getTurnCount(),
18394
18971
  models,
18972
+ sources,
18395
18973
  tools: {
18396
18974
  totalCalls: metrics.tools.totalCalls,
18397
18975
  totalSuccess: metrics.tools.totalSuccess,
@@ -19527,9 +20105,9 @@ var QwenAgent = class {
19527
20105
  });
19528
20106
  await Promise.all(
19529
20107
  this.getLiveMcpConfigs(serverName).map(async (liveConfig) => {
19530
- const geminiClient = liveConfig.getGeminiClient?.();
19531
- if (geminiClient?.isInitialized?.()) {
19532
- await geminiClient.setTools?.();
20108
+ const llmClient = liveConfig.getLlmClient?.();
20109
+ if (llmClient?.isInitialized?.()) {
20110
+ await llmClient.setTools?.();
19533
20111
  }
19534
20112
  })
19535
20113
  );
@@ -20067,6 +20645,17 @@ var QwenAgent = class {
20067
20645
  "error" in source ? source.error : "Invalid or missing sourceType"
20068
20646
  );
20069
20647
  }
20648
+ if (isReservedStandaloneSessionSourceType(source.sourceType)) {
20649
+ const standaloneSession = this.sessionOrThrow(sessionId);
20650
+ if (params[DAEMON_OWNED_STANDALONE_CREATION_KEY] !== true || this.privateParentState !== "trusted" || !isReservedStandaloneSessionSourceType(
20651
+ standaloneSession.getConfig().getSessionSourceType()
20652
+ )) {
20653
+ throw RequestError.invalidParams(
20654
+ void 0,
20655
+ "`standalone` is reserved for daemon-owned session creation"
20656
+ );
20657
+ }
20658
+ }
20070
20659
  const session = this.sessionOrThrow(sessionId);
20071
20660
  if (isCompatibleLiveSessionSource(source)) {
20072
20661
  await session.enableLiveScreenContext();
@@ -20263,9 +20852,41 @@ var QwenAgent = class {
20263
20852
  "Invalid managed relocation capability"
20264
20853
  );
20265
20854
  }
20855
+ const conversationDirectoryExpectation = parseConversationDirectoryExpectation(
20856
+ params["conversationDirectoryExpectation"]
20857
+ );
20858
+ if (conversationDirectoryExpectation !== void 0 && managedRelocation !== "live-conversation") {
20859
+ throw RequestError.invalidParams(
20860
+ void 0,
20861
+ "Managed conversation directory expectation requires managed relocation"
20862
+ );
20863
+ }
20266
20864
  const allowedRoots = params["allowedRoots"];
20267
20865
  const session = this.sessionOrThrow(sessionId);
20268
20866
  const config = session.getConfig();
20867
+ const standalone = isReservedStandaloneSessionSourceType(
20868
+ config.getSessionSourceType()
20869
+ );
20870
+ if (standalone && (managedRelocation !== "live-conversation" || conversationDirectoryExpectation === void 0)) {
20871
+ throw RequestError.invalidParams(
20872
+ void 0,
20873
+ "Standalone relocation requires an exact managed directory expectation"
20874
+ );
20875
+ }
20876
+ if (conversationDirectoryExpectation !== void 0) {
20877
+ if (this.privateParentState !== "trusted" || conversationDirectoryExpectation.canonicalSessionId !== normalizeSessionIdForLookup(sessionId) || !Array.isArray(allowedRoots) || allowedRoots.length !== 1 || typeof allowedRoots[0] !== "string" || !isSameConversationPath(
20878
+ allowedRoots[0],
20879
+ conversationDirectoryExpectation.root.canonicalPath
20880
+ ) || !isSameConversationPath(
20881
+ targetPath,
20882
+ conversationDirectoryExpectation.child.canonicalPath
20883
+ )) {
20884
+ throw managedConversationDirectoryError(false);
20885
+ }
20886
+ await assertManagedConversationDirectoryIdentity(
20887
+ conversationDirectoryExpectation
20888
+ );
20889
+ }
20269
20890
  if (config.isRestrictiveSandbox()) {
20270
20891
  throw new RequestError(-32003, "Restrictive sandbox mode active", {
20271
20892
  errorKind: "restrictive_sandbox"
@@ -20275,18 +20896,34 @@ var QwenAgent = class {
20275
20896
  try {
20276
20897
  stats = await fs3.stat(targetPath);
20277
20898
  } catch {
20899
+ if (conversationDirectoryExpectation !== void 0) {
20900
+ throw managedConversationDirectoryError(true);
20901
+ }
20278
20902
  throw new RequestError(-32002, `Directory not found: ${targetPath}`, {
20279
20903
  errorKind: "directory_not_found",
20280
20904
  path: targetPath
20281
20905
  });
20282
20906
  }
20283
20907
  if (!stats.isDirectory()) {
20908
+ if (conversationDirectoryExpectation !== void 0) {
20909
+ throw managedConversationDirectoryError(false);
20910
+ }
20284
20911
  throw new RequestError(-32002, `Not a directory: ${targetPath}`, {
20285
20912
  errorKind: "directory_not_found",
20286
20913
  path: targetPath
20287
20914
  });
20288
20915
  }
20289
- const canonicalPath = await fs3.realpath(targetPath);
20916
+ let canonicalPath;
20917
+ try {
20918
+ canonicalPath = await fs3.realpath(targetPath);
20919
+ } catch (error) {
20920
+ if (conversationDirectoryExpectation !== void 0) {
20921
+ throw managedConversationDirectoryError(
20922
+ error.code === "ENOENT"
20923
+ );
20924
+ }
20925
+ throw error;
20926
+ }
20290
20927
  let containmentRoots = allowedRoots;
20291
20928
  let managedTrustAllowed = false;
20292
20929
  if (managedRelocation === "live-conversation") {
@@ -20311,13 +20948,22 @@ var QwenAgent = class {
20311
20948
  canonicalRoot = await fs3.realpath(rootPath);
20312
20949
  rootAfter = await fs3.lstat(canonicalRoot);
20313
20950
  } catch {
20951
+ if (conversationDirectoryExpectation !== void 0) {
20952
+ throw managedConversationDirectoryError(false);
20953
+ }
20314
20954
  throw new RequestError(
20315
20955
  -32004,
20316
20956
  "Live managed relocation requires an owner-only allowed root",
20317
20957
  { errorKind: "containment_violation", path: rootPath }
20318
20958
  );
20319
20959
  }
20320
- if (!isOwnerOnlyDirectory(rootBefore) || !isOwnerOnlyDirectory(rootAfter) || rootBefore.dev !== rootAfter.dev || rootBefore.ino !== rootAfter.ino) {
20960
+ if (!isOwnerOnlyDirectory(rootBefore) || !isOwnerOnlyDirectory(rootAfter) || rootBefore.dev !== rootAfter.dev || rootBefore.ino !== rootAfter.ino || conversationDirectoryExpectation !== void 0 && (!isSameConversationPath(
20961
+ canonicalRoot,
20962
+ conversationDirectoryExpectation.root.canonicalPath
20963
+ ) || rootAfter.dev !== conversationDirectoryExpectation.root.device || rootAfter.ino !== conversationDirectoryExpectation.root.inode)) {
20964
+ if (conversationDirectoryExpectation !== void 0) {
20965
+ throw managedConversationDirectoryError(false);
20966
+ }
20321
20967
  throw new RequestError(
20322
20968
  -32004,
20323
20969
  "Live managed relocation requires an owner-only allowed root",
@@ -20329,7 +20975,12 @@ var QwenAgent = class {
20329
20975
  try {
20330
20976
  targetBefore = await fs3.lstat(targetPath);
20331
20977
  targetAfter = await fs3.lstat(canonicalPath);
20332
- } catch {
20978
+ } catch (error) {
20979
+ if (conversationDirectoryExpectation !== void 0) {
20980
+ throw managedConversationDirectoryError(
20981
+ error.code === "ENOENT"
20982
+ );
20983
+ }
20333
20984
  throw new RequestError(
20334
20985
  -32004,
20335
20986
  "Live managed relocation requires an owner-only direct child",
@@ -20337,7 +20988,13 @@ var QwenAgent = class {
20337
20988
  );
20338
20989
  }
20339
20990
  const relativeTarget = path6.relative(canonicalRoot, canonicalPath);
20340
- 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)) {
20991
+ if (!isOwnerOnlyDirectory(targetBefore) || !isOwnerOnlyDirectory(targetAfter) || targetBefore.dev !== targetAfter.dev || targetBefore.ino !== targetAfter.ino || conversationDirectoryExpectation !== void 0 && (!isSameConversationPath(
20992
+ canonicalPath,
20993
+ conversationDirectoryExpectation.child.canonicalPath
20994
+ ) || targetAfter.dev !== conversationDirectoryExpectation.child.device || targetAfter.ino !== conversationDirectoryExpectation.child.inode) || relativeTarget.length === 0 || relativeTarget.startsWith("..") || path6.isAbsolute(relativeTarget) || relativeTarget.includes(path6.sep)) {
20995
+ if (conversationDirectoryExpectation !== void 0) {
20996
+ throw managedConversationDirectoryError(false);
20997
+ }
20341
20998
  throw new RequestError(
20342
20999
  -32004,
20343
21000
  "Live managed relocation requires an owner-only direct child",
@@ -20348,13 +21005,19 @@ var QwenAgent = class {
20348
21005
  try {
20349
21006
  rootFinal = await fs3.lstat(canonicalRoot);
20350
21007
  } catch {
21008
+ if (conversationDirectoryExpectation !== void 0) {
21009
+ throw managedConversationDirectoryError(false);
21010
+ }
20351
21011
  throw new RequestError(
20352
21012
  -32004,
20353
21013
  "Live managed relocation allowed root changed during validation",
20354
21014
  { errorKind: "containment_violation", path: canonicalRoot }
20355
21015
  );
20356
21016
  }
20357
- if (!isOwnerOnlyDirectory(rootFinal) || rootFinal.dev !== rootAfter.dev || rootFinal.ino !== rootAfter.ino) {
21017
+ if (!isOwnerOnlyDirectory(rootFinal) || rootFinal.dev !== rootAfter.dev || rootFinal.ino !== rootAfter.ino || conversationDirectoryExpectation !== void 0 && (rootFinal.dev !== conversationDirectoryExpectation.root.device || rootFinal.ino !== conversationDirectoryExpectation.root.inode)) {
21018
+ if (conversationDirectoryExpectation !== void 0) {
21019
+ throw managedConversationDirectoryError(false);
21020
+ }
20358
21021
  throw new RequestError(
20359
21022
  -32004,
20360
21023
  "Live managed relocation allowed root changed during validation",
@@ -20371,6 +21034,9 @@ var QwenAgent = class {
20371
21034
  return !rel.startsWith("..") && !path6.isAbsolute(rel);
20372
21035
  });
20373
21036
  if (!contained) {
21037
+ if (conversationDirectoryExpectation !== void 0) {
21038
+ throw managedConversationDirectoryError(false);
21039
+ }
20374
21040
  throw new RequestError(
20375
21041
  -32004,
20376
21042
  `Path outside allowed roots: ${canonicalPath}`,
@@ -20404,7 +21070,7 @@ var QwenAgent = class {
20404
21070
  );
20405
21071
  try {
20406
21072
  const settledPreviousCwd = config.getTargetDir();
20407
- if (canonicalPath === settledPreviousCwd) {
21073
+ if (canonicalPath === settledPreviousCwd && conversationDirectoryExpectation === void 0) {
20408
21074
  return {
20409
21075
  previousCwd: settledPreviousCwd,
20410
21076
  newCwd: canonicalPath,
@@ -20420,12 +21086,30 @@ var QwenAgent = class {
20420
21086
  SESSION_DRAIN_TIMEOUT_MS,
20421
21087
  "close"
20422
21088
  );
21089
+ if (conversationDirectoryExpectation !== void 0 && session.hasStandaloneRelocationBlockers()) {
21090
+ throw new RequestError(
21091
+ -32602,
21092
+ "Cannot relocate while standalone background work is active",
21093
+ { errorKind: "session_busy" }
21094
+ );
21095
+ }
20423
21096
  const warnings = [];
20424
21097
  const relocation = await config.relocateWorkingDirectory(
20425
21098
  canonicalPath,
20426
21099
  canonicalPath,
20427
21100
  { skipProcessChdir: true, skipArtifactMigration: true }
20428
21101
  );
21102
+ if (conversationDirectoryExpectation !== void 0) {
21103
+ await assertManagedConversationDirectoryIdentity(
21104
+ conversationDirectoryExpectation
21105
+ );
21106
+ session.installPendingManagedConversationBinding(
21107
+ conversationDirectoryExpectation,
21108
+ () => assertManagedConversationDirectoryIdentity(
21109
+ conversationDirectoryExpectation
21110
+ )
21111
+ );
21112
+ }
20429
21113
  if (relocation.memoryRefreshError) {
20430
21114
  warnings.push(
20431
21115
  `Memory refresh failed: ${relocation.memoryRefreshError instanceof Error ? relocation.memoryRefreshError.message : String(relocation.memoryRefreshError)}`
@@ -20437,7 +21121,7 @@ var QwenAgent = class {
20437
21121
  );
20438
21122
  }
20439
21123
  try {
20440
- await config.getGeminiClient()?.addWorkingDirectoryChangedContext(
21124
+ await config.getLlmClient()?.addWorkingDirectoryChangedContext(
20441
21125
  settledPreviousCwd,
20442
21126
  canonicalPath
20443
21127
  );
@@ -20455,6 +21139,41 @@ var QwenAgent = class {
20455
21139
  releaseGate();
20456
21140
  }
20457
21141
  }
21142
+ case SERVE_CONTROL_EXT_METHODS.sessionManagedConversationBindingCommit:
21143
+ case SERVE_CONTROL_EXT_METHODS.sessionManagedConversationBindingRelease: {
21144
+ const sessionId = params["sessionId"];
21145
+ if (typeof sessionId !== "string" || sessionId.length === 0) {
21146
+ throw RequestError.invalidParams(
21147
+ void 0,
21148
+ "Invalid or missing sessionId"
21149
+ );
21150
+ }
21151
+ if (this.privateParentState !== "trusted") {
21152
+ throw RequestError.invalidParams(
21153
+ void 0,
21154
+ "Managed conversation binding requires a trusted private ACP parent"
21155
+ );
21156
+ }
21157
+ const expectation = parseConversationDirectoryExpectation(
21158
+ params["conversationDirectoryExpectation"]
21159
+ );
21160
+ if (expectation === void 0 || expectation.canonicalSessionId !== normalizeSessionIdForLookup(sessionId)) {
21161
+ throw managedConversationDirectoryError(false);
21162
+ }
21163
+ const session = this.sessionOrThrow(sessionId);
21164
+ if (!isReservedStandaloneSessionSourceType(
21165
+ session.getConfig().getSessionSourceType()
21166
+ )) {
21167
+ throw managedConversationDirectoryError(false);
21168
+ }
21169
+ await assertManagedConversationDirectoryIdentity(expectation);
21170
+ if (method === SERVE_CONTROL_EXT_METHODS.sessionManagedConversationBindingCommit) {
21171
+ await session.commitManagedConversationBinding(expectation);
21172
+ return { sessionId, committed: true };
21173
+ }
21174
+ await session.releaseManagedConversationBinding(expectation);
21175
+ return { sessionId, released: true };
21176
+ }
20458
21177
  case SERVE_CONTROL_EXT_METHODS.sessionApprovalMode: {
20459
21178
  const sessionId = params["sessionId"];
20460
21179
  const mode = params["mode"];
@@ -20580,7 +21299,7 @@ var QwenAgent = class {
20580
21299
  );
20581
21300
  }
20582
21301
  await cfg.refreshHierarchicalMemory();
20583
- await cfg.getGeminiClient()?.refreshSystemInstruction();
21302
+ await cfg.getLlmClient()?.refreshSystemInstruction();
20584
21303
  })
20585
21304
  );
20586
21305
  const failedCount = results.filter(
@@ -20746,7 +21465,7 @@ var QwenAgent = class {
20746
21465
  }
20747
21466
  let hasHistory = false;
20748
21467
  try {
20749
- hasHistory = (config.getGeminiClient().getHistoryShallow() ?? []).length > 0;
21468
+ hasHistory = (config.getLlmClient().getHistoryShallow() ?? []).length > 0;
20750
21469
  } catch (error) {
20751
21470
  debugLogger9.debug("Failed to read history before /fork:", error);
20752
21471
  }
@@ -20779,7 +21498,7 @@ var QwenAgent = class {
20779
21498
  );
20780
21499
  }
20781
21500
  try {
20782
- config.getGeminiClient().addHistory({
21501
+ config.getLlmClient().addHistory({
20783
21502
  role: "user",
20784
21503
  parts: [
20785
21504
  {
@@ -20811,9 +21530,9 @@ var QwenAgent = class {
20811
21530
  }
20812
21531
  const session = this.sessionOrThrow(sessionId);
20813
21532
  const config = session.getConfig();
20814
- const geminiClient = config.getGeminiClient();
21533
+ const llmClient = config.getLlmClient();
20815
21534
  const outputText = typeof params["output"] === "string" ? params["output"] : "";
20816
- geminiClient.addHistory({
21535
+ llmClient.addHistory({
20817
21536
  role: "user",
20818
21537
  parts: [
20819
21538
  {
@@ -21219,7 +21938,7 @@ ${outputText}
21219
21938
  );
21220
21939
  }
21221
21940
  await runRefresh(
21222
- async () => await config.getGeminiClient()?.refreshSystemInstruction()
21941
+ async () => await config.getLlmClient()?.refreshSystemInstruction()
21223
21942
  );
21224
21943
  await runRefresh(
21225
21944
  async () => await session.sendAvailableCommandsUpdate()
@@ -21942,7 +22661,7 @@ ${outputText}
21942
22661
  );
21943
22662
  }
21944
22663
  try {
21945
- await config.getGeminiClient()?.refreshSystemInstruction();
22664
+ await config.getLlmClient()?.refreshSystemInstruction();
21946
22665
  } catch (err) {
21947
22666
  debugLogger9.warn(
21948
22667
  `reload: refreshSystemInstruction failed for session ${id}: ${err}`
@@ -22178,6 +22897,9 @@ ${outputText}
22178
22897
  }
22179
22898
  }
22180
22899
  async newSessionConfigInRuntimeContext(cwd, mcpServers, settings, sessionSource, sessionId, resume, initializeOptions = {}, chatRecording, restoreOptions) {
22900
+ const provisionalWorkspace = isReservedStandaloneSessionSourceType(
22901
+ sessionSource?.sourceType
22902
+ );
22181
22903
  const sessionMcpServers = {};
22182
22904
  for (const server of mcpServers) {
22183
22905
  const stdioServer = toStdioServer(server);
@@ -22239,6 +22961,7 @@ ${outputText}
22239
22961
  const sessionArg = resume === true ? { resume: sessionId, sessionId: void 0 } : { sessionId, resume: void 0 };
22240
22962
  const argvForSession = {
22241
22963
  ...this.argv,
22964
+ ...provisionalWorkspace ? { experimentalLsp: false } : {},
22242
22965
  // Docker sandbox relaunch injects a fixed --sandbox-session-id into
22243
22966
  // the ACP process argv. Without clearing it, every newSession()
22244
22967
  // inherits the same ID and the second session collides with the
@@ -22275,7 +22998,8 @@ ${outputText}
22275
22998
  // not process.exit(1) the shared ACP child and every session on its
22276
22999
  // channel. newSessionConfig maps the throw to a RequestError.
22277
23000
  true,
22278
- this.managedToolInvocationGuard || restoreOptions ? {
23001
+ this.managedToolInvocationGuard || restoreOptions || provisionalWorkspace ? {
23002
+ ...provisionalWorkspace ? { provisionalWorkspace: true } : {},
22279
23003
  ...this.managedToolInvocationGuard ? { toolInvocationGuard: this.managedToolInvocationGuard } : {},
22280
23004
  ...restoreOptions && sessionId ? {
22281
23005
  sessionRestore: {
@@ -22354,8 +23078,12 @@ ${outputText}
22354
23078
  () => this.cleanupUnstoredConfig(config)
22355
23079
  );
22356
23080
  }
22357
- startNonInteractiveOpenAILogHousekeeping(config, settings);
22358
- void this.surfaceMcpFailuresWhenReady(config);
23081
+ if (!provisionalWorkspace) {
23082
+ startNonInteractiveOpenAILogHousekeeping(config, settings);
23083
+ }
23084
+ if (!provisionalWorkspace) {
23085
+ void this.surfaceMcpFailuresWhenReady(config);
23086
+ }
22359
23087
  return config;
22360
23088
  }
22361
23089
  async surfaceMcpFailuresWhenReady(config) {
@@ -22411,10 +23139,10 @@ ${outputText}
22411
23139
  async createAndStoreSession(config, settings, sessionData, options = {}) {
22412
23140
  this.assertManagedSessionAdmission();
22413
23141
  const sessionId = normalizeSessionIdForLookup(config.getSessionId());
22414
- const geminiClient = config.getGeminiClient();
22415
- const needsInitialize = !geminiClient.isInitialized();
22416
- if (needsInitialize) {
22417
- await geminiClient.initialize();
23142
+ const llmClient = config.getLlmClient();
23143
+ const needsInitialize = !llmClient.isInitialized();
23144
+ if (needsInitialize && options.deferWorkspaceActivation !== true) {
23145
+ await llmClient.initialize();
22418
23146
  }
22419
23147
  this.assertManagedSessionAdmission();
22420
23148
  if (this.sessions.has(sessionId)) {
@@ -22442,11 +23170,59 @@ ${outputText}
22442
23170
  (operation) => this.runExclusiveHistoryMutation(sessionId, operation),
22443
23171
  () => this.activeWorkReporter?.notifyChanged()
22444
23172
  );
23173
+ const replaySessionHistory = /* @__PURE__ */ __name(async () => {
23174
+ if (options.replayHistory === false || !sessionData?.conversation.messages) {
23175
+ return;
23176
+ }
23177
+ await session.replayHistory(
23178
+ sessionData.conversation.messages,
23179
+ sessionData.historyGaps
23180
+ );
23181
+ try {
23182
+ await session.publishRecoveredGoalState(
23183
+ sessionData.conversation.messages
23184
+ );
23185
+ } catch (error) {
23186
+ debugLogger9.debug(
23187
+ `Failed to publish recovered Goal state: ${error instanceof Error ? error.message : String(error)}`
23188
+ );
23189
+ }
23190
+ }, "replaySessionHistory");
23191
+ if (options.deferWorkspaceActivation === true) {
23192
+ session.installManagedConversationActivation(
23193
+ async () => {
23194
+ this.assertManagedSessionAdmission();
23195
+ if (options.beforeDeferredWorkspaceActivation) {
23196
+ await options.beforeDeferredWorkspaceActivation();
23197
+ } else {
23198
+ await this.ensureAuthenticated(config);
23199
+ }
23200
+ this.assertManagedSessionAdmission();
23201
+ await config.activateProvisionalWorkspace();
23202
+ this.assertManagedSessionAdmission();
23203
+ this.setupFileSystem(config);
23204
+ config.hydrateSessionRestoreFileHistory?.();
23205
+ if (sessionData?.fileHistorySnapshots?.length) {
23206
+ config.getFileHistoryService().restoreFromSnapshots(sessionData.fileHistorySnapshots);
23207
+ }
23208
+ await replaySessionHistory();
23209
+ await options.beforeStartPostReplayServices?.(session);
23210
+ session.installRewriter();
23211
+ config.finalizeSessionRestore?.();
23212
+ startNonInteractiveOpenAILogHousekeeping(config, settings);
23213
+ },
23214
+ () => {
23215
+ void this.surfaceMcpFailuresWhenReady(config);
23216
+ }
23217
+ );
23218
+ }
22445
23219
  let published = false;
22446
23220
  try {
22447
23221
  await registerCreateSubSessionTool(config);
22448
23222
  options.primeSession?.(session);
22449
- config.hydrateSessionRestoreFileHistory?.();
23223
+ if (options.deferWorkspaceActivation !== true) {
23224
+ config.hydrateSessionRestoreFileHistory?.();
23225
+ }
22450
23226
  this.sessions.set(sessionId, session);
22451
23227
  published = true;
22452
23228
  this.activeWorkReporter?.notifyChanged();
@@ -22454,30 +23230,24 @@ ${outputText}
22454
23230
  if (options.enableLiveScreenContext) {
22455
23231
  await session.enableLiveScreenContext();
22456
23232
  }
22457
- if (sessionData?.fileHistorySnapshots?.length) {
23233
+ if (options.deferWorkspaceActivation !== true && sessionData?.fileHistorySnapshots?.length) {
22458
23234
  config.getFileHistoryService().restoreFromSnapshots(sessionData.fileHistorySnapshots);
22459
23235
  }
22460
23236
  if (sessionData?.conversation.messages) {
22461
23237
  config.getChatRecordingService()?.rebuildTurnBoundaries(sessionData.conversation.messages);
22462
23238
  }
22463
- if (options.replayHistory !== false && sessionData?.conversation.messages) {
22464
- await session.replayHistory(
22465
- sessionData.conversation.messages,
22466
- sessionData.historyGaps
22467
- );
22468
- try {
22469
- await session.publishRecoveredGoalState(
22470
- sessionData.conversation.messages
22471
- );
22472
- } catch (error) {
22473
- debugLogger9.debug(
22474
- `Failed to publish recovered Goal state: ${error instanceof Error ? error.message : String(error)}`
22475
- );
22476
- }
23239
+ if (options.deferWorkspaceActivation !== true) {
23240
+ await replaySessionHistory();
23241
+ }
23242
+ if (options.deferWorkspaceActivation !== true) {
23243
+ await options.beforeStartPostReplayServices?.(session);
23244
+ }
23245
+ if (options.deferWorkspaceActivation !== true) {
23246
+ session.installRewriter();
23247
+ }
23248
+ if (options.deferWorkspaceActivation !== true) {
23249
+ config.finalizeSessionRestore?.();
22477
23250
  }
22478
- await options.beforeStartPostReplayServices?.(session);
22479
- session.installRewriter();
22480
- config.finalizeSessionRestore?.();
22481
23251
  session.startCronScheduler();
22482
23252
  setTimeout(() => {
22483
23253
  void session.sendAvailableCommandsUpdate();
@@ -22585,11 +23355,29 @@ ${outputText}
22585
23355
  currentValue: currentModelId,
22586
23356
  options: configModelOptions
22587
23357
  };
22588
- const modelReasoning = this.getModelReasoningConfiguration(config);
23358
+ const generation = config.getContentGeneratorConfig();
23359
+ const modelReasoning = this.getModelReasoningConfiguration(
23360
+ config,
23361
+ currentModelId
23362
+ );
22589
23363
  const currentModelEffort = config.getReasoningEffort?.();
23364
+ const reasoningOverride = config.getReasoningEffortOverride?.();
23365
+ const reasoningOverrideValue = reasoningOverride ? generation[reasoningOverride.source]?.[reasoningOverride.field] : void 0;
23366
+ const normalizedEffortOverride = reasoningOverride?.field === "reasoning_effort" && typeof reasoningOverrideValue === "string" ? reasoningOverrideValue === "minimal" ? "low" : REASONING_EFFORT_TIERS.find(
23367
+ (effort) => effort === reasoningOverrideValue
23368
+ ) : void 0;
23369
+ const normalizedBudgetOverride = reasoningOverride?.field === "thinking_budget" && typeof reasoningOverrideValue === "number" && Number.isFinite(reasoningOverrideValue) && reasoningOverrideValue >= 0 && reasoningOverrideValue <= 262144 ? reasoningOverrideValue <= 4096 ? "low" : reasoningOverrideValue <= 16384 ? "medium" : "xhigh" : void 0;
23370
+ const normalizedOverrideEffort = normalizedEffortOverride ?? normalizedBudgetOverride;
23371
+ const overrideDisablesReasoning = reasoningOverride?.field === "enable_thinking" && reasoningOverrideValue === false || reasoningOverride?.field === "reasoning_effort" && reasoningOverrideValue === REASONING_EFFORT_NONE;
23372
+ const mandatoryUsesDefaultEffort = generation.thinkingMandatory === true && (overrideDisablesReasoning || generation.reasoning === false && reasoningOverride?.field === "reasoning_effort");
23373
+ const effectiveModelEffort = modelReasoning && !modelReasoning.toggleOnly ? mandatoryUsesDefaultEffort ? modelReasoning.defaultEffort : normalizedOverrideEffort ? modelReasoning.efforts.find(
23374
+ (effort) => effort === normalizedOverrideEffort
23375
+ ) ?? modelReasoning.defaultEffort : currentModelEffort : currentModelEffort;
23376
+ const reasoningEnabled = generation.reasoning !== false && (!reasoningOverride || !overrideDisablesReasoning);
22590
23377
  const reasoningEffortConfigOption = (modelReasoning ? buildModelReasoningConfigOption(rawCurrentModelId, {
22591
- enabled: config.getContentGeneratorConfig().reasoning !== false,
22592
- effort: currentModelEffort
23378
+ enabled: reasoningEnabled,
23379
+ effort: effectiveModelEffort,
23380
+ thinkingMandatory: generation.thinkingMandatory === true
22593
23381
  }) : void 0) ?? {
22594
23382
  id: "reasoning_effort",
22595
23383
  name: "Reasoning effort",
@@ -22612,13 +23400,21 @@ ${outputText}
22612
23400
  };
22613
23401
  return [modeConfigOption, modelConfigOption, reasoningEffortConfigOption];
22614
23402
  }
22615
- getModelReasoningConfiguration(config) {
22616
- if (config.getActiveRuntimeModelSnapshot?.() || config.getReasoningEffortOverride?.() || config.getContentGeneratorConfig().thinkingMandatory === true) {
23403
+ getModelReasoningConfiguration(config, currentAcpModelId) {
23404
+ if (config.getActiveRuntimeModelSnapshot?.()) {
23405
+ return void 0;
23406
+ }
23407
+ const completeModelId = currentAcpModelId ?? getCurrentAcpModelId(
23408
+ this.buildSelectableModelOptions(config),
23409
+ (config.getModel() || "").trim(),
23410
+ config.getAuthType?.(),
23411
+ config.getCurrentModelRegistryBaseUrl?.()
23412
+ );
23413
+ if (completeModelId.startsWith(ACP_ROUTE_ID_PREFIX)) {
22617
23414
  return void 0;
22618
23415
  }
22619
23416
  const reasoning = getModelConfiguration(config.getModel())?.reasoning;
22620
- const currentEffort = config.getReasoningEffort?.();
22621
- return reasoning?.thinking && (reasoning.toggleOnly || !currentEffort || reasoning.efforts.includes(currentEffort)) ? reasoning : void 0;
23417
+ return reasoning?.thinking ? reasoning : void 0;
22622
23418
  }
22623
23419
  buildSelectableModelOptions(config) {
22624
23420
  const currentAuthType = config.getAuthType();