@allbluecn/web-app 0.27.41 → 0.28.1

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 (342) hide show
  1. package/package.json +4 -3
  2. package/public/pdfjs/cmaps/78-EUC-H.bcmap +0 -0
  3. package/public/pdfjs/cmaps/78-EUC-V.bcmap +0 -0
  4. package/public/pdfjs/cmaps/78-H.bcmap +0 -0
  5. package/public/pdfjs/cmaps/78-RKSJ-H.bcmap +0 -0
  6. package/public/pdfjs/cmaps/78-RKSJ-V.bcmap +0 -0
  7. package/public/pdfjs/cmaps/78-V.bcmap +0 -0
  8. package/public/pdfjs/cmaps/78ms-RKSJ-H.bcmap +0 -0
  9. package/public/pdfjs/cmaps/78ms-RKSJ-V.bcmap +0 -0
  10. package/public/pdfjs/cmaps/83pv-RKSJ-H.bcmap +0 -0
  11. package/public/pdfjs/cmaps/90ms-RKSJ-H.bcmap +0 -0
  12. package/public/pdfjs/cmaps/90ms-RKSJ-V.bcmap +0 -0
  13. package/public/pdfjs/cmaps/90msp-RKSJ-H.bcmap +0 -0
  14. package/public/pdfjs/cmaps/90msp-RKSJ-V.bcmap +0 -0
  15. package/public/pdfjs/cmaps/90pv-RKSJ-H.bcmap +0 -0
  16. package/public/pdfjs/cmaps/90pv-RKSJ-V.bcmap +0 -0
  17. package/public/pdfjs/cmaps/Add-H.bcmap +0 -0
  18. package/public/pdfjs/cmaps/Add-RKSJ-H.bcmap +0 -0
  19. package/public/pdfjs/cmaps/Add-RKSJ-V.bcmap +0 -0
  20. package/public/pdfjs/cmaps/Add-V.bcmap +0 -0
  21. package/public/pdfjs/cmaps/Adobe-CNS1-0.bcmap +0 -0
  22. package/public/pdfjs/cmaps/Adobe-CNS1-1.bcmap +0 -0
  23. package/public/pdfjs/cmaps/Adobe-CNS1-2.bcmap +0 -0
  24. package/public/pdfjs/cmaps/Adobe-CNS1-3.bcmap +0 -0
  25. package/public/pdfjs/cmaps/Adobe-CNS1-4.bcmap +0 -0
  26. package/public/pdfjs/cmaps/Adobe-CNS1-5.bcmap +0 -0
  27. package/public/pdfjs/cmaps/Adobe-CNS1-6.bcmap +0 -0
  28. package/public/pdfjs/cmaps/Adobe-CNS1-UCS2.bcmap +0 -0
  29. package/public/pdfjs/cmaps/Adobe-GB1-0.bcmap +0 -0
  30. package/public/pdfjs/cmaps/Adobe-GB1-1.bcmap +0 -0
  31. package/public/pdfjs/cmaps/Adobe-GB1-2.bcmap +0 -0
  32. package/public/pdfjs/cmaps/Adobe-GB1-3.bcmap +0 -0
  33. package/public/pdfjs/cmaps/Adobe-GB1-4.bcmap +0 -0
  34. package/public/pdfjs/cmaps/Adobe-GB1-5.bcmap +0 -0
  35. package/public/pdfjs/cmaps/Adobe-GB1-UCS2.bcmap +0 -0
  36. package/public/pdfjs/cmaps/Adobe-Japan1-0.bcmap +0 -0
  37. package/public/pdfjs/cmaps/Adobe-Japan1-1.bcmap +0 -0
  38. package/public/pdfjs/cmaps/Adobe-Japan1-2.bcmap +0 -0
  39. package/public/pdfjs/cmaps/Adobe-Japan1-3.bcmap +0 -0
  40. package/public/pdfjs/cmaps/Adobe-Japan1-4.bcmap +0 -0
  41. package/public/pdfjs/cmaps/Adobe-Japan1-5.bcmap +0 -0
  42. package/public/pdfjs/cmaps/Adobe-Japan1-6.bcmap +0 -0
  43. package/public/pdfjs/cmaps/Adobe-Japan1-UCS2.bcmap +0 -0
  44. package/public/pdfjs/cmaps/Adobe-Korea1-0.bcmap +0 -0
  45. package/public/pdfjs/cmaps/Adobe-Korea1-1.bcmap +0 -0
  46. package/public/pdfjs/cmaps/Adobe-Korea1-2.bcmap +0 -0
  47. package/public/pdfjs/cmaps/Adobe-Korea1-UCS2.bcmap +0 -0
  48. package/public/pdfjs/cmaps/B5-H.bcmap +0 -0
  49. package/public/pdfjs/cmaps/B5-V.bcmap +0 -0
  50. package/public/pdfjs/cmaps/B5pc-H.bcmap +0 -0
  51. package/public/pdfjs/cmaps/B5pc-V.bcmap +0 -0
  52. package/public/pdfjs/cmaps/CNS-EUC-H.bcmap +0 -0
  53. package/public/pdfjs/cmaps/CNS-EUC-V.bcmap +0 -0
  54. package/public/pdfjs/cmaps/CNS1-H.bcmap +0 -0
  55. package/public/pdfjs/cmaps/CNS1-V.bcmap +0 -0
  56. package/public/pdfjs/cmaps/CNS2-H.bcmap +0 -0
  57. package/public/pdfjs/cmaps/CNS2-V.bcmap +3 -0
  58. package/public/pdfjs/cmaps/ETHK-B5-H.bcmap +0 -0
  59. package/public/pdfjs/cmaps/ETHK-B5-V.bcmap +0 -0
  60. package/public/pdfjs/cmaps/ETen-B5-H.bcmap +0 -0
  61. package/public/pdfjs/cmaps/ETen-B5-V.bcmap +0 -0
  62. package/public/pdfjs/cmaps/ETenms-B5-H.bcmap +3 -0
  63. package/public/pdfjs/cmaps/ETenms-B5-V.bcmap +0 -0
  64. package/public/pdfjs/cmaps/EUC-H.bcmap +0 -0
  65. package/public/pdfjs/cmaps/EUC-V.bcmap +0 -0
  66. package/public/pdfjs/cmaps/Ext-H.bcmap +0 -0
  67. package/public/pdfjs/cmaps/Ext-RKSJ-H.bcmap +0 -0
  68. package/public/pdfjs/cmaps/Ext-RKSJ-V.bcmap +0 -0
  69. package/public/pdfjs/cmaps/Ext-V.bcmap +0 -0
  70. package/public/pdfjs/cmaps/GB-EUC-H.bcmap +0 -0
  71. package/public/pdfjs/cmaps/GB-EUC-V.bcmap +0 -0
  72. package/public/pdfjs/cmaps/GB-H.bcmap +4 -0
  73. package/public/pdfjs/cmaps/GB-V.bcmap +0 -0
  74. package/public/pdfjs/cmaps/GBK-EUC-H.bcmap +0 -0
  75. package/public/pdfjs/cmaps/GBK-EUC-V.bcmap +0 -0
  76. package/public/pdfjs/cmaps/GBK2K-H.bcmap +0 -0
  77. package/public/pdfjs/cmaps/GBK2K-V.bcmap +0 -0
  78. package/public/pdfjs/cmaps/GBKp-EUC-H.bcmap +0 -0
  79. package/public/pdfjs/cmaps/GBKp-EUC-V.bcmap +0 -0
  80. package/public/pdfjs/cmaps/GBT-EUC-H.bcmap +0 -0
  81. package/public/pdfjs/cmaps/GBT-EUC-V.bcmap +0 -0
  82. package/public/pdfjs/cmaps/GBT-H.bcmap +0 -0
  83. package/public/pdfjs/cmaps/GBT-V.bcmap +0 -0
  84. package/public/pdfjs/cmaps/GBTpc-EUC-H.bcmap +0 -0
  85. package/public/pdfjs/cmaps/GBTpc-EUC-V.bcmap +0 -0
  86. package/public/pdfjs/cmaps/GBpc-EUC-H.bcmap +0 -0
  87. package/public/pdfjs/cmaps/GBpc-EUC-V.bcmap +0 -0
  88. package/public/pdfjs/cmaps/H.bcmap +0 -0
  89. package/public/pdfjs/cmaps/HKdla-B5-H.bcmap +0 -0
  90. package/public/pdfjs/cmaps/HKdla-B5-V.bcmap +0 -0
  91. package/public/pdfjs/cmaps/HKdlb-B5-H.bcmap +0 -0
  92. package/public/pdfjs/cmaps/HKdlb-B5-V.bcmap +0 -0
  93. package/public/pdfjs/cmaps/HKgccs-B5-H.bcmap +0 -0
  94. package/public/pdfjs/cmaps/HKgccs-B5-V.bcmap +0 -0
  95. package/public/pdfjs/cmaps/HKm314-B5-H.bcmap +0 -0
  96. package/public/pdfjs/cmaps/HKm314-B5-V.bcmap +0 -0
  97. package/public/pdfjs/cmaps/HKm471-B5-H.bcmap +0 -0
  98. package/public/pdfjs/cmaps/HKm471-B5-V.bcmap +0 -0
  99. package/public/pdfjs/cmaps/HKscs-B5-H.bcmap +0 -0
  100. package/public/pdfjs/cmaps/HKscs-B5-V.bcmap +0 -0
  101. package/public/pdfjs/cmaps/Hankaku.bcmap +0 -0
  102. package/public/pdfjs/cmaps/Hiragana.bcmap +0 -0
  103. package/public/pdfjs/cmaps/KSC-EUC-H.bcmap +0 -0
  104. package/public/pdfjs/cmaps/KSC-EUC-V.bcmap +0 -0
  105. package/public/pdfjs/cmaps/KSC-H.bcmap +0 -0
  106. package/public/pdfjs/cmaps/KSC-Johab-H.bcmap +0 -0
  107. package/public/pdfjs/cmaps/KSC-Johab-V.bcmap +0 -0
  108. package/public/pdfjs/cmaps/KSC-V.bcmap +0 -0
  109. package/public/pdfjs/cmaps/KSCms-UHC-H.bcmap +0 -0
  110. package/public/pdfjs/cmaps/KSCms-UHC-HW-H.bcmap +0 -0
  111. package/public/pdfjs/cmaps/KSCms-UHC-HW-V.bcmap +0 -0
  112. package/public/pdfjs/cmaps/KSCms-UHC-V.bcmap +0 -0
  113. package/public/pdfjs/cmaps/KSCpc-EUC-H.bcmap +0 -0
  114. package/public/pdfjs/cmaps/KSCpc-EUC-V.bcmap +0 -0
  115. package/public/pdfjs/cmaps/Katakana.bcmap +0 -0
  116. package/public/pdfjs/cmaps/LICENSE +36 -0
  117. package/public/pdfjs/cmaps/NWP-H.bcmap +0 -0
  118. package/public/pdfjs/cmaps/NWP-V.bcmap +0 -0
  119. package/public/pdfjs/cmaps/RKSJ-H.bcmap +0 -0
  120. package/public/pdfjs/cmaps/RKSJ-V.bcmap +0 -0
  121. package/public/pdfjs/cmaps/Roman.bcmap +0 -0
  122. package/public/pdfjs/cmaps/UniCNS-UCS2-H.bcmap +0 -0
  123. package/public/pdfjs/cmaps/UniCNS-UCS2-V.bcmap +0 -0
  124. package/public/pdfjs/cmaps/UniCNS-UTF16-H.bcmap +0 -0
  125. package/public/pdfjs/cmaps/UniCNS-UTF16-V.bcmap +0 -0
  126. package/public/pdfjs/cmaps/UniCNS-UTF32-H.bcmap +0 -0
  127. package/public/pdfjs/cmaps/UniCNS-UTF32-V.bcmap +0 -0
  128. package/public/pdfjs/cmaps/UniCNS-UTF8-H.bcmap +0 -0
  129. package/public/pdfjs/cmaps/UniCNS-UTF8-V.bcmap +0 -0
  130. package/public/pdfjs/cmaps/UniGB-UCS2-H.bcmap +0 -0
  131. package/public/pdfjs/cmaps/UniGB-UCS2-V.bcmap +0 -0
  132. package/public/pdfjs/cmaps/UniGB-UTF16-H.bcmap +0 -0
  133. package/public/pdfjs/cmaps/UniGB-UTF16-V.bcmap +0 -0
  134. package/public/pdfjs/cmaps/UniGB-UTF32-H.bcmap +0 -0
  135. package/public/pdfjs/cmaps/UniGB-UTF32-V.bcmap +0 -0
  136. package/public/pdfjs/cmaps/UniGB-UTF8-H.bcmap +0 -0
  137. package/public/pdfjs/cmaps/UniGB-UTF8-V.bcmap +0 -0
  138. package/public/pdfjs/cmaps/UniJIS-UCS2-H.bcmap +0 -0
  139. package/public/pdfjs/cmaps/UniJIS-UCS2-HW-H.bcmap +0 -0
  140. package/public/pdfjs/cmaps/UniJIS-UCS2-HW-V.bcmap +0 -0
  141. package/public/pdfjs/cmaps/UniJIS-UCS2-V.bcmap +0 -0
  142. package/public/pdfjs/cmaps/UniJIS-UTF16-H.bcmap +0 -0
  143. package/public/pdfjs/cmaps/UniJIS-UTF16-V.bcmap +0 -0
  144. package/public/pdfjs/cmaps/UniJIS-UTF32-H.bcmap +0 -0
  145. package/public/pdfjs/cmaps/UniJIS-UTF32-V.bcmap +0 -0
  146. package/public/pdfjs/cmaps/UniJIS-UTF8-H.bcmap +0 -0
  147. package/public/pdfjs/cmaps/UniJIS-UTF8-V.bcmap +0 -0
  148. package/public/pdfjs/cmaps/UniJIS2004-UTF16-H.bcmap +0 -0
  149. package/public/pdfjs/cmaps/UniJIS2004-UTF16-V.bcmap +0 -0
  150. package/public/pdfjs/cmaps/UniJIS2004-UTF32-H.bcmap +0 -0
  151. package/public/pdfjs/cmaps/UniJIS2004-UTF32-V.bcmap +0 -0
  152. package/public/pdfjs/cmaps/UniJIS2004-UTF8-H.bcmap +0 -0
  153. package/public/pdfjs/cmaps/UniJIS2004-UTF8-V.bcmap +0 -0
  154. package/public/pdfjs/cmaps/UniJISPro-UCS2-HW-V.bcmap +0 -0
  155. package/public/pdfjs/cmaps/UniJISPro-UCS2-V.bcmap +0 -0
  156. package/public/pdfjs/cmaps/UniJISPro-UTF8-V.bcmap +0 -0
  157. package/public/pdfjs/cmaps/UniJISX0213-UTF32-H.bcmap +0 -0
  158. package/public/pdfjs/cmaps/UniJISX0213-UTF32-V.bcmap +0 -0
  159. package/public/pdfjs/cmaps/UniJISX02132004-UTF32-H.bcmap +0 -0
  160. package/public/pdfjs/cmaps/UniJISX02132004-UTF32-V.bcmap +0 -0
  161. package/public/pdfjs/cmaps/UniKS-UCS2-H.bcmap +0 -0
  162. package/public/pdfjs/cmaps/UniKS-UCS2-V.bcmap +0 -0
  163. package/public/pdfjs/cmaps/UniKS-UTF16-H.bcmap +0 -0
  164. package/public/pdfjs/cmaps/UniKS-UTF16-V.bcmap +0 -0
  165. package/public/pdfjs/cmaps/UniKS-UTF32-H.bcmap +0 -0
  166. package/public/pdfjs/cmaps/UniKS-UTF32-V.bcmap +0 -0
  167. package/public/pdfjs/cmaps/UniKS-UTF8-H.bcmap +0 -0
  168. package/public/pdfjs/cmaps/UniKS-UTF8-V.bcmap +0 -0
  169. package/public/pdfjs/cmaps/V.bcmap +0 -0
  170. package/public/pdfjs/cmaps/WP-Symbol.bcmap +0 -0
  171. package/src/components/ai/ai-prompt-input/index.tsx +3 -87
  172. package/src/components/ai-elements/__tests__/context.test.tsx +167 -0
  173. package/src/components/ai-elements/context.tsx +182 -94
  174. package/src/components/ai-elements/prompt-input.tsx +6 -104
  175. package/src/components/harness/__tests__/composer-attachments.test.tsx +17 -9
  176. package/src/components/harness/__tests__/composer-click-focus.test.tsx +175 -0
  177. package/src/components/harness/__tests__/composer-focus.test.tsx +7 -0
  178. package/src/components/harness/__tests__/composer-keymap.test.ts +57 -0
  179. package/src/components/harness/__tests__/composer-paste.test.tsx +7 -0
  180. package/src/components/harness/__tests__/composer-pending-guard.test.tsx +207 -0
  181. package/src/components/harness/__tests__/composer-placeholder.test.ts +7 -6
  182. package/src/components/harness/__tests__/composer-plus-menu.test.tsx +202 -0
  183. package/src/components/harness/__tests__/composer-primary-button.test.tsx +7 -0
  184. package/src/components/harness/__tests__/composer-send.test.tsx +12 -4
  185. package/src/components/harness/__tests__/composer-undo.test.tsx +7 -0
  186. package/src/components/harness/__tests__/dock-registry.test.ts +46 -0
  187. package/src/components/harness/__tests__/harness-workbench-auth-error.test.tsx +42 -4
  188. package/src/components/harness/__tests__/mention-kbid.test.ts +69 -0
  189. package/src/components/harness/__tests__/undo-last-turn.test.ts +134 -0
  190. package/src/components/harness/__tests__/voice-activity.test.tsx +2 -2
  191. package/src/components/harness/conversation-panel/composer/__tests__/file-chip-open.test.tsx +195 -0
  192. package/src/components/harness/conversation-panel/composer/__tests__/menu-view.test.tsx +107 -0
  193. package/src/components/harness/conversation-panel/composer/command/__tests__/claim-attachments.test.tsx +271 -0
  194. package/src/components/harness/conversation-panel/composer/command/__tests__/claim-client-submit.test.tsx +291 -0
  195. package/src/components/harness/conversation-panel/composer/command/__tests__/claim-guard.test.tsx +275 -0
  196. package/src/components/harness/conversation-panel/composer/command/__tests__/command-permission.test.tsx +286 -0
  197. package/src/components/harness/conversation-panel/composer/command/__tests__/command-plan.test.tsx +344 -0
  198. package/src/components/harness/conversation-panel/composer/command/__tests__/command-popup.test.tsx +193 -0
  199. package/src/components/harness/conversation-panel/composer/command/__tests__/command-server-source.test.tsx +235 -0
  200. package/src/components/harness/conversation-panel/composer/command/__tests__/command-suggestion-menu.test.tsx +151 -1
  201. package/src/components/harness/conversation-panel/composer/command/__tests__/command-undo.test.tsx +168 -0
  202. package/src/components/harness/conversation-panel/composer/command/__tests__/exclude-composer-seat.test.ts +106 -0
  203. package/src/components/harness/conversation-panel/composer/command/__tests__/menu-view.test.tsx +55 -2
  204. package/src/components/harness/conversation-panel/composer/command/__tests__/skill-source.test.tsx +336 -0
  205. package/src/components/harness/conversation-panel/composer/command/claim.ts +7 -1
  206. package/src/components/harness/conversation-panel/composer/command/command-popup.tsx +140 -0
  207. package/src/components/harness/conversation-panel/composer/command/command-suggestion-menu.tsx +261 -75
  208. package/src/components/harness/conversation-panel/composer/command/menu-view.tsx +188 -50
  209. package/src/components/harness/conversation-panel/composer/command/popup-panel.tsx +106 -0
  210. package/src/components/harness/conversation-panel/composer/command/skill-source.ts +231 -0
  211. package/src/components/harness/conversation-panel/composer/composer-editor.tsx +216 -14
  212. package/src/components/harness/conversation-panel/composer/composer-keymap.ts +26 -0
  213. package/src/components/harness/conversation-panel/composer/extension/__tests__/command-menu.test.ts +128 -12
  214. package/src/components/harness/conversation-panel/composer/extension/command-menu.ts +303 -44
  215. package/src/components/harness/conversation-panel/composer/extension/index.ts +8 -0
  216. package/src/components/harness/conversation-panel/composer/harness-composer.tsx +551 -83
  217. package/src/components/harness/conversation-panel/composer/mention/__tests__/file-mention.test.tsx +517 -0
  218. package/src/components/harness/conversation-panel/composer/mention/__tests__/mention-source-registration.test.tsx +5 -2
  219. package/src/components/harness/conversation-panel/composer/mention/__tests__/mention-suggestion-menu.test.tsx +120 -0
  220. package/src/components/harness/conversation-panel/composer/mention/__tests__/mention-trigger-source.test.ts +52 -9
  221. package/src/components/harness/conversation-panel/composer/mention/__tests__/story-mention.test.tsx +356 -0
  222. package/src/components/harness/conversation-panel/composer/mention/__tests__/thread-mention.test.tsx +377 -0
  223. package/src/components/harness/conversation-panel/composer/mention/file-mention.ts +162 -0
  224. package/src/components/harness/conversation-panel/composer/mention/mention-resolvers.ts +6 -0
  225. package/src/components/harness/conversation-panel/composer/mention/mention-suggestion-menu.tsx +212 -107
  226. package/src/components/harness/conversation-panel/composer/mention/mention-trigger-source.ts +71 -8
  227. package/src/components/harness/conversation-panel/composer/mention/story-mention.ts +131 -0
  228. package/src/components/harness/conversation-panel/composer/mention/thread-mention.ts +159 -0
  229. package/src/components/harness/conversation-panel/composer/mention/use-mention-sources.ts +9 -1
  230. package/src/components/harness/conversation-panel/composer/model-selector/__tests__/model-selector.test.tsx +401 -0
  231. package/src/components/harness/conversation-panel/composer/model-selector/__tests__/wiring.test.ts +117 -0
  232. package/src/components/harness/conversation-panel/composer/model-selector/model-selector-panel.tsx +411 -0
  233. package/src/components/harness/conversation-panel/composer/model-selector/model-selector-trigger.tsx +254 -0
  234. package/src/components/harness/conversation-panel/composer/model-selector/wiring.ts +112 -0
  235. package/src/components/harness/conversation-panel/composer/permission/__tests__/permission-select.test.tsx +264 -0
  236. package/src/components/harness/conversation-panel/composer/permission/permission-policy.ts +76 -0
  237. package/src/components/harness/conversation-panel/composer/permission/permission-popup.tsx +302 -0
  238. package/src/components/harness/conversation-panel/composer/permission/permission-select-button.tsx +140 -0
  239. package/src/components/harness/conversation-panel/composer/workspace/__tests__/workspace-select.test.tsx +390 -0
  240. package/src/components/harness/conversation-panel/composer/workspace/workspace-select-button.tsx +367 -0
  241. package/src/components/harness/conversation-panel/messages/harness-chain/__tests__/use-harness-chat-adapter.test.ts +20 -0
  242. package/src/components/harness/conversation-panel/messages/harness-chain/__tests__/use-harness-session-putmedia.test.tsx +17 -0
  243. package/src/components/harness/conversation-panel/messages/harness-chain/use-agent-terminals.ts +116 -0
  244. package/src/components/harness/conversation-panel/messages/harness-chain/use-harness-chat-adapter.ts +43 -11
  245. package/src/components/harness/conversation-panel/messages/harness-chain/use-harness-session.ts +25 -4
  246. package/src/components/harness/conversation-panel/messages/tools/__tests__/tool-run.test.ts +26 -1
  247. package/src/components/harness/conversation-panel/messages/tools/tool-run.ts +11 -0
  248. package/src/components/harness/extension-panel/dock/__tests__/dock-persist.test.ts +2 -1
  249. package/src/components/harness/extension-panel/dock/__tests__/guide-page.test.tsx +44 -3
  250. package/src/components/harness/extension-panel/dock/__tests__/tab-strip.test.tsx +45 -0
  251. package/src/components/harness/extension-panel/dock/dock-persist.ts +6 -4
  252. package/src/components/harness/extension-panel/dock/dock-registry.ts +69 -14
  253. package/src/components/harness/extension-panel/dock/dock-surface.tsx +35 -0
  254. package/src/components/harness/extension-panel/dock/guide-page.tsx +78 -45
  255. package/src/components/harness/extension-panel/dock/tab-strip.tsx +9 -1
  256. package/src/components/harness/extension-panel/panels/plugin/__tests__/install-dialog.test.tsx +260 -0
  257. package/src/components/harness/extension-panel/panels/plugin/__tests__/plugin-page.test.tsx +912 -0
  258. package/src/components/harness/extension-panel/panels/plugin/__tests__/plugin-row.test.tsx +215 -0
  259. package/src/components/harness/extension-panel/panels/plugin/builtin-section.tsx +204 -0
  260. package/src/components/harness/extension-panel/panels/plugin/install-dialog.tsx +195 -0
  261. package/src/components/harness/extension-panel/panels/plugin/installed-section.tsx +378 -0
  262. package/src/components/harness/extension-panel/panels/plugin/kind.tsx +17 -4
  263. package/src/components/harness/extension-panel/panels/plugin/pending-builds-block.tsx +49 -0
  264. package/src/components/harness/extension-panel/panels/plugin/plugin-page.tsx +257 -0
  265. package/src/components/harness/extension-panel/panels/plugin/plugin-row.tsx +206 -0
  266. package/src/components/harness/extension-panel/panels/plugin/plugin-types.ts +13 -0
  267. package/src/components/harness/extension-panel/panels/plugin/worker-section.tsx +322 -0
  268. package/src/components/harness/extension-panel/panels/terminal/__tests__/kind.test.tsx +219 -2
  269. package/src/components/harness/extension-panel/panels/terminal/__tests__/terminal-instance.test.tsx +322 -19
  270. package/src/components/harness/extension-panel/panels/terminal/__tests__/use-agent-terminal-roster.test.tsx +393 -0
  271. package/src/components/harness/extension-panel/panels/terminal/__tests__/ws-transport.test.ts +25 -0
  272. package/src/components/harness/extension-panel/panels/terminal/kind.tsx +55 -1
  273. package/src/components/harness/extension-panel/panels/terminal/shell-pref.ts +7 -4
  274. package/src/components/harness/extension-panel/panels/terminal/sse-transport.ts +26 -6
  275. package/src/components/harness/extension-panel/panels/terminal/tab-control-state.tsx +114 -0
  276. package/src/components/harness/extension-panel/panels/terminal/terminal-instance.tsx +190 -96
  277. package/src/components/harness/extension-panel/panels/terminal/terminal-theme.ts +113 -0
  278. package/src/components/harness/extension-panel/panels/terminal/transport.ts +28 -6
  279. package/src/components/harness/extension-panel/panels/terminal/use-agent-terminal-roster.ts +107 -0
  280. package/src/components/harness/extension-panel/panels/terminal/ws-transport.ts +7 -5
  281. package/src/components/harness/extension-panel/panels/terminal/xterm-terminal.tsx +5 -67
  282. package/src/components/harness/workbench/__tests__/provider-model-groups.test.ts +301 -0
  283. package/src/components/harness/workbench/harness-workbench-page.tsx +164 -2
  284. package/src/components/harness/workbench/provider-model-groups.ts +140 -0
  285. package/src/components/harness/workbench/undo-last-turn.ts +79 -0
  286. package/src/components/harness/workbench/workbench-context.tsx +53 -3
  287. package/src/components/tiptap/hooks/__tests__/use-floating-element.test.tsx +131 -0
  288. package/src/components/tiptap/hooks/use-floating-element.ts +15 -2
  289. package/src/components/tiptap/hooks/use-menu-navigation.ts +5 -0
  290. package/src/components/tiptap/node/mention-extension.ts +33 -0
  291. package/src/components/tiptap/ui/suggestion-menu/__tests__/suggestion-menu.test.tsx +366 -0
  292. package/src/components/tiptap/ui/suggestion-menu/suggestion-menu-types.ts +54 -0
  293. package/src/components/tiptap/ui/suggestion-menu/suggestion-menu.tsx +176 -45
  294. package/src/lib/changelog/sdk-versions.ts +2 -2
  295. package/src/lib/queries/__tests__/harness-plugin-queries.test.ts +49 -0
  296. package/src/lib/queries/harness-terminal.ts +77 -0
  297. package/src/lib/queries/harness.ts +50 -0
  298. package/src/paraglide/messages/_index.js +1622 -311
  299. package/src/paraglide/messages/en.js +528 -103
  300. package/src/paraglide/messages/zh.js +529 -104
  301. package/src/routes/_nav/harness/route.lazy.tsx +13 -0
  302. package/src/routes/api/harness/$.ts +19 -2
  303. package/src/routes/api/harness/terminal/$.ts +37 -6
  304. package/src/routes/api/harness/terminal/__tests__/route.test.ts +120 -0
  305. package/src/server/ai-gateway/sandbox/policy.ts +6 -6
  306. package/src/server/harness/__tests__/agent-terminal.server.test.ts +448 -0
  307. package/src/server/harness/__tests__/builtin-tools-invariant.test.ts +22 -12
  308. package/src/server/harness/__tests__/compact-plugin.server.test.ts +46 -0
  309. package/src/server/harness/__tests__/define-expose.test.ts +17 -0
  310. package/src/server/harness/__tests__/first-contact-fakes.test.ts +103 -3
  311. package/src/server/harness/__tests__/terminal-manager.server.test.ts +761 -2
  312. package/src/server/harness/__tests__/thread-reference.server.test.ts +258 -0
  313. package/src/server/harness/agent-terminal.server.ts +631 -0
  314. package/src/server/harness/define.server.ts +21 -3
  315. package/src/server/harness/first-contact-fakes.ts +115 -4
  316. package/src/server/harness/host.server.ts +28 -1
  317. package/src/server/harness/persistence/__tests__/session-index-store.server.test.ts +83 -0
  318. package/src/server/harness/persistence/prisma-persistence.server.ts +12 -3
  319. package/src/server/harness/persistence/session-index-store.server.ts +26 -0
  320. package/src/server/harness/plugins/__tests__/assemble-disable.test.ts +25 -17
  321. package/src/server/harness/plugins/__tests__/tool-risk-audit.test.ts +16 -6
  322. package/src/server/harness/plugins/assemble-app.ts +12 -0
  323. package/src/server/harness/plugins/base-patch.ts +9 -2
  324. package/src/server/harness/plugins/builtin/__tests__/agent-terminal.plugin.test.ts +702 -0
  325. package/src/server/harness/plugins/builtin/agent-terminal.plugin.ts +518 -0
  326. package/src/server/harness/terminal-frame-builder.server.ts +5 -3
  327. package/src/server/harness/terminal-manager.server.ts +772 -35
  328. package/src/server/harness/terminal-ws-handler.server.ts +8 -2
  329. package/src/server/harness/thread-reference.server.ts +446 -0
  330. package/src/server/harness/tool-risk.ts +20 -4
  331. package/src/server/serverFns/chat/__tests__/conversations-sandbox-default.test.ts +23 -0
  332. package/src/server/serverFns/chat/conversations.ts +18 -3
  333. package/src/server/serverFns/harness/search-mention-candidates.ts +14 -1
  334. package/src/shared/harness/__tests__/thread-reference-format.test.ts +128 -0
  335. package/src/shared/harness/thread-reference-format.ts +98 -0
  336. package/LICENSE +0 -661
  337. package/src/components/agents/slash-skill-menu.tsx +0 -75
  338. package/src/components/harness/conversation-panel/composer/extension/__tests__/demo-story-reference.test.tsx +0 -177
  339. package/src/components/harness/conversation-panel/composer/extension/demo-story-reference.tsx +0 -227
  340. package/src/components/harness/conversation-panel/composer/plugin-mention-menu.tsx +0 -109
  341. package/src/components/harness/extension-panel/panels/plugin-panel.tsx +0 -1021
  342. package/src/components/harness/extension-panel/panels/terminal/__tests__/xterm-webgl.test.ts +0 -68
@@ -25,12 +25,13 @@ import { createSessionView } from '@tanstack/ai-harness/view'
25
25
  import type { AnyHarness } from '@tanstack/ai-harness'
26
26
  import type { MediaRecord } from '@tanstack/ai-harness/client'
27
27
  import type { SessionViewState, ViewMessage } from '@tanstack/ai-harness/view'
28
- import type { SessionUsage } from '@tanstack/ai-harness'
28
+ import type { ThreadSettings, ThreadSettingsChange } from '@tanstack/ai-harness'
29
29
 
30
30
  import { clearCompactionNotices, useCompactionNotices, wrapClientWithCompactionNotices } from './use-compaction-notices'
31
31
  import { collectTerminalEntries } from './terminal-entries'
32
32
  import { clearModelRetryNotices, useModelRetryNotices, wrapClientWithModelRetryNotices } from './use-model-retry-notices'
33
33
  import { clearWorkspaceFileChanges, wrapClientWithFileChanges } from './use-file-changes'
34
+ import { wrapClientWithAgentTerminals } from './use-agent-terminals'
34
35
 
35
36
  /** 会话实例(client + view 成对生命周期管理;view 持有 SSE 连接,dispose 断流)。 */
36
37
  interface HarnessSessionInstance {
@@ -99,7 +100,9 @@ export function useHarnessSession({ threadId }: UseHarnessSessionOptions) {
99
100
  const modelRetryWrapped = wrapClientWithModelRetryNotices(compactionWrapped)
100
101
  // P2-B 工作区文件联动:再包一层,遇 FileChanged 插件事件抽轻量切片进旁路 store
101
102
  // (原事件照旧透传,view 不受影响)。
102
- const client = wrapClientWithFileChanges(modelRetryWrapped)
103
+ // T13 agent 终端联动:最外层再包一层,遇 AgentTerminalOpened/Closed 插件事件
104
+ // invalidate roster query(DockSurface reconcile 即刻开/关 agent tab)。
105
+ const client = wrapClientWithAgentTerminals(wrapClientWithFileChanges(modelRetryWrapped))
103
106
  // rawClient 非空(threadId 就位),wrapped 亦非空——兜底断言以满足 createSessionView。
104
107
  if (!client) {
105
108
  setSession(null)
@@ -176,6 +179,10 @@ export function useHarnessSession({ threadId }: UseHarnessSessionOptions) {
176
179
  // 用量四桶(P2-3d,设计 §5.3):view state 顶层 usage 切片(SessionUsage:
177
180
  // total/byModel/bySender/bySource)。undefined = 尚无模型调用(用量 pill 不渲染)。
178
181
  const sessionUsage = useStore(store, (s) => s.usage)
182
+ // 线程持久化设置切片(P2 composer 控制,任务 1):view state 顶层 settings
183
+ // (ThreadSettings:model/reasoning/instructions/...,服务端 configure op 写入后经
184
+ // settingsChanged 事件回流)。undefined = 尚无 settings(composer 显示回落值)。
185
+ const threadSettings: ThreadSettings | undefined = useStore(store, (s) => s.settings)
179
186
  // 沙箱终端聚合(P3-5,复审改口径):transcript bash 调用序列客户端聚合
180
187
  // (adapter UIMessage 投影丢 output,须在原始 ViewMessage 层做——messages 即
181
188
  // view state 原始 ViewMessage[],与上方投影订阅同源)。
@@ -213,6 +220,14 @@ export function useHarnessSession({ threadId }: UseHarnessSessionOptions) {
213
220
  }, [view])
214
221
  const cancel = useCallback(() => view?.cancel(), [view])
215
222
 
223
+ // 线程设置写入(P2 composer 控制,任务 1):view.updateThreadSettings(configure
224
+ // op,服务端 expose.settings 白名单逐 key 校验)。可选方法守卫——view 无此能力
225
+ // (旧 view 版本/空态)返回 undefined,消费方以 undefined 识别「无写入通道」。
226
+ const updateThreadSettings = useCallback(
227
+ (settings: ThreadSettingsChange) => view?.updateThreadSettings?.({ settings }),
228
+ [view],
229
+ )
230
+
216
231
  // 附件上传器(T2.11 ④):harness client.putMedia 暴露给 composer 的 useAttachments。
217
232
  // 用 client.putMedia(接受 Blob)而非 view.putMedia(MediaBody 仅 ArrayBuffer|Uint8Array,
218
233
  // 见 view/index.d.ts:101),与 use-attachments 的 File/Blob 通道类型对齐。
@@ -227,12 +242,14 @@ export function useHarnessSession({ threadId }: UseHarnessSessionOptions) {
227
242
 
228
243
  // F5-4 runCommand 通路:服务端命令执行('/' 菜单 server 类的执行出口)。结果
229
244
  // 经 harness.command.result 事件回流(client 现有事件管道,view store 消费),
230
- // 此处只透传调用。空态无 client → undefined(与 putMedia 同款守卫;空态 commands
245
+ // 此处只透传调用。E2 claim(P2 任务 1):input 型 server 命令 claim.submit(args) 结算
246
+ // 经此透传 input(chip 后参数文本)——上游 CommandOptions 本支持 { name, input }。
247
+ // 空态无 client → undefined(与 putMedia 同款守卫;空态 commands
231
248
  // 恒空,菜单不会产出 server 项,此 undefined 仅防御)。
232
249
  const runCommand = useMemo(
233
250
  () =>
234
251
  client
235
- ? (name: string) => client.runCommand({ name })
252
+ ? (name: string, input?: unknown) => client.runCommand({ name, input })
236
253
  : undefined,
237
254
  [client],
238
255
  )
@@ -265,6 +282,10 @@ export function useHarnessSession({ threadId }: UseHarnessSessionOptions) {
265
282
  contextTokens,
266
283
  /** 会话用量四桶(P2-3d,SessionUsage;undefined = 尚无模型调用) */
267
284
  sessionUsage,
285
+ /** 线程持久化设置切片(P2 composer 控制,ThreadSettings;undefined = 尚无 settings) */
286
+ threadSettings,
287
+ /** 线程设置写入(P2 composer 控制:configure op 透传;空态/无能力 undefined) */
288
+ updateThreadSettings,
268
289
  /** 沙箱终端 bash 调用序列(P3-5,transcript 聚合;空 = 无 bash 调用) */
269
290
  terminalEntries,
270
291
  send,
@@ -12,7 +12,7 @@
12
12
  import { describe, expect, it } from 'vitest'
13
13
  import { m } from '@/paraglide/messages.js'
14
14
  import type { AgentPart, MediaPart, ToolCallPart, ViewPart } from '@tanstack/ai-harness/view'
15
- import { collectToolRuns, taskStepsOf } from '../tool-run'
15
+ import { collectToolRuns, HARNESS_TOOL_KIND, taskStepsOf } from '../tool-run'
16
16
 
17
17
  let seq = 0
18
18
  function toolCall(
@@ -200,3 +200,28 @@ describe('taskStepsOf(Task 步骤投影)', () => {
200
200
  expect(steps[1]).toEqual({ title: m.harness_tool_bash({ target: 'tsc' }), running: true })
201
201
  })
202
202
  })
203
+
204
+ describe('HARNESS_TOOL_KIND(agent 终端工具映射,2026-11-20 T15)', () => {
205
+ it('agent 终端六工具 + 用户终端只读两工具 → terminal(复用 bash 形态)', () => {
206
+ const terminalTools = [
207
+ 'terminal_open',
208
+ 'terminal_send',
209
+ 'terminal_read',
210
+ 'terminal_signal',
211
+ 'terminal_close',
212
+ 'terminal_list',
213
+ 'user_terminal_read',
214
+ 'user_terminal_list',
215
+ ]
216
+ for (const name of terminalTools) {
217
+ expect(HARNESS_TOOL_KIND[name]).toBe('terminal')
218
+ }
219
+ })
220
+
221
+ it('terminal_send 步骤行与 bash 同标题链(terminal kind → bash 标题,目标缺省省略号)', () => {
222
+ const [step] = taskStepsOf([
223
+ toolCall('terminal_send', { sessionId: 's1', text: 'watch files' }, 'done'),
224
+ ])
225
+ expect(step).toEqual({ title: m.harness_tool_bash({ target: '…' }) })
226
+ })
227
+ })
@@ -53,6 +53,17 @@ export const HARNESS_TOOL_KIND: Record<string, AgentToolKind> = {
53
53
  webfetch: 'web',
54
54
  websearch: 'web',
55
55
  bash: 'terminal',
56
+ // agent 终端六工具 + 用户终端只读两工具(agent-terminal 插件,2026-11-20 T15):
57
+ // 复用 bash 的 terminal 形态(ToolCardCore 按 summary.kind 出终端展开体,
58
+ // 无 name 硬编码);terminal_send 卡与 bash 同形态(命令文本在结果条目里)。
59
+ terminal_open: 'terminal',
60
+ terminal_send: 'terminal',
61
+ terminal_read: 'terminal',
62
+ terminal_signal: 'terminal',
63
+ terminal_close: 'terminal',
64
+ terminal_list: 'terminal',
65
+ user_terminal_read: 'terminal',
66
+ user_terminal_list: 'terminal',
56
67
  todo_write: 'todo',
57
68
  question: 'ask',
58
69
  plan_submit: 'plan',
@@ -304,7 +304,8 @@ describe("defaultDockLayout", () => {
304
304
  expect(d.tabs[root.tabIds[0]].kind).toBe("guide")
305
305
  expect(d.floats).toEqual([])
306
306
  expect(d.activePaneId).toBe("root")
307
- expect(d.expanded).toBe(true)
307
+ // 进入 Harness 右侧面板默认收起(2026-11-19 用户裁决)
308
+ expect(d.expanded).toBe(false)
308
309
  })
309
310
 
310
311
  it("loadDockState 回落场景返回 null(默认布局由调用方经 defaultDockLayout 提供)", () => {
@@ -74,10 +74,18 @@ describe("collectGuideEntries(卡序 + 显隐 + availability)", () => {
74
74
  makeGuideKind("terminal", 20),
75
75
  // 无 guide 字段 → 不上卡(More 菜单行)
76
76
  { kind: "changes", title: "changes", icon: null, render: () => null },
77
+ // 第五卡:plugin(order 50)
78
+ { kind: "plugin", title: "plugin", icon: null, render: () => null, guide: { order: 50, title: "plugin title", icon: null } },
77
79
  ])
78
80
  try {
79
81
  const entries = collectGuideEntries(dockRegistry.listKinds())
80
- expect(entries.map((e) => e.kind)).toEqual(["files", "terminal", "browser", "media"])
82
+ expect(entries.map((e) => e.kind)).toEqual([
83
+ "files",
84
+ "terminal",
85
+ "browser",
86
+ "media",
87
+ "plugin",
88
+ ])
81
89
  } finally {
82
90
  dispose()
83
91
  }
@@ -153,7 +161,7 @@ describe("GuidePage 渲染", () => {
153
161
  }
154
162
  })
155
163
 
156
- it(">4 卡隐描述:描述行不渲染(保持轻量)", () => {
164
+ it("5 卡(含 order 50 第五卡)仍显描述", () => {
157
165
  const dispose = registerAll([
158
166
  makeGuideKind("a", 10),
159
167
  makeGuideKind("b", 20),
@@ -161,10 +169,31 @@ describe("GuidePage 渲染", () => {
161
169
  makeGuideKind("d", 40),
162
170
  makeGuideKind("e", 50),
163
171
  ])
172
+ try {
173
+ render(<GuidePage />)
174
+ expect(screen.getByText("a desc")).toBeTruthy()
175
+ expect(screen.getByText("b desc")).toBeTruthy()
176
+ expect(screen.getByText("c desc")).toBeTruthy()
177
+ expect(screen.getByText("d desc")).toBeTruthy()
178
+ expect(screen.getByText("e desc")).toBeTruthy()
179
+ } finally {
180
+ dispose()
181
+ }
182
+ })
183
+
184
+ it(">5 卡隐描述:描述行不渲染(保持轻量)", () => {
185
+ const dispose = registerAll([
186
+ makeGuideKind("a", 10),
187
+ makeGuideKind("b", 20),
188
+ makeGuideKind("c", 30),
189
+ makeGuideKind("d", 40),
190
+ makeGuideKind("e", 50),
191
+ makeGuideKind("f", 60),
192
+ ])
164
193
  try {
165
194
  render(<GuidePage />)
166
195
  expect(screen.queryByText("a desc")).toBeNull()
167
- expect(screen.queryByText("e desc")).toBeNull()
196
+ expect(screen.queryByText("f desc")).toBeNull()
168
197
  // 标题仍在
169
198
  expect(screen.getByText("a title")).toBeTruthy()
170
199
  } finally {
@@ -172,6 +201,18 @@ describe("GuidePage 渲染", () => {
172
201
  }
173
202
  })
174
203
 
204
+ it("Guide 滚动根可滚动", () => {
205
+ const dispose = registerAll([makeGuideKind("files", 10)])
206
+ try {
207
+ render(<GuidePage />)
208
+ const root = screen.getByTestId("dock-guide-page")
209
+ expect(root.className).toContain("h-full")
210
+ expect(root.className).toContain("overflow-y-auto")
211
+ } finally {
212
+ dispose()
213
+ }
214
+ })
215
+
175
216
  it("availability disabled 卡:置灰不可点 + tooltip「当前部署形态不支持」", async () => {
176
217
  const openSpy = vi.spyOn(dockRegistry, "openKind")
177
218
  const dispose = registerAll([
@@ -391,6 +391,51 @@ describe("TabStrip 拖拽/caret/flash(P1c)", () => {
391
391
  })
392
392
  })
393
393
 
394
+ describe("TabStrip renderTabTitle 钩子(T14 agent 徽章)", () => {
395
+ it("kind 未实现 renderTabTitle → 标题槽纯文本(与现状一致)", () => {
396
+ dockRegistry.registerKind({
397
+ kind: "k-plain-title",
398
+ title: "t",
399
+ icon: null,
400
+ render: () => null,
401
+ })
402
+ try {
403
+ renderStrip({ tabs: [makeTab("k-plain-title", "纯标题")], activeTabId: "k-plain-title" })
404
+ const chip = screen.getByRole("tab", { name: "纯标题" })
405
+ const title = chip.querySelector('[data-slot="dock-chip-title"]')
406
+ expect(title).toBeTruthy()
407
+ expect(title!.textContent).toBe("纯标题")
408
+ } finally {
409
+ dockRegistry.unregisterKind("k-plain-title")
410
+ }
411
+ })
412
+
413
+ it("kind.renderTabTitle 提供时 → 标题槽渲染钩子返回的节点", () => {
414
+ dockRegistry.registerKind({
415
+ kind: "k-title-probe",
416
+ title: "t",
417
+ icon: null,
418
+ render: () => null,
419
+ renderTabTitle: (tab) => (
420
+ <span data-testid="probe-title-node">
421
+ <span data-testid="probe-title-text">{tab.title}</span>
422
+ <span data-testid="probe-title-badge">徽</span>
423
+ </span>
424
+ ),
425
+ })
426
+ try {
427
+ renderStrip({ tabs: [makeTab("k-title-probe", "探针")], activeTabId: "k-title-probe" })
428
+ const chip = screen.getByRole("tab", { name: /探针/ })
429
+ const slot = chip.querySelector('[data-slot="dock-chip-title"]')
430
+ expect(slot).toBeTruthy()
431
+ expect(slot!.querySelector('[data-testid="probe-title-node"]')).toBeTruthy()
432
+ expect(slot!.querySelector('[data-testid="probe-title-text"]')!.textContent).toBe("探针")
433
+ } finally {
434
+ dockRegistry.unregisterKind("k-title-probe")
435
+ }
436
+ })
437
+ })
438
+
394
439
  describe("TabStrip 双击重命名(P6a-1,设计 §3.1)", () => {
395
440
  // renameable probe kind:strip 直调 dockRegistry.renameTab,故 spy registry 方法。
396
441
  const RENAME_KIND = "terminal"
@@ -31,7 +31,7 @@
31
31
 
32
32
  import { z } from "zod"
33
33
  import type { DockTab, PaneNode, FloatPane, Rect } from "./dock-layout"
34
- import { GUIDE_KIND, createGuideTab } from "./dock-layout"
34
+ import { createGuideTab } from "./dock-layout"
35
35
  import { MIN_PANE_FRACTION } from "./dock-spec"
36
36
 
37
37
  // ---------------------------------------------------------------------------
@@ -209,7 +209,8 @@ function asPane(n: PaneNode): Extract<PaneNode, { kind: "pane" }> | null {
209
209
  // 默认布局 / 导出函数
210
210
  // ---------------------------------------------------------------------------
211
211
 
212
- /** 默认 guide 单页布局(无存档 / 校验失败的回落;自身过 v2 校验)。 */
212
+ /** 默认 guide 单页布局(无存档 / 校验失败的回落;自身过 v2 校验)。
213
+ * expanded=false:进入 Harness 右侧面板默认收起(2026-11-19 用户裁决)。 */
213
214
  export function defaultDockLayout(): PersistedDockStateV2 {
214
215
  const guide = createGuideTab()
215
216
  return {
@@ -219,7 +220,7 @@ export function defaultDockLayout(): PersistedDockStateV2 {
219
220
  rootId: "root",
220
221
  floats: [],
221
222
  activePaneId: "root",
222
- expanded: true,
223
+ expanded: false,
223
224
  }
224
225
  }
225
226
 
@@ -270,7 +271,8 @@ export function migrateV1ToV2(v1: z.infer<typeof persistedDockSchemaV1>): Persis
270
271
  rootId: "root",
271
272
  floats: [],
272
273
  activePaneId: "root",
273
- expanded: true,
274
+ // v1 无展开态语义(旧扁平 dock 恒展开);迁移产物对齐新默认收起(2026-11-19 用户裁决)
275
+ expanded: false,
274
276
  }
275
277
  // 迁移后过一遍 v2 校验(结构 + 引用完整性);不过则回落默认布局。
276
278
  const parsed = persistedDockSchemaV2.safeParse(state)
@@ -93,6 +93,19 @@ export interface DockPanelKind {
93
93
  renameable?: boolean
94
94
  /** 关闭守卫:guide 在唯一 docked tab 时不可关(控件全隐)。 */
95
95
  canCloseTab?: (ctx: { soleDockedTab: boolean }) => boolean
96
+ /**
97
+ * tab 关闭钩子:关闭生效(从 state 移除)前调用一次。terminal 用它杀 PTY 进程 + 清
98
+ * binding(DSH 对标,服务端 idle 回收兜底)。只在 closeTab 挂一处——closeOthers/
99
+ * closeRight 内部循环调 this.closeTab,自动覆盖。
100
+ */
101
+ onTabClose?: (tab: DockTab) => void
102
+ /**
103
+ * tab 标题自定义渲染钩子(T14,onTabClose 同款可选钩子模式):缺省 = tab.title 纯
104
+ * 文本(零消费者行为不变)。terminal kind 用它返回自订阅标题节点(TerminalTabTitle,
105
+ * 经 useSyncExternalStore 订阅闭包 store),state 帧控制权变化时 Agent 徽章自行出现/
106
+ * 消失——tab-strip 只把返回的 ReactNode 渲进标题槽,无终端特有逻辑、无额外订阅。
107
+ */
108
+ renderTabTitle?: (tab: DockTab) => ReactNode
96
109
  /** 渲染该 kind 的 tab 内容。 */
97
110
  render: (tab: DockTab) => ReactNode
98
111
  /** page.refresh 命令钩子(files/browser 绑定)。 */
@@ -137,6 +150,8 @@ export function createDockRegistry() {
137
150
 
138
151
  // ⚠ panelVersion 并入 state(文件头注释):注册/注销/切线程/expanded 变更手动 +1,
139
152
  // 布局纯函数自带 +1。expanded 随 persist v2 载荷持久化(设计 §3.7),故并入 runtime 态。
153
+ // 初始 expanded=false:进入 Harness 右侧面板默认收起(2026-11-19 用户裁决),首帧
154
+ // (switchThread effect 未跑)也不闪现空面板。
140
155
  let state: DockStateV2 = {
141
156
  tabs: {},
142
157
  nodes: { root: { id: "root", kind: "pane", tabIds: [], activeTabId: null } },
@@ -145,7 +160,7 @@ export function createDockRegistry() {
145
160
  activePaneId: "root",
146
161
  panelVersion: 0,
147
162
  }
148
- let expanded = true
163
+ let expanded = false
149
164
 
150
165
  const listeners = new Set<() => void>()
151
166
  const emit = () => listeners.forEach((l) => l())
@@ -155,7 +170,10 @@ export function createDockRegistry() {
155
170
  let instanceSeq = 0
156
171
 
157
172
  // per-thread 持久化(设计 §3.7):write-through,每次变更即存;switchThread 存旧恢复新。
158
- let currentThreadId: string | null = null
173
+ // undefined = 尚未切换过(sentinel,非合法线程 id):首个 switchThread(含 null)必须
174
+ // 真正执行一次(种默认 guide 布局)——初始 null === null no-op 会把上面的空 root pane
175
+ // 留在屏上,「打开面板是空页」(2026-11-19 用户反馈)根因之一。
176
+ let currentThreadId: string | null | undefined = undefined
159
177
 
160
178
  const toPersisted = (): PersistedDockStateV2 => ({
161
179
  version: 2,
@@ -377,6 +395,9 @@ export function createDockRegistry() {
377
395
  if (r.rejected) {
378
396
  return { collapsePanel: false, exitFullscreen: false, rejected: true }
379
397
  }
398
+ // onTabClose 钩子:state 移除前通知(唯一调用点;closeOthers/closeRight 循环走本
399
+ // 方法自动覆盖)。放在 rejected 检查之后,被拒关不触发清理副作用。
400
+ kinds.get(tab.kind)?.onTabClose?.(tab)
380
401
  state = r.state
381
402
  persist()
382
403
  emit()
@@ -463,6 +484,24 @@ export function createDockRegistry() {
463
484
  renameTab(tabId: string, title: string) {
464
485
  commit(layoutRenameTab(state, tabId, title))
465
486
  },
487
+ /**
488
+ * 清除 tab 的 instanceId(T14-I1 reopen 专口):agent tab 重开后必须回归「用户 tab
489
+ * 无 instanceId」不变量——instanceId 全仓仅 openKind 一个写入点、本方法是唯一清除点。
490
+ * 残留死 agent id 会让 T13 reconcile(close 规则命中「带 instanceId 且不在 roster」)
491
+ * 强制关掉用户刚重开的新终端,且 onTabClose 的 kill 打在死 id 上、新 PTY 成孤儿。
492
+ * tab 不存在 / 本就无 instanceId → no-op(返回原引用,不换快照)。
493
+ */
494
+ clearTabInstanceId(tabId: string) {
495
+ const tab = state.tabs[tabId]
496
+ if (!tab || tab.instanceId == null) return
497
+ const nextTab = { ...tab }
498
+ delete nextTab.instanceId
499
+ commit({
500
+ ...state,
501
+ tabs: { ...state.tabs, [tabId]: nextTab },
502
+ panelVersion: state.panelVersion + 1,
503
+ })
504
+ },
466
505
 
467
506
  // -------------------------------------------------------------------------
468
507
  // 派生查询(容器 / 壳层用)
@@ -529,23 +568,39 @@ export function createDockRegistry() {
529
568
  /**
530
569
  * 切线程:存旧线程 v2 布局(write-through 期间已最新,此处兜底)→ 恢复新线程存档
531
570
  * (无存档 / 校验失败 → defaultDockLayout)。panelVersion 继续单调递增(#730 语义),
532
- * 恢复的布局覆盖内存态,expanded 一并恢复。同一线程重复切换 no-op(防 effect 重跑闪烁)。
571
+ * 恢复的布局覆盖内存态。同一线程重复切换 no-op(防 effect 重跑闪烁)。
572
+ * expanded:有存档按存档恢复(模块内切线程的 per-thread 记忆);无存档保持当前态
573
+ * ——切到无存档线程不弹开也不强制收起;进入模块的默认收起由 route.lazy 入口
574
+ * effect 强制(2026-11-19 用户裁决),不在此处掺和。
533
575
  */
534
576
  switchThread(threadId: string | null) {
535
577
  if (threadId === currentThreadId) return
536
578
  if (currentThreadId) saveDockState(currentThreadId, toPersisted())
537
579
  currentThreadId = threadId
538
- // 无存档 / 校验失败 → defaultDockLayout(设计 §3.7:回落默认 guide 单页布局)
539
- const restored = loadDockState(threadId) ?? defaultDockLayout()
540
- expanded = restored.expanded
541
- state = {
542
- tabs: restored.tabs,
543
- nodes: restored.nodes,
544
- rootId: restored.rootId,
545
- floats: restored.floats,
546
- activePaneId: restored.activePaneId,
547
- // panelVersion 不持久化(dock-persist 载荷无此字段),恢复时自行递增
548
- panelVersion: state.panelVersion + 1,
580
+ const restored = loadDockState(threadId)
581
+ if (restored) {
582
+ expanded = restored.expanded
583
+ state = {
584
+ tabs: restored.tabs,
585
+ nodes: restored.nodes,
586
+ rootId: restored.rootId,
587
+ floats: restored.floats,
588
+ activePaneId: restored.activePaneId,
589
+ // panelVersion 不持久化(dock-persist 载荷无此字段),恢复时自行递增
590
+ panelVersion: state.panelVersion + 1,
591
+ }
592
+ } else {
593
+ // 无存档(无会话 / 新线程 / 校验失败)→ 默认 guide 单页布局(设计 §3.7);
594
+ // 首次切换(sentinel)也走此支,把初始空 root pane 换成 guide 开始页。
595
+ const d = defaultDockLayout()
596
+ state = {
597
+ tabs: d.tabs,
598
+ nodes: d.nodes,
599
+ rootId: d.rootId,
600
+ floats: d.floats,
601
+ activePaneId: d.activePaneId,
602
+ panelVersion: state.panelVersion + 1,
603
+ }
549
604
  }
550
605
  emit()
551
606
  },
@@ -51,6 +51,10 @@ import { m } from "@/paraglide/messages.js"
51
51
  import { createTodoKind } from "@/components/harness/extension-panel/panels/todo/kind"
52
52
  import { createPluginKind } from "@/components/harness/extension-panel/panels/plugin/kind"
53
53
  import { createTerminalKind } from "@/components/harness/extension-panel/panels/terminal/kind"
54
+ import {
55
+ reconcileAgentTerminalTabs,
56
+ useAgentTerminalRoster,
57
+ } from "@/components/harness/extension-panel/panels/terminal/use-agent-terminal-roster"
54
58
  import { createMediaKind } from "@/components/harness/extension-panel/panels/media/kind"
55
59
  import { createChangesKind } from "@/components/harness/extension-panel/panels/changes/kind"
56
60
  import { createFilesKind } from "@/components/harness/extension-panel/panels/files/kind"
@@ -169,6 +173,8 @@ export function DockSurface({
169
173
  createTodoKind({ chatMessagesRef, title: m.harness_panel_todo() }),
170
174
  createPluginKind({
171
175
  title: m.harness_panel_guide_plugin(),
176
+ guideTitle: m.harness_panel_guide_plugin(),
177
+ guideDescription: m.harness_panel_plugin_subtitle(),
172
178
  onClose: () => dockRegistry.closeTab("plugin"),
173
179
  }),
174
180
  createFilesKind({
@@ -204,6 +210,35 @@ export function DockSurface({
204
210
  }
205
211
  }, [])
206
212
 
213
+ // -------------------------------------------------------------------------
214
+ // agent 终端 roster 消费 → dock tab 动态开合(T13,设计 §7.2):roster query
215
+ // (10s 轮询 + AgentTerminalOpened/Closed 旁路事件 invalidate,事件包装挂
216
+ // use-harness-session)→ reconcileAgentTerminalTabs 纯函数出开/关指令 → registry
217
+ // 执行。开:openKind('terminal', { instanceId, title })(openTab 需完整 DockTab
218
+ // 含自增 id,不是正确入口);关:closeTab(terminal kind onTabClose 钩子自动
219
+ // 杀 PTY + 清 binding)。control 翻转不关 tab(reconcile 只看 origin+state+存在性);
220
+ // 用户终端(origin='user')不参与。query 失败/空态静默(data undefined → 早退)。
221
+ // 挂载点=DockSurface:threadId 真源(mediaThreadId,与 terminal kind 注册同源)
222
+ // 与 dockRegistry 单例都在此。指令计算执行时点读 getState(),幂等(重复 reconcile
223
+ // 命中已开 tab → 零指令)。effect 声明在 kind 注册 effect 之后:同 commit 内
224
+ // effect 按声明序执行,保证 reconcile 首跑时 terminal kind 已注册(openKind 查表)。
225
+ // -------------------------------------------------------------------------
226
+ const rosterQuery = useAgentTerminalRoster(mediaThreadId ?? null)
227
+ const rosterTerminals = rosterQuery.data?.terminals
228
+ useEffect(() => {
229
+ if (!rosterTerminals) return
230
+ const plan = reconcileAgentTerminalTabs(
231
+ rosterTerminals,
232
+ Object.values(dockRegistry.getState().tabs),
233
+ )
234
+ for (const cmd of plan.open) {
235
+ dockRegistry.openKind("terminal", { instanceId: cmd.instanceId, title: cmd.title })
236
+ }
237
+ for (const tabId of plan.close) {
238
+ dockRegistry.closeTab(tabId)
239
+ }
240
+ }, [rosterTerminals])
241
+
207
242
  const chromePaneId = topRightPaneId(state)
208
243
 
209
244
  // 分栏 blocked 判定(P1c-4 room 实测):measurePaneFits 两档——budget(已达两格上限)