@kingsoftcloud/ksadk-web 0.3.12 → 0.3.13
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.
- package/CHANGELOG.md +23 -0
- package/README.md +7 -4
- package/RELEASE_PROVENANCE.json +2 -2
- package/dist-ksadk/assets/{ArtifactsPanel-C1YoaKhx.js → ArtifactsPanel-CILaW-fC.js} +1 -1
- package/dist-ksadk/assets/{CodeBlock-DHuAWfr5.js → CodeBlock-BVrNVtJC.js} +1 -1
- package/dist-ksadk/assets/{MathMessageMarkdown-cvdrBwYr.js → MathMessageMarkdown-Dp7c4wWD.js} +1 -1
- package/dist-ksadk/assets/{MermaidBlock-DeBkbJvI.js → MermaidBlock-Dxop8Rd7.js} +6 -6
- package/dist-ksadk/assets/{NativeTerminalPanel-oJj44_sV.js → NativeTerminalPanel-Cjjz8B30.js} +1 -1
- package/dist-ksadk/assets/{abnfDiagram-VCTEODGH-Dhfv25o2.js → abnfDiagram-VCTEODGH-ckWDmOzw.js} +1 -1
- package/dist-ksadk/assets/{arc-C35w-pn1.js → arc-DqxJede-.js} +1 -1
- package/dist-ksadk/assets/architecture-7GRP2DOG-pn_DuLy6.js +1 -0
- package/dist-ksadk/assets/{architectureDiagram-5GKGNRK7-FoMY_u6D.js → architectureDiagram-5GKGNRK7-SEQA4bVi.js} +1 -1
- package/dist-ksadk/assets/{blockDiagram-NRAW4CY4-zD4Rt7oE.js → blockDiagram-NRAW4CY4-pM0B-6NJ.js} +1 -1
- package/dist-ksadk/assets/{c4Diagram-UCG6FXSJ-BCtGGkhN.js → c4Diagram-UCG6FXSJ-m2tuCNVq.js} +1 -1
- package/dist-ksadk/assets/channel-fySsnkft.js +1 -0
- package/dist-ksadk/assets/chunk-2Q5K7J3B-BheGxKRQ.js +1 -0
- package/dist-ksadk/assets/{chunk-5VM5RSS4-C2Ms13_k.js → chunk-5VM5RSS4-GJHDr9Ww.js} +1 -1
- package/dist-ksadk/assets/{chunk-F27PBJKO-BoTj-qgx.js → chunk-F27PBJKO-CbAN45AV.js} +1 -1
- package/dist-ksadk/assets/{chunk-G27WJ6UU-DOMyyjHH.js → chunk-G27WJ6UU-D5ngbbzF.js} +1 -1
- package/dist-ksadk/assets/{chunk-JWPE2WC7-DbJJqDli.js → chunk-JWPE2WC7-Cc5IwuYC.js} +1 -1
- package/dist-ksadk/assets/{chunk-LCL6LL3I-CLuRCt_W.js → chunk-LCL6LL3I-CprgDDdJ.js} +1 -1
- package/dist-ksadk/assets/{chunk-POPQ4Y6H-D0Dz847e.js → chunk-POPQ4Y6H-CDZhSy82.js} +1 -1
- package/dist-ksadk/assets/{chunk-RHFEMEQ7-BWSRzEcd.js → chunk-RHFEMEQ7-CZchUNro.js} +1 -1
- package/dist-ksadk/assets/{chunk-SVP7TREG-CPoHqkCY.js → chunk-SVP7TREG-BVruqk6T.js} +1 -1
- package/dist-ksadk/assets/{chunk-XXDRQBXY-Bx1jS-X-.js → chunk-XXDRQBXY-4ld9SxPN.js} +1 -1
- package/dist-ksadk/assets/classDiagram-DTDB5LWJ-DSfLtNYm.js +1 -0
- package/dist-ksadk/assets/classDiagram-v2-JRS7N3AN-DSfLtNYm.js +1 -0
- package/dist-ksadk/assets/{cose-bilkent-JH36ORCC-LzyWm4m0.js → cose-bilkent-JH36ORCC-Dmyyk_Vp.js} +1 -1
- package/dist-ksadk/assets/cynefin-OW5HDTMX-PFWIGtvA.js +1 -0
- package/dist-ksadk/assets/{cynefinDiagram-5FMLGOSQ-BlW_bHED.js → cynefinDiagram-5FMLGOSQ-BIyq3EJb.js} +1 -1
- package/dist-ksadk/assets/{dagre-3AP2YEHR-Bu_S86_i.js → dagre-3AP2YEHR-eBw08Qdk.js} +1 -1
- package/dist-ksadk/assets/{dagre-B7nCawed.js → dagre-DfvnEf45.js} +1 -1
- package/dist-ksadk/assets/{diagram-S7CK7UJ4-W_Zow2Km.js → diagram-S7CK7UJ4-CUSrE3Mg.js} +1 -1
- package/dist-ksadk/assets/{diagram-UQ7AKVKN-CLIKAHON.js → diagram-UQ7AKVKN-Dq5Zw2gy.js} +1 -1
- package/dist-ksadk/assets/{diagram-VSXAHHWV-Dv6_QAlN.js → diagram-VSXAHHWV-DyUHfNwT.js} +1 -1
- package/dist-ksadk/assets/{diagram-VX7I27RA-BWAWRDtZ.js → diagram-VX7I27RA-CREmM89O.js} +1 -1
- package/dist-ksadk/assets/{diagram-Z3DM3KII-XA_rWMss.js → diagram-Z3DM3KII-Dw9zhHUK.js} +1 -1
- package/dist-ksadk/assets/{dist-CGt_UGeO.js → dist-0uJ4tdx6.js} +1 -1
- package/dist-ksadk/assets/{dist-C0J5_3qM.js → dist-AEv-vXf-.js} +1 -1
- package/dist-ksadk/assets/{dist-CIpWk_5f.js → dist-B49GzZDb.js} +1 -1
- package/dist-ksadk/assets/{dist-B3bA05-e.js → dist-B8Myiet9.js} +1 -1
- package/dist-ksadk/assets/{dist-DWfdmz9s.js → dist-BBsYarrI.js} +1 -1
- package/dist-ksadk/assets/{dist-BLpRy_Yx.js → dist-BQMrUwdI.js} +1 -1
- package/dist-ksadk/assets/{dist-CIRMvUM4.js → dist-BX_-FENW.js} +1 -1
- package/dist-ksadk/assets/{dist-BdNFAney.js → dist-CD4L6ymH.js} +1 -1
- package/dist-ksadk/assets/{dist-n3n6t_FO.js → dist-CHpW1BHj.js} +1 -1
- package/dist-ksadk/assets/{dist-DppE_r-D.js → dist-CVPau3tn.js} +1 -1
- package/dist-ksadk/assets/{dist-qe8xjesy.js → dist-C_qdxcSH.js} +1 -1
- package/dist-ksadk/assets/{dist-2vL2sAdF.js → dist-Co68Apq4.js} +1 -1
- package/dist-ksadk/assets/{dist-1nXCdsej.js → dist-Cp2PaOMY.js} +1 -1
- package/dist-ksadk/assets/{dist-DNKuMzWc.js → dist-CuR5Bgme.js} +1 -1
- package/dist-ksadk/assets/{dist-t6MzE0jU.js → dist-DDSyLEOX.js} +1 -1
- package/dist-ksadk/assets/{dist-CPyieXEf.js → dist-DUxO0R99.js} +1 -1
- package/dist-ksadk/assets/{dist-DyG6Ya-z.js → dist-QzbGrED_.js} +1 -1
- package/dist-ksadk/assets/{dist-0X_j2Rcc.js → dist-bupkyEBZ.js} +1 -1
- package/dist-ksadk/assets/{dist-mqD5TZup.js → dist-cxTGfdqx.js} +1 -1
- package/dist-ksadk/assets/{dist-M-SrdhhZ.js → dist-hL5p1til.js} +1 -1
- package/dist-ksadk/assets/{dist-D-92S-Fd.js → dist-lOy23y43.js} +1 -1
- package/dist-ksadk/assets/{dist-BO_UwatH.js → dist-pq-nD33R.js} +1 -1
- package/dist-ksadk/assets/{ebnfDiagram-PWID7BFC-BfCzF1Xi.js → ebnfDiagram-PWID7BFC-BS5LdNoR.js} +1 -1
- package/dist-ksadk/assets/{erDiagram-SSCWMZ5O-Dpz9_0zn.js → erDiagram-SSCWMZ5O-Bv1QtiY-.js} +1 -1
- package/dist-ksadk/assets/eventmodeling-NTZA5JFV-DsM4upQX.js +1 -0
- package/dist-ksadk/assets/flowDiagram-A5DVABFB-D5NA16k9.js +1 -0
- package/dist-ksadk/assets/{ganttDiagram-EL5Y4UJY-DDaG1f4_.js → ganttDiagram-EL5Y4UJY-musi-e0G.js} +1 -1
- package/dist-ksadk/assets/gitGraph-4MIJSDKK-DUCVz-ih.js +1 -0
- package/dist-ksadk/assets/{gitGraphDiagram-WWUBYQGX-DcxzRwYC.js → gitGraphDiagram-WWUBYQGX-DH37EGkG.js} +1 -1
- package/dist-ksadk/assets/index-CZdkAvsv.js +244 -0
- package/dist-ksadk/assets/index-CvXdHgF3.css +2 -0
- package/dist-ksadk/assets/info-A6RAGUB7-rw0ZNHZp.js +1 -0
- package/dist-ksadk/assets/{infoDiagram-RXCK75RN-CYMdn6lQ.js → infoDiagram-RXCK75RN-C1kEtv2y.js} +1 -1
- package/dist-ksadk/assets/{ishikawaDiagram-5VMMS53U-CLHFAD6c.js → ishikawaDiagram-5VMMS53U-BCNPyMka.js} +1 -1
- package/dist-ksadk/assets/{journeyDiagram-EYS64GPL-BHSKQGAl.js → journeyDiagram-EYS64GPL--cDbKnjP.js} +1 -1
- package/dist-ksadk/assets/{kanban-definition-3QL26DDD-D5W3tjTT.js → kanban-definition-3QL26DDD-R1rAVw2f.js} +1 -1
- package/dist-ksadk/assets/{katex-mtjOi4KM.js → katex-BT-X-V7U.js} +1 -1
- package/dist-ksadk/assets/{linear-BETqsxE_.js → linear-DTR631iG.js} +1 -1
- package/dist-ksadk/assets/{mermaid-parser.core-DPWrvs90.js → mermaid-parser.core-DfFzJhX8.js} +2 -2
- package/dist-ksadk/assets/{mindmap-definition-FBJOCRG2-CJG2mfBP.js → mindmap-definition-FBJOCRG2-D4by_rmk.js} +1 -1
- package/dist-ksadk/assets/packet-AYTQ26CC-Ca4Hvki9.js +1 -0
- package/dist-ksadk/assets/{pegDiagram-XKGWAZYB-GjAPNaqn.js → pegDiagram-XKGWAZYB-xWXPEh0c.js} +1 -1
- package/dist-ksadk/assets/pie-WAS4IAKB-hwiz6fbw.js +1 -0
- package/dist-ksadk/assets/{pieDiagram-E7YTZNPT-ToIewrqr.js → pieDiagram-E7YTZNPT-BudBDlCI.js} +1 -1
- package/dist-ksadk/assets/{quadrantDiagram-AXDQQJYC-4d78KiEY.js → quadrantDiagram-AXDQQJYC-DXZ0PCJF.js} +1 -1
- package/dist-ksadk/assets/radar-RG4KPBEZ-BR1oZXLM.js +1 -0
- package/dist-ksadk/assets/railroad-74A4TZTK-DfgEISfX.js +1 -0
- package/dist-ksadk/assets/railroad-abnf-HS5TGJTU-CWOC3rdk.js +1 -0
- package/dist-ksadk/assets/railroad-ebnf-LZEXJU2U-CiRvHCLY.js +1 -0
- package/dist-ksadk/assets/railroad-peg-WCYAUIDC-DSDDyJ2f.js +1 -0
- package/dist-ksadk/assets/{railroadDiagram-O6MQD6OU-DKzx4xfv.js → railroadDiagram-O6MQD6OU-BdAYRYB8.js} +1 -1
- package/dist-ksadk/assets/{requirementDiagram-EFPCY7ZU-CJYljxQS.js → requirementDiagram-EFPCY7ZU-CBBmaL70.js} +1 -1
- package/dist-ksadk/assets/{sankeyDiagram-P5KCCOFB-DLU2fV1w.js → sankeyDiagram-P5KCCOFB-Doc3rdwp.js} +1 -1
- package/dist-ksadk/assets/{sequenceDiagram-WJ2MYXX4-CVqysrA9.js → sequenceDiagram-WJ2MYXX4-0J8R8hWW.js} +1 -1
- package/dist-ksadk/assets/{sizeCapture-X5ZJPWSS-BUxfmTHc.js → sizeCapture-X5ZJPWSS-CfFLlWsK.js} +1 -1
- package/dist-ksadk/assets/{stateDiagram-HBIQ2CUA-CNFgYI9E.js → stateDiagram-HBIQ2CUA-jBwkjtTy.js} +1 -1
- package/dist-ksadk/assets/stateDiagram-v2-4QOOHH4V-Cw1fPb5w.js +1 -0
- package/dist-ksadk/assets/{swimlanes-XN3QIQJK-B6qCMe8N.js → swimlanes-XN3QIQJK-B0WxTQf8.js} +1 -1
- package/dist-ksadk/assets/swimlanesDiagram-VK2B7HYN-Cc3JMBAF.js +8 -0
- package/dist-ksadk/assets/{timeline-definition-24CTP7MA-CMD3x_U_.js → timeline-definition-24CTP7MA-BfCT_75A.js} +1 -1
- package/dist-ksadk/assets/treeView-Q6P3EWNA-C05SJHxo.js +1 -0
- package/dist-ksadk/assets/treemap-WGGIJYW6-BqNLAhc3.js +1 -0
- package/dist-ksadk/assets/{vennDiagram-4TSXK5OY-BqtUqvXM.js → vennDiagram-4TSXK5OY-9gX1VMDC.js} +1 -1
- package/dist-ksadk/assets/wardley-WFR3VGLG-DokNktqB.js +1 -0
- package/dist-ksadk/assets/{wardleyDiagram-VM6X3IG4-B5KfDjI-.js → wardleyDiagram-VM6X3IG4-sEs_BP6O.js} +1 -1
- package/dist-ksadk/assets/{xychartDiagram-S5SC5T6Z-BaUlSZrn.js → xychartDiagram-S5SC5T6Z-Ll4jvUN9.js} +1 -1
- package/dist-ksadk/index.html +2 -2
- package/dist-lib/App.d.ts.map +1 -1
- package/dist-lib/{AttachmentPreview-HLpbjOnQ.js → AttachmentPreview-lufx89xJ.js} +174 -174
- package/dist-lib/{ConnectedComposer-CeWPgOn2.js → ConnectedComposer-Dd8ZFhfL.js} +214 -213
- package/dist-lib/{ConnectedMessageList-D3HWHCh2.js → ConnectedMessageList-CzTOJbZU.js} +582 -510
- package/dist-lib/{InteractionSchemaForm-Du9NT4E8.js → InteractionSchemaForm-ChYkHPop.js} +88 -71
- package/dist-lib/{WorkspacePanelContainer-B2mk7udj.js → WorkspacePanelContainer-BDbgHg1_.js} +2 -2
- package/dist-lib/{a2ui-BEQoW34n.js → a2ui-DfAshhMK.js} +8 -3
- package/dist-lib/api/messages.d.ts +88 -0
- package/dist-lib/api/messages.d.ts.map +1 -0
- package/dist-lib/chat-composer.js +2 -2
- package/dist-lib/chat-timeline.js +3 -3
- package/dist-lib/{cloudMaterials-BlIAT-PA.js → cloudMaterials-D75jTrkQ.js} +823 -628
- package/dist-lib/components/chat/AgentBlockView.d.ts +9 -0
- package/dist-lib/components/chat/AgentBlockView.d.ts.map +1 -0
- package/dist-lib/components/chat/ChatComposer.d.ts.map +1 -1
- package/dist-lib/components/chat/ChatMessageList.d.ts +4 -2
- package/dist-lib/components/chat/ChatMessageList.d.ts.map +1 -1
- package/dist-lib/components/chat/ConnectedComposer.d.ts +1 -1
- package/dist-lib/components/chat/ConnectedComposer.d.ts.map +1 -1
- package/dist-lib/components/chat/ConnectedMessageList.d.ts +4 -1
- package/dist-lib/components/chat/ConnectedMessageList.d.ts.map +1 -1
- package/dist-lib/components/chat/InteractionSchemaForm.d.ts.map +1 -1
- package/dist-lib/components/chat/InteractionTray.d.ts.map +1 -1
- package/dist-lib/components/chat/ProcessingBlocksView.d.ts +2 -2
- package/dist-lib/components/chat/ProcessingBlocksView.d.ts.map +1 -1
- package/dist-lib/components/chat/StatusBanner.d.ts.map +1 -1
- package/dist-lib/components/chat/approval-status.d.ts +5 -0
- package/dist-lib/components/chat/approval-status.d.ts.map +1 -0
- package/dist-lib/components/chat/types.d.ts +13 -1
- package/dist-lib/components/chat/types.d.ts.map +1 -1
- package/dist-lib/components/teams/CloudTeamWorkspace.d.ts.map +1 -1
- package/dist-lib/components/teams/TeamWorkspace.d.ts.map +1 -1
- package/dist-lib/components.js +6 -6
- package/dist-lib/conversation.js +8 -34
- package/dist-lib/core/api/facade.d.ts +18 -10
- package/dist-lib/core/api/facade.d.ts.map +1 -1
- package/dist-lib/core/api/types.d.ts +28 -3
- package/dist-lib/core/api/types.d.ts.map +1 -1
- package/dist-lib/core/conversation/agent.d.ts +49 -0
- package/dist-lib/core/conversation/agent.d.ts.map +1 -0
- package/dist-lib/core/conversation/client.d.ts +2 -0
- package/dist-lib/core/conversation/client.d.ts.map +1 -1
- package/dist-lib/core/conversation/contracts.d.ts.map +1 -1
- package/dist-lib/core/conversation/hosted.d.ts.map +1 -1
- package/dist-lib/core/conversation/index.d.ts +4 -1
- package/dist-lib/core/conversation/index.d.ts.map +1 -1
- package/dist-lib/core/conversation/presentation.d.ts.map +1 -1
- package/dist-lib/core/conversation/reducer.d.ts.map +1 -1
- package/dist-lib/core/conversation/renderer-registry.d.ts +1 -0
- package/dist-lib/core/conversation/renderer-registry.d.ts.map +1 -1
- package/dist-lib/core/conversation/runtime-ingress.d.ts +22 -0
- package/dist-lib/core/conversation/runtime-ingress.d.ts.map +1 -0
- package/dist-lib/core/conversation/safe-tool-value.d.ts +8 -0
- package/dist-lib/core/conversation/safe-tool-value.d.ts.map +1 -0
- package/dist-lib/core/conversation/scoped-cancel.d.ts +16 -0
- package/dist-lib/core/conversation/scoped-cancel.d.ts.map +1 -0
- package/dist-lib/core/conversation/types.d.ts +6 -1
- package/dist-lib/core/conversation/types.d.ts.map +1 -1
- package/dist-lib/core/interaction/adapters/legacy-runtime-events.d.ts +8 -0
- package/dist-lib/core/interaction/adapters/legacy-runtime-events.d.ts.map +1 -0
- package/dist-lib/core/interaction/adapters/responses.d.ts +1 -0
- package/dist-lib/core/interaction/adapters/responses.d.ts.map +1 -1
- package/dist-lib/core/interaction/adapters/session-events.d.ts.map +1 -1
- package/dist-lib/core/interaction/client.d.ts +3 -2
- package/dist-lib/core/interaction/client.d.ts.map +1 -1
- package/dist-lib/core/interaction/index.d.ts +4 -0
- package/dist-lib/core/interaction/index.d.ts.map +1 -1
- package/dist-lib/core/interaction/legacy-history.d.ts +5 -0
- package/dist-lib/core/interaction/legacy-history.d.ts.map +1 -0
- package/dist-lib/core/interaction/store.d.ts +4 -0
- package/dist-lib/core/interaction/store.d.ts.map +1 -1
- package/dist-lib/core/interaction/types.d.ts +2 -0
- package/dist-lib/core/interaction/types.d.ts.map +1 -1
- package/dist-lib/core/run/blocks.d.ts +2 -1
- package/dist-lib/core/run/blocks.d.ts.map +1 -1
- package/dist-lib/core/run/dispatcher.d.ts.map +1 -1
- package/dist-lib/core/run/engine.d.ts +2 -0
- package/dist-lib/core/run/engine.d.ts.map +1 -1
- package/dist-lib/core/run/types.d.ts +7 -1
- package/dist-lib/core/run/types.d.ts.map +1 -1
- package/dist-lib/core/stream/kernel-events.d.ts +2 -0
- package/dist-lib/core/stream/kernel-events.d.ts.map +1 -1
- package/dist-lib/core/stream/responses-protocol.d.ts.map +1 -1
- package/dist-lib/core/stream/runtime-items.d.ts +2 -2
- package/dist-lib/core/stream/runtime-items.d.ts.map +1 -1
- package/dist-lib/core/stream/types.d.ts +4 -0
- package/dist-lib/core/stream/types.d.ts.map +1 -1
- package/dist-lib/core/teams/cloudExtendedContracts.d.ts +48 -48
- package/dist-lib/core/teams/cloudExtendedContracts.d.ts.map +1 -1
- package/dist-lib/core/teams/cloudMaterials.d.ts +2 -2
- package/dist-lib/core/teams/cloudMaterials.d.ts.map +1 -1
- package/dist-lib/hooks/useAgentChat.d.ts +2 -7
- package/dist-lib/hooks/useAgentChat.d.ts.map +1 -1
- package/dist-lib/hooks/useFeedback.d.ts +2 -2
- package/dist-lib/hooks/useFeedback.d.ts.map +1 -1
- package/dist-lib/hooks/useImeComposition.d.ts +21 -0
- package/dist-lib/hooks/useImeComposition.d.ts.map +1 -0
- package/dist-lib/hooks/useInteractions.d.ts +1 -1
- package/dist-lib/hooks/useInteractions.d.ts.map +1 -1
- package/dist-lib/hooks/useRunAgent.d.ts +3 -1
- package/dist-lib/hooks/useRunAgent.d.ts.map +1 -1
- package/dist-lib/hooks/useSessionLifecycle.d.ts +1 -1
- package/dist-lib/hooks/useSessionLifecycle.d.ts.map +1 -1
- package/dist-lib/hooks.js +9 -9
- package/dist-lib/{permission-CcMWqN8Y.js → permission-B2MuVypC.js} +1 -1
- package/dist-lib/persisted-session-history-CBk_ypXo.js +2888 -0
- package/dist-lib/public/chat-timeline.d.ts +2 -0
- package/dist-lib/public/chat-timeline.d.ts.map +1 -1
- package/dist-lib/public/conversation.d.ts +3 -1
- package/dist-lib/public/conversation.d.ts.map +1 -1
- package/dist-lib/{reducer-BP8YVv-Q.js → reducer-mbYiX0wz.js} +81 -13
- package/dist-lib/{runtime-items-q6tMjfGU.js → runtime-items-VPq7711E.js} +0 -0
- package/dist-lib/runtime.js +287 -226
- package/dist-lib/stores/session.d.ts +20 -11
- package/dist-lib/stores/session.d.ts.map +1 -1
- package/dist-lib/styles.css +1 -1
- package/dist-lib/team-components.js +922 -922
- package/dist-lib/teams.js +363 -555
- package/dist-lib/types/agent-control.d.ts +2 -0
- package/dist-lib/types/agent-control.d.ts.map +1 -1
- package/dist-lib/types/capabilities.d.ts +6 -0
- package/dist-lib/types/capabilities.d.ts.map +1 -1
- package/dist-lib/types/session-events.d.ts +1 -0
- package/dist-lib/types/session-events.d.ts.map +1 -1
- package/dist-lib/{useSessionLifecycle-DQXKeBm9.js → useSessionLifecycle-DS3PPoWK.js} +1316 -1041
- package/dist-lib/utils/history-preparation.d.ts +8 -0
- package/dist-lib/utils/history-preparation.d.ts.map +1 -0
- package/dist-lib/utils/messages.d.ts +8 -4
- package/dist-lib/utils/messages.d.ts.map +1 -1
- package/dist-lib/utils/persisted-session-history.d.ts +1 -1
- package/dist-lib/utils/persisted-session-history.d.ts.map +1 -1
- package/dist-lib/utils/session-events.d.ts.map +1 -1
- package/dist-lib/utils/transcript-order.d.ts +10 -0
- package/dist-lib/utils/transcript-order.d.ts.map +1 -0
- package/package.json +3 -2
- package/dist-ksadk/assets/architecture-7GRP2DOG-BCsa26zi.js +0 -1
- package/dist-ksadk/assets/channel-_KDifNys.js +0 -1
- package/dist-ksadk/assets/chunk-2Q5K7J3B-HdVkJ9F0.js +0 -1
- package/dist-ksadk/assets/classDiagram-DTDB5LWJ-BVCW3ZqZ.js +0 -1
- package/dist-ksadk/assets/classDiagram-v2-JRS7N3AN-BVCW3ZqZ.js +0 -1
- package/dist-ksadk/assets/cynefin-OW5HDTMX-CNXjFctL.js +0 -1
- package/dist-ksadk/assets/eventmodeling-NTZA5JFV-B5-8RH9c.js +0 -1
- package/dist-ksadk/assets/flowDiagram-A5DVABFB-BppFxEKw.js +0 -1
- package/dist-ksadk/assets/gitGraph-4MIJSDKK-B-AhYj4C.js +0 -1
- package/dist-ksadk/assets/index-BMd2mucF.css +0 -2
- package/dist-ksadk/assets/index-D5qyyhTH.js +0 -244
- package/dist-ksadk/assets/info-A6RAGUB7-0uiKrC35.js +0 -1
- package/dist-ksadk/assets/packet-AYTQ26CC-BVTmZ_cw.js +0 -1
- package/dist-ksadk/assets/pie-WAS4IAKB-DyfxBU7V.js +0 -1
- package/dist-ksadk/assets/radar-RG4KPBEZ-FFontjL2.js +0 -1
- package/dist-ksadk/assets/railroad-74A4TZTK-D0Uidzen.js +0 -1
- package/dist-ksadk/assets/railroad-abnf-HS5TGJTU-BOo_9T2h.js +0 -1
- package/dist-ksadk/assets/railroad-ebnf-LZEXJU2U-D6-BjW7Z.js +0 -1
- package/dist-ksadk/assets/railroad-peg-WCYAUIDC-CXx__yMm.js +0 -1
- package/dist-ksadk/assets/stateDiagram-v2-4QOOHH4V-BXAFScz8.js +0 -1
- package/dist-ksadk/assets/swimlanesDiagram-VK2B7HYN-uIQ2lJKH.js +0 -8
- package/dist-ksadk/assets/treeView-Q6P3EWNA-CK5GgucZ.js +0 -1
- package/dist-ksadk/assets/treemap-WGGIJYW6-Bq1u1SpG.js +0 -1
- package/dist-ksadk/assets/wardley-WFR3VGLG-QAt06uEz.js +0 -1
- package/dist-lib/persisted-session-history-ClsfDfGs.js +0 -1991
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { d as e, g as t, h as n, m as r } from "./a2ui-
|
|
1
|
+
import { d as e, g as t, h as n, m as r } from "./a2ui-DfAshhMK.js";
|
|
2
2
|
import { t as i } from "./utils-CX-Pz5p6.js";
|
|
3
|
-
import { a, n as o, r as s, t as c } from "./AttachmentPreview-
|
|
3
|
+
import { a, n as o, r as s, t as c } from "./AttachmentPreview-lufx89xJ.js";
|
|
4
4
|
import { c as l, l as u, u as d } from "./feedback-CuC5jRi_.js";
|
|
5
5
|
import { a as f, r as p, t as m } from "./MessageMarkdown-CwMTvgFj.js";
|
|
6
6
|
import { t as h } from "./tool-display-DTiRdghE.js";
|
|
7
7
|
import { t as g } from "./clipboard-MB6Ru6h6.js";
|
|
8
8
|
import { useCallback as _, useEffect as v, useLayoutEffect as y, useMemo as b, useRef as x, useState as S } from "react";
|
|
9
|
-
import { Bot as
|
|
10
|
-
import { Fragment as
|
|
9
|
+
import { Bot as ee, Check as C, ChevronDown as w, Copy as T, FileDiff as te, Globe2 as ne, LoaderCircle as E, Paperclip as D, RefreshCcw as O, RefreshCw as k, ShieldCheck as A, Sparkles as j, StopCircle as M, ThumbsDown as N, ThumbsUp as P, Trash2 as F, WifiOff as I, Wrench as L, XCircle as R, ZapOff as z } from "lucide-react";
|
|
10
|
+
import { Fragment as B, jsx as V, jsxs as H } from "react/jsx-runtime";
|
|
11
11
|
//#region src/utils/parse-unified-diff.ts
|
|
12
|
-
var
|
|
13
|
-
function
|
|
12
|
+
var U = /^diff --git "?a\/(.+?)"? "?b\/(.+?)"?$/;
|
|
13
|
+
function W(e) {
|
|
14
14
|
let t = [], n = /* @__PURE__ */ new Map(), r = null;
|
|
15
15
|
for (let i of e.split("\n")) {
|
|
16
|
-
let e = i.match(
|
|
16
|
+
let e = i.match(U);
|
|
17
17
|
if (e) {
|
|
18
18
|
let a = e[2], o = n.get(a);
|
|
19
19
|
if (o) {
|
|
@@ -31,7 +31,7 @@ function K(e) {
|
|
|
31
31
|
}
|
|
32
32
|
return t;
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function G(e) {
|
|
35
35
|
let t = 0, n = 0;
|
|
36
36
|
for (let r of e.lines) r.startsWith("+") && !r.startsWith("+++") ? t += 1 : r.startsWith("-") && !r.startsWith("---") && (n += 1);
|
|
37
37
|
return {
|
|
@@ -39,286 +39,243 @@ function q(e) {
|
|
|
39
39
|
removed: n
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function K(e) {
|
|
43
43
|
return /^diff --git /m.test(e);
|
|
44
44
|
}
|
|
45
45
|
//#endregion
|
|
46
46
|
//#region src/components/chat/InteractionHistoryAnchor.tsx
|
|
47
|
-
function
|
|
47
|
+
function q(e) {
|
|
48
48
|
if (!e) return "";
|
|
49
49
|
let t = Date.parse(e);
|
|
50
50
|
return Number.isFinite(t) ? new Date(t).toLocaleString() : e;
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function J(e) {
|
|
53
53
|
let t = e?.properties;
|
|
54
54
|
return typeof t != "object" || !t ? [] : Object.keys(t);
|
|
55
55
|
}
|
|
56
|
-
function
|
|
56
|
+
function Y({ interaction: e }) {
|
|
57
57
|
if (e.outcome === "cancelled" || e.status === "cancelled") return null;
|
|
58
|
-
let t = e.status === "resolved" || e.status === "expired", n =
|
|
59
|
-
return /* @__PURE__ */
|
|
58
|
+
let t = e.status === "resolved" || e.status === "expired", n = J(e.requestSchema);
|
|
59
|
+
return /* @__PURE__ */ H("div", {
|
|
60
60
|
"data-testid": "interaction-history-anchor",
|
|
61
61
|
"data-interaction-id": e.interactionId,
|
|
62
62
|
"data-interaction-status": e.status,
|
|
63
63
|
className: "mt-2 rounded-lg border border-border bg-muted/55 px-3 py-2 text-xs text-text-secondary",
|
|
64
|
-
children: [/* @__PURE__ */
|
|
64
|
+
children: [/* @__PURE__ */ H("div", {
|
|
65
65
|
className: "flex flex-wrap items-center gap-2",
|
|
66
|
-
children: [/* @__PURE__ */
|
|
66
|
+
children: [/* @__PURE__ */ V("span", {
|
|
67
67
|
className: "font-medium text-text-primary",
|
|
68
68
|
children: e.title
|
|
69
|
-
}), /* @__PURE__ */
|
|
70
|
-
}), t ? /* @__PURE__ */
|
|
69
|
+
}), /* @__PURE__ */ V(s, { outcome: e.outcome || e.status })]
|
|
70
|
+
}), t ? /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ H("div", {
|
|
71
71
|
className: "mt-1 leading-relaxed",
|
|
72
72
|
children: [
|
|
73
|
-
e.actor ? /* @__PURE__ */
|
|
73
|
+
e.actor ? /* @__PURE__ */ H("span", { children: [
|
|
74
74
|
"操作人:",
|
|
75
75
|
e.actor,
|
|
76
76
|
" · "
|
|
77
77
|
] }) : null,
|
|
78
|
-
e.resolvedAt ? /* @__PURE__ */
|
|
78
|
+
e.resolvedAt ? /* @__PURE__ */ H("span", { children: [
|
|
79
79
|
"决定时间:",
|
|
80
|
-
|
|
80
|
+
q(e.resolvedAt),
|
|
81
81
|
" · "
|
|
82
82
|
] }) : null,
|
|
83
|
-
/* @__PURE__ */
|
|
83
|
+
/* @__PURE__ */ V("span", {
|
|
84
84
|
"data-testid": "interaction-history-response-summary",
|
|
85
85
|
children: e.responseSummary || "响应内容已脱敏"
|
|
86
86
|
})
|
|
87
87
|
]
|
|
88
|
-
}), /* @__PURE__ */
|
|
88
|
+
}), /* @__PURE__ */ H("details", {
|
|
89
89
|
"data-testid": "interaction-history-detail",
|
|
90
90
|
className: "mt-1",
|
|
91
|
-
children: [/* @__PURE__ */
|
|
91
|
+
children: [/* @__PURE__ */ V("summary", {
|
|
92
92
|
className: "cursor-pointer select-none text-text-muted hover:text-text-primary",
|
|
93
93
|
children: "查看确认快照"
|
|
94
|
-
}), /* @__PURE__ */
|
|
94
|
+
}), /* @__PURE__ */ H("div", {
|
|
95
95
|
"data-testid": "interaction-history-snapshot",
|
|
96
96
|
className: "mt-1 rounded border border-border bg-card px-2 py-1.5 leading-relaxed text-card-foreground",
|
|
97
97
|
children: [
|
|
98
|
-
/* @__PURE__ */
|
|
98
|
+
/* @__PURE__ */ H("div", { children: ["操作者:", /* @__PURE__ */ V("span", {
|
|
99
99
|
"data-testid": "interaction-history-actor-ref",
|
|
100
100
|
children: e.actor || "—"
|
|
101
101
|
})] }),
|
|
102
|
-
/* @__PURE__ */
|
|
103
|
-
/* @__PURE__ */
|
|
102
|
+
/* @__PURE__ */ H("div", { children: ["决定时间:", q(e.resolvedAt) || "—"] }),
|
|
103
|
+
/* @__PURE__ */ H("div", { children: ["关键参数:", n.length > 0 ? /* @__PURE__ */ V("span", {
|
|
104
104
|
"data-testid": "interaction-history-schema-keys",
|
|
105
105
|
children: n.join("、")
|
|
106
|
-
}) : /* @__PURE__ */
|
|
106
|
+
}) : /* @__PURE__ */ V("span", { children: "无结构化参数" })] })
|
|
107
107
|
]
|
|
108
108
|
})]
|
|
109
|
-
})] }) : /* @__PURE__ */
|
|
109
|
+
})] }) : /* @__PURE__ */ H("div", {
|
|
110
110
|
className: "mt-1",
|
|
111
111
|
children: ["状态:", e.status === "pending" ? "待处理(见输入区确认面板)" : "处理中…"]
|
|
112
112
|
})]
|
|
113
113
|
});
|
|
114
114
|
}
|
|
115
115
|
//#endregion
|
|
116
|
+
//#region src/components/chat/approval-status.ts
|
|
117
|
+
function X(e) {
|
|
118
|
+
if (e?.status === "cancelled" || e?.status === "expired" || e?.outcome === "cancelled" || e?.outcome === "expired") return "cancelled";
|
|
119
|
+
if (e?.outcome === "approved" || e?.outcome === "rejected") return e.outcome;
|
|
120
|
+
}
|
|
121
|
+
//#endregion
|
|
116
122
|
//#region src/components/chat/ProcessingBlocksView.tsx
|
|
117
|
-
function
|
|
123
|
+
function Z({ summary: e, children: t, defaultOpen: n = !1, streaming: r = !1 }) {
|
|
118
124
|
let [a, o] = S(n);
|
|
119
|
-
return /* @__PURE__ */
|
|
125
|
+
return /* @__PURE__ */ H("div", {
|
|
120
126
|
className: "mb-1.5",
|
|
121
|
-
children: [/* @__PURE__ */
|
|
127
|
+
children: [/* @__PURE__ */ H("button", {
|
|
122
128
|
type: "button",
|
|
123
129
|
onClick: () => o((e) => !e),
|
|
124
130
|
className: "flex w-full items-center gap-1.5 rounded px-1 py-1 text-left text-[13px] text-slate-500 transition-colors hover:bg-slate-100/70 dark:text-slate-400 dark:hover:bg-slate-800/40",
|
|
125
|
-
children: [r ? /* @__PURE__ */
|
|
131
|
+
children: [r ? /* @__PURE__ */ V(E, { className: "h-3.5 w-3.5 animate-spin text-slate-400" }) : /* @__PURE__ */ V(w, { className: i("h-3.5 w-3.5 text-slate-400 transition-transform", a && "rotate-90") }), /* @__PURE__ */ V("span", {
|
|
126
132
|
className: "min-w-0 flex-1 truncate",
|
|
127
133
|
children: e
|
|
128
134
|
})]
|
|
129
|
-
}), a && /* @__PURE__ */
|
|
135
|
+
}), a && /* @__PURE__ */ V("div", {
|
|
130
136
|
className: "mt-1.5 border-l border-slate-200 pl-3.5 dark:border-slate-700/60",
|
|
131
137
|
children: t
|
|
132
138
|
})]
|
|
133
139
|
});
|
|
134
140
|
}
|
|
135
|
-
function
|
|
141
|
+
function Q({ block: e }) {
|
|
136
142
|
let [t, n] = S(!1), r = e.status === "streaming", a = e.content.length, o = `${e.id}-thinking-detail`;
|
|
137
|
-
return /* @__PURE__ */
|
|
143
|
+
return /* @__PURE__ */ H("div", {
|
|
138
144
|
className: "mb-1.5 min-w-0",
|
|
139
|
-
children: [/* @__PURE__ */
|
|
145
|
+
children: [/* @__PURE__ */ H("button", {
|
|
140
146
|
type: "button",
|
|
141
147
|
"aria-expanded": t,
|
|
142
148
|
"aria-controls": o,
|
|
143
149
|
onClick: () => n((e) => !e),
|
|
144
150
|
className: "inline-flex max-w-full items-center gap-1.5 rounded px-1 py-1 text-left text-[13px] leading-5 text-slate-400 transition-colors hover:text-slate-600 dark:text-slate-500 dark:hover:text-slate-300",
|
|
145
151
|
children: [
|
|
146
|
-
!r && /* @__PURE__ */
|
|
147
|
-
/* @__PURE__ */
|
|
152
|
+
!r && /* @__PURE__ */ V(j, { className: "h-3.5 w-3.5 shrink-0" }),
|
|
153
|
+
/* @__PURE__ */ V("span", {
|
|
148
154
|
className: i("min-w-0 truncate", r && "waiting-thinking-text"),
|
|
149
155
|
"data-testid": r ? "thinking-indicator" : void 0,
|
|
150
156
|
role: r ? "status" : void 0,
|
|
151
157
|
children: r ? "正在思考…" : "已思考"
|
|
152
158
|
}),
|
|
153
|
-
!r && /* @__PURE__ */
|
|
159
|
+
!r && /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("span", {
|
|
154
160
|
className: "text-slate-300 dark:text-slate-600",
|
|
155
161
|
children: "·"
|
|
156
|
-
}), /* @__PURE__ */
|
|
162
|
+
}), /* @__PURE__ */ H("span", {
|
|
157
163
|
className: "font-mono text-xs text-slate-400 dark:text-slate-500",
|
|
158
164
|
children: [a, " 字"]
|
|
159
165
|
})] }),
|
|
160
|
-
/* @__PURE__ */
|
|
166
|
+
/* @__PURE__ */ V(w, { className: i("h-3.5 w-3.5 shrink-0 transition-transform", t && "rotate-180") })
|
|
161
167
|
]
|
|
162
|
-
}), t && e.content && /* @__PURE__ */
|
|
168
|
+
}), t && e.content && /* @__PURE__ */ V("div", {
|
|
163
169
|
id: o,
|
|
164
170
|
className: "custom-scrollbar mt-1.5 max-h-[min(46vh,28rem)] overflow-y-auto border-l border-slate-200/80 pl-3.5 text-[12px] leading-5 text-slate-500 dark:border-slate-700/60 dark:text-slate-400 [&_h1]:!mb-2 [&_h1]:!mt-3 [&_h1]:!text-[13px] [&_h2]:!mb-1.5 [&_h2]:!mt-3 [&_h2]:!text-[12px] [&_h3]:!mb-1 [&_h3]:!mt-2.5 [&_h3]:!text-[12px] [&_li]:!text-[12px] [&_li]:!leading-5 [&_p]:!my-1.5 [&_p]:!text-[12px] [&_p]:!leading-5 [&_p]:!text-slate-500 dark:[&_p]:!text-slate-400 [&_pre]:!my-1.5",
|
|
165
|
-
children: /* @__PURE__ */
|
|
171
|
+
children: /* @__PURE__ */ V(m, { content: e.content })
|
|
166
172
|
})]
|
|
167
173
|
});
|
|
168
174
|
}
|
|
169
|
-
function
|
|
170
|
-
let
|
|
171
|
-
return /* @__PURE__ */
|
|
172
|
-
streaming:
|
|
173
|
-
defaultOpen:
|
|
174
|
-
summary: /* @__PURE__ */
|
|
175
|
+
function re({ block: e, tool: t, interactionRecord: n }) {
|
|
176
|
+
let r = t?.status ?? e.status, a = t?.args ?? e.args, o = t?.output ?? e.output, s = e.extra || {}, c = X(n) || s.approvalStatus || t?.approvalStatus, l = s.approvalRequestId || t?.approvalRequestId, u = r === "running", d = String(s.summary ?? t?.summary ?? "").trim(), f = Number(s.durationMs ?? t?.durationMs), p = c === "cancelled" || c === "rejected", m = r === "error" && !p, h = r === "paused", g = r === "unknown" ? "状态未知" : m ? "执行失败" : c === "pending" ? "等待确认" : c === "rejected" ? "已拒绝" : c === "cancelled" ? "已取消" : u ? c === "approved" ? "已授权 · 执行中" : "正在运行" : c === "approved" ? "已授权" : h ? "已暂停" : "已完成", _ = m ? "text-rose-500 dark:text-rose-400" : h ? "text-amber-500 dark:text-amber-400" : u ? "text-slate-500 dark:text-slate-400" : "text-slate-400 dark:text-slate-500";
|
|
177
|
+
return /* @__PURE__ */ V(Z, {
|
|
178
|
+
streaming: u && !a,
|
|
179
|
+
defaultOpen: c === "pending" || h,
|
|
180
|
+
summary: /* @__PURE__ */ H("span", {
|
|
175
181
|
className: "flex items-center gap-1.5",
|
|
176
182
|
children: [
|
|
177
|
-
/* @__PURE__ */
|
|
178
|
-
/* @__PURE__ */
|
|
179
|
-
className:
|
|
180
|
-
children:
|
|
183
|
+
/* @__PURE__ */ V(L, { className: i("h-3.5 w-3.5 shrink-0", _) }),
|
|
184
|
+
/* @__PURE__ */ V("span", {
|
|
185
|
+
className: _,
|
|
186
|
+
children: g
|
|
181
187
|
}),
|
|
182
|
-
/* @__PURE__ */
|
|
188
|
+
/* @__PURE__ */ V("span", {
|
|
183
189
|
className: "truncate font-medium text-slate-600 dark:text-slate-300",
|
|
184
190
|
children: e.toolName
|
|
185
191
|
}),
|
|
186
|
-
|
|
192
|
+
d ? /* @__PURE__ */ H("span", {
|
|
187
193
|
className: "truncate text-slate-400 dark:text-slate-500",
|
|
188
|
-
children: ["· ",
|
|
194
|
+
children: ["· ", d]
|
|
189
195
|
}) : null,
|
|
190
|
-
Number.isFinite(
|
|
196
|
+
Number.isFinite(f) && f >= 0 ? /* @__PURE__ */ H("span", {
|
|
191
197
|
className: "shrink-0 font-mono text-[11px] text-slate-400 dark:text-slate-500",
|
|
192
|
-
children: ["· ",
|
|
198
|
+
children: ["· ", ce(f)]
|
|
193
199
|
}) : null,
|
|
194
|
-
|
|
200
|
+
u && a && /* @__PURE__ */ V("span", {
|
|
195
201
|
className: "ml-0.5 animate-pulse text-slate-400",
|
|
196
202
|
children: "…"
|
|
197
203
|
})
|
|
198
204
|
]
|
|
199
205
|
}),
|
|
200
|
-
children: /* @__PURE__ */
|
|
206
|
+
children: /* @__PURE__ */ H("div", {
|
|
201
207
|
className: "flex flex-col gap-2.5 py-1 text-[13px]",
|
|
202
208
|
children: [
|
|
203
|
-
|
|
204
|
-
"data-slot": "tool-approval-
|
|
205
|
-
className: "flex flex-wrap items-center gap-x-3 gap-y-2 rounded-lg border border-[var(--ksadk-approval-border)] bg-[var(--ksadk-approval-background)] px-2.5 py-2 font-sans text-[12px] text-[var(--ksadk-approval-foreground)] shadow-[0_1px_2px_rgba(15,23,42,0.03)]",
|
|
206
|
-
children: [/* @__PURE__ */ W("div", {
|
|
207
|
-
className: "flex min-w-0 flex-1 items-center gap-2",
|
|
208
|
-
children: [
|
|
209
|
-
/* @__PURE__ */ U("span", {
|
|
210
|
-
className: "h-1.5 w-1.5 shrink-0 rounded-full bg-[var(--ksadk-approval-foreground)]",
|
|
211
|
-
"aria-hidden": "true"
|
|
212
|
-
}),
|
|
213
|
-
/* @__PURE__ */ U("span", {
|
|
214
|
-
className: "shrink-0 font-medium",
|
|
215
|
-
children: "需要确认"
|
|
216
|
-
}),
|
|
217
|
-
/* @__PURE__ */ U("span", {
|
|
218
|
-
className: "min-w-0 truncate opacity-75",
|
|
219
|
-
children: p || "允许后将执行此工具调用。"
|
|
220
|
-
})
|
|
221
|
-
]
|
|
222
|
-
}), /* @__PURE__ */ W("div", {
|
|
223
|
-
className: "flex shrink-0 items-center gap-1.5",
|
|
224
|
-
children: [/* @__PURE__ */ U("button", {
|
|
225
|
-
type: "button",
|
|
226
|
-
disabled: n,
|
|
227
|
-
onClick: () => m === "ag-ui" ? o?.({
|
|
228
|
-
interruptId: f || "",
|
|
229
|
-
approve: !0
|
|
230
|
-
}) : a?.({
|
|
231
|
-
approvalRequestId: f || "",
|
|
232
|
-
approve: !0,
|
|
233
|
-
previousResponseId: h
|
|
234
|
-
}),
|
|
235
|
-
className: "inline-flex h-7 items-center rounded-md bg-primary px-2.5 text-[12px] font-medium text-primary-foreground transition hover:bg-primary/90 disabled:opacity-55",
|
|
236
|
-
children: "允许执行"
|
|
237
|
-
}), /* @__PURE__ */ U("button", {
|
|
238
|
-
type: "button",
|
|
239
|
-
disabled: n,
|
|
240
|
-
onClick: () => m === "ag-ui" ? o?.({
|
|
241
|
-
interruptId: f || "",
|
|
242
|
-
approve: !1
|
|
243
|
-
}) : a?.({
|
|
244
|
-
approvalRequestId: f || "",
|
|
245
|
-
approve: !1,
|
|
246
|
-
previousResponseId: h
|
|
247
|
-
}),
|
|
248
|
-
className: "inline-flex h-7 items-center rounded-md px-2 text-[12px] font-medium text-slate-500 transition hover:bg-slate-100 hover:text-rose-600 disabled:opacity-55 dark:text-slate-400 dark:hover:bg-slate-800",
|
|
249
|
-
children: "拒绝"
|
|
250
|
-
})]
|
|
251
|
-
})]
|
|
252
|
-
}),
|
|
253
|
-
f && d === "pending" && r ? /* @__PURE__ */ W("div", {
|
|
209
|
+
l && c === "pending" ? /* @__PURE__ */ H("div", {
|
|
210
|
+
"data-slot": "tool-approval-status",
|
|
254
211
|
className: "flex items-center gap-1.5 font-sans text-xs text-slate-500 dark:text-slate-400",
|
|
255
|
-
children: [/* @__PURE__ */
|
|
212
|
+
children: [/* @__PURE__ */ V("span", {
|
|
256
213
|
className: "h-1.5 w-1.5 shrink-0 rounded-full bg-amber-400",
|
|
257
214
|
"aria-hidden": "true"
|
|
258
215
|
}), "请在输入区确认面板中操作。"]
|
|
259
216
|
}) : null,
|
|
260
|
-
|
|
217
|
+
l && c && c !== "pending" && /* @__PURE__ */ H("div", {
|
|
261
218
|
className: "flex items-center gap-1.5 font-sans text-xs text-slate-500 dark:text-slate-400",
|
|
262
219
|
children: [
|
|
263
|
-
/* @__PURE__ */
|
|
264
|
-
|
|
265
|
-
|
|
220
|
+
/* @__PURE__ */ V("span", { children: c === "approved" ? "已授权" : c === "cancelled" ? "已取消" : "已拒绝" }),
|
|
221
|
+
c === "approved" && u ? /* @__PURE__ */ V("span", { children: "· 工具执行中" }) : null,
|
|
222
|
+
c === "approved" && m ? /* @__PURE__ */ V("span", { children: "· 工具执行失败" }) : null
|
|
266
223
|
]
|
|
267
224
|
}),
|
|
268
|
-
|
|
225
|
+
a ? /* @__PURE__ */ V(le, {
|
|
269
226
|
label: "入参",
|
|
270
|
-
value:
|
|
227
|
+
value: a,
|
|
271
228
|
tone: "input"
|
|
272
229
|
}) : null,
|
|
273
|
-
|
|
230
|
+
o && !p ? ie(e.toolName, o, m) : null
|
|
274
231
|
]
|
|
275
232
|
})
|
|
276
233
|
});
|
|
277
234
|
}
|
|
278
|
-
function
|
|
279
|
-
if (
|
|
235
|
+
function ie(e, t, n) {
|
|
236
|
+
if (K(t)) return /* @__PURE__ */ V(ae, { output: t });
|
|
280
237
|
let r = e.toLowerCase();
|
|
281
238
|
if (r.includes("web_search") || r.includes("search")) {
|
|
282
|
-
let e =
|
|
283
|
-
if (e.length > 0) return /* @__PURE__ */
|
|
239
|
+
let e = oe(t);
|
|
240
|
+
if (e.length > 0) return /* @__PURE__ */ V($, { sources: e });
|
|
284
241
|
}
|
|
285
|
-
return /* @__PURE__ */
|
|
242
|
+
return /* @__PURE__ */ V(le, {
|
|
286
243
|
label: "输出",
|
|
287
244
|
value: t,
|
|
288
245
|
tone: n ? "error" : "output"
|
|
289
246
|
});
|
|
290
247
|
}
|
|
291
|
-
function
|
|
292
|
-
let t =
|
|
293
|
-
return /* @__PURE__ */
|
|
248
|
+
function ae({ output: e }) {
|
|
249
|
+
let t = W(e), [n, r] = S(!1), i = n ? t : t.slice(0, 3);
|
|
250
|
+
return /* @__PURE__ */ H("div", {
|
|
294
251
|
className: "my-2 overflow-hidden rounded-xl border border-border bg-background",
|
|
295
252
|
children: [
|
|
296
|
-
/* @__PURE__ */
|
|
253
|
+
/* @__PURE__ */ H("div", {
|
|
297
254
|
className: "flex items-center gap-1.5 border-b border-border px-3 py-2 text-xs font-medium text-text-secondary",
|
|
298
|
-
children: [/* @__PURE__ */
|
|
255
|
+
children: [/* @__PURE__ */ V(te, { className: "h-3.5 w-3.5 text-primary" }), /* @__PURE__ */ H("span", { children: [
|
|
299
256
|
"改动 ",
|
|
300
257
|
t.length,
|
|
301
258
|
" 个文件"
|
|
302
259
|
] })]
|
|
303
260
|
}),
|
|
304
|
-
/* @__PURE__ */
|
|
261
|
+
/* @__PURE__ */ V("div", {
|
|
305
262
|
className: "flex flex-col",
|
|
306
263
|
children: i.map((e) => {
|
|
307
|
-
let { added: t, removed: n } =
|
|
308
|
-
return /* @__PURE__ */
|
|
264
|
+
let { added: t, removed: n } = G(e);
|
|
265
|
+
return /* @__PURE__ */ H("div", {
|
|
309
266
|
className: "group/file-change-row flex min-w-0 items-center gap-2 px-3 py-2 text-sm transition-colors hover:bg-muted",
|
|
310
|
-
children: [/* @__PURE__ */
|
|
267
|
+
children: [/* @__PURE__ */ V("span", {
|
|
311
268
|
className: "min-w-0 flex-1 truncate font-mono text-[13px] text-text-primary",
|
|
312
269
|
children: e.path
|
|
313
|
-
}), /* @__PURE__ */
|
|
270
|
+
}), /* @__PURE__ */ H("span", {
|
|
314
271
|
className: "flex-shrink-0 text-[11px] font-mono",
|
|
315
272
|
children: [
|
|
316
|
-
/* @__PURE__ */
|
|
273
|
+
/* @__PURE__ */ H("span", {
|
|
317
274
|
className: "text-emerald-600",
|
|
318
275
|
children: ["+", t]
|
|
319
276
|
}),
|
|
320
277
|
" ",
|
|
321
|
-
/* @__PURE__ */
|
|
278
|
+
/* @__PURE__ */ H("span", {
|
|
322
279
|
className: "text-rose-500",
|
|
323
280
|
children: ["−", n]
|
|
324
281
|
})
|
|
@@ -327,7 +284,7 @@ function ie({ output: e }) {
|
|
|
327
284
|
}, e.path);
|
|
328
285
|
})
|
|
329
286
|
}),
|
|
330
|
-
t.length > 3 ? /* @__PURE__ */
|
|
287
|
+
t.length > 3 ? /* @__PURE__ */ V("button", {
|
|
331
288
|
type: "button",
|
|
332
289
|
onClick: () => r((e) => !e),
|
|
333
290
|
className: "flex w-full items-center justify-center gap-1 border-t border-border py-1.5 text-xs text-text-muted transition hover:bg-muted hover:text-text-primary",
|
|
@@ -336,7 +293,7 @@ function ie({ output: e }) {
|
|
|
336
293
|
]
|
|
337
294
|
});
|
|
338
295
|
}
|
|
339
|
-
function
|
|
296
|
+
function oe(e) {
|
|
340
297
|
try {
|
|
341
298
|
let t = JSON.parse(e), n = Array.isArray(t) ? t : t?.results ?? t?.sources ?? [];
|
|
342
299
|
return Array.isArray(n) ? n.map((e) => {
|
|
@@ -357,33 +314,33 @@ function $(e) {
|
|
|
357
314
|
return [];
|
|
358
315
|
}
|
|
359
316
|
}
|
|
360
|
-
function
|
|
361
|
-
return /* @__PURE__ */
|
|
317
|
+
function $({ sources: e }) {
|
|
318
|
+
return /* @__PURE__ */ V("div", {
|
|
362
319
|
className: "mt-2 flex min-w-0",
|
|
363
|
-
children: /* @__PURE__ */
|
|
320
|
+
children: /* @__PURE__ */ H("span", {
|
|
364
321
|
className: "group/web-search-sources relative inline-flex min-w-0",
|
|
365
|
-
children: [/* @__PURE__ */
|
|
322
|
+
children: [/* @__PURE__ */ H("button", {
|
|
366
323
|
type: "button",
|
|
367
324
|
className: "inline-flex h-7 min-w-0 items-center gap-1.5 rounded-md border border-border bg-surface px-2 text-xs text-text-secondary transition-colors hover:bg-muted hover:text-text-primary",
|
|
368
|
-
children: [/* @__PURE__ */
|
|
325
|
+
children: [/* @__PURE__ */ V(ne, {
|
|
369
326
|
className: "h-3.5 w-3.5 shrink-0",
|
|
370
327
|
strokeWidth: 1.7
|
|
371
|
-
}), /* @__PURE__ */
|
|
372
|
-
}), /* @__PURE__ */
|
|
328
|
+
}), /* @__PURE__ */ H("span", { children: ["来源 · ", e.length] })]
|
|
329
|
+
}), /* @__PURE__ */ V("span", {
|
|
373
330
|
className: "absolute bottom-full left-0 z-30 hidden max-w-[calc(100vw-3rem)] pb-1 group-hover/web-search-sources:block",
|
|
374
|
-
children: /* @__PURE__ */
|
|
331
|
+
children: /* @__PURE__ */ V("span", {
|
|
375
332
|
className: "block w-[min(26rem,calc(100vw-3rem))] rounded-xl border border-border bg-popover p-2 text-left text-text-primary shadow-2xl",
|
|
376
|
-
children: /* @__PURE__ */
|
|
333
|
+
children: /* @__PURE__ */ V("span", {
|
|
377
334
|
className: "flex min-w-0 flex-col gap-1",
|
|
378
|
-
children: e.map((e, t) => /* @__PURE__ */
|
|
335
|
+
children: e.map((e, t) => /* @__PURE__ */ H("a", {
|
|
379
336
|
href: e.url,
|
|
380
337
|
target: "_blank",
|
|
381
338
|
rel: "noopener noreferrer",
|
|
382
339
|
className: "flex min-w-0 items-center gap-2 rounded-lg px-2 py-1.5 text-sm leading-5 text-text-secondary transition-colors hover:bg-muted hover:text-text-primary",
|
|
383
|
-
children: [/* @__PURE__ */
|
|
340
|
+
children: [/* @__PURE__ */ V(ne, {
|
|
384
341
|
className: "h-3.5 w-3.5 shrink-0",
|
|
385
342
|
strokeWidth: 1.7
|
|
386
|
-
}), /* @__PURE__ */
|
|
343
|
+
}), /* @__PURE__ */ V("span", {
|
|
387
344
|
className: "min-w-0 flex-1 truncate",
|
|
388
345
|
children: e.title
|
|
389
346
|
})]
|
|
@@ -394,20 +351,20 @@ function ae({ sources: e }) {
|
|
|
394
351
|
})
|
|
395
352
|
});
|
|
396
353
|
}
|
|
397
|
-
var
|
|
398
|
-
function
|
|
354
|
+
var se = 12e3;
|
|
355
|
+
function ce(e) {
|
|
399
356
|
return e < 1e3 ? `${Math.round(e)}ms` : `${(e / 1e3).toFixed(1)}s`;
|
|
400
357
|
}
|
|
401
|
-
function
|
|
402
|
-
let [r, a] = S(!1), o = n.length >
|
|
403
|
-
return /* @__PURE__ */
|
|
404
|
-
/* @__PURE__ */
|
|
358
|
+
function le({ label: e, tone: t, value: n }) {
|
|
359
|
+
let [r, a] = S(!1), o = n.length > se, s = o && !r ? n.slice(0, se) : n;
|
|
360
|
+
return /* @__PURE__ */ H("div", { children: [
|
|
361
|
+
/* @__PURE__ */ V("div", {
|
|
405
362
|
className: "mb-1 text-[11px] font-semibold uppercase tracking-wide text-slate-400",
|
|
406
363
|
children: e
|
|
407
364
|
}),
|
|
408
|
-
/* @__PURE__ */
|
|
365
|
+
/* @__PURE__ */ V("pre", {
|
|
409
366
|
className: i("custom-scrollbar max-h-60 overflow-auto rounded-lg px-3 py-2 text-[12.5px] leading-relaxed whitespace-pre-wrap break-all", t === "error" ? "bg-rose-50/60 text-rose-700 dark:bg-rose-950/20 dark:text-rose-200" : t === "output" ? "bg-emerald-50/40 text-emerald-800 dark:bg-emerald-950/20 dark:text-emerald-200" : "bg-slate-50 text-slate-700 dark:bg-slate-900/40 dark:text-slate-200"),
|
|
410
|
-
children: f(s).map((e, t) => e.type === "text" ? /* @__PURE__ */
|
|
367
|
+
children: f(s).map((e, t) => e.type === "text" ? /* @__PURE__ */ V("span", { children: e.value }, t) : /* @__PURE__ */ V("a", {
|
|
411
368
|
href: "#",
|
|
412
369
|
style: {
|
|
413
370
|
textDecoration: "underline",
|
|
@@ -421,90 +378,193 @@ function ce({ label: e, tone: t, value: n }) {
|
|
|
421
378
|
children: e.value
|
|
422
379
|
}, t))
|
|
423
380
|
}),
|
|
424
|
-
o ? /* @__PURE__ */
|
|
381
|
+
o ? /* @__PURE__ */ V("button", {
|
|
425
382
|
type: "button",
|
|
426
383
|
onClick: () => a((e) => !e),
|
|
427
384
|
className: "mt-1 text-xs text-primary hover:underline",
|
|
428
385
|
"aria-expanded": r,
|
|
429
|
-
children: r ? "收起完整日志" : `查看完整日志(已显示前 ${
|
|
386
|
+
children: r ? "收起完整日志" : `查看完整日志(已显示前 ${se.toLocaleString()} 字符)`
|
|
430
387
|
}) : null
|
|
431
388
|
] });
|
|
432
389
|
}
|
|
433
|
-
function
|
|
434
|
-
return e.content ? /* @__PURE__ */
|
|
390
|
+
function ue({ block: e }) {
|
|
391
|
+
return e.content ? /* @__PURE__ */ V("div", {
|
|
435
392
|
className: "w-full break-words py-0.5 text-[14px] leading-[1.65]",
|
|
436
|
-
children: /* @__PURE__ */
|
|
393
|
+
children: /* @__PURE__ */ V(m, { content: e.content })
|
|
437
394
|
}) : null;
|
|
438
395
|
}
|
|
439
|
-
function
|
|
440
|
-
let
|
|
441
|
-
return /* @__PURE__ */
|
|
442
|
-
className: i("mb-3 min-w-0",
|
|
396
|
+
function de({ message: e, interactionRecords: t, className: n }) {
|
|
397
|
+
let r = e.blocks ?? [];
|
|
398
|
+
return /* @__PURE__ */ V("div", {
|
|
399
|
+
className: i("mb-3 min-w-0", n),
|
|
443
400
|
"data-slot": "processing-blocks",
|
|
444
|
-
children:
|
|
445
|
-
if (
|
|
446
|
-
if (
|
|
447
|
-
let
|
|
448
|
-
return /* @__PURE__ */
|
|
449
|
-
block:
|
|
450
|
-
tool:
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
onRespondToApproval: n,
|
|
454
|
-
onRespondToAguiApproval: r
|
|
455
|
-
}), l ? /* @__PURE__ */ U(Z, { interaction: l }) : null] }, i.id);
|
|
401
|
+
children: r.map((n) => {
|
|
402
|
+
if (n.type === "thinking") return /* @__PURE__ */ V(Q, { block: n }, n.id);
|
|
403
|
+
if (n.type === "tool") {
|
|
404
|
+
let r = n.extra || {}, i = e.tools?.[n.toolName] || Object.values(e.tools || {}).find((e) => r.approvalRequestId && e.approvalRequestId === r.approvalRequestId || r.callId && e.callId === r.callId), a = String(r.approvalRequestId || i?.approvalRequestId || ""), o = String(r.callId || r.call_id || ""), s = a ? t?.find((e) => e.interactionId === a) : o ? t?.find((e) => String(e.extensions.call_id || "") === o) : void 0;
|
|
405
|
+
return /* @__PURE__ */ H("div", { children: [/* @__PURE__ */ V(re, {
|
|
406
|
+
block: n,
|
|
407
|
+
tool: i,
|
|
408
|
+
interactionRecord: s
|
|
409
|
+
}), s ? /* @__PURE__ */ V(Y, { interaction: s }) : null] }, n.id);
|
|
456
410
|
}
|
|
457
|
-
return /* @__PURE__ */
|
|
411
|
+
return /* @__PURE__ */ V(ue, { block: n }, n.id);
|
|
458
412
|
})
|
|
459
413
|
});
|
|
460
414
|
}
|
|
461
415
|
//#endregion
|
|
416
|
+
//#region src/components/chat/AgentBlockView.tsx
|
|
417
|
+
var fe = {
|
|
418
|
+
submitted: "已提交",
|
|
419
|
+
working: "正在处理",
|
|
420
|
+
input_required: "等待输入",
|
|
421
|
+
completed: "已完成",
|
|
422
|
+
failed: "执行失败",
|
|
423
|
+
cancelled: "已取消"
|
|
424
|
+
};
|
|
425
|
+
function pe(e, t) {
|
|
426
|
+
if (typeof e != "number" || typeof t != "number" || !Number.isFinite(e) || !Number.isFinite(t) || e < 0 || t < e) return;
|
|
427
|
+
let n = Math.floor(t - e);
|
|
428
|
+
if (n < 60) return `${n} 秒`;
|
|
429
|
+
let r = Math.floor(n / 60);
|
|
430
|
+
return r < 60 ? `${r} 分 ${n % 60} 秒` : `${Math.floor(r / 60)} 小时 ${r % 60} 分`;
|
|
431
|
+
}
|
|
432
|
+
function me({ block: e, actions: t }) {
|
|
433
|
+
let [n, r] = S(!1), [i, a] = S("none"), o = x(!1), s = e.item.payload, c = s.agent, l = s.cancel, u = String(s.status || "submitted"), d = [
|
|
434
|
+
"submitted",
|
|
435
|
+
"working",
|
|
436
|
+
"input_required"
|
|
437
|
+
].includes(u), [f, p] = S(() => Date.now());
|
|
438
|
+
v(() => {
|
|
439
|
+
if (!d || typeof s.started_at != "number" || !Number.isFinite(s.started_at)) return;
|
|
440
|
+
let e = setInterval(() => p(Date.now()), 1e3);
|
|
441
|
+
return () => clearInterval(e);
|
|
442
|
+
}, [d, s.started_at]);
|
|
443
|
+
let h = pe(s.started_at, d ? f / 1e3 : s.ended_at), g = {
|
|
444
|
+
sessionId: e.item.sessionId,
|
|
445
|
+
runId: e.item.runId,
|
|
446
|
+
scopeId: String(s.scope_id),
|
|
447
|
+
parentItemId: e.item.parentItemId || ""
|
|
448
|
+
}, _ = l?.request_state && l.request_state !== "none" ? l.request_state : i === "none" ? t?.getCancelRequestState?.(g) || "none" : i, y = {
|
|
449
|
+
processing: "取消请求处理中",
|
|
450
|
+
cancel_requested: "取消请求处理中",
|
|
451
|
+
confirmed: "远程取消已确认",
|
|
452
|
+
local_confirmed: "已取消",
|
|
453
|
+
unknown: "取消结果未知",
|
|
454
|
+
unsupported: "不支持远程取消"
|
|
455
|
+
}, b = async () => {
|
|
456
|
+
if (!o.current) {
|
|
457
|
+
o.current = !0, a("processing");
|
|
458
|
+
try {
|
|
459
|
+
a(await t?.cancel?.(g) || "processing");
|
|
460
|
+
} catch {
|
|
461
|
+
a("unknown");
|
|
462
|
+
} finally {
|
|
463
|
+
o.current = !1;
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
};
|
|
467
|
+
return /* @__PURE__ */ H("section", {
|
|
468
|
+
"data-testid": "agent-block",
|
|
469
|
+
className: "mb-3 rounded border border-slate-200 p-3 dark:border-slate-700",
|
|
470
|
+
children: [
|
|
471
|
+
/* @__PURE__ */ H("button", {
|
|
472
|
+
type: "button",
|
|
473
|
+
"aria-expanded": n,
|
|
474
|
+
"aria-label": c?.name || "远程智能体",
|
|
475
|
+
onClick: () => r(!n),
|
|
476
|
+
className: "flex w-full items-center justify-between text-sm",
|
|
477
|
+
children: [/* @__PURE__ */ V("span", { children: c?.name || "远程智能体" }), /* @__PURE__ */ H("span", {
|
|
478
|
+
className: "flex items-center gap-2",
|
|
479
|
+
children: [h && /* @__PURE__ */ V("span", {
|
|
480
|
+
"data-testid": "agent-block-elapsed",
|
|
481
|
+
className: "text-xs text-slate-500",
|
|
482
|
+
"aria-label": `耗时 ${h}`,
|
|
483
|
+
children: h
|
|
484
|
+
}), /* @__PURE__ */ V("span", {
|
|
485
|
+
role: "status",
|
|
486
|
+
children: fe[u] || "状态未知"
|
|
487
|
+
})]
|
|
488
|
+
})]
|
|
489
|
+
}),
|
|
490
|
+
e.summary && /* @__PURE__ */ V("p", {
|
|
491
|
+
"data-testid": "agent-block-summary",
|
|
492
|
+
className: "mt-1 line-clamp-2 text-xs text-slate-500",
|
|
493
|
+
children: e.summary
|
|
494
|
+
}),
|
|
495
|
+
y[_] && /* @__PURE__ */ V("p", {
|
|
496
|
+
role: "status",
|
|
497
|
+
"data-testid": "agent-block-cancel-state",
|
|
498
|
+
className: "mt-1 text-xs text-slate-500",
|
|
499
|
+
children: y[_]
|
|
500
|
+
}),
|
|
501
|
+
n && /* @__PURE__ */ H("div", {
|
|
502
|
+
className: "mt-3 space-y-2",
|
|
503
|
+
"data-testid": "agent-block-detail",
|
|
504
|
+
children: [e.messages.map((e) => /* @__PURE__ */ H("div", { children: [e.blocks?.length ? /* @__PURE__ */ V(de, {
|
|
505
|
+
message: e,
|
|
506
|
+
isStreaming: d
|
|
507
|
+
}) : /* @__PURE__ */ V(m, { content: e.content }), e.attachments?.map((e) => /* @__PURE__ */ V("a", {
|
|
508
|
+
href: e.url,
|
|
509
|
+
rel: "noreferrer",
|
|
510
|
+
target: "_blank",
|
|
511
|
+
children: e.name
|
|
512
|
+
}, e.url))] }, e.id)), d && t?.cancel && l?.capability === "supported" && ["none", "unknown"].includes(_) && /* @__PURE__ */ V("button", {
|
|
513
|
+
type: "button",
|
|
514
|
+
onClick: () => void b(),
|
|
515
|
+
children: "取消远程智能体"
|
|
516
|
+
})]
|
|
517
|
+
})
|
|
518
|
+
]
|
|
519
|
+
});
|
|
520
|
+
}
|
|
521
|
+
//#endregion
|
|
462
522
|
//#region src/components/chat/StatusBanner.tsx
|
|
463
|
-
function
|
|
464
|
-
let
|
|
465
|
-
if (!
|
|
466
|
-
let
|
|
467
|
-
message:
|
|
468
|
-
retryAfterSec:
|
|
469
|
-
},
|
|
523
|
+
function he({ onRetry: t }) {
|
|
524
|
+
let r = n((e) => e.banner), a = e((e) => e.currentSessionId);
|
|
525
|
+
if (!r || r.sessionId && r.sessionId !== a) return null;
|
|
526
|
+
let o = r.kind === "rate_limited" ? /* @__PURE__ */ V(ge, {
|
|
527
|
+
message: r.message,
|
|
528
|
+
retryAfterSec: r.retryAfterSec
|
|
529
|
+
}, r.createdAt || `${r.sessionId || ""}:${r.retryAfterSec || 0}`) : null, s = {
|
|
470
530
|
rate_limited: {
|
|
471
|
-
icon: /* @__PURE__ */
|
|
531
|
+
icon: /* @__PURE__ */ V(z, { className: "h-4 w-4 text-neutral-500" }),
|
|
472
532
|
bg: "border-neutral-200/70 bg-neutral-50/70 dark:border-neutral-900/40 dark:bg-neutral-950/20",
|
|
473
533
|
text: "text-neutral-700 dark:text-neutral-200",
|
|
474
|
-
label:
|
|
534
|
+
label: o
|
|
475
535
|
},
|
|
476
536
|
network: {
|
|
477
|
-
icon: /* @__PURE__ */
|
|
537
|
+
icon: /* @__PURE__ */ V(E, { className: "h-4 w-4 animate-spin text-text-secondary" }),
|
|
478
538
|
bg: "border-border/70 bg-muted/60",
|
|
479
539
|
text: "text-text-secondary",
|
|
480
|
-
label:
|
|
540
|
+
label: r.message || "网络异常,正在重连…"
|
|
481
541
|
},
|
|
482
542
|
error: {
|
|
483
|
-
icon: /* @__PURE__ */
|
|
543
|
+
icon: /* @__PURE__ */ V(I, { className: "h-4 w-4 text-rose-500" }),
|
|
484
544
|
bg: "border-rose-200/70 bg-rose-50/70 dark:border-rose-900/40 dark:bg-rose-950/20",
|
|
485
545
|
text: "text-rose-600 dark:text-rose-300",
|
|
486
|
-
label:
|
|
546
|
+
label: r.message || "运行失败,请重试"
|
|
487
547
|
}
|
|
488
|
-
}[
|
|
489
|
-
return /* @__PURE__ */
|
|
490
|
-
className: i("mx-auto mb-3 flex w-full max-w-3xl items-center gap-2.5 rounded-xl border px-3.5 py-2.5 text-sm shadow-sm",
|
|
548
|
+
}[r.kind];
|
|
549
|
+
return /* @__PURE__ */ H("div", {
|
|
550
|
+
className: i("mx-auto mb-3 flex w-full max-w-3xl items-center gap-2.5 rounded-xl border px-3.5 py-2.5 text-sm shadow-sm", s.bg, s.text),
|
|
491
551
|
role: "status",
|
|
492
552
|
children: [
|
|
493
|
-
|
|
494
|
-
/* @__PURE__ */
|
|
553
|
+
s.icon,
|
|
554
|
+
/* @__PURE__ */ V("span", {
|
|
495
555
|
className: "min-w-0 flex-1 truncate",
|
|
496
|
-
children:
|
|
556
|
+
children: s.label
|
|
497
557
|
}),
|
|
498
|
-
|
|
558
|
+
r.kind === "error" && t ? /* @__PURE__ */ H("button", {
|
|
499
559
|
type: "button",
|
|
500
|
-
onClick:
|
|
560
|
+
onClick: t,
|
|
501
561
|
className: "flex items-center gap-1 rounded-full px-2.5 py-1 text-xs font-medium text-rose-600 transition hover:bg-rose-100 dark:text-rose-300 dark:hover:bg-rose-950/40",
|
|
502
|
-
children: [/* @__PURE__ */
|
|
562
|
+
children: [/* @__PURE__ */ V(k, { className: "h-3 w-3" }), "重试"]
|
|
503
563
|
}) : null
|
|
504
564
|
]
|
|
505
565
|
});
|
|
506
566
|
}
|
|
507
|
-
function
|
|
567
|
+
function ge({ message: e, retryAfterSec: t }) {
|
|
508
568
|
let [n, r] = S(t || 0);
|
|
509
569
|
return v(() => {
|
|
510
570
|
if (!t) return;
|
|
@@ -516,15 +576,15 @@ function fe({ message: e, retryAfterSec: t }) {
|
|
|
516
576
|
}
|
|
517
577
|
//#endregion
|
|
518
578
|
//#region src/utils/session-helpers.ts
|
|
519
|
-
function
|
|
579
|
+
function _e(e) {
|
|
520
580
|
return String(e.Title || "").trim() || String(e.FirstPrompt || "").trim() || String(e.LastPrompt || "").trim() || String(e.Summary || "").trim() || "新对话";
|
|
521
581
|
}
|
|
522
582
|
//#endregion
|
|
523
583
|
//#region src/utils/message-virtualization.js
|
|
524
|
-
function
|
|
584
|
+
function ve(e, t, n) {
|
|
525
585
|
return Math.max(t, Math.min(n, e));
|
|
526
586
|
}
|
|
527
|
-
function
|
|
587
|
+
function ye({ items: e = [], scrollTop: t = 0, viewportHeight: n = 0, overscan: r = 4, defaultItemHeight: i = 120, measuredHeights: a = /* @__PURE__ */ new Map(), getItemKey: o = (e, t) => e?.id || String(t) } = {}) {
|
|
528
588
|
let s = Math.max(0, Number(n) || 0), c = Math.max(0, Number(t) || 0), l = Math.max(0, Number(r) || 0), u = Math.max(1, Number(i) || 120);
|
|
529
589
|
if (!e.length) return {
|
|
530
590
|
startIndex: 0,
|
|
@@ -542,7 +602,7 @@ function he({ items: e = [], scrollTop: t = 0, viewportHeight: n = 0, overscan:
|
|
|
542
602
|
for (; g < e.length && f[g] + d[g] <= c;) g += 1;
|
|
543
603
|
let _ = g;
|
|
544
604
|
for (; _ < e.length && f[_] < h;) _ += 1;
|
|
545
|
-
return g =
|
|
605
|
+
return g = ve(g - l, 0, e.length), _ = ve(Math.max(g + 1, _ + l), 0, e.length), {
|
|
546
606
|
startIndex: g,
|
|
547
607
|
endIndex: _,
|
|
548
608
|
offsetTop: f[g] || 0,
|
|
@@ -558,33 +618,33 @@ function he({ items: e = [], scrollTop: t = 0, viewportHeight: n = 0, overscan:
|
|
|
558
618
|
})
|
|
559
619
|
};
|
|
560
620
|
}
|
|
561
|
-
function
|
|
621
|
+
function be({ scrollHeight: e, scrollTop: t, clientHeight: n }) {
|
|
562
622
|
return Math.max(0, e - t - n);
|
|
563
623
|
}
|
|
564
|
-
function
|
|
565
|
-
return e.scrollHeight > e.clientHeight + 1 &&
|
|
624
|
+
function xe(e) {
|
|
625
|
+
return e.scrollHeight > e.clientHeight + 1 && be(e) > 96;
|
|
566
626
|
}
|
|
567
627
|
//#endregion
|
|
568
628
|
//#region src/utils/chat-message-grouping.ts
|
|
569
|
-
function
|
|
629
|
+
function Se(e) {
|
|
570
630
|
return String(e?.runId || e?.invocationId || "").trim();
|
|
571
631
|
}
|
|
572
|
-
function
|
|
632
|
+
function Ce(e, t) {
|
|
573
633
|
if (e?.role !== "model" || t.role !== "model") return !1;
|
|
574
|
-
let n =
|
|
575
|
-
return !!(n && n ===
|
|
634
|
+
let n = Se(e);
|
|
635
|
+
return !!(n && n === Se(t));
|
|
576
636
|
}
|
|
577
637
|
//#endregion
|
|
578
638
|
//#region src/components/chat/ChatMessageList.tsx
|
|
579
|
-
var
|
|
580
|
-
function
|
|
639
|
+
var we = 140, Te = 4;
|
|
640
|
+
function Ee(e) {
|
|
581
641
|
let t = String(e || "").trim().toLowerCase();
|
|
582
642
|
return t === "elevated" ? "高风险" : t === "always" ? "始终确认" : t === "confirm" ? "需确认" : e || "";
|
|
583
643
|
}
|
|
584
|
-
function
|
|
644
|
+
function De(e) {
|
|
585
645
|
return String(e || "").trim().toLowerCase() === "elevated" ? "border-[var(--ksadk-approval-elevated-border)] bg-[var(--ksadk-approval-elevated-background)] text-[var(--ksadk-approval-elevated-foreground)]" : "border-[var(--ksadk-approval-border)] bg-[var(--ksadk-approval-background)] text-[var(--ksadk-approval-foreground)]";
|
|
586
646
|
}
|
|
587
|
-
function
|
|
647
|
+
function Oe({ messageId: e, top: t, onMeasure: n, children: r, highlighted: i }) {
|
|
588
648
|
let a = x(null);
|
|
589
649
|
return y(() => {
|
|
590
650
|
let r = a.current;
|
|
@@ -597,7 +657,7 @@ function we({ messageId: e, top: t, onMeasure: n, children: r, highlighted: i })
|
|
|
597
657
|
e,
|
|
598
658
|
n,
|
|
599
659
|
t
|
|
600
|
-
]), /* @__PURE__ */
|
|
660
|
+
]), /* @__PURE__ */ V("div", {
|
|
601
661
|
ref: a,
|
|
602
662
|
"data-message-id": e,
|
|
603
663
|
"data-search-target": i || void 0,
|
|
@@ -611,19 +671,19 @@ function we({ messageId: e, top: t, onMeasure: n, children: r, highlighted: i })
|
|
|
611
671
|
children: r
|
|
612
672
|
});
|
|
613
673
|
}
|
|
614
|
-
function
|
|
615
|
-
return /* @__PURE__ */
|
|
674
|
+
function ke({ agentName: e }) {
|
|
675
|
+
return /* @__PURE__ */ H("div", {
|
|
616
676
|
className: "flex flex-col items-center justify-center min-h-[50vh] px-4",
|
|
617
677
|
children: [
|
|
618
|
-
/* @__PURE__ */
|
|
678
|
+
/* @__PURE__ */ V("div", {
|
|
619
679
|
className: "mb-6 h-16 w-16 rounded-2xl bg-gradient-to-br from-blue-500 to-indigo-600\n flex items-center justify-center shadow-lg shadow-blue-500/20",
|
|
620
|
-
children: /* @__PURE__ */
|
|
680
|
+
children: /* @__PURE__ */ V(ee, { className: "h-8 w-8 text-white" })
|
|
621
681
|
}),
|
|
622
|
-
/* @__PURE__ */
|
|
682
|
+
/* @__PURE__ */ V("h2", {
|
|
623
683
|
className: "text-xl font-semibold text-slate-900 dark:text-slate-50",
|
|
624
684
|
children: "有什么我可以帮您的吗?"
|
|
625
685
|
}),
|
|
626
|
-
/* @__PURE__ */
|
|
686
|
+
/* @__PURE__ */ H("p", {
|
|
627
687
|
className: "mt-2 text-sm text-slate-500",
|
|
628
688
|
children: [
|
|
629
689
|
"我是 ",
|
|
@@ -634,19 +694,19 @@ function Te({ agentName: e }) {
|
|
|
634
694
|
]
|
|
635
695
|
});
|
|
636
696
|
}
|
|
637
|
-
function
|
|
638
|
-
return /* @__PURE__ */
|
|
697
|
+
function Ae() {
|
|
698
|
+
return /* @__PURE__ */ H("div", {
|
|
639
699
|
className: "mx-auto flex w-full max-w-[44rem] flex-col gap-5 px-2 py-8",
|
|
640
700
|
"aria-label": "正在加载会话历史",
|
|
641
701
|
children: [
|
|
642
|
-
/* @__PURE__ */
|
|
643
|
-
/* @__PURE__ */
|
|
644
|
-
/* @__PURE__ */
|
|
645
|
-
/* @__PURE__ */
|
|
702
|
+
/* @__PURE__ */ V("div", { className: "h-4 w-28 animate-pulse rounded bg-slate-200/80 dark:bg-slate-800" }),
|
|
703
|
+
/* @__PURE__ */ V("div", { className: "h-20 w-4/5 animate-pulse rounded-lg bg-slate-100 dark:bg-slate-900" }),
|
|
704
|
+
/* @__PURE__ */ V("div", { className: "ml-auto h-12 w-3/5 animate-pulse rounded-lg bg-slate-100 dark:bg-slate-900" }),
|
|
705
|
+
/* @__PURE__ */ V("div", { className: "h-16 w-11/12 animate-pulse rounded-lg bg-slate-100 dark:bg-slate-900" })
|
|
646
706
|
]
|
|
647
707
|
});
|
|
648
708
|
}
|
|
649
|
-
function
|
|
709
|
+
function je({ attachments: e, isMobile: t, onOpenAttachmentPreview: n }) {
|
|
650
710
|
let r = (e) => typeof e != "number" || !Number.isFinite(e) || e < 0 ? "" : e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`, a = (e) => {
|
|
651
711
|
let t = e.status === "pending" ? "生成中" : e.status === "failed" ? "生成失败" : "";
|
|
652
712
|
return [
|
|
@@ -656,44 +716,44 @@ function De({ attachments: e, isMobile: t, onOpenAttachmentPreview: n }) {
|
|
|
656
716
|
e.runId && `run ${e.runId.slice(0, 12)}`
|
|
657
717
|
].filter(Boolean).join(" · ");
|
|
658
718
|
}, o = (e) => !!(e.artifactId || e.itemId || e.runId || e.sizeBytes != null);
|
|
659
|
-
return /* @__PURE__ */
|
|
719
|
+
return /* @__PURE__ */ V("div", {
|
|
660
720
|
className: "mb-3 flex flex-wrap gap-3",
|
|
661
|
-
children: e.map((e, r) => e.type.startsWith("image/") ? e.url ? /* @__PURE__ */
|
|
721
|
+
children: e.map((e, r) => e.type.startsWith("image/") ? e.url ? /* @__PURE__ */ H("div", {
|
|
662
722
|
className: "flex flex-col gap-1",
|
|
663
|
-
children: [/* @__PURE__ */
|
|
723
|
+
children: [/* @__PURE__ */ V("button", {
|
|
664
724
|
type: "button",
|
|
665
725
|
onClick: () => n(e),
|
|
666
726
|
className: i("group relative overflow-hidden rounded-xl border border-slate-200 shadow-sm dark:border-slate-700", t ? "w-full max-w-full" : "max-w-[200px]"),
|
|
667
|
-
children: /* @__PURE__ */
|
|
727
|
+
children: /* @__PURE__ */ V("img", {
|
|
668
728
|
src: e.url,
|
|
669
729
|
alt: e.name,
|
|
670
730
|
className: i("object-cover transition group-hover:scale-[1.02]", t ? "max-h-[16rem] w-full max-w-full" : "max-h-[200px] max-w-[200px]")
|
|
671
731
|
})
|
|
672
|
-
}), o(e) && /* @__PURE__ */
|
|
732
|
+
}), o(e) && /* @__PURE__ */ V("span", {
|
|
673
733
|
className: "max-w-[200px] truncate text-[11px] text-slate-500 dark:text-slate-400",
|
|
674
734
|
title: `来源 item ${e.itemId || "未知"} · run ${e.runId || "未知"}`,
|
|
675
735
|
children: a(e)
|
|
676
736
|
})]
|
|
677
|
-
}, `${e.name}-${r}`) : /* @__PURE__ */
|
|
737
|
+
}, `${e.name}-${r}`) : /* @__PURE__ */ V("div", {
|
|
678
738
|
className: i("flex items-center justify-center rounded-xl border border-dashed border-slate-300 bg-slate-50 px-4 text-sm text-slate-500 dark:border-slate-700 dark:bg-slate-900/40 dark:text-slate-400", t ? "h-28 w-full" : "h-[120px] w-[200px]"),
|
|
679
739
|
children: e.name
|
|
680
|
-
}, `${e.name}-${r}`) : /* @__PURE__ */
|
|
740
|
+
}, `${e.name}-${r}`) : /* @__PURE__ */ H("div", {
|
|
681
741
|
className: i("flex items-center gap-2 rounded-xl border border-slate-200 bg-slate-100 px-3 py-2 shadow-sm dark:border-slate-700 dark:bg-slate-800", t ? "w-full max-w-full" : "w-max max-w-full"),
|
|
682
742
|
children: [
|
|
683
|
-
/* @__PURE__ */
|
|
684
|
-
e.url ? /* @__PURE__ */
|
|
743
|
+
/* @__PURE__ */ V(D, { className: "h-4 w-4 flex-shrink-0 text-blue-500" }),
|
|
744
|
+
e.url ? /* @__PURE__ */ V("a", {
|
|
685
745
|
href: e.url,
|
|
686
746
|
target: "_blank",
|
|
687
747
|
rel: "noreferrer",
|
|
688
748
|
className: "truncate text-sm text-slate-700 hover:underline dark:text-slate-300",
|
|
689
749
|
title: e.name,
|
|
690
750
|
children: e.name
|
|
691
|
-
}) : /* @__PURE__ */
|
|
751
|
+
}) : /* @__PURE__ */ V("span", {
|
|
692
752
|
className: "truncate text-sm text-slate-700 dark:text-slate-300",
|
|
693
753
|
title: e.name,
|
|
694
754
|
children: e.name
|
|
695
755
|
}),
|
|
696
|
-
o(e) && /* @__PURE__ */
|
|
756
|
+
o(e) && /* @__PURE__ */ V("span", {
|
|
697
757
|
className: "text-[11px] text-slate-500 dark:text-slate-400",
|
|
698
758
|
title: `来源 item ${e.itemId || "未知"} · run ${e.runId || "未知"}`,
|
|
699
759
|
children: a(e)
|
|
@@ -702,35 +762,35 @@ function De({ attachments: e, isMobile: t, onOpenAttachmentPreview: n }) {
|
|
|
702
762
|
}, `${e.name}-${r}`))
|
|
703
763
|
});
|
|
704
764
|
}
|
|
705
|
-
function
|
|
706
|
-
return /* @__PURE__ */
|
|
765
|
+
function Me({ message: e }) {
|
|
766
|
+
return /* @__PURE__ */ V("div", {
|
|
707
767
|
className: "w-full px-0 py-2 sm:px-4",
|
|
708
|
-
children: /* @__PURE__ */
|
|
768
|
+
children: /* @__PURE__ */ H("div", {
|
|
709
769
|
className: "mx-auto max-w-3xl rounded-xl border border-neutral-200/70 bg-neutral-50/60 px-4 py-3 text-sm text-neutral-600 dark:border-neutral-800 dark:bg-neutral-900/40 dark:text-neutral-300",
|
|
710
770
|
children: [
|
|
711
|
-
/* @__PURE__ */
|
|
771
|
+
/* @__PURE__ */ H("div", {
|
|
712
772
|
className: "flex items-center gap-2 font-medium",
|
|
713
|
-
children: [e.status === "running" ? /* @__PURE__ */
|
|
773
|
+
children: [e.status === "running" ? /* @__PURE__ */ V(O, { className: "h-4 w-4 animate-spin text-neutral-600 dark:text-neutral-300" }) : e.status === "failed" ? /* @__PURE__ */ V(M, { className: "h-4 w-4 text-rose-600 dark:text-rose-400" }) : /* @__PURE__ */ V(C, { className: "h-4 w-4 text-emerald-600 dark:text-emerald-400" }), /* @__PURE__ */ V("span", { children: e.content })]
|
|
714
774
|
}),
|
|
715
|
-
e.compactedUntilSeqId ? /* @__PURE__ */
|
|
775
|
+
e.compactedUntilSeqId ? /* @__PURE__ */ H("div", {
|
|
716
776
|
className: "mt-1 text-xs text-neutral-700/80 dark:text-neutral-200/80",
|
|
717
777
|
children: ["已折叠到会话事件 #", e.compactedUntilSeqId]
|
|
718
778
|
}) : null,
|
|
719
|
-
e.summary ? /* @__PURE__ */
|
|
779
|
+
e.summary ? /* @__PURE__ */ H("details", {
|
|
720
780
|
className: "mt-3 rounded-xl border border-neutral-200/80 bg-white/70 px-3 py-2 dark:border-neutral-900/60 dark:bg-slate-950/40",
|
|
721
|
-
children: [/* @__PURE__ */
|
|
781
|
+
children: [/* @__PURE__ */ V("summary", {
|
|
722
782
|
className: "cursor-pointer select-none text-xs font-medium text-neutral-800 dark:text-neutral-200",
|
|
723
783
|
children: "查看压缩摘要"
|
|
724
|
-
}), /* @__PURE__ */
|
|
784
|
+
}), /* @__PURE__ */ V("div", {
|
|
725
785
|
className: "mt-2 text-[13px] leading-relaxed text-slate-700 dark:text-slate-200",
|
|
726
|
-
children: /* @__PURE__ */
|
|
786
|
+
children: /* @__PURE__ */ V(m, { content: e.summary })
|
|
727
787
|
})]
|
|
728
788
|
}) : null
|
|
729
789
|
]
|
|
730
790
|
})
|
|
731
791
|
});
|
|
732
792
|
}
|
|
733
|
-
function
|
|
793
|
+
function Ne({ label: e, tone: t, value: n }) {
|
|
734
794
|
let [r, a] = S("idle"), o = h(n);
|
|
735
795
|
v(() => {
|
|
736
796
|
if (r === "idle") return;
|
|
@@ -740,53 +800,53 @@ function ke({ label: e, tone: t, value: n }) {
|
|
|
740
800
|
let s = async () => {
|
|
741
801
|
a(await g(o) ? "copied" : "failed");
|
|
742
802
|
};
|
|
743
|
-
return /* @__PURE__ */
|
|
803
|
+
return /* @__PURE__ */ H("div", { children: [/* @__PURE__ */ H("div", {
|
|
744
804
|
className: "mb-1 flex items-center justify-between gap-2",
|
|
745
|
-
children: [/* @__PURE__ */
|
|
805
|
+
children: [/* @__PURE__ */ V("div", {
|
|
746
806
|
className: i("text-xs font-semibold uppercase", t === "input" ? "text-blue-500" : t === "error" ? "text-rose-500" : "text-emerald-500"),
|
|
747
807
|
children: e
|
|
748
|
-
}), /* @__PURE__ */
|
|
808
|
+
}), /* @__PURE__ */ H("button", {
|
|
749
809
|
type: "button",
|
|
750
810
|
onClick: () => {
|
|
751
811
|
s();
|
|
752
812
|
},
|
|
753
813
|
className: "inline-flex items-center gap-1 rounded-lg px-2 py-1 text-[11px] font-medium text-slate-500 transition hover:bg-white hover:text-slate-900 dark:text-slate-400 dark:hover:bg-slate-900 dark:hover:text-slate-100",
|
|
754
|
-
children: [r === "copied" ? /* @__PURE__ */
|
|
814
|
+
children: [r === "copied" ? /* @__PURE__ */ V(C, { className: "h-3.5 w-3.5 text-emerald-500" }) : /* @__PURE__ */ V(T, { className: "h-3.5 w-3.5" }), r === "copied" ? "已复制" : r === "failed" ? "复制失败" : "复制"]
|
|
755
815
|
})]
|
|
756
|
-
}), /* @__PURE__ */
|
|
816
|
+
}), /* @__PURE__ */ V("div", {
|
|
757
817
|
className: "custom-scrollbar max-h-[220px] overflow-y-auto whitespace-pre-wrap break-words rounded-xl border border-slate-200/30 bg-white/70 p-3 text-slate-600 shadow-sm dark:border-slate-800 dark:bg-slate-950/40 dark:text-slate-300 sm:max-h-[300px]",
|
|
758
818
|
children: o
|
|
759
819
|
})] });
|
|
760
820
|
}
|
|
761
|
-
function
|
|
821
|
+
function Pe({ isLastMessage: e, isStreaming: t, message: n, onDeleteFeedback: r, onSubmitFeedback: a, alwaysVisible: o = !1 }) {
|
|
762
822
|
let [s, c] = S(!1), [u, d] = S(n.feedback?.comment || ""), f = l(n, t, e), p = !!n.feedback?.pending, m = n.feedback?.rating, h = async () => {
|
|
763
823
|
let e = n.content || "";
|
|
764
824
|
e && g(e);
|
|
765
825
|
};
|
|
766
|
-
return f ? /* @__PURE__ */
|
|
826
|
+
return f ? /* @__PURE__ */ H("div", {
|
|
767
827
|
className: i("mt-2 flex flex-col gap-2 transition-opacity duration-150 focus-within:opacity-100", o ? "opacity-100" : "opacity-0 group-hover:opacity-100"),
|
|
768
828
|
children: [
|
|
769
|
-
/* @__PURE__ */
|
|
829
|
+
/* @__PURE__ */ H("div", {
|
|
770
830
|
className: "flex flex-wrap items-center gap-1.5 text-xs text-text-muted",
|
|
771
831
|
children: [
|
|
772
|
-
/* @__PURE__ */
|
|
832
|
+
/* @__PURE__ */ V("button", {
|
|
773
833
|
type: "button",
|
|
774
834
|
onClick: () => {
|
|
775
835
|
h();
|
|
776
836
|
},
|
|
777
837
|
className: "inline-flex items-center gap-1 rounded-full px-2 py-1 font-medium text-text-secondary transition hover:bg-muted hover:text-text-primary",
|
|
778
838
|
title: "复制",
|
|
779
|
-
children: /* @__PURE__ */
|
|
839
|
+
children: /* @__PURE__ */ V(T, { className: "h-3.5 w-3.5" })
|
|
780
840
|
}),
|
|
781
|
-
/* @__PURE__ */
|
|
841
|
+
/* @__PURE__ */ V("span", {
|
|
782
842
|
className: "text-text-muted/60",
|
|
783
843
|
children: "·"
|
|
784
844
|
}),
|
|
785
|
-
/* @__PURE__ */
|
|
845
|
+
/* @__PURE__ */ V("span", {
|
|
786
846
|
className: "font-medium",
|
|
787
847
|
children: "本次回复有帮助吗?"
|
|
788
848
|
}),
|
|
789
|
-
/* @__PURE__ */
|
|
849
|
+
/* @__PURE__ */ H("button", {
|
|
790
850
|
type: "button",
|
|
791
851
|
disabled: p,
|
|
792
852
|
onClick: () => a({
|
|
@@ -795,45 +855,45 @@ function Ae({ isLastMessage: e, isStreaming: t, message: n, onDeleteFeedback: r,
|
|
|
795
855
|
comment: ""
|
|
796
856
|
}),
|
|
797
857
|
className: i("inline-flex items-center gap-1 rounded-full border px-2.5 py-1 font-medium transition disabled:cursor-not-allowed disabled:opacity-60", m === "up" ? "border-primary/30 bg-primary/10 text-primary" : "border-border bg-background text-text-secondary hover:border-primary/30 hover:text-primary"),
|
|
798
|
-
children: [/* @__PURE__ */
|
|
858
|
+
children: [/* @__PURE__ */ V(P, { className: "h-3.5 w-3.5" }), "有帮助"]
|
|
799
859
|
}),
|
|
800
|
-
/* @__PURE__ */
|
|
860
|
+
/* @__PURE__ */ H("button", {
|
|
801
861
|
type: "button",
|
|
802
862
|
disabled: p,
|
|
803
863
|
onClick: () => {
|
|
804
864
|
d(n.feedback?.comment || ""), c((e) => !e);
|
|
805
865
|
},
|
|
806
866
|
className: i("inline-flex items-center gap-1 rounded-full border px-2.5 py-1 font-medium transition disabled:cursor-not-allowed disabled:opacity-60", m === "down" ? "border-rose-300 bg-rose-50 text-rose-600 dark:border-rose-900/70 dark:bg-rose-950/30 dark:text-rose-300" : "border-border bg-background text-text-secondary hover:border-rose-300 hover:text-rose-600"),
|
|
807
|
-
children: [/* @__PURE__ */
|
|
867
|
+
children: [/* @__PURE__ */ V(N, { className: "h-3.5 w-3.5" }), "需改进"]
|
|
808
868
|
}),
|
|
809
|
-
n.feedback ? /* @__PURE__ */
|
|
869
|
+
n.feedback ? /* @__PURE__ */ H("button", {
|
|
810
870
|
type: "button",
|
|
811
871
|
disabled: p,
|
|
812
872
|
onClick: () => r(n),
|
|
813
873
|
className: "inline-flex items-center gap-1 rounded-full border border-transparent px-2 py-1 font-medium text-slate-400 transition hover:border-slate-200 hover:text-slate-700 disabled:cursor-not-allowed disabled:opacity-60 dark:hover:border-slate-800 dark:hover:text-slate-200",
|
|
814
|
-
children: [/* @__PURE__ */
|
|
874
|
+
children: [/* @__PURE__ */ V(F, { className: "h-3.5 w-3.5" }), "删除反馈"]
|
|
815
875
|
}) : null,
|
|
816
|
-
p ? /* @__PURE__ */
|
|
876
|
+
p ? /* @__PURE__ */ V("span", {
|
|
817
877
|
className: "text-slate-400",
|
|
818
878
|
children: "提交中…"
|
|
819
879
|
}) : null
|
|
820
880
|
]
|
|
821
881
|
}),
|
|
822
|
-
s ? /* @__PURE__ */
|
|
882
|
+
s ? /* @__PURE__ */ H("div", {
|
|
823
883
|
className: "max-w-xl rounded-2xl border border-rose-100 bg-rose-50/60 p-3 shadow-sm dark:border-rose-900/60 dark:bg-rose-950/20",
|
|
824
|
-
children: [/* @__PURE__ */
|
|
884
|
+
children: [/* @__PURE__ */ V("textarea", {
|
|
825
885
|
value: u,
|
|
826
886
|
onChange: (e) => d(e.target.value),
|
|
827
887
|
placeholder: "可以补充哪里不准确、缺失或不符合预期。",
|
|
828
888
|
className: "min-h-[84px] w-full resize-y rounded-xl border border-rose-100 bg-white px-3 py-2 text-sm text-slate-700 outline-none transition placeholder:text-slate-400 focus:border-rose-300 focus:ring-2 focus:ring-rose-100 dark:border-rose-900/70 dark:bg-slate-950 dark:text-slate-100 dark:focus:border-rose-700 dark:focus:ring-rose-950"
|
|
829
|
-
}), /* @__PURE__ */
|
|
889
|
+
}), /* @__PURE__ */ H("div", {
|
|
830
890
|
className: "mt-2 flex flex-wrap justify-end gap-2",
|
|
831
|
-
children: [/* @__PURE__ */
|
|
891
|
+
children: [/* @__PURE__ */ V("button", {
|
|
832
892
|
type: "button",
|
|
833
893
|
onClick: () => c(!1),
|
|
834
894
|
className: "rounded-xl px-3 py-1.5 text-xs font-semibold text-slate-500 transition hover:bg-white hover:text-slate-800 dark:text-slate-400 dark:hover:bg-slate-950 dark:hover:text-slate-100",
|
|
835
895
|
children: "取消"
|
|
836
|
-
}), /* @__PURE__ */
|
|
896
|
+
}), /* @__PURE__ */ V("button", {
|
|
837
897
|
type: "button",
|
|
838
898
|
disabled: p,
|
|
839
899
|
onClick: () => {
|
|
@@ -847,177 +907,161 @@ function Ae({ isLastMessage: e, isStreaming: t, message: n, onDeleteFeedback: r,
|
|
|
847
907
|
children: "提交点踩"
|
|
848
908
|
})]
|
|
849
909
|
})]
|
|
850
|
-
}) : m === "down" && n.feedback?.comment ? /* @__PURE__ */
|
|
910
|
+
}) : m === "down" && n.feedback?.comment ? /* @__PURE__ */ H("div", {
|
|
851
911
|
className: "max-w-xl rounded-xl border border-rose-100 bg-rose-50/50 px-3 py-2 text-xs text-rose-700 dark:border-rose-900/60 dark:bg-rose-950/20 dark:text-rose-200",
|
|
852
912
|
children: ["反馈:", n.feedback.comment]
|
|
853
913
|
}) : null,
|
|
854
|
-
n.feedback?.error ? /* @__PURE__ */
|
|
914
|
+
n.feedback?.error ? /* @__PURE__ */ V("div", {
|
|
855
915
|
className: "text-xs text-rose-600 dark:text-rose-300",
|
|
856
916
|
children: n.feedback.error
|
|
857
917
|
}) : null
|
|
858
918
|
]
|
|
859
919
|
}) : null;
|
|
860
920
|
}
|
|
861
|
-
function
|
|
862
|
-
if (c.role === "user") return /* @__PURE__ */
|
|
921
|
+
function Fe({ agentName: e, isMobile: t, isStreaming: n, isLastMessage: r, suppressWaitingIndicator: o = !1, showAgentHeader: s, message: c, onDeleteFeedback: l, onOpenAttachmentPreview: u, onRespondToApproval: d, onRespondToAguiApproval: f, onSubmitFeedback: p, onSubmitAguiAction: h, interactionRecords: g, agentBlockActions: _ }) {
|
|
922
|
+
if (c.role === "user") return /* @__PURE__ */ V("div", {
|
|
863
923
|
className: "mb-3 flex justify-end",
|
|
864
|
-
children: /* @__PURE__ */
|
|
924
|
+
children: /* @__PURE__ */ H("div", {
|
|
865
925
|
"data-slot": "user-message",
|
|
866
926
|
className: "max-w-[80%] rounded-2xl bg-muted px-3 py-2 text-[14px] leading-relaxed text-foreground",
|
|
867
|
-
children: [c.attachments?.length ? /* @__PURE__ */
|
|
927
|
+
children: [c.attachments?.length ? /* @__PURE__ */ V(je, {
|
|
868
928
|
attachments: c.attachments,
|
|
869
929
|
isMobile: t,
|
|
870
930
|
onOpenAttachmentPreview: u
|
|
871
931
|
}) : null, c.content]
|
|
872
932
|
})
|
|
873
933
|
});
|
|
874
|
-
if (c.role === "a2ui" && c.aguiActivity) return /* @__PURE__ */
|
|
934
|
+
if (c.role === "a2ui" && c.aguiActivity) return /* @__PURE__ */ V(a, {
|
|
875
935
|
surfaceId: c.aguiActivity.surfaceId,
|
|
876
936
|
messages: c.aguiActivity.messages,
|
|
877
937
|
onAction: h
|
|
878
938
|
});
|
|
879
|
-
let
|
|
880
|
-
return /* @__PURE__ */
|
|
939
|
+
let v = n && r && !c.content;
|
|
940
|
+
return /* @__PURE__ */ H("div", {
|
|
881
941
|
"data-slot": "assistant-message",
|
|
882
942
|
className: "group mx-auto mb-3 w-full max-w-[60rem] px-2 sm:px-4",
|
|
883
943
|
children: [
|
|
884
|
-
s ? /* @__PURE__ */
|
|
944
|
+
s ? /* @__PURE__ */ H("div", {
|
|
885
945
|
className: "mb-1.5 flex items-center gap-2 text-xs text-text-muted",
|
|
886
|
-
children: [/* @__PURE__ */
|
|
946
|
+
children: [/* @__PURE__ */ V(ee, { className: "w-3.5 h-3.5" }), /* @__PURE__ */ V("span", { children: e })]
|
|
887
947
|
}) : null,
|
|
888
|
-
c.attachments?.length ? /* @__PURE__ */
|
|
948
|
+
c.attachments?.length ? /* @__PURE__ */ V(je, {
|
|
889
949
|
attachments: c.attachments,
|
|
890
950
|
isMobile: t,
|
|
891
951
|
onOpenAttachmentPreview: u
|
|
892
952
|
}) : null,
|
|
893
|
-
c.
|
|
953
|
+
c.agentBlock ? /* @__PURE__ */ V(me, {
|
|
954
|
+
block: c.agentBlock,
|
|
955
|
+
actions: _
|
|
956
|
+
}, c.agentBlock.item.itemId) : c.blocks?.length ? /* @__PURE__ */ V(de, {
|
|
894
957
|
message: c,
|
|
895
958
|
isStreaming: n,
|
|
896
959
|
onRespondToApproval: d,
|
|
897
960
|
interactionRecords: g,
|
|
898
961
|
onRespondToAguiApproval: f
|
|
899
|
-
}) : /* @__PURE__ */
|
|
900
|
-
c.reasoning ? /* @__PURE__ */
|
|
962
|
+
}) : /* @__PURE__ */ H(B, { children: [
|
|
963
|
+
c.reasoning ? /* @__PURE__ */ H("details", {
|
|
901
964
|
className: "group/details mb-3 overflow-hidden rounded-md border border-slate-200/80 bg-slate-50/60 text-sm text-slate-600 transition-colors open:bg-white dark:border-slate-700/80 dark:bg-slate-900/40 dark:text-slate-300 dark:open:bg-slate-950/30",
|
|
902
|
-
children: [/* @__PURE__ */
|
|
965
|
+
children: [/* @__PURE__ */ H("summary", {
|
|
903
966
|
className: "flex cursor-pointer list-none items-center justify-between gap-3 px-3 py-2 font-medium outline-none marker:hidden",
|
|
904
|
-
children: [/* @__PURE__ */
|
|
967
|
+
children: [/* @__PURE__ */ H("div", {
|
|
905
968
|
className: "flex min-w-0 items-center gap-2",
|
|
906
969
|
children: [
|
|
907
|
-
|
|
908
|
-
/* @__PURE__ */
|
|
909
|
-
className: i("truncate",
|
|
910
|
-
"data-testid":
|
|
911
|
-
role:
|
|
912
|
-
children:
|
|
970
|
+
v ? null : /* @__PURE__ */ V(C, { className: "h-4 w-4 text-slate-400" }),
|
|
971
|
+
/* @__PURE__ */ V("span", {
|
|
972
|
+
className: i("truncate", v && "waiting-thinking-text"),
|
|
973
|
+
"data-testid": v ? "legacy-thinking-indicator" : void 0,
|
|
974
|
+
role: v ? "status" : void 0,
|
|
975
|
+
children: v ? "正在思考…" : "思考过程"
|
|
913
976
|
}),
|
|
914
|
-
|
|
977
|
+
v ? null : /* @__PURE__ */ V("span", {
|
|
915
978
|
className: "rounded-full bg-slate-200/70 px-2 py-0.5 text-[11px] font-medium text-slate-600 dark:bg-slate-800 dark:text-slate-300",
|
|
916
979
|
children: "已完成"
|
|
917
980
|
})
|
|
918
981
|
]
|
|
919
|
-
}), /* @__PURE__ */
|
|
920
|
-
}), /* @__PURE__ */
|
|
982
|
+
}), /* @__PURE__ */ V(w, { className: "h-4 w-4 flex-shrink-0 text-slate-400 transition-transform group-open/details:rotate-180" })]
|
|
983
|
+
}), /* @__PURE__ */ V("div", {
|
|
921
984
|
className: "border-t border-slate-200/70 bg-white/70 dark:border-slate-800 dark:bg-slate-950/20",
|
|
922
|
-
children: /* @__PURE__ */
|
|
985
|
+
children: /* @__PURE__ */ V("div", {
|
|
923
986
|
className: "custom-scrollbar max-h-[min(46vh,28rem)] overflow-y-auto px-4 py-3 text-[14px] leading-7 text-slate-600 dark:text-slate-300 [&_p]:my-2 [&_pre]:my-2",
|
|
924
|
-
children: /* @__PURE__ */
|
|
987
|
+
children: /* @__PURE__ */ V(m, { content: c.reasoning })
|
|
925
988
|
})
|
|
926
989
|
})]
|
|
927
990
|
}) : null,
|
|
928
|
-
c.tools ? Object.values(c.tools).map((e, t) =>
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
children: [e.approvalStatus === "approved" ? /* @__PURE__ */ U(w, { className: "h-3.5 w-3.5 text-emerald-500" }) : /* @__PURE__ */ U(B, { className: "h-3.5 w-3.5 text-rose-500" }), e.approvalStatus === "approved" ? "已批准" : e.approvalStatus === "cancelled" ? "已取消" : "已拒绝"]
|
|
987
|
-
})
|
|
988
|
-
]
|
|
989
|
-
}) : null,
|
|
990
|
-
e.args ? /* @__PURE__ */ U(ke, {
|
|
991
|
-
label: "入参 (Args)",
|
|
992
|
-
tone: "input",
|
|
993
|
-
value: e.args
|
|
994
|
-
}) : null,
|
|
995
|
-
e.output ? /* @__PURE__ */ U(ke, {
|
|
996
|
-
label: "输出 (Output)",
|
|
997
|
-
tone: e.status === "error" ? "error" : "output",
|
|
998
|
-
value: e.output
|
|
999
|
-
}) : null
|
|
1000
|
-
]
|
|
1001
|
-
})]
|
|
1002
|
-
}, `${e.name}-${t}`)) : null,
|
|
1003
|
-
c.tools ? Object.values(c.tools).filter((e) => g?.some((t) => t.interactionId === e.approvalRequestId)).map((e) => /* @__PURE__ */ U(Z, { interaction: g.find((t) => t.interactionId === e.approvalRequestId) }, `anchor-${e.approvalRequestId}`)) : null,
|
|
1004
|
-
/* @__PURE__ */ U("div", {
|
|
991
|
+
c.tools ? Object.values(c.tools).map((e, t) => {
|
|
992
|
+
let n = g?.find((t) => t.interactionId === e.approvalRequestId), r = {
|
|
993
|
+
...e,
|
|
994
|
+
approvalStatus: X(n) || e.approvalStatus
|
|
995
|
+
};
|
|
996
|
+
return /* @__PURE__ */ H("details", {
|
|
997
|
+
open: r.approvalStatus === "pending" || r.status === "paused" ? !0 : void 0,
|
|
998
|
+
className: i("group/details mb-2 overflow-hidden rounded-md border text-sm transition-colors", r.status === "paused" ? "border-neutral-200/80 bg-neutral-50/25 text-slate-700 dark:border-neutral-900/60 dark:bg-neutral-950/10 dark:text-slate-200" : r.status === "error" ? "border-rose-200/80 bg-rose-50/25 text-rose-700 dark:border-rose-900/60 dark:bg-rose-950/10 dark:text-rose-200" : "border-slate-200/80 bg-slate-50/40 text-slate-600 dark:border-slate-700/80 dark:bg-slate-900/30 dark:text-slate-300"),
|
|
999
|
+
children: [/* @__PURE__ */ V("summary", {
|
|
1000
|
+
className: "flex cursor-pointer list-none items-center justify-between gap-2 px-3 py-2 font-medium",
|
|
1001
|
+
children: /* @__PURE__ */ H("div", {
|
|
1002
|
+
className: "flex items-center gap-2",
|
|
1003
|
+
children: [r.status === "running" ? /* @__PURE__ */ V(O, { className: "h-4 w-4 animate-spin text-slate-500" }) : r.status === "paused" ? /* @__PURE__ */ V(A, { className: "h-4 w-4 text-neutral-500" }) : r.status === "error" ? /* @__PURE__ */ V(R, { className: "h-4 w-4 text-rose-500" }) : /* @__PURE__ */ V(C, { className: "h-4 w-4 text-slate-400" }), /* @__PURE__ */ H("span", { children: [r.approvalStatus === "pending" ? "等待审批:" : r.approvalStatus === "approved" ? "已批准:" : r.approvalStatus === "rejected" ? "已拒绝:" : r.approvalStatus === "cancelled" ? "已取消:" : r.status === "error" ? "工具调用失败:" : "工具调用:", r.name] })]
|
|
1004
|
+
})
|
|
1005
|
+
}), /* @__PURE__ */ H("div", {
|
|
1006
|
+
className: i("flex flex-col gap-3 border-t px-3 py-3 font-mono text-[13px] leading-relaxed", r.status === "paused" ? "border-neutral-200/70 dark:border-neutral-900/60" : r.status === "error" ? "border-rose-200/70 dark:border-rose-900/60" : "border-slate-200/70 dark:border-slate-800"),
|
|
1007
|
+
children: [
|
|
1008
|
+
r.approvalRequestId ? /* @__PURE__ */ H("div", {
|
|
1009
|
+
className: "font-sans text-sm text-slate-700 dark:text-slate-200",
|
|
1010
|
+
children: [
|
|
1011
|
+
/* @__PURE__ */ V("div", {
|
|
1012
|
+
className: "font-medium",
|
|
1013
|
+
children: r.approvalStatus === "approved" ? "已批准该工具调用。" : r.approvalStatus === "rejected" ? "已拒绝该工具调用。" : r.approvalStatus === "cancelled" ? "已取消该工具调用。" : r.approvalMessage || "该工具调用需要人工确认后继续。"
|
|
1014
|
+
}),
|
|
1015
|
+
r.approvalLevel ? /* @__PURE__ */ H("div", {
|
|
1016
|
+
className: i("mt-2 inline-flex items-center rounded border px-1.5 py-0.5 text-xs font-medium", De(r.approvalLevel)),
|
|
1017
|
+
children: ["审批级别:", Ee(r.approvalLevel)]
|
|
1018
|
+
}) : null,
|
|
1019
|
+
r.serverLabel ? /* @__PURE__ */ H("div", {
|
|
1020
|
+
className: "mt-1 text-xs text-neutral-700/80 dark:text-neutral-200/80",
|
|
1021
|
+
children: ["MCP Server: ", r.serverLabel]
|
|
1022
|
+
}) : null,
|
|
1023
|
+
r.approvalStatus === "pending" ? /* @__PURE__ */ V("div", {
|
|
1024
|
+
"data-slot": "tool-approval-status",
|
|
1025
|
+
className: "mt-2 text-xs text-slate-500 dark:text-slate-400",
|
|
1026
|
+
children: "请在输入区确认面板中操作。"
|
|
1027
|
+
}) : r.approvalStatus ? /* @__PURE__ */ H("div", {
|
|
1028
|
+
className: "mt-2 inline-flex items-center gap-1.5 text-xs font-medium text-slate-500 dark:text-slate-400",
|
|
1029
|
+
children: [r.approvalStatus === "approved" ? /* @__PURE__ */ V(C, { className: "h-3.5 w-3.5 text-emerald-500" }) : /* @__PURE__ */ V(R, { className: "h-3.5 w-3.5 text-rose-500" }), r.approvalStatus === "approved" ? "已批准" : r.approvalStatus === "cancelled" ? "已取消" : "已拒绝"]
|
|
1030
|
+
}) : null
|
|
1031
|
+
]
|
|
1032
|
+
}) : null,
|
|
1033
|
+
r.args ? /* @__PURE__ */ V(Ne, {
|
|
1034
|
+
label: "入参 (Args)",
|
|
1035
|
+
tone: "input",
|
|
1036
|
+
value: r.args
|
|
1037
|
+
}) : null,
|
|
1038
|
+
r.output ? /* @__PURE__ */ V(Ne, {
|
|
1039
|
+
label: "输出 (Output)",
|
|
1040
|
+
tone: r.status === "error" ? "error" : "output",
|
|
1041
|
+
value: r.output
|
|
1042
|
+
}) : null
|
|
1043
|
+
]
|
|
1044
|
+
})]
|
|
1045
|
+
}, `${r.name}-${t}`);
|
|
1046
|
+
}) : null,
|
|
1047
|
+
c.tools ? Object.values(c.tools).filter((e) => g?.some((t) => t.interactionId === e.approvalRequestId)).map((e) => /* @__PURE__ */ V(Y, { interaction: g.find((t) => t.interactionId === e.approvalRequestId) }, `anchor-${e.approvalRequestId}`)) : null,
|
|
1048
|
+
/* @__PURE__ */ V("div", {
|
|
1005
1049
|
"data-slot": "assistant-content",
|
|
1006
1050
|
className: "w-full break-words",
|
|
1007
|
-
children: c.content ? /* @__PURE__ */
|
|
1051
|
+
children: c.content ? /* @__PURE__ */ V(m, { content: c.content }) : !o && (n && r && !c.reasoning && !c.tools || c.eventType === "optimistic_assistant_placeholder") ? /* @__PURE__ */ V("span", {
|
|
1008
1052
|
className: "relative mt-1 inline-flex h-4 w-4 items-center justify-center",
|
|
1009
1053
|
role: "status",
|
|
1010
1054
|
"aria-label": "正在生成",
|
|
1011
|
-
children: /* @__PURE__ */
|
|
1055
|
+
children: /* @__PURE__ */ V("span", { className: "waiting-generation-breathe h-2.5 w-2.5 rounded-full" })
|
|
1012
1056
|
}) : null
|
|
1013
1057
|
})
|
|
1014
1058
|
] }),
|
|
1015
|
-
c.aguiActivities?.map((e) => /* @__PURE__ */
|
|
1059
|
+
c.aguiActivities?.map((e) => /* @__PURE__ */ V(a, {
|
|
1016
1060
|
surfaceId: e.surfaceId,
|
|
1017
1061
|
messages: e.messages,
|
|
1018
1062
|
onAction: h
|
|
1019
1063
|
}, e.surfaceId)),
|
|
1020
|
-
/* @__PURE__ */
|
|
1064
|
+
/* @__PURE__ */ V(Pe, {
|
|
1021
1065
|
isLastMessage: r,
|
|
1022
1066
|
isStreaming: n,
|
|
1023
1067
|
message: c,
|
|
@@ -1027,42 +1071,42 @@ function je({ agentName: e, isMobile: t, isStreaming: n, isLastMessage: r, suppr
|
|
|
1027
1071
|
]
|
|
1028
1072
|
});
|
|
1029
1073
|
}
|
|
1030
|
-
function
|
|
1031
|
-
let [
|
|
1074
|
+
function Ie({ agentName: e, emptyState: t, isMobile: n, isStreaming: r, activity: a, contextIndicator: o, messages: s, showWaitingIndicator: c = !1, isLoadingInitialHistory: l = !1, onDeleteFeedback: u, onOpenAttachmentPreview: d, onRespondToApproval: f, onRespondToAguiApproval: p, onSubmitFeedback: m, onSubmitAguiAction: h, onStopGeneration: g, onCancelRemote: ee, agentBlockActions: C, onScrollToBottom: T, checkpoints: te = [], onResumeCheckpoint: ne, interactionRecords: E, scrollRef: D, className: O, revealMessage: k }) {
|
|
1075
|
+
let [A, j] = S(0), [M, N] = S(0), [P, F] = S(0), [I, L] = S(/* @__PURE__ */ new Map()), R = x(I);
|
|
1032
1076
|
y(() => {
|
|
1033
|
-
let e =
|
|
1077
|
+
let e = D.current;
|
|
1034
1078
|
if (!e) return;
|
|
1035
1079
|
let t = () => {
|
|
1036
|
-
|
|
1080
|
+
j(e.scrollTop), N(e.clientHeight), F(e.scrollHeight);
|
|
1037
1081
|
};
|
|
1038
1082
|
if (t(), typeof ResizeObserver > "u") return;
|
|
1039
1083
|
let n = new ResizeObserver(() => t());
|
|
1040
1084
|
return n.observe(e), e.firstElementChild instanceof HTMLElement && n.observe(e.firstElementChild), () => n.disconnect();
|
|
1041
|
-
}, [
|
|
1042
|
-
let
|
|
1085
|
+
}, [D]);
|
|
1086
|
+
let z = b(() => ye({
|
|
1043
1087
|
items: s,
|
|
1044
|
-
scrollTop:
|
|
1045
|
-
viewportHeight:
|
|
1046
|
-
overscan:
|
|
1047
|
-
defaultItemHeight:
|
|
1048
|
-
measuredHeights:
|
|
1088
|
+
scrollTop: A,
|
|
1089
|
+
viewportHeight: M,
|
|
1090
|
+
overscan: Te,
|
|
1091
|
+
defaultItemHeight: we,
|
|
1092
|
+
measuredHeights: I,
|
|
1049
1093
|
getItemKey: (e, t) => e?.id || String(t)
|
|
1050
1094
|
}), [
|
|
1051
|
-
|
|
1095
|
+
I,
|
|
1052
1096
|
s,
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
]),
|
|
1097
|
+
A,
|
|
1098
|
+
M
|
|
1099
|
+
]), U = z.visibleItems;
|
|
1056
1100
|
v(() => {
|
|
1057
|
-
if (!
|
|
1058
|
-
let e =
|
|
1101
|
+
if (!k) return;
|
|
1102
|
+
let e = D.current, t = s.findIndex((e) => e.id === k.id);
|
|
1059
1103
|
if (!e || t < 0) return;
|
|
1060
1104
|
let n = e.style.scrollBehavior;
|
|
1061
1105
|
e.style.scrollBehavior = "auto";
|
|
1062
1106
|
let r = 0, i = 0, a = 0, o = -1, c = () => {
|
|
1063
|
-
let l = s.slice(0, t).reduce((e, t) => e + (
|
|
1064
|
-
e.scrollTop = Math.max(0, l - 24),
|
|
1065
|
-
let u = Array.from(e.querySelectorAll("[data-message-id]")).find((e) => e.dataset.messageId ===
|
|
1107
|
+
let l = s.slice(0, t).reduce((e, t) => e + (R.current.get(t.id) || we), 0);
|
|
1108
|
+
e.scrollTop = Math.max(0, l - 24), j(e.scrollTop), N(e.clientHeight);
|
|
1109
|
+
let u = Array.from(e.querySelectorAll("[data-message-id]")).find((e) => e.dataset.messageId === k.id);
|
|
1066
1110
|
if (a = u && Math.abs(o - l) < 1 ? a + 1 : 0, o = l, u && (a >= 3 || i >= 30)) {
|
|
1067
1111
|
e.scrollTop += u.getBoundingClientRect().top - e.getBoundingClientRect().top - 24, u.focus({ preventScroll: !0 }), e.dispatchEvent(new Event("scroll")), e.style.scrollBehavior = n;
|
|
1068
1112
|
return;
|
|
@@ -1072,82 +1116,83 @@ function Me({ agentName: e, emptyState: t, isMobile: n, isStreaming: r, activity
|
|
|
1072
1116
|
return r = requestAnimationFrame(c), () => {
|
|
1073
1117
|
cancelAnimationFrame(r), e.style.scrollBehavior = n;
|
|
1074
1118
|
};
|
|
1075
|
-
}, [
|
|
1076
|
-
let
|
|
1119
|
+
}, [k, D]);
|
|
1120
|
+
let W = _((e, t, n) => {
|
|
1077
1121
|
if (!e || !Number.isFinite(t) || t <= 0) return;
|
|
1078
|
-
let r =
|
|
1122
|
+
let r = R.current, i = r.get(e) ?? we;
|
|
1079
1123
|
if (i === t) return;
|
|
1080
1124
|
let a = new Map(r);
|
|
1081
|
-
a.set(e, t),
|
|
1082
|
-
let o =
|
|
1083
|
-
o && n < o.scrollTop && (o.scrollTop += t - i,
|
|
1084
|
-
}, [
|
|
1085
|
-
scrollHeight:
|
|
1086
|
-
scrollTop:
|
|
1087
|
-
clientHeight:
|
|
1088
|
-
}),
|
|
1089
|
-
scrollHeight:
|
|
1090
|
-
scrollTop:
|
|
1091
|
-
clientHeight:
|
|
1125
|
+
a.set(e, t), R.current = a, L(a);
|
|
1126
|
+
let o = D.current;
|
|
1127
|
+
o && n < o.scrollTop && (o.scrollTop += t - i, j(o.scrollTop), F(o.scrollHeight));
|
|
1128
|
+
}, [D]), G = be({
|
|
1129
|
+
scrollHeight: P,
|
|
1130
|
+
scrollTop: A,
|
|
1131
|
+
clientHeight: M
|
|
1132
|
+
}), K = xe({
|
|
1133
|
+
scrollHeight: P,
|
|
1134
|
+
scrollTop: A,
|
|
1135
|
+
clientHeight: M
|
|
1092
1136
|
});
|
|
1093
|
-
return /* @__PURE__ */
|
|
1094
|
-
ref:
|
|
1137
|
+
return /* @__PURE__ */ H("div", {
|
|
1138
|
+
ref: D,
|
|
1095
1139
|
onScroll: (e) => {
|
|
1096
|
-
|
|
1140
|
+
j(e.currentTarget.scrollTop), N(e.currentTarget.clientHeight), F(e.currentTarget.scrollHeight);
|
|
1097
1141
|
},
|
|
1098
|
-
className: i("custom-scrollbar relative min-h-0 flex-1 overflow-y-auto scroll-smooth", n ? "px-3 py-3" : "px-4 py-5",
|
|
1142
|
+
className: i("custom-scrollbar relative min-h-0 flex-1 overflow-y-auto scroll-smooth", n ? "px-3 py-3" : "px-4 py-5", O),
|
|
1099
1143
|
"data-slot": "message-list",
|
|
1100
1144
|
style: { overflowAnchor: "none" },
|
|
1101
1145
|
children: [
|
|
1102
|
-
/* @__PURE__ */
|
|
1146
|
+
/* @__PURE__ */ V("div", {
|
|
1103
1147
|
"data-slot": "message-list-content",
|
|
1104
1148
|
className: "mx-auto flex w-full max-w-[64rem] flex-col pb-6 sm:pb-8",
|
|
1105
|
-
children: s.length === 0 && l ? /* @__PURE__ */
|
|
1106
|
-
style: { height:
|
|
1149
|
+
children: s.length === 0 && l ? /* @__PURE__ */ V(Ae, {}) : s.length === 0 && !c ? t === void 0 ? /* @__PURE__ */ V(ke, { agentName: e }) : t : /* @__PURE__ */ H(B, { children: [s.length > 0 && /* @__PURE__ */ V("div", {
|
|
1150
|
+
style: { height: z.totalHeight },
|
|
1107
1151
|
className: "relative",
|
|
1108
|
-
children:
|
|
1152
|
+
children: U.map((t) => /* @__PURE__ */ V(Oe, {
|
|
1109
1153
|
messageId: t.item.id || String(t.index),
|
|
1110
|
-
highlighted: t.item.id ===
|
|
1154
|
+
highlighted: t.item.id === k?.id,
|
|
1111
1155
|
top: t.top,
|
|
1112
|
-
onMeasure:
|
|
1113
|
-
children: t.item.role === "system" ? /* @__PURE__ */
|
|
1156
|
+
onMeasure: W,
|
|
1157
|
+
children: t.item.role === "system" ? /* @__PURE__ */ V(Me, { message: t.item }) : /* @__PURE__ */ V(Fe, {
|
|
1114
1158
|
agentName: e,
|
|
1115
1159
|
isMobile: n,
|
|
1116
1160
|
isStreaming: r,
|
|
1117
1161
|
suppressWaitingIndicator: c,
|
|
1118
1162
|
isLastMessage: t.index === s.length - 1,
|
|
1119
|
-
showAgentHeader: !
|
|
1163
|
+
showAgentHeader: !Ce(s[t.index - 1], t.item),
|
|
1120
1164
|
message: t.item,
|
|
1165
|
+
agentBlockActions: C,
|
|
1121
1166
|
onDeleteFeedback: u,
|
|
1122
1167
|
onOpenAttachmentPreview: d,
|
|
1123
1168
|
onRespondToApproval: f,
|
|
1124
|
-
interactionRecords:
|
|
1169
|
+
interactionRecords: E,
|
|
1125
1170
|
onRespondToAguiApproval: p,
|
|
1126
1171
|
onSubmitFeedback: m,
|
|
1127
1172
|
onSubmitAguiAction: h
|
|
1128
1173
|
})
|
|
1129
1174
|
}, t.item.id || t.index))
|
|
1130
|
-
}), c && /* @__PURE__ */
|
|
1175
|
+
}), c && /* @__PURE__ */ V("div", {
|
|
1131
1176
|
className: "mx-auto w-full max-w-[60rem] px-2 sm:px-4",
|
|
1132
1177
|
role: "status",
|
|
1133
1178
|
"data-testid": "waiting-first-token",
|
|
1134
|
-
children: /* @__PURE__ */
|
|
1179
|
+
children: /* @__PURE__ */ V("span", {
|
|
1135
1180
|
className: "waiting-thinking-text",
|
|
1136
1181
|
children: "正在思考…"
|
|
1137
1182
|
})
|
|
1138
1183
|
})] })
|
|
1139
1184
|
}),
|
|
1140
|
-
/* @__PURE__ */
|
|
1141
|
-
|
|
1185
|
+
/* @__PURE__ */ V(he, {}),
|
|
1186
|
+
K ? /* @__PURE__ */ V("button", {
|
|
1142
1187
|
type: "button",
|
|
1143
1188
|
"aria-label": "回到底部",
|
|
1144
|
-
"data-distance-from-bottom": Math.round(
|
|
1189
|
+
"data-distance-from-bottom": Math.round(G),
|
|
1145
1190
|
onClick: () => {
|
|
1146
|
-
if (
|
|
1147
|
-
|
|
1191
|
+
if (T) {
|
|
1192
|
+
T();
|
|
1148
1193
|
return;
|
|
1149
1194
|
}
|
|
1150
|
-
let e =
|
|
1195
|
+
let e = D.current;
|
|
1151
1196
|
e && e.scrollTo({
|
|
1152
1197
|
top: e.scrollHeight,
|
|
1153
1198
|
behavior: "auto"
|
|
@@ -1155,7 +1200,7 @@ function Me({ agentName: e, emptyState: t, isMobile: n, isStreaming: r, activity
|
|
|
1155
1200
|
},
|
|
1156
1201
|
className: "sticky bottom-4 left-1/2 z-20 mx-auto flex h-9 w-9 -translate-x-1/2 items-center justify-center rounded-full border border-border bg-surface text-text-secondary shadow-[0_8px_24px_rgba(15,23,42,0.12)] transition hover:text-text-primary",
|
|
1157
1202
|
title: "回到底部",
|
|
1158
|
-
children: r ? /* @__PURE__ */
|
|
1203
|
+
children: r ? /* @__PURE__ */ V("span", {
|
|
1159
1204
|
"aria-hidden": "true",
|
|
1160
1205
|
className: "flex items-center gap-0.5",
|
|
1161
1206
|
"data-scroll-indicator": "streaming",
|
|
@@ -1163,11 +1208,11 @@ function Me({ agentName: e, emptyState: t, isMobile: n, isStreaming: r, activity
|
|
|
1163
1208
|
0,
|
|
1164
1209
|
1,
|
|
1165
1210
|
2
|
|
1166
|
-
].map((e) => /* @__PURE__ */
|
|
1211
|
+
].map((e) => /* @__PURE__ */ V("span", {
|
|
1167
1212
|
className: "h-1 w-1 animate-bounce rounded-full bg-current motion-reduce:animate-none",
|
|
1168
1213
|
style: { animationDelay: `${e * 120}ms` }
|
|
1169
1214
|
}, e))
|
|
1170
|
-
}) : /* @__PURE__ */
|
|
1215
|
+
}) : /* @__PURE__ */ V(w, {
|
|
1171
1216
|
"aria-hidden": "true",
|
|
1172
1217
|
className: "h-5 w-5",
|
|
1173
1218
|
"data-scroll-indicator": "idle"
|
|
@@ -1178,27 +1223,27 @@ function Me({ agentName: e, emptyState: t, isMobile: n, isStreaming: r, activity
|
|
|
1178
1223
|
}
|
|
1179
1224
|
//#endregion
|
|
1180
1225
|
//#region src/utils/session-message-history.ts
|
|
1181
|
-
function
|
|
1226
|
+
function Le(e) {
|
|
1182
1227
|
return e.requestedSessionId === e.activeSessionId && e.requestToken === e.activeRequestToken;
|
|
1183
1228
|
}
|
|
1184
1229
|
//#endregion
|
|
1185
1230
|
//#region src/components/chat/ConnectedMessageList.tsx
|
|
1186
|
-
function
|
|
1187
|
-
let D = d((e) => e.messages), O = e((e) => e.currentSessionId), k = e((e) => e.isLoadingSessions), A = n((e) => e.isSessionStreaming(O)), j = n((e) => e.getSessionActivity(O)), M = u((e) => e.getSessionCheckpoints(O)), N = e((e) => O ? e.messageHistory[O] : null), P = k || !!N?.isLoadingInitial, F = e((e) => e.sessions.find((e) => e.SessionId === O)?.ContextUsage), I = r((e) => e.availableModels), L = r((e) => e.selectedModel), R = t((e) => e.previewAttachment), z = t((e) => e.previewImageSize),
|
|
1231
|
+
function Re({ agentName: i, emptyState: a, isMobile: s, onDeleteFeedback: l, onSubmitFeedback: f, onRespondToApproval: p, onRespondToAguiApproval: m, onSubmitAguiAction: h, onStopGeneration: g, onCancelRemote: y, agentBlockActions: S, checkpointResumeEnabled: ee = !1, onResumeCheckpoint: C, onLoadOlderSessionMessages: w, onRetryHistory: T, interactionRecords: te, className: ne, revealMessage: E }) {
|
|
1232
|
+
let D = d((e) => e.messages), O = e((e) => e.currentSessionId), k = e((e) => e.isLoadingSessions), A = n((e) => e.isSessionStreaming(O)), j = n((e) => e.getSessionActivity(O)), M = u((e) => e.getSessionCheckpoints(O)), N = e((e) => O ? e.messageHistory[O] : null), P = k || !!N?.isLoadingInitial, F = e((e) => e.sessions.find((e) => e.SessionId === O)?.ContextUsage), I = r((e) => e.availableModels), L = r((e) => e.selectedModel), R = t((e) => e.previewAttachment), z = t((e) => e.previewImageSize), U = x(null), W = x(!0), G = x(!1), K = x(0), q = x(A), J = x(!1), Y = x(null), X = x(!0), Z = x(""), Q = x(E);
|
|
1188
1233
|
v(() => {
|
|
1189
1234
|
Q.current = E;
|
|
1190
1235
|
});
|
|
1191
|
-
let
|
|
1192
|
-
selectedModel:
|
|
1236
|
+
let re = b(() => I.find((e) => e.id === L) || null, [I, L]), ie = b(() => o({
|
|
1237
|
+
selectedModel: re,
|
|
1193
1238
|
contextUsage: F
|
|
1194
|
-
}), [
|
|
1195
|
-
let e =
|
|
1239
|
+
}), [re, F]), ae = D.reduce((e, t, n) => t.role === "user" ? n : e, -1), oe = A && !D.slice(ae + 1).some((e) => !!(e.role === "model" && (e.content || e.reasoning || e.blocks?.some((e) => e.type === "text" || e.type === "thinking" ? e.content : !0) || e.attachments?.length || e.a2ui || e.aguiActivity || e.aguiActivities?.length || Object.keys(e.tools || {}).length))), $ = _(() => {
|
|
1240
|
+
let e = U.current;
|
|
1196
1241
|
if (!e) return;
|
|
1197
|
-
|
|
1242
|
+
W.current = !0, G.current = !1;
|
|
1198
1243
|
let t = e.style.scrollBehavior;
|
|
1199
1244
|
e.style.scrollBehavior = "auto";
|
|
1200
1245
|
let n = 0, r = 0, i = -1, a = () => {
|
|
1201
|
-
if (
|
|
1246
|
+
if (U.current === e) {
|
|
1202
1247
|
if (e.scrollTop = e.scrollHeight, K.current = e.scrollTop, e.dispatchEvent(new Event("scroll")), r = e.scrollHeight === i ? r + 1 : 0, i = e.scrollHeight, n += 1, r >= 3 || n >= 12) {
|
|
1203
1248
|
e.style.scrollBehavior = t;
|
|
1204
1249
|
return;
|
|
@@ -1211,33 +1256,33 @@ function Pe({ agentName: i, emptyState: a, isMobile: s, onDeleteFeedback: l, onS
|
|
|
1211
1256
|
return v(() => {
|
|
1212
1257
|
q.current = A;
|
|
1213
1258
|
}, [A]), v(() => {
|
|
1214
|
-
X.current = !0,
|
|
1259
|
+
X.current = !0, W.current = !0, G.current = !1, K.current = 0, J.current = !1, Y.current = null, Z.current = "";
|
|
1215
1260
|
}, [O]), v(() => {
|
|
1216
|
-
E && (
|
|
1261
|
+
E && (W.current = !1, G.current = !0, X.current = !1);
|
|
1217
1262
|
}, [E]), v(() => {
|
|
1218
1263
|
let e = D.at(-1), t = Z.current;
|
|
1219
1264
|
Z.current = String(e?.id || ""), e?.role === "user" && e.id !== t && !X.current && $();
|
|
1220
1265
|
}, [D, $]), v(() => {
|
|
1221
|
-
let t =
|
|
1266
|
+
let t = U.current;
|
|
1222
1267
|
if (!t) return;
|
|
1223
1268
|
let n = () => {
|
|
1224
1269
|
let n = t.scrollHeight - t.scrollTop - t.clientHeight, r = t.scrollTop < K.current - 2;
|
|
1225
1270
|
if (K.current = t.scrollTop, !X.current && r && t.scrollTop < 200 && O && N?.hasMore && !N.isLoadingOlder && !J.current && w) {
|
|
1226
1271
|
let n = t.scrollHeight, r = O, i = Symbol(r);
|
|
1227
1272
|
J.current = !0, Y.current = i, w(r).then(() => {
|
|
1228
|
-
|
|
1273
|
+
Le({
|
|
1229
1274
|
requestedSessionId: r,
|
|
1230
1275
|
activeSessionId: e.getState().currentSessionId,
|
|
1231
1276
|
requestToken: i,
|
|
1232
1277
|
activeRequestToken: Y.current
|
|
1233
1278
|
}) && requestAnimationFrame(() => {
|
|
1234
|
-
if (!
|
|
1279
|
+
if (!Le({
|
|
1235
1280
|
requestedSessionId: r,
|
|
1236
1281
|
activeSessionId: e.getState().currentSessionId,
|
|
1237
1282
|
requestToken: i,
|
|
1238
1283
|
activeRequestToken: Y.current
|
|
1239
1284
|
})) return;
|
|
1240
|
-
let t =
|
|
1285
|
+
let t = U.current;
|
|
1241
1286
|
if (!t) return;
|
|
1242
1287
|
let a = t.scrollHeight - n;
|
|
1243
1288
|
t.scrollTop += a, K.current = t.scrollTop;
|
|
@@ -1247,15 +1292,15 @@ function Pe({ agentName: i, emptyState: a, isMobile: s, onDeleteFeedback: l, onS
|
|
|
1247
1292
|
});
|
|
1248
1293
|
}
|
|
1249
1294
|
if (q.current && r) {
|
|
1250
|
-
G.current = !0,
|
|
1295
|
+
G.current = !0, W.current = !1;
|
|
1251
1296
|
return;
|
|
1252
1297
|
}
|
|
1253
1298
|
if (G.current) {
|
|
1254
1299
|
let e = n <= 12;
|
|
1255
|
-
G.current = !e,
|
|
1300
|
+
G.current = !e, W.current = e;
|
|
1256
1301
|
return;
|
|
1257
1302
|
}
|
|
1258
|
-
|
|
1303
|
+
W.current = n < 96;
|
|
1259
1304
|
};
|
|
1260
1305
|
return n(), t.addEventListener("scroll", n, { passive: !0 }), () => t.removeEventListener("scroll", n);
|
|
1261
1306
|
}, [
|
|
@@ -1263,20 +1308,20 @@ function Pe({ agentName: i, emptyState: a, isMobile: s, onDeleteFeedback: l, onS
|
|
|
1263
1308
|
O,
|
|
1264
1309
|
w
|
|
1265
1310
|
]), v(() => {
|
|
1266
|
-
let e =
|
|
1311
|
+
let e = U.current;
|
|
1267
1312
|
if (!e || typeof ResizeObserver > "u") return;
|
|
1268
1313
|
let t = new ResizeObserver(() => {
|
|
1269
|
-
!X.current && !
|
|
1314
|
+
!X.current && !W.current || (e.scrollTop = e.scrollHeight, K.current = e.scrollTop, e.dispatchEvent(new Event("scroll")));
|
|
1270
1315
|
});
|
|
1271
1316
|
return t.observe(e), e.firstElementChild instanceof HTMLElement && t.observe(e.firstElementChild), () => t.disconnect();
|
|
1272
1317
|
}, [O]), v(() => {
|
|
1273
|
-
let t =
|
|
1318
|
+
let t = U.current;
|
|
1274
1319
|
if (t) {
|
|
1275
1320
|
if (D.length > 0 && X.current) {
|
|
1276
|
-
let t = Q.current, n = e.getState().currentSessionId, r =
|
|
1321
|
+
let t = Q.current, n = e.getState().currentSessionId, r = U.current, i = r ? r.style.scrollBehavior : "";
|
|
1277
1322
|
r && (r.style.scrollBehavior = "auto", r.scrollTop = r.scrollHeight, K.current = r.scrollTop);
|
|
1278
1323
|
let a = 0, o = r?.scrollHeight ?? -1, s = !1, c = 0, l = () => {
|
|
1279
|
-
let e =
|
|
1324
|
+
let e = U.current;
|
|
1280
1325
|
e && (e.scrollTop = e.scrollHeight, K.current = e.scrollTop, e.dispatchEvent(new Event("scroll")));
|
|
1281
1326
|
}, u = () => {
|
|
1282
1327
|
if (!s) {
|
|
@@ -1284,7 +1329,7 @@ function Pe({ agentName: i, emptyState: a, isMobile: s, onDeleteFeedback: l, onS
|
|
|
1284
1329
|
r && (r.style.scrollBehavior = i);
|
|
1285
1330
|
return;
|
|
1286
1331
|
}
|
|
1287
|
-
l(), r && (r.style.scrollBehavior = i),
|
|
1332
|
+
l(), r && (r.style.scrollBehavior = i), W.current = !0, G.current = !1, X.current = !1;
|
|
1288
1333
|
}
|
|
1289
1334
|
}, d = () => {
|
|
1290
1335
|
if (s) return;
|
|
@@ -1296,7 +1341,7 @@ function Pe({ agentName: i, emptyState: a, isMobile: s, onDeleteFeedback: l, onS
|
|
|
1296
1341
|
s = !0;
|
|
1297
1342
|
return;
|
|
1298
1343
|
}
|
|
1299
|
-
let r =
|
|
1344
|
+
let r = U.current;
|
|
1300
1345
|
if (r) {
|
|
1301
1346
|
if (r.scrollHeight !== o) o = r.scrollHeight, l(), a = 0;
|
|
1302
1347
|
else if (a += 1, a >= 3) {
|
|
@@ -1314,48 +1359,75 @@ function Pe({ agentName: i, emptyState: a, isMobile: s, onDeleteFeedback: l, onS
|
|
|
1314
1359
|
r && (r.style.scrollBehavior = i);
|
|
1315
1360
|
};
|
|
1316
1361
|
}
|
|
1317
|
-
|
|
1362
|
+
W.current && (t.scrollTop = t.scrollHeight, K.current = t.scrollTop);
|
|
1318
1363
|
}
|
|
1319
1364
|
}, [
|
|
1320
1365
|
D,
|
|
1321
1366
|
A,
|
|
1322
1367
|
E
|
|
1323
|
-
]), /* @__PURE__ */
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1368
|
+
]), /* @__PURE__ */ H(B, { children: [
|
|
1369
|
+
N?.persistenceDegraded && /* @__PURE__ */ V("div", {
|
|
1370
|
+
role: "status",
|
|
1371
|
+
"data-testid": "history-persistence-warning",
|
|
1372
|
+
className: "mx-auto w-full max-w-3xl px-6 py-2 text-sm text-amber-700 dark:text-amber-300",
|
|
1373
|
+
children: "当前会话历史尚未持久化。刷新或切换设备后,部分消息可能无法恢复。"
|
|
1374
|
+
}),
|
|
1375
|
+
N?.error && /* @__PURE__ */ H("div", {
|
|
1376
|
+
role: "alert",
|
|
1377
|
+
"data-testid": "history-reload-error",
|
|
1378
|
+
className: "mx-auto w-full max-w-3xl px-6 py-2 text-sm text-red-700 dark:text-red-300",
|
|
1379
|
+
children: [N.error, T && O && /* @__PURE__ */ V("button", {
|
|
1380
|
+
type: "button",
|
|
1381
|
+
className: "ml-3 underline",
|
|
1382
|
+
onClick: () => void T(O),
|
|
1383
|
+
children: "重试"
|
|
1384
|
+
})]
|
|
1385
|
+
}),
|
|
1386
|
+
N?.preparing && /* @__PURE__ */ V("div", {
|
|
1387
|
+
role: "status",
|
|
1388
|
+
"data-testid": "history-preparing",
|
|
1389
|
+
className: "mx-auto w-full max-w-3xl px-6 py-2 text-sm",
|
|
1390
|
+
children: "历史正在准备,请稍候。"
|
|
1391
|
+
}),
|
|
1392
|
+
/* @__PURE__ */ V(Ie, {
|
|
1393
|
+
revealMessage: E,
|
|
1394
|
+
emptyState: N?.error || N?.preparing ? null : a,
|
|
1395
|
+
agentName: i,
|
|
1396
|
+
isMobile: s,
|
|
1397
|
+
isStreaming: A,
|
|
1398
|
+
activity: j,
|
|
1399
|
+
contextIndicator: ie,
|
|
1400
|
+
messages: D,
|
|
1401
|
+
showWaitingIndicator: oe,
|
|
1402
|
+
isLoadingInitialHistory: P,
|
|
1403
|
+
onDeleteFeedback: l,
|
|
1404
|
+
onOpenAttachmentPreview: (e) => {
|
|
1405
|
+
t.getState().setPreviewAttachment(e), t.getState().setPreviewImageSize(null);
|
|
1406
|
+
},
|
|
1407
|
+
onRespondToApproval: p,
|
|
1408
|
+
onRespondToAguiApproval: m,
|
|
1409
|
+
interactionRecords: te,
|
|
1410
|
+
onScrollToBottom: $,
|
|
1411
|
+
onSubmitFeedback: f,
|
|
1412
|
+
onSubmitAguiAction: h,
|
|
1413
|
+
onStopGeneration: g,
|
|
1414
|
+
onCancelRemote: y,
|
|
1415
|
+
agentBlockActions: S,
|
|
1416
|
+
checkpoints: ee ? M : [],
|
|
1417
|
+
onResumeCheckpoint: C,
|
|
1418
|
+
scrollRef: U,
|
|
1419
|
+
className: ne
|
|
1420
|
+
}),
|
|
1421
|
+
/* @__PURE__ */ V(c, {
|
|
1422
|
+
attachment: R,
|
|
1423
|
+
isMobile: s,
|
|
1424
|
+
previewImageSize: z,
|
|
1425
|
+
onClose: () => {
|
|
1426
|
+
t.getState().setPreviewAttachment(null), t.getState().setPreviewImageSize(null);
|
|
1427
|
+
},
|
|
1428
|
+
onImageLoad: (e) => t.getState().setPreviewImageSize(e)
|
|
1429
|
+
})
|
|
1430
|
+
] });
|
|
1359
1431
|
}
|
|
1360
1432
|
//#endregion
|
|
1361
|
-
export {
|
|
1433
|
+
export { me as a, he as i, Ie as n, de as o, _e as r, Y as s, Re as t };
|