@nextclaw/ui 0.15.21 → 0.15.23

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 (476) hide show
  1. package/CHANGELOG.md +69 -0
  2. package/dist/assets/{abnfDiagram-VRR7QNED-M4g_AyR8.js → abnfDiagram-VRR7QNED-DvTjgVMf.js} +1 -1
  3. package/dist/assets/{aiden0z-pptx-renderer.es-Bd99vut2.js → aiden0z-pptx-renderer.es-C1nfBAXR.js} +1 -1
  4. package/dist/assets/api-Glw2OGXK.js +13 -0
  5. package/dist/assets/appearance-settings-page-Bl_W_9m7.js +1 -0
  6. package/dist/assets/{arc-IO7WNWOB.js → arc-BvhODBXv.js} +1 -1
  7. package/dist/assets/architecture-TIHT7OUA-Bjp9jf0h.js +1 -0
  8. package/dist/assets/{architectureDiagram-ZJ3FMSHR-Dc-lvdUh.js → architectureDiagram-ZJ3FMSHR-BKO9RgNS.js} +1 -1
  9. package/dist/assets/{blockDiagram-677ZJIJ3-CcsoWpIY.js → blockDiagram-677ZJIJ3-DHpDXy7D.js} +1 -1
  10. package/dist/assets/{c4Diagram-LMCZKHZV-Bsrtg6b2.js → c4Diagram-LMCZKHZV-BG_iQnDr.js} +1 -1
  11. package/dist/assets/channel-5T3pdR-s.js +1 -0
  12. package/dist/assets/channels-list-page-C7E4Sxwd.js +8 -0
  13. package/dist/assets/chat-page-BT6dNI-4.js +1 -0
  14. package/dist/assets/chunk-2Q5K7J3B-DTZ3tGfE.js +1 -0
  15. package/dist/assets/{chunk-32BRIVSS-Bt08t8oG.js → chunk-32BRIVSS-DR9M0LLx.js} +1 -1
  16. package/dist/assets/{chunk-52WLFC77-Ddx68Xzx.js → chunk-52WLFC77-698iC3BB.js} +1 -1
  17. package/dist/assets/{chunk-5FCAYU7R-B7p9_q55.js → chunk-5FCAYU7R-DikTj9Ey.js} +1 -1
  18. package/dist/assets/{chunk-5HE753X5-D52KvdTm.js → chunk-5HE753X5-ko0o7_q0.js} +1 -1
  19. package/dist/assets/{chunk-5JV3BV7I-C329h8nI.js → chunk-5JV3BV7I-CEHufhgo.js} +1 -1
  20. package/dist/assets/{chunk-5TONJI2A-BZyUBxWt.js → chunk-5TONJI2A-CGgno1cu.js} +1 -1
  21. package/dist/assets/{chunk-5VM5RSS4-BUiYXZmu.js → chunk-5VM5RSS4-DkiB4cUQ.js} +1 -1
  22. package/dist/assets/{chunk-7BUUIJ7U-B7o-mn4r.js → chunk-7BUUIJ7U-DzptcytQ.js} +1 -1
  23. package/dist/assets/{chunk-BIQX33UG-Bey9GoRP.js → chunk-BIQX33UG-DMRSQJvT.js} +1 -1
  24. package/dist/assets/{chunk-C7G6YPKG-C6tosszM.js → chunk-C7G6YPKG-Bw1BwwuY.js} +1 -1
  25. package/dist/assets/{chunk-CQNSW5MT-BNrdkgGQ.js → chunk-CQNSW5MT-C0z6eHBk.js} +1 -1
  26. package/dist/assets/{chunk-CYSBUYHQ-DHODFeyB.js → chunk-CYSBUYHQ-ByPyAouO.js} +1 -1
  27. package/dist/assets/{chunk-EMLP6XTP-BcmLjrcq.js → chunk-EMLP6XTP-CJlAXWZg.js} +1 -1
  28. package/dist/assets/{chunk-EX3LRPZG-r-_eEtJI.js → chunk-EX3LRPZG-Dqq4zKJu.js} +1 -1
  29. package/dist/assets/{chunk-FWX5IMBZ-DOObDWbf.js → chunk-FWX5IMBZ-B0SNoCmi.js} +2 -2
  30. package/dist/assets/{chunk-HOUHSVGY-Bd0FnbWZ.js → chunk-HOUHSVGY-DG_GJih_.js} +1 -1
  31. package/dist/assets/{chunk-ICXQ74PX-ntNwAm4_.js → chunk-ICXQ74PX-Drxk_6bE.js} +1 -1
  32. package/dist/assets/{chunk-JG7HCLWE-YtRpblZN.js → chunk-JG7HCLWE-DdLFPpnd.js} +1 -1
  33. package/dist/assets/{chunk-JWPE2WC7-De5-D9ta.js → chunk-JWPE2WC7-B8M4G76F.js} +1 -1
  34. package/dist/assets/{chunk-MOJQB5TN-CdvKhyp2.js → chunk-MOJQB5TN-XP6FJHY_.js} +1 -1
  35. package/dist/assets/{chunk-MOZMSUNE-DJMMN_lu.js → chunk-MOZMSUNE-C_6x18Qw.js} +1 -1
  36. package/dist/assets/{chunk-OGEWGWER-DOFWVw3O.js → chunk-OGEWGWER-N25BzCmG.js} +1 -1
  37. package/dist/assets/{chunk-OSBZ3O6U-DZkrIN9r.js → chunk-OSBZ3O6U-ASDEm7y0.js} +1 -1
  38. package/dist/assets/{chunk-PUDLZKDR-D1wma2Yf.js → chunk-PUDLZKDR-CTlvAcn7.js} +1 -1
  39. package/dist/assets/{chunk-Q4XR5HBZ-CjPy94Lz.js → chunk-Q4XR5HBZ-Da9BWfB6.js} +1 -1
  40. package/dist/assets/{chunk-QBLGF6JB-Hy1bEgS-.js → chunk-QBLGF6JB-Bi6RpTJO.js} +1 -1
  41. package/dist/assets/{chunk-R7FJI6CG-CUPIHyh-.js → chunk-R7FJI6CG-DkMsSPvK.js} +1 -1
  42. package/dist/assets/{chunk-RYQCIY6F-D5Ua4pcv.js → chunk-RYQCIY6F-DZp0eU-j.js} +1 -1
  43. package/dist/assets/{chunk-U6XO7XAA-DaUQcqb7.js → chunk-U6XO7XAA-vfinDSrj.js} +1 -1
  44. package/dist/assets/{chunk-V7JOEXUC-DX2zLfQe.js → chunk-V7JOEXUC-C9Nksccs.js} +1 -1
  45. package/dist/assets/chunk-VAUOI2AC-HLGIHQ6k.js +1 -0
  46. package/dist/assets/{chunk-VR4S4FIN-CFA-WQik.js → chunk-VR4S4FIN-Xv6zfwXs.js} +1 -1
  47. package/dist/assets/{chunk-WYO6CB5R-Bk2HeDvJ.js → chunk-WYO6CB5R-mOJNzbWl.js} +2 -2
  48. package/dist/assets/chunk-XXDRQBXY-Dl0m6Ni-.js +1 -0
  49. package/dist/assets/{chunk-YOTPTUD7-DUG4FpBN.js → chunk-YOTPTUD7-1-aKSu4o.js} +1 -1
  50. package/dist/assets/{chunk-ZGVPDNZ5-70JdIGo0.js → chunk-ZGVPDNZ5-OJ8veMpK.js} +1 -1
  51. package/dist/assets/{chunk-ZIRB5QZD-XZdgBt5L.js → chunk-ZIRB5QZD-SR_Nq_PP.js} +1 -1
  52. package/dist/assets/classDiagram-OUVF2IWQ-DcDnzGNX.js +1 -0
  53. package/dist/assets/classDiagram-v2-EOCWNBFH-BKXKMzKM.js +1 -0
  54. package/dist/assets/config-split-page-D5BgtKrm.js +1 -0
  55. package/dist/assets/confirm-dialog-Bf907Azu.js +5 -0
  56. package/dist/assets/{cose-bilkent-JH36ORCC-B-PQoGX-.js → cose-bilkent-JH36ORCC-NjVgz2Bw.js} +1 -1
  57. package/dist/assets/cynefin-VYW2F7L2-BWg7U2UD.js +1 -0
  58. package/dist/assets/{cynefinDiagram-TSTJHNR4-BoLCPEM0.js → cynefinDiagram-TSTJHNR4-B_17LDqD.js} +1 -1
  59. package/dist/assets/{dagre-D7Ie4eXr.js → dagre-CMe101gk.js} +1 -1
  60. package/dist/assets/{dagre-VKFMJZFB-CKRrwZA-.js → dagre-VKFMJZFB-qo8nLb3B.js} +1 -1
  61. package/dist/assets/desktop-update-config-BwuyBPJb.js +1 -0
  62. package/dist/assets/{diagram-FQU43EPY-CASL1J3_.js → diagram-FQU43EPY-Ba3XIklC.js} +1 -1
  63. package/dist/assets/{diagram-G47NLZAW-CvLPBIzf.js → diagram-G47NLZAW-CG45TcUx.js} +1 -1
  64. package/dist/assets/{diagram-NH7WQ7WH-Ba6fGdYP.js → diagram-NH7WQ7WH-2F2HrwV-.js} +1 -1
  65. package/dist/assets/{diagram-OA4YK3LP-DkpfgEjM.js → diagram-OA4YK3LP-CXfWH9NZ.js} +1 -1
  66. package/dist/assets/{diagram-WEI45ONY-BP5UMVsN.js → diagram-WEI45ONY-CH_4yepc.js} +1 -1
  67. package/dist/assets/dist-CtLyEJeO.js +1 -0
  68. package/dist/assets/dist-dv_SUR54.js +1 -0
  69. package/dist/assets/doc-browser-C23NDGh5.js +1 -0
  70. package/dist/assets/doc-browser-DlOOhBxI.js +1 -0
  71. package/dist/assets/doc-browser-context-BIBjkwfV.js +1 -0
  72. package/dist/assets/{docx-preview-D0tp3a9T.js → docx-preview-CoM4JK7_.js} +1 -1
  73. package/dist/assets/{ebnfDiagram-CCIWWBDH-TJKbUcmc.js → ebnfDiagram-CCIWWBDH-BwiG4Ea1.js} +1 -1
  74. package/dist/assets/{erDiagram-Q63AITRT-DzGPKkKH.js → erDiagram-Q63AITRT-BML3hpnQ.js} +1 -1
  75. package/dist/assets/eventmodeling-45OFAUF4-SB-J4tpq.js +1 -0
  76. package/dist/assets/flowDiagram-23GEKE2U-BQ_u-eLM.js +1 -0
  77. package/dist/assets/{form-actions-DvvxCpL4.js → form-actions-DAzi68Cn.js} +1 -1
  78. package/dist/assets/{ganttDiagram-NO4QXBWP-JhJzsGp2.js → ganttDiagram-NO4QXBWP-80enfWbD.js} +1 -1
  79. package/dist/assets/gitGraph-TEB2WS4Q-DPxNwsFd.js +1 -0
  80. package/dist/assets/{gitGraphDiagram-IHSO6WYX-DZ1CKMj8.js → gitGraphDiagram-IHSO6WYX-CVLqXr-b.js} +1 -1
  81. package/dist/assets/host-capabilities-D9C4CBK5.js +1 -0
  82. package/dist/assets/index-BLNg2yg0.css +1 -0
  83. package/dist/assets/index-D3EKjEyK.js +107 -0
  84. package/dist/assets/info-DKCQHKI2-DNlNGH90.js +1 -0
  85. package/dist/assets/{infoDiagram-FWYZ7A6U-BNXNKfRQ.js → infoDiagram-FWYZ7A6U-Dyvs2t0i.js} +1 -1
  86. package/dist/assets/{ishikawaDiagram-FXEZZL3T-DoiEfjNw.js → ishikawaDiagram-FXEZZL3T-sSnxDKfh.js} +1 -1
  87. package/dist/assets/{journeyDiagram-5HDEW3XC-D6oK2HSy.js → journeyDiagram-5HDEW3XC-D22V71Mf.js} +1 -1
  88. package/dist/assets/{kanban-definition-HUTT4EX6-B2UnLOH-.js → kanban-definition-HUTT4EX6-D3ds0p-g.js} +1 -1
  89. package/dist/assets/{line-BM7PoxY5.js → line-CbyFs065.js} +1 -1
  90. package/dist/assets/{linear-B3DiqMjk.js → linear-4DKtnZBS.js} +1 -1
  91. package/dist/assets/loader-circle-BSg5u0r4.js +1 -0
  92. package/dist/assets/{map-BAAdHTqR.js → map-CcZzEoz6.js} +1 -1
  93. package/dist/assets/mcp-marketplace-page-ByhvQQj5.js +9 -0
  94. package/dist/assets/mcp-marketplace-page-CytXwnUs.js +1 -0
  95. package/dist/assets/{mermaid-parser.core-BeMviefY.js → mermaid-parser.core-DPmMOjXD.js} +2 -2
  96. package/dist/assets/{mermaid.core-D0Q77r9I.js → mermaid.core-BSf-ddRa.js} +3 -3
  97. package/dist/assets/{mindmap-definition-LN4V7U3C-BQ7r7bR8.js → mindmap-definition-LN4V7U3C-BUTwWPyx.js} +1 -1
  98. package/dist/assets/model-config-page-bgEx3MjQ.js +1 -0
  99. package/dist/assets/navigation-link-CB0OQbnY.js +3 -0
  100. package/dist/assets/{ordinal-Bt2N4IkA.js → ordinal-BgLYtOZE.js} +1 -1
  101. package/dist/assets/packet-7NZHBO7P-BpeiqkBZ.js +1 -0
  102. package/dist/assets/{pegDiagram-2B236MQR-B-C9-LGz.js → pegDiagram-2B236MQR-BEu_ZBjc.js} +1 -1
  103. package/dist/assets/pie-RZYD4A2V-Cy1yxsPd.js +1 -0
  104. package/dist/assets/{pieDiagram-ENE6RG2P-CtirZLtn.js → pieDiagram-ENE6RG2P-CAwAwuBd.js} +1 -1
  105. package/dist/assets/plus-CNjWdLhZ.js +1 -0
  106. package/dist/assets/provider-scoped-model-input-8F6JMd2n.js +1 -0
  107. package/dist/assets/providers-config-page-CxpTjR81.js +1 -0
  108. package/dist/assets/{quadrantDiagram-ABIIQ3AL-DiBWAzDU.js → quadrantDiagram-ABIIQ3AL-CwE6F-_2.js} +1 -1
  109. package/dist/assets/radar-I7S5WNFK-CEcPKCj8.js +1 -0
  110. package/dist/assets/railroad-3IZDKUUU-CW38eNDs.js +1 -0
  111. package/dist/assets/railroad-abnf-AHOZXSZD-ByrylcXf.js +1 -0
  112. package/dist/assets/railroad-ebnf-EBAXGLYW-CNB6GwP-.js +1 -0
  113. package/dist/assets/railroad-peg-LSFZ7HO6-x6hnqlBG.js +1 -0
  114. package/dist/assets/{railroadDiagram-RFXS5EU6-CP6b3PBI.js → railroadDiagram-RFXS5EU6-xgLekU3B.js} +1 -1
  115. package/dist/assets/react-Bk2ydNTe.js +8 -0
  116. package/dist/assets/{refresh-cw-C2e94pmp.js → refresh-cw-Ba0LZou4.js} +1 -1
  117. package/dist/assets/remote-Dv38PuMV.js +1 -0
  118. package/dist/assets/{requirementDiagram-TGXJPOKE-D8YV0-Jz.js → requirementDiagram-TGXJPOKE-CyVUzEX5.js} +1 -1
  119. package/dist/assets/rotate-cw-IkYVk9JX.js +1 -0
  120. package/dist/assets/runtime-config-page-C0ByyUVr.js +1 -0
  121. package/dist/assets/{sankeyDiagram-HTMAVEWB-C2vA4ojE.js → sankeyDiagram-HTMAVEWB-JK6bFmYB.js} +1 -1
  122. package/dist/assets/{save-CkwDOgvt.js → save-DTOAvqzt.js} +1 -1
  123. package/dist/assets/{search-CLXM2reO.js → search-D4X5DNMe.js} +1 -1
  124. package/dist/assets/search-config-page-Cr6254K5.js +1 -0
  125. package/dist/assets/{secrets-config-page-DQ_Curaj.js → secrets-config-page-W2Hx332d.js} +2 -2
  126. package/dist/assets/security-config-1E8OF4kR.js +1 -0
  127. package/dist/assets/select-CDv0g2Pj.js +41 -0
  128. package/dist/assets/{sequenceDiagram-DBY2YBRQ-B9LBmpUo.js → sequenceDiagram-DBY2YBRQ-BR5IokXV.js} +1 -1
  129. package/dist/assets/{settings-2-B9IT2HGd.js → settings-2-CoxzNABp.js} +1 -1
  130. package/dist/assets/{sizeCapture-X5ZJPWSS-9UIfya9-.js → sizeCapture-X5ZJPWSS-SxG_YnMA.js} +1 -1
  131. package/dist/assets/skeleton-DW018fJv.js +1 -0
  132. package/dist/assets/{src-DKf77Yzo.js → src-vgz8E_-O.js} +1 -1
  133. package/dist/assets/{stateDiagram-2N3HPSRC-oTW44vds.js → stateDiagram-2N3HPSRC-DD4OoYhn.js} +1 -1
  134. package/dist/assets/stateDiagram-v2-6OUMAXLB-ZC6dFORv.js +1 -0
  135. package/dist/assets/{swimlanes-5IMT3BWC-Cf7lcsay.js → swimlanes-5IMT3BWC-BWkFeyCT.js} +2 -2
  136. package/dist/assets/swimlanesDiagram-G3AALYLV-CRkh51Im.js +8 -0
  137. package/dist/assets/{tag-chip-CDkB5smU.js → tag-chip-CjkZEoS2.js} +1 -1
  138. package/dist/assets/{timeline-definition-FHXFAJF6-DoCuWKDJ.js → timeline-definition-FHXFAJF6-VTRPy6KA.js} +1 -1
  139. package/dist/assets/treeView-QDETBFTQ-Bw0DSCH7.js +1 -0
  140. package/dist/assets/treemap-6X3UGDF4-DFWBFcfh.js +1 -0
  141. package/dist/assets/use-confirm-dialog-CavtY1vJ.js +1 -0
  142. package/dist/assets/{vennDiagram-L72KCM5P-CpU0pzGe.js → vennDiagram-L72KCM5P-Bvk42Pek.js} +1 -1
  143. package/dist/assets/wardley-OPB4EBWU-CoWturk0.js +1 -0
  144. package/dist/assets/{wardleyDiagram-EHGQE667-CkN6nn6-.js → wardleyDiagram-EHGQE667-DOFjx2s3.js} +1 -1
  145. package/dist/assets/x-PTXYTEwz.js +1 -0
  146. package/dist/assets/{xychartDiagram-FW5EYKEG-DATpapm2.js → xychartDiagram-FW5EYKEG-DY5yRTUc.js} +1 -1
  147. package/dist/index.html +30 -32
  148. package/index.html +8 -0
  149. package/package.json +8 -8
  150. package/src/app/components/layout/page-layout.tsx +15 -6
  151. package/src/app/components/layout/sidebar-rail.styles.ts +0 -2
  152. package/src/app/components/layout/sidebar.tsx +2 -2
  153. package/src/app/styles/charcoal-theme.css +85 -0
  154. package/src/app/styles/design-system.css +23 -13
  155. package/src/features/agents/components/__tests__/agents-page.test.tsx +36 -24
  156. package/src/features/agents/components/agent-advanced-config-fields.tsx +7 -7
  157. package/src/features/agents/components/agent-details-dialog.tsx +8 -8
  158. package/src/features/agents/components/agent-dialogs.tsx +7 -7
  159. package/src/features/agents/components/agents-page.tsx +42 -62
  160. package/src/features/chat/components/chat-sidebar-list-mode-switch.tsx +2 -2
  161. package/src/features/chat/components/conversation/__tests__/chat-conversation-content.test.tsx +46 -4
  162. package/src/features/chat/components/conversation/__tests__/chat-conversation-header-section.test.tsx +17 -1
  163. package/src/features/chat/components/conversation/__tests__/chat-conversation-panel.test.tsx +8 -22
  164. package/src/features/chat/components/conversation/__tests__/chat-conversation-workspace-section.test.tsx +69 -3
  165. package/src/features/chat/components/conversation/chat-conversation-content.tsx +24 -11
  166. package/src/features/chat/components/conversation/chat-conversation-header-section.tsx +30 -31
  167. package/src/features/chat/components/conversation/chat-conversation-header.tsx +1 -1
  168. package/src/features/chat/components/conversation/chat-conversation-panel.tsx +1 -8
  169. package/src/features/chat/components/conversation/chat-conversation-workspace-section.tsx +16 -4
  170. package/src/features/chat/components/layout/__tests__/chat-page-shell.test.tsx +23 -0
  171. package/src/features/chat/components/layout/__tests__/chat-sidebar-read-state.test.tsx +1 -1
  172. package/src/features/chat/components/layout/__tests__/chat-sidebar-session-area.test.tsx +52 -0
  173. package/src/features/chat/components/layout/__tests__/chat-sidebar-toolbar.test.tsx +6 -0
  174. package/src/features/chat/components/layout/__tests__/chat-sidebar.test.tsx +11 -17
  175. package/src/features/chat/components/layout/chat-page-shell.tsx +7 -15
  176. package/src/features/chat/components/layout/chat-sidebar-desktop-layout.tsx +32 -42
  177. package/src/features/chat/components/layout/chat-sidebar-toolbar.tsx +16 -67
  178. package/src/features/chat/components/layout/chat-sidebar-utility-menu.tsx +1 -4
  179. package/src/features/chat/components/providers/chat-presenter.provider.tsx +2 -0
  180. package/src/features/chat/features/conversation/components/__tests__/session-conversation-area.test.tsx +84 -12
  181. package/src/features/chat/features/conversation/components/__tests__/session-conversation-input.streaming.test.tsx +258 -9
  182. package/src/features/chat/features/conversation/components/session-conversation-area.tsx +51 -34
  183. package/src/features/chat/features/conversation/components/session-conversation-input.tsx +50 -39
  184. package/src/features/chat/features/conversation/hooks/__tests__/use-session-conversation-controller.test.tsx +128 -1
  185. package/src/features/chat/features/conversation/hooks/__tests__/use-session-conversation-input-state.test.tsx +67 -1
  186. package/src/features/chat/features/conversation/hooks/__tests__/use-session-conversation-slash-commands.test.tsx +4 -0
  187. package/src/features/chat/features/conversation/hooks/__tests__/use-session-provider-model-catalog.test.tsx +109 -0
  188. package/src/features/chat/features/conversation/hooks/use-chat-composer-reference-intent.ts +46 -0
  189. package/src/features/chat/features/conversation/hooks/use-session-conversation-composer-nodes.ts +26 -0
  190. package/src/features/chat/features/conversation/hooks/use-session-conversation-controller.ts +45 -12
  191. package/src/features/chat/features/conversation/hooks/use-session-conversation-input-attachments.ts +1 -0
  192. package/src/features/chat/features/conversation/hooks/use-session-conversation-input-query.ts +28 -3
  193. package/src/features/chat/features/conversation/hooks/use-session-conversation-input-state.ts +91 -37
  194. package/src/features/chat/features/conversation/hooks/use-session-conversation-recovery-actions.ts +64 -0
  195. package/src/features/chat/features/conversation/hooks/use-session-conversation-slash-commands.ts +2 -0
  196. package/src/features/chat/features/conversation/hooks/use-session-provider-model-catalog.ts +84 -0
  197. package/src/features/chat/features/conversation/utils/__tests__/session-message-composer.utils.test.ts +34 -0
  198. package/src/features/chat/features/conversation/utils/session-conversation-input-toolbar.utils.ts +18 -0
  199. package/src/features/chat/features/conversation/utils/session-message-composer.utils.ts +117 -0
  200. package/src/features/chat/features/conversation/utils/session-queued-input.utils.ts +10 -97
  201. package/src/features/chat/features/input/input-surface-plugins/__tests__/slash-command-plugin.test.ts +2 -1
  202. package/src/features/chat/features/input/input-surface-plugins/slash-command-plugin.utils.ts +3 -1
  203. package/src/features/chat/features/input/utils/__tests__/chat-composer-state.utils.test.ts +22 -1
  204. package/src/features/chat/features/input/utils/__tests__/chat-inline-token.utils.test.ts +23 -0
  205. package/src/features/chat/features/input/utils/__tests__/chat-input-bar.utils.test.ts +105 -0
  206. package/src/features/chat/features/input/utils/chat-composer-state.utils.ts +27 -2
  207. package/src/features/chat/features/input/utils/chat-composer-token-protocol.utils.ts +5 -0
  208. package/src/features/chat/features/input/utils/chat-inline-token.utils.ts +97 -32
  209. package/src/features/chat/features/input/utils/chat-input-bar.utils.ts +1 -1
  210. package/src/features/chat/features/input/utils/chat-input-toolbar.utils.ts +64 -10
  211. package/src/features/chat/features/message/components/__tests__/chat-message-assistant-header.container.test.tsx +149 -0
  212. package/src/features/chat/features/message/components/__tests__/chat-message-inline-editor.test.tsx +59 -0
  213. package/src/features/chat/features/message/components/__tests__/chat-message-list.container.test.tsx +123 -90
  214. package/src/features/chat/features/message/components/__tests__/chat-message-timeline-dividers.test.tsx +43 -0
  215. package/src/features/chat/features/message/components/chat-message-inline-editor.tsx +111 -0
  216. package/src/features/chat/features/message/components/chat-message-list.container.tsx +81 -172
  217. package/src/features/chat/features/message/components/chat-message-timeline-dividers.tsx +75 -0
  218. package/src/features/chat/features/message/hooks/use-chat-inline-token-actions.ts +125 -0
  219. package/src/features/chat/features/message/hooks/use-chat-message-actions.tsx +187 -0
  220. package/src/features/chat/features/message/utils/__tests__/chat-message-action-targets.utils.test.ts +89 -0
  221. package/src/features/chat/features/message/utils/__tests__/chat-message-timeline-compaction.utils.test.ts +194 -0
  222. package/src/features/chat/features/message/utils/__tests__/chat-message-timeline-continuation-compaction.utils.test.ts +167 -0
  223. package/src/features/chat/features/message/utils/__tests__/chat-message-timeline.utils.test.ts +203 -0
  224. package/src/features/chat/features/message/utils/__tests__/chat-message.utils.test.ts +26 -0
  225. package/src/features/chat/features/message/utils/chat-message-action-targets.utils.ts +28 -0
  226. package/src/features/chat/features/message/utils/chat-message-part.utils.ts +38 -0
  227. package/src/features/chat/features/message/utils/chat-message-texts.utils.ts +1 -0
  228. package/src/features/chat/features/message/utils/chat-message-timeline.utils.ts +204 -7
  229. package/src/features/chat/features/ncp/hooks/__tests__/use-ncp-agent-runtime.test.tsx +180 -1
  230. package/src/features/chat/features/ncp/hooks/__tests__/use-ncp-session-conversation.test.tsx +184 -10
  231. package/src/features/chat/features/ncp/hooks/use-hydrated-ncp-agent.integration.test.tsx +57 -0
  232. package/src/features/chat/features/ncp/hooks/use-ncp-session-conversation.ts +90 -1
  233. package/src/features/chat/features/ncp/utils/__tests__/ncp-chat-query-derived.utils.test.ts +110 -0
  234. package/src/features/chat/features/ncp/utils/ncp-chat-query-derived.utils.ts +65 -3
  235. package/src/features/chat/features/session/components/chat-sidebar-session-item.tsx +10 -10
  236. package/src/features/chat/features/session/components/chat-sidebar-session-list.tsx +2 -2
  237. package/src/features/chat/features/session/components/session-header/__tests__/chat-session-header-actions.test.tsx +17 -0
  238. package/src/features/chat/features/session/components/session-header/chat-session-header-actions.tsx +63 -54
  239. package/src/features/chat/features/session/components/session-header/chat-session-header-menu-item.tsx +1 -1
  240. package/src/features/chat/features/session/components/session-header/chat-session-project-badge.tsx +1 -1
  241. package/src/features/chat/features/session/components/session-header/chat-session-switcher-groups.tsx +1 -1
  242. package/src/features/chat/features/session/components/session-header/chat-session-title-switcher.tsx +1 -1
  243. package/src/features/chat/features/session/hooks/__tests__/use-selected-session-context-window-indicator.test.tsx +87 -0
  244. package/src/features/chat/features/session/utils/__tests__/chat-session-display.utils.test.ts +26 -0
  245. package/src/features/chat/features/session/utils/__tests__/ncp-session-adapter.utils.test.ts +23 -2
  246. package/src/features/chat/features/session/utils/chat-context-window-indicator.utils.ts +44 -5
  247. package/src/features/chat/features/session/utils/chat-session-display.utils.ts +48 -12
  248. package/src/features/chat/features/session/utils/ncp-session-adapter.utils.ts +23 -4
  249. package/src/features/chat/features/session/utils/ncp-session-context-metadata.utils.ts +42 -4
  250. package/src/features/chat/features/welcome/components/__tests__/chat-conversation-welcome.test.tsx +6 -0
  251. package/src/features/chat/features/welcome/components/__tests__/chat-welcome.test.tsx +27 -9
  252. package/src/features/chat/features/welcome/components/chat-welcome-agent-picker.tsx +1 -1
  253. package/src/features/chat/features/welcome/components/chat-welcome-project-picker.tsx +11 -17
  254. package/src/features/chat/features/welcome/components/chat-welcome-prompt-suggestions.tsx +37 -0
  255. package/src/features/chat/features/welcome/components/chat-welcome-session-type-picker.tsx +1 -1
  256. package/src/features/chat/features/welcome/components/chat-welcome.tsx +35 -33
  257. package/src/features/chat/features/welcome/utils/__tests__/chat-welcome-project-options.utils.test.ts +22 -6
  258. package/src/features/chat/features/welcome/utils/chat-welcome-project-options.utils.ts +13 -0
  259. package/src/features/chat/features/workspace/components/__tests__/chat-session-workspace-panel-content.test.tsx +73 -3
  260. package/src/features/chat/features/workspace/components/__tests__/chat-session-workspace-panel.test.tsx +22 -2
  261. package/src/features/chat/features/workspace/components/__tests__/chat-session-workspace-text-selection.test.tsx +75 -0
  262. package/src/features/chat/features/workspace/components/__tests__/workspace-text-selection-menu.test.tsx +102 -0
  263. package/src/features/chat/features/workspace/components/chat-session-workspace-directory-browser.tsx +145 -26
  264. package/src/features/chat/features/workspace/components/chat-session-workspace-file-preview.tsx +42 -18
  265. package/src/features/chat/features/workspace/components/chat-session-workspace-panel-content.tsx +50 -10
  266. package/src/features/chat/features/workspace/components/chat-session-workspace-panel-nav.tsx +48 -22
  267. package/src/features/chat/features/workspace/components/chat-session-workspace-panel.tsx +13 -2
  268. package/src/features/chat/features/workspace/components/workspace-text-selection-menu.tsx +223 -0
  269. package/src/features/chat/features/workspace/utils/__tests__/chat-workspace-panel-view-model.utils.test.ts +80 -0
  270. package/src/features/chat/features/workspace/utils/__tests__/workspace-text-excerpt.utils.test.ts +54 -0
  271. package/src/features/chat/features/workspace/utils/chat-thread-workspace-session.utils.ts +47 -0
  272. package/src/features/chat/features/workspace/utils/chat-workspace-file-tab.utils.ts +16 -0
  273. package/src/features/chat/features/workspace/utils/chat-workspace-panel-view-model.utils.ts +22 -1
  274. package/src/features/chat/features/workspace/utils/workspace-text-excerpt.utils.ts +53 -0
  275. package/src/features/chat/index.ts +1 -0
  276. package/src/features/chat/managers/__tests__/chat-composer-intent.manager.test.ts +106 -0
  277. package/src/features/chat/managers/__tests__/chat-session-list.manager.test.ts +53 -5
  278. package/src/features/chat/managers/__tests__/chat-thread-workspace.manager.test.ts +93 -1
  279. package/src/features/chat/managers/__tests__/chat-thread.manager.test.ts +3 -10
  280. package/src/features/chat/managers/__tests__/provider-model-catalog-notice.manager.test.ts +57 -0
  281. package/src/features/chat/managers/chat-composer-intent.manager.ts +145 -0
  282. package/src/features/chat/managers/chat-session-list.manager.ts +14 -25
  283. package/src/features/chat/managers/chat-thread.manager.ts +32 -16
  284. package/src/features/chat/managers/provider-model-catalog-notice.manager.ts +121 -0
  285. package/src/features/chat/pages/__tests__/ncp-chat-page.test.tsx +3 -9
  286. package/src/features/chat/pages/ncp-chat-page.tsx +0 -1
  287. package/src/features/chat/presenters/chat.presenter.ts +3 -0
  288. package/src/features/chat/stores/__tests__/chat-composer-draft.store.test.ts +55 -0
  289. package/src/features/chat/stores/chat-composer-draft.store.ts +92 -0
  290. package/src/features/chat/stores/chat-thread.store.ts +2 -4
  291. package/src/features/chat/types/chat-input-bar.types.ts +6 -0
  292. package/src/features/chat/types/chat-input.types.ts +5 -0
  293. package/src/features/chat/types/chat-message.types.ts +5 -0
  294. package/src/features/cron/components/__tests__/cron-config.test.tsx +100 -19
  295. package/src/features/cron/components/cron-config.tsx +19 -33
  296. package/src/features/cron/components/cron-job-detail-dialog.tsx +42 -16
  297. package/src/features/cron/components/cron-job-row.tsx +18 -1
  298. package/src/features/cron/components/cron-task-discovery.tsx +1 -1
  299. package/src/features/inbox/components/inbox-delivery-content.test.tsx +8 -2
  300. package/src/features/inbox/components/inbox-delivery-content.tsx +1 -1
  301. package/src/features/inbox/components/inbox-reader-dialog.test.tsx +10 -4
  302. package/src/features/inbox/components/inbox-reader-dialog.tsx +37 -61
  303. package/src/features/inbox/pages/inbox-page.tsx +90 -98
  304. package/src/features/marketplace/components/marketplace-page-parts.tsx +1 -1
  305. package/src/features/notifications/components/__tests__/app-notification-toast.test.tsx +31 -6
  306. package/src/features/notifications/components/app-notification-toast.tsx +54 -15
  307. package/src/features/notifications/managers/__tests__/app-notification.manager.test.ts +2 -0
  308. package/src/features/notifications/managers/app-notification.manager.ts +3 -0
  309. package/src/features/panel-apps/components/panel-app-list-item.tsx +1 -1
  310. package/src/features/panel-apps/components/panel-app-toolbar.tsx +2 -2
  311. package/src/features/panel-apps/components/panel-apps-list.tsx +4 -4
  312. package/src/features/panel-apps/utils/panel-app-doc-browser.utils.tsx +1 -0
  313. package/src/features/pwa/managers/__tests__/pwa-shell-theme.manager.test.ts +9 -0
  314. package/src/features/pwa/managers/pwa-shell-theme.manager.ts +1 -0
  315. package/src/features/service-apps/components/__tests__/service-apps-panel.test.tsx +5 -4
  316. package/src/features/service-apps/components/service-app-list-item.tsx +470 -0
  317. package/src/features/service-apps/components/service-apps-panel.tsx +76 -490
  318. package/src/features/settings/components/config/__tests__/provider-models-section.test.tsx +239 -0
  319. package/src/features/settings/components/config/provider-auth-section.tsx +90 -59
  320. package/src/features/settings/components/config/provider-form-detail-pane.tsx +307 -0
  321. package/src/features/settings/components/config/provider-form.tsx +149 -367
  322. package/src/features/settings/components/config/provider-model-list.tsx +293 -0
  323. package/src/features/settings/components/config/provider-model-suggestions-panel.tsx +151 -0
  324. package/src/features/settings/components/config/provider-models-section.tsx +178 -149
  325. package/src/features/settings/components/config/provider-status-badge.tsx +4 -2
  326. package/src/features/settings/hooks/__tests__/use-provider-connectivity.test.tsx +98 -0
  327. package/src/features/settings/hooks/__tests__/use-provider-model-suggestions.test.tsx +107 -0
  328. package/src/features/settings/hooks/use-provider-connectivity.ts +132 -0
  329. package/src/features/settings/hooks/use-provider-model-suggestions.ts +51 -0
  330. package/src/features/settings/pages/__tests__/appearance-settings-page.test.tsx +2 -2
  331. package/src/features/settings/pages/__tests__/providers-config-page.test.tsx +12 -0
  332. package/src/features/settings/pages/__tests__/search-config-page.test.tsx +48 -0
  333. package/src/features/settings/pages/providers-config-page.tsx +2 -1
  334. package/src/features/settings/pages/search-config-page.tsx +17 -8
  335. package/src/features/settings/utils/__tests__/provider-form-support.utils.test.ts +42 -0
  336. package/src/features/settings/utils/provider-form-context.utils.ts +2 -0
  337. package/src/features/settings/utils/provider-form-model.utils.ts +25 -0
  338. package/src/features/settings/utils/provider-form-support.utils.ts +21 -5
  339. package/src/index.css +1 -1
  340. package/src/platforms/desktop/types/desktop-update.types.ts +5 -0
  341. package/src/platforms/mobile/components/__tests__/mobile-app-shell.test.tsx +13 -7
  342. package/src/platforms/mobile/components/__tests__/mobile-bottom-nav.test.tsx +18 -20
  343. package/src/shared/components/actions/__tests__/navigation-link.test.tsx +14 -3
  344. package/src/shared/components/actions/navigation-link.tsx +35 -15
  345. package/src/shared/components/common/__tests__/agent-avatar.test.tsx +3 -2
  346. package/src/shared/components/common/agent-avatar.tsx +3 -3
  347. package/src/shared/components/doc-browser/__tests__/doc-browser.test.tsx +66 -0
  348. package/src/shared/components/doc-browser/doc-browser-panel-parts.tsx +5 -2
  349. package/src/shared/components/doc-browser/doc-browser-renderer.types.ts +1 -0
  350. package/src/shared/components/doc-browser/doc-browser.tsx +9 -0
  351. package/src/shared/components/doc-browser/hooks/use-doc-browser-scroll-restoration.ts +126 -0
  352. package/src/shared/components/path-picker/server-path-picker-directory-list.tsx +1 -1
  353. package/src/shared/components/path-picker/server-path-picker-locations.tsx +1 -1
  354. package/src/shared/components/path-picker/server-path-picker-navigation-bar.tsx +3 -3
  355. package/src/shared/components/settings/settings-page.tsx +1 -1
  356. package/src/shared/components/ui/actions/__tests__/icon-action-button.test.tsx +1 -1
  357. package/src/shared/components/ui/actions/icon-action-button.tsx +1 -1
  358. package/src/shared/components/ui/button.tsx +4 -4
  359. package/src/shared/components/ui/context-menu/__tests__/context-menu.test.tsx +103 -0
  360. package/src/shared/components/ui/context-menu/context-menu.tsx +263 -0
  361. package/src/shared/components/ui/dialog.tsx +1 -1
  362. package/src/shared/components/ui/input.tsx +1 -1
  363. package/src/shared/components/ui/scroll-area.tsx +2 -0
  364. package/src/shared/components/ui/select.tsx +1 -1
  365. package/src/shared/components/ui/switch.tsx +1 -1
  366. package/src/shared/components/ui/tab-strip/__tests__/compact-tab-strip.test.tsx +19 -6
  367. package/src/shared/components/ui/tab-strip/compact-tab-strip.tsx +28 -67
  368. package/src/shared/components/ui/tabs.tsx +1 -1
  369. package/src/shared/components/ui/textarea.tsx +1 -1
  370. package/src/shared/hooks/use-config.ts +33 -1
  371. package/src/shared/lib/api/__tests__/ncp-session-query-cache.utils.test.ts +26 -0
  372. package/src/shared/lib/api/ncp-session-query-cache.utils.ts +7 -10
  373. package/src/shared/lib/api/ncp-session.types.ts +7 -0
  374. package/src/shared/lib/api/types.ts +38 -1
  375. package/src/shared/lib/api/utils/config.utils.ts +14 -0
  376. package/src/shared/lib/cron/cron-job-view.utils.ts +4 -0
  377. package/src/shared/lib/host-capabilities/__tests__/host-capability.manager.test.ts +26 -0
  378. package/src/shared/lib/host-capabilities/host-capability.manager.ts +28 -0
  379. package/src/shared/lib/i18n/locales/en-US/chat.json +45 -17
  380. package/src/shared/lib/i18n/locales/en-US/core.json +26 -0
  381. package/src/shared/lib/i18n/locales/en-US/doc-browser.json +1 -0
  382. package/src/shared/lib/i18n/locales/en-US/search.json +1 -0
  383. package/src/shared/lib/i18n/locales/zh-CN/chat.json +45 -17
  384. package/src/shared/lib/i18n/locales/zh-CN/core.json +26 -0
  385. package/src/shared/lib/i18n/locales/zh-CN/doc-browser.json +1 -0
  386. package/src/shared/lib/i18n/locales/zh-CN/search.json +1 -0
  387. package/src/shared/lib/provider-models/__tests__/anonymous-provider-configuration.test.ts +40 -0
  388. package/src/shared/lib/provider-models/index.ts +4 -3
  389. package/src/shared/lib/session-project/__tests__/workspace-file-breadcrumb.test.ts +28 -1
  390. package/src/shared/lib/session-project/workspace-file-breadcrumb.utils.ts +23 -0
  391. package/src/shared/lib/theme/index.test.ts +11 -0
  392. package/src/shared/lib/theme/index.ts +2 -0
  393. package/dist/assets/api-CHo2gekJ.js +0 -13
  394. package/dist/assets/app-presenter-provider-2_DmWYT9.js +0 -108
  395. package/dist/assets/app-presenter-provider-D3BuuOyZ.css +0 -1
  396. package/dist/assets/appearance-settings-page-BEy2UE7R.js +0 -1
  397. package/dist/assets/architecture-TIHT7OUA-Cii4JyA2.js +0 -1
  398. package/dist/assets/book-open-BrZL4o9L.js +0 -1
  399. package/dist/assets/card-B5rRLu_6.js +0 -1
  400. package/dist/assets/channel-BSKkTPe8.js +0 -1
  401. package/dist/assets/channels-list-page-C1dnm68I.js +0 -8
  402. package/dist/assets/chat-page-Dz6tvZ91.js +0 -1
  403. package/dist/assets/chunk-2Q5K7J3B-CDMOR1xZ.js +0 -1
  404. package/dist/assets/chunk-VAUOI2AC-BRvqNW76.js +0 -1
  405. package/dist/assets/chunk-XXDRQBXY-CwX_mqJ3.js +0 -1
  406. package/dist/assets/classDiagram-OUVF2IWQ-RzbGxG77.js +0 -1
  407. package/dist/assets/classDiagram-v2-EOCWNBFH-C_gWB7WT.js +0 -1
  408. package/dist/assets/config-split-page-6y6W6dz4.js +0 -1
  409. package/dist/assets/confirm-dialog-q1CpEmR8.js +0 -5
  410. package/dist/assets/cynefin-VYW2F7L2-fSLIS0X3.js +0 -1
  411. package/dist/assets/desktop-update-config-DrdlwP4j.js +0 -1
  412. package/dist/assets/dist-C9EX46wM.js +0 -41
  413. package/dist/assets/doc-browser-BfttDSti.js +0 -1
  414. package/dist/assets/doc-browser-DH-3hDnI.js +0 -1
  415. package/dist/assets/doc-browser-context-TU2heon0.js +0 -1
  416. package/dist/assets/eventmodeling-45OFAUF4-XVcQGgha.js +0 -1
  417. package/dist/assets/eye-B-3dyZNA.js +0 -1
  418. package/dist/assets/flowDiagram-23GEKE2U-BiFSctqz.js +0 -1
  419. package/dist/assets/gitGraph-TEB2WS4Q-C014uXqS.js +0 -1
  420. package/dist/assets/host-capabilities-B-TtABsP.js +0 -1
  421. package/dist/assets/index-CXDPLDFD.css +0 -1
  422. package/dist/assets/index-k_eWScvN.js +0 -2
  423. package/dist/assets/info-DKCQHKI2-CQ2qjGhU.js +0 -1
  424. package/dist/assets/loader-circle-B35NlHTI.js +0 -1
  425. package/dist/assets/logo-badge-DB51c0cS.js +0 -1
  426. package/dist/assets/mcp-marketplace-page-CkPtwPBk.js +0 -1
  427. package/dist/assets/mcp-marketplace-page-DWtsIqml.js +0 -9
  428. package/dist/assets/model-config-page-D6cGNnMM.js +0 -1
  429. package/dist/assets/navigation-link-BSJEUiwD.js +0 -1
  430. package/dist/assets/packet-7NZHBO7P-6IFyydij.js +0 -1
  431. package/dist/assets/pie-RZYD4A2V-spXQC_wr.js +0 -1
  432. package/dist/assets/plus-BRVe5jSJ.js +0 -1
  433. package/dist/assets/popover-Bp9IpE_N.js +0 -1
  434. package/dist/assets/provider-models-CXUgDxGR.js +0 -1
  435. package/dist/assets/provider-scoped-model-input-dk7fz9NL.js +0 -1
  436. package/dist/assets/providers-config-page-DTP2YfxA.js +0 -1
  437. package/dist/assets/radar-I7S5WNFK-DWVA8lvY.js +0 -1
  438. package/dist/assets/railroad-3IZDKUUU-Ce51u8y1.js +0 -1
  439. package/dist/assets/railroad-abnf-AHOZXSZD-D7i7cqI_.js +0 -1
  440. package/dist/assets/railroad-ebnf-EBAXGLYW-BEg2hcPs.js +0 -1
  441. package/dist/assets/railroad-peg-LSFZ7HO6-CxROSzbi.js +0 -1
  442. package/dist/assets/react-D6ShNq95.js +0 -8
  443. package/dist/assets/remote-FllhXW3o.js +0 -1
  444. package/dist/assets/rotate-cw-CTC-Qszi.js +0 -1
  445. package/dist/assets/runtime-config-page-C57OLdPm.js +0 -1
  446. package/dist/assets/search-config-page-tnJXaaSr.js +0 -1
  447. package/dist/assets/security-config-S00DjFfO.js +0 -1
  448. package/dist/assets/select-CNFBf00l.js +0 -1
  449. package/dist/assets/skeleton-Dc06gatK.js +0 -1
  450. package/dist/assets/stateDiagram-v2-6OUMAXLB-Bui4RXQK.js +0 -1
  451. package/dist/assets/swimlanesDiagram-G3AALYLV-DTwUsCBz.js +0 -8
  452. package/dist/assets/tabs-BuNr8LSO.js +0 -1
  453. package/dist/assets/trash-2-GchaJuEM.js +0 -1
  454. package/dist/assets/treeView-QDETBFTQ-D5zsTiuL.js +0 -1
  455. package/dist/assets/treemap-6X3UGDF4-CR3dxqNs.js +0 -1
  456. package/dist/assets/use-config-C69rR15i.js +0 -1
  457. package/dist/assets/use-confirm-dialog-DF_EgPYx.js +0 -1
  458. package/dist/assets/use-viewport-layout-BACNZyMY.js +0 -1
  459. package/dist/assets/wardley-OPB4EBWU-LatRT_Lx.js +0 -1
  460. package/dist/assets/x-BXFquY9e.js +0 -1
  461. package/src/features/chat/features/welcome/components/chat-welcome-capability-grid.tsx +0 -59
  462. /package/dist/assets/{array-CAkJT3no.js → array-NADKd9aU.js} +0 -0
  463. /package/dist/assets/{chunk-KEIR6QF5-BgdDoWEH.js → chunk-KEIR6QF5-BuyuzJJL.js} +0 -0
  464. /package/dist/assets/{chunk-Y2CYZVJY-pTllD0P3.js → chunk-Y2CYZVJY-D_B2ZRNt.js} +0 -0
  465. /package/dist/assets/{config-hints-S3g-UVZb.js → config-hints-BcfVUMij.js} +0 -0
  466. /package/dist/assets/{cytoscape.esm-DmURt-5G.js → cytoscape.esm-BANTlgza.js} +0 -0
  467. /package/dist/assets/{defaultLocale-BKy_KP3O.js → defaultLocale-C4_L0aEs.js} +0 -0
  468. /package/dist/assets/{dist-IgNNB7K9.js → dist-DAPEIJbz.js} +0 -0
  469. /package/dist/assets/{graphlib-xw_TBHyH.js → graphlib-ChqXg0dI.js} +0 -0
  470. /package/dist/assets/{init-C9xlLIAu.js → init-D8wZg9xq.js} +0 -0
  471. /package/dist/assets/{jszip.min-Das2IAnb.js → jszip.min-CkbBfwAQ.js} +0 -0
  472. /package/dist/assets/{katex-DSy1eD2d.js → katex-TZJFa0J_.js} +0 -0
  473. /package/dist/assets/{middleware-Df-a4x-q.js → middleware-B3k-TSmZ.js} +0 -0
  474. /package/dist/assets/{path-DB0USYHi.js → path-DodfxcX7.js} +0 -0
  475. /package/dist/assets/{rough.esm-B1B52ZQS.js → rough.esm-CUaa1Rbe.js} +0 -0
  476. /package/dist/assets/{xlsx-DfjC_iml.js → xlsx-CxByi7bR.js} +0 -0
@@ -0,0 +1,106 @@
1
+ import { describe, expect, it, vi } from "vitest";
2
+ import { ChatComposerIntentManager } from "@/features/chat/managers/chat-composer-intent.manager";
3
+
4
+ describe("ChatComposerIntentManager", () => {
5
+ it("delivers a file reference only to the targeted composer", () => {
6
+ const manager = new ChatComposerIntentManager();
7
+ const draftListener = vi.fn();
8
+ const sessionListener = vi.fn();
9
+ manager.subscribe(null, draftListener);
10
+ manager.subscribe("session-1", sessionListener);
11
+
12
+ manager.requestFileReference({
13
+ targetSessionKey: null,
14
+ tokenKey: "docs/guide.md",
15
+ label: "guide.md",
16
+ });
17
+
18
+ expect(draftListener).toHaveBeenCalledWith(
19
+ expect.objectContaining({
20
+ targetSessionKey: null,
21
+ tokenKey: "docs/guide.md",
22
+ label: "guide.md",
23
+ }),
24
+ );
25
+ expect(sessionListener).not.toHaveBeenCalled();
26
+ });
27
+
28
+ it("keeps an intent pending until its matching composer mounts", () => {
29
+ const manager = new ChatComposerIntentManager();
30
+ manager.requestFileReference({
31
+ targetSessionKey: " session-1 ",
32
+ tokenKey: " src/index.ts ",
33
+ label: " index.ts ",
34
+ });
35
+
36
+ expect(manager.consumePending(null)).toBeNull();
37
+ expect(manager.consumePending("session-1")).toMatchObject({
38
+ targetSessionKey: "session-1",
39
+ tokenKey: "src/index.ts",
40
+ label: "index.ts",
41
+ });
42
+ expect(manager.consumePending("session-1")).toBeNull();
43
+ });
44
+
45
+ it("ignores incomplete file references", () => {
46
+ const manager = new ChatComposerIntentManager();
47
+ const listener = vi.fn();
48
+ manager.subscribe(null, listener);
49
+
50
+ manager.requestFileReference({
51
+ targetSessionKey: null,
52
+ tokenKey: " ",
53
+ label: "README.md",
54
+ });
55
+
56
+ expect(listener).not.toHaveBeenCalled();
57
+ expect(manager.consumePending(null)).toBeNull();
58
+ });
59
+
60
+ it("publishes a source-aware excerpt with a stable content identity", () => {
61
+ const manager = new ChatComposerIntentManager();
62
+ const listener = vi.fn();
63
+ manager.subscribe("session-1", listener);
64
+
65
+ manager.requestExcerptReference({
66
+ targetSessionKey: "session-1",
67
+ path: "docs/guide.md",
68
+ label: "guide.md",
69
+ excerpt: "selected text",
70
+ startLine: 12,
71
+ endLine: 13,
72
+ });
73
+
74
+ expect(listener).toHaveBeenCalledWith(expect.objectContaining({
75
+ kind: "workspace_excerpt",
76
+ path: "docs/guide.md",
77
+ label: "guide.md",
78
+ excerpt: "selected text",
79
+ startLine: 12,
80
+ endLine: 13,
81
+ tokenKey: expect.stringMatching(/^docs\/guide\.md#excerpt-/),
82
+ }));
83
+ });
84
+
85
+ it("delivers an excerpt to the unmaterialized new-chat composer", () => {
86
+ const manager = new ChatComposerIntentManager();
87
+ const draftListener = vi.fn();
88
+ manager.subscribe(null, draftListener);
89
+
90
+ manager.requestExcerptReference({
91
+ targetSessionKey: null,
92
+ path: "package.json",
93
+ label: "package.json",
94
+ excerpt: '"name": "nextclaw"',
95
+ startLine: 2,
96
+ endLine: 2,
97
+ });
98
+
99
+ expect(draftListener).toHaveBeenCalledWith(expect.objectContaining({
100
+ targetSessionKey: null,
101
+ kind: "workspace_excerpt",
102
+ path: "package.json",
103
+ excerpt: '"name": "nextclaw"',
104
+ }));
105
+ });
106
+ });
@@ -55,6 +55,7 @@ function resetChatSessionListManagerState() {
55
55
  useChatThreadStore.setState({
56
56
  snapshot: {
57
57
  ...useChatThreadStore.getState().snapshot,
58
+ draftProjectRoot: null,
58
59
  workspacePanelParentKey: "session-1",
59
60
  activeWorkspacePanelKind: "child-session",
60
61
  activeChildSessionKey: "child-session-1",
@@ -70,6 +71,18 @@ function resetChatSessionListManagerState() {
70
71
  describe("ChatSessionListManager draft and selection flow", () => {
71
72
  beforeEach(resetChatSessionListManagerState);
72
73
 
74
+ it("clears the route-derived session selection outside session routes", () => {
75
+ const manager = new ChatSessionListManager(
76
+ {} as ConstructorParameters<typeof ChatSessionListManager>[0],
77
+ );
78
+
79
+ manager.syncRouteSessionSelection(null);
80
+
81
+ expect(
82
+ useChatSessionListStore.getState().snapshot.selectedSessionKey,
83
+ ).toBeNull();
84
+ });
85
+
73
86
  it("applies the requested session type when creating a session", () => {
74
87
  const uiManager = {
75
88
  goToChatRoot: vi.fn(),
@@ -93,7 +106,7 @@ describe("ChatSessionListManager draft and selection flow", () => {
93
106
  });
94
107
  expect(
95
108
  useChatSessionListStore.getState().snapshot.selectedSessionKey,
96
- ).toBeNull();
109
+ ).toBe("session-1");
97
110
  expect(useChatThreadStore.getState().snapshot.sessionKey).toBeNull();
98
111
  expect(
99
112
  useChatThreadStore.getState().snapshot.hasSubmittedDraftMessage,
@@ -109,7 +122,7 @@ describe("ChatSessionListManager draft and selection flow", () => {
109
122
  } as unknown as ConstructorParameters<typeof ChatSessionListManager>[0];
110
123
 
111
124
  const manager = new ChatSessionListManager(uiManager);
112
- manager.startAgentDraftChat("researcher", "codex");
125
+ manager.startAgentDraftChat("researcher", "codex", "Create an agent");
113
126
 
114
127
  expect(uiManager.navigateTo).toHaveBeenCalledWith("/chat/draft", {
115
128
  replace: true,
@@ -117,7 +130,7 @@ describe("ChatSessionListManager draft and selection flow", () => {
117
130
  chatDraft: {
118
131
  sessionType: "codex",
119
132
  projectRoot: null,
120
- prompt: null,
133
+ prompt: "Create an agent",
121
134
  },
122
135
  },
123
136
  });
@@ -126,7 +139,7 @@ describe("ChatSessionListManager draft and selection flow", () => {
126
139
  );
127
140
  expect(
128
141
  useChatSessionListStore.getState().snapshot.selectedSessionKey,
129
- ).toBeNull();
142
+ ).toBe("session-1");
130
143
  expect(useChatThreadStore.getState().snapshot.sessionKey).toBeNull();
131
144
  expect(
132
145
  useChatThreadStore.getState().snapshot.hasSubmittedDraftMessage,
@@ -157,6 +170,41 @@ describe("ChatSessionListManager draft and selection flow", () => {
157
170
  },
158
171
  },
159
172
  });
173
+ expect(useChatThreadStore.getState().snapshot.draftProjectRoot).toBe(
174
+ "/tmp/project-alpha",
175
+ );
176
+ });
177
+
178
+ it("drops file tabs from an abandoned draft while preserving real session tabs", () => {
179
+ useChatThreadStore.getState().setSnapshot({
180
+ workspaceFileTabs: [
181
+ {
182
+ key: "draft::preview::old.md",
183
+ parentSessionKey: null,
184
+ path: "old.md",
185
+ viewMode: "preview",
186
+ },
187
+ {
188
+ key: "session-1::preview::kept.md",
189
+ parentSessionKey: "session-1",
190
+ path: "kept.md",
191
+ viewMode: "preview",
192
+ },
193
+ ],
194
+ });
195
+ const manager = new ChatSessionListManager({
196
+ navigateTo: vi.fn(),
197
+ isAtChatRoot: vi.fn(() => true),
198
+ } as unknown as ConstructorParameters<typeof ChatSessionListManager>[0]);
199
+
200
+ manager.createSession({ projectRoot: "/tmp/new-project" });
201
+
202
+ expect(useChatThreadStore.getState().snapshot.workspaceFileTabs).toEqual([
203
+ expect.objectContaining({
204
+ key: "session-1::preview::kept.md",
205
+ parentSessionKey: "session-1",
206
+ }),
207
+ ]);
160
208
  });
161
209
 
162
210
  it("carries an initial prompt through the draft route state", () => {
@@ -198,7 +246,7 @@ describe("ChatSessionListManager draft and selection flow", () => {
198
246
 
199
247
  expect(
200
248
  useChatSessionListStore.getState().snapshot.selectedSessionKey,
201
- ).toBeNull();
249
+ ).toBe("session-1");
202
250
  expect(uiManager.navigateTo).toHaveBeenCalledWith(
203
251
  "/chat/draft",
204
252
  expect.any(Object),
@@ -3,9 +3,11 @@ import { ChatThreadManager } from '@/features/chat/managers/chat-thread.manager'
3
3
  import { useChatSessionListStore } from '@/features/chat/stores/chat-session-list.store';
4
4
  import { useChatThreadStore } from '@/features/chat/stores/chat-thread.store';
5
5
 
6
- function createUiManager(): ConstructorParameters<typeof ChatThreadManager>[0] {
6
+ function createUiManager(overrides: Record<string, unknown> = {}): ConstructorParameters<typeof ChatThreadManager>[0] {
7
7
  return {
8
8
  goToSession: vi.fn(),
9
+ isAtChatRoot: vi.fn(() => true),
10
+ ...overrides,
9
11
  } as unknown as ConstructorParameters<typeof ChatThreadManager>[0];
10
12
  }
11
13
 
@@ -24,6 +26,8 @@ describe('ChatThreadManager workspace pages', () => {
24
26
  activeWorkspacePanelKind: null,
25
27
  activeChildSessionKey: null,
26
28
  activeWorkspaceFileKey: null,
29
+ draftProjectRoot: null,
30
+ workspaceFileTabs: [],
27
31
  closedWorkspaceTabEntries: [],
28
32
  workspaceNavigationHistory: [],
29
33
  workspaceNavigationHistoryIndex: 0,
@@ -75,6 +79,94 @@ describe('ChatThreadManager workspace pages', () => {
75
79
  });
76
80
  });
77
81
 
82
+ it('opens project files for a draft without exposing session-only pages', () => {
83
+ const manager = new ChatThreadManager(
84
+ createUiManager(),
85
+ {} as ConstructorParameters<typeof ChatThreadManager>[1],
86
+ );
87
+
88
+ manager.toggleWorkspacePanel(null);
89
+
90
+ expect(useChatThreadStore.getState().snapshot).toMatchObject({
91
+ workspacePanelParentKey: null,
92
+ activeWorkspacePanelKind: 'project-files',
93
+ workspaceNavigationHistory: [{ kind: 'project-files' }],
94
+ });
95
+ });
96
+
97
+ it('materializes the draft selection, workspace, and route as one owner action', () => {
98
+ useChatThreadStore.setState({
99
+ snapshot: {
100
+ ...useChatThreadStore.getState().snapshot,
101
+ draftProjectRoot: '/tmp/project-alpha',
102
+ workspacePanelParentKey: null,
103
+ activeWorkspacePanelKind: 'file',
104
+ activeWorkspaceFileKey: 'draft::preview::README.md',
105
+ workspaceFileTabs: [
106
+ {
107
+ key: 'draft::preview::README.md',
108
+ parentSessionKey: null,
109
+ path: 'README.md',
110
+ viewMode: 'preview',
111
+ },
112
+ ],
113
+ workspaceNavigationHistory: [
114
+ { kind: 'project-files' },
115
+ { kind: 'file', key: 'draft::preview::README.md' },
116
+ ],
117
+ workspaceNavigationHistoryIndex: 1,
118
+ },
119
+ });
120
+ const uiManager = createUiManager();
121
+ const syncRouteSessionSelection = vi.fn((sessionKey: string) => {
122
+ useChatSessionListStore.getState().setSnapshot({ selectedSessionKey: sessionKey });
123
+ useChatThreadStore.getState().setSnapshot({ draftProjectRoot: null });
124
+ });
125
+ const manager = new ChatThreadManager(uiManager, {
126
+ syncRouteSessionSelection,
127
+ } as unknown as ConstructorParameters<typeof ChatThreadManager>[1]);
128
+
129
+ manager.materializeRootDraftSession('materialized-session');
130
+
131
+ expect(syncRouteSessionSelection).toHaveBeenCalledWith('materialized-session');
132
+ expect(useChatThreadStore.getState().snapshot).toMatchObject({
133
+ draftProjectRoot: null,
134
+ workspacePanelParentKey: 'materialized-session',
135
+ activeWorkspacePanelKind: 'file',
136
+ activeWorkspaceFileKey:
137
+ 'materialized-session::preview::README.md',
138
+ workspaceFileTabs: [
139
+ expect.objectContaining({
140
+ key: 'materialized-session::preview::README.md',
141
+ parentSessionKey: 'materialized-session',
142
+ }),
143
+ ],
144
+ workspaceNavigationHistory: [
145
+ { kind: 'project-files' },
146
+ {
147
+ kind: 'file',
148
+ key: 'materialized-session::preview::README.md',
149
+ },
150
+ ],
151
+ });
152
+ expect(uiManager.goToSession).toHaveBeenCalledWith('materialized-session', {
153
+ replace: true,
154
+ });
155
+ });
156
+
157
+ it('ignores draft materialization after leaving the root route', () => {
158
+ const uiManager = createUiManager({ isAtChatRoot: vi.fn(() => false) });
159
+ const syncRouteSessionSelection = vi.fn();
160
+ const manager = new ChatThreadManager(uiManager, {
161
+ syncRouteSessionSelection,
162
+ } as unknown as ConstructorParameters<typeof ChatThreadManager>[1]);
163
+
164
+ manager.materializeRootDraftSession('materialized-session');
165
+
166
+ expect(syncRouteSessionSelection).not.toHaveBeenCalled();
167
+ expect(uiManager.goToSession).not.toHaveBeenCalled();
168
+ });
169
+
78
170
  it('does not close fixed workspace pages', () => {
79
171
  const manager = new ChatThreadManager(
80
172
  createUiManager(),
@@ -836,7 +836,7 @@ describe('ChatThreadManager visible workspace selection', () => {
836
836
  });
837
837
 
838
838
  describe('ChatThreadManager deletion', () => {
839
- it('clears the selected thread state after deleting the current session', async () => {
839
+ it('clears thread state while leaving route-derived selection to navigation', async () => {
840
840
  const removeQueries = vi.spyOn(appQueryClient, 'removeQueries').mockImplementation(async () => undefined);
841
841
  const uiManager = {
842
842
  goToSession: vi.fn(),
@@ -844,13 +844,7 @@ describe('ChatThreadManager deletion', () => {
844
844
  goToProviders: vi.fn(),
845
845
  confirm: vi.fn(async () => true),
846
846
  } as unknown as ConstructorParameters<typeof ChatThreadManager>[0];
847
- const sessionListManager = {
848
- setSelectedSessionKey: vi.fn((value: string | null) => {
849
- useChatSessionListStore.getState().setSnapshot({
850
- selectedSessionKey: value,
851
- });
852
- }),
853
- } as unknown as ConstructorParameters<typeof ChatThreadManager>[1];
847
+ const sessionListManager = {} as ConstructorParameters<typeof ChatThreadManager>[1];
854
848
  const manager = new ChatThreadManager(
855
849
  uiManager,
856
850
  sessionListManager,
@@ -858,8 +852,7 @@ describe('ChatThreadManager deletion', () => {
858
852
 
859
853
  await manager.deleteSession();
860
854
 
861
- expect(sessionListManager.setSelectedSessionKey).toHaveBeenCalledWith(null);
862
- expect(useChatSessionListStore.getState().snapshot.selectedSessionKey).toBeNull();
855
+ expect(useChatSessionListStore.getState().snapshot.selectedSessionKey).toBe('parent-session-1');
863
856
  expect(useChatThreadStore.getState().snapshot).toMatchObject({
864
857
  sessionKey: null,
865
858
  canDeleteSession: false,
@@ -0,0 +1,57 @@
1
+ import { beforeEach, describe, expect, it } from 'vitest';
2
+ import {
3
+ LARGE_PROVIDER_MODEL_CATALOG_THRESHOLD,
4
+ ProviderModelCatalogNoticeManager,
5
+ } from '@/features/chat/managers/provider-model-catalog-notice.manager';
6
+
7
+ function buildOptions(providerId: string, count: number) {
8
+ return Array.from({ length: count }, (_, index) => ({
9
+ providerId,
10
+ value: `${providerId}/model-${index + 1}`,
11
+ }));
12
+ }
13
+
14
+ describe('ProviderModelCatalogNoticeManager', () => {
15
+ beforeEach(() => {
16
+ window.localStorage.clear();
17
+ });
18
+
19
+ it('treats a first large catalog as a browseable baseline and only surfaces later additions', () => {
20
+ const manager = new ProviderModelCatalogNoticeManager();
21
+ const initial = buildOptions('openrouter', LARGE_PROVIDER_MODEL_CATALOG_THRESHOLD + 1);
22
+
23
+ expect(manager.filterUnseen(initial)).toEqual([]);
24
+ expect(manager.initializeLargeCatalogs(initial)).toBe(true);
25
+ expect(manager.filterUnseen([...initial, {
26
+ providerId: 'openrouter',
27
+ value: 'openrouter/new-after-baseline',
28
+ }])).toEqual([{
29
+ providerId: 'openrouter',
30
+ value: 'openrouter/new-after-baseline',
31
+ }]);
32
+ });
33
+
34
+ it('keeps small-catalog additions visible until the user marks the batch as seen', () => {
35
+ const manager = new ProviderModelCatalogNoticeManager();
36
+ const initial = buildOptions('opencode', 2);
37
+
38
+ expect(manager.filterUnseen(initial)).toEqual(initial);
39
+ expect(manager.acknowledge(initial)).toBe(true);
40
+ expect(manager.filterUnseen(initial)).toEqual([]);
41
+ expect(manager.filterUnseen([...initial, {
42
+ providerId: 'opencode',
43
+ value: 'opencode/new-after-seen',
44
+ }])).toEqual([{
45
+ providerId: 'opencode',
46
+ value: 'opencode/new-after-seen',
47
+ }]);
48
+ });
49
+
50
+ it('recovers from invalid persisted data without suppressing a small catalog', () => {
51
+ window.localStorage.setItem('nextclaw.chat.provider-model-catalog-notices', '{broken-json');
52
+ const manager = new ProviderModelCatalogNoticeManager();
53
+ const options = buildOptions('opencode', 1);
54
+
55
+ expect(manager.filterUnseen(options)).toEqual(options);
56
+ });
57
+ });
@@ -0,0 +1,145 @@
1
+ import {
2
+ CHAT_WORKSPACE_EXCERPT_TOKEN_KIND,
3
+ CHAT_WORKSPACE_FILE_TOKEN_KIND,
4
+ } from "@nextclaw/shared";
5
+
6
+ type ChatComposerReferenceIntentBase = {
7
+ id: number;
8
+ targetSessionKey: string | null;
9
+ tokenKey: string;
10
+ label: string;
11
+ };
12
+
13
+ export type ChatComposerFileReferenceIntent = ChatComposerReferenceIntentBase & {
14
+ kind: typeof CHAT_WORKSPACE_FILE_TOKEN_KIND;
15
+ };
16
+
17
+ export type ChatComposerExcerptReferenceIntent = ChatComposerReferenceIntentBase & {
18
+ kind: typeof CHAT_WORKSPACE_EXCERPT_TOKEN_KIND;
19
+ path: string;
20
+ excerpt: string;
21
+ startLine: number | null;
22
+ endLine: number | null;
23
+ };
24
+
25
+ export type ChatComposerReferenceIntent =
26
+ | ChatComposerFileReferenceIntent
27
+ | ChatComposerExcerptReferenceIntent;
28
+
29
+ type ChatComposerReferenceRequest =
30
+ | Omit<ChatComposerFileReferenceIntent, "id">
31
+ | Omit<ChatComposerExcerptReferenceIntent, "id">;
32
+
33
+ type ChatComposerIntentListener = (intent: ChatComposerReferenceIntent) => void;
34
+
35
+ type ChatComposerIntentSubscription = {
36
+ targetSessionKey: string | null;
37
+ listener: ChatComposerIntentListener;
38
+ };
39
+
40
+ export class ChatComposerIntentManager {
41
+ private nextId = 0;
42
+ private pendingIntent: ChatComposerReferenceIntent | null = null;
43
+ private readonly subscriptions = new Set<ChatComposerIntentSubscription>();
44
+
45
+ private publish = (intent: ChatComposerReferenceRequest) => {
46
+ const id = this.nextId + 1;
47
+ const targetSessionKey = intent.targetSessionKey?.trim() || null;
48
+ const nextIntent: ChatComposerReferenceIntent = intent.kind === CHAT_WORKSPACE_FILE_TOKEN_KIND
49
+ ? { ...intent, id, targetSessionKey }
50
+ : { ...intent, id, targetSessionKey };
51
+ this.nextId = nextIntent.id;
52
+ this.pendingIntent = nextIntent;
53
+ this.subscriptions.forEach((subscription) => {
54
+ if (subscription.targetSessionKey === nextIntent.targetSessionKey) {
55
+ subscription.listener(nextIntent);
56
+ }
57
+ });
58
+ };
59
+
60
+ requestFileReference = (params: {
61
+ targetSessionKey: string | null;
62
+ tokenKey: string;
63
+ label: string;
64
+ }) => {
65
+ const tokenKey = params.tokenKey.trim();
66
+ const label = params.label.trim();
67
+ if (!tokenKey || !label) {
68
+ return;
69
+ }
70
+ this.publish({
71
+ kind: CHAT_WORKSPACE_FILE_TOKEN_KIND,
72
+ targetSessionKey: params.targetSessionKey?.trim() || null,
73
+ tokenKey,
74
+ label,
75
+ });
76
+ };
77
+
78
+ requestExcerptReference = (params: {
79
+ targetSessionKey: string | null;
80
+ path: string;
81
+ label: string;
82
+ excerpt: string;
83
+ startLine: number | null;
84
+ endLine: number | null;
85
+ }) => {
86
+ const {
87
+ endLine,
88
+ excerpt: rawExcerpt,
89
+ label: rawLabel,
90
+ path: rawPath,
91
+ startLine,
92
+ targetSessionKey,
93
+ } = params;
94
+ const path = rawPath.trim();
95
+ const label = rawLabel.trim();
96
+ const excerpt = rawExcerpt.trim();
97
+ if (!path || !label || !excerpt) {
98
+ return;
99
+ }
100
+ const identity = `${path}:${startLine ?? "x"}:${endLine ?? "x"}:${excerpt}`;
101
+ let hash = 2166136261;
102
+ for (let index = 0; index < identity.length; index += 1) {
103
+ hash ^= identity.charCodeAt(index);
104
+ hash = Math.imul(hash, 16777619);
105
+ }
106
+ this.publish({
107
+ kind: CHAT_WORKSPACE_EXCERPT_TOKEN_KIND,
108
+ targetSessionKey,
109
+ tokenKey: `${path}#excerpt-${(hash >>> 0).toString(36)}`,
110
+ path,
111
+ label,
112
+ excerpt,
113
+ startLine,
114
+ endLine,
115
+ });
116
+ };
117
+
118
+ consumePending = (
119
+ targetSessionKey: string | null,
120
+ ): ChatComposerReferenceIntent | null => {
121
+ if (this.pendingIntent?.targetSessionKey !== targetSessionKey) {
122
+ return null;
123
+ }
124
+ const intent = this.pendingIntent;
125
+ this.pendingIntent = null;
126
+ return intent;
127
+ };
128
+
129
+ markConsumed = (intentId: number) => {
130
+ if (this.pendingIntent?.id === intentId) {
131
+ this.pendingIntent = null;
132
+ }
133
+ };
134
+
135
+ subscribe = (
136
+ targetSessionKey: string | null,
137
+ listener: ChatComposerIntentListener,
138
+ ) => {
139
+ const subscription = { targetSessionKey, listener };
140
+ this.subscriptions.add(subscription);
141
+ return () => {
142
+ this.subscriptions.delete(subscription);
143
+ };
144
+ };
145
+ }
@@ -36,10 +36,14 @@ function toggleListValue(values: string[], value: string): string[] {
36
36
  export class ChatSessionListManager {
37
37
  constructor(private uiManager: ChatUiManager) {}
38
38
 
39
- private syncDraftThreadState = () => {
39
+ private syncDraftThreadState = (draftProjectRoot: string | null) => {
40
+ const workspaceFileTabs = useChatThreadStore
41
+ .getState()
42
+ .snapshot.workspaceFileTabs.filter((tab) => tab.parentSessionKey !== null);
40
43
  useChatThreadStore.getState().setSnapshot({
41
44
  sessionKey: null,
42
45
  sessionDisplayName: undefined,
46
+ draftProjectRoot,
43
47
  canDeleteSession: false,
44
48
  parentSessionKey: null,
45
49
  parentSessionLabel: null,
@@ -47,7 +51,9 @@ export class ChatSessionListManager {
47
51
  activeWorkspacePanelKind: null,
48
52
  childSessionTabs: [],
49
53
  activeChildSessionKey: null,
54
+ activeSideChatDraft: null,
50
55
  activeWorkspaceFileKey: null,
56
+ workspaceFileTabs,
51
57
  closedWorkspaceTabEntries: [],
52
58
  workspaceNavigationHistory: [],
53
59
  workspaceNavigationHistoryIndex: 0,
@@ -100,9 +106,8 @@ export class ChatSessionListManager {
100
106
  this.setSelectedAgentId(normalizedAgentId);
101
107
  };
102
108
 
103
- setSelectedSessionKey = (next: SetStateAction<string | null>) => {
109
+ private setSelectedSessionKey = (value: string | null) => {
104
110
  const prev = useChatSessionListStore.getState().snapshot.selectedSessionKey;
105
- const value = this.resolveUpdateValue(prev, next);
106
111
  if (value === prev) {
107
112
  return;
108
113
  }
@@ -111,23 +116,10 @@ export class ChatSessionListManager {
111
116
  .setSnapshot({ selectedSessionKey: value });
112
117
  };
113
118
 
114
- syncRouteSessionSelection = (params: {
115
- isChatView: boolean;
116
- routeSessionKey: string | null;
117
- }) => {
118
- const { isChatView, routeSessionKey } = params;
119
- if (!isChatView) {
120
- return;
121
- }
122
- const { selectedSessionKey } = useChatSessionListStore.getState().snapshot;
119
+ syncRouteSessionSelection = (routeSessionKey: string | null) => {
120
+ this.setSelectedSessionKey(routeSessionKey);
123
121
  if (routeSessionKey) {
124
- if (selectedSessionKey !== routeSessionKey) {
125
- this.setSelectedSessionKey(routeSessionKey);
126
- }
127
- return;
128
- }
129
- if (selectedSessionKey !== null) {
130
- this.setSelectedSessionKey(null);
122
+ useChatThreadStore.getState().setSnapshot({ draftProjectRoot: null });
131
123
  }
132
124
  };
133
125
 
@@ -207,10 +199,7 @@ export class ChatSessionListManager {
207
199
  );
208
200
  const normalizedProjectRoot = normalizeSessionProjectRootValue(projectRoot);
209
201
  const normalizedPrompt = prompt?.trim() || null;
210
- useChatSessionListStore.getState().setSnapshot({
211
- selectedSessionKey: null,
212
- });
213
- this.syncDraftThreadState();
202
+ this.syncDraftThreadState(normalizedProjectRoot);
214
203
  this.uiManager.navigateTo(CHAT_DRAFT_SESSION_PATH, {
215
204
  replace: this.uiManager.isAtChatRoot(),
216
205
  state: {
@@ -223,9 +212,9 @@ export class ChatSessionListManager {
223
212
  });
224
213
  };
225
214
 
226
- startAgentDraftChat = (agentId: string, sessionType: string): void => {
215
+ startAgentDraftChat = (agentId: string, sessionType: string, prompt?: string): void => {
227
216
  const normalizedAgentId = agentId.trim() || "main";
228
- this.createSession({ sessionType });
217
+ this.createSession({ prompt, sessionType });
229
218
  this.setSelectedAgentId(normalizedAgentId);
230
219
  };
231
220