@kingsoftcloud/ksadk-web 0.3.8 → 0.3.10

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 (242) hide show
  1. package/RELEASE_PROVENANCE.json +2 -2
  2. package/dist-ksadk/assets/{ArtifactsPanel-CbUDzOQO.js → ArtifactsPanel-KzcO_tZH.js} +1 -1
  3. package/dist-ksadk/assets/{CodeBlock-BwoN4XSB.js → CodeBlock-BGqAhmyz.js} +10 -7
  4. package/dist-ksadk/assets/MathMessageMarkdown-Bu5YkZz8.js +8 -0
  5. package/dist-ksadk/assets/{MermaidBlock-E2c6OIM3.js → MermaidBlock-ibbHIg-B.js} +9 -9
  6. package/dist-ksadk/assets/{NativeTerminalPanel-DPLNV-9q.js → NativeTerminalPanel-DYD4i8DH.js} +1 -1
  7. package/dist-ksadk/assets/{abnfDiagram-VCTEODGH-BOEVF10j.js → abnfDiagram-VCTEODGH-DSzm798d.js} +1 -1
  8. package/dist-ksadk/assets/{arc-D8m73GUU.js → arc-BdSe5xC-.js} +1 -1
  9. package/dist-ksadk/assets/architecture-7GRP2DOG-DT48U0B8.js +1 -0
  10. package/dist-ksadk/assets/{architectureDiagram-5GKGNRK7-CZB47JMF.js → architectureDiagram-5GKGNRK7-IlUSNE0r.js} +1 -1
  11. package/dist-ksadk/assets/{blockDiagram-NRAW4CY4-Cv2NU94T.js → blockDiagram-NRAW4CY4-D27YbdEM.js} +1 -1
  12. package/dist-ksadk/assets/{c4Diagram-UCG6FXSJ-opDgjD87.js → c4Diagram-UCG6FXSJ-BOTD9bzX.js} +1 -1
  13. package/dist-ksadk/assets/channel-s-qBe2RL.js +1 -0
  14. package/dist-ksadk/assets/chunk-2Q5K7J3B-Lg7OmxrP.js +1 -0
  15. package/dist-ksadk/assets/{chunk-5VM5RSS4-Ck1iwW_G.js → chunk-5VM5RSS4-9c10Ee3a.js} +1 -1
  16. package/dist-ksadk/assets/{chunk-F27PBJKO-B8zFIVuU.js → chunk-F27PBJKO-DndCmxKx.js} +1 -1
  17. package/dist-ksadk/assets/{chunk-G27WJ6UU-CjEsmMNX.js → chunk-G27WJ6UU-ph1aR2ew.js} +1 -1
  18. package/dist-ksadk/assets/{chunk-JWPE2WC7-CUCDIyfQ.js → chunk-JWPE2WC7-MGRKkdNg.js} +1 -1
  19. package/dist-ksadk/assets/{chunk-LCL6LL3I-DnfLBbwZ.js → chunk-LCL6LL3I-Crfo5Bg9.js} +1 -1
  20. package/dist-ksadk/assets/{chunk-POPQ4Y6H-1y0OEgko.js → chunk-POPQ4Y6H-CKzGLlYk.js} +1 -1
  21. package/dist-ksadk/assets/{chunk-RHFEMEQ7-BXaPo939.js → chunk-RHFEMEQ7-D8MCYaSK.js} +1 -1
  22. package/dist-ksadk/assets/{chunk-SVP7TREG-3RCiOG-8.js → chunk-SVP7TREG-BzTXc0wA.js} +1 -1
  23. package/dist-ksadk/assets/{chunk-XXDRQBXY-Bpt5C4kv.js → chunk-XXDRQBXY-BC5ReyyI.js} +1 -1
  24. package/dist-ksadk/assets/classDiagram-DTDB5LWJ-COCLgDEs.js +1 -0
  25. package/dist-ksadk/assets/classDiagram-v2-JRS7N3AN-COCLgDEs.js +1 -0
  26. package/dist-ksadk/assets/{cose-bilkent-JH36ORCC-CltU2Iio.js → cose-bilkent-JH36ORCC-CpYw536e.js} +1 -1
  27. package/dist-ksadk/assets/cynefin-OW5HDTMX-C-xt1CX-.js +1 -0
  28. package/dist-ksadk/assets/{cynefinDiagram-5FMLGOSQ-Bnah0vhH.js → cynefinDiagram-5FMLGOSQ-BLnqs2UC.js} +1 -1
  29. package/dist-ksadk/assets/{dagre-3AP2YEHR-BQng1ROC.js → dagre-3AP2YEHR-DnRoksk8.js} +1 -1
  30. package/dist-ksadk/assets/{dagre-CoKqxJD2.js → dagre-C-q_cMTM.js} +1 -1
  31. package/dist-ksadk/assets/{diagram-S7CK7UJ4-BXDuD2zO.js → diagram-S7CK7UJ4-DD5tL35w.js} +1 -1
  32. package/dist-ksadk/assets/{diagram-UQ7AKVKN-DIfNFAeg.js → diagram-UQ7AKVKN-BpAtdFE6.js} +1 -1
  33. package/dist-ksadk/assets/{diagram-VSXAHHWV-DKAwDqkb.js → diagram-VSXAHHWV-CMehUJPO.js} +1 -1
  34. package/dist-ksadk/assets/{diagram-VX7I27RA-qFFDltev.js → diagram-VX7I27RA-QbNJzCSv.js} +1 -1
  35. package/dist-ksadk/assets/{diagram-Z3DM3KII-zMIfhqzQ.js → diagram-Z3DM3KII-B4X85Tlu.js} +1 -1
  36. package/dist-ksadk/assets/{dist-BGIxM2Vg.js → dist-2TJ1ZCOL.js} +1 -1
  37. package/dist-ksadk/assets/{dist-Coj7US2k.js → dist-8jyOcR4w.js} +1 -1
  38. package/dist-ksadk/assets/{dist-DzXJwPG5.js → dist-A2T1KeTr.js} +1 -1
  39. package/dist-ksadk/assets/{dist-BEABF8oE.js → dist-BEyTkcDY.js} +1 -1
  40. package/dist-ksadk/assets/{dist-RXjVy4Wc.js → dist-Bi-CzopW.js} +1 -1
  41. package/dist-ksadk/assets/{dist-DI-Jbiqn.js → dist-C7sM-UN3.js} +1 -1
  42. package/dist-ksadk/assets/{dist-B29N3_Ie.js → dist-CZYb4PF9.js} +1 -1
  43. package/dist-ksadk/assets/{dist-DCeG0nKY.js → dist-Cp7irw0l.js} +1 -1
  44. package/dist-ksadk/assets/{dist-Ha8Q7H83.js → dist-CqqLUjBZ.js} +1 -1
  45. package/dist-ksadk/assets/{dist-CU5pKkyk.js → dist-D1HTEtve.js} +1 -1
  46. package/dist-ksadk/assets/{dist-YZwAStAT.js → dist-DDKMMWtJ.js} +1 -1
  47. package/dist-ksadk/assets/{dist-GOJu-1O3.js → dist-DHafuXFW.js} +1 -1
  48. package/dist-ksadk/assets/{dist-1s_bzCxO.js → dist-DKoNUyW5.js} +1 -1
  49. package/dist-ksadk/assets/dist-DYNUYmYr.js +1 -0
  50. package/dist-ksadk/assets/{dist-C60M2KmF.js → dist-Dq-1VFQW.js} +1 -1
  51. package/dist-ksadk/assets/{dist-4ml45Gmg.js → dist-I8jZ1y80.js} +1 -1
  52. package/dist-ksadk/assets/{dist-BH4O3hsm.js → dist-TRJ8GXB4.js} +1 -1
  53. package/dist-ksadk/assets/{dist-2cBTzdEm.js → dist-ZHG09ibd.js} +1 -1
  54. package/dist-ksadk/assets/{dist-Blo8ntwU.js → dist-a8wIzj7Z.js} +2 -2
  55. package/dist-ksadk/assets/{dist-ASt3FSxr.js → dist-n_EDf0JP.js} +1 -1
  56. package/dist-ksadk/assets/{dist-CPy8MMAV.js → dist-smDVDmJ_.js} +1 -1
  57. package/dist-ksadk/assets/{dist-C965y3AU.js → dist-vvj-wd6e.js} +1 -1
  58. package/dist-ksadk/assets/{ebnfDiagram-PWID7BFC-Y-b0ShII.js → ebnfDiagram-PWID7BFC-DoytR8yo.js} +1 -1
  59. package/dist-ksadk/assets/{erDiagram-SSCWMZ5O-CGX9tK2T.js → erDiagram-SSCWMZ5O-D5wO7Xx9.js} +1 -1
  60. package/dist-ksadk/assets/eventmodeling-NTZA5JFV-3qcv137n.js +1 -0
  61. package/dist-ksadk/assets/flowDiagram-A5DVABFB-BXo2QnbF.js +1 -0
  62. package/dist-ksadk/assets/{ganttDiagram-EL5Y4UJY-R7T0Mwkt.js → ganttDiagram-EL5Y4UJY-DXwswSTx.js} +1 -1
  63. package/dist-ksadk/assets/gitGraph-4MIJSDKK-C1qYB3cc.js +1 -0
  64. package/dist-ksadk/assets/{gitGraphDiagram-WWUBYQGX-gzn4XbP8.js → gitGraphDiagram-WWUBYQGX-BQ35_U5m.js} +1 -1
  65. package/dist-ksadk/assets/index-BMd2mucF.css +2 -0
  66. package/dist-ksadk/assets/index-C9lq1_sV.js +244 -0
  67. package/dist-ksadk/assets/info-A6RAGUB7-B4MWRy7s.js +1 -0
  68. package/dist-ksadk/assets/{infoDiagram-RXCK75RN-DrE_0Ol8.js → infoDiagram-RXCK75RN-BNKK7mwC.js} +1 -1
  69. package/dist-ksadk/assets/{ishikawaDiagram-5VMMS53U-CYEgalv4.js → ishikawaDiagram-5VMMS53U-RrBchfXo.js} +1 -1
  70. package/dist-ksadk/assets/{journeyDiagram-EYS64GPL-Bu-fPVb1.js → journeyDiagram-EYS64GPL-DbeWuBTU.js} +1 -1
  71. package/dist-ksadk/assets/{kanban-definition-3QL26DDD-CUFLrae5.js → kanban-definition-3QL26DDD-CgMJQBFh.js} +1 -1
  72. package/dist-ksadk/assets/{katex-CXN0YSjg.js → katex-cfBDFis_.js} +1 -1
  73. package/dist-ksadk/assets/{linear-BSbK6DWk.js → linear-CvMJLkoS.js} +1 -1
  74. package/dist-ksadk/assets/{mermaid-parser.core-D7K14JJL.js → mermaid-parser.core-DBD4MgAK.js} +2 -2
  75. package/dist-ksadk/assets/{mindmap-definition-FBJOCRG2-VVy1xsSW.js → mindmap-definition-FBJOCRG2-DOfK5ncl.js} +1 -1
  76. package/dist-ksadk/assets/packet-AYTQ26CC-BaJsmR1u.js +1 -0
  77. package/dist-ksadk/assets/{pegDiagram-XKGWAZYB-BSK45EeA.js → pegDiagram-XKGWAZYB--xu_koqY.js} +1 -1
  78. package/dist-ksadk/assets/pie-WAS4IAKB-mlz4CzK6.js +1 -0
  79. package/dist-ksadk/assets/{pieDiagram-E7YTZNPT-D7CnjFEg.js → pieDiagram-E7YTZNPT-CPOVLG46.js} +1 -1
  80. package/dist-ksadk/assets/{quadrantDiagram-AXDQQJYC-D2XhCNms.js → quadrantDiagram-AXDQQJYC-DOL7ryOQ.js} +1 -1
  81. package/dist-ksadk/assets/radar-RG4KPBEZ-DW6k0WrX.js +1 -0
  82. package/dist-ksadk/assets/railroad-74A4TZTK-CvdY089q.js +1 -0
  83. package/dist-ksadk/assets/railroad-abnf-HS5TGJTU-CrOcKyhi.js +1 -0
  84. package/dist-ksadk/assets/railroad-ebnf-LZEXJU2U-D9yFdUVf.js +1 -0
  85. package/dist-ksadk/assets/railroad-peg-WCYAUIDC-BfPsg4va.js +1 -0
  86. package/dist-ksadk/assets/{railroadDiagram-O6MQD6OU-CRzXwklx.js → railroadDiagram-O6MQD6OU-B4dCVq9q.js} +1 -1
  87. package/dist-ksadk/assets/{requirementDiagram-EFPCY7ZU-Cc9PcBiM.js → requirementDiagram-EFPCY7ZU-im_O4Plh.js} +1 -1
  88. package/dist-ksadk/assets/{sankeyDiagram-P5KCCOFB-C96FB-uX.js → sankeyDiagram-P5KCCOFB-DJ0_PPoR.js} +1 -1
  89. package/dist-ksadk/assets/{sequenceDiagram-WJ2MYXX4-CKOJAXyc.js → sequenceDiagram-WJ2MYXX4-ULwMzB2T.js} +1 -1
  90. package/dist-ksadk/assets/{sizeCapture-X5ZJPWSS-D9YhRNJt.js → sizeCapture-X5ZJPWSS-K_Fuf0h2.js} +1 -1
  91. package/dist-ksadk/assets/{stateDiagram-HBIQ2CUA-BS0ROr-u.js → stateDiagram-HBIQ2CUA-CsDLAfeQ.js} +1 -1
  92. package/dist-ksadk/assets/stateDiagram-v2-4QOOHH4V-DgIVh3e1.js +1 -0
  93. package/dist-ksadk/assets/{swimlanes-XN3QIQJK-DShW7VAE.js → swimlanes-XN3QIQJK-QxQHBdN8.js} +1 -1
  94. package/dist-ksadk/assets/swimlanesDiagram-VK2B7HYN-Fx2sfhbU.js +8 -0
  95. package/dist-ksadk/assets/{timeline-definition-24CTP7MA-DSeFMeHD.js → timeline-definition-24CTP7MA-C42CTqeJ.js} +1 -1
  96. package/dist-ksadk/assets/treeView-Q6P3EWNA-B-2NNYeb.js +1 -0
  97. package/dist-ksadk/assets/treemap-WGGIJYW6-Csy9dR_3.js +1 -0
  98. package/dist-ksadk/assets/{vennDiagram-4TSXK5OY-CZEKlEip.js → vennDiagram-4TSXK5OY-BY55il3e.js} +1 -1
  99. package/dist-ksadk/assets/wardley-WFR3VGLG-Cx-uCkSS.js +1 -0
  100. package/dist-ksadk/assets/{wardleyDiagram-VM6X3IG4-DTOzWBuZ.js → wardleyDiagram-VM6X3IG4-DiFB1AdX.js} +1 -1
  101. package/dist-ksadk/assets/{xychartDiagram-S5SC5T6Z-RbQFiLqZ.js → xychartDiagram-S5SC5T6Z-BFPyOnRF.js} +1 -1
  102. package/dist-ksadk/index.html +2 -2
  103. package/dist-lib/{AttachmentPreview-BKMo_SaP.js → AttachmentPreview-tjd7Ufsh.js} +1 -1
  104. package/dist-lib/CodeBlock-DMIf4h33.js +213 -0
  105. package/dist-lib/{ConnectedComposer-B5icGTSY.js → ConnectedComposer-Cz5HKWFx.js} +289 -247
  106. package/dist-lib/{ConnectedMessageList-C01x96Jz.js → ConnectedMessageList-XLBootgU.js} +549 -422
  107. package/dist-lib/FilePreviewModal-BM_EhLH0.js +270 -0
  108. package/dist-lib/{MathMessageMarkdown--DoGNUu-.js → MathMessageMarkdown-BesSeCYl.js} +33 -33
  109. package/dist-lib/MermaidBlock-H_0qzQDf.js +42 -0
  110. package/dist-lib/MessageMarkdown-CwMTvgFj.js +437 -0
  111. package/dist-lib/{WorkspacePanelContainer-BKdoP1vC.js → WorkspacePanelContainer-B2mk7udj.js} +3 -3
  112. package/dist-lib/{a2ui-C7sqee_K.js → a2ui-BEQoW34n.js} +22 -19
  113. package/dist-lib/chat-composer.js +2 -2
  114. package/dist-lib/chat-timeline.js +3 -3
  115. package/dist-lib/components/MessageMarkdown.d.ts.map +1 -1
  116. package/dist-lib/components/chat/ChatComposer.d.ts +4 -2
  117. package/dist-lib/components/chat/ChatComposer.d.ts.map +1 -1
  118. package/dist-lib/components/chat/ChatMessageList.d.ts +8 -1
  119. package/dist-lib/components/chat/ChatMessageList.d.ts.map +1 -1
  120. package/dist-lib/components/chat/ConnectedComposer.d.ts +9 -1
  121. package/dist-lib/components/chat/ConnectedComposer.d.ts.map +1 -1
  122. package/dist-lib/components/chat/ConnectedMessageList.d.ts +5 -1
  123. package/dist-lib/components/chat/ConnectedMessageList.d.ts.map +1 -1
  124. package/dist-lib/components/chat/ProcessingBlocksView.d.ts.map +1 -1
  125. package/dist-lib/components/chat/types.d.ts +8 -0
  126. package/dist-lib/components/chat/types.d.ts.map +1 -1
  127. package/dist-lib/components/markdown/CodeBlock.d.ts.map +1 -1
  128. package/dist-lib/components/markdown/MathMessageMarkdown.d.ts.map +1 -1
  129. package/dist-lib/components/markdown/MermaidBlock.d.ts.map +1 -1
  130. package/dist-lib/components/teams/CreateGroupDialog.d.ts +6 -1
  131. package/dist-lib/components/teams/CreateGroupDialog.d.ts.map +1 -1
  132. package/dist-lib/components/teams/TeamReconciliation.d.ts +9 -0
  133. package/dist-lib/components/teams/TeamReconciliation.d.ts.map +1 -0
  134. package/dist-lib/components/teams/TeamWorkspace.d.ts +20 -10
  135. package/dist-lib/components/teams/TeamWorkspace.d.ts.map +1 -1
  136. package/dist-lib/components/workspace/FilePreviewModal.d.ts +21 -0
  137. package/dist-lib/components/workspace/FilePreviewModal.d.ts.map +1 -0
  138. package/dist-lib/components.js +33 -32
  139. package/dist-lib/conversation.js +198 -6
  140. package/dist-lib/core/conversation/history-search.d.ts +33 -0
  141. package/dist-lib/core/conversation/history-search.d.ts.map +1 -0
  142. package/dist-lib/core/conversation/hosted.d.ts +1 -1
  143. package/dist-lib/core/conversation/hosted.d.ts.map +1 -1
  144. package/dist-lib/core/conversation/index.d.ts +1 -0
  145. package/dist-lib/core/conversation/index.d.ts.map +1 -1
  146. package/dist-lib/core/conversation/presentation.d.ts.map +1 -1
  147. package/dist-lib/core/conversation/projection-store.d.ts +25 -0
  148. package/dist-lib/core/conversation/projection-store.d.ts.map +1 -0
  149. package/dist-lib/core/conversation/session-facade.d.ts +136 -0
  150. package/dist-lib/core/conversation/session-facade.d.ts.map +1 -0
  151. package/dist-lib/core/conversation/studio-controller.d.ts +143 -0
  152. package/dist-lib/core/conversation/studio-controller.d.ts.map +1 -0
  153. package/dist-lib/core/conversation/types.d.ts +8 -0
  154. package/dist-lib/core/conversation/types.d.ts.map +1 -1
  155. package/dist-lib/core/run/blocks.d.ts +2 -0
  156. package/dist-lib/core/run/blocks.d.ts.map +1 -1
  157. package/dist-lib/core/run/dispatcher.d.ts +4 -1
  158. package/dist-lib/core/run/dispatcher.d.ts.map +1 -1
  159. package/dist-lib/core/run/engine.d.ts +22 -6
  160. package/dist-lib/core/run/engine.d.ts.map +1 -1
  161. package/dist-lib/core/run/index.d.ts +1 -1
  162. package/dist-lib/core/run/index.d.ts.map +1 -1
  163. package/dist-lib/core/run/types.d.ts +8 -3
  164. package/dist-lib/core/run/types.d.ts.map +1 -1
  165. package/dist-lib/core/teams/client.d.ts +18 -3
  166. package/dist-lib/core/teams/client.d.ts.map +1 -1
  167. package/dist-lib/core/teams/contracts.d.ts +188 -0
  168. package/dist-lib/core/teams/contracts.d.ts.map +1 -1
  169. package/dist-lib/core/teams/grouping.d.ts +5 -0
  170. package/dist-lib/core/teams/grouping.d.ts.map +1 -0
  171. package/dist-lib/core/teams/reducer.d.ts.map +1 -1
  172. package/dist-lib/core/teams/types.d.ts +71 -2
  173. package/dist-lib/core/teams/types.d.ts.map +1 -1
  174. package/dist-lib/file-preview.js +3 -0
  175. package/dist-lib/history-search-CBd9v7MY.js +58 -0
  176. package/dist-lib/hooks/useAgentChat.d.ts +22 -1
  177. package/dist-lib/hooks/useAgentChat.d.ts.map +1 -1
  178. package/dist-lib/hooks/useRunAgent.d.ts +9 -4
  179. package/dist-lib/hooks/useRunAgent.d.ts.map +1 -1
  180. package/dist-lib/hooks/useSessionLifecycle.d.ts +13 -2
  181. package/dist-lib/hooks/useSessionLifecycle.d.ts.map +1 -1
  182. package/dist-lib/hooks.js +229 -130
  183. package/dist-lib/{permission-Cu2xehB-.js → permission-CcMWqN8Y.js} +1 -1
  184. package/dist-lib/{persisted-session-history-CJAtRhxZ.js → persisted-session-history-ClsfDfGs.js} +201 -175
  185. package/dist-lib/public/components.d.ts +3 -0
  186. package/dist-lib/public/components.d.ts.map +1 -1
  187. package/dist-lib/public/conversation.d.ts +8 -0
  188. package/dist-lib/public/conversation.d.ts.map +1 -1
  189. package/dist-lib/public/file-preview.d.ts +4 -0
  190. package/dist-lib/public/file-preview.d.ts.map +1 -0
  191. package/dist-lib/public/runtime.d.ts +1 -1
  192. package/dist-lib/public/runtime.d.ts.map +1 -1
  193. package/dist-lib/{reducer-B-uAlhi2.js → reducer-gQmR9Qb9.js} +118 -66
  194. package/dist-lib/runtime.js +7 -7
  195. package/dist-lib/stores/streaming.d.ts +3 -1
  196. package/dist-lib/stores/streaming.d.ts.map +1 -1
  197. package/dist-lib/studio-controller-jBKN9hmp.js +422 -0
  198. package/dist-lib/styles.css +1 -1
  199. package/dist-lib/team-components.js +1102 -435
  200. package/dist-lib/teams.css +121 -8
  201. package/dist-lib/teams.js +41 -22
  202. package/dist-lib/types/agent-control.d.ts.map +1 -1
  203. package/dist-lib/types/capabilities.d.ts +6 -0
  204. package/dist-lib/types/capabilities.d.ts.map +1 -1
  205. package/dist-lib/{useSessionLifecycle-DN68JYHx.js → useSessionLifecycle-DQXKeBm9.js} +1146 -951
  206. package/dist-lib/utils/persisted-session-history.d.ts.map +1 -1
  207. package/dist-lib/utils/session-events.d.ts.map +1 -1
  208. package/dist-lib/utils/workspace-file-paths.d.ts +24 -0
  209. package/dist-lib/utils/workspace-file-paths.d.ts.map +1 -0
  210. package/dist-lib/utils/workspace-file-preview-bus.d.ts +4 -0
  211. package/dist-lib/utils/workspace-file-preview-bus.d.ts.map +1 -0
  212. package/package.json +11 -4
  213. package/schemas/teams-v1-group-snapshot.schema.json +449 -1
  214. package/dist-ksadk/assets/MathMessageMarkdown-CE8kmnzT.js +0 -8
  215. package/dist-ksadk/assets/architecture-7GRP2DOG-rCXFSJus.js +0 -1
  216. package/dist-ksadk/assets/channel-hnxAcHmY.js +0 -1
  217. package/dist-ksadk/assets/chunk-2Q5K7J3B-CULEGhLm.js +0 -1
  218. package/dist-ksadk/assets/classDiagram-DTDB5LWJ-ChOM9CGx.js +0 -1
  219. package/dist-ksadk/assets/classDiagram-v2-JRS7N3AN-ChOM9CGx.js +0 -1
  220. package/dist-ksadk/assets/cynefin-OW5HDTMX-s8NJ5Tm_.js +0 -1
  221. package/dist-ksadk/assets/dist-Bzxnd_qQ.js +0 -1
  222. package/dist-ksadk/assets/eventmodeling-NTZA5JFV-DSV5ve2-.js +0 -1
  223. package/dist-ksadk/assets/flowDiagram-A5DVABFB-B3rM8szx.js +0 -1
  224. package/dist-ksadk/assets/gitGraph-4MIJSDKK-B4xZV0AQ.js +0 -1
  225. package/dist-ksadk/assets/index-CYNEAutW.css +0 -2
  226. package/dist-ksadk/assets/index-obJvgClV.js +0 -244
  227. package/dist-ksadk/assets/info-A6RAGUB7-iLxaj0HG.js +0 -1
  228. package/dist-ksadk/assets/packet-AYTQ26CC-Cn-vZ0Ty.js +0 -1
  229. package/dist-ksadk/assets/pie-WAS4IAKB-DFyCNLMM.js +0 -1
  230. package/dist-ksadk/assets/radar-RG4KPBEZ-DOHzZ4f2.js +0 -1
  231. package/dist-ksadk/assets/railroad-74A4TZTK-3tTa8qz5.js +0 -1
  232. package/dist-ksadk/assets/railroad-abnf-HS5TGJTU-BCeMbyzT.js +0 -1
  233. package/dist-ksadk/assets/railroad-ebnf-LZEXJU2U-CBtr8GVh.js +0 -1
  234. package/dist-ksadk/assets/railroad-peg-WCYAUIDC-CL9v6-uA.js +0 -1
  235. package/dist-ksadk/assets/stateDiagram-v2-4QOOHH4V-jtOYkJhr.js +0 -1
  236. package/dist-ksadk/assets/swimlanesDiagram-VK2B7HYN-fHwNs_3X.js +0 -8
  237. package/dist-ksadk/assets/treeView-Q6P3EWNA-BkRpaj3X.js +0 -1
  238. package/dist-ksadk/assets/treemap-WGGIJYW6-BUpY1xKR.js +0 -1
  239. package/dist-ksadk/assets/wardley-WFR3VGLG-CJDNWytu.js +0 -1
  240. package/dist-lib/CodeBlock-CgGEMQi-.js +0 -113
  241. package/dist-lib/MermaidBlock-DBFTztfQ.js +0 -35
  242. package/dist-lib/MessageMarkdown-C0NKq4TZ.js +0 -255
@@ -1,6 +1,6 @@
1
1
  import { t as e } from "./InteractionSchemaForm-BNoW5wzt.js";
2
- import { t } from "./MessageMarkdown-C0NKq4TZ.js";
3
- import { S as n, i as r, n as i } from "./reducer-B-uAlhi2.js";
2
+ import { t } from "./MessageMarkdown-CwMTvgFj.js";
3
+ import { C as n, i as r, n as i } from "./reducer-gQmR9Qb9.js";
4
4
  import { i as a, n as o, o as s, r as c, s as l, t as u } from "./presentation-yYw7xK60.js";
5
5
  import { Suspense as d, lazy as f, useEffect as p, useId as m, useLayoutEffect as h, useMemo as g, useRef as _, useState as v, useSyncExternalStore as y } from "react";
6
6
  import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
@@ -37,8 +37,112 @@ function C({ message: e }) {
37
37
  });
38
38
  }
39
39
  //#endregion
40
+ //#region src/components/teams/TeamReconciliation.tsx
41
+ function w({ run: e, onLoadReconciliation: t, onReconcile: n }) {
42
+ let [r, i] = v(null), [a, o] = v({}), [s, c] = v(!1), [l, u] = v("");
43
+ if (!t || !n || e.leaderStandby?.reason !== "execution_uncertain_fenced") return null;
44
+ async function d() {
45
+ c(!0), u("");
46
+ try {
47
+ i(await t(e));
48
+ } catch (e) {
49
+ u(e instanceof Error ? e.message : "暂时无法读取原单。");
50
+ } finally {
51
+ c(!1);
52
+ }
53
+ }
54
+ async function f(r, s) {
55
+ c(!0), u("");
56
+ try {
57
+ await n(r, s, (a[r.commandId] || "").trim()), i(await t(e)), o((e) => ({
58
+ ...e,
59
+ [r.commandId]: ""
60
+ }));
61
+ } catch (e) {
62
+ u(e instanceof Error ? e.message : "核查状态已改变,请刷新。");
63
+ } finally {
64
+ c(!1);
65
+ }
66
+ }
67
+ return /* @__PURE__ */ S("section", {
68
+ className: "team-run-budget",
69
+ "aria-label": "原执行核查",
70
+ children: [
71
+ /* @__PURE__ */ x("h4", { children: "旧执行结果需要核查" }),
72
+ /* @__PURE__ */ x("p", { children: "云端已接管,相关分支会等待原单确认。请先核对外部操作和交付物,再决定是否采用结果。" }),
73
+ /* @__PURE__ */ x("button", {
74
+ type: "button",
75
+ className: "team-button",
76
+ disabled: s,
77
+ onClick: () => void d(),
78
+ children: s ? "正在核对…" : "查看原单证据"
79
+ }),
80
+ r?.filter((e) => !e.reconciled).map((e) => {
81
+ let t = e.quarantinedReceipt, n = a[e.commandId] || "", r = !!e.receiptDigest && [
82
+ "succeeded",
83
+ "failed",
84
+ "cancelled",
85
+ "interrupted"
86
+ ].includes(t?.run_status || "");
87
+ return /* @__PURE__ */ S("article", {
88
+ className: "team-observer-item",
89
+ children: [
90
+ /* @__PURE__ */ S("p", { children: [
91
+ e.taskId ? "成员执行" : "原 Leader 执行",
92
+ " · ",
93
+ r ? "已返回结束回执" : "原节点尚未返回结束回执"
94
+ ] }),
95
+ t?.output && /* @__PURE__ */ x("pre", {
96
+ className: "team-observer-details",
97
+ children: t.output.slice(0, 1e4)
98
+ }),
99
+ /* @__PURE__ */ S("details", { children: [/* @__PURE__ */ x("summary", { children: "执行引用" }), /* @__PURE__ */ x("code", { children: t?.run_id || e.nativeRunId || e.commandId })] }),
100
+ r && /* @__PURE__ */ S(b, { children: [
101
+ /* @__PURE__ */ S("label", {
102
+ className: "team-field",
103
+ children: ["核查说明", /* @__PURE__ */ x("textarea", {
104
+ value: n,
105
+ onChange: (t) => o((n) => ({
106
+ ...n,
107
+ [e.commandId]: t.target.value
108
+ })),
109
+ maxLength: 2e3,
110
+ placeholder: "说明已检查哪些原单或外部结果"
111
+ })]
112
+ }),
113
+ /* @__PURE__ */ x("button", {
114
+ type: "button",
115
+ className: "team-button",
116
+ disabled: s || !n.trim(),
117
+ onClick: () => void f(e, "confirm_ended"),
118
+ children: "确认已结束"
119
+ }),
120
+ e.taskId && t?.run_status === "succeeded" && /* @__PURE__ */ x("button", {
121
+ type: "button",
122
+ className: "team-button",
123
+ disabled: s || !n.trim(),
124
+ onClick: () => void f(e, "use_result"),
125
+ children: "采用已验证成果"
126
+ }),
127
+ /* @__PURE__ */ x("p", {
128
+ className: "team-muted",
129
+ children: "确认结束不会自动重新执行;必要时再对相应子任务提出重试。"
130
+ })
131
+ ] })
132
+ ]
133
+ }, e.commandId);
134
+ }),
135
+ l && /* @__PURE__ */ x("p", {
136
+ role: "alert",
137
+ className: "team-inline-error",
138
+ children: l
139
+ })
140
+ ]
141
+ });
142
+ }
143
+ //#endregion
40
144
  //#region src/components/teams/TeamWorkspace.tsx
41
- var w = f(() => import("./ExecutionTree-v3HexvPo.js").then((e) => e.n).then((e) => ({ default: e.ExecutionTree }))), T = () => `team-${globalThis.crypto.randomUUID()}`, E = {
145
+ var T = f(() => import("./ExecutionTree-v3HexvPo.js").then((e) => e.n).then((e) => ({ default: e.ExecutionTree }))), ee = () => `team-${globalThis.crypto.randomUUID()}`, E = {
42
146
  owner: "群主",
43
147
  leader: "Leader",
44
148
  member: "成员",
@@ -71,8 +175,14 @@ function A({ status: e }) {
71
175
  children: u[e] ?? e
72
176
  });
73
177
  }
74
- function j({ snapshot: e, connection: t, onProgress: n, onMembers: r, onManage: i }) {
75
- let a = e.members.filter((e) => e.status !== "removed"), s = o(e);
178
+ function j({ goal: e }) {
179
+ return e.length <= 100 ? /* @__PURE__ */ x("h3", { children: e }) : /* @__PURE__ */ S("details", {
180
+ className: "team-run-goal",
181
+ children: [/* @__PURE__ */ S("summary", { children: [/* @__PURE__ */ x("h3", { children: e }), /* @__PURE__ */ x("span", { children: "完整目标" })] }), /* @__PURE__ */ x("p", { children: e })]
182
+ });
183
+ }
184
+ function M({ snapshot: e, connection: t, onMembers: n, onManage: r }) {
185
+ let i = e.members.filter((e) => e.status !== "removed");
76
186
  return /* @__PURE__ */ S("header", {
77
187
  className: "team-header",
78
188
  children: [/* @__PURE__ */ S("div", {
@@ -80,73 +190,67 @@ function j({ snapshot: e, connection: t, onProgress: n, onMembers: r, onManage:
80
190
  children: [/* @__PURE__ */ x("div", {
81
191
  className: "team-avatar-stack",
82
192
  "aria-hidden": "true",
83
- children: a.slice(0, 3).map((e) => /* @__PURE__ */ x(k, { name: e.name }, e.memberId))
193
+ children: i.slice(0, 3).map((e) => /* @__PURE__ */ x(k, { name: e.name }, e.memberId))
84
194
  }), /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("h1", { children: e.group.name }), /* @__PURE__ */ S("button", {
85
195
  type: "button",
86
196
  className: "team-text-button team-muted",
87
- onClick: r,
197
+ onClick: n,
88
198
  children: [
89
- a.length,
199
+ i.length,
90
200
  " 位成员 · ",
91
- a.find((t) => t.memberId === e.group.leaderMemberId)?.name || "Leader"
201
+ i.find((t) => t.memberId === e.group.leaderMemberId)?.name || "Leader"
92
202
  ]
93
203
  })] })]
94
204
  }), /* @__PURE__ */ S("div", {
95
205
  className: "team-header-actions",
96
- children: [
97
- t !== "connected" && /* @__PURE__ */ x("span", {
98
- className: "team-connection",
99
- role: "status",
100
- children: O[t]
101
- }),
102
- i && /* @__PURE__ */ x("button", {
103
- type: "button",
104
- className: "team-button",
105
- onClick: i,
106
- children: "设置"
107
- }),
108
- s && /* @__PURE__ */ x("button", {
109
- type: "button",
110
- className: "team-button",
111
- onClick: n,
112
- children: "本轮进展"
113
- })
114
- ]
206
+ children: [t !== "connected" && /* @__PURE__ */ x("span", {
207
+ className: "team-connection",
208
+ role: "status",
209
+ children: O[t]
210
+ }), r && /* @__PURE__ */ x("button", {
211
+ type: "button",
212
+ className: "team-button",
213
+ onClick: r,
214
+ children: "设置"
215
+ })]
115
216
  })]
116
217
  });
117
218
  }
118
- function M({ messages: e, children: n, emptyState: r }) {
119
- let i = _(null), a = _(!0), [o, s] = v(100), c = e.filter((e) => e.visibility === "public");
219
+ function N({ messages: e, children: n, emptyState: r, focusFinalDelivery: i }) {
220
+ let a = _(null), o = _(!0), [s, c] = v(100), l = e.filter((e) => e.visibility === "public");
120
221
  h(() => {
121
- a.current && i.current && (i.current.scrollTop = i.current.scrollHeight);
122
- }, [e, n]);
123
- function l() {
124
- let e = i.current;
222
+ let e = a.current;
223
+ if (!o.current || !e) return;
224
+ let t = i ? e.querySelector(".team-final-delivery") : null;
225
+ t ? e.scrollTop += t.getBoundingClientRect().top - e.getBoundingClientRect().top - 12 : e.scrollTop = e.scrollHeight;
226
+ }, [l.map((e) => `${e.messageId}:${e.revision}`).join("|"), i]);
227
+ function u() {
228
+ let e = a.current;
125
229
  if (!e) return;
126
230
  let t = e.scrollHeight;
127
- s((e) => e + 100), requestAnimationFrame(() => {
231
+ c((e) => e + 100), requestAnimationFrame(() => {
128
232
  e.scrollTop += e.scrollHeight - t;
129
233
  });
130
234
  }
131
235
  return /* @__PURE__ */ x("div", {
132
236
  className: "team-timeline",
133
- ref: i,
237
+ ref: a,
134
238
  onScroll: () => {
135
- let e = i.current;
136
- e && (a.current = e.scrollHeight - e.scrollTop - e.clientHeight < 80);
239
+ let e = a.current;
240
+ e && (o.current = e.scrollHeight - e.scrollTop - e.clientHeight < 80);
137
241
  },
138
242
  "aria-label": "群聊消息",
139
243
  tabIndex: 0,
140
244
  children: /* @__PURE__ */ S("div", {
141
245
  className: "team-timeline-inner",
142
246
  children: [
143
- c.length > o && /* @__PURE__ */ x("button", {
247
+ l.length > s && /* @__PURE__ */ x("button", {
144
248
  className: "team-button team-history-more",
145
249
  type: "button",
146
- onClick: l,
250
+ onClick: u,
147
251
  children: "查看更早的消息"
148
252
  }),
149
- !c.length && (r ?? /* @__PURE__ */ S("div", {
253
+ !l.length && (r ?? /* @__PURE__ */ S("div", {
150
254
  className: "team-empty",
151
255
  children: [
152
256
  /* @__PURE__ */ x("span", {
@@ -157,11 +261,11 @@ function M({ messages: e, children: n, emptyState: r }) {
157
261
  /* @__PURE__ */ S("p", { children: [
158
262
  "描述你想得到的成果,Leader 会组织成员分工。",
159
263
  /* @__PURE__ */ x("br", {}),
160
- "先发送目标启动协作,再按需 @成员。"
264
+ "也可以 @成员,指定由谁参与。"
161
265
  ] })
162
266
  ]
163
267
  })),
164
- c.slice(-o).map((e) => /* @__PURE__ */ S("article", {
268
+ l.slice(-s).map((e) => /* @__PURE__ */ S("article", {
165
269
  className: "team-message",
166
270
  "data-role": e.groupRole,
167
271
  "data-message-id": e.messageId,
@@ -196,11 +300,12 @@ function M({ messages: e, children: n, emptyState: r }) {
196
300
  })
197
301
  });
198
302
  }
199
- function ee({ run: e, tasks: t, pendingCount: n, onOpen: r }) {
200
- let i = t.filter((e) => e.status === "succeeded").length;
303
+ function te({ run: e, tasks: t, pendingCount: n, onOpen: r, compact: i = !1 }) {
304
+ let a = t.filter((e) => e.status === "succeeded").length, o = c(e.status);
201
305
  return /* @__PURE__ */ S("button", {
202
306
  type: "button",
203
307
  className: "team-progress-card",
308
+ "data-active": o || void 0,
204
309
  onClick: r,
205
310
  "aria-label": `查看协作:${e.goal}`,
206
311
  children: [
@@ -209,13 +314,27 @@ function ee({ run: e, tasks: t, pendingCount: n, onOpen: r }) {
209
314
  children: [/* @__PURE__ */ x("span", {
210
315
  className: "team-eyebrow",
211
316
  children: "本轮协作"
212
- }), /* @__PURE__ */ x(A, { status: e.status })]
317
+ }), /* @__PURE__ */ S("span", {
318
+ className: "team-progress-status",
319
+ children: [/* @__PURE__ */ x(A, { status: e.status }), o && /* @__PURE__ */ S("span", {
320
+ className: "team-progress-live",
321
+ role: "status",
322
+ children: ["实时处理中", /* @__PURE__ */ S("span", {
323
+ "aria-hidden": "true",
324
+ children: [
325
+ /* @__PURE__ */ x("i", {}),
326
+ /* @__PURE__ */ x("i", {}),
327
+ /* @__PURE__ */ x("i", {})
328
+ ]
329
+ })]
330
+ })]
331
+ })]
213
332
  }),
214
- /* @__PURE__ */ x("strong", { children: e.goal }),
333
+ !i && /* @__PURE__ */ x("strong", { children: e.goal }),
215
334
  /* @__PURE__ */ S("span", {
216
335
  className: "team-progress-caption",
217
336
  children: [
218
- t.length ? `${i} / ${t.length} 项任务已验收` : "正在整理目标与分工",
337
+ t.length ? `${a} / ${t.length} 项任务已验收` : "正在整理目标与分工",
219
338
  n > 0 ? ` · ${n} 项需要处理` : "",
220
339
  /* @__PURE__ */ S("span", { children: ["查看协作 ", /* @__PURE__ */ x("span", {
221
340
  "aria-hidden": "true",
@@ -230,84 +349,142 @@ function ee({ run: e, tasks: t, pendingCount: n, onOpen: r }) {
230
349
  ]
231
350
  });
232
351
  }
233
- function N({ members: e, activeRun: t, value: n, onChange: r, onSend: i, disabled: a = !1, recipientMemberId: o, onRecipientChange: s, focusRequest: l = 0, artifacts: u = [] }) {
234
- let d = m(), f = m(), g = m(), [y, C] = v([]), w = u.filter((e) => y.includes(e.artifactId)), [E, D] = v(""), O = o ?? E, A = (e) => {
235
- D(e), s?.(e);
236
- }, j = _(null);
352
+ function P({ members: e, activeRun: t, value: n, onChange: r, onSend: i, disabled: a = !1, recipientMemberId: o, onRecipientChange: s, focusRequest: l = 0, artifacts: u = [], referenceArtifacts: d = [], serverAuthority: f = !1 }) {
353
+ let g = m(), y = m(), C = m(), w = t?.teamRunId || "", T = {
354
+ attachmentIds: [],
355
+ note: !1,
356
+ sourcePath: "",
357
+ baseRef: "",
358
+ inputs: "",
359
+ mode: "auto"
360
+ }, [E, D] = v({}), O = E[w] || T, A = (e) => D((t) => ({
361
+ ...t,
362
+ [w]: {
363
+ ...t[w] || T,
364
+ ...e
365
+ }
366
+ })), { attachmentIds: j, note: M } = O, N = (e) => D((t) => {
367
+ let n = t[w] || T;
368
+ return {
369
+ ...t,
370
+ [w]: {
371
+ ...n,
372
+ attachmentIds: typeof e == "function" ? e(n.attachmentIds) : e
373
+ }
374
+ };
375
+ }), te = (e) => A({ note: e }), P = [...new Map([...u, ...d].map((e) => [e.artifactId, e])).values()], F = P.filter((e) => j.includes(e.artifactId)), [ne, re] = v(""), I = o ?? ne, ie = (e) => {
376
+ re(e), s?.(e);
377
+ }, L = _(null);
237
378
  h(() => {
238
- let e = j.current;
379
+ let e = L.current;
239
380
  e && (e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight, 176)}px`);
240
381
  }, [n]), p(() => {
241
- l && j.current?.focus();
382
+ l && L.current?.focus();
242
383
  }, [l]);
243
- let [M, ee] = v(!1), [N, P] = v(!1), F = !!(t && c(t.status)), I = !!(O && !M && !F), [L, R] = v(""), z = _(null), B = _(!0);
244
- p(() => (B.current = !0, () => {
245
- B.current = !1;
384
+ let [ae, oe] = v(0), se = _(w);
385
+ se.current = w, p(() => {
386
+ V("");
387
+ }, [w]);
388
+ let [R, ce] = v(!1), z = !!(t && c(t.status)), B = (!!(t && !z) || t?.status === "cancel_requested") && !M, [le, V] = v(""), H = _(/* @__PURE__ */ new Map()), U = _(!0);
389
+ p(() => (U.current = !0, () => {
390
+ U.current = !1;
246
391
  }), []);
247
- let V = /@([^\s@]*)$/u.exec(n)?.[1], H = V === void 0 ? [] : e.filter((e) => e.status === "active" && e.name.toLowerCase().includes(V.toLowerCase()));
248
- async function te() {
249
- if (a || N || !n.trim() && !w.length) return;
250
- if (I) {
251
- R("请先选择发给 Leader,启动本轮目标;也可以选择仅留言。");
392
+ let ue = /@([^\s@]*)$/u.exec(n)?.[1], W = ue === void 0 ? [] : e.filter((e) => e.status === "active" && e.name.toLowerCase().includes(ue.toLowerCase()));
393
+ async function G() {
394
+ if (a || R || !n.trim() && !F.length) return;
395
+ if (B) {
396
+ V("这个任务已结束,请新建任务继续协作。");
252
397
  return;
253
398
  }
254
- let e = n.trim(), o = M ? "note" : O === "" ? t && c(t.status) ? "followup" : "start_goal" : "directed";
399
+ let e = n.trim(), o = M ? "note" : t ? I === "" ? "followup" : "directed" : "start_goal";
255
400
  if (o === "start_goal" && !e) {
256
- R("请补充这轮希望团队完成的目标,或选择仅留言。");
401
+ V("请补充这轮希望团队完成的目标,或选择仅留言。");
257
402
  return;
258
403
  }
259
- let s = O === "" ? [] : [O], l = [...e ? [{
404
+ let s = I === "" ? [] : [I], c = [...e ? [{
260
405
  kind: "text",
261
406
  text: e
262
- }] : [], ...w.map((e) => ({
407
+ }] : [], ...F.map((e) => ({
263
408
  kind: "attachment",
264
409
  attachmentRef: e.artifactId,
265
410
  mediaType: e.mediaType,
266
411
  name: e.name
267
- }))], u = JSON.stringify([
268
- l,
412
+ }))], l = t?.teamRunId, u = w;
413
+ if (o === "start_goal" && !O.sourcePath.trim() && (O.baseRef.trim() || O.inputs.trim())) {
414
+ V("请先填写执行节点上的工作目录。");
415
+ return;
416
+ }
417
+ let d = o === "start_goal" && O.sourcePath.trim() ? {
418
+ sourcePath: O.sourcePath.trim(),
419
+ mode: O.mode,
420
+ ...O.mode === "auto" && O.baseRef.trim() ? { baseRef: O.baseRef.trim() } : {},
421
+ inputs: O.inputs.split(/\r?\n/).map((e) => e.trim()).filter(Boolean)
422
+ } : void 0;
423
+ if (d && f && d.mode === "auto" && !/^(?:[a-fA-F0-9]{40}|[a-fA-F0-9]{64})$/.test(O.baseRef.trim())) {
424
+ V("云端协作的 Git 基线需要完整的 40 或 64 位 commit,请在工作目录设置中填写。");
425
+ return;
426
+ }
427
+ if (d && d.inputs.length > 32) {
428
+ V("每次任务最多引用 32 个输入文件。");
429
+ return;
430
+ }
431
+ let p = JSON.stringify([
432
+ c,
269
433
  o,
270
- s
434
+ s,
435
+ l,
436
+ d
271
437
  ]);
272
- z.current?.digest !== u && (z.current = {
273
- digest: u,
274
- idempotencyKey: T()
275
- }), P(!0), R("");
438
+ H.current.get(w)?.digest !== p && H.current.set(w, {
439
+ digest: p,
440
+ idempotencyKey: ee()
441
+ });
442
+ let m = H.current.get(w);
443
+ ce(!0), V("");
276
444
  try {
277
445
  let e = await i({
278
- parts: l,
446
+ parts: c,
279
447
  mentions: s,
280
448
  intent: o,
281
- idempotencyKey: z.current.idempotencyKey
449
+ ...l ? { teamRunId: l } : {},
450
+ ...d ? { workspace: d } : {},
451
+ idempotencyKey: m.idempotencyKey
282
452
  });
283
- if (!B.current) return;
453
+ if (!U.current) return;
284
454
  if (e?.status === "rejected" || e?.status === "uncertain") throw Error(e.reason || (e.status === "uncertain" ? "消息接收结果尚未确认。再次提交将使用相同标识核对。" : "消息未被接收。"));
285
- r(""), C([]), z.current = null;
455
+ se.current === u && (r(""), N([])), H.current.delete(u), o === "start_goal" && D((e) => {
456
+ let t = { ...e };
457
+ return delete t[u], t;
458
+ });
286
459
  } catch (e) {
287
- R(e instanceof Error ? e.message : "消息发送失败,请重试。");
460
+ V(e instanceof Error ? e.message : "消息发送失败,请重试。");
288
461
  } finally {
289
- P(!1);
462
+ ce(!1);
290
463
  }
291
464
  }
465
+ function K(e) {
466
+ ie(e.memberId), r(n.replace(/@([^\s@]*)$/u, `@${e.name} `)), oe(0), L.current?.focus();
467
+ }
292
468
  return /* @__PURE__ */ S("form", {
293
469
  className: "team-composer-wrap",
294
470
  onSubmit: (e) => {
295
- e.preventDefault(), te();
471
+ e.preventDefault(), G();
296
472
  },
297
473
  children: [
298
- L && /* @__PURE__ */ x("p", {
474
+ le && /* @__PURE__ */ x("p", {
299
475
  className: "team-inline-error",
300
476
  role: "alert",
301
- children: L
477
+ children: le
302
478
  }),
303
- !!H.length && /* @__PURE__ */ x("div", {
479
+ !!W.length && /* @__PURE__ */ x("div", {
304
480
  className: "team-mention-options",
481
+ role: "listbox",
305
482
  "aria-label": "选择要提及的成员",
306
- children: H.map((e) => /* @__PURE__ */ S("button", {
483
+ children: W.map((e, t) => /* @__PURE__ */ S("button", {
307
484
  type: "button",
308
- onClick: () => {
309
- A(e.memberId), r(n.replace(/@([^\s@]*)$/u, `@${e.name} `));
310
- },
485
+ role: "option",
486
+ "aria-selected": t === ae,
487
+ onClick: () => K(e),
311
488
  children: [
312
489
  /* @__PURE__ */ x(k, { name: e.name }),
313
490
  /* @__PURE__ */ x("span", { children: e.name }),
@@ -315,17 +492,17 @@ function N({ members: e, activeRun: t, value: n, onChange: r, onSend: i, disable
315
492
  ]
316
493
  }, e.memberId))
317
494
  }),
318
- !!w.length && /* @__PURE__ */ x("div", {
495
+ !!F.length && /* @__PURE__ */ x("div", {
319
496
  className: "team-selected-artifacts",
320
497
  "aria-label": "已选择的交付物",
321
- children: w.map((e) => /* @__PURE__ */ S("span", {
498
+ children: F.map((e) => /* @__PURE__ */ S("span", {
322
499
  className: "team-attachment",
323
500
  children: [e.name, /* @__PURE__ */ x("button", {
324
501
  type: "button",
325
502
  className: "team-text-button",
326
503
  "aria-label": `移除引用 ${e.name}`,
327
- disabled: N,
328
- onClick: () => C((t) => t.filter((t) => t !== e.artifactId)),
504
+ disabled: R,
505
+ onClick: () => N((t) => t.filter((t) => t !== e.artifactId)),
329
506
  children: "×"
330
507
  })]
331
508
  }, e.artifactId))
@@ -335,19 +512,29 @@ function N({ members: e, activeRun: t, value: n, onChange: r, onSend: i, disable
335
512
  children: [
336
513
  /* @__PURE__ */ x("label", {
337
514
  className: "team-sr-only",
338
- htmlFor: d,
515
+ htmlFor: g,
339
516
  children: "给团队的消息"
340
517
  }),
341
518
  /* @__PURE__ */ x("textarea", {
342
- ref: j,
343
- id: d,
519
+ ref: L,
520
+ id: g,
344
521
  value: n,
345
- rows: 3,
346
- onChange: (e) => r(e.target.value),
347
- placeholder: M ? "留下一条消息,不启动任务…" : O === "" ? "描述目标、交付物或需要团队解决的问题…" : "向选中的成员提问或分派工作…",
348
- disabled: a || N,
522
+ rows: 2,
523
+ onChange: (e) => {
524
+ r(e.target.value), oe(0);
525
+ },
526
+ placeholder: M ? "留下一条消息,不启动任务…" : I === "" ? "描述目标、交付物或需要团队解决的问题…" : "向选中的成员提问或分派工作…",
527
+ disabled: a || R,
349
528
  onKeyDown: (e) => {
350
- e.key === "Enter" && !e.shiftKey && !e.nativeEvent.isComposing && (e.preventDefault(), te());
529
+ if (W.length && !e.nativeEvent.isComposing && [
530
+ "ArrowDown",
531
+ "ArrowUp",
532
+ "Enter"
533
+ ].includes(e.key)) {
534
+ e.preventDefault(), e.key === "Enter" ? K(W[ae % W.length]) : oe((t) => (t + (e.key === "ArrowDown" ? 1 : -1) + W.length) % W.length);
535
+ return;
536
+ }
537
+ e.key === "Enter" && !e.shiftKey && !e.nativeEvent.isComposing && (e.preventDefault(), G());
351
538
  }
352
539
  }),
353
540
  /* @__PURE__ */ S("div", {
@@ -355,69 +542,140 @@ function N({ members: e, activeRun: t, value: n, onChange: r, onSend: i, disable
355
542
  children: [/* @__PURE__ */ S("div", { children: [
356
543
  /* @__PURE__ */ x("label", {
357
544
  className: "team-sr-only",
358
- htmlFor: f,
545
+ htmlFor: y,
359
546
  children: "接收成员"
360
547
  }),
361
548
  /* @__PURE__ */ S("select", {
362
- id: f,
363
- value: O,
364
- onChange: (e) => A(e.target.value),
365
- disabled: a || N,
549
+ id: y,
550
+ value: I,
551
+ onChange: (e) => ie(e.target.value),
552
+ disabled: a || R,
366
553
  children: [/* @__PURE__ */ x("option", {
367
554
  value: "",
368
555
  children: "发给 Leader"
369
556
  }), e.filter((e) => e.status === "active").map((e) => /* @__PURE__ */ S("option", {
370
557
  value: e.memberId,
371
- disabled: !F && !M,
372
558
  children: ["@", e.name]
373
559
  }, e.memberId))]
374
560
  }),
375
- /* @__PURE__ */ S("label", {
376
- className: "team-note-toggle",
377
- children: [/* @__PURE__ */ x("input", {
378
- type: "checkbox",
379
- checked: M,
380
- onChange: (e) => ee(e.target.checked),
381
- disabled: a || N
382
- }), "仅留言"]
561
+ /* @__PURE__ */ S("details", {
562
+ className: "team-composer-more",
563
+ children: [/* @__PURE__ */ x("summary", {
564
+ "aria-label": "更多消息选项",
565
+ children: "···"
566
+ }), /* @__PURE__ */ S("div", {
567
+ className: "team-composer-menu",
568
+ children: [/* @__PURE__ */ S("label", {
569
+ className: "team-note-toggle",
570
+ children: [/* @__PURE__ */ x("input", {
571
+ type: "checkbox",
572
+ checked: M,
573
+ onChange: (e) => te(e.target.checked),
574
+ disabled: a || R
575
+ }), "仅留言,不启动执行"]
576
+ }), !t && /* @__PURE__ */ S("details", {
577
+ className: "team-workspace-options",
578
+ children: [
579
+ /* @__PURE__ */ S("summary", { children: ["工作目录", O.sourcePath ? " · 已选择" : " · 可选"] }),
580
+ /* @__PURE__ */ S("label", {
581
+ className: "team-field",
582
+ children: ["工作目录", /* @__PURE__ */ x("input", {
583
+ value: O.sourcePath,
584
+ maxLength: 4096,
585
+ onChange: (e) => A({ sourcePath: e.target.value }),
586
+ placeholder: "执行节点上的目录路径",
587
+ disabled: R
588
+ })]
589
+ }),
590
+ /* @__PURE__ */ S("label", {
591
+ className: "team-field",
592
+ children: ["目录类型", /* @__PURE__ */ S("select", {
593
+ value: O.mode,
594
+ onChange: (e) => A({ mode: e.target.value }),
595
+ children: [/* @__PURE__ */ x("option", {
596
+ value: "auto",
597
+ children: f ? "Git 仓库" : "自动识别 Git"
598
+ }), /* @__PURE__ */ x("option", {
599
+ value: "directory",
600
+ children: "普通目录,仅复制输入文件"
601
+ })]
602
+ })]
603
+ }),
604
+ O.mode === "auto" && /* @__PURE__ */ S("label", {
605
+ className: "team-field",
606
+ children: ["Git 基线", /* @__PURE__ */ x("input", {
607
+ value: O.baseRef,
608
+ maxLength: 256,
609
+ onChange: (e) => A({ baseRef: e.target.value }),
610
+ placeholder: f ? "完整 commit(40 或 64 位)" : "HEAD",
611
+ disabled: R
612
+ })]
613
+ }),
614
+ /* @__PURE__ */ S("label", {
615
+ className: "team-field",
616
+ children: ["输入文件", /* @__PURE__ */ x("textarea", {
617
+ rows: 2,
618
+ value: O.inputs,
619
+ onChange: (e) => A({ inputs: e.target.value }),
620
+ placeholder: "每行一个相对路径(非 Git 目录)",
621
+ disabled: R
622
+ })]
623
+ }),
624
+ /* @__PURE__ */ S("p", { children: ["路径须在执行节点可访问。Git 使用提交版本,不带入未提交修改;普通目录只复制列出的输入文件。", f && "云端协作需填写固定 commit,并确保节点可访问相同版本。"] })
625
+ ]
626
+ })]
627
+ })]
383
628
  }),
384
- !!u.length && /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x("label", {
629
+ !!P.length && /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x("label", {
385
630
  className: "team-sr-only",
386
- htmlFor: g,
631
+ htmlFor: C,
387
632
  children: "引用本群交付物"
388
633
  }), /* @__PURE__ */ S("select", {
389
- id: g,
634
+ id: C,
390
635
  value: "",
391
- disabled: a || N || w.length >= 8,
636
+ disabled: a || R || F.length >= 8,
392
637
  onChange: (e) => {
393
638
  let t = e.target.value;
394
- t && C((e) => e.includes(t) ? e : [...e, t]);
639
+ t && N((e) => e.includes(t) ? e : [...e, t]);
395
640
  },
396
- children: [/* @__PURE__ */ x("option", {
397
- value: "",
398
- children: "引用交付物"
399
- }), u.filter((e) => !y.includes(e.artifactId)).map((e) => /* @__PURE__ */ x("option", {
400
- value: e.artifactId,
401
- children: e.name
402
- }, e.artifactId))]
641
+ children: [
642
+ /* @__PURE__ */ x("option", {
643
+ value: "",
644
+ children: "引用交付物"
645
+ }),
646
+ /* @__PURE__ */ x("optgroup", {
647
+ label: "当前任务",
648
+ children: u.filter((e) => !j.includes(e.artifactId)).map((e) => /* @__PURE__ */ x("option", {
649
+ value: e.artifactId,
650
+ children: e.name
651
+ }, e.artifactId))
652
+ }),
653
+ /* @__PURE__ */ x("optgroup", {
654
+ label: "其他任务(显式引用)",
655
+ children: d.filter((e) => !u.some((t) => t.artifactId === e.artifactId) && !j.includes(e.artifactId)).map((e) => /* @__PURE__ */ x("option", {
656
+ value: e.artifactId,
657
+ children: e.name
658
+ }, e.artifactId))
659
+ })
660
+ ]
403
661
  })] })
404
662
  ] }), /* @__PURE__ */ x("button", {
405
663
  className: "team-button team-primary",
406
664
  type: "submit",
407
- disabled: a || N || I || !n.trim() && !w.length,
408
- children: N ? "正在发送" : "发送"
665
+ disabled: a || R || B || !n.trim() && !F.length,
666
+ children: R ? "正在发送" : "发送"
409
667
  })]
410
668
  })
411
669
  ]
412
670
  }),
413
671
  /* @__PURE__ */ x("p", {
414
672
  className: "team-composer-help",
415
- children: I ? "本轮已结束,请切换到 Leader 发起新目标,或选择仅留言。" : /* @__PURE__ */ S(b, { children: ["Enter 发送 · Shift + Enter 换行", M ? " · 留言不会唤醒成员" : ""] })
673
+ children: B ? t?.status === "cancel_requested" ? "正在停止任务 · 等待执行端确认" : "任务已结束 · 新建任务以继续协作" : /* @__PURE__ */ S(b, { children: ["Enter 发送 · Shift + Enter 换行", M ? " · 留言不会唤醒成员" : ""] })
416
674
  })
417
675
  ]
418
676
  });
419
677
  }
420
- function P({ tasks: e, members: t, selectedTaskId: n, onSelect: r }) {
678
+ function F({ tasks: e, members: t, selectedTaskId: n, onSelect: r }) {
421
679
  return e.length ? /* @__PURE__ */ x("div", {
422
680
  className: "team-task-board",
423
681
  children: [
@@ -446,7 +704,7 @@ function P({ tasks: e, members: t, selectedTaskId: n, onSelect: r }) {
446
704
  children: [/* @__PURE__ */ x("h3", { children: "尚未分派任务" }), /* @__PURE__ */ x("p", { children: "Leader 建立任务后,负责人、依赖与验收进度会出现在这里。" })]
447
705
  });
448
706
  }
449
- function F({ artifact: e, onOpen: t }) {
707
+ function ne({ artifact: e, onOpen: t }) {
450
708
  let n = a(e.uri);
451
709
  return /* @__PURE__ */ S("div", {
452
710
  className: "team-artifact",
@@ -463,13 +721,17 @@ function F({ artifact: e, onOpen: t }) {
463
721
  }) : /* @__PURE__ */ x("span", { children: e.name }), /* @__PURE__ */ S("small", { children: [e.mediaType, e.digest ? ` · ${e.digest.slice(0, 12)}` : ""] })]
464
722
  });
465
723
  }
466
- function I({ task: e, members: n, onAction: r, onOpenArtifact: i, onMemberSelect: a }) {
467
- let [o, c] = v(""), [l, d] = v(!1), [f, p] = v(""), m = e.attempts.find((e) => e.attemptId === o) ?? e.attempts.at(-1), h = n.find((t) => t.memberId === e.ownerMemberId);
468
- async function g(t) {
724
+ function re({ task: e, members: n, onAction: r, onOpenArtifact: i, onMemberSelect: a }) {
725
+ let [o, c] = v(""), [l, d] = v(!1), [f, p] = v(""), [m, h] = v(!1), [g, _] = v(""), y = e.attempts.find((e) => e.attemptId === o) ?? e.attempts.at(-1), C = n.find((t) => t.memberId === e.ownerMemberId);
726
+ async function w(t) {
469
727
  if (!(!r || l)) {
728
+ if (t === "reject" && !g.trim()) {
729
+ p("请填写需要修改的内容。");
730
+ return;
731
+ }
470
732
  d(!0), p("");
471
733
  try {
472
- await r(e, t);
734
+ await r(e, t, t === "reject" ? g.trim() : void 0), h(!1);
473
735
  } catch (e) {
474
736
  p(e instanceof Error ? e.message : "操作失败。");
475
737
  } finally {
@@ -482,14 +744,14 @@ function I({ task: e, members: n, onAction: r, onOpenArtifact: i, onMemberSelect
482
744
  children: [
483
745
  /* @__PURE__ */ x(A, { status: e.status }),
484
746
  /* @__PURE__ */ x("h3", { children: e.title }),
485
- h && /* @__PURE__ */ S("button", {
747
+ C && /* @__PURE__ */ S("button", {
486
748
  className: "team-member-link",
487
749
  type: "button",
488
- onClick: () => a?.(h),
750
+ onClick: () => a?.(C),
489
751
  disabled: !a,
490
752
  children: [
491
- /* @__PURE__ */ x(k, { name: h.name }),
492
- h.name,
753
+ /* @__PURE__ */ x(k, { name: C.name }),
754
+ C.name,
493
755
  /* @__PURE__ */ x("span", { children: "查看执行" })
494
756
  ]
495
757
  }),
@@ -503,7 +765,7 @@ function I({ task: e, members: n, onAction: r, onOpenArtifact: i, onMemberSelect
503
765
  e.attempts.length > 1 && /* @__PURE__ */ S("label", {
504
766
  className: "team-field",
505
767
  children: ["执行记录", /* @__PURE__ */ x("select", {
506
- value: m?.attemptId,
768
+ value: y?.attemptId,
507
769
  onChange: (e) => c(e.target.value),
508
770
  children: e.attempts.map((e) => /* @__PURE__ */ S("option", {
509
771
  value: e.attemptId,
@@ -516,30 +778,49 @@ function I({ task: e, members: n, onAction: r, onOpenArtifact: i, onMemberSelect
516
778
  }, e.attemptId))
517
779
  })]
518
780
  }),
519
- m?.result && /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x("h4", { children: "交付结果" }), /* @__PURE__ */ x(t, { content: m.result })] }),
520
- m?.artifacts.map((e) => /* @__PURE__ */ x(F, {
781
+ y?.result && /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x("h4", { children: "交付结果" }), /* @__PURE__ */ x(t, { content: y.result })] }),
782
+ y?.artifacts.map((e) => /* @__PURE__ */ x(ne, {
521
783
  artifact: e,
522
784
  onOpen: i
523
785
  }, e.artifactId)),
786
+ m && /* @__PURE__ */ S("label", {
787
+ className: "team-field",
788
+ children: [
789
+ "修改意见",
790
+ /* @__PURE__ */ x("textarea", {
791
+ rows: 3,
792
+ maxLength: 2e3,
793
+ value: g,
794
+ onChange: (e) => _(e.target.value)
795
+ }),
796
+ /* @__PURE__ */ x("button", {
797
+ className: "team-button",
798
+ type: "button",
799
+ disabled: l || !g.trim(),
800
+ onClick: () => void w("reject"),
801
+ children: "提交修改意见"
802
+ })
803
+ ]
804
+ }),
524
805
  r && /* @__PURE__ */ S("div", {
525
806
  className: "team-task-actions",
526
807
  children: [e.status === "awaiting_acceptance" && /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x("button", {
527
808
  className: "team-button team-primary",
528
809
  type: "button",
529
810
  disabled: l,
530
- onClick: () => void g("accept"),
811
+ onClick: () => void w("accept"),
531
812
  children: "验收通过"
532
813
  }), /* @__PURE__ */ x("button", {
533
814
  className: "team-button",
534
815
  type: "button",
535
816
  disabled: l,
536
- onClick: () => void g("reject"),
537
- children: "退回修改"
817
+ onClick: () => h(!0),
818
+ children: "提出修改"
538
819
  })] }), ["failed", "cancelled"].includes(e.status) && /* @__PURE__ */ x("button", {
539
820
  className: "team-button",
540
821
  type: "button",
541
822
  disabled: l,
542
- onClick: () => void g("retry"),
823
+ onClick: () => void w("retry"),
543
824
  children: "重新执行"
544
825
  })]
545
826
  }),
@@ -551,7 +832,7 @@ function I({ task: e, members: n, onAction: r, onOpenArtifact: i, onMemberSelect
551
832
  ]
552
833
  });
553
834
  }
554
- function L({ interaction: t, member: n, onRespond: r }) {
835
+ function I({ interaction: t, member: n, onRespond: r }) {
555
836
  let [i, a] = v({}), [o, s] = v(!1), [c, l] = v(!1), [u, d] = v(""), f = _(null);
556
837
  async function p(e, n) {
557
838
  if (o || c) return;
@@ -562,7 +843,7 @@ function L({ interaction: t, member: n, onRespond: r }) {
562
843
  ]);
563
844
  f.current?.digest !== i && (f.current = {
564
845
  digest: i,
565
- idempotencyKey: T()
846
+ idempotencyKey: ee()
566
847
  }), s(!0), d("");
567
848
  try {
568
849
  let i = await r({
@@ -623,18 +904,18 @@ function L({ interaction: t, member: n, onRespond: r }) {
623
904
  ]
624
905
  });
625
906
  }
626
- function R({ interactions: e, members: t, onRespond: n }) {
907
+ function ie({ interactions: e, members: t, onRespond: n }) {
627
908
  return /* @__PURE__ */ x("section", {
628
909
  className: "team-interactions",
629
910
  "aria-label": "团队审批与待处理输入",
630
- children: e.filter((e) => ["pending", "resolving"].includes(e.status)).map((e) => /* @__PURE__ */ x(L, {
911
+ children: e.filter((e) => ["pending", "resolving"].includes(e.status)).map((e) => /* @__PURE__ */ x(I, {
631
912
  interaction: e,
632
913
  member: t.find((t) => t.memberId === e.ref.memberId),
633
914
  onRespond: n
634
915
  }, i(e.ref)))
635
916
  });
636
917
  }
637
- function z({ members: e, selectedMemberId: t, onSelect: n }) {
918
+ function L({ members: e, selectedMemberId: t, onSelect: n }) {
638
919
  return /* @__PURE__ */ x("div", {
639
920
  className: "team-member-list",
640
921
  children: e.filter((e) => e.status !== "removed").map((e) => /* @__PURE__ */ S("button", {
@@ -644,7 +925,7 @@ function z({ members: e, selectedMemberId: t, onSelect: n }) {
644
925
  "aria-pressed": t === e.memberId,
645
926
  children: [
646
927
  /* @__PURE__ */ x(k, { name: e.name }),
647
- /* @__PURE__ */ S("span", { children: [/* @__PURE__ */ S("strong", { children: [e.name, /* @__PURE__ */ x("small", { children: e.role === "leader" ? "Leader" : "成员" })] }), /* @__PURE__ */ S("span", { children: [D[e.executionStatus], e.binding.kind === "a2a" ? " · 云端" : " · 本机"] })] }),
928
+ /* @__PURE__ */ S("span", { children: [/* @__PURE__ */ S("strong", { children: [e.name, /* @__PURE__ */ x("small", { children: e.role === "leader" ? "Leader" : "成员" })] }), /* @__PURE__ */ S("span", { children: [D[e.executionStatus], e.binding.kind === "local_build" ? " · 本地" : " · 云端"] })] }),
648
929
  /* @__PURE__ */ x("span", {
649
930
  "aria-hidden": "true",
650
931
  children: "→"
@@ -653,7 +934,7 @@ function z({ members: e, selectedMemberId: t, onSelect: n }) {
653
934
  }, e.memberId))
654
935
  });
655
936
  }
656
- function B({ member: e, observation: n, onDirectedMessage: r, onRetry: i, onCancel: a, cancelPending: o = !1, cancelBusy: s = !1 }) {
937
+ function ae({ member: e, observation: n, onDirectedMessage: r, onRetry: i, onCancel: a, cancelPending: o = !1, cancelBusy: s = !1 }) {
657
938
  return /* @__PURE__ */ S("section", {
658
939
  className: "team-member-inspector",
659
940
  children: [
@@ -668,6 +949,10 @@ function B({ member: e, observation: n, onDirectedMessage: r, onRetry: i, onCanc
668
949
  ]
669
950
  })] })]
670
951
  }),
952
+ e.responsibility && /* @__PURE__ */ x("p", {
953
+ className: "team-member-responsibility",
954
+ children: e.responsibility
955
+ }),
671
956
  /* @__PURE__ */ S("div", {
672
957
  className: "team-member-actions",
673
958
  children: [r && /* @__PURE__ */ x("button", {
@@ -731,8 +1016,8 @@ function B({ member: e, observation: n, onDirectedMessage: r, onRetry: i, onCanc
731
1016
  ]
732
1017
  });
733
1018
  }
734
- function V(e) {
735
- return e.snapshot ? /* @__PURE__ */ x(H, {
1019
+ function oe(e) {
1020
+ return e.snapshot ? /* @__PURE__ */ x(se, {
736
1021
  ...e,
737
1022
  snapshot: e.snapshot
738
1023
  }, `${e.snapshot.group.authorityRef}:${e.snapshot.group.groupId}`) : /* @__PURE__ */ x("section", {
@@ -761,100 +1046,258 @@ function V(e) {
761
1046
  })
762
1047
  });
763
1048
  }
764
- function H({ snapshot: e, connection: t = "connected", draft: n, onDraftChange: r, initialSelection: i, onSelectionChange: a, onSend: s, onRetry: f, error: m, onManage: h, onControl: g, onAcceptRun: y, onTaskAction: C, onRespondInteraction: w, onOpenArtifact: T, onMemberSelect: E, renderMember: D, onLoadExecution: O }) {
765
- let [k, F] = v(""), [L, V] = v(""), [H, ne] = v(0), [U, W] = v(null), [re, G] = v(!1), [ie, ae] = v(i?.taskId ?? ""), [oe, se] = v(i?.teamRunId ?? ""), [ce, K] = v(""), [le, ue] = v(), [q, J] = v(!1), [de, Y] = v(""), fe = _(null), pe = _(null), X = e.teamRuns.find((e) => e.teamRunId === oe) ?? o(e), Z = e.tasks.filter((e) => e.teamRunId === X?.teamRunId), me = Z.find((e) => e.taskId === ie), Q = e.members.find((e) => e.memberId === ce), he = e.interactions.filter((e) => e.status === "pending").length + Z.filter((e) => l(e) === "attention").length, ge = n ?? k;
766
- function _e(e) {
767
- F(e), r?.(e);
1049
+ function se({ snapshot: e, connection: n = "connected", draft: r, onDraftChange: i, initialDrafts: a, initialSelection: s, onSelectionChange: u, onSend: f, onRetry: m, error: h, onManage: g, serverAuthority: y, standbyCandidates: C, onConfigureStandby: T, onLoadReconciliation: ee, onReconcile: E, onControl: D, onAcceptRun: O, onTaskAction: k, onRespondInteraction: I, onOpenArtifact: oe, onMemberSelect: se, renderMember: z, onLoadExecution: B }) {
1050
+ let [le, V] = v(a?.[s?.teamRunId || o(e)?.teamRunId || ""] || ""), [H, U] = v(""), [ue, W] = v(0), [G, K] = v(null), [de, q] = v(!1), [fe, pe] = v(s?.taskId ?? ""), [J, me] = v(s?.teamRunId || o(e)?.teamRunId || ""), [he, ge] = v(!1), [_e, ve] = v(""), [ye, be] = v(), [Y, xe] = v(!1), [Se, Ce] = v(""), [we, Te] = v(!1), [Ee, De] = v(""), Oe = _(null), ke = _(null), Ae = _(new Map(Object.entries(a || {}).map(([e, t]) => [e, {
1051
+ text: t,
1052
+ recipient: ""
1053
+ }]))), X = e.teamRuns.find((e) => e.teamRunId === J) ?? null, je = !!(J && !X), Z = e.tasks.filter((e) => e.teamRunId === X?.teamRunId);
1054
+ p(() => {
1055
+ X && ge(!1);
1056
+ }, [X]);
1057
+ let Me = X ? e.runMembers?.filter((e) => e.teamRunId === X.teamRunId) : void 0, Q = X && e.runMembers ? Me || [] : e.members.filter((e) => e.status !== "removed"), Ne = Z.find((e) => e.taskId === fe), Pe = Q.find((e) => e.memberId === _e), Fe = [...e.deliveries.filter((e) => e.teamRunId === X?.teamRunId).map((e) => e.runId), ...Z.flatMap((e) => e.attempts.map((e) => e.source?.runId))].filter(Boolean), Ie = !e.runMembers && e.teamRuns.length === 1, Le = (e) => !!(X && (Fe.includes(e.runId) || Me?.some((t) => t.sessionId === e.sessionId) || Ie && Q.some((t) => t.sessionId === e.sessionId))), Re = e.interactions.filter((e) => Le(e.ref)), ze = [...new Map([...(e.artifacts || []).filter((e) => Le(e.source)), ...Z.flatMap((e) => e.attempts.flatMap((e) => e.artifacts))].filter((t) => t.source.groupId === e.group.groupId && t.source.authorityRef === e.group.authorityRef).map((e) => [e.artifactId, e])).values()], Be = Re.filter((e) => e.status === "pending").length + ((X?.policy || e.group.policy)?.taskAcceptance === "leader" ? 0 : Z.filter((e) => l(e) === "attention").length), Ve = r ?? le;
1058
+ function He(e) {
1059
+ V(e), i?.(e, J), Ae.current.set(J, {
1060
+ text: e,
1061
+ recipient: H
1062
+ });
768
1063
  }
769
- function $(e) {
770
- ae(e), a?.({
1064
+ function Ue(e) {
1065
+ Ae.current.set(J, {
1066
+ text: Ve,
1067
+ recipient: H
1068
+ });
1069
+ let t = Ae.current.get(e);
1070
+ me(e), ge(!1), pe(""), ve(""), be(void 0), U(t?.recipient || ""), V(t?.text || ""), i?.(t?.text || "", e), Ce(""), Te(!1), De(""), q(!1), u?.({
1071
+ teamRunId: e,
1072
+ taskId: ""
1073
+ });
1074
+ }
1075
+ function We(e) {
1076
+ pe(e), u?.({
771
1077
  teamRunId: X?.teamRunId ?? "",
772
1078
  taskId: e
773
1079
  });
774
1080
  }
775
- function ve(e) {
776
- pe.current = document.activeElement, W(e), K("");
1081
+ function $(e) {
1082
+ ke.current = document.activeElement, K(e), ve("");
777
1083
  }
778
- function ye() {
779
- W(null), G(!1), pe.current?.focus();
1084
+ function Ge() {
1085
+ K(null), q(!1), ke.current?.focus();
780
1086
  }
781
- function be(e) {
782
- V(e.memberId), W(null), G(!1), ne((e) => e + 1);
1087
+ function Ke(e) {
1088
+ U(e.memberId), K(null), q(!1), W((e) => e + 1);
783
1089
  }
784
- function xe(e) {
785
- ue(void 0), K(e.memberId), W("members"), E?.(e);
1090
+ function qe(e) {
1091
+ be(void 0), ve(e.memberId), K("members"), se?.(e);
786
1092
  }
787
1093
  p(() => {
788
- U && fe.current?.focus();
789
- }, [U]);
790
- async function Se(e) {
791
- if (!(!X || !g || q)) {
792
- J(!0), Y("");
1094
+ G && Oe.current?.focus();
1095
+ }, [G]);
1096
+ async function Je(e) {
1097
+ if (!(!X || !D || Y)) {
1098
+ xe(!0), Ce("");
793
1099
  try {
794
- await g(X, e);
1100
+ await D(X, e);
795
1101
  } catch (e) {
796
- Y(e instanceof Error ? e.message : "操作失败。");
1102
+ Ce(e instanceof Error ? e.message : "操作失败。");
797
1103
  } finally {
798
- J(!1);
1104
+ xe(!1);
799
1105
  }
800
1106
  }
801
1107
  }
802
- async function Ce(e) {
803
- if (!(!X || !y || q)) {
804
- J(!0), Y("");
1108
+ async function Ye(e) {
1109
+ if (!(!X || !O || Y)) {
1110
+ if (!e && !Ee.trim()) {
1111
+ Ce("请说明需要修改的内容。");
1112
+ return;
1113
+ }
1114
+ xe(!0), Ce("");
805
1115
  try {
806
- await y(X, e);
1116
+ await O(X, e, e ? void 0 : Ee.trim()), Te(!1), De("");
807
1117
  } catch (e) {
808
- Y(e instanceof Error ? e.message : "验收提交失败。");
1118
+ Ce(e instanceof Error ? e.message : "验收提交失败。");
809
1119
  } finally {
810
- J(!1);
1120
+ xe(!1);
811
1121
  }
812
1122
  }
813
1123
  }
1124
+ async function Xe(e) {
1125
+ let t = await f(e);
1126
+ return t?.teamRunId && !e.teamRunId && ["accepted", "duplicate"].includes(t.status) && (Ae.current.set("", {
1127
+ text: "",
1128
+ recipient: ""
1129
+ }), me(t.teamRunId), ge(!0), V(""), i?.("", ""), U(""), u?.({
1130
+ teamRunId: t.teamRunId,
1131
+ taskId: ""
1132
+ })), t;
1133
+ }
1134
+ let Ze = X?.status === "awaiting_acceptance" && O && /* @__PURE__ */ S("section", {
1135
+ className: "team-final-delivery",
1136
+ "aria-label": "最终验收",
1137
+ children: [
1138
+ /* @__PURE__ */ x("span", {
1139
+ className: "team-eyebrow",
1140
+ children: "团队已提交成果"
1141
+ }),
1142
+ /* @__PURE__ */ x("h3", { children: "请确认这次交付" }),
1143
+ X.result && /* @__PURE__ */ x("div", {
1144
+ className: "team-final-summary",
1145
+ children: /* @__PURE__ */ x(t, { content: X.result })
1146
+ }),
1147
+ /* @__PURE__ */ x("p", { children: "验收通过后完成任务;提出修改会交给 Leader 继续推进。" }),
1148
+ we && /* @__PURE__ */ S("label", {
1149
+ className: "team-field",
1150
+ children: ["修改意见", /* @__PURE__ */ x("textarea", {
1151
+ value: Ee,
1152
+ onChange: (e) => De(e.target.value),
1153
+ placeholder: "哪些内容需要调整?期望是什么?",
1154
+ rows: 3,
1155
+ maxLength: 2e3,
1156
+ disabled: Y
1157
+ })]
1158
+ }),
1159
+ /* @__PURE__ */ x("div", {
1160
+ className: "team-task-actions",
1161
+ children: we ? /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x("button", {
1162
+ className: "team-button",
1163
+ type: "button",
1164
+ disabled: Y,
1165
+ onClick: () => Te(!1),
1166
+ children: "取消修改"
1167
+ }), /* @__PURE__ */ x("button", {
1168
+ className: "team-button team-primary",
1169
+ type: "button",
1170
+ disabled: Y || !Ee.trim(),
1171
+ onClick: () => void Ye(!1),
1172
+ children: "提交修改意见"
1173
+ })] }) : /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x("button", {
1174
+ className: "team-button",
1175
+ type: "button",
1176
+ disabled: Y,
1177
+ onClick: () => Te(!0),
1178
+ children: "提出修改"
1179
+ }), /* @__PURE__ */ x("button", {
1180
+ className: "team-button team-primary",
1181
+ type: "button",
1182
+ disabled: Y,
1183
+ onClick: () => void Ye(!0),
1184
+ children: "通过验收"
1185
+ })] })
1186
+ }),
1187
+ Se && /* @__PURE__ */ x("p", {
1188
+ role: "alert",
1189
+ className: "team-inline-error",
1190
+ children: Se
1191
+ })
1192
+ ]
1193
+ });
814
1194
  return /* @__PURE__ */ S("section", {
815
1195
  className: "ksadk-teams team-workspace",
816
- "data-panel": U || "closed",
817
- "data-execution": re ? "open" : "closed",
1196
+ "data-panel": G || "closed",
1197
+ "data-execution": de ? "open" : "closed",
818
1198
  children: [
819
- /* @__PURE__ */ x(j, {
1199
+ /* @__PURE__ */ x(M, {
820
1200
  snapshot: e,
821
- connection: t,
822
- onProgress: () => ve("tasks"),
823
- onMembers: () => ve("members"),
824
- onManage: h
1201
+ connection: n,
1202
+ onProgress: () => $("tasks"),
1203
+ onMembers: () => $("members"),
1204
+ onManage: g
825
1205
  }),
826
- m && /* @__PURE__ */ S("div", {
1206
+ h && /* @__PURE__ */ S("div", {
827
1207
  className: "team-top-error",
828
1208
  role: "alert",
829
- children: [m, f && /* @__PURE__ */ x("button", {
1209
+ children: [h, m && /* @__PURE__ */ x("button", {
830
1210
  className: "team-text-button",
831
1211
  type: "button",
832
- onClick: f,
1212
+ onClick: m,
833
1213
  children: "重新连接"
834
1214
  })]
835
1215
  }),
836
1216
  /* @__PURE__ */ S("div", {
837
1217
  className: "team-body",
838
1218
  children: [
1219
+ /* @__PURE__ */ S("nav", {
1220
+ className: "team-run-directory",
1221
+ "aria-label": "团队任务",
1222
+ children: [/* @__PURE__ */ S("header", { children: [/* @__PURE__ */ x("h2", { children: "任务" }), /* @__PURE__ */ x("button", {
1223
+ type: "button",
1224
+ className: "team-text-button",
1225
+ onClick: () => {
1226
+ Ue(""), W((e) => e + 1);
1227
+ },
1228
+ children: "+ 新任务"
1229
+ })] }), /* @__PURE__ */ S("div", {
1230
+ className: "team-run-list",
1231
+ children: [[...e.teamRuns].reverse().map((e) => /* @__PURE__ */ S("button", {
1232
+ type: "button",
1233
+ className: "team-run-item",
1234
+ "aria-current": e.teamRunId === J ? "page" : void 0,
1235
+ onClick: () => Ue(e.teamRunId),
1236
+ children: [/* @__PURE__ */ x("strong", { children: e.goal }), /* @__PURE__ */ x(A, { status: e.status })]
1237
+ }, e.teamRunId)), !e.teamRuns.length && /* @__PURE__ */ x("p", {
1238
+ className: "team-muted",
1239
+ children: "每个目标是一个独立任务。"
1240
+ })]
1241
+ })]
1242
+ }),
839
1243
  /* @__PURE__ */ S("div", {
840
1244
  className: "team-chat-pane",
841
- "aria-hidden": re || void 0,
1245
+ "aria-hidden": de || void 0,
842
1246
  children: [
843
- /* @__PURE__ */ x(M, {
844
- messages: e.messages,
845
- children: X && /* @__PURE__ */ x(ee, {
1247
+ /* @__PURE__ */ S("header", {
1248
+ className: "team-task-heading",
1249
+ children: [/* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("span", {
1250
+ className: "team-eyebrow",
1251
+ children: X ? "当前任务" : "新的目标"
1252
+ }), /* @__PURE__ */ x("h2", { children: X?.goal || (je ? he ? "正在同步任务…" : "未找到所选任务" : "希望团队完成什么?") })] }), /* @__PURE__ */ x("button", {
1253
+ type: "button",
1254
+ className: "team-button",
1255
+ "aria-label": "查看任务详情",
1256
+ onClick: () => $("tasks"),
1257
+ children: "详情"
1258
+ })]
1259
+ }),
1260
+ /* @__PURE__ */ S("label", {
1261
+ className: "team-mobile-task-picker team-field",
1262
+ children: ["切换任务", /* @__PURE__ */ S("select", {
1263
+ value: J,
1264
+ onChange: (e) => Ue(e.target.value),
1265
+ children: [/* @__PURE__ */ x("option", {
1266
+ value: "",
1267
+ children: "+ 新任务"
1268
+ }), e.teamRuns.map((e) => /* @__PURE__ */ x("option", {
1269
+ value: e.teamRunId,
1270
+ children: e.goal
1271
+ }, e.teamRunId))]
1272
+ })]
1273
+ }),
1274
+ /* @__PURE__ */ S(N, {
1275
+ emptyState: je ? /* @__PURE__ */ S("div", {
1276
+ className: "team-empty",
1277
+ role: "status",
1278
+ children: [/* @__PURE__ */ x("p", { children: he ? "正在读取刚创建的任务,消息已提交。" : "请从任务列表重新选择;当前输入不会发送到其他任务。" }), m && /* @__PURE__ */ x("button", {
1279
+ className: "team-button",
1280
+ type: "button",
1281
+ onClick: m,
1282
+ children: "重新读取"
1283
+ })]
1284
+ }) : void 0,
1285
+ focusFinalDelivery: Ze ? X?.teamRunId : void 0,
1286
+ messages: e.messages.filter((e) => X ? e.teamRunId === X.teamRunId || Ie && !e.teamRunId : !1),
1287
+ children: [X && /* @__PURE__ */ x(te, {
1288
+ compact: !0,
846
1289
  run: X,
847
1290
  tasks: Z,
848
- pendingCount: he,
849
- onOpen: () => ve("tasks")
850
- })
851
- }),
852
- he > 0 && /* @__PURE__ */ S("button", {
1291
+ pendingCount: Be,
1292
+ onOpen: () => $("tasks")
1293
+ }), Ze]
1294
+ }, J),
1295
+ Be > 0 && /* @__PURE__ */ S("button", {
853
1296
  type: "button",
854
1297
  className: "team-attention-banner",
855
- onClick: () => ve("tasks"),
1298
+ onClick: () => $("tasks"),
856
1299
  children: [
857
- he,
1300
+ Be,
858
1301
  " 项需要处理 ",
859
1302
  /* @__PURE__ */ S("span", { children: ["查看 ", /* @__PURE__ */ x("span", {
860
1303
  "aria-hidden": "true",
@@ -862,51 +1305,98 @@ function H({ snapshot: e, connection: t = "connected", draft: n, onDraftChange:
862
1305
  })] })
863
1306
  ]
864
1307
  }),
865
- /* @__PURE__ */ x(N, {
866
- artifacts: [...new Map([...e.artifacts || [], ...e.tasks.flatMap((e) => e.attempts.flatMap((e) => e.artifacts))].filter((t) => t.source.groupId === e.group.groupId && t.source.authorityRef === e.group.authorityRef).map((e) => [e.artifactId, e])).values()],
867
- recipientMemberId: L,
868
- onRecipientChange: V,
869
- focusRequest: H,
870
- members: e.members,
871
- activeRun: o(e),
872
- value: ge,
873
- onChange: _e,
874
- onSend: s,
875
- disabled: e.group.status !== "active"
1308
+ /* @__PURE__ */ x(P, {
1309
+ serverAuthority: y,
1310
+ referenceArtifacts: [...new Map([...e.artifacts || [], ...e.tasks.flatMap((e) => e.attempts.flatMap((e) => e.artifacts))].filter((t) => t.source.groupId === e.group.groupId && t.source.authorityRef === e.group.authorityRef).map((e) => [e.artifactId, e])).values()],
1311
+ artifacts: ze,
1312
+ recipientMemberId: H,
1313
+ onRecipientChange: U,
1314
+ focusRequest: ue,
1315
+ members: Q,
1316
+ activeRun: X,
1317
+ value: Ve,
1318
+ onChange: He,
1319
+ onSend: Xe,
1320
+ disabled: e.group.status !== "active" || je
876
1321
  })
877
1322
  ]
878
1323
  }),
879
- U && /* @__PURE__ */ S("aside", {
1324
+ G && /* @__PURE__ */ S("aside", {
880
1325
  className: "team-sidepanel",
881
- ref: fe,
1326
+ ref: Oe,
882
1327
  tabIndex: -1,
883
- "aria-label": U === "tasks" ? "本轮协作" : "团队成员",
1328
+ "aria-label": "任务详情",
884
1329
  onKeyDown: (e) => {
885
- e.key === "Escape" && (e.stopPropagation(), ye());
1330
+ e.key === "Escape" && (e.stopPropagation(), Ge());
886
1331
  },
887
1332
  children: [
888
1333
  /* @__PURE__ */ S("header", {
889
1334
  className: "team-panel-header",
890
- children: [/* @__PURE__ */ x("h2", { children: U === "tasks" ? "本轮协作" : "团队成员" }), /* @__PURE__ */ x("button", {
1335
+ children: [/* @__PURE__ */ x("nav", {
1336
+ className: "team-detail-tabs",
1337
+ "aria-label": "任务详情分类",
1338
+ children: [
1339
+ ["tasks", "进度"],
1340
+ ["members", "成员"],
1341
+ ["artifacts", "交付物"]
1342
+ ].map(([e, t]) => /* @__PURE__ */ x("button", {
1343
+ type: "button",
1344
+ "aria-pressed": G === e,
1345
+ onClick: () => $(e),
1346
+ children: t
1347
+ }, e))
1348
+ }), /* @__PURE__ */ x("button", {
891
1349
  type: "button",
892
1350
  className: "team-button team-icon-button",
893
1351
  "aria-label": "关闭详情",
894
- onClick: ye,
1352
+ onClick: Ge,
895
1353
  children: "×"
896
1354
  })]
897
1355
  }),
898
1356
  /* @__PURE__ */ x("div", {
899
1357
  className: "team-panel-scroll",
900
- children: U === "tasks" ? /* @__PURE__ */ S(b, { children: [
1358
+ children: G === "tasks" ? /* @__PURE__ */ S(b, { children: [
901
1359
  X && /* @__PURE__ */ S("div", {
902
1360
  className: "team-run-overview",
903
1361
  children: [
904
1362
  /* @__PURE__ */ x(A, { status: X.status }),
905
- /* @__PURE__ */ x("h3", { children: X.goal }),
1363
+ /* @__PURE__ */ x(j, { goal: X.goal }),
906
1364
  X.reason && /* @__PURE__ */ x("p", { children: X.reason }),
1365
+ D && c(X.status) && /* @__PURE__ */ S("div", {
1366
+ className: "team-run-actions",
1367
+ children: [/* @__PURE__ */ x("button", {
1368
+ className: "team-text-button",
1369
+ type: "button",
1370
+ disabled: Y || X.status === "cancel_requested",
1371
+ onClick: () => void Je(X.dispatchSuspended ? "resume_dispatch" : "suspend_dispatch"),
1372
+ children: X.dispatchSuspended ? "继续协作" : "暂停派发"
1373
+ }), /* @__PURE__ */ x("button", {
1374
+ className: "team-text-button team-danger",
1375
+ type: "button",
1376
+ disabled: Y || X.status === "cancel_requested",
1377
+ onClick: () => void Je("stop"),
1378
+ children: "停止任务"
1379
+ })]
1380
+ }),
1381
+ Se && !Ze && /* @__PURE__ */ x("p", {
1382
+ role: "alert",
1383
+ className: "team-inline-error",
1384
+ children: Se
1385
+ }),
1386
+ /* @__PURE__ */ x(R, {
1387
+ run: X,
1388
+ enabled: y,
1389
+ candidates: C || [],
1390
+ configure: T
1391
+ }),
1392
+ /* @__PURE__ */ x(w, {
1393
+ run: X,
1394
+ onLoadReconciliation: ee,
1395
+ onReconcile: E
1396
+ }, X.teamRunId),
907
1397
  /* @__PURE__ */ S("details", {
908
1398
  className: "team-run-budget",
909
- children: [/* @__PURE__ */ x("summary", { children: "运行限额" }), /* @__PURE__ */ S("dl", { children: [
1399
+ children: [/* @__PURE__ */ x("summary", { children: "执行限额" }), /* @__PURE__ */ S("dl", { children: [
910
1400
  /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("dt", { children: "累计启动" }), /* @__PURE__ */ S("dd", { children: [
911
1401
  X.budget.startsUsed,
912
1402
  " / ",
@@ -922,122 +1412,66 @@ function H({ snapshot: e, connection: t = "connected", draft: n, onDraftChange:
922
1412
  " / ",
923
1413
  X.budget.maxTokens
924
1414
  ] })] }),
925
- X.budget.maxDurationSeconds && /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("dt", { children: "最长运行时间" }), /* @__PURE__ */ S("dd", { children: [Math.round(X.budget.maxDurationSeconds / 60), " 分钟"] })] })
1415
+ X.budget.maxDurationSeconds && /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("dt", { children: "主动执行时限" }), /* @__PURE__ */ S("dd", { children: [Math.round(X.budget.maxDurationSeconds / 60), " 分钟"] })] })
926
1416
  ] })]
927
- }),
928
- g && c(X.status) && /* @__PURE__ */ S("div", {
929
- className: "team-run-actions",
930
- children: [/* @__PURE__ */ x("button", {
931
- className: "team-text-button",
932
- type: "button",
933
- disabled: q || X.status === "cancel_requested",
934
- onClick: () => void Se(X.dispatchSuspended ? "resume_dispatch" : "suspend_dispatch"),
935
- children: X.dispatchSuspended ? "继续自动协作" : "暂停自动协作"
936
- }), /* @__PURE__ */ x("button", {
937
- className: "team-text-button team-danger",
938
- type: "button",
939
- disabled: q || X.status === "cancel_requested",
940
- onClick: () => void Se("stop"),
941
- children: "停止本轮"
942
- })]
943
- }),
944
- de && /* @__PURE__ */ x("p", {
945
- role: "alert",
946
- className: "team-inline-error",
947
- children: de
948
- })
949
- ]
950
- }),
951
- e.teamRuns.length > 1 && /* @__PURE__ */ S("label", {
952
- className: "team-field",
953
- children: ["协作轮次", /* @__PURE__ */ x("select", {
954
- value: X?.teamRunId,
955
- onChange: (e) => {
956
- se(e.target.value), ae(""), a?.({
957
- teamRunId: e.target.value,
958
- taskId: ""
959
- });
960
- },
961
- children: e.teamRuns.map((e) => /* @__PURE__ */ S("option", {
962
- value: e.teamRunId,
963
- children: [
964
- e.goal,
965
- " · ",
966
- u[e.status]
967
- ]
968
- }, e.teamRunId))
969
- })]
970
- }),
971
- X?.status === "awaiting_acceptance" && y && /* @__PURE__ */ S("section", {
972
- className: "team-interaction-card",
973
- children: [
974
- /* @__PURE__ */ x("span", {
975
- className: "team-eyebrow",
976
- children: "本轮交付 · 最终验收"
977
- }),
978
- /* @__PURE__ */ x("h3", { children: "确认团队交付成果" }),
979
- /* @__PURE__ */ x("p", { children: "请检查任务结果与交付物,通过后结束本轮协作。" }),
980
- /* @__PURE__ */ S("div", {
981
- className: "team-task-actions",
982
- children: [/* @__PURE__ */ x("button", {
983
- className: "team-button",
984
- type: "button",
985
- disabled: q,
986
- onClick: () => void Ce(!1),
987
- children: "退回修改"
988
- }), /* @__PURE__ */ x("button", {
989
- className: "team-button team-primary",
990
- type: "button",
991
- disabled: q,
992
- onClick: () => void Ce(!0),
993
- children: "完成验收"
994
- })]
995
1417
  })
996
1418
  ]
997
1419
  }),
998
- w && /* @__PURE__ */ x(R, {
999
- interactions: e.interactions,
1000
- members: e.members,
1001
- onRespond: w
1420
+ I && /* @__PURE__ */ x(ie, {
1421
+ interactions: Re,
1422
+ members: Q,
1423
+ onRespond: I
1002
1424
  }),
1003
- me ? /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x("button", {
1425
+ Ne ? /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x("button", {
1004
1426
  className: "team-text-button team-back",
1005
1427
  type: "button",
1006
- onClick: () => $(""),
1007
- children: "← 所有任务"
1008
- }), /* @__PURE__ */ x(I, {
1009
- task: me,
1010
- members: e.members,
1011
- onAction: C,
1012
- onOpenArtifact: T,
1013
- onMemberSelect: xe
1014
- }, me.taskId)] }) : /* @__PURE__ */ x(P, {
1428
+ onClick: () => We(""),
1429
+ children: "← 所有分工"
1430
+ }), /* @__PURE__ */ x(re, {
1431
+ task: Ne,
1432
+ members: Q,
1433
+ onAction: (X?.policy || e.group.policy)?.taskAcceptance === "leader" ? void 0 : k,
1434
+ onOpenArtifact: oe,
1435
+ onMemberSelect: qe
1436
+ }, Ne.taskId)] }) : /* @__PURE__ */ x(F, {
1015
1437
  tasks: Z,
1016
- members: e.members,
1017
- selectedTaskId: ie,
1018
- onSelect: (e) => $(e.taskId)
1438
+ members: Q,
1439
+ selectedTaskId: fe,
1440
+ onSelect: (e) => We(e.taskId)
1019
1441
  })
1020
- ] }) : Q ? /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x("button", {
1442
+ ] }) : G === "artifacts" ? /* @__PURE__ */ S("section", {
1443
+ className: "team-artifact-list",
1444
+ children: [/* @__PURE__ */ x("h3", { children: "任务交付物" }), ze.length ? ze.map((e) => /* @__PURE__ */ x(ne, {
1445
+ artifact: e,
1446
+ onOpen: oe
1447
+ }, e.artifactId)) : /* @__PURE__ */ x("p", {
1448
+ className: "team-muted",
1449
+ children: "成员发布的成果会保存在这里。"
1450
+ })]
1451
+ }) : Pe ? /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x("button", {
1021
1452
  className: "team-text-button team-back",
1022
1453
  type: "button",
1023
- onClick: () => K(""),
1454
+ onClick: () => ve(""),
1024
1455
  children: "← 所有成员"
1025
- }), D?.(Q, { directedMessage: () => be(Q) }, le) ?? /* @__PURE__ */ x(B, {
1026
- member: Q,
1027
- onDirectedMessage: () => be(Q)
1028
- })] }) : /* @__PURE__ */ x(z, {
1029
- members: e.members,
1030
- selectedMemberId: ce,
1031
- onSelect: xe
1456
+ }), z?.(Pe, {
1457
+ directedMessage: () => Ke(Pe),
1458
+ teamRunId: X?.teamRunId
1459
+ }, ye) ?? /* @__PURE__ */ x(ae, {
1460
+ member: Pe,
1461
+ onDirectedMessage: () => Ke(Pe)
1462
+ })] }) : /* @__PURE__ */ x(L, {
1463
+ members: Q,
1464
+ selectedMemberId: _e,
1465
+ onSelect: qe
1032
1466
  })
1033
1467
  }),
1034
- U === "tasks" && (Z.length > 0 || !!(O && X)) && /* @__PURE__ */ x("footer", {
1468
+ G === "tasks" && (Z.length > 0 || !!(B && X)) && /* @__PURE__ */ x("footer", {
1035
1469
  className: "team-panel-footer",
1036
1470
  children: /* @__PURE__ */ S("button", {
1037
1471
  className: "team-button team-expand",
1038
1472
  type: "button",
1039
- onClick: () => G(!0),
1040
- children: ["展开执行视图 ", /* @__PURE__ */ x("span", {
1473
+ onClick: () => q(!0),
1474
+ children: ["查看执行详情 ", /* @__PURE__ */ x("span", {
1041
1475
  "aria-hidden": "true",
1042
1476
  children: "↗"
1043
1477
  })]
@@ -1045,18 +1479,18 @@ function H({ snapshot: e, connection: t = "connected", draft: n, onDraftChange:
1045
1479
  })
1046
1480
  ]
1047
1481
  }),
1048
- re && /* @__PURE__ */ S("section", {
1482
+ de && /* @__PURE__ */ S("section", {
1049
1483
  className: "team-execution-workspace",
1050
1484
  "aria-label": "执行工作台",
1051
1485
  children: [/* @__PURE__ */ S("header", {
1052
1486
  className: "team-panel-header",
1053
1487
  children: [/* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("span", {
1054
1488
  className: "team-eyebrow",
1055
- children: "执行工作台"
1489
+ children: "执行详情"
1056
1490
  }), /* @__PURE__ */ x("h2", { children: X?.goal })] }), /* @__PURE__ */ x("button", {
1057
1491
  className: "team-button",
1058
1492
  type: "button",
1059
- onClick: () => G(!1),
1493
+ onClick: () => q(!1),
1060
1494
  children: "返回聊天"
1061
1495
  })]
1062
1496
  }), /* @__PURE__ */ x(d, {
@@ -1066,20 +1500,20 @@ function H({ snapshot: e, connection: t = "connected", draft: n, onDraftChange:
1066
1500
  "aria-label": "正在加载执行视图",
1067
1501
  children: [/* @__PURE__ */ x("span", {}), /* @__PURE__ */ x("span", {})]
1068
1502
  }),
1069
- children: /* @__PURE__ */ x(te, {
1503
+ children: /* @__PURE__ */ x(ce, {
1070
1504
  authorityRef: e.group.authorityRef,
1071
1505
  groupId: e.group.groupId,
1072
1506
  teamRunId: X?.teamRunId || "",
1073
1507
  watermark: e.watermark,
1074
- load: O,
1508
+ load: B,
1075
1509
  tasks: Z,
1076
- members: e.members,
1077
- selectedTaskId: ie,
1510
+ members: Q,
1511
+ selectedTaskId: fe,
1078
1512
  onSelect: (e) => {
1079
- $(e.taskId), G(!1), W("tasks");
1513
+ We(e.taskId), q(!1), K("tasks");
1080
1514
  },
1081
1515
  onSelectNode: (e) => {
1082
- e.kind === "task" && e.taskId ? ($(e.taskId), W("tasks"), G(!1)) : e.source && (K(e.source.memberId), ue(e.source), W("members"), G(!1));
1516
+ e.kind === "task" && e.taskId ? (We(e.taskId), K("tasks"), q(!1)) : e.source && (ve(e.source.memberId), be(e.source), K("members"), q(!1));
1083
1517
  }
1084
1518
  }, `${e.group.groupId}:${X?.teamRunId || ""}`)
1085
1519
  })]
@@ -1089,7 +1523,69 @@ function H({ snapshot: e, connection: t = "connected", draft: n, onDraftChange:
1089
1523
  ]
1090
1524
  });
1091
1525
  }
1092
- function te({ authorityRef: e, groupId: t, teamRunId: n, watermark: r, load: i, ...a }) {
1526
+ function R({ run: e, enabled: t, candidates: n, configure: r }) {
1527
+ let [i, a] = v(e.leaderStandby?.standbyBindingRef || ""), [o, s] = v(!1), [l, u] = v(""), [d, f] = v(e.leaderStandby), m = n.filter((e) => e.kind !== "local_build" && ["ready", "unchecked"].includes(e.availability?.state || "") && e.capabilities.leader && e.capabilities.enqueue);
1528
+ if (p(() => {
1529
+ a(e.leaderStandby?.standbyBindingRef || ""), u(""), f(e.leaderStandby);
1530
+ }, [e.teamRunId, e.leaderStandby]), !t || !r || !m.length && !d) return null;
1531
+ async function h() {
1532
+ if (!(!i || o || !r)) {
1533
+ s(!0), u("");
1534
+ try {
1535
+ f(await r(e, i));
1536
+ } catch (e) {
1537
+ u(e instanceof Error ? e.message : "备用配置失败。");
1538
+ } finally {
1539
+ s(!1);
1540
+ }
1541
+ }
1542
+ }
1543
+ return /* @__PURE__ */ S("details", {
1544
+ className: "team-run-budget team-standby",
1545
+ children: [
1546
+ /* @__PURE__ */ S("summary", { children: ["云端接管设置", d?.state === "active" ? " · 已接管" : d?.state === "blocked" ? " · 等待恢复" : ""] }),
1547
+ d && /* @__PURE__ */ x("p", {
1548
+ role: "status",
1549
+ children: d.state === "active" ? "云端 Leader 已接管当前任务。" : d.state === "armed" ? "兼容的备用节点已配置;接管前会保存进度并核对原执行。" : {
1550
+ standby_offline: "云端备用节点离线,正在等待恢复。",
1551
+ checkpoint_required: "正在等待 Leader 保存可恢复的任务进度。",
1552
+ execution_uncertain: "正在核对原执行结果,避免重复执行。"
1553
+ }[d.reason || ""] || "暂时无法接管,请检查执行状态。"
1554
+ }),
1555
+ c(e.status) && !!m.length && /* @__PURE__ */ S(b, { children: [
1556
+ /* @__PURE__ */ S("label", {
1557
+ className: "team-field",
1558
+ children: ["Leader 备用节点", /* @__PURE__ */ S("select", {
1559
+ value: i,
1560
+ onChange: (e) => a(e.target.value),
1561
+ disabled: o,
1562
+ children: [/* @__PURE__ */ x("option", {
1563
+ value: "",
1564
+ children: "选择云端节点,保存时检查"
1565
+ }), m.map((e) => /* @__PURE__ */ x("option", {
1566
+ value: e.bindingRef,
1567
+ children: e.name || e.agentId
1568
+ }, e.bindingRef))]
1569
+ })]
1570
+ }),
1571
+ /* @__PURE__ */ x("p", { children: "本地 Leader 失联后由备用节点继续。新任务沿用此配置;本地恢复时不抢回当前任务。" }),
1572
+ /* @__PURE__ */ x("button", {
1573
+ type: "button",
1574
+ className: "team-button",
1575
+ disabled: o || !i,
1576
+ onClick: () => void h(),
1577
+ children: o ? "正在校验…" : "配置备用节点"
1578
+ })
1579
+ ] }),
1580
+ l && /* @__PURE__ */ x("p", {
1581
+ role: "alert",
1582
+ className: "team-inline-error",
1583
+ children: l
1584
+ })
1585
+ ]
1586
+ });
1587
+ }
1588
+ function ce({ authorityRef: e, groupId: t, teamRunId: n, watermark: r, load: i, ...a }) {
1093
1589
  let o = _(i), s = !!i;
1094
1590
  p(() => {
1095
1591
  o.current = i;
@@ -1115,7 +1611,7 @@ function te({ authorityRef: e, groupId: t, teamRunId: n, watermark: r, load: i,
1115
1611
  r,
1116
1612
  h,
1117
1613
  s
1118
- ]), /* @__PURE__ */ x(w, {
1614
+ ]), /* @__PURE__ */ x(T, {
1119
1615
  ...a,
1120
1616
  execution: c,
1121
1617
  executionLoading: f,
@@ -1126,162 +1622,333 @@ function te({ authorityRef: e, groupId: t, teamRunId: n, watermark: r, load: i,
1126
1622
  });
1127
1623
  }
1128
1624
  //#endregion
1625
+ //#region src/core/teams/grouping.ts
1626
+ var z = (e) => `${e.binding.kind}:${e.binding.agentId}`, B = (e) => e.binding.capabilities.enqueue && e.binding.availability?.state !== "unavailable";
1627
+ function le(e) {
1628
+ let t = /* @__PURE__ */ new Map();
1629
+ for (let n of e) t.set(z(n), [...t.get(z(n)) || [], n]);
1630
+ return [...t.values()].map((e) => e.sort((e, t) => Number(B(t)) - Number(B(e)) || (t.binding.createdAt || "").localeCompare(e.binding.createdAt || "")));
1631
+ }
1632
+ //#endregion
1129
1633
  //#region src/components/teams/CreateGroupDialog.tsx
1130
- function ne({ open: e, candidates: t, loading: r, onClose: i, onCreate: a }) {
1131
- let o = _(null), s = m(), c = m(), l = m(), [u, d] = v(""), [f, h] = v([]), [g, y] = v(""), [b, C] = v(!1), [w, T] = v(""), E = _(null), D = t.filter((e) => f.includes(e.memberId)), O = D.filter((e) => e.binding.capabilities.leader), k = O.some((e) => e.memberId === g) ? g : O[0]?.memberId ?? "";
1634
+ function V({ open: e, candidates: t, serverAuthority: r, loading: i, error: a, onRefresh: o, onClose: s, onCreate: c }) {
1635
+ let l = _(null), u = m(), [d, f] = v(""), [h, g] = v(""), [y, b] = v([]), [C, w] = v(""), [T, ee] = v(""), [E, D] = v(!1), [O, k] = v(""), A = _(null), j = y.map((e) => {
1636
+ let n = t.find((t) => t.binding.bindingRef === e.binding.bindingRef);
1637
+ return n ? {
1638
+ ...n,
1639
+ memberId: e.memberId,
1640
+ responsibility: e.responsibility
1641
+ } : e;
1642
+ }), M = j.filter((e) => e.binding.capabilities.leader && B(e)), N = M.some((e) => e.memberId === C) ? C : M[0]?.memberId ?? "", te = j.find((e) => e.memberId === N)?.binding.kind === "local_build", P = t.filter((e) => e.binding.kind === "cloud" && e.binding.capabilities.leader && B(e)), F = le(t).filter((e) => e.some((e) => `${e.name} ${e.description || ""} ${e.binding.agentId}`.toLowerCase().includes(h.toLowerCase())));
1132
1643
  p(() => {
1133
- let t = o.current;
1644
+ let t = l.current;
1134
1645
  if (!t) return;
1135
1646
  let n = document.activeElement;
1136
1647
  return e && !t.open && t.showModal(), !e && t.open && t.close(), () => {
1137
1648
  t.open && t.close(), n?.focus();
1138
1649
  };
1139
1650
  }, [e]);
1140
- async function A() {
1141
- if (b) return;
1142
- T("");
1651
+ function ne(e, t) {
1652
+ b((n) => t ? [...n, e] : n.filter((t) => z(t) !== z(e)));
1653
+ }
1654
+ async function re() {
1655
+ if (E || i) return;
1656
+ k("");
1143
1657
  let e = {
1144
- name: u.trim(),
1145
- members: D.map((e) => ({
1658
+ name: d.trim(),
1659
+ members: j.map((e) => ({
1146
1660
  memberId: e.memberId,
1147
1661
  name: e.name,
1148
- bindingRef: e.binding.bindingRef
1662
+ bindingRef: e.binding.bindingRef,
1663
+ ...e.responsibility?.trim() ? { responsibility: e.responsibility.trim() } : {}
1149
1664
  })),
1150
- leaderMemberId: k
1665
+ leaderMemberId: N,
1666
+ ...r && te && T ? { leaderStandbyBindingRef: T } : {}
1151
1667
  };
1152
1668
  try {
1153
- if (n(e), !k) throw Error("所选成员中至少需要一位支持 Leader 的 Agent。");
1669
+ if (n(e), j.length < 2) throw Error("请选择至少 2 位成员,一起组成团队。");
1670
+ if (j.some((e) => !t.some((t) => t.binding.bindingRef === e.binding.bindingRef && B(t)))) throw Error("已选成员中有 Agent 暂不可用,请更换版本或移除后重试。");
1671
+ if (!N) throw Error("所选成员中至少需要一位支持 Leader 的 Agent。");
1154
1672
  } catch (e) {
1155
- T(e instanceof Error ? e.message : "群组配置无效。");
1673
+ k(e instanceof Error ? e.message : "团队配置无效。");
1156
1674
  return;
1157
1675
  }
1158
- let t = JSON.stringify(e);
1159
- E.current?.digest !== t && (E.current = {
1160
- digest: t,
1676
+ let a = JSON.stringify(e);
1677
+ A.current?.digest !== a && (A.current = {
1678
+ digest: a,
1161
1679
  idempotencyKey: `group-${globalThis.crypto.randomUUID()}`
1162
- }), C(!0);
1680
+ }), D(!0);
1163
1681
  try {
1164
- await a({
1682
+ await c({
1165
1683
  ...e,
1166
- idempotencyKey: E.current.idempotencyKey
1167
- }), d(""), h([]), y(""), E.current = null, i();
1684
+ idempotencyKey: A.current.idempotencyKey
1685
+ }), f(""), g(""), b([]), w(""), ee(""), A.current = null, s();
1168
1686
  } catch (e) {
1169
- T(e instanceof Error ? e.message : "创建群组失败。");
1687
+ k(e instanceof Error ? e.message : "创建团队失败,已保留你的选择。");
1170
1688
  } finally {
1171
- C(!1);
1689
+ D(!1);
1172
1690
  }
1173
1691
  }
1174
1692
  return /* @__PURE__ */ x("dialog", {
1175
- ref: o,
1693
+ ref: l,
1176
1694
  className: "ksadk-teams team-create-dialog",
1177
- "aria-labelledby": s,
1695
+ "aria-labelledby": u,
1178
1696
  onCancel: (e) => {
1179
- e.preventDefault(), b || i();
1697
+ e.preventDefault(), E || s();
1180
1698
  },
1181
1699
  children: /* @__PURE__ */ S("form", {
1182
1700
  onSubmit: (e) => {
1183
- e.preventDefault(), A();
1701
+ e.preventDefault(), re();
1184
1702
  },
1185
1703
  children: [
1186
1704
  /* @__PURE__ */ S("header", { children: [/* @__PURE__ */ S("div", { children: [
1187
1705
  /* @__PURE__ */ x("span", {
1188
1706
  className: "team-eyebrow",
1189
- children: "AGENT TEAMS"
1707
+ children: "新的协作空间"
1190
1708
  }),
1191
1709
  /* @__PURE__ */ x("h2", {
1192
- id: s,
1193
- children: "创建团队"
1710
+ id: u,
1711
+ children: "组建团队"
1194
1712
  }),
1195
- /* @__PURE__ */ x("p", { children: "选择搭档,给团队一个共同目标。" })
1713
+ /* @__PURE__ */ x("p", { children: "选择搭档,让 Leader 组织分工与复核。" })
1196
1714
  ] }), /* @__PURE__ */ x("button", {
1197
1715
  type: "button",
1198
1716
  className: "team-button team-icon-button",
1199
1717
  "aria-label": "关闭创建团队",
1200
- onClick: i,
1201
- disabled: b,
1718
+ onClick: s,
1719
+ disabled: E,
1202
1720
  children: "×"
1203
1721
  })] }),
1204
- /* @__PURE__ */ S("fieldset", {
1205
- disabled: b || r,
1206
- children: [/* @__PURE__ */ S("legend", { children: ["选择成员 ", /* @__PURE__ */ S("span", { children: [f.length, " / 8"] })] }), r ? /* @__PURE__ */ x("p", {
1207
- role: "status",
1208
- children: "正在读取可用 Agent…"
1209
- }) : t.length ? /* @__PURE__ */ x("div", {
1210
- className: "team-candidate-list",
1211
- children: t.map((e) => /* @__PURE__ */ S("label", {
1212
- className: "team-candidate",
1213
- "data-selected": f.includes(e.memberId),
1722
+ /* @__PURE__ */ S("div", {
1723
+ className: "team-create-body",
1724
+ children: [
1725
+ /* @__PURE__ */ S("label", {
1726
+ className: "team-field",
1727
+ children: ["团队名称", /* @__PURE__ */ x("input", {
1728
+ value: d,
1729
+ onChange: (e) => f(e.target.value),
1730
+ placeholder: "例如:产品交付团队",
1731
+ maxLength: 100,
1732
+ disabled: E,
1733
+ required: !0
1734
+ })]
1735
+ }),
1736
+ /* @__PURE__ */ S("fieldset", {
1737
+ disabled: E,
1738
+ children: [
1739
+ /* @__PURE__ */ S("legend", { children: ["选择成员 ", /* @__PURE__ */ S("span", { children: [y.length, " / 8"] })] }),
1740
+ /* @__PURE__ */ S("div", {
1741
+ className: "team-directory-search",
1742
+ children: [/* @__PURE__ */ x("input", {
1743
+ "aria-label": "搜索 Agent",
1744
+ value: h,
1745
+ onChange: (e) => g(e.target.value),
1746
+ placeholder: "搜索名称或职责"
1747
+ }), o && /* @__PURE__ */ x("button", {
1748
+ type: "button",
1749
+ className: "team-text-button",
1750
+ disabled: i,
1751
+ onClick: o,
1752
+ children: "刷新"
1753
+ })]
1754
+ }),
1755
+ i && /* @__PURE__ */ x("p", {
1756
+ role: "status",
1757
+ className: "team-muted",
1758
+ children: "正在读取 Agent…"
1759
+ }),
1760
+ a && /* @__PURE__ */ x("p", {
1761
+ role: "alert",
1762
+ className: "team-inline-error",
1763
+ children: a
1764
+ }),
1765
+ !i && !t.length ? /* @__PURE__ */ x("p", {
1766
+ className: "team-muted",
1767
+ children: "还没有 Agent。先创建 Agent 并完成构建,再回来组队。"
1768
+ }) : /* @__PURE__ */ S("div", {
1769
+ className: "team-candidate-list",
1770
+ children: [F.map((e) => {
1771
+ let t = j.find((t) => z(t) === z(e[0])), n = t || e[0], r = n.binding.kind === "local_build" ? "本地" : "云端", a = n.description || n.binding.description || (n.binding.capabilities.leader ? "可担任 Leader" : "任务成员");
1772
+ return /* @__PURE__ */ S("div", {
1773
+ className: "team-candidate-group",
1774
+ children: [/* @__PURE__ */ S("label", {
1775
+ className: "team-candidate",
1776
+ "data-selected": !!t,
1777
+ children: [
1778
+ /* @__PURE__ */ x("input", {
1779
+ type: "checkbox",
1780
+ checked: !!t,
1781
+ disabled: i || !t && (!B(n) || y.length >= 8),
1782
+ onChange: (e) => ne(n, e.target.checked)
1783
+ }),
1784
+ /* @__PURE__ */ x("span", {
1785
+ className: "team-avatar",
1786
+ "aria-hidden": "true",
1787
+ children: Array.from(n.name)[0]
1788
+ }),
1789
+ /* @__PURE__ */ S("span", { children: [
1790
+ /* @__PURE__ */ x("strong", {
1791
+ title: n.name,
1792
+ children: n.name
1793
+ }),
1794
+ /* @__PURE__ */ x("small", {
1795
+ className: "team-candidate-description",
1796
+ title: a,
1797
+ children: a
1798
+ }),
1799
+ !B(n) && /* @__PURE__ */ x("small", {
1800
+ className: "team-candidate-reason",
1801
+ children: n.binding.availability?.reason || "当前不支持团队执行"
1802
+ })
1803
+ ] }),
1804
+ /* @__PURE__ */ x("span", {
1805
+ className: "team-source",
1806
+ "data-available": B(n),
1807
+ "data-state": n.binding.availability?.state,
1808
+ title: n.binding.availability?.reason || (n.binding.availability?.state === "unchecked" ? "创建时检查执行环境" : void 0),
1809
+ children: r
1810
+ })
1811
+ ]
1812
+ }), t && /* @__PURE__ */ S("details", {
1813
+ className: "team-version-choice",
1814
+ children: [
1815
+ /* @__PURE__ */ x("summary", { children: "职责与版本" }),
1816
+ /* @__PURE__ */ S("label", {
1817
+ className: "team-field",
1818
+ children: ["工作职责", /* @__PURE__ */ x("textarea", {
1819
+ "aria-label": `${n.name} 的工作职责`,
1820
+ rows: 2,
1821
+ maxLength: 2e3,
1822
+ value: n.responsibility || "",
1823
+ onChange: (e) => {
1824
+ let t = e.target.value;
1825
+ b((e) => e.map((e) => z(e) === z(n) ? {
1826
+ ...e,
1827
+ responsibility: t
1828
+ } : e));
1829
+ },
1830
+ placeholder: "例如:核对实现边界,补充测试证据"
1831
+ })]
1832
+ }),
1833
+ /* @__PURE__ */ S("p", { children: ["模型:", n.binding.modelName || "沿用固定版本配置"] }),
1834
+ /* @__PURE__ */ S("label", {
1835
+ className: "team-field",
1836
+ children: ["执行版本", /* @__PURE__ */ x("select", {
1837
+ "aria-label": `${n.name} 的执行版本`,
1838
+ value: n.binding.bindingRef,
1839
+ onChange: (t) => {
1840
+ let r = e.find((e) => e.binding.bindingRef === t.target.value);
1841
+ b((e) => e.map((e) => z(e) === z(n) ? {
1842
+ ...r,
1843
+ memberId: e.memberId,
1844
+ responsibility: e.responsibility
1845
+ } : e));
1846
+ },
1847
+ children: e.map((e) => /* @__PURE__ */ S("option", {
1848
+ value: e.binding.bindingRef,
1849
+ disabled: !B(e),
1850
+ children: [e.binding.version || e.binding.buildId || e.binding.bindingRef, B(e) ? "" : " · 不可用"]
1851
+ }, e.binding.bindingRef))
1852
+ })]
1853
+ })
1854
+ ]
1855
+ })]
1856
+ }, z(n));
1857
+ }), !F.length && !!t.length && /* @__PURE__ */ x("p", {
1858
+ className: "team-muted",
1859
+ children: "没有匹配的 Agent。"
1860
+ })]
1861
+ }),
1862
+ y.filter((e) => !t.some((t) => t.binding.bindingRef === e.binding.bindingRef)).map((e) => /* @__PURE__ */ S("p", {
1863
+ className: "team-inline-error",
1864
+ children: [
1865
+ e.name,
1866
+ " · 当前目录中不可用 ",
1867
+ /* @__PURE__ */ x("button", {
1868
+ type: "button",
1869
+ className: "team-text-button",
1870
+ onClick: () => ne(e, !1),
1871
+ children: "移除"
1872
+ })
1873
+ ]
1874
+ }, e.memberId))
1875
+ ]
1876
+ }),
1877
+ /* @__PURE__ */ S("label", {
1878
+ className: "team-field",
1879
+ children: [
1880
+ "指定 Leader",
1881
+ /* @__PURE__ */ S("select", {
1882
+ value: N,
1883
+ onChange: (e) => w(e.target.value),
1884
+ disabled: E || !M.length,
1885
+ children: [/* @__PURE__ */ x("option", {
1886
+ value: "",
1887
+ disabled: !0,
1888
+ children: "从已选成员中指定"
1889
+ }), M.map((e) => /* @__PURE__ */ x("option", {
1890
+ value: e.memberId,
1891
+ children: e.name
1892
+ }, e.memberId))]
1893
+ }),
1894
+ /* @__PURE__ */ x("small", { children: "Leader 审核成员成果,你处理工具审批和最终验收。" })
1895
+ ]
1896
+ }),
1897
+ r && te && /* @__PURE__ */ S("details", {
1898
+ className: "team-version-choice",
1214
1899
  children: [
1215
- /* @__PURE__ */ x("input", {
1216
- type: "checkbox",
1217
- checked: f.includes(e.memberId),
1218
- disabled: !e.binding.capabilities.enqueue || !f.includes(e.memberId) && f.length >= 8,
1219
- onChange: (t) => h((n) => t.target.checked ? [...n, e.memberId] : n.filter((t) => t !== e.memberId))
1900
+ /* @__PURE__ */ x("summary", { children: "本地离线时继续协作" }),
1901
+ /* @__PURE__ */ S("label", {
1902
+ className: "team-field",
1903
+ children: ["Leader 云端备用", /* @__PURE__ */ S("select", {
1904
+ value: T,
1905
+ onChange: (e) => ee(e.target.value),
1906
+ disabled: E || i,
1907
+ children: [/* @__PURE__ */ x("option", {
1908
+ value: "",
1909
+ children: "暂不配置"
1910
+ }), P.map((e) => /* @__PURE__ */ S("option", {
1911
+ value: e.binding.bindingRef,
1912
+ children: [
1913
+ e.name,
1914
+ " · ",
1915
+ e.binding.version || e.binding.buildId || "固定版本"
1916
+ ]
1917
+ }, e.binding.bindingRef))]
1918
+ })]
1220
1919
  }),
1221
- /* @__PURE__ */ x("span", {
1222
- className: "team-avatar",
1223
- "aria-hidden": "true",
1224
- children: Array.from(e.name)[0]
1920
+ /* @__PURE__ */ x("p", {
1921
+ className: "team-muted",
1922
+ children: "创建前会检查同版本执行能力。云端模型、工具和任务资料需预先准备;本地凭据不会复制到云端。"
1225
1923
  }),
1226
- /* @__PURE__ */ S("span", { children: [/* @__PURE__ */ x("strong", { children: e.name }), /* @__PURE__ */ S("small", { children: [e.description || (e.binding.capabilities.leader ? "可担任 Leader" : "任务成员"), e.binding.capabilities.enqueue ? "" : " · 当前不可调用"] })] })
1924
+ !P.length && /* @__PURE__ */ x("p", {
1925
+ className: "team-muted",
1926
+ children: "还没有可用的云端 Leader 节点。可以先创建团队,接入节点后在任务详情配置。"
1927
+ })
1227
1928
  ]
1228
- }, e.memberId))
1229
- }) : /* @__PURE__ */ x("p", {
1230
- className: "team-muted",
1231
- children: "暂无可调用的 Agent。请先创建并构建 Agent。"
1232
- })]
1233
- }),
1234
- /* @__PURE__ */ S("label", {
1235
- className: "team-field",
1236
- htmlFor: c,
1237
- children: ["群组名称", /* @__PURE__ */ x("input", {
1238
- id: c,
1239
- value: u,
1240
- onChange: (e) => d(e.target.value),
1241
- placeholder: "例如:接口改造协作组",
1242
- maxLength: 100,
1243
- disabled: b,
1244
- required: !0
1245
- })]
1246
- }),
1247
- /* @__PURE__ */ S("label", {
1248
- className: "team-field",
1249
- htmlFor: l,
1250
- children: [
1251
- "指定 Leader",
1252
- /* @__PURE__ */ S("select", {
1253
- id: l,
1254
- value: k,
1255
- onChange: (e) => y(e.target.value),
1256
- disabled: b || !O.length,
1257
- children: [/* @__PURE__ */ x("option", {
1258
- value: "",
1259
- disabled: !0,
1260
- children: "从已选成员中指定"
1261
- }), O.map((e) => /* @__PURE__ */ x("option", {
1262
- value: e.memberId,
1263
- children: e.name
1264
- }, e.memberId))]
1265
1929
  }),
1266
- /* @__PURE__ */ x("small", { children: "Leader 负责分工与汇总,审批和最终验收仍由你决定。" })
1930
+ /* @__PURE__ */ x("p", {
1931
+ className: "team-create-footnote",
1932
+ children: "创建时检查选中成员的执行环境;配置失败会保留草稿。"
1933
+ }),
1934
+ O && /* @__PURE__ */ x("p", {
1935
+ role: "alert",
1936
+ className: "team-inline-error",
1937
+ children: O
1938
+ })
1267
1939
  ]
1268
1940
  }),
1269
- w && /* @__PURE__ */ x("p", {
1270
- role: "alert",
1271
- className: "team-inline-error",
1272
- children: w
1273
- }),
1274
1941
  /* @__PURE__ */ S("footer", { children: [/* @__PURE__ */ x("button", {
1275
1942
  type: "button",
1276
1943
  className: "team-button",
1277
- onClick: i,
1278
- disabled: b,
1279
- children: "取消"
1944
+ onClick: s,
1945
+ disabled: E,
1946
+ children: "稍后继续"
1280
1947
  }), /* @__PURE__ */ x("button", {
1281
1948
  type: "submit",
1282
1949
  className: "team-button team-primary",
1283
- disabled: b || r || !D.length,
1284
- children: b ? "正在创建" : "创建团队"
1950
+ disabled: E || i || j.length < 2,
1951
+ children: E ? "正在检查并创建…" : "创建团队"
1285
1952
  })] })
1286
1953
  ]
1287
1954
  })
@@ -1289,7 +1956,7 @@ function ne({ open: e, candidates: t, loading: r, onClose: i, onCreate: a }) {
1289
1956
  }
1290
1957
  //#endregion
1291
1958
  //#region src/hooks/useTeamChat.ts
1292
- var U = class {
1959
+ var H = class {
1293
1960
  value = {
1294
1961
  snapshot: null,
1295
1962
  connection: "closed",
@@ -1348,8 +2015,8 @@ var U = class {
1348
2015
  };
1349
2016
  send = (e) => this.client.send(this.groupId, e);
1350
2017
  };
1351
- function W(e) {
1352
- let t = g(() => new U(e.client, e.groupId, e.authorityRef), [
2018
+ function U(e) {
2019
+ let t = g(() => new H(e.client, e.groupId, e.authorityRef), [
1353
2020
  e.client,
1354
2021
  e.groupId,
1355
2022
  e.authorityRef
@@ -1363,4 +2030,4 @@ function W(e) {
1363
2030
  };
1364
2031
  }
1365
2032
  //#endregion
1366
- export { ne as CreateGroupDialog, N as GroupComposer, j as GroupHeader, M as GroupTimeline, B as MemberInspector, z as MemberRail, P as TaskBoard, I as TaskDetail, R as TeamInteractionTray, ee as TeamProgressCard, A as TeamStatusLabel, V as TeamWorkspace, W as useTeamChat };
2033
+ export { V as CreateGroupDialog, P as GroupComposer, M as GroupHeader, N as GroupTimeline, ae as MemberInspector, L as MemberRail, F as TaskBoard, re as TaskDetail, ie as TeamInteractionTray, te as TeamProgressCard, A as TeamStatusLabel, oe as TeamWorkspace, U as useTeamChat };