@saluzi/saluzi-edu 0.2.72 → 0.2.75
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/dist/cli.js +51 -51
- package/dist/rcs-web/assets/{AdminPanel-8HNxSZw0.js → AdminPanel-DGyc0uGQ.js} +1 -1
- package/dist/rcs-web/assets/ArtifactView-DDhb3d8t.js +6 -0
- package/dist/rcs-web/assets/ArtifactsGallery-MEE_QDjK.js +431 -0
- package/{packages/remote-control-server/web/dist/assets/Claim-Dfdhnggp.js → dist/rcs-web/assets/Claim-ChakqMPm.js} +1 -1
- package/dist/rcs-web/assets/{Dashboard-DnLE2gtW.js → Dashboard-CjO5dxyO.js} +2 -2
- package/dist/rcs-web/assets/{Join-Cgq7v-Sb.js → Join-DpcwWZDc.js} +1 -1
- package/dist/rcs-web/assets/{Login-CpRVSamw.js → Login-CPvnrMgA.js} +1 -1
- package/dist/rcs-web/assets/{Register-CvCuP-ww.js → Register-COSDEhaV.js} +1 -1
- package/dist/rcs-web/assets/SessionDetail-Be3UG4sF.js +60 -0
- package/dist/rcs-web/assets/{SessionVisibilityBadge-7ElYQ4hP.js → SessionVisibilityBadge-Dy3ZGawS.js} +1 -1
- package/dist/rcs-web/assets/{Setup-DH5NCalW.js → Setup-BBB5PmwE.js} +1 -1
- package/dist/rcs-web/assets/{ShareLanding-B48Z1tak.js → ShareLanding-DU4f7Pz3.js} +1 -1
- package/dist/rcs-web/assets/{TeamCreate-tXM5yKmq.js → TeamCreate-ovX7IiX2.js} +1 -1
- package/dist/rcs-web/assets/{TeamDetail-3jPhrX5z.js → TeamDetail-DG-YTHaa.js} +2 -2
- package/dist/rcs-web/assets/{TeamList-DylGNt59.js → TeamList-CHOWUmik.js} +1 -1
- package/dist/rcs-web/assets/{TeamSettings-CoBx_q55.js → TeamSettings-BLpkrRcY.js} +1 -1
- package/dist/rcs-web/assets/{UserSearchInput-DM6V0r1B.js → UserSearchInput-74J0KF8K.js} +1 -1
- package/dist/rcs-web/assets/{UserSettings-CxuLje2z.js → UserSettings-IyrqBc1i.js} +1 -1
- package/dist/rcs-web/assets/{arc-BrQup1CU.js → arc-CeNXRXGX.js} +1 -1
- package/dist/rcs-web/assets/{architectureDiagram-3BPJPVTR-l1NuwJAC.js → architectureDiagram-3BPJPVTR-CW4HgXmr.js} +1 -1
- package/{packages/remote-control-server/web/dist/assets/blockDiagram-GPEHLZMM-CVNyoBQm.js → dist/rcs-web/assets/blockDiagram-GPEHLZMM-cpLXlmVg.js} +1 -1
- package/dist/rcs-web/assets/{c4Diagram-AAUBKEIU-C8IgW5pQ.js → c4Diagram-AAUBKEIU-CXMkSvWS.js} +1 -1
- package/dist/rcs-web/assets/channel-B6COvzyD.js +1 -0
- package/dist/rcs-web/assets/{chunk-2J33WTMH-Cz-fnX8Q.js → chunk-2J33WTMH-DEyGFBzH.js} +1 -1
- package/dist/rcs-web/assets/{chunk-4BX2VUAB-s0k1FsPS.js → chunk-4BX2VUAB-DxXT6eP4.js} +1 -1
- package/dist/rcs-web/assets/{chunk-55IACEB6-k7MztSxj.js → chunk-55IACEB6-HmgmzBnH.js} +1 -1
- package/{packages/remote-control-server/web/dist/assets/chunk-727SXJPM-DCD6b_gA.js → dist/rcs-web/assets/chunk-727SXJPM-CuZJw90P.js} +1 -1
- package/{packages/remote-control-server/web/dist/assets/chunk-AQP2D5EJ-ByLnKNaa.js → dist/rcs-web/assets/chunk-AQP2D5EJ-CDt2hrLS.js} +1 -1
- package/dist/rcs-web/assets/{chunk-FMBD7UC4-DnoA9fQr.js → chunk-FMBD7UC4-CvdHuOMd.js} +1 -1
- package/dist/rcs-web/assets/{chunk-ND2GUHAM-BsbvPHC6.js → chunk-ND2GUHAM-XAkimgx-.js} +1 -1
- package/dist/rcs-web/assets/{chunk-QZHKN3VN-DnHGOmkn.js → chunk-QZHKN3VN-yoNUbMoQ.js} +1 -1
- package/dist/rcs-web/assets/classDiagram-4FO5ZUOK-ChndRvEB.js +1 -0
- package/dist/rcs-web/assets/classDiagram-v2-Q7XG4LA2-ChndRvEB.js +1 -0
- package/dist/rcs-web/assets/{code-block-IT6T5CEO-Br6udBTB.js → code-block-IT6T5CEO-DpuW5otn.js} +1 -1
- package/dist/rcs-web/assets/{copy-BFkM6GS4.js → copy-Ds1kEyW_.js} +1 -1
- package/{packages/remote-control-server/web/dist/assets/cose-bilkent-S5V4N54A-ChN-rm-T.js → dist/rcs-web/assets/cose-bilkent-S5V4N54A-hxTzBVb7.js} +1 -1
- package/dist/rcs-web/assets/{dagre-BM42HDAG-Dy0qgRIV.js → dagre-BM42HDAG-BuaRh5_V.js} +1 -1
- package/dist/rcs-web/assets/{diagram-2AECGRRQ-ByiBm-x4.js → diagram-2AECGRRQ-CV1BNYv6.js} +1 -1
- package/dist/rcs-web/assets/{diagram-5GNKFQAL-rGbxhf-H.js → diagram-5GNKFQAL-BnD_0e2X.js} +1 -1
- package/dist/rcs-web/assets/{diagram-KO2AKTUF-COdwodvi.js → diagram-KO2AKTUF-d0FkGsys.js} +1 -1
- package/dist/rcs-web/assets/{diagram-LMA3HP47-EjqjzeZY.js → diagram-LMA3HP47-DJDP8Wb4.js} +1 -1
- package/dist/rcs-web/assets/{diagram-OG6HWLK6-DSPVSdmJ.js → diagram-OG6HWLK6-Cv9tZ0_x.js} +1 -1
- package/{packages/remote-control-server/web/dist/assets/dialog-aHICCHyK.js → dist/rcs-web/assets/dialog-ybaqiKM_.js} +1 -1
- package/{packages/remote-control-server/web/dist/assets/erDiagram-TEJ5UH35-DZBAaLMb.js → dist/rcs-web/assets/erDiagram-TEJ5UH35-C1CfRkws.js} +1 -1
- package/dist/rcs-web/assets/{flowDiagram-I6XJVG4X-DJHAIGo5.js → flowDiagram-I6XJVG4X-DF7zb7Jc.js} +1 -1
- package/{packages/remote-control-server/web/dist/assets/ganttDiagram-6RSMTGT7-DEXe0aC6.js → dist/rcs-web/assets/ganttDiagram-6RSMTGT7-CVSVHZ1u.js} +1 -1
- package/{packages/remote-control-server/web/dist/assets/gitGraphDiagram-PVQCEYII-D35WJeQv.js → dist/rcs-web/assets/gitGraphDiagram-PVQCEYII-BBUoSgjZ.js} +1 -1
- package/dist/rcs-web/assets/{infoDiagram-5YYISTIA-n-NVaNrp.js → infoDiagram-5YYISTIA-BUweKrDn.js} +1 -1
- package/dist/rcs-web/assets/{ishikawaDiagram-YF4QCWOH-D7nU29iu.js → ishikawaDiagram-YF4QCWOH-Cxoo0QxE.js} +1 -1
- package/dist/rcs-web/assets/{journeyDiagram-JHISSGLW-De0htrHG.js → journeyDiagram-JHISSGLW-Cnk8yKCW.js} +1 -1
- package/dist/rcs-web/assets/{kanban-definition-UN3LZRKU-C5rnfLlw.js → kanban-definition-UN3LZRKU-CzydxMee.js} +1 -1
- package/dist/rcs-web/assets/{linear-BkfmaOFV.js → linear-s8rprJB3.js} +1 -1
- package/dist/rcs-web/assets/main-C1pGF5LM.css +1 -0
- package/dist/rcs-web/assets/{main-2FF76CHO.js → main-Ckj6POvG.js} +21 -21
- package/dist/rcs-web/assets/{mermaid-VLURNSYL-CAb8MsJr.js → mermaid-VLURNSYL-SYCFRjUp.js} +4 -4
- package/dist/rcs-web/assets/{mermaid.core-dT6jK4cB.js → mermaid.core-D2rxkNqs.js} +5 -5
- package/{packages/remote-control-server/web/dist/assets/mindmap-definition-RKZ34NQL-KBR776rc.js → dist/rcs-web/assets/mindmap-definition-RKZ34NQL-Chulk5pQ.js} +1 -1
- package/dist/rcs-web/assets/{pieDiagram-4H26LBE5-aGUqFGVT.js → pieDiagram-4H26LBE5-vbW5CLRY.js} +1 -1
- package/dist/rcs-web/assets/{quadrantDiagram-W4KKPZXB-DbWbBGjW.js → quadrantDiagram-W4KKPZXB-QiwEvUD3.js} +1 -1
- package/dist/rcs-web/assets/{requirementDiagram-4Y6WPE33-CRIIsSnh.js → requirementDiagram-4Y6WPE33-3zyJ_Stn.js} +1 -1
- package/{packages/remote-control-server/web/dist/assets/sankeyDiagram-5OEKKPKP-C1fZEOgo.js → dist/rcs-web/assets/sankeyDiagram-5OEKKPKP-C26JYqVD.js} +1 -1
- package/dist/rcs-web/assets/{sequenceDiagram-3UESZ5HK-DpwCRJwm.js → sequenceDiagram-3UESZ5HK-Cvt2g3dR.js} +1 -1
- package/dist/rcs-web/assets/{stateDiagram-AJRCARHV-Dx-tpSSo.js → stateDiagram-AJRCARHV-BAhPFgJ1.js} +1 -1
- package/dist/rcs-web/assets/{stateDiagram-v2-BHNVJYJU-DTEk3-eZ.js → stateDiagram-v2-BHNVJYJU-BBoo93U1.js} +1 -1
- package/dist/rcs-web/assets/{timeline-definition-PNZ67QCA-CUVrbUF6.js → timeline-definition-PNZ67QCA-BEsxhuSm.js} +1 -1
- package/dist/rcs-web/assets/{vennDiagram-CIIHVFJN-Bjoy1hva.js → vennDiagram-CIIHVFJN-BOKf8gTG.js} +1 -1
- package/dist/rcs-web/assets/{wardleyDiagram-YWT4CUSO-Xv7_ml_a.js → wardleyDiagram-YWT4CUSO-pt93Tqjm.js} +1 -1
- package/{packages/remote-control-server/web/dist/assets/xychartDiagram-2RQKCTM6-CMv6nVsy.js → dist/rcs-web/assets/xychartDiagram-2RQKCTM6-BVNPIQIv.js} +1 -1
- package/dist/rcs-web/index.html +2 -2
- package/package.json +3 -2
- package/packages/remote-control-server/src/__tests__/artifacts.test.ts +302 -0
- package/packages/remote-control-server/src/routes/web/artifacts.ts +78 -6
- package/packages/remote-control-server/src/services/artifacts.ts +57 -4
- package/packages/remote-control-server/src/services/event-persistence.ts +13 -4
- package/packages/remote-control-server/src/services/transport.ts +10 -0
- package/packages/remote-control-server/web/dist/assets/{AdminPanel-8HNxSZw0.js → AdminPanel-DGyc0uGQ.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/ArtifactView-DDhb3d8t.js +6 -0
- package/packages/remote-control-server/web/dist/assets/ArtifactsGallery-MEE_QDjK.js +431 -0
- package/{dist/rcs-web/assets/Claim-Dfdhnggp.js → packages/remote-control-server/web/dist/assets/Claim-ChakqMPm.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{Dashboard-DnLE2gtW.js → Dashboard-CjO5dxyO.js} +2 -2
- package/packages/remote-control-server/web/dist/assets/{Join-Cgq7v-Sb.js → Join-DpcwWZDc.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{Login-CpRVSamw.js → Login-CPvnrMgA.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{Register-CvCuP-ww.js → Register-COSDEhaV.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/SessionDetail-Be3UG4sF.js +60 -0
- package/packages/remote-control-server/web/dist/assets/{SessionVisibilityBadge-7ElYQ4hP.js → SessionVisibilityBadge-Dy3ZGawS.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{Setup-DH5NCalW.js → Setup-BBB5PmwE.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{ShareLanding-B48Z1tak.js → ShareLanding-DU4f7Pz3.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{TeamCreate-tXM5yKmq.js → TeamCreate-ovX7IiX2.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{TeamDetail-3jPhrX5z.js → TeamDetail-DG-YTHaa.js} +2 -2
- package/packages/remote-control-server/web/dist/assets/{TeamList-DylGNt59.js → TeamList-CHOWUmik.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{TeamSettings-CoBx_q55.js → TeamSettings-BLpkrRcY.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{UserSearchInput-DM6V0r1B.js → UserSearchInput-74J0KF8K.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{UserSettings-CxuLje2z.js → UserSettings-IyrqBc1i.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{arc-BrQup1CU.js → arc-CeNXRXGX.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{architectureDiagram-3BPJPVTR-l1NuwJAC.js → architectureDiagram-3BPJPVTR-CW4HgXmr.js} +1 -1
- package/{dist/rcs-web/assets/blockDiagram-GPEHLZMM-CVNyoBQm.js → packages/remote-control-server/web/dist/assets/blockDiagram-GPEHLZMM-cpLXlmVg.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{c4Diagram-AAUBKEIU-C8IgW5pQ.js → c4Diagram-AAUBKEIU-CXMkSvWS.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/channel-B6COvzyD.js +1 -0
- package/packages/remote-control-server/web/dist/assets/{chunk-2J33WTMH-Cz-fnX8Q.js → chunk-2J33WTMH-DEyGFBzH.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{chunk-4BX2VUAB-s0k1FsPS.js → chunk-4BX2VUAB-DxXT6eP4.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{chunk-55IACEB6-k7MztSxj.js → chunk-55IACEB6-HmgmzBnH.js} +1 -1
- package/{dist/rcs-web/assets/chunk-727SXJPM-DCD6b_gA.js → packages/remote-control-server/web/dist/assets/chunk-727SXJPM-CuZJw90P.js} +1 -1
- package/{dist/rcs-web/assets/chunk-AQP2D5EJ-ByLnKNaa.js → packages/remote-control-server/web/dist/assets/chunk-AQP2D5EJ-CDt2hrLS.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{chunk-FMBD7UC4-DnoA9fQr.js → chunk-FMBD7UC4-CvdHuOMd.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{chunk-ND2GUHAM-BsbvPHC6.js → chunk-ND2GUHAM-XAkimgx-.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{chunk-QZHKN3VN-DnHGOmkn.js → chunk-QZHKN3VN-yoNUbMoQ.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/classDiagram-4FO5ZUOK-ChndRvEB.js +1 -0
- package/packages/remote-control-server/web/dist/assets/classDiagram-v2-Q7XG4LA2-ChndRvEB.js +1 -0
- package/packages/remote-control-server/web/dist/assets/{code-block-IT6T5CEO-Br6udBTB.js → code-block-IT6T5CEO-DpuW5otn.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{copy-BFkM6GS4.js → copy-Ds1kEyW_.js} +1 -1
- package/{dist/rcs-web/assets/cose-bilkent-S5V4N54A-ChN-rm-T.js → packages/remote-control-server/web/dist/assets/cose-bilkent-S5V4N54A-hxTzBVb7.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{dagre-BM42HDAG-Dy0qgRIV.js → dagre-BM42HDAG-BuaRh5_V.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{diagram-2AECGRRQ-ByiBm-x4.js → diagram-2AECGRRQ-CV1BNYv6.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{diagram-5GNKFQAL-rGbxhf-H.js → diagram-5GNKFQAL-BnD_0e2X.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{diagram-KO2AKTUF-COdwodvi.js → diagram-KO2AKTUF-d0FkGsys.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{diagram-LMA3HP47-EjqjzeZY.js → diagram-LMA3HP47-DJDP8Wb4.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{diagram-OG6HWLK6-DSPVSdmJ.js → diagram-OG6HWLK6-Cv9tZ0_x.js} +1 -1
- package/{dist/rcs-web/assets/dialog-aHICCHyK.js → packages/remote-control-server/web/dist/assets/dialog-ybaqiKM_.js} +1 -1
- package/{dist/rcs-web/assets/erDiagram-TEJ5UH35-DZBAaLMb.js → packages/remote-control-server/web/dist/assets/erDiagram-TEJ5UH35-C1CfRkws.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{flowDiagram-I6XJVG4X-DJHAIGo5.js → flowDiagram-I6XJVG4X-DF7zb7Jc.js} +1 -1
- package/{dist/rcs-web/assets/ganttDiagram-6RSMTGT7-DEXe0aC6.js → packages/remote-control-server/web/dist/assets/ganttDiagram-6RSMTGT7-CVSVHZ1u.js} +1 -1
- package/{dist/rcs-web/assets/gitGraphDiagram-PVQCEYII-D35WJeQv.js → packages/remote-control-server/web/dist/assets/gitGraphDiagram-PVQCEYII-BBUoSgjZ.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{infoDiagram-5YYISTIA-n-NVaNrp.js → infoDiagram-5YYISTIA-BUweKrDn.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{ishikawaDiagram-YF4QCWOH-D7nU29iu.js → ishikawaDiagram-YF4QCWOH-Cxoo0QxE.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{journeyDiagram-JHISSGLW-De0htrHG.js → journeyDiagram-JHISSGLW-Cnk8yKCW.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{kanban-definition-UN3LZRKU-C5rnfLlw.js → kanban-definition-UN3LZRKU-CzydxMee.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{linear-BkfmaOFV.js → linear-s8rprJB3.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/main-C1pGF5LM.css +1 -0
- package/packages/remote-control-server/web/dist/assets/{main-2FF76CHO.js → main-Ckj6POvG.js} +21 -21
- package/packages/remote-control-server/web/dist/assets/{mermaid-VLURNSYL-CAb8MsJr.js → mermaid-VLURNSYL-SYCFRjUp.js} +4 -4
- package/packages/remote-control-server/web/dist/assets/{mermaid.core-dT6jK4cB.js → mermaid.core-D2rxkNqs.js} +5 -5
- package/{dist/rcs-web/assets/mindmap-definition-RKZ34NQL-KBR776rc.js → packages/remote-control-server/web/dist/assets/mindmap-definition-RKZ34NQL-Chulk5pQ.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{pieDiagram-4H26LBE5-aGUqFGVT.js → pieDiagram-4H26LBE5-vbW5CLRY.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{quadrantDiagram-W4KKPZXB-DbWbBGjW.js → quadrantDiagram-W4KKPZXB-QiwEvUD3.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{requirementDiagram-4Y6WPE33-CRIIsSnh.js → requirementDiagram-4Y6WPE33-3zyJ_Stn.js} +1 -1
- package/{dist/rcs-web/assets/sankeyDiagram-5OEKKPKP-C1fZEOgo.js → packages/remote-control-server/web/dist/assets/sankeyDiagram-5OEKKPKP-C26JYqVD.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{sequenceDiagram-3UESZ5HK-DpwCRJwm.js → sequenceDiagram-3UESZ5HK-Cvt2g3dR.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{stateDiagram-AJRCARHV-Dx-tpSSo.js → stateDiagram-AJRCARHV-BAhPFgJ1.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{stateDiagram-v2-BHNVJYJU-DTEk3-eZ.js → stateDiagram-v2-BHNVJYJU-BBoo93U1.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{timeline-definition-PNZ67QCA-CUVrbUF6.js → timeline-definition-PNZ67QCA-BEsxhuSm.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{vennDiagram-CIIHVFJN-Bjoy1hva.js → vennDiagram-CIIHVFJN-BOKf8gTG.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{wardleyDiagram-YWT4CUSO-Xv7_ml_a.js → wardleyDiagram-YWT4CUSO-pt93Tqjm.js} +1 -1
- package/{dist/rcs-web/assets/xychartDiagram-2RQKCTM6-CMv6nVsy.js → packages/remote-control-server/web/dist/assets/xychartDiagram-2RQKCTM6-BVNPIQIv.js} +1 -1
- package/packages/remote-control-server/web/dist/index.html +2 -2
- package/dist/rcs-web/assets/ArtifactView-2di4r0Cr.js +0 -6
- package/dist/rcs-web/assets/ArtifactsGallery-DQj98ptl.js +0 -339
- package/dist/rcs-web/assets/SessionDetail-CTa4JN6V.js +0 -60
- package/dist/rcs-web/assets/channel-DqfyWDcz.js +0 -1
- package/dist/rcs-web/assets/classDiagram-4FO5ZUOK-BC1-yHO5.js +0 -1
- package/dist/rcs-web/assets/classDiagram-v2-Q7XG4LA2-BC1-yHO5.js +0 -1
- package/dist/rcs-web/assets/external-link-Cb0Qh2uy.js +0 -6
- package/dist/rcs-web/assets/main-C2O-g177.css +0 -1
- package/packages/remote-control-server/web/dist/assets/ArtifactView-2di4r0Cr.js +0 -6
- package/packages/remote-control-server/web/dist/assets/ArtifactsGallery-DQj98ptl.js +0 -339
- package/packages/remote-control-server/web/dist/assets/SessionDetail-CTa4JN6V.js +0 -60
- package/packages/remote-control-server/web/dist/assets/channel-DqfyWDcz.js +0 -1
- package/packages/remote-control-server/web/dist/assets/classDiagram-4FO5ZUOK-BC1-yHO5.js +0 -1
- package/packages/remote-control-server/web/dist/assets/classDiagram-v2-Q7XG4LA2-BC1-yHO5.js +0 -1
- package/packages/remote-control-server/web/dist/assets/external-link-Cb0Qh2uy.js +0 -6
- package/packages/remote-control-server/web/dist/assets/main-C2O-g177.css +0 -1
|
@@ -1,339 +0,0 @@
|
|
|
1
|
-
import{e as i,j as e}from"./vendor-DE_-CLIE.js";import{ar as D,W as L,am as a,K as R,aa as B,F as M,g as K,z as A,p as S,H as P}from"./main-2FF76CHO.js";import{D as H,a as F,c as O,d as _,b as z}from"./dialog-aHICCHyK.js";import{E as $}from"./external-link-Cb0Qh2uy.js";import{C as q}from"./copy-BFkM6GS4.js";import"./shiki-mEP5vQQu.js";import"./motion-BILbV7YQ.js";const v=`body { font: 14px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; max-width: 860px; margin: 2rem auto; padding: 0 1rem; color: #1a1a1a; }
|
|
2
|
-
h1 { font-size: 22px; } h1, h2 { color: #1a1a1a; }
|
|
3
|
-
.badge { display: inline-block; border-radius: 999px; padding: 1px 10px; font-size: 12px; font-weight: 500; }
|
|
4
|
-
.badge.ok { background: #dcfce7; color: #166534; }
|
|
5
|
-
.badge.warn { background: #fef3c7; color: #92400e; }
|
|
6
|
-
.badge.err { background: #fee2e2; color: #991b1b; }
|
|
7
|
-
.badge.info { background: #e0e7ff; color: #3730a3; }
|
|
8
|
-
.muted { color: #6b7280; font-size: 12px; }
|
|
9
|
-
.meta { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin: 8px 0 20px; }`,G=`<!DOCTYPE html>
|
|
10
|
-
<html lang="en">
|
|
11
|
-
<head>
|
|
12
|
-
<meta charset="utf-8">
|
|
13
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
14
|
-
<title>Untitled Artifact</title>
|
|
15
|
-
<style>
|
|
16
|
-
${v}
|
|
17
|
-
</style>
|
|
18
|
-
</head>
|
|
19
|
-
<body>
|
|
20
|
-
<h1>Untitled Artifact</h1>
|
|
21
|
-
<div class="meta"><span class="muted">Created from the RCS artifacts gallery</span></div>
|
|
22
|
-
<!-- content here -->
|
|
23
|
-
</body>
|
|
24
|
-
</html>`,V=`<!DOCTYPE html>
|
|
25
|
-
<html lang="en">
|
|
26
|
-
<head>
|
|
27
|
-
<meta charset="utf-8">
|
|
28
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
29
|
-
<title>PR Review</title>
|
|
30
|
-
<style>
|
|
31
|
-
${v}
|
|
32
|
-
.file { border: 1px solid #e5e7eb; border-radius: 8px; margin: 12px 0; overflow: hidden; }
|
|
33
|
-
.file-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #f9fafb; cursor: pointer; }
|
|
34
|
-
.file-head .name { font-family: ui-monospace, Menlo, monospace; font-size: 13px; flex: 1; }
|
|
35
|
-
.file-body { padding: 12px 14px; border-top: 1px solid #e5e7eb; display: none; }
|
|
36
|
-
.file.open .file-body { display: block; }
|
|
37
|
-
.comment { background: #fffbeb; border-left: 3px solid #f59e0b; padding: 8px 12px; margin: 8px 0; border-radius: 4px; font-size: 13px; }
|
|
38
|
-
select { font: inherit; padding: 2px 6px; border-radius: 6px; border: 1px solid #d1d5db; }
|
|
39
|
-
#summary { font-size: 13px; }
|
|
40
|
-
</style>
|
|
41
|
-
</head>
|
|
42
|
-
<body>
|
|
43
|
-
<h1>PR Review — <span id="pr-name">#123</span></h1>
|
|
44
|
-
<div class="meta">
|
|
45
|
-
<span class="badge info" id="overall">REVIEW IN PROGRESS</span>
|
|
46
|
-
<span class="muted" id="stamp"></span>
|
|
47
|
-
</div>
|
|
48
|
-
<div id="summary"></div>
|
|
49
|
-
<div id="files"></div>
|
|
50
|
-
<script>
|
|
51
|
-
var FILES = [
|
|
52
|
-
{ path: 'src/index.ts', verdict: 'comment', lines: '+42 −7',
|
|
53
|
-
note: '入口重构 — 建议补充 JSDoc。' },
|
|
54
|
-
{ path: 'src/utils/http.ts', verdict: 'request-changes', lines: '+128 −31',
|
|
55
|
-
note: '缺少超时与重试;error path 未释放连接。' },
|
|
56
|
-
{ path: 'tests/http.test.ts', verdict: 'approve', lines: '+96 −0',
|
|
57
|
-
note: '覆盖充分,LGTM。' },
|
|
58
|
-
];
|
|
59
|
-
var VERDICTS = {
|
|
60
|
-
'approve': ['✓ Approve', 'ok'],
|
|
61
|
-
'comment': ['💬 Comment', 'info'],
|
|
62
|
-
'request-changes': ['✕ Request changes', 'err'],
|
|
63
|
-
};
|
|
64
|
-
function render() {
|
|
65
|
-
var box = document.getElementById('files');
|
|
66
|
-
box.innerHTML = '';
|
|
67
|
-
var counts = { 'approve': 0, 'comment': 0, 'request-changes': 0 };
|
|
68
|
-
FILES.forEach(function (f, i) {
|
|
69
|
-
counts[f.verdict]++;
|
|
70
|
-
var div = document.createElement('div');
|
|
71
|
-
div.className = 'file';
|
|
72
|
-
div.innerHTML =
|
|
73
|
-
'<div class="file-head"><span class="name">' + f.path + '</span>' +
|
|
74
|
-
'<span class="muted">' + f.lines + '</span>' +
|
|
75
|
-
'<select data-i="' + i + '">' + Object.keys(VERDICTS).map(function (v) {
|
|
76
|
-
return '<option value="' + v + '"' + (v === f.verdict ? ' selected' : '') + '>' + VERDICTS[v][0] + '</option>';
|
|
77
|
-
}).join('') + '</select></div>' +
|
|
78
|
-
'<div class="file-body"><div class="comment">' + (f.note || '—') + '</div></div>';
|
|
79
|
-
div.querySelector('.file-head').addEventListener('click', function () {
|
|
80
|
-
div.classList.toggle('open');
|
|
81
|
-
});
|
|
82
|
-
div.querySelector('select').addEventListener('click', function (e) { e.stopPropagation(); });
|
|
83
|
-
div.querySelector('select').addEventListener('change', function (e) {
|
|
84
|
-
FILES[i].verdict = e.target.value;
|
|
85
|
-
render();
|
|
86
|
-
});
|
|
87
|
-
box.appendChild(div);
|
|
88
|
-
});
|
|
89
|
-
var overall = document.getElementById('overall');
|
|
90
|
-
var label = 'REVIEW IN PROGRESS';
|
|
91
|
-
var cls = 'info';
|
|
92
|
-
if (counts['request-changes'] > 0) { label = 'CHANGES REQUESTED'; cls = 'err'; }
|
|
93
|
-
else if (counts['approve'] === FILES.length && FILES.length > 0) { label = 'APPROVED'; cls = 'ok'; }
|
|
94
|
-
overall.textContent = label;
|
|
95
|
-
overall.className = 'badge ' + cls;
|
|
96
|
-
document.getElementById('summary').innerHTML =
|
|
97
|
-
'<span class="badge ok">✓ ' + counts['approve'] + '</span> ' +
|
|
98
|
-
'<span class="badge info">💬 ' + counts['comment'] + '</span> ' +
|
|
99
|
-
'<span class="badge err">✕ ' + counts['request-changes'] + '</span> ' +
|
|
100
|
-
'<span class="muted"> — 点击文件行展开评论</span>';
|
|
101
|
-
document.getElementById('stamp').textContent = 'updated ' + new Date().toLocaleString();
|
|
102
|
-
}
|
|
103
|
-
render();
|
|
104
|
-
<\/script>
|
|
105
|
-
</body>
|
|
106
|
-
</html>`,W=`<!DOCTYPE html>
|
|
107
|
-
<html lang="en">
|
|
108
|
-
<head>
|
|
109
|
-
<meta charset="utf-8">
|
|
110
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
111
|
-
<title>Incident Timeline</title>
|
|
112
|
-
<style>
|
|
113
|
-
${v}
|
|
114
|
-
#status-banner { border-radius: 8px; padding: 12px 16px; margin: 12px 0; font-weight: 500; }
|
|
115
|
-
#status-banner.investigating { background: #fef3c7; color: #92400e; }
|
|
116
|
-
#status-banner.mitigated { background: #dcfce7; color: #166534; }
|
|
117
|
-
#status-banner.resolved { background: #e0e7ff; color: #3730a3; }
|
|
118
|
-
.tl { list-style: none; padding: 0; margin: 20px 0; border-left: 2px solid #e5e7eb; }
|
|
119
|
-
.tl li { position: relative; padding: 10px 0 10px 24px; }
|
|
120
|
-
.tl li::before { content: ''; position: absolute; left: -6px; top: 16px; width: 10px; height: 10px; border-radius: 999px; background: #9ca3af; }
|
|
121
|
-
.tl li.sev-high::before { background: #ef4444; }
|
|
122
|
-
.tl li.sev-mid::before { background: #f59e0b; }
|
|
123
|
-
.tl li.done::before { background: #22c55e; }
|
|
124
|
-
.tl .ts { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: #6b7280; }
|
|
125
|
-
.tl .body { margin-top: 2px; }
|
|
126
|
-
button { font: inherit; border: 1px solid #d1d5db; background: #fff; border-radius: 6px; padding: 2px 10px; cursor: pointer; }
|
|
127
|
-
button:hover { background: #f3f4f6; }
|
|
128
|
-
</style>
|
|
129
|
-
</head>
|
|
130
|
-
<body>
|
|
131
|
-
<h1 id="title">INC-001 — API 5xx 错误率上升</h1>
|
|
132
|
-
<div id="status-banner" class="investigating">🟡 Investigating</div>
|
|
133
|
-
<div class="meta">
|
|
134
|
-
<span class="muted" id="timer"></span>
|
|
135
|
-
<button id="toggle">标记为已缓解</button>
|
|
136
|
-
</div>
|
|
137
|
-
<ul class="tl" id="tl"></ul>
|
|
138
|
-
<script>
|
|
139
|
-
var EVENTS = [
|
|
140
|
-
{ ts: '10:02', sev: 'high', text: '告警触发:/api/orders 5xx 比例 > 5%(SLO 燃烧率 8×)' },
|
|
141
|
-
{ ts: '10:05', sev: '', text: '值班开始排查,确认影响范围:下单链路全量受影响' },
|
|
142
|
-
{ ts: '10:12', sev: 'mid', text: '定位到 09:58 上线的 order-service v2.3.1,连接池配置回归' },
|
|
143
|
-
{ ts: '10:18', sev: '', text: '回滚 order-service 至 v2.3.0', done: true },
|
|
144
|
-
{ ts: '10:21', sev: '', text: '错误率恢复正常,持续观察中', done: true },
|
|
145
|
-
];
|
|
146
|
-
var state = 'investigating';
|
|
147
|
-
function render() {
|
|
148
|
-
var tl = document.getElementById('tl');
|
|
149
|
-
tl.innerHTML = '';
|
|
150
|
-
EVENTS.forEach(function (e) {
|
|
151
|
-
var li = document.createElement('li');
|
|
152
|
-
li.className = (e.sev ? 'sev-' + (e.sev === 'high' ? 'high' : 'mid') + ' ' : '') + (e.done ? 'done' : '');
|
|
153
|
-
li.innerHTML = '<span class="ts">' + e.ts + '</span><div class="body">' + e.text + '</div>';
|
|
154
|
-
tl.appendChild(li);
|
|
155
|
-
});
|
|
156
|
-
var banner = document.getElementById('status-banner');
|
|
157
|
-
var texts = { investigating: ['🟡 Investigating', 'mitigated'], mitigated: ['🟢 Mitigated — monitoring', 'resolved'], resolved: ['🔵 Resolved', 'investigating'] };
|
|
158
|
-
banner.textContent = texts[state][0];
|
|
159
|
-
banner.className = state;
|
|
160
|
-
document.getElementById('toggle').textContent =
|
|
161
|
-
state === 'investigating' ? '标记为已缓解' : state === 'mitigated' ? '标记为已解决' : '重新打开';
|
|
162
|
-
document.getElementById('timer').textContent = 'last update ' + new Date().toLocaleTimeString();
|
|
163
|
-
}
|
|
164
|
-
document.getElementById('toggle').addEventListener('click', function () {
|
|
165
|
-
state = document.getElementById('status-banner').className === 'investigating' ? 'mitigated'
|
|
166
|
-
: document.getElementById('status-banner').className === 'mitigated' ? 'resolved' : 'investigating';
|
|
167
|
-
render();
|
|
168
|
-
});
|
|
169
|
-
render();
|
|
170
|
-
<\/script>
|
|
171
|
-
</body>
|
|
172
|
-
</html>`,U=`<!DOCTYPE html>
|
|
173
|
-
<html lang="en">
|
|
174
|
-
<head>
|
|
175
|
-
<meta charset="utf-8">
|
|
176
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
177
|
-
<title>Data Dashboard</title>
|
|
178
|
-
<style>
|
|
179
|
-
${v}
|
|
180
|
-
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 16px 0; }
|
|
181
|
-
.kpi { border: 1px solid #e5e7eb; border-radius: 10px; padding: 14px 16px; }
|
|
182
|
-
.kpi .label { font-size: 12px; color: #6b7280; }
|
|
183
|
-
.kpi .value { font-size: 26px; font-weight: 600; margin: 4px 0; }
|
|
184
|
-
.kpi .delta { font-size: 12px; }
|
|
185
|
-
.kpi .delta.up { color: #16a34a; } .kpi .delta.down { color: #dc2626; }
|
|
186
|
-
table { border-collapse: collapse; width: 100%; margin: 16px 0; font-size: 13px; }
|
|
187
|
-
th, td { border: 1px solid #e5e7eb; padding: 6px 10px; text-align: left; }
|
|
188
|
-
th { background: #f9fafb; cursor: pointer; user-select: none; }
|
|
189
|
-
th.sorted-asc::after { content: ' ↑'; } th.sorted-desc::after { content: ' ↓'; }
|
|
190
|
-
</style>
|
|
191
|
-
</head>
|
|
192
|
-
<body>
|
|
193
|
-
<h1>Weekly Data Dashboard</h1>
|
|
194
|
-
<div class="meta"><span class="muted" id="stamp"></span></div>
|
|
195
|
-
<div class="grid" id="kpis"></div>
|
|
196
|
-
<svg id="chart" width="860" height="180" viewBox="0 0 860 180" role="img" aria-label="trend chart"></svg>
|
|
197
|
-
<table id="tbl"><thead><tr></tr></thead><tbody></tbody></table>
|
|
198
|
-
<script>
|
|
199
|
-
var KPIS = [
|
|
200
|
-
{ label: 'Requests', value: '1.24M', delta: '+8.2%', dir: 'up' },
|
|
201
|
-
{ label: 'Error rate', value: '0.42%', delta: '-0.11pp', dir: 'up' },
|
|
202
|
-
{ label: 'p95 latency', value: '213ms', delta: '-18ms', dir: 'up' },
|
|
203
|
-
{ label: 'Active users', value: '18,304', delta: '+3.1%', dir: 'up' },
|
|
204
|
-
];
|
|
205
|
-
var SERIES = [42, 48, 45, 61, 58, 72, 69, 77, 74, 88, 92, 96];
|
|
206
|
-
var ROWS = [
|
|
207
|
-
{ service: 'gateway', rps: 5210, err: '0.31%', p95: '142ms' },
|
|
208
|
-
{ service: 'orders', rps: 3140, err: '0.48%', p95: '231ms' },
|
|
209
|
-
{ service: 'payments', rps: 1890, err: '0.66%', p95: '305ms' },
|
|
210
|
-
{ service: 'search', rps: 1230, err: '0.22%', p95: '98ms' },
|
|
211
|
-
];
|
|
212
|
-
var sortKey = 'rps', sortDir = -1;
|
|
213
|
-
function renderKpis() {
|
|
214
|
-
document.getElementById('kpis').innerHTML = KPIS.map(function (k) {
|
|
215
|
-
return '<div class="kpi"><div class="label">' + k.label + '</div>' +
|
|
216
|
-
'<div class="value">' + k.value + '</div>' +
|
|
217
|
-
'<div class="delta ' + k.dir + '">' + k.delta + ' vs last week</div></div>';
|
|
218
|
-
}).join('');
|
|
219
|
-
}
|
|
220
|
-
function renderChart() {
|
|
221
|
-
var svg = document.getElementById('chart');
|
|
222
|
-
var w = 860, h = 180, pad = 20, max = Math.max.apply(null, SERIES) * 1.15;
|
|
223
|
-
var pts = SERIES.map(function (v, i) {
|
|
224
|
-
var x = pad + (i * (w - pad * 2)) / (SERIES.length - 1);
|
|
225
|
-
var y = h - pad - (v / max) * (h - pad * 2);
|
|
226
|
-
return x.toFixed(1) + ',' + y.toFixed(1);
|
|
227
|
-
});
|
|
228
|
-
var line = '<polyline fill="none" stroke="#D77757" stroke-width="2.5" points="' + pts.join(' ') + '"/>';
|
|
229
|
-
var area = '<polygon fill="#D7775718" points="' + pad + ',' + (h - pad) + ' ' + pts.join(' ') + ' ' + (w - pad) + ',' + (h - pad) + '"/>';
|
|
230
|
-
var dots = pts.map(function (p) {
|
|
231
|
-
var xy = p.split(',');
|
|
232
|
-
return '<circle cx="' + xy[0] + '" cy="' + xy[1] + '" r="3" fill="#D77757"/>';
|
|
233
|
-
}).join('');
|
|
234
|
-
svg.innerHTML = area + line + dots;
|
|
235
|
-
}
|
|
236
|
-
function renderTable() {
|
|
237
|
-
var cols = Object.keys(ROWS[0]);
|
|
238
|
-
var head = document.querySelector('#tbl thead tr');
|
|
239
|
-
head.innerHTML = cols.map(function (c) {
|
|
240
|
-
var cls = c === sortKey ? (sortDir === 1 ? 'sorted-asc' : 'sorted-desc') : '';
|
|
241
|
-
return '<th data-col="' + c + '" class="' + cls + '">' + c + '</th>';
|
|
242
|
-
}).join('');
|
|
243
|
-
var sorted = ROWS.slice().sort(function (a, b) {
|
|
244
|
-
var va = a[sortKey], vb = b[sortKey];
|
|
245
|
-
return (typeof va === 'number' ? va - vb : String(va).localeCompare(String(vb))) * sortDir;
|
|
246
|
-
});
|
|
247
|
-
document.querySelector('#tbl tbody').innerHTML = sorted.map(function (r) {
|
|
248
|
-
return '<tr>' + cols.map(function (c) { return '<td>' + r[c] + '</td>'; }).join('') + '</tr>';
|
|
249
|
-
}).join('');
|
|
250
|
-
head.querySelectorAll('th').forEach(function (th) {
|
|
251
|
-
th.addEventListener('click', function () {
|
|
252
|
-
var col = th.dataset.col;
|
|
253
|
-
if (col === sortKey) { sortDir = -sortDir; } else { sortKey = col; sortDir = 1; }
|
|
254
|
-
renderTable();
|
|
255
|
-
});
|
|
256
|
-
});
|
|
257
|
-
document.getElementById('stamp').textContent = 'generated ' + new Date().toLocaleString();
|
|
258
|
-
}
|
|
259
|
-
renderKpis(); renderChart(); renderTable();
|
|
260
|
-
<\/script>
|
|
261
|
-
</body>
|
|
262
|
-
</html>`,Y=`<!DOCTYPE html>
|
|
263
|
-
<html lang="en">
|
|
264
|
-
<head>
|
|
265
|
-
<meta charset="utf-8">
|
|
266
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
267
|
-
<title>Release Checklist</title>
|
|
268
|
-
<style>
|
|
269
|
-
${v}
|
|
270
|
-
.progress { height: 8px; background: #e5e7eb; border-radius: 999px; overflow: hidden; margin: 14px 0 22px; }
|
|
271
|
-
.progress > div { height: 100%; background: #D77757; width: 0; transition: width .3s; }
|
|
272
|
-
.stage { margin: 18px 0; }
|
|
273
|
-
.stage h2 { font-size: 15px; display: flex; gap: 8px; align-items: center; }
|
|
274
|
-
.item { display: flex; gap: 10px; align-items: baseline; padding: 6px 0 6px 4px; border-left: 2px solid transparent; }
|
|
275
|
-
.item.done { color: #6b7280; text-decoration: line-through; border-left-color: #22c55e; }
|
|
276
|
-
.item input { accent-color: #D77757; }
|
|
277
|
-
.item .note { color: #6b7280; font-size: 12px; }
|
|
278
|
-
.blocked { color: #b91c1c; font-weight: 500; }
|
|
279
|
-
</style>
|
|
280
|
-
</head>
|
|
281
|
-
<body>
|
|
282
|
-
<h1>Release Checklist — <span id="rel">v1.4.0</span></h1>
|
|
283
|
-
<div class="meta"><span class="badge info" id="pct">0%</span><span class="muted" id="blocked-count"></span></div>
|
|
284
|
-
<div class="progress"><div id="bar"></div></div>
|
|
285
|
-
<div id="stages"></div>
|
|
286
|
-
<script>
|
|
287
|
-
var STAGES = [
|
|
288
|
-
{ name: 'Pre-merge', items: [
|
|
289
|
-
{ t: '所有 PR 已合并到 release 分支', note: '' },
|
|
290
|
-
{ t: 'CI 全绿(单元 + 集成)', note: '' },
|
|
291
|
-
{ t: 'CHANGELOG 更新', note: '由 changeset 生成' },
|
|
292
|
-
]},
|
|
293
|
-
{ name: 'Staging', items: [
|
|
294
|
-
{ t: 'staging 部署完成并通过冒烟测试', note: '' },
|
|
295
|
-
{ t: '数据库迁移在 staging 演练', note: '含回滚脚本' },
|
|
296
|
-
]},
|
|
297
|
-
{ name: 'Production', items: [
|
|
298
|
-
{ t: '灰度 5% 观察 30 分钟', note: '错误率 & p95 正常后放量' },
|
|
299
|
-
{ t: '全量发布', note: '' },
|
|
300
|
-
]},
|
|
301
|
-
{ name: 'Post-deploy', items: [
|
|
302
|
-
{ t: '核心指标看板确认', note: 'dashboard 链接见备注' },
|
|
303
|
-
{ t: '发布公告 / 通知团队', note: '' },
|
|
304
|
-
]},
|
|
305
|
-
];
|
|
306
|
-
function render() {
|
|
307
|
-
var box = document.getElementById('stages');
|
|
308
|
-
box.innerHTML = '';
|
|
309
|
-
var total = 0, done = 0, blocked = 0;
|
|
310
|
-
STAGES.forEach(function (s) {
|
|
311
|
-
total += s.items.length;
|
|
312
|
-
var stage = document.createElement('div');
|
|
313
|
-
stage.className = 'stage';
|
|
314
|
-
stage.innerHTML = '<h2>' + s.name + '</h2>';
|
|
315
|
-
s.items.forEach(function (it, i) {
|
|
316
|
-
if (it.done) done++;
|
|
317
|
-
if (it.blocked) blocked++;
|
|
318
|
-
var row = document.createElement('label');
|
|
319
|
-
row.className = 'item' + (it.done ? ' done' : '');
|
|
320
|
-
row.innerHTML = '<input type="checkbox"' + (it.done ? ' checked' : '') + '/>' +
|
|
321
|
-
'<span>' + it.t + (it.blocked ? ' <span class="blocked">⚠ blocked</span>' : '') + '</span>' +
|
|
322
|
-
(it.note ? '<span class="note">— ' + it.note + '</span>' : '');
|
|
323
|
-
row.querySelector('input').addEventListener('change', function () {
|
|
324
|
-
it.done = !it.done;
|
|
325
|
-
render();
|
|
326
|
-
});
|
|
327
|
-
stage.appendChild(row);
|
|
328
|
-
});
|
|
329
|
-
box.appendChild(stage);
|
|
330
|
-
});
|
|
331
|
-
var pct = total ? Math.round((done / total) * 100) : 0;
|
|
332
|
-
document.getElementById('pct').textContent = pct + '%';
|
|
333
|
-
document.getElementById('bar').style.width = pct + '%';
|
|
334
|
-
document.getElementById('blocked-count').textContent = blocked ? blocked + ' 项受阻' : done + '/' + total + ' 完成';
|
|
335
|
-
}
|
|
336
|
-
render();
|
|
337
|
-
<\/script>
|
|
338
|
-
</body>
|
|
339
|
-
</html>`,N=[{id:"blank",titleKey:"artifacts.create.templateBlank",descKey:"",defaultTitle:"Untitled Artifact",html:G},{id:"pr-review",titleKey:"artifacts.create.templatePrReview",descKey:"artifacts.templateDesc.prReview",defaultTitle:"PR Review",html:V},{id:"incident",titleKey:"artifacts.create.templateIncident",descKey:"artifacts.templateDesc.incident",defaultTitle:"Incident Timeline",html:W},{id:"dashboard",titleKey:"artifacts.create.templateDashboard",descKey:"artifacts.templateDesc.dashboard",defaultTitle:"Data Dashboard",html:U},{id:"checklist",titleKey:"artifacts.create.templateChecklist",descKey:"artifacts.templateDesc.checklist",defaultTitle:"Release Checklist",html:Y}];function b(s){return N.find(o=>o.id===s)??N[0]}function I(s){return s<1024?`${s} B`:s<1024*1024?`${(s/1024).toFixed(1)} KB`:`${(s/(1024*1024)).toFixed(1)} MB`}function J(s){if(!s)return"—";try{return new Date(s).toLocaleString()}catch{return s}}function Q(s){if(!s)return null;const o=new Date(s).getTime();return Number.isNaN(o)?null:Math.ceil((o-Date.now())/(1440*60*1e3))}function ie({sessionId:s,embedded:o=!1}){D();const[y,u]=i.useState([]),[m,w]=i.useState(!0),[x,f]=i.useState(""),[p,d]=i.useState(!1),[k,h]=i.useState(null),c=i.useCallback(async()=>{try{const t=await L(s?{session_id:s}:void 0);u(t||[]),f("")}catch(t){f(t instanceof Error?t.message:a("artifacts.loadFailed"))}finally{w(!1)}},[s]);i.useEffect(()=>{c();const t=setInterval(c,15e3);return window.addEventListener("focus",c),()=>{clearInterval(t),window.removeEventListener("focus",c)}},[c]);const g=i.useCallback(t=>{d(!1),u(n=>[t,...n.filter(C=>C.id!==t.id)])},[]),E=i.useCallback(async t=>{if(window.confirm(a("artifacts.delete")+" — "+t.slice(0,8)+"…?"))try{await R(t),u(n=>n.filter(C=>C.id!==t))}catch(n){alert(n instanceof Error?n.message:a("artifacts.deleteFailed"))}},[]),j=i.useCallback(async t=>{await B(`${window.location.origin}${t.url}`)&&(h(t.id),setTimeout(()=>h(null),1500))},[]),r=i.useMemo(()=>y,[y]),l=e.jsxs(e.Fragment,{children:[x&&e.jsx("p",{className:"text-status-error text-sm",children:x}),m?e.jsx("div",{className:"space-y-3",children:[0,1,2].map(t=>e.jsx("div",{className:"h-20 animate-pulse rounded-lg bg-surface-2"},t))}):r.length===0?e.jsxs("div",{className:"rounded-lg border border-dashed border-border py-12 text-center",children:[e.jsx(M,{className:"mx-auto h-8 w-8 text-text-muted/40"}),e.jsx("p",{className:"mt-3 text-sm text-text-muted",children:a("artifacts.empty")})]}):e.jsx("ul",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-3",children:r.map(t=>{const n=Q(t.expires_at);return e.jsxs("li",{className:"group rounded-lg border border-border bg-surface-1 p-4 transition-colors hover:border-brand/50",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("a",{href:`/code/a/${t.id}`,className:"min-w-0 flex-1 no-underline",children:[e.jsx("h3",{className:"truncate font-medium text-text-primary group-hover:text-accent",children:t.title||t.id.slice(0,12)}),e.jsxs("p",{className:"mt-1 font-mono text-xs text-text-muted",children:[t.id.slice(0,10),"… · v",t.version," · ",I(t.size)]})]}),e.jsx("span",{className:`flex-shrink-0 rounded-full px-2 py-0.5 text-[11px] font-medium ${n!==null&&n<=0?"bg-status-error/15 text-status-error":n!==null&&n<=2?"bg-status-warning/15 text-status-warning":"bg-surface-3 text-text-muted"}`,children:n===null?"∞":`${n}d`})]}),e.jsxs("div",{className:"mt-2 flex items-center gap-3 text-xs text-text-muted",children:[t.session_id&&e.jsxs("a",{href:`/code/${t.session_id}`,className:"truncate text-text-muted hover:text-accent",title:t.session_id,children:[a("artifacts.session"),": ",t.session_id.slice(0,14),"…"]}),e.jsxs("span",{className:"flex items-center gap-1",title:a("artifacts.updatedAt"),children:[e.jsx(K,{className:"h-3 w-3"}),J(t.updated_at)]})]}),e.jsxs("div",{className:"mt-3 flex items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100",children:[e.jsx("a",{href:t.url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-text-secondary hover:bg-surface-2 hover:text-text-primary",title:a("artifacts.openInNewTab"),children:e.jsx($,{className:"h-3.5 w-3.5"})}),e.jsxs("button",{type:"button",onClick:()=>j(t),className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-text-secondary hover:bg-surface-2 hover:text-text-primary",title:a("artifacts.copyLink"),children:[e.jsx(q,{className:"h-3.5 w-3.5"}),k===t.id&&e.jsx("span",{className:"text-status-active",children:a("artifacts.copied")})]}),e.jsx("button",{type:"button",onClick:()=>E(t.id),className:"ml-auto inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-text-secondary hover:bg-status-error/10 hover:text-status-error",title:a("artifacts.delete"),children:e.jsx(A,{className:"h-3.5 w-3.5"})})]})]},t.id)})})]});return o?e.jsxs("div",{children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("h2",{className:"text-sm font-medium text-text-primary",children:a("artifacts.title")}),e.jsxs("button",{type:"button",onClick:()=>d(!0),className:"inline-flex items-center gap-1 rounded-md bg-accent px-3 py-1.5 text-sm font-medium text-white hover:bg-accent/90",children:[e.jsx(S,{className:"h-4 w-4"}),a("artifacts.new")]})]}),l,e.jsx(T,{open:p,onClose:()=>d(!1),onCreated:g,sessionId:s})]}):e.jsxs("div",{className:"px-6 py-16 sm:px-10 sm:py-20",children:[e.jsxs("header",{className:"mb-10 flex items-start justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"font-display text-3xl font-semibold tracking-tight text-text-primary sm:text-4xl",children:a("artifacts.title")}),e.jsx("p",{className:"mt-3 text-sm text-text-muted",children:a("artifacts.subtitle")})]}),e.jsxs("button",{type:"button",onClick:()=>d(!0),className:"inline-flex items-center gap-2 rounded-md bg-accent px-4 py-2 text-sm font-medium text-white transition-all hover:bg-accent/90 active:translate-y-px",children:[e.jsx(S,{className:"h-4 w-4"}),a("artifacts.new")]})]}),l,e.jsx(T,{open:p,onClose:()=>d(!1),onCreated:g,sessionId:s})]})}function T({open:s,onClose:o,onCreated:y,sessionId:u}){D();const[m,w]=i.useState("pr-review"),[x,f]=i.useState(""),[p,d]=i.useState(""),[k,h]=i.useState(!1),[c,g]=i.useState("");i.useEffect(()=>{s&&(w("pr-review"),f(""),d(""),h(!1),g(""))},[s]);const E=r=>{w(r);const l=b(r);d(l.html),x.trim()||f(l.defaultTitle)},j=async()=>{const r=p.trim()||b(m).html;if(r){h(!0),g("");try{const l={html:r,title:x.trim()||b(m).defaultTitle,ttl:30};u&&(l.session_id=u);const t=await P(l);y(t)}catch(l){g(l instanceof Error?l.message:a("artifacts.create.failed"))}finally{h(!1)}}};return e.jsx(H,{open:s,onOpenChange:r=>r?void 0:o(),children:e.jsxs(F,{className:"max-h-[85vh] overflow-y-auto sm:max-w-2xl",children:[e.jsx(O,{children:e.jsx(_,{children:a("artifacts.create.title")})}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-2 block text-sm font-medium text-text-primary",children:a("artifacts.create.template")}),e.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3",children:N.map(r=>e.jsxs("button",{type:"button",onClick:()=>E(r.id),className:`rounded-lg border p-3 text-left transition-colors ${m===r.id?"border-accent bg-accent/10":"border-border hover:border-accent/50"}`,children:[e.jsx("div",{className:"text-sm font-medium text-text-primary",children:a(r.titleKey)}),r.descKey&&e.jsx("div",{className:"mt-1 text-xs text-text-muted",children:a(r.descKey)})]},r.id))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"artifact-title",children:a("artifacts.create.title.label")}),e.jsx("input",{id:"artifact-title",type:"text",value:x,onChange:r=>f(r.target.value),placeholder:b(m).defaultTitle,className:"w-full rounded-md border border-border bg-surface-1 px-3 py-2 text-sm text-text-primary focus:border-accent focus:outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"artifact-content",children:a("artifacts.create.content")}),e.jsx("textarea",{id:"artifact-content",value:p,onChange:r=>d(r.target.value),placeholder:b(m).html.slice(0,120)+"…",rows:10,spellCheck:!1,className:"w-full rounded-md border border-border bg-surface-1 px-3 py-2 font-mono text-xs text-text-primary focus:border-accent focus:outline-none"}),e.jsx("p",{className:"mt-1 text-xs text-text-muted",children:p.trim()?`${I(new Blob([p]).size)}`:a("artifacts.create.content")})]}),c&&e.jsx("p",{className:"text-sm text-status-error",children:c})]}),e.jsxs(z,{children:[e.jsx("button",{type:"button",onClick:o,className:"rounded-md border border-border px-4 py-2 text-sm text-text-secondary hover:bg-surface-2",children:a("common.cancel")}),e.jsx("button",{type:"button",onClick:j,disabled:k,className:"rounded-md bg-accent px-4 py-2 text-sm font-medium text-white hover:bg-accent/90 disabled:opacity-50",children:k?a("common.creating"):a("artifacts.create.submit")})]})]})})}export{ie as ArtifactsGallery};
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
var pt=Object.defineProperty;var ht=(s,t,r)=>t in s?pt(s,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):s[t]=r;var M=(s,t,r)=>ht(s,typeof t!="symbol"?t+"":t,r);import{e as m,j as e}from"./vendor-DE_-CLIE.js";import{ab as q,_ as ft,ai as Me,ak as yt,aj as be,a5 as gt,af as fe,a4 as F,$ as bt,x as Le,g as Te,ae as He,L as Be,z as jt,w as kt,ad as I,a9 as J,d as ze,an as Ae,a0 as wt,J as Nt,a3 as vt,ar as Ve,am as w,A as _t,ag as St,G as Ct,ao as Et,ac as Mt,b as Tt,N as At,a1 as Rt,y as We,P as $t,F as It,c as Pt,C as qt,R as Re,Z as Dt,D as Ut,a as Ft,q as Qe,s as Ge,v as Ot,f as Ke,e as Ye,r as Je,M as Lt}from"./main-2FF76CHO.js";import{g as Ht}from"./workerType-Bd-zteMi.js";import{D as Xe,a as Ze,c as et,d as tt,b as Bt}from"./dialog-aHICCHyK.js";import{E as zt}from"./external-link-Cb0Qh2uy.js";import{S as Vt}from"./SessionVisibilityBadge-7ElYQ4hP.js";import{U as Wt}from"./UserSearchInput-DM6V0r1B.js";import{ArtifactsGallery as Qt}from"./ArtifactsGallery-DQj98ptl.js";import"./shiki-mEP5vQQu.js";import"./motion-BILbV7YQ.js";import"./copy-BFkM6GS4.js";/**
|
|
2
|
-
* @license lucide-react v0.555.0 - ISC
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the ISC license.
|
|
5
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const Gt=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Kt=q("activity",Gt);/**
|
|
7
|
-
* @license lucide-react v0.555.0 - ISC
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the ISC license.
|
|
10
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const Yt=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Jt=q("chevron-right",Yt);/**
|
|
12
|
-
* @license lucide-react v0.555.0 - ISC
|
|
13
|
-
*
|
|
14
|
-
* This source code is licensed under the ISC license.
|
|
15
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/const Xt=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],st=q("cpu",Xt);/**
|
|
17
|
-
* @license lucide-react v0.555.0 - ISC
|
|
18
|
-
*
|
|
19
|
-
* This source code is licensed under the ISC license.
|
|
20
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
-
*/const Zt=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],es=q("hash",Zt);/**
|
|
22
|
-
* @license lucide-react v0.555.0 - ISC
|
|
23
|
-
*
|
|
24
|
-
* This source code is licensed under the ISC license.
|
|
25
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/const ts=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],ss=q("info",ts);/**
|
|
27
|
-
* @license lucide-react v0.555.0 - ISC
|
|
28
|
-
*
|
|
29
|
-
* This source code is licensed under the ISC license.
|
|
30
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
31
|
-
*/const ns=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M7 11h10",key:"1twpyw"}],["path",{d:"M7 15h6",key:"d9of3u"}],["path",{d:"M7 7h8",key:"af5zfr"}]],rs=q("message-square-text",ns);/**
|
|
32
|
-
* @license lucide-react v0.555.0 - ISC
|
|
33
|
-
*
|
|
34
|
-
* This source code is licensed under the ISC license.
|
|
35
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
36
|
-
*/const as=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],os=q("play",as);/**
|
|
37
|
-
* @license lucide-react v0.555.0 - ISC
|
|
38
|
-
*
|
|
39
|
-
* This source code is licensed under the ISC license.
|
|
40
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/const is=[["path",{d:"m10.852 14.772-.383.923",key:"11vil6"}],["path",{d:"M13.148 14.772a3 3 0 1 0-2.296-5.544l-.383-.923",key:"1v3clb"}],["path",{d:"m13.148 9.228.383-.923",key:"t2zzyc"}],["path",{d:"m13.53 15.696-.382-.924a3 3 0 1 1-2.296-5.544",key:"1bxfiv"}],["path",{d:"m14.772 10.852.923-.383",key:"k9m8cz"}],["path",{d:"m14.772 13.148.923.383",key:"1xvhww"}],["path",{d:"M4.5 10H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-.5",key:"tn8das"}],["path",{d:"M4.5 14H4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-.5",key:"1g2pve"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"M6 6h.01",key:"1utrut"}],["path",{d:"m9.228 10.852-.923-.383",key:"1wtb30"}],["path",{d:"m9.228 13.148-.923.383",key:"1a830x"}]],ls=q("server-cog",is);/**
|
|
42
|
-
* @license lucide-react v0.555.0 - ISC
|
|
43
|
-
*
|
|
44
|
-
* This source code is licensed under the ISC license.
|
|
45
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
46
|
-
*/const cs=[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]],ds=q("share-2",cs);/**
|
|
47
|
-
* @license lucide-react v0.555.0 - ISC
|
|
48
|
-
*
|
|
49
|
-
* This source code is licensed under the ISC license.
|
|
50
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
51
|
-
*/const us=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],ms=q("shield-check",us);/**
|
|
52
|
-
* @license lucide-react v0.555.0 - ISC
|
|
53
|
-
*
|
|
54
|
-
* This source code is licensed under the ISC license.
|
|
55
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
56
|
-
*/const xs=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],ps=q("triangle-alert",xs);function nt(){return{tasks:{}}}const $e=3e4;function re(s){const t=s.trim();if(!t)return"agent";const r=t.split(/\s+/).slice(0,2).join(" ");return r.length>40?r.slice(0,40)+"…":r}function hs(s,t){var d,p,f,x,b,j,N,i,a,u,y,k;const r=t.subtype;if(r!=="task_started"&&r!=="task_progress"&&r!=="task_notification")return s;const n=t.task_id;if(!n)return s;const l=Date.now(),c=s.tasks[n];if(r==="task_started"){if(c)return{tasks:{...s.tasks,[n]:{...c,description:t.description??c.description,name:re(t.description??c.description),taskType:t.task_type??c.taskType,workflowName:t.workflow_name??c.workflowName,prompt:t.prompt??c.prompt,toolUseId:t.tool_use_id??c.toolUseId,status:"running",startTime:l,evictAfter:void 0}}};const g=t.description??"";return{tasks:{...s.tasks,[n]:{taskId:n,name:re(g),description:g,taskType:t.task_type,workflowName:t.workflow_name,prompt:t.prompt,toolUseId:t.tool_use_id,status:"running",startTime:l}}}}if(r==="task_progress"){if(!c){const g=t.description??"";return{tasks:{...s.tasks,[n]:{taskId:n,name:re(g),description:g,toolUseId:t.tool_use_id,status:"running",startTime:l,tokenCount:(d=t.usage)==null?void 0:d.total_tokens,toolUseCount:(p=t.usage)==null?void 0:p.tool_uses,durationMs:(f=t.usage)==null?void 0:f.duration_ms,lastToolName:t.last_tool_name,summary:t.summary}}}}return{tasks:{...s.tasks,[n]:{...c,description:t.description??c.description,tokenCount:((x=t.usage)==null?void 0:x.total_tokens)??c.tokenCount,toolUseCount:((b=t.usage)==null?void 0:b.tool_uses)??c.toolUseCount,durationMs:((j=t.usage)==null?void 0:j.duration_ms)??c.durationMs,lastToolName:t.last_tool_name??c.lastToolName,summary:t.summary??c.summary}}}}return c?{tasks:{...s.tasks,[n]:{...c,status:t.status??"completed",endTime:l,finalSummary:t.summary??c.finalSummary,outputFile:t.output_file??c.outputFile,tokenCount:((u=t.usage)==null?void 0:u.total_tokens)??c.tokenCount,toolUseCount:((y=t.usage)==null?void 0:y.tool_uses)??c.toolUseCount,durationMs:((k=t.usage)==null?void 0:k.duration_ms)??c.durationMs,evictAfter:l+$e}}}:{tasks:{...s.tasks,[n]:{taskId:n,name:re(t.summary??""),description:t.summary??"",status:t.status??"completed",startTime:l,endTime:l,finalSummary:t.summary,outputFile:t.output_file,tokenCount:(N=t.usage)==null?void 0:N.total_tokens,toolUseCount:(i=t.usage)==null?void 0:i.tool_uses,durationMs:(a=t.usage)==null?void 0:a.duration_ms,evictAfter:l+$e}}}}function fs(s,t=Date.now()){return Object.values(s.tasks).filter(r=>r.evictAfter===void 0||r.evictAfter>t).sort((r,n)=>r.startTime-n.startTime)}class ys{constructor(){M(this,"listeners",new Set);M(this,"eventSource",null);M(this,"_lastSeqNum",0)}onEvent(t){return this.listeners.add(t),()=>this.listeners.delete(t)}connect(t){this.disconnect();const r=`/web/sessions/${t}/events`,n=new EventSource(r,{withCredentials:!0});this.eventSource=n,n.addEventListener("message",l=>{try{const c=JSON.parse(l.data);if(c.seqNum!==void 0&&c.seqNum<=this._lastSeqNum)return;c.seqNum!==void 0&&(this._lastSeqNum=c.seqNum);for(const d of this.listeners)d(c)}catch{}})}disconnect(){this.eventSource&&(this.eventSource.close(),this.eventSource=null),this._lastSeqNum=0}}const ye=new ys;function Ie(s){if(typeof s.content=="string")return s.content;if(s.message&&typeof s.message=="object"){const t=s.message;if(typeof t.content=="string")return t.content;if(Array.isArray(t.content))return t.content.filter(r=>r.type==="text"&&typeof r.text=="string").map(r=>r.text).join("")}return""}function Pe(s,t){for(let r=s.length-1;r>=0;r--){const n=s[r];if(n&&n.type==="tool_call"&&n.toolCall.id===t)return r}return-1}const ge="streaming-";function gs(s){const t=s.message;if(!t||typeof t!="object"||!Array.isArray(t.content))return"";const r=[];for(const n of t.content)if((n==null?void 0:n.type)==="thinking"){const l=typeof n.thinking=="string"&&n.thinking||typeof n.text=="string"&&n.text||"";l&&r.push(l)}return r.join("")}function qe(s){return s.filter(t=>typeof t.subject=="string"&&t.subject).map(t=>({content:t.subject,priority:"medium",status:t.status==="completed"?"completed":t.status==="in_progress"?"in_progress":"pending"}))}class bs{constructor(t,r,n){M(this,"sessionId");M(this,"setEntries");M(this,"unsub",null);M(this,"onStatusChange");M(this,"onError");M(this,"onPermissionRequest");M(this,"onModelsStateChange");M(this,"onSubagentUpdate");M(this,"onControlResponse");M(this,"onPermissionModeChange");M(this,"onUsageChange");M(this,"onElicitationRequest");M(this,"subagentState",nt());M(this,"seenUuids",new Set);M(this,"seenToolCallIds",new Set);M(this,"pendingControlRequests",new Map);M(this,"turnEnded",!1);M(this,"userSinceTurnEnd",!1);M(this,"closed",!1);this.sessionId=t,this.setEntries=r,this.onStatusChange=n==null?void 0:n.onStatusChange,this.onError=n==null?void 0:n.onError,this.onPermissionRequest=n==null?void 0:n.onPermissionRequest,this.onModelsStateChange=n==null?void 0:n.onModelsStateChange,this.onSubagentUpdate=n==null?void 0:n.onSubagentUpdate,this.onControlResponse=n==null?void 0:n.onControlResponse,this.onPermissionModeChange=n==null?void 0:n.onPermissionModeChange,this.onUsageChange=n==null?void 0:n.onUsageChange,this.onElicitationRequest=n==null?void 0:n.onElicitationRequest}markClosed(){this.closed=!0}async init(){await this.loadHistory(),this.connectSSE()}async loadHistory(){var x,b,j;const{events:t}=await ft(this.sessionId);if(!t||t.length===0)return;const r=[];let n=null;const l=()=>{n&&(r.push(n),n=null)};for(const N of t){const i=N.payload||{},a=i.uuid;if(typeof a=="string"&&a&&this.seenUuids.add(a),N.type==="tool_use"){const u=i.tool_call_id;typeof u=="string"&&u&&this.seenToolCallIds.add(u)}if(N.type==="user"){if(N.direction==="inbound")continue;l();const u=Ie(i);u&&r.push({type:"user_message",id:N.id||`hist-user-${r.length}`,content:u})}else if(N.type==="assistant"){l();const u=Ie(i);if(Me(u))continue;const y=[],k=i.message;if(k&&typeof k=="object"&&Array.isArray(k.content)){for(const g of k.content)if(g.type==="tool_use"){const _=g.id;_&&this.seenToolCallIds.add(_),y.push({type:"tool_call",toolCall:{id:_||`hist-tool-${r.length}`,title:g.name||"tool",status:"complete",rawInput:g.input||{}}})}}if(u||y.length>0){n={type:"assistant_message",id:N.id||`hist-asst-${r.length}`,chunks:u?[{type:"message",text:u}]:[]},r.push(n);for(const g of y)r.push(g);n=null}}else if(N.type==="tool_use"){const u=i,y={type:"tool_call",toolCall:{id:u.tool_call_id||`hist-tool-${r.length}`,title:u.tool_name||"tool",status:"complete",rawInput:u.tool_input||{}}};r.push(y)}else if(N.type==="tool_result"){const u=i,y=Pe(r,u.tool_call_id||"");if(y>=0){const k=r[y];r[y]={type:"tool_call",toolCall:{...k.toolCall,rawOutput:{output:u.content||u.output||""}}}}}}l();let c=null;for(const N of t){if(N.type!=="task_state")continue;const i=N.payload||{};Array.isArray(i.tasks)&&(c=i.tasks)}if(c&&c.length>0){const N=qe(c);N.length>0&&r.push({type:"plan",id:`plan-hist-${Date.now()}`,entries:N})}this.setEntries(r);let d=null,p=null,f=null;for(const N of t){const i=N.payload||{};if(N.type==="user"?f="user":(N.type==="result"||N.type==="result_success"||N.type==="interrupt")&&(f="turn_end"),N.type==="models_state"){const a=i.raw,u=a&&typeof a=="object"?a.models_state:i.models_state;u&&Array.isArray(u.availableModels)&&typeof u.currentModelId=="string"&&(d=u)}else if(N.type==="result"||N.type==="result_success"){const a=i.usage,u=typeof i.total_cost_usd=="number"?i.total_cost_usd:null;(a||u!==null)&&(p={inputTokens:((a==null?void 0:a.input_tokens)??0)+((a==null?void 0:a.cache_read_input_tokens)??0)+((a==null?void 0:a.cache_creation_input_tokens)??0),outputTokens:(a==null?void 0:a.output_tokens)??0,totalCostUsd:u})}}d&&((x=this.onModelsStateChange)==null||x.call(this,d)),p&&((b=this.onUsageChange)==null||b.call(this,p)),this.turnEnded=f==="turn_end",this.userSinceTurnEnd=f==="user",this.turnEnded&&!this.closed&&((j=this.onStatusChange)==null||j.call(this,"idle"))}connectSSE(){ye.connect(this.sessionId),this.unsub=ye.onEvent(t=>this.handleEvent(t))}disconnect(){this.unsub&&(this.unsub(),this.unsub=null),ye.disconnect()}handleEvent(t){var l,c,d,p,f,x,b,j,N;const r=t.type,n=t.payload||{};switch(r){case"user":{this.userSinceTurnEnd=!0;break}case"assistant":{const i=n.uuid;if(typeof i=="string"&&i){if(this.seenUuids.has(i))break;this.seenUuids.add(i)}const a=typeof n.content=="string"?n.content:"";if(Me(a))break;const u=gs(n);this.setEntries(k=>{const g=k[k.length-1];if((g==null?void 0:g.type)==="assistant_message"&&g.id.startsWith(ge))return[...k.slice(0,-1),{...g,id:`assistant-${Date.now()}`,chunks:[...u?[{type:"thought",text:u}]:[],{type:"message",text:a}]}];if((g==null?void 0:g.type)==="assistant_message"){const _=g.chunks[g.chunks.length-1];return(_==null?void 0:_.type)==="message"?[...k.slice(0,-1),{...g,chunks:[...g.chunks.slice(0,-1),{type:"message",text:_.text+a}]}]:[...k.slice(0,-1),{...g,chunks:[...g.chunks,{type:"message",text:a}]}]}if(a&&a.trim()||u){const _={type:"assistant_message",id:`assistant-${Date.now()}`,chunks:[...u?[{type:"thought",text:u}]:[],...a?[{type:"message",text:a}]:[]]};return[...k,_]}return k});const y=n.message;if(y&&typeof y=="object"&&Array.isArray(y.content)){const k=y.content.filter(g=>g.type==="tool_use");for(const g of k){const _=g.id||`call-${Date.now()}-${Math.random().toString(16).slice(2,8)}`;if(this.seenToolCallIds.has(_))continue;this.seenToolCallIds.add(_);const R={id:_,title:g.name||"tool",status:"running",rawInput:g.input||{}};this.setEntries(T=>[...T,{type:"tool_call",toolCall:R}])}}break}case"tool_use":{const i=n,a=i.tool_call_id||`call-${Date.now()}`;if(this.seenToolCallIds.has(a))break;this.seenToolCallIds.add(a);const u={id:a,title:i.tool_name||"tool",status:"running",rawInput:i.tool_input||{}};this.setEntries(y=>[...y,{type:"tool_call",toolCall:u}]);break}case"tool_result":{const i=n,a=i.tool_call_id||"";this.setEntries(u=>{const y=Pe(u,a);if(y<0)return u;const k=u[y];return u.map((g,_)=>_===y?{type:"tool_call",toolCall:{...k.toolCall,status:"complete",rawOutput:{output:i.content||i.output||""}}}:g)});break}case"control_request":case"permission_request":{const i=n.request;if(i&&i.subtype==="can_use_tool"){const a=n.request_id||"",u=i.tool_name||"unknown",y=i.input||i.tool_input||{},k=i.description||"",g=Array.isArray(i.permission_suggestions)?i.permission_suggestions:[];this.setEntries(_=>{const R=[..._].reverse().findIndex(T=>T.type==="tool_call");if(R>=0){const T=_.length-1-R,E=_[T];if(E.toolCall.status==="running")return _.map((O,B)=>B===T?{type:"tool_call",toolCall:{...E.toolCall,status:"waiting_for_confirmation",permissionRequest:{requestId:a,options:[]}}}:O)}return _}),(l=this.onPermissionRequest)==null||l.call(this,{requestId:a,toolName:u,toolInput:y,description:k,suggestions:g})}else i&&i.subtype==="elicitation"&&((c=this.onElicitationRequest)==null||c.call(this,{requestId:n.request_id||"",serverName:i.mcp_server_name||"",message:i.message||"",mode:i.mode==="url"?"url":"form",url:typeof i.url=="string"?i.url:void 0,requestedSchema:i.requested_schema||void 0}));break}case"session_status":{if(yt(n)){this.setEntries([]);break}if(typeof n.status=="string"){if(be(n.status))this.closed=!0;else if(this.closed)break;if(n.status==="running"&&this.turnEnded&&!this.userSinceTurnEnd)break;(d=this.onStatusChange)==null||d.call(this,n.status)}break}case"error":{const i=String(n.message||n.content||"Unknown error");(p=this.onError)==null||p.call(this,i);break}case"models_state":{const i=n.raw,a=typeof i=="object"&&i!==null?i.models_state:n.models_state;a&&Array.isArray(a.availableModels)&&typeof a.currentModelId=="string"&&((f=this.onModelsStateChange)==null||f.call(this,a));break}case"system":{const i=n.raw,a=i&&typeof i=="object"?i:n,u=typeof a.subtype=="string"?a.subtype:void 0;if(u==="task_started"||u==="task_progress"||u==="task_notification"){const k={subtype:u,task_id:typeof a.task_id=="string"?a.task_id:void 0,tool_use_id:typeof a.tool_use_id=="string"?a.tool_use_id:void 0,description:typeof a.description=="string"?a.description:void 0,task_type:typeof a.task_type=="string"?a.task_type:void 0,workflow_name:typeof a.workflow_name=="string"?a.workflow_name:void 0,prompt:typeof a.prompt=="string"?a.prompt:void 0,usage:a.usage&&typeof a.usage=="object"?a.usage:void 0,last_tool_name:typeof a.last_tool_name=="string"?a.last_tool_name:void 0,summary:typeof a.summary=="string"?a.summary:void 0,status:a.status==="completed"||a.status==="failed"||a.status==="stopped"?a.status:void 0,output_file:typeof a.output_file=="string"?a.output_file:void 0};this.subagentState=hs(this.subagentState,k)}const y=typeof a.permissionMode=="string"?a.permissionMode:typeof n.permissionMode=="string"?n.permissionMode:null;y&&((x=this.onPermissionModeChange)==null||x.call(this,y));break}case"control_response":{const i=n.response;if(i&&typeof i=="object"){const a=typeof i.request_id=="string"?i.request_id:"",u=typeof i.subtype=="string"?i.subtype:"";if(a){(b=this.onControlResponse)==null||b.call(this,{subtype:u,requestId:a,error:typeof i.error=="string"?i.error:void 0});const y=this.pendingControlRequests.get(a);y&&(this.pendingControlRequests.delete(a),y(u==="success"&&i.response&&typeof i.response=="object"?i.response:null))}}break}case"stream_event":{const i=n.event;if(!i||typeof i.type!="string")break;if(i.type==="content_block_delta"){const a=i.delta;if(!a||typeof a.type!="string")break;const u=a.type==="text_delta"?"message":a.type==="thinking_delta"?"thought":null;if(!u)break;const y=a.text??a.thinking;if(typeof y!="string"||!y)break;this.appendStreamingDelta(u,y)}break}case"partial_assistant":{const i=typeof n.content=="string"?n.content:"";i&&this.appendStreamingDelta("message",i);break}case"result":case"result_success":{this.turnEnded=!0,this.userSinceTurnEnd=!1,this.closed||(j=this.onStatusChange)==null||j.call(this,"idle");const i=n.usage,a=typeof n.total_cost_usd=="number"?n.total_cost_usd:null;if(i||a!==null){const u=((i==null?void 0:i.input_tokens)??0)+((i==null?void 0:i.cache_read_input_tokens)??0)+((i==null?void 0:i.cache_creation_input_tokens)??0);(N=this.onUsageChange)==null||N.call(this,{inputTokens:u,outputTokens:(i==null?void 0:i.output_tokens)??0,totalCostUsd:a})}break}case"task_state":{const i=Array.isArray(n.tasks)?n.tasks:[];if(i.length===0)break;const a=qe(i);if(a.length===0)break;this.setEntries(u=>[...u.filter(k=>k.type!=="plan"),{type:"plan",id:`plan-${n.task_list_id||Date.now()}`,entries:a}]);break}}}appendStreamingDelta(t,r){this.setEntries(n=>{const l=n[n.length-1];if((l==null?void 0:l.type)==="assistant_message"&&l.id.startsWith(ge)){const d=l.chunks[l.chunks.length-1];return(d==null?void 0:d.type)===t?[...n.slice(0,-1),{...l,chunks:[...l.chunks.slice(0,-1),{type:t,text:d.text+r}]}]:[...n.slice(0,-1),{...l,chunks:[...l.chunks,{type:t,text:r}]}]}const c={type:"assistant_message",id:`${ge}${Date.now()}`,chunks:[{type:t,text:r}]};return[...n,c]})}async sendMessage(t,r,n){const l=r&&r.length>0,c=n&&n.length>0;if(!t.trim()&&!l&&!c)return;const d={type:"user_message",id:`user-${Date.now()}`,content:t,images:l?r:void 0,attachments:c?n:void 0};this.setEntries(x=>[...x,d]);const p=[];if(t&&p.push({type:"text",text:t}),l)for(const x of r)p.push({type:"image",source:{type:"base64",media_type:x.mimeType,data:x.data}});if(c){for(const x of n)if(x.kind==="text"||x.kind==="table"){const b=`📎 ${x.name}${x.size!=null?` (${js(x.size)})`:""}`,j=x.textContent||"(空文件)";p.push({type:"text",text:`${b}
|
|
57
|
-
\`\`\`
|
|
58
|
-
${j}
|
|
59
|
-
\`\`\``})}else if(x.kind==="directory"){const b=`📁 目录: ${x.name}${x.files!=null?` (${x.files.length} 个文件)`:""}`,j=x.textContent||"(空目录)";p.push({type:"text",text:`${b}
|
|
60
|
-
${j}`})}}const f=p.length===1&&p[0].type==="text"?p[0].text||t:p.length>0?p:t;try{await gt(this.sessionId,{type:"user",uuid:fe(),content:t,message:{content:f}})}catch(x){throw this.setEntries(b=>b.filter(j=>!(j.type==="user_message"&&j.id===d.id))),x}}async respondPermission(t,r,n){await F(this.sessionId,{type:"permission_response",approved:r,request_id:t,...n}),this.setEntries(l=>l.map(c=>{var d;return c.type!=="tool_call"||((d=c.toolCall.permissionRequest)==null?void 0:d.requestId)!==t?c:{type:"tool_call",toolCall:{...c.toolCall,status:r?"running":"rejected",permissionRequest:void 0}}}))}async interrupt(){this.setEntries(t=>t.map(r=>r.type!=="tool_call"||r.toolCall.status!=="running"&&r.toolCall.status!=="waiting_for_confirmation"?r:{type:"tool_call",toolCall:{...r.toolCall,status:"canceled",permissionRequest:void 0}})),await bt(this.sessionId)}async setPermissionMode(t){const r=fe();return await F(this.sessionId,{type:"control_request",request_id:r,request:{subtype:"set_permission_mode",mode:t}}),r}async searchFiles(t,r=20){const n=fe(),l=new Promise(d=>{this.pendingControlRequests.set(n,d)});await F(this.sessionId,{type:"control_request",request_id:n,request:{subtype:"file_search",query:t,limit:r}});const c=setTimeout(()=>{const d=this.pendingControlRequests.get(n);d&&(this.pendingControlRequests.delete(n),d(null))},8e3);try{const d=await l;if(!d||!Array.isArray(d.suggestions))return[];const p=[];for(const f of d.suggestions)f&&typeof f=="object"&&typeof f.path=="string"&&p.push(f.path);return p}finally{clearTimeout(c)}}async respondElicitation(t,r,n){await F(this.sessionId,{type:"permission_response",approved:r==="accept",request_id:t,response:{subtype:"success",request_id:t,response:{action:r,...n?{content:n}:{}}}})}}function js(s){return s<1024?`${s} B`:s<1024*1024?`${(s/1024).toFixed(1)} KB`:`${(s/(1024*1024)).toFixed(1)} MB`}function ks(s){if(!s)return"never";const t=Math.max(0,Date.now()-s);return t<5e3?"just now":t<6e4?`${Math.floor(t/1e3)}s ago`:t<36e5?`${Math.floor(t/6e4)}m ago`:`${Math.floor(t/36e5)}h ago`}function ws(s){return s?Date.now()-s<6e4:!1}function Ns({onClose:s,session:t,liveStatus:r,pendingPermissions:n,onInterrupt:l,onDelete:c}){const[d,p]=m.useState(!1),f=async()=>{await navigator.clipboard.writeText(t.id),p(!0),setTimeout(()=>p(!1),1500)},x=n.length,b=t.worker,j=t.work_item,N=t.environment;return e.jsx(Xe,{open:!0,onOpenChange:i=>{i||s()},children:e.jsxs(Ze,{showCloseButton:!1,className:"fixed inset-y-0 right-0 top-auto left-auto translate-x-0 translate-y-0 w-full sm:w-96 h-full max-w-none max-h-none rounded-none border-l border-border bg-surface-1 p-4 sm:max-w-md overflow-y-auto",children:[e.jsx(et,{children:e.jsx(tt,{className:"font-display font-semibold text-text-primary",children:"Session Ops"})}),e.jsxs("div",{className:"mt-3 space-y-5 text-sm",children:[e.jsxs("section",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-medium uppercase tracking-wide text-text-muted",children:[e.jsx(Kt,{className:"h-3.5 w-3.5"}),"Status"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Le,{status:r||t.status||"unknown"}),e.jsx("span",{className:"text-xs text-text-muted",children:b&&(ws(b.last_heartbeat_at)?"· worker online":"· worker offline")})]}),e.jsxs("dl",{className:"space-y-1 text-xs text-text-muted",children:[b&&e.jsxs("div",{className:"flex justify-between",children:[e.jsxs("dt",{className:"flex items-center gap-1",children:[e.jsx(Te,{className:"h-3 w-3"}),"Heartbeat"]}),e.jsx("dd",{className:"font-mono text-text-secondary",children:ks(b.last_heartbeat_at)})]}),N&&e.jsxs("div",{className:"flex justify-between",children:[e.jsxs("dt",{className:"flex items-center gap-1",children:[e.jsx(st,{className:"h-3 w-3"}),"Environment"]}),e.jsx("dd",{className:"truncate text-text-secondary",children:N.machine_name||N.id})]}),t.created_at&&e.jsxs("div",{className:"flex justify-between",children:[e.jsxs("dt",{className:"flex items-center gap-1",children:[e.jsx(Te,{className:"h-3 w-3"}),"Created"]}),e.jsx("dd",{className:"font-mono text-text-secondary",children:He(t.created_at)})]})]})]}),e.jsxs("section",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-medium uppercase tracking-wide text-text-muted",children:[e.jsx(Be,{className:"h-3.5 w-3.5"}),"Pending Actions"]}),x>0?e.jsxs("div",{className:"rounded-md bg-status-warning/10 px-3 py-2 text-xs text-status-warning",children:[x," permission request",x>1?"s":""," awaiting your approval"]}):e.jsx("p",{className:"text-xs text-text-muted",children:"No pending actions"})]}),e.jsxs("section",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-medium uppercase tracking-wide text-text-muted",children:[e.jsx(ls,{className:"h-3.5 w-3.5"}),"Quick Actions"]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{onClick:l,className:"flex-1 rounded-md border border-border px-3 py-1.5 text-xs text-text-secondary hover:bg-surface-2 transition-colors",children:"Interrupt"}),e.jsxs("button",{onClick:c,className:"flex-1 rounded-md border border-status-error/30 px-3 py-1.5 text-xs text-status-error hover:bg-status-error/10 transition-colors",children:[e.jsx(jt,{className:"mr-1 inline h-3 w-3"}),"Delete"]})]})]}),e.jsxs("section",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-medium uppercase tracking-wide text-text-muted",children:[e.jsx(es,{className:"h-3.5 w-3.5"}),"Session Info"]}),e.jsxs("dl",{className:"space-y-1 text-xs text-text-muted",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("dt",{children:"Session ID"}),e.jsxs("dd",{className:"flex items-center gap-1 min-w-0",children:[e.jsx("code",{className:"break-all font-mono text-text-secondary text-right",children:t.id}),e.jsx("button",{onClick:f,className:"text-text-muted hover:text-text-primary transition-colors flex-shrink-0",title:"Copy session id",children:d?"✓":"⧉"})]})]}),j&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("dt",{children:"Spawn mode"}),e.jsx("dd",{className:"font-mono text-text-secondary",children:j.spawn_mode??"default"})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("dt",{children:"Work state"}),e.jsx("dd",{className:"font-mono text-text-secondary",children:j.state})]})]}),t.source&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx("dt",{children:"Source"}),e.jsx("dd",{className:"font-mono text-text-secondary",children:t.source})]}),N&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx("dt",{children:"Worker type"}),e.jsx("dd",{className:"font-mono text-text-secondary",children:N.worker_type})]})]})]})]})]})})}const De="rcs:subagent-panel:collapsed";function vs(s){if(s<1e3)return"0s";const t=Math.floor(s/1e3);if(t<60)return`${t}s`;const r=Math.floor(t/60),n=t%60;if(r<60)return n?`${r}m${n}s`:`${r}m`;const l=Math.floor(r/60),c=r%60;return c?`${l}h${c}m`:`${l}h`}function _s(s){return s===void 0||s<=0?"":s<1e3?`${s}`:s<1e6?`${(s/1e3).toFixed(s<1e4?1:0)}k`:`${(s/1e6).toFixed(1)}M`}function Ss({status:s}){return s==="running"?e.jsx(Be,{className:"h-3 w-3 animate-spin text-brand"}):s==="completed"?e.jsx(os,{className:"h-3 w-3 text-status-success"}):s==="failed"||s==="stopped"?e.jsx(kt,{className:"h-3 w-3 text-status-error"}):null}function Cs({task:s}){const t=s.status==="running",r=t?s.durationMs??Date.now()-s.startTime:(s.endTime??Date.now())-s.startTime,n=_s(s.tokenCount),l=s.toolUseCount!==void 0&&s.toolUseCount>0?`${s.toolUseCount} tool${s.toolUseCount>1?"s":""}`:"",c=s.summary||s.description||"(no description)";return e.jsxs("div",{className:"flex items-start gap-2 rounded-md bg-surface-2 px-2.5 py-1.5 text-xs",children:[e.jsx("div",{className:"mt-0.5 flex-shrink-0",children:e.jsx(Ss,{status:s.status})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[e.jsx("span",{className:"truncate font-medium text-text-primary",children:s.name}),e.jsx("span",{className:"flex-shrink-0 font-mono text-text-muted",children:vs(r)})]}),e.jsx("div",{className:"mt-0.5 truncate text-text-secondary",children:c}),(n||l||s.lastToolName)&&e.jsxs("div",{className:"mt-0.5 flex flex-wrap items-center gap-x-2 gap-y-0.5 font-mono text-[10px] text-text-muted",children:[n&&e.jsxs("span",{children:["↕ ",n," tok"]}),l&&e.jsxs("span",{children:["· ",l]}),s.lastToolName&&e.jsxs("span",{className:"truncate",children:["· last: ",s.lastToolName]})]}),!t&&s.finalSummary&&e.jsx("div",{className:"mt-1 rounded bg-status-success/10 px-1.5 py-0.5 text-[10px] text-status-success",children:s.finalSummary})]})]})}function Es({state:s}){const[t,r]=m.useState(()=>{if(typeof window>"u")return!1;try{return window.localStorage.getItem(De)==="1"}catch{return!1}}),n=()=>{r(f=>{const x=!f;try{window.localStorage.setItem(De,x?"1":"0")}catch{}return x})},[,l]=m.useState(0);m.useEffect(()=>{const f=Object.values(s.tasks).some(j=>j.status==="running"),x=Object.values(s.tasks).some(j=>j.status!=="running"&&j.evictAfter!==void 0);if(!f&&!x)return;const b=setInterval(()=>{l(j=>j+1)},1e3);return()=>clearInterval(b)},[s]);const c=fs(s);if(c.length===0)return null;const d=c.filter(f=>f.status==="running").length,p=d>0?`${d} running`:`${c.length} recent`;return e.jsx("section",{"aria-label":"Subagents",className:"border-t border-border bg-surface-1 px-4 py-2",children:e.jsxs("div",{className:"mx-auto max-w-3xl space-y-1.5",children:[e.jsxs("button",{type:"button",onClick:n,"aria-expanded":!t,"aria-controls":"subagent-list",className:"flex w-full items-center justify-between text-[10px] font-medium uppercase tracking-wide text-text-muted hover:text-text-secondary transition-colors",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Jt,{className:`h-3 w-3 transition-transform ${t?"":"rotate-90"}`}),e.jsx("span",{children:"Subagents"})]}),e.jsx("span",{children:p})]}),!t&&e.jsx("div",{id:"subagent-list",className:"space-y-1.5",children:c.map(f=>e.jsx(Cs,{task:f},f.taskId))})]})})}function Ue(s,t){var l;const r=(l=t==null?void 0:t.find(c=>c.type==="addRules"||c.type==="replaceRules"))==null?void 0:l.rules,n=r==null?void 0:r[0];return n!=null&&n.ruleContent?`${n.toolName}(${n.ruleContent})`:n!=null&&n.toolName?n.toolName:s}function Ms({requestId:s,toolName:t,toolInput:r,description:n,suggestions:l,onApprove:c,onApproveAlways:d,onReject:p}){const f=typeof r=="string"?r:JSON.stringify(r,null,2),x=Array.isArray(l)&&l.length>0;return e.jsxs("div",{className:"rounded-xl border border-warning-border/30 bg-surface-1 p-4",children:[e.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[e.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-warning-border/15 text-warning-text",children:e.jsx(ps,{className:"h-3 w-3"})}),e.jsx("span",{className:"text-sm font-semibold text-warning-text",children:"Permission Request"})]}),n&&e.jsx("div",{className:"mb-2 text-sm text-text-secondary",children:I(n)}),e.jsx("div",{className:"mb-2 font-mono text-xs font-bold text-text-primary",children:I(t)}),t!=="AskUserQuestion"&&e.jsx("pre",{className:"mb-3 max-h-40 overflow-auto rounded-lg bg-surface-1 p-2 text-xs text-text-secondary font-mono",children:Ae(f,500)}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx("button",{onClick:c,className:"rounded-lg bg-brand px-4 py-2 text-sm font-medium text-white hover:bg-brand-light transition-colors",children:"Approve"}),x&&d&&e.jsxs("button",{onClick:d,className:"flex items-center gap-1.5 rounded-lg border border-brand/40 bg-brand/10 px-4 py-2 text-sm font-medium text-brand hover:bg-brand/20 transition-colors",title:`允许并记住规则:${Ue(t,l)}`,children:[e.jsx(ms,{className:"h-3.5 w-3.5"}),"Always allow ",Ae(Ue(t,l),40)]}),e.jsx("button",{onClick:p,className:"rounded-lg bg-status-error/20 px-4 py-2 text-sm font-medium text-status-error hover:bg-status-error/30 transition-colors",children:"Reject"})]})]})}function Ts({questions:s,description:t,onSubmit:r,onSkip:n}){const[l,c]=m.useState({}),[d,p]=m.useState({}),[f,x]=m.useState(0),b=(a,u,y)=>{if(y){const k=l[a]||[],g=k.includes(u)?k.filter(_=>_!==u):[...k,u];c({...l,[a]:g})}else c({...l,[a]:u})},j=a=>{var y;const u=(y=d[a])==null?void 0:y.trim();u&&(c({...l,[a]:u}),p({...d,[a]:""}))},N=()=>{var u,y;const a={};for(const[k,g]of Object.entries(l)){const _=s[parseInt(k,10)];_&&(typeof g=="number"?a[k]=((y=(u=_.options)==null?void 0:u[g])==null?void 0:y.label)||String(g):Array.isArray(g)?a[k]=g.map(R=>{var T,E;return((E=(T=_.options)==null?void 0:T[R])==null?void 0:E.label)||String(R)}):a[k]=g)}r(a)};if(s.length<=1){const a=s[0]||{question:t,options:[],multiSelect:!1},u=a.multiSelect||!1;return e.jsxs("div",{className:"rounded-xl border border-brand/30 bg-surface-1 p-4",children:[e.jsx("div",{className:"mb-3 text-sm font-semibold text-text-primary",children:I(t||a.question||"Question")}),e.jsxs("div",{className:"space-y-2",children:[(a.options||[]).map((y,k)=>{const g=u?(l[0]||[]).includes(k):l[0]===k;return e.jsxs("button",{onClick:()=>b(0,k,u),className:J("w-full rounded-lg border px-4 py-2.5 text-left text-sm transition-colors",g?"border-brand bg-brand/10 text-text-primary":"border-border bg-surface-2 text-text-secondary hover:border-border-light"),children:[e.jsx("div",{className:"font-medium",children:I(y.label)}),y.description&&e.jsx("div",{className:"mt-0.5 text-xs text-text-muted",children:I(y.description)})]},k)}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{type:"text",value:d[0]||"",onChange:y=>p({...d,0:y.target.value}),placeholder:"Other...",className:"flex-1 rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none",onKeyDown:y=>y.key==="Enter"&&j(0)}),e.jsx("button",{onClick:()=>j(0),className:"rounded-lg border border-border px-3 py-2 text-sm text-text-secondary hover:bg-surface-2 transition-colors",children:"Send"})]})]}),e.jsxs("div",{className:"mt-4 flex gap-2",children:[e.jsx("button",{onClick:N,className:"rounded-lg bg-brand px-4 py-2 text-sm font-medium text-white hover:bg-brand-light transition-colors",children:"Submit"}),e.jsx("button",{onClick:n,className:"rounded-lg border border-border px-4 py-2 text-sm text-text-secondary hover:bg-surface-2 transition-colors",children:"Skip"})]})]})}const i=s[f];return e.jsxs("div",{className:"rounded-xl border border-brand/30 bg-surface-1 p-4",children:[e.jsx("div",{className:"mb-3 text-sm font-semibold text-text-primary",children:I(t||"Questions")}),e.jsx("div",{className:"mb-3 flex gap-1 overflow-x-auto",children:s.map((a,u)=>e.jsx("button",{onClick:()=>x(u),className:J("rounded-md px-3 py-1.5 text-xs whitespace-nowrap transition-colors",f===u?"bg-brand/20 text-brand":"text-text-muted hover:bg-surface-2"),children:a.header||`Q${u+1}`},u))}),i&&e.jsx(As,{question:i,qIdx:f,answers:l,otherTexts:d,onSelect:b,onOtherTextChange:(a,u)=>p({...d,[a]:u}),onOtherSubmit:j}),e.jsxs("div",{className:"mt-4 flex items-center justify-between",children:[e.jsxs("span",{className:"text-xs text-text-muted",children:[f+1," / ",s.length]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{onClick:N,className:"rounded-lg bg-brand px-4 py-2 text-sm font-medium text-white hover:bg-brand-light transition-colors",children:"Submit All"}),e.jsx("button",{onClick:n,className:"rounded-lg border border-border px-4 py-2 text-sm text-text-secondary hover:bg-surface-2 transition-colors",children:"Skip"})]})]})]})}function As({question:s,qIdx:t,answers:r,otherTexts:n,onSelect:l,onOtherTextChange:c,onOtherSubmit:d}){const p=s.multiSelect||!1;return e.jsxs("div",{children:[e.jsx("div",{className:"mb-2 text-sm text-text-secondary",children:I(s.question)}),e.jsxs("div",{className:"space-y-2",children:[(s.options||[]).map((f,x)=>{const b=p?(r[t]||[]).includes(x):r[t]===x;return e.jsxs("button",{onClick:()=>l(t,x,p),className:J("w-full rounded-lg border px-4 py-2.5 text-left text-sm transition-colors",b?"border-brand bg-brand/10 text-text-primary":"border-border bg-surface-2 text-text-secondary hover:border-border-light"),children:[e.jsx("div",{className:"font-medium",children:I(f.label)}),f.description&&e.jsx("div",{className:"mt-0.5 text-xs text-text-muted",children:I(f.description)})]},x)}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{type:"text",value:n[t]||"",onChange:f=>c(t,f.target.value),placeholder:"Other...",className:"flex-1 rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none",onKeyDown:f=>f.key==="Enter"&&d(t)}),e.jsx("button",{onClick:()=>d(t),className:"rounded-lg border border-border px-3 py-2 text-sm text-text-secondary hover:bg-surface-2 transition-colors",children:"Send"})]})]})]})}function Rs({planContent:s,description:t,onSubmit:r}){const[n,l]=m.useState(null),[c,d]=m.useState(""),p=!s||!s.trim(),f=()=>{n&&r(n,n==="no"?c:void 0)};return e.jsxs("div",{className:"rounded-xl border border-brand/30 bg-surface-1 p-4",children:[e.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[e.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-brand/15 text-brand",children:e.jsx(ze,{className:"h-3 w-3",strokeWidth:2.5})}),e.jsx("span",{className:"text-sm font-semibold text-text-primary",children:p?"Exit plan mode?":"Ready to code?"})]}),!p&&e.jsx("div",{className:"mb-4 max-h-64 overflow-auto rounded-lg bg-tool-card p-4 text-sm text-text-secondary",dangerouslySetInnerHTML:{__html:$s(s)}}),e.jsx("div",{className:"space-y-2",children:p?e.jsxs(e.Fragment,{children:[e.jsx(Y,{selected:n==="yes-default",onClick:()=>l("yes-default"),label:"Yes"}),e.jsx(Y,{selected:n==="no",onClick:()=>l("no"),label:"No"})]}):e.jsxs(e.Fragment,{children:[e.jsx(Y,{selected:n==="yes-accept-edits",onClick:()=>l("yes-accept-edits"),label:"Yes, auto-accept edits",desc:"Approve plan and auto-accept file edits"}),e.jsx(Y,{selected:n==="yes-default",onClick:()=>l("yes-default"),label:"Yes, manually approve edits",desc:"Approve plan but confirm each edit"}),e.jsx(Y,{selected:n==="no",onClick:()=>l("no"),label:"No, keep planning",desc:"Provide feedback to refine the plan"})]})}),n==="no"&&e.jsx("textarea",{value:c,onChange:x=>d(x.target.value),placeholder:"Tell Saluzi what to change...",className:"mt-3 w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none",rows:3}),e.jsx("div",{className:"mt-4",children:e.jsx("button",{onClick:f,disabled:!n,className:"rounded-lg bg-brand px-4 py-2 text-sm font-medium text-white hover:bg-brand-light disabled:opacity-50 transition-colors",children:"Submit"})})]})}function Y({selected:s,onClick:t,label:r,desc:n}){return e.jsxs("button",{onClick:t,className:J("w-full rounded-lg border px-4 py-2.5 text-left text-sm transition-colors",s?"border-brand bg-brand/10 text-text-primary":"border-border bg-surface-2 text-text-secondary hover:border-border-light"),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:J("flex h-4 w-4 items-center justify-center rounded-full border text-[10px] transition-colors",s?"border-brand bg-brand text-white":"border-border"),children:s&&"✓"}),e.jsx("span",{className:"font-medium",children:r})]}),n&&e.jsx("div",{className:"mt-0.5 pl-6 text-xs text-text-muted",children:n})]})}function $s(s){let t=I(s);return t=t.replace(/```(\w*)\n?([\s\S]*?)```/g,(r,n,l)=>`<pre class="my-2 overflow-x-auto rounded-lg bg-tool-card p-3 font-mono text-xs">${l.trim()}</pre>`),t=t.replace(/`([^`]+)`/g,'<code class="rounded bg-tool-card px-1.5 py-0.5 font-mono text-xs">$1</code>'),t=t.replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>"),t}function Is({request:s,onSubmit:t}){const r=Ps(s.requestedSchema),n=qs(s.requestedSchema),[l,c]=m.useState({}),d=r.length===0||n.every(p=>(l[p]??"").trim()!=="");return s.mode==="url"&&s.url?e.jsxs("div",{className:"rounded-xl border border-brand/30 bg-surface-1 p-4",children:[e.jsx(Fe,{serverName:s.serverName,message:s.message}),e.jsxs("a",{href:s.url,target:"_blank",rel:"noopener noreferrer",className:"mt-2 flex w-full items-center justify-between rounded-lg border border-border bg-surface-2 px-4 py-2.5 text-sm text-brand hover:bg-brand/10 transition-colors",children:[e.jsx("span",{className:"truncate font-mono text-xs",children:s.url}),e.jsx(zt,{className:"ml-2 h-4 w-4 flex-shrink-0"})]}),e.jsxs("div",{className:"mt-4 flex gap-2",children:[e.jsx("button",{onClick:()=>t("accept"),className:"rounded-lg bg-brand px-4 py-2 text-sm font-medium text-white hover:bg-brand-light transition-colors",children:"完成"}),e.jsx("button",{onClick:()=>t("cancel"),className:"rounded-lg border border-border px-4 py-2 text-sm text-text-secondary hover:bg-surface-2 transition-colors",children:"取消"})]})]}):e.jsxs("div",{className:"rounded-xl border border-brand/30 bg-surface-1 p-4",children:[e.jsx(Fe,{serverName:s.serverName,message:s.message}),r.length>0&&e.jsx("div",{className:"mb-3 space-y-3",children:r.map(({name:p,prop:f})=>e.jsxs("label",{className:"block",children:[e.jsxs("div",{className:"mb-1 flex items-center gap-2",children:[e.jsx("span",{className:"font-mono text-xs font-medium text-text-primary",children:p}),n.includes(p)&&e.jsx("span",{className:"text-[10px] font-medium text-warning-text",children:"必填"})]}),f.description&&e.jsx("div",{className:"mb-1 text-xs text-text-muted",children:I(f.description)}),e.jsx("input",{type:f.type==="number"?"number":"text",value:l[p]??"",onChange:x=>c(b=>({...b,[p]:x.target.value})),className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"})]},p))}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{onClick:()=>{const p={};for(const{name:f,prop:x}of r){const b=(l[f]??"").trim();b&&(p[f]=x.type==="number"?Number(b):b)}t("accept",p)},disabled:!d,className:"rounded-lg bg-brand px-4 py-2 text-sm font-medium text-white hover:bg-brand-light disabled:opacity-50 transition-colors",children:"提交"}),e.jsx("button",{onClick:()=>t("decline"),className:"rounded-lg border border-border px-4 py-2 text-sm text-text-secondary hover:bg-surface-2 transition-colors",children:"拒绝"})]})]})}function Fe({serverName:s,message:t}){return e.jsxs("div",{className:"mb-3",children:[e.jsxs("div",{className:"mb-1 flex items-center gap-2",children:[e.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-brand/15 text-brand",children:e.jsx(rs,{className:"h-3 w-3"})}),e.jsxs("span",{className:"text-sm font-semibold text-text-primary",children:["MCP 请求输入 ",e.jsx("span",{className:"font-mono text-xs text-text-muted",children:I(s)})]})]}),t&&e.jsx("div",{className:"text-sm text-text-secondary",children:I(t)})]})}function Ps(s){const t=s==null?void 0:s.properties;return!t||typeof t!="object"?[]:Object.entries(t).filter(([,r])=>r&&typeof r=="object").map(([r,n])=>({name:r,prop:n}))}function qs(s){const t=s==null?void 0:s.required;return Array.isArray(t)?t.filter(r=>typeof r=="string"):[]}function Ds(s){const[t,r]=m.useState([]),[n,l]=m.useState(!0),[c,d]=m.useState(null),p=m.useCallback(async()=>{l(!0),d(null);try{const b=await wt(s);r(b)}catch(b){d(b instanceof Error?b.message:"Failed to load shares")}finally{l(!1)}},[s]);m.useEffect(()=>{p()},[p]);const f=m.useCallback(async b=>{d(null);try{const j=await Nt(s,b);return await p(),j}catch(j){throw d(j instanceof Error?j.message:"Failed to create share"),j}},[s,p]),x=m.useCallback(async b=>{d(null);try{await vt(s,b),await p()}catch(j){throw d(j instanceof Error?j.message:"Failed to revoke share"),j}},[s,p]);return{shares:t,isLoading:n,error:c,createShare:f,revokeShare:x,refresh:p}}function Us({open:s,onClose:t,sessionId:r,sessionTitle:n}){Ve();const{shares:l,isLoading:c,error:d,createShare:p,revokeShare:f}=Ds(r),[x,b]=m.useState("user"),[j,N]=m.useState(""),[i,a]=m.useState(""),[u,y]=m.useState("read"),[k,g]=m.useState(""),[_,R]=m.useState(!1),[T,E]=m.useState(null),[O,B]=m.useState(""),[oe,P]=m.useState(!1),[ie,L]=m.useState(!1);m.useEffect(()=>{s&&(b("user"),N(""),a(""),y("read"),g(""),R(!1),E(null),B(""),P(!1),L(!1))},[s]);const X=async()=>{R(!0),B(""),E(null);try{const S={grantedTo:x==="user"?{userId:j.trim()}:{teamId:i.trim()},permission:u};k.trim()&&(S.expiresAt=k.trim());const Q=await p(S);E(`${window.location.origin}/code/s/${Q.shareToken}`)}catch(S){B(S instanceof Error?S.message:"Failed to create share")}finally{R(!1)}},z=async S=>{try{await f(S)}catch{}},V=async()=>{if(!T)return;L(!1);try{if(navigator.clipboard&&window.isSecureContext){await navigator.clipboard.writeText(T),P(!0),setTimeout(()=>P(!1),2e3);return}}catch{}const S=document.createElement("textarea");S.value=T,S.style.position="fixed",S.style.opacity="0",document.body.appendChild(S),S.select();try{document.execCommand("copy"),P(!0),setTimeout(()=>P(!1),2e3)}catch{L(!0)}document.body.removeChild(S)};return e.jsx(Xe,{open:s,onOpenChange:S=>{S||t()},children:e.jsxs(Ze,{className:"max-w-lg rounded-2xl border-border bg-surface-1 p-6 shadow-2xl",children:[e.jsx(et,{children:e.jsxs(tt,{className:"font-display text-lg font-semibold text-text-primary",children:[w("share.title"),n?`: ${n}`:""]})}),e.jsxs("div",{className:"space-y-4 min-w-0",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm text-text-secondary",children:w("share.grantTo")}),e.jsxs("div",{className:"flex gap-2 mb-2",children:[e.jsx("button",{onClick:()=>b("user"),className:`rounded-md px-3 py-1 text-sm transition-colors ${x==="user"?"bg-brand text-white":"bg-surface-2 text-text-secondary hover:bg-surface-3"}`,children:w("share.user")}),e.jsx("button",{onClick:()=>b("team"),className:`rounded-md px-3 py-1 text-sm transition-colors ${x==="team"?"bg-brand text-white":"bg-surface-2 text-text-secondary hover:bg-surface-3"}`,children:w("share.team")})]}),x==="user"?e.jsx(Wt,{onSelect:N,placeholder:w("share.userIdPlaceholder"),actionLabel:w("share.selectUser")}):e.jsx("input",{type:"text",value:i,onChange:S=>a(S.target.value),placeholder:w("share.teamIdPlaceholder"),className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"}),x==="user"&&j&&e.jsxs("p",{className:"mt-1 text-xs text-text-muted",children:[w("share.selectedUser"),": ",e.jsx("span",{className:"font-mono",children:j})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm text-text-secondary",children:w("share.permission")}),e.jsxs("select",{value:u,onChange:S=>y(S.target.value),className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary focus:border-brand focus:outline-none",children:[e.jsx("option",{value:"read",children:w("share.permissionRead")}),e.jsx("option",{value:"write",children:w("share.permissionWrite")})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm text-text-secondary",children:w("share.expiresAt")}),e.jsx("input",{type:"datetime-local",value:k,onChange:S=>g(S.target.value),className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary focus:border-brand focus:outline-none"})]}),(O||d)&&e.jsx("div",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-status-error",children:O||d}),T&&e.jsxs("div",{className:"rounded-md bg-surface-2 px-3 py-2",children:[e.jsx("p",{className:"text-sm text-text-secondary mb-1",children:w("share.linkCreated")}),e.jsxs("div",{className:"flex items-start gap-2 min-w-0",children:[e.jsx("code",{className:"min-w-0 flex-1 break-all text-xs text-text-primary",children:T}),e.jsx("button",{onClick:V,className:"shrink-0 rounded-md bg-brand px-2 py-1 text-xs text-white hover:bg-brand-light transition-colors",children:oe?w("share.copied"):w("share.copy")})]}),ie&&e.jsx("p",{className:"mt-1 text-xs text-status-error",children:w("share.copyFailed")})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"mb-2 text-sm font-medium text-text-secondary",children:w("share.existingShares")}),c?e.jsx("p",{className:"text-sm text-text-muted",children:w("share.loading")}):l.length===0?e.jsx("p",{className:"text-sm text-text-muted",children:w("share.none")}):e.jsx("div",{className:"space-y-2 max-h-40 overflow-y-auto",children:l.map(S=>e.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-md bg-surface-2 px-3 py-2",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"truncate text-sm text-text-primary",children:S.granted_to_user||S.granted_to_team||"Unknown"}),e.jsxs("p",{className:"truncate text-xs text-text-muted",children:[S.permission==="write"?w("share.permissionWrite"):w("share.permissionRead"),S.expires_at?` · expires ${S.expires_at}`:""]})]}),e.jsx("button",{onClick:()=>z(S.id),className:"shrink-0 rounded-md px-2 py-1 text-xs text-status-error hover:bg-surface-3 transition-colors",children:w("share.revoke")})]},S.id))})]})]}),e.jsxs(Bt,{children:[e.jsx("button",{onClick:t,className:"rounded-lg border border-border px-4 py-2 text-sm text-text-secondary hover:bg-surface-2 transition-colors",children:w("common.close")}),e.jsx("button",{onClick:X,disabled:_||(x==="user"?!j.trim():!i.trim()),className:"rounded-lg bg-brand px-4 py-2 text-sm font-medium text-white hover:bg-brand-light disabled:opacity-50 transition-colors",children:_?w("common.creating"):w("share.createShare")})]})]})})}function Fs(s){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/acp/relay/${s}`}function Os(s){const t=Fs(s),r=St(),n=r?{proxyUrl:t,token:r}:{proxyUrl:t};return new _t(n)}const W=[{value:"default",label:"默认",description:"手动审批权限请求"},{value:"acceptEdits",label:"自动接受编辑",description:"自动允许文件编辑操作"},{value:"plan",label:"规划模式",description:"仅规划,不执行工具"},{value:"bypassPermissions",label:"跳过权限",description:"跳过所有权限检查"}],ae="rcs_permission_mode";function Oe(s){return s<1e3?String(s):s<1e6?`${(s/1e3).toFixed(1)}k`:`${(s/1e6).toFixed(1)}M`}function Ls(s){const t=W.findIndex(r=>r.value===s);return W[(t+1+W.length)%W.length].value}function Hs({models:s,currentModelId:t,onSelect:r,disabled:n}){const[l,c]=m.useState(!1),d=s.find(x=>x.modelId===t)??null,p=s.length>0,f=async x=>{r(x.modelId),c(!1)};return e.jsxs(Qe,{open:l,onOpenChange:p?c:void 0,children:[e.jsx(Ge,{asChild:!0,children:e.jsxs("button",{type:"button",disabled:n||!p,className:"flex items-center gap-1.5 rounded-lg px-2 h-7 text-xs text-text-muted hover:text-text-primary hover:bg-surface-2 transition-colors disabled:opacity-50 disabled:cursor-not-allowed font-display",title:"选择模型",children:[e.jsx(st,{className:"h-3 w-3"}),e.jsx("span",{className:"max-w-32 truncate",children:(d==null?void 0:d.name)??t??"选择模型"}),l?e.jsx(Ke,{className:"h-3 w-3"}):e.jsx(Ye,{className:"h-3 w-3"})]})}),e.jsx(Je,{className:"w-72 p-0",align:"start",children:e.jsx(Lt,{models:s,currentModelId:t,onSelect:f,showSearch:s.length>5})})]})}function Bs({mode:s,onModeChange:t,disabled:r}){const[n,l]=m.useState(!1),c=W.find(d=>d.value===s);return e.jsxs(Qe,{open:n,onOpenChange:l,children:[e.jsx(Ge,{asChild:!0,children:e.jsxs("button",{type:"button",disabled:r,className:"flex items-center gap-1.5 rounded-lg px-2 h-7 text-xs text-text-muted hover:text-text-primary hover:bg-surface-2 transition-colors disabled:opacity-50 disabled:cursor-not-allowed font-display",title:"权限模式(Shift+Tab 循环)",children:[e.jsx(Ot,{className:"h-3 w-3"}),e.jsx("span",{className:"max-w-24 truncate",children:(c==null?void 0:c.label)??s}),n?e.jsx(Ke,{className:"h-3 w-3"}):e.jsx(Ye,{className:"h-3 w-3"})]})}),e.jsx(Je,{className:"w-64 p-1",align:"start",children:W.map(d=>e.jsxs("button",{type:"button",onClick:()=>{t(d.value),l(!1)},className:"flex w-full items-start gap-2 rounded-md px-2.5 py-2 text-left hover:bg-surface-2 transition-colors",children:[e.jsx("span",{className:"mt-0.5 flex h-4 w-4 flex-shrink-0 items-center justify-center",children:s===d.value&&e.jsx(ze,{className:"h-3.5 w-3.5 text-brand"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-sm font-medium text-text-primary",children:d.label}),e.jsx("div",{className:"text-xs text-text-muted",children:d.description})]})]},d.value))})]})}function rn({sessionId:s,onSessionLoaded:t}){Ve();const[r,n]=m.useState(null),[l,c]=m.useState(null),[d,p]=m.useState(""),[f,x]=m.useState(!1),[b,j]=m.useState(!1),[N,i]=m.useState(!1),[a,u]=m.useState(!1),[y,k]=m.useState([]),[g,_]=m.useState(!1),[R,T]=m.useState([]),[E,O]=m.useState(null),[B,oe]=m.useState(()=>nt()),[P,ie]=m.useState(null),[L,X]=m.useState(null),[z,V]=m.useState([]),[S,Q]=m.useState(!1),[le,je]=m.useState(""),ce=m.useRef(null),[de,Z]=m.useState(()=>localStorage.getItem(ae)||"default"),[ke,we]=m.useState(null),G=m.useRef(null),[Ne,ve]=m.useState(null),K=m.useRef(null),D=m.useRef(de);D.current=de;const ee=m.useRef(null),_e=m.useRef(null),Se=m.useRef(y);Se.current=y;const te=m.useRef(t);te.current=t;const se=m.useCallback(o=>{we(o),G.current&&clearTimeout(G.current),G.current=setTimeout(()=>we(null),5e3)},[]),ue=m.useCallback(o=>{ve(o),K.current&&clearTimeout(K.current),K.current=setTimeout(()=>ve(null),5e3)},[]),me=m.useCallback(o=>{var C;if(o===D.current)return;const h=D.current;D.current=o,Z(o);try{localStorage.setItem(ae,o)}catch{}(C=_e.current)==null||C.setPermissionMode(o).then(v=>{ee.current={requestId:v,previous:h}}).catch(v=>{console.error("[SessionDetail] set permission mode failed:",v),se(`模式切换请求发送失败: ${v instanceof Error?v.message:String(v)}`),D.current=h,Z(h)})},[se]),A=m.useMemo(()=>new bs(s,k,{onStatusChange:o=>{c(o),_(o==="running"||o==="requires_action")},onError:o=>{console.error("[RCSChatAdapter] error:",o)},onPermissionRequest:o=>{T(h=>h.some(C=>C.requestId===o.requestId)?h:[...h,o])},onModelsStateChange:o=>{O(o)},onSubagentUpdate:o=>{oe(o)},onControlResponse:o=>{const h=ee.current;if(!(!h||h.requestId!==o.requestId)&&(ee.current=null,o.subtype==="error")){D.current=h.previous,Z(h.previous);try{localStorage.setItem(ae,h.previous)}catch{}se(o.error||"模式切换失败")}},onPermissionModeChange:o=>{if(o!==D.current){D.current=o,Z(o);try{localStorage.setItem(ae,o)}catch{}ee.current=null}},onUsageChange:o=>{ie(h=>({inputTokens:Math.max((h==null?void 0:h.inputTokens)??0,o.inputTokens),outputTokens:Math.max((h==null?void 0:h.outputTokens)??0,o.outputTokens),totalCostUsd:o.totalCostUsd??(h==null?void 0:h.totalCostUsd)??null}))},onElicitationRequest:o=>{X(o)}}),[s,se]);m.useEffect(()=>(_e.current=A,()=>{A.disconnect()}),[A]),m.useEffect(()=>{let o=!1;async function h(){var C;p("");try{const v=await Dt(s);if(o)return;n(v),c(v.status),be(v.status)&&A.markClosed(),_(v.status==="running"||v.status==="requires_action"),(C=te.current)==null||C.call(te,v)}catch(v){if(o)return;p(v instanceof Error?v.message:w("session.loadFailed"));return}try{await A.init()}catch(v){console.warn("Failed to init adapter:",v)}}return h(),()=>{o=!0}},[s,A]);const U=be(l),H=(r==null?void 0:r.access_level)==="read",xe=m.useCallback(()=>{k([]),Ct(s).catch(o=>{console.warn("[SessionDetail] Failed to clear session history:",o)})},[s]),ne=m.useCallback(async o=>{const h=o.text.trim(),C=o.images&&o.images.length>0||o.attachments&&o.attachments.length>0;if(!h&&!C||U)return;const v=await Et(h,{sessionId:s,availableCommands:Re,availableModels:(E==null?void 0:E.availableModels)??[],currentModel:E?{modelId:E.currentModelId,name:E.currentModelId}:null,supportsImages:!0,entries:Se.current,setModel:async $=>{await F(s,{type:"control_request",request:{subtype:"set_model",model:$}}),O(he=>he&&{...he,currentModelId:$})},onNewSession:()=>{k([])}}).catch(()=>null);if(v){if(Mt("[SessionDetail] local command result",v),"clearEntries"in v&&v.clearEntries){xe();return}if("newSession"in v&&v.newSession){xe();return}if("userEntry"in v){k($=>[...$,v.userEntry,v.cmdEntry]);return}}_(!0);try{await A.sendMessage(h,o.images,o.attachments)}catch($){if(console.error("Send failed:",$),$ instanceof Tt&&$.type==="session_closed"){c("archived"),A.markClosed(),ue(w("session.closedSendBlocked"));return}ue(`${w("session.sendFailed")}${$ instanceof Error?`: ${$.message}`:""}`)}},[A,U,s,E,xe,ue]),rt=m.useCallback(o=>{if(g){V(h=>[...h,o]);return}ne(o)},[g,ne]),pe=m.useRef(!1);m.useEffect(()=>{if(U){V(h=>h.length>0?[]:h);return}if(g||z.length===0||pe.current)return;const o=z[0];o&&(pe.current=!0,V(h=>h.slice(1)),ne(o).finally(()=>{pe.current=!1}))},[g,z,ne,U]);const Ce=m.useCallback(async()=>{try{await A.interrupt()}catch(o){console.error("Interrupt failed:",o)}finally{_(!1)}},[A]),at=m.useCallback(()=>{me(Ls(D.current))},[me]);m.useEffect(()=>()=>{G.current&&clearTimeout(G.current),K.current&&clearTimeout(K.current)},[]);const ot=m.useCallback(async()=>{if(r&&window.confirm(w("dashboard.confirmDelete").replace("{id}",r.title||r.id)))try{await At(r.id),window.location.href="/code/"}catch(o){alert(o instanceof Error?o.message:w("dashboard.deleteFailed"))}},[r]),it=m.useCallback(async o=>{try{await A.respondPermission(o,!0)}catch(h){console.error("Failed to approve:",h)}T(h=>h.filter(C=>C.requestId!==o))},[A]),lt=m.useCallback(async(o,h)=>{try{await A.respondPermission(o,!0,{updated_permissions:h})}catch(C){console.error("Failed to approve with rules:",C)}T(C=>C.filter(v=>v.requestId!==o))},[A]),ct=m.useCallback(async(o,h)=>{const C=L;if(X(null),!!C)try{await A.respondElicitation(C.requestId,o,h)}catch(v){console.error("Failed to submit elicitation:",v)}},[L,A]),dt=m.useCallback(()=>{!r||H||(je(r.title||""),Q(!0),setTimeout(()=>{var o,h;(o=ce.current)==null||o.focus(),(h=ce.current)==null||h.select()},0))},[r,H]),Ee=m.useCallback(async()=>{const o=le.trim();if(Q(!1),!(!r||!o||o===r.title))try{const h=await Rt(r.id,o);n(C=>C&&{...C,title:h.title??o})}catch(h){console.error("Rename failed:",h),alert(h instanceof Error?h.message:"重命名失败")}},[r,le]),ut=m.useCallback(async o=>{try{await A.respondPermission(o,!1)}catch(h){console.error("Failed to reject:",h)}T(h=>h.filter(C=>C.requestId!==o))},[A]),mt=m.useCallback(async(o,h,C)=>{try{await F(s,{type:"permission_response",approved:!0,request_id:o,updated_input:{questions:C,answers:h}})}catch(v){console.error("Failed to submit answers:",v)}T(v=>v.filter($=>$.requestId!==o))},[s]),xt=m.useCallback(async(o,h,C)=>{try{h==="no"?await F(s,{type:"permission_response",approved:!1,request_id:o,...C?{message:C}:{}}):await F(s,{type:"permission_response",approved:!0,request_id:o,updated_permissions:[{type:"setMode",mode:{"yes-accept-edits":"acceptEdits","yes-default":"default"}[h]||"default",destination:"session"}]})}catch(v){console.error("Failed to submit plan response:",v)}T(v=>v.filter($=>$.requestId!==o))},[s]);return d?e.jsx("div",{className:"flex flex-1 items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-status-error",children:d}),e.jsx("a",{href:"/code/",className:"mt-4 inline-block text-brand hover:underline",children:w("session.backToDashboard")})]})}):r?r.source==="acp"&&r.environment_id?e.jsx(Vs,{sessionId:s,agentId:r.environment_id}):e.jsx(We,{children:e.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[e.jsx("h1",{className:"sr-only",children:r.title||r.id}),e.jsx("div",{className:"border-b bg-surface-1 px-4 py-3",children:e.jsxs("div",{className:"mx-auto max-w-5xl",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[S?e.jsx("input",{ref:ce,value:le,onChange:o=>je(o.target.value),onKeyDown:o=>{o.key==="Enter"&&!o.nativeEvent.isComposing?(o.preventDefault(),Ee()):o.key==="Escape"&&(o.preventDefault(),Q(!1))},onBlur:()=>void Ee(),maxLength:200,className:"w-full max-w-md rounded-lg border border-brand/50 bg-surface-2 px-2.5 py-1 font-display text-lg font-semibold text-text-primary focus:outline-none focus:ring-2 focus:ring-brand/30"}):e.jsxs("h2",{className:"group/title flex min-w-0 items-center gap-1.5 font-display text-lg font-semibold text-text-primary",children:[e.jsx("span",{className:"truncate",children:r.title||r.id}),!H&&!U&&e.jsx("button",{type:"button",onClick:dt,className:"flex-shrink-0 rounded p-0.5 text-text-muted opacity-0 transition-opacity hover:text-text-primary group-hover/title:opacity-100",title:"重命名会话",children:e.jsx($t,{className:"h-3.5 w-3.5"})})]}),r.visibility&&!S&&e.jsx(Vt,{visibility:r.visibility||"private"})]}),e.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[(()=>{var C;const o=r.source==="acp"?"acp":(C=r.environment)==null?void 0:C.worker_type,h=Ht(o);return e.jsx("span",{className:`rounded-full px-2 py-0.5 text-xs font-medium ${h.colorClass}`,children:h.fullLabel})})(),l&&e.jsx(Le,{status:l}),e.jsx("span",{className:"text-xs text-text-muted",children:He(r.created_at)})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>u(!a),className:`flex items-center gap-1 rounded-md px-2 py-1 text-xs transition-colors ${a?"bg-brand-light text-white":"text-text-muted hover:bg-surface-2 hover:text-text-secondary"}`,title:w("artifacts.title"),children:e.jsx(It,{className:"h-3.5 w-3.5"})}),!H&&(r==null?void 0:r.access_level)!=="write"&&e.jsx("button",{onClick:()=>i(!0),className:"flex items-center gap-1 rounded-md px-2 py-1 text-xs text-text-muted hover:bg-surface-2 hover:text-text-secondary transition-colors",title:w("session.share"),children:e.jsx(ds,{className:"h-3.5 w-3.5"})}),e.jsx("button",{onClick:()=>j(!b),className:"flex items-center gap-1 rounded-md px-2 py-1 text-xs text-text-muted hover:bg-surface-2 hover:text-text-secondary transition-colors",title:w("session.info"),children:e.jsx(ss,{className:"h-3.5 w-3.5"})}),e.jsxs("button",{onClick:()=>x(!f),className:"flex items-center gap-1 rounded-md px-3 py-1.5 text-sm text-text-primary font-bold hover:bg-brand-light hover:text-white transition-colors",children:[w("session.tasks"),R.length>0&&e.jsx("span",{className:"ml-1 rounded-full bg-status-warning px-1.5 py-0.5 text-[10px] font-medium text-white",children:R.length})]})]})]}),b&&e.jsxs("div",{className:"mt-2 rounded-md bg-surface-2 px-3 py-2 text-xs text-text-muted space-y-1 font-mono",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-text-primary font-bold font-sans",children:w("session.metaSession")})," ",r.id]}),r.environment_id&&e.jsxs("div",{children:[e.jsx("span",{className:"text-text-primary font-bold font-sans",children:w("session.metaEnvironment")})," ",r.environment_id]})]})]})}),a&&e.jsx("div",{className:"border-b bg-surface-1 px-4 py-4",children:e.jsx("div",{className:"mx-auto max-w-3xl",children:e.jsx(Qt,{sessionId:s,embedded:!0})})}),e.jsx(Pt,{entries:y,isLoading:g,emptyTitle:w("session.emptyTitle"),emptyDescription:w("session.emptyDescription")}),e.jsx(Es,{state:B}),R.length>0&&e.jsx("div",{className:"border-t bg-surface-1 px-4 py-3",children:e.jsx("div",{className:"mx-auto max-w-3xl space-y-3",children:R.map(o=>e.jsx(zs,{request:o,onApprove:()=>it(o.requestId),onApproveAlways:o.suggestions&&o.suggestions.length>0?()=>lt(o.requestId,o.suggestions??[]):void 0,onReject:()=>ut(o.requestId),onSubmitAnswers:mt,onSubmitPlan:xt},o.requestId))})}),L&&e.jsx("div",{className:"border-t bg-surface-1 px-4 py-3",children:e.jsx("div",{className:"mx-auto max-w-3xl",children:e.jsx(Is,{request:L,onSubmit:ct})})}),Ne&&e.jsx("div",{className:"mx-auto max-w-3xl w-full px-4 sm:px-8 pb-1",children:e.jsx("div",{className:"rounded-lg bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 px-3 py-1.5 text-xs text-red-700 dark:text-red-300",children:Ne})}),ke&&e.jsx("div",{className:"mx-auto max-w-3xl w-full px-4 sm:px-8 pb-1",children:e.jsx("div",{className:"rounded-lg bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 px-3 py-1.5 text-xs text-red-700 dark:text-red-300",children:ke})}),e.jsxs("div",{className:"max-w-3xl mx-auto w-full px-4 sm:px-8 pb-1 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Bs,{mode:de,onModeChange:me,disabled:U||H}),e.jsx(Hs,{models:(E==null?void 0:E.availableModels)??[],currentModelId:(E==null?void 0:E.currentModelId)??null,onSelect:o=>{F(s,{type:"control_request",request:{subtype:"set_model",model:o}}),O(h=>h&&{...h,currentModelId:o})},disabled:U||H})]}),P&&e.jsxs("span",{className:"text-[11px] text-text-muted font-mono",title:"会话累计用量(input 含缓存读写)",children:[Oe(P.inputTokens)," in / ",Oe(P.outputTokens)," out",P.totalCostUsd!=null&&` · $${P.totalCostUsd.toFixed(2)}`]})]}),e.jsx(qt,{onSubmit:rt,isLoading:g,onInterrupt:Ce,onCycleMode:at,disabled:U||H,placeholder:U?w("session.closed"):H?w("session.readOnly"):w("session.inputPlaceholder"),supportsAttachments:!0,commands:Re,queueWhileLoading:!0,queuedCount:z.length,onDequeue:o=>V(h=>h.filter((C,v)=>v!==o)),onSearchFiles:o=>A.searchFiles(o)}),f&&r&&e.jsx(Ns,{onClose:()=>x(!1),session:r,liveStatus:l,pendingPermissions:R,onInterrupt:Ce,onDelete:ot}),e.jsx(Us,{open:N,onClose:()=>i(!1),sessionId:r.id,sessionTitle:r.title||void 0})]})}):e.jsx("div",{className:"flex flex-1 items-center justify-center",children:e.jsx("div",{className:"text-text-muted",children:w("session.loading")})})}function zs({request:s,onApprove:t,onApproveAlways:r,onReject:n,onSubmitAnswers:l,onSubmitPlan:c}){const d=s.toolName,p=s.toolInput,f=s.description||"";if(d==="AskUserQuestion"){const x=p.questions||[];return e.jsx(Ts,{requestId:s.requestId,questions:x,description:f,onSubmit:b=>l(s.requestId,b,x),onSkip:n})}if(d==="ExitPlanMode"){const x=p.plan||"";return e.jsx(Rs,{requestId:s.requestId,planContent:x,description:f,onSubmit:(b,j)=>c(s.requestId,b,j)})}return e.jsx(Ms,{requestId:s.requestId,toolName:d,toolInput:p,description:f,suggestions:s.suggestions,onApprove:t,onApproveAlways:r,onReject:n})}function Vs({sessionId:s,agentId:t}){const[r,n]=m.useState(null),[l,c]=m.useState("disconnected"),[d,p]=m.useState(null),f=m.useRef(null);return m.useEffect(()=>{const x=Os(t);return x.setConnectionStateHandler((b,j)=>{c(b),p(j||null)}),f.current=x,n(x),x.connect().catch(b=>{b instanceof Ut||(p(b.message),c("error"))}),()=>{x.disconnect(),f.current=null,n(null),c("disconnected")}},[t]),e.jsx(We,{children:e.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[d&&l==="error"&&e.jsx("div",{className:"px-4 py-2 bg-destructive/10 text-destructive text-sm border-b",children:d}),l==="connecting"&&e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"animate-spin h-8 w-8 border-2 border-brand border-t-transparent rounded-full mx-auto mb-3"}),e.jsx("p",{className:"text-text-muted text-sm",children:w("session.connectingAgent")})]})}),l==="error"&&!r&&e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"font-medium mb-1",children:w("session.connectionFailed")}),e.jsx("p",{className:"text-text-muted text-sm",children:d})]})}),r&&l==="connected"&&e.jsx("div",{className:"flex-1 min-h-0",children:e.jsx(Ft,{client:r,agentId:t})})]})})}export{rn as SessionDetail};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{U as a,C as n}from"./mermaid.core-dT6jK4cB.js";const t=(r,o)=>a.lang.round(n.parse(r)[o]);export{t as c};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as a,a as s,c as t,C as e}from"./chunk-727SXJPM-DCD6b_gA.js";import{b as i}from"./mermaid.core-dT6jK4cB.js";import"./chunk-FMBD7UC4-DnoA9fQr.js";import"./chunk-ND2GUHAM-BsbvPHC6.js";import"./chunk-55IACEB6-k7MztSxj.js";import"./chunk-2J33WTMH-Cz-fnX8Q.js";import"./shiki-mEP5vQQu.js";import"./vendor-DE_-CLIE.js";import"./mermaid-VLURNSYL-CAb8MsJr.js";import"./main-2FF76CHO.js";import"./motion-BILbV7YQ.js";var g={parser:t,get db(){return new e},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{g as diagram};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as a,a as s,c as t,C as e}from"./chunk-727SXJPM-DCD6b_gA.js";import{b as i}from"./mermaid.core-dT6jK4cB.js";import"./chunk-FMBD7UC4-DnoA9fQr.js";import"./chunk-ND2GUHAM-BsbvPHC6.js";import"./chunk-55IACEB6-k7MztSxj.js";import"./chunk-2J33WTMH-Cz-fnX8Q.js";import"./shiki-mEP5vQQu.js";import"./vendor-DE_-CLIE.js";import"./mermaid-VLURNSYL-CAb8MsJr.js";import"./main-2FF76CHO.js";import"./motion-BILbV7YQ.js";var g={parser:t,get db(){return new e},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{g as diagram};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{ab as a}from"./main-2FF76CHO.js";/**
|
|
2
|
-
* @license lucide-react v0.555.0 - ISC
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the ISC license.
|
|
5
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const e=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],n=a("external-link",e);export{n as E};
|