@qwen-code/qwen-code 0.21.12-preview.1 → 0.21.12-preview.4

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 (326) hide show
  1. package/bundled/qc-helper/docs/configuration/settings.md +10 -0
  2. package/bundled/qc-helper/docs/features/code-review.md +1 -1
  3. package/bundled/qc-helper/docs/qwen-serve.md +34 -34
  4. package/bundled/review/SKILL.md +55 -36
  5. package/chunks/{MaxSizedBox-VSAJNP52.js → MaxSizedBox-GFI5RYXH.js} +41 -41
  6. package/chunks/{StandaloneSessionPicker-N5MC42M2.js → StandaloneSessionPicker-JFWRY4V2.js} +60 -61
  7. package/chunks/{acp-startup-profiler-JMJBZDVO.js → acp-startup-profiler-TVI2OVUN.js} +2 -2
  8. package/chunks/{acpAgent-GUV7LTDH.js → acpAgent-7YC6SNIS.js} +676 -430
  9. package/chunks/{agent-WJT3BALC.js → agent-43KVQSB5.js} +38 -38
  10. package/chunks/{agent-headless-JRRUUVP3.js → agent-headless-P2N7PDGQ.js} +38 -38
  11. package/chunks/{anthropicContentGenerator-4JSC3ZFL.js → anthropicContentGenerator-ZBBX5VMY.js} +6 -6
  12. package/chunks/{artifact-tool-FRMBPDPB.js → artifact-tool-RWJAKYBZ.js} +2 -2
  13. package/chunks/{askUserQuestion-7G3LI3IZ.js → askUserQuestion-IQCA2SOX.js} +2 -2
  14. package/chunks/{bridge-VB3BPG7G.js → bridge-ZBMNALLA.js} +44 -44
  15. package/chunks/{channel-management-service-SKAN6NOB.js → channel-management-service-5ZYX4ROW.js} +4 -4
  16. package/chunks/{channel-settings-store-UM7JZEW7.js → channel-settings-store-ZJWM7EDP.js} +45 -45
  17. package/chunks/{channel-worker-group-YPTB5ASD.js → channel-worker-group-QFJKXO7R.js} +5 -5
  18. package/chunks/{channel-worker-manager-4EHJSPRH.js → channel-worker-manager-PWD2UURZ.js} +5 -5
  19. package/chunks/{channel-worker-supervisor-DZKHYFHV.js → channel-worker-supervisor-XQJBGFCM.js} +3 -3
  20. package/chunks/{chunk-GZGDJ4E6.js → chunk-2ASWIM4A.js} +1 -1
  21. package/chunks/{chunk-DP3IHZGG.js → chunk-2AUM35J5.js} +59 -7
  22. package/chunks/{chunk-T4FTABSW.js → chunk-2N6CV4PW.js} +1 -1
  23. package/chunks/{chunk-5PWLQ7SK.js → chunk-2RTRFLWH.js} +11 -4
  24. package/chunks/{chunk-TKAEODJR.js → chunk-2U3UCXZ3.js} +11 -1
  25. package/chunks/{chunk-QZ5G26ZE.js → chunk-32SNBMNP.js} +12 -12
  26. package/chunks/{chunk-5DDUYIY6.js → chunk-3JI5D6RU.js} +3 -3
  27. package/chunks/{chunk-E5BWLU5J.js → chunk-3MJ44LNC.js} +59 -23
  28. package/chunks/{chunk-QUESTNOP.js → chunk-4JS2QK7P.js} +1 -1
  29. package/chunks/{chunk-G4C5RLX6.js → chunk-4X5J3V2I.js} +47 -3
  30. package/chunks/{chunk-IQFYO5BF.js → chunk-5KZNWF2M.js} +1 -1
  31. package/chunks/{chunk-MMH3GO4Z.js → chunk-62TIEFNN.js} +8 -8
  32. package/chunks/{chunk-T6W4KACQ.js → chunk-67F2BEYW.js} +1 -1
  33. package/chunks/{chunk-EN2J77G7.js → chunk-6LDLDK6E.js} +3 -1
  34. package/chunks/{chunk-VESDV72K.js → chunk-6NQWER7D.js} +3 -3
  35. package/chunks/{chunk-732MOPEM.js → chunk-6OJDN5ZT.js} +1 -1
  36. package/chunks/{chunk-GLWWPFTW.js → chunk-6SU6OW5Z.js} +1 -1
  37. package/chunks/{chunk-T2VEHZH3.js → chunk-6T5HCY34.js} +3 -3
  38. package/chunks/{chunk-AQHNAA7E.js → chunk-7JL5YBSA.js} +1 -1
  39. package/chunks/{chunk-NWPO6I7V.js → chunk-7WUMS2UA.js} +1 -1
  40. package/chunks/{chunk-VUTOKX6F.js → chunk-A2QIWDFO.js} +347 -85
  41. package/chunks/{chunk-KT4OWAAZ.js → chunk-A4BAHMJF.js} +3 -3
  42. package/chunks/{chunk-N7NBMAMW.js → chunk-A6GQUQ7I.js} +2 -2
  43. package/chunks/{chunk-XLQS3VI6.js → chunk-AAZWJAPQ.js} +2 -2
  44. package/chunks/{chunk-LT532KF4.js → chunk-ADJDLEVO.js} +1 -1
  45. package/chunks/{chunk-7L64FSYQ.js → chunk-APQTLUZ3.js} +2120 -2085
  46. package/chunks/{chunk-JO45C3OY.js → chunk-ARL4UGRW.js} +3 -3
  47. package/chunks/{chunk-Q6FGSG6B.js → chunk-B2BKFWJK.js} +2 -2
  48. package/chunks/{chunk-SAQHDAUJ.js → chunk-B66LYK4B.js} +452 -57
  49. package/chunks/{chunk-XDN6SMAQ.js → chunk-B7IBCWDW.js} +3 -3
  50. package/chunks/{chunk-SZ36WFVK.js → chunk-BGIKUE5J.js} +1 -1
  51. package/chunks/{chunk-4W25XH7F.js → chunk-BNRIQWXW.js} +3 -3
  52. package/chunks/{chunk-M3QYOPGN.js → chunk-BXAGPCYH.js} +1 -1
  53. package/chunks/{chunk-IEP44U2R.js → chunk-C2DR57L6.js} +1 -1
  54. package/chunks/{chunk-TBVNYG5B.js → chunk-CDDLHCC2.js} +3 -3
  55. package/chunks/{chunk-PDKLO2DN.js → chunk-CJNKGZLC.js} +127 -4
  56. package/chunks/{chunk-VUFEW3SF.js → chunk-CTEGMF77.js} +285 -125
  57. package/chunks/{chunk-QIN5P5BP.js → chunk-DUFZ3OW6.js} +35 -35
  58. package/chunks/{chunk-ZWPWQEF5.js → chunk-E74YSVIN.js} +1 -1
  59. package/chunks/{chunk-WFBG4MF5.js → chunk-ECDXUCEO.js} +4 -4
  60. package/chunks/{chunk-47FQVRCO.js → chunk-EGB2PIYM.js} +1 -1
  61. package/chunks/{chunk-CX2MARRJ.js → chunk-FB5CQZMK.js} +1 -1
  62. package/chunks/{chunk-GQW6P73F.js → chunk-FNVF5RR4.js} +1 -1
  63. package/chunks/{chunk-O4BBDP2G.js → chunk-FTGU6G45.js} +2 -2
  64. package/chunks/{chunk-ZGWY4YUB.js → chunk-FVHLDSQS.js} +2 -2
  65. package/chunks/{chunk-7N6WK2W6.js → chunk-FXWGMPAP.js} +2 -2
  66. package/chunks/{chunk-FMLUVVQ6.js → chunk-GDNDZJSG.js} +2 -2
  67. package/chunks/{chunk-INQN4KIA.js → chunk-GHOUZ5X4.js} +1896 -623
  68. package/chunks/{chunk-3ZLUA4GV.js → chunk-H2U4FK62.js} +6 -6
  69. package/chunks/{chunk-EFIMD5VA.js → chunk-H6BFLALJ.js} +1 -1
  70. package/chunks/{chunk-MJ5FMYVQ.js → chunk-HOJZ2QQA.js} +3 -3
  71. package/chunks/{chunk-OYLNJPY3.js → chunk-HWCHDINS.js} +45 -279
  72. package/chunks/{chunk-DNRV2US3.js → chunk-HY5OHJEC.js} +5 -5
  73. package/chunks/{chunk-P2UCMHDT.js → chunk-IJCZP2MA.js} +2 -2
  74. package/chunks/{chunk-U6LT3QBF.js → chunk-JBZYGFIB.js} +1 -1
  75. package/chunks/{chunk-EAJESCBT.js → chunk-JGD35ZSJ.js} +4 -4
  76. package/chunks/{chunk-MLZCPGDX.js → chunk-JOVJCXN4.js} +1 -1
  77. package/chunks/{chunk-AJL3SAZG.js → chunk-JRMUA53D.js} +12 -12
  78. package/chunks/{chunk-CTQE2NB2.js → chunk-JRTJEGSP.js} +1 -1
  79. package/chunks/{chunk-MZSJ43WV.js → chunk-JVY7FHUZ.js} +15 -2
  80. package/chunks/{chunk-K7JW6V5O.js → chunk-JW5UEE3V.js} +1 -1
  81. package/chunks/{chunk-6LK2QPIA.js → chunk-JXS2JNMZ.js} +2 -2
  82. package/chunks/{chunk-L2GTEEEU.js → chunk-K5IDV3PC.js} +44 -1
  83. package/chunks/{chunk-OH5UKBLL.js → chunk-KB4ISUT3.js} +4 -4
  84. package/chunks/{chunk-GJJQV4PY.js → chunk-KK3FEHPJ.js} +1 -1
  85. package/chunks/{chunk-2AZMF6G5.js → chunk-KTWUFHS4.js} +2 -2
  86. package/chunks/chunk-L34XSHIZ.js +28 -0
  87. package/chunks/{chunk-VO52SIZW.js → chunk-L3YACXS2.js} +3 -3
  88. package/chunks/{chunk-JWXBLIQL.js → chunk-LIBTBTHP.js} +4 -4
  89. package/chunks/{chunk-JS4Q5NG5.js → chunk-LSMCI42W.js} +3 -3
  90. package/chunks/{chunk-A7M57KOL.js → chunk-MTV5W6WN.js} +7 -7
  91. package/chunks/{chunk-T5ZFG4CI.js → chunk-MUN34TTF.js} +7 -7
  92. package/chunks/{chunk-C2VGLLNA.js → chunk-N3J3CO35.js} +4 -4
  93. package/chunks/{chunk-3SIXC6QC.js → chunk-N56NYJWY.js} +7 -7
  94. package/chunks/{chunk-45TYWBCB.js → chunk-NAOHSM56.js} +1 -1
  95. package/chunks/{chunk-URK542T4.js → chunk-NF5J2WFA.js} +15 -2
  96. package/chunks/{chunk-OPBATTFQ.js → chunk-NHZF4VCD.js} +1 -1
  97. package/chunks/{chunk-QTI7SRXI.js → chunk-NM33GGOM.js} +3 -3
  98. package/chunks/{chunk-F6AOBFUN.js → chunk-NW7SPXVG.js} +1 -1
  99. package/chunks/{chunk-ABGS4FDQ.js → chunk-NX5QZVRS.js} +1 -1
  100. package/chunks/{chunk-XYVBANG5.js → chunk-O4MVJKSX.js} +289 -3
  101. package/chunks/{chunk-NC4O6UE6.js → chunk-O6SLWH4X.js} +2 -2
  102. package/chunks/{chunk-ZXUMPZRT.js → chunk-OIZWCOYC.js} +5 -5
  103. package/chunks/{chunk-YQB3HSQ7.js → chunk-ORR5EFCL.js} +4 -4
  104. package/chunks/{chunk-WQOE4IYF.js → chunk-OSA2TFDI.js} +2 -2
  105. package/chunks/{chunk-KPVVWKF3.js → chunk-PSTHNTHF.js} +1 -1
  106. package/chunks/{chunk-FWJRWCKU.js → chunk-PYLVQ6RT.js} +6 -6
  107. package/chunks/{chunk-XAAL4IFG.js → chunk-Q7ALOKK7.js} +3 -3
  108. package/chunks/{chunk-EYW54TBD.js → chunk-QEWAHAW2.js} +3 -3
  109. package/chunks/{chunk-L2O7DJIE.js → chunk-QSDPJROT.js} +2 -2
  110. package/chunks/{chunk-7PBUQKMT.js → chunk-QSMZHJ62.js} +1 -1
  111. package/chunks/{chunk-OSPIZEAM.js → chunk-QWAI7FNT.js} +17 -17
  112. package/chunks/{chunk-JRRZFO4A.js → chunk-QXFAQDBV.js} +2 -2
  113. package/chunks/{chunk-67LXZ6LV.js → chunk-SFBRH5RY.js} +19 -15
  114. package/chunks/{chunk-EYS3GGM3.js → chunk-SKRHR6N2.js} +1 -1
  115. package/chunks/{chunk-6LYDH7VT.js → chunk-SNHBRO4C.js} +2 -2
  116. package/chunks/{chunk-5TXOGH4I.js → chunk-T4G33L3W.js} +3 -3
  117. package/chunks/{chunk-DEVFUPC5.js → chunk-TB6DPBE4.js} +4 -4
  118. package/chunks/{chunk-DEG7R6Z6.js → chunk-TN3REXN4.js} +8 -8
  119. package/chunks/{chunk-MWZYNOCG.js → chunk-TNETSI2A.js} +3 -3
  120. package/chunks/{chunk-ZV4XVYL3.js → chunk-TROB4PZY.js} +4 -4
  121. package/chunks/{chunk-O5AZPHYZ.js → chunk-U5C2GIN2.js} +24 -16
  122. package/chunks/{chunk-3GCU5O2E.js → chunk-U7ROFHSH.js} +1 -1
  123. package/chunks/{chunk-HB6QW4LM.js → chunk-UAAWNTOC.js} +15 -12
  124. package/chunks/{chunk-HHGQGTJQ.js → chunk-UFHPAMAV.js} +4 -0
  125. package/chunks/{chunk-V3LXMASR.js → chunk-UHF5VBKO.js} +1 -1
  126. package/chunks/{chunk-AMXMM7DH.js → chunk-UPUAGRKY.js} +4 -2
  127. package/chunks/{chunk-6S52N6PG.js → chunk-UQPLUR4A.js} +2 -2
  128. package/chunks/{chunk-5AWARYOK.js → chunk-UWIJU22K.js} +66 -19
  129. package/chunks/{chunk-HGCQ5SE7.js → chunk-UXEO7E3V.js} +21 -0
  130. package/chunks/{chunk-DGM2XA3R.js → chunk-V2U6FOJB.js} +2 -2
  131. package/chunks/{chunk-7SUQZ7QH.js → chunk-V3NMFQD2.js} +2 -2
  132. package/chunks/{chunk-P5Y23G2L.js → chunk-V7RNNPGC.js} +1 -18
  133. package/chunks/{chunk-6XZERB6P.js → chunk-VPZMLGD3.js} +3 -3
  134. package/chunks/{chunk-MM4XBXF7.js → chunk-VRQD5D7R.js} +1 -1
  135. package/chunks/{chunk-YTYPRVIZ.js → chunk-VUTOV2HG.js} +2 -2
  136. package/chunks/{chunk-RE6JD2BH.js → chunk-VYDQD5J4.js} +1 -1
  137. package/chunks/{chunk-XCGIMOLN.js → chunk-WCCLLK7X.js} +14 -1
  138. package/chunks/{chunk-ZIS5I56G.js → chunk-WIHSDI6U.js} +4 -4
  139. package/chunks/{chunk-VJNBRRZG.js → chunk-WZMH7II3.js} +1 -1
  140. package/chunks/{chunk-LOJO2RPW.js → chunk-XJ6IMYUS.js} +7 -7
  141. package/chunks/{chunk-3XZYK76R.js → chunk-XL6GYJL2.js} +1 -1
  142. package/chunks/{chunk-OLU7GIF4.js → chunk-XUBM2A4F.js} +67 -16
  143. package/chunks/{chunk-ENEEQMGM.js → chunk-XY7DGTIC.js} +1 -1
  144. package/chunks/{chunk-LCWRQA5U.js → chunk-Y2EOB7WZ.js} +1 -1
  145. package/chunks/{chunk-FLUYVAQZ.js → chunk-Y2HK3ELT.js} +3 -3
  146. package/chunks/{chunk-PRWGIKKU.js → chunk-Y5C24BUY.js} +5 -5
  147. package/chunks/{chunk-5HBFERG5.js → chunk-YI5G32RU.js} +3 -3
  148. package/chunks/{chunk-MPBRV3UU.js → chunk-YMB77M76.js} +15 -0
  149. package/chunks/{chunk-KNQZXSLW.js → chunk-YY23TR4M.js} +23 -9
  150. package/chunks/{chunk-M2S67TPJ.js → chunk-ZA2JN5IZ.js} +3 -3
  151. package/chunks/{chunk-IX7CFQGA.js → chunk-ZPZANKVP.js} +3 -3
  152. package/chunks/{chunk-XTH2OMDS.js → chunk-ZRT36RSF.js} +1 -1
  153. package/chunks/{chunk-M2NMFAFR.js → chunk-ZZ7RUTJ4.js} +1 -1
  154. package/chunks/{computer-use-YOYLKIHT.js → computer-use-J5VUY257.js} +38 -38
  155. package/chunks/{config-utils-TXVKR27S.js → config-utils-7JZQN6L2.js} +4 -4
  156. package/chunks/{contextCommand-KZMV5EOI.js → contextCommand-RCTGC36R.js} +40 -40
  157. package/chunks/{core-runtime-VFUL2R7U.js → core-runtime-REBZ5ZYE.js} +38 -38
  158. package/chunks/{create-sub-session-Y4WYDZGC.js → create-sub-session-23ULO5PO.js} +2 -2
  159. package/chunks/{create-sub-session-EZW2NP4Z.js → create-sub-session-TEEUROAZ.js} +38 -38
  160. package/chunks/{cron-create-ZOVA3CC2.js → cron-create-5WUTNKNF.js} +4 -4
  161. package/chunks/{cron-delete-7Z3H4LJY.js → cron-delete-JEQ27YPS.js} +4 -4
  162. package/chunks/{cron-list-UHGX3IQG.js → cron-list-IXGCA7UR.js} +4 -4
  163. package/chunks/{daemon-PXIC4ZDK.js → daemon-UBVOQMWY.js} +2 -1
  164. package/chunks/{daemon-status-provider-6L3ZKVVR.js → daemon-status-provider-SV7KRLJ4.js} +49 -49
  165. package/chunks/{daemon-trust-policy-SZ3V4JEY.js → daemon-trust-policy-LFUJ4NGF.js} +44 -44
  166. package/chunks/{daemon-trust-policy-monitor-HN34EJQ5.js → daemon-trust-policy-monitor-BQZ77NDD.js} +44 -44
  167. package/chunks/{deferred-core-runtime-Z462KPKI.js → deferred-core-runtime-F4XOQJQL.js} +38 -38
  168. package/chunks/{dispatch-B53LNEO4.js → dispatch-FW7DX2CR.js} +7 -1
  169. package/chunks/{display-image-ZE3GZNIK.js → display-image-CAD7RAUM.js} +4 -4
  170. package/chunks/{dist-BNWP6IZL.js → dist-362MN6CP.js} +2 -2
  171. package/chunks/{dist-EFJILGIS.js → dist-5VDE7U3A.js} +1 -1
  172. package/chunks/{dist-AVUYBK7L.js → dist-6RK4U6VU.js} +1 -1
  173. package/chunks/{dist-KTYDJNYM.js → dist-B3ODKYEB.js} +1 -1
  174. package/chunks/{dist-NPS52B2V.js → dist-CCUH2Z4C.js} +1 -1
  175. package/chunks/{dist-BW2LDPV3.js → dist-DANKRAB3.js} +1 -1
  176. package/chunks/{dist-PKSRQAR2.js → dist-EZHCZSW6.js} +1 -1
  177. package/chunks/{dist-ZWDH5HLS.js → dist-M3XMEIP2.js} +1 -1
  178. package/chunks/{earlyInputCapture-GSE6MMC7.js → earlyInputCapture-JAJXDT2N.js} +39 -39
  179. package/chunks/{edit-YJX2HMSA.js → edit-OXBMFY5B.js} +38 -38
  180. package/chunks/{enter-worktree-H3GV4KQ7.js → enter-worktree-XS4JX4PO.js} +38 -38
  181. package/chunks/{enterPlanMode-6LPSFIN2.js → enterPlanMode-J6PDPFFT.js} +38 -38
  182. package/chunks/{environment-IVCQ3H7T.js → environment-BQW6FAZL.js} +40 -40
  183. package/chunks/{errors-2K5VJQVK.js → errors-TMSN7AZN.js} +40 -40
  184. package/chunks/{exit-worktree-QZC6DXGO.js → exit-worktree-2RIE6DAO.js} +38 -38
  185. package/chunks/{exitPlanMode-UHGM7I4A.js → exitPlanMode-QQL27HU4.js} +38 -38
  186. package/chunks/{fast-path-BDDOO4H6.js → fast-path-TSGUVE5K.js} +4 -4
  187. package/chunks/{gemini-VDUDROF7.js → gemini-RLTFENFV.js} +89 -86
  188. package/chunks/{geminiContentGenerator-O4HYJOR7.js → geminiContentGenerator-B6W6PSO7.js} +6 -6
  189. package/chunks/{glob-Z7VZDN7C.js → glob-JKVAHWL5.js} +38 -38
  190. package/chunks/{goal-tools-JDK2SNMV.js → goal-tools-LQFO4BRY.js} +4 -4
  191. package/chunks/{grep-JQ6AGN62.js → grep-6CN23ZPS.js} +38 -38
  192. package/chunks/{handleAutoUpdate-XZCLKEMR.js → handleAutoUpdate-Y6BUNMBG.js} +42 -42
  193. package/chunks/{i18n-G2BMPGAS.js → i18n-Y5PM6L5V.js} +39 -39
  194. package/chunks/{image-gen-NMKTIERQ.js → image-gen-DC2IQZ73.js} +10 -10
  195. package/chunks/{initializer-JEYFVIIG.js → initializer-OYKKBNHO.js} +45 -45
  196. package/chunks/{installationInfo-GY2OCLIS.js → installationInfo-63AFHLWA.js} +39 -39
  197. package/chunks/{keychain-token-storage-JTWUYFU7.js → keychain-token-storage-GU75J2T2.js} +2 -2
  198. package/chunks/{list-ZJ4GEKM4.js → list-KA63R3R6.js} +47 -47
  199. package/chunks/{list-agents-4GQ2XNEU.js → list-agents-5PNMK2AM.js} +2 -2
  200. package/chunks/{loadedSettingsAdapter-5BO2PZLD.js → loadedSettingsAdapter-IGBJN7C5.js} +44 -44
  201. package/chunks/{loggingContentGenerator-ER2Z5L3L.js → loggingContentGenerator-Z3NADCTQ.js} +115 -93
  202. package/chunks/{loop-wakeup-HOQI3K5D.js → loop-wakeup-OV65FEGR.js} +5 -5
  203. package/chunks/{ls-FSHISLLA.js → ls-RPRSX26R.js} +4 -4
  204. package/chunks/{lsp-APQJ5ZEZ.js → lsp-IWTJWFLT.js} +2 -2
  205. package/chunks/{managed-npm-update-X66EZDQD.js → managed-npm-update-HA262PFM.js} +41 -41
  206. package/chunks/{mcp-BDWPEXJF.js → mcp-T5ZUOKT3.js} +44 -44
  207. package/chunks/{monitor-7J3DCMBL.js → monitor-SLGY7CYB.js} +38 -38
  208. package/chunks/nonInteractiveCli-R5PK5B5G.js +166 -0
  209. package/chunks/{notebook-edit-IX7GCTIL.js → notebook-edit-STSSB5KQ.js} +38 -38
  210. package/chunks/{openaiContentGenerator-K65IDMQ6.js → openaiContentGenerator-OQED57JE.js} +24 -24
  211. package/chunks/{opentui-entry-L76XJNPE.js → opentui-entry-UTJ6MHDI.js} +5224 -825
  212. package/chunks/{pidfile-NNWTPHX2.js → pidfile-GES3MIHH.js} +39 -39
  213. package/chunks/{processUtils-ILOXESNR.js → processUtils-FU6VMUOL.js} +2 -2
  214. package/chunks/{qwenContentGenerator-YIKX3NHW.js → qwenContentGenerator-HWJSEGUL.js} +43 -43
  215. package/chunks/{qwenOAuth2-BLYU65Y4.js → qwenOAuth2-PAIR7XEW.js} +9 -9
  216. package/chunks/{read-file-GLBZFPNV.js → read-file-IYEBTQT5.js} +12 -12
  217. package/chunks/{read-mcp-resource-TJSJRH4F.js → read-mcp-resource-THCSZHXO.js} +2 -2
  218. package/chunks/{read-package-up-TCM6I7S2.js → read-package-up-K6RKTL5D.js} +1 -1
  219. package/chunks/{record-artifact-FXF5LHPE.js → record-artifact-76YYQA5F.js} +3 -3
  220. package/chunks/{resumeHistoryUtils-UMC4Y3E2.js → resumeHistoryUtils-WP446RP5.js} +44 -45
  221. package/chunks/{ripGrep-53XOGSZ4.js → ripGrep-VV2CRCL2.js} +38 -38
  222. package/chunks/{run-qwen-serve-BTZ46CLW.js → run-qwen-serve-AHQCTALV.js} +160 -71
  223. package/chunks/{runtime-RQ3ACQKH.js → runtime-AUUZGDK6.js} +49 -49
  224. package/chunks/{scheduler-WEIFVKQH.js → scheduler-Y4UPEURR.js} +40 -40
  225. package/chunks/{sdk-exporters-http-2VPMAPFI.js → sdk-exporters-http-A7XLKZO7.js} +11 -7
  226. package/chunks/{sdk-impl-5W3JUCWF.js → sdk-impl-XO4UF6PR.js} +11 -8
  227. package/chunks/{send-message-RBYLV5NY.js → send-message-P5SLP57G.js} +6 -6
  228. package/chunks/{serve-RJUR5OJH.js → serve-WI3SE4MY.js} +47 -47
  229. package/chunks/{server-WQ2ID4U7.js → server-G6JU6UWL.js} +264 -159
  230. package/chunks/{session-O4OXRVNI.js → session-2AO2UACB.js} +85 -85
  231. package/chunks/{settings-4BVJ36YG.js → settings-3HRWSH66.js} +43 -43
  232. package/chunks/{shell-DCQZWM5T.js → shell-AR7XFLHA.js} +38 -38
  233. package/chunks/{skill-4KWZ4J7U.js → skill-K6NOUUYM.js} +16 -16
  234. package/chunks/{skill-settings-TEMNXCLU.js → skill-settings-IOXQYS6X.js} +43 -43
  235. package/chunks/{spawnChannel-ROYEZK57.js → spawnChannel-V6P6HF4V.js} +42 -40
  236. package/chunks/{standalone-update-G4BETY4B.js → standalone-update-K5G3L2OJ.js} +40 -40
  237. package/chunks/{startInteractiveUI-PDFQ7N7A.js → startInteractiveUI-TRRP52QX.js} +422 -500
  238. package/chunks/{syntheticOutput-D3Z64LJC.js → syntheticOutput-SEW4NA47.js} +3 -3
  239. package/chunks/{task-create-URFZ5EUX.js → task-create-247EAVF7.js} +10 -10
  240. package/chunks/{task-list-6JDFMPUW.js → task-list-ZJN4QHLK.js} +5 -5
  241. package/chunks/{task-stop-HHUGCD25.js → task-stop-MAYQJ42I.js} +2 -2
  242. package/chunks/{task-update-DVV6CUGI.js → task-update-SU5TMZGG.js} +10 -10
  243. package/chunks/{team-create-KW4LOVHD.js → team-create-IEEEBLE2.js} +38 -38
  244. package/chunks/{team-delete-PZGGBQLM.js → team-delete-3XVRPQBP.js} +5 -5
  245. package/chunks/{team-plan-approval-XHFK2RTF.js → team-plan-approval-SJGNS5JL.js} +38 -38
  246. package/chunks/{terminal-image-renderer-46R2LHGR.js → terminal-image-renderer-C4RQMC67.js} +40 -40
  247. package/chunks/{theme-manager-E56XY2JG.js → theme-manager-IKZQJQ6C.js} +39 -39
  248. package/chunks/{todoWrite-WINAZSZI.js → todoWrite-IE2YTCK7.js} +4 -4
  249. package/chunks/{tool-search-EVVFQUMJ.js → tool-search-4UVNFYWU.js} +16 -16
  250. package/chunks/{total-session-admission-CULMHRTA.js → total-session-admission-DIN6FTZP.js} +44 -44
  251. package/chunks/{trustedFolders-BKLVSCXW.js → trustedFolders-IAHOLV6A.js} +39 -39
  252. package/chunks/{update-relaunch-46H4Q4VL.js → update-relaunch-5QSJ5CWP.js} +5 -5
  253. package/chunks/{updateCheck-3BQA7KNI.js → updateCheck-N4RT7HOZ.js} +44 -44
  254. package/chunks/{useAutoAcceptIndicator-3QJ7QV5R.js → useAutoAcceptIndicator-25T26VZS.js} +46 -46
  255. package/chunks/{validateNonInterActiveAuth-QVFJVBSY.js → validateNonInterActiveAuth-MCTVPLFE.js} +81 -81
  256. package/chunks/{version-6JJA54HH.js → version-6PLZ7PCV.js} +2 -2
  257. package/chunks/{web-fetch-75JBSDA3.js → web-fetch-5ANX6FSM.js} +16 -16
  258. package/chunks/{web-search-PKBISWS3.js → web-search-KQJWWRHW.js} +9 -9
  259. package/chunks/{workflow-KEZDQISR.js → workflow-C57ZKFUF.js} +111 -46
  260. package/chunks/{workspace-providers-status-YQW4VNIV.js → workspace-providers-status-3QAE4G4Y.js} +47 -47
  261. package/chunks/{workspace-registration-store-GQ42PR72.js → workspace-registration-store-Q3J5LV6T.js} +1 -1
  262. package/chunks/{workspace-registry-ZR6DVZQ6.js → workspace-registry-DSJ5NAII.js} +44 -44
  263. package/chunks/{workspace-service-BCMK3NLA.js → workspace-service-QW5LH7FA.js} +49 -49
  264. package/chunks/{workspace-skills-status-ZHBYM2X7.js → workspace-skills-status-N34ALJPZ.js} +45 -45
  265. package/chunks/{workspace-trust-reconciler-TWRB3TW2.js → workspace-trust-reconciler-YTOL7QEV.js} +50 -50
  266. package/chunks/{write-file-CQBI7HXO.js → write-file-MSFRVUZB.js} +38 -38
  267. package/chunks/{zoom-image-36I4WZIL.js → zoom-image-4TQA5GHG.js} +12 -12
  268. package/cli.js +13 -13
  269. package/package.json +4 -4
  270. package/web-shell/assets/{arc-CgGUyHWd.js → arc-lZ04kynw.js} +1 -1
  271. package/web-shell/assets/{architectureDiagram-3BPJPVTR-BR0Qv-1Y.js → architectureDiagram-3BPJPVTR-B1wZVhzD.js} +1 -1
  272. package/web-shell/assets/{blockDiagram-GPEHLZMM-DIoaceaI.js → blockDiagram-GPEHLZMM-CO0e0yJt.js} +1 -1
  273. package/web-shell/assets/{c4Diagram-AAUBKEIU-Bc5k6BbI.js → c4Diagram-AAUBKEIU-Dfpo6Qie.js} +1 -1
  274. package/web-shell/assets/channel-BxvRq3pV.js +1 -0
  275. package/web-shell/assets/{chunk-2J33WTMH-DtPEz2WX.js → chunk-2J33WTMH-BvxArftT.js} +1 -1
  276. package/web-shell/assets/{chunk-4BX2VUAB-Dydo6ydE.js → chunk-4BX2VUAB-BS2XXjGY.js} +1 -1
  277. package/web-shell/assets/{chunk-55IACEB6-DD9_VWXm.js → chunk-55IACEB6-CYL6h3Ph.js} +1 -1
  278. package/web-shell/assets/{chunk-727SXJPM-DVI2m59k.js → chunk-727SXJPM-C-cWPX30.js} +1 -1
  279. package/web-shell/assets/{chunk-AQP2D5EJ-luatmaTN.js → chunk-AQP2D5EJ-CJLxNbVV.js} +1 -1
  280. package/web-shell/assets/{chunk-FMBD7UC4-Duy8NTIi.js → chunk-FMBD7UC4-DwfzKywA.js} +1 -1
  281. package/web-shell/assets/{chunk-ND2GUHAM-CrL1yhms.js → chunk-ND2GUHAM-BI5raYHQ.js} +1 -1
  282. package/web-shell/assets/{chunk-QZHKN3VN-C7BX6bu1.js → chunk-QZHKN3VN-_GkNI90J.js} +1 -1
  283. package/web-shell/assets/classDiagram-4FO5ZUOK-tL8nAxYf.js +1 -0
  284. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-tL8nAxYf.js +1 -0
  285. package/web-shell/assets/{cose-bilkent-S5V4N54A-BTzs7mIi.js → cose-bilkent-S5V4N54A-BAVLNxh9.js} +1 -1
  286. package/web-shell/assets/{dagre-BM42HDAG-3VTUmWts.js → dagre-BM42HDAG-BD4XNLqp.js} +1 -1
  287. package/web-shell/assets/{diagram-2AECGRRQ-Ehdp75GN.js → diagram-2AECGRRQ-WO567p8w.js} +1 -1
  288. package/web-shell/assets/{diagram-5GNKFQAL-B3wu3teE.js → diagram-5GNKFQAL-mAk23VWO.js} +1 -1
  289. package/web-shell/assets/{diagram-KO2AKTUF-DjgTSf2S.js → diagram-KO2AKTUF-YQEeHKze.js} +1 -1
  290. package/web-shell/assets/{diagram-LMA3HP47-Br9mwjY3.js → diagram-LMA3HP47-CMVjxAjv.js} +1 -1
  291. package/web-shell/assets/{diagram-OG6HWLK6-D4xz5M-z.js → diagram-OG6HWLK6-42hPvbM-.js} +1 -1
  292. package/web-shell/assets/{erDiagram-TEJ5UH35-CXayWlG_.js → erDiagram-TEJ5UH35-CXU_cPfu.js} +1 -1
  293. package/web-shell/assets/{flowDiagram-I6XJVG4X-CLonjQTi.js → flowDiagram-I6XJVG4X-D-3TdhMT.js} +1 -1
  294. package/web-shell/assets/{ganttDiagram-6RSMTGT7-BTySFT-1.js → ganttDiagram-6RSMTGT7-CsgkXolz.js} +1 -1
  295. package/web-shell/assets/{gitGraphDiagram-PVQCEYII--2WcUjOe.js → gitGraphDiagram-PVQCEYII-B6Q3PBLD.js} +1 -1
  296. package/web-shell/assets/{index-DPJHkFOG.js → index-BFrkGj2B.js} +1 -1
  297. package/web-shell/assets/index-BgjULKyF.css +5 -0
  298. package/web-shell/assets/index-CxXlPYfl.js +1789 -0
  299. package/web-shell/assets/{infoDiagram-5YYISTIA-9vpgAf1m.js → infoDiagram-5YYISTIA-jiAfSXp8.js} +1 -1
  300. package/web-shell/assets/{ishikawaDiagram-YF4QCWOH-DcRpHnAW.js → ishikawaDiagram-YF4QCWOH-BWif5KeJ.js} +1 -1
  301. package/web-shell/assets/{journeyDiagram-JHISSGLW-C2TKorRm.js → journeyDiagram-JHISSGLW-B-GAZthS.js} +1 -1
  302. package/web-shell/assets/{kanban-definition-UN3LZRKU-DdsFwB8b.js → kanban-definition-UN3LZRKU-9TEuATdL.js} +1 -1
  303. package/web-shell/assets/{linear-7PjRvJrf.js → linear-dy_QPfyE.js} +1 -1
  304. package/web-shell/assets/{mermaid.core-raDXa11C.js → mermaid.core-DB2uLAnq.js} +5 -5
  305. package/web-shell/assets/{mindmap-definition-RKZ34NQL-DLHc-PRN.js → mindmap-definition-RKZ34NQL-ey_dyxi-.js} +1 -1
  306. package/web-shell/assets/{pieDiagram-4H26LBE5-BftYpeTW.js → pieDiagram-4H26LBE5-_6BuMdDj.js} +1 -1
  307. package/web-shell/assets/{quadrantDiagram-W4KKPZXB-O-6ygOYn.js → quadrantDiagram-W4KKPZXB-B2rM19W2.js} +1 -1
  308. package/web-shell/assets/{requirementDiagram-4Y6WPE33-BmZWVufJ.js → requirementDiagram-4Y6WPE33-DWj8b7vW.js} +1 -1
  309. package/web-shell/assets/{sankeyDiagram-5OEKKPKP-2x5beiWt.js → sankeyDiagram-5OEKKPKP-D5dtYh0N.js} +1 -1
  310. package/web-shell/assets/{sequenceDiagram-3UESZ5HK-BH8uKokQ.js → sequenceDiagram-3UESZ5HK-DVkdn_qW.js} +1 -1
  311. package/web-shell/assets/{stateDiagram-AJRCARHV-Dq1MFgX_.js → stateDiagram-AJRCARHV-DgwD_fi6.js} +1 -1
  312. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-BWGkVGVB.js +1 -0
  313. package/web-shell/assets/{timeline-definition-PNZ67QCA-Cl2WKbv9.js → timeline-definition-PNZ67QCA-vNr_1UNX.js} +1 -1
  314. package/web-shell/assets/{vennDiagram-CIIHVFJN-BqoRo_Q-.js → vennDiagram-CIIHVFJN-ChFcGAcu.js} +1 -1
  315. package/web-shell/assets/{wardley-L42UT6IY-BTxp-Yot.js → wardley-L42UT6IY-C8PXoSWk.js} +1 -1
  316. package/web-shell/assets/{wardleyDiagram-YWT4CUSO-DFXVCSH2.js → wardleyDiagram-YWT4CUSO-C2nqOV6i.js} +1 -1
  317. package/web-shell/assets/{xychartDiagram-2RQKCTM6-qQhWx0aE.js → xychartDiagram-2RQKCTM6-BntaqhSB.js} +1 -1
  318. package/web-shell/index.html +2 -2
  319. package/chunks/chunk-7P32M35F.js +0 -51
  320. package/chunks/nonInteractiveCli-THJJIXKG.js +0 -166
  321. package/web-shell/assets/channel-D2b9IYpS.js +0 -1
  322. package/web-shell/assets/classDiagram-4FO5ZUOK-DHatTCmD.js +0 -1
  323. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-DHatTCmD.js +0 -1
  324. package/web-shell/assets/index-CIFO52Wx.css +0 -5
  325. package/web-shell/assets/index-bhq3CUUF.js +0 -1789
  326. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-spuAYji6.js +0 -1
@@ -2,11 +2,13 @@
2
2
  "use strict";
3
3
  import {
4
4
  recomputeMcpGating
5
- } from "./chunk-ZXUMPZRT.js";
5
+ } from "./chunk-OIZWCOYC.js";
6
+ import {
7
+ classifyApiError
8
+ } from "./chunk-V7RNNPGC.js";
6
9
  import {
7
- classifyApiError,
8
10
  fireSessionDeleteHook
9
- } from "./chunk-P5Y23G2L.js";
11
+ } from "./chunk-L34XSHIZ.js";
10
12
  import {
11
13
  EXTENSION_CONTEXT_BUDGET,
12
14
  buildExtensionMentionContext,
@@ -16,17 +18,17 @@ import {
16
18
  matchMcpServerByRef,
17
19
  parseExtensionRef,
18
20
  parseMcpServerRef
19
- } from "./chunk-EAJESCBT.js";
21
+ } from "./chunk-JGD35ZSJ.js";
20
22
  import "./chunk-WLML6VIA.js";
21
23
  import {
22
24
  getAvailableCommands,
23
25
  handleSlashCommand,
24
26
  insertAfterFunctionResponses,
25
27
  normalizePartList
26
- } from "./chunk-T5ZFG4CI.js";
28
+ } from "./chunk-MUN34TTF.js";
27
29
  import {
28
30
  isSlashCommand
29
- } from "./chunk-QIN5P5BP.js";
31
+ } from "./chunk-DUFZ3OW6.js";
30
32
  import {
31
33
  SessionIdConflictError,
32
34
  appEvents,
@@ -34,46 +36,47 @@ import {
34
36
  cleanupReviewWorktreeLeases,
35
37
  loadCliConfig,
36
38
  normalizeDisabledToolList
37
- } from "./chunk-VUFEW3SF.js";
39
+ } from "./chunk-CTEGMF77.js";
38
40
  import {
39
41
  getCommandSubcommandNames
40
- } from "./chunk-MM4XBXF7.js";
42
+ } from "./chunk-VRQD5D7R.js";
41
43
  import {
42
44
  getEffectiveSupportedModes
43
- } from "./chunk-JRRZFO4A.js";
45
+ } from "./chunk-QXFAQDBV.js";
44
46
  import "./chunk-NYX53SV4.js";
45
- import "./chunk-AMXMM7DH.js";
47
+ import "./chunk-UPUAGRKY.js";
46
48
  import {
47
49
  collectContextData,
48
50
  formatContextUsageText
49
- } from "./chunk-DEVFUPC5.js";
51
+ } from "./chunk-TB6DPBE4.js";
50
52
  import "./chunk-4WGODMVR.js";
51
53
  import {
52
54
  isGoalStatusKind
53
55
  } from "./chunk-EKTCKZV5.js";
54
- import "./chunk-EN2J77G7.js";
56
+ import "./chunk-6LDLDK6E.js";
55
57
  import {
56
58
  startNonInteractiveOpenAILogHousekeeping
57
- } from "./chunk-OH5UKBLL.js";
59
+ } from "./chunk-KB4ISUT3.js";
58
60
  import "./chunk-KW7NOTN6.js";
59
- import "./chunk-JWXBLIQL.js";
60
- import "./chunk-T2VEHZH3.js";
61
- import "./chunk-VO52SIZW.js";
61
+ import "./chunk-LIBTBTHP.js";
62
+ import "./chunk-6T5HCY34.js";
63
+ import "./chunk-L3YACXS2.js";
62
64
  import "./chunk-YAF2MQZ6.js";
63
65
  import {
64
66
  computeCpuPercent
65
67
  } from "./chunk-LBOVL47Y.js";
66
- import "./chunk-67LXZ6LV.js";
68
+ import "./chunk-SFBRH5RY.js";
67
69
  import "./chunk-6H67XLET.js";
68
70
  import {
69
71
  beginAcpBootstrapConfigProfiling,
70
72
  buildAndFreezeAcpStartupProfile,
71
73
  endAcpBootstrapConfigProfiling,
72
74
  markAcpStartup
73
- } from "./chunk-M2NMFAFR.js";
75
+ } from "./chunk-ZZ7RUTJ4.js";
74
76
  import {
75
77
  GENERATION_MAX_PROMPT_BYTES,
76
78
  GENERATION_TIMEOUT_MS,
79
+ HistoryReplayLimitError,
77
80
  MAX_REMEMBER_CONTENT_BYTES,
78
81
  REDACTED_MCP_SECRET,
79
82
  collectHistoryReplayUpdates,
@@ -92,7 +95,7 @@ import {
92
95
  shouldSuppressRememberErrorDetails,
93
96
  workspaceMemoryFailureCode,
94
97
  workspaceMemoryFailureDiagnostics
95
- } from "./chunk-5AWARYOK.js";
98
+ } from "./chunk-UWIJU22K.js";
96
99
  import "./chunk-ZBBVBZBR.js";
97
100
  import {
98
101
  BaseEmitter,
@@ -102,10 +105,10 @@ import {
102
105
  createTranscriptMessageUpdate,
103
106
  createTranscriptUsageUpdate,
104
107
  hasFullSessionContext
105
- } from "./chunk-7L64FSYQ.js";
106
- import "./chunk-47FQVRCO.js";
108
+ } from "./chunk-APQTLUZ3.js";
109
+ import "./chunk-EGB2PIYM.js";
107
110
  import "./chunk-4NFY2S7N.js";
108
- import "./chunk-GQW6P73F.js";
111
+ import "./chunk-FNVF5RR4.js";
109
112
  import "./chunk-2MIN6GRR.js";
110
113
  import "./chunk-QHTIBUWB.js";
111
114
  import "./chunk-3Z43GZUQ.js";
@@ -116,32 +119,32 @@ import {
116
119
  normalizeSessionIdForLookup,
117
120
  parseCallerSuppliedSessionId
118
121
  } from "./chunk-TQOF5KBL.js";
119
- import "./chunk-HGCQ5SE7.js";
122
+ import "./chunk-UXEO7E3V.js";
120
123
  import {
121
124
  PERMISSION_RULE_TYPES,
122
125
  PermissionRulesValidationError,
123
126
  buildPermissionSettings,
124
127
  normalizePermissionRules,
125
128
  readPermissionRuleSet
126
- } from "./chunk-LCWRQA5U.js";
129
+ } from "./chunk-Y2EOB7WZ.js";
127
130
  import {
128
131
  MAX_AUDIO_BYTES,
129
132
  sanitizeVoiceErrorMessage,
130
133
  transcribeVoiceAudio
131
- } from "./chunk-FLUYVAQZ.js";
134
+ } from "./chunk-Y2HK3ELT.js";
132
135
  import {
133
136
  readVoiceModel
134
- } from "./chunk-SZ36WFVK.js";
135
- import "./chunk-IQFYO5BF.js";
137
+ } from "./chunk-BGIKUE5J.js";
138
+ import "./chunk-5KZNWF2M.js";
136
139
  import "./chunk-NTTBXH7U.js";
137
- import "./chunk-ZIS5I56G.js";
140
+ import "./chunk-WIHSDI6U.js";
138
141
  import "./chunk-3SH53ANB.js";
139
142
  import {
140
143
  SESSION_SOURCE_META_KEY,
141
144
  parseSessionSource
142
- } from "./chunk-VUTOKX6F.js";
143
- import "./chunk-MZSJ43WV.js";
144
- import "./chunk-XCGIMOLN.js";
145
+ } from "./chunk-A2QIWDFO.js";
146
+ import "./chunk-JVY7FHUZ.js";
147
+ import "./chunk-WCCLLK7X.js";
145
148
  import "./chunk-OCPBI7J5.js";
146
149
  import {
147
150
  ACP_ROUTE_ID_PREFIX,
@@ -151,26 +154,26 @@ import {
151
154
  parseAcpModelOption,
152
155
  resolveAcpModelOption,
153
156
  sanitizeProviderBaseUrl
154
- } from "./chunk-5DDUYIY6.js";
157
+ } from "./chunk-3JI5D6RU.js";
155
158
  import {
156
159
  mapSkillConfigToStatus
157
160
  } from "./chunk-BGXZBI5B.js";
158
161
  import {
159
162
  resolveSkillSettings
160
163
  } from "./chunk-Z4X5MTRT.js";
161
- import "./chunk-3SIXC6QC.js";
162
- import "./chunk-C2VGLLNA.js";
164
+ import "./chunk-N56NYJWY.js";
165
+ import "./chunk-N3J3CO35.js";
163
166
  import "./chunk-57OAHC2Y.js";
164
- import "./chunk-YTYPRVIZ.js";
165
- import "./chunk-ENEEQMGM.js";
166
- import "./chunk-DEG7R6Z6.js";
167
+ import "./chunk-VUTOV2HG.js";
168
+ import "./chunk-XY7DGTIC.js";
169
+ import "./chunk-TN3REXN4.js";
167
170
  import "./chunk-V6WHFGST.js";
168
171
  import {
169
172
  createLoadedSettingsAdapter
170
- } from "./chunk-7PBUQKMT.js";
173
+ } from "./chunk-QSMZHJ62.js";
171
174
  import {
172
175
  ndJsonStream
173
- } from "./chunk-TKAEODJR.js";
176
+ } from "./chunk-2U3UCXZ3.js";
174
177
  import {
175
178
  ACP_PREFLIGHT_KINDS,
176
179
  IDLE_HOOK_EVENTS,
@@ -178,9 +181,9 @@ import {
178
181
  SERVE_STATUS_EXT_METHODS,
179
182
  STATUS_SCHEMA_VERSION,
180
183
  mapDomainErrorToErrorKind
181
- } from "./chunk-OPBATTFQ.js";
182
- import "./chunk-3GCU5O2E.js";
183
- import "./chunk-L2O7DJIE.js";
184
+ } from "./chunk-NHZF4VCD.js";
185
+ import "./chunk-U7ROFHSH.js";
186
+ import "./chunk-QSDPJROT.js";
184
187
  import {
185
188
  ACTIVE_WORK_CLOSE_IF_UNHELD_PARAM,
186
189
  ACTIVE_WORK_HEARTBEAT_META_KEY,
@@ -195,6 +198,8 @@ import {
195
198
  DAEMON_PROMPT_DISPLAY_TEXT_META_KEY,
196
199
  LOAD_REPLAY_BULK_MODE,
197
200
  LOAD_REPLAY_HIDE_INHERITED_META_KEY,
201
+ LOAD_REPLAY_MAX_BYTES,
202
+ LOAD_REPLAY_MAX_UPDATES,
198
203
  LOAD_REPLAY_META_KEY,
199
204
  LOAD_REPLAY_MODE_META_KEY,
200
205
  LOAD_REPLAY_PAGE_SIZE_META_KEY,
@@ -207,7 +212,7 @@ import {
207
212
  WORKTREE_MCP_DEFER_META_KEY,
208
213
  clampActiveWorkIntervalMs,
209
214
  isValidTrustedModelPrompt
210
- } from "./chunk-HHGQGTJQ.js";
215
+ } from "./chunk-UFHPAMAV.js";
211
216
  import {
212
217
  NOT_CURRENTLY_GENERATING_CANCEL_MESSAGE,
213
218
  isNotCurrentlyGeneratingCancelError
@@ -215,7 +220,7 @@ import {
215
220
  import "./chunk-6PLDPT2C.js";
216
221
  import "./chunk-FYJ7W2PI.js";
217
222
  import "./chunk-YP5KH5Y7.js";
218
- import "./chunk-K7JW6V5O.js";
223
+ import "./chunk-JW5UEE3V.js";
219
224
  import "./chunk-ALMR3E6Q.js";
220
225
  import "./chunk-HIBNSEJE.js";
221
226
  import "./chunk-M5GB774H.js";
@@ -229,17 +234,17 @@ import {
229
234
  import {
230
235
  ACP_EVENT_LOOP_STALL_RESTART_MS,
231
236
  CHANNEL_PROMPT_META_KEY
232
- } from "./chunk-LT532KF4.js";
237
+ } from "./chunk-ADJDLEVO.js";
233
238
  import {
234
239
  AgentSideConnection,
235
240
  PROTOCOL_VERSION,
236
241
  RequestError
237
242
  } from "./chunk-IW6RQPQB.js";
238
- import "./chunk-AQHNAA7E.js";
243
+ import "./chunk-7JL5YBSA.js";
239
244
  import {
240
245
  assembleMcpServers,
241
246
  loadMcpApprovals
242
- } from "./chunk-FWJRWCKU.js";
247
+ } from "./chunk-PYLVQ6RT.js";
243
248
  import {
244
249
  getOutputLanguageFilePath,
245
250
  getPersistScopeForModelSelection,
@@ -248,9 +253,9 @@ import {
248
253
  resolveOutputLanguageOrPreserveAuto,
249
254
  updateOutputLanguageFile,
250
255
  writeOutputLanguageAndRegisterPath
251
- } from "./chunk-3ZLUA4GV.js";
256
+ } from "./chunk-H2U4FK62.js";
252
257
  import "./chunk-RKUWKYED.js";
253
- import "./chunk-G4C5RLX6.js";
258
+ import "./chunk-4X5J3V2I.js";
254
259
  import "./chunk-GOXKNSDZ.js";
255
260
  import {
256
261
  getSystemDefaultsPath,
@@ -259,7 +264,7 @@ import {
259
264
  import {
260
265
  getCurrentLanguage,
261
266
  setLanguageAsync
262
- } from "./chunk-6LK2QPIA.js";
267
+ } from "./chunk-JXS2JNMZ.js";
263
268
  import {
264
269
  SUPPORTED_LANGUAGES
265
270
  } from "./chunk-5EJZE3FP.js";
@@ -267,17 +272,17 @@ import {
267
272
  findEnvFiles,
268
273
  preResolveHomeEnvOverrides,
269
274
  reloadEnvironment
270
- } from "./chunk-7N6WK2W6.js";
275
+ } from "./chunk-FXWGMPAP.js";
271
276
  import {
272
277
  ENV_ACP_REPEATED_TOOL_FAILURE_GUARD
273
278
  } from "./chunk-MS7GNABG.js";
274
- import "./chunk-DGM2XA3R.js";
275
- import "./chunk-VJNBRRZG.js";
279
+ import "./chunk-V2U6FOJB.js";
280
+ import "./chunk-WZMH7II3.js";
276
281
  import {
277
282
  isFolderTrustEnabled,
278
283
  isWorkspaceTrusted,
279
284
  loadTrustedFolders
280
- } from "./chunk-M2S67TPJ.js";
285
+ } from "./chunk-ZA2JN5IZ.js";
281
286
  import "./chunk-NPQ5ZKRP.js";
282
287
  import "./chunk-MR3PXB6E.js";
283
288
  import "./chunk-XFSFZCM5.js";
@@ -330,6 +335,7 @@ import {
330
335
  buildPermissionCheckContext,
331
336
  buildSessionRecoveryPlanFromApiHistory,
332
337
  clampInlineMediaPart,
338
+ collectSessionTurnState,
333
339
  computeUniqueBranchTitle,
334
340
  convertToFunctionErrorResponse,
335
341
  convertToFunctionResponse,
@@ -346,7 +352,6 @@ import {
346
352
  evaluatePlanModeShellPolicy,
347
353
  evaluateToolInvocationGuard,
348
354
  finalizeToolResponses,
349
- findBoundaryAtOrBefore,
350
355
  findExistingProviderModels,
351
356
  findPlanModeEntryBatchBoundaryIndex,
352
357
  findProviderById,
@@ -379,7 +384,6 @@ import {
379
384
  isDenialFallbackReason,
380
385
  isGatedMcpScope,
381
386
  isPlanModeBlocked,
382
- isReplayTurnStartType,
383
387
  markDuplicateProviderToolCallResponseSent,
384
388
  matchesAnyServerPattern,
385
389
  mcpServerRequiresOAuth,
@@ -399,7 +403,6 @@ import {
399
403
  runForkedAgent,
400
404
  runManagedAutoMemoryDream,
401
405
  runManagedRememberByAgent,
402
- sessionIdContext,
403
406
  shouldClassifyAllShellForAutoMode,
404
407
  shouldFallback,
405
408
  shouldFirePermissionDeniedForAutoMode,
@@ -411,25 +414,25 @@ import {
411
414
  updateSetting,
412
415
  validatePlanModeShellApproval,
413
416
  validatePlanModeShellContext
414
- } from "./chunk-INQN4KIA.js";
417
+ } from "./chunk-GHOUZ5X4.js";
415
418
  import "./chunk-GOFAQQZA.js";
416
419
  import "./chunk-5M6IDOMF.js";
417
420
  import "./chunk-TWPJO254.js";
418
421
  import {
419
422
  external_exports
420
423
  } from "./chunk-CQ35AJ4Z.js";
421
- import "./chunk-QTI7SRXI.js";
422
- import "./chunk-KT4OWAAZ.js";
423
- import "./chunk-IX7CFQGA.js";
424
- import "./chunk-N7NBMAMW.js";
424
+ import "./chunk-NM33GGOM.js";
425
+ import "./chunk-A4BAHMJF.js";
426
+ import "./chunk-ZPZANKVP.js";
427
+ import "./chunk-A6GQUQ7I.js";
425
428
  import {
426
429
  parsePositiveIntegerEnv
427
430
  } from "./chunk-6PVPNMXU.js";
428
- import "./chunk-U6LT3QBF.js";
431
+ import "./chunk-JBZYGFIB.js";
429
432
  import "./chunk-IRH27ZC2.js";
430
433
  import "./chunk-QHWCP53L.js";
431
- import "./chunk-XLQS3VI6.js";
432
- import "./chunk-NWPO6I7V.js";
434
+ import "./chunk-AAZWJAPQ.js";
435
+ import "./chunk-7WUMS2UA.js";
433
436
  import {
434
437
  promptIdContext,
435
438
  todoWorkChainContext
@@ -439,35 +442,38 @@ import "./chunk-ZPJWUGCS.js";
439
442
  import "./chunk-CPBF7KYF.js";
440
443
  import {
441
444
  APPROVAL_MODES
442
- } from "./chunk-6LYDH7VT.js";
443
- import "./chunk-2AZMF6G5.js";
445
+ } from "./chunk-SNHBRO4C.js";
446
+ import "./chunk-KTWUFHS4.js";
444
447
  import "./chunk-KRXPRVGL.js";
445
448
  import {
446
449
  HookEventName,
447
450
  createHookOutput
448
- } from "./chunk-GZGDJ4E6.js";
449
- import "./chunk-T6W4KACQ.js";
450
- import "./chunk-MWZYNOCG.js";
451
+ } from "./chunk-2ASWIM4A.js";
452
+ import "./chunk-67F2BEYW.js";
453
+ import "./chunk-TNETSI2A.js";
451
454
  import {
452
455
  GoalPersistenceUnavailableError,
453
456
  emptyGoalSnapshot,
454
457
  goalTurnContext,
458
+ parseGoalSnapshotV2,
459
+ parseGoalStateCause,
455
460
  wrapUserPromptSubmitContext
456
- } from "./chunk-SAQHDAUJ.js";
457
- import "./chunk-6XZERB6P.js";
461
+ } from "./chunk-B66LYK4B.js";
462
+ import "./chunk-VPZMLGD3.js";
458
463
  import {
464
+ addDaemonRequestAttribute,
459
465
  addToolArgumentsAttributes,
460
466
  addToolCallResultAttributes,
461
467
  extractDaemonTraceContext,
462
468
  registerAcpEventLoopLagGauge,
463
469
  startEventLoopLagMonitor,
464
470
  withDaemonSpan
465
- } from "./chunk-O5AZPHYZ.js";
471
+ } from "./chunk-U5C2GIN2.js";
466
472
  import "./chunk-SAH4BD2J.js";
467
- import "./chunk-5PWLQ7SK.js";
473
+ import "./chunk-2RTRFLWH.js";
468
474
  import {
469
475
  runWithRuntimeContentGenerator
470
- } from "./chunk-EYS3GGM3.js";
476
+ } from "./chunk-SKRHR6N2.js";
471
477
  import "./chunk-S6LOFUVP.js";
472
478
  import "./chunk-2J3OJGTL.js";
473
479
  import {
@@ -502,26 +508,26 @@ import {
502
508
  shouldRunVisionBridge,
503
509
  splitImageParts,
504
510
  uiTelemetryService
505
- } from "./chunk-HB6QW4LM.js";
511
+ } from "./chunk-UAAWNTOC.js";
506
512
  import "./chunk-YRLW2MSX.js";
507
513
  import "./chunk-VGC4I5JJ.js";
508
514
  import {
509
515
  getAutoMemoryRoot,
510
516
  getUserAutoMemoryRoot
511
- } from "./chunk-732MOPEM.js";
517
+ } from "./chunk-6OJDN5ZT.js";
512
518
  import {
513
519
  runSideQuery
514
- } from "./chunk-CTQE2NB2.js";
515
- import "./chunk-NC4O6UE6.js";
516
- import "./chunk-IEP44U2R.js";
520
+ } from "./chunk-JRTJEGSP.js";
521
+ import "./chunk-O6SLWH4X.js";
522
+ import "./chunk-C2DR57L6.js";
517
523
  import {
518
524
  FORK_SUBAGENT_TYPE,
519
525
  getStartupContextLength,
520
526
  isSystemReminderContent
521
- } from "./chunk-ZV4XVYL3.js";
527
+ } from "./chunk-TROB4PZY.js";
522
528
  import "./chunk-K623ENWT.js";
523
529
  import "./chunk-AQ37AY7B.js";
524
- import "./chunk-V3LXMASR.js";
530
+ import "./chunk-UHF5VBKO.js";
525
531
  import {
526
532
  BaseDeclarativeTool,
527
533
  BaseToolInvocation,
@@ -529,23 +535,23 @@ import {
529
535
  ToolNames,
530
536
  canonicalToolName,
531
537
  isShellProgressData
532
- } from "./chunk-XTH2OMDS.js";
538
+ } from "./chunk-ZRT36RSF.js";
533
539
  import {
534
540
  clearCachedCredentialFile,
535
541
  qwenOAuth2Events
536
- } from "./chunk-TBVNYG5B.js";
542
+ } from "./chunk-CDDLHCC2.js";
537
543
  import "./chunk-NAVJD2PQ.js";
538
- import "./chunk-5HBFERG5.js";
539
- import "./chunk-EYW54TBD.js";
544
+ import "./chunk-YI5G32RU.js";
545
+ import "./chunk-QEWAHAW2.js";
540
546
  import "./chunk-P3QQPMQA.js";
541
- import "./chunk-O4BBDP2G.js";
542
- import "./chunk-KPVVWKF3.js";
547
+ import "./chunk-FTGU6G45.js";
548
+ import "./chunk-PSTHNTHF.js";
543
549
  import {
544
550
  AuthType,
545
551
  preloadContentGenerator
546
- } from "./chunk-LOJO2RPW.js";
552
+ } from "./chunk-XJ6IMYUS.js";
547
553
  import "./chunk-F6WFNA7U.js";
548
- import "./chunk-F6AOBFUN.js";
554
+ import "./chunk-NW7SPXVG.js";
549
555
  import {
550
556
  REASONING_EFFORT_TIERS,
551
557
  applyReasoningEffort
@@ -555,14 +561,14 @@ import "./chunk-AXMWHKXA.js";
555
561
  import {
556
562
  getToolCallPreparations
557
563
  } from "./chunk-GLCZKT5V.js";
558
- import "./chunk-GJJQV4PY.js";
564
+ import "./chunk-KK3FEHPJ.js";
559
565
  import "./chunk-46UV252V.js";
560
566
  import {
561
567
  DEFAULT_TOKEN_LIMIT,
562
568
  tokenLimit
563
569
  } from "./chunk-FPGTNKCP.js";
564
570
  import "./chunk-DJ2GSRLV.js";
565
- import "./chunk-EFIMD5VA.js";
571
+ import "./chunk-H6BFLALJ.js";
566
572
  import {
567
573
  endToolExecutionSpan,
568
574
  endToolSpan,
@@ -571,21 +577,23 @@ import {
571
577
  startToolExecutionSpan,
572
578
  startToolSpan,
573
579
  withInteractionSpan
574
- } from "./chunk-E5BWLU5J.js";
580
+ } from "./chunk-3MJ44LNC.js";
575
581
  import "./chunk-HHJLM3WQ.js";
576
- import "./chunk-L2GTEEEU.js";
582
+ import {
583
+ sessionIdContext
584
+ } from "./chunk-K5IDV3PC.js";
577
585
  import {
578
586
  Storage,
579
587
  createDebugLogger,
580
588
  getErrorMessage,
581
589
  getErrorStatus,
582
590
  isSubpath
583
- } from "./chunk-MPBRV3UU.js";
591
+ } from "./chunk-YMB77M76.js";
584
592
  import "./chunk-VOQXFAY5.js";
585
- import "./chunk-M3QYOPGN.js";
593
+ import "./chunk-BXAGPCYH.js";
586
594
  import {
587
595
  runExitCleanup
588
- } from "./chunk-ABGS4FDQ.js";
596
+ } from "./chunk-NX5QZVRS.js";
589
597
  import {
590
598
  writeStderrLine,
591
599
  writeStderrLineSafe
@@ -1648,8 +1656,12 @@ var MessageEmitter = class extends BaseEmitter {
1648
1656
  }
1649
1657
  });
1650
1658
  }
1651
- async emitGoalStatus(status) {
1652
- await this.sendUpdate(buildGoalStatusUpdate(status));
1659
+ async emitGoalStatus(status, goalState) {
1660
+ const update = buildGoalStatusUpdate(status);
1661
+ if (goalState) {
1662
+ update._meta = { ...update._meta, goalState };
1663
+ }
1664
+ await this.sendUpdate(update);
1653
1665
  }
1654
1666
  async emitGoalState(snapshot, cause, previousGoal = null) {
1655
1667
  await this.sendUpdate(buildGoalStateUpdate(snapshot, cause, previousGoal));
@@ -1784,6 +1796,58 @@ var MessageEmitter = class extends BaseEmitter {
1784
1796
  }
1785
1797
  };
1786
1798
 
1799
+ // packages/cli/src/acp-integration/session/recovered-goal-update.ts
1800
+ init_esbuild_shims();
1801
+ async function renderPreparedGoalUpdate(getRuntime, options = {}) {
1802
+ let runtime;
1803
+ try {
1804
+ runtime = await getRuntime();
1805
+ } catch (error) {
1806
+ if (!(error instanceof GoalPersistenceUnavailableError)) throw error;
1807
+ const status = unrestorableGoalStatus(
1808
+ options.replayedRecords,
1809
+ options.bootstrap
1810
+ );
1811
+ return { updates: status ? [buildGoalStatusUpdate(status)] : [] };
1812
+ }
1813
+ const cause = runtime.getRecoveryCause?.();
1814
+ if (!cause) return { updates: [] };
1815
+ const snapshot = runtime.getSnapshot();
1816
+ const publicationKey = goalPublicationKey(snapshot, cause);
1817
+ if (options.hideRuntimeGoal) {
1818
+ return {
1819
+ publicationKey,
1820
+ ...snapshot.goal ? {
1821
+ suppressedGoalId: snapshot.goal.goalId
1822
+ } : {},
1823
+ updates: []
1824
+ };
1825
+ }
1826
+ const bootstrapGoal = options.bootstrap?.goalState?.goal;
1827
+ const bootstrapMatchesRuntime = bootstrapGoal != null && snapshot.goal?.goalId === bootstrapGoal.goalId && snapshot.goal?.revision === bootstrapGoal.revision;
1828
+ return {
1829
+ publicationKey,
1830
+ updates: options.bootstrap && bootstrapMatchesRuntime ? [] : [buildGoalStateUpdate(snapshot, cause, options.previousGoal ?? null)]
1831
+ };
1832
+ }
1833
+ __name(renderPreparedGoalUpdate, "renderPreparedGoalUpdate");
1834
+ function unrestorableGoalStatus(replayedRecords, bootstrap) {
1835
+ const active = (replayedRecords?.length ? findGoalToRestore(collectGoalStatusItemsFromRecords(replayedRecords)) : void 0) ?? bootstrap?.goalStatus;
1836
+ if (!active) return void 0;
1837
+ return {
1838
+ kind: "cleared",
1839
+ condition: active.condition,
1840
+ iterations: active.iterations,
1841
+ ...active.setAt !== void 0 ? { setAt: active.setAt } : {},
1842
+ lastReason: "Goal not restored: its saved state could not be read, so this session is not driving it."
1843
+ };
1844
+ }
1845
+ __name(unrestorableGoalStatus, "unrestorableGoalStatus");
1846
+ function goalPublicationKey(snapshot, cause) {
1847
+ return cause ? `${cause}:${JSON.stringify(snapshot)}` : void 0;
1848
+ }
1849
+ __name(goalPublicationKey, "goalPublicationKey");
1850
+
1787
1851
  // packages/cli/src/acp-integration/session/SubAgentTracker.ts
1788
1852
  init_esbuild_shims();
1789
1853
 
@@ -3479,28 +3543,6 @@ function resolveHomeLoopResolverRoots({
3479
3543
  };
3480
3544
  }
3481
3545
  __name(resolveHomeLoopResolverRoots, "resolveHomeLoopResolverRoots");
3482
- function computeInitialTurnFromHistory(records, sessionId) {
3483
- let maxPromptTurn = 0;
3484
- let userMessageCount = 0;
3485
- const promptIdPrefix = `${sessionId}########`;
3486
- for (const record of records) {
3487
- if (record.sessionId === sessionId && isUserPromptRecord(record)) {
3488
- userMessageCount += 1;
3489
- }
3490
- for (const promptId of getRecordPromptIds(record)) {
3491
- if (!promptId.startsWith(promptIdPrefix)) {
3492
- continue;
3493
- }
3494
- const suffix = promptId.slice(promptIdPrefix.length);
3495
- if (!/^\d+$/.test(suffix)) {
3496
- continue;
3497
- }
3498
- maxPromptTurn = Math.max(maxPromptTurn, Number(suffix));
3499
- }
3500
- }
3501
- return maxPromptTurn > 0 ? maxPromptTurn : userMessageCount;
3502
- }
3503
- __name(computeInitialTurnFromHistory, "computeInitialTurnFromHistory");
3504
3546
  async function fireSessionPermissionDeniedForAutoMode(config, decision, outcome, toolName, toolParams, callId, signal) {
3505
3547
  if (!config.getDisableAllHooks?.() && shouldFirePermissionDeniedForAutoMode(decision, outcome)) {
3506
3548
  try {
@@ -3520,40 +3562,6 @@ async function fireSessionPermissionDeniedForAutoMode(config, decision, outcome,
3520
3562
  }
3521
3563
  }
3522
3564
  __name(fireSessionPermissionDeniedForAutoMode, "fireSessionPermissionDeniedForAutoMode");
3523
- function getRecordPromptIds(record) {
3524
- const promptIds = [];
3525
- const recordPromptId = record.promptId;
3526
- if (typeof recordPromptId === "string") {
3527
- promptIds.push(recordPromptId);
3528
- }
3529
- const telemetryPromptId = readTelemetryPromptId(record.systemPayload);
3530
- if (telemetryPromptId) {
3531
- promptIds.push(telemetryPromptId);
3532
- }
3533
- return promptIds;
3534
- }
3535
- __name(getRecordPromptIds, "getRecordPromptIds");
3536
- function readTelemetryPromptId(payload) {
3537
- if (!payload || typeof payload !== "object" || !("uiEvent" in payload)) {
3538
- return void 0;
3539
- }
3540
- const uiEvent = payload.uiEvent;
3541
- if (!uiEvent || typeof uiEvent !== "object" || !("prompt_id" in uiEvent)) {
3542
- return void 0;
3543
- }
3544
- const promptId = uiEvent.prompt_id;
3545
- return typeof promptId === "string" ? promptId : void 0;
3546
- }
3547
- __name(readTelemetryPromptId, "readTelemetryPromptId");
3548
- function isUserPromptRecord(record) {
3549
- if (record.type !== "user" || record.subtype === "realtime_message") {
3550
- return false;
3551
- }
3552
- return record.message?.parts?.some(
3553
- (part) => typeof part.text === "string" && part.text.trim().length > 0
3554
- ) ?? false;
3555
- }
3556
- __name(isUserPromptRecord, "isUserPromptRecord");
3557
3565
  var AT_TOKEN_RE = /@([^\s,;!?()[\]{}]+)/g;
3558
3566
  function collectExtensionMentionRefs(text, mentions) {
3559
3567
  for (const match of text.matchAll(AT_TOKEN_RE)) {
@@ -3786,6 +3794,9 @@ var Session = class {
3786
3794
  goalRuntimeUnsubscribe;
3787
3795
  lastGoalSnapshot;
3788
3796
  lastGoalPublicationKey;
3797
+ // Set only when runtime recovery selected a Goal that initial replay hid.
3798
+ // Keep that Goal private through activation and later progress updates.
3799
+ suppressedRecoveredGoalId;
3789
3800
  goalPublicationTail = Promise.resolve();
3790
3801
  // Set true in dispose(). Guards #drainCronQueue and #drainNotificationQueue
3791
3802
  // against the race where #drainNotificationQueue's finally block kicks off
@@ -3897,6 +3908,7 @@ var Session = class {
3897
3908
  this.goalHostUnbind = void 0;
3898
3909
  this.lastGoalSnapshot = void 0;
3899
3910
  this.lastGoalPublicationKey = void 0;
3911
+ this.suppressedRecoveredGoalId = void 0;
3900
3912
  this.#bindGoalRuntime();
3901
3913
  }
3902
3914
  /**
@@ -3934,50 +3946,36 @@ var Session = class {
3934
3946
  if (!cause) return;
3935
3947
  await this.#queueGoalState(runtime.getSnapshot(), cause);
3936
3948
  }
3937
- /**
3938
- * Render the recovered-Goal cards instead of streaming them.
3939
- *
3940
- * The bulk load-replay path (`historyReplay: 'response'`) does not stream
3941
- * its replay: `loadSession` collects the page into the `LOAD_REPLAY`
3942
- * envelope and the bridge seeds those updates onto the session's event bus
3943
- * *after* the ACP `session/load` call returns. A card streamed from inside
3944
- * that call therefore lands on the bus **before** the replayed
3945
- * pre-migration `set` card — the reverse of the ordering
3946
- * {@link publishRecoveredGoalState} exists to produce, leaving the phantom
3947
- * running goal exactly as it was. Returning the cards lets the caller
3948
- * append them to the envelope, after the replay page.
3949
- *
3950
- * Appending after a truncated page (`hasMore`) is still correct: paging
3951
- * drops the oldest records, so the authoritative state belongs last either
3952
- * way.
3953
- *
3954
- * Marks the publication as delivered, so the runtime subscription cannot
3955
- * emit a duplicate card for the same `(cause, snapshot)` once the session
3956
- * goes live.
3957
- */
3958
3949
  async renderRecoveredGoalUpdates(replayedRecords) {
3959
3950
  if (this.disposed || this.closing) return [];
3960
- let runtime;
3961
- try {
3962
- runtime = await this.config.getGoalRuntimeReady();
3963
- } catch (error) {
3964
- if (!(error instanceof GoalPersistenceUnavailableError)) throw error;
3965
- const status = this.#unrestorableGoalStatus(replayedRecords);
3966
- return status ? [buildGoalStatusUpdate(status)] : [];
3951
+ const rendered = await renderPreparedGoalUpdate(
3952
+ () => this.config.getGoalRuntimeReady(),
3953
+ {
3954
+ ...replayedRecords ? { replayedRecords } : {},
3955
+ previousGoal: this.lastGoalSnapshot?.goal ?? null
3956
+ }
3957
+ );
3958
+ if (rendered.publicationKey && rendered.publicationKey === this.lastGoalPublicationKey) {
3959
+ return [];
3967
3960
  }
3968
- const cause = runtime.getRecoveryCause?.();
3969
- if (!cause) return [];
3970
- const snapshot = runtime.getSnapshot();
3971
- const publicationKey = this.#goalPublicationKey(snapshot, cause);
3972
- if (publicationKey === this.lastGoalPublicationKey) return [];
3973
- this.lastGoalPublicationKey = publicationKey;
3974
- return [
3975
- buildGoalStateUpdate(
3976
- snapshot,
3977
- cause,
3978
- this.lastGoalSnapshot?.goal ?? null
3979
- )
3980
- ];
3961
+ this.primeRecoveredGoalPublication(rendered.publicationKey);
3962
+ return rendered.updates;
3963
+ }
3964
+ primeRecoveredGoalPublication(publicationKey, suppressedGoalId) {
3965
+ if (publicationKey) this.lastGoalPublicationKey = publicationKey;
3966
+ this.suppressedRecoveredGoalId = suppressedGoalId;
3967
+ }
3968
+ #suppressRecoveredGoalUpdate(snapshot) {
3969
+ const suppressedGoalId = this.suppressedRecoveredGoalId;
3970
+ if (!suppressedGoalId) return false;
3971
+ const goal = snapshot.goal;
3972
+ if (goal?.goalId === suppressedGoalId) return true;
3973
+ if (goal === null) {
3974
+ this.suppressedRecoveredGoalId = void 0;
3975
+ return true;
3976
+ }
3977
+ this.suppressedRecoveredGoalId = void 0;
3978
+ return false;
3981
3979
  }
3982
3980
  /**
3983
3981
  * Emit a trailing `cleared` card for an active legacy goal the runtime
@@ -4010,11 +4008,9 @@ var Session = class {
4010
4008
  lastReason: "Goal not restored: its saved state could not be read, so this session is not driving it."
4011
4009
  };
4012
4010
  }
4013
- #goalPublicationKey(snapshot, cause) {
4014
- return cause ? `${cause}:${JSON.stringify(snapshot)}` : void 0;
4015
- }
4016
4011
  async #publishGoalState(snapshot, cause, previousGoal = this.lastGoalSnapshot?.goal ?? null) {
4017
- const publicationKey = this.#goalPublicationKey(snapshot, cause);
4012
+ if (this.#suppressRecoveredGoalUpdate(snapshot)) return;
4013
+ const publicationKey = goalPublicationKey(snapshot, cause);
4018
4014
  if (publicationKey && publicationKey === this.lastGoalPublicationKey) {
4019
4015
  return;
4020
4016
  }
@@ -4938,22 +4934,25 @@ var Session = class {
4938
4934
  * Delegates to HistoryReplayer for consistent event emission.
4939
4935
  */
4940
4936
  primeTurnFromHistory(records) {
4941
- for (const record of records) {
4942
- if (record.subtype !== "notification") continue;
4943
- const backgroundTask = record.systemPayload?.backgroundTask;
4944
- if (typeof backgroundTask?.taskId === "string") {
4945
- this.persistedBackgroundNotificationTaskIds.add(backgroundTask.taskId);
4946
- }
4947
- }
4948
- this.turn = Math.max(
4949
- this.turn,
4950
- computeInitialTurnFromHistory(records, this.config.getSessionId())
4937
+ const turnState = collectSessionTurnState(
4938
+ records,
4939
+ this.config.getSessionId()
4940
+ );
4941
+ this.primeTurnState(
4942
+ turnState.initialTurn,
4943
+ turnState.backgroundNotificationTaskIds
4951
4944
  );
4952
4945
  }
4953
- async replayHistory(records, gaps) {
4946
+ primeTurnState(initialTurn, backgroundNotificationTaskIds) {
4947
+ for (const taskId of backgroundNotificationTaskIds) {
4948
+ this.persistedBackgroundNotificationTaskIds.add(taskId);
4949
+ }
4950
+ this.turn = Math.max(this.turn, initialTurn);
4951
+ }
4952
+ async replayHistory(records, gaps, options) {
4954
4953
  this.primeTurnFromHistory(records);
4955
4954
  try {
4956
- await this.historyReplayer.replay(records, gaps);
4955
+ await this.historyReplayer.replay(records, gaps, options);
4957
4956
  } finally {
4958
4957
  this.activeTodoPlanRevision = void 0;
4959
4958
  }
@@ -11496,6 +11495,162 @@ function shouldHideInheritedHistory(params) {
11496
11495
  return meta?.[LOAD_REPLAY_HIDE_INHERITED_META_KEY] === true;
11497
11496
  }
11498
11497
  __name(shouldHideInheritedHistory, "shouldHideInheritedHistory");
11498
+ function loadRestoreOptions(params) {
11499
+ const hideInheritedHistory = shouldHideInheritedHistory(params);
11500
+ if (!isBulkLoadReplayRequest(params)) {
11501
+ return { replay: { kind: "all", hideInheritedHistory } };
11502
+ }
11503
+ const limit = getLoadReplayPageSize(params);
11504
+ return limit === void 0 ? { replay: { kind: "all", hideInheritedHistory } } : { replay: { kind: "recent", limit, hideInheritedHistory } };
11505
+ }
11506
+ __name(loadRestoreOptions, "loadRestoreOptions");
11507
+ var RESUME_RESTORE_OPTIONS = {
11508
+ replay: { kind: "none" }
11509
+ };
11510
+ function mapSessionRestoreRequestError(error, sessionId) {
11511
+ const mappedWriterError = mapSessionWriterRequestError(error);
11512
+ if (mappedWriterError !== error) return mappedWriterError;
11513
+ if (error instanceof SessionTranscriptSnapshotUnavailableError) {
11514
+ return new RequestError(-32010, error.message, {
11515
+ errorKind: "transcript_snapshot_unavailable",
11516
+ sessionId
11517
+ });
11518
+ }
11519
+ if (error instanceof SessionTranscriptTooLargeError) {
11520
+ return new RequestError(-32011, error.message, {
11521
+ errorKind: "transcript_too_large",
11522
+ sessionId,
11523
+ snapshotSize: error.snapshotSize,
11524
+ maxBytes: error.maxBytes
11525
+ });
11526
+ }
11527
+ if (error instanceof SessionTranscriptPageTooLargeError) {
11528
+ addDaemonRequestAttribute(
11529
+ "qwen-code.daemon.session_restore.envelope_limit_reason",
11530
+ "bytes"
11531
+ );
11532
+ return new RequestError(-32012, error.message, {
11533
+ errorKind: "transcript_page_too_large",
11534
+ sessionId,
11535
+ pageBytes: error.pageBytes,
11536
+ maxBytes: error.maxBytes
11537
+ });
11538
+ }
11539
+ if (error instanceof HistoryReplayLimitError) {
11540
+ addDaemonRequestAttribute(
11541
+ "qwen-code.daemon.session_restore.envelope_limit_reason",
11542
+ error.reason
11543
+ );
11544
+ return new RequestError(-32012, error.message, {
11545
+ errorKind: "transcript_page_too_large",
11546
+ sessionId,
11547
+ reason: error.reason,
11548
+ observed: error.observed,
11549
+ limit: error.limit
11550
+ });
11551
+ }
11552
+ return error;
11553
+ }
11554
+ __name(mapSessionRestoreRequestError, "mapSessionRestoreRequestError");
11555
+ function validateLoadReplayEnvelope(sessionId, envelope, enforceLimits) {
11556
+ if (!enforceLimits) return;
11557
+ if (envelope.updates.length > LOAD_REPLAY_MAX_UPDATES) {
11558
+ throw new HistoryReplayLimitError(
11559
+ sessionId,
11560
+ "updates",
11561
+ envelope.updates.length,
11562
+ LOAD_REPLAY_MAX_UPDATES
11563
+ );
11564
+ }
11565
+ const pageBytes = Buffer.byteLength(JSON.stringify(envelope), "utf8");
11566
+ if (pageBytes > LOAD_REPLAY_MAX_BYTES) {
11567
+ throw new HistoryReplayLimitError(
11568
+ sessionId,
11569
+ "bytes",
11570
+ pageBytes,
11571
+ LOAD_REPLAY_MAX_BYTES
11572
+ );
11573
+ }
11574
+ }
11575
+ __name(validateLoadReplayEnvelope, "validateLoadReplayEnvelope");
11576
+ function replayGoalBootstrap(projection) {
11577
+ if (projection && !("runtime" in projection)) {
11578
+ const sourceUuid2 = projection.goalRecoverySourceUuid;
11579
+ if (!sourceUuid2) return void 0;
11580
+ if (projection.replay?.records.some((record) => record.uuid === sourceUuid2)) {
11581
+ return void 0;
11582
+ }
11583
+ const replay = projection.replay?.replay;
11584
+ if (isObjectRecord(replay)) {
11585
+ const bootstrap = HistoryReplayer.v2GoalBootstrap(
11586
+ replay["goalState"],
11587
+ replay["goalCause"]
11588
+ );
11589
+ if (bootstrap) return bootstrap;
11590
+ }
11591
+ const sourceRecord2 = projection.goalRecords?.find(
11592
+ (record) => record.uuid === sourceUuid2
11593
+ );
11594
+ if (sourceRecord2?.subtype === "goal_state") {
11595
+ const payload = isObjectRecord(sourceRecord2.systemPayload) ? sourceRecord2.systemPayload : void 0;
11596
+ return HistoryReplayer.v2GoalBootstrap(
11597
+ payload?.["snapshot"],
11598
+ payload?.["cause"]
11599
+ );
11600
+ }
11601
+ const active2 = findGoalToRestore(
11602
+ collectGoalStatusItemsFromRecords(projection.goalRecords ?? [])
11603
+ );
11604
+ return active2 ? {
11605
+ goalStatus: {
11606
+ kind: active2.iterations > 0 ? "checking" : "set",
11607
+ condition: active2.condition,
11608
+ iterations: active2.iterations,
11609
+ ...active2.setAt !== void 0 ? { setAt: active2.setAt } : {}
11610
+ }
11611
+ } : void 0;
11612
+ }
11613
+ const sourceUuid = projection?.replay?.goalRecoverySourceUuid;
11614
+ if (!projection?.replay || !sourceUuid) return void 0;
11615
+ if (projection.replay.records.some((record) => record.uuid === sourceUuid)) {
11616
+ return void 0;
11617
+ }
11618
+ const goalBootstrapRecords = projection.replay.goalBootstrapRecords ?? [];
11619
+ const sourceRecord = goalBootstrapRecords.find(
11620
+ (record) => record.uuid === sourceUuid
11621
+ );
11622
+ if (sourceRecord?.subtype === "goal_state") {
11623
+ const payload = isObjectRecord(sourceRecord.systemPayload) ? sourceRecord.systemPayload : void 0;
11624
+ return HistoryReplayer.v2GoalBootstrap(
11625
+ payload?.["snapshot"],
11626
+ payload?.["cause"]
11627
+ );
11628
+ }
11629
+ const active = findGoalToRestore(
11630
+ collectGoalStatusItemsFromRecords(goalBootstrapRecords)
11631
+ );
11632
+ if (!active) return void 0;
11633
+ return {
11634
+ goalStatus: {
11635
+ kind: active.iterations > 0 ? "checking" : "set",
11636
+ condition: active.condition,
11637
+ iterations: active.iterations,
11638
+ ...active.setAt !== void 0 ? { setAt: active.setAt } : {}
11639
+ }
11640
+ };
11641
+ }
11642
+ __name(replayGoalBootstrap, "replayGoalBootstrap");
11643
+ function replayInitialGoalState(projection) {
11644
+ const replay = projection?.replay?.replay;
11645
+ if (!isObjectRecord(replay)) return {};
11646
+ const initialGoalState = parseGoalSnapshotV2(replay["goalState"]);
11647
+ const initialGoalCause = parseGoalStateCause(replay["goalCause"]);
11648
+ return {
11649
+ ...initialGoalState ? { initialGoalState } : {},
11650
+ ...initialGoalCause ? { initialGoalCause } : {}
11651
+ };
11652
+ }
11653
+ __name(replayInitialGoalState, "replayInitialGoalState");
11499
11654
  function selectVisibleHistoryRecords(records, hideInheritedHistory) {
11500
11655
  const sourceBoundary = records.findIndex(
11501
11656
  (record) => record.type === "system" && record.subtype === "session_source" && isObjectRecord(record.systemPayload) && record.systemPayload["sourceType"] === "side_task"
@@ -11536,61 +11691,6 @@ function getLoadReplayPageSize(params) {
11536
11691
  return value;
11537
11692
  }
11538
11693
  __name(getLoadReplayPageSize, "getLoadReplayPageSize");
11539
- function isHistoryTurnStart(record) {
11540
- return isReplayTurnStartType(record.type, record.subtype);
11541
- }
11542
- __name(isHistoryTurnStart, "isHistoryTurnStart");
11543
- function isHistoryPageStart(record) {
11544
- return record.subtype !== "realtime_message" && (record.type === "assistant" || isHistoryTurnStart(record));
11545
- }
11546
- __name(isHistoryPageStart, "isHistoryPageStart");
11547
- function historyOrphansToolResult(records, start, end) {
11548
- for (let i = start; i < end; i++) {
11549
- if (records[i].type !== "tool_result") continue;
11550
- for (let owner = i - 1; owner >= start; owner--) {
11551
- if (isHistoryPageStart(records[owner])) return false;
11552
- }
11553
- return true;
11554
- }
11555
- return false;
11556
- }
11557
- __name(historyOrphansToolResult, "historyOrphansToolResult");
11558
- function selectRecentHistoryRecords(records, pageSize) {
11559
- if (pageSize === void 0 || records.length <= pageSize) {
11560
- return { records, hasMore: false };
11561
- }
11562
- let start = records.length - pageSize;
11563
- for (let i = start; i < records.length; i++) {
11564
- if (isHistoryTurnStart(records[i])) {
11565
- start = i;
11566
- break;
11567
- }
11568
- }
11569
- const expansionFloor = Math.max(0, records.length - 2 * pageSize);
11570
- const aligned = findBoundaryAtOrBefore(
11571
- records,
11572
- start,
11573
- expansionFloor,
11574
- isHistoryTurnStart
11575
- );
11576
- if (isHistoryTurnStart(records[aligned])) {
11577
- start = aligned;
11578
- }
11579
- if (start > 0 && historyOrphansToolResult(records, start, records.length)) {
11580
- const pairFloor = Math.max(0, start - pageSize);
11581
- const owner = findBoundaryAtOrBefore(
11582
- records,
11583
- start,
11584
- pairFloor,
11585
- isHistoryPageStart
11586
- );
11587
- if (isHistoryPageStart(records[owner])) {
11588
- start = owner;
11589
- }
11590
- }
11591
- return { records: records.slice(start), hasMore: start > 0 };
11592
- }
11593
- __name(selectRecentHistoryRecords, "selectRecentHistoryRecords");
11594
11694
  function createHiddenWorkspaceMemoryConfig(config) {
11595
11695
  return new Proxy(config, {
11596
11696
  get(target, prop) {
@@ -14060,7 +14160,7 @@ var QwenAgent = class {
14060
14160
  );
14061
14161
  }
14062
14162
  }
14063
- async withLiveSessionRestore(sessionId, session, operation) {
14163
+ async withLiveSessionRestore(sessionId, session, options, operation) {
14064
14164
  await session.assertCanStartTurn();
14065
14165
  const config = session.getConfig();
14066
14166
  const releaseGate = session.beginClose();
@@ -14071,12 +14171,12 @@ var QwenAgent = class {
14071
14171
  "restore"
14072
14172
  );
14073
14173
  const recorder = config.getChatRecordingService();
14074
- const loadAuthoritative = /* @__PURE__ */ __name(() => config.getSessionService().loadSession(sessionId), "loadAuthoritative");
14075
- const data = recorder ? await recorder.runWithWriteBarrier(loadAuthoritative) : await loadAuthoritative();
14076
- if (!data) throw new SessionWriterUnavailableError();
14077
- return await operation(config, data);
14174
+ const readProjection = /* @__PURE__ */ __name(() => config.getSessionService().readLiveRestoreProjection(sessionId, options), "readProjection");
14175
+ const projection = recorder ? await recorder.runWithWriteBarrier(readProjection) : await readProjection();
14176
+ if (!projection) throw new SessionWriterUnavailableError();
14177
+ return await operation(config, projection);
14078
14178
  } catch (error) {
14079
- throw mapSessionWriterRequestError(error);
14179
+ throw mapSessionRestoreRequestError(error, sessionId);
14080
14180
  } finally {
14081
14181
  releaseGate();
14082
14182
  }
@@ -14103,7 +14203,7 @@ var QwenAgent = class {
14103
14203
  this.pendingConfigCleanup.delete(cleanupKey);
14104
14204
  }
14105
14205
  }
14106
- async cleanupAfterRequestFailure(error, cleanup) {
14206
+ async cleanupAfterRequestFailure(error, cleanup, sessionId) {
14107
14207
  try {
14108
14208
  await cleanup();
14109
14209
  } catch (cleanupError) {
@@ -14111,7 +14211,7 @@ var QwenAgent = class {
14111
14211
  `Session cleanup failed while preserving the original request error: ${cleanupError instanceof Error ? cleanupError.message : String(cleanupError)}`
14112
14212
  );
14113
14213
  }
14114
- throw mapSessionWriterRequestError(error);
14214
+ throw sessionId ? mapSessionRestoreRequestError(error, sessionId) : mapSessionWriterRequestError(error);
14115
14215
  }
14116
14216
  pendingConfigCleanupKey(runtimeBaseDir, sessionId) {
14117
14217
  return `${path4.resolve(runtimeBaseDir)}\0${sessionId}`;
@@ -14311,7 +14411,7 @@ var QwenAgent = class {
14311
14411
  }
14312
14412
  this.clientCapabilities = args.clientCapabilities;
14313
14413
  const authMethods = buildAuthMethods();
14314
- const version = "0.21.12-preview.1";
14414
+ const version = "0.21.12-preview.4";
14315
14415
  const response = {
14316
14416
  protocolVersion: PROTOCOL_VERSION,
14317
14417
  agentInfo: {
@@ -14512,6 +14612,7 @@ var QwenAgent = class {
14512
14612
  async loadSessionWithProfiler(params, initialSessionId, profiler) {
14513
14613
  let sessionId = initialSessionId;
14514
14614
  const sessionSource = getSessionSource(params);
14615
+ const restoreOptions = loadRestoreOptions(params);
14515
14616
  const liveSession = this.sessions.get(sessionId);
14516
14617
  if (liveSession) {
14517
14618
  const settings = profiler.timeSync(
@@ -14524,35 +14625,43 @@ var QwenAgent = class {
14524
14625
  return this.withLiveSessionRestore(
14525
14626
  sessionId,
14526
14627
  liveSession,
14527
- async (config, sessionData) => {
14628
+ restoreOptions,
14629
+ async (config, projection) => {
14528
14630
  const response = profiler.timeSync(
14529
14631
  "response_build",
14530
14632
  () => ({
14531
14633
  modes: this.buildModesData(config),
14532
14634
  models: this.buildAvailableModels(config),
14533
14635
  configOptions: this.buildConfigOptions(config),
14534
- ...sessionData.artifactSnapshot ? { artifactSnapshot: sessionData.artifactSnapshot } : {}
14636
+ ...projection?.artifactSnapshot ? { artifactSnapshot: projection.artifactSnapshot } : {}
14535
14637
  })
14536
14638
  );
14537
- const records = sessionData.conversation.messages;
14538
- const visibleRecords = selectVisibleHistoryRecords(
14539
- records,
14540
- shouldHideInheritedHistory(params)
14541
- );
14542
- if (visibleRecords.length === 0) return response;
14639
+ const replayPage = projection?.replay;
14640
+ if (!replayPage || replayPage.records.length === 0) return response;
14543
14641
  const bulkReplay = isBulkLoadReplayRequest(params);
14544
- const replayPage = bulkReplay ? selectRecentHistoryRecords(
14545
- visibleRecords,
14546
- getLoadReplayPageSize(params)
14547
- ) : { records: visibleRecords, hasMore: false };
14548
- const replay = await collectHistoryReplayUpdates({
14549
- sessionId,
14550
- config,
14551
- records: replayPage.records,
14552
- gaps: sessionData.historyGaps,
14553
- cumulativeUsage: createReplayCumulativeUsage(),
14554
- logger: debugLogger8
14555
- });
14642
+ const replay = await profiler.time(
14643
+ "history_replay",
14644
+ () => collectHistoryReplayUpdates({
14645
+ sessionId,
14646
+ config,
14647
+ records: replayPage.records,
14648
+ gaps: replayPage.gaps,
14649
+ cumulativeUsage: createReplayCumulativeUsage(),
14650
+ replayState: replayPage.replay,
14651
+ goalBootstrap: replayGoalBootstrap(projection),
14652
+ ...restoreOptions.replay.kind === "recent" ? {
14653
+ limits: {
14654
+ maxBytes: LOAD_REPLAY_MAX_BYTES,
14655
+ maxUpdates: LOAD_REPLAY_MAX_UPDATES
14656
+ }
14657
+ } : {},
14658
+ logger: debugLogger8
14659
+ })
14660
+ );
14661
+ addDaemonRequestAttribute(
14662
+ "qwen-code.daemon.session_restore.partial_replay",
14663
+ replay.replayError !== void 0
14664
+ );
14556
14665
  if (!bulkReplay) {
14557
14666
  try {
14558
14667
  for (const update of replay.updates) {
@@ -14566,18 +14675,25 @@ var QwenAgent = class {
14566
14675
  }
14567
14676
  return response;
14568
14677
  }
14678
+ const envelope = {
14679
+ v: LOAD_REPLAY_VERSION,
14680
+ updates: replay.updates,
14681
+ ...replayPage.anchorRecordId ? { anchorRecordId: replayPage.anchorRecordId } : {},
14682
+ ...replay.replayError !== void 0 ? {
14683
+ partial: true,
14684
+ replayError: replay.replayError
14685
+ } : {},
14686
+ ...replayPage.hasMore ? { hasMore: true } : {}
14687
+ };
14688
+ validateLoadReplayEnvelope(
14689
+ sessionId,
14690
+ envelope,
14691
+ restoreOptions.replay.kind === "recent"
14692
+ );
14569
14693
  return {
14570
14694
  ...response,
14571
14695
  _meta: {
14572
- [LOAD_REPLAY_META_KEY]: {
14573
- v: LOAD_REPLAY_VERSION,
14574
- updates: replay.updates,
14575
- ...replay.replayError !== void 0 ? {
14576
- partial: true,
14577
- replayError: replay.replayError
14578
- } : {},
14579
- ...replayPage.hasMore ? { hasMore: true } : {}
14580
- }
14696
+ [LOAD_REPLAY_META_KEY]: envelope
14581
14697
  }
14582
14698
  };
14583
14699
  }
@@ -14619,13 +14735,32 @@ var QwenAgent = class {
14619
14735
  settings,
14620
14736
  sessionSource,
14621
14737
  sessionId,
14622
- true
14738
+ true,
14739
+ {},
14740
+ void 0,
14741
+ restoreOptions
14623
14742
  )
14624
14743
  );
14625
- const sessionData = config.getResumedSessionData();
14744
+ const projection = config.consumeSessionRestoreProjection?.();
14745
+ const suppressRecoveredGoalPresentation = projection?.runtime.goalRecoverySourceUuid !== void 0 && projection.runtime.goalRecoverySourceUuid !== projection.replay?.goalRecoverySourceUuid;
14626
14746
  const bulkReplay = isBulkLoadReplayRequest(params);
14627
- const replayPageSize = bulkReplay ? getLoadReplayPageSize(params) : void 0;
14628
14747
  let replayEnvelope;
14748
+ const replayUsage = createReplayCumulativeUsage();
14749
+ let recoveredGoalPublicationKey;
14750
+ let suppressedRecoveredGoalId;
14751
+ let streamGoalUpdates = [];
14752
+ let response;
14753
+ const buildResponse = /* @__PURE__ */ __name(() => profiler.timeSync("response_build", () => ({
14754
+ modes: this.buildModesData(config),
14755
+ models: this.buildAvailableModels(config),
14756
+ configOptions: this.buildConfigOptions(config),
14757
+ ...projection?.runtime.artifactSnapshot ? { artifactSnapshot: projection.runtime.artifactSnapshot } : {},
14758
+ ...replayEnvelope ? {
14759
+ _meta: {
14760
+ [LOAD_REPLAY_META_KEY]: replayEnvelope
14761
+ }
14762
+ } : {}
14763
+ })), "buildResponse");
14629
14764
  try {
14630
14765
  await profiler.time("auth", () => this.ensureAuthenticated(config));
14631
14766
  profiler.timeSync(
@@ -14634,98 +14769,165 @@ var QwenAgent = class {
14634
14769
  );
14635
14770
  await profiler.time(
14636
14771
  "session_register",
14637
- () => this.createAndStoreSession(config, settings, sessionData, {
14772
+ () => this.createAndStoreSession(config, settings, void 0, {
14638
14773
  enableLiveScreenContext: isCompatibleLiveSessionSource(
14639
14774
  sessionSource ?? {}
14640
14775
  ),
14641
- ...bulkReplay ? { replayHistory: false } : {},
14642
- beforeStartPostReplayServices: /* @__PURE__ */ __name(async (createdSession) => {
14643
- if (bulkReplay) {
14644
- const records = sessionData?.conversation.messages;
14645
- let replayUpdates = [];
14646
- if (records) {
14647
- createdSession.primeTurnFromHistory(records);
14648
- const visibleRecords = selectVisibleHistoryRecords(
14649
- records,
14650
- shouldHideInheritedHistory(params)
14651
- );
14652
- const replayPage = selectRecentHistoryRecords(
14653
- visibleRecords,
14654
- replayPageSize
14655
- );
14656
- const replayUsage = createReplayCumulativeUsage();
14657
- const replay = await collectHistoryReplayUpdates({
14776
+ replayHistory: false,
14777
+ prepareBeforeSessionCreate: /* @__PURE__ */ __name(async () => {
14778
+ if (bulkReplay && projection?.replay) {
14779
+ const replay = await profiler.time(
14780
+ "history_replay",
14781
+ () => collectHistoryReplayUpdates({
14658
14782
  sessionId,
14659
14783
  config,
14660
- records: replayPage.records,
14661
- gaps: sessionData?.historyGaps,
14784
+ records: projection.replay.records,
14785
+ gaps: projection.replay.gaps,
14662
14786
  cumulativeUsage: replayUsage,
14787
+ replayState: projection.replay.replay,
14788
+ goalBootstrap: replayGoalBootstrap(projection),
14789
+ ...restoreOptions.replay.kind === "recent" ? {
14790
+ limits: {
14791
+ maxBytes: LOAD_REPLAY_MAX_BYTES,
14792
+ maxUpdates: LOAD_REPLAY_MAX_UPDATES
14793
+ }
14794
+ } : {},
14663
14795
  logger: debugLogger8
14664
- });
14665
- replayUpdates = replay.updates;
14666
- copyCumulativeUsage(
14667
- createdSession.cumulativeUsage,
14668
- replayUsage
14669
- );
14670
- try {
14671
- replayUpdates = replayUpdates.concat(
14672
- await createdSession.renderRecoveredGoalUpdates(records)
14796
+ })
14797
+ );
14798
+ addDaemonRequestAttribute(
14799
+ "qwen-code.daemon.session_restore.partial_replay",
14800
+ replay.replayError !== void 0
14801
+ );
14802
+ replayEnvelope = {
14803
+ v: LOAD_REPLAY_VERSION,
14804
+ updates: replay.updates,
14805
+ ...projection.replay.anchorRecordId ? { anchorRecordId: projection.replay.anchorRecordId } : {},
14806
+ ...replay.replayError !== void 0 ? {
14807
+ partial: true,
14808
+ replayError: replay.replayError
14809
+ } : {},
14810
+ ...projection.replay.hasMore ? { hasMore: true } : {}
14811
+ };
14812
+ validateLoadReplayEnvelope(
14813
+ sessionId,
14814
+ replayEnvelope,
14815
+ restoreOptions.replay.kind === "recent"
14816
+ );
14817
+ }
14818
+ const goalBootstrap = replayGoalBootstrap(projection);
14819
+ const rendered = await renderPreparedGoalUpdate(
14820
+ () => config.getGoalRuntimePrepared(),
14821
+ {
14822
+ ...projection?.replay?.records ? { replayedRecords: projection.replay.records } : {},
14823
+ ...suppressRecoveredGoalPresentation ? { hideRuntimeGoal: true } : {},
14824
+ ...goalBootstrap ? { bootstrap: goalBootstrap } : {}
14825
+ }
14826
+ ).catch((error) => {
14827
+ if (suppressRecoveredGoalPresentation) throw error;
14828
+ debugLogger8.debug(
14829
+ `Failed to render recovered Goal state: ${error instanceof Error ? error.message : String(error)}`
14830
+ );
14831
+ return {
14832
+ publicationKey: void 0,
14833
+ suppressedGoalId: void 0,
14834
+ updates: []
14835
+ };
14836
+ });
14837
+ recoveredGoalPublicationKey = rendered.publicationKey;
14838
+ suppressedRecoveredGoalId = rendered.suppressedGoalId;
14839
+ if (!bulkReplay) {
14840
+ streamGoalUpdates = rendered.updates;
14841
+ return;
14842
+ }
14843
+ const goalUpdates = rendered.updates;
14844
+ if (goalUpdates.length > 0) {
14845
+ replayEnvelope ??= {
14846
+ v: LOAD_REPLAY_VERSION,
14847
+ updates: []
14848
+ };
14849
+ replayEnvelope.updates.push(...goalUpdates);
14850
+ validateLoadReplayEnvelope(
14851
+ sessionId,
14852
+ replayEnvelope,
14853
+ restoreOptions.replay.kind === "recent"
14854
+ );
14855
+ }
14856
+ }, "prepareBeforeSessionCreate"),
14857
+ beforeSessionCreate: /* @__PURE__ */ __name(() => {
14858
+ response = buildResponse();
14859
+ }, "beforeSessionCreate"),
14860
+ primeSession: /* @__PURE__ */ __name((createdSession) => {
14861
+ profiler.timeSync("runtime_initialize", () => {
14862
+ if (!projection) return;
14863
+ createdSession.primeTurnState(
14864
+ projection.runtime.initialTurn,
14865
+ projection.runtime.backgroundNotificationTaskIds
14866
+ );
14867
+ copyCumulativeUsage(
14868
+ createdSession.cumulativeUsage,
14869
+ replayUsage
14870
+ );
14871
+ createdSession.primeRecoveredGoalPublication(
14872
+ recoveredGoalPublicationKey,
14873
+ suppressedRecoveredGoalId
14874
+ );
14875
+ });
14876
+ }, "primeSession"),
14877
+ beforeStartPostReplayServices: /* @__PURE__ */ __name(async (createdSession) => {
14878
+ if (!bulkReplay && projection?.replay) {
14879
+ await profiler.time("history_replay", async () => {
14880
+ const goalBootstrap = replayGoalBootstrap(projection);
14881
+ const initialGoalState = replayInitialGoalState(projection);
14882
+ const hasGoalReplayState = goalBootstrap !== void 0 || initialGoalState.initialGoalState !== void 0 || initialGoalState.initialGoalCause !== void 0;
14883
+ if (hasGoalReplayState) {
14884
+ await createdSession.replayHistory(
14885
+ projection.replay.records,
14886
+ projection.replay.gaps,
14887
+ {
14888
+ ...goalBootstrap ? { goalBootstrap } : {},
14889
+ ...initialGoalState
14890
+ }
14673
14891
  );
14674
- } catch (error) {
14675
- debugLogger8.debug(
14676
- `Failed to render recovered Goal state: ${error instanceof Error ? error.message : String(error)}`
14892
+ } else {
14893
+ await createdSession.replayHistory(
14894
+ projection.replay.records,
14895
+ projection.replay.gaps
14677
14896
  );
14678
14897
  }
14679
- if (replay.replayError !== void 0) {
14680
- replayEnvelope = {
14681
- v: LOAD_REPLAY_VERSION,
14682
- updates: replayUpdates,
14683
- partial: true,
14684
- replayError: replay.replayError,
14685
- ...replayPage.hasMore ? { hasMore: true } : {}
14686
- };
14898
+ });
14899
+ try {
14900
+ for (const update of streamGoalUpdates) {
14901
+ await createdSession.sendUpdate(update);
14687
14902
  }
14688
- replayEnvelope ??= {
14689
- v: LOAD_REPLAY_VERSION,
14690
- updates: replayUpdates,
14691
- ...replayPage.hasMore ? { hasMore: true } : {}
14692
- };
14903
+ } catch (error) {
14904
+ debugLogger8.debug(
14905
+ `Failed to publish recovered Goal state: ${error instanceof Error ? error.message : String(error)}`
14906
+ );
14693
14907
  }
14694
- replayEnvelope ??= {
14695
- v: LOAD_REPLAY_VERSION,
14696
- updates: replayUpdates
14697
- };
14698
14908
  }
14699
- await this.#restoreWorktreeOnResume(config, createdSession);
14700
- await this.#restoreBackgroundAgentsOnResume(
14701
- config,
14702
- createdSession
14703
- );
14909
+ await profiler.time("post_replay_services", async () => {
14910
+ await this.#restoreWorktreeOnResume(config, createdSession);
14911
+ await this.#restoreBackgroundAgentsOnResume(
14912
+ config,
14913
+ createdSession
14914
+ );
14915
+ });
14704
14916
  }, "beforeStartPostReplayServices")
14705
14917
  })
14706
14918
  );
14707
14919
  } catch (error) {
14708
- return this.cleanupAfterRequestFailure(error, async () => {
14709
- if (this.sessions.get(config.getSessionId())?.getConfig() !== config) {
14710
- await this.cleanupUnstoredConfig(config);
14711
- }
14712
- });
14920
+ return this.cleanupAfterRequestFailure(
14921
+ error,
14922
+ async () => {
14923
+ if (this.sessions.get(config.getSessionId())?.getConfig() !== config) {
14924
+ await this.cleanupUnstoredConfig(config);
14925
+ }
14926
+ },
14927
+ sessionId
14928
+ );
14713
14929
  }
14714
- return profiler.timeSync("response_build", () => {
14715
- const response = {
14716
- modes: this.buildModesData(config),
14717
- models: this.buildAvailableModels(config),
14718
- configOptions: this.buildConfigOptions(config),
14719
- ...sessionData?.artifactSnapshot ? { artifactSnapshot: sessionData.artifactSnapshot } : {}
14720
- };
14721
- if (!replayEnvelope) return response;
14722
- return {
14723
- ...response,
14724
- _meta: {
14725
- [LOAD_REPLAY_META_KEY]: replayEnvelope
14726
- }
14727
- };
14728
- });
14930
+ return response;
14729
14931
  } finally {
14730
14932
  releaseStartingSessionId();
14731
14933
  }
@@ -14763,13 +14965,14 @@ var QwenAgent = class {
14763
14965
  return this.withLiveSessionRestore(
14764
14966
  sessionId,
14765
14967
  liveSession,
14766
- async (config, sessionData) => profiler.timeSync(
14968
+ RESUME_RESTORE_OPTIONS,
14969
+ async (config, projection) => profiler.timeSync(
14767
14970
  "response_build",
14768
14971
  () => ({
14769
14972
  modes: this.buildModesData(config),
14770
14973
  models: this.buildAvailableModels(config),
14771
14974
  configOptions: this.buildConfigOptions(config),
14772
- ...sessionData.artifactSnapshot ? { artifactSnapshot: sessionData.artifactSnapshot } : {}
14975
+ ...projection?.artifactSnapshot ? { artifactSnapshot: projection.artifactSnapshot } : {}
14773
14976
  })
14774
14977
  )
14775
14978
  );
@@ -14806,9 +15009,14 @@ var QwenAgent = class {
14806
15009
  settings,
14807
15010
  sessionSource,
14808
15011
  sessionId,
14809
- true
15012
+ true,
15013
+ {},
15014
+ void 0,
15015
+ RESUME_RESTORE_OPTIONS
14810
15016
  )
14811
15017
  );
15018
+ const projection = config.consumeSessionRestoreProjection?.();
15019
+ let response;
14812
15020
  try {
14813
15021
  await profiler.time("auth", () => this.ensureAuthenticated(config));
14814
15022
  profiler.timeSync(
@@ -14817,51 +15025,51 @@ var QwenAgent = class {
14817
15025
  );
14818
15026
  await profiler.time(
14819
15027
  "session_register",
14820
- () => this.createAndStoreSession(
14821
- config,
14822
- settings,
14823
- config.getResumedSessionData(),
14824
- {
14825
- enableLiveScreenContext: isCompatibleLiveSessionSource(
14826
- sessionSource ?? {}
14827
- ),
14828
- replayHistory: false,
14829
- beforeStartPostReplayServices: /* @__PURE__ */ __name(async (createdSession) => {
14830
- try {
14831
- await createdSession.publishRecoveredGoalState(
14832
- config.getResumedSessionData()?.conversation.messages
14833
- );
14834
- } catch (error) {
14835
- debugLogger8.debug(
14836
- `Failed to publish recovered Goal state: ${error instanceof Error ? error.message : String(error)}`
14837
- );
14838
- }
15028
+ () => this.createAndStoreSession(config, settings, void 0, {
15029
+ enableLiveScreenContext: isCompatibleLiveSessionSource(
15030
+ sessionSource ?? {}
15031
+ ),
15032
+ replayHistory: false,
15033
+ beforeSessionCreate: /* @__PURE__ */ __name(() => {
15034
+ response = profiler.timeSync("response_build", () => ({
15035
+ modes: this.buildModesData(config),
15036
+ models: this.buildAvailableModels(config),
15037
+ configOptions: this.buildConfigOptions(config),
15038
+ ...projection?.runtime.artifactSnapshot ? { artifactSnapshot: projection.runtime.artifactSnapshot } : {}
15039
+ }));
15040
+ }, "beforeSessionCreate"),
15041
+ primeSession: /* @__PURE__ */ __name((createdSession) => {
15042
+ profiler.timeSync("runtime_initialize", () => {
15043
+ if (!projection) return;
15044
+ createdSession.primeTurnState(
15045
+ projection.runtime.initialTurn,
15046
+ projection.runtime.backgroundNotificationTaskIds
15047
+ );
15048
+ });
15049
+ }, "primeSession"),
15050
+ beforeStartPostReplayServices: /* @__PURE__ */ __name(async (createdSession) => {
15051
+ await profiler.time("post_replay_services", async () => {
14839
15052
  await this.#restoreWorktreeOnResume(config, createdSession);
14840
15053
  await this.#restoreBackgroundAgentsOnResume(
14841
15054
  config,
14842
15055
  createdSession
14843
15056
  );
14844
- }, "beforeStartPostReplayServices")
14845
- }
14846
- )
15057
+ });
15058
+ }, "beforeStartPostReplayServices")
15059
+ })
14847
15060
  );
14848
15061
  } catch (error) {
14849
- return this.cleanupAfterRequestFailure(error, async () => {
14850
- if (this.sessions.get(config.getSessionId())?.getConfig() !== config) {
14851
- await this.cleanupUnstoredConfig(config);
14852
- }
14853
- });
15062
+ return this.cleanupAfterRequestFailure(
15063
+ error,
15064
+ async () => {
15065
+ if (this.sessions.get(config.getSessionId())?.getConfig() !== config) {
15066
+ await this.cleanupUnstoredConfig(config);
15067
+ }
15068
+ },
15069
+ sessionId
15070
+ );
14854
15071
  }
14855
- const sessionData = config.getResumedSessionData();
14856
- return profiler.timeSync(
14857
- "response_build",
14858
- () => ({
14859
- modes: this.buildModesData(config),
14860
- models: this.buildAvailableModels(config),
14861
- configOptions: this.buildConfigOptions(config),
14862
- ...sessionData?.artifactSnapshot ? { artifactSnapshot: sessionData.artifactSnapshot } : {}
14863
- })
14864
- );
15072
+ return response;
14865
15073
  } finally {
14866
15074
  releaseStartingSessionId();
14867
15075
  }
@@ -20193,7 +20401,7 @@ ${outputText}
20193
20401
  throw error;
20194
20402
  }
20195
20403
  }
20196
- async newSessionConfig(cwd, mcpServers, settings, sessionSource, sessionId, resume, initializeOptions = {}, chatRecording) {
20404
+ async newSessionConfig(cwd, mcpServers, settings, sessionSource, sessionId, resume, initializeOptions = {}, chatRecording, restoreOptions) {
20197
20405
  try {
20198
20406
  this.assertManagedSessionAdmission();
20199
20407
  return await this.runWithPinnedRuntimeBaseDir(settings, cwd, async () => {
@@ -20209,7 +20417,8 @@ ${outputText}
20209
20417
  sessionId,
20210
20418
  resume,
20211
20419
  initializeOptions,
20212
- chatRecording
20420
+ chatRecording,
20421
+ restoreOptions
20213
20422
  );
20214
20423
  });
20215
20424
  } catch (error) {
@@ -20225,10 +20434,10 @@ ${outputText}
20225
20434
  errorKind: writerError.errorKind
20226
20435
  });
20227
20436
  }
20228
- throw error;
20437
+ throw sessionId && restoreOptions ? mapSessionRestoreRequestError(error, sessionId) : error;
20229
20438
  }
20230
20439
  }
20231
- async newSessionConfigInRuntimeContext(cwd, mcpServers, settings, sessionSource, sessionId, resume, initializeOptions = {}, chatRecording) {
20440
+ async newSessionConfigInRuntimeContext(cwd, mcpServers, settings, sessionSource, sessionId, resume, initializeOptions = {}, chatRecording, restoreOptions) {
20232
20441
  const sessionMcpServers = {};
20233
20442
  for (const server of mcpServers) {
20234
20443
  const stdioServer = toStdioServer(server);
@@ -20326,7 +20535,19 @@ ${outputText}
20326
20535
  // not process.exit(1) the shared ACP child and every session on its
20327
20536
  // channel. newSessionConfig maps the throw to a RequestError.
20328
20537
  true,
20329
- this.managedToolInvocationGuard ? { toolInvocationGuard: this.managedToolInvocationGuard } : void 0
20538
+ this.managedToolInvocationGuard || restoreOptions ? {
20539
+ ...this.managedToolInvocationGuard ? { toolInvocationGuard: this.managedToolInvocationGuard } : {},
20540
+ ...restoreOptions && sessionId ? {
20541
+ sessionRestore: {
20542
+ projectionSource: /* @__PURE__ */ __name((restoreSessionId) => new SessionService(cwd, {
20543
+ runtimeBaseDir: Storage.getRuntimeBaseDir()
20544
+ }).readRestoreProjection(
20545
+ restoreSessionId,
20546
+ restoreOptions
20547
+ ), "projectionSource")
20548
+ }
20549
+ } : {}
20550
+ } : void 0
20330
20551
  );
20331
20552
  if (sessionSource) {
20332
20553
  config.setSessionSource(sessionSource.sourceType, sessionSource.sourceId);
@@ -20463,6 +20684,16 @@ ${outputText}
20463
20684
  { errorKind: "session_id_conflict", sessionId }
20464
20685
  );
20465
20686
  }
20687
+ await options.prepareBeforeSessionCreate?.();
20688
+ this.assertManagedSessionAdmission();
20689
+ if (this.sessions.has(sessionId)) {
20690
+ throw new RequestError(
20691
+ ACP_ERROR_CODES.INVALID_PARAMS,
20692
+ `Session ${sessionId} is already active.`,
20693
+ { errorKind: "session_id_conflict", sessionId }
20694
+ );
20695
+ }
20696
+ options.beforeSessionCreate?.();
20466
20697
  const session = new Session(
20467
20698
  sessionId,
20468
20699
  config,
@@ -20470,10 +20701,14 @@ ${outputText}
20470
20701
  settings,
20471
20702
  () => this.activeWorkReporter?.notifyChanged()
20472
20703
  );
20473
- this.sessions.set(sessionId, session);
20474
- this.activeWorkReporter?.notifyChanged();
20475
- this.initializingConfigs.delete(config);
20704
+ let published = false;
20476
20705
  try {
20706
+ options.primeSession?.(session);
20707
+ config.hydrateSessionRestoreFileHistory?.();
20708
+ this.sessions.set(sessionId, session);
20709
+ published = true;
20710
+ this.activeWorkReporter?.notifyChanged();
20711
+ this.initializingConfigs.delete(config);
20477
20712
  if (options.enableLiveScreenContext) {
20478
20713
  await session.enableLiveScreenContext();
20479
20714
  }
@@ -20500,12 +20735,23 @@ ${outputText}
20500
20735
  }
20501
20736
  await options.beforeStartPostReplayServices?.(session);
20502
20737
  session.installRewriter();
20738
+ config.finalizeSessionRestore?.();
20503
20739
  session.startCronScheduler();
20504
20740
  setTimeout(() => {
20505
20741
  void session.sendAvailableCommandsUpdate();
20506
20742
  }, 0);
20507
20743
  return session;
20508
20744
  } catch (error) {
20745
+ if (!published) {
20746
+ try {
20747
+ session.dispose();
20748
+ } catch (disposeError) {
20749
+ debugLogger8.warn(
20750
+ `Failed to dispose unpublished session ${sessionId}: ${disposeError instanceof Error ? disposeError.message : String(disposeError)}`
20751
+ );
20752
+ }
20753
+ throw error;
20754
+ }
20509
20755
  try {
20510
20756
  await this.discardStoredSessionIfCurrent(sessionId, session, {
20511
20757
  shutdownConfig: false