@qwen-code/qwen-code 0.21.12 → 0.21.14-preview.0

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 (353) hide show
  1. package/bundled/qc-helper/docs/configuration/settings.md +13 -5
  2. package/bundled/qc-helper/docs/features/code-review.md +18 -13
  3. package/bundled/qc-helper/docs/features/commands.md +120 -8
  4. package/bundled/qc-helper/docs/features/sub-agents.md +2 -2
  5. package/bundled/qc-helper/docs/qwen-serve-deploy-local.md +1 -1
  6. package/bundled/qc-helper/docs/qwen-serve.md +20 -3
  7. package/bundled/review/SKILL.md +130 -82
  8. package/chunks/{MaxSizedBox-ZSJJ2D5S.js → MaxSizedBox-3PZITE2Y.js} +46 -45
  9. package/chunks/{StandaloneSessionPicker-WHUHQXSA.js → StandaloneSessionPicker-2C34PNGO.js} +68 -67
  10. package/chunks/{acp-startup-profiler-SVPUHLXV.js → acp-startup-profiler-HUYGO57H.js} +2 -2
  11. package/chunks/{acpAgent-7JOAESF5.js → acpAgent-3J4NHAYT.js} +1098 -366
  12. package/chunks/{agent-E6V3VXQR.js → agent-VFX4RPP5.js} +42 -41
  13. package/chunks/agent-headless-6WCF4J6N.js +88 -0
  14. package/chunks/{anthropicContentGenerator-YDT4EOKO.js → anthropicContentGenerator-M7XRJMSK.js} +8 -8
  15. package/chunks/{artifact-tool-4GCQQDZI.js → artifact-tool-GEXTOPVO.js} +2 -2
  16. package/chunks/{askUserQuestion-HZJJLR3Z.js → askUserQuestion-B33XRSB7.js} +2 -2
  17. package/chunks/{bridge-NPBV53UA.js → bridge-XR5ZSR7U.js} +46 -45
  18. package/chunks/{ca-4CQ6MYNQ.js → ca-SLZJD6QH.js} +8 -0
  19. package/chunks/{channel-management-service-OADNGQM3.js → channel-management-service-X6LCQUAD.js} +1 -1
  20. package/chunks/{channel-settings-store-4ODLJ4X2.js → channel-settings-store-Z7BUEUJE.js} +50 -49
  21. package/chunks/{channel-worker-group-IHBIHQ45.js → channel-worker-group-TJ35JDPE.js} +4 -4
  22. package/chunks/{channel-worker-manager-GEHYJ5AE.js → channel-worker-manager-G5LKWGOG.js} +4 -4
  23. package/chunks/{channel-worker-supervisor-ZJIIWM4I.js → channel-worker-supervisor-OEVWBHGT.js} +2 -2
  24. package/chunks/{chunk-47BGDLJG.js → chunk-25GHLMQQ.js} +42 -20
  25. package/chunks/{chunk-2ZWH53I4.js → chunk-2B2BF7P7.js} +3 -3
  26. package/chunks/chunk-2C6HJMG3.js +757 -0
  27. package/chunks/{chunk-WM3LUQLO.js → chunk-2JXDFSVE.js} +6 -6
  28. package/chunks/{chunk-OYWVIXHT.js → chunk-2M55OBEB.js} +1 -1
  29. package/chunks/{chunk-B4VN3VDH.js → chunk-2OA3JMRD.js} +5 -5
  30. package/chunks/{chunk-GZDWTBT3.js → chunk-3EZLLVDF.js} +2 -2
  31. package/chunks/chunk-3PWCMXIR.js +9169 -0
  32. package/chunks/{chunk-XAFIL4BD.js → chunk-4KQ2TI2K.js} +5 -5
  33. package/chunks/{chunk-OPVF453Q.js → chunk-4V4DFJBS.js} +3 -3
  34. package/chunks/{chunk-DPTMKFIH.js → chunk-4ZMS3JCR.js} +43 -12
  35. package/chunks/{chunk-6JEIRPLN.js → chunk-55PIFSP2.js} +2 -2
  36. package/chunks/{chunk-V6OBVAST.js → chunk-57KOJ2KZ.js} +1 -1
  37. package/chunks/{chunk-QLTATTPS.js → chunk-5CVO7YES.js} +1 -1
  38. package/chunks/{chunk-OK47XBYH.js → chunk-5IYS4WWR.js} +1 -1
  39. package/chunks/chunk-5MK45KZ3.js +492 -0
  40. package/chunks/{chunk-OWXFBIB6.js → chunk-6DFPR7CS.js} +1 -1
  41. package/chunks/{chunk-YIGGWOJE.js → chunk-6HY6IF3Z.js} +1 -1
  42. package/chunks/{chunk-XDRXOSAD.js → chunk-6LAPGPVA.js} +7 -5
  43. package/chunks/{chunk-Q4ZPYNIZ.js → chunk-6PDOHRN6.js} +4 -4
  44. package/chunks/{chunk-OWGRUU7F.js → chunk-6QFDQMQX.js} +1 -1
  45. package/chunks/{chunk-MUNA4QDC.js → chunk-6VDPDHIP.js} +29 -8
  46. package/chunks/{chunk-MDNUCDKZ.js → chunk-73G3Z7QS.js} +3 -3
  47. package/chunks/{chunk-VIFA5VJD.js → chunk-7OCSX7FC.js} +1 -1
  48. package/chunks/{chunk-D2RNVVH6.js → chunk-AKBOLMUF.js} +96 -18
  49. package/chunks/{chunk-S6TCTH4Z.js → chunk-AQBHJ2IG.js} +12 -12
  50. package/chunks/{chunk-WCEI6J56.js → chunk-BOJNAPUE.js} +2 -2
  51. package/chunks/{chunk-DAV4QFD5.js → chunk-BQWNIPTE.js} +44 -3
  52. package/chunks/{chunk-HOSVOUDK.js → chunk-BUQDLC2G.js} +3 -0
  53. package/chunks/{chunk-LUISTZXI.js → chunk-CH5OFRV7.js} +2 -2
  54. package/chunks/{chunk-G6MUFRNI.js → chunk-CHHABXPE.js} +1 -1
  55. package/chunks/{chunk-4AOVQPJU.js → chunk-CPHEPGAO.js} +1 -1
  56. package/chunks/{chunk-MS7GNABG.js → chunk-CXJHQVEK.js} +8 -0
  57. package/chunks/{chunk-K5IDV3PC.js → chunk-D34RDOLP.js} +12 -2
  58. package/chunks/{chunk-3GM5DLBI.js → chunk-DGJ7O55J.js} +3 -3
  59. package/chunks/{chunk-7KJPO7YH.js → chunk-DRKYT2TR.js} +2 -2
  60. package/chunks/{chunk-PZW46OTB.js → chunk-DVR7XKO5.js} +2 -2
  61. package/chunks/{chunk-CQ6IPDQW.js → chunk-DZCV3ZYU.js} +3 -3
  62. package/chunks/{chunk-ULNWG62W.js → chunk-E3DYKPYZ.js} +3 -3
  63. package/chunks/{chunk-YCHNAKC5.js → chunk-E5RS7LF4.js} +44 -13
  64. package/chunks/{chunk-4NFY2S7N.js → chunk-E7REAOTN.js} +15 -0
  65. package/chunks/chunk-EOCQCNV4.js +3887 -0
  66. package/chunks/{chunk-D7QGE3RT.js → chunk-FAAUPSY2.js} +1 -1
  67. package/chunks/{chunk-2IVYL3IF.js → chunk-FCTLOVYW.js} +1 -1
  68. package/chunks/{chunk-QPBFRWCP.js → chunk-FS5NGKWC.js} +3 -3
  69. package/chunks/{chunk-RQJA2YYO.js → chunk-G6FFFICU.js} +4 -4
  70. package/chunks/{chunk-36XKGB7E.js → chunk-GV3OIADZ.js} +3 -3
  71. package/chunks/{chunk-3AEKDXKT.js → chunk-H4A72DE5.js} +1 -1
  72. package/chunks/{chunk-IH4Z54RJ.js → chunk-HGPMOXLZ.js} +5 -5
  73. package/chunks/{chunk-DG4IQ6JG.js → chunk-I3N2Z25H.js} +3 -3
  74. package/chunks/{chunk-WI6GIM2M.js → chunk-I7NTHW4C.js} +2 -2
  75. package/chunks/{chunk-ZBB5EZZV.js → chunk-IA2K2HJE.js} +2 -2
  76. package/chunks/{chunk-IRSLAS4M.js → chunk-IOTPI425.js} +19 -11
  77. package/chunks/{chunk-ROIJYS5K.js → chunk-ISRHAMNL.js} +3 -3
  78. package/chunks/{chunk-CGM3E75C.js → chunk-J63PKMYA.js} +3 -3
  79. package/chunks/{chunk-PTSEETCO.js → chunk-J6YS7Z25.js} +107 -13
  80. package/chunks/{chunk-ZQUY3ZJU.js → chunk-K3CECR5C.js} +4 -4
  81. package/chunks/{chunk-QBJYSIQ4.js → chunk-K3LPAED5.js} +53 -12
  82. package/chunks/{chunk-FRHQQC2Z.js → chunk-KBXKR5R2.js} +1 -1
  83. package/chunks/{chunk-4KM2SYK5.js → chunk-KC4WMLZO.js} +1491 -10579
  84. package/chunks/{chunk-IX4PWUDU.js → chunk-KSGWAYNE.js} +14350 -8679
  85. package/chunks/{chunk-CPFFU46D.js → chunk-KV27IEHM.js} +1 -1
  86. package/chunks/{chunk-OR64CU46.js → chunk-L6CCLB3G.js} +1 -1
  87. package/chunks/{chunk-M6NDLY2T.js → chunk-LD5VIJ7S.js} +1 -1
  88. package/chunks/{chunk-GXTMEATA.js → chunk-LLR424CQ.js} +18 -15
  89. package/chunks/{chunk-RDVNSJQU.js → chunk-LRDB2OLB.js} +3 -3
  90. package/chunks/{chunk-LSRI3ND3.js → chunk-MA2HEDVP.js} +1 -1
  91. package/chunks/{chunk-DFVXU5YM.js → chunk-MCG53LWC.js} +1 -1
  92. package/chunks/{chunk-YBVVOSOH.js → chunk-MIPFDQAF.js} +1 -1
  93. package/chunks/{chunk-KRXPRVGL.js → chunk-MLXTMF7H.js} +0 -1
  94. package/chunks/{chunk-BSR5AXZR.js → chunk-NRPXRNN4.js} +1 -1
  95. package/chunks/{chunk-X5SLJOMF.js → chunk-NV6LW6FT.js} +4 -4
  96. package/chunks/{chunk-YILJKX2T.js → chunk-NVRMCWTP.js} +10 -6
  97. package/chunks/chunk-NYWWQ437.js +24 -0
  98. package/chunks/{chunk-AKBFSOC5.js → chunk-OBJYN4MX.js} +2 -2
  99. package/chunks/{chunk-NX4A23LY.js → chunk-OJOP26ET.js} +3 -3
  100. package/chunks/{chunk-3GDBZJD6.js → chunk-OLZSWUZR.js} +7 -7
  101. package/chunks/{chunk-K34GJQOZ.js → chunk-OO4FKHLO.js} +4 -4
  102. package/chunks/{chunk-BSSLSQEW.js → chunk-OSAFWBNR.js} +3 -3
  103. package/chunks/{chunk-TMFWI4RC.js → chunk-OVY67CYC.js} +1 -1
  104. package/chunks/{chunk-6ZKSO6K7.js → chunk-P425IVUK.js} +7 -7
  105. package/chunks/{chunk-4XA4QIUA.js → chunk-PMS7O6SA.js} +1 -1
  106. package/chunks/{chunk-LCX5B364.js → chunk-PPTM4O4R.js} +3 -3
  107. package/chunks/{chunk-VPV7WBVT.js → chunk-PT4I7NBA.js} +1 -1
  108. package/chunks/{chunk-3LDGOQXZ.js → chunk-QECSDJET.js} +6 -6
  109. package/chunks/{chunk-FMIH5KMQ.js → chunk-QEJZUXSK.js} +1 -1
  110. package/chunks/{chunk-NLFLYSS4.js → chunk-QFJ5JHQR.js} +1 -1
  111. package/chunks/{chunk-KWX56CHZ.js → chunk-QIHHJKXT.js} +7 -7
  112. package/chunks/{chunk-TDESMS7M.js → chunk-RAQBBGS6.js} +50 -70
  113. package/chunks/{chunk-KEC5FHLM.js → chunk-ROIYNTHJ.js} +3 -3
  114. package/chunks/{chunk-63FNZTWG.js → chunk-RWDNJBWN.js} +2 -2
  115. package/chunks/{chunk-56HVDG3M.js → chunk-RXHBTKMG.js} +6 -6
  116. package/chunks/{chunk-MAKIANMX.js → chunk-S6CXQKDD.js} +3 -3
  117. package/chunks/{chunk-CIDQISGM.js → chunk-SA7GBPEA.js} +5 -5
  118. package/chunks/{chunk-YX2RDGAL.js → chunk-SBRIBTYN.js} +1 -1
  119. package/chunks/{chunk-TTRH3RTQ.js → chunk-SG7ZP5PG.js} +4 -4
  120. package/chunks/{chunk-XH3KAV2G.js → chunk-SGLPDKRT.js} +3 -3
  121. package/chunks/{chunk-JRIVMPD2.js → chunk-SLILKYV2.js} +4 -4
  122. package/chunks/{chunk-NW2GIPG3.js → chunk-SNQZZ765.js} +2 -2
  123. package/chunks/{chunk-I7BT2MME.js → chunk-SR2LYSMT.js} +1 -1
  124. package/chunks/{chunk-TXP5NGG3.js → chunk-SXCOEJO4.js} +1 -1
  125. package/chunks/{chunk-MELQSJOU.js → chunk-TNPWODIZ.js} +1 -1
  126. package/chunks/{chunk-VLHR7F4E.js → chunk-U6RZRKNM.js} +247 -198
  127. package/chunks/{chunk-HTYND72J.js → chunk-UC67T4SF.js} +3 -1
  128. package/chunks/{chunk-HG3UBTJ4.js → chunk-UYDGFWIJ.js} +609 -23
  129. package/chunks/{chunk-6P5EXEBL.js → chunk-VGAAAMRD.js} +1126 -232
  130. package/chunks/{chunk-WDVDVWJ3.js → chunk-VHPMDDPT.js} +6 -6
  131. package/chunks/{chunk-H7TMVHKE.js → chunk-WGHHA7ZH.js} +1 -1
  132. package/chunks/{chunk-FQDCO3CJ.js → chunk-WP4WIUOJ.js} +7 -0
  133. package/chunks/{chunk-5RUCD4ED.js → chunk-WPVUOVYX.js} +3 -3
  134. package/chunks/{chunk-EJOGLSNJ.js → chunk-WSSH2BNO.js} +2 -2
  135. package/chunks/{chunk-5AFGJNY6.js → chunk-WVIABDXV.js} +4 -4
  136. package/chunks/chunk-WZAD4ZNJ.js +59 -0
  137. package/chunks/{chunk-62X3CM7Q.js → chunk-X3YA3YGG.js} +8 -5
  138. package/chunks/{chunk-EBPLKY6U.js → chunk-XC377TLN.js} +5483 -3168
  139. package/chunks/{chunk-KLOMACIR.js → chunk-XLLKYULU.js} +2 -2
  140. package/chunks/{chunk-QSD4UH74.js → chunk-XO24LIZC.js} +254 -56
  141. package/chunks/{chunk-N4SVADAV.js → chunk-XT4RKHVE.js} +5 -4
  142. package/chunks/{chunk-PVXEJB66.js → chunk-XUJNK7Y6.js} +1 -1
  143. package/chunks/{chunk-YBHUXEC6.js → chunk-YECDICIO.js} +3 -3
  144. package/chunks/{chunk-FA5K6YI2.js → chunk-YFPZ3NNC.js} +36 -4
  145. package/chunks/{chunk-46UV252V.js → chunk-YHC2EYYG.js} +35 -38
  146. package/chunks/{chunk-6SPD4Z7F.js → chunk-YIWH3MKK.js} +8 -3
  147. package/chunks/{chunk-ZMY2P4L3.js → chunk-YXC7JYUI.js} +4 -4
  148. package/chunks/{chunk-TB4YFWXG.js → chunk-YZHRN3CF.js} +2 -2
  149. package/chunks/{chunk-TQDFSQQF.js → chunk-YZOSNW4R.js} +1 -1
  150. package/chunks/{chunk-DD6O3ZRD.js → chunk-ZIGC3MUS.js} +3 -5
  151. package/chunks/{chunk-CZ4OWGQQ.js → chunk-ZXEAEZFN.js} +63 -19
  152. package/chunks/{computer-use-F4URV4TU.js → computer-use-ABECHPS5.js} +42 -41
  153. package/chunks/{config-utils-Z3OW3IQG.js → config-utils-NJQA5YLJ.js} +2 -2
  154. package/chunks/{contextCommand-IGSS2U5J.js → contextCommand-4CD5HZQQ.js} +44 -43
  155. package/chunks/{core-runtime-H5CZDN3A.js → core-runtime-2MOVQ4VX.js} +42 -41
  156. package/chunks/{create-sub-session-XT6DLYOE.js → create-sub-session-KRQULJE6.js} +2 -2
  157. package/chunks/{create-sub-session-PA7MFTHK.js → create-sub-session-L6NNHG5N.js} +46 -44
  158. package/chunks/{cron-create-2JZ2TWTF.js → cron-create-NFRZEOQX.js} +4 -4
  159. package/chunks/{cron-delete-CTPD2P26.js → cron-delete-GFVSVO7C.js} +4 -4
  160. package/chunks/{cron-list-V44KHAF6.js → cron-list-NRW34CLU.js} +4 -4
  161. package/chunks/{daemon-GED37WOX.js → daemon-XH76IXOC.js} +436 -29
  162. package/chunks/{daemon-git-worktree-guard-LZDCNJGV.js → daemon-git-worktree-guard-BLXFEG4Q.js} +44 -43
  163. package/chunks/daemon-status-provider-XGD3TPTO.js +103 -0
  164. package/chunks/daemon-trust-policy-THEGCWPO.js +100 -0
  165. package/chunks/{daemon-trust-policy-monitor-2K2YETMT.js → daemon-trust-policy-monitor-L7L4ACWQ.js} +49 -48
  166. package/chunks/{de-UBEBKG6V.js → de-AH4LGCF5.js} +8 -0
  167. package/chunks/{deferred-core-runtime-FKJ3OYE7.js → deferred-core-runtime-YQLHDUGE.js} +42 -41
  168. package/chunks/discovery-X2NV535U.js +27 -0
  169. package/chunks/{display-image-M2ELAVN4.js → display-image-ON3EYFRD.js} +4 -4
  170. package/chunks/{dist-WJ4BHIEW.js → dist-ESS34DHC.js} +72 -0
  171. package/chunks/{earlyInputCapture-WJBSJQUF.js → earlyInputCapture-PCTXNW7N.js} +43 -42
  172. package/chunks/{edit-X73LA4YO.js → edit-QX2EGWYW.js} +45 -43
  173. package/chunks/{en-X6YV7GME.js → en-MD3GP5YL.js} +8 -0
  174. package/chunks/{enter-worktree-CLRQTIVN.js → enter-worktree-EM3ZZ2SB.js} +42 -41
  175. package/chunks/{enterPlanMode-6BDYUQ5T.js → enterPlanMode-ESCMVAKB.js} +42 -41
  176. package/chunks/{environment-WOAJXJDJ.js → environment-TOJI56YV.js} +45 -44
  177. package/chunks/{errors-7OY5MXYY.js → errors-DZ5FWWEM.js} +44 -43
  178. package/chunks/{exit-worktree-TFFJXCRT.js → exit-worktree-KUIJ36XA.js} +42 -41
  179. package/chunks/exitPlanMode-NFVY54FV.js +86 -0
  180. package/chunks/{fast-path-QQLGC37M.js → fast-path-JLQXJSH6.js} +3 -3
  181. package/chunks/{fast-path-settings-LNOFM2YP.js → fast-path-settings-WHX3J3ZI.js} +2 -2
  182. package/chunks/{fr-VENTC2BS.js → fr-ZEML2JWS.js} +8 -0
  183. package/chunks/{gemini-VHE62IJL.js → gemini-I7OT4FWL.js} +92 -91
  184. package/chunks/{geminiContentGenerator-VSHIEGAQ.js → geminiContentGenerator-GRIS77NJ.js} +6 -6
  185. package/chunks/{glob-VMEEDDLO.js → glob-7TBUUV6R.js} +42 -41
  186. package/chunks/{goal-tools-M4UDAZXP.js → goal-tools-K5OHOJ6B.js} +56 -12
  187. package/chunks/{grep-F4UAR7KX.js → grep-743SYWCZ.js} +42 -41
  188. package/chunks/handleAutoUpdate-GAOYUYOD.js +95 -0
  189. package/chunks/{i18n-ETW24DHW.js → i18n-2ITURYX6.js} +43 -42
  190. package/chunks/{image-gen-YPK2AZT4.js → image-gen-4OIWDZD6.js} +10 -10
  191. package/chunks/initializer-OC7LWA6X.js +101 -0
  192. package/chunks/{installationInfo-P7OTIR4P.js → installationInfo-CO47QX3Q.js} +43 -42
  193. package/chunks/{ja-QHT4EQTO.js → ja-UM5B2HMD.js} +8 -0
  194. package/chunks/{keychain-token-storage-NKKCUHI2.js → keychain-token-storage-3XFJ5ZB2.js} +2 -2
  195. package/chunks/list-ATR2SFWT.js +104 -0
  196. package/chunks/{list-agents-O6WSY4CT.js → list-agents-OSVDFI6S.js} +2 -2
  197. package/chunks/loadedSettingsAdapter-NK4B7AGK.js +98 -0
  198. package/chunks/{loggingContentGenerator-J2J2AANS.js → loggingContentGenerator-3WXBU5TQ.js} +67 -41
  199. package/chunks/{loop-wakeup-GVQRMUKS.js → loop-wakeup-HWVUU5CF.js} +5 -5
  200. package/chunks/{ls-6W2D7TKU.js → ls-D3HUFHDP.js} +4 -4
  201. package/chunks/{lsp-NJ4KFBI2.js → lsp-3QDDJTCS.js} +2 -2
  202. package/chunks/{managed-npm-update-WMV5ITKU.js → managed-npm-update-4SSBWI2D.js} +43 -42
  203. package/chunks/mcp-C62AE2QI.js +98 -0
  204. package/chunks/{monitor-2MM23VDV.js → monitor-FEYEGASA.js} +42 -41
  205. package/chunks/nonInteractiveCli-AJEV5ZWO.js +165 -0
  206. package/chunks/{notebook-edit-QD4TRKLY.js → notebook-edit-SLLTEY4O.js} +46 -44
  207. package/chunks/{openaiContentGenerator-KLHSPVN2.js → openaiContentGenerator-WLUGIAPX.js} +27 -26
  208. package/chunks/{pidfile-RQGZBNXT.js → pidfile-TV2VWUMB.js} +43 -42
  209. package/chunks/{processUtils-HZZDA2VV.js → processUtils-3IN2ZR55.js} +2 -2
  210. package/chunks/proper-lockfile-3LHWIM44.js +8 -0
  211. package/chunks/{pt-VL3I5RNY.js → pt-5BMJ3XYH.js} +8 -0
  212. package/chunks/{qwenContentGenerator-T75M2Z3B.js → qwenContentGenerator-GSGRFPJE.js} +47 -46
  213. package/chunks/{qwenOAuth2-5QZU444W.js → qwenOAuth2-JLSTIS4Z.js} +9 -9
  214. package/chunks/{read-file-LOVUSBJC.js → read-file-6PZZRGZZ.js} +15 -13
  215. package/chunks/{read-mcp-resource-GWCP23WG.js → read-mcp-resource-XD54ZQMC.js} +2 -2
  216. package/chunks/{record-artifact-IYQDEYMV.js → record-artifact-GLU3UWBV.js} +5 -3
  217. package/chunks/{resumeHistoryUtils-LVKSSQII.js → resumeHistoryUtils-5GEWKOOO.js} +49 -48
  218. package/chunks/ripGrep-FX7GBGFN.js +86 -0
  219. package/chunks/{ru-4RCKL4PY.js → ru-6GL66ORV.js} +8 -0
  220. package/chunks/{run-qwen-serve-GZW7B4WK.js → run-qwen-serve-7RHU3NSV.js} +423 -212
  221. package/chunks/{runtime-MYRXEO2E.js → runtime-EPOXAMLP.js} +52 -51
  222. package/chunks/{scheduler-DPTPI6FW.js → scheduler-F4Y7ENVV.js} +44 -43
  223. package/chunks/{sdk-exporters-http-NHBYB5FZ.js → sdk-exporters-http-NC746HLT.js} +3 -3
  224. package/chunks/{sdk-impl-SK4P5WON.js → sdk-impl-YVL7BP6Y.js} +3 -3
  225. package/chunks/{send-message-O7FO63UK.js → send-message-TNBG5EVA.js} +7 -7
  226. package/chunks/{serve-XCG4XCDA.js → serve-LQV4TN5A.js} +49 -50
  227. package/chunks/{server-AWQHKXLG.js → server-IZCKLIYQ.js} +5042 -1725
  228. package/chunks/{session-P5FKNCNR.js → session-52ZGTDVB.js} +87 -85
  229. package/chunks/{settings-CSYVIP2R.js → settings-WCVB34HW.js} +48 -47
  230. package/chunks/{shell-EGTSUO2P.js → shell-33BIUBLH.js} +42 -41
  231. package/chunks/{skill-IFUD72GF.js → skill-IYVQ2QNK.js} +20 -18
  232. package/chunks/{skill-settings-YOE7LBHE.js → skill-settings-YG4ZS4OZ.js} +48 -47
  233. package/chunks/{spawnChannel-PQSZIOLY.js → spawnChannel-BLA4YT4W.js} +44 -43
  234. package/chunks/{standalone-update-RB2EGUSF.js → standalone-update-ALRIPWSM.js} +44 -43
  235. package/chunks/{startInteractiveUI-KMYUJ2MU.js → startInteractiveUI-PISBXWKA.js} +614 -294
  236. package/chunks/{syntheticOutput-DVHJMUGV.js → syntheticOutput-7GWFIDXT.js} +3 -3
  237. package/chunks/{task-create-4NC7PDI4.js → task-create-EILHJJB7.js} +11 -11
  238. package/chunks/{task-list-LBSRMOC7.js → task-list-WGJR6YL5.js} +21 -7
  239. package/chunks/{task-stop-YFNATTIM.js → task-stop-X37KYTKB.js} +2 -2
  240. package/chunks/{task-update-BPLM52GD.js → task-update-XZAHVXJ5.js} +86 -15
  241. package/chunks/{team-create-B6A6MJBT.js → team-create-CIQDCC6A.js} +43 -43
  242. package/chunks/{team-delete-MKYMYBFM.js → team-delete-UEP4QOOT.js} +6 -6
  243. package/chunks/{team-plan-approval-5WO3CXXU.js → team-plan-approval-664XCRB4.js} +42 -41
  244. package/chunks/{terminal-image-renderer-BTRE2GEU.js → terminal-image-renderer-TEBO6ONY.js} +44 -43
  245. package/chunks/theme-manager-3CIFH2JV.js +90 -0
  246. package/chunks/{todoWrite-K5K7NRE5.js → todoWrite-ATS62CAP.js} +4 -4
  247. package/chunks/{tool-search-QNBLXUGR.js → tool-search-IJX5JHJB.js} +19 -17
  248. package/chunks/{total-session-admission-N4E5SFBO.js → total-session-admission-XBK2NVRV.js} +46 -45
  249. package/chunks/{trustedFolders-MQS46LIU.js → trustedFolders-OOFNLRWK.js} +43 -42
  250. package/chunks/{update-relaunch-536KRL33.js → update-relaunch-EIG7EYAQ.js} +5 -5
  251. package/chunks/{updateCheck-QJI2SYWF.js → updateCheck-KYDCBLSF.js} +46 -45
  252. package/chunks/{useAutoAcceptIndicator-7QASHD46.js → useAutoAcceptIndicator-RFX3KNBN.js} +52 -51
  253. package/chunks/{validateNonInterActiveAuth-ZNRGWBLV.js → validateNonInterActiveAuth-MZXSAITU.js} +83 -81
  254. package/chunks/{version-DBEQAFRW.js → version-PJC6ZNXV.js} +1 -1
  255. package/chunks/{web-fetch-MBIVXKPE.js → web-fetch-XXICVGKQ.js} +21 -18
  256. package/chunks/{web-search-4LBIN6VF.js → web-search-LHPM6QWC.js} +9 -9
  257. package/chunks/{workflow-LNMA55HY.js → workflow-4CUO2BV7.js} +159 -57
  258. package/chunks/workspace-providers-status-G4MUGH3X.js +101 -0
  259. package/chunks/{workspace-registration-store-BGRKKIYR.js → workspace-registration-store-QMDMFWBE.js} +2 -2
  260. package/chunks/{workspace-registry-L4NCJ34K.js → workspace-registry-FKBB4MZK.js} +48 -46
  261. package/chunks/{workspace-service-LOXYKYTR.js → workspace-service-TIDTTA65.js} +55 -54
  262. package/chunks/workspace-skills-status-LBC2TZKM.js +101 -0
  263. package/chunks/{workspace-trust-reconciler-H36TCR2S.js → workspace-trust-reconciler-4KJ567XP.js} +58 -56
  264. package/chunks/{write-file-JJAY7JSP.js → write-file-R6LAEER5.js} +42 -41
  265. package/chunks/{zh-TW-SQ4HTSCW.js → zh-TW-LVLBK4KF.js} +8 -0
  266. package/chunks/{zh-LMSTK4WD.js → zh-UBMWS2BJ.js} +8 -0
  267. package/chunks/{zoom-image-4MVVVM7E.js → zoom-image-XLCK6DDK.js} +20 -17
  268. package/cli.js +13 -13
  269. package/locales/ca.js +13 -0
  270. package/locales/de.js +12 -0
  271. package/locales/en.js +11 -0
  272. package/locales/fr.js +13 -0
  273. package/locales/ja.js +13 -0
  274. package/locales/pt.js +12 -0
  275. package/locales/ru.js +12 -0
  276. package/locales/zh-TW.js +11 -0
  277. package/locales/zh.js +11 -0
  278. package/package.json +3 -3
  279. package/web-shell/assets/{arc-B-89zHN4.js → arc-DItbX0DI.js} +1 -1
  280. package/web-shell/assets/{architectureDiagram-3BPJPVTR-BkcOncHk.js → architectureDiagram-3BPJPVTR-CmnIlH8y.js} +1 -1
  281. package/web-shell/assets/{blockDiagram-GPEHLZMM-DQ4yboaF.js → blockDiagram-GPEHLZMM-pObnB9kw.js} +1 -1
  282. package/web-shell/assets/{c4Diagram-AAUBKEIU-C_8ZjPDI.js → c4Diagram-AAUBKEIU-BNBmMS0Y.js} +1 -1
  283. package/web-shell/assets/channel-hZnMfWA9.js +1 -0
  284. package/web-shell/assets/{chunk-2J33WTMH-naKVe1Bm.js → chunk-2J33WTMH-Dz4JBOO6.js} +1 -1
  285. package/web-shell/assets/{chunk-4BX2VUAB-DdoViKT2.js → chunk-4BX2VUAB-Cz2GnvAR.js} +1 -1
  286. package/web-shell/assets/{chunk-55IACEB6-DUDQZEwU.js → chunk-55IACEB6-CC6kOQYx.js} +1 -1
  287. package/web-shell/assets/{chunk-727SXJPM-BqpDTR5s.js → chunk-727SXJPM-Z4lY4gbh.js} +1 -1
  288. package/web-shell/assets/{chunk-AQP2D5EJ-CdmEknkT.js → chunk-AQP2D5EJ-Yz0hZr3D.js} +1 -1
  289. package/web-shell/assets/{chunk-FMBD7UC4-CH7fFTLB.js → chunk-FMBD7UC4-nKmTWTv9.js} +1 -1
  290. package/web-shell/assets/{chunk-ND2GUHAM-ObgSuFKF.js → chunk-ND2GUHAM-CjZz0f6Y.js} +1 -1
  291. package/web-shell/assets/{chunk-QZHKN3VN-D9fKdv_s.js → chunk-QZHKN3VN-Bab3FpuS.js} +1 -1
  292. package/web-shell/assets/classDiagram-4FO5ZUOK-BRnxm8DX.js +1 -0
  293. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-BRnxm8DX.js +1 -0
  294. package/web-shell/assets/{cose-bilkent-S5V4N54A-CvzATMx9.js → cose-bilkent-S5V4N54A-BuSAGFox.js} +1 -1
  295. package/web-shell/assets/{dagre-BM42HDAG-M_xU21QW.js → dagre-BM42HDAG-CRZXTg3g.js} +1 -1
  296. package/web-shell/assets/{diagram-2AECGRRQ-CNrl9sW1.js → diagram-2AECGRRQ-BFx1Ayrz.js} +1 -1
  297. package/web-shell/assets/{diagram-5GNKFQAL-CUweVT6T.js → diagram-5GNKFQAL-B2hMZ3gS.js} +1 -1
  298. package/web-shell/assets/{diagram-KO2AKTUF-D3n6Lxjo.js → diagram-KO2AKTUF-DKxAQLmc.js} +1 -1
  299. package/web-shell/assets/{diagram-LMA3HP47-0SeFPK4t.js → diagram-LMA3HP47-Bo1xGqVY.js} +1 -1
  300. package/web-shell/assets/{diagram-OG6HWLK6-DAgyEwge.js → diagram-OG6HWLK6-B9NG78d-.js} +1 -1
  301. package/web-shell/assets/{erDiagram-TEJ5UH35-CzxBBDIK.js → erDiagram-TEJ5UH35-DltQKiqQ.js} +1 -1
  302. package/web-shell/assets/{flowDiagram-I6XJVG4X-B0uj0jyo.js → flowDiagram-I6XJVG4X-5xXGmS4I.js} +1 -1
  303. package/web-shell/assets/{ganttDiagram-6RSMTGT7-DFzcj5km.js → ganttDiagram-6RSMTGT7-bhGL5n0l.js} +1 -1
  304. package/web-shell/assets/{gitGraphDiagram-PVQCEYII-DylJ_Fc9.js → gitGraphDiagram-PVQCEYII-ZYnz9hgh.js} +1 -1
  305. package/web-shell/assets/{index-BKSAnXU9.js → index-CBBeUArD.js} +1 -1
  306. package/web-shell/assets/index-CbgU-jUo.css +5 -0
  307. package/web-shell/assets/index-_nhzXqab.js +1750 -0
  308. package/web-shell/assets/{infoDiagram-5YYISTIA-BYMcJVMI.js → infoDiagram-5YYISTIA-Cg-jamQf.js} +1 -1
  309. package/web-shell/assets/{ishikawaDiagram-YF4QCWOH-t1quI1S3.js → ishikawaDiagram-YF4QCWOH-CcmvKlyq.js} +1 -1
  310. package/web-shell/assets/{journeyDiagram-JHISSGLW-YM_QVUJm.js → journeyDiagram-JHISSGLW-BRsOQZp1.js} +1 -1
  311. package/web-shell/assets/{kanban-definition-UN3LZRKU-jw8OddK1.js → kanban-definition-UN3LZRKU-xW-dmEHK.js} +1 -1
  312. package/web-shell/assets/{linear-Dlr3RVuP.js → linear-ClBfEZH2.js} +1 -1
  313. package/web-shell/assets/{mermaid.core-CqGKzNzd.js → mermaid.core-D65NDkzc.js} +5 -5
  314. package/web-shell/assets/{mindmap-definition-RKZ34NQL-BqureoOS.js → mindmap-definition-RKZ34NQL-CyvFslYa.js} +1 -1
  315. package/web-shell/assets/{pieDiagram-4H26LBE5-Da20HkK1.js → pieDiagram-4H26LBE5-BwSefMyG.js} +1 -1
  316. package/web-shell/assets/{quadrantDiagram-W4KKPZXB-BsNlMvJy.js → quadrantDiagram-W4KKPZXB-GqBJspFS.js} +1 -1
  317. package/web-shell/assets/{requirementDiagram-4Y6WPE33-DzVCQCse.js → requirementDiagram-4Y6WPE33-B137PlTJ.js} +1 -1
  318. package/web-shell/assets/{sankeyDiagram-5OEKKPKP-BMo16voT.js → sankeyDiagram-5OEKKPKP-maHkkt8i.js} +1 -1
  319. package/web-shell/assets/{sequenceDiagram-3UESZ5HK-Bgi-pdHk.js → sequenceDiagram-3UESZ5HK-DJ1mRaG3.js} +1 -1
  320. package/web-shell/assets/{stateDiagram-AJRCARHV-xaPQXwGk.js → stateDiagram-AJRCARHV-aRmP7Q4i.js} +1 -1
  321. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-Db39gvZ_.js +1 -0
  322. package/web-shell/assets/{timeline-definition-PNZ67QCA-C_9RuvKG.js → timeline-definition-PNZ67QCA-CIQ3BRPA.js} +1 -1
  323. package/web-shell/assets/{vennDiagram-CIIHVFJN-Bgu6vdla.js → vennDiagram-CIIHVFJN-DR9VPd5h.js} +1 -1
  324. package/web-shell/assets/{wardley-L42UT6IY-CFTZ8IrX.js → wardley-L42UT6IY-ZcfIbT4D.js} +1 -1
  325. package/web-shell/assets/{wardleyDiagram-YWT4CUSO-BASW9Vmt.js → wardleyDiagram-YWT4CUSO-D0jgPi4T.js} +1 -1
  326. package/web-shell/assets/{xychartDiagram-2RQKCTM6--Nh-CD3F.js → xychartDiagram-2RQKCTM6-BGWU4s5o.js} +1 -1
  327. package/web-shell/index.html +2 -2
  328. package/chunks/agent-headless-OEQNFOMH.js +0 -87
  329. package/chunks/chunk-DEDESZDL.js +0 -358
  330. package/chunks/chunk-MPHPFVKK.js +0 -48
  331. package/chunks/chunk-UI5UGEF4.js +0 -3576
  332. package/chunks/daemon-status-provider-QYM57Z44.js +0 -102
  333. package/chunks/daemon-trust-policy-TSRVEYZR.js +0 -99
  334. package/chunks/discovery-XLHITE74.js +0 -220
  335. package/chunks/exitPlanMode-WDURQMIU.js +0 -85
  336. package/chunks/handleAutoUpdate-GN7Z6QAC.js +0 -94
  337. package/chunks/initializer-UA6KQ7MS.js +0 -100
  338. package/chunks/list-GRAMIQOT.js +0 -103
  339. package/chunks/loadedSettingsAdapter-5O2TDS3I.js +0 -97
  340. package/chunks/mcp-XLP33CAI.js +0 -97
  341. package/chunks/nonInteractiveCli-KTA5K6FS.js +0 -163
  342. package/chunks/ripGrep-ZJSHKB6H.js +0 -85
  343. package/chunks/theme-manager-XL2N5SBY.js +0 -89
  344. package/chunks/workspace-providers-status-PDDMI6ST.js +0 -100
  345. package/chunks/workspace-skills-status-IJ5FOQI6.js +0 -100
  346. package/web-shell/assets/channel-Du2WFns8.js +0 -1
  347. package/web-shell/assets/classDiagram-4FO5ZUOK-Zw0HafH6.js +0 -1
  348. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-Zw0HafH6.js +0 -1
  349. package/web-shell/assets/index-BIGQygTL.css +0 -5
  350. package/web-shell/assets/index-J7OMTqAN.js +0 -1789
  351. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-D5RqimXD.js +0 -1
  352. package/chunks/{chunk-SYHXR6WM.js → chunk-4W5U2TUT.js} +3 -3
  353. /package/chunks/{chunk-NTTBXH7U.js → chunk-UGK4K2N2.js} +0 -0
@@ -728,6 +728,10 @@ function isDaemonTurnError(error) {
728
728
  return typeof error === "object" && error !== null && error._daemonTurnError === true;
729
729
  }
730
730
  __name(isDaemonTurnError, "isDaemonTurnError");
731
+ function isStaleBranchPointError(error) {
732
+ return error instanceof DaemonHttpError && error.status === 409 && error.body?.code === "branch_point_invalid";
733
+ }
734
+ __name(isStaleBranchPointError, "isStaleBranchPointError");
731
735
  var DaemonClient = class {
732
736
  static {
733
737
  __name(this, "DaemonClient");
@@ -2194,6 +2198,22 @@ var DaemonClient = class {
2194
2198
  "GET /workspace/sessions"
2195
2199
  );
2196
2200
  }
2201
+ /**
2202
+ * Read the memory-only live-state snapshot for a workspace via
2203
+ * `GET /workspaces/:workspace/sessions/live-state`: the complete set of
2204
+ * live sessions with volatile state plus the in-memory catalog version
2205
+ * equality token. Always uses native REST transport (never the pluggable
2206
+ * ACP transport).
2207
+ *
2208
+ * This method deliberately does not pre-flight
2209
+ * `requireCapability('workspace_session_live_state')` — a capability
2210
+ * probe on every poll would double request volume. Consumers preflight
2211
+ * the capability once from their already-loaded capabilities and fall
2212
+ * back to the full session catalog when it is absent.
2213
+ */
2214
+ getWorkspaceSessionLiveState(workspaceCwd, opts = {}) {
2215
+ return this.workspaceByCwd(workspaceCwd).getSessionLiveState(opts);
2216
+ }
2197
2217
  async listSessionGroups(workspaceCwd) {
2198
2218
  return await this.jsonRequest(
2199
2219
  `/workspace/${urlEncode(workspaceCwd)}/session-groups`,
@@ -2274,7 +2294,8 @@ var DaemonClient = class {
2274
2294
  method: "POST",
2275
2295
  headers: this.headers({ "Content-Type": "application/json" }, clientId),
2276
2296
  body: JSON.stringify({
2277
- ...req.name !== void 0 ? { name: req.name } : {}
2297
+ name: req.name,
2298
+ ..."atRecordId" in req ? { atRecordId: req.atRecordId } : {}
2278
2299
  })
2279
2300
  },
2280
2301
  async (res) => {
@@ -2282,7 +2303,8 @@ var DaemonClient = class {
2282
2303
  throw await this.failOnError(res, "POST /session/:id/branch");
2283
2304
  }
2284
2305
  return await res.json();
2285
- }
2306
+ },
2307
+ 12e4
2286
2308
  );
2287
2309
  }
2288
2310
  async createSideTaskSession(sessionId, req = {}, clientId) {
@@ -2638,11 +2660,76 @@ var DaemonClient = class {
2638
2660
  if (!res.ok) throw await this.failOnError(res, "POST /session/:id/btw");
2639
2661
  return await res.json();
2640
2662
  }
2663
+ async uploadSessionMedia(sessionId, data, mimeType, opts) {
2664
+ return await this.fetchWithTimeout(
2665
+ `${this.baseUrl}/session/${urlEncode(sessionId)}/media`,
2666
+ {
2667
+ method: "POST",
2668
+ headers: this.headers({ "Content-Type": mimeType }, opts?.clientId),
2669
+ body: data,
2670
+ signal: opts?.signal
2671
+ },
2672
+ async (res) => {
2673
+ if (!res.ok) {
2674
+ throw await this.failOnError(res, "POST /session/:id/media");
2675
+ }
2676
+ return await res.json();
2677
+ }
2678
+ );
2679
+ }
2680
+ async readSessionMedia(sessionId, mediaId, opts) {
2681
+ return await this.fetchWithTimeout(
2682
+ `${this.baseUrl}/session/${urlEncode(sessionId)}/media/${urlEncode(mediaId)}`,
2683
+ {
2684
+ method: "GET",
2685
+ headers: this.headers({}, opts?.clientId),
2686
+ signal: opts?.signal
2687
+ },
2688
+ async (res) => {
2689
+ if (!res.ok) {
2690
+ throw await this.failOnError(res, "GET /session/:id/media/:mediaId");
2691
+ }
2692
+ const bytes = new Uint8Array(await res.arrayBuffer());
2693
+ let binary = "";
2694
+ for (let offset = 0; offset < bytes.length; offset += 32768) {
2695
+ binary += String.fromCharCode(
2696
+ ...bytes.subarray(offset, offset + 32768)
2697
+ );
2698
+ }
2699
+ return {
2700
+ data: btoa(binary),
2701
+ mimeType: res.headers.get("content-type") ?? "application/octet-stream"
2702
+ };
2703
+ }
2704
+ );
2705
+ }
2706
+ async removeSessionMedia(sessionId, mediaId, opts) {
2707
+ return await this.fetchWithTimeout(
2708
+ `${this.baseUrl}/session/${urlEncode(sessionId)}/media/${urlEncode(mediaId)}`,
2709
+ {
2710
+ method: "DELETE",
2711
+ headers: this.headers({}, opts?.clientId),
2712
+ signal: opts?.signal
2713
+ },
2714
+ async (res) => {
2715
+ if (!res.ok) {
2716
+ throw await this.failOnError(
2717
+ res,
2718
+ "DELETE /session/:id/media/:mediaId"
2719
+ );
2720
+ }
2721
+ return (await res.json()).removed === true;
2722
+ }
2723
+ );
2724
+ }
2641
2725
  /**
2642
2726
  * Queue a user message typed while the session's turn is still running. The
2643
2727
  * ACP child drains it between tool batches so the model sees it before the
2644
2728
  * turn ends. Every accepted request is daemon-owned; a caller-supplied id
2645
- * makes ambiguous retries idempotent.
2729
+ * makes ambiguous retries idempotent. `opts.content` carries media content
2730
+ * image blocks alongside the text — pre-flight the
2731
+ * `session_media` capability; older daemons ignore the
2732
+ * field and drop the media.
2646
2733
  */
2647
2734
  async enqueueMidTurnMessage(sessionId, message, opts) {
2648
2735
  return await this.fetchWithTimeout(
@@ -2653,7 +2740,11 @@ var DaemonClient = class {
2653
2740
  { "Content-Type": "application/json" },
2654
2741
  opts?.clientId
2655
2742
  ),
2656
- body: JSON.stringify({ message, messageId: opts?.messageId }),
2743
+ body: JSON.stringify({
2744
+ message,
2745
+ messageId: opts?.messageId,
2746
+ ...opts?.content && opts.content.length > 0 ? { content: opts.content } : {}
2747
+ }),
2657
2748
  signal: opts?.signal
2658
2749
  },
2659
2750
  async (res) => {
@@ -4589,6 +4680,26 @@ var WorkspaceDaemonClient = class {
4589
4680
  getWorkspaceSessionInfo() {
4590
4681
  return this.get("/session-info", "GET /workspaces/:workspace/session-info");
4591
4682
  }
4683
+ /**
4684
+ * Read the memory-only live-state snapshot for this workspace: the
4685
+ * complete set of live sessions with volatile state plus the in-memory
4686
+ * catalog version equality token. Always uses native REST transport
4687
+ * (never the pluggable ACP transport).
4688
+ *
4689
+ * This method deliberately does not pre-flight
4690
+ * `requireCapability('workspace_session_live_state')` — a capability
4691
+ * probe on every poll would double request volume. Consumers preflight
4692
+ * the capability once from their already-loaded capabilities and fall
4693
+ * back to the full session catalog when it is absent.
4694
+ */
4695
+ getSessionLiveState(opts = {}) {
4696
+ return this.client.workspaceJsonRequest(
4697
+ this.workspaceSelector,
4698
+ "/sessions/live-state",
4699
+ "GET /workspaces/:workspace/sessions/live-state",
4700
+ { clientId: opts.clientId, timeoutMs: opts.timeoutMs, mode: "rest" }
4701
+ );
4702
+ }
4592
4703
  /**
4593
4704
  * Read one page from an active persisted session transcript in this
4594
4705
  * workspace.
@@ -4619,6 +4730,14 @@ var WorkspaceDaemonClient = class {
4619
4730
  opts
4620
4731
  );
4621
4732
  }
4733
+ updateSessionMetadata(sessionId, metadata, clientId) {
4734
+ return this.client.workspaceJsonRequest(
4735
+ this.workspaceSelector,
4736
+ `/session/${urlEncode(sessionId)}/metadata`,
4737
+ "PATCH /workspaces/:workspace/session/:id/metadata",
4738
+ { method: "PATCH", body: metadata, clientId, mode: "rest" }
4739
+ );
4740
+ }
4622
4741
  listSessionGroups() {
4623
4742
  return this.get(
4624
4743
  "/session-groups",
@@ -4941,7 +5060,17 @@ function matchTurnEvent(event, promptId) {
4941
5060
  if (event.type === "turn_complete") {
4942
5061
  const data = event.data;
4943
5062
  if (data.promptId === promptId) {
4944
- return { stopReason: data.stopReason ?? "end_turn" };
5063
+ const stopReason = data.stopReason ?? "end_turn";
5064
+ const candidate = data.branchPoint;
5065
+ const recordUuidPattern = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
5066
+ const branchPoint = stopReason === "end_turn" && typeof candidate?.assistantRecordUuid === "string" && recordUuidPattern.test(candidate.assistantRecordUuid) && typeof candidate.checkpointUuid === "string" && recordUuidPattern.test(candidate.checkpointUuid) ? {
5067
+ assistantRecordUuid: candidate.assistantRecordUuid,
5068
+ checkpointUuid: candidate.checkpointUuid
5069
+ } : void 0;
5070
+ return {
5071
+ stopReason,
5072
+ ...branchPoint ? { branchPoint } : {}
5073
+ };
4945
5074
  }
4946
5075
  }
4947
5076
  if (event.type === "turn_error") {
@@ -4967,6 +5096,14 @@ __name(isNonBlockingAccepted, "isNonBlockingAccepted");
4967
5096
 
4968
5097
  // packages/sdk-typescript/src/daemon/DaemonSessionClient.ts
4969
5098
  init_esbuild_shims();
5099
+ function isSessionMediaReference(value) {
5100
+ if (!value || typeof value !== "object" || Array.isArray(value)) return false;
5101
+ const record = value;
5102
+ return record["type"] === "image" && typeof record["mediaId"] === "string" && record["mediaId"].length > 0 && typeof record["mimeType"] === "string" && record["mimeType"].startsWith(`${record["type"]}/`) && typeof record["size"] === "number" && Number.isSafeInteger(record["size"]) && record["size"] > 0;
5103
+ }
5104
+ __name(isSessionMediaReference, "isSessionMediaReference");
5105
+ var MAX_MEDIA_CACHE_BYTES = 32 * 1024 * 1024;
5106
+ var MAX_MEDIA_CACHE_ENTRIES = 128;
4970
5107
  var DaemonSessionClient = class _DaemonSessionClient {
4971
5108
  static {
4972
5109
  __name(this, "DaemonSessionClient");
@@ -5008,6 +5145,8 @@ var DaemonSessionClient = class _DaemonSessionClient {
5008
5145
  reattaching;
5009
5146
  cancelling;
5010
5147
  promptLimit;
5148
+ mediaCache = /* @__PURE__ */ new Map();
5149
+ mediaCacheBytes = 0;
5011
5150
  _pendingPrompts = /* @__PURE__ */ new Map();
5012
5151
  constructor(opts) {
5013
5152
  this.client = opts.client;
@@ -5067,7 +5206,7 @@ var DaemonSessionClient = class _DaemonSessionClient {
5067
5206
  eventEpoch,
5068
5207
  ...session
5069
5208
  } = restored;
5070
- return new _DaemonSessionClient({
5209
+ const result = new _DaemonSessionClient({
5071
5210
  client,
5072
5211
  session,
5073
5212
  hasActivePrompt,
@@ -5085,6 +5224,8 @@ var DaemonSessionClient = class _DaemonSessionClient {
5085
5224
  historyAnchorRecordId,
5086
5225
  replayDegraded
5087
5226
  });
5227
+ await result.hydrateReplaySnapshot();
5228
+ return result;
5088
5229
  }
5089
5230
  /**
5090
5231
  * Resumes an existing daemon session without requesting history replay.
@@ -5217,6 +5358,29 @@ var DaemonSessionClient = class _DaemonSessionClient {
5217
5358
  }
5218
5359
  return accepted;
5219
5360
  }
5361
+ async uploadMedia(data, mimeType, signal) {
5362
+ return await this.withClientIdSelfHeal(
5363
+ () => this.client.uploadSessionMedia(this.sessionId, data, mimeType, {
5364
+ ...signal ? { signal } : {},
5365
+ ...this.clientId ? { clientId: this.clientId } : {}
5366
+ })
5367
+ );
5368
+ }
5369
+ async removeMedia(mediaId) {
5370
+ const removed = await this.withClientIdSelfHeal(
5371
+ () => this.client.removeSessionMedia(
5372
+ this.sessionId,
5373
+ mediaId,
5374
+ this.clientId ? { clientId: this.clientId } : void 0
5375
+ )
5376
+ );
5377
+ if (removed) {
5378
+ const cached = this.mediaCache.get(mediaId);
5379
+ this.mediaCache.delete(mediaId);
5380
+ this.mediaCacheBytes -= cached?.size ?? 0;
5381
+ }
5382
+ return removed;
5383
+ }
5220
5384
  /**
5221
5385
  * Run a prompt-admission call, recovering from a stale `clientId`.
5222
5386
  *
@@ -5361,6 +5525,7 @@ var DaemonSessionClient = class _DaemonSessionClient {
5361
5525
  return await this.client.enqueueMidTurnMessage(this.sessionId, message, {
5362
5526
  ...opts?.signal ? { signal: opts.signal } : {},
5363
5527
  ...opts?.messageId ? { messageId: opts.messageId } : {},
5528
+ ...opts?.content && opts.content.length > 0 ? { content: opts.content } : {},
5364
5529
  ...this.clientId ? { clientId: this.clientId } : {}
5365
5530
  });
5366
5531
  }
@@ -5377,15 +5542,44 @@ var DaemonSessionClient = class _DaemonSessionClient {
5377
5542
  * callers preserve their current state.
5378
5543
  */
5379
5544
  async getMidTurnMessages(opts) {
5380
- return await this.client.getMidTurnMessages(this.sessionId, {
5545
+ const result = await this.client.getMidTurnMessages(this.sessionId, {
5381
5546
  ...opts?.signal ? { signal: opts.signal } : {},
5382
5547
  ...this.clientId ? { clientId: this.clientId } : {}
5383
5548
  });
5549
+ return {
5550
+ ...result,
5551
+ messages: await Promise.all(
5552
+ result.messages.map(async (message) => ({
5553
+ ...message,
5554
+ ...message.content ? { content: await this.hydrateContent(message.content) } : {}
5555
+ }))
5556
+ )
5557
+ };
5384
5558
  }
5385
5559
  async getPendingPrompts() {
5386
- return await this.client.getPendingPrompts(this.sessionId, {
5560
+ const result = await this.client.getPendingPrompts(this.sessionId, {
5387
5561
  ...this.clientId ? { clientId: this.clientId } : {}
5388
5562
  });
5563
+ return {
5564
+ pendingPrompts: await Promise.all(
5565
+ result.pendingPrompts.map(async (prompt) => ({
5566
+ ...prompt,
5567
+ ...prompt.content ? { content: await this.hydrateContent(prompt.content) } : {}
5568
+ }))
5569
+ )
5570
+ };
5571
+ }
5572
+ async getTranscriptPage(opts = {}) {
5573
+ const page = await this.client.getSessionTranscriptPage(this.sessionId, {
5574
+ ...opts,
5575
+ clientId: opts.clientId ?? this.clientId
5576
+ });
5577
+ return {
5578
+ ...page,
5579
+ events: await Promise.all(
5580
+ page.events.map(async (event) => await this.hydrateEvent(event))
5581
+ )
5582
+ };
5389
5583
  }
5390
5584
  async removePendingPrompt(promptId) {
5391
5585
  return await this.client.removePendingPrompt(this.sessionId, promptId, {
@@ -5565,8 +5759,9 @@ var DaemonSessionClient = class _DaemonSessionClient {
5565
5759
  callerOnEpoch?.(learned);
5566
5760
  }, "onEpoch")
5567
5761
  })) {
5568
- this._dispatchTurnEvent(event);
5569
- yield event;
5762
+ const hydratedEvent = await this.hydrateEvent(event);
5763
+ this._dispatchTurnEvent(hydratedEvent);
5764
+ yield hydratedEvent;
5570
5765
  if (event.id !== void 0) {
5571
5766
  this.lastSeenEventId = Math.max(
5572
5767
  this.lastSeenEventId ?? 0,
@@ -5579,6 +5774,107 @@ var DaemonSessionClient = class _DaemonSessionClient {
5579
5774
  release();
5580
5775
  }
5581
5776
  }
5777
+ async hydrateReplaySnapshot() {
5778
+ this.replaySnapshot.compactedReplay = await Promise.all(
5779
+ this.replaySnapshot.compactedReplay.map(
5780
+ async (event) => await this.hydrateEvent(event)
5781
+ )
5782
+ );
5783
+ this.replaySnapshot.liveJournal = await Promise.all(
5784
+ this.replaySnapshot.liveJournal.map(
5785
+ async (event) => await this.hydrateEvent(event)
5786
+ )
5787
+ );
5788
+ }
5789
+ async hydrateEvent(event) {
5790
+ if (!event.data || typeof event.data !== "object") return event;
5791
+ const data = event.data;
5792
+ if (event.type === "session_update") {
5793
+ const update = data["update"];
5794
+ if (update && typeof update === "object" && !Array.isArray(update)) {
5795
+ const content2 = update["content"];
5796
+ const hydrated2 = await this.hydrateBlock(content2);
5797
+ if (hydrated2 === content2) return event;
5798
+ return {
5799
+ ...event,
5800
+ data: { ...data, update: { ...update, content: hydrated2 } }
5801
+ };
5802
+ }
5803
+ const content = data["content"];
5804
+ const hydrated = await this.hydrateBlock(content);
5805
+ if (hydrated === content) return event;
5806
+ return { ...event, data: { ...data, content: hydrated } };
5807
+ }
5808
+ if (event.type !== "mid_turn_message_injected") return event;
5809
+ const items = data["items"];
5810
+ if (!Array.isArray(items)) return event;
5811
+ return {
5812
+ ...event,
5813
+ data: {
5814
+ ...data,
5815
+ items: await Promise.all(
5816
+ items.map(async (item) => {
5817
+ if (!item || typeof item !== "object" || Array.isArray(item)) {
5818
+ return item;
5819
+ }
5820
+ const record = item;
5821
+ return Array.isArray(record["content"]) ? {
5822
+ ...record,
5823
+ content: await this.hydrateContent(record["content"])
5824
+ } : item;
5825
+ })
5826
+ )
5827
+ }
5828
+ };
5829
+ }
5830
+ async hydrateContent(content) {
5831
+ return await Promise.all(
5832
+ content.map(async (block) => await this.hydrateBlock(block))
5833
+ );
5834
+ }
5835
+ async hydrateBlock(block) {
5836
+ if (!isSessionMediaReference(block)) {
5837
+ return block;
5838
+ }
5839
+ let cached = this.mediaCache.get(block.mediaId);
5840
+ if (cached) {
5841
+ this.mediaCache.delete(block.mediaId);
5842
+ this.mediaCache.set(block.mediaId, cached);
5843
+ } else {
5844
+ const pending = this.withClientIdSelfHeal(
5845
+ () => this.client.readSessionMedia(this.sessionId, block.mediaId, {
5846
+ ...this.clientId ? { clientId: this.clientId } : {}
5847
+ })
5848
+ );
5849
+ cached = { pending, size: block.size };
5850
+ this.mediaCache.set(block.mediaId, cached);
5851
+ this.mediaCacheBytes += block.size;
5852
+ while (this.mediaCache.size > MAX_MEDIA_CACHE_ENTRIES || this.mediaCacheBytes > MAX_MEDIA_CACHE_BYTES) {
5853
+ const oldestId = this.mediaCache.keys().next().value;
5854
+ if (oldestId === void 0) break;
5855
+ const evicted = this.mediaCache.get(oldestId);
5856
+ this.mediaCache.delete(oldestId);
5857
+ this.mediaCacheBytes -= evicted?.size ?? 0;
5858
+ }
5859
+ void pending.catch(() => {
5860
+ if (this.mediaCache.get(block.mediaId)?.pending !== pending) return;
5861
+ this.mediaCache.delete(block.mediaId);
5862
+ this.mediaCacheBytes -= block.size;
5863
+ });
5864
+ }
5865
+ try {
5866
+ const media = await cached.pending;
5867
+ return { type: block.type, data: media.data, mimeType: media.mimeType };
5868
+ } catch (err) {
5869
+ if (err instanceof DaemonHttpError && (err.status === 404 || err.status === 410)) {
5870
+ return {
5871
+ type: "text",
5872
+ text: "[Attached media is no longer available]"
5873
+ };
5874
+ }
5875
+ return block;
5876
+ }
5877
+ }
5582
5878
  _dispatchTurnEvent(event) {
5583
5879
  if (event.type !== "turn_complete" && event.type !== "turn_error") return;
5584
5880
  const promptId = event.data?.promptId;
@@ -5915,7 +6211,7 @@ function asKnownDaemonEvent(event) {
5915
6211
  case "tool_toggled":
5916
6212
  return isToolToggledData(event.data) ? event : void 0;
5917
6213
  case "settings_changed":
5918
- return event.data != null && typeof event.data === "object" ? event : void 0;
6214
+ return isSettingsChangedData(event.data) ? event : void 0;
5919
6215
  case "trust_change_requested":
5920
6216
  return isTrustChangeRequestedData(event.data) ? event : void 0;
5921
6217
  case "workspace_initialized":
@@ -6617,6 +6913,19 @@ function isToolToggledData(value) {
6617
6913
  return isRecord(value) && isNonEmptyString(value["toolName"]) && typeof value["enabled"] === "boolean";
6618
6914
  }
6619
6915
  __name(isToolToggledData, "isToolToggledData");
6916
+ function isDaemonSkillToggleMutation(value) {
6917
+ if (!isRecord(value)) return false;
6918
+ const activation = value["activation"];
6919
+ const skills = value["skills"];
6920
+ return isNonEmptyString(value["id"]) && value["kind"] === "skill_toggle" && Array.isArray(skills) && skills.length > 0 && skills.every(
6921
+ (skill) => isRecord(skill) && isNonEmptyString(skill["name"]) && typeof skill["enabled"] === "boolean"
6922
+ ) && (activation === "applied" || activation === "deferred" || activation === "partial") && isFiniteNumber(value["sessionsRefreshed"]) && isFiniteNumber(value["sessionsFailed"]);
6923
+ }
6924
+ __name(isDaemonSkillToggleMutation, "isDaemonSkillToggleMutation");
6925
+ function isSettingsChangedData(value) {
6926
+ return isRecord(value) && isNonEmptyString(value["key"]) && (value["scope"] === void 0 || typeof value["scope"] === "string") && (value["mutation"] === void 0 || isDaemonSkillToggleMutation(value["mutation"]));
6927
+ }
6928
+ __name(isSettingsChangedData, "isSettingsChangedData");
6620
6929
  function isTrustChangeRequestedData(value) {
6621
6930
  if (!isRecord(value)) return false;
6622
6931
  const desiredState = value["desiredState"];
@@ -7061,6 +7370,7 @@ var MCP_RESTART_REFUSED_REASONS2 = /* @__PURE__ */ new Set([
7061
7370
  var MALFORMED_MEMORY_CHANGED = "malformed memory_changed payload";
7062
7371
  var MAX_DETAILS_LENGTH = 4096;
7063
7372
  var SESSION_RECORDING_DEGRADED_MESSAGE = "Session recording stopped after a write failure. New messages for the affected session will not be saved. Check disk space and permissions, then start a new session to resume recording.";
7373
+ var MEDIA_UNAVAILABLE_TEXT = "[Attached media is no longer available]";
7064
7374
  function normalizeDaemonEvent(event, opts = {}) {
7065
7375
  const base = createBase(event, opts);
7066
7376
  switch (event.type) {
@@ -7437,35 +7747,62 @@ function normalizeMidTurnMessageInjected(event, base) {
7437
7747
  if (!isRecord2(event.data)) {
7438
7748
  return fallbackDebug(event, base, "malformed mid_turn_message_injected");
7439
7749
  }
7440
- const messages = Array.isArray(event.data["messages"]) ? event.data["messages"].filter(
7441
- (message) => typeof message === "string" && message.length > 0
7442
- ) : [];
7443
- if (messages.length === 0) {
7750
+ const data = event.data;
7751
+ const rawMessages = data["messages"];
7752
+ const messages = Array.isArray(rawMessages) && rawMessages.every(
7753
+ (message) => typeof message === "string"
7754
+ ) ? rawMessages : [];
7755
+ const items = data["items"];
7756
+ const hasRenderableItemContent = Array.isArray(items) && items.some(
7757
+ (item) => isRecord2(item) && Array.isArray(item["content"]) && item["content"].some(
7758
+ (block) => isRecord2(block) && (block["type"] === "image" || block["type"] === "text" && typeof block["text"] === "string" && block["text"].length > 0)
7759
+ )
7760
+ );
7761
+ if (messages.length === 0 || !messages.some(Boolean) && !hasRenderableItemContent) {
7444
7762
  return fallbackDebug(event, base, "malformed mid_turn_message_injected");
7445
7763
  }
7446
- return [
7447
- {
7764
+ const messageIds = Array.isArray(data["messageIds"]) ? data["messageIds"] : [];
7765
+ return messages.map((text, index) => {
7766
+ const item = Array.isArray(items) ? items[index] : void 0;
7767
+ const messageId = messageIds[index];
7768
+ return {
7448
7769
  ...base,
7449
7770
  type: "status",
7450
- text: `Inserted message: ${messages.join("\n")}`,
7771
+ text,
7451
7772
  source: "mid_turn_message_injected",
7452
- data: event.data
7453
- }
7454
- ];
7773
+ data: {
7774
+ ...data,
7775
+ messages: [text],
7776
+ ...Array.isArray(items) ? { items: item !== void 0 ? [item] : [] } : {},
7777
+ ...typeof messageId === "string" ? { messageIds: [messageId] } : Array.isArray(data["messageIds"]) ? { messageIds: [] } : {}
7778
+ }
7779
+ };
7780
+ });
7455
7781
  }
7456
7782
  __name(normalizeMidTurnMessageInjected, "normalizeMidTurnMessageInjected");
7457
7783
  function createBase(event, opts) {
7458
7784
  const serverTimestamp = extractServerTimestamp(event);
7459
7785
  const sourceRecordIds = extractSourceRecordIds(event);
7786
+ const branchRecordId = extractBranchRecordId(event);
7460
7787
  return {
7461
7788
  ...event.id !== void 0 ? { eventId: event.id } : {},
7462
7789
  ...serverTimestamp !== void 0 ? { serverTimestamp } : {},
7463
7790
  ...sourceRecordIds ? { sourceRecordIds } : {},
7791
+ ...event.promptId ? { promptId: event.promptId } : {},
7792
+ ...branchRecordId ? { branchRecordId } : {},
7464
7793
  ...event.originatorClientId ? { originatorClientId: event.originatorClientId } : {},
7465
7794
  ...opts.includeRawEvent ? { rawEvent: { ...event, data: redactSensitiveFields(event.data) } } : {}
7466
7795
  };
7467
7796
  }
7468
7797
  __name(createBase, "createBase");
7798
+ function extractBranchRecordId(event) {
7799
+ if (!isRecord2(event.data)) return void 0;
7800
+ const update = getSessionUpdatePayload(event.data);
7801
+ const meta = update && isRecord2(update["_meta"]) ? update["_meta"] : void 0;
7802
+ const transcript = meta && isRecord2(meta["qwenTranscript"]) ? meta["qwenTranscript"] : void 0;
7803
+ return transcript ? getString2(transcript, "branchRecordId") : void 0;
7804
+ }
7805
+ __name(extractBranchRecordId, "extractBranchRecordId");
7469
7806
  function extractServerTimestamp(event) {
7470
7807
  const direct = event.serverTimestamp;
7471
7808
  if (typeof direct === "number" && Number.isFinite(direct)) return direct;
@@ -7513,6 +7850,10 @@ function parseTimestamp(value) {
7513
7850
  return Number.isFinite(parsed) ? parsed : void 0;
7514
7851
  }
7515
7852
  __name(parseTimestamp, "parseTimestamp");
7853
+ function isMediaReferenceContent(value) {
7854
+ return isRecord2(value) && value["type"] === "image" && typeof value["mediaId"] === "string" && value["mediaId"].length > 0 && value["data"] === void 0 && value["url"] === void 0 && value["source"] === void 0;
7855
+ }
7856
+ __name(isMediaReferenceContent, "isMediaReferenceContent");
7516
7857
  function normalizeSessionUpdate(event, base, opts) {
7517
7858
  const update = getSessionUpdatePayload(event.data);
7518
7859
  if (!update) {
@@ -7547,7 +7888,15 @@ function normalizeSessionUpdate(event, base, opts) {
7547
7888
  else if (prefix.startsWith("UklGR")) mimeType = "image/webp";
7548
7889
  }
7549
7890
  if (data) {
7550
- return [{ ...base, type: "user.image.delta", data, mimeType }];
7891
+ return [
7892
+ {
7893
+ ...base,
7894
+ type: "user.image.delta",
7895
+ data,
7896
+ mimeType,
7897
+ ...meta ? { meta } : {}
7898
+ }
7899
+ ];
7551
7900
  }
7552
7901
  return [];
7553
7902
  }
@@ -7563,6 +7912,16 @@ function normalizeSessionUpdate(event, base, opts) {
7563
7912
  }
7564
7913
  return [];
7565
7914
  }
7915
+ if (isMediaReferenceContent(content)) {
7916
+ return [
7917
+ {
7918
+ ...base,
7919
+ type: "user.text.delta",
7920
+ text: MEDIA_UNAVAILABLE_TEXT,
7921
+ ...meta ? { meta } : {}
7922
+ }
7923
+ ];
7924
+ }
7566
7925
  const text = getTextContent(content);
7567
7926
  return text ? [
7568
7927
  {
@@ -8101,13 +8460,15 @@ function normalizeSettingsChanged(event, base) {
8101
8460
  if (!key) {
8102
8461
  return fallbackDebug(event, base, "malformed settings_changed payload");
8103
8462
  }
8463
+ const mutation = isSettingsChangedData(event.data) && event.data.mutation;
8104
8464
  return [
8105
8465
  {
8106
8466
  ...base,
8107
8467
  type: "workspace.settings.changed",
8108
8468
  key,
8109
8469
  scope: scope ?? "workspace",
8110
- value: isRecord2(event.data) ? event.data["value"] : void 0
8470
+ value: isRecord2(event.data) ? event.data["value"] : void 0,
8471
+ ...mutation ? { mutation } : {}
8111
8472
  }
8112
8473
  ];
8113
8474
  }
@@ -8899,6 +9260,9 @@ function appendLocalUserTranscriptMessage(state, text, opts = {}) {
8899
9260
  if (opts.images && opts.images.length > 0) {
8900
9261
  block.images = [...opts.images];
8901
9262
  }
9263
+ if (opts.files && opts.files.length > 0) {
9264
+ block.files = [...opts.files];
9265
+ }
8902
9266
  appendBlock(next, block);
8903
9267
  next.activeUserBlockId = block.id;
8904
9268
  return trimTranscriptState(next);
@@ -8959,8 +9323,9 @@ function applyDaemonTranscriptEvent(next, event) {
8959
9323
  "",
8960
9324
  event.eventId,
8961
9325
  event.serverTimestamp,
8962
- void 0,
8963
- event.sourceRecordIds
9326
+ event.meta,
9327
+ event.sourceRecordIds,
9328
+ event.promptId
8964
9329
  );
8965
9330
  block.images = [{ data: event.data, mimeType: event.mimeType }];
8966
9331
  appendBlock(next, block);
@@ -8968,6 +9333,7 @@ function applyDaemonTranscriptEvent(next, event) {
8968
9333
  } else {
8969
9334
  const block = getWritableBlockById(next, next.activeUserBlockId);
8970
9335
  if (block && block.kind === "user") {
9336
+ if (event.meta) block.meta = { ...block.meta, ...event.meta };
8971
9337
  block.images = [
8972
9338
  ...block.images ?? [],
8973
9339
  { data: event.data, mimeType: event.mimeType }
@@ -8987,6 +9353,19 @@ function applyDaemonTranscriptEvent(next, event) {
8987
9353
  );
8988
9354
  break;
8989
9355
  case "assistant.done":
9356
+ if (event.branchRecordId && event.promptId && event.reason === "end_turn") {
9357
+ const assistant = getWritableBlockById(
9358
+ next,
9359
+ findFinalVisibleAssistantForPrompt(next, event.promptId)
9360
+ );
9361
+ if (assistant?.kind === "assistant") {
9362
+ assistant.branchRecordId = event.branchRecordId;
9363
+ assistant.sourceRecordIds = unionStrings(
9364
+ assistant.sourceRecordIds,
9365
+ event.sourceRecordIds
9366
+ );
9367
+ }
9368
+ }
8990
9369
  finishAssistant(next, event);
8991
9370
  if (event.reason === "cancelled" || event.reason === "error") {
8992
9371
  propagateCancellationToInFlightTools(next);
@@ -9240,6 +9619,12 @@ function appendTextDelta(state, kind, activeKey, text, event) {
9240
9619
  if ("meta" in event && event.meta) {
9241
9620
  existing.meta = { ...existing.meta, ...event.meta };
9242
9621
  }
9622
+ if (existing.promptId === void 0 && event.promptId !== void 0) {
9623
+ existing.promptId = event.promptId;
9624
+ }
9625
+ if (kind === "assistant" && event.branchRecordId) {
9626
+ existing.branchRecordId = event.branchRecordId;
9627
+ }
9243
9628
  if (kind !== "user") existing.streaming = true;
9244
9629
  return;
9245
9630
  }
@@ -9254,8 +9639,12 @@ function appendTextDelta(state, kind, activeKey, text, event) {
9254
9639
  event.eventId,
9255
9640
  event.serverTimestamp,
9256
9641
  "meta" in event ? event.meta : void 0,
9257
- event.sourceRecordIds
9642
+ event.sourceRecordIds,
9643
+ event.promptId
9258
9644
  );
9645
+ if (kind === "assistant" && event.branchRecordId) {
9646
+ block.branchRecordId = event.branchRecordId;
9647
+ }
9259
9648
  if (kind !== "user") block.streaming = true;
9260
9649
  if (kind === "thought") block.collapsed = true;
9261
9650
  if (parentId != null) {
@@ -9286,12 +9675,24 @@ function canMergeTextDelta(existing, event) {
9286
9675
  return false;
9287
9676
  }
9288
9677
  if (existing.meta?.qwenDiscreteMessage === true) return false;
9678
+ if (existing.promptId !== void 0 && event.promptId !== void 0 && existing.promptId !== event.promptId)
9679
+ return false;
9289
9680
  if (!stringArraysEqual(existing.sourceRecordIds, event.sourceRecordIds)) {
9290
9681
  return false;
9291
9682
  }
9292
9683
  return !("meta" in event) || event.meta?.qwenDiscreteMessage !== true;
9293
9684
  }
9294
9685
  __name(canMergeTextDelta, "canMergeTextDelta");
9686
+ function findFinalVisibleAssistantForPrompt(state, promptId) {
9687
+ for (let index = state.blocks.length - 1; index >= 0; index--) {
9688
+ const block = state.blocks[index];
9689
+ if (block?.kind === "assistant" && block.parentToolCallId === void 0 && block.promptId === promptId && block.text.trim().length > 0) {
9690
+ return block.id;
9691
+ }
9692
+ }
9693
+ return void 0;
9694
+ }
9695
+ __name(findFinalVisibleAssistantForPrompt, "findFinalVisibleAssistantForPrompt");
9295
9696
  function finishAssistant(state, event) {
9296
9697
  clearActiveAssistant(state, event);
9297
9698
  for (const parentId of Object.keys(state.activeAssistantBlockByParent)) {
@@ -9691,7 +10092,7 @@ function appendPromptCancelledBlock(state, event) {
9691
10092
  clearActiveText(state);
9692
10093
  }
9693
10094
  __name(appendPromptCancelledBlock, "appendPromptCancelledBlock");
9694
- function createTextBlock(state, kind, text, eventId, serverTimestamp, meta, sourceRecordIds) {
10095
+ function createTextBlock(state, kind, text, eventId, serverTimestamp, meta, sourceRecordIds, promptId) {
9695
10096
  const blockId = allocateBlockId(state, kind);
9696
10097
  return {
9697
10098
  id: blockId,
@@ -9703,6 +10104,7 @@ function createTextBlock(state, kind, text, eventId, serverTimestamp, meta, sour
9703
10104
  ...eventId !== void 0 ? { eventId } : {},
9704
10105
  ...serverTimestamp !== void 0 ? { serverTimestamp } : {},
9705
10106
  ...sourceRecordIds ? { sourceRecordIds: [...sourceRecordIds] } : {},
10107
+ ...promptId ? { promptId } : {},
9706
10108
  ...meta ? { meta: { ...meta } } : {}
9707
10109
  };
9708
10110
  }
@@ -10175,8 +10577,12 @@ function createDaemonTranscriptStore(seed = {}) {
10175
10577
  state = reduceDaemonTranscriptEvents(state, events);
10176
10578
  scheduleNotify();
10177
10579
  },
10178
- appendLocalUserMessage(text, images, meta) {
10179
- state = appendLocalUserTranscriptMessage(state, text, { images, meta });
10580
+ appendLocalUserMessage(text, images, meta, files) {
10581
+ state = appendLocalUserTranscriptMessage(state, text, {
10582
+ images,
10583
+ meta,
10584
+ files
10585
+ });
10180
10586
  scheduleNotify();
10181
10587
  },
10182
10588
  reset(nextSeed = {}) {
@@ -11466,6 +11872,7 @@ export {
11466
11872
  isKnownDaemonEvent,
11467
11873
  isNonBlockingAccepted,
11468
11874
  isSessionLevelNotFound,
11875
+ isStaleBranchPointError,
11469
11876
  isSubagentChildBlock,
11470
11877
  isSubagentSessionNotFound,
11471
11878
  isWorkspaceScopedBudgetEvent,