@inkeep/open-knowledge 0.8.0-beta.8 → 0.8.0-beta.9
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/alias-JE7RI5QX-CjsckksZ.mjs +1 -0
- package/dist/assets/skills/discovery/SKILL.md +1 -1
- package/dist/assets/skills/project/SKILL.md +1 -1
- package/dist/awk2-POPGKRAI-DeuggFRh.mjs +1 -0
- package/dist/{banner-ewegHsSq.mjs → banner-BEKwr_uU.mjs} +2 -2
- package/dist/base64-4YMZCVJ5-Cj7j5Pz8.mjs +1 -0
- package/dist/basename-AA2KJYZQ-DSRxx5mc.mjs +1 -0
- package/dist/bash-IJWYRKFO-DFBZjU3V.mjs +1 -0
- package/dist/build-GAD37AZK.mjs +1 -0
- package/dist/{build-BZeImWox.mjs → build-fAc55Z_L.mjs} +1 -1
- package/dist/cat-RDUMLXKC-CI2IrKwx.mjs +1 -0
- package/dist/chmod-SYMGL4JA-D31pO-B4.mjs +1 -0
- package/dist/{chokidar-DkLjLiwY.mjs → chokidar-CblsKfnx.mjs} +1 -1
- package/dist/{chunk-24IMIIXA-B6yIPkk2.mjs → chunk-24IMIIXA-_PX4ITYZ.mjs} +2 -2
- package/dist/{chunk-3THT3N7L-DztAF386.mjs → chunk-3THT3N7L-DrzOuTpA.mjs} +1 -1
- package/dist/{chunk-3ZUFRYJ4-DJGI-ol3.mjs → chunk-3ZUFRYJ4-C93H8j0V.mjs} +1 -1
- package/dist/{chunk-44UOCSGV-CaFxJDHm.mjs → chunk-44UOCSGV-BbZqjKvt.mjs} +1 -1
- package/dist/{chunk-4GTNDTRF-DLfmDsTz.mjs → chunk-4GTNDTRF-_OVmXcJ-.mjs} +2 -2
- package/dist/{chunk-4HHKTUW3-Do18aeKJ.mjs → chunk-4HHKTUW3-Dm69hDaZ.mjs} +1 -1
- package/dist/{chunk-4Q4SM6WR-BC5DMmtl.mjs → chunk-4Q4SM6WR-DDQRsilN.mjs} +2 -2
- package/dist/{chunk-55VFSPNA-BkiwXNts.mjs → chunk-55VFSPNA-DVZfQAzN.mjs} +2 -2
- package/dist/{chunk-5QMZ5MUS-CAp625aG.mjs → chunk-5QMZ5MUS-SLhNX8t9.mjs} +2 -2
- package/dist/{chunk-5QVNJEHU-DxXSmS6b.mjs → chunk-5QVNJEHU-BvsipSFW.mjs} +2 -2
- package/dist/{chunk-5V6VZH6T-CxAvX_p_.mjs → chunk-5V6VZH6T-BCr5_GDF.mjs} +2 -2
- package/dist/{chunk-62RKD26F-DFxm_wsk.mjs → chunk-62RKD26F-Xy18vjr1.mjs} +2 -2
- package/dist/{chunk-64BAICW3-CbWqy6AU.mjs → chunk-64BAICW3-CTJNEx4Q.mjs} +2 -2
- package/dist/{chunk-74CEPOFO-Ce6zfZno.mjs → chunk-74CEPOFO-D1bzz49u.mjs} +1 -1
- package/dist/{chunk-7L36YK2X-B9iPLZYF.mjs → chunk-7L36YK2X-RiPZFKaV.mjs} +1 -1
- package/dist/{chunk-7TSDKFEO-Clyycgm6.mjs → chunk-7TSDKFEO-a-GUGBTu.mjs} +1 -1
- package/dist/{chunk-A4HU7SVR-KpVaWQZk.mjs → chunk-A4HU7SVR-hefV_YmW.mjs} +1 -1
- package/dist/{chunk-A4JSPFCI-DZdE_RBM.mjs → chunk-A4JSPFCI-D3-Pg2lq.mjs} +2 -2
- package/dist/{chunk-A5O5YHGN-DvJz5Cpw.mjs → chunk-A5O5YHGN-DQP-O5US.mjs} +2 -2
- package/dist/{chunk-A65PWWJC-BSl75Gzh.mjs → chunk-A65PWWJC-D7J5l9eq.mjs} +2 -2
- package/dist/{chunk-A7A2DBEE-CI4JCXh0.mjs → chunk-A7A2DBEE-PLfkXLI4.mjs} +1 -1
- package/dist/{chunk-A7ICOL4V-BzesEh8O.mjs → chunk-A7ICOL4V-Drb3XsEL.mjs} +2 -2
- package/dist/{chunk-ALLTKNUZ-DryLwDJN.mjs → chunk-ALLTKNUZ-BMiTDN50.mjs} +2 -2
- package/dist/{chunk-APT7OOP2-ghqP5RjQ.mjs → chunk-APT7OOP2-CXHnSuct.mjs} +2 -2
- package/dist/{chunk-BBXLRYSX-CBa2upXR.mjs → chunk-BBXLRYSX-Cxoye6wj.mjs} +2 -2
- package/dist/{chunk-BRGMQKJV-BFUsD38L.mjs → chunk-BRGMQKJV-Dr9Z7G7y.mjs} +3 -3
- package/dist/{chunk-CR5AFCPT-CaGcSJNH.mjs → chunk-CR5AFCPT-BBd9E4Jo.mjs} +2 -2
- package/dist/{chunk-CWQS3NFK-Co4ALolT.mjs → chunk-CWQS3NFK-BQ5SUtd7.mjs} +1 -1
- package/dist/{chunk-D4J545R4-39tfGEas.mjs → chunk-D4J545R4-C8nMOauR.mjs} +2 -2
- package/dist/{chunk-D6CWQ5DW-B0H0ZE0g.mjs → chunk-D6CWQ5DW-BudNEuOo.mjs} +2 -2
- package/dist/{chunk-D7MEQ3VN-DjGAq771.mjs → chunk-D7MEQ3VN-Csvth_Ss.mjs} +2 -2
- package/dist/{chunk-DCAAORBQ-2hAkTSsi.mjs → chunk-DCAAORBQ-BdrR5ttw.mjs} +2 -2
- package/dist/{chunk-DXB73IDG-DIKSLkPq.mjs → chunk-DXB73IDG-DfmyzFzL.mjs} +1 -1
- package/dist/{chunk-EEXR5ZDP-CqRIzSRf.mjs → chunk-EEXR5ZDP-C5AJH114.mjs} +1 -1
- package/dist/{chunk-EIZGF4BS-BNKZIY4Y.mjs → chunk-EIZGF4BS-8bsVXqW0.mjs} +2 -2
- package/dist/{chunk-F23WWYKW-C6mQ92-8.mjs → chunk-F23WWYKW-DST0dB7V.mjs} +2 -2
- package/dist/{chunk-F55TLFGB-Ch4EQu4J.mjs → chunk-F55TLFGB-CezmwFJN.mjs} +2 -2
- package/dist/{chunk-FEIOJCZD-C25Und0M.mjs → chunk-FEIOJCZD-Vm1q1kLH.mjs} +2 -2
- package/dist/{chunk-GCTKCWKD-BrH2kwP5.mjs → chunk-GCTKCWKD-Deqi1D_N.mjs} +1 -1
- package/dist/{chunk-GFQRA5P5-DnjwTqP3.mjs → chunk-GFQRA5P5-CkMj9l7f.mjs} +1 -1
- package/dist/{chunk-GOV5EKKI-Cjp7e-4Y.mjs → chunk-GOV5EKKI-DNFJiYJI.mjs} +2 -2
- package/dist/{chunk-GXVXFKBA-DfpAAE3t.mjs → chunk-GXVXFKBA-993FoPmq.mjs} +2 -2
- package/dist/{chunk-HDQ56CKY-oo03cv9O.mjs → chunk-HDQ56CKY-pGV4pOJA.mjs} +2 -2
- package/dist/{chunk-HJQJAYMS-BX2ngisD.mjs → chunk-HJQJAYMS-Ci3vsKQW.mjs} +1 -1
- package/dist/{chunk-HJWBQKYG-B2veqSYo.mjs → chunk-HJWBQKYG-UZig4wUt.mjs} +2 -2
- package/dist/{chunk-HWBSOZZR-BK04cmy7.mjs → chunk-HWBSOZZR-CFFhOzgy.mjs} +2 -2
- package/dist/{chunk-HWKDQ44K-D-Y0sZAA.mjs → chunk-HWKDQ44K-CPSjqtR_.mjs} +2 -2
- package/dist/{chunk-I57KEIP3-BPQZMhwo.mjs → chunk-I57KEIP3-C9JW7Nfp.mjs} +2 -2
- package/dist/{chunk-IPJHKYVM-C3IodQq7.mjs → chunk-IPJHKYVM-orb6vjJ1.mjs} +1 -1
- package/dist/{chunk-J642UCRS-DXUFHVvX.mjs → chunk-J642UCRS-D2hPh3Cf.mjs} +2 -2
- package/dist/{chunk-JVPRLUMK-CLwH0uCX.mjs → chunk-JVPRLUMK-DnQCNjpq.mjs} +2 -2
- package/dist/{chunk-KMEYNNUA-DGQRus36.mjs → chunk-KMEYNNUA-DfdK88O_.mjs} +2 -2
- package/dist/{chunk-LL3S3NLB-DQF3ekov.mjs → chunk-LL3S3NLB-DxXgE3kY.mjs} +2 -2
- package/dist/{chunk-LPQPILI2-unxmYj-H.mjs → chunk-LPQPILI2-8E8WwnE3.mjs} +2 -2
- package/dist/{chunk-LTZRCH7N-Bj3GMNey.mjs → chunk-LTZRCH7N-GAjTFNwG.mjs} +2 -2
- package/dist/{chunk-LWEGUNWT-DmdrV1En.mjs → chunk-LWEGUNWT-BALY4RLC.mjs} +2 -2
- package/dist/{chunk-MDDMCKUK-DM-9Iq67.mjs → chunk-MDDMCKUK-DD6paciv.mjs} +2 -2
- package/dist/{chunk-MDLLFABN-iT7NLOSj.mjs → chunk-MDLLFABN-oBQf6bGE.mjs} +2 -2
- package/dist/{chunk-MHTUABJP-CoXvnzFl.mjs → chunk-MHTUABJP-dKmK6Hw7.mjs} +1 -1
- package/dist/{chunk-MIZPJHVH-C_Ew6iFJ.mjs → chunk-MIZPJHVH-BPfxJ3C2.mjs} +2 -2
- package/dist/{chunk-MLXIYONF-D0cew-4g.mjs → chunk-MLXIYONF-CQ5Q9uTP.mjs} +2 -2
- package/dist/{chunk-MYE6AGBJ-Ba0ek4dq.mjs → chunk-MYE6AGBJ-B4pRo9ma.mjs} +2 -2
- package/dist/{chunk-NAERJDUW-BjY7nf_U.mjs → chunk-NAERJDUW-B3fduMx2.mjs} +2 -2
- package/dist/{chunk-NCNPKYJZ-BfpDmYta.mjs → chunk-NCNPKYJZ-BFGan4lR.mjs} +2 -2
- package/dist/{chunk-NUYSJFDK-CTmaNmMV.mjs → chunk-NUYSJFDK-BVw8oahq.mjs} +2 -2
- package/dist/{chunk-NYQYO467-De27bHHh.mjs → chunk-NYQYO467-nPa6J2DD.mjs} +2 -2
- package/dist/{chunk-OARHFVLG-B7qGh_d9.mjs → chunk-OARHFVLG-DGpNgI6K.mjs} +2 -2
- package/dist/{chunk-OCLXQMOG-JsUybhKc.mjs → chunk-OCLXQMOG-Bktk24jL.mjs} +2 -2
- package/dist/{chunk-OCS6LSEM-DxqjLuBg.mjs → chunk-OCS6LSEM-WwUGJ0am.mjs} +2 -2
- package/dist/{chunk-OJDRYQWQ-ikvLWpfV.mjs → chunk-OJDRYQWQ-D4lSWh0K.mjs} +1 -1
- package/dist/{chunk-OL3S66CO-5k30myjg.mjs → chunk-OL3S66CO-DtsweltN.mjs} +2 -2
- package/dist/{chunk-PBXLG62G-DjO83anU.mjs → chunk-PBXLG62G-Ci7A7XGA.mjs} +2 -2
- package/dist/{chunk-PP6PSHAB-BT5CrRx8.mjs → chunk-PP6PSHAB-DMC_XCfO.mjs} +1 -1
- package/dist/{chunk-PYSFUGCK-Sp2cHHMB.mjs → chunk-PYSFUGCK-CY7pclEB.mjs} +2 -2
- package/dist/{chunk-QCDB2VPH-CKprjJi1.mjs → chunk-QCDB2VPH-D1RuXtOm.mjs} +2 -2
- package/dist/{chunk-QJ7O6ZN3-DAJDwVLZ.mjs → chunk-QJ7O6ZN3-BH67tCjg.mjs} +2 -2
- package/dist/{chunk-R6QSAL5T-BhmoPD7w.mjs → chunk-R6QSAL5T-CtbJTvt9.mjs} +1 -1
- package/dist/{chunk-R6VWJ2ZL-FwG_Za20.mjs → chunk-R6VWJ2ZL-DSqbA7Rj.mjs} +1 -1
- package/dist/{chunk-RPNGRAAP-C2BHhnew.mjs → chunk-RPNGRAAP-BughPjdR.mjs} +2 -2
- package/dist/{chunk-SDNKECQQ-B0K39uOy.mjs → chunk-SDNKECQQ-C3GEf3VZ.mjs} +2 -2
- package/dist/{chunk-SYMJJMQ4-BHTQ9-zw.mjs → chunk-SYMJJMQ4-0QtKvQIP.mjs} +2 -2
- package/dist/{chunk-T56QNPHK-Cm6aWFiU.mjs → chunk-T56QNPHK-DjHqXy9T.mjs} +2 -2
- package/dist/{chunk-TLSUDHID-BQSN0_NC.mjs → chunk-TLSUDHID-6EWOySH2.mjs} +2 -2
- package/dist/{chunk-TOMNU26N-CyB5ygtc.mjs → chunk-TOMNU26N-BjLxRX8P.mjs} +2 -2
- package/dist/{chunk-TXBZCHCQ-hJoWF3in.mjs → chunk-TXBZCHCQ-l48TczF5.mjs} +2 -2
- package/dist/{chunk-UNYNJIFU-C1ZMf296.mjs → chunk-UNYNJIFU-BbdoO4yb.mjs} +3 -3
- package/dist/{chunk-V7TAPXDL-CbyQ432v.mjs → chunk-V7TAPXDL-CnKUp2df.mjs} +2 -2
- package/dist/{chunk-VJFXDYWH-Ju3YsoA8.mjs → chunk-VJFXDYWH-IiUXkKX0.mjs} +2 -2
- package/dist/{chunk-VLGZJRPG-dvgMu0oq.mjs → chunk-VLGZJRPG-B678hnuU.mjs} +2 -2
- package/dist/{chunk-VOBGTVA6-CpbDs1cF.mjs → chunk-VOBGTVA6-BT7gUxqf.mjs} +2 -2
- package/dist/{chunk-VYOJP4TV-COBa4MtL.mjs → chunk-VYOJP4TV-BvibOnKG.mjs} +2 -2
- package/dist/{chunk-WKFATFPP-9cXM_L_4.mjs → chunk-WKFATFPP-DCZdrA8x.mjs} +2 -2
- package/dist/{chunk-X2AJGDEF-CvfqmCuM.mjs → chunk-X2AJGDEF-BaH6i1Rq.mjs} +1 -1
- package/dist/{chunk-XHM67O4N-akBjDPaR.mjs → chunk-XHM67O4N-Cd7Fiqsb.mjs} +1 -1
- package/dist/{chunk-XKQRETAK-Bbdvongf.mjs → chunk-XKQRETAK-cVWA9gEB.mjs} +2 -2
- package/dist/{chunk-XORM457F-BzpdJr6h.mjs → chunk-XORM457F-BAW3OKIy.mjs} +2 -2
- package/dist/{chunk-XVDPCNWR-C2xS3KJO.mjs → chunk-XVDPCNWR-CtK-Xs2O.mjs} +2 -2
- package/dist/{chunk-YCFVLTST-B0tITlai.mjs → chunk-YCFVLTST-PFJX6AMj.mjs} +2 -2
- package/dist/{chunk-YFG2CMIF-Cz08u2O6.mjs → chunk-YFG2CMIF-CVDz5Fsh.mjs} +2 -2
- package/dist/{chunk-YNYSPYQ5-DesxOVHh.mjs → chunk-YNYSPYQ5-Dq-BWW-f.mjs} +1 -1
- package/dist/{chunk-YS3AZT3J-WmJwXHQO.mjs → chunk-YS3AZT3J-DRSVwRFh.mjs} +2 -2
- package/dist/{chunk-YTNYSM6T-CUlXw32O.mjs → chunk-YTNYSM6T-KUvMCIKS.mjs} +2 -2
- package/dist/{chunk-Z6LRHWXI-4l180K8r.mjs → chunk-Z6LRHWXI-CF_r-CgG.mjs} +2 -2
- package/dist/{chunk-Z7JVV2SM-BUdEAZMZ.mjs → chunk-Z7JVV2SM-BzR-yvwK.mjs} +2 -2
- package/dist/clear-5CZ5X4YR-CwAD0ujG.mjs +1 -0
- package/dist/cli.mjs +42 -44
- package/dist/{colors-BtKMHmBX.mjs → colors-D0wh7lK1.mjs} +1 -1
- package/dist/colors-Dl3c2q5r.mjs +1 -0
- package/dist/column-WLPMMSTS-OtgXQJPP.mjs +1 -0
- package/dist/comm-5SLSESQG-Dbe_0JM-.mjs +1 -0
- package/dist/constants-ChqGJV83.mjs +2 -0
- package/dist/cp-XOYR4ABJ-Fs-BUNPK.mjs +1 -0
- package/dist/{curl-47BFPSFW-Di93oHWG.mjs → curl-47BFPSFW-Dq2QRfS5.mjs} +2 -2
- package/dist/cut-OPC3VAGB-QytesYLS.mjs +1 -0
- package/dist/date-DD7FVA2V-Cg5stPCO.mjs +1 -0
- package/dist/diff-HJF2MPDN-DRmjT8LD.mjs +1 -0
- package/dist/dirname-LEMTZZFS-BU2v6Jk9.mjs +1 -0
- package/dist/{dist-DIChSlVj.mjs → dist-9wjL9Ivy.mjs} +1 -1
- package/dist/{dist-h073CA-s.mjs → dist-Cn5JHf5F.mjs} +37 -36
- package/dist/{dist-bundle-BSdjl7Rj.mjs → dist-bundle-BK4P1EQn.mjs} +1 -1
- package/dist/dist-bundle-CjV1Pdeo.mjs +1 -0
- package/dist/du-WO2ENHXQ-BcC6aUKa.mjs +1 -0
- package/dist/echo-O45JWWI2-D_LDH8mS.mjs +1 -0
- package/dist/env-5EPCWSXR-C4ozdy42.mjs +1 -0
- package/dist/{esm-BbkJd7ro.mjs → esm-s2X3YAg-.mjs} +1 -1
- package/dist/{execAsync-BvlEgtAU.mjs → execAsync-0jii24p9.mjs} +1 -1
- package/dist/{execAsync-CXON0DWd.mjs → execAsync-Czqc-yAz.mjs} +1 -1
- package/dist/{execAsync-JPnR_wx1.mjs → execAsync-DgmLXmTx.mjs} +1 -1
- package/dist/expand-DTNXU4LQ-CHt1YsOk.mjs +1 -0
- package/dist/expansion-ENLSRCXJ-CcahEplO.mjs +1 -0
- package/dist/expr-5T3UU5KE-BL4xVSIz.mjs +1 -0
- package/dist/file-ZIGAJ4YS-CT98h277.mjs +1 -0
- package/dist/find-TPUOAIUQ-BE_RhPSK.mjs +1 -0
- package/dist/flag-coverage-QT4N2Z44-CQ2g5NLf.mjs +2 -0
- package/dist/fold-LDSORVYE-CnErgTj9.mjs +1 -0
- package/dist/{getMachineId-bsd-Bv-VsEyc.mjs → getMachineId-bsd-BCJXEJCn.mjs} +2 -2
- package/dist/{getMachineId-bsd-CWLhAjUn.mjs → getMachineId-bsd-D7C80Q-x.mjs} +2 -2
- package/dist/{getMachineId-bsd-VWU2b38Z.mjs → getMachineId-bsd-GIcY1fmf.mjs} +2 -2
- package/dist/{getMachineId-darwin-BhzfDfjK.mjs → getMachineId-darwin-C9wsuHP1.mjs} +2 -2
- package/dist/{getMachineId-darwin-DGlWH8bP.mjs → getMachineId-darwin-D9y6ky_l.mjs} +2 -2
- package/dist/{getMachineId-darwin-DvOo46Q9.mjs → getMachineId-darwin-DG876t7S.mjs} +2 -2
- package/dist/{getMachineId-linux-CDvTv3pB.mjs → getMachineId-linux-BJESQahL.mjs} +2 -2
- package/dist/{getMachineId-linux-ROmYpdDb.mjs → getMachineId-linux-Bt9mk0EE.mjs} +2 -2
- package/dist/{getMachineId-linux-CCJsqLNI.mjs → getMachineId-linux-D9atImpV.mjs} +2 -2
- package/dist/{getMachineId-unsupported-DPtt_3fd.mjs → getMachineId-unsupported-DAbsbHrs.mjs} +2 -2
- package/dist/{getMachineId-unsupported-ejON9VjP.mjs → getMachineId-unsupported-Dabs3aBp.mjs} +2 -2
- package/dist/{getMachineId-unsupported-BkIyKQdM.mjs → getMachineId-unsupported-cApRznzG.mjs} +2 -2
- package/dist/{getMachineId-win-D3tcWjnb.mjs → getMachineId-win-1MPHaim9.mjs} +2 -2
- package/dist/{getMachineId-win-DmRv23KP.mjs → getMachineId-win-CH98qgwX.mjs} +2 -2
- package/dist/{getMachineId-win-WiGlM2s-.mjs → getMachineId-win-CU_iAQo9.mjs} +2 -2
- package/dist/gh-detect-8zY2NNuZ.mjs +4 -0
- package/dist/{git-handle-CjyGVy33-CK0dYQ8y.mjs → git-handle-CjyGVy33-B_7lAMm9.mjs} +2 -2
- package/dist/git-handle-CjyGVy33-lwHYMDQ0.mjs +1 -0
- package/dist/grep-3AIAIJVR-02E3dSfi.mjs +1 -0
- package/dist/gzip-AQXSGOVS-UkVql__3.mjs +1 -0
- package/dist/head-HT2B6D2J-C2sNM7Dv.mjs +1 -0
- package/dist/help-VVWX7SA5-CZumUR0P.mjs +1 -0
- package/dist/history-J4QRNGRO-rwbd7U40.mjs +1 -0
- package/dist/hostname-BK6HG2DE-BQG1bQvh.mjs +1 -0
- package/dist/html-to-markdown-TFCECAGV-Db230ZWS.mjs +1 -0
- package/dist/index.d.mts +37 -1
- package/dist/index.mjs +1 -1
- package/dist/{init-DPYAS2ZD.mjs → init-B-7x7gxL.mjs} +4 -4
- package/dist/init-BspSFYbX.mjs +1 -0
- package/dist/{is-object-C-4FJ0rP.mjs → is-object-BXWpSxBI.mjs} +1 -1
- package/dist/join-GG2LDHE5-Bc_GxS8t.mjs +1 -0
- package/dist/jq-ODXZBPLY-B5VN-dXM.mjs +1 -0
- package/dist/{js-exec-M6UR76J5-DXM3rg6y.mjs → js-exec-M6UR76J5-BssUQ3SC.mjs} +2 -2
- package/dist/{lib-Bp6oCBmn.mjs → lib-Dl2j2VNl.mjs} +1 -1
- package/dist/{libesm-Cfo1LhlX.mjs → libesm-YL3Bqolr.mjs} +1 -1
- package/dist/ln-4TRFBYAT-oG2zzF3W.mjs +1 -0
- package/dist/{loader-CcKCJIs1.mjs → loader-CGnAxV-z.mjs} +2 -2
- package/dist/loader-XusDpPul.mjs +1 -0
- package/dist/ls-KSXFZCWH-BWWIeWvm.mjs +1 -0
- package/dist/{lzma-BhiA9VHg.mjs → lzma-BSHkPrAt.mjs} +1 -1
- package/dist/md5sum-INMIK4DX-lBp2yvEW.mjs +1 -0
- package/dist/mkdir-TDEMSB6C-DbpQ_xq6.mjs +1 -0
- package/dist/mv-Z6MORUFL-CH8FstC-.mjs +1 -0
- package/dist/nl-U5YJDM32-VxSz_iJ4.mjs +1 -0
- package/dist/od-VJEF2UR5-BniMheOA.mjs +1 -0
- package/dist/{open-browser-DKQcpNx8.mjs → open-browser-C6LU_1mt.mjs} +1 -1
- package/dist/paste-7N6AFSDS-C1AAbgf8.mjs +1 -0
- package/dist/{preview-DcW99r1W.mjs → preview-C6NAItZb.mjs} +2 -2
- package/dist/preview-DGMTzIrG.mjs +1 -0
- package/dist/printf-CX64KX2P-DjH-DHsP.mjs +1 -0
- package/dist/public/assets/{ActivityModeContent-DeW1i47n.js → ActivityModeContent-vlSGPi7K.js} +1 -1
- package/dist/public/assets/{DocumentContext-CwBWJ4Ks.js → DocumentContext-BRfvUgZV.js} +1 -1
- package/dist/public/assets/{GraphPanel-MybfqBCo.js → GraphPanel-B-LlGAGO.js} +1 -1
- package/dist/public/assets/SettingsDialogBody-1i4q2xz7.js +7 -0
- package/dist/public/assets/{SourceEditor-z6339Mj3.js → SourceEditor-MMeo5vmo.js} +1 -1
- package/dist/public/assets/config-validation-events-BWyyZh-d.js +12 -0
- package/dist/public/assets/{dist-BkI3xKU4.js → dist-CtVt9wZe.js} +1 -1
- package/dist/public/assets/{dropdown-menu-DL6A5saL.js → dropdown-menu-CGgRqddr.js} +1 -1
- package/dist/public/assets/index-Bco5OsBq.css +1 -0
- package/dist/public/assets/index-C96Loq20.js +1914 -0
- package/dist/public/assets/{prop-types-CuXJaENL.js → prop-types-CGu0ru1E.js} +1 -1
- package/dist/public/assets/{target-navigation-intent-DBwiHDPG.js → target-navigation-intent-DQPHklQL.js} +1 -1
- package/dist/public/assets/{toggle-group-BNXCmF3n.js → toggle-group-Dy2sV5Bv.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-BbezQD9h.js → typing-burst-detector-Ty1Gy_nX.js} +1 -1
- package/dist/public/index.html +10 -10
- package/dist/pwd-D4OZ7N27-VQ3RwUo8.mjs +1 -0
- package/dist/{python3-AUFTPCU6-Dq9xUUBq.mjs → python3-AUFTPCU6-BSuL_Nsg.mjs} +2 -2
- package/dist/readlink-MI4GCHJF-L50-Upms.mjs +1 -0
- package/dist/{repair-launch-json-CQqAUGg3.mjs → repair-launch-json-D1Xg8LAy.mjs} +2 -2
- package/dist/{repair-mcp-configs-FiLhomCw.mjs → repair-mcp-configs-CMNHRhif.mjs} +2 -2
- package/dist/repair-skills-7rlg54ML.mjs +1 -0
- package/dist/{repair-skills-BmAa1apA.mjs → repair-skills-DL08j-QR.mjs} +2 -2
- package/dist/rev-XOSYPP45-CwKU0j6Z.mjs +1 -0
- package/dist/rg-FOQSCCX3-BrvjgaMQ.mjs +1 -0
- package/dist/rm-RTZG23RL-_UcxChNg.mjs +1 -0
- package/dist/rmdir-XTQXT7RK-BRaqkv9Z.mjs +1 -0
- package/dist/{rolldown-runtime-twds-ZHy-Dxr-RWJs.mjs → rolldown-runtime-twds-ZHy-DU73unG7.mjs} +1 -1
- package/dist/sed-VFTTATXJ-CZsNmySp.mjs +1 -0
- package/dist/seq-RN5ZUASB-Cg0b6SeB.mjs +1 -0
- package/dist/{server-lock-BniQ3qki-CadPGoZN.mjs → server-lock-BniQ3qki-C_0QTo_r.mjs} +2 -2
- package/dist/server-lock-BniQ3qki-D-qFWWUB.mjs +1 -0
- package/dist/sha1sum-VJPNLNU6-CAg7QQIj.mjs +1 -0
- package/dist/sha256sum-PI32XWXY-CFFtkep9.mjs +1 -0
- package/dist/sleep-VZFPZFWA-D3Ph1Gn6.mjs +1 -0
- package/dist/sort-DCNRDA7U-BePJiuxU.mjs +1 -0
- package/dist/split-SITCSYCZ-COiAX9LF.mjs +1 -0
- package/dist/sqlite3-56UMWEY3-B0OUvEvJ.mjs +1 -0
- package/dist/src-Cc0yKmd-.mjs +2 -0
- package/dist/start-0fqf2-7A.mjs +3 -0
- package/dist/start-CMujpqWk.mjs +1 -0
- package/dist/stat-BT5A227F-NmZL1hMB.mjs +1 -0
- package/dist/strings-7PLOGTPD-CUJSASTo.mjs +1 -0
- package/dist/tac-SJGXQ4T2-B-fSXHB1.mjs +1 -0
- package/dist/tail-S5ULNTJU-CG1c0Pxf.mjs +1 -0
- package/dist/tar-ANUBEFJY-DH18Zmoc.mjs +1 -0
- package/dist/tee-O7VXZDCO-D_NgfJcm.mjs +1 -0
- package/dist/time-DEUO3QV2-DdyaxseS.mjs +1 -0
- package/dist/timeout-VRKMCG72-LxpBVg0M.mjs +1 -0
- package/dist/touch-DX2IJOQ4-BdSZnvQi.mjs +1 -0
- package/dist/tr-2HXZRDSW-QjngBhOg.mjs +1 -0
- package/dist/tree-LYXBS7DC-CsfD1mRM.mjs +1 -0
- package/dist/true-WHJNXCHG-DJUeGOw7.mjs +1 -0
- package/dist/unexpand-RGTMIGZM-gIXCkWyw.mjs +1 -0
- package/dist/uniq-SUNANL47-CiH7i9-p.mjs +1 -0
- package/dist/wc-TQB3VNOX-D1U1S7L6.mjs +1 -0
- package/dist/which-XZHEH76L-CRVfCXCP.mjs +1 -0
- package/dist/whoami-DGKU3D2X-COB3yQf8.mjs +1 -0
- package/dist/{write-project-skill-VpMfcqZu.mjs → write-project-skill-BKowG4Lg.mjs} +2 -2
- package/dist/xan-BXDXYEIB-iFQjU_f2.mjs +1 -0
- package/dist/xan-view-ECQUO7AJ-BGX-rpom.mjs +1 -0
- package/dist/xargs-I6EZUCYF-CqFBjjSK.mjs +1 -0
- package/dist/yq-MJMAR36V-B5nTz8YA.mjs +1 -0
- package/package.json +1 -1
- package/dist/alias-JE7RI5QX-CAVgalv7.mjs +0 -1
- package/dist/awk2-POPGKRAI-DSmUTUD5.mjs +0 -1
- package/dist/base64-4YMZCVJ5-BwzgfP6J.mjs +0 -1
- package/dist/basename-AA2KJYZQ-CTXbUPI9.mjs +0 -1
- package/dist/bash-IJWYRKFO-CSBfp75s.mjs +0 -1
- package/dist/build-B4ZT2GMK.mjs +0 -1
- package/dist/cat-RDUMLXKC-BA4E-6jM.mjs +0 -1
- package/dist/chmod-SYMGL4JA-DqrztDS_.mjs +0 -1
- package/dist/clear-5CZ5X4YR-BEwl4_C9.mjs +0 -1
- package/dist/colors-t2HkW8lF.mjs +0 -1
- package/dist/column-WLPMMSTS-D0xWkTwB.mjs +0 -1
- package/dist/comm-5SLSESQG-xUt6OU03.mjs +0 -1
- package/dist/constants-D7XfXxlD.mjs +0 -2
- package/dist/cp-XOYR4ABJ-X7H6YMBY.mjs +0 -1
- package/dist/cut-OPC3VAGB-CwS5RcsW.mjs +0 -1
- package/dist/date-DD7FVA2V-Dbk2XkK5.mjs +0 -1
- package/dist/diff-HJF2MPDN-fNt2f91n.mjs +0 -1
- package/dist/dirname-LEMTZZFS-BT_ZAIuL.mjs +0 -1
- package/dist/dist-bundle-BmF5_Mcp.mjs +0 -1
- package/dist/du-WO2ENHXQ-VqOjFaSA.mjs +0 -1
- package/dist/echo-O45JWWI2-C-3bei5r.mjs +0 -1
- package/dist/env-5EPCWSXR-DoYioOMQ.mjs +0 -1
- package/dist/expand-DTNXU4LQ-DBWQTk0V.mjs +0 -1
- package/dist/expansion-ENLSRCXJ-DRm2UiGT.mjs +0 -1
- package/dist/expr-5T3UU5KE-BhfN9y59.mjs +0 -1
- package/dist/file-ZIGAJ4YS-DJbeP4p1.mjs +0 -1
- package/dist/find-TPUOAIUQ-CczmrVYd.mjs +0 -1
- package/dist/flag-coverage-QT4N2Z44-CRPgxYXl.mjs +0 -2
- package/dist/fold-LDSORVYE-DA4LkSBA.mjs +0 -1
- package/dist/git-handle-CjyGVy33-DVACqhWk.mjs +0 -1
- package/dist/grep-3AIAIJVR-BNFrRnPp.mjs +0 -1
- package/dist/gzip-AQXSGOVS-Ch_VPnFG.mjs +0 -1
- package/dist/head-HT2B6D2J-SGgQuBJe.mjs +0 -1
- package/dist/help-VVWX7SA5-9Ykrc3HE.mjs +0 -1
- package/dist/history-J4QRNGRO-CaZeA5kN.mjs +0 -1
- package/dist/hostname-BK6HG2DE-JGVS1ppF.mjs +0 -1
- package/dist/html-to-markdown-TFCECAGV-BG8DWXFH.mjs +0 -1
- package/dist/init-DpZclUms.mjs +0 -1
- package/dist/join-GG2LDHE5-JRj0ouRV.mjs +0 -1
- package/dist/jq-ODXZBPLY-DHB9kbWU.mjs +0 -1
- package/dist/ln-4TRFBYAT-oOs-iS2Z.mjs +0 -1
- package/dist/loader-CfsvAEk9.mjs +0 -1
- package/dist/ls-KSXFZCWH-CQHD37jl.mjs +0 -1
- package/dist/md5sum-INMIK4DX-BDAIIDt4.mjs +0 -1
- package/dist/mkdir-TDEMSB6C-Lwjy9N0j.mjs +0 -1
- package/dist/mv-Z6MORUFL-DgTIQxj0.mjs +0 -1
- package/dist/nl-U5YJDM32-DeUWi7jL.mjs +0 -1
- package/dist/od-VJEF2UR5-5IUCoJ8z.mjs +0 -1
- package/dist/paste-7N6AFSDS-BnArAq5a.mjs +0 -1
- package/dist/preview-BMr8C3lA.mjs +0 -1
- package/dist/printf-CX64KX2P-BByztiUk.mjs +0 -1
- package/dist/public/assets/SettingsDialogBody-Cs-Oet1Z.js +0 -7
- package/dist/public/assets/config-validation-events-D7jOmIYr.js +0 -12
- package/dist/public/assets/index-C5PBW8hb.css +0 -1
- package/dist/public/assets/index-M15V0jry.js +0 -1914
- package/dist/pwd-D4OZ7N27-CEyHiqxC.mjs +0 -1
- package/dist/readlink-MI4GCHJF-DrjzDETr.mjs +0 -1
- package/dist/repair-skills-B8s2RCRZ.mjs +0 -1
- package/dist/rev-XOSYPP45-BrX3RY1o.mjs +0 -1
- package/dist/rg-FOQSCCX3-COS6uwJc.mjs +0 -1
- package/dist/rm-RTZG23RL-CVB8AHY5.mjs +0 -1
- package/dist/rmdir-XTQXT7RK-BPMg1E7n.mjs +0 -1
- package/dist/sed-VFTTATXJ-DbqskjHs.mjs +0 -1
- package/dist/seq-RN5ZUASB-xObuoCwd.mjs +0 -1
- package/dist/server-lock-BniQ3qki-DjKtnzVr.mjs +0 -1
- package/dist/sha1sum-VJPNLNU6-CtzyEkCD.mjs +0 -1
- package/dist/sha256sum-PI32XWXY-CXUzEmYp.mjs +0 -1
- package/dist/sleep-VZFPZFWA-By_skETk.mjs +0 -1
- package/dist/sort-DCNRDA7U-DEjrctZD.mjs +0 -1
- package/dist/split-SITCSYCZ-C3JRw7ww.mjs +0 -1
- package/dist/sqlite3-56UMWEY3-DaCjOzpq.mjs +0 -1
- package/dist/src-rVQIvNz2.mjs +0 -2
- package/dist/start-Cvvkb00d.mjs +0 -1
- package/dist/start-DV6SnYRI.mjs +0 -3
- package/dist/stat-BT5A227F-DTrBFTFt.mjs +0 -1
- package/dist/strings-7PLOGTPD-jFq6v5Kd.mjs +0 -1
- package/dist/tac-SJGXQ4T2-CSwW7a_8.mjs +0 -1
- package/dist/tail-S5ULNTJU-EJIXiVsh.mjs +0 -1
- package/dist/tar-ANUBEFJY-BIVb0c7i.mjs +0 -1
- package/dist/tee-O7VXZDCO-7YBB40m-.mjs +0 -1
- package/dist/time-DEUO3QV2-DL-cn0eZ.mjs +0 -1
- package/dist/timeout-VRKMCG72-Vpzd_EzJ.mjs +0 -1
- package/dist/touch-DX2IJOQ4-BsGLHPhC.mjs +0 -1
- package/dist/tr-2HXZRDSW-CQc1dvVn.mjs +0 -1
- package/dist/tree-LYXBS7DC-BKP2eqPA.mjs +0 -1
- package/dist/true-WHJNXCHG-DuLihQOR.mjs +0 -1
- package/dist/unexpand-RGTMIGZM-8kSHk86g.mjs +0 -1
- package/dist/uniq-SUNANL47--vTI7SnC.mjs +0 -1
- package/dist/wc-TQB3VNOX-DiOuiJK4.mjs +0 -1
- package/dist/which-XZHEH76L-Di_vxpS1.mjs +0 -1
- package/dist/whoami-DGKU3D2X-BDh4nuof.mjs +0 -1
- package/dist/xan-BXDXYEIB-xeeBU-41.mjs +0 -1
- package/dist/xan-view-ECQUO7AJ-Bp_uMGUB.mjs +0 -1
- package/dist/xargs-I6EZUCYF-Xyb7Erje.mjs +0 -1
- package/dist/yq-MJMAR36V-BM8HTxRY.mjs +0 -1
package/dist/public/assets/{typing-burst-detector-BbezQD9h.js → typing-burst-detector-Ty1Gy_nX.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CFjPhJqf.js";import{a as t,i as n,o as r,r as i,t as a}from"./compiler-runtime-Cs91PcD2.js";import{A as o,Dn as s,O as c,On as l,Sn as u,Tn as d,X as f,k as p,lt as m,n as h,rt as g}from"./DocumentContext-CwBWJ4Ks.js";import{a as _,c as v,i as y,n as b,o as x,r as S,s as C,t as w,u as ee}from"./panel-BNBODYwB.js";import{$ as T,A as E,An as D,Ni as O,Oi as k,On as A,Sn as j,Xt as te,bn as M,et as ne,jn as N,kn as re,qt as P,u as ie,xn as ae,yn as oe}from"./prop-types-CuXJaENL.js";import{S as se,t as ce}from"./button-DenIdY-r.js";import{y as F}from"./dialog-nKg9NzaE.js";import{i as le}from"./collapsible-BhpeB6tu.js";import{i as I,n as L,t as R}from"./cursor-f-dht0b0.js";import{a as z,c as ue,d as de,i as fe,l as pe,u as me}from"./dropdown-menu-DL6A5saL.js";import{$ as he,At as ge,Bt as _e,Dt as ve,E as ye,Et as B,Ft as be,Ht as xe,J as V,Mt as Se,N as Ce,Ot as we,Pt as H,Q as Te,Rt as Ee,Ut as De,X as U,_ as Oe,_t as ke,ct as Ae,dt as je,et as Me,f as Ne,gt as Pe,ht as Fe,l as Ie,lt as Le,mt as Re,nt as ze,ot as Be,rt as Ve,st as He,tt as Ue,ut as We,wt as W,y as Ge,yt as G,zt as Ke}from"./dist-DDdDbjlC.js";import{i as qe,n as Je,o as Ye,r as Xe}from"./dist-C7UlNfyl.js";var K=r(),q=e(t(),1),J=a(),Ze=[{id:`claude-cowork`,displayName:`Claude Cowork`,appBrandName:`Claude Desktop`,schemes:[`claude:`],installUrl:`https://claude.com/download`,hasWebFallback:!0,tagline:`Conversational pairing in Claude Desktop's Cowork tab.`},{id:`claude-code`,displayName:`Claude`,appBrandName:`Claude Desktop`,schemes:[`claude:`],installUrl:`https://claude.com/download`,hasWebFallback:!0,tagline:`Agentic coding in Claude Desktop's Code tab.`},{id:`codex`,displayName:`Codex`,appBrandName:`Codex Desktop`,schemes:[`codex:`],installUrl:`https://openai.com/codex`,tagline:`OpenAI's coding agent, terminal-native.`},{id:`cursor`,displayName:`Cursor`,schemes:[`cursor:`],installUrl:`https://cursor.com/`,tagline:`AI-first VS Code fork with multi-file edits.`}],Qe=Ze.filter(e=>e.id!==`claude-cowork`);function $e(e){return{async install(t){let n;try{n=await e.buildAndOpen(t?.force?{force:!0}:void 0)}catch(e){return{ok:!1,reason:`bridge-error`,message:e instanceof Error?e.message:String(e)}}return n.ok?{ok:!0,path:n.path}:{ok:!1,reason:n.reason,message:n.message}}}}function et(e={}){let t=e.fetch??globalThis.fetch,n=`${e.apiOrigin??``}/api/install-skill`;return{async install(e){let r;try{r=await t(n,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e?.force?{force:!0}:{})})}catch(e){return{ok:!1,reason:`network-error`,message:e instanceof Error?e.message:String(e)}}if(!r.ok){let e=`HTTP ${r.status}`;try{let t=E(await r.json());t&&(e=t)}catch{}return{ok:!1,reason:`http-error`,message:e}}let i;try{i=await r.json()}catch(e){return{ok:!1,reason:`parse-error`,message:e instanceof Error?e.message:`Invalid server response`}}return!i||typeof i.status!=`string`?{ok:!1,reason:`parse-error`,message:`Invalid server response shape`}:i.status===`failed`?{ok:!1,reason:`build-failed`,message:i.buildError??`unknown build failure`}:{ok:!0,path:i.outputPath,handoffWarning:i.handoffError?.message}}}}function tt(){if(typeof window>`u`)return null;let e=window.okDesktop?.skill;return e?$e(e):et()}var nt=`ok:skill:cowork:installed`,rt=`1`,it=250,at=`/api/skill/install-state`;function ot(e){return`${nt}:v${e}`}var st=new Map;async function ct(e={},t={}){let n=t.force?`__force__`:`__default__`,r=st.get(n);if(r)return r;let i=lt(e,t);return st.set(n,i),i.finally(()=>{st.get(n)===i&&st.delete(n)}),i}async function lt(e,t){let n=e.installer===void 0?tt():e.installer,r=ut(e.storage),i=e.fetchSnapshot??ft,a=e.serverTimeoutMs??it,o=null;if(!t.force){try{o=await pt(i(),a)}catch(e){console.warn(`[cowork-skill] server install-state check failed; falling through:`,e)}if(o){let e=o.targets[`claude-cowork`]??null;if(e&&e.version===o.currentVersion)return{kind:`already-installed`,source:`server`}}}let s=ot(o?.currentVersion??e.fallbackSkillVersion??dt());if(!t.force&&r?.getItem(s)===rt)return{kind:`already-installed`,source:`local`};if(!n)return{kind:`host-unsupported`};let c=await n.install({force:t.force??!1});if(!c.ok)return{kind:`install-failed`,reason:c.reason,message:c.message};try{r?.setItem(s,rt)}catch(e){console.warn(`[cowork-skill] storage.setItem failed (guard will not persist):`,e)}return{kind:`installed-now`,path:c.path,handoffWarning:c.handoffWarning}}function ut(e){if(e!==void 0)return e;if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}function dt(){return typeof window>`u`?`unknown`:window.okDesktop?.appVersion??`unknown`}async function ft(){let e;try{e=await fetch(at,{method:`GET`,cache:`no-store`})}catch{return null}if(!e.ok)return null;try{let t=await e.json();return typeof t?.currentVersion==`string`?t:null}catch{return null}}async function pt(e,t){return Promise.race([e,new Promise(e=>{setTimeout(()=>e(null),t)})])}function mt(e){return ct({},e)}function ht(){return ct({},{force:!0})}async function gt(e,t){let n;try{n=await t(`/api/handoff`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)})}catch(e){return{ok:!1,reason:`dispatch-error`,detail:e instanceof Error?e.message:String(e)}}return n.status===200?{ok:!0}:n.status===404?{ok:!1,reason:`not-installed`,detail:`POST /api/handoff returned 404`}:n.status===422?{ok:!1,reason:`not-installed`,detail:`POST /api/handoff returned ${n.status}`}:{ok:!1,reason:`dispatch-error`,detail:`POST /api/handoff returned ${n.status}`}}async function _t(e,t={}){let n=t.fetch??globalThis.fetch.bind(globalThis);switch(e.target){case`claude-cowork`:return gt({target:`claude-cowork`,url:M({mode:`cowork`},e)},n);case`claude-code`:return gt({target:`claude-code`,url:M({mode:`code`},e)},n);case`codex`:return gt({target:`codex`,url:ae(e)},n);case`cursor`:return gt({target:`cursor`,url:j(e),workspacePath:e.projectDir},n);default:{let t=e.target;return{ok:!1,reason:`invalid-payload`,detail:`unknown target: ${String(t)}`}}}}async function vt(e,t={}){let n=t.okDesktop??(typeof window<`u`?window.okDesktop:void 0);if(n?.shell?.openExternal)try{return await n.shell.openExternal(e),{ok:!0}}catch(e){return{ok:!1,reason:`dispatch-error`,detail:yt(e)}}let r=t.doc??(typeof document<`u`?document:void 0);if(!r)return{ok:!1,reason:`dispatch-error`,detail:`no DOM available`};try{let t=r.createElement(`a`);return t.href=e,t.rel=`noopener noreferrer`,/^https?:/i.test(e)&&(t.target=`_blank`),r.body.appendChild(t),t.click(),t.remove(),{ok:!0}}catch(e){return{ok:!1,reason:`dispatch-error`,detail:yt(e)}}}function yt(e){if(e instanceof Error)return e.message;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}async function bt(e,t={}){let n=t.okDesktop??(typeof window<`u`?window.okDesktop:void 0);if(n?.shell?.recordHandoff)try{await n.shell.recordHandoff(e)}catch(e){(t.warn??(e=>console.warn(e)))(`[handoff] recordHandoff IPC rejected (telemetry skipped): ${e instanceof Error?e.message:String(e)}`)}}function xt(e,t,n){let r=n===`\\`?t.replaceAll(`/`,`\\`):t;return`${e.endsWith(n)?e.slice(0,-1):e}${n}${r}`}function St(e){return`${e}.md`}function Ct(e){if(!e.docName||!e.workspace)return null;let t=St(e.docName),{contentDir:n,pathSeparator:r}=e.workspace;return{docContext:{relativePath:t},projectDir:n,docPath:xt(n,t,r)}}function wt(e){return e.workspace?.contentDir?{docContext:null,projectDir:e.workspace.contentDir,docPath:``}:null}function Tt(e){return!e.workspace?.contentDir||!e.folderRelativePath?null:{docContext:null,folderRelativePath:e.folderRelativePath,projectDir:e.workspace.contentDir,docPath:``}}function Et(e){if(!e.docName||!e.workspace||!e.selectionMarkdown)return null;let t=St(e.docName),{contentDir:n,pathSeparator:r}=e.workspace;return{docContext:null,selection:{relativePath:t,instruction:e.instruction,selectionMarkdown:e.selectionMarkdown},projectDir:n,docPath:xt(n,t,r)}}function Dt(e){return vt(e.installUrl).then(()=>void 0)}function Ot(e){return`Opened in ${e}.`}function kt(e,t=1){return t>=3?`Couldn't reach ${e} — please try again later.`:t===2?`Still couldn't reach ${e} — try one more time?`:`Couldn't reach ${e} — try again?`}function At(e){return e>=3?null:e===2?`Try one more time`:`Retry`}function jt(e,t,n,r,i){let a=i===void 0?{}:{scope:i};return t.ok?{target:e,host:n,outcome:`ok`,ts:r,...a}:{target:e,host:n,outcome:`error`,ts:r,reason:t.reason,...a}}function Mt(e,t){return e.selection?N({...e.selection,target:t}):e.docContext===null?e.folderRelativePath?D(e.folderRelativePath):A():re(e.docContext.relativePath)}async function Nt(e,t,n,r=1){if(e===`claude-cowork`&&r===1){let e;try{e=await n.ensureCoworkSkillInstalled()}catch(e){let t=e instanceof Error?e.message:String(e);return n.toast.error(`Couldn't install Open Knowledge skill — ${t}`),{ok:!1,reason:`dispatch-error`,detail:`install-error: ${t}`}}if(e.kind===`installed-now`)return n.toast.success(`Open Knowledge skill saved. Upload it in Claude Desktop, then click Cowork again.`),{ok:!0};if(e.kind===`install-failed`){let t=e.message??e.reason;return n.toast.error(`Couldn't install Open Knowledge skill — ${t}`),{ok:!1,reason:`dispatch-error`,detail:`install-failed: ${t}`}}}let i={target:e,projectDir:t.projectDir,docPath:t.docPath,prompt:Mt(t,e)},a=await n.dispatchHandoff(i),o=jt(e,a,n.isElectronHost()?`electron`:`web`,n.now().toISOString(),t.selection?`selection`:void 0);await n.recordHandoff(o);let s=n.getDisplayName(e);if(a.ok)n.toast.success(Ot(s));else{let i=At(r),a=kt(s,r);i===null?n.toast.error(a):n.toast.error(a,{action:{label:i,onClick:()=>{Nt(e,t,n,r+1)}}})}return a}function Pt(e){return Ze.find(t=>t.id===e)?.displayName??e}function Ft(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function It(){return{dispatchHandoff:_t,recordHandoff:bt,toast:{success:e=>{F.success(e)},error:(e,t)=>{F.error(e,t?{action:t.action}:void 0)}},now:()=>new Date,isElectronHost:()=>Ft(),getDisplayName:Pt,ensureCoworkSkillInstalled:mt}}function Lt(){return{dispatch:(e,t)=>Nt(e,t,It()),reinstallCoworkSkill:ht}}var Rt=[...new Set(Ze.flatMap(e=>e.schemes))];function zt(e,t){let n=t.now?.()??Date.now(),r={};for(let t of Ze){let i=t.schemes[0],a=i===void 0?void 0:e[i];if(!a){r[t.id]={installed:null};continue}r[t.id]={installed:a.installed,...a.displayName===void 0?{}:{displayName:a.displayName},lastChecked:n}}return r}function Bt(e){return zt({},e)}async function Vt(e){let t=e.schemes??Rt,n=await Promise.all(t.map(async t=>{let n=t.replace(/:$/,``);try{return[t,await e.detectProtocol(n)]}catch{return[t,{installed:!1}]}}));return Object.fromEntries(n)}var Ht=Object.fromEntries(Rt.map(e=>[e,{installed:!1}]));async function Ut(e){let t;try{t=await e.fetch(`/api/installed-agents`,{signal:e.signal,headers:{Accept:`application/json`}})}catch(e){if(e.name===`AbortError`)throw e;return Ht}if(!t.ok)return Ht;let n;try{n=await t.json()}catch{return Ht}if(typeof n!=`object`||!n||Array.isArray(n))return Ht;let r=n,i={};for(let e of Rt)i[e]={installed:r[e.replace(/:$/,``)]===!0};return i}function Wt(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n){let n=e[r],i=t[r];if(!n||!i||n.installed!==i.installed||n.displayName!==i.displayName)return!1}return!0}function Gt(e){let t=e.throttleMs??1e4,n=!1,r=null,i=null,a={},o=Bt({isElectronHost:e.isElectronHost(),now:e.now}),s=new Set,c=()=>{if(!n)for(let e of s)e(o)},l=()=>{o=zt(a,{isElectronHost:e.isElectronHost(),now:e.now})};return{probe:async()=>{if(n)return;if(i)return i;if(r!==null&&e.now()-r<t)return;let o=(async()=>{try{let t=await e.probe();if(n)return;let i=!Wt(a,t);a=t,i&&(l(),c()),r=e.now()}catch{}finally{i=null}})();return i=o,o},getTargetStates:()=>o,subscribe:e=>(s.add(e),()=>{s.delete(e)}),cancel:()=>{n=!0,s.clear()}}}function Kt(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function qt(){let e=typeof window<`u`?window.okDesktop:void 0;if(e){let t=t=>e.shell.detectProtocol(t);return{probe:()=>Vt({detectProtocol:t}),isElectronHost:()=>!0,now:Date.now}}let t=globalThis.fetch.bind(globalThis);return{probe:()=>Ut({fetch:t}),isElectronHost:()=>!1,now:Date.now}}function Jt(){let e=(0,J.c)(5),[t,n]=(0,q.useState)(Yt),r=(0,q.useRef)(null),i,a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>{let e=Gt(qt());r.current=e;let t=e.subscribe(n);e.probe();let i=()=>{e.probe()};return window.addEventListener(`focus`,i),()=>{window.removeEventListener(`focus`,i),t(),e.cancel(),r.current=null}},a=[],e[0]=i,e[1]=a):(i=e[0],a=e[1]),(0,q.useEffect)(i,a);let o;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>r.current?.probe()??Promise.resolve(),e[2]=o):o=e[2];let s;return e[3]===t?s=e[4]:(s={states:t,refresh:o},e[3]=t,e[4]=s),s}function Yt(){return Bt({isElectronHost:Kt(),now:Date.now})}var Xt=new Map;function Zt(e,t){Xt.set(e,t)}function Qt(e){let t=Xt.get(e)??null;return Xt.delete(e),t}function $t(e){Xt.delete(e)}function en(e,t){let n=(0,J.c)(4),r=t===void 0?!1:t,[i,a]=(0,q.useState)(void 0),o=(0,q.useRef)(null),s,c;return n[0]!==r||n[1]!==e?(s=()=>{if(r||e.length===0){a(void 0);return}let t=function(){let t=window.innerHeight/2,n,r;for(let i of e){let e=document.getElementById(i);if(!e)continue;let a=e.getBoundingClientRect().top;a<0?n=i:r===void 0&&a<t&&(r=i)}a(r??n??e[0])},n=function(){o.current===null&&(o.current=requestAnimationFrame(()=>{o.current=null,t()}))};return document.addEventListener(`scroll`,n,{capture:!0,passive:!0}),t(),()=>{document.removeEventListener(`scroll`,n,{capture:!0}),o.current!==null&&(cancelAnimationFrame(o.current),o.current=null)}},c=[e,r],n[0]=r,n[1]=e,n[2]=s,n[3]=c):(s=n[2],c=n[3]),(0,q.useEffect)(s,c),i}var tn=300;async function nn(e){let t=await fetch(`/api/page-headings?docName=${encodeURIComponent(e)}`),n;try{n=await t.json()}catch(e){throw new m(k._({id:`qAQVSD`}),{cause:e,status:t.status})}if(!t.ok){let e=te.safeParse(n);throw e.success?Error(e.data.title):new m(k._({id:`zlErBl`}),{status:t.status})}let r=P.safeParse(n);if(!r.success)throw new m(k._({id:`XW18jo`}),{status:t.status});return r.data.headings??[]}var rn=32,an=12,on=6,sn=`open-knowledge:outline-nav`;function cn(e){let t=(0,J.c)(2),n;return t[0]===e?n=t[1]:(n=(0,K.jsx)(u,{name:`outline-panel`,children:(0,K.jsx)(ln,{...e})}),t[0]=e,t[1]=n),n}function ln(e){let t=(0,J.c)(50),{docName:r,isSourceMode:a,className:o}=e,s=o===void 0?``:o,{_:c}=n(),{pages:l,loading:u}=ie(),d=ee(),{activeProvider:f,activeDocName:p}=h(),m,g;t[0]===r?(m=t[1],g=t[2]):(m=[`page-headings`,r],g=()=>nn(r),t[0]=r,t[1]=m,t[2]=g);let T;t[3]!==r||t[4]!==u||t[5]!==l?(T=!u&&l.has(r),t[3]=r,t[4]=u,t[5]=l,t[6]=T):T=t[6];let E;t[7]!==m||t[8]!==g||t[9]!==T?(E={queryKey:m,queryFn:g,enabled:T,staleTime:1/0},t[7]=m,t[8]=g,t[9]=T,t[10]=E):E=t[10];let{data:D,isLoading:O,error:k}=v(E),A;t[11]===D?A=t[12]:(A=D===void 0?[]:D,t[11]=D,t[12]=A);let j=A,te,M;t[13]!==p||t[14]!==f||t[15]!==r||t[16]!==d?(te=()=>{if(!f||p!==r)return;let e=f.document,t=null,n=()=>{t!==null&&clearTimeout(t),t=setTimeout(()=>{t=null,d.invalidateQueries({queryKey:[`page-headings`,r]})},tn)};return e.on(`update`,n),()=>{e.off(`update`,n),t!==null&&clearTimeout(t)}},M=[f,p,r,d],t[13]=p,t[14]=f,t[15]=r,t[16]=d,t[17]=te,t[18]=M):(te=t[17],M=t[18]),(0,q.useEffect)(te,M);let ne;t[19]===j?ne=t[20]:(ne=j.map(un),t[19]=j,t[20]=ne);let N=en(ne,a),re;t[21]!==N||t[22]!==j?(re=N?j.findIndex(e=>e.slug===N):-1,t[21]=N,t[22]=j,t[23]=re):re=t[23];let P=re,ae;t[24]!==r||t[25]!==a?(ae=function(e,t){let n={index:e,slug:t,mode:a?`source`:`wysiwyg`};n.mode===`source`&&Zt(r,{kind:`outline`,detail:n}),window.dispatchEvent(new CustomEvent(sn,{detail:n}))},t[24]=r,t[25]=a,t[26]=ae):ae=t[26];let oe=ae,ce=((P>=0?j[P].level:1)-1)*an+(an-on)/2,F=P*rn+(rn-on)/2,le;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(le=(0,K.jsx)(C,{children:(0,K.jsx)(i,{id:`dD7NPy`})}),t[27]=le):le=t[27];let I;t[28]!==j.length||t[29]!==O?(I=!O&&(0,K.jsx)(S,{children:j.length}),t[28]=j.length,t[29]=O,t[30]=I):I=t[30];let L;t[31]===I?L=t[32]:(L=(0,K.jsxs)(x,{children:[le,I]}),t[31]=I,t[32]=L);let R;t[33]!==c||t[34]!==P||t[35]!==N||t[36]!==k||t[37]!==oe||t[38]!==j||t[39]!==O||t[40]!==ce||t[41]!==F?(R=k?(0,K.jsx)(_,{className:`px-2`,children:k instanceof Error?k.message:c({id:`GuqOb1`})}):j.length===0&&!O?(0,K.jsx)(y,{className:`px-2`,children:(0,K.jsx)(i,{id:`0BB9ID`})}):(0,K.jsxs)(`nav`,{"aria-label":c({id:`BymzO4`}),className:`relative`,children:[P>=0&&(0,K.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute left-0 top-0 rounded-full bg-primary motion-safe:[transition:transform_0.25s_var(--ease-out-strong)]`,style:{width:on,height:on,transform:`translate(${ce}px, ${F}px)`}}),j.map((e,t)=>{let n=e.slug===N;return(0,K.jsx)(`button`,{type:`button`,"aria-current":n?`location`:void 0,onClick:()=>oe(t,e.slug),className:se(`w-full cursor-pointer truncate py-1.5 pe-2 text-left text-sm transition-colors`,n?`font-medium text-primary`:`text-muted-foreground hover:text-foreground`),style:{paddingLeft:`${(e.level-1)*an+20}px`},title:e.text,children:e.text},t)})]}),t[33]=c,t[34]=P,t[35]=N,t[36]=k,t[37]=oe,t[38]=j,t[39]=O,t[40]=ce,t[41]=F,t[42]=R):R=t[42];let z;t[43]!==O||t[44]!==R?(z=(0,K.jsx)(b,{className:`px-3 py-2`,"aria-busy":O,children:R}),t[43]=O,t[44]=R,t[45]=z):z=t[45];let ue;return t[46]!==s||t[47]!==L||t[48]!==z?(ue=(0,K.jsxs)(w,{className:s,children:[L,z]}),t[46]=s,t[47]=L,t[48]=z,t[49]=ue):ue=t[49],ue}function un(e){return e.slug}var dn=typeof String.prototype.normalize==`function`?e=>e.normalize(`NFKD`):e=>e,Y=class{constructor(e,t,n=0,r=e.length,i,a){this.test=a,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer=``,this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=i?e=>i(dn(e)):dn,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Ee(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=De(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=Ke(e);let r=this.normalize(t);if(r.length)for(let e=0,i=n;;e++){let a=r.charCodeAt(e),o=this.match(a,i,this.bufferPos+this.bufferStart);if(e==r.length-1){if(o)return this.value=o,this;break}i==n&&e<t.length&&t.charCodeAt(e)==a&&i++}}}match(e,t,n){let r=null;for(let t=0;t<this.matches.length;t+=2){let i=this.matches[t],a=!1;this.query.charCodeAt(i)==e&&(i==this.query.length-1?r={from:this.matches[t+1],to:n}:(this.matches[t]++,a=!0)),a||(this.matches.splice(t,2),t-=2)}return this.query.charCodeAt(0)==e&&(this.query.length==1?r={from:t,to:n}:this.matches.push(1,t)),r&&this.test&&!this.test(r.from,r.to,this.buffer,this.bufferStart)&&(r=null),r}};typeof Symbol<`u`&&(Y.prototype[Symbol.iterator]=function(){return this});var fn={from:-1,to:-1,match:/.*/.exec(``)},pn=`gm`+(/x/.unicode==null?``:`u`),mn=class{constructor(e,t,n,r=0,i=e.length){if(this.text=e,this.to=i,this.curLine=``,this.done=!1,this.value=fn,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new _n(e,t,n,r,i);this.re=new RegExp(t,pn+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.iter=e.iter(),this.curLineStart=e.lineAt(r).from,this.matchPos=yn(e,r),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine=``:(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine=``:this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=yn(this.text,r+ +(n==r)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<r||n>this.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}},hn=new WeakMap,gn=class e{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(t,n,r){let i=hn.get(t);if(!i||i.from>=r||i.to<=n){let i=new e(n,t.sliceString(n,r));return hn.set(t,i),i}if(i.from==n&&i.to==r)return i;let{text:a,from:o}=i;return o>n&&(a=t.sliceString(n,o)+a,o=n),i.to<r&&(a+=t.sliceString(i.to,r)),hn.set(t,new e(o,a)),new e(n,a.slice(n-o,r-o))}},_n=class{constructor(e,t,n,r,i){this.text=e,this.to=i,this.done=!1,this.value=fn,this.matchPos=yn(e,r),this.re=new RegExp(t,pn+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.flat=gn.get(e,r,this.chunkEnd(r+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,n=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,n,t)))return this.value={from:e,to:n,match:t},this.matchPos=yn(this.text,n+ +(e==n)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=gn.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}};typeof Symbol<`u`&&(mn.prototype[Symbol.iterator]=_n.prototype[Symbol.iterator]=function(){return this});function vn(e){try{return new RegExp(e,pn),!0}catch{return!1}}function yn(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}var bn=e=>{let{state:t}=e,n=String(t.doc.lineAt(e.state.selection.main.head).number),{close:r,result:i}=Pe(e,{label:t.phrase(`Go to line`),input:{type:`text`,name:`line`,value:n},focus:!0,submitLabel:t.phrase(`go`)});return i.then(n=>{let i=n&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.elements.line.value);if(!i){e.dispatch({effects:r});return}let a=t.doc.lineAt(t.selection.main.head),[,o,s,c,l]=i,u=c?+c.slice(1):0,d=s?+s:a.number;if(s&&l){let e=d/100;o&&(e=e*(o==`-`?-1:1)+a.number/t.doc.lines),d=Math.round(t.doc.lines*e)}else s&&o&&(d=d*(o==`-`?-1:1)+a.number);let f=t.doc.line(Math.max(1,Math.min(t.doc.lines,d))),p=B.cursor(f.from+Math.max(0,Math.min(u,f.length)));e.dispatch({effects:[r,U.scrollIntoView(p.from,{y:`center`})],selection:p})}),!0},xn={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Sn=we.define({combine(e){return _e(e,xn,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function Cn(e){let t=[kn,On];return e&&t.push(Sn.of(e)),t}var wn=V.mark({class:`cm-selectionMatch`}),Tn=V.mark({class:`cm-selectionMatch cm-selectionMatch-main`});function En(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=W.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=W.Word)}function Dn(e,t,n,r){return e(t.sliceDoc(n,n+1))==W.Word&&e(t.sliceDoc(r-1,r))==W.Word}var On=Te.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(Sn),{state:n}=e,r=n.selection;if(r.ranges.length>1)return V.none;let i=r.main,a,o=null;if(i.empty){if(!t.highlightWordAroundCursor)return V.none;let e=n.wordAt(i.head);if(!e)return V.none;o=n.charCategorizer(i.head),a=n.sliceDoc(e.from,e.to)}else{let e=i.to-i.from;if(e<t.minSelectionLength||e>200)return V.none;if(t.wholeWords){if(a=n.sliceDoc(i.from,i.to),o=n.charCategorizer(i.head),!(En(o,n,i.from,i.to)&&Dn(o,n,i.from,i.to)))return V.none}else if(a=n.sliceDoc(i.from,i.to),!a)return V.none}let s=[];for(let r of e.visibleRanges){let e=new Y(n.doc,a,r.from,r.to);for(;!e.next().done;){let{from:r,to:a}=e.value;if((!o||En(o,n,r,a))&&(i.empty&&r<=i.from&&a>=i.to?s.push(Tn.range(r,a)):(r>=i.to||a<=i.from)&&s.push(wn.range(r,a)),s.length>t.maxMatches))return V.none}}return V.set(s)}},{decorations:e=>e.decorations}),kn=U.baseTheme({".cm-selectionMatch":{backgroundColor:`#99ff7780`},".cm-searchMatch .cm-selectionMatch":{backgroundColor:`transparent`}}),An=({state:e,dispatch:t})=>{let{selection:n}=e,r=B.create(n.ranges.map(t=>e.wordAt(t.head)||B.cursor(t.head)),n.mainIndex);return r.eq(n)?!1:(t(e.update({selection:r})),!0)};function jn(e,t){let{main:n,ranges:r}=e.selection,i=e.wordAt(n.head),a=i&&i.from==n.from&&i.to==n.to;for(let n=!1,i=new Y(e.doc,t,r[r.length-1].to);;)if(i.next(),i.done){if(n)return null;i=new Y(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),n=!0}else{if(n&&r.some(e=>e.from==i.value.from))continue;if(a){let t=e.wordAt(i.value.from);if(!t||t.from!=i.value.from||t.to!=i.value.to)continue}return i.value}}var Mn=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(e=>e.from===e.to))return An({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(t=>e.sliceDoc(t.from,t.to)!=r))return!1;let i=jn(e,r);return i?(t(e.update({selection:e.selection.addRange(B.range(i.from,i.to),!1),effects:U.scrollIntoView(i.to)})),!0):!1},Nn=we.define({combine(e){return _e(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new fr(e),scrollToMatch:e=>U.scrollIntoView(e)})}}),Pn=class{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||``,this.valid=!!this.search&&(!this.regexp||vn(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(e,t)=>t==`n`?`
|
|
1
|
+
import{o as e}from"./chunk-CFjPhJqf.js";import{a as t,i as n,o as r,r as i,t as a}from"./compiler-runtime-Cs91PcD2.js";import{A as o,Dn as s,O as c,On as l,Sn as u,Tn as d,X as f,k as p,lt as m,n as h,rt as g}from"./DocumentContext-BRfvUgZV.js";import{a as _,c as v,i as y,n as b,o as x,r as S,s as C,t as w,u as ee}from"./panel-BNBODYwB.js";import{$ as T,A as E,An as D,Ni as O,Oi as k,On as A,Sn as j,Xt as te,bn as M,et as ne,jn as N,kn as re,qt as P,u as ie,xn as ae,yn as oe}from"./prop-types-CGu0ru1E.js";import{S as se,t as ce}from"./button-DenIdY-r.js";import{y as F}from"./dialog-nKg9NzaE.js";import{i as le}from"./collapsible-BhpeB6tu.js";import{i as I,n as L,t as R}from"./cursor-f-dht0b0.js";import{a as z,c as ue,d as de,i as fe,l as pe,u as me}from"./dropdown-menu-CGgRqddr.js";import{$ as he,At as ge,Bt as _e,Dt as ve,E as ye,Et as B,Ft as be,Ht as xe,J as V,Mt as Se,N as Ce,Ot as we,Pt as H,Q as Te,Rt as Ee,Ut as De,X as U,_ as Oe,_t as ke,ct as Ae,dt as je,et as Me,f as Ne,gt as Pe,ht as Fe,l as Ie,lt as Le,mt as Re,nt as ze,ot as Be,rt as Ve,st as He,tt as Ue,ut as We,wt as W,y as Ge,yt as G,zt as Ke}from"./dist-DDdDbjlC.js";import{i as qe,n as Je,o as Ye,r as Xe}from"./dist-C7UlNfyl.js";var K=r(),q=e(t(),1),J=a(),Ze=[{id:`claude-cowork`,displayName:`Claude Cowork`,appBrandName:`Claude Desktop`,schemes:[`claude:`],installUrl:`https://claude.com/download`,hasWebFallback:!0,tagline:`Conversational pairing in Claude Desktop's Cowork tab.`},{id:`claude-code`,displayName:`Claude`,appBrandName:`Claude Desktop`,schemes:[`claude:`],installUrl:`https://claude.com/download`,hasWebFallback:!0,tagline:`Agentic coding in Claude Desktop's Code tab.`},{id:`codex`,displayName:`Codex`,appBrandName:`Codex Desktop`,schemes:[`codex:`],installUrl:`https://openai.com/codex`,tagline:`OpenAI's coding agent, terminal-native.`},{id:`cursor`,displayName:`Cursor`,schemes:[`cursor:`],installUrl:`https://cursor.com/`,tagline:`AI-first VS Code fork with multi-file edits.`}],Qe=Ze.filter(e=>e.id!==`claude-cowork`);function $e(e){return{async install(t){let n;try{n=await e.buildAndOpen(t?.force?{force:!0}:void 0)}catch(e){return{ok:!1,reason:`bridge-error`,message:e instanceof Error?e.message:String(e)}}return n.ok?{ok:!0,path:n.path}:{ok:!1,reason:n.reason,message:n.message}}}}function et(e={}){let t=e.fetch??globalThis.fetch,n=`${e.apiOrigin??``}/api/install-skill`;return{async install(e){let r;try{r=await t(n,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e?.force?{force:!0}:{})})}catch(e){return{ok:!1,reason:`network-error`,message:e instanceof Error?e.message:String(e)}}if(!r.ok){let e=`HTTP ${r.status}`;try{let t=E(await r.json());t&&(e=t)}catch{}return{ok:!1,reason:`http-error`,message:e}}let i;try{i=await r.json()}catch(e){return{ok:!1,reason:`parse-error`,message:e instanceof Error?e.message:`Invalid server response`}}return!i||typeof i.status!=`string`?{ok:!1,reason:`parse-error`,message:`Invalid server response shape`}:i.status===`failed`?{ok:!1,reason:`build-failed`,message:i.buildError??`unknown build failure`}:{ok:!0,path:i.outputPath,handoffWarning:i.handoffError?.message}}}}function tt(){if(typeof window>`u`)return null;let e=window.okDesktop?.skill;return e?$e(e):et()}var nt=`ok:skill:cowork:installed`,rt=`1`,it=250,at=`/api/skill/install-state`;function ot(e){return`${nt}:v${e}`}var st=new Map;async function ct(e={},t={}){let n=t.force?`__force__`:`__default__`,r=st.get(n);if(r)return r;let i=lt(e,t);return st.set(n,i),i.finally(()=>{st.get(n)===i&&st.delete(n)}),i}async function lt(e,t){let n=e.installer===void 0?tt():e.installer,r=ut(e.storage),i=e.fetchSnapshot??ft,a=e.serverTimeoutMs??it,o=null;if(!t.force){try{o=await pt(i(),a)}catch(e){console.warn(`[cowork-skill] server install-state check failed; falling through:`,e)}if(o){let e=o.targets[`claude-cowork`]??null;if(e&&e.version===o.currentVersion)return{kind:`already-installed`,source:`server`}}}let s=ot(o?.currentVersion??e.fallbackSkillVersion??dt());if(!t.force&&r?.getItem(s)===rt)return{kind:`already-installed`,source:`local`};if(!n)return{kind:`host-unsupported`};let c=await n.install({force:t.force??!1});if(!c.ok)return{kind:`install-failed`,reason:c.reason,message:c.message};try{r?.setItem(s,rt)}catch(e){console.warn(`[cowork-skill] storage.setItem failed (guard will not persist):`,e)}return{kind:`installed-now`,path:c.path,handoffWarning:c.handoffWarning}}function ut(e){if(e!==void 0)return e;if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}function dt(){return typeof window>`u`?`unknown`:window.okDesktop?.appVersion??`unknown`}async function ft(){let e;try{e=await fetch(at,{method:`GET`,cache:`no-store`})}catch{return null}if(!e.ok)return null;try{let t=await e.json();return typeof t?.currentVersion==`string`?t:null}catch{return null}}async function pt(e,t){return Promise.race([e,new Promise(e=>{setTimeout(()=>e(null),t)})])}function mt(e){return ct({},e)}function ht(){return ct({},{force:!0})}async function gt(e,t){let n;try{n=await t(`/api/handoff`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)})}catch(e){return{ok:!1,reason:`dispatch-error`,detail:e instanceof Error?e.message:String(e)}}return n.status===200?{ok:!0}:n.status===404?{ok:!1,reason:`not-installed`,detail:`POST /api/handoff returned 404`}:n.status===422?{ok:!1,reason:`not-installed`,detail:`POST /api/handoff returned ${n.status}`}:{ok:!1,reason:`dispatch-error`,detail:`POST /api/handoff returned ${n.status}`}}async function _t(e,t={}){let n=t.fetch??globalThis.fetch.bind(globalThis);switch(e.target){case`claude-cowork`:return gt({target:`claude-cowork`,url:M({mode:`cowork`},e)},n);case`claude-code`:return gt({target:`claude-code`,url:M({mode:`code`},e)},n);case`codex`:return gt({target:`codex`,url:ae(e)},n);case`cursor`:return gt({target:`cursor`,url:j(e),workspacePath:e.projectDir},n);default:{let t=e.target;return{ok:!1,reason:`invalid-payload`,detail:`unknown target: ${String(t)}`}}}}async function vt(e,t={}){let n=t.okDesktop??(typeof window<`u`?window.okDesktop:void 0);if(n?.shell?.openExternal)try{return await n.shell.openExternal(e),{ok:!0}}catch(e){return{ok:!1,reason:`dispatch-error`,detail:yt(e)}}let r=t.doc??(typeof document<`u`?document:void 0);if(!r)return{ok:!1,reason:`dispatch-error`,detail:`no DOM available`};try{let t=r.createElement(`a`);return t.href=e,t.rel=`noopener noreferrer`,/^https?:/i.test(e)&&(t.target=`_blank`),r.body.appendChild(t),t.click(),t.remove(),{ok:!0}}catch(e){return{ok:!1,reason:`dispatch-error`,detail:yt(e)}}}function yt(e){if(e instanceof Error)return e.message;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}async function bt(e,t={}){let n=t.okDesktop??(typeof window<`u`?window.okDesktop:void 0);if(n?.shell?.recordHandoff)try{await n.shell.recordHandoff(e)}catch(e){(t.warn??(e=>console.warn(e)))(`[handoff] recordHandoff IPC rejected (telemetry skipped): ${e instanceof Error?e.message:String(e)}`)}}function xt(e,t,n){let r=n===`\\`?t.replaceAll(`/`,`\\`):t;return`${e.endsWith(n)?e.slice(0,-1):e}${n}${r}`}function St(e){return`${e}.md`}function Ct(e){if(!e.docName||!e.workspace)return null;let t=St(e.docName),{contentDir:n,pathSeparator:r}=e.workspace;return{docContext:{relativePath:t},projectDir:n,docPath:xt(n,t,r)}}function wt(e){return e.workspace?.contentDir?{docContext:null,projectDir:e.workspace.contentDir,docPath:``}:null}function Tt(e){return!e.workspace?.contentDir||!e.folderRelativePath?null:{docContext:null,folderRelativePath:e.folderRelativePath,projectDir:e.workspace.contentDir,docPath:``}}function Et(e){if(!e.docName||!e.workspace||!e.selectionMarkdown)return null;let t=St(e.docName),{contentDir:n,pathSeparator:r}=e.workspace;return{docContext:null,selection:{relativePath:t,instruction:e.instruction,selectionMarkdown:e.selectionMarkdown},projectDir:n,docPath:xt(n,t,r)}}function Dt(e){return vt(e.installUrl).then(()=>void 0)}function Ot(e){return`Opened in ${e}.`}function kt(e,t=1){return t>=3?`Couldn't reach ${e} — please try again later.`:t===2?`Still couldn't reach ${e} — try one more time?`:`Couldn't reach ${e} — try again?`}function At(e){return e>=3?null:e===2?`Try one more time`:`Retry`}function jt(e,t,n,r,i){let a=i===void 0?{}:{scope:i};return t.ok?{target:e,host:n,outcome:`ok`,ts:r,...a}:{target:e,host:n,outcome:`error`,ts:r,reason:t.reason,...a}}function Mt(e,t){return e.selection?N({...e.selection,target:t}):e.docContext===null?e.folderRelativePath?D(e.folderRelativePath):A():re(e.docContext.relativePath)}async function Nt(e,t,n,r=1){if(e===`claude-cowork`&&r===1){let e;try{e=await n.ensureCoworkSkillInstalled()}catch(e){let t=e instanceof Error?e.message:String(e);return n.toast.error(`Couldn't install Open Knowledge skill — ${t}`),{ok:!1,reason:`dispatch-error`,detail:`install-error: ${t}`}}if(e.kind===`installed-now`)return n.toast.success(`Open Knowledge skill saved. Upload it in Claude Desktop, then click Cowork again.`),{ok:!0};if(e.kind===`install-failed`){let t=e.message??e.reason;return n.toast.error(`Couldn't install Open Knowledge skill — ${t}`),{ok:!1,reason:`dispatch-error`,detail:`install-failed: ${t}`}}}let i={target:e,projectDir:t.projectDir,docPath:t.docPath,prompt:Mt(t,e)},a=await n.dispatchHandoff(i),o=jt(e,a,n.isElectronHost()?`electron`:`web`,n.now().toISOString(),t.selection?`selection`:void 0);await n.recordHandoff(o);let s=n.getDisplayName(e);if(a.ok)n.toast.success(Ot(s));else{let i=At(r),a=kt(s,r);i===null?n.toast.error(a):n.toast.error(a,{action:{label:i,onClick:()=>{Nt(e,t,n,r+1)}}})}return a}function Pt(e){return Ze.find(t=>t.id===e)?.displayName??e}function Ft(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function It(){return{dispatchHandoff:_t,recordHandoff:bt,toast:{success:e=>{F.success(e)},error:(e,t)=>{F.error(e,t?{action:t.action}:void 0)}},now:()=>new Date,isElectronHost:()=>Ft(),getDisplayName:Pt,ensureCoworkSkillInstalled:mt}}function Lt(){return{dispatch:(e,t)=>Nt(e,t,It()),reinstallCoworkSkill:ht}}var Rt=[...new Set(Ze.flatMap(e=>e.schemes))];function zt(e,t){let n=t.now?.()??Date.now(),r={};for(let t of Ze){let i=t.schemes[0],a=i===void 0?void 0:e[i];if(!a){r[t.id]={installed:null};continue}r[t.id]={installed:a.installed,...a.displayName===void 0?{}:{displayName:a.displayName},lastChecked:n}}return r}function Bt(e){return zt({},e)}async function Vt(e){let t=e.schemes??Rt,n=await Promise.all(t.map(async t=>{let n=t.replace(/:$/,``);try{return[t,await e.detectProtocol(n)]}catch{return[t,{installed:!1}]}}));return Object.fromEntries(n)}var Ht=Object.fromEntries(Rt.map(e=>[e,{installed:!1}]));async function Ut(e){let t;try{t=await e.fetch(`/api/installed-agents`,{signal:e.signal,headers:{Accept:`application/json`}})}catch(e){if(e.name===`AbortError`)throw e;return Ht}if(!t.ok)return Ht;let n;try{n=await t.json()}catch{return Ht}if(typeof n!=`object`||!n||Array.isArray(n))return Ht;let r=n,i={};for(let e of Rt)i[e]={installed:r[e.replace(/:$/,``)]===!0};return i}function Wt(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n){let n=e[r],i=t[r];if(!n||!i||n.installed!==i.installed||n.displayName!==i.displayName)return!1}return!0}function Gt(e){let t=e.throttleMs??1e4,n=!1,r=null,i=null,a={},o=Bt({isElectronHost:e.isElectronHost(),now:e.now}),s=new Set,c=()=>{if(!n)for(let e of s)e(o)},l=()=>{o=zt(a,{isElectronHost:e.isElectronHost(),now:e.now})};return{probe:async()=>{if(n)return;if(i)return i;if(r!==null&&e.now()-r<t)return;let o=(async()=>{try{let t=await e.probe();if(n)return;let i=!Wt(a,t);a=t,i&&(l(),c()),r=e.now()}catch{}finally{i=null}})();return i=o,o},getTargetStates:()=>o,subscribe:e=>(s.add(e),()=>{s.delete(e)}),cancel:()=>{n=!0,s.clear()}}}function Kt(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function qt(){let e=typeof window<`u`?window.okDesktop:void 0;if(e){let t=t=>e.shell.detectProtocol(t);return{probe:()=>Vt({detectProtocol:t}),isElectronHost:()=>!0,now:Date.now}}let t=globalThis.fetch.bind(globalThis);return{probe:()=>Ut({fetch:t}),isElectronHost:()=>!1,now:Date.now}}function Jt(){let e=(0,J.c)(5),[t,n]=(0,q.useState)(Yt),r=(0,q.useRef)(null),i,a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>{let e=Gt(qt());r.current=e;let t=e.subscribe(n);e.probe();let i=()=>{e.probe()};return window.addEventListener(`focus`,i),()=>{window.removeEventListener(`focus`,i),t(),e.cancel(),r.current=null}},a=[],e[0]=i,e[1]=a):(i=e[0],a=e[1]),(0,q.useEffect)(i,a);let o;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>r.current?.probe()??Promise.resolve(),e[2]=o):o=e[2];let s;return e[3]===t?s=e[4]:(s={states:t,refresh:o},e[3]=t,e[4]=s),s}function Yt(){return Bt({isElectronHost:Kt(),now:Date.now})}var Xt=new Map;function Zt(e,t){Xt.set(e,t)}function Qt(e){let t=Xt.get(e)??null;return Xt.delete(e),t}function $t(e){Xt.delete(e)}function en(e,t){let n=(0,J.c)(4),r=t===void 0?!1:t,[i,a]=(0,q.useState)(void 0),o=(0,q.useRef)(null),s,c;return n[0]!==r||n[1]!==e?(s=()=>{if(r||e.length===0){a(void 0);return}let t=function(){let t=window.innerHeight/2,n,r;for(let i of e){let e=document.getElementById(i);if(!e)continue;let a=e.getBoundingClientRect().top;a<0?n=i:r===void 0&&a<t&&(r=i)}a(r??n??e[0])},n=function(){o.current===null&&(o.current=requestAnimationFrame(()=>{o.current=null,t()}))};return document.addEventListener(`scroll`,n,{capture:!0,passive:!0}),t(),()=>{document.removeEventListener(`scroll`,n,{capture:!0}),o.current!==null&&(cancelAnimationFrame(o.current),o.current=null)}},c=[e,r],n[0]=r,n[1]=e,n[2]=s,n[3]=c):(s=n[2],c=n[3]),(0,q.useEffect)(s,c),i}var tn=300;async function nn(e){let t=await fetch(`/api/page-headings?docName=${encodeURIComponent(e)}`),n;try{n=await t.json()}catch(e){throw new m(k._({id:`qAQVSD`}),{cause:e,status:t.status})}if(!t.ok){let e=te.safeParse(n);throw e.success?Error(e.data.title):new m(k._({id:`zlErBl`}),{status:t.status})}let r=P.safeParse(n);if(!r.success)throw new m(k._({id:`XW18jo`}),{status:t.status});return r.data.headings??[]}var rn=32,an=12,on=6,sn=`open-knowledge:outline-nav`;function cn(e){let t=(0,J.c)(2),n;return t[0]===e?n=t[1]:(n=(0,K.jsx)(u,{name:`outline-panel`,children:(0,K.jsx)(ln,{...e})}),t[0]=e,t[1]=n),n}function ln(e){let t=(0,J.c)(50),{docName:r,isSourceMode:a,className:o}=e,s=o===void 0?``:o,{_:c}=n(),{pages:l,loading:u}=ie(),d=ee(),{activeProvider:f,activeDocName:p}=h(),m,g;t[0]===r?(m=t[1],g=t[2]):(m=[`page-headings`,r],g=()=>nn(r),t[0]=r,t[1]=m,t[2]=g);let T;t[3]!==r||t[4]!==u||t[5]!==l?(T=!u&&l.has(r),t[3]=r,t[4]=u,t[5]=l,t[6]=T):T=t[6];let E;t[7]!==m||t[8]!==g||t[9]!==T?(E={queryKey:m,queryFn:g,enabled:T,staleTime:1/0},t[7]=m,t[8]=g,t[9]=T,t[10]=E):E=t[10];let{data:D,isLoading:O,error:k}=v(E),A;t[11]===D?A=t[12]:(A=D===void 0?[]:D,t[11]=D,t[12]=A);let j=A,te,M;t[13]!==p||t[14]!==f||t[15]!==r||t[16]!==d?(te=()=>{if(!f||p!==r)return;let e=f.document,t=null,n=()=>{t!==null&&clearTimeout(t),t=setTimeout(()=>{t=null,d.invalidateQueries({queryKey:[`page-headings`,r]})},tn)};return e.on(`update`,n),()=>{e.off(`update`,n),t!==null&&clearTimeout(t)}},M=[f,p,r,d],t[13]=p,t[14]=f,t[15]=r,t[16]=d,t[17]=te,t[18]=M):(te=t[17],M=t[18]),(0,q.useEffect)(te,M);let ne;t[19]===j?ne=t[20]:(ne=j.map(un),t[19]=j,t[20]=ne);let N=en(ne,a),re;t[21]!==N||t[22]!==j?(re=N?j.findIndex(e=>e.slug===N):-1,t[21]=N,t[22]=j,t[23]=re):re=t[23];let P=re,ae;t[24]!==r||t[25]!==a?(ae=function(e,t){let n={index:e,slug:t,mode:a?`source`:`wysiwyg`};n.mode===`source`&&Zt(r,{kind:`outline`,detail:n}),window.dispatchEvent(new CustomEvent(sn,{detail:n}))},t[24]=r,t[25]=a,t[26]=ae):ae=t[26];let oe=ae,ce=((P>=0?j[P].level:1)-1)*an+(an-on)/2,F=P*rn+(rn-on)/2,le;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(le=(0,K.jsx)(C,{children:(0,K.jsx)(i,{id:`dD7NPy`})}),t[27]=le):le=t[27];let I;t[28]!==j.length||t[29]!==O?(I=!O&&(0,K.jsx)(S,{children:j.length}),t[28]=j.length,t[29]=O,t[30]=I):I=t[30];let L;t[31]===I?L=t[32]:(L=(0,K.jsxs)(x,{children:[le,I]}),t[31]=I,t[32]=L);let R;t[33]!==c||t[34]!==P||t[35]!==N||t[36]!==k||t[37]!==oe||t[38]!==j||t[39]!==O||t[40]!==ce||t[41]!==F?(R=k?(0,K.jsx)(_,{className:`px-2`,children:k instanceof Error?k.message:c({id:`GuqOb1`})}):j.length===0&&!O?(0,K.jsx)(y,{className:`px-2`,children:(0,K.jsx)(i,{id:`0BB9ID`})}):(0,K.jsxs)(`nav`,{"aria-label":c({id:`BymzO4`}),className:`relative`,children:[P>=0&&(0,K.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute left-0 top-0 rounded-full bg-primary motion-safe:[transition:transform_0.25s_var(--ease-out-strong)]`,style:{width:on,height:on,transform:`translate(${ce}px, ${F}px)`}}),j.map((e,t)=>{let n=e.slug===N;return(0,K.jsx)(`button`,{type:`button`,"aria-current":n?`location`:void 0,onClick:()=>oe(t,e.slug),className:se(`w-full cursor-pointer truncate py-1.5 pe-2 text-left text-sm transition-colors`,n?`font-medium text-primary`:`text-muted-foreground hover:text-foreground`),style:{paddingLeft:`${(e.level-1)*an+20}px`},title:e.text,children:e.text},t)})]}),t[33]=c,t[34]=P,t[35]=N,t[36]=k,t[37]=oe,t[38]=j,t[39]=O,t[40]=ce,t[41]=F,t[42]=R):R=t[42];let z;t[43]!==O||t[44]!==R?(z=(0,K.jsx)(b,{className:`px-3 py-2`,"aria-busy":O,children:R}),t[43]=O,t[44]=R,t[45]=z):z=t[45];let ue;return t[46]!==s||t[47]!==L||t[48]!==z?(ue=(0,K.jsxs)(w,{className:s,children:[L,z]}),t[46]=s,t[47]=L,t[48]=z,t[49]=ue):ue=t[49],ue}function un(e){return e.slug}var dn=typeof String.prototype.normalize==`function`?e=>e.normalize(`NFKD`):e=>e,Y=class{constructor(e,t,n=0,r=e.length,i,a){this.test=a,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer=``,this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=i?e=>i(dn(e)):dn,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Ee(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=De(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=Ke(e);let r=this.normalize(t);if(r.length)for(let e=0,i=n;;e++){let a=r.charCodeAt(e),o=this.match(a,i,this.bufferPos+this.bufferStart);if(e==r.length-1){if(o)return this.value=o,this;break}i==n&&e<t.length&&t.charCodeAt(e)==a&&i++}}}match(e,t,n){let r=null;for(let t=0;t<this.matches.length;t+=2){let i=this.matches[t],a=!1;this.query.charCodeAt(i)==e&&(i==this.query.length-1?r={from:this.matches[t+1],to:n}:(this.matches[t]++,a=!0)),a||(this.matches.splice(t,2),t-=2)}return this.query.charCodeAt(0)==e&&(this.query.length==1?r={from:t,to:n}:this.matches.push(1,t)),r&&this.test&&!this.test(r.from,r.to,this.buffer,this.bufferStart)&&(r=null),r}};typeof Symbol<`u`&&(Y.prototype[Symbol.iterator]=function(){return this});var fn={from:-1,to:-1,match:/.*/.exec(``)},pn=`gm`+(/x/.unicode==null?``:`u`),mn=class{constructor(e,t,n,r=0,i=e.length){if(this.text=e,this.to=i,this.curLine=``,this.done=!1,this.value=fn,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new _n(e,t,n,r,i);this.re=new RegExp(t,pn+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.iter=e.iter(),this.curLineStart=e.lineAt(r).from,this.matchPos=yn(e,r),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine=``:(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine=``:this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=yn(this.text,r+ +(n==r)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<r||n>this.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}},hn=new WeakMap,gn=class e{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(t,n,r){let i=hn.get(t);if(!i||i.from>=r||i.to<=n){let i=new e(n,t.sliceString(n,r));return hn.set(t,i),i}if(i.from==n&&i.to==r)return i;let{text:a,from:o}=i;return o>n&&(a=t.sliceString(n,o)+a,o=n),i.to<r&&(a+=t.sliceString(i.to,r)),hn.set(t,new e(o,a)),new e(n,a.slice(n-o,r-o))}},_n=class{constructor(e,t,n,r,i){this.text=e,this.to=i,this.done=!1,this.value=fn,this.matchPos=yn(e,r),this.re=new RegExp(t,pn+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.flat=gn.get(e,r,this.chunkEnd(r+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,n=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,n,t)))return this.value={from:e,to:n,match:t},this.matchPos=yn(this.text,n+ +(e==n)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=gn.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}};typeof Symbol<`u`&&(mn.prototype[Symbol.iterator]=_n.prototype[Symbol.iterator]=function(){return this});function vn(e){try{return new RegExp(e,pn),!0}catch{return!1}}function yn(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}var bn=e=>{let{state:t}=e,n=String(t.doc.lineAt(e.state.selection.main.head).number),{close:r,result:i}=Pe(e,{label:t.phrase(`Go to line`),input:{type:`text`,name:`line`,value:n},focus:!0,submitLabel:t.phrase(`go`)});return i.then(n=>{let i=n&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.elements.line.value);if(!i){e.dispatch({effects:r});return}let a=t.doc.lineAt(t.selection.main.head),[,o,s,c,l]=i,u=c?+c.slice(1):0,d=s?+s:a.number;if(s&&l){let e=d/100;o&&(e=e*(o==`-`?-1:1)+a.number/t.doc.lines),d=Math.round(t.doc.lines*e)}else s&&o&&(d=d*(o==`-`?-1:1)+a.number);let f=t.doc.line(Math.max(1,Math.min(t.doc.lines,d))),p=B.cursor(f.from+Math.max(0,Math.min(u,f.length)));e.dispatch({effects:[r,U.scrollIntoView(p.from,{y:`center`})],selection:p})}),!0},xn={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Sn=we.define({combine(e){return _e(e,xn,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function Cn(e){let t=[kn,On];return e&&t.push(Sn.of(e)),t}var wn=V.mark({class:`cm-selectionMatch`}),Tn=V.mark({class:`cm-selectionMatch cm-selectionMatch-main`});function En(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=W.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=W.Word)}function Dn(e,t,n,r){return e(t.sliceDoc(n,n+1))==W.Word&&e(t.sliceDoc(r-1,r))==W.Word}var On=Te.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(Sn),{state:n}=e,r=n.selection;if(r.ranges.length>1)return V.none;let i=r.main,a,o=null;if(i.empty){if(!t.highlightWordAroundCursor)return V.none;let e=n.wordAt(i.head);if(!e)return V.none;o=n.charCategorizer(i.head),a=n.sliceDoc(e.from,e.to)}else{let e=i.to-i.from;if(e<t.minSelectionLength||e>200)return V.none;if(t.wholeWords){if(a=n.sliceDoc(i.from,i.to),o=n.charCategorizer(i.head),!(En(o,n,i.from,i.to)&&Dn(o,n,i.from,i.to)))return V.none}else if(a=n.sliceDoc(i.from,i.to),!a)return V.none}let s=[];for(let r of e.visibleRanges){let e=new Y(n.doc,a,r.from,r.to);for(;!e.next().done;){let{from:r,to:a}=e.value;if((!o||En(o,n,r,a))&&(i.empty&&r<=i.from&&a>=i.to?s.push(Tn.range(r,a)):(r>=i.to||a<=i.from)&&s.push(wn.range(r,a)),s.length>t.maxMatches))return V.none}}return V.set(s)}},{decorations:e=>e.decorations}),kn=U.baseTheme({".cm-selectionMatch":{backgroundColor:`#99ff7780`},".cm-searchMatch .cm-selectionMatch":{backgroundColor:`transparent`}}),An=({state:e,dispatch:t})=>{let{selection:n}=e,r=B.create(n.ranges.map(t=>e.wordAt(t.head)||B.cursor(t.head)),n.mainIndex);return r.eq(n)?!1:(t(e.update({selection:r})),!0)};function jn(e,t){let{main:n,ranges:r}=e.selection,i=e.wordAt(n.head),a=i&&i.from==n.from&&i.to==n.to;for(let n=!1,i=new Y(e.doc,t,r[r.length-1].to);;)if(i.next(),i.done){if(n)return null;i=new Y(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),n=!0}else{if(n&&r.some(e=>e.from==i.value.from))continue;if(a){let t=e.wordAt(i.value.from);if(!t||t.from!=i.value.from||t.to!=i.value.to)continue}return i.value}}var Mn=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(e=>e.from===e.to))return An({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(t=>e.sliceDoc(t.from,t.to)!=r))return!1;let i=jn(e,r);return i?(t(e.update({selection:e.selection.addRange(B.range(i.from,i.to),!1),effects:U.scrollIntoView(i.to)})),!0):!1},Nn=we.define({combine(e){return _e(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new fr(e),scrollToMatch:e=>U.scrollIntoView(e)})}}),Pn=class{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||``,this.valid=!!this.search&&(!this.regexp||vn(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(e,t)=>t==`n`?`
|
|
2
2
|
`:t==`r`?`\r`:t==`t`?` `:`\\`)}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new Gn(this):new zn(this)}getCursor(e,t=0,n){let r=e.doc?e:ve.create({doc:e});return n??=r.doc.length,this.regexp?Vn(this,r,t,n):Ln(this,r,t,n)}},Fn=class{constructor(e){this.spec=e}};function In(e,t,n){return(r,i,a,o)=>n&&!n(r,i,a,o)?!1:e(r>=o&&i<=o+a.length?a.slice(r-o,i-o):t.doc.sliceString(r,i),t,r,i)}function Ln(e,t,n,r){let i;return e.wholeWord&&(i=Rn(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(i=In(e.test,t,i)),new Y(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:e=>e.toLowerCase(),i)}function Rn(e,t){return(n,r,i,a)=>((a>n||a+i.length<r)&&(a=Math.max(0,n-2),i=e.sliceString(a,Math.min(e.length,r+2))),(t(Hn(i,n-a))!=W.Word||t(Un(i,n-a))!=W.Word)&&(t(Un(i,r-a))!=W.Word||t(Hn(i,r-a))!=W.Word))}var zn=class extends Fn{constructor(e){super(e)}nextMatch(e,t,n){let r=Ln(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);r=Ln(this.spec,e,0,n).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==n?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let n=Math.max(t,r-1e4-this.spec.unquoted.length),i=Ln(this.spec,e,n,r),a=null;for(;!i.nextOverlapping().done;)a=i.value;if(a)return a;if(n==t)return null;r-=1e4}}prevMatch(e,t,n){let r=this.prevMatchInRange(e,0,t);return r||=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length),r&&(r.from!=t||r.to!=n)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=Ln(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=Ln(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}};function Bn(e,t,n){return(r,i,a)=>(!n||n(r,i,a))&&e(a[0],t,r,i)}function Vn(e,t,n,r){let i;return e.wholeWord&&(i=Wn(t.charCategorizer(t.selection.main.head))),e.test&&(i=Bn(e.test,t,i)),new mn(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:i},n,r)}function Hn(e,t){return e.slice(xe(e,t,!1),t)}function Un(e,t){return e.slice(t,xe(e,t))}function Wn(e){return(t,n,r)=>!r[0].length||(e(Hn(r.input,r.index))!=W.Word||e(Un(r.input,r.index))!=W.Word)&&(e(Un(r.input,r.index+r[0].length))!=W.Word||e(Hn(r.input,r.index+r[0].length))!=W.Word)}var Gn=class extends Fn{nextMatch(e,t,n){let r=Vn(this.spec,e,n,e.doc.length).next();return r.done&&(r=Vn(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let i=Math.max(t,n-r*1e4),a=Vn(this.spec,e,i,n),o=null;for(;!a.next().done;)o=a.value;if(o&&(i==t||o.from>i+10))return o;if(i==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,n)=>{if(n==`&`)return e.match[0];if(n==`$`)return`$`;for(let t=n.length;t>0;t--){let r=+n.slice(0,t);if(r>0&&r<e.match.length)return e.match[r]+n.slice(t)}return t})}matchAll(e,t){let n=Vn(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=Vn(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}},Kn=H.define(),qn=H.define(),X=be.define({create(e){return new Jn(or(e).create(),null)},update(e,t){for(let n of t.effects)n.is(Kn)?e=new Jn(n.value.create(),e.panel):n.is(qn)&&(e=new Jn(e.query,n.value?ar:null));return e},provide:e=>ke.from(e,e=>e.panel)}),Jn=class{constructor(e,t){this.query=e,this.panel=t}},Yn=V.mark({class:`cm-searchMatch`}),Xn=V.mark({class:`cm-searchMatch cm-searchMatch-selected`}),Zn=Te.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(X))}update(e){let t=e.state.field(X);(t!=e.startState.field(X)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return V.none;let{view:n}=this,r=new Se;for(let t=0,i=n.visibleRanges,a=i.length;t<a;t++){let{from:o,to:s}=i[t];for(;t<a-1&&s>i[t+1].from-500;)s=i[++t].to;e.highlight(n.state,o,s,(e,t)=>{let i=n.state.selection.ranges.some(n=>n.from==e&&n.to==t);r.add(e,t,i?Xn:Yn)})}return r.finish()}},{decorations:e=>e.decorations});function Qn(e){return t=>{let n=t.state.field(X,!1);return n&&n.query.spec.valid?e(t,n):lr(t)}}var $n=Qn((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let i=B.single(r.from,r.to),a=e.state.facet(Nn);return e.dispatch({selection:i,effects:[hr(e,r),a.scrollToMatch(i.main,e)],userEvent:`select.search`}),cr(e),!0}),er=Qn((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,i=t.prevMatch(n,r,r);if(!i)return!1;let a=B.single(i.from,i.to),o=e.state.facet(Nn);return e.dispatch({selection:a,effects:[hr(e,i),o.scrollToMatch(a.main,e)],userEvent:`select.search`}),cr(e),!0}),tr=Qn((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:B.create(n.map(e=>B.range(e.from,e.to))),userEvent:`select.search.matches`}),!0)}),nr=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,a=[],o=0;for(let t=new Y(e.doc,e.sliceDoc(r,i));!t.next().done;){if(a.length>1e3)return!1;t.value.from==r&&(o=a.length),a.push(B.range(t.value.from,t.value.to))}return t(e.update({selection:B.create(a,o),userEvent:`select.search.matches`})),!0},rr=Qn((e,{query:t})=>{let{state:n}=e,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let a=t.nextMatch(n,r,r);if(!a)return!1;let o=a,s=[],c,l,u=[];o.from==r&&o.to==i&&(l=n.toText(t.getReplacement(o)),s.push({from:o.from,to:o.to,insert:l}),o=t.nextMatch(n,o.from,o.to),u.push(U.announce.of(n.phrase(`replaced match on line $`,n.doc.lineAt(r).number)+`.`)));let d=e.state.changes(s);return o&&(c=B.single(o.from,o.to).map(d),u.push(hr(e,o)),u.push(n.facet(Nn).scrollToMatch(c.main,e))),e.dispatch({changes:d,selection:c,effects:u,userEvent:`input.replace`}),!0}),ir=Qn((e,{query:t})=>{if(e.state.readOnly)return!1;let n=t.matchAll(e.state,1e9).map(e=>{let{from:n,to:r}=e;return{from:n,to:r,insert:t.getReplacement(e)}});if(!n.length)return!1;let r=e.state.phrase(`replaced $ matches`,n.length)+`.`;return e.dispatch({changes:n,effects:U.announce.of(r),userEvent:`input.replace.all`}),!0});function ar(e){return e.state.facet(Nn).createPanel(e)}function or(e,t){let n=e.selection.main,r=n.empty||n.to>n.from+100?``:e.sliceDoc(n.from,n.to);if(t&&!r)return t;let i=e.facet(Nn);return new Pn({search:t?.literal??i.literal?r:r.replace(/\n/g,`\\n`),caseSensitive:t?.caseSensitive??i.caseSensitive,literal:t?.literal??i.literal,regexp:t?.regexp??i.regexp,wholeWord:t?.wholeWord??i.wholeWord})}function sr(e){let t=Ve(e,ar);return t&&t.dom.querySelector(`[main-field]`)}function cr(e){let t=sr(e);t&&t==e.root.activeElement&&t.select()}var lr=e=>{let t=e.state.field(X,!1);if(t&&t.panel){let n=sr(e);if(n&&n!=e.root.activeElement){let r=or(e.state,t.query.spec);r.valid&&e.dispatch({effects:Kn.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[qn.of(!0),t?Kn.of(or(e.state,t.query.spec)):H.appendConfig.of(_r)]});return!0},ur=e=>{let t=e.state.field(X,!1);if(!t||!t.panel)return!1;let n=Ve(e,ar);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:qn.of(!1)}),!0},dr=[{key:`Mod-f`,run:lr,scope:`editor search-panel`},{key:`F3`,run:$n,shift:er,scope:`editor search-panel`,preventDefault:!0},{key:`Mod-g`,run:$n,shift:er,scope:`editor search-panel`,preventDefault:!0},{key:`Escape`,run:ur,scope:`editor search-panel`},{key:`Mod-Shift-l`,run:nr},{key:`Mod-Alt-g`,run:bn},{key:`Mod-d`,run:Mn,preventDefault:!0}],fr=class{constructor(e){this.view=e;let t=this.query=e.state.field(X).query.spec;this.commit=this.commit.bind(this),this.searchField=G(`input`,{value:t.search,placeholder:Z(e,`Find`),"aria-label":Z(e,`Find`),class:`cm-textfield`,name:`search`,form:``,"main-field":`true`,onchange:this.commit,onkeyup:this.commit}),this.replaceField=G(`input`,{value:t.replace,placeholder:Z(e,`Replace`),"aria-label":Z(e,`Replace`),class:`cm-textfield`,name:`replace`,form:``,onchange:this.commit,onkeyup:this.commit}),this.caseField=G(`input`,{type:`checkbox`,name:`case`,form:``,checked:t.caseSensitive,onchange:this.commit}),this.reField=G(`input`,{type:`checkbox`,name:`re`,form:``,checked:t.regexp,onchange:this.commit}),this.wordField=G(`input`,{type:`checkbox`,name:`word`,form:``,checked:t.wholeWord,onchange:this.commit});function n(e,t,n){return G(`button`,{class:`cm-button`,name:e,onclick:t,type:`button`},n)}this.dom=G(`div`,{onkeydown:e=>this.keydown(e),class:`cm-search`},[this.searchField,n(`next`,()=>$n(e),[Z(e,`next`)]),n(`prev`,()=>er(e),[Z(e,`previous`)]),n(`select`,()=>tr(e),[Z(e,`all`)]),G(`label`,null,[this.caseField,Z(e,`match case`)]),G(`label`,null,[this.reField,Z(e,`regexp`)]),G(`label`,null,[this.wordField,Z(e,`by word`)]),...e.state.readOnly?[]:[G(`br`),this.replaceField,n(`replace`,()=>rr(e),[Z(e,`replace`)]),n(`replaceAll`,()=>ir(e),[Z(e,`replace all`)])],G(`button`,{name:`close`,onclick:()=>ur(e),"aria-label":Z(e,`close`),type:`button`},[`×`])])}commit(){let e=new Pn({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:Kn.of(e)}))}keydown(e){Fe(this.view,e,`search-panel`)?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?er:$n)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),rr(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(Kn)&&!e.value.eq(this.query)&&this.setQuery(e.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Nn).top}};function Z(e,t){return e.state.phrase(t)}var pr=30,mr=/[\s\.,:;?!]/;function hr(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),i=e.state.doc.lineAt(n).to,a=Math.max(r.from,t-pr),o=Math.min(i,n+pr),s=e.state.sliceDoc(a,o);if(a!=r.from){for(let e=0;e<pr;e++)if(!mr.test(s[e+1])&&mr.test(s[e])){s=s.slice(e);break}}if(o!=i){for(let e=s.length-1;e>s.length-pr;e--)if(!mr.test(s[e-1])&&mr.test(s[e])){s=s.slice(0,e);break}}return U.announce.of(`${e.state.phrase(`current match`)}. ${s} ${e.state.phrase(`on line`)} ${r.number}.`)}var gr=U.baseTheme({".cm-panel.cm-search":{padding:`2px 6px 4px`,position:`relative`,"& [name=close]":{position:`absolute`,top:`0`,right:`4px`,backgroundColor:`inherit`,border:`none`,font:`inherit`,padding:0,margin:0},"& input, & button, & label":{margin:`.2em .6em .2em 0`},"& input[type=checkbox]":{marginRight:`.2em`},"& label":{fontSize:`80%`,whiteSpace:`pre`}},"&light .cm-searchMatch":{backgroundColor:`#ffff0054`},"&dark .cm-searchMatch":{backgroundColor:`#00ffff8a`},"&light .cm-searchMatch-selected":{backgroundColor:`#ff6a0054`},"&dark .cm-searchMatch-selected":{backgroundColor:`#ff00ff8a`}}),_r=[X,ge.low(Zn),gr],vr=class{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}},yr=class e{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(t,n,r){let i=r.facet(jr).markerFilter;i&&(t=i(t,r));let a=t.slice().sort((e,t)=>e.from-t.from||e.to-t.to),o=new Se,s=[],c=0,l=r.doc.iter(),u=0,d=r.doc.length;for(let e=0;;){let t=e==a.length?null:a[e];if(!t&&!s.length)break;let n,r;if(s.length)n=c,r=s.reduce((e,t)=>Math.min(e,t.to),t&&t.from>n?t.from:1e8);else{if(n=t.from,n>d)break;r=t.to,s.push(t),e++}for(;e<a.length;){let t=a[e];if(t.from==n&&(t.to>t.from||t.to==n))s.push(t),e++,r=Math.min(t.to,r);else{r=Math.min(t.from,r);break}}r=Math.min(r,d);let i=!1;if(s.some(e=>e.from==n&&(e.to==r||r==d))&&(i=n==r,!i&&r-n<10)){let e=n-(u+l.value.length);e>0&&(l.next(e),u=n);for(let e=n;;){if(e>=r){i=!0;break}if(!l.lineBreak&&u+l.value.length>e)break;e=u+l.value.length,u+=l.value.length,l.next()}}let f=Hr(s);if(i)o.add(n,n,V.widget({widget:new Fr(f),diagnostics:s.slice()}));else{let e=s.reduce((e,t)=>t.markClass?e+` `+t.markClass:e,``);o.add(n,r,V.mark({class:`cm-lintRange cm-lintRange-`+f+e,diagnostics:s.slice(),inclusiveEnd:s.some(e=>e.to>r)}))}if(c=r,c==d)break;for(let e=0;e<s.length;e++)s[e].to<=c&&s.splice(e--,1)}let f=o.finish();return new e(f,n,Q(f))}};function Q(e,t=null,n=0){let r=null;return e.between(n,1e9,(e,n,{spec:i})=>{if(!(t&&i.diagnostics.indexOf(t)<0))if(!r)r=new vr(e,n,t||i.diagnostics[0]);else if(i.diagnostics.indexOf(r.diagnostic)<0)return!1;else r=new vr(r.from,n,r.diagnostic)}),r}function br(e,t){let n=t.pos,r=t.end||n,i=e.state.facet(jr).hideOn(e,n,r);if(i!=null)return i;let a=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(e=>e.is(Sr))||e.changes.touchesRange(a.from,Math.max(a.to,r)))}function xr(e,t){return e.field($,!1)?t:t.concat(H.appendConfig.of(Ur))}var Sr=H.define(),Cr=H.define(),wr=H.define(),$=be.define({create(){return new yr(V.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),r=null,i=e.panel;if(e.selected){let i=t.changes.mapPos(e.selected.from,1);r=Q(n,e.selected.diagnostic,i)||Q(n,null,i)}!n.size&&i&&t.state.facet(jr).autoPanel&&(i=null),e=new yr(n,i,r)}for(let n of t.effects)if(n.is(Sr)){let r=t.state.facet(jr).autoPanel?n.value.length?Lr.open:null:e.panel;e=yr.init(n.value,r,t.state)}else n.is(Cr)?e=new yr(e.diagnostics,n.value?Lr.open:null,e.selected):n.is(wr)&&(e=new yr(e.diagnostics,e.panel,n.value));return e},provide:e=>[ke.from(e,e=>e.panel),U.decorations.from(e,e=>e.diagnostics)]}),Tr=V.mark({class:`cm-lintRange cm-lintRange-active`});function Er(e,t,n){let{diagnostics:r}=e.state.field($),i,a=-1,o=-1;r.between(t-+(n<0),t+ +(n>0),(e,r,{spec:s})=>{if(t>=e&&t<=r&&(e==r||(t>e||n>0)&&(t<r||n<0)))return i=s.diagnostics,a=e,o=r,!1});let s=e.state.facet(jr).tooltipFilter;return i&&s&&(i=s(i,e.state)),i?{pos:a,end:o,above:e.state.doc.lineAt(a).to<o,create(){return{dom:Dr(e,i)}}}:null}function Dr(e,t){return G(`ul`,{class:`cm-tooltip-lint`},t.map(t=>Pr(e,t,!1)))}var Or=e=>{let t=e.state.field($,!1);(!t||!t.panel)&&e.dispatch({effects:xr(e.state,[Cr.of(!0)])});let n=Ve(e,Lr.open);return n&&n.dom.querySelector(`.cm-panel-lint ul`).focus(),!0},kr=e=>{let t=e.state.field($,!1);return!t||!t.panel?!1:(e.dispatch({effects:Cr.of(!1)}),!0)},Ar=[{key:`Mod-Shift-m`,run:Or,preventDefault:!0},{key:`F8`,run:e=>{let t=e.state.field($,!1);if(!t)return!1;let n=e.state.selection.main,r=Q(t.diagnostics,null,n.to+1);return!r&&(r=Q(t.diagnostics,null,0),!r||r.from==n.from&&r.to==n.to)?!1:(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)}}],jr=we.define({combine(e){return{sources:e.map(e=>e.source).filter(e=>e!=null),..._e(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:Mr,tooltipFilter:Mr,needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t,hideOn:(e,t)=>e?t?(n,r,i)=>e(n,r,i)||t(n,r,i):e:t,autoPanel:(e,t)=>e||t})}}});function Mr(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}function Nr(e){let t=[];if(e)actions:for(let{name:n}of e){for(let e=0;e<n.length;e++){let r=n[e];if(/[a-zA-Z]/.test(r)&&!t.some(e=>e.toLowerCase()==r.toLowerCase())){t.push(r);continue actions}}t.push(``)}return t}function Pr(e,t,n){let r=n?Nr(t.actions):[];return G(`li`,{class:`cm-diagnostic cm-diagnostic-`+t.severity},G(`span`,{class:`cm-diagnosticText`},t.renderMessage?t.renderMessage(e):t.message),t.actions?.map((n,i)=>{let a=!1,o=r=>{if(r.preventDefault(),a)return;a=!0;let i=Q(e.state.field($).diagnostics,t);i&&n.apply(e,i.from,i.to)},{name:s}=n,c=r[i]?s.indexOf(r[i]):-1,l=c<0?s:[s.slice(0,c),G(`u`,s.slice(c,c+1)),s.slice(c+1)];return G(`button`,{type:`button`,class:`cm-diagnosticAction`+(n.markClass?` `+n.markClass:``),onclick:o,onmousedown:o,"aria-label":` Action: ${s}${c<0?``:` (access key "${r[i]})"`}.`},l)}),t.source&&G(`div`,{class:`cm-diagnosticSource`},t.source))}var Fr=class extends he{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return G(`span`,{class:`cm-lintPoint cm-lintPoint-`+this.sev})}},Ir=class{constructor(e,t){this.diagnostic=t,this.id=`item_`+Math.floor(Math.random()*4294967295).toString(16),this.dom=Pr(e,t,!0),this.dom.id=this.id,this.dom.setAttribute(`role`,`option`)}},Lr=class e{constructor(e){this.view=e,this.items=[],this.list=G(`ul`,{tabIndex:0,role:`listbox`,"aria-label":this.view.state.phrase(`Diagnostics`),onkeydown:t=>{if(!(t.ctrlKey||t.altKey||t.metaKey)){if(t.keyCode==27)kr(this.view),this.view.focus();else if(t.keyCode==38||t.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(t.keyCode==40||t.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(t.keyCode==36)this.moveSelection(0);else if(t.keyCode==35)this.moveSelection(this.items.length-1);else if(t.keyCode==13)this.view.focus();else if(t.keyCode>=65&&t.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:n}=this.items[this.selectedIndex],r=Nr(n.actions);for(let i=0;i<r.length;i++)if(r[i].toUpperCase().charCodeAt(0)==t.keyCode){let t=Q(this.view.state.field($).diagnostics,n);t&&n.actions[i].apply(e,t.from,t.to)}}else return;t.preventDefault()}},onclick:e=>{for(let t=0;t<this.items.length;t++)this.items[t].dom.contains(e.target)&&this.moveSelection(t)}}),this.dom=G(`div`,{class:`cm-panel-lint`},this.list,G(`button`,{type:`button`,name:`close`,"aria-label":this.view.state.phrase(`close`),onclick:()=>kr(this.view)},`×`)),this.update()}get selectedIndex(){let e=this.view.state.field($).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field($),n=0,r=!1,i=null,a=new Set;for(e.between(0,this.view.state.doc.length,(e,o,{spec:s})=>{for(let e of s.diagnostics){if(a.has(e))continue;a.add(e);let o=-1,s;for(let t=n;t<this.items.length;t++)if(this.items[t].diagnostic==e){o=t;break}o<0?(s=new Ir(this.view,e),this.items.splice(n,0,s),r=!0):(s=this.items[o],o>n&&(this.items.splice(n,o-n),r=!0)),t&&s.diagnostic==t.diagnostic?s.dom.hasAttribute(`aria-selected`)||(s.dom.setAttribute(`aria-selected`,`true`),i=s):s.dom.hasAttribute(`aria-selected`)&&s.dom.removeAttribute(`aria-selected`),n++}});n<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)r=!0,this.items.pop();this.items.length==0&&(this.items.push(new Ir(this.view,{from:-1,to:-1,severity:`info`,message:this.view.state.phrase(`No diagnostics`)})),r=!0),i?(this.list.setAttribute(`aria-activedescendant`,i.id),this.view.requestMeasure({key:this,read:()=>({sel:i.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.top<t.top?this.list.scrollTop-=(t.top-e.top)/n:e.bottom>t.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute(`aria-activedescendant`),r&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=Q(this.view.state.field($).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:wr.of(t)})}static open(t){return new e(t)}};function Rr(e,t=`viewBox="0 0 40 40"`){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}function zr(e){return Rr(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,`width="6" height="3"`)}var Br=U.baseTheme({".cm-diagnostic":{padding:`3px 6px 3px 8px`,marginLeft:`-1px`,display:`block`,whiteSpace:`pre-wrap`},".cm-diagnostic-error":{borderLeft:`5px solid #d11`},".cm-diagnostic-warning":{borderLeft:`5px solid orange`},".cm-diagnostic-info":{borderLeft:`5px solid #999`},".cm-diagnostic-hint":{borderLeft:`5px solid #66d`},".cm-diagnosticAction":{font:`inherit`,border:`none`,padding:`2px 4px`,backgroundColor:`#444`,color:`white`,borderRadius:`3px`,marginLeft:`8px`,cursor:`pointer`},".cm-diagnosticSource":{fontSize:`70%`,opacity:.7},".cm-lintRange":{backgroundPosition:`left bottom`,backgroundRepeat:`repeat-x`,paddingBottom:`0.7px`},".cm-lintRange-error":{backgroundImage:zr(`#d11`)},".cm-lintRange-warning":{backgroundImage:zr(`orange`)},".cm-lintRange-info":{backgroundImage:zr(`#999`)},".cm-lintRange-hint":{backgroundImage:zr(`#66d`)},".cm-lintRange-active":{backgroundColor:`#ffdd9980`},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:`relative`,"&:after":{content:`""`,position:`absolute`,bottom:0,left:`-2px`,borderLeft:`3px solid transparent`,borderRight:`3px solid transparent`,borderBottom:`4px solid #d11`}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:`orange`}},".cm-lintPoint-info":{"&:after":{borderBottomColor:`#999`}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:`#66d`}},".cm-panel.cm-panel-lint":{position:`relative`,"& ul":{maxHeight:`100px`,overflowY:`auto`,"& [aria-selected]":{backgroundColor:`#ddd`,"& u":{textDecoration:`underline`}},"&:focus [aria-selected]":{background_fallback:`#bdf`,backgroundColor:`Highlight`,color_fallback:`white`,color:`HighlightText`},"& u":{textDecoration:`none`},padding:0,margin:0},"& [name=close]":{position:`absolute`,top:`0`,right:`2px`,background:`inherit`,border:`none`,font:`inherit`,padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:`#86714a80`},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:`#2e343e`}}});function Vr(e){return e==`error`?4:e==`warning`?3:e==`info`?2:1}function Hr(e){let t=`hint`,n=1;for(let r of e){let e=Vr(r.severity);e>n&&(n=e,t=r.severity)}return t}var Ur=[$,U.decorations.compute([$],e=>{let{selected:t,panel:n}=e.field($);return!t||!n||t.from==t.to?V.none:V.set([Tr.range(t.from,t.to)])}),Le(Er,{hideOn:br}),Br],Wr=[je(),He(),Ae(),p(),Oe(),Ue(),ze(),ve.allowMultipleSelections.of(!0),ye(),Ce(Ne,{fallback:!0}),Ie(),Xe(),Je(),Re(),Me(),Be(),Cn(),We.of([...qe,...c,...dr,...o,...Ge,...Ye,...Ar])];Ae(),p(),Ue(),Ce(Ne,{fallback:!0}),We.of([...c,...o]);var Gr={"claude-cowork":`claude`,"claude-code":`claude`,codex:`openai`,cursor:`cursor`};function Kr(e){let t=(0,J.c)(23),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({id:r,style:a,className:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let{resolvedTheme:o}=O(),s=Gr[r],c=s?(o===`dark`?ne[s]:void 0)??T[s]:void 0,l;t[5]!==c||t[6]!==a?(l=c?{...a,"--ok-brand-color":c}:a,t[5]=c,t[6]=a,t[7]=l):l=t[7];let u=l,d=c&&`[&_*]:![color:var(--ok-brand-color)]`,f;t[8]!==n||t[9]!==d?(f=se(d,n),t[8]=n,t[9]=d,t[10]=f):f=t[10];let p=f;if(r===`claude-cowork`||r===`claude-code`){let e;return t[11]!==p||t[12]!==u||t[13]!==i?(e=(0,K.jsx)(I,{style:u,className:p,...i}),t[11]=p,t[12]=u,t[13]=i,t[14]=e):e=t[14],e}if(r===`codex`){let e;return t[15]!==p||t[16]!==u||t[17]!==i?(e=(0,K.jsx)(L,{style:u,className:p,...i}),t[15]=p,t[16]=u,t[17]=i,t[18]=e):e=t[18],e}if(r===`cursor`){let e;return t[19]!==p||t[20]!==u||t[21]!==i?(e=(0,K.jsx)(R,{style:u,className:p,...i}),t[19]=p,t[20]=u,t[21]=i,t[22]=e):e=t[22],e}return null}function qr(e){let{installState:t}=e;return t.installed===null?k._({id:`IA6JW2`}):t.installed===!1?k._({id:`5SwVv1`}):null}function Jr(e){let{target:t,installState:n}=e;if(n.installed===null)return{enabled:!1,tooltip:null};if(n.installed===!1){let e=t.appBrandName??t.displayName;return{enabled:!1,tooltip:{message:k._({id:`OJTOUj`,values:{brand:e}}),installAction:{label:k._({id:`fG0X0e`,values:{brand:e}}),url:t.installUrl},...t.hasWebFallback?{webFallback:{label:k._({id:`0S9PW_`}),url:``}}:{}}}}return{enabled:!0,tooltip:null}}function Yr(e){return oe(e)}function Xr(e){return k._({id:`h_HYHD`,values:{displayName:e}})}var Zr=`claude.ai`;async function Qr(e,t=vt){(await t(oe(e))).ok?F.success(Xr(Zr)):F.error(k._({id:`9NC_MT`,values:{CLAUDE_WEB_FALLBACK_LABEL:Zr}}))}function $r(e){let t=(0,J.c)(68),{_:r}=n(),{target:i,installState:a,isElectronHost:o,prompt:s,onSelect:c}=e,l=e.openExternal??vt,u=e.onWebFallbackSuccess??ti,d=e.onWebFallbackError??ei,{displayName:f}=i,p,m,h,g,_,v,y,b,x,S;if(t[0]!==r||t[1]!==a||t[2]!==o||t[3]!==c||t[4]!==d||t[5]!==u||t[6]!==l||t[7]!==s||t[8]!==i||t[9]!==f){S=Symbol.for(`react.early_return_sentinel`);bb0:{let e=Jr({target:i,installState:a,isElectronHost:o}),n=qr({target:i,installState:a,isElectronHost:o}),C=()=>{e.tooltip&&l(e.tooltip.installAction.url)},w;t[20]!==d||t[21]!==u||t[22]!==l||t[23]!==s||t[24]!==i?(w=()=>{(async()=>{let e=await l(Yr(s));e.ok?u(i):d(i,e.detail??e.reason)})()},t[20]=d,t[21]=u,t[22]=l,t[23]=s,t[24]=i,t[25]=w):w=t[25];let ee=w;if(e.enabled){let e=`open-in-agent-item-${i.id}`,n;t[26]!==r||t[27]!==f?(n=r({id:`NnQapF`,values:{targetDisplayName:f}}),t[26]=r,t[27]=f,t[28]=n):n=t[28];let a;t[29]===i.id?a=t[30]:(a=(0,K.jsx)(Kr,{id:i.id,"aria-hidden":`true`}),t[29]=i.id,t[30]=a);let o;t[31]===i.displayName?o=t[32]:(o=(0,K.jsx)(`span`,{children:i.displayName}),t[31]=i.displayName,t[32]=o);let s;t[33]!==c||t[34]!==n||t[35]!==a||t[36]!==o||t[37]!==e?(s=(0,K.jsxs)(fe,{onSelect:c,"data-testid":e,"aria-label":n,children:[a,o]}),t[33]=c,t[34]=n,t[35]=a,t[36]=o,t[37]=e,t[38]=s):s=t[38],S=s;break bb0}if(!e.tooltip){let e=r(n?{id:`If0crP`,values:{targetDisplayName:f,hint:n}}:{id:`NnQapF`,values:{targetDisplayName:f}}),a;t[39]===i.id?a=t[40]:(a=(0,K.jsx)(Kr,{id:i.id,"aria-hidden":`true`}),t[39]=i.id,t[40]=a);let o;t[41]===i.displayName?o=t[42]:(o=(0,K.jsx)(`span`,{className:`flex-1`,children:i.displayName}),t[41]=i.displayName,t[42]=o),S=(0,K.jsxs)(fe,{disabled:!0,"data-testid":`open-in-agent-item-${i.id}`,"aria-label":e,children:[a,o,n?(0,K.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:n}):null]});break bb0}let T=r(n?{id:`If0crP`,values:{targetDisplayName:f,hint:n}}:{id:`NnQapF`,values:{targetDisplayName:f}}),E=e.tooltip.webFallback?.label??``;m=pe;let D=`open-in-agent-item-${i.id}`,O;t[43]===i.id?O=t[44]:(O=(0,K.jsx)(Kr,{id:i.id,"aria-hidden":`true`,className:`mr-2`}),t[43]=i.id,t[44]=O);let k;t[45]===i.displayName?k=t[46]:(k=(0,K.jsx)(`span`,{className:`flex-1`,children:i.displayName}),t[45]=i.displayName,t[46]=k);let A;t[47]===n?A=t[48]:(A=n?(0,K.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:n}):null,t[47]=n,t[48]=A),t[49]!==T||t[50]!==O||t[51]!==k||t[52]!==A||t[53]!==D?(x=(0,K.jsxs)(de,{"data-testid":D,"data-row-disabled":``,"aria-label":T,children:[O,k,A]}),t[49]=T,t[50]=O,t[51]=k,t[52]=A,t[53]=D,t[54]=x):x=t[54],p=me,h=`min-w-[260px]`,g=`open-in-agent-submenu-${i.id}`,_=(0,K.jsx)(z,{className:`font-normal text-muted-foreground text-xs`,"data-testid":`open-in-agent-message-${i.id}`,children:e.tooltip.message}),t[55]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,K.jsx)(ue,{}),t[55]=v):v=t[55],y=(0,K.jsx)(fe,{onSelect:C,"data-testid":`open-in-agent-install-${i.id}`,children:(0,K.jsx)(`span`,{children:e.tooltip.installAction.label})}),b=e.tooltip.webFallback?(0,K.jsxs)(fe,{onSelect:ee,"data-testid":`open-in-agent-web-fallback-${i.id}`,"aria-label":r({id:`lsOFZR`,values:{webFallbackLabel:E}}),children:[(0,K.jsx)(`span`,{className:`flex-1`,children:e.tooltip.webFallback.label}),(0,K.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:r({id:`Z9BoIy`})})]}):null}t[0]=r,t[1]=a,t[2]=o,t[3]=c,t[4]=d,t[5]=u,t[6]=l,t[7]=s,t[8]=i,t[9]=f,t[10]=p,t[11]=m,t[12]=h,t[13]=g,t[14]=_,t[15]=v,t[16]=y,t[17]=b,t[18]=x,t[19]=S}else p=t[10],m=t[11],h=t[12],g=t[13],_=t[14],v=t[15],y=t[16],b=t[17],x=t[18],S=t[19];if(S!==Symbol.for(`react.early_return_sentinel`))return S;let C;t[56]!==p||t[57]!==h||t[58]!==g||t[59]!==_||t[60]!==v||t[61]!==y||t[62]!==b?(C=(0,K.jsxs)(p,{className:h,"data-testid":g,children:[_,v,y,b]}),t[56]=p,t[57]=h,t[58]=g,t[59]=_,t[60]=v,t[61]=y,t[62]=b,t[63]=C):C=t[63];let w;return t[64]!==m||t[65]!==x||t[66]!==C?(w=(0,K.jsxs)(m,{children:[x,C]}),t[64]=m,t[65]=x,t[66]=C,t[67]=w):w=t[67],w}function ei(){}function ti(){}function ni(e){let t=(0,J.c)(17),{installStates:r,onPick:a}=e,{_:o}=n(),[s,c]=(0,q.useState)(``),l;if(t[0]!==o||t[1]!==r||t[2]!==s||t[3]!==a){let e;t[5]===r?e=t[6]:(e=e=>r[e.id]?.installed===!0,t[5]=r,t[6]=e);let n=Qe.filter(e),u=Qe.some(e=>r[e.id]?.installed==null),d;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,K.jsx)(`div`,{className:`font-mono text-xs uppercase tracking-wide text-muted-foreground`,children:(0,K.jsx)(i,{id:`EVnzPs`})}),t[7]=d):d=t[7];let f;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(f=e=>c(e.target.value),t[8]=f):f=t[8];let p;t[9]===o?p=t[10]:(p=o({id:`Rah7yq`}),t[9]=o,t[10]=p);let m;t[11]===o?m=t[12]:(m=o({id:`ZBt4rI`}),t[11]=o,t[12]=m);let h;t[13]!==s||t[14]!==p||t[15]!==m?(h=(0,K.jsx)(le,{value:s,onChange:f,placeholder:p,"aria-label":m,"data-testid":`edit-with-ai-instruction`}),t[13]=s,t[14]=p,t[15]=m,t[16]=h):h=t[16],l=(0,K.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[d,h,n.length>0?(0,K.jsx)(`div`,{className:`flex flex-col gap-0.5`,children:n.map(e=>(0,K.jsxs)(ce,{type:`button`,variant:`ghost`,className:`w-full justify-start gap-2`,"data-testid":`edit-with-ai-target-${e.id}`,onClick:()=>a(e,s),children:[(0,K.jsx)(Kr,{id:e.id,"aria-hidden":`true`}),(0,K.jsx)(`span`,{children:e.displayName})]},e.id))}):(0,K.jsx)(`p`,{className:`text-sm text-muted-foreground`,"data-testid":`edit-with-ai-empty`,"aria-live":`polite`,children:u?(0,K.jsx)(i,{id:`EcR0fl`}):(0,K.jsx)(i,{id:`l6OXqI`})})]}),t[0]=o,t[1]=r,t[2]=s,t[3]=a,t[4]=l}else l=t[4];return l}function ri(e){let t=(0,J.c)(23),{resolveSelection:r,children:i}=e,{_:a}=n(),{states:o,refresh:c}=Jt(),{dispatch:u}=Lt(),[f,p]=(0,q.useState)(!1),[m,h]=(0,q.useState)(null),g;t[0]!==a||t[1]!==c||t[2]!==r?(g=e=>{if(e){let e;try{e=r()}catch(e){console.error(`Edit with AI: could not read the selection`,e),F.error(a({id:`-RXIMO`}));return}h(e),c()}p(e)},t[0]=a,t[1]=c,t[2]=r,t[3]=g):g=t[3];let _=g,v;t[4]!==a||t[5]!==u||t[6]!==m?(v=(e,t)=>{if(m!==null){let n=Et({docName:m.docName,workspace:m.workspace,instruction:t,selectionMarkdown:m.selectionMarkdown});n===null?F.error(a({id:`_VRtd7`})):u(e.id,n)}p(!1)},t[4]=a,t[5]=u,t[6]=m,t[7]=v):v=t[7];let y=v,b;t[8]===i?b=t[9]:(b=(0,K.jsx)(l,{asChild:!0,children:i}),t[8]=i,t[9]=b);let x;t[10]===a?x=t[11]:(x=a({id:`EVnzPs`}),t[10]=a,t[11]=x);let S;t[12]!==y||t[13]!==o?(S=(0,K.jsx)(ni,{installStates:o,onPick:y}),t[12]=y,t[13]=o,t[14]=S):S=t[14];let C;t[15]!==x||t[16]!==S?(C=(0,K.jsx)(s,{align:`start`,"aria-label":x,"data-testid":`edit-with-ai-popover`,children:S}),t[15]=x,t[16]=S,t[17]=C):C=t[17];let w;return t[18]!==_||t[19]!==f||t[20]!==b||t[21]!==C?(w=(0,K.jsxs)(d,{open:f,onOpenChange:_,children:[b,C]}),t[18]=_,t[19]=f,t[20]=b,t[21]=C,t[22]=w):w=t[22],w}function ii(e){let t=f(e.state.selection.content(),e.state.schema);return g().serialize(t).trim()}function ai(e){let{from:t,to:n}=e.selection.main;return e.sliceDoc(t,n)}export{Dt as _,Kr as a,xt as b,sn as c,Qt as d,Zt as f,wt as g,Ct as h,$r as i,cn as l,Tt as m,ii as n,Qr as o,Jt as p,ri as r,Wr as s,ai as t,$t as u,Lt as v,Qe as x,St as y};
|
package/dist/public/index.html
CHANGED
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
-->
|
|
49
49
|
<script>(() => { let t = 'system'; try { const r = localStorage.getItem('ok-theme-v1'); if (r === 'light' || r === 'dark' || r === 'system') t = r; } catch {} let dark = t === 'dark'; if (t === 'system') { try { dark = window.matchMedia('(prefers-color-scheme: dark)').matches; } catch {} } if (dark) document.documentElement.classList.add('dark'); if (window.okDesktop) document.documentElement.classList.add('electron-mode'); })();</script>
|
|
50
50
|
<style>html { background-color: #fafafa } html.dark { background-color: #171717 }</style>
|
|
51
|
-
<script type="module" crossorigin src="./assets/index-
|
|
51
|
+
<script type="module" crossorigin src="./assets/index-C96Loq20.js"></script>
|
|
52
52
|
<link rel="modulepreload" crossorigin href="./assets/chunk-CFjPhJqf.js">
|
|
53
53
|
<link rel="modulepreload" crossorigin href="./assets/preload-helper-2ej06EnG.js">
|
|
54
54
|
<link rel="modulepreload" crossorigin href="./assets/w3c-keyname-BSTW6KzM.js">
|
|
@@ -61,27 +61,27 @@
|
|
|
61
61
|
<link rel="modulepreload" crossorigin href="./assets/compiler-runtime-Cs91PcD2.js">
|
|
62
62
|
<link rel="modulepreload" crossorigin href="./assets/trace-api-3dczfLSc.js">
|
|
63
63
|
<link rel="modulepreload" crossorigin href="./assets/button-DenIdY-r.js">
|
|
64
|
-
<link rel="modulepreload" crossorigin href="./assets/prop-types-
|
|
64
|
+
<link rel="modulepreload" crossorigin href="./assets/prop-types-CGu0ru1E.js">
|
|
65
65
|
<link rel="modulepreload" crossorigin href="./assets/propagation-api-CobBjsTC.js">
|
|
66
66
|
<link rel="modulepreload" crossorigin href="./assets/collapsible-BhpeB6tu.js">
|
|
67
67
|
<link rel="modulepreload" crossorigin href="./assets/dialog-nKg9NzaE.js">
|
|
68
|
-
<link rel="modulepreload" crossorigin href="./assets/DocumentContext-
|
|
69
|
-
<link rel="modulepreload" crossorigin href="./assets/dist-
|
|
70
|
-
<link rel="modulepreload" crossorigin href="./assets/dropdown-menu-
|
|
68
|
+
<link rel="modulepreload" crossorigin href="./assets/DocumentContext-BRfvUgZV.js">
|
|
69
|
+
<link rel="modulepreload" crossorigin href="./assets/dist-CtVt9wZe.js">
|
|
70
|
+
<link rel="modulepreload" crossorigin href="./assets/dropdown-menu-CGgRqddr.js">
|
|
71
71
|
<link rel="modulepreload" crossorigin href="./assets/panel-BNBODYwB.js">
|
|
72
72
|
<link rel="modulepreload" crossorigin href="./assets/cursor-f-dht0b0.js">
|
|
73
|
-
<link rel="modulepreload" crossorigin href="./assets/typing-burst-detector-
|
|
73
|
+
<link rel="modulepreload" crossorigin href="./assets/typing-burst-detector-Ty1Gy_nX.js">
|
|
74
74
|
<link rel="modulepreload" crossorigin href="./assets/checkbox-DoU3OXGx.js">
|
|
75
75
|
<link rel="modulepreload" crossorigin href="./assets/label-XH11jREQ.js">
|
|
76
|
-
<link rel="modulepreload" crossorigin href="./assets/toggle-group-
|
|
76
|
+
<link rel="modulepreload" crossorigin href="./assets/toggle-group-Dy2sV5Bv.js">
|
|
77
77
|
<link rel="modulepreload" crossorigin href="./assets/textarea-Bt3y5Hxz.js">
|
|
78
|
-
<link rel="modulepreload" crossorigin href="./assets/config-validation-events-
|
|
78
|
+
<link rel="modulepreload" crossorigin href="./assets/config-validation-events-BWyyZh-d.js">
|
|
79
79
|
<link rel="modulepreload" crossorigin href="./assets/agent-presence-4UV17fwS.js">
|
|
80
|
-
<link rel="modulepreload" crossorigin href="./assets/target-navigation-intent-
|
|
80
|
+
<link rel="modulepreload" crossorigin href="./assets/target-navigation-intent-DQPHklQL.js">
|
|
81
81
|
<link rel="modulepreload" crossorigin href="./assets/project-paths-CsGHlmFh.js">
|
|
82
82
|
<link rel="modulepreload" crossorigin href="./assets/mcp-consent-store-CijO54Jd.js">
|
|
83
83
|
<link rel="stylesheet" crossorigin href="./assets/DocumentContext-B0sQn39F.css">
|
|
84
|
-
<link rel="stylesheet" crossorigin href="./assets/index-
|
|
84
|
+
<link rel="stylesheet" crossorigin href="./assets/index-Bco5OsBq.css">
|
|
85
85
|
</head>
|
|
86
86
|
|
|
87
87
|
<body class="antialiased">
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-DXB73IDG-DfmyzFzL.mjs";import{n as e}from"./chunk-A4HU7SVR-hefV_YmW.mjs";export{e as pwdCommand};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./chunk-R6VWJ2ZL-
|
|
1
|
+
import"./chunk-R6VWJ2ZL-DSqbA7Rj.mjs";import"./chunk-CWQS3NFK-BQ5SUtd7.mjs";import"./chunk-DXB73IDG-DfmyzFzL.mjs";import{t as e}from"./chunk-5QMZ5MUS-SLhNX8t9.mjs";import{n as t,t as n}from"./chunk-A5O5YHGN-DQP-O5US.mjs";import{r}from"./chunk-OJDRYQWQ-D4lSWh0K.mjs";import{n as i}from"./chunk-24IMIIXA-_PX4ITYZ.mjs";import{n as a,t as o}from"./chunk-3THT3N7L-DrzOuTpA.mjs";import{t as s}from"./chunk-44UOCSGV-BbZqjKvt.mjs";import{r as c,t as l}from"./chunk-74CEPOFO-D1bzz49u.mjs";import{n as u,t as d}from"./chunk-I57KEIP3-C9JW7Nfp.mjs";import{fileURLToPath as f}from"node:url";import{Worker as p}from"node:worker_threads";import{randomBytes as m}from"node:crypto";var h=1e4,g=6e4,_={name:`python3`,summary:`Execute Python code via CPython Emscripten`,usage:`python3 [OPTIONS] [-c CODE | -m MODULE | FILE] [ARGS...]`,description:[`Execute Python code using CPython compiled to WebAssembly via Emscripten.`,``,`This command runs Python in an isolated environment with access to`,`the virtual filesystem. Standard library modules are available.`],options:[`-c CODE Execute CODE as Python script`,`-m MODULE Run library module as a script`,`--version Show Python version`,`--help Show this help`],examples:[`python3 -c "print(1 + 2)"`,`python3 -c "import sys; print(sys.version)"`,`python3 script.py`,`python3 script.py arg1 arg2`,`echo 'print("hello")' | python3`],notes:[`CPython runs in WebAssembly, so execution may be slower than native Python.`,`Standard library modules are available (no pip install).`,`Maximum execution time is 30 seconds by default.`]};function v(e){let t={code:null,module:null,scriptFile:null,showVersion:!1,scriptArgs:[]};if(e.length===0)return t;let n=e.findIndex(e=>!e.startsWith(`-`)||e===`-`||e===`--`);for(let r=0;r<(n===-1?e.length:n);r++){let n=e[r];if(n===`-c`)return r+1>=e.length?{stdout:``,stderr:`python3: option requires an argument -- 'c'
|
|
2
2
|
`,exitCode:2}:(t.code=e[r+1],t.scriptArgs=e.slice(r+2),t);if(n===`-m`)return r+1>=e.length?{stdout:``,stderr:`python3: option requires an argument -- 'm'
|
|
3
3
|
`,exitCode:2}:(t.module=e[r+1],t.scriptArgs=e.slice(r+2),t);if(n===`--version`||n===`-V`)return t.showVersion=!0,t;if(n.startsWith(`-`)&&n!==`-`)return{stdout:``,stderr:`python3: unrecognized option '${n}'
|
|
4
4
|
`,exitCode:2}}if(n!==-1){let r=e[n];r===`--`?n+1<e.length&&(t.scriptFile=e[n+1],t.scriptArgs=e.slice(n+2)):(t.scriptFile=r,t.scriptArgs=e.slice(n+1))}return t}var y=new WeakMap;function b(e){let t=y.get(e);return t||(t={executionQueue:[],isExecuting:!1},y.set(e,t)),t}var x=f(new URL(`./worker.js`,import.meta.url));function S(){return m(16).toString(`hex`)}function C(e,t){if(!e||typeof e!=`object`)return{success:!1,error:`Malformed worker response`};let n=e;return typeof n.protocolToken!=`string`||n.protocolToken!==t?{success:!1,error:`Malformed worker response: invalid protocol token`}:n.type===`security-violation`?{success:!1,error:`Security violation: ${typeof n.violation?.type==`string`?n.violation.type:`unknown`}`}:typeof n.success==`boolean`?n.success?{success:!0}:{success:!1,error:typeof n.error==`string`&&n.error.length>0?n.error:`Worker execution failed`}:{success:!1,error:`Malformed worker response: missing success flag`}}function w(t){if(t.isExecuting||t.executionQueue.length===0)return;for(;t.executionQueue.length>0&&t.executionQueue[0].canceled;)t.executionQueue.shift();if(t.executionQueue.length===0)return;let n=t.executionQueue.shift();if(!n)return;t.isExecuting=!0;let r;try{r=e.runTrusted(()=>new p(x,{workerData:n.input}))}catch(e){let r=e instanceof Error?e.message:String(e);n.resolve({success:!1,error:o(r)}),t.isExecuting=!1,w(t);return}n.workerRef&&(n.workerRef.current=r);let a=i(n.requireDefenseContext,`python3`,`worker message callback`,e=>{n.resolve(C(e,n.input.protocolToken)),t.isExecuting=!1,r.terminate(),w(t)}),c=i(n.requireDefenseContext,`python3`,`worker error callback`,e=>{let r=o(s(e));n.resolve({success:!1,error:r}),t.isExecuting=!1,w(t)}),l=i(n.requireDefenseContext,`python3`,`worker exit callback`,()=>{t.isExecuting&&(n.resolve({success:!1,error:`Worker exited unexpectedly`}),t.isExecuting=!1,w(t))});r.on(`message`,e=>{try{a(e)}catch(e){let i=e instanceof Error?e.message:String(e);n.resolve({success:!1,error:o(i)}),t.isExecuting=!1,r.terminate(),w(t)}}),r.on(`error`,e=>{try{c(e)}catch(e){let r=e instanceof Error?e.message:String(e);n.resolve({success:!1,error:o(r)}),t.isExecuting=!1,w(t)}}),r.on(`exit`,()=>{try{l()}catch(e){let r=e instanceof Error?e.message:String(e);n.resolve({success:!1,error:o(r)}),t.isExecuting=!1,w(t)}})}async function T(e,a,c,l=[]){let f=u(),p=new d(f,a.fs,a.cwd,`python3`,a.fetch,a.limits?.maxOutputSize??0),m=a.limits?.maxPythonTimeoutMs??h,_=a.fetch?Math.max(m,g):m,v=b(a.fs),y={protocolToken:S(),sharedBuffer:f,pythonCode:e,cwd:a.cwd,env:r(a.env),args:l,scriptPath:c,timeoutMs:_},x={current:null},C=new Promise(e=>{let r={input:y,resolve:()=>{},workerRef:x,requireDefenseContext:a.requireDefenseContext},s=i(a.requireDefenseContext,`python3`,`worker timeout callback`,()=>{x.current?x.current.terminate():r.canceled=!0,e({success:!1,error:`Execution timeout: exceeded ${_}ms limit`})}),c=n(()=>{try{s()}catch(t){e({success:!1,error:o(t instanceof Error?t.message:String(t))})}},_);r.resolve=n=>{t(c),e(n)},v.executionQueue.push(r),w(v)}),[T,E]=await Promise.all([p.run(_).catch(e=>({stdout:``,stderr:`python3: bridge error: ${o(s(e))}
|
|
@@ -9,4 +9,4 @@ import"./chunk-R6VWJ2ZL-FwG_Za20.mjs";import"./chunk-CWQS3NFK-Co4ALolT.mjs";impo
|
|
|
9
9
|
`,exitCode:2};try{r=await t.fs.readFile(e),i=n.scriptFile}catch(e){let t=a(e.message);return{stdout:``,stderr:`python3: can't open file '${n.scriptFile}': ${t}
|
|
10
10
|
`,exitCode:2}}}else if(t.stdin.trim())r=t.stdin,i=`<stdin>`;else return{stdout:``,stderr:`python3: no input provided (use -c CODE, -m MODULE, or provide a script file)
|
|
11
11
|
`,exitCode:2};return T(r,t,i,n.scriptArgs)}},D={name:`python`,async execute(e,t){return E.execute(e,t)}};export{E as python3Command,D as pythonCommand};
|
|
12
|
-
//# sourceMappingURL=python3-AUFTPCU6-
|
|
12
|
+
//# sourceMappingURL=python3-AUFTPCU6-BSuL_Nsg.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-DXB73IDG-DfmyzFzL.mjs";import{n as e}from"./chunk-HJWBQKYG-UZig4wUt.mjs";export{e as readlinkCommand};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n as e,u as t}from"./init-
|
|
2
|
-
//# sourceMappingURL=repair-launch-json-
|
|
1
|
+
import{n as e,u as t}from"./init-B-7x7gxL.mjs";import{t as n}from"./is-object-BXWpSxBI.mjs";import{join as r}from"node:path";import{existsSync as i,readFileSync as a}from"node:fs";const o=[[`@inkeep/open-knowledge`,`ui`],[`-y`,`@inkeep/open-knowledge`,`ui`]];function s(t){if(t.runtimeExecutable!==`npx`||!Array.isArray(t.runtimeArgs))return`preserved`;if(c(t.runtimeArgs,e))return`canonical`;for(let e of o)if(c(t.runtimeArgs,e))return`legacy-bare`;return`preserved`}function c(e,t){if(e.length!==t.length)return!1;for(let n=0;n<t.length;n++)if(e[n]!==t[n])return!1;return!0}function l(e){let o=e.logger??u,c=r(e.projectDir,`.claude`,`launch.json`);if(e.reclaimDisableEnv===`1`)return o({event:`launch-json-repair-skipped`,reason:`reclaim-disabled`}),{outcome:{configPath:c,outcome:`skipped-reclaim-disabled`},repairedCount:0};if(!i(c))return{outcome:{configPath:c,outcome:`no-file`},repairedCount:0};let l;try{let e=a(c,`utf-8`).trim();l=e?JSON.parse(e):{}}catch(e){let t=e instanceof Error?e.message:String(e);return o({event:`launch-json-repair-read-failed`,configPath:c,error:t}),{outcome:{configPath:c,outcome:`read-failed`,error:t},repairedCount:0}}if(!n(l)){let e=`launch.json root is not an object`;return o({event:`launch-json-repair-read-failed`,configPath:c,error:e}),{outcome:{configPath:c,outcome:`read-failed`,error:e},repairedCount:0}}let d=l.configurations;if(!Array.isArray(d))return{outcome:{configPath:c,outcome:`no-entry`},repairedCount:0};let f=d.find(e=>n(e)&&e.name===`open-knowledge-ui`);if(!f)return{outcome:{configPath:c,outcome:`no-entry`},repairedCount:0};let p=s(f);if(p===`canonical`)return{outcome:{configPath:c,outcome:`canonical`},repairedCount:0};if(p===`preserved`)return{outcome:{configPath:c,outcome:`preserved`},repairedCount:0};let m=t(e.projectDir,{mode:`published`});if(m.action===`failed`){let e=m.error??`unknown write failure`;return o({event:`launch-json-repair-write-failed`,configPath:c,error:e}),{outcome:{configPath:c,outcome:`write-failed`,error:e},repairedCount:0}}return o({event:`launch-json-repair-applied`,configPath:c}),{outcome:{configPath:c,outcome:`repaired`},repairedCount:1}}function u(e){process.stderr.write(`${JSON.stringify(e)}\n`)}export{l as repairLaunchJson};
|
|
2
|
+
//# sourceMappingURL=repair-launch-json-D1Xg8LAy.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{_ as e,d as t,g as n,m as r,s as i}from"./init-
|
|
2
|
-
//# sourceMappingURL=repair-mcp-configs-
|
|
1
|
+
import{_ as e,d as t,g as n,m as r,s as i}from"./init-B-7x7gxL.mjs";import{homedir as a}from"node:os";function o(t){return t.command===`npx`&&Array.isArray(t.args)&&s(t.args,e)?`canonical`:`needs-rewrite`}function s(e,t){if(e.length!==t.length)return!1;for(let n=0;n<t.length;n++)if(e[n]!==t[n])return!1;return!0}function c(e){let t=e.logger??f,i=e.home??a(),o=[];if(e.reclaimDisableEnv===`1`)return t({event:`mcp-config-repair-skipped`,reason:`reclaim-disabled`}),{outcomes:o,repairedCount:0};for(let a of r){let r=n[a],s=l(()=>r.configPath(``,i));if(s!==null&&o.push(u({scope:`user`,editorId:a,target:r,home:i,cwd:``,configPath:s,configPathOverride:void 0,logger:t})),r.projectConfigPath){let n=r.projectConfigPath,i=l(()=>n(e.projectDir));i!==null&&o.push(u({scope:`project`,editorId:a,target:r,home:void 0,cwd:e.projectDir,configPath:i,configPathOverride:i,logger:t}))}}return{outcomes:o,repairedCount:o.filter(e=>e.outcome===`repaired`).length}}function l(e){try{return e()}catch{return null}}function u(e){let n={scope:e.scope,editorId:e.editorId,configPath:e.configPath},r=i(e.target,e.cwd,e.home,e.configPathOverride);if(r===null)return{...n,outcome:`no-entry`};if(o(r)===`canonical`)return{...n,outcome:`canonical`};let a=d(r),s=t(e.target,e.cwd,{mode:`published`,skipAvailabilityCheck:!0},e.home,e.configPathOverride);if(s.action===`failed`){let t=s.error??`unknown write failure`;return e.logger({event:`mcp-config-repair-write-failed`,scope:e.scope,editorId:e.editorId,configPath:e.configPath,error:t}),{...n,outcome:`write-failed`,error:t}}return e.logger({event:`mcp-config-reclaim`,scope:e.scope,editorId:e.editorId,configPath:e.configPath,priorCommand:a.priorCommand,priorArgs:a.priorArgs}),{...n,outcome:`repaired`}}function d(e){return{priorCommand:typeof e.command==`string`?e.command.slice(0,200):null,priorArgs:Array.isArray(e.args)?e.args.slice(0,10).map(e=>typeof e==`string`?e.slice(0,200):e):null}}function f(e){process.stderr.write(`${JSON.stringify(e)}\n`)}export{c as repairMcpConfigs};
|
|
2
|
+
//# sourceMappingURL=repair-mcp-configs-CMNHRhif.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./repair-skills-DL08j-QR.mjs";export{e as repairSkills};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{t as e}from"./esm-CEs3LWY3.mjs";import{Br as t,Ln as n,Nn as r,Un as i,kn as a}from"./dist-
|
|
1
|
+
import{t as e}from"./esm-CEs3LWY3.mjs";import{Br as t,Ln as n,Nn as r,Un as i,kn as a}from"./dist-Cn5JHf5F.mjs";import{t as o}from"./write-project-skill-BKowG4Lg.mjs";import{dirname as s,join as c,resolve as l}from"node:path";import{existsSync as u,mkdirSync as d,readFileSync as f,readdirSync as p,rmSync as m,statSync as h,writeFileSync as g}from"node:fs";import{homedir as _}from"node:os";const v=[{hostDir:`.claude`,editorId:`claude`},{hostDir:`.cursor`,editorId:`cursor`},{hostDir:`.agents`,editorId:`codex`}],y=`open-knowledge-discovery`,b=[`.agents`,`skills`,y],x={existsSync:e=>u(e),isDirectory:e=>{try{return h(e).isDirectory()}catch(e){if(e.code===`ENOENT`)return!1;throw e}},readdirSync:e=>p(e),readFileSync:e=>f(e),writeFileSync:(e,t)=>{g(e,t)},mkdirSync:(e,t)=>{d(e,t)},rmSync:(e,t)=>{m(e,t)}},S={resolveProjectBundledSkillDir:()=>i(`project`,{checkDesktop:!1}),resolveDiscoveryBundledSkillDir:()=>i(`discovery`,{checkDesktop:!1}),readBundledVersion:()=>a(),readRecordedVersion:e=>r(e,`cli-hosts`),writeRecordedVersion:(e,n)=>t(e,`cli-hosts`,n,`cli-start`),recordEvent:e=>n(e)};function C(e){process.stderr.write(`${JSON.stringify(e)}\n`)}function w(e,t,n){n.rmSync(t,{recursive:!0,force:!0}),n.mkdirSync(s(t),{recursive:!0}),T(e,t,n)}function T(e,t,n){n.mkdirSync(t,{recursive:!0});for(let r of n.readdirSync(e)){let i=c(e,r),a=c(t,r);n.isDirectory(i)?T(i,a,n):n.writeFileSync(a,n.readFileSync(i))}}function E(e,t,n,r){let i;try{i=t.resolveProjectBundledSkillDir()}catch(e){return r({event:`project-skill-reclaim-bundle-missing`,scope:`project`,error:e instanceof Error?e.message:String(e)}),{outcome:`skipped`,reason:`bundle-missing`}}let a=[];for(let t of v){let s=c(e,t.hostDir,`skills`,`open-knowledge`),l=c(s,`SKILL.md`);if(!n.existsSync(l)){a.push({editorId:t.editorId,hostDir:t.hostDir,path:s,outcome:`no-token`}),r({event:`project-skill-reclaim-no-token`,scope:`project`,editorId:t.editorId,path:s});continue}try{o(s,e),w(i,s,n),a.push({editorId:t.editorId,hostDir:t.hostDir,path:s,outcome:`reclaimed`}),r({event:`project-skill-reclaim-reclaimed`,scope:`project`,editorId:t.editorId,path:s})}catch(e){let n=e instanceof Error?e.message:String(e);a.push({editorId:t.editorId,hostDir:t.hostDir,path:s,outcome:`failed`,error:n}),r({event:`project-skill-reclaim-failed`,scope:`project`,editorId:t.editorId,path:s,error:n})}}return{outcome:`done`,entries:a}}async function D(e,t,n,r){let i=e=>{t.recordEvent(e).catch(()=>{})},a=()=>new Date().toISOString(),o;try{o=await t.readBundledVersion()}catch(e){let t=e instanceof Error?e.message:String(e);return r({event:`user-skill-reclaim-version-read-failed`,scope:`user`,error:t}),i({ts:a(),surface:`cli-start`,target:`cli-hosts`,bundle:`discovery`,outcome:`failed`,reason:`version-read-failed:${t}`}),{outcome:`skipped`,reason:`version-read-failed`}}let s;try{s=await t.readRecordedVersion(e)}catch(e){r({event:`user-skill-reclaim-version-read-error`,scope:`user`,error:e instanceof Error?e.message:String(e)}),s=null}if(s!==null&&s===o)return r({event:`user-skill-reclaim-skipped-version-current`,scope:`user`,version:o}),{outcome:`skipped`,reason:`version-current`};let l;try{l=t.resolveDiscoveryBundledSkillDir()}catch(e){let t=e instanceof Error?e.message:String(e);return r({event:`user-skill-reclaim-bundle-missing`,scope:`user`,error:t}),i({ts:a(),surface:`cli-start`,target:`cli-hosts`,bundle:`discovery`,outcome:`failed`,reason:`bundle-missing:${t}`}),{outcome:`skipped`,reason:`bundle-missing`}}let u=[],d=c(e,...b),f=n.existsSync(d);try{w(l,d,n),u.push({kind:`central`,path:d,outcome:f?`overwritten`:`written`}),r({event:`user-skill-reclaim-central-written`,scope:`user`,path:d,preexisting:f,version:o})}catch(e){let t=e instanceof Error?e.message:String(e);u.push({kind:`central`,path:d,outcome:`failed`,error:t}),r({event:`user-skill-reclaim-central-failed`,scope:`user`,path:d,error:t})}for(let t of v){let i=c(e,t.hostDir),a=c(i,`skills`,y);if(a===d){u.push({kind:`host`,editorId:t.editorId,hostDir:t.hostDir,path:a,outcome:`skipped-collapsed-with-central`});continue}if(!n.existsSync(i)){u.push({kind:`host`,editorId:t.editorId,hostDir:t.hostDir,path:a,outcome:`skipped-host-absent`});continue}let s=n.existsSync(a);try{w(l,a,n),u.push({kind:`host`,editorId:t.editorId,hostDir:t.hostDir,path:a,outcome:s?`overwritten`:`written`}),r({event:`user-skill-reclaim-host-written`,scope:`user`,editorId:t.editorId,hostDir:t.hostDir,path:a,preexisting:s,version:o})}catch(e){let n=e instanceof Error?e.message:String(e);u.push({kind:`host`,editorId:t.editorId,hostDir:t.hostDir,path:a,outcome:`failed`,error:n}),r({event:`user-skill-reclaim-host-failed`,scope:`user`,editorId:t.editorId,hostDir:t.hostDir,path:a,error:n})}}let p=u.find(e=>e.kind===`central`);if(p?.outcome===`written`||p?.outcome===`overwritten`){let n=null;try{await t.writeRecordedVersion(e,o),r({event:`user-skill-reclaim-version-recorded`,scope:`user`,version:o})}catch(e){n=e instanceof Error?e.message:String(e),r({event:`user-skill-reclaim-version-record-failed`,scope:`user`,version:o,error:n})}i({ts:a(),surface:`cli-start`,target:`cli-hosts`,bundle:`discovery`,outcome:n===null?`installed`:`failed`,version:o,...n===null?{}:{reason:`state-write-failed:${n}`}})}else{let e=u.some(e=>e.kind===`host`&&e.outcome===`failed`);i({ts:a(),surface:`cli-start`,target:`cli-hosts`,bundle:`discovery`,outcome:`failed`,version:o,reason:e?`all-writes-failed`:`no-hosts-installed`})}return{outcome:`done`,version:o,entries:u}}async function O(e){let t=e.logger??C,n=e.fs??x,r=e.home??_(),i={...S,...e.deps};return e.reclaimDisableEnv===`1`?(t({event:`skill-repair-skipped`,reason:`reclaim-disabled`}),{status:`skipped`,reason:`reclaim-disabled`}):{status:`done`,project:E(e.projectDir,i,n,t),user:await D(r,i,n,t)}}function k(e){return e.status===`skipped`?e.reason===`reclaim-disabled`?0:1:e.project.outcome===`skipped`||e.user.outcome===`skipped`&&e.user.reason!==`version-current`||e.project.entries.some(e=>e.outcome===`failed`)||e.user.outcome===`done`&&e.user.entries.some(e=>e.outcome===`failed`)?1:0}function A(e){if(e.status===`skipped`)return`Skipped: ${e.reason}`;let t=[`Skill reclaim complete.`];if(e.project.outcome===`done`){let n=e.project.entries.filter(e=>e.outcome===`reclaimed`).length,r=e.project.entries.filter(e=>e.outcome===`no-token`).length,i=e.project.entries.filter(e=>e.outcome===`failed`).length;t.push(` Project: ${n} reclaimed, ${r} no-token, ${i} failed.`)}else t.push(` Project: skipped (${e.project.reason}).`);if(e.user.outcome===`done`){let n=e.user.entries.filter(e=>e.outcome===`written`||e.outcome===`overwritten`).length,r=e.user.entries.filter(e=>e.outcome===`skipped-host-absent`||e.outcome===`skipped-collapsed-with-central`).length,i=e.user.entries.filter(e=>e.outcome===`failed`).length;t.push(` User (${e.user.version}): ${n} written, ${r} skipped, ${i} failed.`)}else t.push(` User: skipped (${e.user.reason}).`);return t.join(`
|
|
2
2
|
`)}function j(){return new e(`repair-skills`).description("Refresh bundled SKILL.md files for installed AI editors (project-local + user-global). Runs automatically during `ok start`; this command forces an explicit sweep.").action(async()=>{let e=await O({projectDir:l(process.cwd()),reclaimDisableEnv:process.env.OK_RECLAIM_DISABLE??null});process.stdout.write(`${A(e)}\n`),process.exitCode=k(e)})}export{j as n,O as t};
|
|
3
|
-
//# sourceMappingURL=repair-skills-
|
|
3
|
+
//# sourceMappingURL=repair-skills-DL08j-QR.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-DXB73IDG-DfmyzFzL.mjs";import{n as e}from"./chunk-QCDB2VPH-D1RuXtOm.mjs";export{e as rev};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-YNYSPYQ5-Dq-BWW-f.mjs";import"./chunk-DXB73IDG-DfmyzFzL.mjs";import"./chunk-7TSDKFEO-a-GUGBTu.mjs";import"./chunk-VLGZJRPG-B678hnuU.mjs";import{t as e}from"./chunk-NYQYO467-nPa6J2DD.mjs";export{e as rgCommand};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-DXB73IDG-DfmyzFzL.mjs";import{n as e}from"./chunk-MIZPJHVH-BPfxJ3C2.mjs";export{e as rmCommand};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-DXB73IDG-DfmyzFzL.mjs";import{n as e}from"./chunk-OCS6LSEM-WwUGJ0am.mjs";export{e as rmdirCommand};
|
package/dist/{rolldown-runtime-twds-ZHy-Dxr-RWJs.mjs → rolldown-runtime-twds-ZHy-DU73unG7.mjs}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r};export{t};
|
|
2
|
-
//# sourceMappingURL=rolldown-runtime-twds-ZHy-
|
|
2
|
+
//# sourceMappingURL=rolldown-runtime-twds-ZHy-DU73unG7.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-YNYSPYQ5-Dq-BWW-f.mjs";import"./chunk-DXB73IDG-DfmyzFzL.mjs";import"./chunk-5QMZ5MUS-SLhNX8t9.mjs";import"./chunk-24IMIIXA-_PX4ITYZ.mjs";import{t as e}from"./chunk-OL3S66CO-DtsweltN.mjs";export{e as sedCommand};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-DXB73IDG-DfmyzFzL.mjs";import{t as e}from"./chunk-A7A2DBEE-PLfkXLI4.mjs";export{e as seqCommand};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-twds-ZHy-
|
|
2
|
-
//# sourceMappingURL=server-lock-BniQ3qki-
|
|
1
|
+
import{t as e}from"./rolldown-runtime-twds-ZHy-DU73unG7.mjs";import{dirname as t,resolve as n}from"node:path";import{closeSync as r,existsSync as i,mkdirSync as a,openSync as o,readFileSync as s,unlinkSync as c,writeFileSync as l,writeSync as u}from"node:fs";import{hostname as d}from"node:os";import{fileURLToPath as f}from"node:url";function p(e){try{return process.kill(e,0),!0}catch(e){return!!(e&&typeof e==`object`&&`code`in e&&e.code===`EPERM`)}}function m(e){return!(typeof e!=`number`||!Number.isInteger(e)||e<2||e>2147483647)}function h(){try{let e=n(t(f(import.meta.url)),`..`,`package.json`),r=JSON.parse(s(e,`utf-8`));if(typeof r.version==`string`&&r.version.length>0)return r.version}catch{}return`0.0.0-unknown`}const g=h(),_=1;var v=class extends Error{existing;lockPath;lockName;constructor(e,t,n){super(`Open Knowledge ${n} already running on port ${e.port} (pid ${e.pid}, started ${e.startedAt}). Stop it first or use a different directory. Lock: ${t}`),this.name=`ProcessLockCollisionError`,this.existing=e,this.lockPath=t,this.lockName=n}};function y(e,t){return n(e,`${t}.lock`)}const b=new Map;function x(e){b.set(e,(b.get(e)??0)+1)}function S(e){let t=b.get(e);return t===void 0||t<=1?(b.delete(e),!0):(b.set(e,t-1),!1)}function C(e,t){try{let n=JSON.parse(s(e,`utf-8`));return n&&typeof n==`object`&&m(n.pid)?n:(console.warn(`${t} Corrupt lock file at ${e} — replacing`),null)}catch{return console.warn(`${t} Corrupt lock file at ${e} — replacing`),null}}function w(e){let{lockName:t,lockDir:n,metadata:s}=e,f=`[${t}-lock]`;a(n,{recursive:!0});let m=y(n,t),h={pid:process.pid,hostname:d(),port:s.port,startedAt:new Date().toISOString(),worktreeRoot:s.worktreeRoot,...s.kind!==void 0&&{kind:s.kind},...s.parentPid!==void 0&&{parentPid:s.parentPid},...s.capabilities!==void 0&&{capabilities:s.capabilities},protocolVersion:s.protocolVersion??1,runtimeVersion:s.runtimeVersion??g},_=JSON.stringify(h,null,2);for(let e=0;e<3;e++){if(!i(m))try{let e=o(m,`wx`,384);try{u(e,_)}finally{r(e)}return x(m),T({lockName:t,lockDir:n,lockPath:m})}catch(e){if(e.code!==`EEXIST`)throw e}let e=C(m,f);if(e){let r=e.hostname===d();if(r&&e.pid===process.pid)return l(m,_,{encoding:`utf-8`,mode:384}),x(m),T({lockName:t,lockDir:n,lockPath:m});if(r&&p(e.pid))throw new v(e,m,t);console.warn(`${f} Stale lock detected (pid=${e.pid}, host=${e.hostname}) — replacing`)}try{c(m)}catch{}}throw Error(`${f} Failed to acquire ${m} after 3 attempts (concurrent acquire contention).`)}function T(e){let{lockName:t,lockDir:n,lockPath:r}=e;return{lockPath:r,release:()=>k({lockName:t,lockDir:n}),updatePort:e=>E({lockName:t,lockDir:n,port:e})}}function E(e){let{lockName:t,lockDir:n,port:r}=e,a=`[${t}-lock]`,o=y(n,t);if(!i(o)){console.warn(`${a} Lock file missing at ${o} during port update — skipping`);return}let c;try{let e=JSON.parse(s(o,`utf-8`));if(!e||typeof e!=`object`||!m(e.pid)){console.warn(`${a} Corrupt lock at ${o} during port update — skipping`);return}c=e}catch{console.warn(`${a} Unreadable lock at ${o} during port update — skipping`);return}if(c.pid===process.pid&&!(typeof c.hostname==`string`&&c.hostname!==d())){c.port=r;try{l(o,JSON.stringify(c,null,2),{encoding:`utf-8`,mode:384})}catch(e){console.warn(`${a} Failed to update port in ${o}: ${e instanceof Error?e.message:String(e)}`)}}}function D(e){let{lockName:t,lockDir:n}=e,r=y(n,t);if(!i(r))return null;let a;try{let e=JSON.parse(s(r,`utf-8`));if(!e||typeof e!=`object`||!m(e.pid))return null;a=e}catch{return null}if(a.hostname!==d())return null;if(!p(a.pid)){try{c(r)}catch{}return null}return a}function O(e){let{lockName:t,lockDir:n}=e,r=y(n,t);if(!i(r))return{status:`absent`};let a;try{a=JSON.parse(s(r,`utf-8`))}catch{return{status:`incompatible`,reason:`corrupt`,raw:void 0}}if(!a||typeof a!=`object`)return{status:`incompatible`,reason:`corrupt`,raw:a};let o=a;if(!m(o.pid)||typeof o.hostname!=`string`||typeof o.port!=`number`||typeof o.startedAt!=`string`||typeof o.worktreeRoot!=`string`)return{status:`incompatible`,reason:`corrupt`,raw:a};let l={pid:o.pid,hostname:o.hostname,port:o.port,startedAt:o.startedAt,worktreeRoot:o.worktreeRoot,protocolVersion:typeof o.protocolVersion==`number`?o.protocolVersion:void 0,runtimeVersion:typeof o.runtimeVersion==`string`?o.runtimeVersion:void 0};if(l.hostname!==d())return{status:`stale`,lock:l};if(!p(l.pid)){try{c(r)}catch{}return{status:`stale`,lock:l}}return l.protocolVersion===void 0||l.runtimeVersion===void 0?{status:`incompatible`,reason:`missing-fields`,raw:a}:{status:`live`,lock:l}}function k(e){let{lockName:t,lockDir:n}=e,r=`[${t}-lock]`,a=y(n,t);if(S(a)&&i(a))try{let e=JSON.parse(s(a,`utf-8`));if(!e||typeof e!=`object`||typeof e.pid!=`number`||e.pid!==process.pid||typeof e.hostname==`string`&&e.hostname!==d())return;c(a)}catch(e){console.warn(`${r} Failed to release ${a}: ${e instanceof Error?e.message:String(e)}`)}}var A=e({ServerLockCollisionError:()=>j,acquireServerLock:()=>M,readServerLock:()=>P,releaseServerLock:()=>F,updateServerLockPort:()=>N}),j=class extends v{constructor(e,t){super(e,t,`server`),this.name=`ServerLockCollisionError`}};function M(e,t){try{return w({lockName:`server`,lockDir:e,metadata:t}).lockPath}catch(e){throw e instanceof v&&e.lockName===`server`?new j(e.existing,e.lockPath):e}}function N(e,t){E({lockName:`server`,lockDir:e,port:t})}function P(e){return D({lockName:`server`,lockDir:e})}function F(e){k({lockName:`server`,lockDir:e})}export{N as _,w as a,m as c,O as d,P as f,E as g,A as h,j as i,y as l,F as m,g as n,M as o,k as p,_ as r,p as s,v as t,D as u};
|
|
2
|
+
//# sourceMappingURL=server-lock-BniQ3qki-C_0QTo_r.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as e}from"./server-lock-BniQ3qki-C_0QTo_r.mjs";export{e as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-DXB73IDG-DfmyzFzL.mjs";import{t as e}from"./chunk-XKQRETAK-cVWA9gEB.mjs";export{e as sha1sumCommand};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-DXB73IDG-DfmyzFzL.mjs";import{t as e}from"./chunk-5V6VZH6T-BCr5_GDF.mjs";export{e as sha256sumCommand};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-DXB73IDG-DfmyzFzL.mjs";import"./chunk-5QMZ5MUS-SLhNX8t9.mjs";import"./chunk-A5O5YHGN-DQP-O5US.mjs";import{n as e}from"./chunk-GOV5EKKI-DNFJiYJI.mjs";export{e as sleepCommand};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-DXB73IDG-DfmyzFzL.mjs";import{n as e}from"./chunk-KMEYNNUA-DfdK88O_.mjs";export{e as sortCommand};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-DXB73IDG-DfmyzFzL.mjs";import{n as e}from"./chunk-MYE6AGBJ-B4pRo9ma.mjs";export{e as split};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-DXB73IDG-DfmyzFzL.mjs";import"./chunk-5QMZ5MUS-SLhNX8t9.mjs";import"./chunk-A5O5YHGN-DQP-O5US.mjs";import"./chunk-24IMIIXA-_PX4ITYZ.mjs";import{t as e}from"./chunk-HWBSOZZR-CFFhOzgy.mjs";export{e as sqlite3Command};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./gh-detect-8zY2NNuZ.mjs";import{d as e,g as t,u as n}from"./init-B-7x7gxL.mjs";import"./loader-CGnAxV-z.mjs";import"./preview-C6NAItZb.mjs";import{n as r}from"./write-project-skill-BKowG4Lg.mjs";import{dirname as i,isAbsolute as a,join as o,relative as s,resolve as c}from"node:path";import{statSync as l}from"node:fs";import{readFile as u,realpath as d}from"node:fs/promises";function f(e){return e.replace(/:\d+$/,``)}function p(e){let t=e.trim();if(!t)return null;{let e=/^https?:\/\/([^/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`https`,hostname:f(e[1]),owner:e[2],name:e[3]}}{let e=/^ssh:\/\/(?:[\w.-]+@)?([^/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`ssh`,hostname:f(e[1]),owner:e[2],name:e[3]}}{let e=/^git:\/\/([^/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`git`,hostname:f(e[1]),owner:e[2],name:e[3]}}{let e=/^(?:[\w.-]+@)?([\w.-]+):([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?$/.exec(t);if(e?.[1].includes(`.`)||e&&t.startsWith(`git@`))return{protocol:`ssh`,hostname:e[1],owner:e[2],name:e[3]}}{let e=/^git:([\w.-]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`git`,hostname:e[1],owner:e[2],name:e[3]}}if(!t.includes(`://`)&&!t.includes(`@`)&&!t.startsWith(`/`)){let e=/^([\w.-]+)\/([\w.\-~%]+?)(?:\.git)?$/.exec(t);if(e)return{protocol:`https`,hostname:`github.com`,owner:e[1],name:e[2]}}return null}function m(e){let t;try{t=new URL(e)}catch{return null}if(t.hostname!==`github.com`&&t.hostname!==`www.github.com`)return null;let n=t.pathname.split(`/`).filter(e=>e.length>0);if(n.length<5||n[2]!==`blob`)return null;let r,i,a,o;try{r=decodeURIComponent(n[0]),i=decodeURIComponent(n[1]),a=decodeURIComponent(n[3]),o=n.slice(4).map(e=>decodeURIComponent(e))}catch{return null}return!r||!i||!a||o.length===0||o.some(e=>e.length===0)?null:{owner:r,repo:i,branch:a,path:o.join(`/`)}}async function h(e,t){let n,r;try{n=await d(c(e)),r=await d(c(i(e)))}catch{return{kind:`not-git`}}if(!g(n,r))return{kind:`symlink-escape`};let s=o(n,`.git`),f;try{f=l(s)}catch{return{kind:`not-git`}}let m;if(f.isDirectory()){let e;try{e=await d(s)}catch{return{kind:`not-git`}}if(!g(e,n))return{kind:`symlink-escape`};m=e}else if(f.isFile()){let e;try{e=await u(s,`utf-8`)}catch{return{kind:`not-git`}}let t=/^gitdir:\s*(.+)$/m.exec(e.trim());if(!t)return{kind:`not-git`};let r=t[1].trim(),i=a(r)?r:c(n,r);try{m=await d(i)}catch{return{kind:`not-git`}}}else return{kind:`not-git`};let h=o(m,`config`),_;try{_=await u(h,`utf-8`)}catch{return{kind:`not-git`}}let y=v(_);if(y===null)return{kind:`no-origin`};let b=p(y);if(b===null||b.hostname!==`github.com`)return{kind:`non-github`};let x=b.owner.toLowerCase()===t.owner.toLowerCase(),S=b.name.toLowerCase()===t.repo.toLowerCase();return!x||!S?{kind:`wrong-repo`,actualOwner:b.owner,actualRepo:b.name}:{kind:`ok`,gitRemoteUrl:`https://github.com/${b.owner}/${b.name}.git`}}function g(e,t){if(e===t)return!0;let n=s(t,e);return n.length>0&&!n.startsWith(`..`)&&!a(n)}function _(e){let t=e.indexOf(`#`),n=e.indexOf(`;`),r=-1;return t>=0&&n>=0?r=Math.min(t,n):t>=0?r=t:n>=0&&(r=n),(r===-1?e:e.slice(0,r)).trim()}function v(e){let t=!1;for(let n of e.split(/\r?\n/)){let e=_(n);if(e.length===0)continue;if(e.startsWith(`[`)){t=/^\[\s*remote\s+["']origin["']\s*\]$/.test(e);continue}if(!t)continue;let r=/^url\s*=\s*(.+)$/.exec(e);if(r)return y(r[1])}return null}function y(e){let t=e.trim();return t.startsWith(`"`)&&t.endsWith(`"`)||t.startsWith(`'`)&&t.endsWith(`'`)?t.slice(1,-1):t}const b=[{id:`mcp-config`,write(t,n,r){let i=t.projectConfigPath?.(n);if(!i)return{integration:`mcp-config`,editorId:t.id,action:`skipped-unsupported`};try{let a=e(t,n,r,void 0,i);return a.action===`written`||a.action===`overwritten`?{integration:`mcp-config`,editorId:t.id,action:a.action,path:a.configPath}:a.action===`failed`?{integration:`mcp-config`,editorId:t.id,action:`failed`,path:a.configPath,error:a.error??`unknown failure`}:{integration:`mcp-config`,editorId:t.id,action:`failed`,path:a.configPath,error:`unexpected project-scope action: ${a.action}`}}catch(e){return{integration:`mcp-config`,editorId:t.id,action:`failed`,path:i,error:e instanceof Error?e.message:String(e)}}}},{id:`project-skill`,write(e,t,n){try{let n=r(e,t);return{integration:`project-skill`,editorId:e.id,action:n.action,...n.path?{path:n.path}:{},...n.error?{error:n.error}:{}}}catch(t){return{integration:`project-skill`,editorId:e.id,action:`failed`,error:t instanceof Error?t.message:String(t)}}}}];function x(e,n,r={},i=b){let a=[];for(let o of n){let n=t[o];for(let t of i)a.push(t.write(n,e,r))}return a}function S(e,t,r={}){return{integrations:x(e,t,r),claudeLaunchJson:t.includes(`claude`)?n(e,r):void 0}}export{p as i,h as n,m as r,S as t};
|
|
2
|
+
//# sourceMappingURL=src-Cc0yKmd-.mjs.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{n as e,t}from"./esm-CEs3LWY3.mjs";import{fn as n,oi as r,pi as i}from"./dist-Cn5JHf5F.mjs";import{i as a,t as o}from"./gh-detect-8zY2NNuZ.mjs";import{n as s}from"./constants-ChqGJV83.mjs";import{spawn as c}from"node:child_process";import{basename as l,join as u}from"node:path";import{closeSync as d,existsSync as f,mkdirSync as p,openSync as m,statSync as h}from"node:fs";import{homedir as g}from"node:os";import{setTimeout as _}from"node:timers/promises";const v=`Open Knowledge.app`,y=`/Applications/${v}`;function b(){return{platform:process.platform,env:process.env,execPath:process.execPath,isTTY:process.stdout.isTTY,statSync:e=>{try{return h(e,{throwIfNoEntry:!1})??null}catch{return null}}}}function x(e){if(e.env.ELECTRON_RUN_AS_NODE===`1`){let t=/(.+?\.app)\/Contents\/MacOS\//.exec(e.execPath);if(t?.[1])return t[1]}if(S(e,y))return y;let t=u(e.homeDir??g(),`Applications`,v);return S(e,t)?t:null}function S(e,t){try{let n=u(t,`Contents`,`MacOS`,`Open Knowledge`),r=e.statSync(n);return r&&typeof r.isFile==`function`?r.isFile():!1}catch{return!1}}function C(e){if(e.env.OK_FORCE_BROWSER===`1`)return{available:!1,reason:`force-browser`};if(e.platform!==`darwin`)return{available:!1,reason:`darwin-only`};let t;try{t=x(e)}catch{return{available:!1,reason:`stat-error`}}return t?e.env.OK_FORCE_DESKTOP===`1`?{available:!0,reason:`available`,bundlePath:t}:e.isTTY!==!0||e.env.SSH_CONNECTION||e.env.SSH_TTY?{available:!1,reason:`headless`,bundlePath:t}:{available:!0,reason:`available`,bundlePath:t}:{available:!1,reason:`no-bundle`}}function w(e){(e.log??(e=>console.error(e)))("Launching Open Knowledge desktop (use `ok start` for the browser server, or `OK_FORCE_BROWSER=1` to always skip)");let t={...process.env};delete t.ELECTRON_RUN_AS_NODE,e.spawn(`open`,[`-b`,`com.inkeep.open-knowledge`],{detached:!0,stdio:`ignore`,env:t}).unref()}function T(e=`no-bundle`){switch(e){case`no-bundle`:return`Desktop app not found at ${y}. Install via DMG, or omit --mode for browser mode.`;case`darwin-only`:return`Desktop app is macOS-only on this release. Use --mode=browser, or omit --mode for the server fallback.`;case`headless`:return`Desktop launch is gated in headless contexts (CI, SSH, non-TTY stdout). Set OK_FORCE_DESKTOP=1 to override, or use --mode=browser.`;case`force-browser`:return`OK_FORCE_BROWSER=1 is set — desktop dispatch is disabled. Unset it to use --mode=app.`;case`stat-error`:return`Failed to inspect desktop bundle at ${y} (filesystem error). Check permissions or use --mode=browser.`;case`available`:return`Desktop app appears available at ${y} but launch dispatch did not fire (caller bug).`}}function E(){let e=process.execPath,t=process.argv[1];return t?{command:e,prefixArgs:[t]}:(console.warn(`[self-spawn] process.argv[1] is empty — falling back to \`npx -y @inkeep/open-knowledge@latest\`. This re-introduces the registry-fetch surface that re-exec was fixing. Observed argv: ${JSON.stringify(process.argv)}`),{command:`npx`,prefixArgs:[`-y`,`@inkeep/open-knowledge@latest`]})}function D(e,t){return e.host??t.HOST??`localhost`}function O(e){let t=l(e).replace(/[^\x20-\x7E]/g,``).trim().slice(0,64);return`open-knowledge-server ${t.length>0?t:`unknown`}`}var k=class extends Error{cwd;constructor(e){super("This directory isn't set up yet. Run `ok init` first, then `ok start` again."),this.name=`OkDirMissingError`,this.cwd=e}};function A(e){return e.uiLock?e.isAlive(e.uiLock.pid)?{action:`skip`,reason:`alive`,pid:e.uiLock.pid,port:e.uiLock.port}:{action:`spawn`,reason:`stale`,stalePid:e.uiLock.pid}:{action:`spawn`,reason:`absent`}}function j(e){f(e.lockDir)||p(e.lockDir,{recursive:!0});let t=m(u(e.lockDir,i),`w`),n=e.spawn??c,{PORT:r,...a}=process.env,o=E();try{let r=n(o.command,[...o.prefixArgs,...e.args??[`ui`]],{detached:!0,stdio:[`ignore`,`ignore`,t],cwd:e.cwd,env:a});return r.unref(),r}finally{try{d(t)}catch{}}}async function M(e){let t=e.now()+e.timeoutMs;for(;e.now()<t;){let t=e.readUiLock();if(t&&t.port>0)return t.port;await e.sleep(e.pollIntervalMs)}let n=e.readUiLock();return n&&n.port>0?n.port:null}const N=r;function P(e){let t=e.sigtermGraceMs??N,n=e.sigtermPollIntervalMs??200,r=e.sleep??(e=>_(e));return async()=>{try{let i=e.readUiLock();if(i&&e.isAlive(i.pid))try{e.killPid(i.pid,`SIGTERM`),e.log?.info({pid:i.pid,port:i.port},`idle-shutdown: SIGTERM UI sibling`);let a=Date.now()+t;for(;Date.now()<a&&e.isAlive(i.pid);)await r(n);if(e.isAlive(i.pid))try{e.killPid(i.pid,`SIGKILL`),e.log?.warn({pid:i.pid,graceMs:t},`idle-shutdown: SIGTERM grace expired — escalated to SIGKILL`)}catch(t){e.log?.error({pid:i.pid,err:t instanceof Error?t.message:String(t)},`idle-shutdown: SIGKILL failed`)}}catch(t){e.log?.warn({pid:i.pid,err:t instanceof Error?t.message:String(t)},`idle-shutdown: failed to SIGTERM UI sibling`)}}catch(t){e.log?.warn({err:t instanceof Error?t.message:String(t)},`idle-shutdown: UI lookup failed; proceeding with destroy`)}await e.destroy()}}async function F(e){let{config:t,cwd:r,host:i}=e,s=e.skipAutoInit??!1,c=e.skipUiAutoSpawn??!1,l=e.idleThresholdMs??18e5,{existsSync:u,mkdirSync:d}=await import(`node:fs`),{bootServer:f,getLogger:p,isProcessAlive:m,readUiLock:h,resolveContentDir:g}=await import(`./dist-9wjL9Ivy.mjs`),v=e.log??p(`start`);if(!s&&!n(r))throw new k(r);let y=process.env.OK_RECLAIM_DISABLE??null;try{(e.repairMcpConfigsFn??(await import(`./repair-mcp-configs-CMNHRhif.mjs`)).repairMcpConfigs)({projectDir:r,reclaimDisableEnv:y})}catch(e){v.warn({err:e},`[start] mcp-config repair sweep failed; continuing`)}try{(e.repairLaunchJsonFn??(await import(`./repair-launch-json-D1Xg8LAy.mjs`)).repairLaunchJson)({projectDir:r,reclaimDisableEnv:y})}catch(e){v.warn({err:e},`[start] launch.json repair sweep failed; continuing`)}try{await(e.repairSkillsFn??(await import(`./repair-skills-7rlg54ML.mjs`)).repairSkills)({projectDir:r,reclaimDisableEnv:y})}catch(e){v.warn({err:e},`[start] skill repair sweep failed; continuing`)}let b=g(t,r);u(b)||(d(b,{recursive:!0}),v.info({contentDir:b},`Created content directory`));let x=null,S=async({lockDir:t})=>{if(x=A({uiLock:h(t),isAlive:m}),x.action===`spawn`&&!c)try{j({lockDir:t,cwd:r,spawn:e.spawn}),v.info({reason:x.reason},`[start] auto-spawned ok ui sibling`)}catch(e){console.warn(`[start] failed to auto-spawn ok ui: ${e instanceof Error?e.message:String(e)}`)}else x.action===`skip`&&v.info({port:x.port,pid:x.pid},`UI already running at port ${x.port}`)},C=e.reactShellDistDir===void 0,w=a(),T=await f({config:t,contentDir:b,projectDir:r,contentRoot:t.content.dir,port:e.port,host:i,quiet:!1,detectGh:o,tokenStore:w,localOpCliArgs:[process.execPath,process.argv[1]],attachUiSibling:C,idleShutdownMs:l,skipAutoInit:!0,...C?{spawnUiSiblingFn:S}:{},idleShutdownHandler:e=>P({readUiLock:()=>h(T.lockDir),isAlive:m,killPid:(e,t)=>{process.kill(e,t)},destroy:e,log:v}),log:v,...e.serveContentAssets?{serveContentAssets:!0}:{},...e.reactShellDistDir?{reactShellDistDir:e.reactShellDistDir}:{}});x||={action:`skip`,reason:`alive`,pid:0,port:0};let E=x,D=null;if(E.action===`skip`)D=E.port>0?E.port:null;else if(!c){let t=e.uiBindTimeoutMs??3e3;D=await M({readUiLock:()=>h(T.lockDir),now:Date.now,sleep:e=>_(e),timeoutMs:t,pollIntervalMs:50}),D===null&&v.warn({timeoutMs:t},`[start] ok ui did not bind within timeout — banner falls back to API URL`)}return{httpServer:T.httpServer,destroy:T.destroy,lockDir:T.lockDir,contentDir:b,port:T.port,ready:T.ready,degraded:T.degraded,uiSpawnDecision:x,resolvedUiPort:D}}function I(t){if(t===`browser`||t===`app`)return t;throw new e(`--mode must be 'browser' or 'app'`)}async function L(e,t){let{renderBanner:n}=await import(`./banner-BEKwr_uU.mjs`),{dim:r,error:i,warning:a}=await import(`./colors-Dl3c2q5r.mjs`),o=process.cwd(),c=e;process.title=O(o);let l=D(t,process.env),u=t.port===void 0?void 0:Number(t.port),d=process.env.PORT?Number(process.env.PORT):void 0,f=u??d,p;try{p=await F({config:c,cwd:o,host:l,port:f,...t.serveContentAssets?{serveContentAssets:!0}:{},...t.reactShellDistDir?{reactShellDistDir:t.reactShellDistDir}:{}})}catch(e){e instanceof k&&(console.error(i(e.message)),process.exit(1));let t=R(e,o,await import(`./dist-9wjL9Ivy.mjs`));t!==null&&(console.error(i(t)),process.exit(1)),console.error(`${i(`Failed to start:`)} ${e instanceof Error?e.stack??e.message:String(e)}`),process.exit(1)}let m=!1,h=async e=>{if(!m){m=!0,console.log(r(`\nShutting down (${e})`));try{await p.destroy()}catch(e){console.error(`${i(`destroy() failed:`)} ${e instanceof Error?e.stack??e.message:String(e)}`),process.exitCode=1}process.exit(process.exitCode??0)}};process.once(`SIGINT`,()=>{h(`SIGINT`)}),process.once(`SIGTERM`,()=>{h(`SIGTERM`)});let g=`http://${l}:${p.port}`,_=l===`0.0.0.0`||l===`::`?`http://0.0.0.0:${p.port}`:void 0,v=p.resolvedUiPort,y=v!==null&&v>0?`http://${l}:${v}`:g;console.log(n({name:`open-knowledge`,version:s,localUrl:y,apiUrl:y===g?void 0:g,networkUrl:_}));let b={"shadow-repo":`Version history and branch-switch safety unavailable`,"file-watcher":`External file changes will not sync to the editor`,"head-watcher":`Git branch switches may cause document inconsistency`};p.ready.then(async()=>{if(p.degraded.length>0){console.log();for(let e of p.degraded){let t=b[e]??`${e} (check server logs for details)`;console.warn(` ${a(`⚠`)} ${a(e)}: ${r(t)}`)}console.log()}if(t.open){let{openBrowser:e}=await import(`./open-browser-C6LU_1mt.mjs`);e(y)}}).catch(e=>{console.error(` ${i(`Server initialization failed:`)} ${e instanceof Error?e.message:String(e)}`)})}function R(e,t,n){let r=n.ServerLockCollisionError;if(r===void 0||!(e instanceof r))return null;try{let e=u(t,`.ok`),r=n.readServerLock(e);return r?r.kind===`interactive`?`Open Knowledge desktop is currently running on this project. Quit it or use --cwd to point elsewhere.`:r.kind===`mcp-spawned`?"An MCP-spawned server holds this lock; it should release on idle-shutdown (~30 min). Or run `ok stop`.":"Open Knowledge server is already running on this project — check `ok status` or `ok stop`.":"Open Knowledge server is already running on this project — check `ok status` or `ok stop`."}catch{return null}}function z(e){return new t(`start`).description(`Start the knowledge base collab server`).option(`-p, --port <port>`,`Server port`,void 0).option(`-H, --host <host>`,`Server host`,void 0).option(`--open`,`Open browser after start`).option(`--mode <mode>`,`Force dispatch mode: 'browser' or 'app'`,I).option(`--serve-content-assets`,`Serve content assets from this server`).option(`--react-shell-dist-dir <path>`,`Serve React shell from <path> (suppresses ok ui sibling)`).action(async t=>{let n=e();if(t.mode===`app`){t.open&&(process.stderr.write(`error: option '--mode=app' cannot be combined with '--open' (--open opens a browser tab against the local server, which app mode does not boot)
|
|
2
|
+
`),process.exit(2));let e=[];if(t.port!==void 0&&e.push(`--port`),t.host!==void 0&&e.push(`--host`),e.length>0){let t=process.env.OK_LOG_LEVEL??`info`;(t===`debug`||t===`trace`)&&console.error(`--mode=app: ignoring ${e.join(`, `)}`)}let n=C(b());if(n.available){w({spawn:c});return}console.error(T(n.reason)),process.exit(1)}await L(n,t)})}export{A as a,L as c,R as d,E as f,w as h,P as i,j as l,C as m,M as n,O as o,b as p,F as r,D as s,k as t,z as u};
|
|
3
|
+
//# sourceMappingURL=start-0fqf2-7A.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as e}from"./start-0fqf2-7A.mjs";export{e as startCommand};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-DXB73IDG-DfmyzFzL.mjs";import{t as e}from"./chunk-5QVNJEHU-BvsipSFW.mjs";export{e as statCommand};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-DXB73IDG-DfmyzFzL.mjs";import{n as e}from"./chunk-VYOJP4TV-BvibOnKG.mjs";export{e as strings};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-DXB73IDG-DfmyzFzL.mjs";import{n as e}from"./chunk-MHTUABJP-dKmK6Hw7.mjs";export{e as tac};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-DXB73IDG-DfmyzFzL.mjs";import{n as e}from"./chunk-DCAAORBQ-BdrR5ttw.mjs";export{e as tailCommand};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-YNYSPYQ5-Dq-BWW-f.mjs";import"./chunk-DXB73IDG-DfmyzFzL.mjs";import"./chunk-5QMZ5MUS-SLhNX8t9.mjs";import{n as e}from"./chunk-BRGMQKJV-Dr9Z7G7y.mjs";export{e as tarCommand};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-DXB73IDG-DfmyzFzL.mjs";import{n as e}from"./chunk-55VFSPNA-DVZfQAzN.mjs";export{e as teeCommand};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-CWQS3NFK-BQ5SUtd7.mjs";import"./chunk-DXB73IDG-DfmyzFzL.mjs";import{n as e}from"./chunk-Z6LRHWXI-CF_r-CgG.mjs";export{e as timeCommand};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-DXB73IDG-DfmyzFzL.mjs";import"./chunk-5QMZ5MUS-SLhNX8t9.mjs";import"./chunk-A5O5YHGN-DQP-O5US.mjs";import{n as e}from"./chunk-YTNYSM6T-KUvMCIKS.mjs";export{e as timeoutCommand};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-DXB73IDG-DfmyzFzL.mjs";import{t as e}from"./chunk-OCLXQMOG-Bktk24jL.mjs";export{e as touchCommand};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-DXB73IDG-DfmyzFzL.mjs";import{n as e}from"./chunk-62RKD26F-Xy18vjr1.mjs";export{e as trCommand};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-DXB73IDG-DfmyzFzL.mjs";import{n as e}from"./chunk-XVDPCNWR-CtK-Xs2O.mjs";export{e as treeCommand};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-DXB73IDG-DfmyzFzL.mjs";import{i as e,t}from"./chunk-R6QSAL5T-CtbJTvt9.mjs";export{e as falseCommand,t as trueCommand};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-DXB73IDG-DfmyzFzL.mjs";import{n as e}from"./chunk-PYSFUGCK-CY7pclEB.mjs";export{e as unexpand};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-DXB73IDG-DfmyzFzL.mjs";import{t as e}from"./chunk-WKFATFPP-DCZdrA8x.mjs";export{e as uniqCommand};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-DXB73IDG-DfmyzFzL.mjs";import{t as e}from"./chunk-GXVXFKBA-993FoPmq.mjs";export{e as wcCommand};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-DXB73IDG-DfmyzFzL.mjs";import{t as e}from"./chunk-A65PWWJC-D7J5l9eq.mjs";export{e as whichCommand};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-DXB73IDG-DfmyzFzL.mjs";import{t as e}from"./chunk-HJQJAYMS-Ci3vsKQW.mjs";export{e as whoami};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Un as e}from"./dist-
|
|
2
|
-
//# sourceMappingURL=write-project-skill-
|
|
1
|
+
import{Un as e}from"./dist-Cn5JHf5F.mjs";import{dirname as t,isAbsolute as n,relative as r,resolve as i,sep as a}from"node:path";import{cpSync as o,existsSync as s,lstatSync as c,mkdirSync as l,realpathSync as u,rmSync as d}from"node:fs";function f(e,o){let s;try{s=u(o)}catch{s=i(o)}let l;try{l=c(e)}catch(e){if(e.code!==`ENOENT`)throw e}if(l?.isSymbolicLink())throw Error(`Refusing to write through a symbolic link at ${e}. Remove the symlink and re-run project setup.`);let d=t(e);for(;d.length>1&&d!==a;){let i;try{i=u(d)}catch(e){if(e.code===`ENOENT`){d=t(d);continue}throw e}let a=r(s,i);if(a===``||!a.startsWith(`..`)&&!n(a))return;throw Error(`Refusing to write at ${e}: ancestor ${d} resolves to ${i}, which is outside the project directory ${s}. A symbolic link in the path likely escapes the project. Remove the symlink and re-run project setup.`)}}function p(n,r){let i=n.projectSkillPath?.(r);if(!i)return{editorId:n.id,label:n.label,action:`skipped-unsupported`,path:``};try{let a=e(`project`,{checkDesktop:!0}),c=t(i);f(c,r);let u=s(i)?`overwritten`:`written`;return d(c,{recursive:!0,force:!0}),l(t(c),{recursive:!0}),o(a,c,{recursive:!0}),{editorId:n.id,label:n.label,action:u,path:i}}catch(e){return{editorId:n.id,label:n.label,action:`failed`,path:i,error:e instanceof Error?e.message:String(e)}}}export{p as n,f as t};
|
|
2
|
+
//# sourceMappingURL=write-project-skill-BKowG4Lg.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-YNYSPYQ5-Dq-BWW-f.mjs";import"./chunk-DXB73IDG-DfmyzFzL.mjs";import"./chunk-5QMZ5MUS-SLhNX8t9.mjs";import"./chunk-24IMIIXA-_PX4ITYZ.mjs";import"./chunk-SYMJJMQ4-0QtKvQIP.mjs";import"./chunk-7TSDKFEO-a-GUGBTu.mjs";import"./chunk-BBXLRYSX-Cxoye6wj.mjs";import"./chunk-F55TLFGB-CezmwFJN.mjs";import{n as e}from"./chunk-UNYNJIFU-BbdoO4yb.mjs";export{e as xanCommand};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-DXB73IDG-DfmyzFzL.mjs";import"./chunk-SYMJJMQ4-0QtKvQIP.mjs";import{c as e}from"./chunk-F55TLFGB-CezmwFJN.mjs";export{e as cmdView};
|