@inkeep/open-knowledge 0.12.0-beta.9 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/THIRD_PARTY_NOTICES.md +35 -0
- package/dist/_baseFor-m0TxKeb9.mjs +2 -0
- package/dist/alias-JE7RI5QX-DmHh8yog.mjs +1 -0
- package/dist/arc-Doj9VrmJ.mjs +2 -0
- package/dist/architecture-YZFGNWBL-YPACCZ88.mjs +1 -0
- package/dist/architectureDiagram-Q4EWVU46-C9cSuC8m.mjs +37 -0
- package/dist/array-1jkOhClC.mjs +2 -0
- package/dist/assets/skills/discovery/SKILL.md +1 -1
- package/dist/assets/skills/project/SKILL.md +6 -4
- package/dist/awk2-POPGKRAI-C7696e-z.mjs +1 -0
- package/dist/{banner-BeneQTB4.mjs → banner-BxCFCyu8.mjs} +2 -2
- package/dist/base64-4YMZCVJ5-BIHNwDj2.mjs +1 -0
- package/dist/basename-AA2KJYZQ-Dcz4Ls85.mjs +1 -0
- package/dist/bash-IJWYRKFO-DgruzS3i.mjs +1 -0
- package/dist/blockDiagram-DXYQGD6D-Dr7L7QsL.mjs +133 -0
- package/dist/build-CCDQyip-.mjs +1 -0
- package/dist/{build-CJEQ0nGy.mjs → build-DCHzh6iE.mjs} +1 -1
- package/dist/c4Diagram-AHTNJAMY-CPm6kKNR.mjs +11 -0
- package/dist/cat-RDUMLXKC-BJJIS9lB.mjs +1 -0
- package/dist/channel-DE79NHCf.mjs +2 -0
- package/dist/chmod-SYMGL4JA-C1Ie7s0s.mjs +1 -0
- package/dist/{chokidar-BDjANGpQ.mjs → chokidar-Bu9Rdqzq.mjs} +1 -1
- package/dist/{chunk-24IMIIXA-C-Zyd2K_.mjs → chunk-24IMIIXA-DaS5XS55.mjs} +2 -2
- package/dist/chunk-2KRD3SAO-BXl7sX-7.mjs +2 -0
- package/dist/chunk-336JU56O-KTMEs5Wk.mjs +2 -0
- package/dist/{chunk-3THT3N7L-Ce6LrnIA.mjs → chunk-3THT3N7L-B1WzJUh4.mjs} +1 -1
- package/dist/{chunk-3ZUFRYJ4-C93H8j0V.mjs → chunk-3ZUFRYJ4-Bv1jGN68.mjs} +1 -1
- package/dist/chunk-426QAEUC-DUpKwtVu.mjs +2 -0
- package/dist/{chunk-44UOCSGV-uErOrz7G.mjs → chunk-44UOCSGV-BZ6LfyW2.mjs} +1 -1
- package/dist/chunk-4BX2VUAB-DM-mXRDw.mjs +2 -0
- package/dist/{chunk-4GTNDTRF-_OVmXcJ-.mjs → chunk-4GTNDTRF-DLnFbNSw.mjs} +2 -2
- package/dist/{chunk-4HHKTUW3-Dm69hDaZ.mjs → chunk-4HHKTUW3-Ct4ue15f.mjs} +1 -1
- package/dist/{chunk-4Q4SM6WR-DDQRsilN.mjs → chunk-4Q4SM6WR-CAvCnPq5.mjs} +2 -2
- package/dist/chunk-4TB4RGXK-Ct6WjPoY.mjs +207 -0
- package/dist/chunk-55IACEB6-Cmyc0XwJ.mjs +2 -0
- package/dist/{chunk-55VFSPNA-DVZfQAzN.mjs → chunk-55VFSPNA-RFvY6zq0.mjs} +2 -2
- package/dist/chunk-5FUZZQ4R-Bf6nbyQG.mjs +63 -0
- package/dist/chunk-5PVQY5BW-DUXm3tDu.mjs +3 -0
- package/dist/{chunk-5QMZ5MUS-BfIuRNkK.mjs → chunk-5QMZ5MUS-BwpNU33k.mjs} +2 -2
- package/dist/{chunk-5QVNJEHU-BvsipSFW.mjs → chunk-5QVNJEHU-BV0xuiYW.mjs} +2 -2
- package/dist/{chunk-5V6VZH6T-BCr5_GDF.mjs → chunk-5V6VZH6T-ByuVaPWr.mjs} +2 -2
- package/dist/{chunk-62RKD26F-CvuML91F.mjs → chunk-62RKD26F-DebCAz0V.mjs} +2 -2
- package/dist/{chunk-64BAICW3-CTJNEx4Q.mjs → chunk-64BAICW3-BlirlXmE.mjs} +2 -2
- package/dist/chunk-67CJDMHE-C58W8DAL.mjs +2 -0
- package/dist/{chunk-74CEPOFO-D1bzz49u.mjs → chunk-74CEPOFO-V0JXh91S.mjs} +1 -1
- package/dist/{chunk-7L36YK2X-RiPZFKaV.mjs → chunk-7L36YK2X-B3QRwLbB.mjs} +1 -1
- package/dist/chunk-7N4EOEYR-DzEIb3Sc.mjs +2 -0
- package/dist/{chunk-7TSDKFEO-a-GUGBTu.mjs → chunk-7TSDKFEO-CMVuiOdP.mjs} +1 -1
- package/dist/{chunk-A4HU7SVR-hefV_YmW.mjs → chunk-A4HU7SVR-Bjuqsbev.mjs} +1 -1
- package/dist/{chunk-A4JSPFCI-k-tJSZgB.mjs → chunk-A4JSPFCI-CQJoYugB.mjs} +2 -2
- package/dist/{chunk-A5O5YHGN-C6ngIqYR.mjs → chunk-A5O5YHGN-DApqA6Ow.mjs} +2 -2
- package/dist/{chunk-A65PWWJC-D7J5l9eq.mjs → chunk-A65PWWJC-GGt9898w.mjs} +2 -2
- package/dist/{chunk-A7A2DBEE-PLfkXLI4.mjs → chunk-A7A2DBEE-BqvlRSRw.mjs} +1 -1
- package/dist/{chunk-A7ICOL4V-Drb3XsEL.mjs → chunk-A7ICOL4V-D5TsVU6v.mjs} +2 -2
- package/dist/chunk-AA7GKIK3-DKgpQZxa.mjs +2 -0
- package/dist/{chunk-ALLTKNUZ-BMiTDN50.mjs → chunk-ALLTKNUZ-4H3OLfNN.mjs} +2 -2
- package/dist/{chunk-APT7OOP2-CXHnSuct.mjs → chunk-APT7OOP2-DnIeUlVe.mjs} +2 -2
- package/dist/{chunk-BBXLRYSX-Oks1GMhO.mjs → chunk-BBXLRYSX-XWD4jM9A.mjs} +2 -2
- package/dist/{chunk-BRGMQKJV-CHO764qS.mjs → chunk-BRGMQKJV-CHbk2NqS.mjs} +3 -3
- package/dist/chunk-BSJP7CBP-BG3yJGkJ.mjs +2 -0
- package/dist/{chunk-FK9Q3tQk.mjs → chunk-C94x7I9S.mjs} +1 -1
- package/dist/chunk-CIAEETIT-CH33zQ9L.mjs +2 -0
- package/dist/{chunk-CR5AFCPT-CH8ZGz3B.mjs → chunk-CR5AFCPT-DN7EAdus.mjs} +2 -2
- package/dist/{chunk-CWQS3NFK-BP3kiNgH.mjs → chunk-CWQS3NFK-BkE4vqrf.mjs} +1 -1
- package/dist/{chunk-D4J545R4-C8nMOauR.mjs → chunk-D4J545R4-KlK3EOFl.mjs} +2 -2
- package/dist/{chunk-D6CWQ5DW-BgQGt8eQ.mjs → chunk-D6CWQ5DW-CF9bBHyK.mjs} +2 -2
- package/dist/{chunk-D7MEQ3VN-Csvth_Ss.mjs → chunk-D7MEQ3VN-BM_kIbvf.mjs} +2 -2
- package/dist/{chunk-DCAAORBQ-BdrR5ttw.mjs → chunk-DCAAORBQ-BUMlCZ4-.mjs} +2 -2
- package/dist/{chunk-DXB73IDG-C2RuFAAY.mjs → chunk-DXB73IDG-F_tmy-Lz.mjs} +2 -2
- package/dist/chunk-EDXVE4YY-CI4s3JHP.mjs +2 -0
- package/dist/{chunk-EEXR5ZDP-C5AJH114.mjs → chunk-EEXR5ZDP-CvpAxUxM.mjs} +1 -1
- package/dist/{chunk-EIZGF4BS-8bsVXqW0.mjs → chunk-EIZGF4BS-C8wRSfCC.mjs} +2 -2
- package/dist/chunk-ENJZ2VHE-CQwjtY5A.mjs +11 -0
- package/dist/{chunk-F23WWYKW-DST0dB7V.mjs → chunk-F23WWYKW-DLeNVzzD.mjs} +2 -2
- package/dist/{chunk-F55TLFGB-Bkfd8ak_.mjs → chunk-F55TLFGB-BZSRX-Vi.mjs} +2 -2
- package/dist/{chunk-FEIOJCZD-DmvuPNqm.mjs → chunk-FEIOJCZD-NzTooVTc.mjs} +2 -2
- package/dist/chunk-FMBD7UC4-CAloFUY3.mjs +16 -0
- package/dist/chunk-FOC6F5B3-Cv5O0Fxp.mjs +2 -0
- package/dist/{chunk-GCTKCWKD-Deqi1D_N.mjs → chunk-GCTKCWKD-D3J1Ev9z.mjs} +1 -1
- package/dist/{chunk-GFQRA5P5-ePq2jelx.mjs → chunk-GFQRA5P5-DbAN9IDm.mjs} +1 -1
- package/dist/{chunk-GOV5EKKI-CyL1eJ32.mjs → chunk-GOV5EKKI-CDGzZWfT.mjs} +2 -2
- package/dist/{chunk-GXVXFKBA-993FoPmq.mjs → chunk-GXVXFKBA-D0BDCtkE.mjs} +2 -2
- package/dist/{chunk-HDQ56CKY-pGV4pOJA.mjs → chunk-HDQ56CKY-DZc2LbWr.mjs} +2 -2
- package/dist/{chunk-HJQJAYMS-Ci3vsKQW.mjs → chunk-HJQJAYMS-BS_JF11O.mjs} +1 -1
- package/dist/{chunk-HJWBQKYG-UZig4wUt.mjs → chunk-HJWBQKYG-DknkBuxy.mjs} +2 -2
- package/dist/{chunk-HWBSOZZR-BeVrNfQw.mjs → chunk-HWBSOZZR-5PJ_z6D6.mjs} +2 -2
- package/dist/{chunk-HWKDQ44K-CPSjqtR_.mjs → chunk-HWKDQ44K-BJxdK4fT.mjs} +2 -2
- package/dist/{chunk-I57KEIP3-5RFY25TO.mjs → chunk-I57KEIP3-DSoF8c_0.mjs} +2 -2
- package/dist/chunk-ICPOFSXX-C--tVIY5.mjs +123 -0
- package/dist/{chunk-IPJHKYVM-D6H6ZTtk.mjs → chunk-IPJHKYVM-CUKythEA.mjs} +1 -1
- package/dist/{chunk-J642UCRS-D87gHOLP.mjs → chunk-J642UCRS-HjD8qpZD.mjs} +2 -2
- package/dist/{chunk-JVPRLUMK-DnQCNjpq.mjs → chunk-JVPRLUMK-D6CRdXSO.mjs} +2 -2
- package/dist/chunk-K5T4RW27-BPgPjo39.mjs +98 -0
- package/dist/chunk-KGLVRYIC-CmkADDeV.mjs +2 -0
- package/dist/{chunk-KMEYNNUA-DfdK88O_.mjs → chunk-KMEYNNUA-Qk0eg7gN.mjs} +2 -2
- package/dist/chunk-LIHQZDEY-Fy8O-IVI.mjs +2 -0
- package/dist/{chunk-LL3S3NLB-DxXgE3kY.mjs → chunk-LL3S3NLB-CH16p_-s.mjs} +2 -2
- package/dist/{chunk-LPQPILI2-DyyhWSR7.mjs → chunk-LPQPILI2-OoVL_l9j.mjs} +2 -2
- package/dist/{chunk-LTZRCH7N-GAjTFNwG.mjs → chunk-LTZRCH7N-BfgCUlp9.mjs} +2 -2
- package/dist/{chunk-LWEGUNWT-BALY4RLC.mjs → chunk-LWEGUNWT-DhbhFY11.mjs} +2 -2
- package/dist/{chunk-MDDMCKUK-poQ25EjI.mjs → chunk-MDDMCKUK-ChL1CU4m.mjs} +2 -2
- package/dist/{chunk-MDLLFABN-oBQf6bGE.mjs → chunk-MDLLFABN-UsHGHHoh.mjs} +2 -2
- package/dist/{chunk-MHTUABJP-dKmK6Hw7.mjs → chunk-MHTUABJP-Dk5ocjFo.mjs} +1 -1
- package/dist/{chunk-MIZPJHVH-BdoPqh_Y.mjs → chunk-MIZPJHVH-BD7tHmLL.mjs} +2 -2
- package/dist/{chunk-MLXIYONF-DwewZM3r.mjs → chunk-MLXIYONF-CV7WHBm-.mjs} +2 -2
- package/dist/{chunk-MYE6AGBJ-B4pRo9ma.mjs → chunk-MYE6AGBJ-DwzjGrc0.mjs} +2 -2
- package/dist/{chunk-NAERJDUW-BFcmkHme.mjs → chunk-NAERJDUW-Cyg2DAzO.mjs} +2 -2
- package/dist/{chunk-NCNPKYJZ-BFGan4lR.mjs → chunk-NCNPKYJZ-Ct0_l0YT.mjs} +2 -2
- package/dist/{chunk-NUYSJFDK-DAvAseHr.mjs → chunk-NUYSJFDK-BH2DjyxF.mjs} +2 -2
- package/dist/{chunk-NYQYO467-_2947cgi.mjs → chunk-NYQYO467-CY88QCuT.mjs} +2 -2
- package/dist/{chunk-OARHFVLG-vxL5zuWx.mjs → chunk-OARHFVLG-dXiYYC4o.mjs} +2 -2
- package/dist/{chunk-OCLXQMOG-C7k2qEN6.mjs → chunk-OCLXQMOG-DOkdFgyf.mjs} +2 -2
- package/dist/{chunk-OCS6LSEM-Lh1p0H-V.mjs → chunk-OCS6LSEM-Bcx6uxmm.mjs} +2 -2
- package/dist/{chunk-OJDRYQWQ-DWhg7YHU.mjs → chunk-OJDRYQWQ-CmrD0Dg2.mjs} +1 -1
- package/dist/{chunk-OL3S66CO-B3hSNlNP.mjs → chunk-OL3S66CO-CWEDi2F_.mjs} +2 -2
- package/dist/chunk-ORNJ4GCN-R_gUIosC.mjs +2 -0
- package/dist/chunk-OYMX7WX6-Dvg98Zb-.mjs +232 -0
- package/dist/{chunk-PBXLG62G-MmAqjdXR.mjs → chunk-PBXLG62G-CpvczNyQ.mjs} +2 -2
- package/dist/{chunk-PP6PSHAB-DMC_XCfO.mjs → chunk-PP6PSHAB-DQ3LPONR.mjs} +1 -1
- package/dist/{chunk-PYSFUGCK-CY7pclEB.mjs → chunk-PYSFUGCK-B_Gv8rUn.mjs} +2 -2
- package/dist/{chunk-QCDB2VPH-D1RuXtOm.mjs → chunk-QCDB2VPH-Bays5mAr.mjs} +2 -2
- package/dist/{chunk-QJ7O6ZN3-BH67tCjg.mjs → chunk-QJ7O6ZN3-BCF2wp2J.mjs} +2 -2
- package/dist/chunk-QZHKN3VN-D0OJ2eQ1.mjs +2 -0
- package/dist/{chunk-R6QSAL5T-CtbJTvt9.mjs → chunk-R6QSAL5T-RaNW7MSS.mjs} +1 -1
- package/dist/{chunk-R6VWJ2ZL-D1Ufj9fh.mjs → chunk-R6VWJ2ZL-BVeTwIsz.mjs} +1 -1
- package/dist/{chunk-RPNGRAAP-BughPjdR.mjs → chunk-RPNGRAAP-yHFoBjjv.mjs} +2 -2
- package/dist/{chunk-SDNKECQQ-C3GEf3VZ.mjs → chunk-SDNKECQQ-BsAYzqU5.mjs} +2 -2
- package/dist/{chunk-SYMJJMQ4-DLPoQaug.mjs → chunk-SYMJJMQ4-jdmKoBFb.mjs} +2 -2
- package/dist/{chunk-T56QNPHK-TppyesRp.mjs → chunk-T56QNPHK-DmDxJbbD.mjs} +2 -2
- package/dist/{chunk-TLSUDHID-B2VV2ufQ.mjs → chunk-TLSUDHID-CSDR438C.mjs} +2 -2
- package/dist/{chunk-TOMNU26N-DfLjxpHW.mjs → chunk-TOMNU26N-CrDa7MpH.mjs} +2 -2
- package/dist/{chunk-TXBZCHCQ-l48TczF5.mjs → chunk-TXBZCHCQ-BxbbtyNr.mjs} +2 -2
- package/dist/chunk-U2HBQHQK-C1Q2DiEX.mjs +71 -0
- package/dist/{chunk-UNYNJIFU--HT-3lrq.mjs → chunk-UNYNJIFU-CZ2Mla0s.mjs} +3 -3
- package/dist/{chunk-V7TAPXDL-CnKUp2df.mjs → chunk-V7TAPXDL-CKif4_mH.mjs} +2 -2
- package/dist/{chunk-VJFXDYWH-IiUXkKX0.mjs → chunk-VJFXDYWH-CWlZv59U.mjs} +2 -2
- package/dist/{chunk-VLGZJRPG-DbWYxLfI.mjs → chunk-VLGZJRPG-DpYP_EVp.mjs} +2 -2
- package/dist/{chunk-VOBGTVA6-BT7gUxqf.mjs → chunk-VOBGTVA6-D6fSjWnx.mjs} +2 -2
- package/dist/{chunk-VYOJP4TV-BvibOnKG.mjs → chunk-VYOJP4TV-DN1CSkP5.mjs} +2 -2
- package/dist/{chunk-WKFATFPP-DCZdrA8x.mjs → chunk-WKFATFPP-CoPg2OGf.mjs} +2 -2
- package/dist/{chunk-X2AJGDEF-BaH6i1Rq.mjs → chunk-X2AJGDEF-ClcErtij.mjs} +1 -1
- package/dist/chunk-X2U36JSP-BiF0R9ys.mjs +2 -0
- package/dist/{chunk-XHM67O4N-BWGDFyz_.mjs → chunk-XHM67O4N-C_wCK9HT.mjs} +1 -1
- package/dist/{chunk-XKQRETAK-cVWA9gEB.mjs → chunk-XKQRETAK-BC2HZ_y9.mjs} +2 -2
- package/dist/{chunk-XORM457F-D-QrjagQ.mjs → chunk-XORM457F-BuPOSqOe.mjs} +2 -2
- package/dist/chunk-XPW4576I-BkucPPwf.mjs +39 -0
- package/dist/{chunk-XVDPCNWR-CtK-Xs2O.mjs → chunk-XVDPCNWR-CkzIJQaO.mjs} +2 -2
- package/dist/{chunk-YCFVLTST-CFJxSbsH.mjs → chunk-YCFVLTST-DsF45PbT.mjs} +2 -2
- package/dist/{chunk-YFG2CMIF-DkT4NiqV.mjs → chunk-YFG2CMIF-DjdwxBNc.mjs} +2 -2
- package/dist/{chunk-YNYSPYQ5-iQGTFdx0.mjs → chunk-YNYSPYQ5-gU4-j5DO.mjs} +1 -1
- package/dist/{chunk-YS3AZT3J-w6Dw8reo.mjs → chunk-YS3AZT3J-CB0wWPLc.mjs} +2 -2
- package/dist/{chunk-YTNYSM6T-Cz_dxkBy.mjs → chunk-YTNYSM6T-DpkSVTln.mjs} +2 -2
- package/dist/chunk-YZCP3GAM-DRdMIQsB.mjs +2 -0
- package/dist/{chunk-Z6LRHWXI-BcgkPhhu.mjs → chunk-Z6LRHWXI-EsbeaQ3V.mjs} +2 -2
- package/dist/{chunk-Z7JVV2SM-BzR-yvwK.mjs → chunk-Z7JVV2SM-BtFBVQEW.mjs} +2 -2
- package/dist/chunk-ZZ45TVLE-DwKS4e_N.mjs +2 -0
- package/dist/classDiagram-6PBFFD2Q-BrpY9pLd.mjs +2 -0
- package/dist/classDiagram-v2-HSJHXN6E-DDV6mz7Y.mjs +2 -0
- package/dist/clear-5CZ5X4YR-CHSnzs8i.mjs +1 -0
- package/dist/cli.mjs +53 -52
- package/dist/clone-BD_JFVST.mjs +2 -0
- package/dist/{colors-BtKMHmBX.mjs → colors-8SzMRIVy.mjs} +2 -2
- package/dist/colors-CkPULM8m.mjs +1 -0
- package/dist/column-WLPMMSTS-DTBoovzp.mjs +1 -0
- package/dist/comm-5SLSESQG-DT3SY7zS.mjs +1 -0
- package/dist/constants-iOPbvTyC.mjs +2 -0
- package/dist/cose-bilkent-S5V4N54A-E5vxHQ63.mjs +2 -0
- package/dist/cp-XOYR4ABJ-Bs6Rpbb2.mjs +1 -0
- package/dist/{curl-47BFPSFW-CdMFK7aW.mjs → curl-47BFPSFW-xgS5bDTx.mjs} +2 -2
- package/dist/cut-OPC3VAGB-Bm1HBn07.mjs +1 -0
- package/dist/cytoscape.esm-BNCKY88j.mjs +332 -0
- package/dist/dagre-KV5264BT-Ci7CcQr4.mjs +5 -0
- package/dist/dagre-L3rg9n9q.mjs +2 -0
- package/dist/date-DD7FVA2V-Dv3os04S.mjs +1 -0
- package/dist/defaultLocale-BljHASC9.mjs +2 -0
- package/dist/diagram-5BDNPKRD-BM3C88Zx.mjs +11 -0
- package/dist/diagram-G4DWMVQ6-Dt1Kt-mj.mjs +25 -0
- package/dist/diagram-MMDJMWI5-DomPsk0L.mjs +44 -0
- package/dist/diagram-TYMM5635-eOfCqwhs.mjs +25 -0
- package/dist/diff-HJF2MPDN-Di-oK2tx.mjs +1 -0
- package/dist/dirname-LEMTZZFS-D-u8wJ0b.mjs +1 -0
- package/dist/{dist-BZk9iqJ9.mjs → dist-D7myPw4s.mjs} +50 -50
- package/dist/dist-DZb_HoiN.mjs +2 -0
- package/dist/dist-GL5zcXSU.mjs +1 -0
- package/dist/dist-bundle-BnlRWriT.mjs +1 -0
- package/dist/{dist-bundle-B3l-HkEL.mjs → dist-bundle-D75dREX-.mjs} +2 -2
- package/dist/du-WO2ENHXQ-CO_jR0w6.mjs +1 -0
- package/dist/echo-O45JWWI2-RBT2dq5Y.mjs +1 -0
- package/dist/env-5EPCWSXR-DSwwgRF5.mjs +1 -0
- package/dist/erDiagram-SMLLAGMA-CPcwhEue.mjs +86 -0
- package/dist/{esm-CEs3LWY3.mjs → esm-BLMtE3s6.mjs} +2 -2
- package/dist/{esm-k1YlZnpm.mjs → esm-BS2W3Uzl.mjs} +2 -2
- package/dist/{execAsync-0jii24p9.mjs → execAsync-B4xEJACY.mjs} +2 -2
- package/dist/{execAsync-Czqc-yAz.mjs → execAsync-Chx_LJuI.mjs} +2 -2
- package/dist/{execAsync-DgmLXmTx.mjs → execAsync-DunQtInX.mjs} +2 -2
- package/dist/expand-DTNXU4LQ-CtzV8vlq.mjs +1 -0
- package/dist/expansion-ENLSRCXJ-CNi8PTVy.mjs +1 -0
- package/dist/expr-5T3UU5KE-BOXtVHu2.mjs +1 -0
- package/dist/file-ZIGAJ4YS-Bt-1Wusv.mjs +1 -0
- package/dist/find-TPUOAIUQ-CJd25AiD.mjs +1 -0
- package/dist/flag-coverage-QT4N2Z44-DJYVWsW6.mjs +2 -0
- package/dist/flatten-CX5MwHL4.mjs +2 -0
- package/dist/flowDiagram-DWJPFMVM-WnIxEgSt.mjs +163 -0
- package/dist/fold-LDSORVYE-DZ2L21IZ.mjs +1 -0
- package/dist/ganttDiagram-T4ZO3ILL-BJEuIZ2X.mjs +293 -0
- package/dist/getMachineId-bsd-B7ue3N1o.mjs +2 -0
- package/dist/getMachineId-bsd-DYQqYqxN.mjs +2 -0
- package/dist/getMachineId-bsd-ucL-2FoT.mjs +2 -0
- package/dist/{getMachineId-darwin-C4PiguA-.mjs → getMachineId-darwin-BNCkZc-0.mjs} +2 -2
- package/dist/{getMachineId-darwin-COcA_c6l.mjs → getMachineId-darwin-CSTYV_Bd.mjs} +2 -2
- package/dist/{getMachineId-darwin-CywdnyvB.mjs → getMachineId-darwin-DWmBOUuk.mjs} +2 -2
- package/dist/getMachineId-linux-BaNp1ZEm.mjs +2 -0
- package/dist/getMachineId-linux-Bv6oOXxT.mjs +2 -0
- package/dist/getMachineId-linux-tTgUzx-Z.mjs +2 -0
- package/dist/getMachineId-unsupported-Kf9p6LJQ.mjs +2 -0
- package/dist/getMachineId-unsupported-fh_7WYkB.mjs +2 -0
- package/dist/getMachineId-unsupported-iDvWGFBk.mjs +2 -0
- package/dist/{getMachineId-win-B20yaCSB.mjs → getMachineId-win-Bo1_B38N.mjs} +2 -2
- package/dist/{getMachineId-win-BXWDfxLS.mjs → getMachineId-win-DHmdubaR.mjs} +2 -2
- package/dist/{getMachineId-win-BfSvDvM7.mjs → getMachineId-win-DQ2s9Z1n.mjs} +2 -2
- package/dist/{gh-detect-DW_FsIun.mjs → gh-detect-CNO7EkgF.mjs} +2 -2
- package/dist/{git-handle--dq7Gq14-C8bnaqHA.mjs → git-handle--dq7Gq14-BpH0pmv5.mjs} +2 -2
- package/dist/git-handle-BaZ9y3AC-CCCU9J5d.mjs +1 -0
- package/dist/gitGraph-7Q5UKJZL-ClGjTWw6.mjs +1 -0
- package/dist/gitGraphDiagram-UUTBAWPF-BqA8KMTw.mjs +107 -0
- package/dist/graphlib-BI4uS4Lx.mjs +2 -0
- package/dist/grep-3AIAIJVR-CzG01gPs.mjs +1 -0
- package/dist/gzip-AQXSGOVS-B_BV2fa3.mjs +1 -0
- package/dist/head-HT2B6D2J-CjBr6WQ1.mjs +1 -0
- package/dist/help-VVWX7SA5-C4HsVKec.mjs +1 -0
- package/dist/history-J4QRNGRO-1CYG7cs0.mjs +1 -0
- package/dist/hostname-BK6HG2DE-BLS00ZWn.mjs +1 -0
- package/dist/html-to-markdown-TFCECAGV-5Fopg2Q5.mjs +1 -0
- package/dist/index.mjs +1 -1
- package/dist/info-OMHHGYJF-11Qh6VJr.mjs +1 -0
- package/dist/infoDiagram-42DDH7IO-0lM1lRCH.mjs +3 -0
- package/dist/init-BCTt64EX.mjs +1 -0
- package/dist/{init-CsRBtK6g.mjs → init-DjkROmXh.mjs} +9 -9
- package/dist/init-L1KCVOHH.mjs +2 -0
- package/dist/{is-object-C-4FJ0rP.mjs → is-object-Cie0xXKD.mjs} +1 -1
- package/dist/isEmpty-CaTO-fHo.mjs +2 -0
- package/dist/ishikawaDiagram-UXIWVN3A-j-jlqjJX.mjs +71 -0
- package/dist/join-GG2LDHE5-C_A2RnwJ.mjs +1 -0
- package/dist/journeyDiagram-VCZTEJTY-BDX_OcrR.mjs +140 -0
- package/dist/jq-ODXZBPLY-hdWY1RUY.mjs +1 -0
- package/dist/{js-exec-M6UR76J5-Bo7dCQVP.mjs → js-exec-M6UR76J5-Cu6NIWHE.mjs} +2 -2
- package/dist/kanban-definition-6JOO6SKY-C5XJUD3U.mjs +90 -0
- package/dist/katex-DEJL_MaU.mjs +258 -0
- package/dist/{lib-Dl2j2VNl.mjs → lib-BbNAtG4h.mjs} +2 -2
- package/dist/lib-CItGM3rN.mjs +195 -0
- package/dist/{libesm-D3nlnq5U.mjs → libesm-Ob3yvbRV.mjs} +1 -1
- package/dist/line-C6RZPh4T.mjs +2 -0
- package/dist/linear-gA98NGf7.mjs +2 -0
- package/dist/ln-4TRFBYAT-CMm4PFgi.mjs +1 -0
- package/dist/loader-DlfckqdT.mjs +1 -0
- package/dist/{loader-BUzHchzL.mjs → loader-ZHA8qsxF.mjs} +2 -2
- package/dist/ls-KSXFZCWH-Beyjypib.mjs +1 -0
- package/dist/{lzma-DMoteSiK.mjs → lzma-D4yjI8KW.mjs} +1 -1
- package/dist/{mcp-migrate-event-BF8ILHwp.mjs → mcp-migrate-event-D0NrGjvc.mjs} +1 -1
- package/dist/md5sum-INMIK4DX-C2RH1Ljb.mjs +1 -0
- package/dist/mermaid-parser.core-Cx4njenA.mjs +4 -0
- package/dist/mermaid.core-CcmmzbTt.mjs +16 -0
- package/dist/mindmap-definition-QFDTVHPH-WLdthwDy.mjs +97 -0
- package/dist/mkdir-TDEMSB6C-BeLs_C7x.mjs +1 -0
- package/dist/mv-Z6MORUFL-BDAoI0Wd.mjs +1 -0
- package/dist/nl-U5YJDM32-SP99R3HJ.mjs +1 -0
- package/dist/od-VJEF2UR5-BR0Ho1t5.mjs +1 -0
- package/dist/{open-browser-C6LU_1mt.mjs → open-browser-DHTbHSqx.mjs} +1 -1
- package/dist/ordinal-BCuCMCHk.mjs +2 -0
- package/dist/packet-4T2RLAQJ-jzF54bgp.mjs +1 -0
- package/dist/paste-7N6AFSDS-Bz3kd4hU.mjs +1 -0
- package/dist/path-C9DYqGo_.mjs +2 -0
- package/dist/pie-ZZUOXDRM-x8WFG16Q.mjs +1 -0
- package/dist/pieDiagram-DEJITSTG-7oeIAT-R.mjs +31 -0
- package/dist/preview-1rr7IXHj.mjs +1 -0
- package/dist/{preview-DhJtzW08.mjs → preview-BI2sVxtF.mjs} +2 -2
- package/dist/printf-CX64KX2P-GrZNCK4M.mjs +1 -0
- package/dist/public/assets/{ActivityModeContent-BIXjc03A.js → ActivityModeContent-BWmb9zCZ.js} +1 -1
- package/dist/public/assets/{DocumentContext-D6GST2uS.js → DocumentContext-9Sn6Kq-o.js} +22 -22
- package/dist/public/assets/{GraphPanel-D8NK8BUZ.js → GraphPanel-PYMXWVsg.js} +1 -1
- package/dist/public/assets/{SettingsDialogBody-Ciq3C1io.js → SettingsDialogBody-YOvgrn38.js} +1 -1
- package/dist/public/assets/{SourceEditor-wygB4ExR.js → SourceEditor-D1zhJS8f.js} +1 -1
- package/dist/public/assets/{config-validation-events-mfAOR8V6.js → config-validation-events-BUyp1R_U.js} +1 -1
- package/dist/public/assets/index-BXgWyDFu.css +1 -0
- package/dist/public/assets/index-CEtMQRxi.js +1915 -0
- package/dist/public/assets/{keyboard-shortcuts-B_OdnEM8.js → keyboard-shortcuts-CNJfczoS.js} +1 -1
- package/dist/public/assets/{prop-types-B5unaqIG.js → prop-types-COA7UVY9.js} +153 -153
- package/dist/public/assets/{target-navigation-intent-B9alFb27.js → target-navigation-intent-Cp-mOxXo.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-BOYqYZUw.js → typing-burst-detector-DWg86xJw.js} +1 -1
- package/dist/public/index.html +8 -8
- package/dist/pwd-D4OZ7N27-DDRhZsId.mjs +1 -0
- package/dist/{python3-AUFTPCU6-1PPUn2I7.mjs → python3-AUFTPCU6-DmPp1QHj.mjs} +2 -2
- package/dist/quadrantDiagram-34T5L4WZ-DWVBhb1E.mjs +8 -0
- package/dist/radar-PYXPWWZC-C-wbHKao.mjs +1 -0
- package/dist/readlink-MI4GCHJF-mNeJ3km7.mjs +1 -0
- package/dist/reduce-V0ODtSr4.mjs +2 -0
- package/dist/{repair-launch-json-wiGmOUjz.mjs → repair-launch-json-DCXsAQuF.mjs} +2 -2
- package/dist/{repair-mcp-configs-CmP4Plha.mjs → repair-mcp-configs-BV1WJulV.mjs} +2 -2
- package/dist/repair-skills-BSA3PyS7.mjs +1 -0
- package/dist/{repair-skills-DlA60DLJ.mjs → repair-skills-uHQb0hCn.mjs} +2 -2
- package/dist/requirementDiagram-MS252O5E-Bneel37I.mjs +85 -0
- package/dist/rev-XOSYPP45-KAKdorsx.mjs +1 -0
- package/dist/rg-FOQSCCX3-BWOdKDEd.mjs +1 -0
- package/dist/rm-RTZG23RL-D4Xj3X_m.mjs +1 -0
- package/dist/rmdir-XTQXT7RK-Bx-u3U5l.mjs +1 -0
- package/dist/rough.cjs-C-63phNL.mjs +2 -0
- package/dist/sankeyDiagram-XADWPNL6-4f2f9-uf.mjs +11 -0
- package/dist/sed-VFTTATXJ-DmL_7Y-J.mjs +1 -0
- package/dist/seq-RN5ZUASB-DeaNEJEM.mjs +1 -0
- package/dist/sequenceDiagram-FGHM5R23-B1K4VtLp.mjs +158 -0
- package/dist/{server-lock-BpjJj3OD-D_v2bsKE.mjs → server-lock-BpjJj3OD-CUhVvie4.mjs} +8 -8
- package/dist/server-lock-CyhBidkz-D41BTXw5.mjs +1 -0
- package/dist/sha1sum-VJPNLNU6-DYUNX0rt.mjs +1 -0
- package/dist/sha256sum-PI32XWXY-BwDMGEnF.mjs +1 -0
- package/dist/sleep-VZFPZFWA-D3IG7CwN.mjs +1 -0
- package/dist/sort-DCNRDA7U-BfL8J8kf.mjs +1 -0
- package/dist/split-SITCSYCZ-Q5NIWguo.mjs +1 -0
- package/dist/sqlite3-56UMWEY3-B4_LAdBq.mjs +1 -0
- package/dist/src-BkCVz_TJ.mjs +2 -0
- package/dist/{src-BZbfEFlq.mjs → src-DnynaviS.mjs} +3 -3
- package/dist/start-DYkSDg3x.mjs +1 -0
- package/dist/{start-62LrACwl.mjs → start-NIyRsRSX.mjs} +2 -2
- package/dist/stat-BT5A227F-CYFqsI8W.mjs +1 -0
- package/dist/stateDiagram-FHFEXIEX-BREbMXiC.mjs +2 -0
- package/dist/stateDiagram-v2-QKLJ7IA2-DQeH2s3K.mjs +2 -0
- package/dist/strings-7PLOGTPD-BLW4mXRs.mjs +1 -0
- package/dist/tac-SJGXQ4T2-BGR2Dq7O.mjs +1 -0
- package/dist/tail-S5ULNTJU-BOBd42y5.mjs +1 -0
- package/dist/tar-ANUBEFJY-GYQ0YvKO.mjs +1 -0
- package/dist/tee-O7VXZDCO-Bg8MXC_K.mjs +1 -0
- package/dist/time-DEUO3QV2-CxVP9vXG.mjs +1 -0
- package/dist/timeline-definition-GMOUNBTQ-Bd7XEw7o.mjs +121 -0
- package/dist/timeout-VRKMCG72-CVG2Q30a.mjs +1 -0
- package/dist/touch-DX2IJOQ4-DmEja_Fu.mjs +1 -0
- package/dist/tr-2HXZRDSW-DWcyuCoi.mjs +1 -0
- package/dist/tree-LYXBS7DC-CFaeUWGI.mjs +1 -0
- package/dist/treeView-SZITEDCU-DXyZ3zQc.mjs +1 -0
- package/dist/treemap-W4RFUUIX-CZRYHpYU.mjs +1 -0
- package/dist/true-WHJNXCHG-CJH22fVg.mjs +1 -0
- package/dist/unexpand-RGTMIGZM-Uj1QzdPV.mjs +1 -0
- package/dist/uniq-SUNANL47-MRCnRrGo.mjs +1 -0
- package/dist/vennDiagram-DHZGUBPP-Bk-INjRY.mjs +35 -0
- package/dist/wardley-RL74JXVD-UKzwcBOa.mjs +1 -0
- package/dist/wardleyDiagram-NUSXRM2D-DOD6wQla.mjs +21 -0
- package/dist/wc-TQB3VNOX-JPk1lni-.mjs +1 -0
- package/dist/which-XZHEH76L-Cl63MOrV.mjs +1 -0
- package/dist/whoami-DGKU3D2X-CB3itqHE.mjs +1 -0
- package/dist/wrapper-BZO_sIci.mjs +7 -0
- package/dist/{write-project-skill-B8HMSegN.mjs → write-project-skill-DnuutHfZ.mjs} +2 -2
- package/dist/xan-BXDXYEIB-ZPqGVO90.mjs +1 -0
- package/dist/xan-view-ECQUO7AJ-C-WHEJiv.mjs +1 -0
- package/dist/xargs-I6EZUCYF-BvcSF5Y7.mjs +1 -0
- package/dist/xychartDiagram-5P7HB3ND-B4AGYFQs.mjs +8 -0
- package/dist/yazl-CQSNnbvt.mjs +1 -0
- package/dist/{yazl-CB0sfSbo.mjs → yazl-Docqgl6q.mjs} +2 -2
- package/dist/yq-MJMAR36V-_D_zdU3z.mjs +1 -0
- package/package.json +1 -1
- package/dist/alias-JE7RI5QX-oTDRHt3W.mjs +0 -1
- package/dist/awk2-POPGKRAI-BZ_7e8H1.mjs +0 -1
- package/dist/base64-4YMZCVJ5-BhIrz6He.mjs +0 -1
- package/dist/basename-AA2KJYZQ-C5R0pcfV.mjs +0 -1
- package/dist/bash-IJWYRKFO-DywpGlyx.mjs +0 -1
- package/dist/build-CZpdADQB.mjs +0 -1
- package/dist/cat-RDUMLXKC-BNwer8pK.mjs +0 -1
- package/dist/chmod-SYMGL4JA-BN-B1xmG.mjs +0 -1
- package/dist/clear-5CZ5X4YR-B6kVcfOw.mjs +0 -1
- package/dist/colors-gw_5YWUu.mjs +0 -1
- package/dist/column-WLPMMSTS-CEev_e2R.mjs +0 -1
- package/dist/comm-5SLSESQG-BXsiD7To.mjs +0 -1
- package/dist/constants-Dfe850MK.mjs +0 -2
- package/dist/cp-XOYR4ABJ-Dy5aHk72.mjs +0 -1
- package/dist/cut-OPC3VAGB-GohHdbJ4.mjs +0 -1
- package/dist/date-DD7FVA2V-RM_vdvCh.mjs +0 -1
- package/dist/diff-HJF2MPDN-DTuHZGVW.mjs +0 -1
- package/dist/dirname-LEMTZZFS-C6aDcxLl.mjs +0 -1
- package/dist/dist-Cz45iNYz.mjs +0 -1
- package/dist/dist-bundle-XlngXUNr.mjs +0 -1
- package/dist/du-WO2ENHXQ-Da1HuQkH.mjs +0 -1
- package/dist/echo-O45JWWI2-Cr9jHdYm.mjs +0 -1
- package/dist/env-5EPCWSXR-6RSqo9Bn.mjs +0 -1
- package/dist/expand-DTNXU4LQ-D4dbwBrD.mjs +0 -1
- package/dist/expansion-ENLSRCXJ-Bv6RV19y.mjs +0 -1
- package/dist/expr-5T3UU5KE-D7ekHiOy.mjs +0 -1
- package/dist/file-ZIGAJ4YS-DzKHvjCj.mjs +0 -1
- package/dist/find-TPUOAIUQ-DuBwOGWI.mjs +0 -1
- package/dist/flag-coverage-QT4N2Z44-DmAL_7h5.mjs +0 -2
- package/dist/fold-LDSORVYE-BQyKAmCr.mjs +0 -1
- package/dist/getMachineId-bsd-CzP05Ffc.mjs +0 -2
- package/dist/getMachineId-bsd-D0erQsHH.mjs +0 -2
- package/dist/getMachineId-bsd-Dp2q7huT.mjs +0 -2
- package/dist/getMachineId-linux-BRPjBsHg.mjs +0 -2
- package/dist/getMachineId-linux-CQZJR55S.mjs +0 -2
- package/dist/getMachineId-linux-DcN5tfI_.mjs +0 -2
- package/dist/getMachineId-unsupported-BokXsjFr.mjs +0 -2
- package/dist/getMachineId-unsupported-DZAxq-oW.mjs +0 -2
- package/dist/getMachineId-unsupported-GPbM_evk.mjs +0 -2
- package/dist/git-handle-BaZ9y3AC-B05Md-6F.mjs +0 -1
- package/dist/grep-3AIAIJVR-DhLMPK9o.mjs +0 -1
- package/dist/gzip-AQXSGOVS-kzAFjO_Y.mjs +0 -1
- package/dist/head-HT2B6D2J-BR-dv_ar.mjs +0 -1
- package/dist/help-VVWX7SA5-jdvqGfQj.mjs +0 -1
- package/dist/history-J4QRNGRO-jb5B-tWQ.mjs +0 -1
- package/dist/hostname-BK6HG2DE-CVVAGatl.mjs +0 -1
- package/dist/html-to-markdown-TFCECAGV-B5yiu2Qr.mjs +0 -1
- package/dist/init-BgbGMxzB.mjs +0 -1
- package/dist/join-GG2LDHE5-BLgXAHZ_.mjs +0 -1
- package/dist/jq-ODXZBPLY-JpgGenzN.mjs +0 -1
- package/dist/ln-4TRFBYAT-C7xn5Rqr.mjs +0 -1
- package/dist/loader-CUDhE0kS.mjs +0 -1
- package/dist/ls-KSXFZCWH-BFVVAoBi.mjs +0 -1
- package/dist/md5sum-INMIK4DX-0GZIz1Ci.mjs +0 -1
- package/dist/mkdir-TDEMSB6C-DTyG__G-.mjs +0 -1
- package/dist/mv-Z6MORUFL-CmjBk72Q.mjs +0 -1
- package/dist/nl-U5YJDM32-5XaxKjVN.mjs +0 -1
- package/dist/od-VJEF2UR5-BYZOEzSd.mjs +0 -1
- package/dist/paste-7N6AFSDS-BnDgUhuq.mjs +0 -1
- package/dist/preview-Cw-pRSsH.mjs +0 -1
- package/dist/printf-CX64KX2P-0abCeF-D.mjs +0 -1
- package/dist/public/assets/index-C-eV_aX_.css +0 -1
- package/dist/public/assets/index-DmXCsqro.js +0 -1915
- package/dist/pwd-D4OZ7N27-AYS4A9o1.mjs +0 -1
- package/dist/readlink-MI4GCHJF-BvzND_DT.mjs +0 -1
- package/dist/repair-skills-D-f79wF9.mjs +0 -1
- package/dist/rev-XOSYPP45-Bqdhxuez.mjs +0 -1
- package/dist/rg-FOQSCCX3-CrVzsut-.mjs +0 -1
- package/dist/rm-RTZG23RL-DVQCHLUL.mjs +0 -1
- package/dist/rmdir-XTQXT7RK-DrUUkxCF.mjs +0 -1
- package/dist/sed-VFTTATXJ-QHemmbCP.mjs +0 -1
- package/dist/seq-RN5ZUASB-BBSGpJq5.mjs +0 -1
- package/dist/server-lock-CyhBidkz-CEUtTbEY.mjs +0 -1
- package/dist/sha1sum-VJPNLNU6-D6-7B21n.mjs +0 -1
- package/dist/sha256sum-PI32XWXY-BYVtIJOS.mjs +0 -1
- package/dist/sleep-VZFPZFWA-C-x_VGtG.mjs +0 -1
- package/dist/sort-DCNRDA7U-BTlvuG7X.mjs +0 -1
- package/dist/split-SITCSYCZ-BmGbaiMe.mjs +0 -1
- package/dist/sqlite3-56UMWEY3-Cjvsy5Oo.mjs +0 -1
- package/dist/start-KBgtL-5Z.mjs +0 -1
- package/dist/stat-BT5A227F-BjNsVAze.mjs +0 -1
- package/dist/strings-7PLOGTPD-B6_kjNM-.mjs +0 -1
- package/dist/tac-SJGXQ4T2-BEQ9sZmi.mjs +0 -1
- package/dist/tail-S5ULNTJU-DSe2aEO8.mjs +0 -1
- package/dist/tar-ANUBEFJY-HbwMpE1g.mjs +0 -1
- package/dist/tee-O7VXZDCO-BD6QXg_b.mjs +0 -1
- package/dist/time-DEUO3QV2-CRnH51wk.mjs +0 -1
- package/dist/timeout-VRKMCG72-D_oS0IDg.mjs +0 -1
- package/dist/touch-DX2IJOQ4-4yR1M9Nd.mjs +0 -1
- package/dist/tr-2HXZRDSW-Ca-NmLk7.mjs +0 -1
- package/dist/tree-LYXBS7DC-CR3kfmh6.mjs +0 -1
- package/dist/true-WHJNXCHG-x85l8vsW.mjs +0 -1
- package/dist/unexpand-RGTMIGZM-D-1EwjbB.mjs +0 -1
- package/dist/uniq-SUNANL47-DtBj3lmA.mjs +0 -1
- package/dist/wc-TQB3VNOX-Qw6WjSl1.mjs +0 -1
- package/dist/which-XZHEH76L-B-Xo178d.mjs +0 -1
- package/dist/whoami-DGKU3D2X-_Mgzu6ty.mjs +0 -1
- package/dist/xan-BXDXYEIB-qijhj_cA.mjs +0 -1
- package/dist/xan-view-ECQUO7AJ-BfZejrY6.mjs +0 -1
- package/dist/xargs-I6EZUCYF-aS184J1w.mjs +0 -1
- package/dist/yazl-Dqnhfxk7.mjs +0 -1
- package/dist/yq-MJMAR36V-Cgql6fKu.mjs +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{i as e,o as t,t as n}from"./chunk-FK9Q3tQk.mjs";import{r,t as i}from"./esm-CEs3LWY3.mjs";import{Or as a,Pt as o,bt as s,cn as c,v as l,xt as u,y as d}from"./server-lock-BpjJj3OD-D_v2bsKE.mjs";import{Bn as f,Fi as p,Gi as m,Gn as h,Ji as g,Jn as _,Nn as v,P as y,Qi as b,U as x,Vn as S,ln as C,rn as w,zn as ee}from"./dist-BZk9iqJ9.mjs";import"./constants-Dfe850MK.mjs";import{t as T}from"./is-object-C-4FJ0rP.mjs";import{i as E,o as D,r as O,s as k,t as A}from"./colors-BtKMHmBX.mjs";import{t as te}from"./preview-DhJtzW08.mjs";import{n as ne,t as j}from"./write-project-skill-B8HMSegN.mjs";import{execFileSync as re}from"node:child_process";import{existsSync as M,mkdirSync as ie,readFileSync as N,realpathSync as ae,writeFileSync as P}from"node:fs";import F,{basename as I,dirname as L,isAbsolute as oe,join as R,posix as se,relative as z,resolve as ce,sep as le,win32 as ue}from"node:path";import B from"node:process";import{homedir as V}from"node:os";import{randomUUID as de}from"node:crypto";import{stripVTControlCharacters as fe,styleText as H}from"node:util";import{AsyncLocalStorage as pe,AsyncResource as me}from"node:async_hooks";import{createServer as he,request as ge}from"node:http";import*as _e from"node:readline";import{connect as ve}from"node:net";function ye(){return B.platform.startsWith(`win`)?!!B.env.CI||!!B.env.WT_SESSION||!!B.env.TERMINUS_SUBLIME||B.env.ConEmuTask===`{cmd::Cmder}`||B.env.TERM_PROGRAM===`Terminus-Sublime`||B.env.TERM_PROGRAM===`vscode`||B.env.TERM===`xterm-256color`||B.env.TERM===`alacritty`||B.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`:B.env.TERM!==`linux`}const be={circleQuestionMark:`(?)`,questionMarkPrefix:`(?)`,square:`█`,squareDarkShade:`▓`,squareMediumShade:`▒`,squareLightShade:`░`,squareTop:`▀`,squareBottom:`▄`,squareLeft:`▌`,squareRight:`▐`,squareCenter:`■`,bullet:`●`,dot:`․`,ellipsis:`…`,pointerSmall:`›`,triangleUp:`▲`,triangleUpSmall:`▴`,triangleDown:`▼`,triangleDownSmall:`▾`,triangleLeftSmall:`◂`,triangleRightSmall:`▸`,home:`⌂`,heart:`♥`,musicNote:`♪`,musicNoteBeamed:`♫`,arrowUp:`↑`,arrowDown:`↓`,arrowLeft:`←`,arrowRight:`→`,arrowLeftRight:`↔`,arrowUpDown:`↕`,almostEqual:`≈`,notEqual:`≠`,lessOrEqual:`≤`,greaterOrEqual:`≥`,identical:`≡`,infinity:`∞`,subscriptZero:`₀`,subscriptOne:`₁`,subscriptTwo:`₂`,subscriptThree:`₃`,subscriptFour:`₄`,subscriptFive:`₅`,subscriptSix:`₆`,subscriptSeven:`₇`,subscriptEight:`₈`,subscriptNine:`₉`,oneHalf:`½`,oneThird:`⅓`,oneQuarter:`¼`,oneFifth:`⅕`,oneSixth:`⅙`,oneEighth:`⅛`,twoThirds:`⅔`,twoFifths:`⅖`,threeQuarters:`¾`,threeFifths:`⅗`,threeEighths:`⅜`,fourFifths:`⅘`,fiveSixths:`⅚`,fiveEighths:`⅝`,sevenEighths:`⅞`,line:`─`,lineBold:`━`,lineDouble:`═`,lineDashed0:`┄`,lineDashed1:`┅`,lineDashed2:`┈`,lineDashed3:`┉`,lineDashed4:`╌`,lineDashed5:`╍`,lineDashed6:`╴`,lineDashed7:`╶`,lineDashed8:`╸`,lineDashed9:`╺`,lineDashed10:`╼`,lineDashed11:`╾`,lineDashed12:`−`,lineDashed13:`–`,lineDashed14:`‐`,lineDashed15:`⁃`,lineVertical:`│`,lineVerticalBold:`┃`,lineVerticalDouble:`║`,lineVerticalDashed0:`┆`,lineVerticalDashed1:`┇`,lineVerticalDashed2:`┊`,lineVerticalDashed3:`┋`,lineVerticalDashed4:`╎`,lineVerticalDashed5:`╏`,lineVerticalDashed6:`╵`,lineVerticalDashed7:`╷`,lineVerticalDashed8:`╹`,lineVerticalDashed9:`╻`,lineVerticalDashed10:`╽`,lineVerticalDashed11:`╿`,lineDownLeft:`┐`,lineDownLeftArc:`╮`,lineDownBoldLeftBold:`┓`,lineDownBoldLeft:`┒`,lineDownLeftBold:`┑`,lineDownDoubleLeftDouble:`╗`,lineDownDoubleLeft:`╖`,lineDownLeftDouble:`╕`,lineDownRight:`┌`,lineDownRightArc:`╭`,lineDownBoldRightBold:`┏`,lineDownBoldRight:`┎`,lineDownRightBold:`┍`,lineDownDoubleRightDouble:`╔`,lineDownDoubleRight:`╓`,lineDownRightDouble:`╒`,lineUpLeft:`┘`,lineUpLeftArc:`╯`,lineUpBoldLeftBold:`┛`,lineUpBoldLeft:`┚`,lineUpLeftBold:`┙`,lineUpDoubleLeftDouble:`╝`,lineUpDoubleLeft:`╜`,lineUpLeftDouble:`╛`,lineUpRight:`└`,lineUpRightArc:`╰`,lineUpBoldRightBold:`┗`,lineUpBoldRight:`┖`,lineUpRightBold:`┕`,lineUpDoubleRightDouble:`╚`,lineUpDoubleRight:`╙`,lineUpRightDouble:`╘`,lineUpDownLeft:`┤`,lineUpBoldDownBoldLeftBold:`┫`,lineUpBoldDownBoldLeft:`┨`,lineUpDownLeftBold:`┥`,lineUpBoldDownLeftBold:`┩`,lineUpDownBoldLeftBold:`┪`,lineUpDownBoldLeft:`┧`,lineUpBoldDownLeft:`┦`,lineUpDoubleDownDoubleLeftDouble:`╣`,lineUpDoubleDownDoubleLeft:`╢`,lineUpDownLeftDouble:`╡`,lineUpDownRight:`├`,lineUpBoldDownBoldRightBold:`┣`,lineUpBoldDownBoldRight:`┠`,lineUpDownRightBold:`┝`,lineUpBoldDownRightBold:`┡`,lineUpDownBoldRightBold:`┢`,lineUpDownBoldRight:`┟`,lineUpBoldDownRight:`┞`,lineUpDoubleDownDoubleRightDouble:`╠`,lineUpDoubleDownDoubleRight:`╟`,lineUpDownRightDouble:`╞`,lineDownLeftRight:`┬`,lineDownBoldLeftBoldRightBold:`┳`,lineDownLeftBoldRightBold:`┯`,lineDownBoldLeftRight:`┰`,lineDownBoldLeftBoldRight:`┱`,lineDownBoldLeftRightBold:`┲`,lineDownLeftRightBold:`┮`,lineDownLeftBoldRight:`┭`,lineDownDoubleLeftDoubleRightDouble:`╦`,lineDownDoubleLeftRight:`╥`,lineDownLeftDoubleRightDouble:`╤`,lineUpLeftRight:`┴`,lineUpBoldLeftBoldRightBold:`┻`,lineUpLeftBoldRightBold:`┷`,lineUpBoldLeftRight:`┸`,lineUpBoldLeftBoldRight:`┹`,lineUpBoldLeftRightBold:`┺`,lineUpLeftRightBold:`┶`,lineUpLeftBoldRight:`┵`,lineUpDoubleLeftDoubleRightDouble:`╩`,lineUpDoubleLeftRight:`╨`,lineUpLeftDoubleRightDouble:`╧`,lineUpDownLeftRight:`┼`,lineUpBoldDownBoldLeftBoldRightBold:`╋`,lineUpDownBoldLeftBoldRightBold:`╈`,lineUpBoldDownLeftBoldRightBold:`╇`,lineUpBoldDownBoldLeftRightBold:`╊`,lineUpBoldDownBoldLeftBoldRight:`╉`,lineUpBoldDownLeftRight:`╀`,lineUpDownBoldLeftRight:`╁`,lineUpDownLeftBoldRight:`┽`,lineUpDownLeftRightBold:`┾`,lineUpBoldDownBoldLeftRight:`╂`,lineUpDownLeftBoldRightBold:`┿`,lineUpBoldDownLeftBoldRight:`╃`,lineUpBoldDownLeftRightBold:`╄`,lineUpDownBoldLeftBoldRight:`╅`,lineUpDownBoldLeftRightBold:`╆`,lineUpDoubleDownDoubleLeftDoubleRightDouble:`╬`,lineUpDoubleDownDoubleLeftRight:`╫`,lineUpDownLeftDoubleRightDouble:`╪`,lineCross:`╳`,lineBackslash:`╲`,lineSlash:`╱`},xe={tick:`✔`,info:`ℹ`,warning:`⚠`,cross:`✘`,squareSmall:`◻`,squareSmallFilled:`◼`,circle:`◯`,circleFilled:`◉`,circleDotted:`◌`,circleDouble:`◎`,circleCircle:`ⓞ`,circleCross:`ⓧ`,circlePipe:`Ⓘ`,radioOn:`◉`,radioOff:`◯`,checkboxOn:`☒`,checkboxOff:`☐`,checkboxCircleOn:`ⓧ`,checkboxCircleOff:`Ⓘ`,pointer:`❯`,triangleUpOutline:`△`,triangleLeft:`◀`,triangleRight:`▶`,lozenge:`◆`,lozengeOutline:`◇`,hamburger:`☰`,smiley:`㋡`,mustache:`෴`,star:`★`,play:`▶`,nodejs:`⬢`,oneSeventh:`⅐`,oneNinth:`⅑`,oneTenth:`⅒`},Se={tick:`√`,info:`i`,warning:`‼`,cross:`×`,squareSmall:`□`,squareSmallFilled:`■`,circle:`( )`,circleFilled:`(*)`,circleDotted:`( )`,circleDouble:`( )`,circleCircle:`(○)`,circleCross:`(×)`,circlePipe:`(│)`,radioOn:`(*)`,radioOff:`( )`,checkboxOn:`[×]`,checkboxOff:`[ ]`,checkboxCircleOn:`(×)`,checkboxCircleOff:`( )`,pointer:`>`,triangleUpOutline:`∆`,triangleLeft:`◄`,triangleRight:`►`,lozenge:`♦`,lozengeOutline:`◊`,hamburger:`≡`,smiley:`☺`,mustache:`┌─┐`,star:`✶`,play:`►`,nodejs:`♦`,oneSeventh:`1/7`,oneNinth:`1/9`,oneTenth:`1/10`},Ce={...be,...xe},we={...be,...Se},U=ye()?Ce:we;Object.entries(xe);var Te=n(((t,n)=>{n.exports=i;function r(t){let n={defaultWidth:0,output:process.stdout,tty:e(`tty`)};return t?(Object.keys(n).forEach(function(e){t[e]||(t[e]=n[e])}),t):n}function i(e){let t=r(e);if(t.output.getWindowSize)return t.output.getWindowSize()[0]||t.defaultWidth;if(t.tty.getWindowSize)return t.tty.getWindowSize()[1]||t.defaultWidth;if(t.output.columns)return t.output.columns;if(process.env.CLI_WIDTH){let e=parseInt(process.env.CLI_WIDTH,10);if(!isNaN(e)&&e!==0)return e}return t.defaultWidth}}));const Ee=(()=>{let e=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return t=>{let n=0;for(e.lastIndex=0;e.test(t);)n+=1;return t.length-n}})(),De=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,Oe=e=>e===8987||e===9001||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e>=131072&&e<=196605||e>=196608&&e<=262141,ke=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,Ae=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,je=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/uy,Me=/\t{1,1000}/y,Ne=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/uy,Pe=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,Fe=/\p{M}+/gu,Ie={limit:1/0,ellipsis:``},Le=(e,t={},n={})=>{let r=t.limit??1/0,i=t.ellipsis??``,a=t?.ellipsisWidth??(i?Le(i,Ie,n).width:0),o=n.controlWidth??0,s=n.tabWidth??8,c=n.emojiWidth??2,l=n.regularWidth??1,u=n.wideWidth??2,d=[[Pe,l],[ke,0],[Ae,o],[Me,s],[Ne,c],[je,u]],f=0,p=0,m=e.length,h=0,g=!1,_=m,v=Math.max(0,r-a),y=0,b=0,x=0,S=0;outer:for(;;){if(b>y||p>=m&&p>f){let t=e.slice(y,b)||e.slice(f,p);h=0;for(let e of t.replaceAll(Fe,``)){let t=e.codePointAt(0)||0;if(S=De(t)?2:Oe(t)?u:l,x+S>v&&(_=Math.min(_,Math.max(y,f)+h)),x+S>r){g=!0;break outer}h+=e.length,x+=S}y=b=0}if(p>=m)break outer;for(let t=0,n=d.length;t<n;t++){let[n,i]=d[t];if(n.lastIndex=p,n.test(e)){if(h=n===je?Ee(e.slice(p,n.lastIndex)):n===Ne?1:n.lastIndex-p,S=h*i,x+S>v&&(_=Math.min(_,p+Math.floor((v-x)/i))),x+S>r){g=!0;break outer}x+=S,y=f,b=p,p=f=n.lastIndex;continue outer}}p+=1}return{width:g?v:x,index:g?_:m,truncated:g,ellipsed:g&&r>=a}},Re={limit:1/0,ellipsis:``,ellipsisWidth:0},W=(e,t={})=>Le(e,Re,t).width,ze=`]8;;`,Be=RegExp(`(?:\\[(?<code>\\d+)m|\\${ze}(?<uri>.*))`,`y`),Ve=e=>{if(e>=30&&e<=37||e>=90&&e<=97)return 39;if(e>=40&&e<=47||e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0},He=e=>`[${e}m`,Ue=e=>`${ze}${e}`,We=(e,t,n)=>{let r=t[Symbol.iterator](),i=!1,a=!1,o=e.at(-1),s=o===void 0?0:W(o),c=r.next(),l=r.next(),u=0;for(;!c.done;){let o=c.value,d=W(o);s+d<=n?e[e.length-1]+=o:(e.push(o),s=0),(o===`\x1B`||o===``)&&(i=!0,a=t.startsWith(ze,u+1)),i?a?o===`\x07`&&(i=!1,a=!1):o===`m`&&(i=!1):(s+=d,s===n&&!l.done&&(e.push(``),s=0)),c=l,l=r.next(),u+=o.length}o=e.at(-1),!s&&o!==void 0&&o.length&&e.length>1&&(e[e.length-2]+=e.pop())},Ge=e=>{let t=e.split(` `),n=t.length;for(;n&&!W(t[n-1]);)n--;return n===t.length?e:t.slice(0,n).join(` `)+t.slice(n).join(``)},Ke=(e,t,n={})=>{if(n.trim!==!1&&e.trim()===``)return``;let r=``,i,a,o=e.split(` `),s=[``],c=0;for(let e=0;e<o.length;e++){let r=o[e];if(n.trim!==!1){let e=s.at(-1)??``,t=e.trimStart();e.length!==t.length&&(s[s.length-1]=t,c=W(t))}e!==0&&(c>=t&&(n.wordWrap===!1||n.trim===!1)&&(s.push(``),c=0),(c||n.trim===!1)&&(s[s.length-1]+=` `,c++));let i=W(r);if(n.hard&&i>t){let e=t-c,n=1+Math.floor((i-e-1)/t);Math.floor((i-1)/t)<n&&s.push(``),We(s,r,t),c=W(s.at(-1)??``);continue}if(c+i>t&&c&&i){if(n.wordWrap===!1&&c<t){We(s,r,t),c=W(s.at(-1)??``);continue}s.push(``),c=0}if(c+i>t&&n.wordWrap===!1){We(s,r,t),c=W(s.at(-1)??``);continue}s[s.length-1]+=r,c+=i}n.trim!==!1&&(s=s.map(e=>Ge(e)));let l=s.join(`
|
|
1
|
+
import{a as e,s as t,t as n}from"./chunk-C94x7I9S.mjs";import{r,t as i}from"./esm-BLMtE3s6.mjs";import{Ft as a,Or as o,St as s,ln as c,v as l,xt as u,y as d}from"./server-lock-BpjJj3OD-CUhVvie4.mjs";import{$i as f,Bn as p,F as m,Hn as h,Ii as g,Ki as _,Kn as v,Pn as y,Vn as b,W as x,Yi as S,Yn as C,in as w,un as ee}from"./dist-D7myPw4s.mjs";import"./constants-iOPbvTyC.mjs";import{t as T}from"./is-object-Cie0xXKD.mjs";import{i as E,o as D,r as O,s as k,t as A}from"./colors-8SzMRIVy.mjs";import{t as te}from"./preview-BI2sVxtF.mjs";import{n as ne,t as j}from"./write-project-skill-DnuutHfZ.mjs";import{execFileSync as re}from"node:child_process";import{existsSync as M,mkdirSync as ie,readFileSync as N,realpathSync as ae,writeFileSync as P}from"node:fs";import F,{basename as I,dirname as L,isAbsolute as oe,join as R,posix as se,relative as z,resolve as ce,sep as le,win32 as ue}from"node:path";import B from"node:process";import{homedir as V}from"node:os";import{randomUUID as de}from"node:crypto";import{stripVTControlCharacters as fe,styleText as H}from"node:util";import{AsyncLocalStorage as pe,AsyncResource as me}from"node:async_hooks";import{createServer as he,request as ge}from"node:http";import*as _e from"node:readline";import{connect as ve}from"node:net";function ye(){return B.platform.startsWith(`win`)?!!B.env.CI||!!B.env.WT_SESSION||!!B.env.TERMINUS_SUBLIME||B.env.ConEmuTask===`{cmd::Cmder}`||B.env.TERM_PROGRAM===`Terminus-Sublime`||B.env.TERM_PROGRAM===`vscode`||B.env.TERM===`xterm-256color`||B.env.TERM===`alacritty`||B.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`:B.env.TERM!==`linux`}const be={circleQuestionMark:`(?)`,questionMarkPrefix:`(?)`,square:`█`,squareDarkShade:`▓`,squareMediumShade:`▒`,squareLightShade:`░`,squareTop:`▀`,squareBottom:`▄`,squareLeft:`▌`,squareRight:`▐`,squareCenter:`■`,bullet:`●`,dot:`․`,ellipsis:`…`,pointerSmall:`›`,triangleUp:`▲`,triangleUpSmall:`▴`,triangleDown:`▼`,triangleDownSmall:`▾`,triangleLeftSmall:`◂`,triangleRightSmall:`▸`,home:`⌂`,heart:`♥`,musicNote:`♪`,musicNoteBeamed:`♫`,arrowUp:`↑`,arrowDown:`↓`,arrowLeft:`←`,arrowRight:`→`,arrowLeftRight:`↔`,arrowUpDown:`↕`,almostEqual:`≈`,notEqual:`≠`,lessOrEqual:`≤`,greaterOrEqual:`≥`,identical:`≡`,infinity:`∞`,subscriptZero:`₀`,subscriptOne:`₁`,subscriptTwo:`₂`,subscriptThree:`₃`,subscriptFour:`₄`,subscriptFive:`₅`,subscriptSix:`₆`,subscriptSeven:`₇`,subscriptEight:`₈`,subscriptNine:`₉`,oneHalf:`½`,oneThird:`⅓`,oneQuarter:`¼`,oneFifth:`⅕`,oneSixth:`⅙`,oneEighth:`⅛`,twoThirds:`⅔`,twoFifths:`⅖`,threeQuarters:`¾`,threeFifths:`⅗`,threeEighths:`⅜`,fourFifths:`⅘`,fiveSixths:`⅚`,fiveEighths:`⅝`,sevenEighths:`⅞`,line:`─`,lineBold:`━`,lineDouble:`═`,lineDashed0:`┄`,lineDashed1:`┅`,lineDashed2:`┈`,lineDashed3:`┉`,lineDashed4:`╌`,lineDashed5:`╍`,lineDashed6:`╴`,lineDashed7:`╶`,lineDashed8:`╸`,lineDashed9:`╺`,lineDashed10:`╼`,lineDashed11:`╾`,lineDashed12:`−`,lineDashed13:`–`,lineDashed14:`‐`,lineDashed15:`⁃`,lineVertical:`│`,lineVerticalBold:`┃`,lineVerticalDouble:`║`,lineVerticalDashed0:`┆`,lineVerticalDashed1:`┇`,lineVerticalDashed2:`┊`,lineVerticalDashed3:`┋`,lineVerticalDashed4:`╎`,lineVerticalDashed5:`╏`,lineVerticalDashed6:`╵`,lineVerticalDashed7:`╷`,lineVerticalDashed8:`╹`,lineVerticalDashed9:`╻`,lineVerticalDashed10:`╽`,lineVerticalDashed11:`╿`,lineDownLeft:`┐`,lineDownLeftArc:`╮`,lineDownBoldLeftBold:`┓`,lineDownBoldLeft:`┒`,lineDownLeftBold:`┑`,lineDownDoubleLeftDouble:`╗`,lineDownDoubleLeft:`╖`,lineDownLeftDouble:`╕`,lineDownRight:`┌`,lineDownRightArc:`╭`,lineDownBoldRightBold:`┏`,lineDownBoldRight:`┎`,lineDownRightBold:`┍`,lineDownDoubleRightDouble:`╔`,lineDownDoubleRight:`╓`,lineDownRightDouble:`╒`,lineUpLeft:`┘`,lineUpLeftArc:`╯`,lineUpBoldLeftBold:`┛`,lineUpBoldLeft:`┚`,lineUpLeftBold:`┙`,lineUpDoubleLeftDouble:`╝`,lineUpDoubleLeft:`╜`,lineUpLeftDouble:`╛`,lineUpRight:`└`,lineUpRightArc:`╰`,lineUpBoldRightBold:`┗`,lineUpBoldRight:`┖`,lineUpRightBold:`┕`,lineUpDoubleRightDouble:`╚`,lineUpDoubleRight:`╙`,lineUpRightDouble:`╘`,lineUpDownLeft:`┤`,lineUpBoldDownBoldLeftBold:`┫`,lineUpBoldDownBoldLeft:`┨`,lineUpDownLeftBold:`┥`,lineUpBoldDownLeftBold:`┩`,lineUpDownBoldLeftBold:`┪`,lineUpDownBoldLeft:`┧`,lineUpBoldDownLeft:`┦`,lineUpDoubleDownDoubleLeftDouble:`╣`,lineUpDoubleDownDoubleLeft:`╢`,lineUpDownLeftDouble:`╡`,lineUpDownRight:`├`,lineUpBoldDownBoldRightBold:`┣`,lineUpBoldDownBoldRight:`┠`,lineUpDownRightBold:`┝`,lineUpBoldDownRightBold:`┡`,lineUpDownBoldRightBold:`┢`,lineUpDownBoldRight:`┟`,lineUpBoldDownRight:`┞`,lineUpDoubleDownDoubleRightDouble:`╠`,lineUpDoubleDownDoubleRight:`╟`,lineUpDownRightDouble:`╞`,lineDownLeftRight:`┬`,lineDownBoldLeftBoldRightBold:`┳`,lineDownLeftBoldRightBold:`┯`,lineDownBoldLeftRight:`┰`,lineDownBoldLeftBoldRight:`┱`,lineDownBoldLeftRightBold:`┲`,lineDownLeftRightBold:`┮`,lineDownLeftBoldRight:`┭`,lineDownDoubleLeftDoubleRightDouble:`╦`,lineDownDoubleLeftRight:`╥`,lineDownLeftDoubleRightDouble:`╤`,lineUpLeftRight:`┴`,lineUpBoldLeftBoldRightBold:`┻`,lineUpLeftBoldRightBold:`┷`,lineUpBoldLeftRight:`┸`,lineUpBoldLeftBoldRight:`┹`,lineUpBoldLeftRightBold:`┺`,lineUpLeftRightBold:`┶`,lineUpLeftBoldRight:`┵`,lineUpDoubleLeftDoubleRightDouble:`╩`,lineUpDoubleLeftRight:`╨`,lineUpLeftDoubleRightDouble:`╧`,lineUpDownLeftRight:`┼`,lineUpBoldDownBoldLeftBoldRightBold:`╋`,lineUpDownBoldLeftBoldRightBold:`╈`,lineUpBoldDownLeftBoldRightBold:`╇`,lineUpBoldDownBoldLeftRightBold:`╊`,lineUpBoldDownBoldLeftBoldRight:`╉`,lineUpBoldDownLeftRight:`╀`,lineUpDownBoldLeftRight:`╁`,lineUpDownLeftBoldRight:`┽`,lineUpDownLeftRightBold:`┾`,lineUpBoldDownBoldLeftRight:`╂`,lineUpDownLeftBoldRightBold:`┿`,lineUpBoldDownLeftBoldRight:`╃`,lineUpBoldDownLeftRightBold:`╄`,lineUpDownBoldLeftBoldRight:`╅`,lineUpDownBoldLeftRightBold:`╆`,lineUpDoubleDownDoubleLeftDoubleRightDouble:`╬`,lineUpDoubleDownDoubleLeftRight:`╫`,lineUpDownLeftDoubleRightDouble:`╪`,lineCross:`╳`,lineBackslash:`╲`,lineSlash:`╱`},xe={tick:`✔`,info:`ℹ`,warning:`⚠`,cross:`✘`,squareSmall:`◻`,squareSmallFilled:`◼`,circle:`◯`,circleFilled:`◉`,circleDotted:`◌`,circleDouble:`◎`,circleCircle:`ⓞ`,circleCross:`ⓧ`,circlePipe:`Ⓘ`,radioOn:`◉`,radioOff:`◯`,checkboxOn:`☒`,checkboxOff:`☐`,checkboxCircleOn:`ⓧ`,checkboxCircleOff:`Ⓘ`,pointer:`❯`,triangleUpOutline:`△`,triangleLeft:`◀`,triangleRight:`▶`,lozenge:`◆`,lozengeOutline:`◇`,hamburger:`☰`,smiley:`㋡`,mustache:`෴`,star:`★`,play:`▶`,nodejs:`⬢`,oneSeventh:`⅐`,oneNinth:`⅑`,oneTenth:`⅒`},Se={tick:`√`,info:`i`,warning:`‼`,cross:`×`,squareSmall:`□`,squareSmallFilled:`■`,circle:`( )`,circleFilled:`(*)`,circleDotted:`( )`,circleDouble:`( )`,circleCircle:`(○)`,circleCross:`(×)`,circlePipe:`(│)`,radioOn:`(*)`,radioOff:`( )`,checkboxOn:`[×]`,checkboxOff:`[ ]`,checkboxCircleOn:`(×)`,checkboxCircleOff:`( )`,pointer:`>`,triangleUpOutline:`∆`,triangleLeft:`◄`,triangleRight:`►`,lozenge:`♦`,lozengeOutline:`◊`,hamburger:`≡`,smiley:`☺`,mustache:`┌─┐`,star:`✶`,play:`►`,nodejs:`♦`,oneSeventh:`1/7`,oneNinth:`1/9`,oneTenth:`1/10`},Ce={...be,...xe},we={...be,...Se},U=ye()?Ce:we;Object.entries(xe);var Te=n(((t,n)=>{n.exports=i;function r(t){let n={defaultWidth:0,output:process.stdout,tty:e(`tty`)};return t?(Object.keys(n).forEach(function(e){t[e]||(t[e]=n[e])}),t):n}function i(e){let t=r(e);if(t.output.getWindowSize)return t.output.getWindowSize()[0]||t.defaultWidth;if(t.tty.getWindowSize)return t.tty.getWindowSize()[1]||t.defaultWidth;if(t.output.columns)return t.output.columns;if(process.env.CLI_WIDTH){let e=parseInt(process.env.CLI_WIDTH,10);if(!isNaN(e)&&e!==0)return e}return t.defaultWidth}}));const Ee=(()=>{let e=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return t=>{let n=0;for(e.lastIndex=0;e.test(t);)n+=1;return t.length-n}})(),De=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,Oe=e=>e===8987||e===9001||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e>=131072&&e<=196605||e>=196608&&e<=262141,ke=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,Ae=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,je=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/uy,Me=/\t{1,1000}/y,Ne=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/uy,Pe=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,Fe=/\p{M}+/gu,Ie={limit:1/0,ellipsis:``},Le=(e,t={},n={})=>{let r=t.limit??1/0,i=t.ellipsis??``,a=t?.ellipsisWidth??(i?Le(i,Ie,n).width:0),o=n.controlWidth??0,s=n.tabWidth??8,c=n.emojiWidth??2,l=n.regularWidth??1,u=n.wideWidth??2,d=[[Pe,l],[ke,0],[Ae,o],[Me,s],[Ne,c],[je,u]],f=0,p=0,m=e.length,h=0,g=!1,_=m,v=Math.max(0,r-a),y=0,b=0,x=0,S=0;outer:for(;;){if(b>y||p>=m&&p>f){let t=e.slice(y,b)||e.slice(f,p);h=0;for(let e of t.replaceAll(Fe,``)){let t=e.codePointAt(0)||0;if(S=De(t)?2:Oe(t)?u:l,x+S>v&&(_=Math.min(_,Math.max(y,f)+h)),x+S>r){g=!0;break outer}h+=e.length,x+=S}y=b=0}if(p>=m)break outer;for(let t=0,n=d.length;t<n;t++){let[n,i]=d[t];if(n.lastIndex=p,n.test(e)){if(h=n===je?Ee(e.slice(p,n.lastIndex)):n===Ne?1:n.lastIndex-p,S=h*i,x+S>v&&(_=Math.min(_,p+Math.floor((v-x)/i))),x+S>r){g=!0;break outer}x+=S,y=f,b=p,p=f=n.lastIndex;continue outer}}p+=1}return{width:g?v:x,index:g?_:m,truncated:g,ellipsed:g&&r>=a}},Re={limit:1/0,ellipsis:``,ellipsisWidth:0},W=(e,t={})=>Le(e,Re,t).width,ze=`]8;;`,Be=RegExp(`(?:\\[(?<code>\\d+)m|\\${ze}(?<uri>.*))`,`y`),Ve=e=>{if(e>=30&&e<=37||e>=90&&e<=97)return 39;if(e>=40&&e<=47||e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0},He=e=>`[${e}m`,Ue=e=>`${ze}${e}`,We=(e,t,n)=>{let r=t[Symbol.iterator](),i=!1,a=!1,o=e.at(-1),s=o===void 0?0:W(o),c=r.next(),l=r.next(),u=0;for(;!c.done;){let o=c.value,d=W(o);s+d<=n?e[e.length-1]+=o:(e.push(o),s=0),(o===`\x1B`||o===``)&&(i=!0,a=t.startsWith(ze,u+1)),i?a?o===`\x07`&&(i=!1,a=!1):o===`m`&&(i=!1):(s+=d,s===n&&!l.done&&(e.push(``),s=0)),c=l,l=r.next(),u+=o.length}o=e.at(-1),!s&&o!==void 0&&o.length&&e.length>1&&(e[e.length-2]+=e.pop())},Ge=e=>{let t=e.split(` `),n=t.length;for(;n&&!W(t[n-1]);)n--;return n===t.length?e:t.slice(0,n).join(` `)+t.slice(n).join(``)},Ke=(e,t,n={})=>{if(n.trim!==!1&&e.trim()===``)return``;let r=``,i,a,o=e.split(` `),s=[``],c=0;for(let e=0;e<o.length;e++){let r=o[e];if(n.trim!==!1){let e=s.at(-1)??``,t=e.trimStart();e.length!==t.length&&(s[s.length-1]=t,c=W(t))}e!==0&&(c>=t&&(n.wordWrap===!1||n.trim===!1)&&(s.push(``),c=0),(c||n.trim===!1)&&(s[s.length-1]+=` `,c++));let i=W(r);if(n.hard&&i>t){let e=t-c,n=1+Math.floor((i-e-1)/t);Math.floor((i-1)/t)<n&&s.push(``),We(s,r,t),c=W(s.at(-1)??``);continue}if(c+i>t&&c&&i){if(n.wordWrap===!1&&c<t){We(s,r,t),c=W(s.at(-1)??``);continue}s.push(``),c=0}if(c+i>t&&n.wordWrap===!1){We(s,r,t),c=W(s.at(-1)??``);continue}s[s.length-1]+=r,c+=i}n.trim!==!1&&(s=s.map(e=>Ge(e)));let l=s.join(`
|
|
2
2
|
`),u=!1;for(let e=0;e<l.length;e++){let t=l[e];if(r+=t,u)u=!1;else if(u=t>=`\ud800`&&t<=`\udbff`,u)continue;if(t===`\x1B`||t===``){Be.lastIndex=e+1;let t=Be.exec(l)?.groups;if(t?.code!==void 0){let e=Number.parseFloat(t.code);i=e===39?void 0:e}else t?.uri!==void 0&&(a=t.uri.length===0?void 0:t.uri)}if(l[e+1]===`
|
|
3
3
|
`){a&&(r+=Ue(``));let e=i?Ve(i):void 0;i&&e&&(r+=He(e))}else t===`
|
|
4
4
|
`&&(i&&Ve(i)&&(r+=He(i)),a&&(r+=Ue(a)))}return r},qe=/\r?\n/;function Je(e,t,n){return String(e).normalize().split(qe).map(e=>Ke(e,t,n)).join(`
|
|
5
|
-
`)}var Ye=n(((t,n)=>{let r=e(`stream`);n.exports=class extends r{#e=null;constructor(e={}){super(e),this.writable=this.readable=!0,this.muted=!1,this.on(`pipe`,this._onpipe),this.replace=e.replace,this._prompt=e.prompt||null,this._hadControl=!1}#t(e,t){return this._dest?this._dest[e]:this._src?this._src[e]:t}#n(e,...t){typeof this._dest?.[e]==`function`&&this._dest[e](...t),typeof this._src?.[e]==`function`&&this._src[e](...t)}get isTTY(){return this.#e===null?this.#t(`isTTY`,!1):this.#e}set isTTY(e){this.#e=e}get rows(){return this.#t(`rows`)}get columns(){return this.#t(`columns`)}mute(){this.muted=!0}unmute(){this.muted=!1}_onpipe(e){this._src=e}pipe(e,t){return this._dest=e,super.pipe(e,t)}pause(){if(this._src)return this._src.pause()}resume(){if(this._src)return this._src.resume()}write(e){if(this.muted){if(!this.replace)return!0;if(e.match(/^\u001b/))return e.indexOf(this._prompt)===0&&(e=e.slice(this._prompt.length),e=e.replace(/./g,this.replace),e=this._prompt+e),this._hadControl=!0,this.emit(`data`,e);this._prompt&&this._hadControl&&e.indexOf(this._prompt)===0&&(this._hadControl=!1,this.emit(`data`,this._prompt),e=e.slice(this._prompt.length)),e=e.toString().replace(/./g,this.replace)}this.emit(`data`,e)}end(e){this.muted&&(e=e&&this.replace?e.toString().replace(/./g,this.replace):null),e&&this.emit(`data`,e),this.emit(`end`)}destroy(...e){return this.#n(`destroy`,...e)}destroySoon(...e){return this.#n(`destroySoon`,...e)}close(...e){return this.#n(`close`,...e)}}}));const Xe=[];Xe.push(`SIGHUP`,`SIGINT`,`SIGTERM`),process.platform!==`win32`&&Xe.push(`SIGALRM`,`SIGABRT`,`SIGVTALRM`,`SIGXCPU`,`SIGXFSZ`,`SIGUSR2`,`SIGTRAP`,`SIGSYS`,`SIGQUIT`,`SIGIOT`),process.platform===`linux`&&Xe.push(`SIGIO`,`SIGPOLL`,`SIGPWR`,`SIGSTKFLT`);const Ze=e=>!!e&&typeof e==`object`&&typeof e.removeListener==`function`&&typeof e.emit==`function`&&typeof e.reallyExit==`function`&&typeof e.listeners==`function`&&typeof e.kill==`function`&&typeof e.pid==`number`&&typeof e.on==`function`,Qe=Symbol.for(`signal-exit emitter`),$e=globalThis,et=Object.defineProperty.bind(Object);var tt=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if($e[Qe])return $e[Qe];et($e,Qe,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,t){this.listeners[e].push(t)}removeListener(e,t){let n=this.listeners[e],r=n.indexOf(t);r!==-1&&(r===0&&n.length===1?n.length=0:n.splice(r,1))}emit(e,t,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let r=!1;for(let i of this.listeners[e])r=i(t,n)===!0||r;return e===`exit`&&(r=this.emit(`afterExit`,t,n)||r),r}},nt=class{};const rt=e=>({onExit(t,n){return e.onExit(t,n)},load(){return e.load()},unload(){return e.unload()}});var it=class extends nt{onExit(){return()=>{}}load(){}unload(){}},at=class extends nt{#e=ot.platform===`win32`?`SIGINT`:`SIGHUP`;#t=new tt;#n;#r;#i;#a={};#o=!1;constructor(e){super(),this.#n=e,this.#a={};for(let t of Xe)this.#a[t]=()=>{let n=this.#n.listeners(t),{count:r}=this.#t,i=e;if(typeof i.__signal_exit_emitter__==`object`&&typeof i.__signal_exit_emitter__.count==`number`&&(r+=i.__signal_exit_emitter__.count),n.length===r){this.unload();let n=this.#t.emit(`exit`,null,t),r=t===`SIGHUP`?this.#e:t;n||e.kill(e.pid,r)}};this.#i=e.reallyExit,this.#r=e.emit}onExit(e,t){if(!Ze(this.#n))return()=>{};this.#o===!1&&this.load();let n=t?.alwaysLast?`afterExit`:`exit`;return this.#t.on(n,e),()=>{this.#t.removeListener(n,e),this.#t.listeners.exit.length===0&&this.#t.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#o){this.#o=!0,this.#t.count+=1;for(let e of Xe)try{let t=this.#a[e];t&&this.#n.on(e,t)}catch{}this.#n.emit=(e,...t)=>this.#c(e,...t),this.#n.reallyExit=e=>this.#s(e)}}unload(){this.#o&&(this.#o=!1,Xe.forEach(e=>{let t=this.#a[e];if(!t)throw Error(`Listener not defined for signal: `+e);try{this.#n.removeListener(e,t)}catch{}}),this.#n.emit=this.#r,this.#n.reallyExit=this.#i,--this.#t.count)}#s(e){return Ze(this.#n)?(this.#n.exitCode=e||0,this.#t.emit(`exit`,this.#n.exitCode,null),this.#i.call(this.#n,this.#n.exitCode)):0}#c(e,...t){let n=this.#r;if(e===`exit`&&Ze(this.#n)){typeof t[0]==`number`&&(this.#n.exitCode=t[0]);let r=n.call(this.#n,e,...t);return this.#t.emit(`exit`,this.#n.exitCode,null),r}else return n.call(this.#n,e,...t)}};const ot=globalThis.process,{onExit:st,load:ct,unload:lt}=rt(Ze(ot)?new at(ot):new it),ut=`\x1B[?25l`,dt=`\x1B[?25h`,ft=(e=1)=>e>0?`[${e}A`:``,pt=(e=1)=>e>0?`[${e}B`:``,mt=(e,t)=>typeof t==`number`&&!Number.isNaN(t)?`[${t+1};${e+1}H`:`[${e+1}G`,ht=`\x1B[2K`,gt=e=>e>0?(ht+ft(1)).repeat(e-1)+ht+`\x1B[G`:``,_t=l,vt=
|
|
5
|
+
`)}var Ye=n(((t,n)=>{let r=e(`stream`);n.exports=class extends r{#e=null;constructor(e={}){super(e),this.writable=this.readable=!0,this.muted=!1,this.on(`pipe`,this._onpipe),this.replace=e.replace,this._prompt=e.prompt||null,this._hadControl=!1}#t(e,t){return this._dest?this._dest[e]:this._src?this._src[e]:t}#n(e,...t){typeof this._dest?.[e]==`function`&&this._dest[e](...t),typeof this._src?.[e]==`function`&&this._src[e](...t)}get isTTY(){return this.#e===null?this.#t(`isTTY`,!1):this.#e}set isTTY(e){this.#e=e}get rows(){return this.#t(`rows`)}get columns(){return this.#t(`columns`)}mute(){this.muted=!0}unmute(){this.muted=!1}_onpipe(e){this._src=e}pipe(e,t){return this._dest=e,super.pipe(e,t)}pause(){if(this._src)return this._src.pause()}resume(){if(this._src)return this._src.resume()}write(e){if(this.muted){if(!this.replace)return!0;if(e.match(/^\u001b/))return e.indexOf(this._prompt)===0&&(e=e.slice(this._prompt.length),e=e.replace(/./g,this.replace),e=this._prompt+e),this._hadControl=!0,this.emit(`data`,e);this._prompt&&this._hadControl&&e.indexOf(this._prompt)===0&&(this._hadControl=!1,this.emit(`data`,this._prompt),e=e.slice(this._prompt.length)),e=e.toString().replace(/./g,this.replace)}this.emit(`data`,e)}end(e){this.muted&&(e=e&&this.replace?e.toString().replace(/./g,this.replace):null),e&&this.emit(`data`,e),this.emit(`end`)}destroy(...e){return this.#n(`destroy`,...e)}destroySoon(...e){return this.#n(`destroySoon`,...e)}close(...e){return this.#n(`close`,...e)}}}));const Xe=[];Xe.push(`SIGHUP`,`SIGINT`,`SIGTERM`),process.platform!==`win32`&&Xe.push(`SIGALRM`,`SIGABRT`,`SIGVTALRM`,`SIGXCPU`,`SIGXFSZ`,`SIGUSR2`,`SIGTRAP`,`SIGSYS`,`SIGQUIT`,`SIGIOT`),process.platform===`linux`&&Xe.push(`SIGIO`,`SIGPOLL`,`SIGPWR`,`SIGSTKFLT`);const Ze=e=>!!e&&typeof e==`object`&&typeof e.removeListener==`function`&&typeof e.emit==`function`&&typeof e.reallyExit==`function`&&typeof e.listeners==`function`&&typeof e.kill==`function`&&typeof e.pid==`number`&&typeof e.on==`function`,Qe=Symbol.for(`signal-exit emitter`),$e=globalThis,et=Object.defineProperty.bind(Object);var tt=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if($e[Qe])return $e[Qe];et($e,Qe,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,t){this.listeners[e].push(t)}removeListener(e,t){let n=this.listeners[e],r=n.indexOf(t);r!==-1&&(r===0&&n.length===1?n.length=0:n.splice(r,1))}emit(e,t,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let r=!1;for(let i of this.listeners[e])r=i(t,n)===!0||r;return e===`exit`&&(r=this.emit(`afterExit`,t,n)||r),r}},nt=class{};const rt=e=>({onExit(t,n){return e.onExit(t,n)},load(){return e.load()},unload(){return e.unload()}});var it=class extends nt{onExit(){return()=>{}}load(){}unload(){}},at=class extends nt{#e=ot.platform===`win32`?`SIGINT`:`SIGHUP`;#t=new tt;#n;#r;#i;#a={};#o=!1;constructor(e){super(),this.#n=e,this.#a={};for(let t of Xe)this.#a[t]=()=>{let n=this.#n.listeners(t),{count:r}=this.#t,i=e;if(typeof i.__signal_exit_emitter__==`object`&&typeof i.__signal_exit_emitter__.count==`number`&&(r+=i.__signal_exit_emitter__.count),n.length===r){this.unload();let n=this.#t.emit(`exit`,null,t),r=t===`SIGHUP`?this.#e:t;n||e.kill(e.pid,r)}};this.#i=e.reallyExit,this.#r=e.emit}onExit(e,t){if(!Ze(this.#n))return()=>{};this.#o===!1&&this.load();let n=t?.alwaysLast?`afterExit`:`exit`;return this.#t.on(n,e),()=>{this.#t.removeListener(n,e),this.#t.listeners.exit.length===0&&this.#t.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#o){this.#o=!0,this.#t.count+=1;for(let e of Xe)try{let t=this.#a[e];t&&this.#n.on(e,t)}catch{}this.#n.emit=(e,...t)=>this.#c(e,...t),this.#n.reallyExit=e=>this.#s(e)}}unload(){this.#o&&(this.#o=!1,Xe.forEach(e=>{let t=this.#a[e];if(!t)throw Error(`Listener not defined for signal: `+e);try{this.#n.removeListener(e,t)}catch{}}),this.#n.emit=this.#r,this.#n.reallyExit=this.#i,--this.#t.count)}#s(e){return Ze(this.#n)?(this.#n.exitCode=e||0,this.#t.emit(`exit`,this.#n.exitCode,null),this.#i.call(this.#n,this.#n.exitCode)):0}#c(e,...t){let n=this.#r;if(e===`exit`&&Ze(this.#n)){typeof t[0]==`number`&&(this.#n.exitCode=t[0]);let r=n.call(this.#n,e,...t);return this.#t.emit(`exit`,this.#n.exitCode,null),r}else return n.call(this.#n,e,...t)}};const ot=globalThis.process,{onExit:st,load:ct,unload:lt}=rt(Ze(ot)?new at(ot):new it),ut=`\x1B[?25l`,dt=`\x1B[?25h`,ft=(e=1)=>e>0?`[${e}A`:``,pt=(e=1)=>e>0?`[${e}B`:``,mt=(e,t)=>typeof t==`number`&&!Number.isNaN(t)?`[${t+1};${e+1}H`:`[${e+1}G`,ht=`\x1B[2K`,gt=e=>e>0?(ht+ft(1)).repeat(e-1)+ht+`\x1B[G`:``,_t=l,vt=u,yt={MCP_DEBUG:`1`,OK_LOG_FILE:`/tmp/ok-mcp.log`};function bt(e){if(typeof e!=`object`||!e)return!1;let t=e;if(t.command!==`/bin/sh`||!Array.isArray(t.args)||t.args[0]!==`-l`||t.args[1]!==`-c`)return!1;let n=t.args[2];return typeof n==`string`&&n.includes(`# ok-mcp-v1`)}function xt(e=process.argv[1]){if(!e)throw Error(`Cannot infer the local CLI entry for --dev-mcp because process.argv[1] is empty.`);let t=ce(e);if(I(t)===`cli.mjs`&&I(L(t))===`dist`)return t;let n=t.split(le),r=n.lastIndexOf(`packages`);if(r===-1||n[r+1]!==`cli`)throw Error(`Cannot infer the repo root for --dev-mcp from ${t}. Run the local CLI from this repo so the built dist path can be derived.`);let i=n.slice(0,r);return R(i.length===0?le:i.join(le),`packages`,`cli`,`dist`,`cli.mjs`)}function St(e={}){return e.mode===`dev`?{command:`node`,args:[xt(),`mcp`],env:{...yt}}:{command:`/bin/sh`,args:[`-l`,`-c`,`# ok-mcp-v1
|
|
6
6
|
USER_BUNDLE="$HOME/Applications/Open Knowledge.app/Contents/Resources/cli/bin/ok.sh"
|
|
7
7
|
[ -f "$USER_BUNDLE" ] && [ -x "$USER_BUNDLE" ] && exec "$USER_BUNDLE" mcp
|
|
8
8
|
BUNDLE="/Applications/Open Knowledge.app/Contents/Resources/cli/bin/ok.sh"
|
|
@@ -12,13 +12,13 @@ for d in "$HOME/.nvm/versions/node"/*/bin "$HOME/.fnm/node-versions"/*/installat
|
|
|
12
12
|
[ -f "$d/npx" ] && [ -x "$d/npx" ] && exec "$d/npx" -y @inkeep/open-knowledge@latest mcp
|
|
13
13
|
done
|
|
14
14
|
echo "Open Knowledge: install OK Desktop or Node.js 24+, then restart your editor" >&2
|
|
15
|
-
exit 127`]}}function Ct(e){return e===`win32`?ue:se}function wt(e={}){let t=e.platformName??process.platform,n=e.home??V();return Ct(t).join(n,`.claude.json`)}function Tt(e={}){let t=e.platformName??process.platform,n=e.home??V(),r=e.env??process.env;if(t===`darwin`)return se.join(n,`Library`,`Application Support`,`Claude`,`claude_desktop_config.json`);if(t===`win32`){let e=r.APPDATA??ue.join(n,`AppData`,`Roaming`);return ue.join(e,`Claude`,`claude_desktop_config.json`)}throw Error(`Claude Desktop is not available on ${t}. Supported: macOS, Windows.`)}function Et(e={}){let t=e.platformName??process.platform,n=e.home??V();return Ct(t).join(n,`.cursor`,`mcp.json`)}function Dt(e={}){let t=e.platformName??process.platform,n=e.home??V();return(e.env??process.env).CODEX_HOME??Ct(t).join(n,`.codex`)}function Ot(e={}){return Ct(e.platformName??process.platform).join(Dt(e),`config.toml`)}const G={claude:{id:`claude`,label:vt.claude,configPath:(e,t)=>wt({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>
|
|
15
|
+
exit 127`]}}function Ct(e){return e===`win32`?ue:se}function wt(e={}){let t=e.platformName??process.platform,n=e.home??V();return Ct(t).join(n,`.claude.json`)}function Tt(e={}){let t=e.platformName??process.platform,n=e.home??V(),r=e.env??process.env;if(t===`darwin`)return se.join(n,`Library`,`Application Support`,`Claude`,`claude_desktop_config.json`);if(t===`win32`){let e=r.APPDATA??ue.join(n,`AppData`,`Roaming`);return ue.join(e,`Claude`,`claude_desktop_config.json`)}throw Error(`Claude Desktop is not available on ${t}. Supported: macOS, Windows.`)}function Et(e={}){let t=e.platformName??process.platform,n=e.home??V();return Ct(t).join(n,`.cursor`,`mcp.json`)}function Dt(e={}){let t=e.platformName??process.platform,n=e.home??V();return(e.env??process.env).CODEX_HOME??Ct(t).join(n,`.codex`)}function Ot(e={}){return Ct(e.platformName??process.platform).join(Dt(e),`config.toml`)}const G={claude:{id:`claude`,label:vt.claude,configPath:(e,t)=>wt({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>m,buildEntry:(e,t)=>St(t),scope:`global`,detectPath:(e,t)=>R(t??V(),`.claude`),projectConfigPath:e=>R(e,`.mcp.json`),projectSkillPath:e=>R(e,`.claude`,`skills`,`open-knowledge`,`SKILL.md`)},"claude-desktop":{id:`claude-desktop`,label:vt[`claude-desktop`],configPath:(e,t)=>Tt({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>m,buildEntry:(e,t)=>St(t),scope:`global`,detectPath:(e,t)=>L(Tt({home:t}))},cursor:{id:`cursor`,label:vt.cursor,configPath:(e,t)=>Et({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>m,buildEntry:(e,t)=>St(t),scope:`global`,detectPath:(e,t)=>L(Et({home:t})),projectConfigPath:e=>R(e,`.cursor`,`mcp.json`),projectSkillPath:e=>R(e,`.cursor`,`skills`,`open-knowledge`,`SKILL.md`)},codex:{id:`codex`,label:vt.codex,configPath:(e,t)=>Ot({home:t}),format:`toml`,topLevelKey:`mcp_servers`,serverName:()=>m,buildEntry:(e,t)=>St(t),scope:`global`,detectPath:(e,t)=>L(Ot({home:t})),projectConfigPath:e=>R(e,`.codex`,`config.toml`),projectSkillPath:e=>R(e,`.agents`,`skills`,`open-knowledge`,`SKILL.md`)}};function kt(e){let t=e.filter(e=>!Object.hasOwn(G,e));if(t.length>0)throw Error(`Unknown editor(s): ${t.join(`, `)}. Valid options: ${_t.join(`, `)}`);return e.map(e=>G[e])}function At(e){let t=[`.ok/`,`.okignore`];for(let n of _t){let r=G[n];if(r.projectConfigPath&&t.push(Ht(r.projectConfigPath(e),e)),r.projectSkillPath){let n=Ht(r.projectSkillPath(e),e);t.push(`${Wt(n)}/`)}}return t.push(`.claude/launch.json`),Array.from(new Set(t))}function jt(e,t){let n=Ft(e,t).tracked;if(n.length>0)return{kind:`refused-tracked`,tracked:n,remediation:It(n)};let r=Lt(e);if(r.kind!==`ok`)return r.result;let i=M(r.path)?N(r.path,`utf-8`):``,a=Vt(i),o=[],s=[];for(let e of t)Bt(a,e)?s.push(e):o.push(e);if(o.length===0)return{kind:`updated`,appended:o,alreadyPresent:s,removed:[]};let c=i.length===0||i.endsWith(`
|
|
16
16
|
`)?``:`
|
|
17
17
|
`,l=`${o.join(`
|
|
18
18
|
`)}\n`;try{P(r.path,`${i}${c}${l}`,`utf-8`)}catch{return{kind:`no-exclude`,reason:`inaccessible`}}return{kind:`updated`,appended:o,alreadyPresent:s,removed:[]}}function Mt(e,t){let n=Lt(e);if(n.kind!==`ok`)return n.result;if(!M(n.path))return{kind:`updated`,appended:[],alreadyPresent:[],removed:[]};let r=t.map(e=>zt(e)),i=new Set;for(let e of r)for(let t of e)i.add(t);let a;try{a=N(n.path,`utf-8`)}catch{return{kind:`no-exclude`,reason:`inaccessible`}}let o=a.split(`
|
|
19
19
|
`),s=new Set,c=[];for(let e of o){let t=e.trim();if(i.has(t)){s.add(t);continue}c.push(e)}let l=t.filter(e=>{for(let t of zt(e))if(s.has(t))return!0;return!1});if(s.size===0)return{kind:`updated`,appended:[],alreadyPresent:[],removed:[]};let u=c.join(`
|
|
20
20
|
`);if(u!==a)try{P(n.path,u,`utf-8`)}catch{return{kind:`no-exclude`,reason:`inaccessible`}}return{kind:`updated`,appended:[],alreadyPresent:[],removed:l}}function Nt(e){let t=Lt(e);if(t.kind!==`ok`)return t.result.reason===`no-git`||t.result.reason===`malformed-pointer`||t.result.reason===`inaccessible`?`no-git`:`shared`;if(!M(t.path))return`shared`;let n;try{n=N(t.path,`utf-8`)}catch{return`shared`}let r=Vt(n),i=At(e);for(let e of i)if(Bt(r,e))return`local-only`;return`shared`}function Pt(e){let t=Lt(e);if(t.kind!==`ok`||!M(t.path))return[];let n;try{n=N(t.path,`utf-8`)}catch{return[]}let r=Vt(n);return At(e).filter(e=>Bt(r,e))}function Ft(e,t){let n=[];for(let r of t)if(M(ce(e,r)))try{re(`git`,[`ls-files`,`--error-unmatch`,`--`,r],{cwd:e,stdio:[`ignore`,`ignore`,`ignore`]}),n.push(r)}catch{}return{tracked:n}}function It(e){let t=[];t.push(`Cannot switch Open Knowledge to local-only — these OK files are tracked upstream:`),t.push(``);for(let n of e)t.push(` ${n}`);t.push(``),t.push(`.git/info/exclude only hides files that git isn't already tracking. To proceed, untrack them first:`),t.push(``);for(let n of e){let e=n.replace(/\/$/,``),r=n.endsWith(`/`)?`-r `:``;t.push(` git rm --cached ${r}${e}`)}return t.push(``),t.push("Then re-run the command. Note: `git rm --cached` removes the files from the index — your teammates will see a deletion on their next pull. If you don't want that, leave sharing mode set to 'shared'."),t.join(`
|
|
21
|
-
`)}function Lt(e){let t=
|
|
21
|
+
`)}function Lt(e){let t=f(e);switch(t.kind){case`directory`:case`linked`:{let e=R(Rt(t.path),`info`);return M(e)?{kind:`ok`,path:R(e,`exclude`)}:{kind:`no-exclude`,result:{kind:`no-exclude`,reason:`no-info-dir`}}}case`absent`:return{kind:`no-exclude`,result:{kind:`no-exclude`,reason:`no-git`}};case`malformed-pointer`:return{kind:`no-exclude`,result:{kind:`no-exclude`,reason:`malformed-pointer`}};case`inaccessible`:return{kind:`no-exclude`,result:{kind:`no-exclude`,reason:`inaccessible`}}}}function Rt(e){let t=R(e,`commondir`);if(!M(t))return e;let n;try{n=N(t,`utf-8`).trim()}catch{return e}return n.length===0?e:oe(n)?n:ce(e,n)}function zt(e){let t=e.replace(/\/$/,``);return new Set([e,t,`/${e}`,`/${t}`])}function Bt(e,t){for(let n of zt(t))if(e.has(n))return!0;return!1}function Vt(e){let t=new Set;for(let n of e.split(`
|
|
22
22
|
`)){let e=n.trim();e.length!==0&&t.add(e)}return t}function Ht(e,t){return Ut(z(t,e))}function Ut(e){return le===`/`?e:e.split(le).join(`/`)}function Wt(e){let t=e.lastIndexOf(`/`);return t<0?`.`:e.slice(0,t)}const Gt=(e,t=[])=>e.name===`up`||t.includes(`vim`)&&e.name===`k`||t.includes(`emacs`)&&e.ctrl&&e.name===`p`,Kt=(e,t=[])=>e.name===`down`||t.includes(`vim`)&&e.name===`j`||t.includes(`emacs`)&&e.ctrl&&e.name===`n`,qt=e=>e.name===`space`,Jt=e=>`1234567890`.includes(e.name),Yt=e=>e.name===`enter`||e.name===`return`;var Xt=class extends Error{name=`AbortPromptError`;message=`Prompt was aborted`;constructor(e){super(),this.cause=e?.cause}},Zt=class extends Error{name=`CancelPromptError`;message=`Prompt was canceled`},Qt=class extends Error{name=`ExitPromptError`},$t=class extends Error{name=`HookError`},en=class extends Error{name=`ValidationError`};const tn=new pe;function nn(e){return{rl:e,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function rn(e,t){let n=nn(e);return tn.run(n,()=>{function e(e){n.handleChange=()=>{n.index=0,e()},n.handleChange()}return t(e)})}function K(){let e=tn.getStore();if(!e)throw new $t(`[Inquirer] Hook functions can only be called from within a prompt`);return e}function an(){return K().rl}function on(e){return me.bind((...t)=>{let n=K(),r=!1,i=n.handleChange;n.handleChange=()=>{r=!0};let a=e(...t);return r&&i(),n.handleChange=i,a})}function sn(e){let t=K(),{index:n}=t,r=e({get(){return t.hooks[n]},set(e){t.hooks[n]=e},initialized:n in t.hooks});return t.index++,r}function cn(){K().handleChange()}const ln={queue(e){let t=K(),{index:n}=t;t.hooksEffect.push(()=>{t.hooksCleanup[n]?.();let r=e(an());if(r!=null&&typeof r!=`function`)throw new en(`useEffect return value must be a cleanup function or nothing.`);t.hooksCleanup[n]=r})},run(){let e=K();on(()=>{e.hooksEffect.forEach(e=>{e()}),e.hooksEffect.length=0})()},clearAll(){let e=K();e.hooksCleanup.forEach(e=>{e?.()}),e.hooksEffect.length=0,e.hooksCleanup.length=0}};function un(e){return typeof e==`function`}function q(e){return sn(t=>{let n=me.bind(function(e){t.get()!==e&&(t.set(e),cn())});if(t.initialized)return[t.get(),n];let r=un(e)?e():e;return t.set(r),[r,n]})}function dn(e,t){sn(n=>{let r=n.get();(!Array.isArray(r)||t.some((e,t)=>!Object.is(e,r[t])))&&ln.queue(e),n.set(t)})}const fn={prefix:{idle:H(`blue`,`?`),done:H(`green`,U.tick)},spinner:{interval:80,frames:[`⠋`,`⠙`,`⠹`,`⠸`,`⠼`,`⠴`,`⠦`,`⠧`,`⠇`,`⠏`].map(e=>H(`yellow`,e))},style:{answer:e=>H(`cyan`,e),message:e=>H(`bold`,e),error:e=>H(`red`,`> ${e}`),defaultAnswer:e=>H(`dim`,`(${e})`),help:e=>H(`dim`,e),highlight:e=>H(`cyan`,e),key:e=>H(`cyan`,H(`bold`,`<${e}>`))}};function pn(e){if(typeof e!=`object`||!e)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function mn(...e){let t={};for(let n of e)for(let[e,r]of Object.entries(n)){let n=t[e];t[e]=pn(n)&&pn(r)?mn(n,r):r}return t}function hn(...e){return mn(fn,...e.filter(e=>e!=null))}function gn({status:e=`idle`,theme:t}){let[n,r]=q(!1),[i,a]=q(0),{prefix:o,spinner:s}=hn(t);return dn(()=>{if(e===`loading`){let e,t=-1,n=setTimeout(()=>{r(!0),e=setInterval(()=>{t+=1,a(t%s.frames.length)},s.interval)},300);return()=>{clearTimeout(n),clearInterval(e)}}else r(!1)},[e]),n?s.frames[i]:typeof o==`string`?o:o[e===`loading`?`idle`:e]??o.idle}function _n(e,t){return sn(n=>{let r=n.get();if(!r||r.dependencies.length!==t.length||r.dependencies.some((e,n)=>e!==t[n])){let r=e();return n.set({value:r,dependencies:t}),r}return r.value})}function vn(e){return q({current:e})[0]}function yn(e){let t=vn(e);t.current=e,dn(e=>{let n=!1,r=on((r,i)=>{n||t.current(i,e)});return e.input.on(`keypress`,r),()=>{n=!0,e.input.removeListener(`keypress`,r)}},[])}var bn=t(Te(),1);function xn(e,t){return e.split(`
|
|
23
23
|
`).flatMap(e=>Je(e,t,{trim:!1,hard:!0}).split(`
|
|
24
24
|
`).map(e=>e.trimEnd())).join(`
|
|
@@ -290,8 +290,8 @@ let bi=/^[a-z0-9-_]+$/i;function xi(e){let t=typeof e;if(t===`object`){if(Array.
|
|
|
290
290
|
`)+Oi(e,t[c],e,r-1,i)}else a+=s,a+=` = `,a+=wi(t[c],e,r,i),a+=`
|
|
291
291
|
`}}return e&&(a||!o)&&(a=a?`[${e}]\n${a}`:`[${e}]`),a&&o?`${a}\n${o}`:a||o}function ki(e,{maxDepth:t=1e3,numbersAsFloat:n=!1}={}){if(xi(e)!==`object`)throw TypeError(`stringify can only be called with an object`);let r=Oi(0,e,``,t,n);return r[r.length-1]===`
|
|
292
292
|
`?r:r+`
|
|
293
|
-
`}function Ai(e,t){let n=z(t,e);return n.length>0&&!n.startsWith(`..`)&&!oe(n)}const ji=e=>{try{let t=re(`git`,[`rev-parse`,`--show-toplevel`],{cwd:e,encoding:`utf8`,stdio:[`ignore`,`pipe`,`ignore`]}).trim();return t.length>0?t:null}catch{return null}};function Mi(e,t={}){let n=t.homeDir??V(),r=t.gitTopLevel??ji,i=ce(e),a;try{a=ae(i)}catch{a=i}let o=a,s=0;for(;s<30&&!(o===n||o===`/`||o===``);){if(
|
|
294
|
-
`)}\r\n\r\n`),n.length>0&&o.write(n)}catch(e){c({event:`proxy-upgrade-handshake-write-failed`,err:e});return}o.on(`data`,e=>{t.writable&&t.write(e)}),t.on(`data`,e=>{o.writable&&o.write(e)})}),o.once(`timeout`,()=>{c({event:`proxy-upgrade-upstream-connect-timeout`})}),o.on(`error`,e=>c({event:`proxy-upgrade-upstream-error`,err:e})),t.on(`error`,e=>c({event:`proxy-upgrade-client-error`,err:e})),o.once(`close`,()=>c()),t.once(`close`,()=>c())}const Ri=[`connection`,`keep-alive`,`proxy-authenticate`,`proxy-authorization`,`te`,`trailer`,`transfer-encoding`,`upgrade`,`cookie`,`set-cookie`];async function zi(e){let t=e.upstreamTimeoutMs??Ni,n=new Set,r=he((n,r)=>{Pi(n,r)||Vi(n,r,e.upstreamHost,e.upstreamPort,t)});r.on(`upgrade`,(t,r,i)=>{Ii(t,r)||Li(t,r,i,e.upstreamHost,e.upstreamPort,n)}),await new Promise((t,n)=>{let i=e=>n(e);r.once(`error`,i),r.listen(e.listenPort,e.host,()=>{r.off(`error`,i),t()})});let i=r.address();return{httpServer:r,port:typeof i==`object`&&i?i.port:e.listenPort,close:()=>new Promise(e=>{for(let e of n)try{e.destroy()}catch{}n.clear(),r.close(()=>e()),r.closeIdleConnections()})}}function Bi(e,t,n){Vi(e,t,n.upstreamHost,n.upstreamPort,n.upstreamTimeoutMs??Ni)}function Vi(e,t,n,r,i){let a={...e.headers};delete a.host;for(let e of Ri)delete a[e];e.setTimeout(Fi,()=>{if(t.headersSent)try{t.end()}catch{}else try{$(t,408,`urn:ok:error:request-timeout`,`Proxy request exceeded the per-request deadline.`,`Slow-loris-class: client did not finish within ${Fi/1e3}s.`)}catch{}try{e.socket?.destroy()}catch{}});let o=ge({host:n,port:r,method:e.method,path:e.url,headers:{...a,host:`${n}:${r}`}},e=>{let n={...e.headers};for(let e of Ri)delete n[e];t.writeHead(e.statusCode??502,n),e.pipe(t),e.once(`error`,()=>{try{t.end()}catch{}})});i>0&&o.setTimeout(i,()=>{if(!t.headersSent)$(t,504,`urn:ok:error:gateway-timeout`,`Upstream did not respond before the gateway deadline.`,`Upstream timeout: ${i/1e3}s elapsed without a response.`);else try{t.end()}catch{}o.destroy()}),o.on(`error`,()=>{if(!t.headersSent)$(t,502,`urn:ok:error:collab-server-not-running`,`Collab server is unreachable.`,`Upstream connection failed or dropped before a response was received.`);else try{t.end()}catch{}}),e.on(`error`,()=>{o.destroy()}),e.pipe(o)}const Hi=39847,Ui=39848;async function Wi(e){await Promise.all(e.map(e=>new Promise(t=>{e.close(()=>t())})))}async function Gi(e){let{existsSync:t}=await import(`node:fs`),{createServer:n}=await import(`node:http`),{resolve:r}=await import(`node:path`),{acquireUiLock:i,clearArmedPaneTarget:s,createAssetServeMiddleware:c,createContentFilter:l,readArmedPaneTarget:f,readServerLock:p,releaseUiLock:m,updateUiLockPort:h}=await import(`./dist-Cz45iNYz.mjs`),{default:g}=await import(`./build-CZpdADQB.mjs`),{resolveContentDir:_,resolveLockDir:v}=await import(`./dist-Cz45iNYz.mjs`),y=_(e.config,e.cwd),b=v(e.cwd);i(b,{port:0,worktreeRoot:e.cwd});let x=import.meta.dirname??new URL(`.`,import.meta.url).pathname,S=[r(x,`public`),r(x,`../../app/dist`),r(x,`../../../app/dist`)],C=e.assetDir??S.find(e=>t(e)),w=C?g(C,{single:!0,gzip:!0,etag:!0,dev:!0,extensions:[]}):null,ee=t(y)?c({contentFilter:l({projectDir:e.cwd,contentDir:y}),contentSirv:g(y,{dotfiles:!1,dev:!0,extensions:[]}),inlineExtensions:o,assetExtensions:d,blocklistExtensions:u}):null,T=e.port,E=null,D=(e,t)=>{let n=e.url?.split(`?`)[0];if(e.method===`GET`&&(n===`/`||n===``)){let e=f(b);if(e&&!/[\r\n]/.test(e)){s(b),t.statusCode=302,t.setHeader(`Location`,`/${e}`),t.setHeader(`Cache-Control`,`no-store`),t.end();return}}if((n===`/`||n===``)&&(e.url=`/index.html`),!(n?.startsWith(`/api/`)&&Pi(e,t))){if(n===`/api/config`&&e.method===`DELETE`){s(b),t.setHeader(`Cache-Control`,`no-store`),t.statusCode=204,t.end();return}if(n===`/api/config`&&(e.method===`GET`||e.method===`HEAD`)){E?.();let n=p(b),r=e.headers.host??`localhost:${T}`,i=n&&n.port>0?`ws://${r}/collab`:null,a=f(b),o=JSON.stringify({collabUrl:i,previewUrl:null,port:T,paneTarget:a});t.setHeader(`Content-Type`,`application/json`),t.setHeader(`Cache-Control`,`no-store`),t.setHeader(`X-Content-Type-Options`,`nosniff`),t.statusCode=200,e.method===`HEAD`?t.end():t.end(o);return}if(n?.startsWith(`/api/`)){E?.();let r=p(b);if(!r||r.port<=0){$(t,503,`urn:ok:error:collab-server-not-running`,"Collab server not running. Start `ok start` or run `ok status`.",`Path: ${n}`);return}Bi(e,t,{upstreamHost:`localhost`,upstreamPort:r.port});return}if(w&&n?.startsWith(`/assets/`)){w(e,t,()=>{ee?ee(e,t,()=>Ki(t)):Ki(t)});return}if(ee){ee(e,t,()=>{w?w(e,t):Ki(t)});return}if(w){w(e,t);return}Ki(t)}},O=new Set,k=(e,t,n)=>{if(Ii(e,t))return;let r=e.url?.split(`?`)[0]??``;if(r!==`/collab`&&!r.startsWith(`/collab/`)){t.destroy();return}let i=p(b);if(!i||i.port<=0){console.warn(JSON.stringify({event:`ok-ui-upgrade-no-collab-lock`,url:r,reason:"server.lock missing or port unbound — is `ok start` running?"})),t.destroy();return}Li(e,t,n,`localhost`,i.port,O)},A=()=>{for(let e of O)try{e.destroy()}catch{}O.clear()},te=e.host===void 0?[`::1`,`127.0.0.1`]:[e.host],ne=[],j=e.port,re=e=>e instanceof Error&&e.code===`EADDRINUSE`,M=async()=>{await Promise.all(ne.splice(0).map(e=>new Promise(t=>{try{e.close(()=>t())}catch{t()}})))},ie=async e=>{j=e;for(let e of te){let t=n(D);t.on(`upgrade`,k),ne.push(t),await new Promise((n,r)=>{let i=e=>r(e);t.once(`error`,i),t.listen(j,e,()=>{t.off(`error`,i);let e=t.address();typeof e==`object`&&e&&(j=e.port),n()})})}};try{try{await ie(e.port)}catch(t){if(e.fallbackToKernel===!0&&re(t))await M(),await ie(0);else throw t}}catch(e){await M();try{m(b)}catch{}throw e}let N=j;T=N,h(b,N);let ae=e.scheduler??a,P=e.safetyNetMs??432e5,F=null,I=!1,L=!1,oe=()=>{I||(I=!0,F!==null&&(ae.clearTimeout(F),F=null))},R=()=>{if(oe(),!L){L=!0;try{m(b)}catch{}}},se=()=>{I||P<=0||(F!==null&&(ae.clearTimeout(F),F=null),F=ae.setTimeout(()=>{F=null,console.warn(`[ui] safety-net (${P}ms) reached — shutting down (D-025 backstop)`);try{e.onSafetyNet?.()}catch{}A();for(let e of ne)try{e.close()}catch{}R()},P))},z=()=>{I||P<=0||se()};return E=z,se(),{httpServers:ne,port:N,release:R,detachSafetyNet:oe,nudgeSafetyNet:z,drainUpgradeSockets:A}}function Ki(e){e.headersSent||e.writableEnded||e.destroyed||(e.setHeader(`X-Content-Type-Options`,`nosniff`),e.setHeader(`Cache-Control`,`no-store`),e.statusCode=404,e.end())}function qi(e,t){if(e!==void 0){let t=Number.parseInt(e,10);if(Number.isNaN(t)||t<0||t>65535)throw Error(`Invalid --port value '${e}'`);return{port:t,fallbackToKernel:!1}}if(t!==void 0&&t!==``){let e=Number.parseInt(t,10);if(Number.isNaN(e)||e<0||e>65535)throw Error(`Invalid PORT env value '${t}'`);return{port:e,fallbackToKernel:!1}}return{port:Hi,fallbackToKernel:!0}}async function Ji(e){let t=e.readLock??(async()=>{let{readUiLock:t}=await import(`./dist-Cz45iNYz.mjs`);return t(e.lockDir)}),n=await t();if(!n)throw Error(`UI lock collision reported but the lock disappeared before handling — retry acquiring.`);if(n.port===e.requestedPort&&n.port>0)return{mode:`already-running`,port:n.port};let r=n.port;if(r===0){let n=Date.now()+(e.pollDeadlineMs??2e3),i=e.pollIntervalMs??100;for(;Date.now()<n;){await new Promise(e=>{setTimeout(e,i)});let e=await t();if(e&&e.port>0){r=e.port;break}}if(r===0)throw Error("UI did not bind within 2s; run `ok clean`");if(r===e.requestedPort)return{mode:`already-running`,port:r}}return{mode:`proxy`,handle:await zi({listenPort:e.requestedPort,host:e.host,upstreamHost:`localhost`,upstreamPort:r}),upstreamPort:r}}function Yi(e){return new i(`ui`).description(`Serve the Open Knowledge React editor UI`).option(`-p, --port <port>`,`UI port (default: $PORT env or ${Hi}, kernel-allocated fallback if busy)`).option(`-H, --host <host>`,"UI host. Default: two-socket loopback bind (`[::1]` + `127.0.0.1`) so cross-family collisions fail loud. Pass an explicit host (e.g. `127.0.0.1`, `0.0.0.0`) to bind a single socket on that host.").action(async t=>{let{dim:n}=await import(`./colors-gw_5YWUu.mjs`),{UiLockCollisionError:r}=await import(`./dist-Cz45iNYz.mjs`),{resolveLockDir:i}=await import(`./dist-Cz45iNYz.mjs`),a=e(),o=t.host,s;try{s=qi(t.port,process.env.PORT)}catch(e){console.error(e instanceof Error?e.message:String(e)),process.exitCode=1;return}let c=s.port;try{let e=await Gi({config:a,cwd:process.cwd(),port:c,fallbackToKernel:s.fallbackToKernel,host:o}),t=o===void 0||o===`::`||o===`0.0.0.0`?`localhost`:o;console.log(`${n(`[ui]`)} listening on http://${t}:${e.port}`);let r=!1,i=t=>{if(r)return;r=!0,console.log(n(`\n[ui] Shutting down (${t})`)),e.detachSafetyNet();let i=()=>{try{e.release()}finally{process.exit(process.exitCode??0)}};e.drainUpgradeSockets(),Wi(e.httpServers).then(i,i),setTimeout(i,2e3).unref()};process.once(`SIGINT`,()=>i(`SIGINT`)),process.once(`SIGTERM`,()=>i(`SIGTERM`));return}catch(e){if(!(e instanceof r))throw e;let t=i(process.cwd()),a=o??`localhost`,s;try{s=await Ji({requestedPort:c,host:a,lockDir:t})}catch(e){console.error(e instanceof Error?e.message:String(e)),process.exit(1)}if(s.mode===`already-running`){if(console.log(`UI already running at http://${a}:${s.port}`),Xi(process)){await new Promise(e=>{let t=t=>{console.log(n(`\n[ui-keepalive] Shutting down (${t})`)),e()};process.once(`SIGINT`,()=>t(`SIGINT`)),process.once(`SIGTERM`,()=>t(`SIGTERM`))});return}process.exit(0)}console.log(`UI running at http://${a}:${s.upstreamPort}; acting as HTTP proxy on port ${s.handle.port}`);let l=!1,u=e=>{l||(l=!0,console.log(n(`\n[ui-proxy] Shutting down (${e})`)),s.handle.close().finally(()=>process.exit(process.exitCode??0)),setTimeout(()=>process.exit(process.exitCode??0),2e3).unref())};process.once(`SIGINT`,()=>u(`SIGINT`)),process.once(`SIGTERM`,()=>u(`SIGTERM`))}})}function Xi(e){let t=e.stdout.isTTY===!0,n=typeof e.env.PORT==`string`&&e.env.PORT!==``;return!t||n}function Zi(e){if(!M(e))return{};let t=N(e,`utf-8`).trim();if(t===``)return{};try{let n=JSON.parse(t);if(T(n))return n;throw Error(`${e} root must be a JSON object`)}catch(t){throw t instanceof SyntaxError?Error(`${e} contains invalid JSON: ${t.message}`):t}}function Qi(e){if(!M(e))return{};let t=N(e,`utf-8`).trim();if(t===``)return{};try{let n=yi(t);if(T(n))return n;throw Error(`${e} root must be a TOML table`)}catch(t){throw Error(`${e} contains invalid TOML: ${t instanceof Error?t.message:String(t)}`)}}function $i(e,t){m(e,`${JSON.stringify(t,null,2)}\n`)}function ea(e,t){let n=ki(t);m(e,n.endsWith(`
|
|
293
|
+
`}function Ai(e,t){let n=z(t,e);return n.length>0&&!n.startsWith(`..`)&&!oe(n)}const ji=e=>{try{let t=re(`git`,[`rev-parse`,`--show-toplevel`],{cwd:e,encoding:`utf8`,stdio:[`ignore`,`pipe`,`ignore`]}).trim();return t.length>0?t:null}catch{return null}};function Mi(e,t={}){let n=t.homeDir??V(),r=t.gitTopLevel??ji,i=ce(e),a;try{a=ae(i)}catch{a=i}let o=a,s=0;for(;s<30&&!(o===n||o===`/`||o===``);){if(C(o))return{projectRoot:o,defaultContentDir:`.`,ancestorPromoted:o!==a,gitRootPromoted:!1};let e=L(o);if(e===o)break;o=e,s+=1}let c=r(a);return c!==null&&Ai(c,n)?c===a?{projectRoot:i,defaultContentDir:`.`,ancestorPromoted:!1,gitRootPromoted:!1}:{projectRoot:c,defaultContentDir:`.`,ancestorPromoted:!1,gitRootPromoted:!0}:{projectRoot:i,defaultContentDir:`.`,ancestorPromoted:!1,gitRootPromoted:!1}}function $(e,t,n,r,i){let a=`urn:uuid:${de()}`;if(e.headersSent||e.writableEnded||e.destroyed){console.error(`[ok ui] emitProblem called after headers sent — suppressed`,{type:n,status:t,instance:a});return}let o={type:n,title:r,status:t,instance:a,...i===void 0?{}:{detail:i}},s=c.safeParse(o);if(!s.success){console.error(`[ok ui] emitProblem produced an invalid ProblemDetails body:`,{issues:s.error.issues,originalStatus:t,body:o}),e.writeHead(500,{"Content-Type":`application/problem+json`,"X-Content-Type-Options":`nosniff`,"Cache-Control":`no-store`}),e.end(JSON.stringify({type:`urn:ok:error:internal-server-error`,title:`Internal server error.`,status:500,instance:a}));return}e.writeHead(t,{"Content-Type":`application/problem+json`,"X-Content-Type-Options":`nosniff`,"Cache-Control":`no-store`}),e.end(JSON.stringify(o))}const Ni=1e4;function Pi(e,t){let n=e.socket?.remoteAddress;if(n!==void 0&&!v(n))return $(t,403,`urn:ok:error:loopback-required`,`Request must originate from a loopback address.`),!0;if(!h(e.headers.host))return $(t,403,`urn:ok:error:host-not-allowed`,`Host header is not in the loopback allowlist.`),!0;let r=e.headers.origin;return r!==void 0&&!b(r)?($(t,403,`urn:ok:error:invalid-origin`,`Origin header is not in the loopback allowlist.`),!0):!1}const Fi=3e4;function Ii(e,t){let n=e.socket?.remoteAddress;if(n!==void 0&&!v(n)||!h(e.headers.host))return t.destroy(),!0;let r=e.headers.origin;return typeof r==`string`&&!b(r)?(t.destroy(),!0):!1}function Li(e,t,n,r,i,a){a.add(t),t.once(`close`,()=>a.delete(t));let o=ve({host:r,port:i,timeout:Ni});a.add(o),o.once(`close`,()=>a.delete(o));let s=!1,c=n=>{if(!s){if(s=!0,n!==void 0){let t=n.err;console.warn(JSON.stringify({event:n.event,upstreamHost:r,upstreamPort:i,url:e.url,code:t instanceof Error?t.code:void 0,message:t instanceof Error?t.message:void 0}))}try{o.destroy()}catch{}try{t.destroy()}catch{}}};o.once(`connect`,()=>{o.setTimeout(0);let a=[`${e.method??`GET`} ${e.url??`/`} HTTP/1.1`,`host: ${r}:${i}`];for(let[t,n]of Object.entries(e.headers))if(t.toLowerCase()!==`host`&&n!==void 0)if(Array.isArray(n))for(let e of n)a.push(`${t}: ${e}`);else a.push(`${t}: ${n}`);try{o.write(`${a.join(`\r
|
|
294
|
+
`)}\r\n\r\n`),n.length>0&&o.write(n)}catch(e){c({event:`proxy-upgrade-handshake-write-failed`,err:e});return}o.on(`data`,e=>{t.writable&&t.write(e)}),t.on(`data`,e=>{o.writable&&o.write(e)})}),o.once(`timeout`,()=>{c({event:`proxy-upgrade-upstream-connect-timeout`})}),o.on(`error`,e=>c({event:`proxy-upgrade-upstream-error`,err:e})),t.on(`error`,e=>c({event:`proxy-upgrade-client-error`,err:e})),o.once(`close`,()=>c()),t.once(`close`,()=>c())}const Ri=[`connection`,`keep-alive`,`proxy-authenticate`,`proxy-authorization`,`te`,`trailer`,`transfer-encoding`,`upgrade`,`cookie`,`set-cookie`];async function zi(e){let t=e.upstreamTimeoutMs??Ni,n=new Set,r=he((n,r)=>{Pi(n,r)||Vi(n,r,e.upstreamHost,e.upstreamPort,t)});r.on(`upgrade`,(t,r,i)=>{Ii(t,r)||Li(t,r,i,e.upstreamHost,e.upstreamPort,n)}),await new Promise((t,n)=>{let i=e=>n(e);r.once(`error`,i),r.listen(e.listenPort,e.host,()=>{r.off(`error`,i),t()})});let i=r.address();return{httpServer:r,port:typeof i==`object`&&i?i.port:e.listenPort,close:()=>new Promise(e=>{for(let e of n)try{e.destroy()}catch{}n.clear(),r.close(()=>e()),r.closeIdleConnections()})}}function Bi(e,t,n){Vi(e,t,n.upstreamHost,n.upstreamPort,n.upstreamTimeoutMs??Ni)}function Vi(e,t,n,r,i){let a={...e.headers};delete a.host;for(let e of Ri)delete a[e];e.setTimeout(Fi,()=>{if(t.headersSent)try{t.end()}catch{}else try{$(t,408,`urn:ok:error:request-timeout`,`Proxy request exceeded the per-request deadline.`,`Slow-loris-class: client did not finish within ${Fi/1e3}s.`)}catch{}try{e.socket?.destroy()}catch{}});let o=ge({host:n,port:r,method:e.method,path:e.url,headers:{...a,host:`${n}:${r}`}},e=>{let n={...e.headers};for(let e of Ri)delete n[e];t.writeHead(e.statusCode??502,n),e.pipe(t),e.once(`error`,()=>{try{t.end()}catch{}})});i>0&&o.setTimeout(i,()=>{if(!t.headersSent)$(t,504,`urn:ok:error:gateway-timeout`,`Upstream did not respond before the gateway deadline.`,`Upstream timeout: ${i/1e3}s elapsed without a response.`);else try{t.end()}catch{}o.destroy()}),o.on(`error`,()=>{if(!t.headersSent)$(t,502,`urn:ok:error:collab-server-not-running`,`Collab server is unreachable.`,`Upstream connection failed or dropped before a response was received.`);else try{t.end()}catch{}}),e.on(`error`,()=>{o.destroy()}),e.pipe(o)}const Hi=39847,Ui=39848;async function Wi(e){await Promise.all(e.map(e=>new Promise(t=>{e.close(()=>t())})))}async function Gi(e){let{existsSync:t}=await import(`node:fs`),{createServer:n}=await import(`node:http`),{resolve:r}=await import(`node:path`),{acquireUiLock:i,clearArmedPaneTarget:c,createAssetServeMiddleware:l,createContentFilter:u,readArmedPaneTarget:f,readServerLock:p,releaseUiLock:m,updateUiLockPort:h}=await import(`./dist-GL5zcXSU.mjs`),{default:g}=await import(`./build-CCDQyip-.mjs`),{resolveContentDir:_,resolveLockDir:v}=await import(`./dist-GL5zcXSU.mjs`),y=_(e.config,e.cwd),b=v(e.cwd);i(b,{port:0,worktreeRoot:e.cwd});let x=import.meta.dirname??new URL(`.`,import.meta.url).pathname,S=[r(x,`public`),r(x,`../../app/dist`),r(x,`../../../app/dist`)],C=e.assetDir??S.find(e=>t(e)),w=C?g(C,{single:!0,gzip:!0,etag:!0,dev:!0,extensions:[]}):null,ee=t(y)?l({contentFilter:u({projectDir:e.cwd,contentDir:y}),contentSirv:g(y,{dotfiles:!1,dev:!0,extensions:[]}),inlineExtensions:a,assetExtensions:d,blocklistExtensions:s}):null,T=e.port,E=null,D=(e,t)=>{let n=e.url?.split(`?`)[0];if(e.method===`GET`&&(n===`/`||n===``)){let e=f(b);if(e&&!/[\r\n]/.test(e)){c(b),t.statusCode=302,t.setHeader(`Location`,`/${e}`),t.setHeader(`Cache-Control`,`no-store`),t.end();return}}if((n===`/`||n===``)&&(e.url=`/index.html`),!(n?.startsWith(`/api/`)&&Pi(e,t))){if(n===`/api/config`&&e.method===`DELETE`){c(b),t.setHeader(`Cache-Control`,`no-store`),t.statusCode=204,t.end();return}if(n===`/api/config`&&(e.method===`GET`||e.method===`HEAD`)){E?.();let n=p(b),r=e.headers.host??`localhost:${T}`,i=n&&n.port>0?`ws://${r}/collab`:null,a=f(b),o=JSON.stringify({collabUrl:i,previewUrl:null,port:T,paneTarget:a});t.setHeader(`Content-Type`,`application/json`),t.setHeader(`Cache-Control`,`no-store`),t.setHeader(`X-Content-Type-Options`,`nosniff`),t.statusCode=200,e.method===`HEAD`?t.end():t.end(o);return}if(n?.startsWith(`/api/`)){E?.();let r=p(b);if(!r||r.port<=0){$(t,503,`urn:ok:error:collab-server-not-running`,"Collab server not running. Start `ok start` or run `ok status`.",`Path: ${n}`);return}Bi(e,t,{upstreamHost:`localhost`,upstreamPort:r.port});return}if(w&&n?.startsWith(`/assets/`)){w(e,t,()=>{ee?ee(e,t,()=>Ki(t)):Ki(t)});return}if(ee){ee(e,t,()=>{w?w(e,t):Ki(t)});return}if(w){w(e,t);return}Ki(t)}},O=new Set,k=(e,t,n)=>{if(Ii(e,t))return;let r=e.url?.split(`?`)[0]??``;if(r!==`/collab`&&!r.startsWith(`/collab/`)){t.destroy();return}let i=p(b);if(!i||i.port<=0){console.warn(JSON.stringify({event:`ok-ui-upgrade-no-collab-lock`,url:r,reason:"server.lock missing or port unbound — is `ok start` running?"})),t.destroy();return}Li(e,t,n,`localhost`,i.port,O)},A=()=>{for(let e of O)try{e.destroy()}catch{}O.clear()},te=e.host===void 0?[`::1`,`127.0.0.1`]:[e.host],ne=[],j=e.port,re=e=>e instanceof Error&&e.code===`EADDRINUSE`,M=async()=>{await Promise.all(ne.splice(0).map(e=>new Promise(t=>{try{e.close(()=>t())}catch{t()}})))},ie=async e=>{j=e;for(let e of te){let t=n(D);t.on(`upgrade`,k),ne.push(t),await new Promise((n,r)=>{let i=e=>r(e);t.once(`error`,i),t.listen(j,e,()=>{t.off(`error`,i);let e=t.address();typeof e==`object`&&e&&(j=e.port),n()})})}};try{try{await ie(e.port)}catch(t){if(e.fallbackToKernel===!0&&re(t))await M(),await ie(0);else throw t}}catch(e){await M();try{m(b)}catch{}throw e}let N=j;T=N,h(b,N);let ae=e.scheduler??o,P=e.safetyNetMs??432e5,F=null,I=!1,L=!1,oe=()=>{I||(I=!0,F!==null&&(ae.clearTimeout(F),F=null))},R=()=>{if(oe(),!L){L=!0;try{m(b)}catch{}}},se=()=>{I||P<=0||(F!==null&&(ae.clearTimeout(F),F=null),F=ae.setTimeout(()=>{F=null,console.warn(`[ui] safety-net (${P}ms) reached — shutting down (D-025 backstop)`);try{e.onSafetyNet?.()}catch{}A();for(let e of ne)try{e.close()}catch{}R()},P))},z=()=>{I||P<=0||se()};return E=z,se(),{httpServers:ne,port:N,release:R,detachSafetyNet:oe,nudgeSafetyNet:z,drainUpgradeSockets:A}}function Ki(e){e.headersSent||e.writableEnded||e.destroyed||(e.setHeader(`X-Content-Type-Options`,`nosniff`),e.setHeader(`Cache-Control`,`no-store`),e.statusCode=404,e.end())}function qi(e,t){if(e!==void 0){let t=Number.parseInt(e,10);if(Number.isNaN(t)||t<0||t>65535)throw Error(`Invalid --port value '${e}'`);return{port:t,fallbackToKernel:!1}}if(t!==void 0&&t!==``){let e=Number.parseInt(t,10);if(Number.isNaN(e)||e<0||e>65535)throw Error(`Invalid PORT env value '${t}'`);return{port:e,fallbackToKernel:!1}}return{port:Hi,fallbackToKernel:!0}}async function Ji(e){let t=e.readLock??(async()=>{let{readUiLock:t}=await import(`./dist-GL5zcXSU.mjs`);return t(e.lockDir)}),n=await t();if(!n)throw Error(`UI lock collision reported but the lock disappeared before handling — retry acquiring.`);if(n.port===e.requestedPort&&n.port>0)return{mode:`already-running`,port:n.port};let r=n.port;if(r===0){let n=Date.now()+(e.pollDeadlineMs??2e3),i=e.pollIntervalMs??100;for(;Date.now()<n;){await new Promise(e=>{setTimeout(e,i)});let e=await t();if(e&&e.port>0){r=e.port;break}}if(r===0)throw Error("UI did not bind within 2s; run `ok clean`");if(r===e.requestedPort)return{mode:`already-running`,port:r}}return{mode:`proxy`,handle:await zi({listenPort:e.requestedPort,host:e.host,upstreamHost:`localhost`,upstreamPort:r}),upstreamPort:r}}function Yi(e){return new i(`ui`).description(`Serve the Open Knowledge React editor UI`).option(`-p, --port <port>`,`UI port (default: $PORT env or ${Hi}, kernel-allocated fallback if busy)`).option(`-H, --host <host>`,"UI host. Default: two-socket loopback bind (`[::1]` + `127.0.0.1`) so cross-family collisions fail loud. Pass an explicit host (e.g. `127.0.0.1`, `0.0.0.0`) to bind a single socket on that host.").action(async t=>{let{dim:n}=await import(`./colors-CkPULM8m.mjs`),{UiLockCollisionError:r}=await import(`./dist-GL5zcXSU.mjs`),{resolveLockDir:i}=await import(`./dist-GL5zcXSU.mjs`),a=e(),o=t.host,s;try{s=qi(t.port,process.env.PORT)}catch(e){console.error(e instanceof Error?e.message:String(e)),process.exitCode=1;return}let c=s.port;try{let e=await Gi({config:a,cwd:process.cwd(),port:c,fallbackToKernel:s.fallbackToKernel,host:o}),t=o===void 0||o===`::`||o===`0.0.0.0`?`localhost`:o;console.log(`${n(`[ui]`)} listening on http://${t}:${e.port}`);let r=!1,i=t=>{if(r)return;r=!0,console.log(n(`\n[ui] Shutting down (${t})`)),e.detachSafetyNet();let i=()=>{try{e.release()}finally{process.exit(process.exitCode??0)}};e.drainUpgradeSockets(),Wi(e.httpServers).then(i,i),setTimeout(i,2e3).unref()};process.once(`SIGINT`,()=>i(`SIGINT`)),process.once(`SIGTERM`,()=>i(`SIGTERM`));return}catch(e){if(!(e instanceof r))throw e;let t=i(process.cwd()),a=o??`localhost`,s;try{s=await Ji({requestedPort:c,host:a,lockDir:t})}catch(e){console.error(e instanceof Error?e.message:String(e)),process.exit(1)}if(s.mode===`already-running`){if(console.log(`UI already running at http://${a}:${s.port}`),Xi(process)){await new Promise(e=>{let t=t=>{console.log(n(`\n[ui-keepalive] Shutting down (${t})`)),e()};process.once(`SIGINT`,()=>t(`SIGINT`)),process.once(`SIGTERM`,()=>t(`SIGTERM`))});return}process.exit(0)}console.log(`UI running at http://${a}:${s.upstreamPort}; acting as HTTP proxy on port ${s.handle.port}`);let l=!1,u=e=>{l||(l=!0,console.log(n(`\n[ui-proxy] Shutting down (${e})`)),s.handle.close().finally(()=>process.exit(process.exitCode??0)),setTimeout(()=>process.exit(process.exitCode??0),2e3).unref())};process.once(`SIGINT`,()=>u(`SIGINT`)),process.once(`SIGTERM`,()=>u(`SIGTERM`))}})}function Xi(e){let t=e.stdout.isTTY===!0,n=typeof e.env.PORT==`string`&&e.env.PORT!==``;return!t||n}function Zi(e){if(!M(e))return{};let t=N(e,`utf-8`).trim();if(t===``)return{};try{let n=JSON.parse(t);if(T(n))return n;throw Error(`${e} root must be a JSON object`)}catch(t){throw t instanceof SyntaxError?Error(`${e} contains invalid JSON: ${t.message}`):t}}function Qi(e){if(!M(e))return{};let t=N(e,`utf-8`).trim();if(t===``)return{};try{let n=yi(t);if(T(n))return n;throw Error(`${e} root must be a TOML table`)}catch(t){throw Error(`${e} contains invalid TOML: ${t instanceof Error?t.message:String(t)}`)}}function $i(e,t){_(e,`${JSON.stringify(t,null,2)}\n`)}function ea(e,t){let n=ki(t);_(e,n.endsWith(`
|
|
295
295
|
`)?n:`${n}\n`)}const ta=e=>e!==`project`,na=e=>e!==`user`;async function ra(){let e=await Bn({message:`Where should the MCP server be configured?
|
|
296
296
|
`,required:!1,theme:{icon:{checked:`[x]`,unchecked:`[ ]`}},choices:[{name:`User-level (~/.claude.json, ~/.cursor/mcp.json, …)`,value:`user`,checked:!0},{name:`Project-level (.mcp.json, .cursor/mcp.json, …)`,value:`project`,checked:!0}]});return e.includes(`user`)&&e.includes(`project`)?`both`:e.includes(`user`)?`user`:e.includes(`project`)?`project`:null}async function ia(e){return e.mcp===!1?null:e.scope?e.scope:e.isTTY??process.stdout.isTTY?(e.promptFn??ra)():`both`}async function aa(e){return Yr({message:`How do you want to handle Open Knowledge config files (.ok/, .mcp.json, project skills, launch.json)?`,default:e,choices:[{name:`Share with my team (commit alongside content)`,value:`shared`,description:`OK config gets committed alongside your project content.`},{name:`Local only (keep out of git via .git/info/exclude)`,value:`local-only`,description:"OK config stays on this machine only; teammates do not see it. Safe escape hatch via `ok config-sharing share`."}]})}async function oa(e){if(e.sharing!==void 0)return e.sharing;let t=Nt(e.projectRoot)===`local-only`?`local-only`:`shared`;return e.isTTY??process.stdout.isTTY?(e.promptFn??aa)(t):t}const sa=`0.0.1`,ca=`open-knowledge-ui`,la=[`-y`,`@inkeep/open-knowledge@latest`,`ui`],ua=`# ok-ui-v1`,da=`${ua}
|
|
297
297
|
UIPORT="\${PORT:-${Ui}}"
|
|
@@ -308,8 +308,8 @@ echo "Open Knowledge: install OK Desktop or Node.js 24+, then restart your edito
|
|
|
308
308
|
exit 127`;function fa(e,t={}){let n=R(e,`.claude`,`launch.json`),r=t.mode===`dev`?{name:ca,runtimeExecutable:`/bin/sh`,runtimeArgs:[`-l`,`-c`,`${ua}
|
|
309
309
|
UIPORT="\${PORT:-${Ui}}"
|
|
310
310
|
unset PORT
|
|
311
|
-
exec node "${xt()}" start --ui-port "$UIPORT"`],port:Ui,autoPort:!0}:{name:ca,runtimeExecutable:`/bin/sh`,runtimeArgs:[`-l`,`-c`,da],port:Ui,autoPort:!0};try{if(j(n,e),!M(n))return ie(L(n),{recursive:!0}),P(n,`${JSON.stringify({version:sa,configurations:[r]},null,2)}\n`,`utf-8`),{action:`created`,configPath:n};let t=N(n,`utf-8`).trim(),i=t?JSON.parse(t):{};if(!T(i))return{action:`failed`,configPath:n,error:`launch.json root is not an object`};let a=Array.isArray(i.configurations)?i.configurations:[],o=a.findIndex(e=>T(e)&&e.name===`open-knowledge-ui`);o>=0?a[o]=r:a.push(r);let s={...i,version:i.version??sa,configurations:a};return P(n,`${JSON.stringify(s,null,2)}\n`,`utf-8`),{action:o>=0?`merged`:`created`,configPath:n}}catch(e){return{action:`failed`,configPath:n,error:e instanceof Error?e.message:String(e)}}}function pa(e,t,n){try{return M(e.detectPath?.(t,n)??L(e.configPath(t,n)))}catch{return!1}}function ma(e,t,n,r,i){let a=e.serverName(t),o;try{o=i??e.configPath(t,r)}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:``,serverName:a,error:t instanceof Error?t.message:String(t)}}if(!i&&!n.skipAvailabilityCheck&&!pa(e,t,r))return{editorId:e.id,label:e.label,action:`skipped-missing`,configPath:o,serverName:a};if(i!==void 0)try{j(o,t)}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:t instanceof Error?t.message:String(t),configScope:`project`}}let s;try{s=e.buildEntry(t,n)}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:t instanceof Error?t.message:String(t),...i===void 0?{}:{configScope:`project`}}}try{ie(L(o),{recursive:!0})}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:t instanceof Error?t.message:String(t),...i===void 0?{}:{configScope:`project`}}}let c,l;try{g(`${o}.lock`,()=>{let t=e.format===`toml`?Qi(o):Zi(o),n=t[e.topLevelKey]??{};c=n[a];let r={...t,[e.topLevelKey]:{...n,[a]:s}};e.format===`toml`?ea(o,r):$i(o,r)},{onWarn:(e,t)=>process.stderr.write(`[ok] ${e} ${JSON.stringify(t)}\n`)})}catch(e){l=e instanceof Error?e:Error(String(e))}return l?{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:l.message,...i===void 0?{}:{configScope:`project`}}:{editorId:e.id,label:e.label,action:c===void 0?`written`:`overwritten`,configPath:o,serverName:a,...i===void 0?{}:{configScope:`project`}}}function ha(e,t){let n=e.projectConfigPath?.(t);if(!(!n||!M(n)))return{editorId:e.id,label:e.label,path:n}}async function ga(e){let t=kt(e.editors),n={mode:`published`,skipAvailabilityCheck:!0};return t.map(t=>ma(t,``,n,e.home))}function _a(e,t,n,r){let i=va(e,t,n,r);return i.kind===`present`?i.entry:null}function va(e,t,n,r){let i;try{i=r??e.configPath(t,n)}catch{return{kind:`absent`}}if(!M(i))return{kind:`absent`};let a;try{a=N(i,`utf-8`)}catch(e){return{kind:`corrupt`,error:e instanceof Error?e.message:String(e)}}if(a.trim()===``)return{kind:`corrupt`,error:`file is empty`};let o;try{o=e.format===`toml`?Qi(i):Zi(i)}catch(e){return{kind:`corrupt`,error:e instanceof Error?e.message:String(e)}}let s=o[e.topLevelKey];if(!T(s))return{kind:`no-entry`};let c=s[e.serverName(t)];return T(c)?{kind:`present`,entry:c}:{kind:`no-entry`}}async function ya(e={}){let t=ce(e.cwd??process.cwd()),n=Mi(t,{homeDir:e.home}),r=n.projectRoot,i=!M(R(r,`.ok`));n.ancestorPromoted?console.log(`[ok] Opened existing project at ${r}`):n.gitRootPromoted&&i&&console.log(`[ok] Initialized OK at ${r} — opened parent of ${z(r,t)} because it contains a .git folder`);let a={mode:e.devMcp?`dev`:`published`},o=await C(r),s;try{s=v(r,{contentDir:n.defaultContentDir})}catch(t){let n=G.claude.configPath(r,e.home);return{projectRoot:r,contentCreated:[],contentUpdated:[],contentSkipped:[],editors:[],projectSkills:[],legacyProjectConfigs:[],didGitInit:o.didInit,rootGitignoreCreated:!1,claudeDesktopDetected:!1,mcpAction:`failed`,mcpPath:n,mcpError:`Content scaffolding failed: ${t instanceof Error?t.message:String(t)}`,sharing:{kind:`no-exclude`,reason:`no-git`,localOnlyRequested:!1}}}let c=!1;if(o.didInit)try{c=p(r)===`created`}catch(e){console.warn(`[ok] Skipping .gitignore seed at ${r}: ${e instanceof Error?e.message:String(e)}`)}let l=await ia({scope:e.scope,mcp:e.mcp,isTTY:e.isTTY,promptFn:e.promptFn}),u=e.editors??Ca(r,e.home),d=e.editors??_t.filter(e=>G[e].projectConfigPath!==void 0),f=kt(u),m=kt(d),h=e.mcp===!1||l===null,g=Array.from(new Map([...f,...h?[]:m].map(e=>[e.id,e])).values()),_=f.filter(t=>pa(t,r,e.home)),y=[],b=[],x=new Set;for(let t of g){if(h){let n=``;try{n=t.configPath(r,e.home)}catch{}y.push({editorId:t.id,label:t.label,action:`skipped-flag`,configPath:n,serverName:t.serverName(r)});continue}if(ta(l)&&f.includes(t)&&y.push(ma(t,r,a,e.home)),na(l)&&m.includes(t)&&t.projectConfigPath){let n=t.projectConfigPath(r),i=ma(t,r,a,e.home,n);y.push(i),(i.action===`written`||i.action===`overwritten`)&&x.add(n)}}for(let e of m)e.projectSkillPath&&b.push(ne(e,r));let S=!h&&l!==null&&na(l)?m.filter(e=>!e.projectConfigPath).map(e=>e.label):void 0,T=h?[]:_.map(e=>ha(e,r)).filter(e=>e!==void 0).filter(e=>!x.has(e.path)),E=_.some(e=>e.id===`claude`)&&!h?fa(r,a):void 0,D=await(e.installUserSkill??ee)({home:e.home}),O=w({home:e.home}),k=h?`skipped-flag`:`skipped-missing`,A=y.find(e=>e.editorId===`claude`)??y[0]??{action:k,configPath:G.claude.configPath(r,e.home)},te=await ba({projectRoot:r,desiredMode:await oa({sharing:e.sharing,projectRoot:r,isTTY:e.isTTY,promptFn:e.sharingPromptFn}),explicitFlag:e.sharing});return{projectRoot:r,contentCreated:s.created,contentUpdated:s.updated,contentSkipped:s.skipped,editors:y,projectSkills:b,legacyProjectConfigs:T,launchJson:E,skillInstall:D,didGitInit:o.didInit,rootGitignoreCreated:c,claudeDesktopDetected:O,mcpAction:A.action,mcpPath:A.configPath,mcpError:`error`in A?A.error:void 0,projectScopeUnsupportedLabels:S,sharing:te}}async function ba(e){let{projectRoot:t,desiredMode:n,explicitFlag:r}=e,i=Nt(t);if(i===`no-git`)return{kind:`no-exclude`,reason:`no-git`,localOnlyRequested:r===`local-only`};let a=At(t);if(n===`local-only`){let e=jt(t,a);if(e.kind===`refused-tracked`){let t=e;return{kind:`refused-tracked`,tracked:t.tracked,remediation:t.remediation}}return e.kind===`no-exclude`?{kind:`no-exclude`,reason:e.reason,localOnlyRequested:r===`local-only`}:xa(t,e,`add`)}if(i===`shared`)return{kind:`applied`,mode:`shared`,action:`noop`,appended:[],alreadyPresent:[],removed:[]};let o=Mt(t,a);return o.kind===`no-exclude`?{kind:`no-exclude`,reason:o.reason,localOnlyRequested:!1}:xa(t,o,`remove`)}function xa(e,t,n){let r=Nt(e);return n===`add`?{kind:`applied`,mode:r,action:t.appended.length>0?`added`:`noop`,appended:t.appended,alreadyPresent:t.alreadyPresent,removed:[]}:{kind:`applied`,mode:r,action:`removed`,appended:[],alreadyPresent:[],removed:t.removed}}function Sa(e,t){let n=[],r=e.editors.some(e=>e.action===`written`||e.action===`overwritten`),i=e.editors.some(e=>e.action===`failed`)||e.projectSkills.some(e=>e.action===`failed`),a=e.editors.length>0&&e.editors.every(e=>e.action===`skipped-flag`),o=e.editors.length>0&&e.editors.every(e=>e.action===`skipped-missing`),s=e=>{let n=e.configPath.startsWith(t)?z(t,e.configPath):e.configPath;switch(e.action){case`created`:return` app preview server ${n} configured for Claude Code Desktop embedded browser`;case`merged`:return` app preview server ${n} updated for Claude Code Desktop embedded browser`;case`failed`:return` app preview server ${n} FAILED: ${e.error}`}};e.didGitInit&&n.push(`Initialized git repo at ${t}/.git/ (default branch: main)`),e.rootGitignoreCreated&&n.push(`Seeded .gitignore at ${t}/.gitignore (.DS_Store)`);let c=R(t,`.ok`);if(e.contentCreated.length>0||e.contentUpdated.length>0?(n.push(A(`Content scaffolded at ${c}/`)),e.contentCreated.length>0&&n.push(` Created: ${e.contentCreated.join(`, `)}`),e.contentUpdated.length>0&&n.push(` Updated: ${e.contentUpdated.join(`, `)}`)):n.push(A(`Content already present at ${c}/`)),e.contentSkipped.length>0&&n.push(` Skipped (already exist): ${e.contentSkipped.join(`, `)}`),n.push(``),e.mcpError&&e.editors.length===0)n.push(`Warning: ${e.mcpError}`);else if(e.editors.length===0)if(n.push(A(`MCP server configuration:`)),e.mcpAction===`skipped-flag`)n.push(` MCP config not written — use without --no-mcp to configure editors`);else if(e.projectScopeUnsupportedLabels&&e.projectScopeUnsupportedLabels.length>0){let t=e.projectScopeUnsupportedLabels.join(`, `),r=e.projectScopeUnsupportedLabels.length===1?`does`:`do`;n.push(` ${t} ${r} not support project-level config; skipped`)}else n.push(` No supported editor config directories detected; skipped MCP registration`);else if(a)n.push(`MCP config not written — use without --no-mcp to configure editors`);else if(o)n.push(A(`MCP server configuration:`)),n.push(` No supported editor config directories detected; skipped MCP registration`);else{n.push(A(`MCP server configuration:`));for(let r of e.editors){let i=r.configPath.startsWith(t)?z(t,r.configPath):r.configPath.replace(/^\/Users\/[^/]+/,`~`),a=r.serverName===`open-knowledge`?``:` (${r.serverName})`,o=r.configScope===`project`?` (project)`:``,c=`${r.label}${o}`,l=` `.repeat(Math.max(1,20-c.length)),u=r.editorId===`claude-desktop`&&(r.action===`written`||r.action===`overwritten`)?` — quit and relaunch Claude Desktop to activate`:``;switch(r.action){case`written`:n.push(` ${c}${l}${i} ${D(`registered`)}${a}${u}`);break;case`overwritten`:n.push(` ${c}${l}${i} ${D(`updated`)}${a}${u}`);break;case`skipped-missing`:n.push(` ${c}${l}${i} config root missing; skipped`);break;case`failed`:n.push(` ${c}${l}${i} ${O(`FAILED`)}: ${r.error}`);break;case`skipped-flag`:break}r.editorId===`claude`&&e.launchJson&&n.push(s(e.launchJson))}if(e.projectScopeUnsupportedLabels&&e.projectScopeUnsupportedLabels.length>0){let t=e.projectScopeUnsupportedLabels.join(`, `),r=e.projectScopeUnsupportedLabels.length===1?`does`:`do`;n.push(` ${t} ${r} not support project-level config; skipped`)}}if(e.projectSkills.length>0){n.push(``),n.push(A(`Project-local skills:`));for(let r of e.projectSkills){let e=`${r.label} (project)`,i=` `.repeat(Math.max(1,20-e.length)),a=r.path?z(t,r.path):``;switch(r.action){case`written`:n.push(` ${e}${i}${a} ${D(`installed`)}`);break;case`overwritten`:n.push(` ${e}${i}${a} ${D(`updated`)}`);break;case`skipped-unsupported`:n.push(` ${e}${i}no known project skill surface; skipped`);break;case`failed`:n.push(` ${e}${i}${a} ${O(`FAILED`)}: ${r.error}`);break}}}if(i&&(n.push(``),n.push(`For failed editors, add the MCP server entry or project skill manually. See:`),n.push(` https://github.com/inkeep/open-knowledge#mcp-setup`)),e.legacyProjectConfigs.length>0){n.push(``),n.push(`Project MCP configs found:`);for(let r of e.legacyProjectConfigs)n.push(` ${r.label} ${z(t,r.path)}`);n.push(` These project-local files may override the global config. Remove them if you want fully user-scoped MCP setup in this project.`)}if(e.skillInstall)switch(n.push(``),n.push(A(`User-global skill:`)),e.skillInstall){case`installed`:n.push(` open-knowledge ${D(`installed to detected agent hosts`)} via \`npx skills\``);break;case`skip-current`:n.push(` open-knowledge ${D(`already installed at current version`)}`);break;case`failed`:n.push(` ${k(`open-knowledge install failed — MCP still configured; run manually:`)}`),n.push(` ${k(` npx skills@~1.5.0 add <bundled-path> --agent '*' -g -y --copy`)}`);break}if(e.claudeDesktopDetected&&(n.push(``),n.push(`Claude Desktop App detected. To enable in Claude Chat & Cowork, run: ${A(`ok install-skill`)}`)),e.preview?(n.push(``),n.push(te(e.preview,t))):e.previewWarning&&(n.push(``),n.push(`Content preview unavailable: ${e.previewWarning}`)),n.push(``),n.push(...Ta(e.sharing,t)),r){let t=new Set,r=e.editors.filter(e=>e.action===`written`||e.action===`overwritten`).filter(e=>!t.has(e.editorId)&&t.add(e.editorId)).map(e=>e.label);n.push(``),n.push(`${D(`✓`)} ${A(`Next steps:`)}`),n.push(` 1. Open your editor (${E(r.join(` / `))})`),n.push(` 2. Approve the MCP server when prompted`),n.push(` 3. (Optional) scaffold the starter knowledge-base structure:`),n.push(` - ${E(`ok seed`)} — empty repo, Karpathy 3-layer`),n.push(` - ${E(`mcp__open-knowledge__discover`)} — existing repo, extract conventions`),n.push(` 4. Use the MCP workflow tools as you build the wiki:`),n.push(` - ${E(`mcp__open-knowledge__ingest`)} — capture an external source`),n.push(` - ${E(`mcp__open-knowledge__research`)} — gather sources and write findings`),n.push(` - ${E(`mcp__open-knowledge__consolidate`)} — promote research to canonical articles`)}return n.join(`
|
|
311
|
+
exec node "${xt()}" start --ui-port "$UIPORT"`],port:Ui,autoPort:!0}:{name:ca,runtimeExecutable:`/bin/sh`,runtimeArgs:[`-l`,`-c`,da],port:Ui,autoPort:!0};try{if(j(n,e),!M(n))return ie(L(n),{recursive:!0}),P(n,`${JSON.stringify({version:sa,configurations:[r]},null,2)}\n`,`utf-8`),{action:`created`,configPath:n};let t=N(n,`utf-8`).trim(),i=t?JSON.parse(t):{};if(!T(i))return{action:`failed`,configPath:n,error:`launch.json root is not an object`};let a=Array.isArray(i.configurations)?i.configurations:[],o=a.findIndex(e=>T(e)&&e.name===`open-knowledge-ui`);o>=0?a[o]=r:a.push(r);let s={...i,version:i.version??sa,configurations:a};return P(n,`${JSON.stringify(s,null,2)}\n`,`utf-8`),{action:o>=0?`merged`:`created`,configPath:n}}catch(e){return{action:`failed`,configPath:n,error:e instanceof Error?e.message:String(e)}}}function pa(e,t,n){try{return M(e.detectPath?.(t,n)??L(e.configPath(t,n)))}catch{return!1}}function ma(e,t,n,r,i){let a=e.serverName(t),o;try{o=i??e.configPath(t,r)}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:``,serverName:a,error:t instanceof Error?t.message:String(t)}}if(!i&&!n.skipAvailabilityCheck&&!pa(e,t,r))return{editorId:e.id,label:e.label,action:`skipped-missing`,configPath:o,serverName:a};if(i!==void 0)try{j(o,t)}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:t instanceof Error?t.message:String(t),configScope:`project`}}let s;try{s=e.buildEntry(t,n)}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:t instanceof Error?t.message:String(t),...i===void 0?{}:{configScope:`project`}}}try{ie(L(o),{recursive:!0})}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:t instanceof Error?t.message:String(t),...i===void 0?{}:{configScope:`project`}}}let c,l;try{S(`${o}.lock`,()=>{let t=e.format===`toml`?Qi(o):Zi(o),n=t[e.topLevelKey]??{};c=n[a];let r={...t,[e.topLevelKey]:{...n,[a]:s}};e.format===`toml`?ea(o,r):$i(o,r)},{onWarn:(e,t)=>process.stderr.write(`[ok] ${e} ${JSON.stringify(t)}\n`)})}catch(e){l=e instanceof Error?e:Error(String(e))}return l?{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:l.message,...i===void 0?{}:{configScope:`project`}}:{editorId:e.id,label:e.label,action:c===void 0?`written`:`overwritten`,configPath:o,serverName:a,...i===void 0?{}:{configScope:`project`}}}function ha(e,t){let n=e.projectConfigPath?.(t);if(!(!n||!M(n)))return{editorId:e.id,label:e.label,path:n}}async function ga(e){let t=kt(e.editors),n={mode:`published`,skipAvailabilityCheck:!0};return t.map(t=>ma(t,``,n,e.home))}function _a(e,t,n,r){let i=va(e,t,n,r);return i.kind===`present`?i.entry:null}function va(e,t,n,r){let i;try{i=r??e.configPath(t,n)}catch{return{kind:`absent`}}if(!M(i))return{kind:`absent`};let a;try{a=N(i,`utf-8`)}catch(e){return{kind:`corrupt`,error:e instanceof Error?e.message:String(e)}}if(a.trim()===``)return{kind:`corrupt`,error:`file is empty`};let o;try{o=e.format===`toml`?Qi(i):Zi(i)}catch(e){return{kind:`corrupt`,error:e instanceof Error?e.message:String(e)}}let s=o[e.topLevelKey];if(!T(s))return{kind:`no-entry`};let c=s[e.serverName(t)];return T(c)?{kind:`present`,entry:c}:{kind:`no-entry`}}async function ya(e={}){let t=ce(e.cwd??process.cwd()),n=Mi(t,{homeDir:e.home}),r=n.projectRoot,i=!M(R(r,`.ok`));n.ancestorPromoted?console.log(`[ok] Opened existing project at ${r}`):n.gitRootPromoted&&i&&console.log(`[ok] Initialized OK at ${r} — opened parent of ${z(r,t)} because it contains a .git folder`);let a={mode:e.devMcp?`dev`:`published`},o=await ee(r),s;try{s=y(r,{contentDir:n.defaultContentDir})}catch(t){let n=G.claude.configPath(r,e.home);return{projectRoot:r,contentCreated:[],contentUpdated:[],contentSkipped:[],editors:[],projectSkills:[],legacyProjectConfigs:[],didGitInit:o.didInit,rootGitignoreCreated:!1,claudeDesktopDetected:!1,mcpAction:`failed`,mcpPath:n,mcpError:`Content scaffolding failed: ${t instanceof Error?t.message:String(t)}`,sharing:{kind:`no-exclude`,reason:`no-git`,localOnlyRequested:!1}}}let c=!1;if(o.didInit)try{c=g(r)===`created`}catch(e){console.warn(`[ok] Skipping .gitignore seed at ${r}: ${e instanceof Error?e.message:String(e)}`)}let l=await ia({scope:e.scope,mcp:e.mcp,isTTY:e.isTTY,promptFn:e.promptFn}),u=e.editors??Ca(r,e.home),d=e.editors??_t.filter(e=>G[e].projectConfigPath!==void 0),f=kt(u),m=kt(d),h=e.mcp===!1||l===null,_=Array.from(new Map([...f,...h?[]:m].map(e=>[e.id,e])).values()),v=f.filter(t=>pa(t,r,e.home)),b=[],x=[],S=new Set;for(let t of _){if(h){let n=``;try{n=t.configPath(r,e.home)}catch{}b.push({editorId:t.id,label:t.label,action:`skipped-flag`,configPath:n,serverName:t.serverName(r)});continue}if(ta(l)&&f.includes(t)&&b.push(ma(t,r,a,e.home)),na(l)&&m.includes(t)&&t.projectConfigPath){let n=t.projectConfigPath(r),i=ma(t,r,a,e.home,n);b.push(i),(i.action===`written`||i.action===`overwritten`)&&S.add(n)}}for(let e of m)e.projectSkillPath&&x.push(ne(e,r));let C=!h&&l!==null&&na(l)?m.filter(e=>!e.projectConfigPath).map(e=>e.label):void 0,T=h?[]:v.map(e=>ha(e,r)).filter(e=>e!==void 0).filter(e=>!S.has(e.path)),E=v.some(e=>e.id===`claude`)&&!h?fa(r,a):void 0,D=await(e.installUserSkill??p)({home:e.home}),O=w({home:e.home}),k=h?`skipped-flag`:`skipped-missing`,A=b.find(e=>e.editorId===`claude`)??b[0]??{action:k,configPath:G.claude.configPath(r,e.home)},te=await ba({projectRoot:r,desiredMode:await oa({sharing:e.sharing,projectRoot:r,isTTY:e.isTTY,promptFn:e.sharingPromptFn}),explicitFlag:e.sharing});return{projectRoot:r,contentCreated:s.created,contentUpdated:s.updated,contentSkipped:s.skipped,editors:b,projectSkills:x,legacyProjectConfigs:T,launchJson:E,skillInstall:D,didGitInit:o.didInit,rootGitignoreCreated:c,claudeDesktopDetected:O,mcpAction:A.action,mcpPath:A.configPath,mcpError:`error`in A?A.error:void 0,projectScopeUnsupportedLabels:C,sharing:te}}async function ba(e){let{projectRoot:t,desiredMode:n,explicitFlag:r}=e,i=Nt(t);if(i===`no-git`)return{kind:`no-exclude`,reason:`no-git`,localOnlyRequested:r===`local-only`};let a=At(t);if(n===`local-only`){let e=jt(t,a);if(e.kind===`refused-tracked`){let t=e;return{kind:`refused-tracked`,tracked:t.tracked,remediation:t.remediation}}return e.kind===`no-exclude`?{kind:`no-exclude`,reason:e.reason,localOnlyRequested:r===`local-only`}:xa(t,e,`add`)}if(i===`shared`)return{kind:`applied`,mode:`shared`,action:`noop`,appended:[],alreadyPresent:[],removed:[]};let o=Mt(t,a);return o.kind===`no-exclude`?{kind:`no-exclude`,reason:o.reason,localOnlyRequested:!1}:xa(t,o,`remove`)}function xa(e,t,n){let r=Nt(e);return n===`add`?{kind:`applied`,mode:r,action:t.appended.length>0?`added`:`noop`,appended:t.appended,alreadyPresent:t.alreadyPresent,removed:[]}:{kind:`applied`,mode:r,action:`removed`,appended:[],alreadyPresent:[],removed:t.removed}}function Sa(e,t){let n=[],r=e.editors.some(e=>e.action===`written`||e.action===`overwritten`),i=e.editors.some(e=>e.action===`failed`)||e.projectSkills.some(e=>e.action===`failed`),a=e.editors.length>0&&e.editors.every(e=>e.action===`skipped-flag`),o=e.editors.length>0&&e.editors.every(e=>e.action===`skipped-missing`),s=e=>{let n=e.configPath.startsWith(t)?z(t,e.configPath):e.configPath;switch(e.action){case`created`:return` app preview server ${n} configured for Claude Code Desktop embedded browser`;case`merged`:return` app preview server ${n} updated for Claude Code Desktop embedded browser`;case`failed`:return` app preview server ${n} FAILED: ${e.error}`}};e.didGitInit&&n.push(`Initialized git repo at ${t}/.git/ (default branch: main)`),e.rootGitignoreCreated&&n.push(`Seeded .gitignore at ${t}/.gitignore (.DS_Store)`);let c=R(t,`.ok`);if(e.contentCreated.length>0||e.contentUpdated.length>0?(n.push(A(`Content scaffolded at ${c}/`)),e.contentCreated.length>0&&n.push(` Created: ${e.contentCreated.join(`, `)}`),e.contentUpdated.length>0&&n.push(` Updated: ${e.contentUpdated.join(`, `)}`)):n.push(A(`Content already present at ${c}/`)),e.contentSkipped.length>0&&n.push(` Skipped (already exist): ${e.contentSkipped.join(`, `)}`),n.push(``),e.mcpError&&e.editors.length===0)n.push(`Warning: ${e.mcpError}`);else if(e.editors.length===0)if(n.push(A(`MCP server configuration:`)),e.mcpAction===`skipped-flag`)n.push(` MCP config not written — use without --no-mcp to configure editors`);else if(e.projectScopeUnsupportedLabels&&e.projectScopeUnsupportedLabels.length>0){let t=e.projectScopeUnsupportedLabels.join(`, `),r=e.projectScopeUnsupportedLabels.length===1?`does`:`do`;n.push(` ${t} ${r} not support project-level config; skipped`)}else n.push(` No supported editor config directories detected; skipped MCP registration`);else if(a)n.push(`MCP config not written — use without --no-mcp to configure editors`);else if(o)n.push(A(`MCP server configuration:`)),n.push(` No supported editor config directories detected; skipped MCP registration`);else{n.push(A(`MCP server configuration:`));for(let r of e.editors){let i=r.configPath.startsWith(t)?z(t,r.configPath):r.configPath.replace(/^\/Users\/[^/]+/,`~`),a=r.serverName===`open-knowledge`?``:` (${r.serverName})`,o=r.configScope===`project`?` (project)`:``,c=`${r.label}${o}`,l=` `.repeat(Math.max(1,20-c.length)),u=r.editorId===`claude-desktop`&&(r.action===`written`||r.action===`overwritten`)?` — quit and relaunch Claude Desktop to activate`:``;switch(r.action){case`written`:n.push(` ${c}${l}${i} ${D(`registered`)}${a}${u}`);break;case`overwritten`:n.push(` ${c}${l}${i} ${D(`updated`)}${a}${u}`);break;case`skipped-missing`:n.push(` ${c}${l}${i} config root missing; skipped`);break;case`failed`:n.push(` ${c}${l}${i} ${O(`FAILED`)}: ${r.error}`);break;case`skipped-flag`:break}r.editorId===`claude`&&e.launchJson&&n.push(s(e.launchJson))}if(e.projectScopeUnsupportedLabels&&e.projectScopeUnsupportedLabels.length>0){let t=e.projectScopeUnsupportedLabels.join(`, `),r=e.projectScopeUnsupportedLabels.length===1?`does`:`do`;n.push(` ${t} ${r} not support project-level config; skipped`)}}if(e.projectSkills.length>0){n.push(``),n.push(A(`Project-local skills:`));for(let r of e.projectSkills){let e=`${r.label} (project)`,i=` `.repeat(Math.max(1,20-e.length)),a=r.path?z(t,r.path):``;switch(r.action){case`written`:n.push(` ${e}${i}${a} ${D(`installed`)}`);break;case`overwritten`:n.push(` ${e}${i}${a} ${D(`updated`)}`);break;case`skipped-unsupported`:n.push(` ${e}${i}no known project skill surface; skipped`);break;case`failed`:n.push(` ${e}${i}${a} ${O(`FAILED`)}: ${r.error}`);break}}}if(i&&(n.push(``),n.push(`For failed editors, add the MCP server entry or project skill manually. See:`),n.push(` https://github.com/inkeep/open-knowledge#mcp-setup`)),e.legacyProjectConfigs.length>0){n.push(``),n.push(`Project MCP configs found:`);for(let r of e.legacyProjectConfigs)n.push(` ${r.label} ${z(t,r.path)}`);n.push(` These project-local files may override the global config. Remove them if you want fully user-scoped MCP setup in this project.`)}if(e.skillInstall)switch(n.push(``),n.push(A(`User-global skill:`)),e.skillInstall){case`installed`:n.push(` open-knowledge ${D(`installed to detected agent hosts`)} via \`npx skills\``);break;case`skip-current`:n.push(` open-knowledge ${D(`already installed at current version`)}`);break;case`failed`:n.push(` ${k(`open-knowledge install failed — MCP still configured; run manually:`)}`),n.push(` ${k(` npx skills@~1.5.0 add <bundled-path> --agent '*' -g -y --copy`)}`);break}if(e.claudeDesktopDetected&&(n.push(``),n.push(`Claude Desktop App detected. To enable in Claude Chat & Cowork, run: ${A(`ok install-skill`)}`)),e.preview?(n.push(``),n.push(te(e.preview,t))):e.previewWarning&&(n.push(``),n.push(`Content preview unavailable: ${e.previewWarning}`)),n.push(``),n.push(...Ta(e.sharing,t)),r){let t=new Set,r=e.editors.filter(e=>e.action===`written`||e.action===`overwritten`).filter(e=>!t.has(e.editorId)&&t.add(e.editorId)).map(e=>e.label);n.push(``),n.push(`${D(`✓`)} ${A(`Next steps:`)}`),n.push(` 1. Open your editor (${E(r.join(` / `))})`),n.push(` 2. Approve the MCP server when prompted`),n.push(` 3. (Optional) scaffold the starter knowledge-base structure:`),n.push(` - ${E(`ok seed`)} — empty repo, Karpathy 3-layer`),n.push(` - ${E(`mcp__open-knowledge__discover`)} — existing repo, extract conventions`),n.push(` 4. Use the MCP workflow tools as you build the wiki:`),n.push(` - ${E(`mcp__open-knowledge__ingest`)} — capture an external source`),n.push(` - ${E(`mcp__open-knowledge__research`)} — gather sources and write findings`),n.push(` - ${E(`mcp__open-knowledge__consolidate`)} — promote research to canonical articles`)}return n.join(`
|
|
312
312
|
`)}function Ca(e,t){let n=[];for(let r of _t)pa(G[r],e,t)&&n.push(r);return n}function wa(){return new i(`init`).description(`Scaffold .ok/ in the current directory and register the MCP server for your editor(s)`).option(`--mcp`,`Register the MCP server for selected editors (default: true)`,!0).option(`--no-mcp`,`Scaffold the .ok/ directory but do not touch MCP config`).option(`--dev-mcp`,`Register a local dev MCP entry using node + packages/cli/dist/cli.mjs with debug logging`).addOption(new r(`--scope <scope>`,`Write MCP config at user level, project level, or both`).choices([`user`,`project`,`both`])).addOption(new r(`--shared`,`Commit OK config alongside content (the default for fresh repos)`).conflicts(`localOnly`)).addOption(new r(`--local-only`,`Keep OK config out of git via .git/info/exclude (per-clone, not committed)`).conflicts(`shared`)).action(async e=>{let t=process.cwd(),n=e.shared?`shared`:e.localOnly?`local-only`:void 0,r;try{r=await ya({cwd:t,mcp:e.mcp,devMcp:e.devMcp,scope:e.scope,sharing:n})}catch(e){if(e instanceof x){process.stderr.write(`open-knowledge requires git to initialize a parent repo. Install git or run 'git init' yourself, then re-run.
|
|
313
|
-
`),e.stderr&&process.stderr.write(`${e.stderr.trim()}\n`),process.exitCode=1;return}throw e}try{let{previewContent:e}=await import(`./preview-
|
|
313
|
+
`),e.stderr&&process.stderr.write(`${e.stderr.trim()}\n`),process.exitCode=1;return}throw e}try{let{previewContent:e}=await import(`./preview-1rr7IXHj.mjs`),{loadConfig:t}=await import(`./loader-DlfckqdT.mjs`),{resolveContentDir:n}=await import(`./dist-GL5zcXSU.mjs`),{config:i}=t(r.projectRoot),a=n(i,r.projectRoot);r.preview=e({projectDir:r.projectRoot,contentDir:a})}catch(e){r.previewWarning=e instanceof Error?e.message:String(e)}process.stdout.write(`${Sa(r,r.projectRoot)}\n`),(r.editors.some(e=>e.action===`failed`)||r.mcpAction===`failed`)&&(process.exitCode=1)})}function Ta(e,t){let n=[];switch(e.kind){case`applied`:return n.push(A(`Sharing mode:`)),e.mode===`local-only`?e.action===`added`?n.push(` ${D(`local-only`)} — appended ${e.appended.length} path(s) to ${A(`${t}/.git/info/exclude`)} (per-clone, not committed).`):e.action===`noop`&&e.alreadyPresent.length>0?n.push(` ${D(`local-only`)} — already excluded; nothing to do.`):n.push(` ${D(`local-only`)}`):e.action===`removed`?n.push(` ${D(`shared`)} — removed OK paths from ${A(`${t}/.git/info/exclude`)}; commit the files to share with teammates.`):n.push(` ${D(`shared`)} — OK config will be committed alongside content.`),n;case`refused-tracked`:n.push(k(`Sharing mode: switch to local-only deferred`));for(let t of e.remediation.split(`
|
|
314
314
|
`))n.push(t.length>0?` ${t}`:``);return n.push(` Re-run ${E(`ok config-sharing unshare`)} after resolving to complete the switch.`),n;case`no-exclude`:if(e.localOnlyRequested)n.push(k(`Sharing mode: --local-only requested but no git repo found — option ignored`)),n.push(` Run ${E(`git init`)} (or open this folder via OK Desktop, which can scaffold a repo) and then ${E(`ok config-sharing unshare`)}.`);else if(e.reason===`no-git`)return[];else n.push(k(`Sharing mode unavailable: ${e.reason}.`));return n}}export{St as A,Je as B,At as C,_t as D,Mt as E,mt as F,U as H,ft as I,gt as L,pt as M,ut as N,vt as O,dt as P,st as R,Pt as S,Nt as T,Te as V,ga as _,ba as a,jt as b,Sa as c,_a as d,ia as f,ma as g,fa as h,da as i,bt as j,G as k,Ta as l,ya as m,la as n,va as o,oa as p,ua as r,Ca as s,ca as t,wa as u,Yi as v,Ft as w,It as x,Mi as y,Ye as z};
|
|
315
|
-
//# sourceMappingURL=init-
|
|
315
|
+
//# sourceMappingURL=init-DjkROmXh.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
function e(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}export{e as t};
|
|
2
|
-
//# sourceMappingURL=is-object-
|
|
2
|
+
//# sourceMappingURL=is-object-Cie0xXKD.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{D as e,S as t,T as n,a as r,b as i,c as a,g as o,i as s,m as c,o as l,p as u,x as d}from"./_baseFor-m0TxKeb9.mjs";var f=r(Object.keys,Object),p=Object.prototype.hasOwnProperty;function m(e){if(!l(e))return f(e);var t=[];for(var n in Object(e))p.call(e,n)&&n!=`constructor`&&t.push(n);return t}var h=d(e,`DataView`),g=d(e,`Promise`),_=d(e,`Set`),v=d(e,`WeakMap`),y=`[object Map]`,b=`[object Object]`,x=`[object Promise]`,S=`[object Set]`,C=`[object WeakMap]`,w=`[object DataView]`,T=t(h),E=t(i),D=t(g),O=t(_),k=t(v),A=n;(h&&A(new h(new ArrayBuffer(1)))!=w||i&&A(new i)!=y||g&&A(g.resolve())!=x||_&&A(new _)!=S||v&&A(new v)!=C)&&(A=function(e){var r=n(e),i=r==b?e.constructor:void 0,a=i?t(i):``;if(a)switch(a){case T:return w;case E:return y;case D:return x;case O:return S;case k:return C}return r});var j=A,M=`[object Map]`,N=`[object Set]`,P=Object.prototype.hasOwnProperty;function F(e){if(e==null)return!0;if(s(e)&&(o(e)||typeof e==`string`||typeof e.splice==`function`||u(e)||a(e)||c(e)))return!e.length;var t=j(e);if(t==M||t==N)return!e.size;if(l(e))return!m(e).length;for(var n in e)if(P.call(e,n))return!1;return!0}export{m as i,j as n,_ as r,F as t};
|
|
2
|
+
//# sourceMappingURL=isEmpty-CaTO-fHo.mjs.map
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import{s as e}from"./chunk-C94x7I9S.mjs";import{w as t}from"./src-BkCVz_TJ.mjs";import{B as n,C as r,V as i,W as a,_ as o,a as s,b as c,c as l,s as u,v as d}from"./chunk-ICPOFSXX-C--tVIY5.mjs";import{f}from"./chunk-5PVQY5BW-DUXm3tDu.mjs";import{t as p}from"./chunk-426QAEUC-DUpKwtVu.mjs";import{t as m}from"./rough.cjs-C-63phNL.mjs";var h=e(m(),1),g=(function(){var e=t(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,4],r=[1,14],i=[1,12],a=[1,13],o=[6,7,8],s=[1,20],c=[1,18],l=[1,19],u=[6,7,11],d=[1,6,13,14],f=[1,23],p=[1,24],m=[1,6,7,11,13,14],h={trace:t(function(){},`trace`),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:`error`,6:`SPACELINE`,7:`NL`,8:`ISHIKAWA`,11:`EOF`,13:`SPACELIST`,14:`TEXT`},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:t(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 6:case 7:return r;case 15:r.addNode(a[s-1].length,a[s].trim());break;case 16:r.addNode(0,a[s].trim());break}},`anonymous`),table:[{3:1,4:2,5:3,6:[1,5],8:n},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:n},{6:r,7:[1,10],9:9,12:11,13:i,14:a},e(o,[2,3]),{1:[2,2]},e(o,[2,4]),e(o,[2,5]),{1:[2,6],6:r,12:15,13:i,14:a},{6:r,9:16,12:11,13:i,14:a},{6:s,7:c,10:17,11:l},e(u,[2,18],{14:[1,21]}),e(u,[2,16]),e(u,[2,17]),{6:s,7:c,10:22,11:l},{1:[2,7],6:r,12:15,13:i,14:a},e(d,[2,14],{7:f,11:p}),e(m,[2,8]),e(m,[2,9]),e(m,[2,10]),e(u,[2,15]),e(d,[2,13],{7:f,11:p}),e(m,[2,11]),e(m,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:t(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:t(function(e){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}t(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}t(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
|
|
2
|
+
`+h.showPosition()+`
|
|
3
|
+
Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};h.lexer=(function(){return{EOF:1,parseError:t(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:t(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:t(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:t(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:t(function(){return this._more=!0,this},`more`),reject:t(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
|
+
`+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:t(function(e){this.unput(this.match.slice(e))},`less`),pastInput:t(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:t(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:t(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
|
|
5
|
+
`+t+`^`},`showPosition`),test_match:t(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:t(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;a<i.length;a++)if(n=this._input.match(this.rules[i[a]]),n&&(!t||n[0].length>t[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}else return!1}else if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e===!1?!1:e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
+
`+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:t(function(){return this.next()||this.lex()},`lex`),begin:t(function(e){this.conditionStack.push(e)},`begin`),popState:t(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:t(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:t(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:t(function(e){this.begin(e)},`pushState`),stateStackSize:t(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:t(function(e,t,n,r){switch(n){case 0:return 6;case 1:return 8;case 2:return 8;case 3:return 6;case 4:return 7;case 5:return 13;case 6:return 14;case 7:return 11}},`anonymous`),rules:[/^(?:\s*%%.*)/i,/^(?:ishikawa-beta\b)/i,/^(?:ishikawa\b)/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:[^\n]+)/i,/^(?:$)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}}})();function g(){this.yy={}}return t(g,`Parser`),g.prototype=h,h.Parser=g,new g})();g.parser=g;var _=g,v=class{constructor(){this.stack=[],this.clear=this.clear.bind(this),this.addNode=this.addNode.bind(this),this.getRoot=this.getRoot.bind(this)}static{t(this,`IshikawaDB`)}clear(){this.root=void 0,this.stack=[],this.baseLevel=void 0,s()}getRoot(){return this.root}addNode(e,t){let n=u.sanitizeText(t,c());if(!this.root){this.root={text:n,children:[]},this.stack=[{level:0,node:this.root}],a(n);return}this.baseLevel??=e;let r=e-this.baseLevel+1;for(r<=0&&(r=1);this.stack.length>1&&this.stack[this.stack.length-1].level>=r;)this.stack.pop();let i=this.stack[this.stack.length-1].node,o={text:n,children:[]};i.children.push(o),this.stack.push({level:r,node:o})}getAccTitle(){return d()}setAccTitle(e){i(e)}getAccDescription(){return o()}setAccDescription(e){n(e)}getDiagramTitle(){return r()}setDiagramTitle(e){a(e)}},y=14,b=250,x=30,S=60,C=5,w=82*Math.PI/180,T=Math.cos(w),E=Math.sin(w),D=t((e,t,n)=>{let r=e.node().getBBox(),i=r.width+t*2,a=r.height+t*2;l(e,a,i,n),e.attr(`viewBox`,`${r.x-t} ${r.y-t} ${i} ${a}`)},`applyPaddedViewBox`),O=t((e,t,n,r)=>{let i=r.db.getRoot();if(!i)return;let a=c(),{look:o,handDrawnSeed:s,themeVariables:l}=a,u=f(a.fontSize)[0]??y,d=o===`handDrawn`,m=i.children??[],g=a.ishikawa?.diagramPadding??20,_=a.ishikawa?.useMaxWidth??!1,v=p(t),x=v.append(`g`).attr(`class`,`ishikawa`),S=d?h.default.svg(v.node()):void 0,C=S?{roughSvg:S,seed:s??0,lineColor:l?.lineColor??`#333`,fillColor:l?.mainBkg??`#fff`}:void 0,w=`ishikawa-arrow-${t}`;d||x.append(`defs`).append(`marker`).attr(`id`,w).attr(`viewBox`,`0 0 10 10`).attr(`refX`,0).attr(`refY`,5).attr(`markerWidth`,6).attr(`markerHeight`,6).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 10 0 L 0 5 L 10 10 Z`).attr(`class`,`ishikawa-arrow`);let T=0,E=b,O=d?void 0:z(x,T,E,T,E,`ishikawa-spine`);if(A(x,T,E,i.text,u,C),!m.length){d&&z(x,T,E,T,E,`ishikawa-spine`,C),D(v,g,_);return}T-=20;let j=m.filter((e,t)=>t%2==0),M=m.filter((e,t)=>t%2==1),N=k(j),F=k(M),I=N.total+F.total,L=b,R=b;if(I>0){let e=b*2,t=b*.3;L=Math.max(t,e*(N.total/I)),R=Math.max(t,e*(F.total/I))}let B=u*2;L=Math.max(L,N.max*B),R=Math.max(R,F.max*B),E=Math.max(L,b),O&&O.attr(`y1`,E).attr(`y2`,E),x.select(`.ishikawa-head-group`).attr(`transform`,`translate(0,${E})`);let V=Math.ceil(m.length/2);for(let e=0;e<V;e++){let t=x.append(`g`).attr(`class`,`ishikawa-pair`);for(let[n,r,i]of[[m[e*2],-1,L],[m[e*2+1],1,R]])n&&P(t,n,T,E,r,i,u,C);T=t.selectAll(`text`).nodes().reduce((e,t)=>Math.min(e,t.getBBox().x),1/0)}if(d)z(x,T,E,0,E,`ishikawa-spine`,C);else{O.attr(`x1`,T);let e=`url(#${w})`;x.selectAll(`line.ishikawa-branch, line.ishikawa-sub-branch`).attr(`marker-start`,e)}D(v,g,_)},`draw`),k=t(e=>{let n=t(e=>e.children.reduce((e,t)=>e+1+n(t),0),`countDescendants`);return e.reduce((e,t)=>{let r=n(t);return e.total+=r,e.max=Math.max(e.max,r),e},{total:0,max:0})},`sideStats`),A=t((e,t,n,r,i,a)=>{let o=Math.max(6,Math.floor(110/(i*.6))),s=e.append(`g`).attr(`class`,`ishikawa-head-group`).attr(`transform`,`translate(${t},${n})`),c=L(s,I(r,o),0,0,`ishikawa-head-label`,`start`,i),l=c.node().getBBox(),u=Math.max(60,l.width+6),d=Math.max(40,l.height*2+40),f=`M 0 ${-d/2} L 0 ${d/2} Q ${u*2.4} 0 0 ${-d/2} Z`;if(a){let e=a.roughSvg.path(f,{roughness:1.5,seed:a.seed,fill:a.fillColor,fillStyle:`hachure`,fillWeight:2.5,hachureGap:5,stroke:a.lineColor,strokeWidth:2});s.insert(()=>e,`:first-child`).attr(`class`,`ishikawa-head`)}else s.insert(`path`,`:first-child`).attr(`class`,`ishikawa-head`).attr(`d`,f);c.attr(`transform`,`translate(${(u-l.width)/2-l.x+3},${-l.y-l.height/2})`)},`drawHead`),j=t((e,n)=>{let r=[],i=[],a=t((e,t,o)=>{let s=n===-1?[...e].reverse():e;for(let e of s){let n=r.length,s=e.children??[];r.push({depth:o,text:I(e.text,15),parentIndex:t,childCount:s.length}),o%2==0?(i.push(n),s.length&&a(s,n,o+1)):(s.length&&a(s,n,o+1),i.push(n))}},`walk`);return a(e,-1,2),{entries:r,yOrder:i}},`flattenTree`),M=t((e,t,n,r,i,a,o)=>{let s=e.append(`g`).attr(`class`,`ishikawa-label-group`),c=L(s,t,n,r+11*i,`ishikawa-label cause`,`middle`,a).node().getBBox();if(o){let e=o.roughSvg.rectangle(c.x-20,c.y-2,c.width+40,c.height+4,{roughness:1.5,seed:o.seed,fill:o.fillColor,fillStyle:`hachure`,fillWeight:2.5,hachureGap:5,stroke:o.lineColor,strokeWidth:2});s.insert(()=>e,`:first-child`).attr(`class`,`ishikawa-label-box`)}else s.insert(`rect`,`:first-child`).attr(`class`,`ishikawa-label-box`).attr(`x`,c.x-20).attr(`y`,c.y-2).attr(`width`,c.width+40).attr(`height`,c.height+4)},`drawCauseLabel`),N=t((e,t,n,r,i,a)=>{let o=Math.sqrt(r*r+i*i);if(o===0)return;let s=r/o,c=i/o,l=-c*6,u=s*6,d=t,f=n,p=`M ${d} ${f} L ${d-s*6*2+l} ${f-c*6*2+u} L ${d-s*6*2-l} ${f-c*6*2-u} Z`,m=a.roughSvg.path(p,{roughness:1,seed:a.seed,fill:a.lineColor,fillStyle:`solid`,stroke:a.lineColor,strokeWidth:1});e.append(()=>m)},`drawArrowMarker`),P=t((e,t,n,r,i,a,o,s)=>{let c=t.children??[],l=a*(c.length?1:.2),u=-T*l,d=E*l*i,f=n+u,p=r+d;if(z(e,n,r,f,p,`ishikawa-branch`,s),s&&N(e,n,r,n-f,r-p,s),M(e,t.text,f,p,i,o,s),!c.length)return;let{entries:m,yOrder:h}=j(c,i),g=m.length,_=Array(g);for(let[e,t]of h.entries())_[t]=r+d*((e+1)/(g+1));let v=new Map;v.set(-1,{x0:n,y0:r,x1:f,y1:p,childCount:c.length,childrenDrawn:0});let y=-T,b=E*i,w=i<0?`ishikawa-label up`:`ishikawa-label down`;for(let[t,n]of m.entries()){let r=_[t],i=v.get(n.parentIndex),a=e.append(`g`).attr(`class`,`ishikawa-sub-group`),c=0,l=0,u=0;if(n.depth%2==0){let e=i.y1-i.y0;c=R(i.x0,i.x1,e?(r-i.y0)/e:.5),l=r,u=c-(n.childCount>0?S+n.childCount*C:x),z(a,c,r,u,r,`ishikawa-sub-branch`,s),s&&N(a,c,r,1,0,s),L(a,n.text,u,r,`ishikawa-label align`,`end`,o)}else{let e=i.childrenDrawn++;c=R(i.x0,i.x1,(i.childCount-e)/(i.childCount+1)),l=i.y0,u=c+y*((r-l)/b),z(a,c,l,u,r,`ishikawa-sub-branch`,s),s&&N(a,c,l,c-u,l-r,s),L(a,n.text,u,r,w,`end`,o)}n.childCount>0&&v.set(t,{x0:c,y0:l,x1:u,y1:r,childCount:n.childCount,childrenDrawn:0})}},`drawBranch`),F=t(e=>e.split(/<br\s*\/?>|\n/),`splitLines`),I=t((e,t)=>{if(e.length<=t)return e;let n=[];for(let r of e.split(/\s+/)){let e=n.length-1;e>=0&&n[e].length+1+r.length<=t?n[e]+=` `+r:n.push(r)}return n.join(`
|
|
7
|
+
`)},`wrapText`),L=t((e,t,n,r,i,a,o)=>{let s=F(t),c=o*1.05,l=e.append(`text`).attr(`class`,i).attr(`text-anchor`,a).attr(`x`,n).attr(`y`,r-(s.length-1)*c/2);for(let[e,t]of s.entries())l.append(`tspan`).attr(`x`,n).attr(`dy`,e===0?0:c).text(t);return l},`drawMultilineText`),R=t((e,t,n)=>e+(t-e)*n,`lerp`),z=t((e,t,n,r,i,a,o)=>{if(o){let s=o.roughSvg.line(t,n,r,i,{roughness:1.5,seed:o.seed,stroke:o.lineColor,strokeWidth:2});e.append(()=>s).attr(`class`,a);return}return e.append(`line`).attr(`class`,a).attr(`x1`,t).attr(`y1`,n).attr(`x2`,r).attr(`y2`,i)},`drawLine`),B={parser:_,get db(){return new v},renderer:{draw:O},styles:t(e=>`
|
|
8
|
+
.ishikawa .ishikawa-spine,
|
|
9
|
+
.ishikawa .ishikawa-branch,
|
|
10
|
+
.ishikawa .ishikawa-sub-branch {
|
|
11
|
+
stroke: ${e.lineColor};
|
|
12
|
+
stroke-width: 2;
|
|
13
|
+
fill: none;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.ishikawa .ishikawa-sub-branch {
|
|
17
|
+
stroke-width: 1;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.ishikawa .ishikawa-arrow {
|
|
21
|
+
fill: ${e.lineColor};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.ishikawa .ishikawa-head {
|
|
25
|
+
fill: ${e.mainBkg};
|
|
26
|
+
stroke: ${e.lineColor};
|
|
27
|
+
stroke-width: 2;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.ishikawa .ishikawa-label-box {
|
|
31
|
+
fill: ${e.mainBkg};
|
|
32
|
+
stroke: ${e.lineColor};
|
|
33
|
+
stroke-width: 2;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.ishikawa text {
|
|
37
|
+
font-family: ${e.fontFamily};
|
|
38
|
+
font-size: ${e.fontSize};
|
|
39
|
+
fill: ${e.textColor};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.ishikawa .ishikawa-head-label {
|
|
43
|
+
font-weight: 600;
|
|
44
|
+
text-anchor: middle;
|
|
45
|
+
dominant-baseline: middle;
|
|
46
|
+
font-size: 14px;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.ishikawa .ishikawa-label {
|
|
50
|
+
text-anchor: end;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.ishikawa .ishikawa-label.cause {
|
|
54
|
+
text-anchor: middle;
|
|
55
|
+
dominant-baseline: middle;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.ishikawa .ishikawa-label.align {
|
|
59
|
+
text-anchor: end;
|
|
60
|
+
dominant-baseline: middle;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.ishikawa .ishikawa-label.up {
|
|
64
|
+
dominant-baseline: baseline;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.ishikawa .ishikawa-label.down {
|
|
68
|
+
dominant-baseline: hanging;
|
|
69
|
+
}
|
|
70
|
+
`,`getStyles`)};export{B as diagram};
|
|
71
|
+
//# sourceMappingURL=ishikawaDiagram-UXIWVN3A-j-jlqjJX.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-DXB73IDG-F_tmy-Lz.mjs";import{n as e}from"./chunk-A7ICOL4V-D5TsVU6v.mjs";export{e as join};
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import{p as e,w as t}from"./src-BkCVz_TJ.mjs";import{B as n,C as r,V as i,W as a,_ as o,a as s,b as c,c as l,v as u}from"./chunk-ICPOFSXX-C--tVIY5.mjs";import{t as d}from"./arc-Doj9VrmJ.mjs";import{t as f}from"./chunk-FMBD7UC4-CAloFUY3.mjs";import{a as p,n as m,o as h,s as g}from"./chunk-YZCP3GAM-DRdMIQsB.mjs";var _=(function(){var e=t(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[6,8,10,11,12,14,16,17,18],r=[1,9],i=[1,10],a=[1,11],o=[1,12],s=[1,13],c=[1,14],l={trace:t(function(){},`trace`),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:`error`,4:`journey`,6:`EOF`,8:`SPACE`,10:`NEWLINE`,11:`title`,12:`acc_title`,13:`acc_title_value`,14:`acc_descr`,15:`acc_descr_value`,16:`acc_descr_multiline_value`,17:`section`,18:`taskName`,19:`taskData`},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:t(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 1:return a[s-1];case 2:this.$=[];break;case 3:a[s-1].push(a[s]),this.$=a[s-1];break;case 4:case 5:this.$=a[s];break;case 6:case 7:this.$=[];break;case 8:r.setDiagramTitle(a[s].substr(6)),this.$=a[s].substr(6);break;case 9:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 10:case 11:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 12:r.addSection(a[s].substr(8)),this.$=a[s].substr(8);break;case 13:r.addTask(a[s-1],a[s]),this.$=`task`;break}},`anonymous`),table:[{3:1,4:[1,2]},{1:[3]},e(n,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:r,12:i,14:a,16:o,17:s,18:c},e(n,[2,7],{1:[2,1]}),e(n,[2,3]),{9:15,11:r,12:i,14:a,16:o,17:s,18:c},e(n,[2,5]),e(n,[2,6]),e(n,[2,8]),{13:[1,16]},{15:[1,17]},e(n,[2,11]),e(n,[2,12]),{19:[1,18]},e(n,[2,4]),e(n,[2,9]),e(n,[2,10]),e(n,[2,13])],defaultActions:{},parseError:t(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:t(function(e){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}t(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}t(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
|
|
2
|
+
`+h.showPosition()+`
|
|
3
|
+
Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};l.lexer=(function(){return{EOF:1,parseError:t(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:t(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:t(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:t(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:t(function(){return this._more=!0,this},`more`),reject:t(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
|
+
`+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:t(function(e){this.unput(this.match.slice(e))},`less`),pastInput:t(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:t(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:t(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
|
|
5
|
+
`+t+`^`},`showPosition`),test_match:t(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:t(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;a<i.length;a++)if(n=this._input.match(this.rules[i[a]]),n&&(!t||n[0].length>t[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}else return!1}else if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e===!1?!1:e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
+
`+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:t(function(){return this.next()||this.lex()},`lex`),begin:t(function(e){this.conditionStack.push(e)},`begin`),popState:t(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:t(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:t(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:t(function(e){this.begin(e)},`pushState`),stateStackSize:t(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:t(function(e,t,n,r){switch(n){case 0:break;case 1:break;case 2:return 10;case 3:break;case 4:break;case 5:return 4;case 6:return 11;case 7:return this.begin(`acc_title`),12;case 8:return this.popState(),`acc_title_value`;case 9:return this.begin(`acc_descr`),14;case 10:return this.popState(),`acc_descr_value`;case 11:this.begin(`acc_descr_multiline`);break;case 12:this.popState();break;case 13:return`acc_descr_multiline_value`;case 14:return 17;case 15:return 18;case 16:return 19;case 17:return`:`;case 18:return 6;case 19:return`INVALID`}},`anonymous`),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:journey\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18,19],inclusive:!0}}}})();function u(){this.yy={}}return t(u,`Parser`),u.prototype=l,l.Parser=u,new u})();_.parser=_;var v=_,y=``,b=[],x=[],S=[],C=t(function(){b.length=0,x.length=0,y=``,S.length=0,s()},`clear`),w=t(function(e){y=e,b.push(e)},`addSection`),T=t(function(){return b},`getSections`),E=t(function(){let e=A(),t=0;for(;!e&&t<100;)e=A(),t++;return x.push(...S),x},`getTasks`),D=t(function(){let e=[];return x.forEach(t=>{t.people&&e.push(...t.people)}),[...new Set(e)].sort()},`updateActors`),O=t(function(e,t){let n=t.substr(1).split(`:`),r=0,i=[];n.length===1?(r=Number(n[0]),i=[]):(r=Number(n[0]),i=n[1].split(`,`));let a=i.map(e=>e.trim()),o={section:y,type:y,people:a,task:e,score:r};S.push(o)},`addTask`),k=t(function(e){let t={section:y,type:y,description:e,task:e,classes:[]};x.push(t)},`addTaskOrg`),A=t(function(){let e=t(function(e){return S[e].processed},`compileTask`),n=!0;for(let[t,r]of S.entries())e(t),n&&=r.processed;return n},`compileTasks`),j={getConfig:t(()=>c().journey,`getConfig`),clear:C,setDiagramTitle:a,getDiagramTitle:r,setAccTitle:i,getAccTitle:u,setAccDescription:n,getAccDescription:o,addSection:w,getSections:T,getTasks:E,addTask:O,addTaskOrg:k,getActors:t(function(){return D()},`getActors`)},M=t(e=>`.label {
|
|
7
|
+
font-family: ${e.fontFamily};
|
|
8
|
+
color: ${e.textColor};
|
|
9
|
+
}
|
|
10
|
+
.mouth {
|
|
11
|
+
stroke: #666;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
line {
|
|
15
|
+
stroke: ${e.textColor}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.legend {
|
|
19
|
+
fill: ${e.textColor};
|
|
20
|
+
font-family: ${e.fontFamily};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.label text {
|
|
24
|
+
fill: #333;
|
|
25
|
+
}
|
|
26
|
+
.label {
|
|
27
|
+
color: ${e.textColor}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.face {
|
|
31
|
+
${e.faceColor?`fill: ${e.faceColor}`:`fill: #FFF8DC`};
|
|
32
|
+
stroke: #999;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.node rect,
|
|
36
|
+
.node circle,
|
|
37
|
+
.node ellipse,
|
|
38
|
+
.node polygon,
|
|
39
|
+
.node path {
|
|
40
|
+
fill: ${e.mainBkg};
|
|
41
|
+
stroke: ${e.nodeBorder};
|
|
42
|
+
stroke-width: 1px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.node .label {
|
|
46
|
+
text-align: center;
|
|
47
|
+
}
|
|
48
|
+
.node.clickable {
|
|
49
|
+
cursor: pointer;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.arrowheadPath {
|
|
53
|
+
fill: ${e.arrowheadColor};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.edgePath .path {
|
|
57
|
+
stroke: ${e.lineColor};
|
|
58
|
+
stroke-width: 1.5px;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.flowchart-link {
|
|
62
|
+
stroke: ${e.lineColor};
|
|
63
|
+
fill: none;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.edgeLabel {
|
|
67
|
+
background-color: ${e.edgeLabelBackground};
|
|
68
|
+
rect {
|
|
69
|
+
opacity: 0.5;
|
|
70
|
+
}
|
|
71
|
+
text-align: center;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.cluster rect {
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.cluster text {
|
|
78
|
+
fill: ${e.titleColor};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
div.mermaidTooltip {
|
|
82
|
+
position: absolute;
|
|
83
|
+
text-align: center;
|
|
84
|
+
max-width: 200px;
|
|
85
|
+
padding: 2px;
|
|
86
|
+
font-family: ${e.fontFamily};
|
|
87
|
+
font-size: 12px;
|
|
88
|
+
background: ${e.tertiaryColor};
|
|
89
|
+
border: 1px solid ${e.border2};
|
|
90
|
+
border-radius: 2px;
|
|
91
|
+
pointer-events: none;
|
|
92
|
+
z-index: 100;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.task-type-0, .section-type-0 {
|
|
96
|
+
${e.fillType0?`fill: ${e.fillType0}`:``};
|
|
97
|
+
}
|
|
98
|
+
.task-type-1, .section-type-1 {
|
|
99
|
+
${e.fillType0?`fill: ${e.fillType1}`:``};
|
|
100
|
+
}
|
|
101
|
+
.task-type-2, .section-type-2 {
|
|
102
|
+
${e.fillType0?`fill: ${e.fillType2}`:``};
|
|
103
|
+
}
|
|
104
|
+
.task-type-3, .section-type-3 {
|
|
105
|
+
${e.fillType0?`fill: ${e.fillType3}`:``};
|
|
106
|
+
}
|
|
107
|
+
.task-type-4, .section-type-4 {
|
|
108
|
+
${e.fillType0?`fill: ${e.fillType4}`:``};
|
|
109
|
+
}
|
|
110
|
+
.task-type-5, .section-type-5 {
|
|
111
|
+
${e.fillType0?`fill: ${e.fillType5}`:``};
|
|
112
|
+
}
|
|
113
|
+
.task-type-6, .section-type-6 {
|
|
114
|
+
${e.fillType0?`fill: ${e.fillType6}`:``};
|
|
115
|
+
}
|
|
116
|
+
.task-type-7, .section-type-7 {
|
|
117
|
+
${e.fillType0?`fill: ${e.fillType7}`:``};
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.actor-0 {
|
|
121
|
+
${e.actor0?`fill: ${e.actor0}`:``};
|
|
122
|
+
}
|
|
123
|
+
.actor-1 {
|
|
124
|
+
${e.actor1?`fill: ${e.actor1}`:``};
|
|
125
|
+
}
|
|
126
|
+
.actor-2 {
|
|
127
|
+
${e.actor2?`fill: ${e.actor2}`:``};
|
|
128
|
+
}
|
|
129
|
+
.actor-3 {
|
|
130
|
+
${e.actor3?`fill: ${e.actor3}`:``};
|
|
131
|
+
}
|
|
132
|
+
.actor-4 {
|
|
133
|
+
${e.actor4?`fill: ${e.actor4}`:``};
|
|
134
|
+
}
|
|
135
|
+
.actor-5 {
|
|
136
|
+
${e.actor5?`fill: ${e.actor5}`:``};
|
|
137
|
+
}
|
|
138
|
+
${f()}
|
|
139
|
+
`,`getStyles`),N=t(function(e,t){return p(e,t)},`drawRect`),P=t(function(e,n){let r=e.append(`circle`).attr(`cx`,n.cx).attr(`cy`,n.cy).attr(`class`,`face`).attr(`r`,15).attr(`stroke-width`,2).attr(`overflow`,`visible`),i=e.append(`g`);i.append(`circle`).attr(`cx`,n.cx-15/3).attr(`cy`,n.cy-15/3).attr(`r`,1.5).attr(`stroke-width`,2).attr(`fill`,`#666`).attr(`stroke`,`#666`),i.append(`circle`).attr(`cx`,n.cx+15/3).attr(`cy`,n.cy-15/3).attr(`r`,1.5).attr(`stroke-width`,2).attr(`fill`,`#666`).attr(`stroke`,`#666`);function a(e){let t=d().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(15/2).outerRadius(15/2.2);e.append(`path`).attr(`class`,`mouth`).attr(`d`,t).attr(`transform`,`translate(`+n.cx+`,`+(n.cy+2)+`)`)}t(a,`smile`);function o(e){let t=d().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(15/2).outerRadius(15/2.2);e.append(`path`).attr(`class`,`mouth`).attr(`d`,t).attr(`transform`,`translate(`+n.cx+`,`+(n.cy+7)+`)`)}t(o,`sad`);function s(e){e.append(`line`).attr(`class`,`mouth`).attr(`stroke`,2).attr(`x1`,n.cx-5).attr(`y1`,n.cy+7).attr(`x2`,n.cx+5).attr(`y2`,n.cy+7).attr(`class`,`mouth`).attr(`stroke-width`,`1px`).attr(`stroke`,`#666`)}return t(s,`ambivalent`),n.score>3?a(i):n.score<3?o(i):s(i),r},`drawFace`),F=t(function(e,t){let n=e.append(`circle`);return n.attr(`cx`,t.cx),n.attr(`cy`,t.cy),n.attr(`class`,`actor-`+t.pos),n.attr(`fill`,t.fill),n.attr(`stroke`,t.stroke),n.attr(`r`,t.r),n.class!==void 0&&n.attr(`class`,n.class),t.title!==void 0&&n.append(`title`).text(t.title),n},`drawCircle`),I=t(function(e,t){return h(e,t)},`drawText`),L=t(function(e,n){function r(e,t,n,r,i){return e+`,`+t+` `+(e+n)+`,`+t+` `+(e+n)+`,`+(t+r-i)+` `+(e+n-i*1.2)+`,`+(t+r)+` `+e+`,`+(t+r)}t(r,`genPoints`);let i=e.append(`polygon`);i.attr(`points`,r(n.x,n.y,50,20,7)),i.attr(`class`,`labelBox`),n.y+=n.labelMargin,n.x+=.5*n.labelMargin,I(e,n)},`drawLabel`),R=t(function(e,t,n){let r=e.append(`g`),i=g();i.x=t.x,i.y=t.y,i.fill=t.fill,i.width=n.width*t.taskCount+n.diagramMarginX*(t.taskCount-1),i.height=n.height,i.class=`journey-section section-type-`+t.num,i.rx=3,i.ry=3,N(r,i),H(n)(t.text,r,i.x,i.y,i.width,i.height,{class:`journey-section section-type-`+t.num},n,t.colour)},`drawSection`),z=-1,B=t(function(e,t,n,r){let i=t.x+n.width/2,a=e.append(`g`);z++,a.append(`line`).attr(`id`,r+`-task`+z).attr(`x1`,i).attr(`y1`,t.y).attr(`x2`,i).attr(`y2`,450).attr(`class`,`task-line`).attr(`stroke-width`,`1px`).attr(`stroke-dasharray`,`4 2`).attr(`stroke`,`#666`),P(a,{cx:i,cy:300+(5-t.score)*30,score:t.score});let o=g();o.x=t.x,o.y=t.y,o.fill=t.fill,o.width=n.width,o.height=n.height,o.class=`task task-type-`+t.num,o.rx=3,o.ry=3,N(a,o);let s=t.x+14;t.people.forEach(e=>{let n=t.actors[e].color;F(a,{cx:s,cy:t.y,r:7,fill:n,stroke:`#000`,title:e,pos:t.actors[e].position}),s+=10}),H(n)(t.task,a,o.x,o.y,o.width,o.height,{class:`task`},n,t.colour)},`drawTask`),V=t(function(e,t){m(e,t)},`drawBackgroundRect`),H=(function(){function e(e,t,n,r,a,o,s,c){i(t.append(`text`).attr(`x`,n+a/2).attr(`y`,r+o/2+5).style(`font-color`,c).style(`text-anchor`,`middle`).text(e),s)}t(e,`byText`);function n(e,t,n,r,a,o,s,c,l){let{taskFontSize:u,taskFontFamily:d}=c,f=e.split(/<br\s*\/?>/gi);for(let e=0;e<f.length;e++){let c=e*u-u*(f.length-1)/2,p=t.append(`text`).attr(`x`,n+a/2).attr(`y`,r).attr(`fill`,l).style(`text-anchor`,`middle`).style(`font-size`,u).style(`font-family`,d);p.append(`tspan`).attr(`x`,n+a/2).attr(`dy`,c).text(f[e]),p.attr(`y`,r+o/2).attr(`dominant-baseline`,`central`).attr(`alignment-baseline`,`central`),i(p,s)}}t(n,`byTspan`);function r(e,t,r,a,o,s,c,l){let u=t.append(`switch`),d=u.append(`foreignObject`).attr(`x`,r).attr(`y`,a).attr(`width`,o).attr(`height`,s).attr(`position`,`fixed`).append(`xhtml:div`).style(`display`,`table`).style(`height`,`100%`).style(`width`,`100%`);d.append(`div`).attr(`class`,`label`).style(`display`,`table-cell`).style(`text-align`,`center`).style(`vertical-align`,`middle`).text(e),n(e,u,r,a,o,s,c,l),i(d,c)}t(r,`byFo`);function i(e,t){for(let n in t)n in t&&e.attr(n,t[n])}return t(i,`_setTextAttrs`),function(t){return t.textPlacement===`fo`?r:t.textPlacement===`old`?e:n}})(),U={drawRect:N,drawCircle:F,drawSection:R,drawText:I,drawLabel:L,drawTask:B,drawBackgroundRect:V,initGraphics:t(function(e,t){z=-1,e.append(`defs`).append(`marker`).attr(`id`,t+`-arrowhead`).attr(`refX`,5).attr(`refY`,2).attr(`markerWidth`,6).attr(`markerHeight`,4).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 0,0 V 4 L6,2 Z`)},`initGraphics`)},W=t(function(e){Object.keys(e).forEach(function(t){J[t]=e[t]})},`setConf`),G={},K=0;function q(e){let t=c().journey,n=t.maxLabelWidth;K=0;let r=60;Object.keys(G).forEach(i=>{let a=G[i].color,o={cx:20,cy:r,r:7,fill:a,stroke:`#000`,pos:G[i].position};U.drawCircle(e,o);let s=e.append(`text`).attr(`visibility`,`hidden`).text(i),c=s.node().getBoundingClientRect().width;s.remove();let l=[];if(c<=n)l=[i];else{let t=i.split(` `),r=``;s=e.append(`text`).attr(`visibility`,`hidden`),t.forEach(e=>{let t=r?`${r} ${e}`:e;if(s.text(t),s.node().getBoundingClientRect().width>n){if(r&&l.push(r),r=e,s.text(e),s.node().getBoundingClientRect().width>n){let t=``;for(let r of e)t+=r,s.text(t+`-`),s.node().getBoundingClientRect().width>n&&(l.push(t.slice(0,-1)+`-`),t=r);r=t}}else r=t}),r&&l.push(r),s.remove()}l.forEach((n,i)=>{let a={x:40,y:r+7+i*20,fill:`#666`,text:n,textMargin:t.boxTextMargin??5},o=U.drawText(e,a).node().getBoundingClientRect().width;o>K&&o>t.leftMargin-o&&(K=o)}),r+=Math.max(20,l.length*20)})}t(q,`drawActorLegend`);var J=c().journey,Y=0,ee=t(function(t,n,r,i){let a=c(),o=a.journey.titleColor,s=a.journey.titleFontSize,u=a.journey.titleFontFamily,d=a.securityLevel,f;d===`sandbox`&&(f=e(`#i`+n));let p=e(d===`sandbox`?f.nodes()[0].contentDocument.body:`body`);X.init();let m=p.select(`#`+n);U.initGraphics(m,n);let h=i.db.getTasks(),g=i.db.getDiagramTitle(),_=i.db.getActors();for(let e in G)delete G[e];let v=0;_.forEach(e=>{G[e]={color:J.actorColours[v%J.actorColours.length],position:v},v++}),q(m),Y=J.leftMargin+K,X.insert(0,0,Y,Object.keys(G).length*50),te(m,h,0,n);let y=X.getBounds();g&&m.append(`text`).text(g).attr(`x`,Y).attr(`font-size`,s).attr(`font-weight`,`bold`).attr(`y`,25).attr(`fill`,o).attr(`font-family`,u);let b=y.stopy-y.starty+2*J.diagramMarginY,x=Y+y.stopx+2*J.diagramMarginX;l(m,b,x,J.useMaxWidth),m.append(`line`).attr(`x1`,Y).attr(`y1`,J.height*4).attr(`x2`,x-Y-4).attr(`y2`,J.height*4).attr(`stroke-width`,4).attr(`stroke`,`black`).attr(`marker-end`,`url(#`+n+`-arrowhead)`);let S=g?70:0;m.attr(`viewBox`,`${y.startx} -25 ${x} ${b+S}`),m.attr(`preserveAspectRatio`,`xMinYMin meet`),m.attr(`height`,b+S+25)},`draw`),X={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:t(function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},`init`),updateVal:t(function(e,t,n,r){e[t]===void 0?e[t]=n:e[t]=r(n,e[t])},`updateVal`),updateBounds:t(function(e,n,r,i){let a=c().journey,o=this,s=0;function l(c){return t(function(t){s++;let l=o.sequenceItems.length-s+1;o.updateVal(t,`starty`,n-l*a.boxMargin,Math.min),o.updateVal(t,`stopy`,i+l*a.boxMargin,Math.max),o.updateVal(X.data,`startx`,e-l*a.boxMargin,Math.min),o.updateVal(X.data,`stopx`,r+l*a.boxMargin,Math.max),c!==`activation`&&(o.updateVal(t,`startx`,e-l*a.boxMargin,Math.min),o.updateVal(t,`stopx`,r+l*a.boxMargin,Math.max),o.updateVal(X.data,`starty`,n-l*a.boxMargin,Math.min),o.updateVal(X.data,`stopy`,i+l*a.boxMargin,Math.max))},`updateItemBounds`)}t(l,`updateFn`),this.sequenceItems.forEach(l())},`updateBounds`),insert:t(function(e,t,n,r){let i=Math.min(e,n),a=Math.max(e,n),o=Math.min(t,r),s=Math.max(t,r);this.updateVal(X.data,`startx`,i,Math.min),this.updateVal(X.data,`starty`,o,Math.min),this.updateVal(X.data,`stopx`,a,Math.max),this.updateVal(X.data,`stopy`,s,Math.max),this.updateBounds(i,o,a,s)},`insert`),bumpVerticalPos:t(function(e){this.verticalPos+=e,this.data.stopy=this.verticalPos},`bumpVerticalPos`),getVerticalPos:t(function(){return this.verticalPos},`getVerticalPos`),getBounds:t(function(){return this.data},`getBounds`)},Z=J.sectionFills,Q=J.sectionColours,te=t(function(e,t,n,r){let i=c().journey,a=``,o=n+(i.height*2+i.diagramMarginY),s=0,l=`#CCC`,u=`black`,d=0;for(let[n,c]of t.entries()){if(a!==c.section){l=Z[s%Z.length],d=s%Z.length,u=Q[s%Q.length];let r=0,o=c.section;for(let e=n;e<t.length&&t[e].section==o;e++)r+=1;let f={x:n*i.taskMargin+n*i.width+Y,y:50,text:c.section,fill:l,num:d,colour:u,taskCount:r};U.drawSection(e,f,i),a=c.section,s++}let f=c.people.reduce((e,t)=>(G[t]&&(e[t]=G[t]),e),{});c.x=n*i.taskMargin+n*i.width+Y,c.y=o,c.width=i.diagramMarginX,c.height=i.diagramMarginY,c.colour=u,c.fill=l,c.num=d,c.actors=f,U.drawTask(e,c,i,r),X.insert(c.x,c.y,c.x+c.width+i.taskMargin,450)}},`drawTasks`),$={setConf:W,draw:ee},ne={parser:v,db:j,renderer:$,styles:M,init:t(e=>{$.setConf(e.journey),j.clear()},`init`)};export{ne as diagram};
|
|
140
|
+
//# sourceMappingURL=journeyDiagram-VCZTEJTY-BDX_OcrR.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-YNYSPYQ5-gU4-j5DO.mjs";import"./chunk-DXB73IDG-F_tmy-Lz.mjs";import"./chunk-5QMZ5MUS-BwpNU33k.mjs";import"./chunk-24IMIIXA-DaS5XS55.mjs";import"./chunk-7TSDKFEO-CMVuiOdP.mjs";import"./chunk-BBXLRYSX-XWD4jM9A.mjs";import{t as e}from"./chunk-YCFVLTST-DsF45PbT.mjs";export{e as jqCommand};
|