termdock 1.4.310 → 1.4.311
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/collaborationCli.js +6 -4
- package/dist/server/agent/collaborationDeliveryWorker.js +3 -97
- package/dist/server/agent/collaborationTmuxDelivery.js +23 -51
- 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 +8 -12
- package/docs/integrations.md +5 -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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { plainCollaborationSnapshot } from './collaborationText.js';
|
|
2
|
-
import { normalizePromptForPaste } from './promptDelivery.js';
|
|
2
|
+
import { normalizePromptForPaste, waitForPromptSubmit } from './promptDelivery.js';
|
|
3
3
|
const TMUX_KEY_NAMES = {
|
|
4
4
|
enter: 'Enter', escape: 'Escape', space: 'Space', left: 'Left', right: 'Right', up: 'Up', down: 'Down',
|
|
5
5
|
};
|
|
@@ -19,26 +19,9 @@ const APPROVAL_DIALOG_PATTERNS = [
|
|
|
19
19
|
/\b1\.\s*是\b/,
|
|
20
20
|
/允许.*执行|确认.*执行/i,
|
|
21
21
|
];
|
|
22
|
-
/** Agent TUIs collapse pasted input in the input box to a marker line like
|
|
23
|
-
* "[Pasted text #3 +42 lines]". While the paste sits unsubmitted the marker
|
|
24
|
-
* stays on screen; a submitted paste clears the box and only the transcript
|
|
25
|
-
* holds the content. Session-unique #N lets us diff screen captures. */
|
|
26
|
-
const PASTE_MARKER_PATTERN = /\[Pasted text #(\d+)/g;
|
|
27
22
|
export function detectApprovalDialog(content) {
|
|
28
23
|
return APPROVAL_DIALOG_PATTERNS.some((pattern) => pattern.test(content));
|
|
29
24
|
}
|
|
30
|
-
/** Paste marker sequence numbers visible in a screen capture. */
|
|
31
|
-
export function extractPasteMarkerNumbers(content) {
|
|
32
|
-
return new Set([...content.matchAll(PASTE_MARKER_PATTERN)].map((match) => Number(match[1])));
|
|
33
|
-
}
|
|
34
|
-
/** True when `after` shows a paste marker that was not in `before`. Diffing
|
|
35
|
-
* prevents a recovery Enter from submitting a stale paste that predates this
|
|
36
|
-
* delivery (or someone else's draft): we only ever submit what we just put
|
|
37
|
-
* there, at most once per delivery. */
|
|
38
|
-
export function hasNewPasteMarker(after, before) {
|
|
39
|
-
const beforeNumbers = extractPasteMarkerNumbers(before);
|
|
40
|
-
return [...extractPasteMarkerNumbers(after)].some((number) => !beforeNumbers.has(number));
|
|
41
|
-
}
|
|
42
25
|
async function assertSamePane(run, pane) {
|
|
43
26
|
const identity = (await run(['display-message', '-p', '-t', pane.paneId,
|
|
44
27
|
'#{pid}:#{session_id}:#{pane_id}:#{pane_pid}'])).trim();
|
|
@@ -48,15 +31,19 @@ async function assertSamePane(run, pane) {
|
|
|
48
31
|
/** Unique-per-process buffer name so concurrent deliveries to different panes
|
|
49
32
|
* never share (or clobber) a buffer. */
|
|
50
33
|
let bufferSequence = 0;
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
34
|
+
const paneWrites = new Map();
|
|
35
|
+
/** Serialize TD paste/submit pairs for this exact runtime pane. */
|
|
36
|
+
export function writeCollaborationTmuxPane(run, pane, prompt, stdin) {
|
|
37
|
+
const key = `${pane.serverPid}:${pane.sessionId}:${pane.paneId}:${pane.panePid}`;
|
|
38
|
+
const previous = paneWrites.get(key) ?? Promise.resolve();
|
|
39
|
+
const operation = previous.catch(() => undefined).then(() => writeTmuxPrompt(run, pane, prompt, stdin))
|
|
40
|
+
.finally(() => { if (paneWrites.get(key) === operation)
|
|
41
|
+
paneWrites.delete(key); });
|
|
42
|
+
paneWrites.set(key, operation);
|
|
43
|
+
return operation;
|
|
44
|
+
}
|
|
45
|
+
async function writeTmuxPrompt(run, pane, prompt,
|
|
46
|
+
/** Body travels on stdin so tmux cannot parse its semicolons/backslashes. */
|
|
60
47
|
stdin) {
|
|
61
48
|
await assertSamePane(run, pane);
|
|
62
49
|
// A fixed pane target is independent of the current window, keyboard focus
|
|
@@ -77,13 +64,8 @@ stdin) {
|
|
|
77
64
|
// every tmux version.
|
|
78
65
|
const buffer = `termdock-collab-${process.pid}-${bufferSequence++}`;
|
|
79
66
|
try {
|
|
80
|
-
//
|
|
81
|
-
//
|
|
82
|
-
// client's paste can interleave between our text and our submit CR
|
|
83
|
-
// (measured: one contiguous block, 0ms apart, versus two invocations
|
|
84
|
-
// ~14ms apart). A failing step stops the rest — verified on 3.4 and 3.7 —
|
|
85
|
-
// which is the safe direction: a failed text paste is never followed by a
|
|
86
|
-
// bare CR into whatever the input box already held.
|
|
67
|
+
// Paste once, then send one unbracketed CR after 50ms. No screen parsing,
|
|
68
|
+
// Agent-specific recovery, consumption confirmation or additional Enter.
|
|
87
69
|
await stdin([
|
|
88
70
|
// The body arrives on stdin, not argv: it is user content, and in a
|
|
89
71
|
// `\;` chain argv is a language where `;` and `\` mean something.
|
|
@@ -91,13 +73,17 @@ stdin) {
|
|
|
91
73
|
// -r keeps LF as LF rather than the separator default of CR. The
|
|
92
74
|
// normalizer already folded every line break to CR, so no LF is left
|
|
93
75
|
// for it to rewrite — the flag is insurance, not the mechanism.
|
|
94
|
-
'paste-buffer', '-p', '-r', '-d', '-b', buffer, '-t', pane.paneId,
|
|
76
|
+
'paste-buffer', '-p', '-r', '-d', '-b', buffer, '-t', pane.paneId,
|
|
77
|
+
], normalizePromptForPaste(prompt));
|
|
78
|
+
await waitForPromptSubmit();
|
|
79
|
+
await assertSamePane(run, pane);
|
|
80
|
+
await run([
|
|
95
81
|
// The submit key rides outside the paste block: inside it, an editor
|
|
96
82
|
// inserts a pasted CR as text instead of acting on it. Pasting the bare
|
|
97
83
|
// CR (no -p) keeps the key in the same mode-proof channel as the text.
|
|
98
84
|
'set-buffer', '-b', buffer, '--', '\r', ';',
|
|
99
85
|
'paste-buffer', '-d', '-b', buffer, '-t', pane.paneId,
|
|
100
|
-
]
|
|
86
|
+
]);
|
|
101
87
|
}
|
|
102
88
|
finally {
|
|
103
89
|
// -d consumed the buffer on the happy path; this sweeps up after a failed
|
|
@@ -139,21 +125,7 @@ export async function approveCollaborationDialog(run, pane) {
|
|
|
139
125
|
await sendTmuxPaneKey(run, pane, 'enter');
|
|
140
126
|
return true;
|
|
141
127
|
}
|
|
142
|
-
/**
|
|
143
|
-
* turn and is still sitting unsubmitted in the input box. Only acts on
|
|
144
|
-
* differential evidence — a paste marker that appeared after the write —
|
|
145
|
-
* never on pre-existing stale markers, and returns whether Enter was sent.
|
|
146
|
-
* Committing the whole input buffer is safe: each delivery is written once,
|
|
147
|
-
* so each marker's content enters the transcript exactly once. */
|
|
148
|
-
export async function recoverStuckPaste(run, pane, baseline) {
|
|
149
|
-
const viewport = await captureTmuxPaneText(run, pane);
|
|
150
|
-
if (!hasNewPasteMarker(viewport, baseline))
|
|
151
|
-
return false;
|
|
152
|
-
await sendTmuxPaneKey(run, pane, 'enter');
|
|
153
|
-
return true;
|
|
154
|
-
}
|
|
155
|
-
/** History-inclusive pane text (scrollback + viewport) used to confirm a
|
|
156
|
-
* delivery was actually rendered by the agent, not wiped by a boot clear. */
|
|
128
|
+
/** History-inclusive terminal observation, without inferring consumption. */
|
|
157
129
|
export async function captureTmuxPaneHistory(run, pane, lines = 800, rawOutput = false) {
|
|
158
130
|
await assertSamePane(run, pane);
|
|
159
131
|
if (!Number.isInteger(lines) || lines < 1 || lines > 10000)
|
|
@@ -8,13 +8,26 @@
|
|
|
8
8
|
export function normalizePromptForPaste(prompt) {
|
|
9
9
|
return prompt.replace(/\r\n|\r|\n/g, '\r').replace(/\x1b/g, '␛');
|
|
10
10
|
}
|
|
11
|
-
/**
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export function
|
|
17
|
-
return `\x1b[200~${normalizePromptForPaste(prompt)}\x1b[201
|
|
11
|
+
/** Separate the paste and its single unbracketed CR by 50ms. */
|
|
12
|
+
export const PROMPT_SUBMIT_DELAY_MS = 50;
|
|
13
|
+
export function waitForPromptSubmit() {
|
|
14
|
+
return new Promise((resolve) => setTimeout(resolve, PROMPT_SUBMIT_DELAY_MS));
|
|
15
|
+
}
|
|
16
|
+
export function buildBracketedPasteBytes(prompt) {
|
|
17
|
+
return `\x1b[200~${normalizePromptForPaste(prompt)}\x1b[201~`;
|
|
18
|
+
}
|
|
19
|
+
const promptWrites = new WeakMap();
|
|
20
|
+
/** Serialize TD prompt pairs per PTY. Success only records terminal writes. */
|
|
21
|
+
export function writeBracketedPrompt(target, prompt) {
|
|
22
|
+
const previous = promptWrites.get(target) ?? Promise.resolve();
|
|
23
|
+
const operation = previous.catch(() => undefined).then(async () => {
|
|
24
|
+
target.write(buildBracketedPasteBytes(prompt));
|
|
25
|
+
await waitForPromptSubmit();
|
|
26
|
+
target.write('\r');
|
|
27
|
+
}).finally(() => { if (promptWrites.get(target) === operation)
|
|
28
|
+
promptWrites.delete(target); });
|
|
29
|
+
promptWrites.set(target, operation);
|
|
30
|
+
return operation;
|
|
18
31
|
}
|
|
19
32
|
/**
|
|
20
33
|
* Process detection and hook events are independent Agent signals. A target is
|
|
@@ -29,6 +29,19 @@ Fields: description, diagram, context, constraint, concern, todo, note.
|
|
|
29
29
|
Examples: td architecture prompt --project .
|
|
30
30
|
td architecture write --format omm overall-architecture/auth description -
|
|
31
31
|
td architecture save --file .termdock/architecture.json -`;
|
|
32
|
+
function elementPath(view, node) {
|
|
33
|
+
if (!node)
|
|
34
|
+
return view.id;
|
|
35
|
+
if (node.documentPath)
|
|
36
|
+
return node.documentPath;
|
|
37
|
+
const parts = [node.id];
|
|
38
|
+
let parent = node.parentId;
|
|
39
|
+
while (parent) {
|
|
40
|
+
parts.unshift(parent);
|
|
41
|
+
parent = view.nodes.find(item => item.id === parent)?.parentId;
|
|
42
|
+
}
|
|
43
|
+
return [view.id, ...parts].join('/');
|
|
44
|
+
}
|
|
32
45
|
function target(document, element) {
|
|
33
46
|
const [perspective, ...parts] = element.split('/');
|
|
34
47
|
const view = document.perspectives.find(view => view.id === perspective);
|
|
@@ -78,10 +91,14 @@ export async function runArchitectureCli(args, io = { write: value => process.st
|
|
|
78
91
|
if (options.format && !['native', 'omm'].includes(options.format))
|
|
79
92
|
throw new Error('Format must be native or omm');
|
|
80
93
|
const file = options.file ?? (omm ? '.omm' : ARCHITECTURE_FILE);
|
|
94
|
+
const instructions = async () => {
|
|
95
|
+
const language = options.language ?? (omm ? (await store.config()).language : 'en');
|
|
96
|
+
return omm ? buildOmmScanPrompt(root, language) : buildArchitecturePrompt(root, language === 'zh' ? 'zh' : 'en');
|
|
97
|
+
};
|
|
81
98
|
const input = async (values) => values[0] === '-' ? io.stdin() : values.join(' ');
|
|
82
99
|
const json = (value) => io.write(JSON.stringify(value, null, 2));
|
|
83
100
|
if (command === 'prompt' || command === 'scan') {
|
|
84
|
-
io.write(
|
|
101
|
+
io.write(await instructions());
|
|
85
102
|
return 0;
|
|
86
103
|
}
|
|
87
104
|
if (command === 'setup') {
|
|
@@ -112,7 +129,7 @@ export async function runArchitectureCli(args, io = { write: value => process.st
|
|
|
112
129
|
io.write(`Removed ${relative}`);
|
|
113
130
|
continue;
|
|
114
131
|
}
|
|
115
|
-
const prompt =
|
|
132
|
+
const prompt = await instructions();
|
|
116
133
|
await fs.writeFile(destination, `---\nname: termdock-architecture\ndescription: Recursively analyze or update this project's Termdock code architecture.\n---\n${marker}\n\n${prompt}\n`, { mode: 0o600 });
|
|
117
134
|
io.write(`Installed ${relative}`);
|
|
118
135
|
}
|
|
@@ -206,10 +223,12 @@ export async function runArchitectureCli(args, io = { write: value => process.st
|
|
|
206
223
|
}
|
|
207
224
|
if (command === 'validate') {
|
|
208
225
|
const issues = [];
|
|
226
|
+
if (element)
|
|
227
|
+
target(document, element);
|
|
209
228
|
for (const view of document.perspectives) {
|
|
210
229
|
for (const item of [view, ...view.nodes]) {
|
|
211
|
-
const key =
|
|
212
|
-
if (element && !key.startsWith(element))
|
|
230
|
+
const key = elementPath(view, item === view ? undefined : item);
|
|
231
|
+
if (element && key !== element && !key.startsWith(`${element}/`))
|
|
213
232
|
continue;
|
|
214
233
|
if (!item.description && !item.summary)
|
|
215
234
|
issues.push({ element: key, message: 'Missing description' });
|
|
@@ -274,7 +293,13 @@ export async function runArchitectureCli(args, io = { write: value => process.st
|
|
|
274
293
|
return 0;
|
|
275
294
|
}
|
|
276
295
|
if (command === 'refs') {
|
|
277
|
-
|
|
296
|
+
const reference = (perspective, id) => {
|
|
297
|
+
const view = document.perspectives.find(view => view.id === perspective);
|
|
298
|
+
const node = id ? view.nodes.find(node => node.id === id) : undefined;
|
|
299
|
+
return { perspective, ...(id ? { node: id } : {}), element: elementPath(view, node), title: node?.title ?? view.title };
|
|
300
|
+
};
|
|
301
|
+
const connections = (selected.node ? selected.view.edges.filter(edge => edge.from === selected.node.id || edge.to === selected.node.id) : selected.view.edges).map(edge => ({ ...edge, fromElement: elementPath(selected.view, selected.view.nodes.find(node => node.id === edge.from)), toElement: elementPath(selected.view, selected.view.nodes.find(node => node.id === edge.to)) }));
|
|
302
|
+
json({ outgoing: (selected.node?.references ?? []).map(ref => reference(ref.perspective, ref.node)), incoming: document.perspectives.flatMap(view => view.nodes.filter(node => node.references?.some(ref => ref.perspective === selected.view.id && (!ref.node || ref.node === selected.node?.id))).map(node => reference(view.id, node.id))), connections });
|
|
278
303
|
return 0;
|
|
279
304
|
}
|
|
280
305
|
if (command === 'diff') {
|
|
@@ -304,19 +304,19 @@ export function buildArchitecturePrompt(root, language, analysis = DEFAULT_ANALY
|
|
|
304
304
|
'Source paths must be existing files relative to the project root, with no absolute paths, URLs, backslashes or dot/parent segments. Add a positive integer line when verified. Omit uncertain connections and explain uncertainties in summaries.',
|
|
305
305
|
`Write titles, summaries and edge labels in ${language === 'zh' ? 'Chinese' : 'English'}. Set generatedAt to the actual current ISO timestamp. The sample paths are illustrative; use this project's real paths.`,
|
|
306
306
|
'Read the selected output document if it already exists. Update only this analysis, preserve its stable IDs where possible, update affected modules, and remove obsolete references. Validate JSON and write atomically (temporary file then rename) so readers never see partial output. Summarize what was analyzed and any limitations after writing.',
|
|
307
|
-
`Prefer
|
|
307
|
+
`Prefer invoking executable td with this argument array: ${JSON.stringify(['architecture', 'save', '--project', root, '--file', output, '-'])}. Pass the complete JSON on stdin. Pass arguments separately; JSON string quoting is not shell escaping. This validates the document, archives the previous version, and records the update count and Git revision. If the CLI is unavailable, use the atomic file write above and disclose that history metadata was not recorded.`,
|
|
308
308
|
JSON.stringify(example, null, 2),
|
|
309
309
|
].join('\n\n');
|
|
310
310
|
}
|
|
311
311
|
/** Adapted scanner workflow from oh-my-mermaid, MIT; see THIRD_PARTY_NOTICES.md. */
|
|
312
312
|
export function buildOmmScanPrompt(root, language) {
|
|
313
313
|
return [
|
|
314
|
-
language
|
|
315
|
-
`Project root (literal path): ${JSON.stringify(root)}. Write document content in ${language
|
|
314
|
+
language.startsWith('zh') ? '分析当前项目并递归更新 .omm 架构文档。' : 'Recursively analyze this project and update its .omm architecture documents.',
|
|
315
|
+
`Project root (literal path): ${JSON.stringify(root)}. Write document content in language ${JSON.stringify(language)}.`,
|
|
316
316
|
'Read project instructions, manifests, entry points and existing .omm documentation. Select relevant perspectives: overall-architecture, request-lifecycle, data-flow, dependency-map, external-integrations, state-transitions, route-page-map, command-surface, extension-points, pipeline, orchestration, storage.',
|
|
317
317
|
'For each perspective, write a graph LR or graph TD diagram whose node IDs match child directory names (English kebab-case). Every edge must have a meaningful label. Node labels use name plus verified source path separated by \\n. Write description for EVERY node, inspect its actual source, and recursively create child diagrams wherever distinct internal components exist. Leaves still need descriptions. Do not stop at the top-level diagram.',
|
|
318
318
|
'Each element supports description, diagram, context, constraint, concern, todo, note. Use Markdown for text fields. Record real constraints and concerns without inventing them. Existing @perspective references can link between perspectives. Do not rewrite unchanged elements. Remove obsolete references after confirming them. Never modify business source files or include secrets.',
|
|
319
|
-
`
|
|
319
|
+
`Invoke executable td with this argument array: ${JSON.stringify(['architecture', 'write', '--project', root, '--format', 'omm', '<perspective/child/path>', '<field>', '-'])}, replacing the two placeholders with the element path and field. Supply that field on stdin. Pass arguments separately; JSON string quoting is not shell escaping. Use read, tree, refs and diff to inspect existing documents. Finish by invoking td with argument array ${JSON.stringify(['architecture', 'validate', '--project', root, '--format', 'omm'])}.`,
|
|
320
320
|
'Report the inspected sources, updated perspectives, recursion coverage and unresolved limitations. The Termdock architecture viewer reads .omm directly; no separate viewer server is required.',
|
|
321
321
|
].join('\n\n');
|
|
322
322
|
}
|
|
@@ -2,6 +2,11 @@ import { ARCHITECTURE_FIELDS } from './document.js';
|
|
|
2
2
|
/** Compare semantic document content, excluding timestamps and update counters. */
|
|
3
3
|
export function diffArchitecture(before, after) {
|
|
4
4
|
const changes = [];
|
|
5
|
+
if (before) {
|
|
6
|
+
const changed = ['summary', 'analysis', 'details', 'origin'].filter(key => JSON.stringify(before[key]) !== JSON.stringify(after[key]));
|
|
7
|
+
if (changed.length)
|
|
8
|
+
changes.push({ perspective: '', title: 'Project overview', kind: 'changed', fields: changed });
|
|
9
|
+
}
|
|
5
10
|
const oldViews = new Map(before?.perspectives.map(view => [view.id, view]) ?? []);
|
|
6
11
|
for (const view of after.perspectives) {
|
|
7
12
|
const previous = oldViews.get(view.id);
|
|
@@ -49,7 +49,7 @@ 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
53
|
import { prepareSupervisionEnable } from '../utils/enableSupervision.js';
|
|
54
54
|
import { buildServerHealthState, dismissServerHealth } from '../utils/serverHealth.js';
|
|
55
55
|
import { collaborationRoutes } from '../agent/collaborationRoutes.js';
|
|
@@ -65,7 +65,7 @@ import { CollaborationError } from '../agent/collaborationProtocol.js';
|
|
|
65
65
|
import { resolveCollaborationBackend, resolveCollaborationSessionId } from '../agent/sessionBindingRecovery.js';
|
|
66
66
|
import { CollaborationRoutingStore, selectCollaborationPane, selectDrivePane } from '../agent/collaborationRouting.js';
|
|
67
67
|
import { CollaborationDeliveryWorker } from '../agent/collaborationDeliveryWorker.js';
|
|
68
|
-
import { approveCollaborationDialog, captureTmuxPaneHistory, captureTmuxPaneText,
|
|
68
|
+
import { approveCollaborationDialog, captureTmuxPaneHistory, captureTmuxPaneText, sendTmuxPaneKey, writeCollaborationTmuxPane } from '../agent/collaborationTmuxDelivery.js';
|
|
69
69
|
import { listAllHookAgents, refreshStaleHooksAtLaunch, installHooksForSlug, uninstallHooksForSlug, } from '../agent/installers.js';
|
|
70
70
|
import { loadPlugins, savePlugin, removePlugin, readPluginIcon, validateManifest, } from '../agent/plugins.js';
|
|
71
71
|
import { TmuxLifecycleCoordinator } from '../utils/tmuxLifecycle.js';
|
|
@@ -1455,7 +1455,7 @@ function deliverAutomationPromptWhenReady(backendSessionId, prompt, attempt = 0)
|
|
|
1455
1455
|
if (!session)
|
|
1456
1456
|
return;
|
|
1457
1457
|
if (canDeliverPromptToAgent(session) || attempt >= 60) {
|
|
1458
|
-
session.ptyProcess.
|
|
1458
|
+
void writeBracketedPrompt(session.ptyProcess, prompt).catch((error) => console.error('[automation] terminal write failed:', getErrorMessage(error)));
|
|
1459
1459
|
return;
|
|
1460
1460
|
}
|
|
1461
1461
|
setTimeout(() => deliverAutomationPromptWhenReady(backendSessionId, prompt, attempt + 1), 250);
|
|
@@ -1475,7 +1475,7 @@ async function runAgentAutomation(automation, req) {
|
|
|
1475
1475
|
const message = automation.prompt || automation.command;
|
|
1476
1476
|
if (!message)
|
|
1477
1477
|
throw new Error('自动任务没有可发送的内容');
|
|
1478
|
-
backend.ptyProcess
|
|
1478
|
+
await writeBracketedPrompt(backend.ptyProcess, message);
|
|
1479
1479
|
}
|
|
1480
1480
|
else {
|
|
1481
1481
|
const request = req ?? {};
|
|
@@ -1495,7 +1495,7 @@ async function runAgentAutomation(automation, req) {
|
|
|
1495
1495
|
if (automation.command)
|
|
1496
1496
|
deliverAutomationPromptWhenReady(opened.terminalSession.sessionId, automation.prompt);
|
|
1497
1497
|
else
|
|
1498
|
-
backend.ptyProcess
|
|
1498
|
+
await writeBracketedPrompt(backend.ptyProcess, automation.prompt);
|
|
1499
1499
|
}
|
|
1500
1500
|
}
|
|
1501
1501
|
automationStore.finishRun(run.id, 'success', frontendSessionId, '任务已投递');
|
|
@@ -1722,11 +1722,7 @@ async function resolveCollaborationRoute(frontendSessionId) {
|
|
|
1722
1722
|
throw new Error('SESSION_REMOVED');
|
|
1723
1723
|
await writeCollaborationTmuxPane(runTmux, pinned, formatLocalCollaborationMessages(frontendSessionId, messages), runTmuxStdin);
|
|
1724
1724
|
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) };
|
|
1725
|
+
} };
|
|
1730
1726
|
}
|
|
1731
1727
|
if (!backend || !binding.backendSessionId)
|
|
1732
1728
|
return { state: 'offline', reason: 'SHELL_BACKEND_NOT_RUNNING' };
|
|
@@ -1740,7 +1736,7 @@ async function resolveCollaborationRoute(frontendSessionId) {
|
|
|
1740
1736
|
throw new Error('SESSION_REMOVED');
|
|
1741
1737
|
if (terminalSessions.get(binding.backendSessionId) !== target)
|
|
1742
1738
|
throw new Error('SHELL_BACKEND_CHANGED');
|
|
1743
|
-
target.ptyProcess
|
|
1739
|
+
await writeBracketedPrompt(target.ptyProcess, formatLocalCollaborationMessages(frontendSessionId, messages));
|
|
1744
1740
|
target.lastActivity = Date.now();
|
|
1745
1741
|
} };
|
|
1746
1742
|
}
|
|
@@ -7994,7 +7990,7 @@ router.post('/:sessionId/agent-resume', async (req, res) => {
|
|
|
7994
7990
|
});
|
|
7995
7991
|
}
|
|
7996
7992
|
try {
|
|
7997
|
-
session.ptyProcess
|
|
7993
|
+
await writeBracketedPrompt(session.ptyProcess, target.command);
|
|
7998
7994
|
session.lastActivity = Date.now();
|
|
7999
7995
|
res.json({ success: true, command: target.command });
|
|
8000
7996
|
}
|
package/docs/integrations.md
CHANGED
|
@@ -499,7 +499,11 @@ 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` 保留历史,不触发补键或重投。
|
|
503
507
|
任务完成继续以负责人明确 `report complete` 为准。
|
|
504
508
|
|
|
505
509
|
恢复保留原 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.311",
|
|
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-7L8T4bDJQ154U8PiMQzdpuoJqJC2mFUEmqyAR8CeyBc=",
|
|
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
|