@qwen-code/qwen-code 0.21.12-preview.3 → 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 (323) 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-EIK4BHBQ.js → MaxSizedBox-GFI5RYXH.js} +41 -41
  6. package/chunks/{StandaloneSessionPicker-NHVJDRYD.js → StandaloneSessionPicker-JFWRY4V2.js} +60 -60
  7. package/chunks/{acp-startup-profiler-JMJBZDVO.js → acp-startup-profiler-TVI2OVUN.js} +2 -2
  8. package/chunks/{acpAgent-37UDZP64.js → acpAgent-7YC6SNIS.js} +672 -428
  9. package/chunks/{agent-FAWBG7PP.js → agent-43KVQSB5.js} +38 -38
  10. package/chunks/{agent-headless-SHK4PCCH.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-DEAYNDCI.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-UIGYER6R.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-TYGKUOEG.js → chunk-2U3UCXZ3.js} +2 -1
  25. package/chunks/{chunk-QZ5G26ZE.js → chunk-32SNBMNP.js} +12 -12
  26. package/chunks/{chunk-NPE3STIW.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-L7T742G2.js → chunk-4X5J3V2I.js} +47 -3
  30. package/chunks/{chunk-IQFYO5BF.js → chunk-5KZNWF2M.js} +1 -1
  31. package/chunks/{chunk-EXG2R5UR.js → chunk-62TIEFNN.js} +8 -8
  32. package/chunks/{chunk-T6W4KACQ.js → chunk-67F2BEYW.js} +1 -1
  33. package/chunks/{chunk-NELCY6JT.js → chunk-6LDLDK6E.js} +1 -1
  34. package/chunks/{chunk-5I5NMQCU.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-TEKFBSMY.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-O5G7IQGM.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-VWD7SNNN.js → chunk-APQTLUZ3.js} +2120 -2085
  46. package/chunks/{chunk-AJX4ITUG.js → chunk-ARL4UGRW.js} +3 -3
  47. package/chunks/{chunk-ZQSNP4TG.js → chunk-B2BKFWJK.js} +2 -2
  48. package/chunks/{chunk-SAQHDAUJ.js → chunk-B66LYK4B.js} +452 -57
  49. package/chunks/{chunk-6ZIIHBNV.js → chunk-B7IBCWDW.js} +3 -3
  50. package/chunks/{chunk-5UPJ774B.js → chunk-BGIKUE5J.js} +1 -1
  51. package/chunks/{chunk-2J53A6MV.js → chunk-BNRIQWXW.js} +3 -3
  52. package/chunks/{chunk-CZXQ4UZA.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-CG3OQDNY.js → chunk-CJNKGZLC.js} +6 -6
  56. package/chunks/{chunk-UZPWH6SP.js → chunk-CTEGMF77.js} +285 -125
  57. package/chunks/{chunk-3TT6MZHJ.js → chunk-DUFZ3OW6.js} +35 -35
  58. package/chunks/{chunk-ZWPWQEF5.js → chunk-E74YSVIN.js} +1 -1
  59. package/chunks/{chunk-RQVVXDHS.js → chunk-ECDXUCEO.js} +4 -4
  60. package/chunks/{chunk-47FQVRCO.js → chunk-EGB2PIYM.js} +1 -1
  61. package/chunks/{chunk-JL3LC3CQ.js → chunk-FB5CQZMK.js} +1 -1
  62. package/chunks/{chunk-U6PTKAOW.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-RRQJPCRQ.js → chunk-FXWGMPAP.js} +2 -2
  66. package/chunks/{chunk-P64FPV3G.js → chunk-GDNDZJSG.js} +2 -2
  67. package/chunks/{chunk-M6HXP2SG.js → chunk-GHOUZ5X4.js} +1892 -622
  68. package/chunks/{chunk-M6SXIXBV.js → chunk-H2U4FK62.js} +6 -6
  69. package/chunks/{chunk-EFIMD5VA.js → chunk-H6BFLALJ.js} +1 -1
  70. package/chunks/{chunk-TYCXSMZU.js → chunk-HOJZ2QQA.js} +3 -3
  71. package/chunks/{chunk-Y66OOMKS.js → chunk-HWCHDINS.js} +21 -21
  72. package/chunks/{chunk-4GLFFNP3.js → chunk-HY5OHJEC.js} +5 -5
  73. package/chunks/{chunk-P2UCMHDT.js → chunk-IJCZP2MA.js} +2 -2
  74. package/chunks/{chunk-I4XSOFH2.js → chunk-JBZYGFIB.js} +1 -1
  75. package/chunks/{chunk-HBZUU4AE.js → chunk-JGD35ZSJ.js} +4 -4
  76. package/chunks/{chunk-DAX3G67A.js → chunk-JOVJCXN4.js} +1 -1
  77. package/chunks/{chunk-YI6UGZF5.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-GYBDYWMV.js → chunk-JXS2JNMZ.js} +2 -2
  82. package/chunks/{chunk-L2GTEEEU.js → chunk-K5IDV3PC.js} +44 -1
  83. package/chunks/{chunk-N3FJOQX7.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-7D4KEFOT.js → chunk-L3YACXS2.js} +3 -3
  87. package/chunks/{chunk-575MI5K3.js → chunk-LIBTBTHP.js} +4 -4
  88. package/chunks/{chunk-JS4Q5NG5.js → chunk-LSMCI42W.js} +3 -3
  89. package/chunks/{chunk-YZJVVQD3.js → chunk-MTV5W6WN.js} +7 -7
  90. package/chunks/{chunk-UOMZKPI5.js → chunk-MUN34TTF.js} +7 -7
  91. package/chunks/{chunk-LHY6HBRA.js → chunk-N3J3CO35.js} +4 -4
  92. package/chunks/{chunk-TRYJ3BVE.js → chunk-N56NYJWY.js} +7 -7
  93. package/chunks/{chunk-3ZYX7AUR.js → chunk-NAOHSM56.js} +1 -1
  94. package/chunks/{chunk-URK542T4.js → chunk-NF5J2WFA.js} +15 -2
  95. package/chunks/{chunk-OPBATTFQ.js → chunk-NHZF4VCD.js} +1 -1
  96. package/chunks/{chunk-QTI7SRXI.js → chunk-NM33GGOM.js} +3 -3
  97. package/chunks/{chunk-F6AOBFUN.js → chunk-NW7SPXVG.js} +1 -1
  98. package/chunks/{chunk-J7DNMZFO.js → chunk-NX5QZVRS.js} +1 -1
  99. package/chunks/{chunk-WFRHWDBT.js → chunk-O4MVJKSX.js} +5 -5
  100. package/chunks/{chunk-NC4O6UE6.js → chunk-O6SLWH4X.js} +2 -2
  101. package/chunks/{chunk-V4MJ56RS.js → chunk-OIZWCOYC.js} +5 -5
  102. package/chunks/{chunk-JXK3WAP7.js → chunk-ORR5EFCL.js} +4 -4
  103. package/chunks/{chunk-EYY4IBPV.js → chunk-OSA2TFDI.js} +2 -2
  104. package/chunks/{chunk-KPVVWKF3.js → chunk-PSTHNTHF.js} +1 -1
  105. package/chunks/{chunk-4M2F7OG7.js → chunk-PYLVQ6RT.js} +6 -6
  106. package/chunks/{chunk-6AECVSVX.js → chunk-Q7ALOKK7.js} +3 -3
  107. package/chunks/{chunk-EYW54TBD.js → chunk-QEWAHAW2.js} +3 -3
  108. package/chunks/{chunk-N5ULBHP3.js → chunk-QSDPJROT.js} +2 -2
  109. package/chunks/{chunk-DYVCDQW2.js → chunk-QSMZHJ62.js} +1 -1
  110. package/chunks/{chunk-MDFUBQAQ.js → chunk-QWAI7FNT.js} +17 -17
  111. package/chunks/{chunk-M4OYAR6J.js → chunk-QXFAQDBV.js} +2 -2
  112. package/chunks/{chunk-ILVATFYJ.js → chunk-SFBRH5RY.js} +19 -15
  113. package/chunks/{chunk-EYS3GGM3.js → chunk-SKRHR6N2.js} +1 -1
  114. package/chunks/{chunk-6LYDH7VT.js → chunk-SNHBRO4C.js} +2 -2
  115. package/chunks/{chunk-5TXOGH4I.js → chunk-T4G33L3W.js} +3 -3
  116. package/chunks/{chunk-32VOOMEF.js → chunk-TB6DPBE4.js} +4 -4
  117. package/chunks/{chunk-DEG7R6Z6.js → chunk-TN3REXN4.js} +8 -8
  118. package/chunks/{chunk-MWZYNOCG.js → chunk-TNETSI2A.js} +3 -3
  119. package/chunks/{chunk-ZV4XVYL3.js → chunk-TROB4PZY.js} +4 -4
  120. package/chunks/{chunk-O5AZPHYZ.js → chunk-U5C2GIN2.js} +24 -16
  121. package/chunks/{chunk-3GCU5O2E.js → chunk-U7ROFHSH.js} +1 -1
  122. package/chunks/{chunk-HB6QW4LM.js → chunk-UAAWNTOC.js} +15 -12
  123. package/chunks/{chunk-HHGQGTJQ.js → chunk-UFHPAMAV.js} +4 -0
  124. package/chunks/{chunk-V3LXMASR.js → chunk-UHF5VBKO.js} +1 -1
  125. package/chunks/{chunk-FRH4SSGX.js → chunk-UPUAGRKY.js} +2 -2
  126. package/chunks/{chunk-6S52N6PG.js → chunk-UQPLUR4A.js} +2 -2
  127. package/chunks/{chunk-KIFRFCCB.js → chunk-UWIJU22K.js} +66 -19
  128. package/chunks/{chunk-HGCQ5SE7.js → chunk-UXEO7E3V.js} +21 -0
  129. package/chunks/{chunk-M2PY7CNK.js → chunk-V2U6FOJB.js} +2 -2
  130. package/chunks/{chunk-7SUQZ7QH.js → chunk-V3NMFQD2.js} +2 -2
  131. package/chunks/{chunk-6XZERB6P.js → chunk-VPZMLGD3.js} +3 -3
  132. package/chunks/{chunk-UNCIELQJ.js → chunk-VRQD5D7R.js} +1 -1
  133. package/chunks/{chunk-YTYPRVIZ.js → chunk-VUTOV2HG.js} +2 -2
  134. package/chunks/{chunk-7LZ7DK4D.js → chunk-VYDQD5J4.js} +1 -1
  135. package/chunks/{chunk-XCGIMOLN.js → chunk-WCCLLK7X.js} +14 -1
  136. package/chunks/{chunk-JEMR2FTD.js → chunk-WIHSDI6U.js} +4 -4
  137. package/chunks/{chunk-VJNBRRZG.js → chunk-WZMH7II3.js} +1 -1
  138. package/chunks/{chunk-XWUQ4IH5.js → chunk-XJ6IMYUS.js} +7 -7
  139. package/chunks/{chunk-3XZYK76R.js → chunk-XL6GYJL2.js} +1 -1
  140. package/chunks/{chunk-KNXA5XXK.js → chunk-XUBM2A4F.js} +7 -7
  141. package/chunks/{chunk-ENEEQMGM.js → chunk-XY7DGTIC.js} +1 -1
  142. package/chunks/{chunk-SSAOTDK7.js → chunk-Y2EOB7WZ.js} +1 -1
  143. package/chunks/{chunk-VQZXRLEX.js → chunk-Y2HK3ELT.js} +3 -3
  144. package/chunks/{chunk-FDWH6CBK.js → chunk-Y5C24BUY.js} +5 -5
  145. package/chunks/{chunk-5HBFERG5.js → chunk-YI5G32RU.js} +3 -3
  146. package/chunks/{chunk-MPBRV3UU.js → chunk-YMB77M76.js} +15 -0
  147. package/chunks/{chunk-KNQZXSLW.js → chunk-YY23TR4M.js} +23 -9
  148. package/chunks/{chunk-4ETA3KRC.js → chunk-ZA2JN5IZ.js} +3 -3
  149. package/chunks/{chunk-IX7CFQGA.js → chunk-ZPZANKVP.js} +3 -3
  150. package/chunks/{chunk-XTH2OMDS.js → chunk-ZRT36RSF.js} +1 -1
  151. package/chunks/{chunk-M2NMFAFR.js → chunk-ZZ7RUTJ4.js} +1 -1
  152. package/chunks/{computer-use-S4JEU5P7.js → computer-use-J5VUY257.js} +38 -38
  153. package/chunks/{config-utils-TXVKR27S.js → config-utils-7JZQN6L2.js} +4 -4
  154. package/chunks/{contextCommand-2H5OH2HW.js → contextCommand-RCTGC36R.js} +40 -40
  155. package/chunks/{core-runtime-IAQ4DD4Y.js → core-runtime-REBZ5ZYE.js} +38 -38
  156. package/chunks/{create-sub-session-Y4WYDZGC.js → create-sub-session-23ULO5PO.js} +2 -2
  157. package/chunks/{create-sub-session-EKHKXJAA.js → create-sub-session-TEEUROAZ.js} +38 -38
  158. package/chunks/{cron-create-ZOVA3CC2.js → cron-create-5WUTNKNF.js} +4 -4
  159. package/chunks/{cron-delete-7Z3H4LJY.js → cron-delete-JEQ27YPS.js} +4 -4
  160. package/chunks/{cron-list-UHGX3IQG.js → cron-list-IXGCA7UR.js} +4 -4
  161. package/chunks/{daemon-PXIC4ZDK.js → daemon-UBVOQMWY.js} +2 -1
  162. package/chunks/{daemon-status-provider-LPYR2GXY.js → daemon-status-provider-SV7KRLJ4.js} +49 -49
  163. package/chunks/{daemon-trust-policy-7JOBVFH3.js → daemon-trust-policy-LFUJ4NGF.js} +44 -44
  164. package/chunks/{daemon-trust-policy-monitor-OU3NRHAR.js → daemon-trust-policy-monitor-BQZ77NDD.js} +44 -44
  165. package/chunks/{deferred-core-runtime-SFT3KI2C.js → deferred-core-runtime-F4XOQJQL.js} +38 -38
  166. package/chunks/{dispatch-B53LNEO4.js → dispatch-FW7DX2CR.js} +7 -1
  167. package/chunks/{display-image-ZE3GZNIK.js → display-image-CAD7RAUM.js} +4 -4
  168. package/chunks/{dist-BNWP6IZL.js → dist-362MN6CP.js} +2 -2
  169. package/chunks/{dist-EFJILGIS.js → dist-5VDE7U3A.js} +1 -1
  170. package/chunks/{dist-AVUYBK7L.js → dist-6RK4U6VU.js} +1 -1
  171. package/chunks/{dist-KTYDJNYM.js → dist-B3ODKYEB.js} +1 -1
  172. package/chunks/{dist-NPS52B2V.js → dist-CCUH2Z4C.js} +1 -1
  173. package/chunks/{dist-BW2LDPV3.js → dist-DANKRAB3.js} +1 -1
  174. package/chunks/{dist-PKSRQAR2.js → dist-EZHCZSW6.js} +1 -1
  175. package/chunks/{dist-ZWDH5HLS.js → dist-M3XMEIP2.js} +1 -1
  176. package/chunks/{earlyInputCapture-27RPWE2D.js → earlyInputCapture-JAJXDT2N.js} +39 -39
  177. package/chunks/{edit-WXVZ7FHS.js → edit-OXBMFY5B.js} +38 -38
  178. package/chunks/{enter-worktree-TYMVXFLA.js → enter-worktree-XS4JX4PO.js} +38 -38
  179. package/chunks/{enterPlanMode-FT4MRU5N.js → enterPlanMode-J6PDPFFT.js} +38 -38
  180. package/chunks/{environment-Z6OMA34I.js → environment-BQW6FAZL.js} +40 -40
  181. package/chunks/{errors-YMXK2GG3.js → errors-TMSN7AZN.js} +40 -40
  182. package/chunks/{exit-worktree-ODZUQLGJ.js → exit-worktree-2RIE6DAO.js} +38 -38
  183. package/chunks/{exitPlanMode-MBPAPBBV.js → exitPlanMode-QQL27HU4.js} +38 -38
  184. package/chunks/{fast-path-ZU5T6XSN.js → fast-path-TSGUVE5K.js} +4 -4
  185. package/chunks/{gemini-OZK6AIMC.js → gemini-RLTFENFV.js} +86 -86
  186. package/chunks/{geminiContentGenerator-MC6ZKWZG.js → geminiContentGenerator-B6W6PSO7.js} +6 -6
  187. package/chunks/{glob-KJ4A4ZOM.js → glob-JKVAHWL5.js} +38 -38
  188. package/chunks/{goal-tools-JDK2SNMV.js → goal-tools-LQFO4BRY.js} +4 -4
  189. package/chunks/{grep-QWBLG564.js → grep-6CN23ZPS.js} +38 -38
  190. package/chunks/{handleAutoUpdate-M3ACKDKF.js → handleAutoUpdate-Y6BUNMBG.js} +42 -42
  191. package/chunks/{i18n-FPW7XZL5.js → i18n-Y5PM6L5V.js} +39 -39
  192. package/chunks/{image-gen-OTFC2S7L.js → image-gen-DC2IQZ73.js} +10 -10
  193. package/chunks/{initializer-5HKUXXBT.js → initializer-OYKKBNHO.js} +45 -45
  194. package/chunks/{installationInfo-4OA6UW7V.js → installationInfo-63AFHLWA.js} +39 -39
  195. package/chunks/{keychain-token-storage-JTWUYFU7.js → keychain-token-storage-GU75J2T2.js} +2 -2
  196. package/chunks/{list-3TKZ264A.js → list-KA63R3R6.js} +47 -47
  197. package/chunks/{list-agents-4GQ2XNEU.js → list-agents-5PNMK2AM.js} +2 -2
  198. package/chunks/{loadedSettingsAdapter-IRUANLS2.js → loadedSettingsAdapter-IGBJN7C5.js} +44 -44
  199. package/chunks/{loggingContentGenerator-D4URLH2A.js → loggingContentGenerator-Z3NADCTQ.js} +115 -93
  200. package/chunks/{loop-wakeup-HOQI3K5D.js → loop-wakeup-OV65FEGR.js} +5 -5
  201. package/chunks/{ls-FSHISLLA.js → ls-RPRSX26R.js} +4 -4
  202. package/chunks/{lsp-APQJ5ZEZ.js → lsp-IWTJWFLT.js} +2 -2
  203. package/chunks/{managed-npm-update-2O7XSAWJ.js → managed-npm-update-HA262PFM.js} +41 -41
  204. package/chunks/{mcp-AFVHCHKT.js → mcp-T5ZUOKT3.js} +44 -44
  205. package/chunks/{monitor-PY4WDSX3.js → monitor-SLGY7CYB.js} +38 -38
  206. package/chunks/nonInteractiveCli-R5PK5B5G.js +166 -0
  207. package/chunks/{notebook-edit-GEPL33NO.js → notebook-edit-STSSB5KQ.js} +38 -38
  208. package/chunks/{openaiContentGenerator-ACYSXQ6R.js → openaiContentGenerator-OQED57JE.js} +24 -24
  209. package/chunks/{opentui-entry-SBAOWW7M.js → opentui-entry-UTJ6MHDI.js} +116 -97
  210. package/chunks/{pidfile-SUNYCAA4.js → pidfile-GES3MIHH.js} +39 -39
  211. package/chunks/{processUtils-F7LP7YUV.js → processUtils-FU6VMUOL.js} +2 -2
  212. package/chunks/{qwenContentGenerator-BB6IPELF.js → qwenContentGenerator-HWJSEGUL.js} +43 -43
  213. package/chunks/{qwenOAuth2-OU3WGDOI.js → qwenOAuth2-PAIR7XEW.js} +9 -9
  214. package/chunks/{read-file-GORBXJTS.js → read-file-IYEBTQT5.js} +12 -12
  215. package/chunks/{read-mcp-resource-TJSJRH4F.js → read-mcp-resource-THCSZHXO.js} +2 -2
  216. package/chunks/{read-package-up-TCM6I7S2.js → read-package-up-K6RKTL5D.js} +1 -1
  217. package/chunks/{record-artifact-FXF5LHPE.js → record-artifact-76YYQA5F.js} +3 -3
  218. package/chunks/{resumeHistoryUtils-FOAJJJWK.js → resumeHistoryUtils-WP446RP5.js} +44 -44
  219. package/chunks/{ripGrep-RNLIZGCY.js → ripGrep-VV2CRCL2.js} +38 -38
  220. package/chunks/{run-qwen-serve-GVMMX3IU.js → run-qwen-serve-AHQCTALV.js} +160 -71
  221. package/chunks/{runtime-RNBZ5FDD.js → runtime-AUUZGDK6.js} +49 -49
  222. package/chunks/{scheduler-NTRFSPIP.js → scheduler-Y4UPEURR.js} +40 -40
  223. package/chunks/{sdk-exporters-http-2VPMAPFI.js → sdk-exporters-http-A7XLKZO7.js} +11 -7
  224. package/chunks/{sdk-impl-5W3JUCWF.js → sdk-impl-XO4UF6PR.js} +11 -8
  225. package/chunks/{send-message-RBYLV5NY.js → send-message-P5SLP57G.js} +6 -6
  226. package/chunks/{serve-H3PGA26U.js → serve-WI3SE4MY.js} +47 -47
  227. package/chunks/{server-SUXD2F3C.js → server-G6JU6UWL.js} +264 -159
  228. package/chunks/{session-MTFVUWWM.js → session-2AO2UACB.js} +85 -85
  229. package/chunks/{settings-GUJ3TN2J.js → settings-3HRWSH66.js} +43 -43
  230. package/chunks/{shell-C2UP5FF2.js → shell-AR7XFLHA.js} +38 -38
  231. package/chunks/{skill-4XCNK55E.js → skill-K6NOUUYM.js} +16 -16
  232. package/chunks/{skill-settings-Y2BU27XM.js → skill-settings-IOXQYS6X.js} +43 -43
  233. package/chunks/{spawnChannel-UUUUK734.js → spawnChannel-V6P6HF4V.js} +40 -40
  234. package/chunks/{standalone-update-MJ722XZ4.js → standalone-update-K5G3L2OJ.js} +40 -40
  235. package/chunks/{startInteractiveUI-TCPIPNGN.js → startInteractiveUI-TRRP52QX.js} +125 -115
  236. package/chunks/{syntheticOutput-D3Z64LJC.js → syntheticOutput-SEW4NA47.js} +3 -3
  237. package/chunks/{task-create-URFZ5EUX.js → task-create-247EAVF7.js} +10 -10
  238. package/chunks/{task-list-6JDFMPUW.js → task-list-ZJN4QHLK.js} +5 -5
  239. package/chunks/{task-stop-HHUGCD25.js → task-stop-MAYQJ42I.js} +2 -2
  240. package/chunks/{task-update-DVV6CUGI.js → task-update-SU5TMZGG.js} +10 -10
  241. package/chunks/{team-create-WZWH2NJI.js → team-create-IEEEBLE2.js} +38 -38
  242. package/chunks/{team-delete-PZGGBQLM.js → team-delete-3XVRPQBP.js} +5 -5
  243. package/chunks/{team-plan-approval-SUZQJCWJ.js → team-plan-approval-SJGNS5JL.js} +38 -38
  244. package/chunks/{terminal-image-renderer-BCUN3Z3W.js → terminal-image-renderer-C4RQMC67.js} +40 -40
  245. package/chunks/{theme-manager-UGMFDREN.js → theme-manager-IKZQJQ6C.js} +39 -39
  246. package/chunks/{todoWrite-WINAZSZI.js → todoWrite-IE2YTCK7.js} +4 -4
  247. package/chunks/{tool-search-B6F3MPUZ.js → tool-search-4UVNFYWU.js} +16 -16
  248. package/chunks/{total-session-admission-MQLBJ5WL.js → total-session-admission-DIN6FTZP.js} +44 -44
  249. package/chunks/{trustedFolders-2XST7U5C.js → trustedFolders-IAHOLV6A.js} +39 -39
  250. package/chunks/{update-relaunch-OVC7YNGD.js → update-relaunch-5QSJ5CWP.js} +5 -5
  251. package/chunks/{updateCheck-YAKM36WQ.js → updateCheck-N4RT7HOZ.js} +44 -44
  252. package/chunks/{useAutoAcceptIndicator-RF6FVX3S.js → useAutoAcceptIndicator-25T26VZS.js} +46 -46
  253. package/chunks/{validateNonInterActiveAuth-IPPXFNQH.js → validateNonInterActiveAuth-MCTVPLFE.js} +81 -81
  254. package/chunks/{version-4IDFEXOU.js → version-6PLZ7PCV.js} +2 -2
  255. package/chunks/{web-fetch-NUOLHXPN.js → web-fetch-5ANX6FSM.js} +16 -16
  256. package/chunks/{web-search-LVOOV4XZ.js → web-search-KQJWWRHW.js} +9 -9
  257. package/chunks/{workflow-JSTYTG3K.js → workflow-C57ZKFUF.js} +111 -46
  258. package/chunks/{workspace-providers-status-U4EYXA4K.js → workspace-providers-status-3QAE4G4Y.js} +47 -47
  259. package/chunks/{workspace-registration-store-OG66U3CB.js → workspace-registration-store-Q3J5LV6T.js} +1 -1
  260. package/chunks/{workspace-registry-WSHWQRQQ.js → workspace-registry-DSJ5NAII.js} +44 -44
  261. package/chunks/{workspace-service-QZXQHX2F.js → workspace-service-QW5LH7FA.js} +49 -49
  262. package/chunks/{workspace-skills-status-VRBHEX5O.js → workspace-skills-status-N34ALJPZ.js} +45 -45
  263. package/chunks/{workspace-trust-reconciler-FCRIUIOF.js → workspace-trust-reconciler-YTOL7QEV.js} +50 -50
  264. package/chunks/{write-file-PYL3JCCD.js → write-file-MSFRVUZB.js} +38 -38
  265. package/chunks/{zoom-image-RS6MU26F.js → zoom-image-4TQA5GHG.js} +12 -12
  266. package/cli.js +13 -13
  267. package/package.json +4 -4
  268. package/web-shell/assets/{arc-CgGUyHWd.js → arc-lZ04kynw.js} +1 -1
  269. package/web-shell/assets/{architectureDiagram-3BPJPVTR-BR0Qv-1Y.js → architectureDiagram-3BPJPVTR-B1wZVhzD.js} +1 -1
  270. package/web-shell/assets/{blockDiagram-GPEHLZMM-DIoaceaI.js → blockDiagram-GPEHLZMM-CO0e0yJt.js} +1 -1
  271. package/web-shell/assets/{c4Diagram-AAUBKEIU-Bc5k6BbI.js → c4Diagram-AAUBKEIU-Dfpo6Qie.js} +1 -1
  272. package/web-shell/assets/channel-BxvRq3pV.js +1 -0
  273. package/web-shell/assets/{chunk-2J33WTMH-DtPEz2WX.js → chunk-2J33WTMH-BvxArftT.js} +1 -1
  274. package/web-shell/assets/{chunk-4BX2VUAB-Dydo6ydE.js → chunk-4BX2VUAB-BS2XXjGY.js} +1 -1
  275. package/web-shell/assets/{chunk-55IACEB6-DD9_VWXm.js → chunk-55IACEB6-CYL6h3Ph.js} +1 -1
  276. package/web-shell/assets/{chunk-727SXJPM-DVI2m59k.js → chunk-727SXJPM-C-cWPX30.js} +1 -1
  277. package/web-shell/assets/{chunk-AQP2D5EJ-luatmaTN.js → chunk-AQP2D5EJ-CJLxNbVV.js} +1 -1
  278. package/web-shell/assets/{chunk-FMBD7UC4-Duy8NTIi.js → chunk-FMBD7UC4-DwfzKywA.js} +1 -1
  279. package/web-shell/assets/{chunk-ND2GUHAM-CrL1yhms.js → chunk-ND2GUHAM-BI5raYHQ.js} +1 -1
  280. package/web-shell/assets/{chunk-QZHKN3VN-C7BX6bu1.js → chunk-QZHKN3VN-_GkNI90J.js} +1 -1
  281. package/web-shell/assets/classDiagram-4FO5ZUOK-tL8nAxYf.js +1 -0
  282. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-tL8nAxYf.js +1 -0
  283. package/web-shell/assets/{cose-bilkent-S5V4N54A-BTzs7mIi.js → cose-bilkent-S5V4N54A-BAVLNxh9.js} +1 -1
  284. package/web-shell/assets/{dagre-BM42HDAG-3VTUmWts.js → dagre-BM42HDAG-BD4XNLqp.js} +1 -1
  285. package/web-shell/assets/{diagram-2AECGRRQ-Ehdp75GN.js → diagram-2AECGRRQ-WO567p8w.js} +1 -1
  286. package/web-shell/assets/{diagram-5GNKFQAL-B3wu3teE.js → diagram-5GNKFQAL-mAk23VWO.js} +1 -1
  287. package/web-shell/assets/{diagram-KO2AKTUF-DjgTSf2S.js → diagram-KO2AKTUF-YQEeHKze.js} +1 -1
  288. package/web-shell/assets/{diagram-LMA3HP47-Br9mwjY3.js → diagram-LMA3HP47-CMVjxAjv.js} +1 -1
  289. package/web-shell/assets/{diagram-OG6HWLK6-D4xz5M-z.js → diagram-OG6HWLK6-42hPvbM-.js} +1 -1
  290. package/web-shell/assets/{erDiagram-TEJ5UH35-CXayWlG_.js → erDiagram-TEJ5UH35-CXU_cPfu.js} +1 -1
  291. package/web-shell/assets/{flowDiagram-I6XJVG4X-CLonjQTi.js → flowDiagram-I6XJVG4X-D-3TdhMT.js} +1 -1
  292. package/web-shell/assets/{ganttDiagram-6RSMTGT7-BTySFT-1.js → ganttDiagram-6RSMTGT7-CsgkXolz.js} +1 -1
  293. package/web-shell/assets/{gitGraphDiagram-PVQCEYII--2WcUjOe.js → gitGraphDiagram-PVQCEYII-B6Q3PBLD.js} +1 -1
  294. package/web-shell/assets/{index-DPJHkFOG.js → index-BFrkGj2B.js} +1 -1
  295. package/web-shell/assets/index-BgjULKyF.css +5 -0
  296. package/web-shell/assets/index-CxXlPYfl.js +1789 -0
  297. package/web-shell/assets/{infoDiagram-5YYISTIA-9vpgAf1m.js → infoDiagram-5YYISTIA-jiAfSXp8.js} +1 -1
  298. package/web-shell/assets/{ishikawaDiagram-YF4QCWOH-DcRpHnAW.js → ishikawaDiagram-YF4QCWOH-BWif5KeJ.js} +1 -1
  299. package/web-shell/assets/{journeyDiagram-JHISSGLW-C2TKorRm.js → journeyDiagram-JHISSGLW-B-GAZthS.js} +1 -1
  300. package/web-shell/assets/{kanban-definition-UN3LZRKU-DdsFwB8b.js → kanban-definition-UN3LZRKU-9TEuATdL.js} +1 -1
  301. package/web-shell/assets/{linear-7PjRvJrf.js → linear-dy_QPfyE.js} +1 -1
  302. package/web-shell/assets/{mermaid.core-raDXa11C.js → mermaid.core-DB2uLAnq.js} +5 -5
  303. package/web-shell/assets/{mindmap-definition-RKZ34NQL-DLHc-PRN.js → mindmap-definition-RKZ34NQL-ey_dyxi-.js} +1 -1
  304. package/web-shell/assets/{pieDiagram-4H26LBE5-BftYpeTW.js → pieDiagram-4H26LBE5-_6BuMdDj.js} +1 -1
  305. package/web-shell/assets/{quadrantDiagram-W4KKPZXB-O-6ygOYn.js → quadrantDiagram-W4KKPZXB-B2rM19W2.js} +1 -1
  306. package/web-shell/assets/{requirementDiagram-4Y6WPE33-BmZWVufJ.js → requirementDiagram-4Y6WPE33-DWj8b7vW.js} +1 -1
  307. package/web-shell/assets/{sankeyDiagram-5OEKKPKP-2x5beiWt.js → sankeyDiagram-5OEKKPKP-D5dtYh0N.js} +1 -1
  308. package/web-shell/assets/{sequenceDiagram-3UESZ5HK-BH8uKokQ.js → sequenceDiagram-3UESZ5HK-DVkdn_qW.js} +1 -1
  309. package/web-shell/assets/{stateDiagram-AJRCARHV-Dq1MFgX_.js → stateDiagram-AJRCARHV-DgwD_fi6.js} +1 -1
  310. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-BWGkVGVB.js +1 -0
  311. package/web-shell/assets/{timeline-definition-PNZ67QCA-Cl2WKbv9.js → timeline-definition-PNZ67QCA-vNr_1UNX.js} +1 -1
  312. package/web-shell/assets/{vennDiagram-CIIHVFJN-BqoRo_Q-.js → vennDiagram-CIIHVFJN-ChFcGAcu.js} +1 -1
  313. package/web-shell/assets/{wardley-L42UT6IY-BTxp-Yot.js → wardley-L42UT6IY-C8PXoSWk.js} +1 -1
  314. package/web-shell/assets/{wardleyDiagram-YWT4CUSO-DFXVCSH2.js → wardleyDiagram-YWT4CUSO-C2nqOV6i.js} +1 -1
  315. package/web-shell/assets/{xychartDiagram-2RQKCTM6-qQhWx0aE.js → xychartDiagram-2RQKCTM6-BntaqhSB.js} +1 -1
  316. package/web-shell/index.html +2 -2
  317. package/chunks/nonInteractiveCli-ZHW6F76F.js +0 -166
  318. package/web-shell/assets/channel-D2b9IYpS.js +0 -1
  319. package/web-shell/assets/classDiagram-4FO5ZUOK-DHatTCmD.js +0 -1
  320. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-DHatTCmD.js +0 -1
  321. package/web-shell/assets/index-CIFO52Wx.css +0 -5
  322. package/web-shell/assets/index-bhq3CUUF.js +0 -1789
  323. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-spuAYji6.js +0 -1
@@ -6,18 +6,20 @@ import {
6
6
  EventBus,
7
7
  logEventSizingFailed,
8
8
  serializedBridgeEventByteLength
9
- } from "./chunk-MZSJ43WV.js";
9
+ } from "./chunk-JVY7FHUZ.js";
10
10
  import {
11
+ JOURNAL_GROWTH_HARD_CAP_BYTES,
11
12
  normalizeCompactedReplayMaxBytes,
13
+ normalizeJournalGrowthPoolBytes,
12
14
  normalizeMaxJournalBytes,
13
15
  normalizeMaxJournalEvents
14
- } from "./chunk-XCGIMOLN.js";
16
+ } from "./chunk-WCCLLK7X.js";
15
17
  import {
16
18
  MCP_RESTART_SERVER_DEADLINE_MS
17
19
  } from "./chunk-OCPBI7J5.js";
18
20
  import {
19
21
  defaultSpawnChannelFactory
20
- } from "./chunk-TYGKUOEG.js";
22
+ } from "./chunk-2U3UCXZ3.js";
21
23
  import {
22
24
  BridgeChannelClosedError,
23
25
  BridgeTimeoutError,
@@ -27,7 +29,7 @@ import {
27
29
  SessionRestoreTimeoutError,
28
30
  createIdleWorkspaceExtensionsStatus,
29
31
  createIdleWorkspaceHooksStatus
30
- } from "./chunk-OPBATTFQ.js";
32
+ } from "./chunk-NHZF4VCD.js";
31
33
  import {
32
34
  ACTIVE_WORK_CLOSE_IF_UNHELD_PARAM,
33
35
  ACTIVE_WORK_CLOSE_TIMEOUT_MS,
@@ -46,6 +48,7 @@ import {
46
48
  DAEMON_PROMPT_DISPLAY_TEXT_META_KEY,
47
49
  LOAD_REPLAY_BULK_MODE,
48
50
  LOAD_REPLAY_HIDE_INHERITED_META_KEY,
51
+ LOAD_REPLAY_MAX_UPDATES,
49
52
  LOAD_REPLAY_META_KEY,
50
53
  LOAD_REPLAY_MODE_META_KEY,
51
54
  LOAD_REPLAY_PAGE_SIZE_META_KEY,
@@ -59,7 +62,7 @@ import {
59
62
  WORKTREE_MCP_DEFER_META_KEY,
60
63
  clampActiveWorkIntervalMs,
61
64
  isValidTrustedModelPrompt
62
- } from "./chunk-HHGQGTJQ.js";
65
+ } from "./chunk-UFHPAMAV.js";
63
66
  import {
64
67
  BranchWhilePromptActiveError,
65
68
  BridgeChannelQuarantinedError,
@@ -116,16 +119,16 @@ import {
116
119
  metadataBudgetBytes,
117
120
  normalizeSnapshotPayload,
118
121
  stableSessionArtifactId
119
- } from "./chunk-M6HXP2SG.js";
122
+ } from "./chunk-GHOUZ5X4.js";
120
123
  import {
121
124
  DAEMON_TRACEPARENT_META_KEY,
122
125
  DAEMON_TRACESTATE_META_KEY
123
- } from "./chunk-O5AZPHYZ.js";
126
+ } from "./chunk-U5C2GIN2.js";
124
127
  import {
125
128
  INVOCATION_CONTEXT_META_KEY,
126
129
  PRIVATE_ACP_CAPABILITY_ENV,
127
130
  PRIVATE_PARENT_CAPABILITY_META_KEY
128
- } from "./chunk-HB6QW4LM.js";
131
+ } from "./chunk-UAAWNTOC.js";
129
132
  import {
130
133
  init_esbuild_shims
131
134
  } from "./chunk-5O2XNYP6.js";
@@ -155,6 +158,17 @@ var LATEST_WINS_UPDATES = /* @__PURE__ */ new Set([
155
158
  ]);
156
159
  var REPLAY_SEGMENT_COMPACT_THRESHOLD = 64;
157
160
  var LIVE_JOURNAL_TEXT_CHUNKS_PER_EVENT = 256;
161
+ function createLiveJournalState() {
162
+ return {
163
+ entries: [],
164
+ entryBytes: [],
165
+ entryEvents: [],
166
+ totalBytes: 0,
167
+ totalEvents: 0,
168
+ truncatedEvents: 0
169
+ };
170
+ }
171
+ __name(createLiveJournalState, "createLiveJournalState");
158
172
  function replayRecordId(event) {
159
173
  if (event.type !== "session_update") return void 0;
160
174
  const data = event.data;
@@ -180,26 +194,35 @@ function lastRecordIdIn(events) {
180
194
  return void 0;
181
195
  }
182
196
  __name(lastRecordIdIn, "lastRecordIdIn");
197
+ function lastSummaryRecordIdIn(events) {
198
+ for (let i = events.length - 1; i >= 0; i--) {
199
+ if (!isSummaryLiveJournalEvent(events[i])) continue;
200
+ const id = replayRecordId(events[i]);
201
+ if (id !== void 0) return id;
202
+ }
203
+ return void 0;
204
+ }
205
+ __name(lastSummaryRecordIdIn, "lastSummaryRecordIdIn");
206
+ var JOURNAL_GROWTH_REASK_INTERVAL_MS = 1e4;
207
+ var JOURNAL_GROWTH_MAX_GRANTS_PER_BREACH = 64;
183
208
  var TurnBoundaryCompactionEngine = class {
184
209
  static {
185
210
  __name(this, "TurnBoundaryCompactionEngine");
186
211
  }
187
212
  maxReplayBytes;
213
+ // Mutable: adaptive growth (see `maybeGrowJournalLimits`) raises these
214
+ // in place when the advisor grants headroom.
188
215
  maxJournalEvents;
189
216
  maxJournalBytes;
217
+ onJournalGrowth;
218
+ now;
219
+ journalGrowthDeniedAt;
190
220
  onReplayWindowEviction;
191
221
  replaySegments = [];
192
222
  replaySegmentStart = 0;
193
223
  replayBytes = 0;
194
- liveJournal = [];
195
- /** Serialized source-event size of each `liveJournal` entry, index-parallel. */
196
- journalEntryBytes = [];
197
- /** Raw event count represented by each `liveJournal` entry. */
198
- journalEntryEvents = [];
199
- journalTotalBytes = 0;
200
- journalTotalEvents = 0;
201
- journalTruncatedEvents = 0;
202
- liveJournalTextSegment;
224
+ fullJournal = createLiveJournalState();
225
+ summaryJournal = createLiveJournalState();
203
226
  lastEventId = 0;
204
227
  closed = false;
205
228
  truncatedEvents = 0;
@@ -212,6 +235,7 @@ var TurnBoundaryCompactionEngine = class {
212
235
  // pagination. Undefined until at least one recordId has been observed;
213
236
  // omitted from the marker in that case.
214
237
  activeRecordId;
238
+ summaryRecordId;
215
239
  // Pagination anchor for the replay-path `history_truncated` marker,
216
240
  // frozen at the first replay-window eviction. Prefers the first
217
241
  // retained recordId (the eviction boundary, so `beforeRecordId`
@@ -232,19 +256,30 @@ var TurnBoundaryCompactionEngine = class {
232
256
  this.maxReplayBytes = normalizeCompactedReplayMaxBytes(opts.maxReplayBytes);
233
257
  this.maxJournalEvents = normalizeMaxJournalEvents(opts.maxJournalEvents);
234
258
  this.maxJournalBytes = normalizeMaxJournalBytes(opts.maxJournalBytes);
259
+ this.onJournalGrowth = opts.onJournalGrowth;
260
+ this.now = opts.now ?? (() => performance.now());
235
261
  this.onReplayWindowEviction = opts.onReplayWindowEviction;
236
262
  }
263
+ /** Current journal caps — may have grown past the configured baseline. */
264
+ journalLimits() {
265
+ return { maxEvents: this.maxJournalEvents, maxBytes: this.maxJournalBytes };
266
+ }
237
267
  ingest(event, byteLength) {
238
268
  if (this.closed) return;
239
269
  if (event.id !== void 0) {
240
270
  this.lastEventId = event.id;
241
271
  }
242
272
  if (TRANSIENT_TYPES.has(event.type)) return;
273
+ const summaryEvent = isSummaryLiveJournalEvent(event);
243
274
  const seenRecordId = replayRecordId(event);
244
275
  if (seenRecordId !== void 0) {
245
276
  this.activeRecordId = seenRecordId;
277
+ if (summaryEvent) this.summaryRecordId = seenRecordId;
278
+ }
279
+ this.appendLiveJournal(this.fullJournal, event, byteLength);
280
+ if (summaryEvent) {
281
+ this.appendLiveJournal(this.summaryJournal, event, byteLength);
246
282
  }
247
- this.appendLiveJournal(event, byteLength);
248
283
  if (TURN_BOUNDARY_TYPES.has(event.type)) {
249
284
  this.compactCurrentTurn(event);
250
285
  return;
@@ -255,33 +290,35 @@ var TurnBoundaryCompactionEngine = class {
255
290
  }
256
291
  this.slots.push({ kind: "misc", event });
257
292
  }
258
- snapshot() {
293
+ snapshot(liveReplayMode = "full") {
259
294
  const compactedTurns = this.flattenReplaySegments();
260
295
  if (this.truncatedEvents > 0) {
261
296
  compactedTurns.unshift(
262
297
  this.makeHistoryTruncatedEvent(compactedTurns.length)
263
298
  );
264
299
  }
265
- const liveJournal = this.liveJournal.map(
300
+ const journal = liveReplayMode === "summary" ? this.summaryJournal : this.fullJournal;
301
+ const journalRecordId = liveReplayMode === "summary" ? this.summaryRecordId : this.activeRecordId;
302
+ const liveJournal = journal.entries.map(
266
303
  (entry) => isLiveJournalTextSegment(entry) ? mergeLiveJournalTextEvent(
267
304
  entry.firstEvent,
268
305
  entry.lastEvent,
269
306
  entry.chunks
270
307
  ) : entry
271
308
  );
272
- if (this.journalTruncatedEvents > 0) {
309
+ if (journal.truncatedEvents > 0) {
273
310
  liveJournal.unshift({
274
311
  v: EVENT_SCHEMA_VERSION,
275
312
  type: "history_truncated",
276
313
  data: {
277
314
  reason: "replay_window_exceeded",
278
315
  scope: "live_journal",
279
- truncatedEvents: this.journalTruncatedEvents,
280
- retainedEvents: this.journalTotalEvents,
316
+ truncatedEvents: journal.truncatedEvents,
317
+ retainedEvents: journal.totalEvents,
281
318
  maxBytes: this.maxJournalBytes,
282
319
  maxEvents: this.maxJournalEvents,
283
320
  // Pagination anchor — see makeHistoryTruncatedEvent.
284
- ...this.activeRecordId !== void 0 ? { recordId: this.activeRecordId } : {},
321
+ ...journalRecordId !== void 0 ? { recordId: journalRecordId } : {},
285
322
  fullTranscriptAvailable: true
286
323
  }
287
324
  });
@@ -297,7 +334,9 @@ var TurnBoundaryCompactionEngine = class {
297
334
  this.resetReplayWindow();
298
335
  this.lastEventId = snapshot.lastEventId;
299
336
  this.activeRecordId = void 0;
337
+ this.summaryRecordId = void 0;
300
338
  this.activeRecordId = lastRecordIdIn(snapshot.compactedTurns);
339
+ this.summaryRecordId = lastSummaryRecordIdIn(snapshot.compactedTurns);
301
340
  for (const event of snapshot.compactedTurns) {
302
341
  if (TRANSIENT_TYPES.has(event.type)) continue;
303
342
  this.addReplaySegment([event], 0);
@@ -311,7 +350,9 @@ var TurnBoundaryCompactionEngine = class {
311
350
  if (this.closed) return;
312
351
  this.resetReplayWindow();
313
352
  this.activeRecordId = void 0;
353
+ this.summaryRecordId = void 0;
314
354
  this.activeRecordId = lastRecordIdIn(events);
355
+ this.summaryRecordId = lastSummaryRecordIdIn(events);
315
356
  let recordEvents = [];
316
357
  let recordId;
317
358
  const flushRecord = /* @__PURE__ */ __name(() => {
@@ -346,22 +387,23 @@ var TurnBoundaryCompactionEngine = class {
346
387
  this.resetReplayWindow();
347
388
  this.resetJournal();
348
389
  this.activeRecordId = void 0;
390
+ this.summaryRecordId = void 0;
349
391
  this.slots = [];
350
392
  this.toolSlotIndex.clear();
351
393
  this.clearTextSlotIndex();
352
394
  }
353
- appendLiveJournal(event, byteLength) {
395
+ appendLiveJournal(journal, event, byteLength) {
354
396
  const bytes = byteLength ?? serializedBridgeEventByteLength(event) ?? 0;
355
397
  const textChunk = liveJournalTextChunk(event);
356
- const current = this.liveJournalTextSegment;
357
- const currentIndex = this.liveJournal.length - 1;
358
- if (textChunk && current && this.liveJournal[currentIndex] === current && current.chunks.length < LIVE_JOURNAL_TEXT_CHUNKS_PER_EVENT && this.journalEntryBytes[currentIndex] + bytes <= this.maxJournalBytes && current.sessionUpdate === textChunk.sessionUpdate && current.parentToolCallId === textChunk.parentToolCallId && stringArraysEqual(current.sourceRecordIds, textChunk.sourceRecordIds) && current.promptId === event.promptId && current.originatorClientId === event.originatorClientId && current.sessionId === captureSessionId(event) && hasOnlyTimestampEnvelopeMeta(current.lastEvent._meta) && hasOnlyTimestampEnvelopeMeta(event._meta)) {
398
+ const current = journal.textSegment;
399
+ const currentIndex = journal.entries.length - 1;
400
+ if (textChunk && current && journal.entries[currentIndex] === current && current.chunks.length < LIVE_JOURNAL_TEXT_CHUNKS_PER_EVENT && journal.entryBytes[currentIndex] + bytes <= this.maxJournalBytes && current.sessionUpdate === textChunk.sessionUpdate && current.parentToolCallId === textChunk.parentToolCallId && stringArraysEqual(current.sourceRecordIds, textChunk.sourceRecordIds) && current.promptId === event.promptId && current.originatorClientId === event.originatorClientId && current.sessionId === captureSessionId(event) && hasOnlyTimestampEnvelopeMeta(current.lastEvent._meta) && hasOnlyTimestampEnvelopeMeta(event._meta)) {
359
401
  current.chunks.push(textChunk.text);
360
402
  current.lastEvent = event;
361
- this.journalEntryBytes[currentIndex] += bytes;
362
- this.journalEntryEvents[currentIndex] += 1;
363
- this.journalTotalBytes += bytes;
364
- this.journalTotalEvents += 1;
403
+ journal.entryBytes[currentIndex] += bytes;
404
+ journal.entryEvents[currentIndex] += 1;
405
+ journal.totalBytes += bytes;
406
+ journal.totalEvents += 1;
365
407
  } else {
366
408
  let entry = event;
367
409
  if (textChunk) {
@@ -377,27 +419,97 @@ var TurnBoundaryCompactionEngine = class {
377
419
  lastEvent: event
378
420
  };
379
421
  entry = segment;
380
- this.liveJournalTextSegment = segment;
422
+ journal.textSegment = segment;
381
423
  } else {
382
- this.liveJournalTextSegment = void 0;
424
+ journal.textSegment = void 0;
383
425
  }
384
- this.liveJournal.push(entry);
385
- this.journalEntryBytes.push(bytes);
386
- this.journalEntryEvents.push(1);
387
- this.journalTotalBytes += bytes;
388
- this.journalTotalEvents += 1;
426
+ journal.entries.push(entry);
427
+ journal.entryBytes.push(bytes);
428
+ journal.entryEvents.push(1);
429
+ journal.totalBytes += bytes;
430
+ journal.totalEvents += 1;
431
+ }
432
+ if (!TURN_BOUNDARY_TYPES.has(event.type) && (journal.entries.length > this.maxJournalEvents || journal.totalBytes > this.maxJournalBytes && journal.entries.length > 1)) {
433
+ this.maybeGrowJournalLimits(journal);
389
434
  }
390
- while (this.liveJournal.length > this.maxJournalEvents || this.journalTotalBytes > this.maxJournalBytes && this.liveJournal.length > 1) {
391
- const dropped = this.liveJournal.shift();
392
- this.journalTotalBytes -= this.journalEntryBytes.shift() ?? 0;
393
- const droppedEvents = this.journalEntryEvents.shift() ?? 0;
394
- this.journalTotalEvents -= droppedEvents;
395
- this.journalTruncatedEvents += droppedEvents;
396
- if (dropped === this.liveJournalTextSegment) {
397
- this.liveJournalTextSegment = void 0;
435
+ while (journal.entries.length > this.maxJournalEvents || journal.totalBytes > this.maxJournalBytes && journal.entries.length > 1) {
436
+ const dropped = journal.entries.shift();
437
+ journal.totalBytes -= journal.entryBytes.shift() ?? 0;
438
+ const droppedEvents = journal.entryEvents.shift() ?? 0;
439
+ journal.totalEvents -= droppedEvents;
440
+ journal.truncatedEvents += droppedEvents;
441
+ if (dropped === journal.textSegment) {
442
+ journal.textSegment = void 0;
398
443
  }
399
444
  }
400
445
  }
446
+ /**
447
+ * Consults the growth advisor once the journal breaches its caps and
448
+ * applies a grant in place, so the eviction loop below only drops what
449
+ * still exceeds the (possibly raised) caps. An intermediate grant that
450
+ * does not yet retain an extra entry is still applied tentatively —
451
+ * each applied cap is what the next ask reports and is charged for —
452
+ * and the walk continues until a grant retains strictly more than the
453
+ * pre-breach caps, the advisor refuses, or the step budget runs out. A
454
+ * walk that never improves retention rolls back to the original caps
455
+ * and counts as a refusal, so the pool is never charged for growth that
456
+ * preserves no replay. Never throws: a misbehaving advisor degrades to
457
+ * plain eviction, matching the engine's best-effort contract.
458
+ */
459
+ maybeGrowJournalLimits(journal) {
460
+ const advisor = this.onJournalGrowth;
461
+ if (!advisor || this.closed) return;
462
+ const now = this.now();
463
+ if (this.journalGrowthDeniedAt !== void 0) {
464
+ const sinceDenialMs = now - this.journalGrowthDeniedAt;
465
+ if (sinceDenialMs >= 0 && sinceDenialMs < JOURNAL_GROWTH_REASK_INTERVAL_MS) {
466
+ return;
467
+ }
468
+ }
469
+ const originalEvents = this.maxJournalEvents;
470
+ const originalBytes = this.maxJournalBytes;
471
+ const originalRetained = this.retainedTailCount(
472
+ journal,
473
+ originalEvents,
474
+ originalBytes
475
+ );
476
+ for (let step = 0; step < JOURNAL_GROWTH_MAX_GRANTS_PER_BREACH; step++) {
477
+ let grant;
478
+ try {
479
+ grant = advisor({
480
+ maxEvents: this.maxJournalEvents,
481
+ maxBytes: this.maxJournalBytes
482
+ });
483
+ } catch {
484
+ grant = void 0;
485
+ }
486
+ if (!grant || !Number.isSafeInteger(grant.maxBytes) || !Number.isSafeInteger(grant.maxEvents) || grant.maxBytes <= this.maxJournalBytes || grant.maxEvents < this.maxJournalEvents) {
487
+ break;
488
+ }
489
+ this.maxJournalBytes = grant.maxBytes;
490
+ this.maxJournalEvents = grant.maxEvents;
491
+ if (this.retainedTailCount(journal, grant.maxEvents, grant.maxBytes) > originalRetained) {
492
+ this.journalGrowthDeniedAt = void 0;
493
+ return;
494
+ }
495
+ }
496
+ this.maxJournalEvents = originalEvents;
497
+ this.maxJournalBytes = originalBytes;
498
+ this.journalGrowthDeniedAt = now;
499
+ }
500
+ /** Entries of the newest-first tail the eviction loop would retain. */
501
+ retainedTailCount(journal, maxEvents, maxBytes) {
502
+ let count = 0;
503
+ let bytes = 0;
504
+ for (let i = journal.entries.length - 1; i >= 0; i--) {
505
+ const entryBytes = journal.entryBytes[i] ?? 0;
506
+ if (count + 1 > maxEvents) break;
507
+ if (count >= 1 && bytes + entryBytes > maxBytes) break;
508
+ count += 1;
509
+ bytes += entryBytes;
510
+ }
511
+ return count;
512
+ }
401
513
  classifySessionUpdate(event) {
402
514
  const data = event.data;
403
515
  const updateType = data?.update?.sessionUpdate;
@@ -565,13 +677,9 @@ var TurnBoundaryCompactionEngine = class {
565
677
  }
566
678
  }
567
679
  resetJournal() {
568
- this.liveJournal = [];
569
- this.journalEntryBytes = [];
570
- this.journalEntryEvents = [];
571
- this.journalTotalBytes = 0;
572
- this.journalTotalEvents = 0;
573
- this.journalTruncatedEvents = 0;
574
- this.liveJournalTextSegment = void 0;
680
+ this.fullJournal = createLiveJournalState();
681
+ this.summaryJournal = createLiveJournalState();
682
+ this.journalGrowthDeniedAt = void 0;
575
683
  }
576
684
  addReplaySegment(events, turnCount) {
577
685
  if (events.length === 0) return;
@@ -806,6 +914,21 @@ function extractParentToolCallIdFromMeta(meta) {
806
914
  return void 0;
807
915
  }
808
916
  __name(extractParentToolCallIdFromMeta, "extractParentToolCallIdFromMeta");
917
+ function isSummaryLiveJournalEvent(event) {
918
+ if (event.type !== "session_update") return true;
919
+ const data = event.data;
920
+ const meta = data?.update?._meta;
921
+ const parentToolCallId = extractParentToolCallIdFromMeta(meta);
922
+ if (parentToolCallId === void 0) return true;
923
+ if (parentToolCallId === data?.update?.toolCallId) return true;
924
+ if (data?.update?.sessionUpdate !== "agent_message_chunk") return false;
925
+ if (typeof meta !== "object" || meta === null) return false;
926
+ const usage = meta["usage"];
927
+ if (typeof usage !== "object" || usage === null) return false;
928
+ const fields = usage;
929
+ return typeof fields["inputTokens"] === "number" || typeof fields["outputTokens"] === "number";
930
+ }
931
+ __name(isSummaryLiveJournalEvent, "isSummaryLiveJournalEvent");
809
932
  function extractSourceRecordIdsFromMeta(meta) {
810
933
  if (typeof meta !== "object" || meta === null) return void 0;
811
934
  const transcript = meta["qwenTranscript"];
@@ -928,6 +1051,44 @@ function mergeTranscriptUpdateMeta(existing, incoming) {
928
1051
  }
929
1052
  __name(mergeTranscriptUpdateMeta, "mergeTranscriptUpdateMeta");
930
1053
 
1054
+ // packages/acp-bridge/src/journalGrowthPolicy.ts
1055
+ init_esbuild_shims();
1056
+ function createJournalGrowthPolicy(opts) {
1057
+ const hardCapEvents = Math.min(
1058
+ Number.MAX_SAFE_INTEGER,
1059
+ Math.max(
1060
+ opts.baselineEvents,
1061
+ Math.ceil(opts.hardCapBytes / opts.baselineBytes * opts.baselineEvents)
1062
+ )
1063
+ );
1064
+ return {
1065
+ grant(request) {
1066
+ if (request.currentMaxBytes >= opts.hardCapBytes) return void 0;
1067
+ const extraGranted = request.allSessionLimits.reduce(
1068
+ (sum, session) => sum + Math.max(0, session.limitBytes - session.baselineBytes),
1069
+ 0
1070
+ );
1071
+ const available = opts.poolBytes - extraGranted;
1072
+ if (available <= 0) return void 0;
1073
+ const maxBytes = Math.min(
1074
+ request.currentMaxBytes * 2,
1075
+ request.currentMaxBytes + available,
1076
+ opts.hardCapBytes
1077
+ );
1078
+ if (maxBytes <= request.currentMaxBytes) return void 0;
1079
+ const maxEvents = Math.min(
1080
+ Math.max(
1081
+ request.currentMaxEvents,
1082
+ Math.ceil(maxBytes / opts.baselineBytes * opts.baselineEvents)
1083
+ ),
1084
+ hardCapEvents
1085
+ );
1086
+ return { maxBytes, maxEvents };
1087
+ }
1088
+ };
1089
+ }
1090
+ __name(createJournalGrowthPolicy, "createJournalGrowthPolicy");
1091
+
931
1092
  // packages/acp-bridge/src/session-restore-timeout.ts
932
1093
  init_esbuild_shims();
933
1094
  var DEFAULT_SESSION_RESTORE_TIMEOUT_MS = 6e4;
@@ -5911,7 +6072,6 @@ var KNOWN_SESSION_UPDATE_TYPES = /* @__PURE__ */ new Set([
5911
6072
  "session_info_update",
5912
6073
  "usage_update"
5913
6074
  ]);
5914
- var MAX_BULK_REPLAY_UPDATES = 1e4;
5915
6075
  function isRecord3(value) {
5916
6076
  return typeof value === "object" && value !== null && !Array.isArray(value);
5917
6077
  }
@@ -6241,9 +6401,9 @@ function extractLoadReplayResponse(state) {
6241
6401
  `Invalid qwen.session.loadReplay updates (version=${LOAD_REPLAY_VERSION}, count=not-array)`
6242
6402
  );
6243
6403
  }
6244
- if (rawUpdates.length > MAX_BULK_REPLAY_UPDATES) {
6404
+ if (rawUpdates.length > LOAD_REPLAY_MAX_UPDATES) {
6245
6405
  throw new Error(
6246
- `qwen.session.loadReplay updates exceed limit (${rawUpdates.length} > ${MAX_BULK_REPLAY_UPDATES})`
6406
+ `qwen.session.loadReplay updates exceed limit (${rawUpdates.length} > ${LOAD_REPLAY_MAX_UPDATES})`
6247
6407
  );
6248
6408
  }
6249
6409
  const partial = replay["partial"];
@@ -6264,6 +6424,12 @@ function extractLoadReplayResponse(state) {
6264
6424
  `Invalid qwen.session.loadReplay hasMore (version=${LOAD_REPLAY_VERSION}, hasMore=${describeLoadReplayValue(hasMore)})`
6265
6425
  );
6266
6426
  }
6427
+ const anchorRecordId = replay["anchorRecordId"];
6428
+ if (anchorRecordId !== void 0 && typeof anchorRecordId !== "string") {
6429
+ throw new Error(
6430
+ `Invalid qwen.session.loadReplay anchorRecordId (version=${LOAD_REPLAY_VERSION}, anchorRecordId=${describeLoadReplayValue(anchorRecordId)})`
6431
+ );
6432
+ }
6267
6433
  const invalidUpdateIndex = rawUpdates.findIndex(
6268
6434
  (update) => !isBulkReplayUpdate(update)
6269
6435
  );
@@ -6285,6 +6451,7 @@ function extractLoadReplayResponse(state) {
6285
6451
  return {
6286
6452
  state: cleanState,
6287
6453
  updates: rawUpdates,
6454
+ ...typeof anchorRecordId === "string" ? { anchorRecordId } : {},
6288
6455
  ...partial === true ? { partial: true } : {},
6289
6456
  ...typeof replayError === "string" ? { replayError } : {},
6290
6457
  ...hasMore === true ? { hasMore: true } : {}
@@ -6772,6 +6939,16 @@ function createAcpSessionBridge(opts) {
6772
6939
  );
6773
6940
  const maxJournalEvents = normalizeMaxJournalEvents(opts.maxJournalEvents);
6774
6941
  const maxJournalBytes = normalizeMaxJournalBytes(opts.maxJournalBytes);
6942
+ const journalGrowthPoolBytes = normalizeJournalGrowthPoolBytes(
6943
+ opts.journalGrowthPoolBytes
6944
+ );
6945
+ const journalGrowthPolicy = journalGrowthPoolBytes !== void 0 ? createJournalGrowthPolicy({
6946
+ baselineEvents: maxJournalEvents,
6947
+ baselineBytes: maxJournalBytes,
6948
+ poolBytes: journalGrowthPoolBytes,
6949
+ hardCapBytes: JOURNAL_GROWTH_HARD_CAP_BYTES
6950
+ }) : void 0;
6951
+ const journalGrowthSessionLimits = opts.journalGrowthSessionLimits;
6775
6952
  const channelFactory = opts.channelFactory ?? defaultSpawnChannelFactory;
6776
6953
  const childEnvOverrides = opts.childEnvOverrides ? Object.freeze({ ...opts.childEnvOverrides }) : Object.freeze({});
6777
6954
  const initTimeoutMs = opts.initializeTimeoutMs ?? DEFAULT_INIT_TIMEOUT_MS;
@@ -7295,6 +7472,22 @@ function createAcpSessionBridge(opts) {
7295
7472
  const inFlightRequestedSessionSpawns = /* @__PURE__ */ new Map();
7296
7473
  const inFlightRestores = /* @__PURE__ */ new Map();
7297
7474
  const pendingRestoreEvents = /* @__PURE__ */ new Map();
7475
+ const journalSessionLimits = /* @__PURE__ */ __name(() => {
7476
+ const limits = [...byId.values()].map((entry) => ({
7477
+ limitBytes: entry.events.journalLimitBytes() ?? maxJournalBytes,
7478
+ baselineBytes: maxJournalBytes
7479
+ }));
7480
+ for (const [restoreId, bus] of pendingRestoreEvents) {
7481
+ if (!byId.has(restoreId)) {
7482
+ limits.push({
7483
+ limitBytes: bus.journalLimitBytes() ?? maxJournalBytes,
7484
+ baselineBytes: maxJournalBytes
7485
+ });
7486
+ }
7487
+ }
7488
+ return limits;
7489
+ }, "journalSessionLimits");
7490
+ const unregisterJournalGrowthSessionLimits = journalGrowthPolicy !== void 0 && opts.registerJournalGrowthSessionLimits !== void 0 ? opts.registerJournalGrowthSessionLimits(journalSessionLimits) : void 0;
7298
7491
  const createClientId = /* @__PURE__ */ __name(() => `client_${randomUUID2()}`, "createClientId");
7299
7492
  const registerClient = /* @__PURE__ */ __name((entry, requestedClientId) => {
7300
7493
  if (requestedClientId && entry.clientIds.has(requestedClientId)) {
@@ -8506,7 +8699,34 @@ function createAcpSessionBridge(opts) {
8506
8699
  teeServeDebugLine(
8507
8700
  `replay window evicted ${JSON.stringify(eviction)}`
8508
8701
  );
8509
- }, "onReplayWindowEviction")
8702
+ }, "onReplayWindowEviction"),
8703
+ // Adaptive growth: the engine asks before evicting past its caps.
8704
+ // The policy accounts growth across this bridge's live sessions
8705
+ // from every session's CURRENT journal cap (stateless — no ledger
8706
+ // to reconcile when a session is reaped), so granted headroom dies
8707
+ // with its session.
8708
+ ...journalGrowthPolicy ? {
8709
+ onJournalGrowth: /* @__PURE__ */ __name((current) => {
8710
+ const allSessionLimits = journalGrowthSessionLimits ? [...journalGrowthSessionLimits()] : journalSessionLimits();
8711
+ if (!byId.has(sessionId) && !pendingRestoreEvents.has(sessionId)) {
8712
+ allSessionLimits.push({
8713
+ limitBytes: current.maxBytes,
8714
+ baselineBytes: maxJournalBytes
8715
+ });
8716
+ }
8717
+ const grant = journalGrowthPolicy.grant({
8718
+ currentMaxEvents: current.maxEvents,
8719
+ currentMaxBytes: current.maxBytes,
8720
+ allSessionLimits
8721
+ });
8722
+ if (grant) {
8723
+ teeServeDebugLine(
8724
+ `live journal growth session=${JSON.stringify(sessionId)}: ${current.maxBytes} -> ${grant.maxBytes} bytes, ${current.maxEvents} -> ${grant.maxEvents} entries`
8725
+ );
8726
+ }
8727
+ return grant;
8728
+ }, "onJournalGrowth")
8729
+ } : {}
8510
8730
  }),
8511
8731
  {
8512
8732
  // Fired once, on the FIRST ingest/seed failure (the bus keeps the
@@ -8782,18 +9002,19 @@ function createAcpSessionBridge(opts) {
8782
9002
  }
8783
9003
  return typeof maybe.message === "string" && maybe.message === `Resource not found: ${expectedUri}`;
8784
9004
  }, "isAcpSessionResourceNotFound");
8785
- const replayFieldsFor = /* @__PURE__ */ __name((entry, action) => {
9005
+ const replayFieldsFor = /* @__PURE__ */ __name((entry, action, liveReplayMode = "full") => {
8786
9006
  const replayStatus = action === "load" && entry.restoreReplayPartial === true ? {
8787
9007
  partial: true,
8788
9008
  ...typeof entry.restoreReplayError === "string" ? { replayError: entry.restoreReplayError } : {}
8789
9009
  } : {};
8790
9010
  const eventEpoch = entry.events.epoch;
8791
- const snapshot = entry.events.snapshotReplay();
9011
+ const snapshot = entry.events.snapshotReplay(liveReplayMode);
8792
9012
  if (!snapshot) {
8793
9013
  return {
8794
9014
  lastEventId: entry.events.lastEventId,
8795
9015
  eventEpoch,
8796
- ...replayStatus
9016
+ ...replayStatus,
9017
+ ...action === "load" && entry.restoreHistoryAnchorRecordId !== void 0 ? { historyAnchorRecordId: entry.restoreHistoryAnchorRecordId } : {}
8797
9018
  };
8798
9019
  }
8799
9020
  if (action === "load") {
@@ -8810,7 +9031,8 @@ function createAcpSessionBridge(opts) {
8810
9031
  eventEpoch,
8811
9032
  ...replayStatus,
8812
9033
  ...snapshot.degraded ? { replayDegraded: true } : {},
8813
- ...entry.restoreHistoryHasMore === true ? { historyHasMore: true } : {}
9034
+ ...entry.restoreHistoryHasMore === true ? { historyHasMore: true } : {},
9035
+ ...entry.restoreHistoryAnchorRecordId !== void 0 ? { historyAnchorRecordId: entry.restoreHistoryAnchorRecordId } : {}
8814
9036
  };
8815
9037
  }
8816
9038
  return { lastEventId: snapshot.lastEventId, eventEpoch, ...replayStatus };
@@ -8876,7 +9098,7 @@ function createAcpSessionBridge(opts) {
8876
9098
  }
8877
9099
  }
8878
9100
  __name(requestSessionTranscriptPage, "requestSessionTranscriptPage");
8879
- async function refreshedReplayFieldsFor(entry, historyPageSize) {
9101
+ async function refreshedReplayFieldsFor(entry, historyPageSize, liveReplayMode) {
8880
9102
  for (let attempt = 0; attempt < 2; attempt++) {
8881
9103
  try {
8882
9104
  const lastEventId = entry.events.lastEventId;
@@ -8916,7 +9138,7 @@ function createAcpSessionBridge(opts) {
8916
9138
  break;
8917
9139
  }
8918
9140
  }
8919
- return replayFieldsFor(entry, "load");
9141
+ return replayFieldsFor(entry, "load", liveReplayMode);
8920
9142
  }
8921
9143
  __name(refreshedReplayFieldsFor, "refreshedReplayFieldsFor");
8922
9144
  function transcriptEventRecordId(event) {
@@ -8971,6 +9193,13 @@ function createAcpSessionBridge(opts) {
8971
9193
  }
8972
9194
  const historyReplay = action === "load" ? req.historyReplay ?? "stream" : "stream";
8973
9195
  const historyPageSize = action === "load" && historyReplay === "response" ? req.historyPageSize : void 0;
9196
+ const requestedLiveReplayMode = req.liveReplayMode;
9197
+ if (requestedLiveReplayMode !== void 0 && requestedLiveReplayMode !== "full" && requestedLiveReplayMode !== "summary") {
9198
+ throw new Error(
9199
+ `Invalid liveReplayMode: ${JSON.stringify(requestedLiveReplayMode)}`
9200
+ );
9201
+ }
9202
+ const liveReplayMode = action === "load" ? requestedLiveReplayMode ?? "full" : "full";
8974
9203
  if (historyPageSize !== void 0 && (!Number.isSafeInteger(historyPageSize) || historyPageSize < 1 || historyPageSize > SESSION_TRANSCRIPT_MAX_LIMIT)) {
8975
9204
  throw new Error(
8976
9205
  `Invalid historyPageSize; expected 1..${SESSION_TRANSCRIPT_MAX_LIMIT}`
@@ -8980,7 +9209,11 @@ function createAcpSessionBridge(opts) {
8980
9209
  const existing = byId.get(req.sessionId);
8981
9210
  if (existing) {
8982
9211
  assertAttachableSessionEntry(req.sessionId, existing);
8983
- const replayFields = historyPageSize !== void 0 ? await refreshedReplayFieldsFor(existing, historyPageSize) : replayFieldsFor(existing, action);
9212
+ const replayFields = historyPageSize !== void 0 ? await refreshedReplayFieldsFor(
9213
+ existing,
9214
+ historyPageSize,
9215
+ liveReplayMode
9216
+ ) : replayFieldsFor(existing, action, liveReplayMode);
8984
9217
  const historyAnchorRecordId = action === "load" ? await resolveHistoryAnchorRecordId(existing, replayFields) : void 0;
8985
9218
  assertAttachableSessionEntry(req.sessionId, existing);
8986
9219
  existing.attachCount++;
@@ -9026,7 +9259,7 @@ function createAcpSessionBridge(opts) {
9026
9259
  }
9027
9260
  const inFlight = inFlightRestores.get(req.sessionId);
9028
9261
  if (inFlight) {
9029
- if (inFlight.lifecycle.phase === "abandoned" || action !== inFlight.action || historyReplay !== inFlight.historyReplay || historyPageSize !== inFlight.historyPageSize || hideInheritedHistory !== inFlight.hideInheritedHistory) {
9262
+ if (inFlight.lifecycle.phase === "abandoned" || action !== inFlight.action || historyReplay !== inFlight.historyReplay || historyPageSize !== inFlight.historyPageSize || inFlight.liveReplayMode === "summary" && liveReplayMode === "full" || hideInheritedHistory !== inFlight.hideInheritedHistory) {
9030
9263
  const abandoned = inFlight.lifecycle.phase === "abandoned";
9031
9264
  throw new RestoreInProgressError(
9032
9265
  req.sessionId,
@@ -9061,6 +9294,18 @@ function createAcpSessionBridge(opts) {
9061
9294
  entry.attachCount = Math.max(0, entry.attachCount - 1);
9062
9295
  throw error;
9063
9296
  }
9297
+ const waiterReplayFields = liveReplayMode !== inFlight.liveReplayMode ? historyPageSize !== void 0 ? await refreshedReplayFieldsFor(
9298
+ entry,
9299
+ historyPageSize,
9300
+ liveReplayMode
9301
+ ) : replayFieldsFor(entry, action, liveReplayMode) : void 0;
9302
+ try {
9303
+ assertAttachableSessionEntry(restored.sessionId, entry);
9304
+ } catch (error) {
9305
+ inFlight.coalesceState.count--;
9306
+ entry.attachCount = Math.max(0, entry.attachCount - 1);
9307
+ throw error;
9308
+ }
9064
9309
  const clientId = registerClient(entry, req.clientId);
9065
9310
  recordAttachRef(entry, clientId);
9066
9311
  if (req.approvalMode) {
@@ -9086,7 +9331,8 @@ function createAcpSessionBridge(opts) {
9086
9331
  attached: true,
9087
9332
  clientId,
9088
9333
  createdAt: entry.createdAt,
9089
- hasActivePrompt: entry.promptActive
9334
+ hasActivePrompt: entry.promptActive,
9335
+ ...waiterReplayFields ?? {}
9090
9336
  };
9091
9337
  }
9092
9338
  assertFreshSessionsAvailable();
@@ -9260,6 +9506,7 @@ function createAcpSessionBridge(opts) {
9260
9506
  let replayPartial;
9261
9507
  let replayError;
9262
9508
  let replayHasMore;
9509
+ let replayAnchorRecordId;
9263
9510
  try {
9264
9511
  const rawRestore = telemetry.withSpan(
9265
9512
  "session.restore",
@@ -9370,6 +9617,7 @@ function createAcpSessionBridge(opts) {
9370
9617
  replayPartial = extracted.partial;
9371
9618
  replayError = extracted.replayError;
9372
9619
  replayHasMore = extracted.hasMore === true ? true : void 0;
9620
+ replayAnchorRecordId = extracted.anchorRecordId;
9373
9621
  }
9374
9622
  } catch (err) {
9375
9623
  if (err instanceof SessionRestoreTimeoutError) throw err;
@@ -9447,7 +9695,7 @@ function createAcpSessionBridge(opts) {
9447
9695
  ...racedEntry.sourceId !== void 0 ? { sourceId: racedEntry.sourceId } : {},
9448
9696
  state: racedEntry.restoreState ?? {},
9449
9697
  hasActivePrompt: racedEntry.promptActive,
9450
- ...replayFieldsFor(racedEntry, action)
9698
+ ...replayFieldsFor(racedEntry, action, liveReplayMode)
9451
9699
  };
9452
9700
  }
9453
9701
  const entry = createSessionEntry(
@@ -9478,6 +9726,9 @@ function createAcpSessionBridge(opts) {
9478
9726
  if (replayHasMore === true) {
9479
9727
  entry.restoreHistoryHasMore = true;
9480
9728
  }
9729
+ if (replayAnchorRecordId !== void 0) {
9730
+ entry.restoreHistoryAnchorRecordId = replayAnchorRecordId;
9731
+ }
9481
9732
  seedSnapshotCaches(entry, publicState);
9482
9733
  const artifactRestoreWarnings = await entry.artifacts.restore(
9483
9734
  restoredArtifactSnapshot
@@ -9520,7 +9771,7 @@ function createAcpSessionBridge(opts) {
9520
9771
  state: publicState,
9521
9772
  ...artifactRestoreWarnings.length > 0 ? { artifactWarnings: artifactRestoreWarnings } : {},
9522
9773
  hasActivePrompt: entry.promptActive,
9523
- ...replayFieldsFor(entry, action)
9774
+ ...replayFieldsFor(entry, action, liveReplayMode)
9524
9775
  };
9525
9776
  })().finally(async () => {
9526
9777
  if (restoreLifecycle.phase === "abandoned") return;
@@ -9583,6 +9834,7 @@ function createAcpSessionBridge(opts) {
9583
9834
  action,
9584
9835
  historyReplay,
9585
9836
  ...historyPageSize !== void 0 ? { historyPageSize } : {},
9837
+ liveReplayMode,
9586
9838
  hideInheritedHistory,
9587
9839
  publicPromise: promise,
9588
9840
  settlementPromise,
@@ -9767,6 +10019,10 @@ function createAcpSessionBridge(opts) {
9767
10019
  compactedReplayMaxBytes,
9768
10020
  maxJournalEvents,
9769
10021
  maxJournalBytes,
10022
+ journalGrowth: journalGrowthPoolBytes !== void 0 ? {
10023
+ poolBytes: journalGrowthPoolBytes,
10024
+ hardCapBytes: JOURNAL_GROWTH_HARD_CAP_BYTES
10025
+ } : null,
9770
10026
  channelIdleTimeoutMs: resolvedChannelIdleTimeoutMs(),
9771
10027
  sessionIdleTimeoutMs
9772
10028
  },
@@ -9774,22 +10030,27 @@ function createAcpSessionBridge(opts) {
9774
10030
  pendingPermissionCount: permissionMediator.pendingCount,
9775
10031
  channelLive: !!liveChannelInfo(),
9776
10032
  permissionPolicy: permissionMediator.policy,
9777
- sessions: [...byId.values()].map((entry) => ({
9778
- sessionId: entry.sessionId,
9779
- workspaceCwd: entry.workspaceCwd,
9780
- createdAt: entry.createdAt,
9781
- ...entry.displayName ? { displayName: entry.displayName } : {},
9782
- clientCount: entry.clientIds.size,
9783
- subscriberCount: entry.events.subscriberCount,
9784
- attachCount: entry.attachCount,
9785
- pendingPromptCount: entry.pendingPromptCount,
9786
- pendingPermissionCount: entry.pendingPermissionIds.size,
9787
- hasActivePrompt: entry.promptActive,
9788
- lastEventId: entry.events.lastEventId,
9789
- ...entry.sessionLastSeenAt !== void 0 ? { lastSeenAt: entry.sessionLastSeenAt } : {},
9790
- ...entry.currentModelId ? { currentModelId: entry.currentModelId } : {},
9791
- ...entry.currentApprovalMode ? { currentApprovalMode: entry.currentApprovalMode } : {}
9792
- }))
10033
+ sessions: [...byId.values()].map((entry) => {
10034
+ const journalLimits = entry.events.journalLimits();
10035
+ return {
10036
+ sessionId: entry.sessionId,
10037
+ workspaceCwd: entry.workspaceCwd,
10038
+ createdAt: entry.createdAt,
10039
+ ...entry.displayName ? { displayName: entry.displayName } : {},
10040
+ clientCount: entry.clientIds.size,
10041
+ subscriberCount: entry.events.subscriberCount,
10042
+ attachCount: entry.attachCount,
10043
+ pendingPromptCount: entry.pendingPromptCount,
10044
+ pendingPermissionCount: entry.pendingPermissionIds.size,
10045
+ hasActivePrompt: entry.promptActive,
10046
+ lastEventId: entry.events.lastEventId,
10047
+ ...entry.sessionLastSeenAt !== void 0 ? { lastSeenAt: entry.sessionLastSeenAt } : {},
10048
+ ...entry.currentModelId ? { currentModelId: entry.currentModelId } : {},
10049
+ ...entry.currentApprovalMode ? { currentApprovalMode: entry.currentApprovalMode } : {},
10050
+ maxJournalEvents: journalLimits?.maxEvents ?? maxJournalEvents,
10051
+ maxJournalBytes: journalLimits?.maxBytes ?? maxJournalBytes
10052
+ };
10053
+ })
9793
10054
  };
9794
10055
  },
9795
10056
  get sessionCount() {
@@ -12765,6 +13026,7 @@ function createAcpSessionBridge(opts) {
12765
13026
  });
12766
13027
  void (async () => {
12767
13028
  shuttingDown = true;
13029
+ unregisterJournalGrowthSessionLimits?.();
12768
13030
  cancelIdleTimer();
12769
13031
  stopSessionReaper();
12770
13032
  const entries = Array.from(byId.values());