@inkeep/open-knowledge 0.49.0 → 0.49.1
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/{abnfDiagram-VRR7QNED-DQjgDcgA.mjs → abnfDiagram-VRR7QNED-DWDzSKGM.mjs} +2 -2
- package/dist/{acp-harness-probe-DOXp9Wx4.mjs → acp-harness-probe-C8FhVWZi.mjs} +3 -3
- package/dist/alias-JE7RI5QX-BLuOrjl2.mjs +7 -0
- package/dist/alias-JE7RI5QX-VxEqWoTW.mjs +1 -0
- package/dist/{arc-CO8jsQkL.mjs → arc-DXUbbcxK.mjs} +2 -2
- package/dist/architecture-TIHT7OUA-Bl3hpxt3.mjs +1 -0
- package/dist/{architectureDiagram-ZJ3FMSHR-CkUIG8wd.mjs → architectureDiagram-ZJ3FMSHR-HYEpY7T3.mjs} +2 -2
- package/dist/{array-Cerc_8W3.mjs → array-BbgQa93P.mjs} +1 -1
- package/dist/awk2-BBAGSFUB-ClUuupKf.mjs +21 -0
- package/dist/{awk2-BBAGSFUB-BH8WxyhW.mjs → awk2-BBAGSFUB-Dq-YdAGA.mjs} +1 -1
- package/dist/{banner-CIK2GwPx.mjs → banner-Be20aAVc.mjs} +1 -1
- package/dist/base64-4YMZCVJ5-CtkujsXK.mjs +6 -0
- package/dist/{base64-4YMZCVJ5-CDuRvFBG.mjs → base64-4YMZCVJ5-dXz6vbV-.mjs} +1 -1
- package/dist/{basename-AA2KJYZQ-sv8gJZXS.mjs → basename-AA2KJYZQ-BhoOTAHi.mjs} +1 -1
- package/dist/basename-AA2KJYZQ-CEdH80GO.mjs +6 -0
- package/dist/bash-IJWYRKFO-BDtU-lTC.mjs +6 -0
- package/dist/bash-IJWYRKFO-jaJEvAZe.mjs +1 -0
- package/dist/{blockDiagram-677ZJIJ3-sLhYyPCr.mjs → blockDiagram-677ZJIJ3-yJugV29e.mjs} +2 -2
- package/dist/{c4Diagram-LMCZKHZV-Cg6dfUXU.mjs → c4Diagram-LMCZKHZV-BFQQLctA.mjs} +2 -2
- package/dist/cat-RDUMLXKC-D1H4LA3Z.mjs +6 -0
- package/dist/{cat-RDUMLXKC-BtNo16C3.mjs → cat-RDUMLXKC-DFuXWxVq.mjs} +1 -1
- package/dist/channel-Cjp51EO_.mjs +2 -0
- package/dist/{chmod-SYMGL4JA-B15Xlp42.mjs → chmod-SYMGL4JA-ByMUk130.mjs} +1 -1
- package/dist/chmod-SYMGL4JA-lEGJICyB.mjs +8 -0
- package/dist/{chokidar-CVNrjmRM.mjs → chokidar-dh8zokRd.mjs} +1 -1
- package/dist/chunk-24IMIIXA-RjlBWJtr.mjs +2 -0
- package/dist/{chunk-2Q5K7J3B-2Es1K_NO.mjs → chunk-2Q5K7J3B-Ck8oGqYt.mjs} +2 -2
- package/dist/{chunk-2TRDZQLB-G1LvPXqq.mjs → chunk-2TRDZQLB-AH-I_6yN.mjs} +1 -1
- package/dist/chunk-2TRDZQLB-ZoW1EBbl.mjs +18 -0
- package/dist/{chunk-32BRIVSS-ok2xg0Je.mjs → chunk-32BRIVSS-Dwq69mnI.mjs} +2 -2
- package/dist/{chunk-3BS5SKQH-CFcrGLDG.mjs → chunk-3BS5SKQH-DpdUzS0R.mjs} +3 -3
- package/dist/{chunk-3H6UQG3A-Dx5ykWR0.mjs → chunk-3H6UQG3A-BWCaN15a.mjs} +2 -2
- package/dist/chunk-3THT3N7L-DYkTD3HD.mjs +2 -0
- package/dist/{chunk-3ZUFRYJ4-DzbWfyzV.mjs → chunk-3ZUFRYJ4-H1A1hWy1.mjs} +1 -1
- package/dist/chunk-3ZUFRYJ4-ekaYB_vG.mjs +2 -0
- package/dist/chunk-44UOCSGV-D1FZHMOP.mjs +2 -0
- package/dist/{chunk-4GTNDTRF-COTPYeV6.mjs → chunk-4GTNDTRF-Cx89i2Y1.mjs} +2 -2
- package/dist/{chunk-4HHKTUW3-BkuKGebe.mjs → chunk-4HHKTUW3-Dk2l1S8J.mjs} +1 -1
- package/dist/{chunk-4Q4SM6WR-i8tiQRv3.mjs → chunk-4Q4SM6WR-CGuvvBWe.mjs} +2 -2
- package/dist/{chunk-52WLFC77-BaT5_S-q.mjs → chunk-52WLFC77-Cn-qt8h-.mjs} +2 -2
- package/dist/{chunk-55VFSPNA-Ct9maI6O.mjs → chunk-55VFSPNA-D2U7n2ka.mjs} +2 -2
- package/dist/{chunk-5FCAYU7R-of7BBDNL.mjs → chunk-5FCAYU7R-DszODYLe.mjs} +2 -2
- package/dist/{chunk-5HE753X5-9kILZ5Nr.mjs → chunk-5HE753X5-DDnyF29o.mjs} +2 -2
- package/dist/{chunk-5JV3BV7I-BKVVlFxh.mjs → chunk-5JV3BV7I-BkeVAZnj.mjs} +2 -2
- package/dist/chunk-5QMZ5MUS-C5NTf5Rj.mjs +5 -0
- package/dist/{chunk-5QVNJEHU-CvZ-NmqQ.mjs → chunk-5QVNJEHU-DS9zA_YV.mjs} +2 -2
- package/dist/{chunk-5TONJI2A-CGHpmUrS.mjs → chunk-5TONJI2A-CzUNHQPX.mjs} +2 -2
- package/dist/{chunk-5V6VZH6T-DdeqP2TW.mjs → chunk-5V6VZH6T-DBFenjXz.mjs} +2 -2
- package/dist/{chunk-5VM5RSS4-COK1ErrI.mjs → chunk-5VM5RSS4-C8vNNqW0.mjs} +2 -2
- package/dist/{chunk-62RKD26F-RtrcFE7S.mjs → chunk-62RKD26F-C4qK_fA-.mjs} +2 -2
- package/dist/{chunk-64BAICW3-0h-yIc1e.mjs → chunk-64BAICW3-BupSxcu5.mjs} +2 -2
- package/dist/{chunk-6Z5SFZXK-C5owNg1o.mjs → chunk-6Z5SFZXK-Cz0C4bhB.mjs} +2 -2
- package/dist/{chunk-74CEPOFO--xsxhUFC.mjs → chunk-74CEPOFO-BUVWiXkJ.mjs} +1 -1
- package/dist/chunk-74CEPOFO-BYrCYxKO.mjs +23 -0
- package/dist/{chunk-7BUUIJ7U-_1oXd84C.mjs → chunk-7BUUIJ7U-D7hE25H9.mjs} +2 -2
- package/dist/{chunk-7L36YK2X-VlH7dlrD.mjs → chunk-7L36YK2X-CGwYuotX.mjs} +1 -1
- package/dist/chunk-7L36YK2X-DAp-upAs.mjs +3 -0
- package/dist/{chunk-7TSDKFEO-BjOrsK6M.mjs → chunk-7TSDKFEO-CE_P23TY.mjs} +1 -1
- package/dist/chunk-7TSDKFEO-DBB10vPw.mjs +2 -0
- package/dist/{chunk-A4HU7SVR-oMNSpej4.mjs → chunk-A4HU7SVR-BZJ8xDMo.mjs} +1 -1
- package/dist/{chunk-A4JSPFCI-DtnWqT5O.mjs → chunk-A4JSPFCI-Dej71yGP.mjs} +2 -2
- package/dist/chunk-A5O5YHGN-CczwCZ4d.mjs +2 -0
- package/dist/{chunk-A65PWWJC-LctFeUxK.mjs → chunk-A65PWWJC-C-0S-s_f.mjs} +2 -2
- package/dist/{chunk-A7A2DBEE-DuuhuGG1.mjs → chunk-A7A2DBEE-DCXJ1xmx.mjs} +1 -1
- package/dist/{chunk-A7ICOL4V-CzYDHdxM.mjs → chunk-A7ICOL4V-BQZ9JZ1A.mjs} +2 -2
- package/dist/{chunk-ALLTKNUZ-BnLIZXEI.mjs → chunk-ALLTKNUZ-D2ZOfcEz.mjs} +2 -2
- package/dist/{chunk-APT7OOP2-DESh647P.mjs → chunk-APT7OOP2-D-DaFB7K.mjs} +2 -2
- package/dist/chunk-B74TABJS-BJwhrR8a.mjs +34 -0
- package/dist/{chunk-BIQX33UG-BVtPexox.mjs → chunk-BIQX33UG-Bmho6v3L.mjs} +2 -2
- package/dist/{chunk-C7G6YPKG-DpNJWc2e.mjs → chunk-C7G6YPKG-BAX_SClW.mjs} +2 -2
- package/dist/{chunk-CQNSW5MT-B6mAd0WS.mjs → chunk-CQNSW5MT-FekKjn0i.mjs} +2 -2
- package/dist/chunk-CWQS3NFK-CcBWgb8o.mjs +2 -0
- package/dist/{chunk-CYSBUYHQ-CTWbbsmm.mjs → chunk-CYSBUYHQ-BftsYwRW.mjs} +2 -2
- package/dist/{chunk-D4J545R4-Dy3lcp_X.mjs → chunk-D4J545R4-Br_5qOnE.mjs} +2 -2
- package/dist/{chunk-D6CWQ5DW-Dl4tJcwX.mjs → chunk-D6CWQ5DW-3AWPydfx.mjs} +2 -2
- package/dist/{chunk-D7MEQ3VN-B-Qyxyo5.mjs → chunk-D7MEQ3VN-Df6An2jd.mjs} +2 -2
- package/dist/chunk-DBKNVD4L-B3hX287s.mjs +10 -0
- package/dist/{chunk-DBKNVD4L-Y2Mnp5lC.mjs → chunk-DBKNVD4L-DNQP2COw.mjs} +2 -2
- package/dist/{chunk-DCAAORBQ-BxtVrSMT.mjs → chunk-DCAAORBQ-BDLVpBG2.mjs} +2 -2
- package/dist/chunk-DHbaKqs-.mjs +1 -0
- package/dist/chunk-DXB73IDG-BBwE27jK.mjs +2 -0
- package/dist/{chunk-EEXR5ZDP-BcjEP2wd.mjs → chunk-EEXR5ZDP-CE452hsE.mjs} +1 -1
- package/dist/chunk-EEXR5ZDP-Df-EPnbj.mjs +3 -0
- package/dist/{chunk-EIZGF4BS-DYiqM1Ss.mjs → chunk-EIZGF4BS-86nrMkyt.mjs} +2 -2
- package/dist/chunk-EIZGF4BS-CSFp0aUh.mjs +9 -0
- package/dist/{chunk-EMLP6XTP-AFimKO17.mjs → chunk-EMLP6XTP-C2yfLzVC.mjs} +2 -2
- package/dist/{chunk-EX3LRPZG-BYcqQlY8.mjs → chunk-EX3LRPZG-Chp9b-Lc.mjs} +2 -2
- package/dist/{chunk-F23WWYKW-BuCITNd6.mjs → chunk-F23WWYKW-qKke1WqP.mjs} +2 -2
- package/dist/{chunk-FWX5IMBZ-BFNo8SGu.mjs → chunk-FWX5IMBZ-Cn1xNcn5.mjs} +2 -2
- package/dist/{chunk-GCTKCWKD-jz3yOk3f.mjs → chunk-GCTKCWKD-D0obXRun.mjs} +1 -1
- package/dist/chunk-GFQRA5P5-XqPO4cim.mjs +3 -0
- package/dist/{chunk-GOV5EKKI-IRzA9ik3.mjs → chunk-GOV5EKKI-CDovwI7Z.mjs} +2 -2
- package/dist/{chunk-GXVXFKBA-CGc4vqMu.mjs → chunk-GXVXFKBA-D-BGCybM.mjs} +2 -2
- package/dist/{chunk-HDQ56CKY-Svz-iz8m.mjs → chunk-HDQ56CKY-CI8IkhlS.mjs} +2 -2
- package/dist/chunk-HDQ56CKY-Pa-7c4rC.mjs +16 -0
- package/dist/{chunk-HJQJAYMS-SgZmT_QE.mjs → chunk-HJQJAYMS-BHzb4Ncl.mjs} +1 -1
- package/dist/{chunk-HJWBQKYG-BqFDM0xp.mjs → chunk-HJWBQKYG-B-KESSoV.mjs} +2 -2
- package/dist/{chunk-HKLCLINH-DKx243zB.mjs → chunk-HKLCLINH-Bgw53oZd.mjs} +3 -3
- package/dist/{chunk-HL6NGDO2-B9GCn41X.mjs → chunk-HL6NGDO2-CftrHAlX.mjs} +2 -2
- package/dist/{chunk-HOUHSVGY-Cg_2_CUd.mjs → chunk-HOUHSVGY-C3h3PdhC.mjs} +2 -2
- package/dist/{chunk-HWKDQ44K-CVxg-h0V.mjs → chunk-HWKDQ44K-CGcvROg-.mjs} +2 -2
- package/dist/chunk-HWKDQ44K-D3ZbaPl8.mjs +4 -0
- package/dist/chunk-I57KEIP3-_HYA-njf.mjs +11 -0
- package/dist/{chunk-I57KEIP3-FVl4IVXz.mjs → chunk-I57KEIP3-iiTO2OC-.mjs} +1 -1
- package/dist/{chunk-ICXQ74PX-CewdqzeE.mjs → chunk-ICXQ74PX-DbJy3VdO.mjs} +2 -2
- package/dist/chunk-IPJHKYVM-3ANqAo3C.mjs +2 -0
- package/dist/{chunk-JG7HCLWE-BgiWVzAI.mjs → chunk-JG7HCLWE-lUInQ_44.mjs} +2 -2
- package/dist/{chunk-JVPRLUMK-CH7w4zyh.mjs → chunk-JVPRLUMK-FzUEFQw9.mjs} +2 -2
- package/dist/{chunk-JWPE2WC7-cMhWwV9I.mjs → chunk-JWPE2WC7-iDbhfJR-.mjs} +2 -2
- package/dist/{chunk-K6LIBGJA-DI9ZkJey.mjs → chunk-K6LIBGJA-BXxOXTjI.mjs} +2 -2
- package/dist/{chunk-KEIR6QF5-BhaMJNB5.mjs → chunk-KEIR6QF5-BLwvtFl6.mjs} +1 -1
- package/dist/{chunk-KMEYNNUA-CabTsa7P.mjs → chunk-KMEYNNUA-1KiUKBQV.mjs} +2 -2
- package/dist/chunk-KRBPSX3W-DeaaVEij.mjs +6 -0
- package/dist/{chunk-KRBPSX3W-ciCGjpAL.mjs → chunk-KRBPSX3W-YDdgrCmf.mjs} +2 -2
- package/dist/{chunk-LL3S3NLB-r8mDpVuz.mjs → chunk-LL3S3NLB-D0lLKwVi.mjs} +2 -2
- package/dist/{chunk-LTZRCH7N-Cj1hz7m7.mjs → chunk-LTZRCH7N-DpPs5vSq.mjs} +2 -2
- package/dist/{chunk-LWEGUNWT-C3ON4AHi.mjs → chunk-LWEGUNWT-DOK-XWMd.mjs} +2 -2
- package/dist/{chunk-MDDMCKUK-D3MZs3FF.mjs → chunk-MDDMCKUK-CTA6qEdN.mjs} +2 -2
- package/dist/{chunk-MDLLFABN-DgTeOfIY.mjs → chunk-MDLLFABN-B2tA3LLA.mjs} +2 -2
- package/dist/{chunk-MHTUABJP-BbSobv_U.mjs → chunk-MHTUABJP-CrR3MfDw.mjs} +1 -1
- package/dist/{chunk-MIZPJHVH-CzqfuBdK.mjs → chunk-MIZPJHVH-d3bhRfh4.mjs} +2 -2
- package/dist/{chunk-MLXIYONF-BcM04nM_.mjs → chunk-MLXIYONF-C0S_CKb1.mjs} +1 -1
- package/dist/{chunk-MOJQB5TN-CidbQQ7m.mjs → chunk-MOJQB5TN-CUt4IiNv.mjs} +2 -2
- package/dist/{chunk-MOZMSUNE-DTiZcqZ1.mjs → chunk-MOZMSUNE-DCxwDKn7.mjs} +2 -2
- package/dist/{chunk-MYE6AGBJ-B3ukegXT.mjs → chunk-MYE6AGBJ-CMoRJzYM.mjs} +2 -2
- package/dist/{chunk-NAERJDUW-CoAYVGR3.mjs → chunk-NAERJDUW-Ck-SZ2Ps.mjs} +2 -2
- package/dist/{chunk-NCNPKYJZ-C1KcgrGe.mjs → chunk-NCNPKYJZ-BxqfYu6d.mjs} +2 -2
- package/dist/{chunk-NUYSJFDK-sPbPxu4W.mjs → chunk-NUYSJFDK-DfaBzW-k.mjs} +2 -2
- package/dist/{chunk-OCLXQMOG-BdLZfp3D.mjs → chunk-OCLXQMOG-DC3689MV.mjs} +2 -2
- package/dist/{chunk-OCS6LSEM-7beNWT9m.mjs → chunk-OCS6LSEM-BY3_3dNt.mjs} +2 -2
- package/dist/{chunk-OGEWGWER-B-Vr80Fa.mjs → chunk-OGEWGWER-DgPAesMA.mjs} +2 -2
- package/dist/chunk-OJDRYQWQ-B9KRyRFZ.mjs +2 -0
- package/dist/{chunk-OSBZ3O6U-DwDyo3Ly.mjs → chunk-OSBZ3O6U-BVpvamr7.mjs} +2 -2
- package/dist/{chunk-PBXLG62G-ww-bn-Tp.mjs → chunk-PBXLG62G-C12xrBbG.mjs} +2 -2
- package/dist/{chunk-PP6PSHAB-xKRHmmOd.mjs → chunk-PP6PSHAB-tlM6YKyg.mjs} +1 -1
- package/dist/{chunk-PUDLZKDR-CI0pacGF.mjs → chunk-PUDLZKDR-CIWYIjrF.mjs} +2 -2
- package/dist/{chunk-PXTK5WE2-Dfi2FrE5.mjs → chunk-PXTK5WE2-DNbfUrIy.mjs} +1 -1
- package/dist/chunk-PXTK5WE2-e9kxtsgu.mjs +22 -0
- package/dist/{chunk-PYSFUGCK-BHwvxY2Q.mjs → chunk-PYSFUGCK-DqdcBhD4.mjs} +2 -2
- package/dist/{chunk-Q4XR5HBZ-4H-m7p0G.mjs → chunk-Q4XR5HBZ-jWirJQsj.mjs} +2 -2
- package/dist/{chunk-QBLGF6JB-B_tvtCRO.mjs → chunk-QBLGF6JB-hMrl9lGc.mjs} +2 -2
- package/dist/{chunk-QCDB2VPH-DHsQu4h6.mjs → chunk-QCDB2VPH-Cv7mIZWG.mjs} +2 -2
- package/dist/{chunk-QJ7O6ZN3-CTKdWbns.mjs → chunk-QJ7O6ZN3-BRN048sn.mjs} +2 -2
- package/dist/{chunk-R6QSAL5T-DA60heK6.mjs → chunk-R6QSAL5T-CxzbKF59.mjs} +1 -1
- package/dist/chunk-R6VWJ2ZL-DmUcUF0z.mjs +2 -0
- package/dist/{chunk-R7FJI6CG-BVR1ae7y.mjs → chunk-R7FJI6CG-bmCS8vOS.mjs} +2 -2
- package/dist/{chunk-RPNGRAAP-df7FdhI4.mjs → chunk-RPNGRAAP-BTpXCNpb.mjs} +2 -2
- package/dist/{chunk-RYQCIY6F-C8F82Uai.mjs → chunk-RYQCIY6F-Dt7I2-Oy.mjs} +2 -2
- package/dist/{chunk-SDNKECQQ-BuTL-ot2.mjs → chunk-SDNKECQQ-BNRfy-15.mjs} +2 -2
- package/dist/chunk-SNN4IESC-CZPQ88bY.mjs +2 -0
- package/dist/{chunk-SNN4IESC-DVqEOGsL.mjs → chunk-SNN4IESC-oXVGT9qo.mjs} +1 -1
- package/dist/{chunk-T56QNPHK-COZC2A_r.mjs → chunk-T56QNPHK-lY6QjpkL.mjs} +2 -2
- package/dist/{chunk-TLSUDHID-DAREQN9J.mjs → chunk-TLSUDHID-BP7dARSe.mjs} +2 -2
- package/dist/{chunk-TOMNU26N-C3JZDC96.mjs → chunk-TOMNU26N-BFsBBT9j.mjs} +2 -2
- package/dist/{chunk-TP4BZANS-C2Z-CHHA.mjs → chunk-TP4BZANS-C6KGxaUf.mjs} +2 -2
- package/dist/{chunk-TXBZCHCQ-DOaoE5TV.mjs → chunk-TXBZCHCQ-DxPX5PCF.mjs} +2 -2
- package/dist/{chunk-U6XO7XAA-BpjdcG5R.mjs → chunk-U6XO7XAA-BHty90wb.mjs} +2 -2
- package/dist/{chunk-V5MWI2OL-D8SKWVO_.mjs → chunk-V5MWI2OL-DApVl_z4.mjs} +1 -1
- package/dist/{chunk-V7JOEXUC-CdEIYYNc.mjs → chunk-V7JOEXUC-DNM56rwe.mjs} +2 -2
- package/dist/{chunk-V7TAPXDL-CQbB1mLa.mjs → chunk-V7TAPXDL-CrGsULIH.mjs} +2 -2
- package/dist/chunk-VAUOI2AC-BdotBBDE.mjs +2 -0
- package/dist/{chunk-VJFXDYWH-C7Lg-Yts.mjs → chunk-VJFXDYWH-DXnppZsu.mjs} +2 -2
- package/dist/{chunk-VOBGTVA6-CKl2LR-K.mjs → chunk-VOBGTVA6-_4QbVbSJ.mjs} +2 -2
- package/dist/{chunk-VR4S4FIN-mH-q10Uq.mjs → chunk-VR4S4FIN-RUJ5PgRH.mjs} +2 -2
- package/dist/{chunk-VYOJP4TV-DFxaC5Uc.mjs → chunk-VYOJP4TV-DG_cm0JM.mjs} +2 -2
- package/dist/{chunk-WKFATFPP-R7B51gCW.mjs → chunk-WKFATFPP-DygaP6No.mjs} +2 -2
- package/dist/{chunk-WYO6CB5R-Cg1RXhAT.mjs → chunk-WYO6CB5R-DN1R0VLx.mjs} +2 -2
- package/dist/{chunk-X2AJGDEF-D97qevlv.mjs → chunk-X2AJGDEF-BXjUENXL.mjs} +1 -1
- package/dist/chunk-X2AJGDEF-ivzQBp_p.mjs +2 -0
- package/dist/{chunk-XKQRETAK-BTmmMuta.mjs → chunk-XKQRETAK-CYJSOFLN.mjs} +2 -2
- package/dist/{chunk-XKWWSDBF-BGzAOrO3.mjs → chunk-XKWWSDBF-BTj39eCO.mjs} +2 -2
- package/dist/{chunk-XVDPCNWR-3ajbQWzU.mjs → chunk-XVDPCNWR-BSVT7Ttz.mjs} +2 -2
- package/dist/chunk-XXDRQBXY-D1gFTzjI.mjs +2 -0
- package/dist/{chunk-Y2CYZVJY-C7FmC3Cl.mjs → chunk-Y2CYZVJY-acXC9Sbb.mjs} +1 -1
- package/dist/{chunk-YMMW5UAP-DbBgrudQ.mjs → chunk-YMMW5UAP-CE-EQ2Is.mjs} +2 -2
- package/dist/{chunk-YOTPTUD7-BSOqhRr-.mjs → chunk-YOTPTUD7-63S9b4Z2.mjs} +2 -2
- package/dist/{chunk-YTNYSM6T-CoxqCaLl.mjs → chunk-YTNYSM6T-DFPh_641.mjs} +2 -2
- package/dist/{chunk-YULBWSET-CuKhTv4j.mjs → chunk-YULBWSET-B6FKJjk9.mjs} +2 -2
- package/dist/{chunk-Z6LRHWXI-CujGXDs8.mjs → chunk-Z6LRHWXI-BCgawaNX.mjs} +1 -1
- package/dist/{chunk-Z7JVV2SM-CiJwkxuY.mjs → chunk-Z7JVV2SM-CTUpikzI.mjs} +2 -2
- package/dist/{chunk-ZGVPDNZ5-BE_qYP6z.mjs → chunk-ZGVPDNZ5-CyyHBEs2.mjs} +2 -2
- package/dist/{chunk-ZIRB5QZD-mhYZnDzb.mjs → chunk-ZIRB5QZD-K23GvNu-.mjs} +2 -2
- package/dist/{chunk-ZZO3UDB3-DCkJjNN2.mjs → chunk-ZZO3UDB3-MiEiJy8J.mjs} +2 -2
- package/dist/classDiagram-OUVF2IWQ-0ApI9cDS.mjs +2 -0
- package/dist/classDiagram-v2-EOCWNBFH-DfQYJWNe.mjs +2 -0
- package/dist/clear-5CZ5X4YR-9EZyt4MH.mjs +2 -0
- package/dist/{clear-5CZ5X4YR-BNXs_KRD.mjs → clear-5CZ5X4YR-BICGLF_r.mjs} +1 -1
- package/dist/cli.mjs +22 -22
- package/dist/{column-WLPMMSTS-BrY1gQI1.mjs → column-WLPMMSTS-D0I9TpQ2.mjs} +1 -1
- package/dist/column-WLPMMSTS-Do8HgL6q.mjs +8 -0
- package/dist/comm-5SLSESQG-0igXzBnl.mjs +12 -0
- package/dist/{comm-5SLSESQG-aGB098lH.mjs → comm-5SLSESQG-D2Rs9Jmo.mjs} +1 -1
- package/dist/constants-BkYBCRUx.mjs +2 -0
- package/dist/{cose-bilkent-JH36ORCC-CMfIp4st.mjs → cose-bilkent-JH36ORCC-B1gjUwU3.mjs} +2 -2
- package/dist/cp-XOYR4ABJ-CpnwcT2f.mjs +8 -0
- package/dist/{du-WO2ENHXQ-Cg71FvLi.mjs → cp-XOYR4ABJ-OfwEEWhR.mjs} +1 -1
- package/dist/{curl-47BFPSFW-d1TMPUJw.mjs → curl-47BFPSFW-Ko1BcK_R.mjs} +2 -2
- package/dist/{cut-OPC3VAGB-FXZX1WQM.mjs → cut-OPC3VAGB-BAhJz0Qh.mjs} +1 -1
- package/dist/cut-OPC3VAGB-nJAw1cEp.mjs +6 -0
- package/dist/cynefin-VYW2F7L2-C-aICrN-.mjs +1 -0
- package/dist/{cynefinDiagram-TSTJHNR4-CFbt5v4d.mjs → cynefinDiagram-TSTJHNR4-CoESbhp4.mjs} +2 -2
- package/dist/{cytoscape.esm-Dq6ZD9GH.mjs → cytoscape.esm-D6l9Lhue.mjs} +1 -1
- package/dist/{dagre-CbI1Ylqw.mjs → dagre-BkPA5x_w.mjs} +2 -2
- package/dist/{dagre-VKFMJZFB-BWP36rMX.mjs → dagre-VKFMJZFB-BhCtWAkc.mjs} +2 -2
- package/dist/{head-HT2B6D2J-DSBJixLD.mjs → date-DD7FVA2V-BGJ9-l0O.mjs} +1 -1
- package/dist/date-DD7FVA2V-W_sbdO4n.mjs +5 -0
- package/dist/{defaultLocale-9SlCuWEL.mjs → defaultLocale-DN4qDyCE.mjs} +1 -1
- package/dist/{diagram-FQU43EPY-D2pf7IBH.mjs → diagram-FQU43EPY-BdshpOzp.mjs} +2 -2
- package/dist/{diagram-G47NLZAW-BlOXaBe6.mjs → diagram-G47NLZAW-Lw1fB9_w.mjs} +2 -2
- package/dist/{diagram-NH7WQ7WH-DOwRNWDI.mjs → diagram-NH7WQ7WH-DnzwFaQq.mjs} +2 -2
- package/dist/{diagram-OA4YK3LP-uyGYHUoX.mjs → diagram-OA4YK3LP-BXU-URV1.mjs} +2 -2
- package/dist/{diagram-WEI45ONY-CmW1X9Kx.mjs → diagram-WEI45ONY-CD_Zpcvk.mjs} +2 -2
- package/dist/diff-HJF2MPDN-CQAaA8lM.mjs +1 -0
- package/dist/diff-HJF2MPDN-EjmLU95d.mjs +7 -0
- package/dist/{dirname-LEMTZZFS-RRQ5Ar_Z.mjs → dirname-LEMTZZFS-BG01-R4_.mjs} +1 -1
- package/dist/dirname-LEMTZZFS-Dg3ijqjM.mjs +5 -0
- package/dist/{dist-BmYngy7b.mjs → dist-CMZz8-Ge.mjs} +1 -1
- package/dist/du-WO2ENHXQ-jqWYqk_n.mjs +8 -0
- package/dist/{cp-XOYR4ABJ-D0LUaMQT.mjs → du-WO2ENHXQ-oQRVbsEF.mjs} +1 -1
- package/dist/{ebnfDiagram-CCIWWBDH-BpBYlrRH.mjs → ebnfDiagram-CCIWWBDH-D-647A1u.mjs} +2 -2
- package/dist/echo-O45JWWI2-BPosfKdD.mjs +1 -0
- package/dist/echo-O45JWWI2-gk6mEMAU.mjs +4 -0
- package/dist/env-5EPCWSXR-BU5zTNDV.mjs +9 -0
- package/dist/env-5EPCWSXR-DygzVPiG.mjs +1 -0
- package/dist/{erDiagram-Q63AITRT-ChoKKmxG.mjs → erDiagram-Q63AITRT-DviwoNdm.mjs} +2 -2
- package/dist/eventmodeling-45OFAUF4-CJqJ2hnR.mjs +1 -0
- package/dist/{execAsync-BKp2jujj.mjs → execAsync-BLKHjfg7.mjs} +1 -1
- package/dist/{execAsync-BuUKdKlz.mjs → execAsync-C5ympCkf.mjs} +1 -1
- package/dist/expand-DTNXU4LQ-D2bEx87V.mjs +11 -0
- package/dist/{expand-DTNXU4LQ-BD32VJaK.mjs → expand-DTNXU4LQ-XU44HrWp.mjs} +1 -1
- package/dist/expr-YYCVMXE3-DI2glLwn.mjs +1 -0
- package/dist/expr-YYCVMXE3-wI0boF3e.mjs +5 -0
- package/dist/file-IGDTDPLG-DkYMcmTl.mjs +24 -0
- package/dist/{date-DD7FVA2V-7hk1aW9g.mjs → file-IGDTDPLG-sPfWVy9T.mjs} +1 -1
- package/dist/find-DH2ALKQS-B6bMjuwo.mjs +12 -0
- package/dist/find-DH2ALKQS-CEKaRkgJ.mjs +1 -0
- package/dist/flag-coverage-6JEX67RU-QmoBigPs.mjs +2 -0
- package/dist/flowDiagram-23GEKE2U-Dhi3SNHm.mjs +1 -0
- package/dist/fold-LDSORVYE-Dhx0k6vg.mjs +12 -0
- package/dist/{fold-LDSORVYE-CDU-6eOS.mjs → fold-LDSORVYE-DumfsCQO.mjs} +1 -1
- package/dist/{fs-traced-By5aY-RE.mjs → fs-traced-DVpoNaQJ.mjs} +3 -3
- package/dist/fs-traced-_QGcVmcb.mjs +1 -0
- package/dist/{ganttDiagram-NO4QXBWP-Cv7sGb-R.mjs → ganttDiagram-NO4QXBWP-DnN5cTGV.mjs} +2 -2
- package/dist/{getMachineId-bsd-DtFrm1Uy.mjs → getMachineId-bsd-B_NuwbXS.mjs} +2 -2
- package/dist/{getMachineId-bsd-GFl1-Bje.mjs → getMachineId-bsd-neTWr-l3.mjs} +2 -2
- package/dist/{getMachineId-darwin--IR8MP8d.mjs → getMachineId-darwin-BP4aVKkL.mjs} +2 -2
- package/dist/{getMachineId-darwin-28jQHa_N.mjs → getMachineId-darwin-DKDl-xYO.mjs} +2 -2
- package/dist/{getMachineId-linux-BZgyplQ5.mjs → getMachineId-linux-Bexb2iRT.mjs} +1 -1
- package/dist/{getMachineId-linux-Bzx3S652.mjs → getMachineId-linux-YTb5epZX.mjs} +1 -1
- package/dist/{getMachineId-unsupported-CyTjujlI.mjs → getMachineId-unsupported-Ddv20ynQ.mjs} +1 -1
- package/dist/{getMachineId-unsupported-DuB0leRF.mjs → getMachineId-unsupported-DdwXS_Q3.mjs} +1 -1
- package/dist/{getMachineId-win-BmvAZEMa.mjs → getMachineId-win-BNx0EbPq.mjs} +2 -2
- package/dist/{getMachineId-win-CuOFQQ73.mjs → getMachineId-win-D8cNuBNk.mjs} +2 -2
- package/dist/git-handle-DBSzQutT.mjs +1 -0
- package/dist/{git-handle-BHe1p04S.mjs → git-handle-r3d7s3VF.mjs} +2 -2
- package/dist/gitGraph-TEB2WS4Q-_V7TMkJv.mjs +1 -0
- package/dist/{gitGraphDiagram-IHSO6WYX-DxsFHicP.mjs → gitGraphDiagram-IHSO6WYX-Bs2N855t.mjs} +2 -2
- package/dist/{graphlib-DKEQBDTz.mjs → graphlib-DXQPHTiH.mjs} +1 -1
- package/dist/grep-2HUTXO5U-9G7xEEms.mjs +9 -0
- package/dist/grep-2HUTXO5U-DG5Ulinc.mjs +1 -0
- package/dist/gzip-AQXSGOVS-BcGYw5wM.mjs +32 -0
- package/dist/gzip-AQXSGOVS-D6UYmM0C.mjs +1 -0
- package/dist/head-HT2B6D2J-B5ybc-my.mjs +2 -0
- package/dist/{file-IGDTDPLG-BAlm5q29.mjs → head-HT2B6D2J-CHIR76LI.mjs} +1 -1
- package/dist/help-VVWX7SA5-Bb8T3djf.mjs +16 -0
- package/dist/help-VVWX7SA5-BbK0QLPX.mjs +1 -0
- package/dist/history-J4QRNGRO-5XgHJL_Q.mjs +1 -0
- package/dist/history-J4QRNGRO-DesXbqi2.mjs +3 -0
- package/dist/{hostname-BK6HG2DE-CaZb-T_R.mjs → hostname-BK6HG2DE-Clwz043m.mjs} +1 -1
- package/dist/hostname-BK6HG2DE-DTiGP5th.mjs +3 -0
- package/dist/html-to-markdown-TFCECAGV-BsVwcc4T.mjs +1 -0
- package/dist/html-to-markdown-TFCECAGV-DLUGt6pW.mjs +73 -0
- package/dist/index.d.mts +6867 -242
- package/dist/index.mjs +1521 -1
- package/dist/info-DKCQHKI2-DIsEz1l_.mjs +1 -0
- package/dist/{infoDiagram-FWYZ7A6U-CbPpTq2x.mjs → infoDiagram-FWYZ7A6U-CD5T72Pd.mjs} +2 -2
- package/dist/init-BlCMJ0yB.mjs +1 -0
- package/dist/{init-Buw5jj4Q.mjs → init-D8OKme52.mjs} +1 -1
- package/dist/{init-ZOWQ1Th4.mjs → init-VslWN3Iz.mjs} +54 -59
- package/dist/{ishikawaDiagram-FXEZZL3T-Dd5BEpOv.mjs → ishikawaDiagram-FXEZZL3T-CzHEtbdq.mjs} +2 -2
- package/dist/join-GG2LDHE5-7k4Syl20.mjs +14 -0
- package/dist/{join-GG2LDHE5-kABASDPB.mjs → join-GG2LDHE5-BIH_-8vD.mjs} +1 -1
- package/dist/{journeyDiagram-5HDEW3XC-W6Nbr96_.mjs → journeyDiagram-5HDEW3XC-BywkQV2b.mjs} +2 -2
- package/dist/jq-LYZFFBZB-BZ4XP29I.mjs +14 -0
- package/dist/jq-LYZFFBZB-Dlyx6Y7w.mjs +1 -0
- package/dist/{js-exec-VXN6TZ7U-1yyCDQqM.mjs → js-exec-VXN6TZ7U-BrugyKqi.mjs} +2 -2
- package/dist/js-exec-VXN6TZ7U-Ds5SsewK.mjs +97 -0
- package/dist/{kanban-definition-HUTT4EX6-xcwe5vNg.mjs → kanban-definition-HUTT4EX6-DIgH0tMg.mjs} +2 -2
- package/dist/{launch-json-removal-CcFuFFS1.mjs → launch-json-removal-9-8M5r9e.mjs} +2 -2
- package/dist/lib-B2tLN_O_.mjs +2 -0
- package/dist/{lib-TLTWf9qr.mjs → lib-DuDqLKFD.mjs} +1 -1
- package/dist/{lib-BCIeHFfP.mjs → lib-ozx_WsjS.mjs} +1 -1
- package/dist/libesm-qUf-Au5c.mjs +14 -0
- package/dist/{line-Cq-NoiNn.mjs → line-eTDW_zUy.mjs} +2 -2
- package/dist/{linear-DPbvcrPk.mjs → linear-Cn1royVQ.mjs} +2 -2
- package/dist/{ln-4TRFBYAT-Dhr3hBr6.mjs → ln-4TRFBYAT-B0hi-FAf.mjs} +1 -1
- package/dist/ln-4TRFBYAT-DGrhTL40.mjs +9 -0
- package/dist/loader-Birwg2h1.mjs +1 -0
- package/dist/{loader-ji3pPcXi.mjs → loader-f3tIWlWk.mjs} +2 -2
- package/dist/{logger-BZPV1wv8.mjs → logger-DFxEUjvj.mjs} +2 -2
- package/dist/ls-KSXFZCWH-C_kbnNdU.mjs +1 -0
- package/dist/ls-KSXFZCWH-GOWXktO9.mjs +28 -0
- package/dist/{lzma-Dh_aFpqW.mjs → lzma-CD6C2vYw.mjs} +1 -1
- package/dist/lzma-CG6o9sq-.mjs +2 -0
- package/dist/{map-CFzSl60r.mjs → map-bDB3k8vA.mjs} +2 -2
- package/dist/md-manager-BbSzMHHE.mjs +2 -0
- package/dist/md5sum-INMIK4DX-BlgGpdCD.mjs +2 -0
- package/dist/md5sum-INMIK4DX-DGvi_A-E.mjs +1 -0
- package/dist/{mermaid-parser.core-DejmtVwC.mjs → mermaid-parser.core-uwQfwzUX.mjs} +2 -2
- package/dist/{mermaid.core-CB8v9A8r.mjs → mermaid.core-BgpKViY0.mjs} +3 -3
- package/dist/{mindmap-definition-LN4V7U3C-BiYp6fzL.mjs → mindmap-definition-LN4V7U3C-H3p7uT-G.mjs} +2 -2
- package/dist/mkdir-TDEMSB6C-BVcgITXm.mjs +7 -0
- package/dist/mkdir-TDEMSB6C-CMOt1jIT.mjs +1 -0
- package/dist/mv-Z6MORUFL-CqyCV_Ze.mjs +1 -0
- package/dist/mv-Z6MORUFL-El0zMsEA.mjs +7 -0
- package/dist/{nl-U5YJDM32-CrNZhLtI.mjs → nl-U5YJDM32-BO1kUpkn.mjs} +1 -1
- package/dist/nl-U5YJDM32-Y_hGSMac.mjs +17 -0
- package/dist/od-VJEF2UR5-CueTpZ68.mjs +5 -0
- package/dist/{od-VJEF2UR5-5RFpmlxK.mjs → od-VJEF2UR5-DxUGtlve.mjs} +1 -1
- package/dist/{open-browser-CxnOIVsL.mjs → open-browser-BgReR_t5.mjs} +2 -2
- package/dist/{ordinal-D5S_JXYv.mjs → ordinal-BFK2XMXf.mjs} +2 -2
- package/dist/packet-7NZHBO7P-B64OS2eJ.mjs +1 -0
- package/dist/parse-worker.d.mts +6626 -1
- package/dist/parse-worker.mjs +1 -1
- package/dist/paste-7N6AFSDS-BJHZcYXH.mjs +1 -0
- package/dist/paste-7N6AFSDS-BnqApCW_.mjs +8 -0
- package/dist/{path-D4ahAhVD.mjs → path-CIoCsClp.mjs} +1 -1
- package/dist/{pegDiagram-2B236MQR-DMP1ng8V.mjs → pegDiagram-2B236MQR-PBU61CXk.mjs} +2 -2
- package/dist/pie-RZYD4A2V-B313HDTA.mjs +1 -0
- package/dist/{pieDiagram-ENE6RG2P-CSKXRjGQ.mjs → pieDiagram-ENE6RG2P-ClZWrO6e.mjs} +2 -2
- package/dist/{preview-2rQXoRuM.mjs → preview-CdESX2Ja.mjs} +2 -2
- package/dist/preview-gKyXf1a0.mjs +1 -0
- package/dist/printf-CX64KX2P-841sNxew.mjs +1 -0
- package/dist/printf-CX64KX2P-B_vWcqAL.mjs +15 -0
- package/dist/public/assets/FeedbackForm-C_A-lpjC.js +1 -0
- package/dist/public/assets/{SessionsHost-BobZkNwc.js → SessionsHost-BRUQMi7f.js} +2 -2
- package/dist/public/assets/{TerminalWindowApp-CgWp2eC-.js → TerminalWindowApp-CFxcrkfe.js} +1 -1
- package/dist/public/assets/ThreadView-CAGruMiN.js +10 -0
- package/dist/public/assets/{follow-file-CWSsUd-S.js → follow-file-BymUhAtT.js} +1 -1
- package/dist/public/assets/{index-Dmlpu4P1.js → index-B-snLDY1.js} +7 -7
- package/dist/public/index.html +2 -2
- package/dist/pwd-D4OZ7N27-C41v1g3B.mjs +1 -0
- package/dist/pwd-D4OZ7N27-NYST_A3S.mjs +3 -0
- package/dist/python3-DNGS4G3E-DaBJervu.mjs +12 -0
- package/dist/{python3-DNGS4G3E-BZ5fPY5e.mjs → python3-DNGS4G3E-OzxoFG34.mjs} +2 -2
- package/dist/{quadrantDiagram-ABIIQ3AL-Do93EPf_.mjs → quadrantDiagram-ABIIQ3AL-Z4PbVL1N.mjs} +2 -2
- package/dist/radar-I7S5WNFK-BdiwGd2_.mjs +1 -0
- package/dist/railroad-3IZDKUUU-O4nBw7jb.mjs +1 -0
- package/dist/railroad-abnf-AHOZXSZD-CDaO5Dcu.mjs +1 -0
- package/dist/railroad-ebnf-EBAXGLYW-CS4l_gpR.mjs +1 -0
- package/dist/railroad-peg-LSFZ7HO6-bbLhALeS.mjs +1 -0
- package/dist/{railroadDiagram-RFXS5EU6-BBHONGQu.mjs → railroadDiagram-RFXS5EU6-ZSRYpY_p.mjs} +2 -2
- package/dist/readlink-MI4GCHJF-CQlQ03aa.mjs +1 -0
- package/dist/readlink-MI4GCHJF-Dl1Uxmrf.mjs +6 -0
- package/dist/{repair-launch-json-Cq9ghST3.mjs → repair-launch-json-DwJ_yLw4.mjs} +2 -2
- package/dist/{repair-mcp-configs-DY0FS2-y.mjs → repair-mcp-configs-Q1hO02co.mjs} +2 -2
- package/dist/{repair-skills-CkZZbtNk.mjs → repair-skills-DADI6iaT.mjs} +2 -2
- package/dist/repair-skills-DKwDAoHc.mjs +1 -0
- package/dist/{requirementDiagram-TGXJPOKE-CAGy_wFo.mjs → requirementDiagram-TGXJPOKE-H6OWjjJE.mjs} +2 -2
- package/dist/{rev-XOSYPP45-G2PvMYC2.mjs → rev-XOSYPP45-BYe7prl1.mjs} +1 -1
- package/dist/rev-XOSYPP45-D6eJxPKd.mjs +7 -0
- package/dist/rg-XNF3R3II-CmxxmmUf.mjs +1 -0
- package/dist/rg-XNF3R3II-vKB7djPZ.mjs +33 -0
- package/dist/rm-RTZG23RL-Bl5s9ltJ.mjs +1 -0
- package/dist/rm-RTZG23RL-sCMTtbxP.mjs +8 -0
- package/dist/rmdir-XTQXT7RK-C1ccje2_.mjs +1 -0
- package/dist/rmdir-XTQXT7RK-DZfv6Zfz.mjs +14 -0
- package/dist/{rough.cjs-LxmwwhvT.mjs → rough.cjs-BGkc0Naf.mjs} +1 -1
- package/dist/{sankeyDiagram-HTMAVEWB-B59ayZ_U.mjs → sankeyDiagram-HTMAVEWB-CtBVJJox.mjs} +2 -2
- package/dist/sed-JAPPVBEU-C7wh6RxT.mjs +100 -0
- package/dist/{sed-JAPPVBEU-BUaK4riL.mjs → sed-JAPPVBEU-D9bYEx2I.mjs} +1 -1
- package/dist/seq-RN5ZUASB-CFySG-xk.mjs +1 -0
- package/dist/seq-RN5ZUASB-R5HjEVux.mjs +7 -0
- package/dist/{sequenceDiagram-DBY2YBRQ-BqY5gm2k.mjs → sequenceDiagram-DBY2YBRQ-DDLm4Ak_.mjs} +2 -2
- package/dist/server-lock-U8YDpJpq.mjs +1 -0
- package/dist/{server-lock-BleUv9m0.mjs → server-lock-aXnDVUI8.mjs} +2 -2
- package/dist/sha1sum-VJPNLNU6-DfzpfxJ-.mjs +2 -0
- package/dist/sha1sum-VJPNLNU6-DgLJCjAg.mjs +1 -0
- package/dist/sha256sum-PI32XWXY-DZ42pgY3.mjs +1 -0
- package/dist/sha256sum-PI32XWXY-DrKtnAPK.mjs +2 -0
- package/dist/{sizeCapture-X5ZJPWSS-D7Nqbe-W.mjs → sizeCapture-X5ZJPWSS-Izaz24Pi.mjs} +2 -2
- package/dist/{skill-teardown-CZnemDLF.mjs → skill-teardown-onVYT1VF.mjs} +2 -2
- package/dist/{sleep-VZFPZFWA-DcISab6N.mjs → sleep-VZFPZFWA-5fZFI3Vy.mjs} +1 -1
- package/dist/sleep-VZFPZFWA-CBARUnrz.mjs +10 -0
- package/dist/sort-DCNRDA7U-RFl0HYBr.mjs +1 -0
- package/dist/sort-DCNRDA7U-vT57Mw8o.mjs +16 -0
- package/dist/{split-SITCSYCZ-D4U2N_sH.mjs → split-SITCSYCZ-BdATfTxU.mjs} +1 -1
- package/dist/split-SITCSYCZ-Ci_IfVPT.mjs +17 -0
- package/dist/{sqlite3-TE5AIOTF-DcjYN7WW.mjs → sqlite3-TE5AIOTF-BIRMe0xz.mjs} +1 -1
- package/dist/sqlite3-TE5AIOTF-BhXSdz7U.mjs +37 -0
- package/dist/{src-BuBt_xnY.mjs → src-BPVU4Y0o.mjs} +2 -2
- package/dist/src-BgeIHNkQ.mjs +1 -0
- package/dist/src-DNPRz0-U.mjs +20 -0
- package/dist/{src-9I3GiOoK.mjs → src-Dt5dAyFQ.mjs} +378 -378
- package/dist/{src-9BFQh559.mjs → src-TKCctdpc.mjs} +123 -123
- package/dist/{src-h5dDPK2z.mjs → src-cRpQSbXB.mjs} +1 -1
- package/dist/start-CWIlNpAT.mjs +1 -0
- package/dist/{start-C4KuZHu5.mjs → start-DRG6a2sz.mjs} +3 -3
- package/dist/stat-BT5A227F-CEZPXJ9_.mjs +9 -0
- package/dist/stat-BT5A227F-Dd-OyLQQ.mjs +1 -0
- package/dist/{stateDiagram-2N3HPSRC-BD1FBZi9.mjs → stateDiagram-2N3HPSRC-pAn2bDnn.mjs} +2 -2
- package/dist/stateDiagram-v2-6OUMAXLB-DCmVVpGm.mjs +2 -0
- package/dist/strings-7PLOGTPD-CiVw0Uh4.mjs +14 -0
- package/dist/strings-7PLOGTPD-v3qEuUEm.mjs +1 -0
- package/dist/{swimlanes-5IMT3BWC-D2eO0gTx.mjs → swimlanes-5IMT3BWC-nSsjdSnj.mjs} +2 -2
- package/dist/swimlanesDiagram-G3AALYLV-CdQlHesp.mjs +9 -0
- package/dist/tac-SJGXQ4T2-BL4Xd7y6.mjs +9 -0
- package/dist/{tac-SJGXQ4T2-D-bfDFKg.mjs → tac-SJGXQ4T2-DphHfCAY.mjs} +1 -1
- package/dist/tail-S5ULNTJU-Cfa1pDQZ.mjs +2 -0
- package/dist/tail-S5ULNTJU-D6qRQZwV.mjs +1 -0
- package/dist/tar-MZQD7NO4-HJsWmzu9.mjs +63 -0
- package/dist/{tar-MZQD7NO4-Cx5bpVMY.mjs → tar-MZQD7NO4-oAQoyk28.mjs} +1 -1
- package/dist/tee-O7VXZDCO-D95l5L5Z.mjs +3 -0
- package/dist/tee-O7VXZDCO-odVO6Wjw.mjs +1 -0
- package/dist/time-DEUO3QV2-CviQF55F.mjs +1 -0
- package/dist/time-DEUO3QV2-DwnT4FOS.mjs +14 -0
- package/dist/{timeline-definition-FHXFAJF6-DZHpuaV_.mjs → timeline-definition-FHXFAJF6-CnTXJoEq.mjs} +2 -2
- package/dist/timeout-VRKMCG72-DFU5EkCe.mjs +12 -0
- package/dist/{timeout-VRKMCG72-DaJVXXR3.mjs → timeout-VRKMCG72-jeMAkAMc.mjs} +1 -1
- package/dist/touch-DX2IJOQ4-CRX6GYeb.mjs +7 -0
- package/dist/touch-DX2IJOQ4-CyiMRd7b.mjs +1 -0
- package/dist/tr-2HXZRDSW-ByYmbFae.mjs +21 -0
- package/dist/tr-2HXZRDSW-CCce6lU_.mjs +1 -0
- package/dist/tree-LYXBS7DC-Dq6aWetx.mjs +12 -0
- package/dist/tree-LYXBS7DC-pAC77Hbt.mjs +1 -0
- package/dist/treeView-QDETBFTQ-BCAjffnq.mjs +1 -0
- package/dist/treemap-6X3UGDF4-Dv-54pyt.mjs +1 -0
- package/dist/true-WHJNXCHG-Dzdq7R5f.mjs +1 -0
- package/dist/true-WHJNXCHG-XC4ZnbBw.mjs +2 -0
- package/dist/unexpand-RGTMIGZM-B06mOUPB.mjs +1 -0
- package/dist/unexpand-RGTMIGZM-BL5sZ5_Z.mjs +11 -0
- package/dist/uniq-SUNANL47-BIgIOFSf.mjs +1 -0
- package/dist/uniq-SUNANL47-DBRSkw7j.mjs +5 -0
- package/dist/{vennDiagram-L72KCM5P-CGoW4QcS.mjs → vennDiagram-L72KCM5P-CqTzYRfa.mjs} +2 -2
- package/dist/wardley-OPB4EBWU-DSvo57UC.mjs +1 -0
- package/dist/{wardleyDiagram-EHGQE667-DHS8jBWZ.mjs → wardleyDiagram-EHGQE667-WhxG-nRT.mjs} +2 -2
- package/dist/wc-TQB3VNOX-9RyJlZXB.mjs +1 -0
- package/dist/wc-TQB3VNOX-DqHFY4jy.mjs +6 -0
- package/dist/which-XZHEH76L-CbmRVw8E.mjs +3 -0
- package/dist/which-XZHEH76L-SMFjHhz2.mjs +1 -0
- package/dist/whoami-DGKU3D2X-BDJh39KM.mjs +3 -0
- package/dist/whoami-DGKU3D2X-BIUooLXE.mjs +1 -0
- package/dist/{write-project-skill-WXZSbQlg.mjs → write-project-skill-DOogyZge.mjs} +4 -4
- package/dist/xan-UD7JYIL2-DAuAMQ0H.mjs +1 -0
- package/dist/xan-UD7JYIL2-DQo9f-1a.mjs +140 -0
- package/dist/xan-view-OW2TB7Z3-BhVOL6hm.mjs +1 -0
- package/dist/xan-view-OW2TB7Z3-CwG0zS53.mjs +1 -0
- package/dist/xargs-I6EZUCYF-C_ZtmUCd.mjs +5 -0
- package/dist/xargs-I6EZUCYF-INAdKqnR.mjs +1 -0
- package/dist/{xychartDiagram-FW5EYKEG-CG0DSvm_.mjs → xychartDiagram-FW5EYKEG-DDE7TRrw.mjs} +2 -2
- package/dist/yazl-BlMyAOcT.mjs +2 -0
- package/dist/yq-OAKYHSXH-C1fFFHD4.mjs +1 -0
- package/dist/yq-OAKYHSXH-COzSqY4J.mjs +288 -0
- package/package.json +7 -6
- package/dist/alias-JE7RI5QX-BfILuEvo.mjs +0 -1
- package/dist/architecture-TIHT7OUA-CScIhnar.mjs +0 -1
- package/dist/bash-IJWYRKFO-DKUaUgF9.mjs +0 -1
- package/dist/channel-DRk0OEK0.mjs +0 -2
- package/dist/chunk-VAUOI2AC-Ds6ZNp2p.mjs +0 -2
- package/dist/chunk-XXDRQBXY-BvbdToKZ.mjs +0 -2
- package/dist/classDiagram-OUVF2IWQ-rKP7gcsT.mjs +0 -2
- package/dist/classDiagram-v2-EOCWNBFH-BoWf4tYI.mjs +0 -2
- package/dist/constants-J4-mibQ1.mjs +0 -2
- package/dist/cynefin-VYW2F7L2-DtazLHUs.mjs +0 -1
- package/dist/diff-HJF2MPDN-bcOaHvDo.mjs +0 -1
- package/dist/echo-O45JWWI2-BacOdfFs.mjs +0 -1
- package/dist/env-5EPCWSXR-T8XCKOX_.mjs +0 -1
- package/dist/eventmodeling-45OFAUF4-BIXp-P6z.mjs +0 -1
- package/dist/expr-YYCVMXE3-CgQib9F9.mjs +0 -1
- package/dist/find-DH2ALKQS-z-G7VPmU.mjs +0 -1
- package/dist/flag-coverage-6JEX67RU-Cj_NycUm.mjs +0 -2
- package/dist/flowDiagram-23GEKE2U-B4VrCGdr.mjs +0 -1
- package/dist/fs-traced-CkLhqsEn.mjs +0 -1
- package/dist/git-handle-BDmbIWwd.mjs +0 -1
- package/dist/gitGraph-TEB2WS4Q-BaTdqV7-.mjs +0 -1
- package/dist/grep-2HUTXO5U-CsEE08ya.mjs +0 -1
- package/dist/gzip-AQXSGOVS-CmMf6H0r.mjs +0 -1
- package/dist/help-VVWX7SA5-BncYWg0B.mjs +0 -1
- package/dist/history-J4QRNGRO-CULSDkzp.mjs +0 -1
- package/dist/html-to-markdown-TFCECAGV-CF0t8_d3.mjs +0 -1
- package/dist/index-1MIt1xrM.d.mts +0 -6628
- package/dist/info-DKCQHKI2-BxlpeeVn.mjs +0 -1
- package/dist/init-DDwncQha.mjs +0 -1
- package/dist/jq-LYZFFBZB-CIwp4u6h.mjs +0 -1
- package/dist/loader-BcwbnY_K.mjs +0 -1
- package/dist/ls-KSXFZCWH-BEv3e7-2.mjs +0 -1
- package/dist/md-manager-B4-M0hXs.mjs +0 -2
- package/dist/md5sum-INMIK4DX-CJ1G9gTe.mjs +0 -1
- package/dist/mkdir-TDEMSB6C-BY7IIkok.mjs +0 -1
- package/dist/mv-Z6MORUFL-C4m2WG8E.mjs +0 -1
- package/dist/packet-7NZHBO7P-DJoR1MQJ.mjs +0 -1
- package/dist/paste-7N6AFSDS-DQNANxpk.mjs +0 -1
- package/dist/pie-RZYD4A2V-Ba8iL0H-.mjs +0 -1
- package/dist/preview-MV-qHfzy.mjs +0 -1
- package/dist/printf-CX64KX2P-CKuJk-Cs.mjs +0 -1
- package/dist/public/assets/FeedbackForm-CmdTz11F.js +0 -1
- package/dist/public/assets/ThreadView-VqdgemBS.js +0 -10
- package/dist/pwd-D4OZ7N27-CSTLotxZ.mjs +0 -1
- package/dist/radar-I7S5WNFK-HP72Fmhl.mjs +0 -1
- package/dist/railroad-3IZDKUUU-DC3PWo_6.mjs +0 -1
- package/dist/railroad-abnf-AHOZXSZD-Vgpa9_KI.mjs +0 -1
- package/dist/railroad-ebnf-EBAXGLYW-B4SmMMsT.mjs +0 -1
- package/dist/railroad-peg-LSFZ7HO6-DLlDiUuB.mjs +0 -1
- package/dist/readlink-MI4GCHJF-V9fwXBrg.mjs +0 -1
- package/dist/repair-skills-l9Id0gzv.mjs +0 -1
- package/dist/rg-XNF3R3II-CuFYIwNn.mjs +0 -1
- package/dist/rm-RTZG23RL-BOvMrhon.mjs +0 -1
- package/dist/rmdir-XTQXT7RK-Dk19R-p8.mjs +0 -1
- package/dist/seq-RN5ZUASB-D5aLn_so.mjs +0 -1
- package/dist/server-lock-uucDARDL.mjs +0 -1
- package/dist/sha1sum-VJPNLNU6-DnTKth9v.mjs +0 -1
- package/dist/sha256sum-PI32XWXY-Z-xtGDHc.mjs +0 -1
- package/dist/sort-DCNRDA7U-C1gRzOOY.mjs +0 -1
- package/dist/src-Dl8P6sfz.mjs +0 -20
- package/dist/start-BYY0acPS.mjs +0 -1
- package/dist/stat-BT5A227F-B4qwqNn_.mjs +0 -1
- package/dist/stateDiagram-v2-6OUMAXLB-CqmBRdZY.mjs +0 -2
- package/dist/strings-7PLOGTPD-BJ6vWsQi.mjs +0 -1
- package/dist/swimlanesDiagram-G3AALYLV-BiRCZWbo.mjs +0 -9
- package/dist/tail-S5ULNTJU-CWnyTuXg.mjs +0 -1
- package/dist/tee-O7VXZDCO-B_duU1hV.mjs +0 -1
- package/dist/time-DEUO3QV2-CekCKA2I.mjs +0 -1
- package/dist/touch-DX2IJOQ4-CZteiICw.mjs +0 -1
- package/dist/tr-2HXZRDSW-D4XuTGWg.mjs +0 -1
- package/dist/tree-LYXBS7DC-CUIzQKTG.mjs +0 -1
- package/dist/treeView-QDETBFTQ-C9yOsbGY.mjs +0 -1
- package/dist/treemap-6X3UGDF4-iowse2nY.mjs +0 -1
- package/dist/true-WHJNXCHG-BzxCUQFd.mjs +0 -1
- package/dist/unexpand-RGTMIGZM-x3XCmR3I.mjs +0 -1
- package/dist/uniq-SUNANL47-DpupkNiO.mjs +0 -1
- package/dist/wardley-OPB4EBWU-BL1Dan_S.mjs +0 -1
- package/dist/wc-TQB3VNOX-D8llmcL9.mjs +0 -1
- package/dist/which-XZHEH76L-imZgNd5x.mjs +0 -1
- package/dist/whoami-DGKU3D2X-CzLNG51j.mjs +0 -1
- package/dist/xan-UD7JYIL2-_38Iv1cI.mjs +0 -1
- package/dist/xan-view-OW2TB7Z3-RT-IKMgr.mjs +0 -1
- package/dist/xargs-I6EZUCYF-Bu8VhXV_.mjs +0 -1
- package/dist/yq-OAKYHSXH-BcCBaLJN.mjs +0 -1
- /package/dist/{expansion-VBDYWVZR-CeY6vkty.mjs → expansion-VBDYWVZR-CpX0YZMb.mjs} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./chunk-Y2CYZVJY-
|
|
1
|
+
import{n as e}from"./chunk-Y2CYZVJY-acXC9Sbb.mjs";import{m as t}from"./src-BPVU4Y0o.mjs";import{D as n,H as r,K as i,U as a,a as o,b as s,c,v as l,w as u,x as d,y as f}from"./chunk-WYO6CB5R-DN1R0VLx.mjs";import{i as p}from"./chunk-ICXQ74PX-DbJy3VdO.mjs";import{t as m}from"./chunk-VAUOI2AC-BdotBBDE.mjs";import{t as h}from"./chunk-JWPE2WC7-iDbhfJR-.mjs";import{n as g}from"./mermaid-parser.core-uwQfwzUX.mjs";var _=e((e,t)=>{let n=e<=1?e*100:e;if(n<0||n>100)throw Error(`${t} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${e}`);return n},`toPercent`),v=e((e,t,n)=>({x:_(t,`${n} evolution`),y:_(e,`${n} visibility`)}),`toCoordinates`),y=e(e=>{if(e){if(e===`+<>`)return`bidirectional`;if(e===`+<`)return`backward`;if(e===`+>`)return`forward`}},`getFlowFromPort`),b=e(e=>{if(!e?.startsWith(`+`))return{};let t=/^\+'([^']*)'/.exec(e)?.[1];return e.includes(`<>`)?{flow:`bidirectional`,label:t}:e.includes(`<`)?{flow:`backward`,label:t}:e.includes(`>`)?{flow:`forward`,label:t}:{label:t}},`extractFlowFromArrow`),x=e((e,t)=>{if(h(e,t),e.size&&t.setSize(e.size.width,e.size.height),e.evolution){let n=e.evolution.stages.map(e=>e.secondName?`${e.name.trim()} / ${e.secondName.trim()}`:e.name.trim()),r=e.evolution.stages.filter(e=>e.boundary!==void 0).map(e=>e.boundary);t.updateAxes({stages:n,stageBoundaries:r})}if(e.anchors.forEach(e=>{let n=v(e.visibility,e.evolution,`Anchor "${e.name}"`);t.addNode(e.name,e.name,n.x,n.y,`anchor`)}),e.components.forEach(e=>{let n=v(e.visibility,e.evolution,`Component "${e.name}"`),r=e.label?(e.label.negX?-1:1)*e.label.offsetX:void 0,i=e.label?(e.label.negY?-1:1)*e.label.offsetY:void 0,a=e.decorator?.strategy;t.addNode(e.name,e.name,n.x,n.y,`component`,r,i,e.inertia,a)}),e.notes.forEach(e=>{let n=v(e.visibility,e.evolution,`Note "${e.text}"`);t.addNote(e.text,n.x,n.y)}),e.pipelines.forEach(e=>{let n=t.getNode(e.parent);if(!n||typeof n.y!=`number`)throw Error(`Pipeline "${e.parent}" must reference an existing component with coordinates.`);let r=n.y;t.startPipeline(e.parent),e.components.forEach(n=>{let i=`${e.parent}_${n.name}`,a=n.label?(n.label.negX?-1:1)*n.label.offsetX:void 0,o=n.label?(n.label.negY?-1:1)*n.label.offsetY:void 0,s=_(n.evolution,`Pipeline component "${n.name}" evolution`);t.addNode(i,n.name,s,r,`pipeline-component`,a,o),t.addPipelineComponent(e.parent,i)})}),e.links.forEach(e=>{let n=!!e.arrow&&(e.arrow.includes(`-.->`)||e.arrow.includes(`.-.`)),r=y(e.fromPort)??y(e.toPort),{flow:i,label:a}=b(e.arrow);!r&&i&&(r=i);let o=e.linkLabel,s=a??o;t.addLink(t.resolveNodeId(e.from),t.resolveNodeId(e.to),n,s,r)}),e.evolves.forEach(e=>{let n=t.getNode(e.component);if(n?.y!==void 0){let r=_(e.target,`Evolve target for "${e.component}"`);t.addTrend(e.component,r,n.y)}}),e.annotations.length>0){let n=e.annotations[0],r=v(n.x,n.y,`Annotations box`);t.setAnnotationsBox(r.x,r.y)}e.annotation.forEach(e=>{let n=v(e.x,e.y,`Annotation ${e.number}`);t.addAnnotation(e.number,[{x:n.x,y:n.y}],e.text)}),e.accelerators.forEach(e=>{let n=v(e.x,e.y,`Accelerator "${e.name}"`);t.addAccelerator(e.name,n.x,n.y)}),e.deaccelerators.forEach(e=>{let n=v(e.x,e.y,`Deaccelerator "${e.name}"`);t.addDeaccelerator(e.name,n.x,n.y)})},`populateDb`),S={parser:{yy:void 0},parse:e(async e=>{let n=await g(`wardley`,e);t.debug(n);let r=S.parser?.yy;if(!r||typeof r.addNode!=`function`)throw Error(`parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.`);x(n,r)},`parse`)},C=new class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}static{e(this,`WardleyBuilder`)}addNode(e){let t=this.nodes.get(e.id)??{id:e.id,label:e.label},n={...t,...e,className:e.className??t.className,labelOffsetX:e.labelOffsetX??t.labelOffsetX,labelOffsetY:e.labelOffsetY??t.labelOffsetY};this.nodes.set(e.id,n)}addLink(e){this.links.push(e)}addTrend(e){this.trends.set(e.nodeId,e)}startPipeline(e){this.pipelines.set(e,{nodeId:e,componentIds:[]});let t=this.nodes.get(e);t&&(t.isPipelineParent=!0)}addPipelineComponent(e,t){let n=this.pipelines.get(e);n&&n.componentIds.push(t);let r=this.nodes.get(t);r&&(r.inPipeline=!0)}addAnnotation(e){this.annotations.push(e)}addNote(e){this.notes.push(e)}addAccelerator(e){this.accelerators.push(e)}addDeaccelerator(e){this.deaccelerators.push(e)}setAnnotationsBox(e,t){this.annotationsBox={x:e,y:t}}setAxes(e){this.axes={...this.axes,...e}}setSize(e,t){this.size={width:e,height:t}}getNode(e){return this.nodes.get(e)}resolveNodeId(e){if(this.nodes.has(e))return e;for(let[t,n]of this.nodes)if(n.label===e)return t;return e}build(){let e=[];for(let t of this.nodes.values()){if(typeof t.x!=`number`||typeof t.y!=`number`)throw Error(`Node "${t.label}" is missing coordinates`);e.push(t)}return{nodes:e,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}};function w(){return d()[`wardley-beta`]}e(w,`getConfig`);function T(e,t,n,r,i,a,o,s,c){C.addNode({id:e,label:t,x:n,y:r,className:i,labelOffsetX:a,labelOffsetY:o,inertia:s,sourceStrategy:c})}e(T,`addNode`);function E(e,t,n=!1,r,i){C.addLink({source:e,target:t,dashed:n,label:r,flow:i})}e(E,`addLink`);function D(e,t,n){C.addTrend({nodeId:e,targetX:t,targetY:n})}e(D,`addTrend`);function O(e,t,n){C.addAnnotation({number:e,coordinates:t,text:n})}e(O,`addAnnotation`);function k(e,t,n){C.addNote({text:e,x:t,y:n})}e(k,`addNote`);function A(e,t,n){C.addAccelerator({name:e,x:t,y:n})}e(A,`addAccelerator`);function j(e,t,n){C.addDeaccelerator({name:e,x:t,y:n})}e(j,`addDeaccelerator`);function M(e,t){C.setAnnotationsBox(e,t)}e(M,`setAnnotationsBox`);function N(e,t){C.setSize(e,t)}e(N,`setSize`);function P(e){C.startPipeline(e)}e(P,`startPipeline`);function F(e,t){C.addPipelineComponent(e,t)}e(F,`addPipelineComponent`);function I(e){C.setAxes(e)}e(I,`updateAxes`);function L(e){return C.getNode(e)}e(L,`getNode`);function R(e){return C.resolveNodeId(e)}e(R,`resolveNodeId`);function z(){return C.build()}e(z,`getWardleyData`);function B(){C.clear(),o()}e(B,`clear`);var V={getConfig:w,addNode:T,addLink:E,addTrend:D,addAnnotation:O,addNote:k,addAccelerator:A,addDeaccelerator:j,setAnnotationsBox:M,setSize:N,startPipeline:P,addPipelineComponent:F,updateAxes:I,getNode:L,resolveNodeId:R,getWardleyData:z,clear:B,setAccTitle:a,getAccTitle:f,setDiagramTitle:i,getDiagramTitle:u,getAccDescription:l,setAccDescription:r},H=[`Genesis`,`Custom Built`,`Product`,`Commodity`],U=e(()=>{let{themeVariables:e}=d();return{backgroundColor:e.wardley?.backgroundColor??e.background??`#fff`,axisColor:e.wardley?.axisColor??`#000`,axisTextColor:e.wardley?.axisTextColor??e.primaryTextColor??`#222`,gridColor:e.wardley?.gridColor??`rgba(100, 100, 100, 0.2)`,componentFill:e.wardley?.componentFill??`#fff`,componentStroke:e.wardley?.componentStroke??`#000`,componentLabelColor:e.wardley?.componentLabelColor??e.primaryTextColor??`#222`,linkStroke:e.wardley?.linkStroke??`#000`,evolutionStroke:e.wardley?.evolutionStroke??`#dc3545`,annotationStroke:e.wardley?.annotationStroke??`#000`,annotationTextColor:e.wardley?.annotationTextColor??e.primaryTextColor??`#222`,annotationFill:e.wardley?.annotationFill??e.background??`#fff`}},`getTheme`),W=e(()=>{let e=d()[`wardley-beta`];return{width:e?.width??900,height:e?.height??600,padding:e?.padding??48,nodeRadius:e?.nodeRadius??6,nodeLabelOffset:e?.nodeLabelOffset??8,axisFontSize:e?.axisFontSize??12,labelFontSize:e?.labelFontSize??10,showGrid:e?.showGrid??!1,useMaxWidth:e?.useMaxWidth??!0}},`getConfigValues`),G={parser:S,db:V,renderer:{draw:e((n,r,i,a)=>{t.debug(`Rendering Wardley map
|
|
2
2
|
`+n);let o=W(),s=U(),l=o.nodeRadius*1.6,u=a.db,d=u.getWardleyData(),f=u.getDiagramTitle(),p=d.size?.width??o.width,h=d.size?.height??o.height,g=m(r);g.selectAll(`*`).remove(),c(g,h,p,o.useMaxWidth),g.attr(`viewBox`,`0 0 ${p} ${h}`);let _=g.append(`g`).attr(`class`,`wardley-map`),v=g.append(`defs`);v.append(`marker`).attr(`id`,`arrow-${r}`).attr(`viewBox`,`0 0 10 10`).attr(`refX`,9).attr(`refY`,5).attr(`markerWidth`,6).attr(`markerHeight`,6).attr(`orient`,`auto-start-reverse`).append(`path`).attr(`d`,`M 0 0 L 10 5 L 0 10 z`).attr(`fill`,s.evolutionStroke).attr(`stroke`,`none`),v.append(`marker`).attr(`id`,`link-arrow-end-${r}`).attr(`viewBox`,`0 0 10 10`).attr(`refX`,9).attr(`refY`,5).attr(`markerWidth`,5).attr(`markerHeight`,5).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 0 0 L 10 5 L 0 10 z`).attr(`fill`,s.linkStroke).attr(`stroke`,`none`),v.append(`marker`).attr(`id`,`link-arrow-start-${r}`).attr(`viewBox`,`0 0 10 10`).attr(`refX`,1).attr(`refY`,5).attr(`markerWidth`,5).attr(`markerHeight`,5).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 10 0 L 0 5 L 10 10 z`).attr(`fill`,s.linkStroke).attr(`stroke`,`none`),_.append(`rect`).attr(`class`,`wardley-background`).attr(`width`,p).attr(`height`,h).attr(`fill`,s.backgroundColor);let y=p-o.padding*2,b=h-o.padding*2;f&&_.append(`text`).attr(`class`,`wardley-title`).attr(`x`,p/2).attr(`y`,o.padding/2).attr(`fill`,s.axisTextColor).attr(`font-size`,o.axisFontSize*1.05).attr(`font-weight`,`bold`).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`middle`).text(f);let x=e(e=>o.padding+e/100*y,`projectX`),S=e(e=>h-o.padding-e/100*b,`projectY`),C=_.append(`g`).attr(`class`,`wardley-axes`);C.append(`line`).attr(`x1`,o.padding).attr(`x2`,p-o.padding).attr(`y1`,h-o.padding).attr(`y2`,h-o.padding).attr(`stroke`,s.axisColor).attr(`stroke-width`,1),C.append(`line`).attr(`x1`,o.padding).attr(`x2`,o.padding).attr(`y1`,o.padding).attr(`y2`,h-o.padding).attr(`stroke`,s.axisColor).attr(`stroke-width`,1);let w=d.axes.xLabel??`Evolution`,T=d.axes.yLabel??`Visibility`;C.append(`text`).attr(`class`,`wardley-axis-label wardley-axis-label-x`).attr(`x`,o.padding+y/2).attr(`y`,h-o.padding/4).attr(`fill`,s.axisTextColor).attr(`font-size`,o.axisFontSize).attr(`font-weight`,`bold`).attr(`text-anchor`,`middle`).text(w),C.append(`text`).attr(`class`,`wardley-axis-label wardley-axis-label-y`).attr(`x`,o.padding/3).attr(`y`,o.padding+b/2).attr(`fill`,s.axisTextColor).attr(`font-size`,o.axisFontSize).attr(`font-weight`,`bold`).attr(`text-anchor`,`middle`).attr(`transform`,`rotate(-90 ${o.padding/3} ${o.padding+b/2})`).text(T);let E=d.axes.stages&&d.axes.stages.length>0?d.axes.stages:H;if(E.length>0){let e=_.append(`g`).attr(`class`,`wardley-stages`),t=d.axes.stageBoundaries,n=[];if(t&&t.length===E.length){let e=0;t.forEach(t=>{n.push({start:e,end:t}),e=t})}else{let e=1/E.length;E.forEach((t,r)=>{n.push({start:r*e,end:(r+1)*e})})}E.forEach((t,r)=>{let i=n[r],a=o.padding+i.start*y,c=(a+(o.padding+i.end*y))/2;r>0&&e.append(`line`).attr(`x1`,a).attr(`x2`,a).attr(`y1`,o.padding).attr(`y2`,h-o.padding).attr(`stroke`,`#000`).attr(`stroke-width`,1).attr(`stroke-dasharray`,`5 5`).attr(`opacity`,.8),e.append(`text`).attr(`class`,`wardley-stage-label`).attr(`x`,c).attr(`y`,h-o.padding/1.5).attr(`fill`,s.axisTextColor).attr(`font-size`,o.axisFontSize-2).attr(`text-anchor`,`middle`).text(t)})}if(o.showGrid){let e=_.append(`g`).attr(`class`,`wardley-grid`);for(let t=1;t<4;t++){let n=t/4,r=o.padding+y*n;e.append(`line`).attr(`x1`,r).attr(`x2`,r).attr(`y1`,o.padding).attr(`y2`,h-o.padding).attr(`stroke`,s.gridColor).attr(`stroke-dasharray`,`2 6`),e.append(`line`).attr(`x1`,o.padding).attr(`x2`,p-o.padding).attr(`y1`,h-o.padding-b*n).attr(`y2`,h-o.padding-b*n).attr(`stroke`,s.gridColor).attr(`stroke-dasharray`,`2 6`)}}let D=new Map;if(d.nodes.forEach(e=>{D.set(e.id,{x:x(e.x),y:S(e.y),node:e})}),d.pipelines.length>0){let e=_.append(`g`).attr(`class`,`wardley-pipelines`),t=_.append(`g`).attr(`class`,`wardley-pipeline-links`);d.pipelines.forEach(n=>{if(n.componentIds.length===0)return;let r=n.componentIds.map(e=>({id:e,pos:D.get(e),node:d.nodes.find(t=>t.id===e)})).filter(e=>e.pos&&e.node).sort((e,t)=>e.node.x-t.node.x);for(let e=0;e<r.length-1;e++){let n=r[e],i=r[e+1];t.append(`line`).attr(`class`,`wardley-pipeline-evolution-link`).attr(`x1`,n.pos.x).attr(`y1`,n.pos.y).attr(`x2`,i.pos.x).attr(`y2`,i.pos.y).attr(`stroke`,s.linkStroke).attr(`stroke-width`,1).attr(`stroke-dasharray`,`4 4`)}let i=1/0,a=-1/0,c=0;if(n.componentIds.forEach(e=>{let t=D.get(e);t&&(i=Math.min(i,t.x),a=Math.max(a,t.x),c=t.y)}),i!==1/0&&a!==-1/0){let t=o.nodeRadius*4,r=c-t/2,u=D.get(n.nodeId);u&&(u.x=(i+a)/2,u.y=r-l/6),e.append(`rect`).attr(`class`,`wardley-pipeline-box`).attr(`x`,i-15).attr(`y`,r).attr(`width`,a-i+30).attr(`height`,t).attr(`fill`,`none`).attr(`stroke`,s.axisColor).attr(`stroke-width`,1.5).attr(`rx`,4).attr(`ry`,4)}})}let O=_.append(`g`).attr(`class`,`wardley-links`),k=new Map;d.pipelines.forEach(e=>{k.set(e.nodeId,new Set(e.componentIds))});let A=d.links.filter(e=>!(!D.has(e.source)||!D.has(e.target)||k.get(e.target)?.has(e.source)));O.selectAll(`line`).data(A).enter().append(`line`).attr(`class`,e=>`wardley-link${e.dashed?` wardley-link--dashed`:``}`).attr(`x1`,e=>{let t=D.get(e.source),n=D.get(e.target),r=d.nodes.find(t=>t.id===e.source).isPipelineParent?l/Math.sqrt(2):o.nodeRadius,i=n.x-t.x,a=n.y-t.y,s=Math.sqrt(i*i+a*a);return t.x+i/s*r}).attr(`y1`,e=>{let t=D.get(e.source),n=D.get(e.target),r=d.nodes.find(t=>t.id===e.source).isPipelineParent?l/Math.sqrt(2):o.nodeRadius,i=n.x-t.x,a=n.y-t.y,s=Math.sqrt(i*i+a*a);return t.y+a/s*r}).attr(`x2`,e=>{let t=D.get(e.source),n=D.get(e.target),r=d.nodes.find(t=>t.id===e.target).isPipelineParent?l/Math.sqrt(2):o.nodeRadius,i=t.x-n.x,a=t.y-n.y,s=Math.sqrt(i*i+a*a);return n.x+i/s*r}).attr(`y2`,e=>{let t=D.get(e.source),n=D.get(e.target),r=d.nodes.find(t=>t.id===e.target).isPipelineParent?l/Math.sqrt(2):o.nodeRadius,i=t.x-n.x,a=t.y-n.y,s=Math.sqrt(i*i+a*a);return n.y+a/s*r}).attr(`stroke`,s.linkStroke).attr(`stroke-width`,1).attr(`stroke-dasharray`,e=>e.dashed?`6 6`:null).attr(`marker-end`,e=>e.flow===`forward`||e.flow===`bidirectional`?`url(#link-arrow-end-${r})`:null).attr(`marker-start`,e=>e.flow===`backward`||e.flow===`bidirectional`?`url(#link-arrow-start-${r})`:null),O.selectAll(`text`).data(A.filter(e=>e.label)).enter().append(`text`).attr(`class`,`wardley-link-label`).attr(`x`,e=>{let t=D.get(e.source),n=D.get(e.target),r=(t.x+n.x)/2,i=n.y-t.y,a=n.x-t.x;return r+i/Math.sqrt(a*a+i*i)*8}).attr(`y`,e=>{let t=D.get(e.source),n=D.get(e.target),r=(t.y+n.y)/2,i=n.x-t.x,a=n.y-t.y,o=Math.sqrt(i*i+a*a);return r+-i/o*8}).attr(`fill`,s.axisTextColor).attr(`font-size`,o.labelFontSize).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`middle`).attr(`transform`,e=>{let t=D.get(e.source),n=D.get(e.target),r=(t.x+n.x)/2,i=(t.y+n.y)/2,a=n.x-t.x,o=n.y-t.y,s=Math.sqrt(a*a+o*o),c=o/s,l=-a/s,u=r+c*8,d=i+l*8,f=Math.atan2(o,a)*180/Math.PI;return(f>90||f<-90)&&(f+=180),`rotate(${f} ${u} ${d})`}).text(e=>e.label);let j=_.append(`g`).attr(`class`,`wardley-trends`),M=d.trends.map(e=>{let t=D.get(e.nodeId);if(!t)return null;let n=x(e.targetX),r=S(e.targetY),i=n-t.x,a=r-t.y,s=Math.sqrt(i*i+a*a),c=o.nodeRadius+2;return{origin:t,targetX:n,targetY:r,adjustedX2:s>c?n-i/s*c:n,adjustedY2:s>c?r-a/s*c:r}}).filter(e=>e!==null);j.selectAll(`line`).data(M).enter().append(`line`).attr(`class`,`wardley-trend`).attr(`x1`,e=>e.origin.x).attr(`y1`,e=>e.origin.y).attr(`x2`,e=>e.adjustedX2).attr(`y2`,e=>e.adjustedY2).attr(`stroke`,s.evolutionStroke).attr(`stroke-width`,1).attr(`stroke-dasharray`,`4 4`).attr(`marker-end`,`url(#arrow-${r})`);let N=_.append(`g`).attr(`class`,`wardley-nodes`).selectAll(`g`).data(d.nodes).enter().append(`g`).attr(`class`,e=>[`wardley-node`,e.className?`wardley-node--${e.className}`:``].filter(Boolean).join(` `));N.filter(e=>e.sourceStrategy===`outsource`).append(`circle`).attr(`class`,`wardley-outsource-overlay`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y).attr(`r`,o.nodeRadius*2).attr(`fill`,`#666`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),N.filter(e=>e.sourceStrategy===`buy`).append(`circle`).attr(`class`,`wardley-buy-overlay`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y).attr(`r`,o.nodeRadius*2).attr(`fill`,`#ccc`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),N.filter(e=>e.sourceStrategy===`build`).append(`circle`).attr(`class`,`wardley-build-overlay`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y).attr(`r`,o.nodeRadius*2).attr(`fill`,`#eee`).attr(`stroke`,`#000`).attr(`stroke-width`,1);let P=N.filter(e=>e.sourceStrategy===`market`);P.append(`circle`).attr(`class`,`wardley-market-overlay`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y).attr(`r`,o.nodeRadius*2).attr(`fill`,`white`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),N.filter(e=>!e.isPipelineParent&&e.sourceStrategy!==`market`&&e.className!==`anchor`).append(`circle`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y).attr(`r`,o.nodeRadius).attr(`fill`,s.componentFill).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1);let F=o.nodeRadius*.7,I=o.nodeRadius*1.2;if(P.append(`line`).attr(`class`,`wardley-market-line`).attr(`x1`,e=>D.get(e.id).x).attr(`y1`,e=>D.get(e.id).y-I).attr(`x2`,e=>D.get(e.id).x-I*Math.cos(Math.PI/6)).attr(`y2`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),P.append(`line`).attr(`class`,`wardley-market-line`).attr(`x1`,e=>D.get(e.id).x-I*Math.cos(Math.PI/6)).attr(`y1`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`x2`,e=>D.get(e.id).x+I*Math.cos(Math.PI/6)).attr(`y2`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),P.append(`line`).attr(`class`,`wardley-market-line`).attr(`x1`,e=>D.get(e.id).x+I*Math.cos(Math.PI/6)).attr(`y1`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`x2`,e=>D.get(e.id).x).attr(`y2`,e=>D.get(e.id).y-I).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),P.append(`circle`).attr(`class`,`wardley-market-dot`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y-I).attr(`r`,F).attr(`fill`,`white`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,2),P.append(`circle`).attr(`class`,`wardley-market-dot`).attr(`cx`,e=>D.get(e.id).x-I*Math.cos(Math.PI/6)).attr(`cy`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`r`,F).attr(`fill`,`white`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,2),P.append(`circle`).attr(`class`,`wardley-market-dot`).attr(`cx`,e=>D.get(e.id).x+I*Math.cos(Math.PI/6)).attr(`cy`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`r`,F).attr(`fill`,`white`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,2),N.filter(e=>e.isPipelineParent===!0).append(`rect`).attr(`x`,e=>D.get(e.id).x-l/2).attr(`y`,e=>D.get(e.id).y-l/2).attr(`width`,l).attr(`height`,l).attr(`fill`,s.componentFill).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),N.filter(e=>e.inertia===!0).append(`line`).attr(`class`,`wardley-inertia`).attr(`x1`,e=>{let t=D.get(e.id),n=e.isPipelineParent?l/2+15:o.nodeRadius+15;return e.sourceStrategy&&(n+=o.nodeRadius+10),t.x+n}).attr(`y1`,e=>{let t=D.get(e.id),n=e.isPipelineParent?l:o.nodeRadius*2;return t.y-n/2}).attr(`x2`,e=>{let t=D.get(e.id),n=e.isPipelineParent?l/2+15:o.nodeRadius+15;return e.sourceStrategy&&(n+=o.nodeRadius+10),t.x+n}).attr(`y2`,e=>{let t=D.get(e.id),n=e.isPipelineParent?l:o.nodeRadius*2;return t.y+n/2}).attr(`stroke`,s.componentStroke).attr(`stroke-width`,6),N.append(`text`).attr(`x`,e=>{let t=D.get(e.id);if(e.className===`anchor`)return e.labelOffsetX===void 0?t.x:t.x+e.labelOffsetX;let n=o.nodeLabelOffset;e.sourceStrategy&&e.labelOffsetX===void 0&&(n+=10);let r=e.labelOffsetX??n;return t.x+r}).attr(`y`,e=>{let t=D.get(e.id);if(e.className===`anchor`)return e.labelOffsetY===void 0?t.y-3:t.y+e.labelOffsetY;let n=-o.nodeLabelOffset;e.sourceStrategy&&e.labelOffsetY===void 0&&(n-=10);let r=e.labelOffsetY??n;return t.y+r}).attr(`class`,`wardley-node-label`).attr(`fill`,e=>e.className===`evolved`?s.evolutionStroke:e.className===`anchor`?`#000`:s.componentLabelColor).attr(`font-size`,o.labelFontSize).attr(`font-weight`,e=>e.className===`anchor`?`bold`:`normal`).attr(`text-anchor`,e=>e.className===`anchor`?`middle`:`start`).attr(`dominant-baseline`,e=>e.className===`anchor`?`middle`:`auto`).text(e=>e.label),d.annotations.length>0){let e=_.append(`g`).attr(`class`,`wardley-annotations`);if(d.annotations.forEach(t=>{let n=t.coordinates.map(e=>({x:x(e.x),y:S(e.y)}));if(n.length>1)for(let t=0;t<n.length-1;t++)e.append(`line`).attr(`class`,`wardley-annotation-line`).attr(`x1`,n[t].x).attr(`y1`,n[t].y).attr(`x2`,n[t+1].x).attr(`y2`,n[t+1].y).attr(`stroke`,s.axisColor).attr(`stroke-width`,1.5).attr(`stroke-dasharray`,`4 4`);n.forEach(n=>{let r=e.append(`g`).attr(`class`,`wardley-annotation`);r.append(`circle`).attr(`cx`,n.x).attr(`cy`,n.y).attr(`r`,10).attr(`fill`,`white`).attr(`stroke`,s.axisColor).attr(`stroke-width`,1.5),r.append(`text`).attr(`x`,n.x).attr(`y`,n.y).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`central`).attr(`font-size`,10).attr(`fill`,s.axisTextColor).attr(`font-weight`,`bold`).text(t.number)})}),d.annotationsBox){let t=x(d.annotationsBox.x),n=S(d.annotationsBox.y),r=e.append(`g`).attr(`class`,`wardley-annotations-box`),i=[...d.annotations].filter(e=>e.text).sort((e,t)=>e.number-t.number),a=[];if(i.forEach((e,i)=>{let o=r.append(`text`).attr(`x`,t+10).attr(`y`,n+10+(i+1)*16).attr(`font-size`,11).attr(`fill`,s.axisTextColor).attr(`text-anchor`,`start`).attr(`dominant-baseline`,`middle`).text(`${e.number}. ${e.text}`);a.push(o)}),a.length>0){let e=0,c=0;a.forEach(t=>{let n=t.node(),r=n.getComputedTextLength();e=Math.max(e,r);let i=n.getBBox();c=Math.max(c,i.height)});let l=e+20+105,u=i.length*16+20+c/2,d=o.padding,f=p-o.padding-l,m=o.padding,g=h-o.padding-u;t=Math.max(d,Math.min(t,f)),n=Math.max(m,Math.min(n,g)),a.forEach((e,r)=>{e.attr(`x`,t+10).attr(`y`,n+10+(r+1)*16)}),r.insert(`rect`,`text`).attr(`x`,t).attr(`y`,n).attr(`width`,l).attr(`height`,u).attr(`fill`,`white`).attr(`stroke`,s.axisColor).attr(`stroke-width`,1.5).attr(`rx`,4).attr(`ry`,4)}}}if(d.notes.length>0){let e=_.append(`g`).attr(`class`,`wardley-notes`);d.notes.forEach(t=>{let n=x(t.x),r=S(t.y);e.append(`text`).attr(`x`,n).attr(`y`,r).attr(`text-anchor`,`start`).attr(`font-size`,11).attr(`fill`,s.axisTextColor).attr(`font-weight`,`bold`).text(t.text)})}if(d.accelerators.length>0){let e=_.append(`g`).attr(`class`,`wardley-accelerators`);d.accelerators.forEach(t=>{let n=x(t.x),r=S(t.y),i=`
|
|
3
3
|
M ${n} ${r-30/2}
|
|
4
4
|
L ${n+60-20} ${r-30/2}
|
|
@@ -76,4 +76,4 @@ import{n as e}from"./chunk-Y2CYZVJY-C7FmC3Cl.mjs";import{m as t}from"./src-BuBt_
|
|
|
76
76
|
fill: ${t.axisTextColor};
|
|
77
77
|
}
|
|
78
78
|
`},`styles`)};export{G as diagram};
|
|
79
|
-
//# sourceMappingURL=wardleyDiagram-EHGQE667-
|
|
79
|
+
//# sourceMappingURL=wardleyDiagram-EHGQE667-WhxG-nRT.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-DXB73IDG-q-dGnwlc.mjs";import{t as e}from"./chunk-GXVXFKBA-D-BGCybM.mjs";export{e as wcCommand};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import"./chunk-DXB73IDG-BBwE27jK.mjs";import{r as e,t}from"./chunk-74CEPOFO-BYrCYxKO.mjs";import{t as n}from"./chunk-HWKDQ44K-D3ZbaPl8.mjs";import{n as r}from"./chunk-7L36YK2X-DAp-upAs.mjs";var i={name:`wc`,summary:`print newline, word, and byte counts for each file`,usage:`wc [OPTION]... [FILE]...`,options:[`-c, --bytes print the byte counts`,`-m, --chars print the character counts`,`-l, --lines print the newline counts`,`-w, --words print the word counts`,` --help display this help and exit`]},a={lines:{short:`l`,long:`lines`,type:`boolean`},words:{short:`w`,long:`words`,type:`boolean`},bytes:{short:`c`,long:`bytes`,type:`boolean`},chars:{short:`m`,long:`chars`,type:`boolean`}},o={name:`wc`,async execute(o,l){if(t(o))return e(i);let u=n(`wc`,o,a);if(!u.ok)return u.error;let{lines:d,words:f}=u.result.flags,p=u.result.flags.bytes||u.result.flags.chars,m=u.result.positional;!d&&!f&&!p&&(d=f=p=!0);let h=await r(l,m,{cmdName:`wc`,stopOnError:!1});if(m.length===0)return{stdout:`${c(s(h.files[0].content),d,f,p,``,0)}
|
|
2
|
+
`,stderr:``,exitCode:0};let g=[],_=0,v=0,y=0;for(let{filename:e,content:t}of h.files){let n=s(t);_+=n.lines,v+=n.words,y+=n.chars,g.push({filename:e,stats:n})}let b=m.length>1?_:Math.max(...g.map(e=>e.stats.lines)),x=m.length>1?v:Math.max(...g.map(e=>e.stats.words)),S=m.length>1?y:Math.max(...g.map(e=>e.stats.chars)),C=m.length>1?3:0;d&&(C=Math.max(C,String(b).length)),f&&(C=Math.max(C,String(x).length)),p&&(C=Math.max(C,String(S).length));let w=``;for(let{filename:e,stats:t}of g)w+=`${c(t,d,f,p,e,C)}
|
|
3
|
+
`;return m.length>1&&(w+=`${c({lines:_,words:v,chars:y},d,f,p,`total`,C)}
|
|
4
|
+
`),{stdout:w,stderr:h.stderr,exitCode:h.exitCode}}};function s(e){let t=e.length,n=0,r=0,i=!1;for(let a=0;a<t;a++){let t=e[a];t===`
|
|
5
|
+
`?(n++,i&&=(r++,!1)):t===` `||t===` `||t===`\r`?i&&=(r++,!1):i=!0}return i&&r++,{lines:n,words:r,chars:t}}function c(e,t,n,r,i,a){let o=[];t&&o.push(String(e.lines).padStart(a)),n&&o.push(String(e.words).padStart(a)),r&&o.push(String(e.chars).padStart(a));let s=o.join(` `);return i&&(s+=` ${i}`),s}export{o as wcCommand};
|
|
6
|
+
//# sourceMappingURL=wc-TQB3VNOX-DqHFY4jy.mjs.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import"./chunk-DXB73IDG-BBwE27jK.mjs";import{r as e,t}from"./chunk-74CEPOFO-BYrCYxKO.mjs";import{t as n}from"./chunk-HWKDQ44K-D3ZbaPl8.mjs";var r={name:`which`,summary:`locate a command`,usage:`which [-as] program ...`,options:[`-a List all instances of executables found`,`-s No output, just return 0 if found, 1 if not`,`--help display this help and exit`]},i={showAll:{short:`a`,type:`boolean`},silent:{short:`s`,type:`boolean`}},a={name:`which`,async execute(a,o){if(t(a))return e(r);let s=n(`which`,a,i);if(!s.ok)return s.error;let c=s.result.flags.showAll,l=s.result.flags.silent,u=s.result.positional;if(u.length===0)return{stdout:``,stderr:``,exitCode:1};let d=(o.env.get(`PATH`)||`/usr/bin:/bin`).split(`:`),f=``,p=!0;for(let e of u){let t=!1;for(let n of d){if(!n)continue;let r=o.fs.resolvePath(n,e);if(await o.fs.exists(r)&&(t=!0,l||(f+=`${r}
|
|
2
|
+
`),!c))break}t||(p=!1)}return{stdout:f,stderr:``,exitCode:+!p}}};export{a as whichCommand};
|
|
3
|
+
//# sourceMappingURL=which-XZHEH76L-CbmRVw8E.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-DXB73IDG-q-dGnwlc.mjs";import{t as e}from"./chunk-A65PWWJC-C-0S-s_f.mjs";export{e as whichCommand};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-DXB73IDG-q-dGnwlc.mjs";import{t as e}from"./chunk-HJQJAYMS-BHzb4Ncl.mjs";export{e as whoami};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as e,o as t,t as n}from"./chunk-DTipWd-i.mjs";import{
|
|
1
|
+
import{i as e,o as t,t as n}from"./chunk-DTipWd-i.mjs";import{Ho as r,Po as i,Uo as a,qo as o}from"./src-TKCctdpc.mjs";import{Ir as s,gr as c}from"./src-Dt5dAyFQ.mjs";import{basename as l,dirname as u,isAbsolute as d,join as f,posix as p,relative as m,resolve as h,sep as g,win32 as _}from"node:path";import{cpSync as ee,existsSync as v,lstatSync as te,mkdirSync as y,readFileSync as ne,realpathSync as b,rmSync as x,statSync as re}from"node:fs";import{homedir as S}from"node:os";var C=n((e=>{var t=class extends Error{constructor(e,t,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},n=class extends t{constructor(e){super(1,`commander.invalidArgument`,e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};e.CommanderError=t,e.InvalidArgumentError=n})),w=n((e=>{let{InvalidArgumentError:t}=C();var n=class{constructor(e,t){switch(this.description=t||``,this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case`<`:this.required=!0,this._name=e.slice(1,-1);break;case`[`:this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.endsWith(`...`)&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,n)=>{if(!this.argChoices.includes(e))throw new t(`Allowed choices are ${this.argChoices.join(`, `)}.`);return this.variadic?this._collectValue(e,n):e},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function r(e){let t=e.name()+(e.variadic===!0?`...`:``);return e.required?`<`+t+`>`:`[`+t+`]`}e.Argument=n,e.humanReadableArgName=r})),T=n((e=>{let{humanReadableArgName:t}=w();var n=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let t=e.commands.filter(e=>!e._hidden),n=e._getHelpCommand();return n&&!n._hidden&&t.push(n),this.sortSubcommands&&t.sort((e,t)=>e.name().localeCompare(t.name())),t}compareOptions(e,t){let n=e=>e.short?e.short.replace(/^-/,``):e.long.replace(/^--/,``);return n(e).localeCompare(n(t))}visibleOptions(e){let t=e.options.filter(e=>!e.hidden),n=e._getHelpOption();if(n&&!n.hidden){let r=n.short&&e._findOption(n.short),i=n.long&&e._findOption(n.long);!r&&!i?t.push(n):n.long&&!i?t.push(e.createOption(n.long,n.description)):n.short&&!r&&t.push(e.createOption(n.short,n.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let n=e.parent;n;n=n.parent){let e=n.options.filter(e=>!e.hidden);t.push(...e)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||``}),e.registeredArguments.find(e=>e.description)?e.registeredArguments:[]}subcommandTerm(e){let n=e.registeredArguments.map(e=>t(e)).join(` `);return e._name+(e._aliases[0]?`|`+e._aliases[0]:``)+(e.options.length?` [options]`:``)+(n?` `+n:``)}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleSubcommandTerm(t.subcommandTerm(n)))),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleArgumentTerm(t.argumentTerm(n)))),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+`|`+e._aliases[0]);let n=``;for(let t=e.parent;t;t=t.parent)n=t.name()+` `+n;return n+t+` `+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(`, `)}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue==`boolean`)&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0){let n=`(${t.join(`, `)})`;return e.description?`${e.description} ${n}`:n}return e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(`, `)}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let n=`(${t.join(`, `)})`;return e.description?`${e.description} ${n}`:n}return e.description}formatItemList(e,t,n){return t.length===0?[]:[n.styleTitle(e),...t,``]}groupItems(e,t,n){let r=new Map;return e.forEach(e=>{let t=n(e);r.has(t)||r.set(t,[])}),t.forEach(e=>{let t=n(e);r.has(t)||r.set(t,[]),r.get(t).push(e)}),r}formatHelp(e,t){let n=t.padWidth(e,t),r=t.helpWidth??80;function i(e,r){return t.formatItem(e,n,r,t)}let a=[`${t.styleTitle(`Usage:`)} ${t.styleUsage(t.commandUsage(e))}`,``],o=t.commandDescription(e);o.length>0&&(a=a.concat([t.boxWrap(t.styleCommandDescription(o),r),``]));let s=t.visibleArguments(e).map(e=>i(t.styleArgumentTerm(t.argumentTerm(e)),t.styleArgumentDescription(t.argumentDescription(e))));if(a=a.concat(this.formatItemList(`Arguments:`,s,t)),this.groupItems(e.options,t.visibleOptions(e),e=>e.helpGroupHeading??`Options:`).forEach((e,n)=>{let r=e.map(e=>i(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));a=a.concat(this.formatItemList(n,r,t))}),t.showGlobalOptions){let n=t.visibleGlobalOptions(e).map(e=>i(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));a=a.concat(this.formatItemList(`Global Options:`,n,t))}return this.groupItems(e.commands,t.visibleCommands(e),e=>e.helpGroup()||`Commands:`).forEach((e,n)=>{let r=e.map(e=>i(t.styleSubcommandTerm(t.subcommandTerm(e)),t.styleSubcommandDescription(t.subcommandDescription(e))));a=a.concat(this.formatItemList(n,r,t))}),a.join(`
|
|
2
2
|
`)}displayWidth(e){return r(e).length}styleTitle(e){return e}styleUsage(e){return e.split(` `).map(e=>e===`[options]`?this.styleOptionText(e):e===`[command]`?this.styleSubcommandText(e):e[0]===`[`||e[0]===`<`?this.styleArgumentText(e):this.styleCommandText(e)).join(` `)}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(` `).map(e=>e===`[options]`?this.styleOptionText(e):e[0]===`[`||e[0]===`<`?this.styleArgumentText(e):this.styleSubcommandText(e)).join(` `)}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,t,n,r){let i=` `.repeat(2);if(!n)return i+e;let a=e.padEnd(t+e.length-r.displayWidth(e)),o=(this.helpWidth??80)-t-2-2,s;return s=o<this.minWidthToWrap||r.preformatted(n)?n:r.boxWrap(n,o).replace(/\n/g,`
|
|
3
3
|
`+` `.repeat(t+2)),i+a+` `.repeat(2)+s.replace(/\n/g,`\n${i}`)}boxWrap(e,t){if(t<this.minWidthToWrap)return e;let n=e.split(/\r\n|\n/),r=/[\s]*[^\s]+/g,i=[];return n.forEach(e=>{let n=e.match(r);if(n===null){i.push(``);return}let a=[n.shift()],o=this.displayWidth(a[0]);n.forEach(e=>{let n=this.displayWidth(e);if(o+n<=t){a.push(e),o+=n;return}i.push(a.join(``));let r=e.trimStart();a=[r],o=this.displayWidth(r)}),i.push(a.join(``))}),i.join(`
|
|
4
4
|
`)}};function r(e){return e.replace(/\x1b\[\d*(;\d*)*m/g,``)}e.Help=n,e.stripColor=r})),E=n((e=>{let{InvalidArgumentError:t}=C();var n=class{constructor(e,t){this.flags=e,this.description=t||``,this.required=e.includes(`<`),this.optional=e.includes(`[`),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let n=a(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith(`--no-`)),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;return typeof e==`string`&&(t={[e]:!0}),this.implied=Object.assign(this.implied||{},t),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,n)=>{if(!this.argChoices.includes(e))throw new t(`Allowed choices are ${this.argChoices.join(`, `)}.`);return this.variadic?this._collectValue(e,n):e},this}name(){return this.long?this.long.replace(/^--/,``):this.short.replace(/^-/,``)}attributeName(){return this.negate?i(this.name().replace(/^no-/,``)):i(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},r=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(e=>{e.negate?this.negativeOptions.set(e.attributeName(),e):this.positiveOptions.set(e.attributeName(),e)}),this.negativeOptions.forEach((e,t)=>{this.positiveOptions.has(t)&&this.dualOptions.add(t)})}valueFromOption(e,t){let n=t.attributeName();if(!this.dualOptions.has(n))return!0;let r=this.negativeOptions.get(n).presetArg,i=r===void 0?!1:r;return t.negate===(i===e)}};function i(e){return e.split(`-`).reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}function a(e){let t,n,r=/^-[^-]$/,i=/^--[^-]/,a=e.split(/[ |,]+/).concat(`guard`);if(r.test(a[0])&&(t=a.shift()),i.test(a[0])&&(n=a.shift()),!t&&r.test(a[0])&&(t=a.shift()),!t&&i.test(a[0])&&(t=n,n=a.shift()),a[0].startsWith(`-`)){let t=a[0],n=`option creation failed due to '${t}' in option flags '${e}'`;throw/^-[^-][^-]/.test(t)?Error(`${n}
|
|
@@ -16,7 +16,7 @@ Expecting one of '${n.join(`', '`)}'`);return this._lifeCycleHooks[e]?this._life
|
|
|
16
16
|
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
17
17
|
- ${t?`searched for local subcommand relative to directory '${t}'`:`no directory for search for local subcommand, use .executableDir() to supply a custom directory`}`;throw Error(r)}_executeSubCommand(e,t){t=t.slice();let n=!1,s=[`.js`,`.ts`,`.tsx`,`.mjs`,`.cjs`];function c(e,t){let n=i.resolve(e,t);if(a.existsSync(n))return n;if(s.includes(i.extname(t)))return;let r=s.find(e=>a.existsSync(`${n}${e}`));if(r)return`${n}${r}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let u=e._executableFile||`${this._name}-${e._name}`,d=this._executableDir||``;if(this._scriptPath){let e;try{e=a.realpathSync(this._scriptPath)}catch{e=this._scriptPath}d=i.resolve(i.dirname(e),d)}if(d){let t=c(d,u);if(!t&&!e._executableFile&&this._scriptPath){let n=i.basename(this._scriptPath,i.extname(this._scriptPath));n!==this._name&&(t=c(d,`${n}-${e._name}`))}u=t||u}n=s.includes(i.extname(u));let f;o.platform===`win32`?(this._checkForMissingExecutable(u,d,e._name),t.unshift(u),t=g(o.execArgv).concat(t),f=r.spawn(o.execPath,t,{stdio:`inherit`})):n?(t.unshift(u),t=g(o.execArgv).concat(t),f=r.spawn(o.argv[0],t,{stdio:`inherit`})):f=r.spawn(u,t,{stdio:`inherit`}),f.killed||[`SIGUSR1`,`SIGUSR2`,`SIGTERM`,`SIGINT`,`SIGHUP`].forEach(e=>{o.on(e,()=>{f.killed===!1&&f.exitCode===null&&f.kill(e)})});let p=this._exitCallback;f.on(`close`,e=>{e??=1,p?p(new l(e,`commander.executeSubCommandAsync`,`(close)`)):o.exit(e)}),f.on(`error`,t=>{if(t.code===`ENOENT`)this._checkForMissingExecutable(u,d,e._name);else if(t.code===`EACCES`)throw Error(`'${u}' not executable`);if(!p)o.exit(1);else{let e=new l(1,`commander.executeSubCommandAsync`,`(error)`);e.nestedError=t,p(e)}}),this.runningCommand=f}_dispatchSubcommand(e,t,n){let r=this._findCommand(e);r||this.help({error:!0}),r._prepareForParse();let i;return i=this._chainOrCallSubCommandHook(i,r,`preSubcommand`),i=this._chainOrCall(i,()=>{if(r._executableHandler)this._executeSubCommand(r,t.concat(n));else return r._parseCommand(t,n)}),i}_dispatchHelpCommand(e){e||this.help();let t=this._findCommand(e);return t&&!t._executableHandler&&t.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??`--help`])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,t)=>{e.required&&this.args[t]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(e,t,n)=>{let r=t;if(t!==null&&e.parseArg){let i=`error: command-argument value '${t}' is invalid for argument '${e.name()}'.`;r=this._callParseArg(e,t,n,i)}return r};this._checkNumberOfArguments();let t=[];this.registeredArguments.forEach((n,r)=>{let i=n.defaultValue;n.variadic?r<this.args.length?(i=this.args.slice(r),n.parseArg&&(i=i.reduce((t,r)=>e(n,r,t),n.defaultValue))):i===void 0&&(i=[]):r<this.args.length&&(i=this.args[r],n.parseArg&&(i=e(n,i,n.defaultValue))),t[r]=i}),this.processedArgs=t}_chainOrCall(e,t){return e?.then&&typeof e.then==`function`?e.then(()=>t()):t()}_chainOrCallHooks(e,t){let n=e,r=[];return this._getCommandAndAncestors().reverse().filter(e=>e._lifeCycleHooks[t]!==void 0).forEach(e=>{e._lifeCycleHooks[t].forEach(t=>{r.push({hookedCommand:e,callback:t})})}),t===`postAction`&&r.reverse(),r.forEach(e=>{n=this._chainOrCall(n,()=>e.callback(e.hookedCommand,this))}),n}_chainOrCallSubCommandHook(e,t,n){let r=e;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(e=>{r=this._chainOrCall(r,()=>e(this,t))}),r}_parseCommand(e,t){let n=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(n.operands),t=n.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(t),this._dispatchSubcommand(this._defaultCommandName,e,t);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let r=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},i=`command:${this.name()}`;if(this._actionHandler){r(),this._processArguments();let n;return n=this._chainOrCallHooks(n,`preAction`),n=this._chainOrCall(n,()=>this._actionHandler(this.processedArgs)),this.parent&&(n=this._chainOrCall(n,()=>{this.parent.emit(i,e,t)})),n=this._chainOrCallHooks(n,`postAction`),n}if(this.parent?.listenerCount(i))r(),this._processArguments(),this.parent.emit(i,e,t);else if(e.length){if(this._findCommand(`*`))return this._dispatchSubcommand(`*`,e,t);this.listenerCount(`command:*`)?this.emit(`command:*`,e,t):this.commands.length?this.unknownCommand():(r(),this._processArguments())}else this.commands.length?(r(),this.help({error:!0})):(r(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(t=>t._name===e||t._aliases.includes(e))}_findOption(e){return this.options.find(t=>t.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(t=>{t.mandatory&&e.getOptionValue(t.attributeName())===void 0&&e.missingMandatoryOptionValue(t)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(e=>{let t=e.attributeName();return this.getOptionValue(t)===void 0?!1:this.getOptionValueSource(t)!==`default`});e.filter(e=>e.conflictsWith.length>0).forEach(t=>{let n=e.find(e=>t.conflictsWith.includes(e.attributeName()));n&&this._conflictingOption(t,n)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let t=[],n=[],r=t;function i(e){return e.length>1&&e[0]===`-`}let a=e=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(e)?!this._getCommandAndAncestors().some(e=>e.options.map(e=>e.short).some(e=>/^-\d$/.test(e))):!1,o=null,s=null,c=0;for(;c<e.length||s;){let l=s??e[c++];if(s=null,l===`--`){r===n&&r.push(l),r.push(...e.slice(c));break}if(o&&(!i(l)||a(l))){this.emit(`option:${o.name()}`,l);continue}if(o=null,i(l)){let t=this._findOption(l);if(t){if(t.required){let n=e[c++];n===void 0&&this.optionMissingArgument(t),this.emit(`option:${t.name()}`,n)}else if(t.optional){let n=null;c<e.length&&(!i(e[c])||a(e[c]))&&(n=e[c++]),this.emit(`option:${t.name()}`,n)}else this.emit(`option:${t.name()}`);o=t.variadic?t:null;continue}}if(l.length>2&&l[0]===`-`&&l[1]!==`-`){let e=this._findOption(`-${l[1]}`);if(e){e.required||e.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${e.name()}`,l.slice(2)):(this.emit(`option:${e.name()}`),s=`-${l.slice(2)}`);continue}}if(/^--[^=]+=/.test(l)){let e=l.indexOf(`=`),t=this._findOption(l.slice(0,e));if(t&&(t.required||t.optional)){this.emit(`option:${t.name()}`,l.slice(e+1));continue}}if(r===t&&i(l)&&!(this.commands.length===0&&a(l))&&(r=n),(this._enablePositionalOptions||this._passThroughOptions)&&t.length===0&&n.length===0){if(this._findCommand(l)){t.push(l),n.push(...e.slice(c));break}else if(this._getHelpCommand()&&l===this._getHelpCommand().name()){t.push(l,...e.slice(c));break}else if(this._defaultCommandName){n.push(l,...e.slice(c));break}}if(this._passThroughOptions){r.push(l,...e.slice(c));break}r.push(l)}return{operands:t,unknown:n}}opts(){if(this._storeOptionsAsProperties){let e={},t=this.options.length;for(let n=0;n<t;n++){let t=this.options[n].attributeName();e[t]=t===this._versionOptionName?this._version:this[t]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,t)=>Object.assign(e,t.opts()),{})}error(e,t){this._outputConfiguration.outputError(`${e}\n`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError==`string`?this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
|
|
18
18
|
`),this.outputHelp({error:!0}));let n=t||{},r=n.exitCode||1,i=n.code||`commander.error`;this._exit(r,i,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in o.env){let t=e.attributeName();(this.getOptionValue(t)===void 0||[`default`,`config`,`env`].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,o.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new p(this.options),t=e=>this.getOptionValue(e)!==void 0&&![`default`,`implied`].includes(this.getOptionValueSource(e));this.options.filter(n=>n.implied!==void 0&&t(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(e=>{Object.keys(e.implied).filter(e=>!t(e)).forEach(t=>{this.setOptionValueWithSource(t,e.implied[t],`implied`)})})}missingArgument(e){let t=`error: missing required argument '${e}'`;this.error(t,{code:`commander.missingArgument`})}optionMissingArgument(e){let t=`error: option '${e.flags}' argument missing`;this.error(t,{code:`commander.optionMissingArgument`})}missingMandatoryOptionValue(e){let t=`error: required option '${e.flags}' not specified`;this.error(t,{code:`commander.missingMandatoryOptionValue`})}_conflictingOption(e,t){let n=e=>{let t=e.attributeName(),n=this.getOptionValue(t),r=this.options.find(e=>e.negate&&t===e.attributeName()),i=this.options.find(e=>!e.negate&&t===e.attributeName());return r&&(r.presetArg===void 0&&n===!1||r.presetArg!==void 0&&n===r.presetArg)?r:i||e},r=e=>{let t=n(e),r=t.attributeName();return this.getOptionValueSource(r)===`env`?`environment variable '${t.envVar}'`:`option '${t.flags}'`},i=`error: ${r(e)} cannot be used with ${r(t)}`;this.error(i,{code:`commander.conflictingOption`})}unknownOption(e){if(this._allowUnknownOption)return;let t=``;if(e.startsWith(`--`)&&this._showSuggestionAfterError){let n=[],r=this;do{let e=r.createHelp().visibleOptions(r).filter(e=>e.long).map(e=>e.long);n=n.concat(e),r=r.parent}while(r&&!r._enablePositionalOptions);t=m(e,n)}let n=`error: unknown option '${e}'${t}`;this.error(n,{code:`commander.unknownOption`})}_excessArguments(e){if(this._allowExcessArguments)return;let t=this.registeredArguments.length,n=t===1?``:`s`,r=`error: too many arguments${this.parent?` for '${this.name()}'`:``}. Expected ${t} argument${n} but got ${e.length}.`;this.error(r,{code:`commander.excessArguments`})}unknownCommand(){let e=this.args[0],t=``;if(this._showSuggestionAfterError){let n=[];this.createHelp().visibleCommands(this).forEach(e=>{n.push(e.name()),e.alias()&&n.push(e.alias())}),t=m(e,n)}let n=`error: unknown command '${e}'${t}`;this.error(n,{code:`commander.unknownCommand`})}version(e,t,n){if(e===void 0)return this._version;this._version=e,t||=`-V, --version`,n||=`output the version number`;let r=this.createOption(t,n);return this._versionOptionName=r.attributeName(),this._registerOption(r),this.on(`option:`+r.name(),()=>{this._outputConfiguration.writeOut(`${e}\n`),this._exit(0,`commander.version`,e)}),this}description(e,t){return e===void 0&&t===void 0?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let t=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw Error(`Command alias can't be the same as its name`);let n=this.parent?._findCommand(e);if(n){let t=[n.name()].concat(n.aliases()).join(`|`);throw Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${t}'`)}return t._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(e=>this.alias(e)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let e=this.registeredArguments.map(e=>c(e));return[].concat(this.options.length||this._helpOption!==null?`[options]`:[],this.commands.length?`[command]`:[],this.registeredArguments.length?e:[]).join(` `)}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}helpGroup(e){return e===void 0?this._helpGroupHeading??``:(this._helpGroupHeading=e,this)}commandsGroup(e){return e===void 0?this._defaultCommandGroup??``:(this._defaultCommandGroup=e,this)}optionsGroup(e){return e===void 0?this._defaultOptionGroup??``:(this._defaultOptionGroup=e,this)}_initOptionGroup(e){this._defaultOptionGroup&&!e.helpGroupHeading&&e.helpGroup(this._defaultOptionGroup)}_initCommandGroup(e){this._defaultCommandGroup&&!e.helpGroup()&&e.helpGroup(this._defaultCommandGroup)}nameFromFilename(e){return this._name=i.basename(e,i.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let t=this.createHelp(),n=this._getOutputContext(e);t.prepareContext({error:n.error,helpWidth:n.helpWidth,outputHasColors:n.hasColors});let r=t.formatHelp(this,t);return n.hasColors?r:this._outputConfiguration.stripColor(r)}_getOutputContext(e){e||={};let t=!!e.error,n,r,i;return t?(n=e=>this._outputConfiguration.writeErr(e),r=this._outputConfiguration.getErrHasColors(),i=this._outputConfiguration.getErrHelpWidth()):(n=e=>this._outputConfiguration.writeOut(e),r=this._outputConfiguration.getOutHasColors(),i=this._outputConfiguration.getOutHelpWidth()),{error:t,write:e=>(r||(e=this._outputConfiguration.stripColor(e)),n(e)),hasColors:r,helpWidth:i}}outputHelp(e){let t;typeof e==`function`&&(t=e,e=void 0);let n=this._getOutputContext(e),r={error:n.error,write:n.write,command:this};this._getCommandAndAncestors().reverse().forEach(e=>e.emit(`beforeAllHelp`,r)),this.emit(`beforeHelp`,r);let i=this.helpInformation({error:n.error});if(t&&(i=t(i),typeof i!=`string`&&!Buffer.isBuffer(i)))throw Error(`outputHelp callback must return a string or a Buffer`);n.write(i),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit(`afterHelp`,r),this._getCommandAndAncestors().forEach(e=>e.emit(`afterAllHelp`,r))}helpOption(e,t){return typeof e==`boolean`?(e?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(e??`-h, --help`,t??`display help for command`),(e||t)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this._initOptionGroup(e),this}help(e){this.outputHelp(e);let t=Number(o.exitCode??0);t===0&&e&&typeof e!=`function`&&e.error&&(t=1),this._exit(t,`commander.help`,`(outputHelp)`)}addHelpText(e,t){let n=[`beforeAll`,`before`,`after`,`afterAll`];if(!n.includes(e))throw Error(`Unexpected value for position to addHelpText.
|
|
19
|
-
Expecting one of '${n.join(`', '`)}'`);let r=`${e}Help`;return this.on(r,e=>{let n;n=typeof t==`function`?t({error:e.error,command:e.command}):t,n&&e.write(`${n}\n`)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(e=>t.is(e))&&(this.outputHelp(),this._exit(0,`commander.helpDisplayed`,`(outputHelp)`))}};function g(e){return e.map(e=>{if(!e.startsWith(`--inspect`))return e;let t,n=`127.0.0.1`,r=`9229`,i;return(i=e.match(/^(--inspect(-brk)?)$/))===null?(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))===null?(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=i[1],n=i[3],r=i[4]):(t=i[1],/^\d+$/.test(i[3])?r=i[3]:n=i[3]):t=i[1],t&&r!==`0`?`${t}=${n}:${parseInt(r)+1}`:e})}function _(){if(o.env.NO_COLOR||o.env.FORCE_COLOR===`0`||o.env.FORCE_COLOR===`false`)return!1;if(o.env.FORCE_COLOR||o.env.CLICOLOR_FORCE!==void 0)return!0}t.Command=h,t.useColor=_}));const{program:oe,createCommand:se,createArgument:ce,createOption:le,CommanderError:ue,InvalidArgumentError:D,InvalidOptionArgumentError:de,Command:fe,Argument:pe,Option:me,Help:he}=t(n((e=>{let{Argument:t}=w(),{Command:n}=ae(),{CommanderError:r,InvalidArgumentError:i}=C(),{Help:a}=T(),{Option:o}=E();e.program=new n,e.createCommand=e=>new n(e),e.createOption=(e,t)=>new o(e,t),e.createArgument=(e,n)=>new t(e,n),e.Command=n,e.Option=o,e.Argument=t,e.Help=a,e.CommanderError=r,e.InvalidArgumentError=i,e.InvalidOptionArgumentError=i}))(),1).default,O=
|
|
19
|
+
Expecting one of '${n.join(`', '`)}'`);let r=`${e}Help`;return this.on(r,e=>{let n;n=typeof t==`function`?t({error:e.error,command:e.command}):t,n&&e.write(`${n}\n`)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(e=>t.is(e))&&(this.outputHelp(),this._exit(0,`commander.helpDisplayed`,`(outputHelp)`))}};function g(e){return e.map(e=>{if(!e.startsWith(`--inspect`))return e;let t,n=`127.0.0.1`,r=`9229`,i;return(i=e.match(/^(--inspect(-brk)?)$/))===null?(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))===null?(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=i[1],n=i[3],r=i[4]):(t=i[1],/^\d+$/.test(i[3])?r=i[3]:n=i[3]):t=i[1],t&&r!==`0`?`${t}=${n}:${parseInt(r)+1}`:e})}function _(){if(o.env.NO_COLOR||o.env.FORCE_COLOR===`0`||o.env.FORCE_COLOR===`false`)return!1;if(o.env.FORCE_COLOR||o.env.CLICOLOR_FORCE!==void 0)return!0}t.Command=h,t.useColor=_}));const{program:oe,createCommand:se,createArgument:ce,createOption:le,CommanderError:ue,InvalidArgumentError:D,InvalidOptionArgumentError:de,Command:fe,Argument:pe,Option:me,Help:he}=t(n((e=>{let{Argument:t}=w(),{Command:n}=ae(),{CommanderError:r,InvalidArgumentError:i}=C(),{Help:a}=T(),{Option:o}=E();e.program=new n,e.createCommand=e=>new n(e),e.createOption=(e,t)=>new o(e,t),e.createArgument=(e,n)=>new t(e,n),e.Command=n,e.Option=o,e.Argument=t,e.Help=a,e.CommanderError=r,e.InvalidArgumentError=i,e.InvalidOptionArgumentError=i}))(),1).default,O=r,k=a,ge=o,A=`node`,j={MCP_DEBUG:`1`,OK_LOG_FILE:`/tmp/ok-mcp.log`},M=`# ok-mcp-v2
|
|
20
20
|
USER_BUNDLE="$HOME/Applications/OpenKnowledge.app/Contents/Resources/cli/bin/ok.sh"
|
|
21
21
|
[ -f "$USER_BUNDLE" ] && [ -x "$USER_BUNDLE" ] && exec "$USER_BUNDLE" mcp
|
|
22
22
|
BUNDLE="/Applications/OpenKnowledge.app/Contents/Resources/cli/bin/ok.sh"
|
|
@@ -52,5 +52,5 @@ foreach ($d in $dirs) {
|
|
|
52
52
|
if (Test-Path -LiteralPath $probe -PathType Leaf) { & $probe -y '@inkeep/open-knowledge@latest' mcp; exit $LASTEXITCODE }
|
|
53
53
|
}
|
|
54
54
|
[Console]::Error.WriteLine('OpenKnowledge: install Node.js 24+ (npm i -g @inkeep/open-knowledge), then restart your editor')
|
|
55
|
-
exit 127`,P=`// ok-pi-bridge`,F=`${P}-v1`,I=`ok-pi-managed-extension`;function L(e){if(typeof e!=`object`||!e)return!1;let t=e;if(t.command===`/bin/sh`){if(!Array.isArray(t.args)||t.args[0]!==`-l`||t.args[1]!==`-c`)return!1;let e=t.args[2];return typeof e==`string`&&e.includes(`# ok-mcp-v2`)}if(t.command===`powershell`){if(!Array.isArray(t.args)||t.args[0]!==`-NoProfile`||t.args[1]!==`-NonInteractive`||t.args[2]!==`-Command`)return!1;let e=t.args[3];return typeof e==`string`&&e.includes(`# ok-mcp-win-v1`)}if(t.type===`local`&&Array.isArray(t.command)){if(t.command[0]===`/bin/sh`){if(t.command[1]!==`-l`||t.command[2]!==`-c`)return!1;let e=t.command[3];return typeof e==`string`&&e.includes(`# ok-mcp-v2`)}if(t.command[0]===`powershell`){if(t.command[1]!==`-NoProfile`||t.command[2]!==`-NonInteractive`||t.command[3]!==`-Command`)return!1;let e=t.command[4];return typeof e==`string`&&e.includes(`# ok-mcp-win-v1`)}return!1}if(t.command===`ok-pi-managed-extension`){if(!Array.isArray(t.args))return!1;let e=t.args[0];return typeof e==`string`&&e.startsWith(F)}return!1}function R(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=h(e);if(l(t)===`cli.mjs`&&l(u(t))===`dist`)return t;let n=t.split(g),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 f(i.length===0?g:i.join(g),`packages`,`cli`,`dist`,`cli.mjs`)}function z(e={}){return e.mode===`dev`?{command:A,args:[R(),`mcp`],env:{...j}}:(e.platformName??process.platform)===`win32`?{command:`powershell`,args:[`-NoProfile`,`-NonInteractive`,`-Command`,N]}:{command:`/bin/sh`,args:[`-l`,`-c`,M]}}function _e(e={}){return e.mode===`dev`?{type:`local`,enabled:!0,command:[A,R(),`mcp`],environment:{...j}}:(e.platformName??process.platform)===`win32`?{type:`local`,enabled:!0,command:[`powershell`,`-NoProfile`,`-NonInteractive`,`-Command`,N]}:{type:`local`,enabled:!0,command:[`/bin/sh`,`-l`,`-c`,M]}}function ve(e){if(typeof e!=`object`||!e)return!1;let t=e;return B(t,z({mode:`published`,platformName:`darwin`}))||B(t,z({mode:`published`,platformName:`win32`}))}function B(e,t){return Object.keys(e).length===Object.keys(t).length?ye(e,t):!1}function ye(e,t){if(e.command!==t.command)return!1;let n=t.args;return!Array.isArray(n)||!Array.isArray(e.args)||e.args.length!==n.length?!1:e.args.every((e,t)=>e===n[t])}function V(e,t){let n=e=>typeof e==`string`&&e.includes(`# ok-mcp`);return t===`/bin/sh`?e[0]===`-l`&&e[1]===`-c`&&n(e[2]):t===`powershell`?e[0]===`-NoProfile`&&e[1]===`-NonInteractive`&&e[2]===`-Command`&&n(e[3]):!1}function be(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.enabled===!1||typeof t.command!=`string`||!Array.isArray(t.args)?!1:V(t.args,t.command)}function xe(e){if(typeof e!=`object`||!e)return!1;let t=e;if(t.type!==`local`||t.enabled===!1||!Array.isArray(t.command))return!1;let[n,...r]=t.command;return typeof n==`string`&&V(r,n)}function H(e){return e===`win32`?_:p}function Se(e={}){let t=e.platformName??process.platform,n=e.home??S(),r=e.env??process.env,i=H(t);return t===`darwin`?i.join(n,`Library`,`Application Support`):t===`win32`?r.APPDATA??i.join(n,`AppData`,`Roaming`):r.XDG_CONFIG_HOME??i.join(n,`.config`)}function Ce(e={}){let t=e.platformName??process.platform,n=e.home??S();return H(t).join(n,`.claude.json`)}function U(e={}){let t=e.platformName??process.platform,n=e.home??S(),r=e.env??process.env;if(t===`darwin`)return p.join(n,`Library`,`Application Support`,`Claude`,`claude_desktop_config.json`);if(t===`win32`){let e=r.APPDATA??_.join(n,`AppData`,`Roaming`);return _.join(e,`Claude`,`claude_desktop_config.json`)}throw Error(`Claude Desktop is not available on ${t}. Supported: macOS, Windows.`)}function W(e={}){let t=e.platformName??process.platform,n=e.home??S();return H(t).join(n,`.cursor`,`mcp.json`)}function we(e={}){let t=e.platformName??process.platform,n=e.home??S();return(e.env??process.env).CODEX_HOME??H(t).join(n,`.codex`)}function G(e={}){return H(e.platformName??process.platform).join(we(e),`config.toml`)}function K(e={}){let t=e.platformName??process.platform,n=e.home??S(),r=(e.env??process.env).COPILOT_HOME??H(t).join(n,`.copilot`);return H(t).join(r,`mcp-config.json`)}function Te(e={}){let t=e.platformName??process.platform,n=e.home??S(),r=e.env??process.env,i=H(t);if(t===`win32`){let e=r.APPDATA??i.join(n,`AppData`,`Roaming`);return i.join(e,`opencode`)}let a=r.XDG_CONFIG_HOME??i.join(n,`.config`);return i.join(a,`opencode`)}function q(e={}){return H(e.platformName??process.platform).join(Te(e),`opencode.json`)}function Ee(e={}){let t=e.platformName??process.platform,n=e.home??S();return H(t).join(n,`.openclaw`,`openclaw.json`)}function De(e={}){let t=e.platformName??process.platform,n=e.home??S();return H(t).join(n,`.hermes`,`config.yaml`)}function Oe(e={}){let t=e.platformName??process.platform,n=e.home??S();return(e.env??process.env).PI_CODING_AGENT_DIR??H(t).join(n,`.pi`,`agent`)}function ke(e={}){let t=e.platformName??process.platform,n=e.home??S();return H(t).join(n,`.gemini`,`config`,`mcp_config.json`)}function Ae(e,t){let n=H(t),r=n.join(e,`.lmstudio`,`mcp.json`),i=n.join(e,`.cache`,`lm-studio`,`mcp.json`);return t===`darwin`?[i,r]:[r,i]}function J(e={}){let t=e.platformName??process.platform,n=Ae(e.home??S(),t);return n.find(e=>v(e))||n.find(e=>v(u(e)))||n[0]}function je(e){let t=e.serverName(``);return e.format===`toml`?`[${e.topLevelKey}.${t}]`:[e.topLevelKey,e.serverMapSubKey,t].filter(Boolean).join(`.`)}function Me(e,t){let n;try{n=e.configPath(``,t)}catch{return null}return n.startsWith(`${t}/`)?`~${n.slice(t.length)}`:n}const Y={claude:{id:`claude`,label:k.claude,configPath:(e,t)=>Ce({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>i,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>f(t??S(),`.claude`),projectConfigPath:e=>f(e,`.mcp.json`),projectSkillPath:e=>f(e,`.claude`,`skills`,`open-knowledge`,`SKILL.md`)},"claude-desktop":{id:`claude-desktop`,label:k[`claude-desktop`],configPath:(e,t)=>U({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>i,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>u(U({home:t}))},cursor:{id:`cursor`,label:k.cursor,configPath:(e,t)=>W({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>i,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>u(W({home:t})),projectConfigPath:e=>f(e,`.cursor`,`mcp.json`),projectSkillPath:e=>f(e,`.cursor`,`skills`,`open-knowledge`,`SKILL.md`)},codex:{id:`codex`,label:k.codex,configPath:(e,t)=>G({home:t}),format:`toml`,topLevelKey:`mcp_servers`,serverName:()=>i,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>u(G({home:t})),projectConfigPath:e=>f(e,`.codex`,`config.toml`),projectSkillPath:e=>f(e,`.codex`,`skills`,`open-knowledge`,`SKILL.md`)},copilot:{id:`copilot`,label:k.copilot,configPath:(e,t)=>K({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>i,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>u(K({home:t})),projectSkillPath:e=>f(e,`.github`,`skills`,`open-knowledge`,`SKILL.md`)},opencode:{id:`opencode`,label:k.opencode,configPath:(e,t)=>q({home:t}),format:`json`,topLevelKey:`mcp`,serverName:()=>i,buildEntry:(e,t)=>_e(t),scope:`global`,detectPath:(e,t)=>u(q({home:t})),projectConfigPath:e=>f(e,`opencode.json`),projectSkillPath:e=>f(e,`.opencode`,`skills`,`open-knowledge`,`SKILL.md`)},openclaw:{id:`openclaw`,label:k.openclaw,configPath:(e,t)=>Ee({home:t}),format:`json`,topLevelKey:`mcp`,serverMapSubKey:`servers`,serverName:()=>i,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>f(t??S(),`.openclaw`),offerOnlyWhenDetected:!0},pi:{id:`pi`,label:k.pi,configPath:()=>{throw Error("Pi has no user-global MCP config; OK's integration is the project-scoped bridge extension at .pi/extensions/open-knowledge.ts (run `ok init` in the project).")},format:`file`,topLevelKey:`mcpServers`,serverName:()=>i,buildEntry:()=>{throw Error(`Pi has no MCP entry shape; the managed bridge file is built by buildPiExtensionSource (integrations/pi-extension.ts).`)},scope:`project`,detectPath:(e,t)=>Oe({home:t}),projectConfigPath:e=>f(e,`.pi`,`extensions`,`open-knowledge.ts`),projectSkillPath:e=>f(e,`.pi`,`skills`,`open-knowledge`,`SKILL.md`)},antigravity:{id:`antigravity`,label:k.antigravity,configPath:(e,t)=>ke({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>i,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>f(t??S(),`.gemini`),offerOnlyWhenDetected:!0},"lm-studio":{id:`lm-studio`,label:k[`lm-studio`],configPath:(e,t)=>J({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>i,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>u(J({home:t})),offerOnlyWhenDetected:!0},hermes:{id:`hermes`,label:k.hermes,configPath:(e,t)=>De({home:t}),format:`yaml`,topLevelKey:`mcp_servers`,serverName:()=>i,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>f(t??S(),`.hermes`),offerOnlyWhenDetected:!0}};function Ne(e){let t=e.filter(e=>!Object.hasOwn(Y,e));if(t.length>0)throw Error(`Unknown editor(s): ${t.join(`, `)}. Valid options: ${O.join(`, `)}`);return e.map(e=>Y[e])}function X(e,t){let n;try{n=te(e)}catch(e){if(e.code!==`ENOENT`)throw e}if(n?.isSymbolicLink())throw Error(`Refusing to write through a symbolic link at ${e}. Remove the symlink and re-run project setup.`);Q(e,t)}function Z(e,t){Q(e,t)}function Q(e,t){let n;try{n=y(t)}catch{n=h(t)}let r=u(e);for(;r.length>1&&r!==g;){let t;try{t=y(r)}catch(e){if(e.code===`ENOENT`){r=u(r);continue}throw e}let i=m(n,t);if(i===``||!i.startsWith(`..`)&&!d(i))return;throw Error(`Refusing to write at ${e}: ancestor ${r} resolves to ${t}, which is outside the project directory ${n}. A symbolic link in the path likely escapes the project. Remove the symlink and re-run project setup.`)}}function $(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Pe(e,t,n){try{if(x(n).size>10485760)return!1}catch{return!1}let r;try{r=re(n,`utf-8`)}catch{return!1}let i=[],a=s(r.charCodeAt(0)===65279?r.slice(1):r,i,{allowTrailingComma:!0,disallowComments:!1});if(i.length>0||!$(a))return!1;let o=a[e.topLevelKey];if(!$(o))return!1;let c=e.serverMapSubKey?o[e.serverMapSubKey]:o;return $(c)?$(c[e.serverName(t)]):!1}function Fe(e,t,n={}){if(e.id!==`copilot`)return!0;try{return Pe(e,t,e.configPath(t,n.home))}catch{return!1}}function Ie(e,t,n={}){let r=e.projectSkillPath?.(t);if(!r)return{editorId:e.id,label:e.label,action:`skipped-unsupported`,path:``};if(!Fe(e,t,n))return{editorId:e.id,label:e.label,action:`skipped-prerequisite`,path:r};try{let n=c(`project`,{checkDesktop:!0}),i=u(r);X(i,t);let a=v(r)?`overwritten`:`written`;return b(i,{recursive:!0,force:!0}),ne(u(i),{recursive:!0}),ee(n,i,{recursive:!0}),{editorId:e.id,label:e.label,action:a,path:r}}catch(t){return{editorId:e.id,label:e.label,action:`failed`,path:r,error:t instanceof Error?t.message:String(t)}}}function Le(e,t){let n=e.projectSkillPath?.(t);if(!n)return{editorId:e.id,label:e.label,action:`skipped-unsupported`,path:``};try{let r=u(n);return v(n)?(Z(r,t),b(r,{recursive:!0,force:!0}),{editorId:e.id,label:e.label,action:`removed`,path:n}):{editorId:e.id,label:e.label,action:`not-present`,path:n}}catch(t){return{editorId:e.id,label:e.label,action:`failed`,path:n,error:t instanceof Error?t.message:String(t)}}}export{me as C,D as S,ve as _,O as a,Ne as b,ge as c,I as d,z as f,L as g,be as h,Ie as i,P as l,je as m,Z as n,k as o,Me as p,Le as r,Y as s,X as t,F as u,xe as v,fe as x,Se as y};
|
|
56
|
-
//# sourceMappingURL=write-project-skill-
|
|
55
|
+
exit 127`,P=`// ok-pi-bridge`,F=`${P}-v1`,I=`ok-pi-managed-extension`;function L(e){if(typeof e!=`object`||!e)return!1;let t=e;if(t.command===`/bin/sh`){if(!Array.isArray(t.args)||t.args[0]!==`-l`||t.args[1]!==`-c`)return!1;let e=t.args[2];return typeof e==`string`&&e.includes(`# ok-mcp-v2`)}if(t.command===`powershell`){if(!Array.isArray(t.args)||t.args[0]!==`-NoProfile`||t.args[1]!==`-NonInteractive`||t.args[2]!==`-Command`)return!1;let e=t.args[3];return typeof e==`string`&&e.includes(`# ok-mcp-win-v1`)}if(t.type===`local`&&Array.isArray(t.command)){if(t.command[0]===`/bin/sh`){if(t.command[1]!==`-l`||t.command[2]!==`-c`)return!1;let e=t.command[3];return typeof e==`string`&&e.includes(`# ok-mcp-v2`)}if(t.command[0]===`powershell`){if(t.command[1]!==`-NoProfile`||t.command[2]!==`-NonInteractive`||t.command[3]!==`-Command`)return!1;let e=t.command[4];return typeof e==`string`&&e.includes(`# ok-mcp-win-v1`)}return!1}if(t.command===`ok-pi-managed-extension`){if(!Array.isArray(t.args))return!1;let e=t.args[0];return typeof e==`string`&&e.startsWith(F)}return!1}function R(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=h(e);if(l(t)===`cli.mjs`&&l(u(t))===`dist`)return t;let n=t.split(g),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 f(i.length===0?g:i.join(g),`packages`,`cli`,`dist`,`cli.mjs`)}function z(e={}){return e.mode===`dev`?{command:A,args:[R(),`mcp`],env:{...j}}:(e.platformName??process.platform)===`win32`?{command:`powershell`,args:[`-NoProfile`,`-NonInteractive`,`-Command`,N]}:{command:`/bin/sh`,args:[`-l`,`-c`,M]}}function _e(e={}){return e.mode===`dev`?{type:`local`,enabled:!0,command:[A,R(),`mcp`],environment:{...j}}:(e.platformName??process.platform)===`win32`?{type:`local`,enabled:!0,command:[`powershell`,`-NoProfile`,`-NonInteractive`,`-Command`,N]}:{type:`local`,enabled:!0,command:[`/bin/sh`,`-l`,`-c`,M]}}function ve(e){if(typeof e!=`object`||!e)return!1;let t=e;return B(t,z({mode:`published`,platformName:`darwin`}))||B(t,z({mode:`published`,platformName:`win32`}))}function B(e,t){return Object.keys(e).length===Object.keys(t).length?ye(e,t):!1}function ye(e,t){if(e.command!==t.command)return!1;let n=t.args;return!Array.isArray(n)||!Array.isArray(e.args)||e.args.length!==n.length?!1:e.args.every((e,t)=>e===n[t])}function V(e,t){let n=e=>typeof e==`string`&&e.includes(`# ok-mcp`);return t===`/bin/sh`?e[0]===`-l`&&e[1]===`-c`&&n(e[2]):t===`powershell`?e[0]===`-NoProfile`&&e[1]===`-NonInteractive`&&e[2]===`-Command`&&n(e[3]):!1}function be(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.enabled===!1||typeof t.command!=`string`||!Array.isArray(t.args)?!1:V(t.args,t.command)}function xe(e){if(typeof e!=`object`||!e)return!1;let t=e;if(t.type!==`local`||t.enabled===!1||!Array.isArray(t.command))return!1;let[n,...r]=t.command;return typeof n==`string`&&V(r,n)}function H(e){return e===`win32`?_:p}function Se(e={}){let t=e.platformName??process.platform,n=e.home??S(),r=e.env??process.env,i=H(t);return t===`darwin`?i.join(n,`Library`,`Application Support`):t===`win32`?r.APPDATA??i.join(n,`AppData`,`Roaming`):r.XDG_CONFIG_HOME??i.join(n,`.config`)}function Ce(e={}){let t=e.platformName??process.platform,n=e.home??S();return H(t).join(n,`.claude.json`)}function U(e={}){let t=e.platformName??process.platform,n=e.home??S(),r=e.env??process.env;if(t===`darwin`)return p.join(n,`Library`,`Application Support`,`Claude`,`claude_desktop_config.json`);if(t===`win32`){let e=r.APPDATA??_.join(n,`AppData`,`Roaming`);return _.join(e,`Claude`,`claude_desktop_config.json`)}throw Error(`Claude Desktop is not available on ${t}. Supported: macOS, Windows.`)}function W(e={}){let t=e.platformName??process.platform,n=e.home??S();return H(t).join(n,`.cursor`,`mcp.json`)}function we(e={}){let t=e.platformName??process.platform,n=e.home??S();return(e.env??process.env).CODEX_HOME??H(t).join(n,`.codex`)}function G(e={}){return H(e.platformName??process.platform).join(we(e),`config.toml`)}function K(e={}){let t=e.platformName??process.platform,n=e.home??S(),r=(e.env??process.env).COPILOT_HOME??H(t).join(n,`.copilot`);return H(t).join(r,`mcp-config.json`)}function Te(e={}){let t=e.platformName??process.platform,n=e.home??S(),r=e.env??process.env,i=H(t);if(t===`win32`){let e=r.APPDATA??i.join(n,`AppData`,`Roaming`);return i.join(e,`opencode`)}let a=r.XDG_CONFIG_HOME??i.join(n,`.config`);return i.join(a,`opencode`)}function q(e={}){return H(e.platformName??process.platform).join(Te(e),`opencode.json`)}function Ee(e={}){let t=e.platformName??process.platform,n=e.home??S();return H(t).join(n,`.openclaw`,`openclaw.json`)}function De(e={}){let t=e.platformName??process.platform,n=e.home??S();return H(t).join(n,`.hermes`,`config.yaml`)}function Oe(e={}){let t=e.platformName??process.platform,n=e.home??S();return(e.env??process.env).PI_CODING_AGENT_DIR??H(t).join(n,`.pi`,`agent`)}function ke(e={}){let t=e.platformName??process.platform,n=e.home??S();return H(t).join(n,`.gemini`,`config`,`mcp_config.json`)}function Ae(e,t){let n=H(t),r=n.join(e,`.lmstudio`,`mcp.json`),i=n.join(e,`.cache`,`lm-studio`,`mcp.json`);return t===`darwin`?[i,r]:[r,i]}function J(e={}){let t=e.platformName??process.platform,n=Ae(e.home??S(),t);return n.find(e=>v(e))||n.find(e=>v(u(e)))||n[0]}const Y={claude:{id:`claude`,label:k.claude,configPath:(e,t)=>Ce({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>i,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>f(t??S(),`.claude`),projectConfigPath:e=>f(e,`.mcp.json`),projectSkillPath:e=>f(e,`.claude`,`skills`,`open-knowledge`,`SKILL.md`)},"claude-desktop":{id:`claude-desktop`,label:k[`claude-desktop`],configPath:(e,t)=>U({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>i,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>u(U({home:t}))},cursor:{id:`cursor`,label:k.cursor,configPath:(e,t)=>W({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>i,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>u(W({home:t})),projectConfigPath:e=>f(e,`.cursor`,`mcp.json`),projectSkillPath:e=>f(e,`.cursor`,`skills`,`open-knowledge`,`SKILL.md`)},codex:{id:`codex`,label:k.codex,configPath:(e,t)=>G({home:t}),format:`toml`,topLevelKey:`mcp_servers`,serverName:()=>i,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>u(G({home:t})),projectConfigPath:e=>f(e,`.codex`,`config.toml`),projectSkillPath:e=>f(e,`.codex`,`skills`,`open-knowledge`,`SKILL.md`)},copilot:{id:`copilot`,label:k.copilot,configPath:(e,t)=>K({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>i,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>u(K({home:t})),projectSkillPath:e=>f(e,`.github`,`skills`,`open-knowledge`,`SKILL.md`)},opencode:{id:`opencode`,label:k.opencode,configPath:(e,t)=>q({home:t}),format:`json`,topLevelKey:`mcp`,serverName:()=>i,buildEntry:(e,t)=>_e(t),scope:`global`,detectPath:(e,t)=>u(q({home:t})),projectConfigPath:e=>f(e,`opencode.json`),projectSkillPath:e=>f(e,`.opencode`,`skills`,`open-knowledge`,`SKILL.md`)},openclaw:{id:`openclaw`,label:k.openclaw,configPath:(e,t)=>Ee({home:t}),format:`json`,topLevelKey:`mcp`,serverMapSubKey:`servers`,serverName:()=>i,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>f(t??S(),`.openclaw`),offerOnlyWhenDetected:!0},pi:{id:`pi`,label:k.pi,configPath:()=>{throw Error("Pi has no user-global MCP config; OK's integration is the project-scoped bridge extension at .pi/extensions/open-knowledge.ts (run `ok init` in the project).")},format:`file`,topLevelKey:`mcpServers`,serverName:()=>i,buildEntry:()=>{throw Error(`Pi has no MCP entry shape; the managed bridge file is built by buildPiExtensionSource (integrations/pi-extension.ts).`)},scope:`project`,detectPath:(e,t)=>Oe({home:t}),projectConfigPath:e=>f(e,`.pi`,`extensions`,`open-knowledge.ts`),projectSkillPath:e=>f(e,`.pi`,`skills`,`open-knowledge`,`SKILL.md`)},antigravity:{id:`antigravity`,label:k.antigravity,configPath:(e,t)=>ke({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>i,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>f(t??S(),`.gemini`),offerOnlyWhenDetected:!0},"lm-studio":{id:`lm-studio`,label:k[`lm-studio`],configPath:(e,t)=>J({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>i,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>u(J({home:t})),offerOnlyWhenDetected:!0},hermes:{id:`hermes`,label:k.hermes,configPath:(e,t)=>De({home:t}),format:`yaml`,topLevelKey:`mcp_servers`,serverName:()=>i,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>f(t??S(),`.hermes`),offerOnlyWhenDetected:!0}};function je(e){let t=e.filter(e=>!Object.hasOwn(Y,e));if(t.length>0)throw Error(`Unknown editor(s): ${t.join(`, `)}. Valid options: ${O.join(`, `)}`);return e.map(e=>Y[e])}function X(e,t){let n;try{n=te(e)}catch(e){if(e.code!==`ENOENT`)throw e}if(n?.isSymbolicLink())throw Error(`Refusing to write through a symbolic link at ${e}. Remove the symlink and re-run project setup.`);Z(e,t)}function Me(e,t){Z(e,t)}function Z(e,t){let n;try{n=b(t)}catch{n=h(t)}let r=u(e);for(;r.length>1&&r!==g;){let t;try{t=b(r)}catch(e){if(e.code===`ENOENT`){r=u(r);continue}throw e}let i=m(n,t);if(i===``||!i.startsWith(`..`)&&!d(i))return;throw Error(`Refusing to write at ${e}: ancestor ${r} resolves to ${t}, which is outside the project directory ${n}. A symbolic link in the path likely escapes the project. Remove the symlink and re-run project setup.`)}}function Q(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Ne(e,t,n){try{if(re(n).size>10485760)return!1}catch{return!1}let r;try{r=ne(n,`utf-8`)}catch{return!1}let i=[],a=s(r.charCodeAt(0)===65279?r.slice(1):r,i,{allowTrailingComma:!0,disallowComments:!1});if(i.length>0||!Q(a))return!1;let o=a[e.topLevelKey];if(!Q(o))return!1;let c=e.serverMapSubKey?o[e.serverMapSubKey]:o;return Q(c)?Q(c[e.serverName(t)]):!1}function Pe(e,t,n={}){if(e.id!==`copilot`)return!0;try{return Ne(e,t,e.configPath(t,n.home))}catch{return!1}}function $(e,t,n={}){let r=e.projectSkillPath?.(t);if(!r)return{editorId:e.id,label:e.label,action:`skipped-unsupported`,path:``};if(!Pe(e,t,n))return{editorId:e.id,label:e.label,action:`skipped-prerequisite`,path:r};try{let n=c(`project`,{checkDesktop:!0}),i=u(r);X(i,t);let a=v(r)?`overwritten`:`written`;return x(i,{recursive:!0,force:!0}),y(u(i),{recursive:!0}),ee(n,i,{recursive:!0}),{editorId:e.id,label:e.label,action:a,path:r}}catch(t){return{editorId:e.id,label:e.label,action:`failed`,path:r,error:t instanceof Error?t.message:String(t)}}}export{je as _,k as a,me as b,P as c,z as d,be as f,Se as g,xe as h,O as i,F as l,ve as m,Me as n,Y as o,L as p,$ as r,ge as s,X as t,I as u,fe as v,D as y};
|
|
56
|
+
//# sourceMappingURL=write-project-skill-DOogyZge.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-B74TABJS-BSazPoW8.mjs";import"./chunk-DXB73IDG-q-dGnwlc.mjs";import"./chunk-5QMZ5MUS-D8tv8KWc.mjs";import"./chunk-24IMIIXA-BQtWA2ag.mjs";import"./chunk-PXTK5WE2-DNbfUrIy.mjs";import"./chunk-7TSDKFEO-DBB10vPw.mjs";import"./chunk-KRBPSX3W-YDdgrCmf.mjs";import"./chunk-DBKNVD4L-DNQP2COw.mjs";import{t as e}from"./chunk-3BS5SKQH-DpdUzS0R.mjs";export{e as xanCommand};
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import{t as e}from"./chunk-B74TABJS-BJwhrR8a.mjs";import{a as t,i as n,n as r,o as i}from"./chunk-DXB73IDG-BBwE27jK.mjs";import"./chunk-5QMZ5MUS-C5NTf5Rj.mjs";import"./chunk-24IMIIXA-RjlBWJtr.mjs";import{r as a,t as o}from"./chunk-74CEPOFO-BYrCYxKO.mjs";import{n as s}from"./chunk-7L36YK2X-DAp-upAs.mjs";import{t as c}from"./chunk-PXTK5WE2-e9kxtsgu.mjs";import{n as l,s as u}from"./chunk-7TSDKFEO-CE_P23TY.mjs";import{n as d}from"./chunk-KRBPSX3W-DeaaVEij.mjs";import{a as f,c as p,i as m,n as h,o as g,r as _,s as v,t as y}from"./chunk-DBKNVD4L-B3hX287s.mjs";var b,x=r(()=>{b=class{input;pos=0;tokens=[];constructor(e){this.input=e}tokenize(){for(;this.pos<this.input.length&&(this.skipWhitespace(),!(this.pos>=this.input.length));){let e=this.nextToken();e&&this.tokens.push(e)}return this.tokens.push({type:`eof`,value:``,pos:this.pos}),this.tokens}skipWhitespace(){for(;this.pos<this.input.length;){let e=this.input[this.pos];if(e===` `||e===` `||e===`
|
|
2
|
+
`||e===`\r`)this.pos++;else if(e===`#`)for(;this.pos<this.input.length&&this.input[this.pos]!==`
|
|
3
|
+
`;)this.pos++;else break}}nextToken(){let e=this.pos,t=this.input[this.pos];if(t>=`0`&&t<=`9`)return this.readNumber();if(t===`"`||t===`'`||t==="`")return this.readString(t);if(t===`b`&&this.pos+1<this.input.length){let e=this.input[this.pos+1];if(e===`"`||e===`'`||e==="`")return this.pos++,this.readString(e)}if(t===`/`){let t=this.tokens[this.tokens.length-1];return t&&(t.type===`int`||t.type===`float`||t.type===`string`||t.type===`ident`||t.type===`)`||t.type===`]`)?this.input[this.pos+1]===`/`?(this.pos+=2,{type:`//`,value:`//`,pos:e}):(this.pos++,{type:`/`,value:`/`,pos:e}):this.readRegex()}if(this.match(`not in`))return{type:`not in`,value:`not in`,pos:e};if(this.match(`=>`))return{type:`=>`,value:`=>`,pos:e};if(this.match(`**`))return{type:`**`,value:`**`,pos:e};if(this.match(`++`))return{type:`++`,value:`++`,pos:e};if(this.match(`//`))return{type:`//`,value:`//`,pos:e};if(this.match(`==`))return{type:`==`,value:`==`,pos:e};if(this.match(`!=`))return{type:`!=`,value:`!=`,pos:e};if(this.match(`<=`))return{type:`<=`,value:`<=`,pos:e};if(this.match(`>=`))return{type:`>=`,value:`>=`,pos:e};if(this.match(`&&`))return{type:`&&`,value:`&&`,pos:e};if(this.match(`||`))return{type:`||`,value:`||`,pos:e};let n=new Map([[`(`,`(`],[`)`,`)`],[`[`,`[`],[`]`,`]`],[`{`,`{`],[`}`,`}`],[`,`,`,`],[`:`,`:`],[`;`,`;`],[`+`,`+`],[`-`,`-`],[`*`,`*`],[`%`,`%`],[`<`,`<`],[`>`,`>`],[`!`,`!`],[`.`,`.`],[`|`,`|`],[`=`,`=`]]).get(t);if(n!==void 0)return this.pos++,{type:n,value:t,pos:e};if(this.isIdentStart(t))return this.readIdentifier();throw Error(`Unexpected character '${t}' at position ${this.pos}`)}match(e){if(this.input.slice(this.pos,this.pos+e.length)===e){if(/^[a-zA-Z]/.test(e)){let t=this.input[this.pos+e.length];if(t&&this.isIdentChar(t))return!1}return this.pos+=e.length,!0}return!1}isIdentStart(e){return e>=`a`&&e<=`z`||e>=`A`&&e<=`Z`||e===`_`}isIdentChar(e){return this.isIdentStart(e)||e>=`0`&&e<=`9`}readNumber(){let e=this.pos,t=!1,n=!1;for(;this.pos<this.input.length;){let e=this.input[this.pos];if(e>=`0`&&e<=`9`)this.pos++;else if(e===`_`)this.pos++;else if(e===`.`&&!t&&!n)t=!0,this.pos++;else if((e===`e`||e===`E`)&&!n)n=!0,t=!0,this.pos++,this.pos<this.input.length&&(this.input[this.pos]===`+`||this.input[this.pos]===`-`)&&this.pos++;else break}let r=this.input.slice(e,this.pos).replace(/_/g,``);return{type:t?`float`:`int`,value:r,pos:e}}readString(e){let t=this.pos;this.pos++;let n=``;for(;this.pos<this.input.length;){let r=this.input[this.pos];if(r===e)return this.pos++,{type:`string`,value:n,pos:t};if(r===`\\`){if(this.pos++,this.pos<this.input.length){let e=this.input[this.pos];switch(e){case`n`:n+=`
|
|
4
|
+
`;break;case`r`:n+=`\r`;break;case`t`:n+=` `;break;case`\\`:n+=`\\`;break;case`"`:n+=`"`;break;case`'`:n+=`'`;break;case"`":n+="`";break;case`0`:n+=`\0`;break;default:n+=e}this.pos++}}else n+=r,this.pos++}throw Error(`Unterminated string starting at position ${t}`)}readRegex(){let e=this.pos;this.pos++;let t=``,n=``;for(;this.pos<this.input.length;){let r=this.input[this.pos];if(r===`/`){for(this.pos++;this.pos<this.input.length&&this.input[this.pos]===`i`;)n+=this.input[this.pos],this.pos++;return{type:`regex`,value:t+(n?`/${n}`:``),pos:e}}r===`\\`?(t+=r,this.pos++,this.pos<this.input.length&&(t+=this.input[this.pos],this.pos++)):(t+=r,this.pos++)}throw Error(`Unterminated regex starting at position ${e}`)}readIdentifier(){let e=this.pos;for(;this.pos<this.input.length&&this.isIdentChar(this.input[this.pos]);)this.pos++;let t=!1;this.pos<this.input.length&&this.input[this.pos]===`?`&&(t=!0,this.pos++);let n=this.input.slice(e,t?this.pos-1:this.pos);t&&(n+=`?`);let r=new Map([[`true`,`true`],[`false`,`false`],[`null`,`null`],[`and`,`and`],[`or`,`or`],[`eq`,`eq`],[`ne`,`ne`],[`lt`,`lt`],[`le`,`le`],[`gt`,`gt`],[`ge`,`ge`],[`in`,`in`],[`as`,`as`],[`_`,`_`]]),i=n.replace(/\?$/,``),a=r.get(i);return a!==void 0&&!t?{type:a,value:i,pos:e}:{type:`ident`,value:n,pos:e}}}}),S={};n(S,{parseMoonblade:()=>w,parseNamedExpressions:()=>C});function C(e){let t=[],n=new b(e).tokenize(),r=0,i=()=>n[r]||{type:`eof`,value:``,pos:0},a=()=>n[r++];for(;i().type!==`eof`;){if(i().type===`,`&&t.length>0){a();continue}let o=[],s=0,c=r;for(;i().type!==`eof`;){let e=i();if((e.type===`,`||e.type===`as`)&&s===0)break;(e.type===`(`||e.type===`[`||e.type===`{`)&&s++,(e.type===`)`||e.type===`]`||e.type===`}`)&&s--,o.push(a())}o.push({type:`eof`,value:``,pos:0});let l=new E(o).parse(),u;if(i().type===`as`)if(a(),i().type===`(`){a();let e=[];for(;i().type!==`)`&&i().type!==`eof`;)(i().type===`ident`||i().type===`string`)&&(e.push(i().value),a()),i().type===`,`&&a();i().type===`)`&&a(),u=e}else if(i().type===`ident`||i().type===`string`)u=i().value,a();else throw Error(`Expected name after 'as', got ${i().type}`);else u=e.slice(n[c].pos,n[r-1]?.pos||e.length).trim(),l.type===`identifier`&&(u=l.name);t.push({expr:l,name:u})}return t}function w(e){let t=new b(e).tokenize();return new E(t).parse()}var T,E,D=r(()=>{x(),T={PIPE:1,OR:2,AND:3,EQUALITY:4,COMPARISON:5,ADDITIVE:6,MULTIPLICATIVE:7,POWER:8,UNARY:9,POSTFIX:10},E=class{pos=0;tokens;constructor(e){this.tokens=e}parse(){let e=this.parseExpr(0);if(this.peek().type!==`eof`)throw Error(`Unexpected token: ${this.peek().value}`);return e}parseExpr(e){let t=this.parsePrefix();for(;;){let n=this.peek(),r=this.getInfixPrec(n.type);if(r<e)break;t=this.parseInfix(t,r)}return t}parsePrefix(){let e=this.peek();switch(e.type){case`int`:return this.advance(),{type:`int`,value:Number.parseInt(e.value,10)};case`float`:return this.advance(),{type:`float`,value:Number.parseFloat(e.value)};case`string`:return this.advance(),{type:`string`,value:e.value};case`regex`:{this.advance();let t=e.value.split(`/`),n=t.length>1?t[t.length-1]:``;return{type:`regex`,pattern:t.slice(0,-1).join(`/`)||e.value,caseInsensitive:n.includes(`i`)}}case`true`:return this.advance(),{type:`bool`,value:!0};case`false`:return this.advance(),{type:`bool`,value:!1};case`null`:return this.advance(),{type:`null`};case`_`:return this.advance(),{type:`underscore`};case`ident`:{let t=e.value,n=t.endsWith(`?`),r=n?t.slice(0,-1):t;if(this.advance(),this.peek().type===`(`)return this.parseFunctionCall(r);if(this.peek().type===`=>`){this.advance();let e=this.parseExpr(0);return this.bindLambdaArgs({type:`lambda`,params:[r],body:e},[r])}return{type:`identifier`,name:r,unsure:n}}case`(`:{this.advance();let e=this.pos;if(this.peek().type===`)`){if(this.advance(),this.peek().type===`=>`)return this.advance(),{type:`lambda`,params:[],body:this.parseExpr(0)};throw Error(`Empty parentheses not allowed`)}if(this.peek().type===`ident`){let t=[this.peek().value];this.advance();let n=!0;for(;this.peek().type===`,`;)if(this.advance(),this.peek().type===`ident`)t.push(this.peek().value),this.advance();else{n=!1;break}if(n&&this.peek().type===`)`&&this.peekAt(1).type===`=>`){this.advance(),this.advance();let e=this.parseExpr(0);return this.bindLambdaArgs({type:`lambda`,params:t,body:e},t)}this.pos=e}let t=this.parseExpr(0);return this.expect(`)`),t}case`[`:return this.parseList();case`{`:return this.parseMap();case`-`:{this.advance();let e=this.parseExpr(T.UNARY);return e.type===`int`?{type:`int`,value:-e.value}:e.type===`float`?{type:`float`,value:-e.value}:{type:`func`,name:`neg`,args:[{expr:e}]}}case`!`:return this.advance(),{type:`func`,name:`not`,args:[{expr:this.parseExpr(T.UNARY)}]};default:throw Error(`Unexpected token: ${e.type} (${e.value})`)}}parseFunctionCall(e){this.expect(`(`);let t=[];if(this.peek().type!==`)`)do{t.length>0&&this.peek().type===`,`&&this.advance();let e;if(this.peek().type===`ident`){let t=this.peek().value,n=this.pos+1;n<this.tokens.length&&this.tokens[n].type===`=`&&(e=t,this.advance(),this.advance())}let n=this.parseExpr(0);t.push({name:e,expr:n})}while(this.peek().type===`,`);return this.expect(`)`),{type:`func`,name:e.toLowerCase(),args:t}}parseList(){this.expect(`[`);let e=[];if(this.peek().type!==`]`)do e.length>0&&this.peek().type===`,`&&this.advance(),e.push(this.parseExpr(0));while(this.peek().type===`,`);return this.expect(`]`),{type:`list`,elements:e}}parseMap(){this.expect(`{`);let e=[];if(this.peek().type!==`}`)do{e.length>0&&this.peek().type===`,`&&this.advance();let t;if(this.peek().type===`ident`)t=this.peek().value,this.advance();else if(this.peek().type===`string`)t=this.peek().value,this.advance();else throw Error(`Expected map key, got ${this.peek().type}`);this.expect(`:`);let n=this.parseExpr(0);e.push({key:t,value:n})}while(this.peek().type===`,`);return this.expect(`}`),{type:`map`,entries:e}}parseInfix(e,t){let n=this.peek(),r=new Map([[`+`,`add`],[`-`,`sub`],[`*`,`mul`],[`/`,`div`],[`//`,`idiv`],[`%`,`mod`],[`**`,`pow`],[`++`,`concat`],[`==`,`==`],[`!=`,`!=`],[`<`,`<`],[`<=`,`<=`],[`>`,`>`],[`>=`,`>=`],[`eq`,`eq`],[`ne`,`ne`],[`lt`,`lt`],[`le`,`le`],[`gt`,`gt`],[`ge`,`ge`],[`&&`,`and`],[`and`,`and`],[`||`,`or`],[`or`,`or`]]).get(n.type);if(r!==void 0){this.advance();let i=this.parseExpr(t+ +!this.isRightAssoc(n.type));return{type:`func`,name:r,args:[{expr:e},{expr:i}]}}if(n.type===`|`){this.advance();let n=this.parseExpr(t);return this.handlePipe(e,n)}if(n.type===`.`)return this.advance(),this.handleDot(e);if(n.type===`[`)return this.advance(),this.handleIndexing(e);if(n.type===`in`)return this.advance(),{type:`func`,name:`contains`,args:[{expr:this.parseExpr(t+1)},{expr:e}]};if(n.type===`not in`)return this.advance(),{type:`func`,name:`not`,args:[{expr:{type:`func`,name:`contains`,args:[{expr:this.parseExpr(t+1)},{expr:e}]}}]};throw Error(`Unexpected infix token: ${n.type}`)}handlePipe(e,t){if(t.type===`identifier`)return{type:`func`,name:t.name,args:[{expr:e}]};if(t.type===`func`){let n=this.countUnderscores(t);return n===0?t:n===1?this.fillUnderscore(t,e):{type:`pipeline`,exprs:[e,t]}}return this.countUnderscores(t)===1?this.fillUnderscore(t,e):t}handleDot(e){let t=this.peek();if(t.type===`ident`){let n=t.value;if(this.advance(),this.peek().type===`(`){let t=this.parseFunctionCall(n);return t.type===`func`&&t.args.unshift({expr:e}),t}return{type:`func`,name:`get`,args:[{expr:e},{expr:{type:`string`,value:n}}]}}if(t.type===`int`){let n=Number.parseInt(t.value,10);return this.advance(),{type:`func`,name:`get`,args:[{expr:e},{expr:{type:`int`,value:n}}]}}if(t.type===`string`){let n=t.value;return this.advance(),{type:`func`,name:`get`,args:[{expr:e},{expr:{type:`string`,value:n}}]}}throw Error(`Expected identifier, number, or string after dot, got ${t.type}`)}handleIndexing(e){if(this.peek().type===`:`){if(this.advance(),this.peek().type===`]`)return this.advance(),{type:`func`,name:`slice`,args:[{expr:e}]};let t=this.parseExpr(0);return this.expect(`]`),{type:`func`,name:`slice`,args:[{expr:e},{expr:{type:`int`,value:0}},{expr:t}]}}let t=this.parseExpr(0);if(this.peek().type===`:`){if(this.advance(),this.peek().type===`]`)return this.advance(),{type:`func`,name:`slice`,args:[{expr:e},{expr:t}]};let n=this.parseExpr(0);return this.expect(`]`),{type:`func`,name:`slice`,args:[{expr:e},{expr:t},{expr:n}]}}return this.expect(`]`),{type:`func`,name:`get`,args:[{expr:e},{expr:t}]}}countUnderscores(e){return e.type===`underscore`?1:e.type===`func`?e.args.reduce((e,t)=>e+this.countUnderscores(t.expr),0):e.type===`list`?e.elements.reduce((e,t)=>e+this.countUnderscores(t),0):e.type===`map`?e.entries.reduce((e,t)=>e+this.countUnderscores(t.value),0):0}fillUnderscore(e,t){return e.type===`underscore`?t:e.type===`func`?{...e,args:e.args.map(e=>({...e,expr:this.fillUnderscore(e.expr,t)}))}:e.type===`list`?{...e,elements:e.elements.map(e=>this.fillUnderscore(e,t))}:e.type===`map`?{...e,entries:e.entries.map(e=>({...e,value:this.fillUnderscore(e.value,t)}))}:e}bindLambdaArgs(e,t){return{...e,body:this.bindLambdaArgsInExpr(e.body,t)}}bindLambdaArgsInExpr(e,t){return e.type===`identifier`&&t.includes(e.name)?{type:`lambdaBinding`,name:e.name}:e.type===`func`?{...e,args:e.args.map(e=>({...e,expr:this.bindLambdaArgsInExpr(e.expr,t)}))}:e.type===`list`?{...e,elements:e.elements.map(e=>this.bindLambdaArgsInExpr(e,t))}:e.type===`map`?{...e,entries:e.entries.map(e=>({...e,value:this.bindLambdaArgsInExpr(e.value,t)}))}:e}getInfixPrec(e){switch(e){case`|`:return T.PIPE;case`||`:case`or`:return T.OR;case`&&`:case`and`:return T.AND;case`==`:case`!=`:case`eq`:case`ne`:return T.EQUALITY;case`<`:case`<=`:case`>`:case`>=`:case`lt`:case`le`:case`gt`:case`ge`:case`in`:case`not in`:return T.COMPARISON;case`+`:case`-`:case`++`:return T.ADDITIVE;case`*`:case`/`:case`//`:case`%`:return T.MULTIPLICATIVE;case`**`:return T.POWER;case`.`:case`[`:return T.POSTFIX;default:return-1}}isRightAssoc(e){return e===`**`}peek(){return this.tokens[this.pos]||{type:`eof`,value:``,pos:0}}peekAt(e){return this.tokens[this.pos+e]||{type:`eof`,value:``,pos:0}}advance(){return this.tokens[this.pos++]}expect(e){let t=this.peek();if(t.type!==e)throw Error(`Expected ${e}, got ${t.type}`);return this.advance()}}});D();function O(e,t){return t.length===0?j(e,[]):t.length===1?{type:`Pipe`,left:t[0],right:j(e,[])}:{type:`Pipe`,left:t[0],right:j(e,t.slice(1))}}var k={add:e=>A(`+`,e[0],e[1]),sub:e=>A(`-`,e[0],e[1]),mul:e=>A(`*`,e[0],e[1]),div:e=>A(`/`,e[0],e[1]),mod:e=>A(`%`,e[0],e[1]),idiv:e=>j(`floor`,[A(`/`,e[0],e[1])]),pow:e=>O(`pow`,e),neg:e=>({type:`UnaryOp`,op:`-`,operand:e[0]}),"==":e=>A(`==`,e[0],e[1]),"!=":e=>A(`!=`,e[0],e[1]),"<":e=>A(`<`,e[0],e[1]),"<=":e=>A(`<=`,e[0],e[1]),">":e=>A(`>`,e[0],e[1]),">=":e=>A(`>=`,e[0],e[1]),eq:e=>A(`==`,P(e[0]),P(e[1])),ne:e=>A(`!=`,P(e[0]),P(e[1])),lt:e=>A(`<`,P(e[0]),P(e[1])),le:e=>A(`<=`,P(e[0]),P(e[1])),gt:e=>A(`>`,P(e[0]),P(e[1])),ge:e=>A(`>=`,P(e[0]),P(e[1])),and:e=>A(`and`,e[0],e[1]),or:e=>A(`or`,e[0],e[1]),not:e=>({type:`UnaryOp`,op:`not`,operand:e[0]}),len:e=>O(`length`,e),length:e=>O(`length`,e),upper:e=>O(`ascii_upcase`,e),lower:e=>O(`ascii_downcase`,e),trim:e=>O(`trim`,e),ltrim:e=>e.length===0?j(`ltrimstr`,[{type:`Literal`,value:` `}]):{type:`Pipe`,left:e[0],right:j(`ltrimstr`,[{type:`Literal`,value:` `}])},rtrim:e=>e.length===0?j(`rtrimstr`,[{type:`Literal`,value:` `}]):{type:`Pipe`,left:e[0],right:j(`rtrimstr`,[{type:`Literal`,value:` `}])},split:e=>O(`split`,e),join:e=>e.length===1?j(`join`,[{type:`Literal`,value:``}]):O(`join`,e),concat:e=>A(`+`,e[0],e[1]),startswith:e=>O(`startswith`,e),endswith:e=>O(`endswith`,e),contains:e=>O(`contains`,e),replace:e=>O(`gsub`,e),substr:e=>e.length===2?{type:`Slice`,base:e[0],start:e[1]}:{type:`Slice`,base:e[0],start:e[1],end:A(`+`,e[1],e[2])},abs:e=>O(`fabs`,e),floor:e=>O(`floor`,e),ceil:e=>O(`ceil`,e),round:e=>O(`round`,e),sqrt:e=>O(`sqrt`,e),log:e=>O(`log`,e),log10:e=>O(`log10`,e),log2:e=>O(`log2`,e),exp:e=>O(`exp`,e),sin:e=>O(`sin`,e),cos:e=>O(`cos`,e),tan:e=>O(`tan`,e),asin:e=>O(`asin`,e),acos:e=>O(`acos`,e),atan:e=>O(`atan`,e),min:e=>O(`min`,e),max:e=>O(`max`,e),first:e=>e.length===0?{type:`Index`,index:{type:`Literal`,value:0}}:{type:`Index`,index:{type:`Literal`,value:0},base:e[0]},last:e=>e.length===0?{type:`Index`,index:{type:`Literal`,value:-1}}:{type:`Index`,index:{type:`Literal`,value:-1},base:e[0]},get:e=>e.length===1?{type:`Index`,index:e[0]}:{type:`Index`,index:e[1],base:e[0]},slice:e=>e.length===1?{type:`Slice`,base:e[0]}:e.length===2?{type:`Slice`,base:e[0],start:e[1]}:{type:`Slice`,base:e[0],start:e[1],end:e[2]},keys:`keys`,values:`values`,entries:e=>j(`to_entries`,e),from_entries:`from_entries`,reverse:`reverse`,sort:`sort`,sort_by:`sort_by`,group_by:`group_by`,unique:`unique`,unique_by:`unique_by`,flatten:`flatten`,map:e=>({type:`Pipe`,left:e[0],right:{type:`Array`,elements:e[1]}}),select:e=>j(`select`,e),empty:()=>j(`empty`,[]),count:()=>j(`length`,[]),sum:e=>e.length===0?j(`add`,[]):{type:`Pipe`,left:{type:`Array`,elements:e[0]},right:j(`add`,[])},mean:e=>e.length===0?{type:`Pipe`,left:{type:`Identity`},right:A(`/`,j(`add`,[]),j(`length`,[]))}:{type:`Pipe`,left:{type:`Array`,elements:e[0]},right:A(`/`,j(`add`,[]),j(`length`,[]))},avg:e=>e.length===0?{type:`Pipe`,left:{type:`Identity`},right:A(`/`,j(`add`,[]),j(`length`,[]))}:{type:`Pipe`,left:{type:`Array`,elements:e[0]},right:A(`/`,j(`add`,[]),j(`length`,[]))},type:`type`,isnull:e=>e.length===0?A(`==`,{type:`Identity`},{type:`Literal`,value:null}):A(`==`,e[0],{type:`Literal`,value:null}),isempty:e=>e.length===0?A(`==`,{type:`Identity`},{type:`Literal`,value:``}):A(`==`,e[0],{type:`Literal`,value:``}),tonumber:e=>e.length===0?j(`tonumber`,[]):j(`tonumber`,e),tostring:e=>e.length===0?j(`tostring`,[]):j(`tostring`,e),if:e=>N(e[0],e[1],e[2]),coalesce:e=>{if(e.length===0)return{type:`Literal`,value:null};if(e.length===1)return e[0];let[t,...n]=e;return N(A(`and`,A(`!=`,t,{type:`Literal`,value:null}),A(`!=`,t,{type:`Literal`,value:``})),t,n.length===1?n[0]:k.coalesce(n))},index:()=>({type:`Field`,name:`_row_index`}),now:()=>j(`now`,[]),fmt:e=>j(`tostring`,e),format:e=>j(`tostring`,e)};Object.setPrototypeOf(k,null);function A(e,t,n){return{type:`BinaryOp`,op:e,left:t,right:n}}function j(e,t){return{type:`Call`,name:e,args:t}}var M=`then`;function N(e,t,n){let r=u({type:`Cond`,cond:e,elifs:[],else:n||{type:`Literal`,value:null}});return r[M]=t,r}function P(e){return{type:`Pipe`,left:e,right:{type:`Call`,name:`tostring`,args:[]}}}function F(e,t=!0){switch(e.type){case`int`:case`float`:return{type:`Literal`,value:e.value};case`string`:return{type:`Literal`,value:e.value};case`bool`:return{type:`Literal`,value:e.value};case`null`:return{type:`Literal`,value:null};case`underscore`:return{type:`Index`,base:{type:`Identity`},index:{type:`Literal`,value:`_`}};case`identifier`:return t?{type:`Field`,name:e.name}:{type:`VarRef`,name:e.name};case`lambdaBinding`:return{type:`VarRef`,name:e.name};case`func`:{let n=e.args.map(e=>F(e.expr,t)),r=Object.hasOwn(k,e.name)?k[e.name]:void 0;return typeof r==`function`?r(n):j(typeof r==`string`?r:e.name,n)}case`list`:return e.elements.length===0?{type:`Array`}:{type:`Array`,elements:e.elements.reduce((e,n,r)=>{let i=F(n,t);return r===0?i:{type:`Comma`,left:e,right:i}},null)};case`map`:return{type:`Object`,entries:e.entries.map(e=>({key:e.key,value:F(e.value,t)}))};case`regex`:return{type:`Literal`,value:e.pattern};case`slice`:return{type:`Slice`,start:e.start?F(e.start,t):void 0,end:e.end?F(e.end,t):void 0};case`lambda`:return F(e.body,t);case`pipeline`:return{type:`Identity`};default:throw Error(`Unknown moonblade expression type: ${e.type}`)}}function I(e){let t=[],n=0;for(;n<e.length;){for(;n<e.length&&(e[n]===` `||e[n]===`,`);)n++;if(n>=e.length)break;let r=n;for(;n<e.length&&/\w/.test(e[n]);)n++;let i=e.slice(r,n);for(;n<e.length&&e[n]===` `;)n++;if(e[n]!==`(`)break;n++;let a=1,o=n;for(;n<e.length&&a>0;)e[n]===`(`?a++:e[n]===`)`&&a--,a>0&&n++;let s=e.slice(o,n).trim();for(n++;n<e.length&&e[n]===` `;)n++;let c=``;if(e.slice(n,n+3).toLowerCase()===`as `){for(n+=3;n<e.length&&e[n]===` `;)n++;let t=n;for(;n<e.length&&/\w/.test(e[n]);)n++;c=e.slice(t,n)}c||=s?`${i}(${s})`:`${i}()`,t.push({func:i,expr:s,alias:c})}return t}function L(e){return/^\w+$/.test(e)}function R(e,t,n){let r=d(e,F(w(t)),n);return r.length>0?r[0]:null}function z(e,t,n={}){let{func:r,expr:i}=t;if(r===`count`&&!i)return e.length;let a;switch(a=L(i)?e.map(e=>e[i]).filter(e=>e!=null):e.map(e=>R(e,i,n)).filter(e=>e!=null),r){case`count`:return L(i)?a.length:a.filter(e=>!!e).length;case`sum`:return a.map(e=>typeof e==`number`?e:Number.parseFloat(String(e))).reduce((e,t)=>e+t,0);case`mean`:case`avg`:{let e=a.map(e=>typeof e==`number`?e:Number.parseFloat(String(e)));return e.length>0?e.reduce((e,t)=>e+t,0)/e.length:0}case`min`:{let e=a.map(e=>typeof e==`number`?e:Number.parseFloat(String(e)));return e.length>0?Math.min(...e):null}case`max`:{let e=a.map(e=>typeof e==`number`?e:Number.parseFloat(String(e)));return e.length>0?Math.max(...e):null}case`first`:return a.length>0?a[0]:null;case`last`:return a.length>0?a[a.length-1]:null;case`median`:{let e=a.map(e=>typeof e==`number`?e:Number.parseFloat(String(e))).filter(e=>!Number.isNaN(e)).sort((e,t)=>e-t);if(e.length===0)return null;let t=Math.floor(e.length/2);return e.length%2==0?(e[t-1]+e[t])/2:e[t]}case`mode`:{let e=new Map;for(let t of a){let n=String(t);e.set(n,(e.get(n)||0)+1)}let t=0,n=null;for(let[r,i]of e)i>t&&(t=i,n=r);return n}case`cardinality`:return new Set(a.map(e=>String(e))).size;case`values`:return a.map(e=>String(e)).join(`|`);case`distinct_values`:return[...new Set(a.map(e=>String(e)))].sort().join(`|`);case`all`:if(e.length===0)return!0;for(let t of e)if(!R(t,i,n))return!1;return!0;case`any`:for(let t of e)if(R(t,i,n))return!0;return!1;default:return null}}function ee(e,t,n={}){let r=v();for(let i of t)_(r,i.alias,z(e,i,n));return r}async function te(e,t){let n=``,r=[];for(let t of e)t.startsWith(`-`)||(n?r.push(t):n=t);if(!n)return{stdout:``,stderr:`xan agg: no aggregation expression
|
|
5
|
+
`,exitCode:1};let{data:i,error:a}=await g(r,t);if(a)return a;let o={limits:t.limits?{maxIterations:t.limits.maxJqIterations}:void 0},s=I(n);return{stdout:h(s.map(e=>e.alias),[ee(i,s,o)]),stderr:``,exitCode:0}}async function ne(e,t){let n=``,r=``,i=[];for(let t=0;t<e.length;t++){let a=e[t];a===`--sorted`||a.startsWith(`-`)||(n?r?i.push(a):r=a:n=a)}if(!n||!r)return{stdout:``,stderr:`xan groupby: usage: xan groupby COLS EXPR [FILE]
|
|
6
|
+
`,exitCode:1};let{data:a,error:o}=await g(i,t);if(o)return o;let s={limits:t.limits?{maxIterations:t.limits.maxJqIterations}:void 0},c=n.split(`,`),l=I(r),u=[],d=new Map;for(let e of a){let t=c.map(t=>String(e[t])).join(`\0`);d.has(t)||(d.set(t,[]),u.push(t)),d.get(t)?.push(e)}let f=[...c,...l.map(e=>e.alias)],p=[];for(let e of u){let t=d.get(e);if(!t)continue;let n=v();for(let e of c)_(n,e,t[0][e]);for(let e of l)_(n,e.alias,z(t,e,s));p.push(n)}return{stdout:h(f,p),stderr:``,exitCode:0}}async function re(e,t){let n=[],r=``,i=10,a=!1,o=[];for(let t=0;t<e.length;t++){let s=e[t];(s===`-s`||s===`--select`)&&t+1<e.length?n=e[++t].split(`,`):(s===`-g`||s===`--groupby`)&&t+1<e.length?r=e[++t]:(s===`-l`||s===`--limit`)&&t+1<e.length?i=Number.parseInt(e[++t],10):s===`--no-extra`?a=!0:s===`-A`||s===`--all`?i=0:s.startsWith(`-`)||o.push(s)}let{headers:s,data:c,error:l}=await g(o,t);if(l)return l;let u=n.length>0?n:s.filter(e=>e!==r);r&&n.length===0&&(u=s.filter(e=>e!==r));let d=[],f=r?[`field`,r,`value`,`count`]:[`field`,`value`,`count`];if(r){let e=new Map;for(let t of c){let n=String(t[r]??``);e.has(n)||e.set(n,[]),e.get(n)?.push(t)}for(let t of u)for(let[n,o]of e){let e=new Map;for(let n of o){let r=n[t],i=r===``||r==null?``:String(r);e.set(i,(e.get(i)||0)+1)}let s=[...e.entries()].sort((e,t)=>t[1]===e[1]?e[0].localeCompare(t[0]):t[1]-e[1]);a&&(s=s.filter(([e])=>e!==``)),i>0&&(s=s.slice(0,i));for(let[e,i]of s)d.push({field:t,[r]:n,value:e===``?`<empty>`:e,count:i})}}else for(let e of u){let t=new Map;for(let n of c){let r=n[e],i=r===``||r==null?``:String(r);t.set(i,(t.get(i)||0)+1)}let n=[...t.entries()].sort((e,t)=>t[1]===e[1]?e[0].localeCompare(t[0]):t[1]-e[1]);a&&(n=n.filter(([e])=>e!==``)),i>0&&(n=n.slice(0,i));for(let[t,r]of n)d.push({field:e,value:t===``?`<empty>`:t,count:r})}return{stdout:h(f,d),stderr:``,exitCode:0}}async function ie(e,t){let n=[],r=[];for(let t=0;t<e.length;t++){let i=e[t];i===`-s`&&t+1<e.length?n=e[++t].split(`,`):i.startsWith(`-`)||r.push(i)}let{headers:i,data:a,error:o}=await g(r,t);if(o)return o;let s=n.length>0?n:i,c=[`field`,`type`,`count`,`min`,`max`,`mean`],l=[];for(let e of s){let t=a.map(t=>t[e]).filter(e=>e!=null),n=t.map(e=>typeof e==`number`?e:Number.parseFloat(String(e))).filter(e=>!Number.isNaN(e)),r=n.length===t.length&&n.length>0;l.push({field:e,type:r?`Number`:`String`,count:t.length,min:r?Math.min(...n):``,max:r?Math.max(...n):``,mean:r?Math.round(n.reduce((e,t)=>e+t,0)/n.length*1e10)/1e10:``})}return{stdout:h(c,l),stderr:``,exitCode:0}}D();function ae(e){return F(w(e))}function B(t){return e(`^${t.replace(/[.+?^${}()|[\]\\]/g,`\\$&`).replace(/\*/g,`.*`)}$`)}function V(e,t){let n=[],r=new Set;for(let i of e.split(`,`)){let e=i.trim();if(e.startsWith(`!`)){let n=V(e.slice(1),t);for(let e of n)r.add(e);continue}if(e===`*`){for(let e of t)n.includes(e)||n.push(e);continue}if(e.includes(`*`)){let r=B(e);for(let e of t)r.test(e)&&!n.includes(e)&&n.push(e);continue}let a=e.match(/^([^:]*):([^:]*)$/);if(a&&(a[1]||a[2])){let e=a[1],r=a[2],i=e?t.indexOf(e):0,o=r?t.indexOf(r):t.length-1;if(i!==-1&&o!==-1){let e=i<=o?1:-1;for(let r=i;e>0?r<=o:r>=o;r+=e)n.includes(t[r])||n.push(t[r])}continue}let o=e.match(/^(\d+)-(\d+)$/);if(o){let e=Number.parseInt(o[1],10),r=Number.parseInt(o[2],10);for(let i=e;i<=r&&i<t.length;i++)n.push(t[i]);continue}let s=Number.parseInt(e,10);if(!Number.isNaN(s)&&s>=0&&s<t.length){n.push(t[s]);continue}t.includes(e)&&n.push(e)}return r.size>0?n.filter(e=>!r.has(e)):n}async function H(e,t){let n=``,r=[];for(let t of e)t.startsWith(`-`)||(n?r.push(t):n=t);if(!n)return{stdout:``,stderr:`xan select: no columns specified
|
|
7
|
+
`,exitCode:1};let{headers:i,data:a,error:o}=await g(r,t);if(o)return o;let s=V(n,i);return{stdout:h(s,a.map(e=>{let t=v();for(let n of s)_(t,n,e[n]);return t})),stderr:``,exitCode:0}}async function U(e,t){let n=``,r=[];for(let t of e)t.startsWith(`-`)||(n?r.push(t):n=t);if(!n)return{stdout:``,stderr:`xan drop: no columns specified
|
|
8
|
+
`,exitCode:1};let{headers:i,data:a,error:o}=await g(r,t);if(o)return o;let s=new Set(V(n,i)),c=i.filter(e=>!s.has(e));return{stdout:h(c,a.map(e=>{let t=v();for(let n of c)_(t,n,e[n]);return t})),stderr:``,exitCode:0}}async function W(e,t){let n=``,r=``,i=[];for(let t=0;t<e.length;t++){let a=e[t];a===`-s`&&t+1<e.length?r=e[++t]:a.startsWith(`-`)||(n?i.push(a):n=a)}if(!n)return{stdout:``,stderr:`xan rename: no new name(s) specified
|
|
9
|
+
`,exitCode:1};let{headers:a,data:o,error:s}=await g(i,t);if(s)return s;let c;if(r){let e=r.split(`,`),t=n.split(`,`),i=new Map;for(let n=0;n<e.length&&n<t.length;n++)i.set(e[n],t[n]);c=a.map(e=>i.get(e)||e)}else{let e=n.split(`,`);c=a.map((t,n)=>n<e.length?e[n]:t)}let l=o.map(e=>{let t=v();for(let n=0;n<a.length;n++)_(t,c[n],e[a[n]]);return t});return{stdout:h(c,l),stderr:``,exitCode:0}}async function G(e,t){let n=`index`,r=[];for(let t=0;t<e.length;t++)e[t]===`-c`&&t+1<e.length?n=e[++t]:r.push(e[t]);let{headers:i,data:a,error:o}=await g(r,t);return o||{stdout:h([n,...i],a.map((e,t)=>{let r=v();_(r,n,t);for(let t of i)_(r,t,e[t]);return r})),stderr:``,exitCode:0}}async function K(e,t){let n=e.includes(`-j`)||e.includes(`--just-names`),{headers:r,error:i}=await g(e.filter(e=>e!==`-j`&&e!==`--just-names`),t);return i||{stdout:n?`${r.map(e=>e).join(`
|
|
10
|
+
`)}
|
|
11
|
+
`:`${r.map((e,t)=>`${t} ${e}`).join(`
|
|
12
|
+
`)}
|
|
13
|
+
`,stderr:``,exitCode:0}}async function q(e,t){let{data:n,error:r}=await g(e,t);return r||{stdout:`${n.length}
|
|
14
|
+
`,stderr:``,exitCode:0}}async function J(e,t){let n=10,r=[];for(let t=0;t<e.length;t++)(e[t]===`-l`||e[t]===`-n`)&&t+1<e.length?n=Number.parseInt(e[++t],10):r.push(e[t]);let{headers:i,data:a,error:o}=await g(r,t);return o||{stdout:h(i,a.slice(0,n)),stderr:``,exitCode:0}}async function oe(e,t){let n=10,r=[];for(let t=0;t<e.length;t++)(e[t]===`-l`||e[t]===`-n`)&&t+1<e.length?n=Number.parseInt(e[++t],10):r.push(e[t]);let{headers:i,data:a,error:o}=await g(r,t);return o||{stdout:h(i,a.slice(-n)),stderr:``,exitCode:0}}async function se(e,t){let n,r,i,a=[];for(let t=0;t<e.length;t++){let o=e[t];(o===`-s`||o===`--start`)&&t+1<e.length?n=Number.parseInt(e[++t],10):(o===`-e`||o===`--end`)&&t+1<e.length?r=Number.parseInt(e[++t],10):(o===`-l`||o===`--len`)&&t+1<e.length?i=Number.parseInt(e[++t],10):o.startsWith(`-`)||a.push(o)}let{headers:o,data:s,error:c}=await g(a,t);if(c)return c;let l=n??0,u;return u=i===void 0?r===void 0?s.length:r:l+i,{stdout:h(o,s.slice(l,u)),stderr:``,exitCode:0}}async function ce(e,t){let{headers:n,data:r,error:i}=await g(e,t);return i||{stdout:h(n,[...r].reverse()),stderr:``,exitCode:0}}var Y=t(c(),1);async function le(e,t){let{headers:n,data:r,error:i}=await g(e.filter(e=>!e.startsWith(`-`)),t);if(i)return i;if(r.length===0)return{stdout:h([`column`],n.map(e=>({column:e}))),stderr:``,exitCode:0};let a=n[0],o=[a,...r.map((e,t)=>String(e[a]??`row_${t}`))],s=[];for(let e=1;e<n.length;e++){let t=n[e],i=v();_(i,a,t);for(let e=0;e<r.length;e++)_(i,o[e+1],r[e][t]);s.push(i)}return{stdout:h(o,s),stderr:``,exitCode:0}}async function ue(e,t){let n=null,r=[];for(let t=0;t<e.length;t++){let i=e[t];i===`--seed`&&t+1<e.length?n=Number.parseInt(e[++t],10):i.startsWith(`-`)||r.push(i)}let{headers:i,data:a,error:o}=await g(r,t);if(o)return o;let s=n===null?Date.now():n,c=()=>(s=s*1103515245+12345&2147483647,s/2147483647),l=[...a];for(let e=l.length-1;e>0;e--){let t=Math.floor(c()*(e+1));[l[e],l[t]]=[l[t],l[e]]}return{stdout:h(i,l),stderr:``,exitCode:0}}async function de(e,t){let n=null,r=``,i=[];for(let t=0;t<e.length;t++){let a=e[t];(a===`-l`||a===`--length`)&&t+1<e.length?n=Number.parseInt(e[++t],10):(a===`-d`||a===`--default`)&&t+1<e.length?r=e[++t]:a.startsWith(`-`)||i.push(a)}let a=i[0],o;if(!a||a===`-`)o=t.stdin;else try{let e=t.fs.resolvePath(t.cwd,a);o=await t.fs.readFile(e)}catch{return{stdout:``,stderr:`xan fixlengths: ${a}: No such file or directory
|
|
15
|
+
`,exitCode:1}}let s=Y.default.parse(o.trim(),{header:!1,skipEmptyLines:!0}).data;if(s.length===0)return{stdout:``,stderr:``,exitCode:0};let c=Math.max(...s.map(e=>e.length)),l=n??c,u=s.map(e=>e.length===l?e:e.length<l?[...e,...Array(l-e.length).fill(r)]:e.slice(0,l));return{stdout:`${Y.default.unparse(u).replace(/\r\n/g,`
|
|
16
|
+
`)}
|
|
17
|
+
`,stderr:``,exitCode:0}}async function fe(e,t){let n=null,r=null,i=`.`,a=[];for(let t=0;t<e.length;t++){let o=e[t];(o===`-c`||o===`--chunks`)&&t+1<e.length?n=Number.parseInt(e[++t],10):(o===`-S`||o===`--size`)&&t+1<e.length?r=Number.parseInt(e[++t],10):(o===`-o`||o===`--output`)&&t+1<e.length?i=e[++t]:o.startsWith(`-`)||a.push(o)}if(!n&&!r)return{stdout:``,stderr:`xan split: must specify -c or -S
|
|
18
|
+
`,exitCode:1};let{headers:o,data:s,error:c}=await g(a,t);if(c)return c;let l=[];if(n){let e=Math.ceil(s.length/n);for(let t=0;t<n;t++)l.push(s.slice(t*e,(t+1)*e))}else if(r)for(let e=0;e<s.length;e+=r)l.push(s.slice(e,e+r));let u=l.filter(e=>e.length>0),d=a[0]?.replace(/\.csv$/,``)||`part`;try{let e=t.fs.resolvePath(t.cwd,i);for(let n=0;n<u.length;n++){let r=`${d}_${String(n+1).padStart(3,`0`)}.csv`,i=t.fs.resolvePath(e,r);await t.fs.writeFile(i,h(o,u[n]))}return{stdout:`Split into ${u.length} parts
|
|
19
|
+
`,stderr:``,exitCode:0}}catch{return{stdout:`${u.map((e,t)=>`Part ${t+1}: ${e.length} rows`).join(`
|
|
20
|
+
`)}
|
|
21
|
+
`,stderr:``,exitCode:0}}}function X(e){return e.replace(/[^a-zA-Z0-9_-]/g,`_`)||`empty`}function pe(e){let t=2166136261;for(let n=0;n<e.length;n++)t=(t^e.charCodeAt(n))*16777619>>>0;return t.toString(36).padStart(6,`0`).slice(0,6)}async function me(e,t){let n=``,r=`.`,i=[];for(let t=0;t<e.length;t++){let a=e[t];(a===`-o`||a===`--output`)&&t+1<e.length?r=e[++t]:a.startsWith(`-`)||(n?i.push(a):n=a)}if(!n)return{stdout:``,stderr:`xan partition: usage: xan partition COLUMN [FILE]
|
|
22
|
+
`,exitCode:1};let{headers:a,data:o,error:s}=await g(i,t);if(s)return s;if(!a.includes(n))return{stdout:``,stderr:`xan partition: column '${n}' not found
|
|
23
|
+
`,exitCode:1};let c=new Map;for(let e of o){let t=String(e[n]??``);c.has(t)||c.set(t,[]),c.get(t)?.push(e)}let l=new Map;for(let e of c.keys()){let t=X(e);l.set(t,(l.get(t)??0)+1)}let u=new Set,d=new Map;for(let e of c.keys()){let t=X(e),n=(l.get(t)??0)>1?`${t}_${pe(e)}`:t,r=`${n}.csv`,i=1;for(;u.has(r);)r=`${n}_${i}.csv`,i++;u.add(r),d.set(e,r)}try{let e=t.fs.resolvePath(t.cwd,r);for(let[n,r]of c){let i=d.get(n);if(!i)continue;let o=t.fs.resolvePath(e,i);await t.fs.writeFile(o,h(a,r))}return{stdout:`Partitioned into ${c.size} files by '${n}'
|
|
24
|
+
`,stderr:``,exitCode:0}}catch{return{stdout:`${Array.from(c.entries()).map(([e,t])=>`${e}: ${t.length} rows`).join(`
|
|
25
|
+
`)}
|
|
26
|
+
`,stderr:``,exitCode:0}}}async function he(e,t){if(e.length===0)return{stdout:``,stderr:`xan to: usage: xan to <format> [FILE]
|
|
27
|
+
`,exitCode:1};let n=e[0],r=e.slice(1);return n===`json`?ge(r,t):{stdout:``,stderr:`xan to: unsupported format '${n}'
|
|
28
|
+
`,exitCode:1}}async function ge(e,t){let{data:n,error:r}=await g(e.filter(e=>!e.startsWith(`-`)),t);return r||{stdout:`${JSON.stringify(n,null,2)}
|
|
29
|
+
`,stderr:``,exitCode:0}}async function _e(e,t){let n=``,r=[];for(let t=0;t<e.length;t++){let i=e[t];(i===`-f`||i===`--format`)&&t+1<e.length?n=e[++t]:i.startsWith(`-`)||r.push(i)}return n?n===`json`?ve(r,t):{stdout:``,stderr:`xan from: unsupported format '${n}'
|
|
30
|
+
`,exitCode:1}:{stdout:``,stderr:`xan from: usage: xan from -f <format> [FILE]
|
|
31
|
+
`,exitCode:1}}async function ve(e,t){let n=e[0],r;if(!n||n===`-`)r=t.stdin;else try{let e=t.fs.resolvePath(t.cwd,n);r=await t.fs.readFile(e)}catch{return{stdout:``,stderr:`xan from: ${n}: No such file or directory
|
|
32
|
+
`,exitCode:1}}try{let e=JSON.parse(r.trim());if(!Array.isArray(e))return{stdout:``,stderr:`xan from: JSON input must be an array
|
|
33
|
+
`,exitCode:1};if(e.length===0)return{stdout:`
|
|
34
|
+
`,stderr:``,exitCode:0};if(Array.isArray(e[0])){let[t,...n]=e;return{stdout:h(t,n.map(e=>{let n=v();for(let r=0;r<t.length;r++)_(n,t[r],e[r]);return n})),stderr:``,exitCode:0}}return{stdout:h(Object.keys(e[0]).sort(),e),stderr:``,exitCode:0}}catch{return{stdout:``,stderr:`xan from: invalid JSON input
|
|
35
|
+
`,exitCode:1}}}async function ye(e,t){let n=!1,r=0,i=``,o=[];for(let t=0;t<e.length;t++){let s=e[t];if(s===`-v`||s===`--invert`)n=!0;else if((s===`-l`||s===`--limit`)&&t+1<e.length)r=Number.parseInt(e[++t],10);else{if(s===`--help`)return a({name:`xan filter`,summary:`Filter rows by expression`,usage:`xan filter [OPTIONS] EXPR [FILE]`,description:`Filter CSV rows using moonblade expressions.`,options:[`-v, --invert invert match`,`-l, --limit N limit output to N rows`,` --help display help`]});s.startsWith(`-`)||(i?o.push(s):i=s)}}if(!i)return{stdout:``,stderr:`xan filter: no expression specified
|
|
36
|
+
`,exitCode:1};let{headers:s,data:c,error:l}=await g(o,t);if(l)return l;let u={limits:t.limits?{maxIterations:t.limits.maxJqIterations}:void 0},f=ae(i),p=[];for(let e of c){if(r>0&&p.length>=r)break;let t=d(e,f,u),i=t.length>0&&t.some(e=>!!e);(n?!i:i)&&p.push(e)}return{stdout:h(s,p),stderr:``,exitCode:0}}async function be(e,t){let n=``,r=!1,i=!1,a=[];for(let t=0;t<e.length;t++){let o=e[t];o===`-N`||o===`--numeric`?r=!0:o===`-R`||o===`-r`||o===`--reverse`?i=!0:o===`-s`&&t+1<e.length?n=e[++t]:o.startsWith(`-`)||a.push(o)}let{headers:o,data:s,error:c}=await g(a,t);return c||(!n&&o.length>0&&(n=o[0]),{stdout:h(o,[...s].sort((e,t)=>{let a=e[n],o=t[n],s;return s=r?(typeof a==`number`?a:Number.parseFloat(String(a)))-(typeof o==`number`?o:Number.parseFloat(String(o))):String(a).localeCompare(String(o)),i?-s:s})),stderr:``,exitCode:0})}async function xe(e,t){let n=``,r=[];for(let t=0;t<e.length;t++){let i=e[t];i===`-s`&&t+1<e.length?n=e[++t]:i.startsWith(`-`)||r.push(i)}let{headers:i,data:a,error:o}=await g(r,t);if(o)return o;let s=new Set;return{stdout:h(i,a.filter(e=>{let t=n?String(e[n]):JSON.stringify(e);return s.has(t)?!1:(s.add(t),!0)})),stderr:``,exitCode:0}}async function Se(e,t){let n=10,r=``,i=!1,a=[];for(let t=0;t<e.length;t++){let o=e[t];(o===`-l`||o===`-n`)&&t+1<e.length?n=Number.parseInt(e[++t],10):o===`-R`||o===`-r`||o===`--reverse`?i=!0:o.startsWith(`-`)||(r?a.push(o):r=o)}let{headers:o,data:s,error:c}=await g(a,t);return c||(!r&&o.length>0&&(r=o[0]),{stdout:h(o,[...s].sort((e,t)=>{let n=e[r],a=t[r],o=typeof n==`number`?n:Number.parseFloat(String(n)),s=typeof a==`number`?a:Number.parseFloat(String(a));return i?o-s:s-o}).slice(0,n)),stderr:``,exitCode:0})}D();async function Ce(e,t){let n=``,r=!1,i=!1,a=[];for(let t=0;t<e.length;t++){let o=e[t];o===`-O`||o===`--overwrite`?r=!0:o===`--filter`?i=!0:o.startsWith(`-`)||(n?a.push(o):n=o)}if(!n)return{stdout:``,stderr:`xan map: no expression specified
|
|
37
|
+
`,exitCode:1};let{headers:o,data:s,error:c}=await g(a,t);if(c)return c;let u=C(n).map(({expr:e,name:t})=>({alias:typeof t==`string`?t:t[0],ast:F(e)})),f={limits:t.limits?{maxIterations:t.limits.maxJqIterations}:void 0},p;if(r){p=[...o];for(let e of u)o.includes(e.alias)||p.push(e.alias)}else p=[...o,...u.map(e=>e.alias)];let m=[];for(let e=0;e<s.length;e++){let t=s[e],n=y(t),r=!1,a=Object.assign(l(t),{_row_index:e});for(let e of u){let t=d(a,e.ast,f),o=t.length>0?t[0]:null;if(i&&o==null){r=!0;break}_(n,e.alias,o)}r||m.push(n)}return{stdout:h(p,m),stderr:``,exitCode:0}}async function we(e,t){let n=``,r=``,a=``,o=[];for(let t=0;t<e.length;t++){let i=e[t];(i===`-r`||i===`--rename`)&&t+1<e.length?a=e[++t]:i.startsWith(`-`)||(n?r?o.push(i):r=i:n=i)}if(!n||!r)return{stdout:``,stderr:`xan transform: usage: xan transform COLUMN EXPR [FILE]
|
|
38
|
+
`,exitCode:1};let{headers:s,data:c,error:u}=await g(o,t);if(u)return u;let f=n.split(`,`).map(e=>e.trim()),p=a?a.split(`,`).map(e=>e.trim()):[];for(let e of f)if(!s.includes(e))return{stdout:``,stderr:`xan transform: column '${e}' not found
|
|
39
|
+
`,exitCode:1};let m=F(C(r)[0]?.expr||(D(),i(S)).parseMoonblade(r)),v={limits:t.limits?{maxIterations:t.limits.maxJqIterations}:void 0},b=s.map(e=>{let t=f.indexOf(e);return t!==-1&&p[t]?p[t]:e}),x=[];for(let e of c){let t=y(e);for(let n=0;n<f.length;n++){let r=f[n],i=d(Object.assign(l(e),{_:e[r]}),m,v),a=i.length>0?i[0]:null,o=p[n]||r;o!==r&&delete t[r],_(t,o,a)}x.push(t)}return{stdout:h(b,x),stderr:``,exitCode:0}}async function Te(e,t){let n=``,r=`|`,i=!1,a=``,o=[];for(let t=0;t<e.length;t++){let s=e[t];(s===`-s`||s===`--separator`)&&t+1<e.length?r=e[++t]:s===`--drop-empty`?i=!0:(s===`-r`||s===`--rename`)&&t+1<e.length?a=e[++t]:s.startsWith(`-`)||(n?o.push(s):n=s)}if(!n)return{stdout:``,stderr:`xan explode: usage: xan explode COLUMN [FILE]
|
|
40
|
+
`,exitCode:1};let{headers:s,data:c,error:l}=await g(o,t);if(l)return l;if(!s.includes(n))return{stdout:``,stderr:`xan explode: column '${n}' not found
|
|
41
|
+
`,exitCode:1};let u=a?s.map(e=>e===n?a:e):s,d=a||n,f=[];for(let e of c){let t=e[n],o=t==null?``:String(t);if(o===``){if(!i){let t=y(e);a&&(delete t[n],_(t,d,``)),f.push(t)}}else{let t=o.split(r);for(let r of t){let t=y(e);a&&delete t[n],_(t,d,r),f.push(t)}}}return{stdout:h(u,f),stderr:``,exitCode:0}}async function Ee(e,t){let n=``,r=`|`,i=``,a=[];for(let t=0;t<e.length;t++){let o=e[t];(o===`-s`||o===`--sep`)&&t+1<e.length?r=e[++t]:(o===`-r`||o===`--rename`)&&t+1<e.length?i=e[++t]:o.startsWith(`-`)||(n?a.push(o):n=o)}if(!n)return{stdout:``,stderr:`xan implode: usage: xan implode COLUMN [FILE]
|
|
42
|
+
`,exitCode:1};let{headers:o,data:s,error:c}=await g(a,t);if(c)return c;if(!o.includes(n))return{stdout:``,stderr:`xan implode: column '${n}' not found
|
|
43
|
+
`,exitCode:1};let l=o.filter(e=>e!==n),u=i?o.map(e=>e===n?i:e):o,d=i||n,f=[],p=null,m=[],v=null;for(let e of s){let t=l.map(t=>String(e[t]??``)).join(`\0`),a=e[n],o=a==null?``:String(a);if(t!==p){if(v!==null){let e=y(v);i&&delete e[n],_(e,d,m.join(r)),f.push(e)}p=t,m=[o],v=e}else m.push(o)}if(v!==null){let e=y(v);i&&delete e[n],_(e,d,m.join(r)),f.push(e)}return{stdout:h(u,f),stderr:``,exitCode:0}}async function De(e,t){let n=``,r=``,i=``,a=``,o=`inner`,s=``,c=0;for(let t=0;t<e.length;t++){let l=e[t];l===`--left`?o=`left`:l===`--right`?o=`right`:l===`--full`?o=`full`:(l===`-D`||l===`--default`)&&t+1<e.length?s=e[++t]:l.startsWith(`-`)||(c++,c===1?n=l:c===2?r=l:c===3?i=l:c===4&&(a=l))}if(!n||!r||!i||!a)return{stdout:``,stderr:`xan join: usage: xan join KEY1 FILE1 KEY2 FILE2 [OPTIONS]
|
|
44
|
+
`,exitCode:1};let l=await g([r],t);if(l.error)return l.error;let u=await g([a],t);if(u.error)return u.error;let{headers:d,data:f}=l,{headers:p,data:m}=u;if(!d.includes(n))return{stdout:``,stderr:`xan join: column '${n}' not found in first file
|
|
45
|
+
`,exitCode:1};if(!p.includes(i))return{stdout:``,stderr:`xan join: column '${i}' not found in second file
|
|
46
|
+
`,exitCode:1};let y=new Map;for(let e of m){let t=String(e[i]??``);y.has(t)||y.set(t,[]),y.get(t)?.push(e)}let b=new Set(d),x=p.filter(e=>!b.has(e)),S=[...d,...x],C=[],w=new Set;for(let e of f){let t=String(e[n]??``),r=y.get(t);if(r&&r.length>0){w.add(t);for(let t of r){let n=v();for(let t of d)_(n,t,e[t]);for(let e of x)_(n,e,t[e]);C.push(n)}}else if(o===`left`||o===`full`){let t=v();for(let n of d)_(t,n,e[n]);for(let e of x)_(t,e,s);C.push(t)}}if(o===`right`||o===`full`)for(let e of m){let t=String(e[i]??``);if(!w.has(t)){let t=v();for(let n of d)_(t,n,p.includes(n)?e[n]:s);for(let n of x)_(t,n,e[n]);C.push(t)}}return{stdout:h(S,C),stderr:``,exitCode:0}}async function Oe(e,t){let n=``,r=``,i=[],a=[];for(let t=0;t<e.length;t++){let o=e[t];(o===`-g`||o===`--groupby`)&&t+1<e.length?i=e[++t].split(`,`).map(e=>e.trim()):o.startsWith(`-`)||(n?r?a.push(o):r=o:n=o)}if(!n||!r)return{stdout:``,stderr:`xan pivot: usage: xan pivot COLUMN AGG_EXPR [OPTIONS] [FILE]
|
|
47
|
+
`,exitCode:1};let{headers:o,data:s,error:c}=await g(a,t);if(c)return c;if(!o.includes(n))return{stdout:``,stderr:`xan pivot: column '${n}' not found
|
|
48
|
+
`,exitCode:1};let l=r.match(/^(\w+)\((\w+)\)$/);if(!l)return{stdout:``,stderr:`xan pivot: invalid aggregation expression '${r}'
|
|
49
|
+
`,exitCode:1};let[,u,d]=l;i.length===0&&(i=o.filter(e=>e!==n&&e!==d));let f=[];for(let e of s){let t=String(e[n]??``);f.includes(t)||f.push(t)}let p=new Map,m=[];for(let e of s){let t=i.map(t=>String(e[t]??``)).join(`\0`),r=String(e[n]??``),a=e[d];p.has(t)||(p.set(t,new Map),m.push(t));let o=p.get(t);o&&(o.has(r)||o.set(r,[]),o.get(r)?.push(a))}let y=[...i,...f],b=[];for(let e of m){let t=e.split(`\0`),n=p.get(e);if(!n)continue;let r=v();for(let e=0;e<i.length;e++)_(r,i[e],t[e]);for(let e of f)_(r,e,ke(u,n.get(e)||[]));b.push(r)}return{stdout:h(y,b),stderr:``,exitCode:0}}function ke(e,t){let n=t.filter(e=>e!=null).map(e=>typeof e==`number`?e:Number.parseFloat(String(e))).filter(e=>!Number.isNaN(e));switch(e){case`count`:return t.length;case`sum`:return n.reduce((e,t)=>e+t,0);case`mean`:case`avg`:return n.length>0?n.reduce((e,t)=>e+t,0)/n.length:null;case`min`:return n.length>0?Math.min(...n):null;case`max`:return n.length>0?Math.max(...n):null;case`first`:return t.length>0?String(t[0]??``):null;case`last`:return t.length>0?String(t[t.length-1]??``):null;default:return null}}async function Z(e,t){let n=``,r=[];for(let t=0;t<e.length;t++){let i=e[t];(i===`-s`||i===`--sort`)&&t+1<e.length?n=e[++t]:i.startsWith(`-`)||r.push(i)}if(r.length<2)return{stdout:``,stderr:`xan merge: usage: xan merge [OPTIONS] FILE1 FILE2 ...
|
|
50
|
+
`,exitCode:1};let i=[],a=null;for(let e of r){let n=await g([e],t);if(n.error)return n.error;if(a===null)a=n.headers;else if(JSON.stringify(a)!==JSON.stringify(n.headers))return{stdout:``,stderr:`xan merge: all files must have the same headers
|
|
51
|
+
`,exitCode:1};i.push({headers:n.headers,data:n.data})}if(!a)return{stdout:``,stderr:``,exitCode:0};let o=[];for(let{data:e}of i)o=o.concat(e);if(n){if(!a.includes(n))return{stdout:``,stderr:`xan merge: column '${n}' not found
|
|
52
|
+
`,exitCode:1};o.sort((e,t)=>{let r=e[n],i=t[n],a=typeof r==`number`?r:Number.parseFloat(String(r)),o=typeof i==`number`?i:Number.parseFloat(String(i));return!Number.isNaN(a)&&!Number.isNaN(o)?a-o:String(r??``).localeCompare(String(i??``))})}return{stdout:h(a,o),stderr:``,exitCode:0}}D();async function Ae(e,t){let{headers:n,data:r,error:i}=await g(e.filter(e=>!e.startsWith(`-`)),t);return i||(r.length===0?{stdout:``,stderr:``,exitCode:0}:{stdout:r.map(e=>n.map(t=>e[t])).map(e=>e.map(e=>je(e)).join(`,`)).join(`
|
|
53
|
+
`)+`
|
|
54
|
+
`,stderr:``,exitCode:0})}function je(e){if(e==null)return``;let t=String(e);return t.includes(`,`)||t.includes(`"`)||t.includes(`
|
|
55
|
+
`)?`"${t.replace(/"/g,`""`)}"`:t}async function Me(e,t){let n=null,r=null,i=[];for(let t=0;t<e.length;t++){let a=e[t];if(a===`--seed`&&t+1<e.length)r=Number.parseInt(e[++t],10);else if(!a.startsWith(`-`)){let e=Number.parseInt(a,10);n===null&&!Number.isNaN(e)&&e>0?n=e:i.push(a)}}if(n===null)return{stdout:``,stderr:`xan sample: usage: xan sample <sample-size> [FILE]
|
|
56
|
+
`,exitCode:1};let{headers:a,data:o,error:s}=await g(i,t);if(s)return s;if(o.length<=n)return{stdout:h(a,o),stderr:``,exitCode:0};let c=r===null?Date.now():r,l=()=>(c=c*1103515245+12345&2147483647,c/2147483647),u=o.map((e,t)=>t);for(let e=u.length-1;e>0;e--){let t=Math.floor(l()*(e+1));[u[e],u[t]]=[u[t],u[e]]}return{stdout:h(a,u.slice(0,n).sort((e,t)=>e-t).map(e=>o[e])),stderr:``,exitCode:0}}async function Ne(e,t){let n=!1,r=[];for(let t=0;t<e.length;t++){let i=e[t];i===`-p`||i===`--pad`?n=!0:i.startsWith(`-`)||r.push(i)}if(r.length===0)return{stdout:``,stderr:`xan cat: no files specified
|
|
57
|
+
`,exitCode:1};let i=await s(t,r,{cmdName:`xan cat`,stopOnError:!0});if(i.exitCode!==0)return{stdout:``,stderr:i.stderr,exitCode:i.exitCode};let a=[],o=[];for(let{content:e}of i.files){let{headers:t,data:n}=f(e);a.push({headers:t,data:n});for(let e of t)o.includes(e)||o.push(e)}if(!n){let e=JSON.stringify(a[0].headers);for(let t=1;t<a.length;t++)if(JSON.stringify(a[t].headers)!==e)return{stdout:``,stderr:`xan cat: headers do not match (use -p to pad)
|
|
58
|
+
`,exitCode:1};o=a[0].headers}let c=[];for(let{headers:e,data:t}of a)for(let n of t){let t=v();for(let r of o)_(t,r,e.includes(r)?n[r]:``);c.push(t)}return{stdout:h(o,c),stderr:``,exitCode:0}}async function Pe(t,n){let r=``,i=[],a=!1,o=!1,s=[];for(let e=0;e<t.length;e++){let n=t[e];(n===`-s`||n===`--select`)&&e+1<t.length?i=t[++e].split(`,`):n===`-v`||n===`--invert`?a=!0:n===`-i`||n===`--ignore-case`?o=!0:n===`-r`||n===`--regex`||n.startsWith(`-`)||(r?s.push(n):r=n)}if(!r)return{stdout:``,stderr:`xan search: no pattern specified
|
|
59
|
+
`,exitCode:1};let{headers:c,data:l,error:u}=await g(s,n);if(u)return u;let d=i.length>0?i:c,f;try{f=e(r,o?`i`:``)}catch{return{stdout:``,stderr:`xan search: invalid regex pattern '${r}'
|
|
60
|
+
`,exitCode:1}}return{stdout:h(c,l.filter(e=>{let t=d.some(t=>{let n=e[t];return n!=null&&f.test(String(n))});return a?!t:t})),stderr:``,exitCode:0}}async function Fe(e,t){let n=``,r=[];for(let t of e)t.startsWith(`-`)||(n?r.push(t):n=t);if(!n)return{stdout:``,stderr:`xan flatmap: no expression specified
|
|
61
|
+
`,exitCode:1};let{headers:i,data:a,error:o}=await g(r,t);if(o)return o;let s=C(n).map(({expr:e,name:t})=>({alias:typeof t==`string`?t:t[0],ast:F(e)})),c={limits:t.limits?{maxIterations:t.limits.maxJqIterations}:void 0},l=[...i,...s.map(e=>e.alias)],u=[];for(let e of a){let t=[],n=1;for(let r of s){let i=d(e,r.ast,c),a=i.length>0&&Array.isArray(i[0])?i[0]:i;t.push(a),n=Math.max(n,a.length)}for(let r=0;r<n;r++){let n=y(e);for(let e=0;e<s.length;e++){let i=t[e][r]??null;_(n,s[e].alias,i)}u.push(n)}}return{stdout:h(l,u),stderr:``,exitCode:0}}async function Ie(e,t){let{cmdView:n}=await import(`./xan-view-OW2TB7Z3-BhVOL6hm.mjs`);return n(e,t)}var Q=new Set([`fuzzy-join`,`glob`,`hist`,`input`,`parallel`,`plot`,`progress`,`range`,`scrape`,`tokenize`,`union-find`]),Le=new Set([`agg`,`behead`,`cat`,`count`,`dedup`,`drop`,`enum`,`explode`,`f`,`filter`,`fixlengths`,`flatmap`,`flatten`,`fmt`,`frequency`,`freq`,`from`,`groupby`,`head`,`headers`,`implode`,`join`,`map`,`merge`,`partition`,`pivot`,`rename`,`reverse`,`sample`,`search`,`select`,`shuffle`,`slice`,`sort`,`split`,`stats`,`tail`,`to`,`top`,`transform`,`transpose`,`view`,...Q]),$={name:`xan`,summary:`CSV toolkit for data manipulation`,usage:`xan <COMMAND> [OPTIONS] [FILE]`,description:`xan is a collection of commands for working with CSV data.
|
|
62
|
+
It provides a simple, ergonomic interface for common data operations.
|
|
63
|
+
|
|
64
|
+
COMMANDS:
|
|
65
|
+
Core:
|
|
66
|
+
headers Show column names
|
|
67
|
+
count Count rows
|
|
68
|
+
head Show first N rows
|
|
69
|
+
tail Show last N rows
|
|
70
|
+
slice Extract row range
|
|
71
|
+
reverse Reverse row order
|
|
72
|
+
behead Remove header row
|
|
73
|
+
sample Random sample of rows
|
|
74
|
+
|
|
75
|
+
Column operations:
|
|
76
|
+
select Select columns (supports glob, ranges, negation)
|
|
77
|
+
drop Drop columns
|
|
78
|
+
rename Rename columns
|
|
79
|
+
enum Add row index column
|
|
80
|
+
|
|
81
|
+
Row operations:
|
|
82
|
+
filter Filter rows by expression
|
|
83
|
+
search Filter rows by regex match
|
|
84
|
+
sort Sort rows
|
|
85
|
+
dedup Remove duplicates
|
|
86
|
+
top Get top N by column
|
|
87
|
+
|
|
88
|
+
Transformations:
|
|
89
|
+
map Add computed columns
|
|
90
|
+
transform Modify existing columns
|
|
91
|
+
explode Split column into multiple rows
|
|
92
|
+
implode Combine rows, join column values
|
|
93
|
+
flatmap Map returning multiple rows
|
|
94
|
+
pivot Reshape rows into columns
|
|
95
|
+
transpose Swap rows and columns
|
|
96
|
+
|
|
97
|
+
Aggregation:
|
|
98
|
+
agg Aggregate values
|
|
99
|
+
groupby Group and aggregate
|
|
100
|
+
frequency Count value occurrences
|
|
101
|
+
stats Show column statistics
|
|
102
|
+
|
|
103
|
+
Multi-file:
|
|
104
|
+
cat Concatenate CSV files
|
|
105
|
+
join Join two CSV files on key
|
|
106
|
+
merge Merge sorted CSV files
|
|
107
|
+
split Split into multiple files
|
|
108
|
+
partition Split by column value
|
|
109
|
+
|
|
110
|
+
Data conversion:
|
|
111
|
+
to Convert CSV to other formats (json)
|
|
112
|
+
from Convert other formats to CSV (json)
|
|
113
|
+
shuffle Randomly reorder rows
|
|
114
|
+
fixlengths Fix ragged CSV files
|
|
115
|
+
|
|
116
|
+
Output:
|
|
117
|
+
view Pretty print as table
|
|
118
|
+
flatten Display records vertically (alias: f)
|
|
119
|
+
fmt Format output
|
|
120
|
+
|
|
121
|
+
EXAMPLES:
|
|
122
|
+
xan headers data.csv
|
|
123
|
+
xan count data.csv
|
|
124
|
+
xan head -n 5 data.csv
|
|
125
|
+
xan select name,email data.csv
|
|
126
|
+
xan select 'vec_*' data.csv # glob pattern
|
|
127
|
+
xan select 'a:c' data.csv # column range
|
|
128
|
+
xan filter 'age > 30' data.csv
|
|
129
|
+
xan search -r '^foo' data.csv
|
|
130
|
+
xan sort -N price data.csv
|
|
131
|
+
xan agg 'sum(amount) as total' data.csv
|
|
132
|
+
xan groupby region 'count() as n' data.csv
|
|
133
|
+
xan explode tags data.csv
|
|
134
|
+
xan join id file1.csv id file2.csv
|
|
135
|
+
xan pivot year 'sum(sales)' data.csv`,options:[` --help display this help and exit`]},Re={headers:{name:`xan headers`,summary:`Show column names`,usage:`xan headers [OPTIONS] [FILE]`,description:`Display column names from a CSV file.`,options:[`-j, --just-names show names only (no index)`]},count:{name:`xan count`,summary:`Count rows`,usage:`xan count [FILE]`,description:`Count the number of data rows (excluding header).`,options:[]},filter:{name:`xan filter`,summary:`Filter rows by expression`,usage:`xan filter [OPTIONS] EXPR [FILE]`,description:`Filter CSV rows using moonblade expressions.`,options:[`-v, --invert invert match`,`-l, --limit N limit output rows`]},search:{name:`xan search`,summary:`Filter rows by regex`,usage:`xan search [OPTIONS] PATTERN [FILE]`,description:`Filter CSV rows by regex match on columns.`,options:[`-s, --select COLS search only these columns`,`-v, --invert invert match`,`-i, --ignore-case case insensitive`]},select:{name:`xan select`,summary:`Select columns`,usage:`xan select COLS [FILE]`,description:`Select columns by name, index, glob, or range.`,options:[`Supports: col names, indices (0,1), ranges (a:c), globs (vec_*), negation (!col)`]},explode:{name:`xan explode`,summary:`Split column into rows`,usage:`xan explode COLUMN [OPTIONS] [FILE]`,description:`Split delimited column values into multiple rows.`,options:[`-s, --separator SEP separator (default: |)`,`--drop-empty drop empty values`,`-r, --rename NAME rename column`]},implode:{name:`xan implode`,summary:`Combine rows`,usage:`xan implode COLUMN [OPTIONS] [FILE]`,description:`Combine consecutive rows, joining column values.`,options:[`-s, --sep SEP separator (default: |)`,`-r, --rename NAME rename column`]},join:{name:`xan join`,summary:`Join CSV files`,usage:`xan join KEY1 FILE1 KEY2 FILE2 [OPTIONS]`,description:`Join two CSV files on key columns.`,options:[`--left left outer join`,`--right right outer join`,`--full full outer join`,`-D, --default VAL default for missing`]},pivot:{name:`xan pivot`,summary:`Reshape to columns`,usage:`xan pivot COLUMN AGG_EXPR [OPTIONS] [FILE]`,description:`Turn row values into columns.`,options:[`-g, --groupby COLS group by columns`]}},ze={name:`xan`,async execute(e,t){if(e.length===0||o(e))return a($);let n=e[0],r=e.slice(1);if(o(r)){let e=Re[n];return a(e||$)}if(Q.has(n))return{stdout:``,stderr:`xan ${n}: not yet implemented
|
|
136
|
+
`,exitCode:1};switch(n){case`headers`:return K(r,t);case`count`:return q(r,t);case`head`:return J(r,t);case`tail`:return oe(r,t);case`slice`:return se(r,t);case`reverse`:return ce(r,t);case`behead`:return Ae(r,t);case`sample`:return Me(r,t);case`select`:return H(r,t);case`drop`:return U(r,t);case`rename`:return W(r,t);case`enum`:return G(r,t);case`filter`:return ye(r,t);case`search`:return Pe(r,t);case`sort`:return be(r,t);case`dedup`:return xe(r,t);case`top`:return Se(r,t);case`map`:return Ce(r,t);case`transform`:return we(r,t);case`explode`:return Te(r,t);case`implode`:return Ee(r,t);case`flatmap`:return Fe(r,t);case`pivot`:return Oe(r,t);case`agg`:return te(r,t);case`groupby`:return ne(r,t);case`frequency`:case`freq`:return re(r,t);case`stats`:return ie(r,t);case`cat`:return Ne(r,t);case`join`:return De(r,t);case`merge`:return Z(r,t);case`split`:return fe(r,t);case`partition`:return me(r,t);case`to`:return he(r,t);case`from`:return _e(r,t);case`transpose`:return le(r,t);case`shuffle`:return ue(r,t);case`fixlengths`:return de(r,t);case`view`:return p(r,t);case`flatten`:case`f`:return m(r,t);case`fmt`:return Ie(r,t);default:return Le.has(n)?{stdout:``,stderr:`xan ${n}: not yet implemented
|
|
137
|
+
`,exitCode:1}:{stdout:``,stderr:`xan: unknown command '${n}'
|
|
138
|
+
Run 'xan --help' for usage.
|
|
139
|
+
`,exitCode:1}}}};export{ze as xanCommand};
|
|
140
|
+
//# sourceMappingURL=xan-UD7JYIL2-DQo9f-1a.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-DXB73IDG-BBwE27jK.mjs";import"./chunk-PXTK5WE2-e9kxtsgu.mjs";import{c as e}from"./chunk-DBKNVD4L-B3hX287s.mjs";export{e as cmdView};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-DXB73IDG-q-dGnwlc.mjs";import"./chunk-PXTK5WE2-DNbfUrIy.mjs";import{c as e}from"./chunk-DBKNVD4L-DNQP2COw.mjs";export{e as cmdView};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import"./chunk-DXB73IDG-BBwE27jK.mjs";import{t as e}from"./chunk-IPJHKYVM-3ANqAo3C.mjs";import{n as t,r as n,t as r}from"./chunk-74CEPOFO-BYrCYxKO.mjs";var i={name:`xargs`,summary:`build and execute command lines from standard input`,usage:`xargs [OPTION]... [COMMAND [INITIAL-ARGS]]`,options:[`-I REPLACE replace occurrences of REPLACE with input`,`-d DELIM use DELIM as input delimiter (e.g., -d '\\n' for newline)`,`-n NUM use at most NUM arguments per command line`,`-P NUM run at most NUM processes at a time`,`-0, --null items are separated by null, not whitespace`,`-t, --verbose print commands before executing`,`-r, --no-run-if-empty do not run command if input is empty`,` --help display this help and exit`]},a={name:`xargs`,async execute(a,o){if(r(a))return n(i);let s=null,c=null,l=null,u=null,d=!1,f=!1,p=0;for(let e=0;e<a.length;e++){let n=a[e];if(n===`-I`&&e+1<a.length)s=a[++e],p=e+1;else if(n===`-d`&&e+1<a.length)c=a[++e].replace(/\\n/g,`
|
|
2
|
+
`).replace(/\\t/g,` `).replace(/\\r/g,`\r`).replace(/\\0/g,`\0`).replace(/\\\\/g,`\\`),p=e+1;else if(n===`-n`&&e+1<a.length)l=parseInt(a[++e],10),p=e+1;else if(n===`-P`&&e+1<a.length)u=parseInt(a[++e],10),p=e+1;else if(n===`-0`||n===`--null`)d=!0,p=e+1;else if(n===`-t`||n===`--verbose`)f=!0,p=e+1;else if(n===`-r`||n===`--no-run-if-empty`)p=e+1;else{if(n.startsWith(`--`))return t(`xargs`,n);if(n.startsWith(`-`)&&n.length>1){for(let e of n.slice(1))if(!`0tr`.includes(e))return t(`xargs`,`-${e}`);n.includes(`0`)&&(d=!0),n.includes(`t`)&&(f=!0),n.includes(`r`),p=e+1}else if(!n.startsWith(`-`)){p=e;break}}}let m=a.slice(p);m.length===0&&m.push(`echo`);let h;if(h=d?o.stdin.split(`\0`).filter(e=>e.length>0):c===null?o.stdin.split(/\s+/).map(e=>e.trim()).filter(e=>e.length>0):o.stdin.replace(/\n$/,``).split(c).filter(e=>e.length>0),h.length===0)return{stdout:``,stderr:``,exitCode:0};let g=``,_=``,v=0,y=e=>/[\s"'\\$`!*?[\]{}();&|<>#]/.test(e)?`"${e.replace(/([\\"`$])/g,`\\$1`)}"`:e,b=async t=>{if(f){let e=t.map(y).join(` `);_+=`${e}
|
|
3
|
+
`}return o.exec?o.exec(e([t[0]]),{cwd:o.cwd,signal:o.signal,args:t.slice(1)}):{stdout:`${t.map(y).join(` `)}
|
|
4
|
+
`,stderr:``,exitCode:0}},x=async e=>{if(u!==null&&u>1)for(let t=0;t<e.length;t+=u){let n=e.slice(t,t+u),r=await Promise.all(n.map(b));for(let e of r)g+=e.stdout,_+=e.stderr,e.exitCode!==0&&(v=e.exitCode)}else for(let t of e){let e=await b(t);g+=e.stdout,_+=e.stderr,e.exitCode!==0&&(v=e.exitCode)}};if(s!==null)await x(h.map(e=>m.map(t=>t.replaceAll(s,e))));else if(l!==null){let e=[];for(let t=0;t<h.length;t+=l){let n=h.slice(t,t+l);e.push([...m,...n])}await x(e)}else{let e=await b([...m,...h]);g+=e.stdout,_+=e.stderr,v=e.exitCode}return{stdout:g,stderr:_,exitCode:v}}};export{a as xargsCommand};
|
|
5
|
+
//# sourceMappingURL=xargs-I6EZUCYF-C_ZtmUCd.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-DXB73IDG-q-dGnwlc.mjs";import{n as e}from"./chunk-TOMNU26N-BFsBBT9j.mjs";export{e as xargsCommand};
|