termdock 1.4.310 → 1.4.312
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/client/assets/{App-CytIMrFr.js → App-ChS2-lkz.js} +8 -8
- package/dist/client/assets/App-ChS2-lkz.js.br +0 -0
- package/dist/client/assets/App-ChS2-lkz.js.gz +0 -0
- package/dist/client/assets/ArchitecturePanel-JtjyyJoW.js +9 -0
- package/dist/client/assets/ArchitecturePanel-JtjyyJoW.js.br +0 -0
- package/dist/client/assets/ArchitecturePanel-JtjyyJoW.js.gz +0 -0
- package/dist/client/assets/{ChangeWalkthroughPanel-Bm9Tvd6H.js → ChangeWalkthroughPanel-BlQ5-VPp.js} +1 -1
- package/dist/client/assets/ChangeWalkthroughPanel-BlQ5-VPp.js.br +0 -0
- package/dist/client/assets/ChangeWalkthroughPanel-BlQ5-VPp.js.gz +0 -0
- package/dist/client/assets/{CollaborationMainWorkspace-BagYBDlJ.js → CollaborationMainWorkspace-aFLAMqDr.js} +1 -1
- package/dist/client/assets/CollaborationMainWorkspace-aFLAMqDr.js.br +0 -0
- package/dist/client/assets/CollaborationMainWorkspace-aFLAMqDr.js.gz +0 -0
- package/dist/client/assets/CollaborationTaskContent-BDQMRhU9.js +2 -0
- package/dist/client/assets/{ComputerControlView-CC6r2cD3.js → ComputerControlView-TAKDbBUl.js} +2 -2
- package/dist/client/assets/ComputerControlView-TAKDbBUl.js.br +0 -0
- package/dist/client/assets/ComputerControlView-TAKDbBUl.js.gz +0 -0
- package/dist/client/assets/{DagPlayground-BqAadqBT.js → DagPlayground-CR4uDFOx.js} +1 -1
- package/dist/client/assets/DagPlayground-CR4uDFOx.js.br +0 -0
- package/dist/client/assets/DagPlayground-CR4uDFOx.js.gz +0 -0
- package/dist/client/assets/{DiffLab-CrEVLy-j.js → DiffLab-BqeHMDOy.js} +1 -1
- package/dist/client/assets/DiffLab-BqeHMDOy.js.br +0 -0
- package/dist/client/assets/DiffLab-BqeHMDOy.js.gz +0 -0
- package/dist/client/assets/{DiffReview-C8e2GQxb.js → DiffReview-DqrOcRfP.js} +1 -1
- package/dist/client/assets/DiffReview-DqrOcRfP.js.br +0 -0
- package/dist/client/assets/DiffReview-DqrOcRfP.js.gz +0 -0
- package/dist/client/assets/{DiffReviewLab-RQ1NmpZE.js → DiffReviewLab-CEYpbrL6.js} +1 -1
- package/dist/client/assets/DiffReviewLab-CEYpbrL6.js.br +0 -0
- package/dist/client/assets/DiffReviewLab-CEYpbrL6.js.gz +0 -0
- package/dist/client/assets/{DiffViewer-KljgMa9h.js → DiffViewer-F-uQSmhG.js} +1 -1
- package/dist/client/assets/DiffViewer-F-uQSmhG.js.br +0 -0
- package/dist/client/assets/DiffViewer-F-uQSmhG.js.gz +0 -0
- package/dist/client/assets/{ModelPreview-B9UR1TR3.js → ModelPreview-KmXFkgij.js} +1 -1
- package/dist/client/assets/ModelPreview-KmXFkgij.js.br +0 -0
- package/dist/client/assets/ModelPreview-KmXFkgij.js.gz +0 -0
- package/dist/client/assets/{RightSidebar-DSH93gN5.js → RightSidebar-VMdXpo4h.js} +3 -3
- package/dist/client/assets/RightSidebar-VMdXpo4h.js.br +0 -0
- package/dist/client/assets/RightSidebar-VMdXpo4h.js.gz +0 -0
- package/dist/client/assets/{abnfDiagram-VCTEODGH-WFUf9n1A.js → abnfDiagram-VCTEODGH-CAMk1C0N.js} +1 -1
- package/dist/client/assets/abnfDiagram-VCTEODGH-CAMk1C0N.js.br +0 -0
- package/dist/client/assets/abnfDiagram-VCTEODGH-CAMk1C0N.js.gz +0 -0
- package/dist/client/assets/{app-Bey8S6UU.js → app-CHxLSuGQ.js} +3 -3
- package/dist/client/assets/app-CHxLSuGQ.js.br +0 -0
- package/dist/client/assets/app-CHxLSuGQ.js.gz +0 -0
- package/dist/client/assets/{arc-BXKxIsA3.js → arc-CYG_-1vC.js} +1 -1
- package/dist/client/assets/arc-CYG_-1vC.js.br +0 -0
- package/dist/client/assets/arc-CYG_-1vC.js.gz +0 -0
- package/dist/client/assets/{architectureDiagram-5GKGNRK7-DAfRrSxr.js → architectureDiagram-5GKGNRK7-BqHzezLR.js} +1 -1
- package/dist/client/assets/architectureDiagram-5GKGNRK7-BqHzezLR.js.br +0 -0
- package/dist/client/assets/architectureDiagram-5GKGNRK7-BqHzezLR.js.gz +0 -0
- package/dist/client/assets/{blockDiagram-I7D4REHJ-1HbSy7rb.js → blockDiagram-I7D4REHJ-D6GWRO_Z.js} +1 -1
- package/dist/client/assets/blockDiagram-I7D4REHJ-D6GWRO_Z.js.br +0 -0
- package/dist/client/assets/blockDiagram-I7D4REHJ-D6GWRO_Z.js.gz +0 -0
- package/dist/client/assets/{c4Diagram-7LVT6UL2-Dxwui-M_.js → c4Diagram-7LVT6UL2-CutmGIGb.js} +1 -1
- package/dist/client/assets/c4Diagram-7LVT6UL2-CutmGIGb.js.br +0 -0
- package/dist/client/assets/c4Diagram-7LVT6UL2-CutmGIGb.js.gz +0 -0
- package/dist/client/assets/channel-B3BKM2gg.js +1 -0
- package/dist/client/assets/{chunk-2Q5K7J3B-CJSdJ_A1.js → chunk-2Q5K7J3B-DwiUpGFu.js} +1 -1
- package/dist/client/assets/{chunk-5VM5RSS4-BNEXn4bI.js → chunk-5VM5RSS4-C35gLPSH.js} +1 -1
- package/dist/client/assets/{chunk-F27PBJKO-BaM6iLMb.js → chunk-F27PBJKO-CNptP19P.js} +1 -1
- package/dist/client/assets/chunk-F27PBJKO-CNptP19P.js.br +0 -0
- package/dist/client/assets/chunk-F27PBJKO-CNptP19P.js.gz +0 -0
- package/dist/client/assets/{chunk-IMKFNOWR-DxPJBdLq.js → chunk-IMKFNOWR-DHdpB9A0.js} +1 -1
- package/dist/client/assets/chunk-IMKFNOWR-DHdpB9A0.js.br +0 -0
- package/dist/client/assets/chunk-IMKFNOWR-DHdpB9A0.js.gz +0 -0
- package/dist/client/assets/{chunk-JWPE2WC7-BwEOSoiu.js → chunk-JWPE2WC7-CrKSOzdE.js} +1 -1
- package/dist/client/assets/{chunk-POPQ4Y6H-CbYcBz8G.js → chunk-POPQ4Y6H-CiZGLRSk.js} +1 -1
- package/dist/client/assets/{chunk-SVP7TREG-CpnycZ3K.js → chunk-SVP7TREG-B70pX8OB.js} +1 -1
- package/dist/client/assets/chunk-SVP7TREG-B70pX8OB.js.br +0 -0
- package/dist/client/assets/chunk-SVP7TREG-B70pX8OB.js.gz +0 -0
- package/dist/client/assets/{chunk-TICWLB2K-5oWwjAOF.js → chunk-TICWLB2K-Ba1mI99F.js} +1 -1
- package/dist/client/assets/chunk-TICWLB2K-Ba1mI99F.js.br +0 -0
- package/dist/client/assets/chunk-TICWLB2K-Ba1mI99F.js.gz +0 -0
- package/dist/client/assets/{chunk-XXDRQBXY-VWUm4Sz5.js → chunk-XXDRQBXY-DmKIl18h.js} +1 -1
- package/dist/client/assets/classDiagram-ZZMXUADV-CS4V_MQS.js +1 -0
- package/dist/client/assets/classDiagram-v2-VYDZK3BY-CS4V_MQS.js +1 -0
- package/dist/client/assets/{cose-bilkent-JH36ORCC-gpF5Tw44.js → cose-bilkent-JH36ORCC-C-NMDUHW.js} +1 -1
- package/dist/client/assets/cose-bilkent-JH36ORCC-C-NMDUHW.js.br +0 -0
- package/dist/client/assets/cose-bilkent-JH36ORCC-C-NMDUHW.js.gz +0 -0
- package/dist/client/assets/{cynefin-OW5HDTMX-HFr7zRQ0.js → cynefin-OW5HDTMX-CZgEc1ab.js} +1 -1
- package/dist/client/assets/cynefin-OW5HDTMX-CZgEc1ab.js.br +0 -0
- package/dist/client/assets/cynefin-OW5HDTMX-CZgEc1ab.js.gz +0 -0
- package/dist/client/assets/{cynefinDiagram-5FMLGOSQ-LccKgJj0.js → cynefinDiagram-5FMLGOSQ-CHQeSNm2.js} +1 -1
- package/dist/client/assets/cynefinDiagram-5FMLGOSQ-CHQeSNm2.js.br +0 -0
- package/dist/client/assets/cynefinDiagram-5FMLGOSQ-CHQeSNm2.js.gz +0 -0
- package/dist/client/assets/{dagre-GXQ25YYZ-C7eLk1r1.js → dagre-GXQ25YYZ-B_jkMdPS.js} +1 -1
- package/dist/client/assets/dagre-GXQ25YYZ-B_jkMdPS.js.br +0 -0
- package/dist/client/assets/dagre-GXQ25YYZ-B_jkMdPS.js.gz +0 -0
- package/dist/client/assets/{diagram-S7CK7UJ4-DkWPZYAg.js → diagram-S7CK7UJ4-nv6Lnsrp.js} +1 -1
- package/dist/client/assets/diagram-S7CK7UJ4-nv6Lnsrp.js.br +0 -0
- package/dist/client/assets/diagram-S7CK7UJ4-nv6Lnsrp.js.gz +0 -0
- package/dist/client/assets/{diagram-UQ7AKVKN-DluTsMXz.js → diagram-UQ7AKVKN-BZf2fzaA.js} +1 -1
- package/dist/client/assets/diagram-UQ7AKVKN-BZf2fzaA.js.br +0 -0
- package/dist/client/assets/diagram-UQ7AKVKN-BZf2fzaA.js.gz +0 -0
- package/dist/client/assets/{diagram-VSXAHHWV-BLXEmXmu.js → diagram-VSXAHHWV-CxL0_BH8.js} +1 -1
- package/dist/client/assets/diagram-VSXAHHWV-CxL0_BH8.js.br +0 -0
- package/dist/client/assets/diagram-VSXAHHWV-CxL0_BH8.js.gz +0 -0
- package/dist/client/assets/{diagram-VX7I27RA-DO3J99WU.js → diagram-VX7I27RA-Dm9MqpIE.js} +1 -1
- package/dist/client/assets/diagram-VX7I27RA-Dm9MqpIE.js.br +0 -0
- package/dist/client/assets/diagram-VX7I27RA-Dm9MqpIE.js.gz +0 -0
- package/dist/client/assets/{diagram-Z3DM3KII-kvkSusTy.js → diagram-Z3DM3KII-BIfTa7P5.js} +1 -1
- package/dist/client/assets/diagram-Z3DM3KII-BIfTa7P5.js.br +0 -0
- package/dist/client/assets/diagram-Z3DM3KII-BIfTa7P5.js.gz +0 -0
- package/dist/client/assets/{ebnfDiagram-PWID7BFC-Bxd9hatc.js → ebnfDiagram-PWID7BFC-D4XhCDFS.js} +1 -1
- package/dist/client/assets/ebnfDiagram-PWID7BFC-D4XhCDFS.js.br +0 -0
- package/dist/client/assets/ebnfDiagram-PWID7BFC-D4XhCDFS.js.gz +0 -0
- package/dist/client/assets/{erDiagram-RLTQ6QDP-BWc3uM23.js → erDiagram-RLTQ6QDP-Dxd48dXC.js} +1 -1
- package/dist/client/assets/erDiagram-RLTQ6QDP-Dxd48dXC.js.br +0 -0
- package/dist/client/assets/erDiagram-RLTQ6QDP-Dxd48dXC.js.gz +0 -0
- package/dist/client/assets/{flowDiagram-HODETNUW-BQhPtc9z.js → flowDiagram-HODETNUW-BXBMsEmE.js} +1 -1
- package/dist/client/assets/flowDiagram-HODETNUW-BXBMsEmE.js.br +0 -0
- package/dist/client/assets/flowDiagram-HODETNUW-BXBMsEmE.js.gz +0 -0
- package/dist/client/assets/{ganttDiagram-EL5Y4UJY-DzmTLgVr.js → ganttDiagram-EL5Y4UJY-CBfDd-KZ.js} +1 -1
- package/dist/client/assets/ganttDiagram-EL5Y4UJY-CBfDd-KZ.js.br +0 -0
- package/dist/client/assets/ganttDiagram-EL5Y4UJY-CBfDd-KZ.js.gz +0 -0
- package/dist/client/assets/{gestureArbiter-BuNZMZ7A.js → gestureArbiter-DXLmNGli.js} +1 -1
- package/dist/client/assets/gestureArbiter-DXLmNGli.js.br +0 -0
- package/dist/client/assets/{gestureArbiter-BuNZMZ7A.js.gz → gestureArbiter-DXLmNGli.js.gz} +0 -0
- package/dist/client/assets/{gitGraphDiagram-WWUBYQGX-r0Onfl7K.js → gitGraphDiagram-WWUBYQGX-DtLM68fN.js} +1 -1
- package/dist/client/assets/gitGraphDiagram-WWUBYQGX-DtLM68fN.js.br +0 -0
- package/dist/client/assets/gitGraphDiagram-WWUBYQGX-DtLM68fN.js.gz +0 -0
- package/dist/client/assets/index-KuPaZyuZ.css +1 -0
- package/dist/client/assets/index-KuPaZyuZ.css.br +0 -0
- package/dist/client/assets/{index-C6D5a-dg.css.gz → index-KuPaZyuZ.css.gz} +0 -0
- package/dist/client/assets/{infoDiagram-27XIBGKW-C52jpDzv.js → infoDiagram-27XIBGKW-FRhqdJvW.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-5VMMS53U-C-l0eHmO.js → ishikawaDiagram-5VMMS53U-DAHBvAZ-.js} +1 -1
- package/dist/client/assets/ishikawaDiagram-5VMMS53U-DAHBvAZ-.js.br +0 -0
- package/dist/client/assets/ishikawaDiagram-5VMMS53U-DAHBvAZ-.js.gz +0 -0
- package/dist/client/assets/{journeyDiagram-3NMN7TZE-DmhgEOjX.js → journeyDiagram-3NMN7TZE-CVuWuL3Z.js} +1 -1
- package/dist/client/assets/journeyDiagram-3NMN7TZE-CVuWuL3Z.js.br +0 -0
- package/dist/client/assets/journeyDiagram-3NMN7TZE-CVuWuL3Z.js.gz +0 -0
- package/dist/client/assets/{kanban-definition-UXKFOSKX-BnZWlxIT.js → kanban-definition-UXKFOSKX-ByQSUVJV.js} +1 -1
- package/dist/client/assets/kanban-definition-UXKFOSKX-ByQSUVJV.js.br +0 -0
- package/dist/client/assets/kanban-definition-UXKFOSKX-ByQSUVJV.js.gz +0 -0
- package/dist/client/assets/{layout-BrxPpC7u.js → layout-Bb3Nb1c4.js} +1 -1
- package/dist/client/assets/layout-Bb3Nb1c4.js.br +0 -0
- package/dist/client/assets/layout-Bb3Nb1c4.js.gz +0 -0
- package/dist/client/assets/{linear-DaEpqVcH.js → linear-DHMMQlOo.js} +1 -1
- package/dist/client/assets/linear-DHMMQlOo.js.br +0 -0
- package/dist/client/assets/linear-DHMMQlOo.js.gz +0 -0
- package/dist/client/assets/{mermaid.core-CidoOS12.js → mermaid.core-BYfniK0H.js} +5 -5
- package/dist/client/assets/mermaid.core-BYfniK0H.js.br +0 -0
- package/dist/client/assets/mermaid.core-BYfniK0H.js.gz +0 -0
- package/dist/client/assets/{mindmap-definition-YA3MSWOX-Bpr3CVLy.js → mindmap-definition-YA3MSWOX-EDLD5AyH.js} +1 -1
- package/dist/client/assets/mindmap-definition-YA3MSWOX-EDLD5AyH.js.br +0 -0
- package/dist/client/assets/mindmap-definition-YA3MSWOX-EDLD5AyH.js.gz +0 -0
- package/dist/client/assets/{passwordBootstrap-D7hFrc0r.js → passwordBootstrap-DCrtirwT.js} +1 -1
- package/dist/client/assets/passwordBootstrap-DCrtirwT.js.br +0 -0
- package/dist/client/assets/passwordBootstrap-DCrtirwT.js.gz +0 -0
- package/dist/client/assets/{pegDiagram-XKGWAZYB-Bw2JpSYn.js → pegDiagram-XKGWAZYB-BHYhkqJN.js} +1 -1
- package/dist/client/assets/pegDiagram-XKGWAZYB-BHYhkqJN.js.br +0 -0
- package/dist/client/assets/pegDiagram-XKGWAZYB-BHYhkqJN.js.gz +0 -0
- package/dist/client/assets/{pieDiagram-E7YTZNPT-BaKc3ifQ.js → pieDiagram-E7YTZNPT-BUIJlswC.js} +1 -1
- package/dist/client/assets/pieDiagram-E7YTZNPT-BUIJlswC.js.br +0 -0
- package/dist/client/assets/pieDiagram-E7YTZNPT-BUIJlswC.js.gz +0 -0
- package/dist/client/assets/{quadrantDiagram-AXDQQJYC-B0Yi-dl9.js → quadrantDiagram-AXDQQJYC-D8Im-7yC.js} +1 -1
- package/dist/client/assets/quadrantDiagram-AXDQQJYC-D8Im-7yC.js.br +0 -0
- package/dist/client/assets/quadrantDiagram-AXDQQJYC-D8Im-7yC.js.gz +0 -0
- package/dist/client/assets/{railroadDiagram-O6MQD6OU-DCcCQofU.js → railroadDiagram-O6MQD6OU-D7n6z2G1.js} +1 -1
- package/dist/client/assets/railroadDiagram-O6MQD6OU-D7n6z2G1.js.br +0 -0
- package/dist/client/assets/railroadDiagram-O6MQD6OU-D7n6z2G1.js.gz +0 -0
- package/dist/client/assets/{rdpSession-DY81W5BY.js → rdpSession-DJlNIbVk.js} +1 -1
- package/dist/client/assets/rdpSession-DJlNIbVk.js.br +0 -0
- package/dist/client/assets/rdpSession-DJlNIbVk.js.gz +0 -0
- package/dist/client/assets/{referenceLongPress-CAzWqXsY.js → referenceLongPress-DFSrssSr.js} +1 -1
- package/dist/client/assets/referenceLongPress-DFSrssSr.js.br +0 -0
- package/dist/client/assets/referenceLongPress-DFSrssSr.js.gz +0 -0
- package/dist/client/assets/{requirementDiagram-BXWQKSXE-CEJFRPWH.js → requirementDiagram-BXWQKSXE-Ki0rR-F7.js} +1 -1
- package/dist/client/assets/requirementDiagram-BXWQKSXE-Ki0rR-F7.js.br +0 -0
- package/dist/client/assets/requirementDiagram-BXWQKSXE-Ki0rR-F7.js.gz +0 -0
- package/dist/client/assets/{sankeyDiagram-P5KCCOFB-B3Wk45FA.js → sankeyDiagram-P5KCCOFB-36NmMqsW.js} +1 -1
- package/dist/client/assets/sankeyDiagram-P5KCCOFB-36NmMqsW.js.br +0 -0
- package/dist/client/assets/sankeyDiagram-P5KCCOFB-36NmMqsW.js.gz +0 -0
- package/dist/client/assets/{sequenceDiagram-WJ2MYXX4-BejEsITb.js → sequenceDiagram-WJ2MYXX4-5vsPuFyO.js} +1 -1
- package/dist/client/assets/sequenceDiagram-WJ2MYXX4-5vsPuFyO.js.br +0 -0
- package/dist/client/assets/sequenceDiagram-WJ2MYXX4-5vsPuFyO.js.gz +0 -0
- package/dist/client/assets/{sizeCapture-INFHLROL-DZ5NJZnM.js → sizeCapture-INFHLROL-DbAulwBg.js} +1 -1
- package/dist/client/assets/sizeCapture-INFHLROL-DbAulwBg.js.br +0 -0
- package/dist/client/assets/sizeCapture-INFHLROL-DbAulwBg.js.gz +0 -0
- package/dist/client/assets/{sparkles-DQGLdN2b.js → sparkles-CapLTKAs.js} +1 -1
- package/dist/client/assets/{stateDiagram-D77RDMKH-D8SSEwHa.js → stateDiagram-D77RDMKH-Bgwe0g5S.js} +1 -1
- package/dist/client/assets/stateDiagram-D77RDMKH-Bgwe0g5S.js.br +0 -0
- package/dist/client/assets/stateDiagram-D77RDMKH-Bgwe0g5S.js.gz +0 -0
- package/dist/client/assets/stateDiagram-v2-MP3YSRHH-Bg6S3Zm0.js +1 -0
- package/dist/client/assets/{swimlanes-42K2YHIH-Dow-EKMG.js → swimlanes-42K2YHIH-COGAWe-g.js} +1 -1
- package/dist/client/assets/swimlanes-42K2YHIH-COGAWe-g.js.br +0 -0
- package/dist/client/assets/swimlanes-42K2YHIH-COGAWe-g.js.gz +0 -0
- package/dist/client/assets/swimlanesDiagram-VR7AAH4N-DwBBOocG.js +8 -0
- package/dist/client/assets/{timeline-definition-24CTP7MA-DpQ9D5f6.js → timeline-definition-24CTP7MA-C4gt5z68.js} +1 -1
- package/dist/client/assets/timeline-definition-24CTP7MA-C4gt5z68.js.br +0 -0
- package/dist/client/assets/timeline-definition-24CTP7MA-C4gt5z68.js.gz +0 -0
- package/dist/client/assets/{triangle-alert-Bdf_dBch.js → triangle-alert-xPHw25jD.js} +1 -1
- package/dist/client/assets/{vennDiagram-4TSXK5OY-DoemAmM2.js → vennDiagram-4TSXK5OY-CIEXh9oD.js} +1 -1
- package/dist/client/assets/vennDiagram-4TSXK5OY-CIEXh9oD.js.br +0 -0
- package/dist/client/assets/vennDiagram-4TSXK5OY-CIEXh9oD.js.gz +0 -0
- package/dist/client/assets/{videoCompression-Bg4gUQUf.js → videoCompression-CUkCS2-q.js} +1 -1
- package/dist/client/assets/videoCompression-CUkCS2-q.js.br +0 -0
- package/dist/client/assets/videoCompression-CUkCS2-q.js.gz +0 -0
- package/dist/client/assets/{wardleyDiagram-VM6X3IG4-MernEZ54.js → wardleyDiagram-VM6X3IG4-gQhcW1vd.js} +1 -1
- package/dist/client/assets/wardleyDiagram-VM6X3IG4-gQhcW1vd.js.br +0 -0
- package/dist/client/assets/wardleyDiagram-VM6X3IG4-gQhcW1vd.js.gz +0 -0
- package/dist/client/assets/{xychartDiagram-S5SC5T6Z-CzO3HEHD.js → xychartDiagram-S5SC5T6Z-BmIcdejz.js} +1 -1
- package/dist/client/assets/xychartDiagram-S5SC5T6Z-BmIcdejz.js.br +0 -0
- package/dist/client/assets/xychartDiagram-S5SC5T6Z-BmIcdejz.js.gz +0 -0
- package/dist/client/index.html +2 -2
- package/dist/client/index.html.br +0 -0
- package/dist/client/index.html.gz +0 -0
- package/dist/client/sw.js +1 -1
- package/dist/client/sw.js.br +0 -0
- package/dist/client/sw.js.gz +0 -0
- package/dist/server/agent/agentLaunchCheck.js +22 -0
- package/dist/server/agent/collaborationCli.js +15 -4
- package/dist/server/agent/collaborationDeliveryWorker.js +3 -97
- package/dist/server/agent/collaborationTmuxDelivery.js +23 -51
- package/dist/server/agent/integrationServer.js +1 -0
- package/dist/server/agent/promptDelivery.js +20 -7
- package/dist/server/architecture/cli.js +30 -5
- package/dist/server/architecture/document.js +4 -4
- package/dist/server/architecture/documentDiff.js +5 -0
- package/dist/server/routes/terminal.js +103 -30
- package/docs/integrations.md +20 -1
- package/package.json +1 -1
- package/runtime-manifest.json +3 -3
- package/dist/client/assets/App-CytIMrFr.js.br +0 -0
- package/dist/client/assets/App-CytIMrFr.js.gz +0 -0
- package/dist/client/assets/ArchitecturePanel-BRTR2IsK.js +0 -9
- package/dist/client/assets/ArchitecturePanel-BRTR2IsK.js.br +0 -0
- package/dist/client/assets/ArchitecturePanel-BRTR2IsK.js.gz +0 -0
- package/dist/client/assets/ChangeWalkthroughPanel-Bm9Tvd6H.js.br +0 -0
- package/dist/client/assets/ChangeWalkthroughPanel-Bm9Tvd6H.js.gz +0 -0
- package/dist/client/assets/CollaborationMainWorkspace-BagYBDlJ.js.br +0 -0
- package/dist/client/assets/CollaborationMainWorkspace-BagYBDlJ.js.gz +0 -0
- package/dist/client/assets/CollaborationTaskContent-D7LXylWr.js +0 -2
- package/dist/client/assets/ComputerControlView-CC6r2cD3.js.br +0 -0
- package/dist/client/assets/ComputerControlView-CC6r2cD3.js.gz +0 -0
- package/dist/client/assets/DagPlayground-BqAadqBT.js.br +0 -0
- package/dist/client/assets/DagPlayground-BqAadqBT.js.gz +0 -0
- package/dist/client/assets/DiffLab-CrEVLy-j.js.br +0 -0
- package/dist/client/assets/DiffLab-CrEVLy-j.js.gz +0 -0
- package/dist/client/assets/DiffReview-C8e2GQxb.js.br +0 -0
- package/dist/client/assets/DiffReview-C8e2GQxb.js.gz +0 -0
- package/dist/client/assets/DiffReviewLab-RQ1NmpZE.js.br +0 -0
- package/dist/client/assets/DiffReviewLab-RQ1NmpZE.js.gz +0 -0
- package/dist/client/assets/DiffViewer-KljgMa9h.js.br +0 -0
- package/dist/client/assets/DiffViewer-KljgMa9h.js.gz +0 -0
- package/dist/client/assets/ModelPreview-B9UR1TR3.js.br +0 -0
- package/dist/client/assets/ModelPreview-B9UR1TR3.js.gz +0 -0
- package/dist/client/assets/RightSidebar-DSH93gN5.js.br +0 -0
- package/dist/client/assets/RightSidebar-DSH93gN5.js.gz +0 -0
- package/dist/client/assets/abnfDiagram-VCTEODGH-WFUf9n1A.js.br +0 -0
- package/dist/client/assets/abnfDiagram-VCTEODGH-WFUf9n1A.js.gz +0 -0
- package/dist/client/assets/app-Bey8S6UU.js.br +0 -0
- package/dist/client/assets/app-Bey8S6UU.js.gz +0 -0
- package/dist/client/assets/arc-BXKxIsA3.js.br +0 -0
- package/dist/client/assets/arc-BXKxIsA3.js.gz +0 -0
- package/dist/client/assets/architectureDiagram-5GKGNRK7-DAfRrSxr.js.br +0 -0
- package/dist/client/assets/architectureDiagram-5GKGNRK7-DAfRrSxr.js.gz +0 -0
- package/dist/client/assets/blockDiagram-I7D4REHJ-1HbSy7rb.js.br +0 -0
- package/dist/client/assets/blockDiagram-I7D4REHJ-1HbSy7rb.js.gz +0 -0
- package/dist/client/assets/c4Diagram-7LVT6UL2-Dxwui-M_.js.br +0 -0
- package/dist/client/assets/c4Diagram-7LVT6UL2-Dxwui-M_.js.gz +0 -0
- package/dist/client/assets/channel-Dkh0SMv-.js +0 -1
- package/dist/client/assets/chunk-F27PBJKO-BaM6iLMb.js.br +0 -0
- package/dist/client/assets/chunk-F27PBJKO-BaM6iLMb.js.gz +0 -0
- package/dist/client/assets/chunk-IMKFNOWR-DxPJBdLq.js.br +0 -0
- package/dist/client/assets/chunk-IMKFNOWR-DxPJBdLq.js.gz +0 -0
- package/dist/client/assets/chunk-SVP7TREG-CpnycZ3K.js.br +0 -0
- package/dist/client/assets/chunk-SVP7TREG-CpnycZ3K.js.gz +0 -0
- package/dist/client/assets/chunk-TICWLB2K-5oWwjAOF.js.br +0 -0
- package/dist/client/assets/chunk-TICWLB2K-5oWwjAOF.js.gz +0 -0
- package/dist/client/assets/classDiagram-ZZMXUADV-DqvmSdwt.js +0 -1
- package/dist/client/assets/classDiagram-v2-VYDZK3BY-DqvmSdwt.js +0 -1
- package/dist/client/assets/cose-bilkent-JH36ORCC-gpF5Tw44.js.br +0 -0
- package/dist/client/assets/cose-bilkent-JH36ORCC-gpF5Tw44.js.gz +0 -0
- package/dist/client/assets/cynefin-OW5HDTMX-HFr7zRQ0.js.br +0 -0
- package/dist/client/assets/cynefin-OW5HDTMX-HFr7zRQ0.js.gz +0 -0
- package/dist/client/assets/cynefinDiagram-5FMLGOSQ-LccKgJj0.js.br +0 -0
- package/dist/client/assets/cynefinDiagram-5FMLGOSQ-LccKgJj0.js.gz +0 -0
- package/dist/client/assets/dagre-GXQ25YYZ-C7eLk1r1.js.br +0 -0
- package/dist/client/assets/dagre-GXQ25YYZ-C7eLk1r1.js.gz +0 -0
- package/dist/client/assets/diagram-S7CK7UJ4-DkWPZYAg.js.br +0 -0
- package/dist/client/assets/diagram-S7CK7UJ4-DkWPZYAg.js.gz +0 -0
- package/dist/client/assets/diagram-UQ7AKVKN-DluTsMXz.js.br +0 -0
- package/dist/client/assets/diagram-UQ7AKVKN-DluTsMXz.js.gz +0 -0
- package/dist/client/assets/diagram-VSXAHHWV-BLXEmXmu.js.br +0 -0
- package/dist/client/assets/diagram-VSXAHHWV-BLXEmXmu.js.gz +0 -0
- package/dist/client/assets/diagram-VX7I27RA-DO3J99WU.js.br +0 -0
- package/dist/client/assets/diagram-VX7I27RA-DO3J99WU.js.gz +0 -0
- package/dist/client/assets/diagram-Z3DM3KII-kvkSusTy.js.br +0 -0
- package/dist/client/assets/diagram-Z3DM3KII-kvkSusTy.js.gz +0 -0
- package/dist/client/assets/ebnfDiagram-PWID7BFC-Bxd9hatc.js.br +0 -0
- package/dist/client/assets/ebnfDiagram-PWID7BFC-Bxd9hatc.js.gz +0 -0
- package/dist/client/assets/erDiagram-RLTQ6QDP-BWc3uM23.js.br +0 -0
- package/dist/client/assets/erDiagram-RLTQ6QDP-BWc3uM23.js.gz +0 -0
- package/dist/client/assets/flowDiagram-HODETNUW-BQhPtc9z.js.br +0 -0
- package/dist/client/assets/flowDiagram-HODETNUW-BQhPtc9z.js.gz +0 -0
- package/dist/client/assets/ganttDiagram-EL5Y4UJY-DzmTLgVr.js.br +0 -0
- package/dist/client/assets/ganttDiagram-EL5Y4UJY-DzmTLgVr.js.gz +0 -0
- package/dist/client/assets/gestureArbiter-BuNZMZ7A.js.br +0 -0
- package/dist/client/assets/gitGraphDiagram-WWUBYQGX-r0Onfl7K.js.br +0 -0
- package/dist/client/assets/gitGraphDiagram-WWUBYQGX-r0Onfl7K.js.gz +0 -0
- package/dist/client/assets/index-C6D5a-dg.css +0 -1
- package/dist/client/assets/index-C6D5a-dg.css.br +0 -0
- package/dist/client/assets/ishikawaDiagram-5VMMS53U-C-l0eHmO.js.br +0 -0
- package/dist/client/assets/ishikawaDiagram-5VMMS53U-C-l0eHmO.js.gz +0 -0
- package/dist/client/assets/journeyDiagram-3NMN7TZE-DmhgEOjX.js.br +0 -0
- package/dist/client/assets/journeyDiagram-3NMN7TZE-DmhgEOjX.js.gz +0 -0
- package/dist/client/assets/kanban-definition-UXKFOSKX-BnZWlxIT.js.br +0 -0
- package/dist/client/assets/kanban-definition-UXKFOSKX-BnZWlxIT.js.gz +0 -0
- package/dist/client/assets/layout-BrxPpC7u.js.br +0 -0
- package/dist/client/assets/layout-BrxPpC7u.js.gz +0 -0
- package/dist/client/assets/linear-DaEpqVcH.js.br +0 -0
- package/dist/client/assets/linear-DaEpqVcH.js.gz +0 -0
- package/dist/client/assets/mermaid.core-CidoOS12.js.br +0 -0
- package/dist/client/assets/mermaid.core-CidoOS12.js.gz +0 -0
- package/dist/client/assets/mindmap-definition-YA3MSWOX-Bpr3CVLy.js.br +0 -0
- package/dist/client/assets/mindmap-definition-YA3MSWOX-Bpr3CVLy.js.gz +0 -0
- package/dist/client/assets/passwordBootstrap-D7hFrc0r.js.br +0 -0
- package/dist/client/assets/passwordBootstrap-D7hFrc0r.js.gz +0 -0
- package/dist/client/assets/pegDiagram-XKGWAZYB-Bw2JpSYn.js.br +0 -0
- package/dist/client/assets/pegDiagram-XKGWAZYB-Bw2JpSYn.js.gz +0 -0
- package/dist/client/assets/pieDiagram-E7YTZNPT-BaKc3ifQ.js.br +0 -0
- package/dist/client/assets/pieDiagram-E7YTZNPT-BaKc3ifQ.js.gz +0 -0
- package/dist/client/assets/quadrantDiagram-AXDQQJYC-B0Yi-dl9.js.br +0 -0
- package/dist/client/assets/quadrantDiagram-AXDQQJYC-B0Yi-dl9.js.gz +0 -0
- package/dist/client/assets/railroadDiagram-O6MQD6OU-DCcCQofU.js.br +0 -0
- package/dist/client/assets/railroadDiagram-O6MQD6OU-DCcCQofU.js.gz +0 -0
- package/dist/client/assets/rdpSession-DY81W5BY.js.br +0 -0
- package/dist/client/assets/rdpSession-DY81W5BY.js.gz +0 -0
- package/dist/client/assets/referenceLongPress-CAzWqXsY.js.br +0 -0
- package/dist/client/assets/referenceLongPress-CAzWqXsY.js.gz +0 -0
- package/dist/client/assets/requirementDiagram-BXWQKSXE-CEJFRPWH.js.br +0 -0
- package/dist/client/assets/requirementDiagram-BXWQKSXE-CEJFRPWH.js.gz +0 -0
- package/dist/client/assets/sankeyDiagram-P5KCCOFB-B3Wk45FA.js.br +0 -0
- package/dist/client/assets/sankeyDiagram-P5KCCOFB-B3Wk45FA.js.gz +0 -0
- package/dist/client/assets/sequenceDiagram-WJ2MYXX4-BejEsITb.js.br +0 -0
- package/dist/client/assets/sequenceDiagram-WJ2MYXX4-BejEsITb.js.gz +0 -0
- package/dist/client/assets/sizeCapture-INFHLROL-DZ5NJZnM.js.br +0 -0
- package/dist/client/assets/sizeCapture-INFHLROL-DZ5NJZnM.js.gz +0 -0
- package/dist/client/assets/stateDiagram-D77RDMKH-D8SSEwHa.js.br +0 -0
- package/dist/client/assets/stateDiagram-D77RDMKH-D8SSEwHa.js.gz +0 -0
- package/dist/client/assets/stateDiagram-v2-MP3YSRHH-D1KQOetv.js +0 -1
- package/dist/client/assets/swimlanes-42K2YHIH-Dow-EKMG.js.br +0 -0
- package/dist/client/assets/swimlanes-42K2YHIH-Dow-EKMG.js.gz +0 -0
- package/dist/client/assets/swimlanesDiagram-VR7AAH4N-DQbZCzq9.js +0 -8
- package/dist/client/assets/timeline-definition-24CTP7MA-DpQ9D5f6.js.br +0 -0
- package/dist/client/assets/timeline-definition-24CTP7MA-DpQ9D5f6.js.gz +0 -0
- package/dist/client/assets/vennDiagram-4TSXK5OY-DoemAmM2.js.br +0 -0
- package/dist/client/assets/vennDiagram-4TSXK5OY-DoemAmM2.js.gz +0 -0
- package/dist/client/assets/videoCompression-Bg4gUQUf.js.br +0 -0
- package/dist/client/assets/videoCompression-Bg4gUQUf.js.gz +0 -0
- package/dist/client/assets/wardleyDiagram-VM6X3IG4-MernEZ54.js.br +0 -0
- package/dist/client/assets/wardleyDiagram-VM6X3IG4-MernEZ54.js.gz +0 -0
- package/dist/client/assets/xychartDiagram-S5SC5T6Z-CzO3HEHD.js.br +0 -0
- package/dist/client/assets/xychartDiagram-S5SC5T6Z-CzO3HEHD.js.gz +0 -0
|
@@ -49,7 +49,8 @@ import { completedExecution, ExecutionArchiveStore } from '../agent/executionArc
|
|
|
49
49
|
import { archiveTaskWorkspace, restoreTaskWorkspace, snapshotTaskWorkspace } from '../agent/collaborationTaskWorkspace.js';
|
|
50
50
|
import { isTmuxRecoveryCandidate } from '../utils/tmuxRecoveryCandidate.js';
|
|
51
51
|
import { AutomationStore, normalizeAutomationSchedule } from '../agent/automationStore.js';
|
|
52
|
-
import {
|
|
52
|
+
import { writeBracketedPrompt, canDeliverPromptToAgent } from '../agent/promptDelivery.js';
|
|
53
|
+
import { agentLaunchBlockReason, normalizeAgentLaunchCheck } from '../agent/agentLaunchCheck.js';
|
|
53
54
|
import { prepareSupervisionEnable } from '../utils/enableSupervision.js';
|
|
54
55
|
import { buildServerHealthState, dismissServerHealth } from '../utils/serverHealth.js';
|
|
55
56
|
import { collaborationRoutes } from '../agent/collaborationRoutes.js';
|
|
@@ -65,7 +66,7 @@ import { CollaborationError } from '../agent/collaborationProtocol.js';
|
|
|
65
66
|
import { resolveCollaborationBackend, resolveCollaborationSessionId } from '../agent/sessionBindingRecovery.js';
|
|
66
67
|
import { CollaborationRoutingStore, selectCollaborationPane, selectDrivePane } from '../agent/collaborationRouting.js';
|
|
67
68
|
import { CollaborationDeliveryWorker } from '../agent/collaborationDeliveryWorker.js';
|
|
68
|
-
import { approveCollaborationDialog, captureTmuxPaneHistory, captureTmuxPaneText,
|
|
69
|
+
import { approveCollaborationDialog, captureTmuxPaneHistory, captureTmuxPaneText, sendTmuxPaneKey, writeCollaborationTmuxPane } from '../agent/collaborationTmuxDelivery.js';
|
|
69
70
|
import { listAllHookAgents, refreshStaleHooksAtLaunch, installHooksForSlug, uninstallHooksForSlug, } from '../agent/installers.js';
|
|
70
71
|
import { loadPlugins, savePlugin, removePlugin, readPluginIcon, validateManifest, } from '../agent/plugins.js';
|
|
71
72
|
import { TmuxLifecycleCoordinator } from '../utils/tmuxLifecycle.js';
|
|
@@ -965,6 +966,7 @@ function normalizePersistedClientSession(input) {
|
|
|
965
966
|
? candidate.shellTitle
|
|
966
967
|
: null,
|
|
967
968
|
agentResume: normalizePersistedAgentResumeInfo(candidate.agentResume),
|
|
969
|
+
agentLaunchCheck: normalizeAgentLaunchCheck(candidate.agentLaunchCheck),
|
|
968
970
|
};
|
|
969
971
|
}
|
|
970
972
|
function generateTmuxSessionName() {
|
|
@@ -1450,15 +1452,53 @@ function searchMetadataForBackend(backendSessionId, session) {
|
|
|
1450
1452
|
function writeTerminalInput(session, value) {
|
|
1451
1453
|
session.ptyProcess.write(value.replace(/\r?\n/g, '\r'));
|
|
1452
1454
|
}
|
|
1453
|
-
function
|
|
1455
|
+
async function beginAgentLaunchCheck(frontendSessionId, agentSlug, nativeSessionId = null) {
|
|
1456
|
+
const record = globalSessionState.sessions.find(candidate => candidate.sessionId === frontendSessionId);
|
|
1457
|
+
if (!record)
|
|
1458
|
+
throw new Error('SESSION_REMOVED');
|
|
1459
|
+
upsertGlobalSessionRecord({ ...record, agentLaunchCheck: { id: randomUUID(), agentSlug, nativeSessionId, deadline: Date.now() + 120_000 } });
|
|
1460
|
+
await persistGlobalStateNow();
|
|
1461
|
+
}
|
|
1462
|
+
async function observeAgentLaunchCheck(record, observed) {
|
|
1463
|
+
const check = record.agentLaunchCheck;
|
|
1464
|
+
if (!check)
|
|
1465
|
+
return null;
|
|
1466
|
+
const reason = agentLaunchBlockReason(check, observed);
|
|
1467
|
+
if (reason)
|
|
1468
|
+
return { state: 'recovering', reason };
|
|
1469
|
+
const latest = globalSessionState.sessions.find(candidate => candidate.sessionId === record.sessionId);
|
|
1470
|
+
if (!latest)
|
|
1471
|
+
return { state: 'offline', reason: 'SESSION_REMOVED' };
|
|
1472
|
+
if (latest.agentLaunchCheck?.id !== check.id)
|
|
1473
|
+
return { state: 'recovering', reason: 'AGENT_LAUNCH_CHANGED' };
|
|
1474
|
+
upsertGlobalSessionRecord({ ...latest, agentLaunchCheck: null });
|
|
1475
|
+
await persistGlobalStateNow();
|
|
1476
|
+
return null;
|
|
1477
|
+
}
|
|
1478
|
+
async function deliverAutomationPromptWhenReady(backendSessionId, prompt, attempt = 0) {
|
|
1454
1479
|
const session = terminalSessions.get(backendSessionId);
|
|
1455
1480
|
if (!session)
|
|
1456
1481
|
return;
|
|
1482
|
+
const record = globalSessionState.sessions.find(candidate => candidate.backendSessionId === backendSessionId);
|
|
1483
|
+
if (record?.agentLaunchCheck) {
|
|
1484
|
+
await refreshCollaborationAgentIdentity(backendSessionId, session, true);
|
|
1485
|
+
const agent = detectAgentFromCommand(session.activeProgram?.rawArgs ?? session.activeProgram?.command ?? '', agentCustomCommands());
|
|
1486
|
+
const nativeSessionId = agent && session.activeProgram?.rawArgs ? inferResumeSessionId(agent, splitCommandToArgv(session.activeProgram.rawArgs)) : null;
|
|
1487
|
+
const blocked = await observeAgentLaunchCheck(record, { agentSlug: agent?.slug ?? null, nativeSessionId });
|
|
1488
|
+
if (blocked) {
|
|
1489
|
+
if (blocked.reason !== 'AGENT_LAUNCH_PENDING')
|
|
1490
|
+
throw new Error(blocked.reason ?? 'AGENT_LAUNCH_PENDING');
|
|
1491
|
+
await new Promise(resolve => setTimeout(resolve, 250));
|
|
1492
|
+
return deliverAutomationPromptWhenReady(backendSessionId, prompt, attempt + 1);
|
|
1493
|
+
}
|
|
1494
|
+
await writeBracketedPrompt(session.ptyProcess, prompt);
|
|
1495
|
+
return;
|
|
1496
|
+
}
|
|
1457
1497
|
if (canDeliverPromptToAgent(session) || attempt >= 60) {
|
|
1458
|
-
session.ptyProcess.
|
|
1498
|
+
void writeBracketedPrompt(session.ptyProcess, prompt).catch((error) => console.error('[automation] terminal write failed:', getErrorMessage(error)));
|
|
1459
1499
|
return;
|
|
1460
1500
|
}
|
|
1461
|
-
setTimeout(() => deliverAutomationPromptWhenReady(backendSessionId, prompt, attempt + 1), 250);
|
|
1501
|
+
setTimeout(() => { void deliverAutomationPromptWhenReady(backendSessionId, prompt, attempt + 1).catch(error => console.error('[automation] terminal write failed:', getErrorMessage(error))); }, 250);
|
|
1462
1502
|
}
|
|
1463
1503
|
async function runAgentAutomation(automation, req) {
|
|
1464
1504
|
const run = automationStore.beginRun(automation);
|
|
@@ -1469,13 +1509,16 @@ async function runAgentAutomation(automation, req) {
|
|
|
1469
1509
|
const backend = record?.backendSessionId ? terminalSessions.get(record.backendSessionId) : null;
|
|
1470
1510
|
if (!record || !backend)
|
|
1471
1511
|
throw new Error('目标会话当前不在线');
|
|
1472
|
-
if (!canDeliverPromptToAgent(backend))
|
|
1512
|
+
if (!record.agentLaunchCheck && !canDeliverPromptToAgent(backend))
|
|
1473
1513
|
throw new Error('目标会话当前没有运行中的 Agent');
|
|
1474
1514
|
frontendSessionId = record.sessionId;
|
|
1475
1515
|
const message = automation.prompt || automation.command;
|
|
1476
1516
|
if (!message)
|
|
1477
1517
|
throw new Error('自动任务没有可发送的内容');
|
|
1478
|
-
|
|
1518
|
+
if (record.agentLaunchCheck)
|
|
1519
|
+
await deliverAutomationPromptWhenReady(record.backendSessionId, message);
|
|
1520
|
+
else
|
|
1521
|
+
await writeBracketedPrompt(backend.ptyProcess, message);
|
|
1479
1522
|
}
|
|
1480
1523
|
else {
|
|
1481
1524
|
const request = req ?? {};
|
|
@@ -1489,13 +1532,17 @@ async function runAgentAutomation(automation, req) {
|
|
|
1489
1532
|
const backend = terminalSessions.get(opened.terminalSession.sessionId);
|
|
1490
1533
|
if (!backend)
|
|
1491
1534
|
throw new Error('自动任务会话创建失败');
|
|
1492
|
-
if (automation.command)
|
|
1535
|
+
if (automation.command) {
|
|
1536
|
+
const agent = detectAgentFromCommand(automation.command, agentCustomCommands());
|
|
1537
|
+
if (agent)
|
|
1538
|
+
await beginAgentLaunchCheck(frontendSessionId, agent.slug);
|
|
1493
1539
|
writeTerminalInput(backend, `${automation.command}\r`);
|
|
1540
|
+
}
|
|
1494
1541
|
if (automation.prompt) {
|
|
1495
1542
|
if (automation.command)
|
|
1496
|
-
deliverAutomationPromptWhenReady(opened.terminalSession.sessionId, automation.prompt);
|
|
1543
|
+
await deliverAutomationPromptWhenReady(opened.terminalSession.sessionId, automation.prompt);
|
|
1497
1544
|
else
|
|
1498
|
-
backend.ptyProcess
|
|
1545
|
+
await writeBracketedPrompt(backend.ptyProcess, automation.prompt);
|
|
1499
1546
|
}
|
|
1500
1547
|
}
|
|
1501
1548
|
automationStore.finishRun(run.id, 'success', frontendSessionId, '任务已投递');
|
|
@@ -1580,7 +1627,7 @@ function formatLocalCollaborationMessages(frontendSessionId, messages) {
|
|
|
1580
1627
|
* agent-keyed selector can never reach it. Delivery still needs an agent (the
|
|
1581
1628
|
* confirm gate and prompt formatting assume a TUI); driving a terminal —
|
|
1582
1629
|
* run/capture — is a shell operation and works on any pane. */
|
|
1583
|
-
async function inspectCollaborationTmux(binding, requestedPane, allowPlainPane = false, nativeProcessIdentity = false) {
|
|
1630
|
+
async function inspectCollaborationTmux(binding, requestedPane, allowPlainPane = false, nativeProcessIdentity = false, freshProcess = false) {
|
|
1584
1631
|
if (!binding.tmuxSessionName)
|
|
1585
1632
|
return { state: 'offline', reason: 'TMUX_BINDING_MISSING' };
|
|
1586
1633
|
const name = `=${binding.tmuxSessionName}`;
|
|
@@ -1599,12 +1646,12 @@ async function inspectCollaborationTmux(binding, requestedPane, allowPlainPane =
|
|
|
1599
1646
|
const serverPid = Number((await runTmux(['display-message', '-p', '#{pid}'])).trim());
|
|
1600
1647
|
if (!Number.isInteger(serverPid) || serverPid <= 0)
|
|
1601
1648
|
throw new Error('TMUX_SERVER_IDENTITY_UNAVAILABLE');
|
|
1602
|
-
if (nativeProcessIdentity && process.platform === 'linux')
|
|
1649
|
+
if ((nativeProcessIdentity || freshProcess) && process.platform === 'linux')
|
|
1603
1650
|
await getProcessSnapshot(true);
|
|
1604
1651
|
const panes = await Promise.all(layout.windows.flatMap((window) => window.panes).map(async (pane) => {
|
|
1605
1652
|
// Native identity needs the foreground argv even for a named binary;
|
|
1606
1653
|
// pane_current_command alone cannot prove an exact resumed conversation.
|
|
1607
|
-
const program = await resolveTmuxPaneProgram(pane, true);
|
|
1654
|
+
const program = await resolveTmuxPaneProgram(pane, true, nativeProcessIdentity || freshProcess);
|
|
1608
1655
|
const agent = detectAgentFromCommand(program?.rawArgs ?? program?.command ?? '', agentCustomCommands());
|
|
1609
1656
|
const identity = nativeProcessIdentity ? await observeProgramNativeIdentity(agent, program)
|
|
1610
1657
|
: { nativeId: agent && program?.rawArgs ? inferResumeSessionId(agent, splitCommandToArgv(program.rawArgs)) : null, failure: null };
|
|
@@ -1664,8 +1711,8 @@ async function rebindCollaborationRoute(frontendSessionId, paneId) {
|
|
|
1664
1711
|
return { ...collaborationRouting.get(frontendSessionId), state: 'recovering' };
|
|
1665
1712
|
}
|
|
1666
1713
|
/**
|
|
1667
|
-
*
|
|
1668
|
-
*
|
|
1714
|
+
* A TD-initiated Agent launch waits once for current process/binding evidence.
|
|
1715
|
+
* Existing terminals receive messages whatever their agent is doing. Busy guessing (hook state,
|
|
1669
1716
|
* turn phase) is the sender's job — the send receipt carries a screen
|
|
1670
1717
|
* snapshot of the recipient after the write, and the sender judges from that.
|
|
1671
1718
|
*/
|
|
@@ -1684,13 +1731,16 @@ async function resolveCollaborationRoute(frontendSessionId) {
|
|
|
1684
1731
|
agentSlug: record.agentResume?.slug ?? null, nativeSessionId: record.agentResume?.sessionId ?? null, pane: null,
|
|
1685
1732
|
};
|
|
1686
1733
|
if (binding.mode === 'tmux') {
|
|
1687
|
-
const inspected = await inspectCollaborationTmux(binding);
|
|
1734
|
+
const inspected = await inspectCollaborationTmux(binding, undefined, false, Boolean(record.agentLaunchCheck?.nativeSessionId), Boolean(record.agentLaunchCheck));
|
|
1688
1735
|
if (inspected.state !== 'ready' || !inspected.pane)
|
|
1689
1736
|
return inspected;
|
|
1690
1737
|
record = globalSessionState.sessions.find((candidate) => candidate.sessionId === frontendSessionId);
|
|
1691
1738
|
if (!record)
|
|
1692
1739
|
return { state: 'offline', reason: 'SESSION_REMOVED_DURING_RECOVERY' };
|
|
1693
1740
|
const pane = inspected.pane;
|
|
1741
|
+
const launch = await observeAgentLaunchCheck(record, { agentSlug: pane.agentSlug || null, nativeSessionId: pane.nativeSessionId });
|
|
1742
|
+
if (launch)
|
|
1743
|
+
return launch;
|
|
1694
1744
|
// Remember the target before attachment. A failed attachment must not let
|
|
1695
1745
|
// a subsequent active-pane change silently choose another recipient.
|
|
1696
1746
|
const pinned = { serverPid: pane.serverPid, sessionId: pane.sessionId, paneId: pane.paneId, panePid: pane.panePid,
|
|
@@ -1722,16 +1772,19 @@ async function resolveCollaborationRoute(frontendSessionId) {
|
|
|
1722
1772
|
throw new Error('SESSION_REMOVED');
|
|
1723
1773
|
await writeCollaborationTmuxPane(runTmux, pinned, formatLocalCollaborationMessages(frontendSessionId, messages), runTmuxStdin);
|
|
1724
1774
|
backend.lastActivity = Date.now();
|
|
1725
|
-
|
|
1726
|
-
// message (boot sequences clear only the screen, never the history a
|
|
1727
|
-
// live TUI writes into). Terminal-state only — no agent hooks.
|
|
1728
|
-
}, confirm: async () => captureTmuxPaneHistory(runTmux, pinned), approve: async () => approveCollaborationDialog(runTmux, pinned),
|
|
1729
|
-
recoverStuck: async (baseline) => recoverStuckPaste(runTmux, pinned, baseline) };
|
|
1775
|
+
} };
|
|
1730
1776
|
}
|
|
1731
1777
|
if (!backend || !binding.backendSessionId)
|
|
1732
1778
|
return { state: 'offline', reason: 'SHELL_BACKEND_NOT_RUNNING' };
|
|
1733
|
-
await refreshCollaborationAgentIdentity(binding.backendSessionId, backend);
|
|
1779
|
+
await refreshCollaborationAgentIdentity(binding.backendSessionId, backend, Boolean(record.agentLaunchCheck));
|
|
1734
1780
|
const target = backend;
|
|
1781
|
+
if (record.agentLaunchCheck) {
|
|
1782
|
+
const agent = detectAgentFromCommand(target.activeProgram?.rawArgs ?? target.activeProgram?.command ?? '', agentCustomCommands());
|
|
1783
|
+
const nativeSessionId = agent && target.activeProgram?.rawArgs ? inferResumeSessionId(agent, splitCommandToArgv(target.activeProgram.rawArgs)) : null;
|
|
1784
|
+
const launch = await observeAgentLaunchCheck(record, { agentSlug: agent?.slug ?? null, nativeSessionId });
|
|
1785
|
+
if (launch)
|
|
1786
|
+
return launch;
|
|
1787
|
+
}
|
|
1735
1788
|
return { state: 'ready',
|
|
1736
1789
|
isShell: backend.activeProgram?.source !== 'unknown' && shellNamesBackend.has(backend.activeProgram?.command?.toLowerCase() ?? ''),
|
|
1737
1790
|
capture: async () => target.autoTitleContext,
|
|
@@ -1740,19 +1793,21 @@ async function resolveCollaborationRoute(frontendSessionId) {
|
|
|
1740
1793
|
throw new Error('SESSION_REMOVED');
|
|
1741
1794
|
if (terminalSessions.get(binding.backendSessionId) !== target)
|
|
1742
1795
|
throw new Error('SHELL_BACKEND_CHANGED');
|
|
1743
|
-
target.ptyProcess
|
|
1796
|
+
await writeBracketedPrompt(target.ptyProcess, formatLocalCollaborationMessages(frontendSessionId, messages));
|
|
1744
1797
|
target.lastActivity = Date.now();
|
|
1745
1798
|
} };
|
|
1746
1799
|
}
|
|
1747
|
-
async function refreshCollaborationAgentIdentity(backendSessionId, session) {
|
|
1800
|
+
async function refreshCollaborationAgentIdentity(backendSessionId, session, freshProcess = false) {
|
|
1748
1801
|
let activeProgram = null;
|
|
1749
1802
|
if (session.mode === 'shell') {
|
|
1750
|
-
activeProgram = await getCachedShellActiveProgram(backendSessionId, session);
|
|
1803
|
+
activeProgram = freshProcess ? await detectShellActiveProgram(session, true) : await getCachedShellActiveProgram(backendSessionId, session);
|
|
1751
1804
|
}
|
|
1752
1805
|
else if (session.tmuxSessionName) {
|
|
1753
|
-
const layout = await getCachedTmuxLayout(session.tmuxSessionName);
|
|
1806
|
+
const layout = freshProcess ? await getTmuxLayout(session.tmuxSessionName) : await getCachedTmuxLayout(session.tmuxSessionName);
|
|
1807
|
+
if (freshProcess && process.platform === 'linux')
|
|
1808
|
+
await getProcessSnapshot(true);
|
|
1754
1809
|
const activePane = getActivePaneFromLayout(layout);
|
|
1755
|
-
const resolved = activePane ? await resolveTmuxPaneProgram(activePane) : null;
|
|
1810
|
+
const resolved = activePane ? await resolveTmuxPaneProgram(activePane, freshProcess, freshProcess) : null;
|
|
1756
1811
|
activeProgram = resolved
|
|
1757
1812
|
? { ...resolved, updatedAt: Date.now() }
|
|
1758
1813
|
: getActiveProgramFromTmuxLayout(layout);
|
|
@@ -1796,6 +1851,7 @@ async function spawnCollaborationAgentSession(req, group, sourceSessionId, input
|
|
|
1796
1851
|
const backend = terminalSessions.get(opened.terminalSession.sessionId);
|
|
1797
1852
|
if (!backend)
|
|
1798
1853
|
throw new HttpStatusError(500, 'Agent Session 创建失败', 'COLLAB_AGENT_SESSION_FAILED');
|
|
1854
|
+
await beginAgentLaunchCheck(frontendSessionId, launcher.slug);
|
|
1799
1855
|
const latestGroup = collaborationStore.getGroup(group.id);
|
|
1800
1856
|
if (!latestGroup || latestGroup.deleted) {
|
|
1801
1857
|
const created = globalSessionState.sessions.find(record => record.sessionId === frontendSessionId);
|
|
@@ -2100,6 +2156,7 @@ async function launchIntegrationTerminal(record, restoring, prepared) {
|
|
|
2100
2156
|
backend.agentSession = null;
|
|
2101
2157
|
backend.agent = null;
|
|
2102
2158
|
backend.agentResumeRecovered = false;
|
|
2159
|
+
await beginAgentLaunchCheck(record.session_id, record.agent_slug, restoring ? record.agent_native_session_id : null);
|
|
2103
2160
|
await runTmux(['send-keys', '-t', pinned.paneId, '-l', integrationLaunchCommand(record, restoring)]);
|
|
2104
2161
|
await runTmux(['send-keys', '-t', pinned.paneId, 'Enter']);
|
|
2105
2162
|
broadcastClientState();
|
|
@@ -2148,6 +2205,7 @@ export function prepareCollaborationTaskWorker(task, template, dependencies, ser
|
|
|
2148
2205
|
throw error;
|
|
2149
2206
|
}
|
|
2150
2207
|
if (!currentAgent && (!launch || launch.backendId !== opened.terminalSession.sessionId)) {
|
|
2208
|
+
await beginAgentLaunchCheck(record.sessionId, launcher.slug);
|
|
2151
2209
|
// Persist before typing: a retry must never type the launcher into a newly booted Agent's prompt.
|
|
2152
2210
|
const temporary = `${launchFile}.${process.pid}.tmp`;
|
|
2153
2211
|
await fs.promises.writeFile(temporary, JSON.stringify({ sessionId: record.sessionId, backendId: opened.terminalSession.sessionId }), { mode: 0o600 });
|
|
@@ -4251,7 +4309,7 @@ async function sampleTerminalSession(sessionId, session) {
|
|
|
4251
4309
|
events.push({ type: 'tmux-layout', layout });
|
|
4252
4310
|
return events;
|
|
4253
4311
|
}
|
|
4254
|
-
async function detectShellActiveProgram(session) {
|
|
4312
|
+
async function detectShellActiveProgram(session, includeArguments = false) {
|
|
4255
4313
|
const pid = getPtyProcessPid(session.ptyProcess);
|
|
4256
4314
|
if (pid === null) {
|
|
4257
4315
|
return null;
|
|
@@ -4290,10 +4348,15 @@ async function detectShellActiveProgram(session) {
|
|
|
4290
4348
|
const foregroundRows = rows.filter((row) => row.command && row.tpgid > 0 && row.pgid === row.tpgid && !row.stat.startsWith('Z'));
|
|
4291
4349
|
const preferredForeground = foregroundRows.find((row) => row.pid !== pid) ?? foregroundRows[foregroundRows.length - 1];
|
|
4292
4350
|
if (preferredForeground?.command) {
|
|
4351
|
+
// Startup checks need current argv, including an exact resume UUID;
|
|
4352
|
+
// ordinary terminal sampling retains its existing inexpensive path.
|
|
4353
|
+
const rawArgs = includeArguments
|
|
4354
|
+
? (await execFileAsync('ps', ['-p', String(preferredForeground.pid), '-o', 'args='], { timeout: 3000, maxBuffer: 512 * 1024 })).stdout.trim() || null
|
|
4355
|
+
: null;
|
|
4293
4356
|
return {
|
|
4294
4357
|
command: preferredForeground.command,
|
|
4295
4358
|
source: 'shell-tty',
|
|
4296
|
-
rawArgs
|
|
4359
|
+
rawArgs,
|
|
4297
4360
|
updatedAt: Date.now(),
|
|
4298
4361
|
};
|
|
4299
4362
|
}
|
|
@@ -6756,6 +6819,7 @@ router.post('/operations/execution-archives/:sessionId/restore', executionArchiv
|
|
|
6756
6819
|
broadcastClientState();
|
|
6757
6820
|
throw error;
|
|
6758
6821
|
}
|
|
6822
|
+
await beginAgentLaunchCheck(record.sessionId, target.slug, target.nativeSessionId);
|
|
6759
6823
|
writeTerminalInput(backend, `${command}\r`);
|
|
6760
6824
|
restoreArchivedMembership(entry, record.sessionId);
|
|
6761
6825
|
await persistGlobalStateNow();
|
|
@@ -7994,7 +8058,16 @@ router.post('/:sessionId/agent-resume', async (req, res) => {
|
|
|
7994
8058
|
});
|
|
7995
8059
|
}
|
|
7996
8060
|
try {
|
|
7997
|
-
|
|
8061
|
+
const frontend = globalSessionState.sessions.find(candidate => candidate.backendSessionId === sessionId);
|
|
8062
|
+
const launch = async () => {
|
|
8063
|
+
if (frontend)
|
|
8064
|
+
await beginAgentLaunchCheck(frontend.sessionId, target.slug, target.nativeSessionId);
|
|
8065
|
+
await writeBracketedPrompt(session.ptyProcess, target.command);
|
|
8066
|
+
};
|
|
8067
|
+
if (frontend)
|
|
8068
|
+
await collaborationDeliveryWorker.reconfigure(frontend.sessionId, launch);
|
|
8069
|
+
else
|
|
8070
|
+
await launch();
|
|
7998
8071
|
session.lastActivity = Date.now();
|
|
7999
8072
|
res.json({ success: true, command: target.command });
|
|
8000
8073
|
}
|
package/docs/integrations.md
CHANGED
|
@@ -499,7 +499,26 @@ session 事件;get 也会现场核验。120 秒内未形成绑定返回 `SESSI
|
|
|
499
499
|
|
|
500
500
|
`observed` 只表示本次启动的画面条件已观测;后续咨询保留通常的追加投递方式,
|
|
501
501
|
不以 Agent 忙闲门控。真正执行 restore 时重新等待启动条件。写入后的 `delivered`
|
|
502
|
-
|
|
502
|
+
仍只表示终端写入。1.4.311 起,普通消息统一粘贴一次,间隔 50ms 后发送一次
|
|
503
|
+
不带括号粘贴包装的 CR(回车),适用于 tmux 与直接 PTY;不识别 Agent 粘贴提示、
|
|
504
|
+
不自动补回车、不根据终端文字确认消费。`delivered`/`pty_written` 是现有回执字段,
|
|
505
|
+
仅记录终端写入调用完成,不保证对方收到、提交、消费或执行。快照只作观测,明确回复单独关联。
|
|
506
|
+
旧回执中的 `AGENT_CONSUME_UNCONFIRMED` 保留历史,不触发补键或重投。
|
|
507
|
+
|
|
508
|
+
1.4.312 起,TD 实际启动/恢复 Agent 时持久记录一次进程检查意图。仅该次启动的
|
|
509
|
+
首次投递在原终端观察到目标 Agent 后放行;恢复还须匹配原 native UUID,冷启动
|
|
510
|
+
不要求首次输入前尚未生成的 UUID。已有会话和普通 Terminal 不新增检查;运行中
|
|
511
|
+
no-op restore 不重新开启检查。检查是运行/绑定事实,不表示 TUI 已完成输入初始化。
|
|
512
|
+
`startup_input_disabled` 仅清除画面条件,独立于该进程检查。capabilities 为
|
|
513
|
+
`agent_launch_process_check=true`,最低运行服务 1.4.312;建议 CLI 同升以取得新诊断文案。
|
|
514
|
+
|
|
515
|
+
未确认时普通消息保持 pending、实际写入次数不增加,诊断 `AGENT_LAUNCH_PENDING`;
|
|
516
|
+
120 秒后 `AGENT_LAUNCH_TIMEOUT`,不同 Agent/原 UUID 为 `AGENT_LAUNCH_IDENTITY_MISMATCH`。
|
|
517
|
+
不因超时盲投或重新启动,后续如果现场确实观察到正确进程可解除检查。检查随活动
|
|
518
|
+
终端登记持久化,服务重启保留;新的实际启动/恢复重新生成检查 ID,旧观察不能清除
|
|
519
|
+
新检查。一旦当前检查解除,后续普通消息沿原终端路由,不重复判断应用就绪/忙闲。
|
|
520
|
+
已正常 release 的承载登记被移除,下一次 restore 在新承载上重新记录检查。
|
|
521
|
+
|
|
503
522
|
任务完成继续以负责人明确 `report complete` 为准。
|
|
504
523
|
|
|
505
524
|
恢复保留原 TD ID、原生 ID、argv/model/cwd/包装器配置。原会话已经精确运行时直接
|
package/package.json
CHANGED
package/runtime-manifest.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"packageName": "termdock",
|
|
4
|
-
"version": "1.4.
|
|
4
|
+
"version": "1.4.312",
|
|
5
5
|
"runtimeProtocolVersion": 1,
|
|
6
6
|
"minimumDesktopVersion": "1.4.46",
|
|
7
7
|
"nodeMajor": 22,
|
|
8
8
|
"dependencyHash": "sha256-oaGYi/P5ob8sd6VnNBOwshKozjhdV+hYiCmLAsn5x00=",
|
|
9
|
-
"serverBundleHash": "sha256-
|
|
10
|
-
"clientBundleHash": "sha256-
|
|
9
|
+
"serverBundleHash": "sha256-3z8IRTcO44/bc2KIMkaUKGeZbMd7loehrVjqv4I0pGI=",
|
|
10
|
+
"clientBundleHash": "sha256-rSq/8EDPH8i6WLa9SUHpZCeR4b5vZUPiTUusapoxjBs=",
|
|
11
11
|
"entrypoint": "dist/server/cli.js",
|
|
12
12
|
"clientEntrypoint": "dist/client/index.html"
|
|
13
13
|
}
|
|
Binary file
|
|
Binary file
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/RightSidebar-DSH93gN5.js","assets/app-Bey8S6UU.js","assets/react-XDCjal2T.js","assets/dnd-BCFAPC0L.js","assets/terminal-C7X98Amf.js","assets/index-C6D5a-dg.css","assets/App-CytIMrFr.js","assets/gestureArbiter-BuNZMZ7A.js","assets/gestureArbiter-C2J0D0kV.css","assets/triangle-alert-Bdf_dBch.js","assets/referenceLongPress-CAzWqXsY.js","assets/DiffReview-C8e2GQxb.js","assets/sparkles-DQGLdN2b.js","assets/DiffViewer-KljgMa9h.js","assets/DiffViewer-T3uj2-aP.css","assets/ChangeWalkthroughPanel-Bm9Tvd6H.js","assets/RightSidebar-DW-JEgm2.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{af as gt,aL as At,d9 as he,bx as e,_ as Mt,cs as Ge,ct as Dt,da as We,n as yt,X as Se,df as et,C as Ft,g as Lt,e as Te,c as Tt,a as Pt,d as jt,dj as It}from"./app-Bey8S6UU.js";import{b as s,r as vt}from"./dnd-BCFAPC0L.js";import{ab as Je,ag as Pe,a as wt,a2 as Ot,H as Ht,n as tt,a3 as Bt,_ as Ue,b as fe,e as Nt,$ as _t,a1 as nt,t as Ut,ac as qt,i as Wt,r as Jt,R as kt,o as Vt,ad as Kt,a4 as Xt,p as Zt,D as Ae,N as mt,a0 as Yt}from"./App-CytIMrFr.js";import{U as Qt,l as Gt,i as er,S as tr}from"./RightSidebar-DSH93gN5.js";import{L as rr}from"./DiffViewer-KljgMa9h.js";import sr from"./purify.es-4eNOHKSq.js";import{L as nr}from"./triangle-alert-Bdf_dBch.js";import{S as St}from"./sparkles-DQGLdN2b.js";import"./react-XDCjal2T.js";import"./terminal-C7X98Amf.js";import"./gestureArbiter-BuNZMZ7A.js";import"./referenceLongPress-CAzWqXsY.js";import"./DiffReview-C8e2GQxb.js";import"./ChangeWalkthroughPanel-Bm9Tvd6H.js";const ir=[["path",{d:"M17 7 7 17",key:"15tmo1"}],["path",{d:"M17 17H7V7",key:"1org7z"}]],ar=gt("arrow-down-left",ir);const lr=[["path",{d:"m15 15 6 6",key:"1s409w"}],["path",{d:"m15 9 6-6",key:"ko1vev"}],["path",{d:"M21 16v5h-5",key:"1ck2sf"}],["path",{d:"M21 8V3h-5",key:"1qoq8a"}],["path",{d:"M3 16v5h5",key:"1t08am"}],["path",{d:"m3 21 6-6",key:"wwnumi"}],["path",{d:"M3 8V3h5",key:"1ln10m"}],["path",{d:"M9 9 3 3",key:"v551iv"}]],cr=gt("expand",lr);function or(r,o){const a=new Map,d={id:"all-perspectives",title:o,summary:r.summary,nodes:[],edges:[]};return r.perspectives.forEach((p,n)=>{const x=`perspective${n}`,g=new Map(p.nodes.map((u,c)=>[u.id,`${x}_node${c}`]));a.set(x,{perspective:p.id}),d.nodes.push({id:x,title:p.title,summary:p.summary,files:[],description:p.description});for(const u of p.nodes){const c=g.get(u.id);a.set(c,{perspective:p.id,node:u.id}),d.nodes.push({...u,id:c,parentId:u.parentId?g.get(u.parentId):x})}d.edges.push(...p.edges.map(u=>({...u,from:g.get(u.from),to:g.get(u.to)})))}),{view:d,references:a}}async function $e(r,o,a,d){const p=new URLSearchParams({root:r}),n=await fetch(`/api/terminal/architecture/${o}${d?"":`${o.includes("?")?"&":"?"}${p}`}`,{signal:a,cache:"no-store",...d?{method:"PUT",headers:{"Content-Type":"application/json","X-XSRF-TOKEN":await At()},body:JSON.stringify({root:r,...d})}:{}}),x=await n.json();if(!n.ok)throw new Error(x.error||`HTTP ${n.status}`);return x}async function ur(r,o){const a=await $e(r,"documents",o);if(!Array.isArray(a.files))throw new Error("Invalid architecture library");return[...new Set(a.files.filter(d=>typeof d=="string"&&Je(d)))].sort()}async function qe(r,o,a){if(!Je(o))throw new Error("Invalid architecture file");const d=await $e(r,`document?${new URLSearchParams({file:o})}`,a);if(!("document"in d)||d.revision!==null&&typeof d.revision!="string")throw new Error("Invalid architecture response");return{document:d.document?Pe(JSON.stringify(d.document)):null,revision:typeof d.revision=="string"?d.revision:null}}async function dr(r,o,a,d,p,n,x){const g=await $e(r,"field",void 0,{file:o,perspective:a,node:d,field:p,value:n,revision:x});return Pe(JSON.stringify(g.document))}async function mr(r,o,a){const d=await $e(r,`history?${new URLSearchParams({file:o})}`,a);if(!Array.isArray(d.versions))throw new Error("Invalid architecture history");return d.versions}async function hr(r,o){return $e(r,`bundle?${new URLSearchParams({file:o})}`)}async function xr(r,o,a){const d=await $e(r,"bundle",void 0,{bundle:o,revision:a});return Pe(JSON.stringify(d.document))}async function pr(r,o,a,d){const p=await $e(r,"document",void 0,{file:o,document:a,...d!==void 0?{revision:d}:{}});return Pe(JSON.stringify(p.document))}const fr=s.lazy(()=>Mt(()=>import("./RightSidebar-DSH93gN5.js").then(r=>r.R),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16])).then(r=>({default:r.MarkdownPreview})));function rt(r,o){return o?{description:"说明",diagram:"关系图源码",context:"上下文",constraint:"约束",concern:"问题与风险",todo:"待办",note:"备注"}[r]:{description:"Description",diagram:"Diagram source",context:"Context",constraint:"Constraints",concern:"Concerns",todo:"To do",note:"Notes"}[r]}function st({value:r,rootPath:o,onEdit:a,onOpenFile:d}){const{locale:p}=he(),n=p==="zh",x=r.description?.replace(/^#\s+([^\n]+)\n\s*/,(u,c)=>c.trim()===r.title?"":u),g=u=>e.jsx(s.Suspense,{fallback:e.jsx("p",{className:"whitespace-pre-wrap text-sm",children:u}),children:e.jsx(fr,{referenceLines:!1,content:u,filePath:null,rootPath:o??null,lineRange:null,onLineRangeClick:()=>{},scrollTop:0,outlineOpen:!1,lightboxOpen:!1,onLocalLinkOpen:c=>d?.({path:o&&c.path.startsWith(`${o}/`)?c.path.slice(o.length+1):c.path})})});return e.jsxs("div",{className:"space-y-2",children:[x&&e.jsx("div",{className:"min-w-0 overflow-x-auto",children:g(x)}),wt.filter(u=>u!=="description"&&r[u]).map(u=>e.jsxs("details",{className:"rounded-lg border border-border/15 px-2",children:[e.jsx("summary",{className:"min-h-11 cursor-pointer py-3 text-xs font-medium",children:rt(u,n)}),e.jsxs("div",{className:"min-w-0 overflow-x-auto pb-2",children:[u==="diagram"?e.jsx("pre",{className:"whitespace-pre-wrap break-all text-xs",children:r[u]}):g(r[u]),a&&e.jsx("button",{type:"button",className:"min-h-11 rounded px-2 text-xs text-primary hover:bg-surface-elevated",onClick:()=>a(u),children:n?"编辑此字段":"Edit field"})]})]},u)),a&&e.jsx("button",{type:"button",className:"min-h-11 rounded-lg px-3 text-xs text-primary hover:bg-surface-elevated",onClick:()=>a("description"),children:n?"编辑文档":"Edit document"}),r.meta&&e.jsxs("details",{children:[e.jsx("summary",{className:"min-h-11 cursor-pointer py-3 text-xs text-muted-foreground",children:n?"版本信息":"Version information"}),e.jsx("dl",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 break-all pb-3 text-xs text-muted-foreground",children:Object.entries(r.meta).filter(([u])=>u!=="previousDiagram").map(([u,c])=>e.jsxs("div",{className:"contents",children:[e.jsx("dt",{children:{created:n?"创建":"Created",updated:n?"更新":"Updated",updateCount:n?"更新次数":"Updates",gitCommit:"Commit",gitBranch:n?"分支":"Branch"}[u]??u}),e.jsx("dd",{children:String(c)})]},u))})]})]})}function Qe({root:r,file:o,perspective:a,node:d,initialField:p,onSaved:n,onCancel:x}){const{locale:g}=he(),u=g==="zh",[c,T]=s.useState(null),[F,k]=s.useState(p),[C,R]=s.useState(""),[N,E]=s.useState(""),[z,$]=s.useState(""),[l,b]=s.useState(!1),h=s.useRef(!0),j=s.useRef(0);s.useEffect(()=>{h.current=!0;const f=++j.current;T(null),$("");const H=new AbortController;return qe(r,o,H.signal).then(P=>{!H.signal.aborted&&f===j.current&&T(P)}).catch(P=>{!H.signal.aborted&&f===j.current&&$(String(P.message))}),()=>{h.current=!1,++j.current,H.abort()}},[r,o]),s.useEffect(()=>{const f=c?.document?.perspectives.find(q=>q.id===a),H=d?f?.nodes.find(q=>q.id===d):f;if(!H||!f)return;const P=H[F]??(F==="description"?H.summary:F==="diagram"?Ot(f,d):"");R(P),E(P)},[c,a,d,F]);const B=C!==N;return e.jsxs("form",{className:"flex min-h-0 flex-1 flex-col gap-3",onSubmit:f=>{if(f.preventDefault(),!c||l||!B)return;const H=j.current;b(!0),$(""),dr(r,o,a,d,F,C,c.revision).then(P=>{h.current&&H===j.current&&n(P)}).catch(P=>{h.current&&H===j.current&&$(P.message)}).finally(()=>{h.current&&H===j.current&&b(!1)})},children:[e.jsxs("label",{className:"flex items-center gap-2 text-xs",children:[u?"字段":"Field",e.jsx("select",{"aria-label":u?"文档字段":"Document field",className:"min-h-11 min-w-0 flex-1 rounded bg-surface-2 px-2",value:F,disabled:l||B,onChange:f=>k(f.target.value),children:wt.map(f=>e.jsx("option",{value:f,children:rt(f,u)},f))})]}),B&&e.jsx("p",{className:"text-xs text-muted-foreground",children:u?"保存当前字段后可切换字段。":"Save this field before switching fields."}),!c&&!z&&e.jsx("p",{role:"status",className:"text-xs",children:u?"读取最新文档…":"Loading the latest document…"}),e.jsx("textarea",{"aria-label":rt(F,u),spellCheck:!1,className:"min-h-56 w-full flex-1 resize-y rounded-lg border border-border/30 bg-surface-2 p-3 font-mono text-sm focus-visible:ring-2 focus-visible:ring-ring",disabled:!c||l,maxLength:1e5,value:C,onChange:f=>R(f.target.value)}),z&&e.jsx("p",{role:"alert",className:"break-words text-xs text-destructive",children:z}),e.jsxs("div",{className:"sticky bottom-0 flex gap-2 bg-surface py-2",children:[e.jsx("button",{type:"submit",className:"min-h-11 rounded-lg bg-primary/15 px-4 text-sm text-primary disabled:opacity-40",disabled:!c||l||!B,children:l?u?"保存中…":"Saving…":u?"保存":"Save"}),e.jsx("button",{type:"button",className:"min-h-11 rounded-lg px-4 text-sm hover:bg-surface-elevated",disabled:l,onClick:x,children:u?"取消":"Cancel"})]})]})}function br({root:r,file:o,document:a,onLoaded:d}){const{locale:p}=he(),n=p==="zh",[x,g]=s.useState(""),[u,c]=s.useState(""),[T,F]=s.useState(!1),[k,C]=s.useState(null),[R,N]=s.useState(null),E=s.useRef(null),z=s.useRef(0);s.useEffect(()=>(z.current++,N(null),C(null),g(""),c(""),F(!1),()=>{z.current++}),[r,o]);async function $(b){const h=++z.current;F(!0),g(""),c("");try{await b(()=>h===z.current)}catch(j){h===z.current&&g(j instanceof Error?j.message:String(j))}finally{h===z.current&&F(!1)}}const l="inline-flex min-h-11 items-center gap-1.5 rounded-lg px-3 text-xs hover:bg-surface-elevated disabled:opacity-40";return e.jsxs("details",{className:"rounded-lg border border-border/15 px-3",children:[e.jsx("summary",{className:"min-h-11 cursor-pointer py-3 text-xs text-muted-foreground",children:n?"历史、导入与分享":"History, import and sharing"}),e.jsxs("div",{className:"flex flex-wrap gap-1",children:[e.jsxs("button",{className:l,type:"button",disabled:T||!a,onClick:()=>{$(async b=>{const h=await mr(r,o);b()&&C(h)})},children:[e.jsx(Ht,{size:14}),n?"更新差异":"Changes"]}),e.jsxs("button",{className:l,type:"button",disabled:T||!a,onClick:()=>{$(async()=>{await Ge(new Blob([JSON.stringify(a,null,2)],{type:"application/json"}),"termdock-architecture.json")})},children:[e.jsx(tt,{size:14}),"JSON"]}),e.jsxs("button",{className:l,type:"button",disabled:T||!a,onClick:()=>{$(async()=>{const b=await hr(r,o);await Ge(new Blob([JSON.stringify(b,null,2)],{type:"application/json"}),"architecture.omm.json")})},children:[e.jsx(tt,{size:14}),".omm"]}),e.jsxs("button",{className:l,type:"button",disabled:T,onClick:()=>E.current?.click(),children:[e.jsx(Qt,{size:14}),n?"导入":"Import"]}),e.jsxs("button",{className:l,type:"button",disabled:T||!a,onClick:()=>{$(async()=>{const b=Dt(),h=Bt(window.location.origin,{root:r,file:o,...b?{peerId:b.targetPeerId,serviceName:b.serviceName}:{}});await navigator.clipboard.writeText(h),c(n?"链接已复制,打开时需要登录此 Termdock 服务。":"Link copied. Sign in to this Termdock service to view it.")})},children:[e.jsx(rr,{size:14}),n?"复制查看链接":"Copy viewer link"]})]}),e.jsx("input",{ref:E,hidden:!0,type:"file",accept:".json,application/json",onChange:b=>{const h=b.target.files?.[0];b.target.value="",h&&$(async j=>{if(h.size>5e6)throw new Error(n?"文档超过 5 MB。":"Document exceeds 5 MB.");const B=await h.text();if(!j())return;const f=JSON.parse(B);if(f?.format==="termdock-omm-bundle"){const Q=await qe(r,".omm");if(!j())return;N({name:h.name,value:f,file:".omm",revision:Q.revision});return}const H=Pe(B),P=H.analysis?Ue(H.analysis):fe,q=await qe(r,P);j()&&N({name:h.name,value:H,file:P,revision:q.revision})})}}),R&&e.jsxs("div",{className:"my-2 rounded-lg bg-surface-2 p-3 text-xs",children:[e.jsxs("p",{className:"break-all",children:[R.name," → ",R.file]}),e.jsx("p",{className:"mt-1 text-muted-foreground",children:R.file===".omm"?n?"合并文档中的目录和字段;同名字段将更新。":"Merge bundled directories and fields; matching fields are updated.":n?"保存为此范围的架构,并保留此前的版本。":"Save this scope and retain its previous version."}),e.jsxs("div",{className:"mt-2 flex gap-2",children:[e.jsx("button",{className:`${l} text-primary`,disabled:T,type:"button",onClick:()=>{$(async b=>{const h=R.file===".omm"?await xr(r,R.value,R.revision):await pr(r,R.file,R.value,R.revision);b()&&(N(null),d(R.file,h))})},children:n?"确认导入":"Import document"}),e.jsx("button",{className:l,disabled:T,type:"button",onClick:()=>N(null),children:n?"取消":"Cancel"})]})]}),T&&e.jsx("p",{role:"status",className:"py-2 text-xs",children:n?"处理中…":"Working…"}),x&&e.jsx("p",{role:"alert",className:"break-words py-2 text-xs text-destructive",children:x}),u&&e.jsx("p",{role:"status",className:"py-2 text-xs text-muted-foreground",children:u}),k&&e.jsxs("div",{className:"space-y-2 pb-3",children:[k.length===0&&e.jsx("p",{className:"text-xs text-muted-foreground",children:n?"还没有历史版本。使用原生命令或文档编辑保存后会保留版本。":"No previous versions. Native saves and document edits retain history."}),k.map(b=>e.jsxs("details",{children:[e.jsxs("summary",{className:"min-h-11 cursor-pointer py-3 text-xs",children:[new Date(b.savedAt).toLocaleString()," · ",b.changes.length," ",n?"处差异":"changes"]}),e.jsx("ul",{className:"space-y-1 text-xs text-muted-foreground",children:b.changes.map((h,j)=>e.jsxs("li",{className:"break-words",children:[h.kind==="added"?"+":h.kind==="removed"?"−":"~"," ",h.title," · ",h.fields.join(", ")]},j))})]},b.id))]})]})}async function gr(r,o,a=fe){const{document:d}=await qe(r,a,o);if(d?.analysis&&Ue(d.analysis)!==a)throw new Nt("Architecture scope does not match its file");return d}async function yr(r,o){return ur(r,o)}function jr({view:r,parentId:o,selectedId:a,onSelect:d,active:p=!0,referenceWidth:n,inspector:x,inspectorStage:g="details",onDismissInspector:u,onExpandedChange:c,navigation:T,heading:F}){const{t:k,locale:C}=he(),[R,N]=s.useState(1),E=s.useId().replace(/[^a-zA-Z0-9]/g,""),z=s.useRef(null),$=s.useRef(null),l=s.useRef(null),b=s.useRef(null),h=s.useRef(null),[j,B]=s.useState(""),[f,H]=s.useState(!1),[P,q]=s.useState(1),Q=s.useRef(1),[A,ne]=s.useState(!1),be=s.useRef(!0),V=s.useRef({inspector:x,onDismissInspector:u});V.current={inspector:x,onDismissInspector:u};const _=s.useRef(c);_.current=c;const ee=s.useRef({left:0,top:0}),[ie,oe]=s.useState(!1),[ae,xe]=s.useState({width:320,height:320,clipHeight:0}),v=s.useRef(new Map),O=s.useRef(!1),K=s.useRef(0),le=s.useMemo(()=>_t(r,o,R),[r,o,R]),Z=s.useMemo(()=>nt(r,o).edges,[r,o]),W=s.useMemo(()=>{const i=j.match(/viewBox="([^"]+)"/)?.[1].split(/\s+/).map(Number),S=i?.[2]||320,m=i?.[3]||240,D=A?window.innerWidth:n||ae.width,w=Math.max(1,Math.min(1.4,Math.max(160,D-24)/S));return{width:S,height:m,scale:w}},[j,ae.width,A,n]),ce={width:W.width*W.scale*P,height:W.height*W.scale*P},ue=(i,S,m)=>{const D=Math.max(.01,Math.min(4,i)),w=$.current;if(w){const J=w.getBoundingClientRect(),ge=S===void 0?w.clientWidth/2:S-J.left,me=m===void 0?w.clientHeight/2:m-J.top,Y=D/Q.current,ve=(w.scrollLeft+ge)*Y-ge,pe=(w.scrollTop+me)*Y-me,ze=()=>{$.current===w&&(w.scrollLeft=ve,w.scrollTop=pe)};window.requestAnimationFrame?window.requestAnimationFrame(ze):window.setTimeout(ze,0)}Q.current=D,q(D)},se=()=>{Q.current=1,q(1),$.current&&($.current.scrollLeft=0,$.current.scrollTop=0)};s.useEffect(()=>{let i=!1;return B(""),H(!1),se(),oe(!1),v.current.clear(),le.nodes.length>300?(H(!0),()=>{i=!0}):(Gt().then(async S=>{er(S);const m=await S.render(`td-architecture-${E}`,le.code);i||B(sr.sanitize(m.svg,{USE_PROFILES:{svg:!0,svgFilters:!0}}))}).catch(()=>{i||H(!0)}),()=>{i=!0})},[le.code,E]),s.useEffect(()=>{p||ne(!1)},[p]),s.useEffect(()=>{_.current?.(A)},[A]),s.useEffect(()=>()=>_.current?.(!1),[]),s.useLayoutEffect(()=>{const i=$.current;if(i)return i.scrollLeft=ee.current.left,i.scrollTop=ee.current.top,()=>{ee.current={left:i.scrollLeft,top:i.scrollTop}}},[A,!!j]),s.useEffect(()=>{const i=$.current;if(!i)return;const S=i.closest("[data-architecture-content]"),m=()=>{xe({width:i.clientWidth||320,height:i.clientHeight||320,clipHeight:S?.clientHeight||0})};m();const D=new ResizeObserver(m);return D.observe(i),S&&D.observe(S),()=>D.disconnect()},[j,A]),We(l,A&&p,()=>{V.current.inspector?V.current.onDismissInspector?.():ne(!1)},()=>be.current?h.current:null),s.useEffect(()=>{if(!A)return;const i=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=i,v.current.clear()}},[A]),s.useLayoutEffect(()=>{const i=z.current?.querySelector("svg"),S=i?.querySelector("g");if(!(!i||!S||typeof S.getBBox!="function"))try{const m=S.getBBox();if(![m.x,m.y,m.width,m.height].every(Number.isFinite)||m.width<=0||m.height<=0)return;const D=`${m.x-16} ${m.y-16} ${m.width+32} ${m.height+32}`;if(i.getAttribute("viewBox")===D)return;i.setAttribute("viewBox",D),B(i.outerHTML)}catch{}},[j,A]),s.useLayoutEffect(()=>{z.current?.querySelectorAll("g.node, g.cluster").forEach(i=>{const S=Number(i.id.match(/(?:^|-)n(\d+)(?:-|$)/)?.[1]),m=le.nodes[S];if(!m)return;i.dataset.architectureRole=m.role,i.dataset.architectureNode=m.id,i.dataset.architectureRelated=String(!!a&&Z.some(w=>w.from===a&&w.to===m.id||w.to===a&&w.from===m.id));const D=i.matches("g.cluster")?i.querySelector("g.cluster-label")??i:i;D!==i&&(i.removeAttribute("role"),i.removeAttribute("tabindex")),D.dataset.architectureNode=m.id,D.setAttribute("role","button"),D.setAttribute("tabindex","0"),D.setAttribute("aria-label",m.title),D.setAttribute("aria-pressed",String(a===m.id)),i.setAttribute("aria-pressed",String(a===m.id))})}),s.useLayoutEffect(()=>{if(!a||g==="source"||g==="analysis")return;const i=$.current,S=[...z.current?.querySelectorAll("[data-architecture-node]")??[]].find(Y=>Y.dataset.architectureNode===a);if(!i||!S)return;let m=i.getBoundingClientRect();const D=i.closest("[data-architecture-content]");if(!A&&D&&m.width>24&&m.height>24){const Y=D.getBoundingClientRect(),ve=Math.min(m.height,Math.max(160,Y.height-136));Y.height>160&&Math.min(m.bottom,Y.bottom)-Math.max(m.top,Y.top)<ve&&(D.scrollTop+=Math.max(0,m.top-Y.bottom+ve),m=i.getBoundingClientRect());const pe=Math.max(m.top,Y.top+136),ze=Math.min(m.bottom,Y.bottom);m=new DOMRect(m.left,pe,m.width,Math.max(0,ze-pe))}const w=S.getBoundingClientRect();if(m.width<=24||m.height<=24||w.width<=0||w.height<=0)return;const J=12,ge=w.width>m.width-2*J?(w.left+w.right-m.left-m.right)/2:w.left<m.left+J?w.left-m.left-J:w.right>m.right-J?w.right-m.right+J:0,me=w.height>m.height-2*J?(w.top+w.bottom-m.top-m.bottom)/2:w.top<m.top+J?w.top-m.top-J:w.bottom>m.bottom-J?w.bottom-m.bottom+J:0;i.scrollLeft+=ge,i.scrollTop+=me},[a,ae.width,ae.height,ae.clipHeight,A,g,j]);const M=i=>{[...z.current?.querySelectorAll("[data-architecture-node]")??[]].find(S=>S.dataset.architectureNode===i)?.focus?.({preventScroll:!0}),d(i)},X="flex h-11 min-w-11 items-center justify-center rounded-lg px-2 hover:bg-surface-elevated focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-40",U=e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:X,"aria-label":k("architecture.zoomOut"),disabled:P<=.01,onClick:()=>ue(Q.current/1.25),children:e.jsx(Ut,{size:17})}),e.jsxs("button",{type:"button",className:`${X} text-xs tabular-nums`,"aria-label":k("architecture.resetZoom"),title:k("architecture.resetZoom"),onClick:se,children:[Math.round(W.scale*P*100),"%"]}),e.jsx("button",{type:"button",className:X,"aria-label":k("architecture.zoomIn"),disabled:P>=4,onClick:()=>ue(Q.current*1.25),children:e.jsx(yt,{size:17})}),e.jsx("button",{type:"button",className:X,"aria-label":k("architecture.fitGraph"),onClick:()=>ue(Math.min((ae.width-24)/W.width,(ae.height-24)/W.height)/W.scale),children:e.jsx(tr,{size:17})}),!A&&e.jsx("button",{ref:h,type:"button",className:X,"aria-label":k("architecture.fullscreen"),onClick:()=>{be.current=!0,ne(!0)},children:e.jsx(cr,{size:17})}),e.jsx("button",{type:"button",className:X,"aria-label":k("architecture.download"),disabled:!j,onClick:()=>{oe(!1),Ge(new Blob([j],{type:"image/svg+xml"}),`architecture-${r.id}.svg`).catch(()=>oe(!0))},children:e.jsx(tt,{size:17})}),A&&e.jsx("button",{ref:b,type:"button",className:X,"aria-label":k("architecture.closeFullscreen"),onClick:()=>ne(!1),children:e.jsx(Se,{size:18})})]}),Ce=r.nodes.find(i=>i.id===o)?.title??r.title,Ie=e.jsxs(e.Fragment,{children:[A?e.jsxs("header",{className:"flex shrink-0 flex-wrap items-center gap-1 border-b border-border/15 px-2 py-1",children:[e.jsx("div",{className:"min-w-0 basis-full px-1 min-[360px]:basis-0 min-[360px]:flex-1",children:F??e.jsx("h2",{className:"truncate text-xs font-semibold",title:Ce,children:Ce})}),e.jsx("div",{className:"flex w-full shrink-0 items-center justify-between gap-1 min-[360px]:w-auto",title:k("architecture.panHint"),children:U})]}):e.jsxs("div",{className:"sticky top-[60px] z-10 shrink-0 border-b border-border/15 bg-surface-2 px-2 py-1",children:[e.jsx("div",{className:"flex items-center justify-between gap-1",children:U}),e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-1 px-1 text-xs text-muted-foreground",children:[e.jsx("span",{children:k("architecture.panHint")}),e.jsxs("label",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[C==="zh"?"展开层级":"Expand levels",e.jsx("select",{"aria-label":C==="zh"?"展开层级":"Expand levels",className:"min-h-8 rounded bg-surface-2 px-2 text-foreground",value:R,onChange:i=>N(Number(i.target.value)),children:[0,1,2,6].map(i=>e.jsx("option",{value:i,children:i===0?C==="zh"?"当前层":"Current level":i===6?C==="zh"?"全部":"All":`${i}`},i))})]})]})]}),A&&e.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 px-2",children:[T,e.jsxs("label",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[C==="zh"?"展开层级":"Expand levels",e.jsx("select",{"aria-label":C==="zh"?"展开层级":"Expand levels",className:"min-h-8 rounded bg-surface-2 px-2 text-foreground",value:R,onChange:i=>N(Number(i.target.value)),children:[0,1,2,6].map(i=>e.jsx("option",{value:i,children:i===0?C==="zh"?"当前层":"Current level":i===6?C==="zh"?"全部":"All":`${i}`},i))})]})]}),ie&&e.jsx("p",{role:"alert",className:"px-3 py-2 text-xs text-destructive",children:k("architecture.downloadFailed")}),e.jsxs("div",{className:A?"relative flex min-h-0 flex-1 flex-col overflow-hidden min-[768px]:flex-row":"relative",children:[f?e.jsx("p",{role:"alert",className:"p-4 text-sm text-muted-foreground",children:le.nodes.length>300?C==="zh"?"图中模块较多,请减少展开层级或选择单个视角。":"This graph has many modules. Expand fewer levels or select one perspective.":k("architecture.diagramFailed")}):j?e.jsx("div",{ref:$,"data-sidebar-gesture-ignore":!0,className:`termdock-architecture-viewport overflow-auto overscroll-contain p-3 ${A?"min-h-0 min-w-0 flex-1":"h-[min(50dvh,26rem)]"}`,style:{touchAction:"none",maxHeight:!A&&ae.clipHeight?Math.max(160,ae.clipHeight-150):void 0},onPointerDown:i=>{if(i.button!==0)return;v.current.size||(O.current=!1,K.current=0);const S=i.target.closest("[data-architecture-node]")?.getAttribute("data-architecture-node")??void 0;v.current.set(i.pointerId,{x:i.clientX,y:i.clientY,nodeId:S}),v.current.size>1&&(O.current=!0);try{i.currentTarget.setPointerCapture?.(i.pointerId)}catch{}},onPointerMove:i=>{const S=v.current.get(i.pointerId);if(!S)return;const m=[...v.current.values()];v.current.set(i.pointerId,{...S,x:i.clientX,y:i.clientY});const D=[...v.current.values()];if(D.length>=2){const w=me=>Math.hypot(me[0].x-me[1].x,me[0].y-me[1].y),J=w(m),ge=w(D);J>0&&ue(Q.current*ge/J,(D[0].x+D[1].x)/2,(D[0].y+D[1].y)/2),O.current=!0}else{const w=S.x-i.clientX,J=S.y-i.clientY;K.current+=Math.hypot(w,J),K.current>5&&(O.current=!0),i.currentTarget.scrollLeft+=w,i.currentTarget.scrollTop+=J}},onPointerUp:i=>{const S=v.current.get(i.pointerId),m=v.current.size===1&&!O.current&&S?.nodeId;v.current.delete(i.pointerId),m&&(O.current=!0,M(m))},onPointerCancel:i=>{v.current.delete(i.pointerId),O.current=!0},onLostPointerCapture:i=>{v.current.delete(i.pointerId)},children:e.jsx("div",{ref:z,role:"group","aria-label":k("architecture.modules"),className:"termdock-architecture-diagram mx-auto",style:ce,onClick:i=>{if(O.current)return;const m=i.target.closest("[data-architecture-node]")?.getAttribute("data-architecture-node");m&&M(m)},onKeyDown:i=>{if(i.key!=="Enter"&&i.key!==" ")return;const S=i.target.closest("[data-architecture-node]")?.getAttribute("data-architecture-node");S&&(i.preventDefault(),M(S))},dangerouslySetInnerHTML:{__html:j}})}):e.jsx("p",{role:"status",className:"p-4 text-sm text-muted-foreground",children:k("architecture.rendering")}),A&&x]})]});return A?vt.createPortal(e.jsx("section",{ref:l,tabIndex:-1,role:"dialog","aria-modal":"true","aria-label":k("architecture.diagram"),"data-sidebar-gesture-ignore":!0,className:"fixed inset-0 z-modal-panel flex flex-col overflow-hidden bg-surface text-foreground pt-[env(safe-area-inset-top)] pb-[env(safe-area-inset-bottom)]",children:Ie}),document.body):e.jsx("section",{className:"overflow-clip rounded-xl border border-border/20 bg-surface-2","aria-label":k("architecture.diagram"),children:Ie})}function je(r,o){let a=r.trim().replace(/^@/,"");/^([`"']).*\1$/.test(a)&&(a=a.slice(1,-1)),a=a.replace(/\\ /g," ").replace(/:\d+(?:-\d+)?$/,"").replace(/\/+$/,""),/^([`"']).*\1$/.test(a)&&(a=a.slice(1,-1));const d=o.replace(/\/+$/,"");if(a.startsWith("/")){if(!a.startsWith(`${d}/`))return null;a=a.slice(d.length+1)}return a=a.replace(/^\.\//,""),a.length<=1024&&qt(a)?a:null}function ht(r,o){const a=[...r.matchAll(/^# (.+?): hunk \d+,/gm)].map(x=>x[1]),p=(a.length?a:r.split(/\r?\n/).map(x=>x.trim()).filter(Boolean)).map(x=>je(x,o));if(p.some(x=>x===null))return null;const n=[...new Set(p)];return n.length<=20?n:null}function $t({rootPath:r,initialDirectory:o,selected:a,onChange:d,selectionDisabled:p=!1,compact:n=!1}){const{t:x}=he(),g=r.replace(/\/+$/,"")||"/",[u,c]=s.useState(()=>o&&je(o,g)?o.replace(/\/+$/,""):g),[T,F]=s.useState(""),[k,C]=s.useState(null),[R,N]=s.useState(0),[E,z]=s.useState(null);s.useEffect(()=>{if(!E)return;const f=window.setTimeout(()=>z(null),1800);return()=>window.clearTimeout(f)},[E]);const $=et(f=>f.invalidateDirectoryCache),l=new Set(a.map(f=>`${g==="/"?"":g}/${f}`)),b=f=>{const H=je(f,g);p||!H||a.includes(H)||a.length>=20||d([...a,H])},h=f=>{f!==g&&!je(f,g)||(c(f),F(""),C(null))},j=`inline-flex shrink-0 items-center justify-center rounded-lg text-xs hover:bg-surface-elevated focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-40 ${n?"h-8 w-8 [@media(pointer:coarse)]:h-11 [@media(pointer:coarse)]:w-11":"h-11 w-11"}`,B=je(u,g);return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"shrink-0 px-2 py-1",children:e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("button",{type:"button",className:j,disabled:u===g,"aria-label":x("rightSidebar.parentFolder"),onClick:()=>h(u.slice(0,u.lastIndexOf("/"))||g),children:e.jsx(Wt,{size:17})}),e.jsx("button",{type:"button",className:j,disabled:u===g,"aria-label":x("rightSidebar.backToProjectRoot"),onClick:()=>h(g),children:e.jsx(Jt,{size:16})}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-xs font-medium",title:u,children:B??(u.split("/").pop()||"/")}),B&&e.jsx("button",{type:"button",className:`${j} text-primary`,disabled:p||!a.includes(B)&&a.length>=20,"aria-label":`${x("architecture.addScopeReference")}: ${u.split("/").pop()}`,title:B,"aria-pressed":a.includes(B),onClick:()=>b(u),children:a.includes(B)?e.jsx(Ft,{size:15}):e.jsx(nr,{size:15})}),e.jsx("button",{type:"button",className:j,"aria-label":x("rightSidebar.refreshFiles"),onClick:()=>{$(u,!0),N(f=>f+1)},children:e.jsx(kt,{size:15})})]})}),p&&e.jsx("p",{role:"alert",className:"shrink-0 px-3 pb-2 text-xs text-muted-foreground",children:x("architecture.correctPathsFirst")}),e.jsx("div",{className:"shrink-0 border-b border-border/15 px-3 pb-2",children:e.jsx("input",{"aria-label":x("architecture.searchScopePaths"),placeholder:x("architecture.searchScopePaths"),value:T,onChange:f=>F(f.target.value),className:`${n?"h-9 [@media(pointer:coarse)]:h-11":"h-11"} w-full rounded-lg border border-border/20 bg-surface-2 px-3 text-sm focus-visible:ring-2 focus-visible:ring-ring`})}),e.jsx("div",{className:"min-h-0 flex-1 overflow-auto overscroll-contain bg-surface",children:e.jsx(Vt,{rootPath:u,selectedFilePath:k,onFileSelect:f=>{C(f),b(f)},onDirectoryRoot:h,onPathReference:b,getReferenceText:f=>je(f,g)??f,query:T,onReferenceCopied:z,copiedReferenceKey:E,onSearchFromDirectory:h,referenceSelection:{paths:l,label:x("architecture.addScopeReference"),disabled:p||a.length>=20}},`${u}:${R}`)})]})}function vr({rootPath:r,initialDirectory:o,initial:a,onConfirm:d,onCancel:p}){const{t:n}=he(),x=s.useRef(null);We(x,!0,p);const g=s.useId(),[u,c]=s.useState(a);s.useEffect(()=>{const F=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=F}},[]);const T="inline-flex min-h-11 items-center justify-center gap-1.5 rounded-lg px-3 text-xs hover:bg-surface-elevated focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-40";return vt.createPortal(e.jsxs("div",{className:"fixed inset-0 z-popover flex items-center justify-center p-[max(0.75rem,env(safe-area-inset-top))]",children:[e.jsx("button",{type:"button",className:"absolute inset-0 z-10 cursor-default bg-[var(--app-backdrop)]","aria-label":n("common.cancel"),onClick:p}),e.jsxs("section",{ref:x,id:`${g}-dialog`,tabIndex:-1,role:"dialog","aria-modal":"true","aria-labelledby":g,"aria-describedby":`${g}-hint`,className:"relative z-20 flex h-full max-h-[42rem] w-full max-w-xl flex-col overflow-hidden rounded-xl border border-border/20 bg-surface text-foreground shadow-xl",children:[e.jsxs("header",{className:"shrink-0 px-3 py-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{id:g,className:"min-w-0 flex-1 text-sm font-semibold",title:n("architecture.browsePathsHint"),children:n("architecture.choosePaths")}),e.jsx("button",{type:"button",className:T,"aria-label":n("common.close"),onClick:p,children:e.jsx(Se,{size:17})})]}),e.jsx("p",{id:`${g}-hint`,className:"sr-only",children:n("architecture.browsePathsHint")})]}),e.jsx($t,{rootPath:r,initialDirectory:o,selected:u,onChange:c}),e.jsxs("footer",{className:"shrink-0 space-y-2 border-t border-border/15 p-3",children:[e.jsxs("p",{className:"text-xs text-muted-foreground",children:[n("architecture.selectedPaths")," ",u.length," / 20"]}),u.length>0&&e.jsx("div",{className:"flex max-h-24 flex-wrap gap-1 overflow-y-auto",children:u.map(F=>e.jsxs("button",{type:"button",className:`${T} min-w-0 max-w-full bg-surface-2`,"aria-label":`${n("architecture.removePath")}: ${F}`,onClick:()=>c(k=>k.filter(C=>C!==F)),children:[e.jsx("span",{className:"truncate font-mono",children:F}),e.jsx(Se,{size:13,className:"shrink-0"})]},F))}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx("button",{type:"button",className:T,onClick:p,children:n("common.cancel")}),e.jsx("button",{type:"button",className:`${T} bg-primary/15 text-primary`,onClick:()=>d(u),children:n("architecture.usePaths")})]})]})]})]}),document.body)}function xt({rootPath:r,initial:o,outputFile:a,currentFile:d,currentDirectory:p,active:n=!0,onInsertPrompt:x,onPrepared:g,onClose:u}){const{t:c,locale:T}=he(),F=s.useRef(null),k=s.useRef(null);We(k,n,u),s.useLayoutEffect(()=>{n&&k.current?.scrollIntoView?.({block:"start"})},[n]);const[C,R]=s.useState(!1);s.useLayoutEffect(()=>{const M=k.current;if(!n||!M)return;const X=()=>R(M.clientWidth>=900);if(X(),typeof ResizeObserver>"u")return;const U=new ResizeObserver(X);return U.observe(M),()=>U.disconnect()},[n]);const N=s.useId(),[E,z]=s.useState(o.kind),[$,l]=s.useState(o.target),[b,h]=s.useState(o.paths.join(`
|
|
3
|
-
`)),[j,B]=s.useState(o.depth),[f,H]=s.useState(o.focus),[P,q]=s.useState(null),[Q,A]=s.useState(!1),[ne,be]=s.useState(!1),V=s.useRef(0);s.useEffect(()=>()=>{V.current++},[]),s.useEffect(()=>{n||(V.current++,A(!1),be(!1))},[n]);const _=ht(b,r),ee=d?je(d,r):null,ie=p?je(p,r):null,oe=ie?p:ee?d.slice(0,d.lastIndexOf("/")):r,xe=n&&C&&E!=="project"&&!a&&!ne;let v=null;try{(E==="project"||_)&&(v=Kt({kind:E,target:$,paths:_??[],depth:j,focus:f}))}catch{}const O=v?Xt(r,T,v,a):"",K="inline-flex min-h-11 items-center justify-center gap-1.5 rounded-lg text-xs font-medium transition hover:bg-surface-elevated focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-40",le=`${K} px-3`,Z=`${K} px-1`,W="min-h-10 w-full min-w-0 rounded-lg border border-border/20 bg-surface px-2 py-2 text-sm text-foreground focus-visible:ring-2 focus-visible:ring-ring",ce=()=>{V.current++,A(!1),q(null)},ue=M=>{h(_?[...new Set([..._,M])].join(`
|
|
4
|
-
`):`${b.trim()}
|
|
5
|
-
${M}`),ce()},se=v;return e.jsxs("div",{ref:k,id:`${N}-workspace`,tabIndex:-1,className:xe?"grid min-h-0 min-w-0 flex-1 grid-cols-[20rem_minmax(0,1fr)] grid-rows-[minmax(0,1fr)] items-start gap-3":"min-w-0 shrink-0",children:[xe&&e.jsxs("section",{"aria-label":c("architecture.choosePaths"),"aria-describedby":`${N}-browser-hint`,className:"flex h-full min-h-0 min-w-0 flex-col overflow-hidden rounded-xl border border-border/20 bg-surface-2",children:[e.jsxs("header",{className:"flex min-h-9 shrink-0 items-center gap-2 px-3",children:[e.jsx("h3",{className:"min-w-0 flex-1 truncate text-xs font-medium",title:c("architecture.browsePathsHint"),children:c("architecture.choosePaths")}),e.jsxs("p",{role:"status","aria-label":`${c("architecture.selectedPaths")} ${_?.length??0} / 20`,className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:[_?.length??0," / 20"]}),e.jsx("p",{id:`${N}-browser-hint`,className:"sr-only",children:c("architecture.browsePathsHint")})]}),e.jsx($t,{compact:!0,rootPath:r,initialDirectory:oe,selected:_??[],selectionDisabled:!_,onChange:M=>{h(M.join(`
|
|
6
|
-
`)),ce()}})]}),e.jsxs("form",{ref:F,tabIndex:-1,className:`min-w-0 space-y-2.5 rounded-xl border border-border/20 bg-surface-2 p-3 ${xe?"max-h-full overflow-y-auto overscroll-contain":""}`,onSubmit:M=>{if(M.preventDefault(),!se||Q||!n||!F.current)return;const X=++V.current,U=F.current;U.focus({preventScroll:!0}),A(!0),q(null),Promise.resolve().then(()=>X===V.current&&U.isConnected?x(O,U):!1).then(Ce=>{X===V.current&&(Ce===!0?(g(a??Ue(se),se),q("inserted")):q("insertFailed"))}).catch(()=>{X===V.current&&q("insertFailed")}).finally(()=>{X===V.current&&A(!1)})},children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("h2",{className:"text-sm font-medium",children:c(a?"architecture.updateAnalysis":"architecture.prepare")}),e.jsx("button",{type:"button",className:`${le} px-2`,"aria-label":c("architecture.closePreparation"),onClick:u,children:e.jsx(Se,{size:16})})]}),e.jsxs("label",{className:"block space-y-1 text-xs",htmlFor:`${N}-kind`,children:[e.jsx("span",{children:c("architecture.analysisRange")}),e.jsxs("select",{id:`${N}-kind`,className:W,value:E,disabled:!!a,onChange:M=>{z(M.target.value),ce()},children:[e.jsx("option",{value:"project",children:c("architecture.projectRange")}),e.jsx("option",{value:"module",children:c("architecture.moduleRange")}),e.jsx("option",{value:"feature",children:c("architecture.featureRange")})]})]}),E==="feature"&&e.jsxs("label",{className:"block space-y-1 text-xs",htmlFor:`${N}-target`,children:[e.jsx("span",{children:c("architecture.featureTarget")}),e.jsx("input",{id:`${N}-target`,className:W,value:$,readOnly:!!a,maxLength:1e3,placeholder:c("architecture.featurePlaceholder"),onChange:M=>{l(M.target.value),ce()},"aria-describedby":`${N}-validation`})]}),E!=="project"&&e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"block text-xs",htmlFor:`${N}-paths`,children:c(E==="module"?"architecture.modulePaths":"architecture.startPaths")}),e.jsx("textarea",{id:`${N}-paths`,className:`${W} resize-y font-mono text-xs`,rows:2,value:b,readOnly:!!a,placeholder:c("architecture.modulePlaceholder"),onChange:M=>{h(M.target.value),ce()},onBlur:()=>{!a&&_&&h(_.join(`
|
|
7
|
-
`))},onPaste:M=>{if(a)return;const X=ht(M.clipboardData.getData("text/plain"),r);if(!X?.length||!_)return;const U=[...new Set([..._,...X])];U.length>20||(M.preventDefault(),h(U.join(`
|
|
8
|
-
`)),ce())},"aria-describedby":`${N}-paths-hint ${N}-validation`}),!a&&e.jsxs("div",{className:"flex flex-wrap gap-1",children:[!xe&&e.jsxs("button",{type:"button",className:`${Z} text-primary`,"aria-label":c("architecture.choosePaths"),onClick:()=>be(!0),children:[e.jsx(Zt,{size:14}),c("architecture.browsePaths")]}),ie&&e.jsx("button",{type:"button",className:Z,disabled:!!_?.includes(ie)||(_?.length??0)>=20,title:ie,onClick:()=>ue(ie),children:c("architecture.useCurrentDirectory")}),ee&&e.jsx("button",{type:"button",className:Z,disabled:!!_?.includes(ee)||(_?.length??0)>=20,title:ee,onClick:()=>ue(ee),children:c("architecture.useCurrentFile")})]}),e.jsx("p",{id:`${N}-paths-hint`,className:"text-xs leading-relaxed text-muted-foreground",title:r,children:c("architecture.pathsHint")})]}),!v&&(b.trim()||$.trim())&&e.jsx("p",{id:`${N}-validation`,role:"alert",className:"text-xs text-muted-foreground",children:c(E==="module"?"architecture.invalidPaths":"architecture.requiredFeature")}),e.jsxs("label",{className:"block space-y-1 text-xs",htmlFor:`${N}-focus`,children:[e.jsx("span",{children:c("architecture.focus")}),e.jsx("textarea",{id:`${N}-focus`,className:`${W} resize-y`,rows:2,maxLength:2e3,value:f,placeholder:c("architecture.focusPlaceholder"),onChange:M=>{H(M.target.value),ce()}})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx("button",{type:"submit",disabled:!v||Q,className:`${le} bg-primary/15 text-primary`,children:c(Q?"architecture.inserting":"architecture.insertPrompt")}),e.jsxs("button",{type:"button",disabled:!v||Q,className:le,onClick:()=>{if(!se)return;const M=++V.current;Promise.resolve().then(()=>navigator.clipboard.writeText(O)).then(()=>{M===V.current&&(g(a??Ue(se),se),q("copied"))}).catch(()=>{M===V.current&&q("failed")})},children:[e.jsx(Lt,{size:14}),c("architecture.copyPrompt")]})]}),P&&e.jsx("p",{role:"status",className:"text-xs text-muted-foreground",children:c(`architecture.${P}`)}),e.jsxs("details",{children:[e.jsx("summary",{className:"cursor-pointer py-2 text-xs text-muted-foreground",children:c("architecture.analysisOptions")}),e.jsxs("div",{className:"space-y-3 pt-1",children:[e.jsxs("label",{className:"block space-y-1 text-xs",htmlFor:`${N}-depth`,children:[e.jsx("span",{children:c("architecture.dependencyDepth")}),e.jsxs("select",{id:`${N}-depth`,className:W,value:j,onChange:M=>{B(M.target.value),ce()},children:[e.jsx("option",{value:"boundary",children:c("architecture.boundaryDepth")}),e.jsx("option",{value:"dependencies",children:c("architecture.followDepth")})]})]}),E==="feature"&&e.jsx("p",{className:"text-xs leading-relaxed text-muted-foreground",children:c("architecture.featureScopeHint")}),e.jsx("p",{className:"text-xs leading-relaxed text-muted-foreground",children:c(a?"architecture.updateOnly":"architecture.independentHint")})]})]}),e.jsxs("details",{children:[e.jsx("summary",{className:"cursor-pointer py-2 text-xs text-muted-foreground",children:c("architecture.previewPrompt")}),e.jsx("textarea",{readOnly:!0,"aria-label":c("architecture.previewPrompt"),value:O,className:`${W} mt-2 h-52 resize-y font-mono text-xs`})]}),e.jsx("p",{className:"text-xs leading-relaxed text-muted-foreground",children:c("architecture.promptHint")})]}),n&&ne&&e.jsx(vr,{rootPath:r,initialDirectory:oe,initial:_??[],onCancel:()=>be(!1),onConfirm:M=>{h(M.join(`
|
|
9
|
-
`)),be(!1),ce()}})]})}function wr({node:r,view:o,parentId:a,onSelect:d,onExplore:p,onAnalyze:n,onOpenFile:x,onClose:g,document:u,rootPath:c,onEdit:T,onReference:F,embedded:k=!1}){const{t:C,locale:R}=he(),N=[...r.references??[],...u?.perspectives.flatMap(l=>l.nodes.filter(b=>b.references?.some(h=>h.perspective===o.id&&(!h.node||h.node===r.id))).map(b=>({perspective:l.id,node:b.id})))??[]],E=nt(o,a),z=E.edges.filter(l=>l.from===r.id||l.to===r.id),$="inline-flex min-h-11 items-center justify-center gap-1.5 rounded-lg px-3 text-xs font-medium transition hover:bg-surface-elevated focus-visible:ring-2 focus-visible:ring-ring";return e.jsxs("section",{className:k?"space-y-3":"space-y-3 rounded-xl border border-primary/30 bg-surface-2 p-3","aria-label":r.title,children:[!k&&e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsx("h3",{className:"pt-2 text-sm font-semibold",children:r.title}),e.jsx("button",{type:"button",className:`${$} shrink-0 px-2`,"aria-label":C("architecture.closeDetail"),onClick:g,children:e.jsx(Se,{size:16})})]}),e.jsxs(e.Fragment,{children:[!r.description&&e.jsx("p",{className:"whitespace-pre-wrap break-words text-sm leading-relaxed",children:r.summary}),e.jsx(st,{value:r,rootPath:c,onEdit:T,onOpenFile:x})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[o.nodes.some(l=>l.parentId===r.id)&&e.jsxs("button",{type:"button",className:`${$} bg-primary/15 text-primary`,onClick:p,children:[C("architecture.explore"),e.jsx(Te,{size:14})]}),r.files.length>0&&e.jsxs("button",{type:"button",className:`${$} text-primary`,onClick:n,children:[e.jsx(St,{size:14}),C("architecture.analyzeModule")]})]}),N.length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-semibold text-muted-foreground",children:R==="zh"?"跨视角引用":"Cross-perspective references"}),N.map((l,b)=>e.jsxs("button",{type:"button","aria-label":`${R==="zh"?"打开引用":"Open reference"}: ${u?.perspectives.find(h=>h.id===l.perspective)?.nodes.find(h=>h.id===l.node)?.title??u?.perspectives.find(h=>h.id===l.perspective)?.title??l.perspective}`,className:`${$} block w-full text-left text-primary`,onClick:()=>F?.(l),children:[u?.perspectives.find(h=>h.id===l.perspective)?.nodes.find(h=>h.id===l.node)?.title??u?.perspectives.find(h=>h.id===l.perspective)?.title??l.perspective,e.jsx(Te,{size:14})]},b))]}),z.length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"mb-1 text-xs font-semibold text-muted-foreground",children:C("architecture.connections")}),e.jsx("div",{className:"space-y-1",children:z.map((l,b)=>{const h=l.from===r.id,j=E.nodes.find(B=>B.id===(h?l.to:l.from));return j?e.jsxs("button",{type:"button",className:"flex min-h-11 w-full items-center gap-2 rounded-lg bg-surface px-3 py-2 text-left text-xs hover:bg-surface-elevated",onClick:()=>d(j.id),"aria-label":`${C(h?"architecture.outgoing":"architecture.incoming")}: ${j.title} · ${l.label}`,children:[h?e.jsx(Tt,{size:15,className:"shrink-0 text-primary"}):e.jsx(ar,{size:15,className:"shrink-0 text-muted-foreground"}),e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"block font-medium",children:j.title}),e.jsxs("span",{className:"mt-0.5 block break-words text-muted-foreground",children:[C(h?"architecture.outgoing":"architecture.incoming")," · ",l.label]})]}),e.jsx(Te,{size:14,className:"shrink-0"})]},`${l.from}:${l.to}:${b}`):null})})]}),r.files.length>0&&e.jsxs("details",{open:r.files.length<=4,children:[e.jsxs("summary",{className:"min-h-11 cursor-pointer py-3 text-xs font-semibold text-muted-foreground",children:[C("architecture.sourceFiles")," (",r.files.length,")"]}),r.files.map(l=>e.jsxs("button",{type:"button",className:"block min-h-11 w-full break-all rounded-lg px-2 py-2 text-left font-mono text-xs text-primary hover:bg-surface-elevated",onClick:()=>x(l),children:[l.path,l.line?`:${l.line}`:""]},`${l.path}:${l.line??""}`))]})]})}function pt({title:r,stageKey:o,source:a=!1,fullHeight:d=!1,inGraph:p=!1,docked:n=!1,side:x=!1,active:g=!0,onBack:u,backLabel:c,onClose:T,onDismiss:F,onCollapse:k,children:C}){const{t:R}=he(),N=s.useRef(null),E=s.useRef(null),z=s.useRef(new Map);We(N,g&&!p&&(!n||d),F),s.useLayoutEffect(()=>{E.current&&(E.current.scrollTop=z.current.get(o)??0),g&&N.current?.querySelector("button:not(:disabled)")?.focus({preventScroll:!0})},[o,g]);const $=n?d?"relative h-full w-full flex-1":x?"relative h-full w-[22rem] max-w-[40%] shrink-0":"relative h-[48%] max-h-96 w-full shrink-0":p?`${a||d?"inset-0":"inset-x-0 bottom-0 max-h-[48%]"} min-[768px]:inset-y-0 min-[768px]:left-auto min-[768px]:right-0 min-[768px]:max-h-none ${a||d?"min-[768px]:w-[min(50vw,40rem)]":"min-[768px]:w-[22rem]"}`:x?"inset-y-0 right-0 w-[22rem] max-w-full":"inset-0",l="inline-flex min-h-11 shrink-0 items-center justify-center gap-1.5 rounded-lg px-2 text-xs text-primary hover:bg-surface-elevated focus-visible:ring-2 focus-visible:ring-ring",b=()=>{E.current&&z.current.set(o,E.current.scrollTop)};return e.jsxs("aside",{ref:N,tabIndex:-1,role:p||n&&!d?void 0:"dialog","aria-modal":p?void 0:!1,"aria-label":r,"data-architecture-inspector":!0,"data-sidebar-gesture-ignore":!0,onClickCapture:b,className:`${n?"":"absolute"} z-20 flex min-h-0 flex-col overflow-hidden border border-border/30 bg-surface ${n?"":"shadow-xl"} ${$}`,children:[e.jsxs("header",{className:"flex shrink-0 items-center gap-2 border-b border-border/15 px-2 py-1",children:[e.jsxs("button",{type:"button",className:l,"aria-label":u?c:R("architecture.closeDetail"),onClick:u??T,children:[e.jsx(Pt,{size:17}),e.jsx("span",{children:u?c:R("architecture.backToMap")})]}),e.jsx("h2",{className:"min-w-0 flex-1 truncate text-sm font-semibold",title:r,children:r}),k&&e.jsx("button",{type:"button",className:l,"aria-label":R("architecture.collapseDetail"),onClick:k,children:e.jsx(jt,{size:17})}),u&&e.jsx("button",{type:"button",className:l,"aria-label":R("architecture.closeDetail"),onClick:T,children:e.jsx(Se,{size:17})})]}),e.jsx("div",{ref:E,onScroll:b,className:`min-h-0 flex-1 ${a?"overflow-hidden":"overflow-y-auto overscroll-contain p-3"}`,children:C})]})}function Nr({node:r,onExpand:o,onClose:a}){const{t:d}=he(),p=s.useRef(null),n=s.useRef(null);s.useLayoutEffect(()=>{document.activeElement!==p.current&&(n.current=document.activeElement),p.current?.focus({preventScroll:!0})},[r.id]),s.useLayoutEffect(()=>()=>{n.current?.isConnected&&n.current.focus({preventScroll:!0})},[]);const x="inline-flex min-h-11 shrink-0 items-center justify-center rounded-lg px-2 text-xs hover:bg-surface-elevated focus-visible:ring-2 focus-visible:ring-ring";return e.jsxs("section",{ref:p,tabIndex:-1,"aria-label":r.title,"data-architecture-inspector":!0,"data-sidebar-gesture-ignore":!0,className:"shrink-0 border-t border-border/30 bg-surface px-3 pb-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"min-w-0 flex-1 truncate text-sm font-semibold",title:r.title,children:r.title}),e.jsx("button",{type:"button",className:`${x} text-primary`,onClick:o,children:d("architecture.expandDetail")}),e.jsx("button",{type:"button",className:x,"aria-label":d("architecture.closeDetail"),onClick:a,children:e.jsx(Se,{size:17})})]}),e.jsx("p",{className:"line-clamp-2 break-words text-xs leading-relaxed text-muted-foreground",children:r.summary})]})}function it(r){return`termdock.architecture.selection:${r}`}function ft(r){try{const o=r?sessionStorage.getItem(it(r)):null;return o&&Je(o)?o:fe}catch{return fe}}function bt(r){try{const o=r?sessionStorage.getItem(it(r)):null;return!!o&&Je(o)}catch{return!1}}function Ir({rootPath:r,active:o,onInsertPrompt:a,onOpenFile:d,renderSource:p}){const{t:n,locale:x}=he(),g=et(t=>t.rootPath===r?t.selectedFilePath:null),u=et(t=>t.rootPath===r?t.explorerRoot:null),[c,T]=s.useState(()=>ft(r)),[F,k]=s.useState([]),[C,R]=s.useState(!1),[N,E]=s.useState(Ae),[z,$]=s.useState(null),[l,b]=s.useState(null),[h,j]=s.useState(!0),[B,f]=s.useState(null),[H,P]=s.useState(0),[q,Q]=s.useState(!1),[A,ne]=s.useState(!1),[be,V]=s.useState(""),[_,ee]=s.useState([]),[ie,oe]=s.useState(null),[ae,xe]=s.useState([]),[v,O]=s.useState(null),[K,le]=s.useState(null),[Z,W]=s.useState(null),[ce,ue]=s.useState(null),[se,M]=s.useState(!1),[X,U]=s.useState(!1),[Ce,Ie]=s.useState(()=>typeof window<"u"&&window.innerWidth>=768),i=s.useRef(0),S=s.useRef(bt(r)),m=s.useRef(null),D=s.useRef(null),[w,J]=s.useState(0),[ge,me]=s.useState("auto"),Y=ge==="auto"?w>=560?"graph":"outline":ge,ve=s.useRef(null),pe=t=>{S.current=!0,T(t);try{r&&sessionStorage.setItem(it(r),t)}catch{}},ze=()=>{$(null),ve.current?.focus({preventScroll:!0})};s.useEffect(()=>{const t=()=>Ie(window.innerWidth>=768);return window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[]),s.useEffect(()=>{const t=m.current;if(!t||!o||typeof ResizeObserver>"u")return;const y=()=>{t.clientWidth>0&&J(t.clientWidth)};y();const I=new ResizeObserver(y);return I.observe(t),()=>I.disconnect()},[o]),s.useEffect(()=>{b(null),f(null),j(!0),ne(!1),V(""),ee([]),re(),$(null),T(ft(r)),k([]),R(!1),E(Ae),S.current=bt(r)},[r]),s.useEffect(()=>{b(null),f(null),j(!0),ne(!1),V(""),ee([]),re()},[c]),s.useEffect(()=>{if(!o||!r)return;let t=!1,y=null,I;const G=async Fe=>{const Ye=++i.current,_e=new AbortController;y=_e,Fe&&(j(!0),f(null));const Et=window.setTimeout(()=>_e.abort(),15e3);try{const[ke,Le]=await Promise.allSettled([gr(r,_e.signal,c),yr(r,_e.signal)]);if(t||i.current!==Ye)return;if(Le.status==="fulfilled"?(k(Le.value),R(!1)):R(!0),ke.status==="rejected")throw ke.reason;b(dt=>JSON.stringify(dt)===JSON.stringify(ke.value)?dt:ke.value),f(null),!ke.value&&c===fe&&!S.current&&Le.status==="fulfilled"&&Le.value.length===1&&pe(Le.value[0])}catch(ke){if(t||i.current!==Ye)return;f(ke instanceof Nt?"format":"load")}finally{window.clearTimeout(Et),!t&&i.current===Ye&&(j(!1),I=setTimeout(()=>{t||G(!1)},1e4))}};return G(!0),()=>{t=!0,++i.current,y?.abort(),clearTimeout(I)}},[r,o,H,c]);const at=JSON.stringify(r?[...new Set([`${r}/.termdock`,`${r}/.termdock/architectures`,`${r}/.omm`,...c===".omm"?l?.perspectives.flatMap(t=>[`${r}/.omm/${t.id}`,...t.nodes.flatMap(y=>y.documentPath?[`${r}/.omm/${y.documentPath}`]:[])])??[]:[]])].slice(0,128).sort():[]);s.useEffect(()=>{if(!o||!r)return;const t=new AbortController;let y;return It(JSON.parse(at),I=>{I.some(G=>G.type==="rescan-required"||G.path?.includes("/.omm/")||G.path?.includes("/.termdock/"))&&(clearTimeout(y),y=setTimeout(()=>P(G=>G+1),300))},t.signal).catch(()=>{}),()=>{t.abort(),clearTimeout(y)}},[r,o,at]);const L=l?.perspectives.find(t=>t.id===be)??l?.perspectives[0],Re=s.useMemo(()=>l?or(l,x==="zh"?"全部视角":"All perspectives"):null,[l,x]),Ve=t=>{t==="all-perspectives"?(ne(!0),Ne([])):(ne(!1),V(t),Ne([]))},we=s.useMemo(()=>{const t=[];for(const y of _){if(!L?.nodes.some(I=>I.id===y&&I.parentId===t[t.length-1]))break;t.push(y)}return t},[_,L]),Oe=we[we.length-1],He=s.useMemo(()=>L?nt(L,Oe):null,[L,Oe]),te=L?.nodes.find(t=>t.id===ie),ye=L?.nodes.find(t=>t.id===Oe),Ct=[...new Set([fe,...F,c])],Be=l?.analysis??(c===fe||c===".omm"?Ae:N.kind==="project"?null:N),re=()=>{Q(!1),O(null),oe(null),U(!1),xe([]),le(null),W(null),ue(null)},Me=(t,y=!1)=>{xe(I=>y&&ie?[...I,ie]:[]),U(y),Q(!1),O(null),le(null),W(null),ue(null),oe(t)},Ne=t=>{t.length&&ne(!1),ee(t),re(),D.current&&(D.current.scrollTop=0)},lt=t=>{p?(U(!0),le(t)):d(t)},zt=t=>{W({...Ae,kind:"module",paths:[...new Set(t.files.map(y=>y.path))].slice(0,20)}),ue(null)},ct=v?()=>O(null):K?()=>le(null):Z?()=>W(null):ae.length?()=>{oe(ae[ae.length-1]),xe(t=>t.slice(0,-1))}:void 0,Rt=n(K||Z||v?"architecture.backToModule":"architecture.previousModule"),Ee=se?Ce:w>=900,Ke=!Ee&&!X&&!K&&!Z&&!v,De=!se&&(!!te||q)&&(!!K||!!Z||!!v||Y==="outline"),Xe=t=>{const y=[];let I=L?.nodes.find(G=>G.id===t);for(;I?.parentId;)y.unshift(I.parentId),I=L?.nodes.find(G=>G.id===I.parentId);return y},ot=t=>{const y=l?.perspectives.find(I=>I.id===t.perspective);if(y)if(re(),V(y.id),t.node){const I=[];let G=y.nodes.find(Fe=>Fe.id===t.node);for(;G?.parentId;)I.unshift(G.parentId),G=y.nodes.find(Fe=>Fe.id===G.parentId);ee(I),oe(t.node),U(!0)}else ee([]),Q(!0)},de="inline-flex min-h-11 items-center justify-center gap-1.5 rounded-lg px-3 text-xs font-medium transition hover:bg-surface-elevated focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-40",Ze=Ke?re:ct??(!Ee&&Y==="graph"?()=>U(!1):re),ut=t=>q&&L?e.jsx(pt,{active:o,docked:!0,title:L.title,stageKey:`${L.id}:${v?"edit":"view-document"}`,source:!1,fullHeight:De||!!v,inGraph:t,side:Ee,onBack:v?()=>O(null):void 0,backLabel:n("architecture.backToModule"),onClose:re,onDismiss:v?()=>O(null):re,children:v?e.jsx(Qe,{root:r,file:c,perspective:L.id,initialField:v.field,onSaved:y=>{++i.current,b(y),O(null),P(I=>I+1)},onCancel:()=>O(null)}):e.jsxs(e.Fragment,{children:[e.jsx(st,{value:L,rootPath:r,onEdit:y=>O({field:y}),onOpenFile:d}),e.jsx("button",{type:"button",className:`${de} text-primary`,onClick:()=>{ne(!1),Ne([])},children:x==="zh"?"进入此视角":"Explore this perspective"})]})}):te&&((t||Y==="graph")&&Ke?e.jsx(Nr,{node:te,onExpand:()=>U(!0),onClose:re}):e.jsx(pt,{active:o&&!Z,docked:!t||!K&&!Z,title:te.title,stageKey:`${te.id}:${K?`${K.path}:${K.line}`:Z?"analysis":v?`edit:${v.field}`:"details"}`,source:!!K,fullHeight:t?!!Z||!!v:De,inGraph:t,side:Ee,onBack:ct,backLabel:Rt,onClose:re,onDismiss:Ze,onCollapse:!Ee&&!De&&!K&&!Z&&!v?()=>U(!1):void 0,children:v?e.jsx(Qe,{root:r,file:c,perspective:L.id,node:v.node,initialField:v.field,onSaved:y=>{++i.current,b(y),O(null),P(I=>I+1)},onCancel:()=>O(null)},`${c}:${L.id}:${v.node??"view"}:${v.field}`):K&&p?p(K):Z?e.jsxs(e.Fragment,{children:[e.jsx(xt,{active:o,rootPath:r,currentFile:g,currentDirectory:u,initial:Z,onInsertPrompt:a,onPrepared:ue,onClose:()=>W(null)},te.id),ce&&e.jsx("button",{type:"button",className:`${de} mt-3 bg-primary/15 text-primary`,onClick:()=>{E(Z),pe(ce),re()},children:n("architecture.viewPrepared")})]}):e.jsx(wr,{embedded:!0,document:l,rootPath:r,onReference:ot,onEdit:y=>{U(!0),O({node:te.id,field:y})},node:te,view:L,parentId:te.parentId,onSelect:y=>Me(y,!0),onExplore:()=>Ne([...Xe(te.id),te.id]),onAnalyze:()=>zt(te),onOpenFile:lt,onClose:re})}));return r?e.jsxs("div",{ref:m,className:"relative flex h-full min-h-0 flex-col",onKeyDown:t=>{!se&&(te||q)&&t.key==="Escape"&&!t.defaultPrevented&&!t.nativeEvent.isComposing&&(t.preventDefault(),t.stopPropagation(),Ze())},children:[e.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border/15 px-3 py-2",children:[e.jsxs("span",{className:"flex items-center gap-2 text-sm font-semibold",children:[e.jsx(mt,{size:16}),n("architecture.title")]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsxs("button",{ref:ve,type:"button",className:de,disabled:!Be,onClick:()=>{Be&&(re(),$(z?null:{initial:Be,...l?{outputFile:c}:{}}))},"aria-expanded":!!z,children:[e.jsx(St,{size:14}),n(l?"architecture.update":"architecture.generate")]}),(l||c!==fe)&&e.jsx("button",{type:"button",className:`${de} px-2`,"aria-label":n("architecture.newAnalysis"),onClick:()=>{re(),$({initial:Ae})},children:e.jsx(yt,{size:16})}),e.jsx("button",{type:"button",className:`${de} px-2`,"aria-label":n("architecture.refresh"),disabled:h,onClick:()=>P(t=>t+1),children:e.jsx(kt,{size:15,className:h?"animate-spin":""})})]})]}),e.jsxs("div",{className:`relative flex min-h-0 flex-1 ${Ee&&!De?"flex-row":"flex-col"}`,"data-architecture-workspace":!0,children:[e.jsx("div",{ref:D,hidden:De,"data-architecture-content":!0,className:`min-h-0 min-w-0 flex-1 overflow-y-auto p-3 [overflow-anchor:none] ${z?"flex flex-col":""}`,children:v&&!te&&!q?e.jsxs("div",{className:"flex min-h-full flex-col gap-3",children:[e.jsx("h2",{className:"text-sm font-semibold",children:L?.title}),e.jsx(Qe,{root:r,file:c,perspective:L.id,initialField:v.field,onSaved:t=>{++i.current,b(t),O(null),P(y=>y+1)},onCancel:()=>O(null)},`${c}:${L?.id}:${v.field}`)]}):z?e.jsx(xt,{active:o,rootPath:r,currentFile:g,currentDirectory:u,initial:z.initial,outputFile:z.outputFile,onInsertPrompt:a,onPrepared:(t,y)=>{E(y),pe(t)},onClose:ze},`${z.outputFile??"new"}:${JSON.stringify(z.initial)}`):e.jsxs(e.Fragment,{children:[e.jsxs("label",{className:"mb-3 flex items-center gap-2 text-xs text-muted-foreground",children:[n("architecture.savedAnalyses"),e.jsx("select",{"aria-label":n("architecture.savedAnalyses"),value:c,onChange:t=>{E(Ae),pe(t.target.value)},className:"min-h-10 min-w-0 flex-1 rounded-lg border border-border/20 bg-surface-2 px-2 text-sm text-foreground",children:Ct.map(t=>e.jsx("option",{value:t,children:t===".omm"?".omm · oh-my-mermaid":t===fe?n("architecture.projectRange"):`${n(t.includes("/module-")?"architecture.moduleRange":"architecture.featureRange")}: ${t===c&&l?.analysis?l.analysis.target.replace(/\n/g,", "):Yt(t)}`},t))})]}),C&&e.jsx("p",{role:"alert",className:"mb-3 text-xs text-muted-foreground",children:n("architecture.libraryFailed")}),h&&!l&&e.jsx("p",{role:"status",className:"py-4 text-sm text-muted-foreground",children:n("architecture.loading")}),B&&e.jsxs("div",{role:"alert",className:"mb-3 rounded-lg border border-destructive/30 p-3 text-sm",children:[e.jsx("p",{children:n(B==="format"?"architecture.invalid":"architecture.loadFailed")}),l&&e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:n("architecture.previous")}),e.jsx("button",{type:"button",className:`${de} mt-2 bg-surface-2`,onClick:()=>P(t=>t+1),children:n("architecture.retry")})]}),!h&&!B&&!l&&e.jsxs("div",{className:"flex flex-col items-center gap-3 px-4 py-8 text-center",children:[e.jsx(mt,{size:32,className:"text-muted-foreground"}),e.jsx("h2",{className:"text-base font-medium",children:n("architecture.empty")}),e.jsx("p",{className:"max-w-sm text-sm leading-relaxed text-muted-foreground",children:n(c===fe?"architecture.emptyHint":"architecture.awaitingFile")})]}),l&&L&&He&&e.jsxs("div",{className:"space-y-3",children:[!Be&&e.jsx("p",{className:"text-xs text-muted-foreground",children:n("architecture.scopeUnavailable")}),l.analysis&&e.jsxs("p",{className:"break-words text-xs text-muted-foreground",children:[n(`architecture.${l.analysis.kind}Range`),l.analysis.target?` · ${l.analysis.target.replace(/\n/g,", ")}`:""," · ",n(l.analysis.depth==="boundary"?"architecture.boundaryDepth":"architecture.followDepth")]}),l.summary.length<=240&&e.jsx("p",{className:"whitespace-pre-wrap break-words text-sm leading-relaxed text-muted-foreground",children:l.summary}),e.jsxs("label",{className:"sticky -top-3 z-10 !mt-0 -mx-3 flex items-center gap-2 bg-surface px-3 py-2 text-xs text-muted-foreground",children:[n("architecture.perspective"),e.jsxs("select",{"aria-label":n("architecture.perspective"),value:A?"all-perspectives":L.id,onChange:t=>Ve(t.target.value),className:"min-h-11 min-w-0 flex-1 rounded-lg border border-border/20 bg-surface-2 px-2 text-sm text-foreground",children:[e.jsx("option",{value:"all-perspectives",children:x==="zh"?"全部视角":"All perspectives"}),l.perspectives.map(t=>e.jsx("option",{value:t.id,children:t.title},t.id))]})]}),we.length>0&&e.jsxs("nav",{className:"flex flex-wrap items-center gap-1 text-xs","aria-label":n("architecture.breadcrumb"),children:[e.jsx("button",{type:"button",className:`${de} px-2`,onClick:()=>Ne([]),children:L.title}),we.map((t,y)=>e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(Te,{size:12}),e.jsx("button",{type:"button",className:`${de} px-2`,onClick:()=>Ne(we.slice(0,y+1)),children:L.nodes.find(I=>I.id===t)?.title})]},t))]}),e.jsx("p",{className:"line-clamp-3 whitespace-pre-wrap break-words text-sm leading-relaxed text-muted-foreground",children:ye?.summary??L.summary}),e.jsxs("details",{children:[e.jsx("summary",{className:"min-h-11 cursor-pointer py-3 text-xs text-muted-foreground",children:x==="zh"?"视角文档与模块目录":"Perspective documents and module tree"}),e.jsx(st,{value:ye??L,rootPath:r,onOpenFile:lt,onEdit:t=>{ye?(oe(ye.id),U(!0),O({node:ye.id,field:t})):O({field:t})}}),e.jsx("nav",{"aria-label":x==="zh"?"模块目录":"Module tree",className:"my-2 border-l border-border/20",children:L.nodes.map(t=>e.jsx("button",{type:"button","aria-label":`${x==="zh"?"定位模块":"Go to module"}: ${t.title}`,className:`${de} flex w-full justify-start text-left ${ie===t.id?"text-primary":""}`,style:{paddingInlineStart:12+Xe(t.id).length*16},onClick:()=>{ee(Xe(t.id)),Me(t.id),U(!0)},children:t.title},t.id))})]}),e.jsx("div",{role:"group","aria-label":n("architecture.browseMode"),className:"flex gap-1 rounded-lg bg-surface-2 p-1",children:["outline","graph"].map(t=>e.jsx("button",{type:"button","aria-pressed":Y===t,className:`${de} flex-1 ${Y===t?"bg-surface text-primary":"text-muted-foreground"}`,onClick:()=>me(t),children:n(t==="outline"?"architecture.outlineMode":"architecture.graphMode")},t))}),Y==="graph"?e.jsxs(e.Fragment,{children:[e.jsx(jr,{view:A&&Re?Re.view:L,parentId:A?void 0:Oe,selectedId:A&&Re?[...Re.references].find(([,t])=>t.perspective===L.id&&t.node===ie)?.[0]??null:ie,onSelect:t=>{if(A&&Re){const y=Re.references.get(t);y&&ot(y)}else Me(t)},active:o,referenceWidth:w,inspector:ut(!0),inspectorStage:K?"source":Z||v?"analysis":Ke?"preview":"details",onDismissInspector:q?v?()=>O(null):re:Ze,onExpandedChange:t=>{M(t),!t&&se&&re()},heading:e.jsxs("div",{className:"relative",children:[e.jsxs("select",{"aria-label":n("architecture.perspective"),title:L.title,value:A?"all-perspectives":L.id,onChange:t=>Ve(t.target.value),className:"h-11 w-full min-w-0 appearance-none truncate bg-surface pr-4 text-xs font-semibold focus-visible:ring-2 focus-visible:ring-ring",children:[e.jsx("option",{value:"all-perspectives",children:x==="zh"?"全部视角":"All perspectives"}),l.perspectives.map(t=>e.jsx("option",{value:t.id,children:t.title},t.id))]}),e.jsx(jt,{size:12,className:"pointer-events-none absolute right-0 top-1/2 -translate-y-1/2 text-muted-foreground"})]}),navigation:we.length>0?e.jsxs("nav",{"aria-label":n("architecture.breadcrumb"),className:"flex items-center gap-1 px-2",children:[e.jsx("button",{type:"button",className:`${de} shrink-0 px-2`,onClick:()=>Ne(we.slice(0,-1)),children:n("architecture.parentModule")}),e.jsxs("span",{className:"truncate text-xs text-muted-foreground",children:[L.title," / ",ye?.title]})]}):void 0}),e.jsxs("details",{children:[e.jsxs("summary",{className:"min-h-11 cursor-pointer py-3 text-xs text-muted-foreground",children:[n("architecture.modules")," (",He.nodes.length,")"]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:He.nodes.map(t=>e.jsx("button",{type:"button","aria-pressed":te?.id===t.id,className:`${de} bg-surface-2`,onClick:()=>Me(t.id),children:t.title},t.id))})]})]}):e.jsx("div",{className:"space-y-2",role:"group","aria-label":n("architecture.modules"),children:A?l.perspectives.map(t=>e.jsxs("button",{type:"button",className:"block min-h-16 w-full rounded-xl bg-surface-2 p-3 text-left",onClick:()=>Ve(t.id),children:[e.jsx("span",{className:"text-sm font-medium",children:t.title}),e.jsx("span",{className:"mt-1 block text-xs text-muted-foreground",children:t.summary})]},t.id)):He.nodes.map(t=>e.jsx("div",{children:e.jsxs("button",{type:"button","aria-label":t.title,"aria-expanded":te?.id===t.id,className:"block min-h-16 w-full rounded-xl border border-border/20 bg-surface-2 p-3 text-left transition hover:bg-surface-elevated focus-visible:ring-2 focus-visible:ring-ring",onClick:()=>Me(t.id),children:[e.jsxs("span",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-sm font-medium",children:t.title}),e.jsx(Te,{size:16,className:"shrink-0 text-muted-foreground"})]}),e.jsx("span",{className:"mt-1.5 line-clamp-2 break-words text-xs leading-relaxed text-muted-foreground",children:t.summary})]})},t.id))}),e.jsxs("details",{className:"rounded-lg border border-border/15 px-3",children:[e.jsxs("summary",{className:"min-h-11 cursor-pointer py-3 text-xs text-muted-foreground",children:[n("architecture.analysisNotes")," · ",n("architecture.savedAt")," ",new Date(l.generatedAt).toLocaleString(x==="zh"?"zh-CN":"en-US")]}),e.jsxs("div",{className:"space-y-3 pb-3",children:[l.summary.length>240&&e.jsx("p",{className:"whitespace-pre-wrap break-words text-sm leading-relaxed text-muted-foreground",children:l.summary}),l.details?.limitations.length?e.jsxs("div",{children:[e.jsx("h3",{className:"mb-1 text-xs font-semibold",children:n("architecture.limitations")}),e.jsx("ul",{className:"list-disc space-y-1 pl-4 text-xs leading-relaxed text-muted-foreground",children:l.details.limitations.map((t,y)=>e.jsx("li",{children:t},y))})]}):null,l.details?.analyzedPaths.length?e.jsxs("details",{children:[e.jsxs("summary",{className:"min-h-11 cursor-pointer py-3 text-xs text-muted-foreground",children:[n("architecture.analyzedPaths")," (",l.details.analyzedPaths.length,")"]}),l.details.analyzedPaths.map(t=>e.jsx("button",{type:"button",className:"block min-h-11 w-full break-all rounded px-2 py-2 text-left font-mono text-xs text-primary hover:bg-surface-elevated",onClick:()=>d({path:t}),children:t},t))]}):null]})]}),ye&&ye.files.length>0&&e.jsxs("details",{children:[e.jsx("summary",{className:"cursor-pointer py-2 text-xs text-muted-foreground",children:n("architecture.sourceFiles")}),ye.files.map(t=>e.jsxs("button",{type:"button",className:"block min-h-10 w-full break-all rounded px-2 py-2 text-left font-mono text-xs text-primary hover:bg-surface-2",onClick:()=>d(t),children:[t.path,t.line?`:${t.line}`:""]},`${t.path}:${t.line??""}`))]})]}),e.jsx(br,{root:r,file:c,document:l,onLoaded:(t,y)=>{pe(t),b(y),P(I=>I+1)}})]})}),o&&!se&&ut(!1)]})]}):e.jsx("p",{className:"p-5 text-sm text-muted-foreground",children:n("fileTree.noWorkingDir")})}export{Ir as ArchitecturePanel};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{bx as r}from"./app-Bey8S6UU.js";import{b as m}from"./dnd-BCFAPC0L.js";import{b as n}from"./RightSidebar-DSH93gN5.js";import"./react-XDCjal2T.js";import"./terminal-C7X98Amf.js";import"./App-CytIMrFr.js";import"./gestureArbiter-BuNZMZ7A.js";import"./triangle-alert-Bdf_dBch.js";import"./referenceLongPress-CAzWqXsY.js";import"./DiffReview-C8e2GQxb.js";import"./sparkles-DQGLdN2b.js";import"./DiffViewer-KljgMa9h.js";import"./ChangeWalkthroughPanel-Bm9Tvd6H.js";function g({content:o}){const e=m.useMemo(()=>n(o.split(`
|
|
2
|
-
`),null,null),[o]);return r.jsx("div",{className:"min-w-0 space-y-3 break-words text-sm leading-6 text-foreground [&_h1]:text-lg [&_h2]:text-base [&_h3]:text-sm [&_pre]:max-w-full [&_table]:text-xs",children:e.map((t,i)=>r.jsx("div",{className:"min-w-0",children:typeof t.content=="function"?t.content(null):t.content},i))})}export{g as default};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|