@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
|
@@ -34,12 +34,29 @@ function diagnosticsOf(error) {
|
|
|
34
34
|
path: String(row.path ?? '/'),
|
|
35
35
|
message: String(row.message ?? error.message),
|
|
36
36
|
...(row.severity === undefined ? {} : { severity: row.severity }),
|
|
37
|
+
...(row.viewId === undefined ? {} : { viewId: row.viewId }),
|
|
37
38
|
...(row.ids === undefined ? {} : { ids: row.ids }),
|
|
38
39
|
...(row.sourcePath === undefined ? {} : { sourcePath: row.sourcePath, line: row.line, column: row.column }),
|
|
39
40
|
}));
|
|
40
41
|
return [{ code: String(error?.code ?? 'BUILD_FAILED'), path: '/', message: String(error?.message ?? 'Build failed.') }];
|
|
41
42
|
}
|
|
42
43
|
|
|
44
|
+
function attributeChildFailure(error, name) {
|
|
45
|
+
const prefix = `/canvases/${name}`;
|
|
46
|
+
const diagnostics = diagnosticsOf(error).map(({ viewId, ...row }) => {
|
|
47
|
+
if (row.path === prefix || row.path.startsWith(`${prefix}/`)) return { ...row, severity: row.severity ?? 'error' };
|
|
48
|
+
const suffix = row.path !== '/' ? (row.path.startsWith('/') ? row.path : `/${row.path}`) : '';
|
|
49
|
+
const label = viewId ? `${name} · ${viewId}` : name;
|
|
50
|
+
return {
|
|
51
|
+
...row,
|
|
52
|
+
severity: row.severity ?? 'error',
|
|
53
|
+
path: `${prefix}${viewId ? `/views/${viewId}` : ''}${suffix}`,
|
|
54
|
+
message: row.message.startsWith(`[${name}`) ? row.message : `[${label}] ${row.message}`,
|
|
55
|
+
};
|
|
56
|
+
});
|
|
57
|
+
return new MapAuthoringError(diagnostics);
|
|
58
|
+
}
|
|
59
|
+
|
|
43
60
|
const diagnosticCheck = diagnostic => ({
|
|
44
61
|
...diagnostic, severity: diagnostic.severity ?? 'error', passed: false,
|
|
45
62
|
ids: diagnostic.ids ?? [diagnostic.path], value: diagnostic.ids?.length ?? 1, limit: 0,
|
|
@@ -58,6 +75,41 @@ const mainPathMissing = checks => checks.some(row => row.code === 'MAIN_PATH_MIS
|
|
|
58
75
|
+ 'Declare LM_MainPath("entry ... result"), or record "Main path and roles: none — <reason>" in handoff.md for a view without one flow.',
|
|
59
76
|
}] : [];
|
|
60
77
|
|
|
78
|
+
const DETOUR_RULES = {
|
|
79
|
+
EDGE_ROUTE_DETOUR: {
|
|
80
|
+
defaultLimit: 4,
|
|
81
|
+
describe: (ratio, maxRatio, ids) => `Relation detour exceeds ${ratio}× direct distance `
|
|
82
|
+
+ `(max ${maxRatio}×; relations: ${ids}). `
|
|
83
|
+
+ 'Inspect the rendered route for an unnecessary outer detour or obstructing header text before publishing.',
|
|
84
|
+
},
|
|
85
|
+
ADJACENT_EDGE_DETOUR: {
|
|
86
|
+
defaultLimit: 2.5,
|
|
87
|
+
describe: (ratio, maxRatio, ids) => `Adjacent relation detour exceeds ${ratio}× card gap or abandoned facing sides `
|
|
88
|
+
+ `(max ${maxRatio}×; relations: ${ids}). `
|
|
89
|
+
+ 'Inspect ports and intervening headers/obstacles before publishing.',
|
|
90
|
+
},
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
/** Surface excessive or adjacent route detours in diagnostics and stderr alongside MAIN_PATH_MISSING. */
|
|
94
|
+
export const routeDetours = checks => checks
|
|
95
|
+
.filter(row => Object.hasOwn(DETOUR_RULES, row.code) && !row.passed)
|
|
96
|
+
.map(row => {
|
|
97
|
+
const rule = DETOUR_RULES[row.code];
|
|
98
|
+
const ratio = row.limit?.maxRatio ?? rule.defaultLimit;
|
|
99
|
+
const maxRatio = row.value?.maxRatio ?? 'unknown';
|
|
100
|
+
const ids = row.ids?.length ? row.ids.join(', ') : 'unknown';
|
|
101
|
+
return {
|
|
102
|
+
code: row.code,
|
|
103
|
+
severity: 'warning',
|
|
104
|
+
path: row.ids?.length === 1 ? `/relations/${row.ids[0]}` : '/relations',
|
|
105
|
+
ids: row.ids ?? [],
|
|
106
|
+
message: rule.describe(ratio, maxRatio, ids),
|
|
107
|
+
};
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
const hasDiagnostic = (list, code, ids) => list.some(item =>
|
|
111
|
+
item.code === code && (ids === undefined || isDeepStrictEqual(item.ids, ids)));
|
|
112
|
+
|
|
61
113
|
// A project generator can supply its emitted JSON in memory while sourcePath still identifies the input.
|
|
62
114
|
export async function buildDiagram({ sourcePath, sourceText: emittedSource, outputDir, style, handwrittenCardFill, multiScreen = false, citationBindings, detailsFilesPath, chromiumPath, chromiumSource = 'api', timeoutMs = 90_000 }, {
|
|
63
115
|
browserBuilder = runBrowserBuild,
|
|
@@ -84,7 +136,29 @@ export async function buildDiagram({ sourcePath, sourceText: emittedSource, outp
|
|
|
84
136
|
throw error;
|
|
85
137
|
}
|
|
86
138
|
let { model, chain } = compiled;
|
|
87
|
-
|
|
139
|
+
let browserResolution, selectedBrowser;
|
|
140
|
+
const ensureBrowser = () => browserResolution ??= Promise.resolve().then(async () => {
|
|
141
|
+
selectedBrowser = await browserResolver?.({ chromiumPath, source: chromiumSource });
|
|
142
|
+
return selectedBrowser;
|
|
143
|
+
});
|
|
144
|
+
const buildInBrowser = async (model, chain) => browserBuilder({
|
|
145
|
+
projectRoot, model, chain, staticDelivery: false, frameToViewport: true, style, handwrittenCardFill,
|
|
146
|
+
browser: await ensureBrowser(), chromiumPath, viewport: { width: 1600, height: 1000 }, timeoutMs,
|
|
147
|
+
});
|
|
148
|
+
const buildCanvas = async ({ name, model, chain }) => {
|
|
149
|
+
try {
|
|
150
|
+
const child = await buildInBrowser(model, chain);
|
|
151
|
+
admitBuiltDelivery(child, chain.views.map(view => view.id), { viewportFramed: true });
|
|
152
|
+
const errors = child.layoutDiagnostics.flatMap(row => row.diagnostics
|
|
153
|
+
.filter(item => item.code !== 'LABEL_NO_SLOT' && item.severity !== 'warning')
|
|
154
|
+
.map(item => ({ ...item, viewId: item.viewId ?? row.viewId, severity: item.severity ?? 'error' })));
|
|
155
|
+
if (errors.length) throw new MapAuthoringError(errors);
|
|
156
|
+
return { bundle: child.bundle };
|
|
157
|
+
} catch (error) {
|
|
158
|
+
throw attributeChildFailure(error, name);
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
const materials = detailsFilesPath === undefined ? undefined : await readDetailsFiles(detailsFilesPath, model, { deferCanvasBuilds: true });
|
|
88
162
|
const withReadingFiles = candidate => materials ? parseAndValidate({
|
|
89
163
|
...candidate, assets: { ...candidate.assets, ...materials.metadata }, reading: materials.reading,
|
|
90
164
|
}) : candidate;
|
|
@@ -96,7 +170,7 @@ export async function buildDiagram({ sourcePath, sourceText: emittedSource, outp
|
|
|
96
170
|
const stage = await createOutputStage(out);
|
|
97
171
|
|
|
98
172
|
const pngName = `${source.id}.png`, bundleName = `${source.id}.locus-map.json`;
|
|
99
|
-
let
|
|
173
|
+
let browser, imageBuffer, published = false, publishing = false, checkRows = [];
|
|
100
174
|
|
|
101
175
|
const publishFailure = async (error, existingChecks = []) => {
|
|
102
176
|
if (published) return;
|
|
@@ -122,19 +196,8 @@ export async function buildDiagram({ sourcePath, sourceText: emittedSource, outp
|
|
|
122
196
|
|
|
123
197
|
try {
|
|
124
198
|
if (emitSource) await writeFile(resolve(stage, 'source.map.json'), json(source));
|
|
125
|
-
|
|
126
|
-
browser = structuredClone(await
|
|
127
|
-
projectRoot,
|
|
128
|
-
model,
|
|
129
|
-
chain,
|
|
130
|
-
staticDelivery: false,
|
|
131
|
-
frameToViewport: true,
|
|
132
|
-
style, handwrittenCardFill,
|
|
133
|
-
browser: selectedBrowser,
|
|
134
|
-
chromiumPath,
|
|
135
|
-
viewport: { width: 1600, height: 1000 },
|
|
136
|
-
timeoutMs,
|
|
137
|
-
}));
|
|
199
|
+
if (materials?.pendingCanvases.length) await materials.buildPendingCanvases(buildCanvas);
|
|
200
|
+
browser = structuredClone(await buildInBrowser(model, chain));
|
|
138
201
|
const delivery = admitBuiltDelivery(browser, [viewId], { viewportFramed: true });
|
|
139
202
|
imageBuffer = delivery.imageBuffers[viewId];
|
|
140
203
|
const officialBrowser = delivery.reportedOfficial && browserBuilder === runBrowserBuild && browserRestorer === runBrowserRestore;
|
|
@@ -167,9 +230,11 @@ export async function buildDiagram({ sourcePath, sourceText: emittedSource, outp
|
|
|
167
230
|
]);
|
|
168
231
|
}
|
|
169
232
|
|
|
170
|
-
const
|
|
171
|
-
|
|
172
|
-
|
|
233
|
+
const postCheckDiagnostics = [
|
|
234
|
+
...legendDiagnostics,
|
|
235
|
+
...mainPathMissing(evaluation.checks),
|
|
236
|
+
...routeDetours(evaluation.checks),
|
|
237
|
+
];
|
|
173
238
|
|
|
174
239
|
if (materials) {
|
|
175
240
|
const original = await loadChainBundle(browser.bundle);
|
|
@@ -179,6 +244,7 @@ export async function buildDiagram({ sourcePath, sourceText: emittedSource, outp
|
|
|
179
244
|
model = withReadingFiles(model);
|
|
180
245
|
browser.bundle = await saveChainBundle({
|
|
181
246
|
model, chain: original.chain, scenes: original.scenes, assets: new Map([...original.assets, ...materials.assets]),
|
|
247
|
+
...(materials.canvases.size && { canvases: materials.canvases }),
|
|
182
248
|
});
|
|
183
249
|
}
|
|
184
250
|
const stagedBundlePath = resolve(stage, bundleName);
|
|
@@ -203,6 +269,12 @@ export async function buildDiagram({ sourcePath, sourceText: emittedSource, outp
|
|
|
203
269
|
code: 'BROWSER_RESTORE_CHANGED', path: '/browser/restore', message: JSON.stringify(comparison.views.filter(item => !item.matches)),
|
|
204
270
|
}]);
|
|
205
271
|
|
|
272
|
+
// Defer warning emission until post-check restore succeeds so failures report each warning once via catch.
|
|
273
|
+
for (const diagnostic of postCheckDiagnostics) {
|
|
274
|
+
sourceDiagnostics.push(diagnostic);
|
|
275
|
+
onDiagnostic(diagnostic);
|
|
276
|
+
}
|
|
277
|
+
|
|
206
278
|
evaluation.checks.push(
|
|
207
279
|
{ code: 'SEMANTIC_ADMISSION', severity: 'error', passed: true, ids: [viewId], value: true, limit: true },
|
|
208
280
|
{ code: 'BUNDLE_READBACK', severity: 'error', passed: true, ids: [viewId], value: true, limit: true },
|
|
@@ -238,7 +310,15 @@ export async function buildDiagram({ sourcePath, sourceText: emittedSource, outp
|
|
|
238
310
|
// Once at the final boundary: routing attempts may each fail, but the missing path is one fact.
|
|
239
311
|
const missing = mainPathMissing(checkRows);
|
|
240
312
|
if (!published && missing.length && Array.isArray(error?.diagnostics)
|
|
241
|
-
&& !
|
|
313
|
+
&& !hasDiagnostic(sourceDiagnostics, 'MAIN_PATH_MISSING')
|
|
314
|
+
&& !hasDiagnostic(error.diagnostics, 'MAIN_PATH_MISSING')) error.diagnostics.push(...missing);
|
|
315
|
+
for (const detour of routeDetours(checkRows)) {
|
|
316
|
+
if (!published && Array.isArray(error?.diagnostics)
|
|
317
|
+
&& !hasDiagnostic(sourceDiagnostics, detour.code, detour.ids)
|
|
318
|
+
&& !hasDiagnostic(error.diagnostics, detour.code, detour.ids)) {
|
|
319
|
+
error.diagnostics.push(detour);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
242
322
|
if (!publishing && !published) await publishFailure(error);
|
|
243
323
|
throw error;
|
|
244
324
|
} finally {
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// Build-time .mjs sources run as trusted code in a Node subprocess with the builder's permissions.
|
|
2
|
+
import { writeSync } from 'node:fs';
|
|
3
|
+
import { BUNDLE_LIMITS } from '../bundle/safety.js';
|
|
4
|
+
import { pathToFileURL } from 'node:url';
|
|
5
|
+
import { registerHooks } from 'node:module';
|
|
6
|
+
import { sourcePrimitives } from './sourceView.js';
|
|
7
|
+
|
|
8
|
+
const chunks = [];
|
|
9
|
+
for await (const chunk of process.stdin) chunks.push(chunk);
|
|
10
|
+
const { source } = JSON.parse(Buffer.concat(chunks).toString('utf8'));
|
|
11
|
+
const filePath = process.argv[2];
|
|
12
|
+
const url = pathToFileURL(filePath).href;
|
|
13
|
+
process.argv = [process.execPath, filePath];
|
|
14
|
+
registerHooks({
|
|
15
|
+
resolve(specifier, context, next) {
|
|
16
|
+
return specifier === url ? { url, shortCircuit: true } : next(specifier, context);
|
|
17
|
+
},
|
|
18
|
+
load(target, context, next) {
|
|
19
|
+
return target === url ? { format: 'module', source, shortCircuit: true } : next(target, context);
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
const pauseBuffer = new Int32Array(new SharedArrayBuffer(4));
|
|
23
|
+
const output = [];
|
|
24
|
+
let stdoutBytes = 0;
|
|
25
|
+
let overflowed = false;
|
|
26
|
+
let emitted = false;
|
|
27
|
+
let hasExport = false;
|
|
28
|
+
let exportResult;
|
|
29
|
+
const limitError = () => {
|
|
30
|
+
overflowed = true;
|
|
31
|
+
return new Error('Canvas source stdout exceeds the size limit.');
|
|
32
|
+
};
|
|
33
|
+
function writeAllSync(fd, data) {
|
|
34
|
+
let offset = 0;
|
|
35
|
+
while (offset < data.length) {
|
|
36
|
+
try { offset += writeSync(fd, data, offset, data.length - offset); }
|
|
37
|
+
catch (error) {
|
|
38
|
+
if (error.code === 'EAGAIN') { Atomics.wait(pauseBuffer, 0, 0, 1); continue; }
|
|
39
|
+
throw error;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
const emitSync = payload => writeAllSync(1, Buffer.from(JSON.stringify(payload), 'utf8'));
|
|
44
|
+
const writeStderrSync = text => writeAllSync(2, Buffer.from(text, 'utf8'));
|
|
45
|
+
process.stdout.write = (chunk, encoding, cb) => {
|
|
46
|
+
const callback = typeof encoding === 'function' ? encoding : cb;
|
|
47
|
+
const charset = typeof encoding === 'string' ? encoding : undefined;
|
|
48
|
+
const bytes = typeof chunk === 'string' ? Buffer.from(chunk, charset) : Buffer.from(chunk);
|
|
49
|
+
stdoutBytes += bytes.byteLength;
|
|
50
|
+
if (stdoutBytes > BUNDLE_LIMITS.bundleBytes) throw limitError();
|
|
51
|
+
if (bytes.byteLength) output.push(bytes);
|
|
52
|
+
callback?.();
|
|
53
|
+
return true;
|
|
54
|
+
};
|
|
55
|
+
function finalize(code) {
|
|
56
|
+
const effectiveCode = process.exitCode !== undefined ? Number(process.exitCode) : code;
|
|
57
|
+
if (emitted || code !== 0 || effectiveCode !== 0) return;
|
|
58
|
+
if (overflowed) {
|
|
59
|
+
writeStderrSync('Canvas source stdout exceeds the size limit.\n');
|
|
60
|
+
process.exitCode = 1;
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
try {
|
|
64
|
+
if (hasExport) {
|
|
65
|
+
emitted = true;
|
|
66
|
+
emitSync(exportResult);
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
const text = new TextDecoder('utf-8', { fatal: true }).decode(Buffer.concat(output));
|
|
70
|
+
if (!text.trim()) {
|
|
71
|
+
writeStderrSync('Canvas source module must export a diagram source or write schema-v1 JSON to stdout.\n');
|
|
72
|
+
process.exitCode = 1;
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
emitted = true;
|
|
76
|
+
emitSync({ mode: 'cli', text });
|
|
77
|
+
} catch (error) {
|
|
78
|
+
writeStderrSync(`${error?.message || error}\n`);
|
|
79
|
+
process.exitCode = 1;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
const rawEmit = process.emit.bind(process);
|
|
83
|
+
process.emit = (event, ...args) => {
|
|
84
|
+
const result = rawEmit(event, ...args);
|
|
85
|
+
if (event === 'exit') finalize(args[0]);
|
|
86
|
+
return result;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
const mod = await import(url);
|
|
90
|
+
const plain = value => value && [Object.prototype, null].includes(Object.getPrototypeOf(value));
|
|
91
|
+
const author = typeof mod.default === 'function' || plain(mod.default) ? mod.default : mod.diagram ?? mod.source;
|
|
92
|
+
if (author !== undefined) {
|
|
93
|
+
exportResult = { mode: 'export', source: typeof author === 'function' ? await author(sourcePrimitives) : author };
|
|
94
|
+
hasExport = true;
|
|
95
|
+
}
|
|
96
|
+
if (stdoutBytes > BUNDLE_LIMITS.bundleBytes) throw limitError();
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { fileURLToPath } from 'node:url';
|
|
2
|
+
import { execFileBounded } from './boundedProcess.mjs';
|
|
3
|
+
import { compileDiagramSource, parseDiagramSourceText, validateDiagramSource } from './diagramSource.js';
|
|
4
|
+
import { parsePlantumlSource } from './plantumlSource.js';
|
|
5
|
+
import { locatePlantumlDiagnostics } from './plantumlSyntax.js';
|
|
6
|
+
import { MapAuthoringError } from './mapAuthoring.js';
|
|
7
|
+
import { BUNDLE_LIMITS } from '../bundle/safety.js';
|
|
8
|
+
|
|
9
|
+
const worker = fileURLToPath(new URL('./canvas-source-worker.mjs', import.meta.url));
|
|
10
|
+
const bounds = { timeoutMs: 20_000, maxBuffer: 16 * 1024 * 1024 };
|
|
11
|
+
|
|
12
|
+
export async function compileCanvasSourceFile({ filePath, bytes, sourceFormat }) {
|
|
13
|
+
let imported;
|
|
14
|
+
try {
|
|
15
|
+
if (bytes.byteLength > BUNDLE_LIMITS.bundleBytes) throw new Error('Canvas source exceeds the size limit.');
|
|
16
|
+
const text = new TextDecoder('utf-8', { fatal: true }).decode(bytes);
|
|
17
|
+
let source;
|
|
18
|
+
if (sourceFormat === 'mjs') {
|
|
19
|
+
// Execute the admitted bytes once as trusted code in a Node subprocess with the builder's permissions.
|
|
20
|
+
const { stdout } = await execFileBounded(process.execPath, [worker, filePath], {
|
|
21
|
+
...bounds, input: JSON.stringify({ source: text }),
|
|
22
|
+
});
|
|
23
|
+
if (!stdout.trim()) throw new Error('Canvas source module must export a diagram source or write schema-v1 JSON to stdout.');
|
|
24
|
+
const result = JSON.parse(stdout);
|
|
25
|
+
if (result?.mode === 'cli') source = parseDiagramSourceText(result.text);
|
|
26
|
+
else if (result?.mode === 'export') source = validateDiagramSource(result.source);
|
|
27
|
+
else throw new Error('Invalid canvas source worker result.');
|
|
28
|
+
} else if (sourceFormat === 'puml') {
|
|
29
|
+
imported = parsePlantumlSource(text, { sourcePath: filePath });
|
|
30
|
+
source = imported.source;
|
|
31
|
+
} else if (sourceFormat === 'map-json') {
|
|
32
|
+
source = parseDiagramSourceText(text);
|
|
33
|
+
} else throw new Error('Unsupported canvas source format.');
|
|
34
|
+
const { model, chain } = compileDiagramSource(source);
|
|
35
|
+
return { sourceFormat, source, model, chain, title: source.title || model.title };
|
|
36
|
+
} catch (error) {
|
|
37
|
+
if (imported && error.diagnostics) throw new MapAuthoringError(locatePlantumlDiagnostics(error.diagnostics, imported.locations, filePath));
|
|
38
|
+
if (error instanceof MapAuthoringError) throw error;
|
|
39
|
+
throw new MapAuthoringError([{ code: 'INVALID_DETAILS_FILE', path: filePath, message: error.stderr?.trim() || error.message }]);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { presentation as drawPresentation } from '@locus-forge/locus-draw/scene';
|
|
1
2
|
import { isModernProfile } from '@locus-forge/locus-draw/source';
|
|
2
3
|
import { inspectDiagramLayout } from './diagramLayoutChecks.js';
|
|
3
|
-
import { inspectAreaLayout, ROUTE_DETOUR_WARN_RATIO } from '../adapter/areas.js';
|
|
4
|
+
import { ADJACENT_DETOUR_WARN_RATIO, inspectAreaLayout, ROUTE_DETOUR_WARN_RATIO } from '../adapter/areas.js';
|
|
4
5
|
import { inspectPageLayout } from '../adapter/page.js';
|
|
6
|
+
import { savedCardTemplate, supportedCardPresentation } from '../adapter/cards/template.js';
|
|
5
7
|
import { C4_REFERENCE_PROFILE, isDiagramPresentationProfile, isEditorialPresentationProfile, relationPresentation } from '../contract/diagramPresentation.js';
|
|
6
8
|
|
|
7
9
|
export const DIAGRAM_READABILITY = Object.freeze({
|
|
@@ -88,6 +90,124 @@ function conditionInLabel(edge) {
|
|
|
88
90
|
return pattern.test(normalizedConditionText(edge.label ?? ''));
|
|
89
91
|
}
|
|
90
92
|
|
|
93
|
+
const TITLE_ORPHAN_LINE_RATIO = 0.35;
|
|
94
|
+
const TITLE_SINGLE_WORD_BALANCE_RATIO = 0.55;
|
|
95
|
+
const TITLE_NAME_ROLES = new Set(['name', 'label']);
|
|
96
|
+
const COMPOSITE_CARD_ROLES = new Set(['card-outline', 'card-fold', 'card-cap']);
|
|
97
|
+
|
|
98
|
+
function profileWiderCardOption(profile) {
|
|
99
|
+
if (!profile || !supportedCardPresentation(profile)) return null;
|
|
100
|
+
const template = savedCardTemplate(profile);
|
|
101
|
+
const baseWidth = template?.card?.width;
|
|
102
|
+
if (!Number.isFinite(baseWidth)) return null;
|
|
103
|
+
if (Number.isFinite(template?.extraWide?.width) && template.extraWide.width > baseWidth) {
|
|
104
|
+
return { size: 'extra-wide', width: template.extraWide.width };
|
|
105
|
+
}
|
|
106
|
+
if (Number.isFinite(template?.card?.wideWidth) && template.card.wideWidth > baseWidth) {
|
|
107
|
+
return { size: 'wide', width: template.card.wideWidth };
|
|
108
|
+
}
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/** Flag awkward automatic title wraps without nagging over intentional breaks or balanced two-line titles. */
|
|
113
|
+
export function inspectTitleWraps(model, scene) {
|
|
114
|
+
const elements = Array.isArray(scene?.elements) ? scene.elements : [];
|
|
115
|
+
const shapesById = new Map();
|
|
116
|
+
const compositeIds = new Set();
|
|
117
|
+
const outlinesById = new Map();
|
|
118
|
+
const foldsById = new Set();
|
|
119
|
+
const glyphIds = new Set();
|
|
120
|
+
for (const element of elements) {
|
|
121
|
+
const mapping = element?.customData?.locusMap;
|
|
122
|
+
if (element?.isDeleted || mapping?.kind !== 'node') continue;
|
|
123
|
+
if (mapping.role === 'shape') shapesById.set(mapping.semanticId, element);
|
|
124
|
+
if (COMPOSITE_CARD_ROLES.has(mapping.role)) compositeIds.add(mapping.semanticId);
|
|
125
|
+
if (mapping.role === 'card-outline') outlinesById.set(mapping.semanticId, element);
|
|
126
|
+
if (mapping.role === 'card-fold') foldsById.add(mapping.semanticId);
|
|
127
|
+
if (typeof mapping.role === 'string' && mapping.role.startsWith('icon-')) glyphIds.add(mapping.semanticId);
|
|
128
|
+
}
|
|
129
|
+
const nodesById = new Map((model?.nodes ?? []).map(node => [node.id, node]));
|
|
130
|
+
const profile = model?.presentationProfile;
|
|
131
|
+
const widerOption = profileWiderCardOption(profile);
|
|
132
|
+
const templateCard = profile && supportedCardPresentation(profile) ? savedCardTemplate(profile)?.card : null;
|
|
133
|
+
const findings = [];
|
|
134
|
+
for (const element of elements) {
|
|
135
|
+
const mapping = element?.customData?.locusMap;
|
|
136
|
+
if (element?.type !== 'text' || element.isDeleted || mapping?.kind !== 'node' || !TITLE_NAME_ROLES.has(mapping.role)) continue;
|
|
137
|
+
if (typeof element.text !== 'string' || !Number.isFinite(element.fontSize) || element.fontSize <= 0) continue;
|
|
138
|
+
const lines = element.text.replace(/\r\n?/gu, '\n').split('\n').map(line => line.trim()).filter(Boolean);
|
|
139
|
+
if (lines.length <= 1) continue;
|
|
140
|
+
const modelNode = nodesById.get(mapping.semanticId);
|
|
141
|
+
const explicitBreak = (typeof modelNode?.label === 'string' && /[\r\n]/u.test(modelNode.label))
|
|
142
|
+
|| (typeof element.originalText === 'string' && /[\r\n]/u.test(element.originalText));
|
|
143
|
+
if (explicitBreak) continue;
|
|
144
|
+
|
|
145
|
+
const rawSingleLine = typeof element.originalText === 'string' && element.originalText.trim()
|
|
146
|
+
? element.originalText
|
|
147
|
+
: typeof modelNode?.label === 'string' && modelNode.label.trim()
|
|
148
|
+
? modelNode.label
|
|
149
|
+
: lines.join(' ');
|
|
150
|
+
const singleLineText = rawSingleLine.replace(/\s+/gu, ' ').trim();
|
|
151
|
+
const singleLineWidth = drawPresentation.renderedTextWidth(singleLineText, element.fontSize, element.fontFamily);
|
|
152
|
+
const lineWidths = lines.map(line => drawPresentation.renderedTextWidth(line, element.fontSize, element.fontFamily));
|
|
153
|
+
const firstLineWidth = Math.max(1, lineWidths[0] ?? 0);
|
|
154
|
+
const lastLine = lines.at(-1) ?? '';
|
|
155
|
+
const lastLineWords = lastLine ? lastLine.split(/\s+/u) : [];
|
|
156
|
+
const lastLineWidth = lineWidths.at(-1) ?? 0;
|
|
157
|
+
|
|
158
|
+
const shape = shapesById.get(mapping.semanticId);
|
|
159
|
+
const cardWidth = Number.isFinite(shape?.width) ? shape.width : null;
|
|
160
|
+
let recoveredSlotWidth = 0;
|
|
161
|
+
const needsSlotRecovery = (element.textAlign === 'center' && drawPresentation.isTitleFirstProfile(profile))
|
|
162
|
+
|| (Boolean(profile) && !isDiagramPresentationProfile(profile));
|
|
163
|
+
if (needsSlotRecovery && cardWidth !== null && templateCard && Number.isFinite(templateCard.padding)) {
|
|
164
|
+
const cut = Math.min(24, cardWidth * 0.12);
|
|
165
|
+
const outline = outlinesById.get(mapping.semanticId);
|
|
166
|
+
const hasFold = foldsById.has(mapping.semanticId);
|
|
167
|
+
const isHexagon = Boolean(outline && Number.isFinite(shape?.x) && outline.x > shape.x + 0.5);
|
|
168
|
+
const iconSpace = glyphIds.has(mapping.semanticId) && Number.isFinite(templateCard.glyphSize)
|
|
169
|
+
? templateCard.glyphSize + (templateCard.glyphGap ?? 0)
|
|
170
|
+
: 0;
|
|
171
|
+
recoveredSlotWidth = Math.max(0, cardWidth - 2 * (templateCard.padding + (isHexagon ? cut : 0)) - (hasFold ? cut : 0) - iconSpace);
|
|
172
|
+
}
|
|
173
|
+
const allocatedWidth = Math.max(
|
|
174
|
+
Number.isFinite(element.width) && element.width > 0 ? element.width : 0,
|
|
175
|
+
recoveredSlotWidth,
|
|
176
|
+
firstLineWidth,
|
|
177
|
+
);
|
|
178
|
+
const extraWidthPx = Math.max(1, Math.ceil(singleLineWidth - allocatedWidth));
|
|
179
|
+
|
|
180
|
+
const isStandardRect = shape?.type === 'rectangle'
|
|
181
|
+
&& shape.strokeColor !== 'transparent'
|
|
182
|
+
&& !compositeIds.has(mapping.semanticId);
|
|
183
|
+
const hasWiderOption = Boolean(widerOption && isStandardRect && cardWidth !== null && widerOption.width > cardWidth + 1);
|
|
184
|
+
const widerSizeFits = hasWiderOption && extraWidthPx <= widerOption.width - cardWidth;
|
|
185
|
+
|
|
186
|
+
const referenceWidth = Math.max(allocatedWidth, firstLineWidth);
|
|
187
|
+
const slotRatio = lastLineWidth / referenceWidth;
|
|
188
|
+
const singleWordOrphan = lastLineWords.length === 1
|
|
189
|
+
&& lastLineWidth / firstLineWidth < TITLE_SINGLE_WORD_BALANCE_RATIO;
|
|
190
|
+
|
|
191
|
+
const reasons = [];
|
|
192
|
+
if (lines.length >= 3) reasons.push('many-lines');
|
|
193
|
+
if (lines.length === 2 && widerSizeFits) reasons.push('wider-size-fits');
|
|
194
|
+
if (lines.length === 2 && (singleWordOrphan || slotRatio < TITLE_ORPHAN_LINE_RATIO)) {
|
|
195
|
+
reasons.push('orphan-wrap');
|
|
196
|
+
}
|
|
197
|
+
if (!reasons.length) continue;
|
|
198
|
+
|
|
199
|
+
findings.push({
|
|
200
|
+
id: mapping.semanticId,
|
|
201
|
+
lines: lines.length,
|
|
202
|
+
reasons,
|
|
203
|
+
cardWidth: cardWidth === null ? null : Math.round(cardWidth),
|
|
204
|
+
extraWidthPx,
|
|
205
|
+
...(hasWiderOption ? { suggestedSize: widerOption.size } : {}),
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
return findings;
|
|
209
|
+
}
|
|
210
|
+
|
|
91
211
|
/** Fixed reader-facing checks over the official restored scene and browser measurements. */
|
|
92
212
|
export function evaluateDiagramChecks({ model, scene, browserMeasurement, layoutDiagnostics = [], officialBrowser, mainPath, multiScreen = false }) {
|
|
93
213
|
const checks = mainPathChecks(model, scene, mainPath);
|
|
@@ -120,6 +240,23 @@ export function evaluateDiagramChecks({ model, scene, browserMeasurement, layout
|
|
|
120
240
|
const overflows = browserMeasurement?.overflows ?? [];
|
|
121
241
|
checks.push(check('CARD_TEXT_OVERFLOW', 'error', overflows.length === 0, overflows.map(row => row.id), overflows.length, 0));
|
|
122
242
|
|
|
243
|
+
const titleWraps = inspectTitleWraps(model, scene);
|
|
244
|
+
checks.push({
|
|
245
|
+
...check(
|
|
246
|
+
'TITLE_WRAP_WARNING',
|
|
247
|
+
'warning',
|
|
248
|
+
titleWraps.length === 0,
|
|
249
|
+
titleWraps.map(row => row.id),
|
|
250
|
+
{
|
|
251
|
+
count: titleWraps.length,
|
|
252
|
+
maxLines: titleWraps.length ? Math.max(...titleWraps.map(row => row.lines)) : 1,
|
|
253
|
+
maxExtraWidthPx: titleWraps.length ? Math.max(...titleWraps.map(row => row.extraWidthPx)) : 0,
|
|
254
|
+
},
|
|
255
|
+
{ maxCount: 0 },
|
|
256
|
+
),
|
|
257
|
+
...(titleWraps.length ? { details: titleWraps } : {}),
|
|
258
|
+
});
|
|
259
|
+
|
|
123
260
|
if (isDiagramPresentationProfile(model.presentationProfile)) {
|
|
124
261
|
const missingDetails = [
|
|
125
262
|
...model.nodes.filter(node => node.technical?.external !== true && node.body === (node.technical?.responsibility ?? '')).map(node => node.id),
|
|
@@ -164,6 +301,11 @@ export function evaluateDiagramChecks({ model, scene, browserMeasurement, layout
|
|
|
164
301
|
checks.push(check('EDGE_ROUTE_DETOUR', 'warning', detours.length === 0, detours.flatMap(item => item.ids ?? []),
|
|
165
302
|
{ count: detours.length, maxRatio: detours.length ? Math.max(...detours.map(item => item.value)) : 0 },
|
|
166
303
|
{ maxRatio: ROUTE_DETOUR_WARN_RATIO }));
|
|
304
|
+
const adjacentDetours = areaDiagnostics.filter(item => item.code === 'ADJACENT_EDGE_DETOUR');
|
|
305
|
+
checks.push(check('ADJACENT_EDGE_DETOUR', 'warning', adjacentDetours.length === 0,
|
|
306
|
+
adjacentDetours.flatMap(item => item.ids ?? []),
|
|
307
|
+
{ count: adjacentDetours.length, maxRatio: adjacentDetours.length ? Math.max(...adjacentDetours.map(item => item.value)) : 0 },
|
|
308
|
+
{ maxRatio: adjacentDetours[0]?.limit ?? ADJACENT_DETOUR_WARN_RATIO }));
|
|
167
309
|
const pageCollisions = inspectPageLayout(model, scene.elements);
|
|
168
310
|
checks.push(check('PAGE_GRAPH_COLLISION', 'error', pageCollisions.length === 0,
|
|
169
311
|
pageCollisions.flatMap(item => item.ids ?? []), pageCollisions.length, 0));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DrawSourceError,
|
|
3
|
+
copyJson,
|
|
3
4
|
toDrawing,
|
|
4
5
|
parseDiagramSourceText as parseSourceText,
|
|
5
6
|
validateDiagramSource as validateSource,
|
|
@@ -8,6 +9,9 @@ import {
|
|
|
8
9
|
import { parseAndValidate } from '../contract/index.js';
|
|
9
10
|
import { parseAndValidateChain } from '../chain/index.js';
|
|
10
11
|
import { DIAGRAM_CARD_PRESENTATION } from '../contract/diagramPresentation.js';
|
|
12
|
+
import { deepFreeze } from '../contract/safety.js';
|
|
13
|
+
import { validateReadingTable } from '../contract/readingTable.js';
|
|
14
|
+
|
|
11
15
|
import { MapAuthoringError } from './mapAuthoring.js';
|
|
12
16
|
|
|
13
17
|
export { REGISTERED_SOURCE_PRESENTATION_PROFILES };
|
|
@@ -23,10 +27,27 @@ export function withMapSourceErrors(operation) {
|
|
|
23
27
|
}
|
|
24
28
|
}
|
|
25
29
|
|
|
26
|
-
export
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
export function parseDiagramSourceText(text) {
|
|
31
|
+
try {
|
|
32
|
+
return withMapSourceErrors(() => parseSourceText(text));
|
|
33
|
+
} catch (error) {
|
|
34
|
+
// Draw reports unknown root fields only after its JSON limits and duplicate-key check.
|
|
35
|
+
if (!error.diagnostics?.some(item => item.code === 'UNKNOWN_FIELD' && item.path === '/readingTable')) throw error;
|
|
36
|
+
return validateDiagramSource(JSON.parse(text));
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function validateDiagramSource(input) {
|
|
41
|
+
if (!input || !Object.hasOwn(input, 'readingTable')) return withMapSourceErrors(() => validateSource(input));
|
|
42
|
+
const diagnostics = [];
|
|
43
|
+
const copy = copyJson(input, (code, path, message) => diagnostics.push({ code, path, message }));
|
|
44
|
+
if (diagnostics.length) throw new MapAuthoringError(diagnostics);
|
|
45
|
+
const { readingTable, ...drawingSource } = copy;
|
|
46
|
+
const source = withMapSourceErrors(() => validateSource(drawingSource));
|
|
47
|
+
const table = validateReadingTable(readingTable, source.nodes.map(node => node.id));
|
|
48
|
+
if (!table.valid) throw new MapAuthoringError(table.diagnostics);
|
|
49
|
+
return deepFreeze({ ...source, readingTable });
|
|
50
|
+
}
|
|
30
51
|
|
|
31
52
|
export function compileDiagramSource(
|
|
32
53
|
source,
|
|
@@ -35,6 +56,10 @@ export function compileDiagramSource(
|
|
|
35
56
|
REGISTERED_SOURCE_PRESENTATION_PROFILES[profile],
|
|
36
57
|
} = {},
|
|
37
58
|
) {
|
|
59
|
+
let readingTable;
|
|
60
|
+
if (Object.hasOwn(source, 'readingTable')) {
|
|
61
|
+
({ readingTable, ...source } = validateDiagramSource(source));
|
|
62
|
+
}
|
|
38
63
|
const presentationProfile = profileResolver(source.profile);
|
|
39
64
|
if (typeof presentationProfile !== 'string')
|
|
40
65
|
throw new MapAuthoringError([
|
|
@@ -44,7 +69,7 @@ export function compileDiagramSource(
|
|
|
44
69
|
message: `Profile ${source.profile} is admitted but unavailable in this compiler installation.`,
|
|
45
70
|
},
|
|
46
71
|
]);
|
|
47
|
-
const drawing = toDrawing(source);
|
|
72
|
+
const drawing = withMapSourceErrors(() => toDrawing(source));
|
|
48
73
|
const authoredNodes = new Map(source.nodes.map((node) => [node.id, node]));
|
|
49
74
|
const nodes = drawing.nodes.map((node) => {
|
|
50
75
|
const authored = authoredNodes.get(node.id);
|
|
@@ -106,6 +131,7 @@ export function compileDiagramSource(
|
|
|
106
131
|
maxNodes: nodes.length,
|
|
107
132
|
nodeIds: nodes.map((node) => node.id),
|
|
108
133
|
edgeIds: edges.map((edge) => edge.id),
|
|
134
|
+
...(readingTable && { readingTable }),
|
|
109
135
|
...(source.readingTree && { readingTree: source.readingTree }),
|
|
110
136
|
...(Object.keys(layout).length > 1
|
|
111
137
|
? {
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
import { printPlantumlSource as printSource } from '@locus-forge/locus-draw/source';
|
|
2
|
-
import { withMapSourceErrors } from './diagramSource.js';
|
|
2
|
+
import { validateDiagramSource, withMapSourceErrors } from './diagramSource.js';
|
|
3
|
+
import { MapAuthoringError } from './mapAuthoring.js';
|
|
3
4
|
|
|
4
|
-
export
|
|
5
|
+
export function printPlantumlSource(input) {
|
|
6
|
+
if (input && typeof input === 'object' && Object.hasOwn(input, 'readingTable')) {
|
|
7
|
+
validateDiagramSource(input);
|
|
8
|
+
throw new MapAuthoringError([{
|
|
9
|
+
code: 'TEXT_NOT_REPRESENTABLE',
|
|
10
|
+
path: '/readingTable',
|
|
11
|
+
message: 'Keep a source with readingTable in JSON to preserve its structured table declaration.',
|
|
12
|
+
}]);
|
|
13
|
+
}
|
|
14
|
+
return withMapSourceErrors(() => printSource(input));
|
|
15
|
+
}
|