@locus-forge/locus-map 0.1.0 → 0.2.2-dev.20261206.g5e970d2
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/CONTRIBUTING.md +2 -2
- package/README.md +35 -10
- package/THIRD_PARTY_NOTICES.md +3 -1
- package/dist/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
- package/dist/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
- package/dist/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
- package/dist/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
- package/dist/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
- package/dist/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
- package/dist/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
- package/dist/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
- package/dist/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
- package/dist/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
- package/dist/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
- package/dist/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
- package/dist/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
- package/dist/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
- package/dist/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
- package/dist/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
- package/dist/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
- package/dist/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
- package/dist/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
- package/dist/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
- package/dist/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
- package/dist/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
- package/dist/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
- package/dist/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
- package/dist/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
- package/dist/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
- package/dist/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
- package/dist/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
- package/dist/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
- package/dist/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
- package/dist/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
- package/dist/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
- package/dist/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
- package/dist/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
- package/dist/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
- package/dist/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
- package/dist/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
- package/dist/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
- package/dist/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
- package/dist/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
- package/dist/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
- package/dist/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
- package/dist/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
- package/dist/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
- package/dist/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
- package/dist/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
- package/dist/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
- package/dist/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
- package/dist/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
- package/dist/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
- package/dist/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
- package/dist/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
- package/dist/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
- package/dist/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
- package/dist/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
- package/dist/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
- package/dist/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
- package/dist/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
- package/dist/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
- package/dist/assets/{abnfDiagram-VCTEODGH-tB0FidS0.js → abnfDiagram-VCTEODGH-JiCO6vo-.js} +1 -1
- package/dist/assets/{ar-SA-G6X2FPQ2-BQNIWg05.js → ar-SA-G6X2FPQ2-BdzEBmp3.js} +1 -1
- package/dist/assets/{architectureDiagram-5GKGNRK7-D1SjeTh7.js → architectureDiagram-5GKGNRK7-D7T_vJwe.js} +1 -1
- package/dist/assets/{az-AZ-76LH7QW2-BAQK4UQr.js → az-AZ-76LH7QW2-BQ_SoVB7.js} +1 -1
- package/dist/assets/{bg-BG-XCXSNQG7-BDvRwwoU.js → bg-BG-XCXSNQG7-DlH1olUf.js} +1 -1
- package/dist/assets/{blockDiagram-I7D4REHJ-xOWzl6z3.js → blockDiagram-I7D4REHJ-DPz0LEjY.js} +1 -1
- package/dist/assets/{bn-BD-2XOGV67Q-B-osMrPA.js → bn-BD-2XOGV67Q-CFIZU06C.js} +1 -1
- package/dist/assets/{c4Diagram-7LVT6UL2-D5e6bidF.js → c4Diagram-7LVT6UL2-B6uCi0Ol.js} +1 -1
- package/dist/assets/{ca-ES-6MX7JW3Y-BqurRCRN.js → ca-ES-6MX7JW3Y-Bpe3kOti.js} +1 -1
- package/dist/assets/channel-DB3atv5o.js +1 -0
- package/dist/assets/{chunk-2Q5K7J3B-CQmSUQUU.js → chunk-2Q5K7J3B-DTWRWhpx.js} +1 -1
- package/dist/assets/{chunk-5VM5RSS4-iLXee7yJ.js → chunk-5VM5RSS4-Dfr1HUAN.js} +1 -1
- package/dist/assets/{chunk-F27PBJKO-BSQMcINP.js → chunk-F27PBJKO-D_IVoCIK.js} +1 -1
- package/dist/assets/{chunk-IMKFNOWR-l-2241K-.js → chunk-IMKFNOWR-Boa_chn8.js} +1 -1
- package/dist/assets/{chunk-JWPE2WC7-Cu7ldP_G.js → chunk-JWPE2WC7-RaK8jzc2.js} +1 -1
- package/dist/assets/{chunk-POPQ4Y6H-BkgM8HKl.js → chunk-POPQ4Y6H-D7xOpv6O.js} +1 -1
- package/dist/assets/{chunk-SVP7TREG-BR7R6F9G.js → chunk-SVP7TREG-XvJsx1jt.js} +1 -1
- package/dist/assets/{chunk-TICWLB2K-DzFEizqD.js → chunk-TICWLB2K-DZCVWmZG.js} +1 -1
- package/dist/assets/{chunk-XXDRQBXY-B3V5ae8Q.js → chunk-XXDRQBXY-Djk-REAy.js} +1 -1
- package/dist/assets/classDiagram-ZZMXUADV-CzvsXoj_.js +1 -0
- package/dist/assets/classDiagram-v2-VYDZK3BY-HxwJpdPt.js +1 -0
- package/dist/assets/{cose-bilkent-JH36ORCC-BSUyEU78.js → cose-bilkent-JH36ORCC-D6XaIbtG.js} +1 -1
- package/dist/assets/{cs-CZ-2BRQDIVT-BtaYa8qS.js → cs-CZ-2BRQDIVT-BdzgSHdJ.js} +1 -1
- package/dist/assets/{cynefin-OW5HDTMX-BQ6G1FGd.js → cynefin-OW5HDTMX-BMTkMDG1.js} +1 -1
- package/dist/assets/{cynefinDiagram-5FMLGOSQ-BmH3cQU1.js → cynefinDiagram-5FMLGOSQ-C2s5i9h9.js} +1 -1
- package/dist/assets/{d3-scale-6PaX2_v-.js → d3-scale-BMIMKl27.js} +1 -1
- package/dist/assets/{da-DK-5WZEPLOC-Dk88jbcE.js → da-DK-5WZEPLOC-Bj-GFWHU.js} +1 -1
- package/dist/assets/{dagre-GXQ25YYZ-DzqDTRYR.js → dagre-GXQ25YYZ-CMT8wlz0.js} +1 -1
- package/dist/assets/{de-DE-XR44H4JA-BtkAzckW.js → de-DE-XR44H4JA-JmpondAB.js} +1 -1
- package/dist/assets/{diagram-S7CK7UJ4-CKkad9LS.js → diagram-S7CK7UJ4-DU1blS3M.js} +1 -1
- package/dist/assets/{diagram-UQ7AKVKN-HnH6kGvY.js → diagram-UQ7AKVKN-0lWi4KDV.js} +1 -1
- package/dist/assets/{diagram-VSXAHHWV-BGbiUlE1.js → diagram-VSXAHHWV-CrseWrhn.js} +1 -1
- package/dist/assets/{diagram-VX7I27RA-MPt2qzsq.js → diagram-VX7I27RA-C5BMS8Ql.js} +1 -1
- package/dist/assets/{diagram-Z3DM3KII-hcUL0DLm.js → diagram-Z3DM3KII-Cc3vq6b8.js} +1 -1
- package/dist/assets/{ebnfDiagram-PWID7BFC-hUZUNK__.js → ebnfDiagram-PWID7BFC-ZF78imma.js} +1 -1
- package/dist/assets/{el-GR-BZB4AONW-DOnEE5fq.js → el-GR-BZB4AONW-BFslUpdm.js} +1 -1
- package/dist/assets/{engines-C6k3bUFA.js → engines-BtEtIBXt.js} +1 -1
- package/dist/assets/{erDiagram-RLTQ6QDP-DoHgp3nM.js → erDiagram-RLTQ6QDP-CjPjDn2i.js} +1 -1
- package/dist/assets/{es-ES-U4NZUMDT-VFRkCKl6.js → es-ES-U4NZUMDT-B0ezBTxQ.js} +1 -1
- package/dist/assets/{eu-ES-A7QVB2H4-CWlqsMWd.js → eu-ES-A7QVB2H4-DP_gx2kf.js} +1 -1
- package/dist/assets/{fa-IR-HGAKTJCU-CxtwUetE.js → fa-IR-HGAKTJCU-BuT1ELty.js} +1 -1
- package/dist/assets/{fi-FI-Z5N7JZ37-Djl1mow5.js → fi-FI-Z5N7JZ37-BAu_Cj7n.js} +1 -1
- package/dist/assets/{flowDiagram-HODETNUW-CCs8KCI7.js → flowDiagram-HODETNUW-yqPGWNdd.js} +1 -1
- package/dist/assets/{fr-FR-RHASNOE6-CTSI58QE.js → fr-FR-RHASNOE6-OF1CpgtN.js} +1 -1
- package/dist/assets/{ganttDiagram-EL5Y4UJY-V39NrnLQ.js → ganttDiagram-EL5Y4UJY-zUY5je2K.js} +1 -1
- package/dist/assets/{gitGraphDiagram-WWUBYQGX-DsfCYVRX.js → gitGraphDiagram-WWUBYQGX-oWrs7wy0.js} +1 -1
- package/dist/assets/{gl-ES-HMX3MZ6V-9X19A7Co.js → gl-ES-HMX3MZ6V-CkJ47l98.js} +1 -1
- package/dist/assets/{he-IL-6SHJWFNN-CCWn0aTE.js → he-IL-6SHJWFNN-D7CecRlh.js} +1 -1
- package/dist/assets/{hi-IN-IWLTKZ5I-Czvn3Cqk.js → hi-IN-IWLTKZ5I-CGlW2X-h.js} +1 -1
- package/dist/assets/{hu-HU-A5ZG7DT2-CSA0xyZy.js → hu-HU-A5ZG7DT2-Dq_n_tbp.js} +1 -1
- package/dist/assets/{id-ID-SAP4L64H-C8Y8IY1j.js → id-ID-SAP4L64H-CotwO_06.js} +1 -1
- package/dist/assets/index-CdVc9Lmz.js +624 -0
- package/dist/assets/{index-C_ek_ppO.css → index-Cv-tTxNC.css} +1 -1
- package/dist/assets/{index-0Kge4otW.js → index-VaWCb9bx.js} +5 -5
- package/dist/assets/{infoDiagram-27XIBGKW-C0Ivywz2.js → infoDiagram-27XIBGKW-CYzIkNFW.js} +1 -1
- package/dist/assets/{ishikawaDiagram-5VMMS53U-CMmE4k9T.js → ishikawaDiagram-5VMMS53U-DkgUsuk5.js} +1 -1
- package/dist/assets/{it-IT-JPQ66NNP-gVSFrMB6.js → it-IT-JPQ66NNP-h97o81us.js} +1 -1
- package/dist/assets/{ja-JP-DBVTYXUO-HnD6OZRp.js → ja-JP-DBVTYXUO-M6EVfh0o.js} +1 -1
- package/dist/assets/{journeyDiagram-3NMN7TZE-CpkEKmSl.js → journeyDiagram-3NMN7TZE-CuKkNrJy.js} +1 -1
- package/dist/assets/{kaa-6HZHGXH3-C29qXHap.js → kaa-6HZHGXH3-DUy85zzz.js} +1 -1
- package/dist/assets/{kab-KAB-ZGHBKWFO-CLNG0bT_.js → kab-KAB-ZGHBKWFO-ChL-fKtk.js} +1 -1
- package/dist/assets/{kanban-definition-UXKFOSKX-hOCBBBFh.js → kanban-definition-UXKFOSKX-DkOxt3kf.js} +1 -1
- package/dist/assets/{kk-KZ-P5N5QNE5-DNoNNWtH.js → kk-KZ-P5N5QNE5-DY6ucSGD.js} +1 -1
- package/dist/assets/{km-KH-HSX4SM5Z-eQMwEzV_.js → km-KH-HSX4SM5Z-BAaS4014.js} +1 -1
- package/dist/assets/{ko-KR-MTYHY66A-DP3yaFyg.js → ko-KR-MTYHY66A-D-r3mJ1R.js} +1 -1
- package/dist/assets/{ku-TR-6OUDTVRD-B2GUIkso.js → ku-TR-6OUDTVRD-Dk1GCoOP.js} +1 -1
- package/dist/assets/{layout-D_xIMZTq.js → layout-DtNEGI4_.js} +1 -1
- package/dist/assets/{lt-LT-XHIRWOB4-CuDegLO4.js → lt-LT-XHIRWOB4-3Z2Ui1VZ.js} +1 -1
- package/dist/assets/{lv-LV-5QDEKY6T-DOjbM5AK.js → lv-LV-5QDEKY6T-Bg59rOkR.js} +1 -1
- package/dist/assets/{mindmap-definition-YA3MSWOX-DL4r3hzu.js → mindmap-definition-YA3MSWOX-Dcs8eV7p.js} +1 -1
- package/dist/assets/{mr-IN-CRQNXWMA-C0vzd3Vl.js → mr-IN-CRQNXWMA-DepTOG29.js} +1 -1
- package/dist/assets/{my-MM-5M5IBNSE-Dirjg8Yf.js → my-MM-5M5IBNSE-4KqL4Tav.js} +1 -1
- package/dist/assets/{nb-NO-T6EIAALU-IpjtB42R.js → nb-NO-T6EIAALU-5YWO_l3W.js} +1 -1
- package/dist/assets/{nl-NL-IS3SIHDZ-BiVBDlHI.js → nl-NL-IS3SIHDZ-QlAndkM2.js} +1 -1
- package/dist/assets/{nn-NO-6E72VCQL-kbUyKFiJ.js → nn-NO-6E72VCQL-BscwhEDW.js} +1 -1
- package/dist/assets/{oc-FR-POXYY2M6-C-zRRb5B.js → oc-FR-POXYY2M6-k7bYbSQj.js} +1 -1
- package/dist/assets/{pa-IN-N4M65BXN-Dhh3bH7-.js → pa-IN-N4M65BXN-jxBFwrWj.js} +1 -1
- package/dist/assets/{pegDiagram-XKGWAZYB-CtbYRYVR.js → pegDiagram-XKGWAZYB-zM-VZA3r.js} +1 -1
- package/dist/assets/{pica-HSHSc6s6.js → pica-CsWQ4DPU.js} +1 -1
- package/dist/assets/{pieDiagram-E7YTZNPT-Cwv0hsvK.js → pieDiagram-E7YTZNPT-C60FE0D8.js} +1 -1
- package/dist/assets/{pl-PL-T2D74RX3-CuDP0Pq6.js → pl-PL-T2D74RX3-be8atU_l.js} +1 -1
- package/dist/assets/{pt-BR-5N22H2LF-BlvJqOgZ.js → pt-BR-5N22H2LF-CSE0O2fj.js} +1 -1
- package/dist/assets/{pt-PT-UZXXM6DQ-C3RUoC5C.js → pt-PT-UZXXM6DQ-5rnYJhy1.js} +1 -1
- package/dist/assets/{quadrantDiagram-AXDQQJYC-C_u4_Oxh.js → quadrantDiagram-AXDQQJYC-DyH84hx6.js} +1 -1
- package/dist/assets/{railroadDiagram-O6MQD6OU-FHKPLH9r.js → railroadDiagram-O6MQD6OU-DCrJgP9s.js} +1 -1
- package/dist/assets/{requirementDiagram-BXWQKSXE-B_8MbGxf.js → requirementDiagram-BXWQKSXE-C78-QlFo.js} +1 -1
- package/dist/assets/{ro-RO-JPDTUUEW-QUZCSbcA.js → ro-RO-JPDTUUEW-Gh6EgC27.js} +1 -1
- package/dist/assets/{ru-RU-B4JR7IUQ-BCk_AmNC.js → ru-RU-B4JR7IUQ-BUWESZhq.js} +1 -1
- package/dist/assets/{sankeyDiagram-P5KCCOFB-DsfunxYA.js → sankeyDiagram-P5KCCOFB-D_MOkKEs.js} +1 -1
- package/dist/assets/{sequenceDiagram-WJ2MYXX4-cRf71lBb.js → sequenceDiagram-WJ2MYXX4-BeQbHZRB.js} +1 -1
- package/dist/assets/{si-LK-N5RQ5JYF-jo1qm6JU.js → si-LK-N5RQ5JYF-C9pnvQMf.js} +1 -1
- package/dist/assets/{sizeCapture-INFHLROL-COrYinZO.js → sizeCapture-INFHLROL-DUn-Mus_.js} +1 -1
- package/dist/assets/{sk-SK-C5VTKIMK-BnMkvGRK.js → sk-SK-C5VTKIMK-FnkPBibb.js} +1 -1
- package/dist/assets/{sl-SI-NN7IZMDC-DIkgazuw.js → sl-SI-NN7IZMDC-Cwrqj_B9.js} +1 -1
- package/dist/assets/{stateDiagram-D77RDMKH-BvBlef2E.js → stateDiagram-D77RDMKH-C3EF3jQ3.js} +1 -1
- package/dist/assets/stateDiagram-v2-MP3YSRHH-CVQHmIvK.js +1 -0
- package/dist/assets/{subset-shared.chunk-Cp0oS3tn.js → subset-shared.chunk-8ifLcT_D.js} +1 -1
- package/dist/assets/{subset-worker.chunk-BEbN9HM2.js → subset-worker.chunk-DrNTybDR.js} +1 -1
- package/dist/assets/{sv-SE-XGPEYMSR-CxQiCAkW.js → sv-SE-XGPEYMSR-Btz80pGx.js} +1 -1
- package/dist/assets/{swimlanes-42K2YHIH-BjR8lfsn.js → swimlanes-42K2YHIH-B2_kGhPA.js} +1 -1
- package/dist/assets/swimlanesDiagram-VR7AAH4N-C1rOmrkT.js +8 -0
- package/dist/assets/{ta-IN-2NMHFXQM-e_HiIsgP.js → ta-IN-2NMHFXQM-B0bWtgu1.js} +1 -1
- package/dist/assets/{th-TH-HPSO5L25-DTp8x86q.js → th-TH-HPSO5L25-DgC0yFw3.js} +1 -1
- package/dist/assets/{timeline-definition-24CTP7MA-B0uf0zYu.js → timeline-definition-24CTP7MA-Bu0W3Mcy.js} +1 -1
- package/dist/assets/{tr-TR-DEFEU3FU-BfTQG1sR.js → tr-TR-DEFEU3FU-C9Mmy6ri.js} +1 -1
- package/dist/assets/{uk-UA-QMV73CPH-DMHmllj-.js → uk-UA-QMV73CPH-rxEnqB_i.js} +1 -1
- package/dist/assets/{vennDiagram-4TSXK5OY-AxXlA6VW.js → vennDiagram-4TSXK5OY-63JTeOph.js} +1 -1
- package/dist/assets/{vi-VN-M7AON7JQ-BtoynmIl.js → vi-VN-M7AON7JQ-DOVa-vAT.js} +1 -1
- package/dist/assets/{wardleyDiagram-VM6X3IG4-BiKqKrb1.js → wardleyDiagram-VM6X3IG4-Bct0TRuC.js} +1 -1
- package/dist/assets/{xychartDiagram-S5SC5T6Z-DKJ6ufCR.js → xychartDiagram-S5SC5T6Z-C21zgvSM.js} +1 -1
- package/dist/assets/{zh-CN-LNUGB5OW-BiSoyhtF.js → zh-CN-LNUGB5OW-MyifsmQ8.js} +1 -1
- package/dist/assets/{zh-HK-E62DVLB3-C6DC7GXY.js → zh-HK-E62DVLB3-Cp55UViv.js} +1 -1
- package/dist/assets/{zh-TW-RAJ6MFWO-D1A1a-SQ.js → zh-TW-RAJ6MFWO-DMy6SZap.js} +1 -1
- package/dist/index.html +2 -2
- package/dist/licenses/markdown-reading-notices.txt +76 -0
- package/docs/BUNDLE-FORMAT.md +18 -5
- package/docs/DIAGRAM-SOURCE.md +59 -12
- package/docs/LOCAL-DOCUMENT.md +17 -14
- package/docs/MODEL-CONTRACT.md +7 -4
- package/docs/PLANTUML-SOURCE.md +3 -2
- package/docs/VIEWER-LAUNCH.md +18 -3
- package/docs/VIEWER.md +118 -35
- package/docs/adr/ADR-001-2026-12-03-inspector-original-document-first/ADR-001-2026-12-03-inspector-original-document-first.md +1 -1
- package/docs/adr/ADR-006-2026-12-05-workspace-navigation-rows/ADR-006-2026-12-05-workspace-navigation-rows.md +29 -0
- package/docs/adr/ADR-007-2026-12-05-native-edit-selection/ADR-007-2026-12-05-native-edit-selection.md +25 -0
- package/docs/capabilities.json +27 -4
- package/docs/decisions.md +3 -1
- package/licenses/markdown-reading-notices.txt +76 -0
- package/package.json +5 -2
- package/scripts/build-map.mjs +1 -1
- package/scripts/lib/map-viewer-server.mjs +48 -24
- package/scripts/lib/original-materials.mjs +1 -1
- package/scripts/lib/original-report-server.mjs +7 -3
- package/scripts/lib/project-catalog.mjs +14 -2
- package/scripts/lib/project-map-inputs.mjs +1 -1
- package/scripts/lib/sketch-publication.mjs +1 -1
- package/scripts/lib/task-map-build.mjs +1 -1
- package/scripts/lib/view-args.mjs +183 -0
- package/scripts/lib/workflow/reader-surface.mjs +29 -11
- package/scripts/locus-map.mjs +14 -20
- package/scripts/open-map.mjs +84 -49
- package/scripts/vite-browser-dependencies.mjs +2 -1
- package/skills/README.md +2 -1
- package/skills/locus-map/SKILL.md +27 -25
- package/skills/locus-map/assets/artifact-handoff.md +2 -1
- package/skills/locus-map/references/build-environment.md +11 -7
- package/skills/locus-map/references/checks.md +16 -4
- package/skills/locus-map/references/component-checkpoint.md +35 -0
- package/skills/locus-map/references/draw-skill.md +2 -1
- package/skills/locus-map/references/selection.md +36 -13
- package/skills/locus-map/references/task-maps.md +5 -0
- package/skills/locus-map/references/visual-composition.md +69 -0
- package/skills/locus-map-draft/SKILL.md +95 -0
- package/skills/locus-map-draft/assets/chosen-direction.md +47 -0
- package/skills/locus-map-draft/references/divergence-and-formats.md +127 -0
- package/skills/locus-map-primitives/SKILL.md +6 -2
- package/skills/locus-map-primitives/references/card-presentation.md +57 -3
- package/skills/locus-map-primitives/references/reading-files.md +1 -1
- package/src/adapter/areas.js +1 -0
- package/src/adapter/semanticAdmission.js +118 -5
- package/src/authoring/buildDiagram.mjs +99 -19
- package/src/authoring/canvas-source-worker.mjs +96 -0
- package/src/authoring/canvasSource.mjs +41 -0
- package/src/authoring/diagramChecks.js +143 -1
- package/src/authoring/diagramSource.js +31 -5
- package/src/authoring/printPlantumlSource.js +13 -2
- package/src/authoring/readDetailsFiles.mjs +100 -19
- package/src/bundle/chain.js +129 -32
- package/src/bundle/chainBrowser.js +26 -2
- package/src/bundle/localDocument.mjs +87 -22
- package/src/bundle/localDocumentClient.js +5 -1
- package/src/bundle/projectClient.js +59 -18
- package/src/chain/validation.js +7 -1
- package/src/contract/readingMarkdown.js +57 -13
- package/src/contract/readingMaterials.js +18 -2
- package/src/contract/readingTable.js +66 -0
- package/src/viewer/ControlIcon.jsx +1 -0
- package/src/viewer/DiagramViewer.jsx +97 -56
- package/src/viewer/EmbeddedExcalidrawEditor.jsx +305 -0
- package/src/viewer/HighlightOverlay.jsx +146 -33
- package/src/viewer/Inspector.jsx +110 -33
- package/src/viewer/ProjectRail.jsx +11 -5
- package/src/viewer/ProjectTabs.jsx +9 -6
- package/src/viewer/ProjectViewChainViewer.jsx +235 -77
- package/src/viewer/ReadingTable.jsx +151 -0
- package/src/viewer/SketchCanvas.jsx +34 -87
- package/src/viewer/ViewChainViewer.jsx +583 -81
- package/src/viewer/camera.js +50 -18
- package/src/viewer/chainEditorSession.js +161 -35
- package/src/viewer/chainInstallation.js +3 -3
- package/src/viewer/details/CanvasPreview.jsx +303 -0
- package/src/viewer/details/InspectorReadingSettings.jsx +50 -13
- package/src/viewer/details/MeaningFirst.jsx +2 -2
- package/src/viewer/details/ReadingFiles.jsx +32 -4
- package/src/viewer/details/ReadingMarkdown.jsx +43 -12
- package/src/viewer/details/RelationshipBody.jsx +2 -2
- package/src/viewer/details/details.css +69 -26
- package/src/viewer/diagramControls.css +1 -1
- package/src/viewer/fileError.js +53 -0
- package/src/viewer/geometry.js +12 -0
- package/src/viewer/highlight.js +26 -12
- package/src/viewer/inspectorPosition.js +68 -16
- package/src/viewer/projectTasks.css +1 -2
- package/src/viewer/readingTable.css +47 -0
- package/src/viewer/sceneState.js +0 -4
- package/src/viewer/sketchSettling.js +71 -0
- package/src/viewer/useInspectorPosition.js +126 -39
- package/src/viewer/viewChain.css +55 -24
- package/src/viewer/viewer.css +23 -12
- package/dist/assets/channel-DP1yLO71.js +0 -1
- package/dist/assets/classDiagram-ZZMXUADV-DKQje2st.js +0 -1
- package/dist/assets/classDiagram-v2-VYDZK3BY-C3KVT455.js +0 -1
- package/dist/assets/index-BaHpjra6.js +0 -362
- package/dist/assets/stateDiagram-v2-MP3YSRHH-jeUVI-Q4.js +0 -1
- package/dist/assets/swimlanesDiagram-VR7AAH4N-Dp8eikhA.js +0 -8
|
@@ -105,15 +105,16 @@ export async function startMapViewer({ filePath, projectPath, libraryRoot, regis
|
|
|
105
105
|
const projectMode = Boolean(singleProject || registry);
|
|
106
106
|
const describe = (snapshot, originals) => originals && snapshot.kind !== 'sketch' ? originals.describe(snapshot, reports) : snapshot;
|
|
107
107
|
let origin;
|
|
108
|
+
let allowedHosts;
|
|
108
109
|
const canWrite = request => !readOnly && authenticated(request.headers['x-locus-write'], capability);
|
|
109
110
|
// A comparison failure never changes the confirmation of the main read/save.
|
|
110
|
-
async function withComparison(saved) {
|
|
111
|
+
async function withComparison(saved, requestOrigin = origin) {
|
|
111
112
|
if (!previous) return saved;
|
|
112
113
|
let comparison;
|
|
113
114
|
try {
|
|
114
115
|
const snapshot = await previous.read();
|
|
115
116
|
comparison = { status: 'available', scope: 'saved-documents',
|
|
116
|
-
previous: { path: previous.path, url: snapshot.loaded.scenes ? `${
|
|
117
|
+
previous: { path: previous.path, url: snapshot.loaded.scenes ? `${requestOrigin}/?document=${encodeURIComponent(previous.path)}` : null },
|
|
117
118
|
report: compareMapDocuments({ previous: snapshot.loaded, candidate: await loadChainBundle(JSON.stringify(saved.bundle)) }),
|
|
118
119
|
};
|
|
119
120
|
} catch (error) {
|
|
@@ -133,11 +134,13 @@ export async function startMapViewer({ filePath, projectPath, libraryRoot, regis
|
|
|
133
134
|
response.end(JSON.stringify(value));
|
|
134
135
|
};
|
|
135
136
|
try {
|
|
136
|
-
|
|
137
|
-
|
|
137
|
+
const requestHost = typeof request.headers.host === 'string' ? request.headers.host.toLowerCase() : '';
|
|
138
|
+
const requestOrigin = `http://${requestHost}`;
|
|
139
|
+
if (!allowedHosts.has(requestHost)
|
|
140
|
+
|| (request.headers.origin && request.headers.origin !== requestOrigin)) {
|
|
138
141
|
return json(403, { code: 'ORIGIN_REFUSED', message: 'The request must come from this local viewer.', outcome: 'rejected' });
|
|
139
142
|
}
|
|
140
|
-
const url = new URL(request.url,
|
|
143
|
+
const url = new URL(request.url, requestOrigin);
|
|
141
144
|
const rawPath = request.url.split('?')[0];
|
|
142
145
|
if (!rawPath.startsWith('/') || rawPath !== url.pathname || /%(?:2f|5c|2e|25)/i.test(rawPath) || rawPath.includes('\\')) {
|
|
143
146
|
return json(404, { code: 'PATH_REFUSED', message: 'Unknown asset path.', outcome: 'rejected' });
|
|
@@ -169,7 +172,7 @@ export async function startMapViewer({ filePath, projectPath, libraryRoot, regis
|
|
|
169
172
|
}
|
|
170
173
|
const context = () => registry ? registry.get(url.searchParams.get('project')) : singleContext;
|
|
171
174
|
if (url.pathname === '/api/original') {
|
|
172
|
-
if (request.method !== 'POST' || request.headers.origin !==
|
|
175
|
+
if (request.method !== 'POST' || request.headers.origin !== requestOrigin || request.headers['x-locus-action'] !== 'open-in-zed') {
|
|
173
176
|
return json(403, { message: 'Open the source from its local viewer.' });
|
|
174
177
|
}
|
|
175
178
|
const query = url.searchParams;
|
|
@@ -188,7 +191,7 @@ export async function startMapViewer({ filePath, projectPath, libraryRoot, regis
|
|
|
188
191
|
return result.opened ? json(200, result) : json(409, { message: result.reason });
|
|
189
192
|
}
|
|
190
193
|
if ((registry || singleProject?.editorPaths) && url.pathname === '/api/project/zed') {
|
|
191
|
-
if (request.method !== 'POST' || request.headers.origin !==
|
|
194
|
+
if (request.method !== 'POST' || request.headers.origin !== requestOrigin || request.headers['x-locus-action'] !== 'open-in-zed') {
|
|
192
195
|
return json(403, { message: 'Open Zed from this local project viewer.' });
|
|
193
196
|
}
|
|
194
197
|
const query = url.searchParams;
|
|
@@ -208,7 +211,7 @@ export async function startMapViewer({ filePath, projectPath, libraryRoot, regis
|
|
|
208
211
|
}
|
|
209
212
|
if (registry && url.pathname === '/api/project/sketch') {
|
|
210
213
|
if (request.method !== 'POST') return json(405, { code: 'METHOD_REFUSED', message: 'Method not supported.' });
|
|
211
|
-
if (request.headers.origin !==
|
|
214
|
+
if (request.headers.origin !== requestOrigin || !canWrite(request)) {
|
|
212
215
|
return json(403, { code: 'READ_ONLY', message: 'No permission to create a drawing.', outcome: 'rejected' });
|
|
213
216
|
}
|
|
214
217
|
const query = url.searchParams;
|
|
@@ -230,7 +233,7 @@ export async function startMapViewer({ filePath, projectPath, libraryRoot, regis
|
|
|
230
233
|
if (!reading && (request.method !== 'POST' || catalogRequest)) {
|
|
231
234
|
return json(405, { code: 'METHOD_REFUSED', message: 'Method not supported.', outcome: 'rejected' });
|
|
232
235
|
}
|
|
233
|
-
if (!reading && (request.headers.origin !==
|
|
236
|
+
if (!reading && (request.headers.origin !== requestOrigin || !canWrite(request))) {
|
|
234
237
|
return json(403, { code: 'READ_ONLY', message: 'No permission to write this document.', outcome: 'rejected' });
|
|
235
238
|
}
|
|
236
239
|
const { project, originals } = await context();
|
|
@@ -258,13 +261,13 @@ export async function startMapViewer({ filePath, projectPath, libraryRoot, regis
|
|
|
258
261
|
if (!snapshot.loaded.scenes) throw new DocumentError('UNSUPPORTED_MAPPING_VERSION', 'The presentation of the previous version is not supported; only a limited mapping is available.');
|
|
259
262
|
return json(200, { path: previous.path, revision: previousRevision, readOnly: true, bundle: snapshot.loaded.bundle });
|
|
260
263
|
}
|
|
261
|
-
if (request.method === 'GET') return json(200, await describe(await withComparison(await document.read()), singleOriginals));
|
|
264
|
+
if (request.method === 'GET') return json(200, await describe(await withComparison(await document.read(), requestOrigin), singleOriginals));
|
|
262
265
|
if (request.method !== 'POST') return json(405, { code: 'METHOD_REFUSED', message: 'Method not supported.', outcome: 'rejected' });
|
|
263
|
-
if (request.headers.origin !==
|
|
266
|
+
if (request.headers.origin !== requestOrigin || !canWrite(request)) {
|
|
264
267
|
return json(403, { code: 'READ_ONLY', message: 'No permission to write this document.', outcome: 'rejected' });
|
|
265
268
|
}
|
|
266
269
|
const confirmed = await document.save(await saveInput(request));
|
|
267
|
-
return json(200, await withComparison(confirmed));
|
|
270
|
+
return json(200, await withComparison(confirmed, requestOrigin));
|
|
268
271
|
}
|
|
269
272
|
if (!['GET', 'HEAD'].includes(request.method)) return json(405, { code: 'METHOD_REFUSED', message: 'Method not supported.' });
|
|
270
273
|
const asset = assets.get(url.pathname);
|
|
@@ -279,7 +282,13 @@ export async function startMapViewer({ filePath, projectPath, libraryRoot, regis
|
|
|
279
282
|
}
|
|
280
283
|
});
|
|
281
284
|
const sockets = new Set();
|
|
282
|
-
|
|
285
|
+
let closing;
|
|
286
|
+
let serverClosed = false;
|
|
287
|
+
server.on('connection', socket => {
|
|
288
|
+
if (closing) { socket.destroy(); return; }
|
|
289
|
+
sockets.add(socket);
|
|
290
|
+
socket.once('close', () => sockets.delete(socket));
|
|
291
|
+
});
|
|
283
292
|
server.requestTimeout = 30000;
|
|
284
293
|
server.headersTimeout = 10000;
|
|
285
294
|
try {
|
|
@@ -292,7 +301,9 @@ export async function startMapViewer({ filePath, projectPath, libraryRoot, regis
|
|
|
292
301
|
server.once('error', reject);
|
|
293
302
|
server.listen(port, '127.0.0.1', resolve);
|
|
294
303
|
});
|
|
295
|
-
|
|
304
|
+
const boundPort = server.address().port;
|
|
305
|
+
origin = `http://127.0.0.1:${boundPort}`;
|
|
306
|
+
allowedHosts = new Set([`127.0.0.1:${boundPort}`, `localhost:${boundPort}`]);
|
|
296
307
|
} catch (error) { await reports?.close(); await document?.close(); await previous?.close(); await singleProject?.close(); await registry?.close(); throw error; }
|
|
297
308
|
const launch = new URL('/', origin);
|
|
298
309
|
if (registry) launch.searchParams.set('project', registry.entry);
|
|
@@ -303,20 +314,33 @@ export async function startMapViewer({ filePath, projectPath, libraryRoot, regis
|
|
|
303
314
|
if (registry) fragment.set('workspace', discovery);
|
|
304
315
|
launch.hash = fragment.toString();
|
|
305
316
|
const url = launch.href;
|
|
306
|
-
|
|
317
|
+
const destroyConnections = () => {
|
|
318
|
+
server.closeAllConnections?.();
|
|
319
|
+
for (const socket of sockets) socket.destroy();
|
|
320
|
+
};
|
|
307
321
|
return {
|
|
308
322
|
url,
|
|
309
323
|
documentPath: document?.path,
|
|
310
324
|
previousDocumentPath: previous?.path,
|
|
311
|
-
close: ({ force = false } = {}) =>
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
325
|
+
close: ({ force = false } = {}) => {
|
|
326
|
+
if (!closing) {
|
|
327
|
+
closing = (async () => {
|
|
328
|
+
const closed = new Promise((resolve, reject) => server.close(error => error ? reject(error) : resolve()));
|
|
329
|
+
server.closeIdleConnections?.();
|
|
330
|
+
for (const socket of sockets) if (socket.bytesRead === 0 && !socket._httpMessage) socket.destroy();
|
|
331
|
+
if (force) destroyConnections();
|
|
332
|
+
try { await Promise.all([closed, reports?.close()]); }
|
|
333
|
+
finally {
|
|
334
|
+
serverClosed = true;
|
|
335
|
+
if (registry) await registry.close();
|
|
336
|
+
else if (singleProject) await singleProject.close();
|
|
337
|
+
else try { await document.close(); } finally { await previous?.close(); }
|
|
338
|
+
}
|
|
339
|
+
})();
|
|
340
|
+
} else if (force && !serverClosed) {
|
|
341
|
+
destroyConnections();
|
|
319
342
|
}
|
|
320
|
-
|
|
343
|
+
return closing;
|
|
344
|
+
},
|
|
321
345
|
};
|
|
322
346
|
}
|
|
@@ -24,7 +24,7 @@ export async function originalMaterials(sourceRoot, expectedIdentity) {
|
|
|
24
24
|
|
|
25
25
|
async function locate(file) {
|
|
26
26
|
if (!projectRoot) return { reason: 'The declared source root is unavailable. Restart the viewer with its repository directory.' };
|
|
27
|
-
if (!isPortablePath(file?.sourcePath) || !['markdown', 'report', 'original'].includes(file.kind)) {
|
|
27
|
+
if (!isPortablePath(file?.sourcePath) || !['markdown', 'report', 'original', 'canvas'].includes(file.kind)) {
|
|
28
28
|
return { reason: unavailable };
|
|
29
29
|
}
|
|
30
30
|
const candidate = path.join(root, file.sourcePath);
|
|
@@ -36,6 +36,7 @@ export async function startOriginalReportServer(readOriginal) {
|
|
|
36
36
|
server.listen(0, '127.0.0.1', resolve);
|
|
37
37
|
});
|
|
38
38
|
const host = '127.0.0.1:' + server.address().port;
|
|
39
|
+
let closing;
|
|
39
40
|
return {
|
|
40
41
|
links(map, files, project) {
|
|
41
42
|
return Object.fromEntries(files.map(([id, sourcePath]) => {
|
|
@@ -44,9 +45,12 @@ export async function startOriginalReportServer(readOriginal) {
|
|
|
44
45
|
}));
|
|
45
46
|
},
|
|
46
47
|
close() {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
return closing ??= (() => {
|
|
49
|
+
const closed = new Promise((resolve, reject) => server.close(error => error ? reject(error) : resolve()));
|
|
50
|
+
server.closeIdleConnections?.();
|
|
51
|
+
server.closeAllConnections?.();
|
|
52
|
+
return closed;
|
|
53
|
+
})();
|
|
50
54
|
},
|
|
51
55
|
};
|
|
52
56
|
}
|
|
@@ -72,7 +72,14 @@ function parseCatalog(text) {
|
|
|
72
72
|
|
|
73
73
|
const diagnostic = (code, message) => ({ code, message });
|
|
74
74
|
const writeLimit = error => {
|
|
75
|
-
if (error.code === 'DOCUMENT_LOCKED')
|
|
75
|
+
if (error.code === 'DOCUMENT_LOCKED') {
|
|
76
|
+
const reason = diagnostic('DOCUMENT_LOCKED', 'The document is open for writing in another viewer.');
|
|
77
|
+
if (error.lock) {
|
|
78
|
+
const { pid, role, createdAt, stale } = error.lock;
|
|
79
|
+
reason.lock = { pid, role, createdAt, stale };
|
|
80
|
+
}
|
|
81
|
+
return reason;
|
|
82
|
+
}
|
|
76
83
|
if (['READ_ONLY', 'EACCES', 'EPERM', 'EROFS'].includes(error.code)) {
|
|
77
84
|
return diagnostic('READ_ONLY', 'The document or its directory is read-only.');
|
|
78
85
|
}
|
|
@@ -460,11 +467,16 @@ async function openProject({ projectRoot, catalog: { id: project, entry, documen
|
|
|
460
467
|
if (!sketch && !member.document.modelId) await read(map);
|
|
461
468
|
if (closing) throw new DocumentError('OWNER_CLOSED', 'The project viewer is closing.');
|
|
462
469
|
try {
|
|
463
|
-
member.writer ??= await (sketch ? openSketchWriter(member.file)
|
|
470
|
+
member.writer ??= await (sketch ? openSketchWriter(member.file)
|
|
471
|
+
: openLocalDocument({ projectFile: member.file, modelId: member.document.modelId, role: 'viewer' }));
|
|
464
472
|
return scoped(map, member, await member.writer.read({ requireWrite: true }));
|
|
465
473
|
} catch (error) {
|
|
466
474
|
const readOnlyReason = writeLimit(error);
|
|
467
475
|
if (!readOnlyReason) throw error;
|
|
476
|
+
if (error.code === 'DOCUMENT_LOCKED' && member.writer) {
|
|
477
|
+
await closeWriter(member);
|
|
478
|
+
member.writer = undefined;
|
|
479
|
+
}
|
|
468
480
|
return { ...await read(map), readOnlyReason };
|
|
469
481
|
}
|
|
470
482
|
}),
|
|
@@ -131,7 +131,7 @@ export async function bindMapInputs(repository, library, entries, registryFile)
|
|
|
131
131
|
if (!artifactPath(document, artifact) || path.dirname(path.resolve(bundlePath)) !== path.resolve(outputDir)) throw new Error('Unexpected candidate for the build input record.');
|
|
132
132
|
const artifactVersion = await localFileVersion(library.path, artifact);
|
|
133
133
|
if (!artifactVersion) throw new Error('The verified build output is missing.');
|
|
134
|
-
const lock = await acquireDocumentLock(record, { checkParents: guard });
|
|
134
|
+
const lock = await acquireDocumentLock(record, { checkParents: guard, role: 'build' });
|
|
135
135
|
try {
|
|
136
136
|
const data = { format: 'locus-map.build-inputs', version: 1, document, artifact, artifactVersion, workingRoot, recipe, inputs: source.inputs, versions: before };
|
|
137
137
|
const text = JSON.stringify(data) + '\n';
|
|
@@ -18,7 +18,7 @@ export async function publishSketch({ library, map, text, check, io = fs }) {
|
|
|
18
18
|
await io.access(library.path, constants.W_OK);
|
|
19
19
|
const filename = path.join(library.path, map);
|
|
20
20
|
const parentCheck = () => check(false);
|
|
21
|
-
const lock = await acquireDocumentLock(filename, { io, checkParents: parentCheck }).catch(error => {
|
|
21
|
+
const lock = await acquireDocumentLock(filename, { io, checkParents: parentCheck, role: 'sketch-create' }).catch(error => {
|
|
22
22
|
if (error.code === 'DOCUMENT_LOCKED') throw collision();
|
|
23
23
|
throw error;
|
|
24
24
|
});
|
|
@@ -59,7 +59,7 @@ export async function buildTaskDocument({ root = '.', tasksDir, map, includeArch
|
|
|
59
59
|
throw new Error('Task facts or the project author module changed during the build. Rebuild the map.');
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
const lock = await acquireDocumentLock(dest, { checkParents: checkParent });
|
|
62
|
+
const lock = await acquireDocumentLock(dest, { checkParents: checkParent, role: 'task-build' });
|
|
63
63
|
async function publishTaskDocument(stage, out, { last, bundleName }) {
|
|
64
64
|
await lock.check();
|
|
65
65
|
const temp = join(parent, '.locus-map-' + randomUUID() + '.tmp');
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { realpath, stat } from 'node:fs/promises';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
|
|
4
|
+
async function statKind(filePath) {
|
|
5
|
+
try {
|
|
6
|
+
const info = await stat(filePath);
|
|
7
|
+
if (info.isFile()) return 'file';
|
|
8
|
+
if (info.isDirectory()) return 'dir';
|
|
9
|
+
return null;
|
|
10
|
+
} catch (error) {
|
|
11
|
+
if (['ENOENT', 'ENOTDIR'].includes(error.code)) return null;
|
|
12
|
+
throw error;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
async function canonicalPath(filePath) {
|
|
17
|
+
let current = path.resolve(filePath);
|
|
18
|
+
const suffix = [];
|
|
19
|
+
while (true) {
|
|
20
|
+
try {
|
|
21
|
+
const resolved = await realpath(current);
|
|
22
|
+
return suffix.length ? path.join(resolved, ...suffix.reverse()) : resolved;
|
|
23
|
+
} catch (error) {
|
|
24
|
+
if (!['ENOENT', 'ENOTDIR'].includes(error.code)) throw error;
|
|
25
|
+
const parent = path.dirname(current);
|
|
26
|
+
if (parent === current) return path.resolve(filePath);
|
|
27
|
+
suffix.push(path.basename(current));
|
|
28
|
+
current = parent;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function isBareTopicName(value) {
|
|
34
|
+
return typeof value === 'string' && value.length > 0
|
|
35
|
+
&& !value.includes('/') && !value.includes('\\') && !value.includes('\0')
|
|
36
|
+
&& value !== '.' && value !== '..' && path.basename(value) === value;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function enclosingLibraryRoot(targetPath) {
|
|
40
|
+
let directory = path.dirname(targetPath);
|
|
41
|
+
while (true) {
|
|
42
|
+
const parent = path.dirname(directory);
|
|
43
|
+
if (path.basename(directory) === '.locus-map' && parent !== directory) return parent;
|
|
44
|
+
if (parent === directory) return undefined;
|
|
45
|
+
directory = parent;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function isInsideDirectory(candidate, directory) {
|
|
50
|
+
const relative = path.relative(directory, candidate);
|
|
51
|
+
return Boolean(relative) && relative !== '..' && !relative.startsWith(`..${path.sep}`) && !path.isAbsolute(relative);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
async function inferSourceRoot(mode, targetPath, cwd) {
|
|
55
|
+
const [realTarget, realCwd] = await Promise.all([canonicalPath(targetPath), canonicalPath(cwd)]);
|
|
56
|
+
if (mode === 'library') return realTarget;
|
|
57
|
+
const fromLibrary = enclosingLibraryRoot(realTarget);
|
|
58
|
+
if (fromLibrary) return fromLibrary;
|
|
59
|
+
if (isInsideDirectory(realTarget, realCwd)) return realCwd;
|
|
60
|
+
return undefined;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
async function resolveTopicTarget(target, cwd, { projectFlag }) {
|
|
64
|
+
const direct = path.resolve(cwd, target);
|
|
65
|
+
const directKind = await statKind(direct);
|
|
66
|
+
if (directKind === 'file') {
|
|
67
|
+
const isCatalog = projectFlag || path.basename(direct) === 'project.json';
|
|
68
|
+
return { mode: isCatalog ? 'project' : 'document', targetPath: direct };
|
|
69
|
+
}
|
|
70
|
+
if (directKind === 'dir') {
|
|
71
|
+
const catalog = path.join(direct, 'project.json');
|
|
72
|
+
if (await statKind(catalog) === 'file') return { mode: 'project', targetPath: catalog };
|
|
73
|
+
const name = path.basename(direct);
|
|
74
|
+
if (!projectFlag && name === '.locus-map') return { mode: 'library', targetPath: path.dirname(direct) };
|
|
75
|
+
if (name !== '.locus-map') {
|
|
76
|
+
const namesake = path.join(direct, `${name}.locus-map.json`);
|
|
77
|
+
if (await statKind(namesake) === 'file') return { mode: 'document', targetPath: namesake };
|
|
78
|
+
}
|
|
79
|
+
if (!isBareTopicName(target) || name === '.locus-map') {
|
|
80
|
+
throw new Error(name === '.locus-map'
|
|
81
|
+
? `Cannot find "project.json" in "${target}".`
|
|
82
|
+
: `Cannot find "project.json" or "${name}.locus-map.json" in "${target}".`);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
if (isBareTopicName(target)) {
|
|
86
|
+
const candidates = [
|
|
87
|
+
{ mode: 'project', targetPath: path.resolve(cwd, '.locus-map', target, 'project.json') },
|
|
88
|
+
{ mode: 'document', targetPath: path.resolve(cwd, '.locus-map', target, `${target}.locus-map.json`) },
|
|
89
|
+
{ mode: 'document', targetPath: path.resolve(cwd, '.locus-map', `${target}.locus-map.json`) },
|
|
90
|
+
...(target === 'project'
|
|
91
|
+
? [{ mode: 'project', targetPath: path.resolve(cwd, '.locus-map', 'project.json') }]
|
|
92
|
+
: []),
|
|
93
|
+
];
|
|
94
|
+
for (const candidate of candidates) {
|
|
95
|
+
if (await statKind(candidate.targetPath) === 'file') return candidate;
|
|
96
|
+
}
|
|
97
|
+
throw new Error(
|
|
98
|
+
`Cannot find ${projectFlag ? 'project or diagram' : 'diagram or project'} "${target}". `
|
|
99
|
+
+ `Checked "${target}", ".locus-map/${target}/project.json", ".locus-map/${target}/${target}.locus-map.json", and ".locus-map/${target}.locus-map.json".`,
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
return { mode: projectFlag ? 'project' : 'document', targetPath: direct };
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Parse `locus-map view` CLI arguments, resolve topic/project shorthands relative
|
|
107
|
+
* to `cwd`, and return the canonical `open-map.mjs` argument list.
|
|
108
|
+
*/
|
|
109
|
+
export async function resolveViewArgs(args, { cwd = process.cwd(), usage }) {
|
|
110
|
+
const resolvedCwd = path.resolve(cwd);
|
|
111
|
+
const seen = new Set();
|
|
112
|
+
let local = false;
|
|
113
|
+
let hasProject = false;
|
|
114
|
+
let positional;
|
|
115
|
+
let sourceRoot;
|
|
116
|
+
let noSourceRoot = false;
|
|
117
|
+
let readOnly = false;
|
|
118
|
+
let port;
|
|
119
|
+
let previousDocument;
|
|
120
|
+
|
|
121
|
+
for (let index = 0; index < args.length; index++) {
|
|
122
|
+
const token = args[index];
|
|
123
|
+
if (token === '--document') throw new Error('Pass the document as the first argument to view.');
|
|
124
|
+
if (!token.startsWith('-')) {
|
|
125
|
+
if (positional !== undefined) throw new Error(usage);
|
|
126
|
+
positional = token;
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
if (seen.has(token)) throw new Error(usage);
|
|
130
|
+
seen.add(token);
|
|
131
|
+
if (token === '--local') { local = true; continue; }
|
|
132
|
+
if (token === '--read-only') { readOnly = true; continue; }
|
|
133
|
+
if (token === '--no-source-root') { noSourceRoot = true; continue; }
|
|
134
|
+
if (token === '--project') { hasProject = true; continue; }
|
|
135
|
+
const value = args[++index];
|
|
136
|
+
if (!value || value.startsWith('-')) throw new Error(usage);
|
|
137
|
+
if (token === '--source-root') sourceRoot = path.resolve(resolvedCwd, value);
|
|
138
|
+
else if (token === '--previous-document') previousDocument = path.resolve(resolvedCwd, value);
|
|
139
|
+
else if (token === '--port') {
|
|
140
|
+
if (!/^[0-9]+$/.test(value)) throw new Error(usage);
|
|
141
|
+
const parsed = Number(value);
|
|
142
|
+
if (!Number.isInteger(parsed) || parsed < 0 || parsed > 65535) throw new Error(usage);
|
|
143
|
+
port = value;
|
|
144
|
+
} else throw new Error(usage);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
if (sourceRoot !== undefined && noSourceRoot) throw new Error(usage);
|
|
148
|
+
if (hasProject && local) throw new Error(usage);
|
|
149
|
+
|
|
150
|
+
let mode;
|
|
151
|
+
let targetPath;
|
|
152
|
+
if (hasProject) {
|
|
153
|
+
if (positional === undefined) {
|
|
154
|
+
const rootCatalog = path.resolve(resolvedCwd, '.locus-map', 'project.json');
|
|
155
|
+
if (await statKind(rootCatalog) !== 'file') {
|
|
156
|
+
throw new Error('Cannot find root project catalog ".locus-map/project.json". Pass a catalog file, topic name, or use "locus-map view --local".');
|
|
157
|
+
}
|
|
158
|
+
mode = 'project';
|
|
159
|
+
targetPath = rootCatalog;
|
|
160
|
+
} else {
|
|
161
|
+
({ mode, targetPath } = await resolveTopicTarget(positional, resolvedCwd, { projectFlag: true }));
|
|
162
|
+
}
|
|
163
|
+
} else if (positional !== undefined) {
|
|
164
|
+
({ mode, targetPath } = await resolveTopicTarget(positional, resolvedCwd, { projectFlag: false }));
|
|
165
|
+
} else {
|
|
166
|
+
const isolated = local || sourceRoot !== undefined || noSourceRoot;
|
|
167
|
+
mode = isolated ? 'library' : 'user-projects';
|
|
168
|
+
targetPath = resolvedCwd;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
if (previousDocument !== undefined && mode !== 'document') throw new Error(usage);
|
|
172
|
+
|
|
173
|
+
const effectiveSourceRoot = mode === 'user-projects'
|
|
174
|
+
? undefined
|
|
175
|
+
: sourceRoot ?? (noSourceRoot ? undefined : await inferSourceRoot(mode, targetPath, resolvedCwd));
|
|
176
|
+
|
|
177
|
+
const openArgs = [`--${mode}`, targetPath];
|
|
178
|
+
if (previousDocument !== undefined) openArgs.push('--previous-document', previousDocument);
|
|
179
|
+
if (effectiveSourceRoot !== undefined) openArgs.push('--source-root', effectiveSourceRoot);
|
|
180
|
+
if (readOnly) openArgs.push('--read-only');
|
|
181
|
+
if (port !== undefined) openArgs.push('--port', port);
|
|
182
|
+
return { mode, targetPath, sourceRoot: effectiveSourceRoot, openArgs };
|
|
183
|
+
}
|
|
@@ -7,15 +7,16 @@ import { startMapViewer } from '../map-viewer-server.mjs';
|
|
|
7
7
|
const self = fileURLToPath(import.meta.url);
|
|
8
8
|
const fail = (code, message) => Object.assign(new Error(message), { code });
|
|
9
9
|
|
|
10
|
-
async function publishSurface(recordPath, record) {
|
|
11
|
-
const temporary = recordPath + '.' + randomUUID() + '.tmp';
|
|
10
|
+
async function publishSurface(recordPath, record, temporary = recordPath + '.' + randomUUID() + '.tmp') {
|
|
12
11
|
const file = await open(temporary, 'wx', 0o600);
|
|
12
|
+
let closed = false;
|
|
13
13
|
try {
|
|
14
14
|
await file.writeFile(JSON.stringify(record) + '\n');
|
|
15
|
+
closed = true;
|
|
15
16
|
await file.close();
|
|
16
17
|
await rename(temporary, recordPath);
|
|
17
18
|
} finally {
|
|
18
|
-
await file.close();
|
|
19
|
+
if (!closed) await file.close().catch(() => {});
|
|
19
20
|
await rm(temporary, { force: true });
|
|
20
21
|
}
|
|
21
22
|
}
|
|
@@ -36,8 +37,9 @@ export async function startReaderSurface(config) {
|
|
|
36
37
|
throw fail('READER_ALREADY_STARTED', 'This reader call already owns a surface attempt.');
|
|
37
38
|
throw error;
|
|
38
39
|
});
|
|
40
|
+
const runningTempPath = config.recordPath + '.' + randomUUID() + '.tmp';
|
|
39
41
|
return new Promise((resolveReady, reject) => {
|
|
40
|
-
const child = fork(self, ['--worker', JSON.stringify(config)], {
|
|
42
|
+
const child = fork(self, ['--worker', JSON.stringify({ ...config, runningTempPath })], {
|
|
41
43
|
stdio: ['ignore', 'ignore', 'ignore', 'ipc'],
|
|
42
44
|
execArgv: [],
|
|
43
45
|
});
|
|
@@ -51,6 +53,7 @@ export async function startReaderSurface(config) {
|
|
|
51
53
|
? Promise.resolve() : new Promise(resolve => child.once('close', resolve));
|
|
52
54
|
child.kill('SIGKILL');
|
|
53
55
|
await stopped;
|
|
56
|
+
await rm(runningTempPath, { force: true }).catch(() => {});
|
|
54
57
|
let failure = error;
|
|
55
58
|
try {
|
|
56
59
|
await publishSurface(
|
|
@@ -94,11 +97,12 @@ async function worker(config) {
|
|
|
94
97
|
const began = Date.now();
|
|
95
98
|
let viewer,
|
|
96
99
|
closing = false,
|
|
100
|
+
ready = false,
|
|
97
101
|
watcher,
|
|
98
102
|
deadline,
|
|
99
103
|
hardStop;
|
|
100
104
|
let writing = Promise.resolve();
|
|
101
|
-
const write = (value) => {
|
|
105
|
+
const write = (value, temporary) => {
|
|
102
106
|
const next = writing.then(() => publishSurface(config.recordPath, {
|
|
103
107
|
schemaVersion: 1,
|
|
104
108
|
runId: config.runId,
|
|
@@ -107,7 +111,7 @@ async function worker(config) {
|
|
|
107
111
|
startedAt: new Date(began).toISOString(),
|
|
108
112
|
expiresAt: new Date(began + config.timeoutMs + 5000).toISOString(),
|
|
109
113
|
...value,
|
|
110
|
-
}));
|
|
114
|
+
}, temporary));
|
|
111
115
|
writing = next.catch(() => {});
|
|
112
116
|
return next;
|
|
113
117
|
};
|
|
@@ -118,11 +122,13 @@ async function worker(config) {
|
|
|
118
122
|
clearTimeout(deadline);
|
|
119
123
|
try {
|
|
120
124
|
await viewer?.close({ force: true });
|
|
121
|
-
await write({ state: 'closed', reason, url: viewer?.url ?? null });
|
|
125
|
+
if (ready) await write({ state: 'closed', reason, url: viewer?.url ?? null });
|
|
126
|
+
else await writing;
|
|
122
127
|
clearTimeout(hardStop);
|
|
123
128
|
process.exitCode = 0;
|
|
124
129
|
} catch (error) {
|
|
125
|
-
await write({ state: 'failed', reason: error.message }).catch(() => {});
|
|
130
|
+
if (ready) await write({ state: 'failed', reason: error.message }).catch(() => {});
|
|
131
|
+
clearTimeout(hardStop);
|
|
126
132
|
process.exitCode = 1;
|
|
127
133
|
}
|
|
128
134
|
};
|
|
@@ -136,9 +142,10 @@ async function worker(config) {
|
|
|
136
142
|
await viewer.close({ force: true });
|
|
137
143
|
return;
|
|
138
144
|
}
|
|
139
|
-
await write({ state: 'running', url: viewer.url });
|
|
145
|
+
await write({ state: 'running', url: viewer.url }, config.runningTempPath);
|
|
140
146
|
if (closing) return;
|
|
141
147
|
process.send?.({ kind: 'ready', url: viewer.url, pid: process.pid });
|
|
148
|
+
ready = true;
|
|
142
149
|
let inspecting = false;
|
|
143
150
|
watcher = setInterval(async () => {
|
|
144
151
|
if (inspecting || closing) return;
|
|
@@ -175,8 +182,19 @@ async function worker(config) {
|
|
|
175
182
|
}
|
|
176
183
|
}, 250);
|
|
177
184
|
} catch (error) {
|
|
178
|
-
|
|
179
|
-
|
|
185
|
+
// Before readiness, the parent owns failure publication and immediately SIGKILLs the worker.
|
|
186
|
+
closing = true;
|
|
187
|
+
clearInterval(watcher);
|
|
188
|
+
clearTimeout(deadline);
|
|
189
|
+
clearTimeout(hardStop);
|
|
190
|
+
await viewer?.close({ force: true }).catch(() => {});
|
|
191
|
+
await writing;
|
|
192
|
+
if (process.connected) {
|
|
193
|
+
try {
|
|
194
|
+
process.send?.({ kind: 'error', message: error.message });
|
|
195
|
+
} catch {}
|
|
196
|
+
}
|
|
197
|
+
process.exitCode = 1;
|
|
180
198
|
}
|
|
181
199
|
}
|
|
182
200
|
if (process.argv[1] && resolve(process.argv[1]) === self && process.argv[2] === '--worker')
|
package/scripts/locus-map.mjs
CHANGED
|
@@ -11,16 +11,21 @@ const usage = `Usage:
|
|
|
11
11
|
locus-map build [build-map options]
|
|
12
12
|
locus-map tasks export [--root DIR] [--dir .tasks] [--include-archived]
|
|
13
13
|
locus-map view --help
|
|
14
|
-
locus-map view [--local] [--read-only] [--port N]
|
|
15
|
-
locus-map view
|
|
16
|
-
locus-map view --project
|
|
14
|
+
locus-map view [--local] [--source-root DIR | --no-source-root] [--read-only] [--port N]
|
|
15
|
+
locus-map view TARGET [--source-root DIR | --no-source-root] [--read-only] [--port N] [--previous-document FILE]
|
|
16
|
+
locus-map view --project [TARGET] [--source-root DIR | --no-source-root] [--read-only] [--port N]`;
|
|
17
17
|
|
|
18
18
|
const viewHelp = `${usage.slice(usage.indexOf(' locus-map view [--local]'))}
|
|
19
19
|
|
|
20
20
|
Start one local viewer and open the URL it prints. Keep its process running.
|
|
21
21
|
Register named folders in ~/.locusmap/projects.toml. Existing projects.json registries also work.
|
|
22
22
|
Without a registry, view opens Personal and any library in the launch directory.
|
|
23
|
-
--local skips the home registry. Explicit
|
|
23
|
+
--local skips the home registry. Explicit target, --project and --source-root launches also skip it.
|
|
24
|
+
TARGET may be a file, directory or topic name under .locus-map/ (.locus-map/<name>/project.json,
|
|
25
|
+
.locus-map/<name>/<name>.locus-map.json or .locus-map/<name>.locus-map.json). --project without a
|
|
26
|
+
target opens the root .locus-map/project.json. Isolated launches default --source-root to the
|
|
27
|
+
enclosing project directory when the target lives under .locus-map/ or the launch directory; pass
|
|
28
|
+
--no-source-root to disable original-file links.
|
|
24
29
|
Workspace launches default to 127.0.0.1:8181 or the configured port. --port N overrides both.
|
|
25
30
|
Use --port 0 for a free port, the default for explicit and isolated launches. --read-only disables file saves.
|
|
26
31
|
Launch and configuration guide: ${join(root, 'docs', 'VIEWER-LAUNCH.md')}`;
|
|
@@ -31,6 +36,7 @@ async function doctor(json) {
|
|
|
31
36
|
productRoot: root,
|
|
32
37
|
docsRoot: join(root, 'docs'),
|
|
33
38
|
mapSkillPath: join(root, 'skills/locus-map/SKILL.md'),
|
|
39
|
+
draftSkillPath: join(root, 'skills/locus-map-draft/SKILL.md'),
|
|
34
40
|
primitivesSkillPath: join(root, 'skills/locus-map-primitives/SKILL.md'),
|
|
35
41
|
researchSkillPath: join(root, 'skills/locus-map-research/SKILL.md'),
|
|
36
42
|
drawSkillPath: null,
|
|
@@ -56,7 +62,7 @@ async function doctor(json) {
|
|
|
56
62
|
} catch (error) { result.reasons.push(error.message); }
|
|
57
63
|
|
|
58
64
|
try {
|
|
59
|
-
await Promise.all([join(result.docsRoot, 'DIAGRAM-SOURCE.md'), result.mapSkillPath, result.primitivesSkillPath, result.researchSkillPath]
|
|
65
|
+
await Promise.all([join(result.docsRoot, 'DIAGRAM-SOURCE.md'), result.mapSkillPath, result.draftSkillPath, result.primitivesSkillPath, result.researchSkillPath]
|
|
60
66
|
.map(async path => {
|
|
61
67
|
if (!(await stat(path)).isFile()) throw new Error(`Expected a file at ${path}.`);
|
|
62
68
|
}));
|
|
@@ -126,22 +132,10 @@ async function main([command, ...args]) {
|
|
|
126
132
|
return 0;
|
|
127
133
|
}
|
|
128
134
|
if (command === 'build') return run('build-map.mjs', args);
|
|
129
|
-
if (command === 'view' && args[0] === '--project' && args[1] && !args[1].startsWith('--')) {
|
|
130
|
-
return run('open-map.mjs', ['--project', resolve(args[1]), ...args.slice(2)]);
|
|
131
|
-
}
|
|
132
|
-
if (command === 'view' && args[0] && !args[0].startsWith('--')) {
|
|
133
|
-
const [file, ...options] = args;
|
|
134
|
-
for (let index = 0; index < options.length; index++) {
|
|
135
|
-
if (options[index] === '--document') throw new Error('Pass the document as the first argument to view.');
|
|
136
|
-
if (options[index] === '--previous-document' && options[index + 1] && !options[index + 1].startsWith('--')) {
|
|
137
|
-
options[++index] = resolve(options[index]);
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
return run('open-map.mjs', ['--document', resolve(file), ...options]);
|
|
141
|
-
}
|
|
142
135
|
if (command === 'view') {
|
|
143
|
-
const
|
|
144
|
-
|
|
136
|
+
const { resolveViewArgs } = await import('./lib/view-args.mjs');
|
|
137
|
+
const { openArgs } = await resolveViewArgs(args, { cwd: process.cwd(), usage });
|
|
138
|
+
return run('open-map.mjs', openArgs);
|
|
145
139
|
}
|
|
146
140
|
throw new Error(usage);
|
|
147
141
|
}
|