@inkeep/open-knowledge 0.25.0-beta.1 → 0.25.0-beta.11
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-DxvTrQH3.mjs +1 -0
- package/dist/{architectureDiagram-Q4EWVU46-C9cSuC8m.mjs → architectureDiagram-Q4EWVU46-Dwlx8W7J.mjs} +2 -2
- package/dist/assets/skills/discovery/SKILL.md +1 -1
- package/dist/assets/skills/project/SKILL.md +1 -1
- package/dist/awk2-POPGKRAI-6Q9HKhoL.mjs +1 -0
- package/dist/base64-4YMZCVJ5-bqN_UBX0.mjs +1 -0
- package/dist/basename-AA2KJYZQ-GWPOMupJ.mjs +1 -0
- package/dist/bash-IJWYRKFO-C7Yi9aK0.mjs +1 -0
- package/dist/{blockDiagram-DXYQGD6D-Dr7L7QsL.mjs → blockDiagram-DXYQGD6D-D_l7RLVS.mjs} +2 -2
- package/dist/{build-CN003PPg.mjs → build-CCNlCFyu.mjs} +1 -1
- package/dist/build-gfyDk62R.mjs +1 -0
- package/dist/{c4Diagram-AHTNJAMY-CPm6kKNR.mjs → c4Diagram-AHTNJAMY-QadWjRVL.mjs} +2 -2
- package/dist/cat-RDUMLXKC-Cqi4_PjZ.mjs +1 -0
- package/dist/channel-Dq8ADXfq.mjs +2 -0
- package/dist/chmod-SYMGL4JA-C_dD-tNl.mjs +1 -0
- package/dist/{chokidar-oNPiNLWX.mjs → chokidar-D1eNAlbX.mjs} +3 -3
- package/dist/{chunk-24IMIIXA-DaS5XS55.mjs → chunk-24IMIIXA-BoP5OA93.mjs} +2 -2
- package/dist/{chunk-336JU56O-KTMEs5Wk.mjs → chunk-336JU56O-5giJrfiv.mjs} +2 -2
- package/dist/{chunk-3THT3N7L-B1WzJUh4.mjs → chunk-3THT3N7L-CBWmNncQ.mjs} +1 -1
- package/dist/{chunk-426QAEUC-DUpKwtVu.mjs → chunk-426QAEUC-BGn1TCpd.mjs} +2 -2
- package/dist/{chunk-44UOCSGV-BZ6LfyW2.mjs → chunk-44UOCSGV-B6GSHp1s.mjs} +1 -1
- package/dist/{chunk-4TB4RGXK-Ct6WjPoY.mjs → chunk-4TB4RGXK-DWREoP49.mjs} +2 -2
- package/dist/{chunk-5FUZZQ4R-Bf6nbyQG.mjs → chunk-5FUZZQ4R-DFR5eSi-.mjs} +2 -2
- package/dist/{chunk-5PVQY5BW-DUXm3tDu.mjs → chunk-5PVQY5BW-C5V4E1lO.mjs} +2 -2
- package/dist/{chunk-5QMZ5MUS-BwpNU33k.mjs → chunk-5QMZ5MUS-_0tQyQsf.mjs} +2 -2
- package/dist/{chunk-62RKD26F-DebCAz0V.mjs → chunk-62RKD26F-K5NW6_Si.mjs} +2 -2
- package/dist/{chunk-A4JSPFCI-CQJoYugB.mjs → chunk-A4JSPFCI-BA544Kdp.mjs} +2 -2
- package/dist/{chunk-A5O5YHGN-DApqA6Ow.mjs → chunk-A5O5YHGN-Kbs3GRxW.mjs} +2 -2
- package/dist/{chunk-BBXLRYSX-XWD4jM9A.mjs → chunk-BBXLRYSX-OVlWa2B-.mjs} +2 -2
- package/dist/{chunk-BRGMQKJV-CZUkYGAZ.mjs → chunk-BRGMQKJV-DtyxDw61.mjs} +3 -3
- package/dist/{chunk-CR5AFCPT-DN7EAdus.mjs → chunk-CR5AFCPT-BD_awIEP.mjs} +2 -2
- package/dist/{chunk-CWQS3NFK-BkE4vqrf.mjs → chunk-CWQS3NFK-DNm_iIwd.mjs} +1 -1
- package/dist/{chunk-D6CWQ5DW-CF9bBHyK.mjs → chunk-D6CWQ5DW-CaV8X9is.mjs} +2 -2
- package/dist/{chunk-DXB73IDG-F_tmy-Lz.mjs → chunk-DXB73IDG-Bx-Ikbnu.mjs} +1 -1
- package/dist/{chunk-EDXVE4YY-CI4s3JHP.mjs → chunk-EDXVE4YY-B_wA-KGy.mjs} +2 -2
- package/dist/{chunk-ENJZ2VHE-CQwjtY5A.mjs → chunk-ENJZ2VHE-DwiyImt2.mjs} +2 -2
- package/dist/{chunk-F55TLFGB-BZSRX-Vi.mjs → chunk-F55TLFGB-AEzanSfe.mjs} +2 -2
- package/dist/{chunk-FEIOJCZD-NzTooVTc.mjs → chunk-FEIOJCZD-D6YUa1Xl.mjs} +2 -2
- package/dist/{chunk-GFQRA5P5-DbAN9IDm.mjs → chunk-GFQRA5P5-DigWkxW2.mjs} +1 -1
- package/dist/{chunk-GOV5EKKI-CDGzZWfT.mjs → chunk-GOV5EKKI-x0jEbztj.mjs} +2 -2
- package/dist/{chunk-HWBSOZZR-DQTTl_pa.mjs → chunk-HWBSOZZR-DaPTwPxK.mjs} +3 -3
- package/dist/{chunk-I57KEIP3-DSoF8c_0.mjs → chunk-I57KEIP3-DpiJySG6.mjs} +2 -2
- package/dist/{chunk-ICPOFSXX-C--tVIY5.mjs → chunk-ICPOFSXX-D0MVsm4H.mjs} +2 -2
- package/dist/{chunk-IPJHKYVM-CUKythEA.mjs → chunk-IPJHKYVM-DlQCOz2c.mjs} +1 -1
- package/dist/{chunk-J642UCRS-HjD8qpZD.mjs → chunk-J642UCRS-C1PS8Hwf.mjs} +2 -2
- package/dist/{chunk-LPQPILI2-OoVL_l9j.mjs → chunk-LPQPILI2-GOcK96AE.mjs} +2 -2
- package/dist/{chunk-MDDMCKUK-ChL1CU4m.mjs → chunk-MDDMCKUK-CuQlmIio.mjs} +2 -2
- package/dist/{chunk-MIZPJHVH-BD7tHmLL.mjs → chunk-MIZPJHVH-Bo1j-3C3.mjs} +2 -2
- package/dist/{chunk-MLXIYONF-CV7WHBm-.mjs → chunk-MLXIYONF-DRuy-_4a.mjs} +2 -2
- package/dist/{chunk-NAERJDUW-Cyg2DAzO.mjs → chunk-NAERJDUW-0UrOIQ6q.mjs} +2 -2
- package/dist/{chunk-NUYSJFDK-BH2DjyxF.mjs → chunk-NUYSJFDK-BvwS54ju.mjs} +2 -2
- package/dist/{chunk-NYQYO467-CY88QCuT.mjs → chunk-NYQYO467-KfHLMnUW.mjs} +2 -2
- package/dist/{chunk-OARHFVLG-dXiYYC4o.mjs → chunk-OARHFVLG-Csb_cJVS.mjs} +2 -2
- package/dist/{chunk-OCLXQMOG-DOkdFgyf.mjs → chunk-OCLXQMOG-CCPg8vjW.mjs} +2 -2
- package/dist/{chunk-OCS6LSEM-Bcx6uxmm.mjs → chunk-OCS6LSEM-DkbaohJu.mjs} +2 -2
- package/dist/{chunk-OJDRYQWQ-CmrD0Dg2.mjs → chunk-OJDRYQWQ-LGuZyK6R.mjs} +1 -1
- package/dist/{chunk-OL3S66CO-CWEDi2F_.mjs → chunk-OL3S66CO-CBdL6pp1.mjs} +2 -2
- package/dist/{chunk-OYMX7WX6-Dvg98Zb-.mjs → chunk-OYMX7WX6-BrOfVMt8.mjs} +2 -2
- package/dist/{chunk-PBXLG62G-CpvczNyQ.mjs → chunk-PBXLG62G-C7MEQojr.mjs} +2 -2
- package/dist/{chunk-R6VWJ2ZL-BVeTwIsz.mjs → chunk-R6VWJ2ZL-XKIhMSUi.mjs} +1 -1
- package/dist/{chunk-SYMJJMQ4-jdmKoBFb.mjs → chunk-SYMJJMQ4-DUF5hY-A.mjs} +2 -2
- package/dist/{chunk-T56QNPHK-DmDxJbbD.mjs → chunk-T56QNPHK-B6DfVzfs.mjs} +2 -2
- package/dist/{chunk-TLSUDHID-CSDR438C.mjs → chunk-TLSUDHID-SuIGgADo.mjs} +2 -2
- package/dist/{chunk-TOMNU26N-CrDa7MpH.mjs → chunk-TOMNU26N-Dw9Enq1O.mjs} +2 -2
- package/dist/{chunk-U2HBQHQK-C1Q2DiEX.mjs → chunk-U2HBQHQK-DB1SzWgs.mjs} +2 -2
- package/dist/{chunk-UNYNJIFU-CZ2Mla0s.mjs → chunk-UNYNJIFU-HSzsM3a6.mjs} +3 -3
- package/dist/{chunk-VLGZJRPG-DpYP_EVp.mjs → chunk-VLGZJRPG-CHtdu0KZ.mjs} +2 -2
- package/dist/{chunk-X2U36JSP-BiF0R9ys.mjs → chunk-X2U36JSP-CqOGcGN3.mjs} +2 -2
- package/dist/{chunk-XHM67O4N-D3pxE_Og.mjs → chunk-XHM67O4N-2lBQUjKO.mjs} +1 -1
- package/dist/{chunk-XORM457F-BuPOSqOe.mjs → chunk-XORM457F-CJbQLVgU.mjs} +2 -2
- package/dist/{chunk-YCFVLTST-DsF45PbT.mjs → chunk-YCFVLTST-CKzPj8PR.mjs} +2 -2
- package/dist/{chunk-YFG2CMIF-DjdwxBNc.mjs → chunk-YFG2CMIF-DBRGs_rZ.mjs} +2 -2
- package/dist/{chunk-YNYSPYQ5-gU4-j5DO.mjs → chunk-YNYSPYQ5-DHter9G3.mjs} +1 -1
- package/dist/{chunk-YS3AZT3J-CB0wWPLc.mjs → chunk-YS3AZT3J-DwQ3GyQR.mjs} +2 -2
- package/dist/{chunk-YTNYSM6T-DpkSVTln.mjs → chunk-YTNYSM6T-DcovOiF_.mjs} +2 -2
- package/dist/{chunk-YZCP3GAM-DRdMIQsB.mjs → chunk-YZCP3GAM-CkC6DoBJ.mjs} +2 -2
- package/dist/{chunk-Z6LRHWXI-EsbeaQ3V.mjs → chunk-Z6LRHWXI-BLaYoFnT.mjs} +2 -2
- package/dist/{chunk-ZZ45TVLE-DwKS4e_N.mjs → chunk-ZZ45TVLE-CXznFlWR.mjs} +2 -2
- package/dist/classDiagram-6PBFFD2Q-cIblqhKe.mjs +2 -0
- package/dist/classDiagram-v2-HSJHXN6E-CnZ_g-6O.mjs +2 -0
- package/dist/clear-5CZ5X4YR-C4DTv-gF.mjs +1 -0
- package/dist/cli.mjs +69 -57
- package/dist/clone-s6xjJkoz.mjs +2 -0
- package/dist/column-WLPMMSTS-Bg1ZsVDm.mjs +1 -0
- package/dist/comm-5SLSESQG-CTh1BUfn.mjs +1 -0
- package/dist/constants-CDhMxCLo.mjs +2 -0
- package/dist/cp-XOYR4ABJ-VqiK1WcH.mjs +1 -0
- package/dist/{curl-47BFPSFW-xgS5bDTx.mjs → curl-47BFPSFW-ClMENMWY.mjs} +2 -2
- package/dist/cut-OPC3VAGB-BDAM8WY8.mjs +1 -0
- package/dist/{dagre-KV5264BT-Ci7CcQr4.mjs → dagre-KV5264BT-C5SrnhX7.mjs} +2 -2
- package/dist/{dagre-L3rg9n9q.mjs → dagre-LJG-5J7U.mjs} +2 -2
- package/dist/date-DD7FVA2V-nDqDn5ZQ.mjs +1 -0
- package/dist/{diagram-5BDNPKRD-BM3C88Zx.mjs → diagram-5BDNPKRD-biBuhEzo.mjs} +2 -2
- package/dist/{diagram-G4DWMVQ6-Dt1Kt-mj.mjs → diagram-G4DWMVQ6-CHhS5h96.mjs} +2 -2
- package/dist/{diagram-MMDJMWI5-DomPsk0L.mjs → diagram-MMDJMWI5-BgulNwvp.mjs} +2 -2
- package/dist/{diagram-TYMM5635-eOfCqwhs.mjs → diagram-TYMM5635-DpmgERPD.mjs} +2 -2
- package/dist/diff-HJF2MPDN-DSY9AfjL.mjs +1 -0
- package/dist/dirname-LEMTZZFS-VsUIxZwx.mjs +1 -0
- package/dist/{dist-CwoT-vvz.mjs → dist-BrZELwdw.mjs} +25 -17
- package/dist/dist-DWpVFZ0v.mjs +1 -0
- package/dist/du-WO2ENHXQ-Cq3dzRFU.mjs +1 -0
- package/dist/echo-O45JWWI2-B99ElfBo.mjs +1 -0
- package/dist/env-5EPCWSXR-CsaomJHQ.mjs +1 -0
- package/dist/{erDiagram-SMLLAGMA-CPcwhEue.mjs → erDiagram-SMLLAGMA-BNISHenz.mjs} +2 -2
- package/dist/{esm-BS2W3Uzl.mjs → esm-BQ4-CT8p.mjs} +1 -1
- package/dist/{esm-BLMtE3s6.mjs → esm-CsQUg9js.mjs} +1 -1
- package/dist/expand-DTNXU4LQ-Bp3M0RnL.mjs +1 -0
- package/dist/expansion-ENLSRCXJ-C5xjxYTl.mjs +1 -0
- package/dist/expr-5T3UU5KE-DrJUreFq.mjs +1 -0
- package/dist/file-ZIGAJ4YS-D07ChhI1.mjs +1 -0
- package/dist/find-TPUOAIUQ-ZPOxwUwf.mjs +1 -0
- package/dist/{flag-coverage-QT4N2Z44-hqAAghSo.mjs → flag-coverage-QT4N2Z44-BlPYKPtd.mjs} +2 -2
- package/dist/{flowDiagram-DWJPFMVM-WnIxEgSt.mjs → flowDiagram-DWJPFMVM-CFu645eN.mjs} +2 -2
- package/dist/fold-LDSORVYE-Bx5XDGgK.mjs +1 -0
- package/dist/{ganttDiagram-T4ZO3ILL-BJEuIZ2X.mjs → ganttDiagram-T4ZO3ILL-DhKUbpmR.mjs} +2 -2
- package/dist/{getMachineId-bsd-DYQqYqxN.mjs → getMachineId-bsd-Bt-frlcx.mjs} +2 -2
- package/dist/{getMachineId-bsd-B7ue3N1o.mjs → getMachineId-bsd-DC8LkcdK.mjs} +2 -2
- package/dist/{getMachineId-bsd-ucL-2FoT.mjs → getMachineId-bsd-DFsE-K5i.mjs} +2 -2
- package/dist/{getMachineId-darwin-BNCkZc-0.mjs → getMachineId-darwin-B9GQUU0e.mjs} +2 -2
- package/dist/{getMachineId-darwin-CSTYV_Bd.mjs → getMachineId-darwin-DMNBrKWp.mjs} +2 -2
- package/dist/{getMachineId-darwin-DWmBOUuk.mjs → getMachineId-darwin-DRxpszyZ.mjs} +2 -2
- package/dist/{getMachineId-linux-Bv6oOXxT.mjs → getMachineId-linux-B5vQV4C7.mjs} +2 -2
- package/dist/{getMachineId-linux-tTgUzx-Z.mjs → getMachineId-linux-D9dNX75P.mjs} +2 -2
- package/dist/{getMachineId-linux-BaNp1ZEm.mjs → getMachineId-linux-DOv7iOg-.mjs} +2 -2
- package/dist/{getMachineId-unsupported-fh_7WYkB.mjs → getMachineId-unsupported-BQ6KY9w-.mjs} +2 -2
- package/dist/{getMachineId-unsupported-iDvWGFBk.mjs → getMachineId-unsupported-D6sWFm_K.mjs} +2 -2
- package/dist/{getMachineId-unsupported-Kf9p6LJQ.mjs → getMachineId-unsupported-DdAD6gRb.mjs} +2 -2
- package/dist/{getMachineId-win-DQ2s9Z1n.mjs → getMachineId-win-BMQSc3Xj.mjs} +2 -2
- package/dist/{getMachineId-win-Bo1_B38N.mjs → getMachineId-win-BZsHRo32.mjs} +2 -2
- package/dist/{getMachineId-win-DHmdubaR.mjs → getMachineId-win-CpDtoa22.mjs} +2 -2
- package/dist/{gh-detect-C_OoX4ZE.mjs → gh-detect-B0tAImnG.mjs} +3 -3
- package/dist/{git-handle-DY9lXoT3-Cmzgvwd8.mjs → git-handle-BM0b1rwW-DuV-KO4L.mjs} +4 -4
- package/dist/git-handle-D7c_AnSg-mtlScJx8.mjs +1 -0
- package/dist/{gitGraphDiagram-UUTBAWPF-BqA8KMTw.mjs → gitGraphDiagram-UUTBAWPF-Cwemn6Ch.mjs} +2 -2
- package/dist/{graphlib-BI4uS4Lx.mjs → graphlib-5CpUx0Yq.mjs} +2 -2
- package/dist/grep-3AIAIJVR-Bh6KBg6d.mjs +1 -0
- package/dist/gzip-AQXSGOVS-BtiMTiZG.mjs +1 -0
- package/dist/head-HT2B6D2J-DSAed845.mjs +1 -0
- package/dist/help-VVWX7SA5-DCBusWam.mjs +1 -0
- package/dist/history-J4QRNGRO-BwBOMO5i.mjs +1 -0
- package/dist/hostname-BK6HG2DE-_qJ9gN13.mjs +1 -0
- package/dist/html-to-markdown-TFCECAGV-D7XdAo13.mjs +1 -0
- package/dist/index.d.mts +765 -1
- package/dist/index.mjs +1 -1
- package/dist/{infoDiagram-42DDH7IO-0lM1lRCH.mjs → infoDiagram-42DDH7IO-D0XeM9Mm.mjs} +2 -2
- package/dist/init-5g_Az-Di.mjs +321 -0
- package/dist/init-wbCkDiw4.mjs +1 -0
- package/dist/{ishikawaDiagram-UXIWVN3A-j-jlqjJX.mjs → ishikawaDiagram-UXIWVN3A-vTBTHzHj.mjs} +2 -2
- package/dist/join-GG2LDHE5-BMnXfCXQ.mjs +1 -0
- package/dist/{journeyDiagram-VCZTEJTY-BDX_OcrR.mjs → journeyDiagram-VCZTEJTY-Dq1fLo6N.mjs} +2 -2
- package/dist/jq-ODXZBPLY-D3tmTL1R.mjs +1 -0
- package/dist/{js-exec-M6UR76J5-Cu6NIWHE.mjs → js-exec-M6UR76J5-ZESSNIAK.mjs} +2 -2
- package/dist/{kanban-definition-6JOO6SKY-C5XJUD3U.mjs → kanban-definition-6JOO6SKY-B03_bODj.mjs} +2 -2
- package/dist/{katex-DEJL_MaU.mjs → katex-Bif7Db7V.mjs} +1 -1
- package/dist/{lib-CItGM3rN.mjs → lib-CCQO9uWA.mjs} +2 -2
- package/dist/{libesm-Ob3yvbRV.mjs → libesm-_Wi8iuGI.mjs} +1 -1
- package/dist/{line-C6RZPh4T.mjs → line-C62ka-l9.mjs} +2 -2
- package/dist/ln-4TRFBYAT-Byit-TLI.mjs +1 -0
- package/dist/{loader-kYfLQbUq.mjs → loader-BkrnIaLx.mjs} +3 -3
- package/dist/loader-CaCbNK5z.mjs +1 -0
- package/dist/ls-KSXFZCWH-CNZ_hN8P.mjs +1 -0
- package/dist/{lzma-DBkyKSY9.mjs → lzma-BSEvzrCT.mjs} +2 -2
- package/dist/md5sum-INMIK4DX-pTX2tfQd.mjs +1 -0
- package/dist/{mermaid.core-CcmmzbTt.mjs → mermaid.core-LrO0u_wA.mjs} +3 -3
- package/dist/{mindmap-definition-QFDTVHPH-WLdthwDy.mjs → mindmap-definition-QFDTVHPH-b0aFdJAS.mjs} +2 -2
- package/dist/mkdir-TDEMSB6C-Bl16kSBR.mjs +1 -0
- package/dist/mv-Z6MORUFL-D9pw6nb9.mjs +1 -0
- package/dist/nl-U5YJDM32-Bs_nMrMg.mjs +1 -0
- package/dist/od-VJEF2UR5-DwpkPMHp.mjs +1 -0
- package/dist/paste-7N6AFSDS-C8EyimeA.mjs +1 -0
- package/dist/{pieDiagram-DEJITSTG-7oeIAT-R.mjs → pieDiagram-DEJITSTG-C77h8TOO.mjs} +2 -2
- package/dist/{preview-DcLHmjqA.mjs → preview-CsrNIg5y.mjs} +2 -2
- package/dist/preview-IO1HdLoR.mjs +1 -0
- package/dist/printf-CX64KX2P-2Mks7IIT.mjs +1 -0
- package/dist/public/assets/{ActivityModeContent-BXwyo0tV.js → ActivityModeContent-DWqftzFv.js} +1 -1
- package/dist/public/assets/{ConsentDialogBody-DPw1rTwW.js → ConsentDialogBody-CPX75E6Q.js} +1 -1
- package/dist/public/assets/{DocumentContext-BiJ-_xlQ.js → DocumentContext-BsUMLW8v.js} +1 -1
- package/dist/public/assets/{GraphPanel-D5yxV_ez.js → GraphPanel-CoFIPJeO.js} +1 -1
- package/dist/public/assets/{ManagedArtifactProperties-DrATYt0M.js → ManagedArtifactProperties-aggUCFwm.js} +1 -1
- package/dist/public/assets/McpConsentDialogBody-ByCv3Eox.js +1 -0
- package/dist/public/assets/{PropertyPanel-DDb_pPhO.js → PropertyPanel-y4nVfcC9.js} +1 -1
- package/dist/public/assets/{SettingsDialogBody-Cq52gaLH.js → SettingsDialogBody-e9L5tY2S.js} +1 -1
- package/dist/public/assets/{SkillEditorActions-BEyFie-g.js → SkillEditorActions-B5t0uiA3.js} +1 -1
- package/dist/public/assets/{SourceEditor-Ca3EOrpG.js → SourceEditor-AJMPI3Ro.js} +1 -1
- package/dist/public/assets/{TerminalPanel-Ds-ev2-D.js → TerminalPanel-B_CRJJo1.js} +1 -1
- package/dist/public/assets/{checkbox-DwE0ySFI.js → checkbox-EGJP9xna.js} +1 -1
- package/dist/public/assets/{config-validation-events-xzRhWOFG.js → config-validation-events-CLEET6bq.js} +1 -1
- package/dist/public/assets/{dialog-CvKVTeQa.js → dialog-CIq9aQLf.js} +1 -1
- package/dist/public/assets/dist-SBrtZlNr.js +528 -0
- package/dist/public/assets/{documents-events-CSQluyCM.js → documents-events-CKxqEznK.js} +1 -1
- package/dist/public/assets/{file-tree-adapter-TDYabCI-.js → file-tree-adapter-DWosaWMW.js} +1 -1
- package/dist/public/assets/{index-DqAFQhRc.js → index-CqqK-uHe.js} +93 -93
- package/dist/public/assets/index-Now3zu6y.css +1 -0
- package/dist/public/assets/{keyboard-shortcuts-CZysvuV8.js → keyboard-shortcuts-EKm4qf1P.js} +1 -1
- package/dist/public/assets/{navigation-targets-CXdtVjj4.js → navigation-targets-ESPml90i.js} +1 -1
- package/dist/public/assets/{open-managed-artifact-tab-CvsZjaW-.js → open-managed-artifact-tab-DMcXcdp1.js} +1 -1
- package/dist/public/assets/{prop-types-C_2IQGCC.js → prop-types-DvqQyn4X.js} +1 -1
- package/dist/public/assets/{selection-context-DBzjobL4.js → selection-context-CwsEsiIs.js} +1 -1
- package/dist/public/assets/{skill-actions-5seH6nEr.js → skill-actions-DWigHhCA.js} +1 -1
- package/dist/public/assets/{skills-api-CAh7BbdG.js → skills-api-TIoYtdma.js} +1 -1
- package/dist/public/assets/{target-navigation-intent-C4nLupIH.js → target-navigation-intent-tIHAVN5x.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-DerDTg2m.js → typing-burst-detector-Cfjpkpbz.js} +1 -1
- package/dist/public/index.html +19 -19
- package/dist/pwd-D4OZ7N27-m5fzqroZ.mjs +1 -0
- package/dist/{python3-AUFTPCU6-DmPp1QHj.mjs → python3-AUFTPCU6-B7_jrPM3.mjs} +2 -2
- package/dist/{quadrantDiagram-34T5L4WZ-DWVBhb1E.mjs → quadrantDiagram-34T5L4WZ-CLL-GTlz.mjs} +2 -2
- package/dist/readlink-MI4GCHJF-BMheCA1U.mjs +1 -0
- package/dist/{repair-launch-json-DJ72dZ5s.mjs → repair-launch-json-XeLywT-4.mjs} +2 -2
- package/dist/repair-mcp-configs-fdIPLNhE.mjs +2 -0
- package/dist/repair-skills-CsnYmfEW.mjs +1 -0
- package/dist/repair-skills-pz27DKKD.mjs +3 -0
- package/dist/{requirementDiagram-MS252O5E-Bneel37I.mjs → requirementDiagram-MS252O5E-JIzm76n0.mjs} +2 -2
- package/dist/rev-XOSYPP45-4azlKYu4.mjs +1 -0
- package/dist/rg-FOQSCCX3-ViKChHv5.mjs +1 -0
- package/dist/rm-RTZG23RL-F9g7gQHU.mjs +1 -0
- package/dist/rmdir-XTQXT7RK-CFMuhNvO.mjs +1 -0
- package/dist/{sankeyDiagram-XADWPNL6-4f2f9-uf.mjs → sankeyDiagram-XADWPNL6-Bpk8eTPe.mjs} +2 -2
- package/dist/sed-VFTTATXJ-BfHBQ11q.mjs +1 -0
- package/dist/seq-RN5ZUASB-BaUQfYSh.mjs +1 -0
- package/dist/{sequenceDiagram-FGHM5R23-B1K4VtLp.mjs → sequenceDiagram-FGHM5R23-CHCigzvZ.mjs} +2 -2
- package/dist/server-lock-LsXsWtim-xl6GYqbw.mjs +1 -0
- package/dist/{server-lock-CN2YHwpP-CIPpd1-K.mjs → server-lock-ltHt39S2-B1OizSvN.mjs} +121 -119
- package/dist/sha1sum-VJPNLNU6-NRAU83Yg.mjs +1 -0
- package/dist/sha256sum-PI32XWXY-Cfe-w5CY.mjs +1 -0
- package/dist/sleep-VZFPZFWA-BgSOeH2N.mjs +1 -0
- package/dist/sort-DCNRDA7U-DqMg1dll.mjs +1 -0
- package/dist/split-SITCSYCZ-DqhMcIGL.mjs +1 -0
- package/dist/sqlite3-56UMWEY3-DNmhrHQv.mjs +1 -0
- package/dist/src-CCQnBSjz.mjs +3 -0
- package/dist/start-CCY-wXZz.mjs +1 -0
- package/dist/start-nEiwGZtZ.mjs +3 -0
- package/dist/stat-BT5A227F-DOG39Ce5.mjs +1 -0
- package/dist/{stateDiagram-FHFEXIEX-BREbMXiC.mjs → stateDiagram-FHFEXIEX-CiIJxbDV.mjs} +2 -2
- package/dist/stateDiagram-v2-QKLJ7IA2-CTdt2FVd.mjs +2 -0
- package/dist/strings-7PLOGTPD-l9kho9ff.mjs +1 -0
- package/dist/tac-SJGXQ4T2-DMDGVNTy.mjs +1 -0
- package/dist/tail-S5ULNTJU-knoYRbXD.mjs +1 -0
- package/dist/tar-ANUBEFJY-Db9qg5B2.mjs +1 -0
- package/dist/tee-O7VXZDCO-BgHEibOy.mjs +1 -0
- package/dist/time-DEUO3QV2-CXWA3kJ0.mjs +1 -0
- package/dist/{timeline-definition-GMOUNBTQ-Bd7XEw7o.mjs → timeline-definition-GMOUNBTQ-BBhlpYO9.mjs} +2 -2
- package/dist/timeout-VRKMCG72-aaC7r4sX.mjs +1 -0
- package/dist/touch-DX2IJOQ4-DGiKr2c0.mjs +1 -0
- package/dist/tr-2HXZRDSW-BDNDgux2.mjs +1 -0
- package/dist/tree-LYXBS7DC-BK2c44-E.mjs +1 -0
- package/dist/true-WHJNXCHG-B6CZ-ZF1.mjs +1 -0
- package/dist/unexpand-RGTMIGZM-BWFllY1p.mjs +1 -0
- package/dist/uniq-SUNANL47-CiXMC2Qh.mjs +1 -0
- package/dist/{vennDiagram-DHZGUBPP-Bk-INjRY.mjs → vennDiagram-DHZGUBPP-CATweP9B.mjs} +2 -2
- package/dist/{wardleyDiagram-NUSXRM2D-DOD6wQla.mjs → wardleyDiagram-NUSXRM2D-3qxY3I6a.mjs} +2 -2
- package/dist/wc-TQB3VNOX-Bof613yN.mjs +1 -0
- package/dist/which-XZHEH76L-DfnqWxtA.mjs +1 -0
- package/dist/whoami-DGKU3D2X-DhtD1OhF.mjs +1 -0
- package/dist/{wrapper-BZO_sIci.mjs → wrapper-CGw3ogaz.mjs} +1 -1
- package/dist/write-project-skill-BFtWHJup.mjs +36 -0
- package/dist/xan-BXDXYEIB-I8yansvE.mjs +1 -0
- package/dist/xan-view-ECQUO7AJ-DJhdCPf3.mjs +1 -0
- package/dist/xargs-I6EZUCYF-CdKFilDT.mjs +1 -0
- package/dist/{xychartDiagram-5P7HB3ND-B4AGYFQs.mjs → xychartDiagram-5P7HB3ND-BAWpa2N2.mjs} +2 -2
- package/dist/yazl-Clfc09F-.mjs +1 -0
- package/dist/{yazl-Docqgl6q.mjs → yazl-DgCFuIuD.mjs} +1 -1
- package/dist/yq-MJMAR36V-BXyMiYfX.mjs +1 -0
- package/package.json +1 -1
- package/scripts/aggregate-tolerance-class-fires.ts +15 -0
- package/scripts/build-config-schema.mjs +69 -0
- package/scripts/postinstall.mjs +19 -0
- package/scripts/probe-exec.ts +8 -0
- package/scripts/probe-read-document.ts +12 -0
- package/dist/alias-JE7RI5QX-DmHh8yog.mjs +0 -1
- package/dist/awk2-POPGKRAI-C7696e-z.mjs +0 -1
- package/dist/base64-4YMZCVJ5-BIHNwDj2.mjs +0 -1
- package/dist/basename-AA2KJYZQ-Dcz4Ls85.mjs +0 -1
- package/dist/bash-IJWYRKFO-DgruzS3i.mjs +0 -1
- package/dist/build-Ca40rJCO.mjs +0 -1
- package/dist/cat-RDUMLXKC-BJJIS9lB.mjs +0 -1
- package/dist/channel-DE79NHCf.mjs +0 -2
- package/dist/chmod-SYMGL4JA-C1Ie7s0s.mjs +0 -1
- package/dist/classDiagram-6PBFFD2Q-BrpY9pLd.mjs +0 -2
- package/dist/classDiagram-v2-HSJHXN6E-DDV6mz7Y.mjs +0 -2
- package/dist/clear-5CZ5X4YR-CHSnzs8i.mjs +0 -1
- package/dist/clone-BD_JFVST.mjs +0 -2
- package/dist/column-WLPMMSTS-DTBoovzp.mjs +0 -1
- package/dist/comm-5SLSESQG-DT3SY7zS.mjs +0 -1
- package/dist/constants-C5Kh99hH.mjs +0 -2
- package/dist/cp-XOYR4ABJ-Bs6Rpbb2.mjs +0 -1
- package/dist/cut-OPC3VAGB-Bm1HBn07.mjs +0 -1
- package/dist/date-DD7FVA2V-Dv3os04S.mjs +0 -1
- package/dist/diff-HJF2MPDN-Di-oK2tx.mjs +0 -1
- package/dist/dirname-LEMTZZFS-D-u8wJ0b.mjs +0 -1
- package/dist/dist-tv3SH76A.mjs +0 -1
- package/dist/du-WO2ENHXQ-CO_jR0w6.mjs +0 -1
- package/dist/echo-O45JWWI2-RBT2dq5Y.mjs +0 -1
- package/dist/env-5EPCWSXR-DSwwgRF5.mjs +0 -1
- package/dist/expand-DTNXU4LQ-CtzV8vlq.mjs +0 -1
- package/dist/expansion-ENLSRCXJ-CNi8PTVy.mjs +0 -1
- package/dist/expr-5T3UU5KE-BOXtVHu2.mjs +0 -1
- package/dist/file-ZIGAJ4YS-Bt-1Wusv.mjs +0 -1
- package/dist/find-TPUOAIUQ-CJd25AiD.mjs +0 -1
- package/dist/fold-LDSORVYE-DZ2L21IZ.mjs +0 -1
- package/dist/git-handle-DdgvPBh6-Dv4DjLoy.mjs +0 -1
- package/dist/grep-3AIAIJVR-CzG01gPs.mjs +0 -1
- package/dist/gzip-AQXSGOVS-B_BV2fa3.mjs +0 -1
- package/dist/head-HT2B6D2J-CjBr6WQ1.mjs +0 -1
- package/dist/help-VVWX7SA5-C4HsVKec.mjs +0 -1
- package/dist/history-J4QRNGRO-1CYG7cs0.mjs +0 -1
- package/dist/hostname-BK6HG2DE-BLS00ZWn.mjs +0 -1
- package/dist/html-to-markdown-TFCECAGV-5Fopg2Q5.mjs +0 -1
- package/dist/init-BFySg4cK.mjs +0 -317
- package/dist/init-ByAw3X7-.mjs +0 -1
- package/dist/join-GG2LDHE5-C_A2RnwJ.mjs +0 -1
- package/dist/jq-ODXZBPLY-hdWY1RUY.mjs +0 -1
- package/dist/ln-4TRFBYAT-CMm4PFgi.mjs +0 -1
- package/dist/loader-p811lc-J.mjs +0 -1
- package/dist/ls-KSXFZCWH-Beyjypib.mjs +0 -1
- package/dist/md5sum-INMIK4DX-C2RH1Ljb.mjs +0 -1
- package/dist/mkdir-TDEMSB6C-BeLs_C7x.mjs +0 -1
- package/dist/mv-Z6MORUFL-BDAoI0Wd.mjs +0 -1
- package/dist/nl-U5YJDM32-SP99R3HJ.mjs +0 -1
- package/dist/od-VJEF2UR5-BR0Ho1t5.mjs +0 -1
- package/dist/paste-7N6AFSDS-Bz3kd4hU.mjs +0 -1
- package/dist/preview-BcZ2y0Ew.mjs +0 -1
- package/dist/printf-CX64KX2P-GrZNCK4M.mjs +0 -1
- package/dist/public/assets/McpConsentDialogBody-DnW93Hlu.js +0 -1
- package/dist/public/assets/dist-GmorMgHF.js +0 -524
- package/dist/public/assets/index-HjoM0Lai.css +0 -1
- package/dist/pwd-D4OZ7N27-DDRhZsId.mjs +0 -1
- package/dist/readlink-MI4GCHJF-mNeJ3km7.mjs +0 -1
- package/dist/repair-mcp-configs-CehYsaY5.mjs +0 -2
- package/dist/repair-skills-8Fp4JWM2.mjs +0 -1
- package/dist/repair-skills-qae9fkzx.mjs +0 -3
- package/dist/rev-XOSYPP45-KAKdorsx.mjs +0 -1
- package/dist/rg-FOQSCCX3-BWOdKDEd.mjs +0 -1
- package/dist/rm-RTZG23RL-D4Xj3X_m.mjs +0 -1
- package/dist/rmdir-XTQXT7RK-Bx-u3U5l.mjs +0 -1
- package/dist/sed-VFTTATXJ-DmL_7Y-J.mjs +0 -1
- package/dist/seq-RN5ZUASB-DeaNEJEM.mjs +0 -1
- package/dist/server-lock-8Lv6A-Xa-COMNAqoW.mjs +0 -1
- package/dist/sha1sum-VJPNLNU6-DYUNX0rt.mjs +0 -1
- package/dist/sha256sum-PI32XWXY-BwDMGEnF.mjs +0 -1
- package/dist/sleep-VZFPZFWA-D3IG7CwN.mjs +0 -1
- package/dist/sort-DCNRDA7U-BfL8J8kf.mjs +0 -1
- package/dist/split-SITCSYCZ-Q5NIWguo.mjs +0 -1
- package/dist/sqlite3-56UMWEY3-DA8bw7DG.mjs +0 -1
- package/dist/src-BGnLjdLF.mjs +0 -3
- package/dist/start-BBxjM94q.mjs +0 -1
- package/dist/start-DOnYbt5T.mjs +0 -3
- package/dist/stat-BT5A227F-CYFqsI8W.mjs +0 -1
- package/dist/stateDiagram-v2-QKLJ7IA2-DQeH2s3K.mjs +0 -2
- package/dist/strings-7PLOGTPD-BLW4mXRs.mjs +0 -1
- package/dist/tac-SJGXQ4T2-BGR2Dq7O.mjs +0 -1
- package/dist/tail-S5ULNTJU-BOBd42y5.mjs +0 -1
- package/dist/tar-ANUBEFJY-DCUS8bvA.mjs +0 -1
- package/dist/tee-O7VXZDCO-Bg8MXC_K.mjs +0 -1
- package/dist/time-DEUO3QV2-CxVP9vXG.mjs +0 -1
- package/dist/timeout-VRKMCG72-CVG2Q30a.mjs +0 -1
- package/dist/touch-DX2IJOQ4-DmEja_Fu.mjs +0 -1
- package/dist/tr-2HXZRDSW-DWcyuCoi.mjs +0 -1
- package/dist/tree-LYXBS7DC-CFaeUWGI.mjs +0 -1
- package/dist/true-WHJNXCHG-CJH22fVg.mjs +0 -1
- package/dist/unexpand-RGTMIGZM-Uj1QzdPV.mjs +0 -1
- package/dist/uniq-SUNANL47-MRCnRrGo.mjs +0 -1
- package/dist/wc-TQB3VNOX-JPk1lni-.mjs +0 -1
- package/dist/which-XZHEH76L-Cl63MOrV.mjs +0 -1
- package/dist/whoami-DGKU3D2X-CB3itqHE.mjs +0 -1
- package/dist/write-project-skill-Ta2BaP1w.mjs +0 -12
- package/dist/xan-BXDXYEIB-ZPqGVO90.mjs +0 -1
- package/dist/xan-view-ECQUO7AJ-C-WHEJiv.mjs +0 -1
- package/dist/xargs-I6EZUCYF-BvcSF5Y7.mjs +0 -1
- package/dist/yazl-CQSNnbvt.mjs +0 -1
- package/dist/yq-MJMAR36V-_D_zdU3z.mjs +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -8,25 +8,61 @@ interface GhDetectResult {
|
|
|
8
8
|
type ExecFileSyncFn = typeof execFileSync;
|
|
9
9
|
type FileExistsFn = (path: string) => boolean;
|
|
10
10
|
interface DetectGhOptions {
|
|
11
|
+
/** Injectable for tests. */
|
|
11
12
|
_exec?: ExecFileSyncFn;
|
|
13
|
+
/** Injectable for tests. */
|
|
12
14
|
_fileExists?: FileExistsFn;
|
|
13
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Detect whether `gh` CLI is on PATH (or a known absolute install path) and
|
|
18
|
+
* currently authenticated. Returns the token from `gh auth token` on success.
|
|
19
|
+
*
|
|
20
|
+
* When `host` is provided, scopes the lookup with `--hostname <host>` so a
|
|
21
|
+
* GHES-only login isn't mistaken for github.com auth (or vice versa). Note
|
|
22
|
+
* the flag spelling — `gh auth token` rejects `--host` with "unknown flag";
|
|
23
|
+
* the canonical name is `--hostname` (alias `-h`).
|
|
24
|
+
*
|
|
25
|
+
* Lookup order: bare `gh` via `PATH` first (fast path for shell launches),
|
|
26
|
+
* then `KNOWN_GH_PATHS` in order (only paths that exist on disk are tried).
|
|
27
|
+
* Stops at the first command that returns a non-empty token.
|
|
28
|
+
*/
|
|
14
29
|
declare function detectGh(host?: string, options?: DetectGhOptions): GhDetectResult;
|
|
15
30
|
//#endregion
|
|
16
31
|
//#region src/auth/token-store.d.ts
|
|
32
|
+
/** Stored credential entry keyed by hostname. */
|
|
17
33
|
interface TokenEntry {
|
|
18
34
|
login: string;
|
|
19
35
|
token: string;
|
|
36
|
+
/** Default git protocol for this host (default 'https') */
|
|
20
37
|
gitProtocol?: string;
|
|
38
|
+
/** User display name from OAuth profile, for identity resolution */
|
|
21
39
|
name?: string;
|
|
40
|
+
/** User email from OAuth profile, for identity resolution */
|
|
22
41
|
email?: string;
|
|
23
42
|
}
|
|
43
|
+
/** Unified token storage API. Both backends implement this interface. */
|
|
24
44
|
interface TokenStore {
|
|
45
|
+
/** Which storage mechanism is active */
|
|
25
46
|
readonly backend: 'keyring' | 'file';
|
|
26
47
|
get(host: string): Promise<TokenEntry | null>;
|
|
27
48
|
set(host: string, login: string, token: string, extra?: Pick<TokenEntry, 'gitProtocol' | 'name' | 'email'>): Promise<void>;
|
|
28
49
|
clear(host: string): Promise<void>;
|
|
29
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* Optional observability hooks for the token store. Kept as plain callbacks so
|
|
53
|
+
* `token-store` stays logger-agnostic (it's also constructed in the server
|
|
54
|
+
* push-permission probe path); the credential helper wires these to its file
|
|
55
|
+
* logger. A keychain read that returns nothing reports `absent`
|
|
56
|
+
* (errSecItemNotFound); a read that throws — locked keychain, ACL/access
|
|
57
|
+
* denied, native ABI mismatch — reports `read-error`. A stored entry that
|
|
58
|
+
* fails to JSON-parse reports `corrupt-entry`. The kinds are indistinguishable
|
|
59
|
+
* from the returned `null` alone, which is exactly the signal lost when a
|
|
60
|
+
* credential silently disappears.
|
|
61
|
+
*
|
|
62
|
+
* `error` only ever carries a bounded, value-free token: an `Error.name`
|
|
63
|
+
* (e.g. `SyntaxError`) or a fixed string. Never a full error message — a
|
|
64
|
+
* parse/keychain error message can echo bytes of the stored credential.
|
|
65
|
+
*/
|
|
30
66
|
interface TokenStoreDiagnostics {
|
|
31
67
|
onKeychainRead?: (info: {
|
|
32
68
|
kind: 'absent' | 'read-error' | 'corrupt-entry';
|
|
@@ -38,7 +74,19 @@ interface TokenStoreDiagnostics {
|
|
|
38
74
|
reason?: string;
|
|
39
75
|
}) => void;
|
|
40
76
|
}
|
|
77
|
+
/**
|
|
78
|
+
* Create a TokenStore, preferring the OS keychain (via @napi-rs/keyring) and
|
|
79
|
+
* falling back to a plaintext YAML file at ~/.ok/auth.yml when the
|
|
80
|
+
* native module cannot be loaded.
|
|
81
|
+
*
|
|
82
|
+
* Logs the active backend at INFO level once.
|
|
83
|
+
*/
|
|
41
84
|
declare function createTokenStore(authFile?: string, diag?: TokenStoreDiagnostics): Promise<TokenStore>;
|
|
85
|
+
/**
|
|
86
|
+
* Push-permission-probe-shaped token store. Returns immediately; defers
|
|
87
|
+
* the underlying `createTokenStore()` to the first `.get()` call.
|
|
88
|
+
* Structural shape matches the server's `ProbeTokenStore` interface.
|
|
89
|
+
*/
|
|
42
90
|
declare function makeLazyProbeTokenStore(authFile?: string): {
|
|
43
91
|
get: (host: string) => Promise<{
|
|
44
92
|
token?: string;
|
|
@@ -55,27 +103,125 @@ declare const HOSTS_WITH_USER_SKILL_DIR: readonly {
|
|
|
55
103
|
readonly hostDir: string;
|
|
56
104
|
readonly editorId: CoreEditorId;
|
|
57
105
|
}[];
|
|
106
|
+
/**
|
|
107
|
+
* MCP install modes for `ok init`-written editor configs.
|
|
108
|
+
*
|
|
109
|
+
* - `'published'` (default) — the local platform's resilient chain shape:
|
|
110
|
+
* `{command: '/bin/sh', args: ['-l', '-c', CHAIN_V1]}` on macOS/Linux,
|
|
111
|
+
* `{command: 'powershell', args: ['-NoProfile', '-NonInteractive',
|
|
112
|
+
* '-Command', CHAIN_WIN_V1]}` on Windows.
|
|
113
|
+
* Resolves an installed runtime at spawn time. Byte-identical across all
|
|
114
|
+
* developer machines of the same platform; detect with `isEntryUpToDate`
|
|
115
|
+
* (which recognizes BOTH shapes on every platform).
|
|
116
|
+
* - `'dev'` — `{command: 'node', args: [<dist/cli.mjs>, 'mcp'], env: {...}}`.
|
|
117
|
+
* Used by `--dev-mcp` for monorepo development against a worktree-local CLI.
|
|
118
|
+
*/
|
|
58
119
|
type McpInstallMode = 'published' | 'dev';
|
|
59
120
|
interface McpInstallOptions {
|
|
60
121
|
mode?: McpInstallMode;
|
|
122
|
+
/**
|
|
123
|
+
* Platform whose canonical chain shape to emit; defaults to
|
|
124
|
+
* `process.platform`. Writers never set this — a machine always writes its
|
|
125
|
+
* own platform's shape; tests inject it to pin either shape on any host.
|
|
126
|
+
*/
|
|
127
|
+
platformName?: NodeJS.Platform;
|
|
128
|
+
/**
|
|
129
|
+
* Skip `writeEditorMcpConfig`'s `isEditorTargetAvailable` check. Default
|
|
130
|
+
* `ok init` behavior rejects writes for editors whose config dir doesn't
|
|
131
|
+
* exist — reasonable when the default editor list is being fanned out
|
|
132
|
+
* without user intent. The Desktop consent dialog shows every editor with
|
|
133
|
+
* a checkbox and the user explicitly toggles; their click IS the consent,
|
|
134
|
+
* so the availability check would silently drop the selection.
|
|
135
|
+
* `writeUserMcpConfigs` sets this to `true`; terminal-invoked `ok init`
|
|
136
|
+
* never sets it.
|
|
137
|
+
*/
|
|
61
138
|
skipAvailabilityCheck?: boolean;
|
|
62
139
|
}
|
|
140
|
+
/**
|
|
141
|
+
* True iff the entry matches either platform's chain shape AND embeds that
|
|
142
|
+
* shape's current version sentinel. Reclaim's no-op gate — only entries that
|
|
143
|
+
* pass this check are left untouched. Foreign shapes (legacy bare-npx,
|
|
144
|
+
* bundle-direct, arbitrary customizations, missing/malformed entries) all
|
|
145
|
+
* resolve `false` and trigger a rewrite.
|
|
146
|
+
*
|
|
147
|
+
* BOTH platforms' canonical shapes are recognized on EVERY platform: a
|
|
148
|
+
* committed project config (`.mcp.json`, `.cursor/mcp.json`, …) written on
|
|
149
|
+
* one platform must classify as canonical on the other, or the two
|
|
150
|
+
* platforms' startup reclaim sweeps would rewrite the shared file back and
|
|
151
|
+
* forth forever. Writers always EMIT the local platform's shape; this
|
|
152
|
+
* predicate only decides "leave it alone".
|
|
153
|
+
*
|
|
154
|
+
* The check is intentionally permissive on the chain body — the sentinel
|
|
155
|
+
* version stamp is the only invariant. Future chain edits that don't change
|
|
156
|
+
* the structural contract can keep the sentinel; structural edits (e.g.
|
|
157
|
+
* adding a new probe branch that changes execution order) must bump that
|
|
158
|
+
* platform's sentinel so existing-but-stale entries get rewritten.
|
|
159
|
+
*/
|
|
63
160
|
declare function isEntryUpToDate(entry: unknown): boolean;
|
|
64
161
|
declare function buildManagedServerEntry(options?: McpInstallOptions): Record<string, unknown>;
|
|
162
|
+
/**
|
|
163
|
+
* Security gate for the docked-terminal Claude launch's MCP pre-approval.
|
|
164
|
+
*
|
|
165
|
+
* True iff `entry` is structurally IDENTICAL to one of OK's own canonical
|
|
166
|
+
* PUBLISHED managed entries — the closed two-element set of the Unix shape
|
|
167
|
+
* (`{command:'/bin/sh', args:['-l', '-c', CHAIN_V1]}`) and the Windows shape
|
|
168
|
+
* (`{command:'powershell', args:[…, CHAIN_WIN_V1]}`) — with NO extra keys
|
|
169
|
+
* (an injected `env` on either shape, a different `command`, an appended
|
|
170
|
+
* chain line). Unlike {@link isEntryUpToDate} — deliberately permissive (sentinel
|
|
171
|
+
* substring) for the reclaim flow — this is an EXACT match, so it is sound
|
|
172
|
+
* as a trust boundary: a same-named `mcpServers["open-knowledge"]` entry in
|
|
173
|
+
* a shared/cloned project's `.mcp.json` that points anywhere else (RCE via
|
|
174
|
+
* `command`, tool-poisoning via a URL) fails this and is NOT pre-approved,
|
|
175
|
+
* leaving Claude Code's own "trust this MCP server?" prompt in place.
|
|
176
|
+
* Dev-mode and version-stale OK entries also fail (safe — the user simply
|
|
177
|
+
* sees the prompt). The OTHER platform's canonical is accepted by design: it
|
|
178
|
+
* is byte-exactly OK's own chain, and its interpreter NAME does not resolve
|
|
179
|
+
* on this platform (`/bin/sh` does not exist on Windows; PowerShell Core on
|
|
180
|
+
* macOS/Linux installs as `pwsh`, never `powershell`), so pre-approving it
|
|
181
|
+
* grants nothing an attacker can use. That inertness is load-bearing: a
|
|
182
|
+
* future canonical that names a cross-platform-resolvable interpreter must
|
|
183
|
+
* either keep this gate sound or scope it per-platform.
|
|
184
|
+
*/
|
|
65
185
|
declare function isOwnManagedEntry(entry: unknown): boolean;
|
|
66
186
|
interface EditorMcpTarget {
|
|
67
187
|
id: EditorId;
|
|
188
|
+
/** Human-friendly name for CLI output. */
|
|
68
189
|
label: string;
|
|
190
|
+
/** Resolve the absolute path to the MCP config file. */
|
|
69
191
|
configPath: (cwd: string, home?: string) => string;
|
|
192
|
+
/** On-disk config format for this editor. */
|
|
70
193
|
format: 'json' | 'toml';
|
|
194
|
+
/** Top-level key that holds the server map. */
|
|
71
195
|
topLevelKey: 'mcpServers' | 'servers' | 'mcp_servers' | 'mcp';
|
|
196
|
+
/**
|
|
197
|
+
* Optional second-level key nested under `topLevelKey` that holds the server
|
|
198
|
+
* map, for editors whose config nests it one level deeper — OpenClaw keys
|
|
199
|
+
* servers at `mcp.servers.<name>`. When set, the JSON upsert/read walk the
|
|
200
|
+
* `[topLevelKey, serverMapSubKey, serverName]` path; when absent they use the
|
|
201
|
+
* flat `[topLevelKey, serverName]` every other editor uses. JSON-only.
|
|
202
|
+
*/
|
|
72
203
|
serverMapSubKey?: string;
|
|
204
|
+
/**
|
|
205
|
+
* When true, this editor is only ever written if its config root is present
|
|
206
|
+
* (`detectPath` exists) — the availability check is enforced even in the
|
|
207
|
+
* consent flow's `skipAvailabilityCheck` path. For a global agent gateway like
|
|
208
|
+
* OpenClaw that most users don't run, writing `~/.openclaw/openclaw.json` for a
|
|
209
|
+
* tool that isn't installed is pointless (nothing reads it), so it's gated on
|
|
210
|
+
* detection everywhere. Editors without this flag keep the default behavior:
|
|
211
|
+
* `ok init` gates on detection, but an explicit consent-dialog toggle writes.
|
|
212
|
+
*/
|
|
73
213
|
offerOnlyWhenDetected?: boolean;
|
|
214
|
+
/** Config key used for this project's MCP server entry. */
|
|
74
215
|
serverName: (cwd: string) => string;
|
|
216
|
+
/** Build the server entry object for this editor. */
|
|
75
217
|
buildEntry: (cwd: string, options?: McpInstallOptions) => Record<string, unknown>;
|
|
218
|
+
/** Whether the config is project-local or user-global. */
|
|
76
219
|
scope: 'project' | 'global';
|
|
220
|
+
/** Filesystem path whose existence implies the editor is installed. */
|
|
77
221
|
detectPath?: (cwd: string, home?: string) => string;
|
|
222
|
+
/** Project-local MCP config path (used for project-scope installs). */
|
|
78
223
|
projectConfigPath?: (cwd: string) => string;
|
|
224
|
+
/** Project-local Agent Skill entrypoint, when the editor has a known skill surface. */
|
|
79
225
|
projectSkillPath?: (cwd: string) => string;
|
|
80
226
|
}
|
|
81
227
|
declare const EDITOR_TARGETS: Record<EditorId, EditorMcpTarget>;
|
|
@@ -95,9 +241,64 @@ interface PreviewResult {
|
|
|
95
241
|
declare function previewContent(opts: PreviewOptions): PreviewResult;
|
|
96
242
|
//#endregion
|
|
97
243
|
//#region src/integrations/write-project-skill.d.ts
|
|
244
|
+
/**
|
|
245
|
+
* Guard against project-scope writes that would traverse a symbolic link.
|
|
246
|
+
* Without this check `writeFileSync` and `mkdirSync` follow symlinks, so a
|
|
247
|
+
* pre-existing `.mcp.json -> /etc/passwd` (or similar) planted in a cloned
|
|
248
|
+
* repository would silently overwrite the target file when the user runs
|
|
249
|
+
* `ok init` inside that directory.
|
|
250
|
+
*
|
|
251
|
+
* Refuses two distinct cases:
|
|
252
|
+
* 1. The target path itself is a symbolic link — refuse regardless of
|
|
253
|
+
* where it points; project-scope writes never traverse a symlink at
|
|
254
|
+
* the leaf.
|
|
255
|
+
* 2. The deepest existing ancestor of the target resolves (via realpath)
|
|
256
|
+
* outside the project directory — this catches symlinked parent
|
|
257
|
+
* directories such as `.cursor -> /etc` whose contents would be
|
|
258
|
+
* written into the symlink target rather than the project tree.
|
|
259
|
+
*
|
|
260
|
+
* Allows the legitimate case where intermediate symlinks stay contained
|
|
261
|
+
* inside the project directory.
|
|
262
|
+
*
|
|
263
|
+
* Scope: project-scope writes only. User-scope writes intentionally still
|
|
264
|
+
* follow symlinks because users frequently maintain dotfiles repositories
|
|
265
|
+
* with `~/.cursor/mcp.json` (and friends) symlinked to a managed location.
|
|
266
|
+
*/
|
|
98
267
|
declare function assertProjectPathSafe(targetPath: string, cwd: string): void;
|
|
99
268
|
//#endregion
|
|
100
269
|
//#region src/sharing/git-exclude.d.ts
|
|
270
|
+
/**
|
|
271
|
+
* `sharing/git-exclude.ts` — manage the OK artifact set in `.git/info/exclude`.
|
|
272
|
+
*
|
|
273
|
+
* Single source of truth for the sharing-mode toggle. The user's posture — share OK config with the team
|
|
274
|
+
* (default) or keep it local-only on this machine — is encoded ENTIRELY in
|
|
275
|
+
* `.git/info/exclude`. No parallel registry; `readSharingMode` derives the
|
|
276
|
+
* mode by checking whether any OK artifact appears in the exclude file.
|
|
277
|
+
*
|
|
278
|
+
* Worktree-aware: every read/write resolves the gitdir via
|
|
279
|
+
* `resolveGitDirDetailed` from `@inkeep/open-knowledge-core` so linked
|
|
280
|
+
* worktrees (where `<projectRoot>/.git` is a pointer file) write to the
|
|
281
|
+
* correct `<repo>/.git/worktrees/<name>/info/exclude`, not a non-existent
|
|
282
|
+
* `<projectRoot>/.git/info/exclude`.
|
|
283
|
+
*
|
|
284
|
+
* Every transition to local-only (init `--local-only`, `ok config-sharing unshare`,
|
|
285
|
+
* desktop create radio, desktop settings panel) flows through
|
|
286
|
+
* `addOkPathsToGitExclude`. That function runs `probeTrackedOkPaths`
|
|
287
|
+
* internally and refuses the write when any OK artifact is already tracked
|
|
288
|
+
* upstream — `.git/info/exclude` cannot hide tracked files, so silently
|
|
289
|
+
* completing the operation would mislead the user. One probe site, one
|
|
290
|
+
* refusal site, one diagnostic.
|
|
291
|
+
*/
|
|
292
|
+
/**
|
|
293
|
+
* Result of an `addOkPathsToGitExclude` / `removeOkPathsFromGitExclude` call
|
|
294
|
+
* that completed the variant-matching pass against the exclude file.
|
|
295
|
+
*
|
|
296
|
+
* `no-exclude` is a sub-typed no-op: the gitdir is unresolvable, the
|
|
297
|
+
* resolved gitdir has no `info/` dir, the `.git` pointer is malformed, or
|
|
298
|
+
* the `.git` entry is inaccessible. Callers map each sub-reason to a
|
|
299
|
+
* different user-facing message; all four are non-fatal for sharing-mode
|
|
300
|
+
* itself.
|
|
301
|
+
*/
|
|
101
302
|
type ExcludeWriteResult = {
|
|
102
303
|
kind: 'updated';
|
|
103
304
|
appended: string[];
|
|
@@ -107,20 +308,124 @@ type ExcludeWriteResult = {
|
|
|
107
308
|
kind: 'no-exclude';
|
|
108
309
|
reason: 'no-git' | 'no-info-dir' | 'malformed-pointer' | 'inaccessible';
|
|
109
310
|
};
|
|
311
|
+
/**
|
|
312
|
+
* Refusal returned by `addOkPathsToGitExclude` when one or more candidate
|
|
313
|
+
* paths are already tracked upstream. Carries the pre-formatted remediation
|
|
314
|
+
* message so the CLI and desktop surface identical copy.
|
|
315
|
+
*/
|
|
110
316
|
interface TrackedRefusal {
|
|
111
317
|
kind: 'refused-tracked';
|
|
318
|
+
/** Paths currently tracked upstream (subset of the input `paths`). */
|
|
112
319
|
tracked: string[];
|
|
320
|
+
/** Pre-formatted, multi-line user-facing diagnostic. */
|
|
113
321
|
remediation: string;
|
|
114
322
|
}
|
|
323
|
+
/** Resolved sharing-mode reading derived from `.git/info/exclude` content. */
|
|
115
324
|
type SharingMode = 'shared' | 'local-only' | 'no-git';
|
|
325
|
+
/**
|
|
326
|
+
* Return the canonical OK artifact set for a project. Artifact classes:
|
|
327
|
+
*
|
|
328
|
+
* - `.ok/` — whole-tree, config + folder configs
|
|
329
|
+
* - `.okignore` — project ignore file (gitignore syntax)
|
|
330
|
+
* - `.mcp.json` — Claude Code project MCP (merged file)
|
|
331
|
+
* - `.cursor/mcp.json` — Cursor project MCP (merged file)
|
|
332
|
+
* - `.codex/config.toml` — Codex project MCP (merged file)
|
|
333
|
+
* - `.claude/skills/open-knowledge/` — Claude project SKILL.md bundle (whole-tree)
|
|
334
|
+
* - `.cursor/skills/open-knowledge/` — Cursor project SKILL.md bundle (whole-tree)
|
|
335
|
+
* - `.codex/skills/open-knowledge/` — Codex project SKILL.md bundle (whole-tree)
|
|
336
|
+
* - `.claude/launch.json` — Claude launcher entry (merged file)
|
|
337
|
+
*
|
|
338
|
+
* `.ok/` and `.okignore` are emitted UNANCHORED (slash-free). gitignore
|
|
339
|
+
* matches a slash-free pattern at every depth, so one entry each covers the
|
|
340
|
+
* project-root `.ok/` (where `config.yml` lives — it is read from
|
|
341
|
+
* `<projectRoot>/.ok/`, regardless of `content.dir`), the content-dir copy,
|
|
342
|
+
* and folder-nested copies. This is intentionally content.dir-independent:
|
|
343
|
+
* anchoring to `<contentDir>/.ok/` misses the project-root config dir
|
|
344
|
+
* whenever `content.dir` is a subdirectory, leaving the primary OK config
|
|
345
|
+
* committable in local-only mode.
|
|
346
|
+
*
|
|
347
|
+
* Returns POSIX-separated, project-root-relative paths. Directory entries
|
|
348
|
+
* carry a trailing `/` so the gitignore syntax in `.git/info/exclude` treats
|
|
349
|
+
* them as whole-tree excludes; file entries do not.
|
|
350
|
+
*
|
|
351
|
+
* Derives the per-editor `projectConfigPath` / `projectSkillPath` slots from
|
|
352
|
+
* `EDITOR_TARGETS` so a future editor entry with project-scope artifacts
|
|
353
|
+
* flows through automatically — no hand-maintained list.
|
|
354
|
+
*/
|
|
116
355
|
declare function getOkArtifactPaths(projectRoot: string): readonly string[];
|
|
356
|
+
/**
|
|
357
|
+
* Append each path to `<gitdir>/info/exclude`, idempotent against the four
|
|
358
|
+
* recognized variants per path. Runs `probeTrackedOkPaths` FIRST — when any
|
|
359
|
+
* candidate path is tracked upstream, returns `TrackedRefusal` and does NOT
|
|
360
|
+
* write. The probe runs at exactly one site (this function) so the
|
|
361
|
+
* safety check fires uniformly across every transition to local-only.
|
|
362
|
+
*
|
|
363
|
+
* Returns `kind: 'updated'` on a successful append-or-noop pass. The
|
|
364
|
+
* `appended` and `alreadyPresent` arrays partition the input.
|
|
365
|
+
*
|
|
366
|
+
* Returns `kind: 'no-exclude'` when the gitdir / info-dir is unresolvable;
|
|
367
|
+
* callers treat this as a no-op (sharing-mode is a `.git`-only feature, and
|
|
368
|
+
* a non-git project has nothing to opt out of).
|
|
369
|
+
*/
|
|
117
370
|
declare function addOkPathsToGitExclude(projectRoot: string, paths: readonly string[]): ExcludeWriteResult | TrackedRefusal;
|
|
371
|
+
/**
|
|
372
|
+
* Remove every line in `<gitdir>/info/exclude` that matches any of the
|
|
373
|
+
* four recognized variants for any path. Preserves every other line
|
|
374
|
+
* byte-identical — no whitespace normalization, no reordering, no
|
|
375
|
+
* surrounding-line touching. The variant set is the same one
|
|
376
|
+
* `addOkPathsToGitExclude` and `readSharingMode` use, so add-remove-add
|
|
377
|
+
* cycles round-trip cleanly.
|
|
378
|
+
*
|
|
379
|
+
* No tracked-files probe: going local-only → shared cannot create a
|
|
380
|
+
* tracking conflict (tracking state is orthogonal to the exclude file).
|
|
381
|
+
*/
|
|
118
382
|
declare function removeOkPathsFromGitExclude(projectRoot: string, paths: readonly string[]): ExcludeWriteResult;
|
|
383
|
+
/**
|
|
384
|
+
* Read the current sharing mode. `local-only` iff at least one variant for
|
|
385
|
+
* any path in `getOkArtifactPaths(projectRoot)` appears in
|
|
386
|
+
* `.git/info/exclude`. `shared` when none match. `no-git` when the gitdir
|
|
387
|
+
* is unresolvable (non-git project, malformed pointer, or inaccessible).
|
|
388
|
+
*
|
|
389
|
+
* Pure read — never throws, never writes. Safe to call from the desktop UI
|
|
390
|
+
* mount path or from CI lockfile scripts.
|
|
391
|
+
*/
|
|
119
392
|
declare function readSharingMode(projectRoot: string): SharingMode;
|
|
393
|
+
/**
|
|
394
|
+
* Return the subset of `getOkArtifactPaths(projectRoot)` that currently
|
|
395
|
+
* appears in `.git/info/exclude` (matched via the canonical four-variant
|
|
396
|
+
* spelling tolerance). Pure read — never writes, never throws. Empty array
|
|
397
|
+
* when the gitdir is unresolvable.
|
|
398
|
+
*
|
|
399
|
+
* Used by `ok config-sharing status` to render the excluded-paths section and by
|
|
400
|
+
* the desktop settings panel for the equivalent UI list. Lives next to
|
|
401
|
+
* `readSharingMode` so both observable read paths share one variant-match
|
|
402
|
+
* implementation — no `excludeFileContains`-style duplicate.
|
|
403
|
+
*/
|
|
120
404
|
declare function getExcludedOkPaths(projectRoot: string): readonly string[];
|
|
405
|
+
/**
|
|
406
|
+
* Pure probe — checks which of `paths` (if any) are currently tracked
|
|
407
|
+
* upstream via `git ls-files --error-unmatch`. Used at exactly one site
|
|
408
|
+
* inside `addOkPathsToGitExclude`, plus by `ok config-sharing status` to surface
|
|
409
|
+
* the tracked set in the read-only report. Skips paths that don't exist
|
|
410
|
+
* on disk — there's nothing to potentially conflict.
|
|
411
|
+
*
|
|
412
|
+
* `git ls-files --error-unmatch <p>` exits 0 iff at least one index entry
|
|
413
|
+
* matches the pathspec. Works for both files and directories — the
|
|
414
|
+
* directory form expands to "any tracked file under this path."
|
|
415
|
+
*/
|
|
121
416
|
declare function probeTrackedOkPaths(projectRoot: string, paths: readonly string[]): {
|
|
122
417
|
tracked: string[];
|
|
123
418
|
};
|
|
419
|
+
/**
|
|
420
|
+
* Format the tracked-files diagnostic. Single source of truth for the
|
|
421
|
+
* remediation copy — the CLI prints it to stderr, the desktop modal
|
|
422
|
+
* renders the same string.
|
|
423
|
+
*
|
|
424
|
+
* The hand-crafted shape lists each tracked path, names the exact
|
|
425
|
+
* `git rm --cached` command for each, and warns about the
|
|
426
|
+
* teammate-side-effect of an `rm --cached` (the deletion propagates on
|
|
427
|
+
* next pull). Loud and explicit.
|
|
428
|
+
*/
|
|
124
429
|
declare function formatTrackedRemediation(tracked: readonly string[]): string;
|
|
125
430
|
//#endregion
|
|
126
431
|
//#region src/commands/init.d.ts
|
|
@@ -131,11 +436,47 @@ interface EditorMcpResult {
|
|
|
131
436
|
configPath: string;
|
|
132
437
|
serverName: string;
|
|
133
438
|
error?: string;
|
|
439
|
+
/**
|
|
440
|
+
* Set on a 'declined' action: the bounded reason OK left a present config
|
|
441
|
+
* byte-unchanged rather than register into it (unparseable, oversized, or a
|
|
442
|
+
* duplicate container key). Engineer-facing; no config contents.
|
|
443
|
+
*/
|
|
134
444
|
declineReason?: McpDeclineReason;
|
|
445
|
+
/** Set to 'project' when the result came from a project-scope write. */
|
|
135
446
|
configScope?: 'project';
|
|
136
447
|
}
|
|
137
448
|
declare const LAUNCH_CONFIG_NAME = "open-knowledge-ui";
|
|
449
|
+
/**
|
|
450
|
+
* Version sentinel for the published-mode launch.json recipe. The first line
|
|
451
|
+
* of the chain doubles as a shell comment and the stamp `classifyLaunchJsonEntry`
|
|
452
|
+
* matches on. Bump the suffix (`v2`, …) on any structurally-different chain so
|
|
453
|
+
* the repair sweep recognizes stale text and rewrites it forward.
|
|
454
|
+
*/
|
|
138
455
|
declare const LAUNCH_UI_CHAIN_SENTINEL = "# ok-ui-v1";
|
|
456
|
+
/**
|
|
457
|
+
* Published-mode `.claude/launch.json` recipe — the preview pane spawns this
|
|
458
|
+
* to bring the worktree's editor up. Mirrors the proven `# ok-mcp-v1` chain
|
|
459
|
+
* (editors.ts) — resolves the Desktop bundle first (user → system Applications),
|
|
460
|
+
* then npx, then version-manager `npx` paths — but runs **`ok start`**, not
|
|
461
|
+
* bare `ok ui`, so the folder gets its OWN collab server (the worktree fix).
|
|
462
|
+
* `ok start` connects-instead-of-erroring on a live lock (`--ui-port` path), so
|
|
463
|
+
* one committed recipe is safe on both the main checkout and a fresh worktree.
|
|
464
|
+
*
|
|
465
|
+
* Port handling: the pane passes its watched port via `PORT` env. We capture it
|
|
466
|
+
* as `UIPORT`, defaulting to the launch.json `port` (`LAUNCH_JSON_PORT`) when
|
|
467
|
+
* `PORT` is somehow absent — the pane probes that same port, so the default
|
|
468
|
+
* matches what it watches. `unset PORT` so the collab server kernel-allocates
|
|
469
|
+
* instead of fighting its UI sibling for the env port (`ok start` also drops
|
|
470
|
+
* env-`PORT` for the collab when `--ui-port` is set, belt-and-braces). We ALWAYS
|
|
471
|
+
* pass `--ui-port` — that is what arms `ok start`'s connect-instead-of-exit-1
|
|
472
|
+
* fallback, so a missing `PORT` can never leave the main checkout running a bare
|
|
473
|
+
* `ok start` that exits 1 and breaks the preview pane. Ports are numeric;
|
|
474
|
+
* `"$UIPORT"` is quoted for safety.
|
|
475
|
+
*
|
|
476
|
+
* Portable + public-safe: no machine-specific absolute path is baked in; the
|
|
477
|
+
* bundle is resolved at spawn time. Same chain ships in the git-committed
|
|
478
|
+
* scaffold and the per-open desktop reclaim (which force-writes this shape).
|
|
479
|
+
*/
|
|
139
480
|
declare const LAUNCH_UI_CHAIN_V1 = "# ok-ui-v1\nUIPORT=\"${PORT:-39848}\"\nunset PORT\nUSER_BUNDLE=\"$HOME/Applications/OpenKnowledge.app/Contents/Resources/cli/bin/ok.sh\"\n[ -f \"$USER_BUNDLE\" ] && [ -x \"$USER_BUNDLE\" ] && exec \"$USER_BUNDLE\" start --ui-port \"$UIPORT\"\nBUNDLE=\"/Applications/OpenKnowledge.app/Contents/Resources/cli/bin/ok.sh\"\n[ -f \"$BUNDLE\" ] && [ -x \"$BUNDLE\" ] && exec \"$BUNDLE\" start --ui-port \"$UIPORT\"\ncommand -v npx >/dev/null 2>&1 && exec npx -y @inkeep/open-knowledge@latest start --ui-port \"$UIPORT\"\nfor d in \"$HOME/.nvm/versions/node\"/*/bin \"$HOME/.fnm/node-versions\"/*/installation/bin \"$HOME/.asdf/installs/nodejs\"/*/bin /opt/homebrew/bin /usr/local/bin \"$HOME/.local/bin\" \"$HOME/.volta/bin\"; do\n [ -f \"$d/npx\" ] && [ -x \"$d/npx\" ] && exec \"$d/npx\" -y @inkeep/open-knowledge@latest start --ui-port \"$UIPORT\"\ndone\necho \"OpenKnowledge: install OK Desktop or Node.js 24+, then restart your editor\" >&2\nexit 127";
|
|
140
481
|
type LaunchJsonAction = 'created' | 'merged' | 'failed';
|
|
141
482
|
interface LaunchJsonResult {
|
|
@@ -143,15 +484,133 @@ interface LaunchJsonResult {
|
|
|
143
484
|
configPath: string;
|
|
144
485
|
error?: string;
|
|
145
486
|
}
|
|
487
|
+
/**
|
|
488
|
+
* Scaffold or merge a `.claude/launch.json` entry so that Claude's
|
|
489
|
+
* built-in preview browser can start the OpenKnowledge dev server via
|
|
490
|
+
* `preview_start("open-knowledge-ui")`.
|
|
491
|
+
*
|
|
492
|
+
* `runtimeArgs` launches `open-knowledge ui` (not `open-knowledge start`) —
|
|
493
|
+
* the UI sibling-process is what the preview pane renders; collab runs in a
|
|
494
|
+
* separate `open-knowledge start` process auto-spawned by `ok ui` via the
|
|
495
|
+
* MCP stdio path.
|
|
496
|
+
*
|
|
497
|
+
* - File missing → create with the OK entry
|
|
498
|
+
* - File exists, no OK → merge the entry into configurations
|
|
499
|
+
* - File exists, has OK → replace with current defaults
|
|
500
|
+
*/
|
|
146
501
|
declare function scaffoldLaunchJson(cwd: string, installOptions?: McpInstallOptions): LaunchJsonResult;
|
|
502
|
+
/**
|
|
503
|
+
* Per-editor MCP config writer. Exported so `@inkeep/open-knowledge`
|
|
504
|
+
* consumers — specifically Electron main's first-launch consent flow via
|
|
505
|
+
* `writeUserMcpConfigs` — can invoke the same write logic that the
|
|
506
|
+
* terminal-origin `ok init` command uses. The
|
|
507
|
+
* `installOptions.skipAvailabilityCheck` flag distinguishes the two call
|
|
508
|
+
* sites: `ok init` enforces `isEditorTargetAvailable` so users don't get
|
|
509
|
+
* empty config dirs for editors they haven't installed; the consent flow
|
|
510
|
+
* bypasses the check because the user explicitly toggled the editor
|
|
511
|
+
* checkbox in the dialog.
|
|
512
|
+
*/
|
|
147
513
|
declare function writeEditorMcpConfig(target: EditorMcpTarget, cwd: string, installOptions: McpInstallOptions, home?: string, configPathOverride?: string): EditorMcpResult;
|
|
148
514
|
interface UserMcpConfigsOptions {
|
|
515
|
+
/**
|
|
516
|
+
* Editors whose MCP config to write. Caller (mcp-wiring.ts confirmHandler)
|
|
517
|
+
* owns user disclosure for any existing `open-knowledge` namespace entry
|
|
518
|
+
* before calling this writer. This function unconditionally overwrites every
|
|
519
|
+
* editor it receives (aligning with `writeEditorMcpConfig`'s always-rewrite
|
|
520
|
+
* semantic — installs stay aligned with current defaults).
|
|
521
|
+
*/
|
|
149
522
|
editors: EditorId[];
|
|
523
|
+
/** Override `$HOME` for resolving user-scoped config paths (test hook). */
|
|
150
524
|
home?: string;
|
|
151
525
|
}
|
|
526
|
+
/**
|
|
527
|
+
* Write MCP config entries for a set of editors without any of `runInit`'s
|
|
528
|
+
* project-scoped side effects.
|
|
529
|
+
*
|
|
530
|
+
* Specifically does NOT run:
|
|
531
|
+
* - `ensureProjectGit` — would `git init` wherever `cwd` is (packaged Electron
|
|
532
|
+
* apps have `process.cwd() === '/'` by default)
|
|
533
|
+
* - `initContent` — scaffolds `.ok/` in a project
|
|
534
|
+
* - `scaffoldLaunchJson` — writes `.claude/launch.json`
|
|
535
|
+
* - `upsertRootInstructions` — mutates `AGENTS.md` / `CLAUDE.md`
|
|
536
|
+
* - `collectLegacyProjectConfig` — scans for `.mcp.json` / `.cursor/mcp.json`
|
|
537
|
+
*
|
|
538
|
+
* This is the entry point Electron main's first-launch MCP consent flow
|
|
539
|
+
* calls after the user clicks Add. The terminal-invoked `ok init`
|
|
540
|
+
* path shares the same canonical npx shape.
|
|
541
|
+
*
|
|
542
|
+
* Bypasses `isEditorTargetAvailable` via `skipAvailabilityCheck: true` — the
|
|
543
|
+
* user explicitly toggled the editor checkbox; their click IS the consent,
|
|
544
|
+
* so skip-on-missing would silently drop their selection.
|
|
545
|
+
*/
|
|
152
546
|
declare function writeUserMcpConfigs(opts: UserMcpConfigsOptions): Promise<EditorMcpResult[]>;
|
|
547
|
+
/**
|
|
548
|
+
* Read a single editor's existing MCP server entry for use with the
|
|
549
|
+
* desktop confirm-flow's canonical-shape classification. Reads the
|
|
550
|
+
* user-scoped config (format-aware — JSON or TOML), looks up
|
|
551
|
+
* `config[topLevelKey][serverName]`, and returns it as a plain object.
|
|
552
|
+
* Returns `null` when the config file is absent, unreadable,
|
|
553
|
+
* unparseable, or has no entry for this editor's server name.
|
|
554
|
+
*
|
|
555
|
+
* **Never-throws contract (load-bearing):** the first-launch consent flow
|
|
556
|
+
* MUST be able to classify every selected editor without aborting on one
|
|
557
|
+
* malformed config. A corrupt user config (e.g., stale
|
|
558
|
+
* `~/.codex/config.toml` from a half-completed third-party edit) on ANY
|
|
559
|
+
* selected editor would otherwise crash `confirmHandler`, leave the
|
|
560
|
+
* marker absent, and create an infinite dialog re-fire loop on the user's
|
|
561
|
+
* machine. Delegates to the never-throwing `classifyExistingMcpEntry`; every
|
|
562
|
+
* non-`present` classification returns `null`:
|
|
563
|
+
* - configPath() throws → null (platform-mismatched target, e.g.
|
|
564
|
+
* Claude Desktop on Linux)
|
|
565
|
+
* - file absent or blank → null
|
|
566
|
+
* - parse fails / duplicate container → `decline` → null (unparseable config)
|
|
567
|
+
* - top-level key absent or not a plain object → `no-entry` → null
|
|
568
|
+
* - server entry value not a plain object → `no-entry` → null
|
|
569
|
+
*
|
|
570
|
+
* Note: `null` deliberately conflates "absent" with "no compatible entry to
|
|
571
|
+
* merge into" from the desktop classifier's perspective. The downstream
|
|
572
|
+
* `writeEditorMcpConfig` re-reads via the same capable parser and, on a present
|
|
573
|
+
* config it can't safely edit, DECLINES (leaves it byte-unchanged) rather than
|
|
574
|
+
* throwing — surfaced via the bounded `mcp-config-decline` event.
|
|
575
|
+
*/
|
|
153
576
|
declare function readExistingMcpEntry(target: EditorMcpTarget, cwd: string, home?: string, configPathOverride?: string): Record<string, unknown> | null;
|
|
577
|
+
/**
|
|
578
|
+
* Bounded set of reasons OpenKnowledge declines to register into a present,
|
|
579
|
+
* non-empty config. Kept to a closed enum (never raw parser text or a config
|
|
580
|
+
* path) so a decline is observable in telemetry without logging the user's
|
|
581
|
+
* config contents. `unparseable` covers a genuinely-malformed file, one OK's
|
|
582
|
+
* parser can't read, or a half-written file caught mid-write by a concurrent
|
|
583
|
+
* harness — none of which OK's parsers can reliably tell apart, so all collapse
|
|
584
|
+
* here. `duplicate-container` is produced by the JSON/TOML write paths (an
|
|
585
|
+
* ambiguous edit target); `oversize` is produced by both the write paths and
|
|
586
|
+
* `classifyExistingMcpEntry` when a config exceeds the size bound;
|
|
587
|
+
* `no-native-writer` is the TOML write path declining a present config because
|
|
588
|
+
* the format-preserving native engine is unavailable and a JS-fallback rewrite
|
|
589
|
+
* would be lossy — the file was never parsed, so it is not `unparseable`.
|
|
590
|
+
*/
|
|
154
591
|
type McpDeclineReason = 'unparseable' | 'duplicate-container' | 'oversize' | 'no-native-writer';
|
|
592
|
+
/**
|
|
593
|
+
* Discriminated classification of an existing MCP host config file. Where
|
|
594
|
+
* `readExistingMcpEntry` collapses every state into `Record | null`, this
|
|
595
|
+
* surface distinguishes them so callers can act differently per state.
|
|
596
|
+
*
|
|
597
|
+
* OpenKnowledge is a guest in another tool's config — its write authority is
|
|
598
|
+
* scoped to its own entry. A present, non-empty file it cannot parse is
|
|
599
|
+
* therefore `'decline'`: left untouched, never renamed or overwritten, so a
|
|
600
|
+
* config OK's parser merely can't read is never mistaken for one to reset.
|
|
601
|
+
* A `'no-entry'` file (parses, but holds no entry under our server name) is
|
|
602
|
+
* likewise left alone — it could be an unrelated tool's config.
|
|
603
|
+
*
|
|
604
|
+
* Blank / whitespace / 0-byte files classify as `'absent'`: there is nothing
|
|
605
|
+
* to preserve, so they are safe to create into (the readers already coerce
|
|
606
|
+
* blank input to `{}` for the merge path). A non-blank file whose parse throws
|
|
607
|
+
* is `'decline'`, NOT `'absent'` — a half-written file caught mid-write by a
|
|
608
|
+
* concurrent harness must be left alone, not treated as empty-and-creatable.
|
|
609
|
+
*
|
|
610
|
+
* **Never-throws contract:** every failure path returns a structured outcome.
|
|
611
|
+
* Mirrors `readExistingMcpEntry`'s contract for the same load-bearing reason
|
|
612
|
+
* (one unreadable user config must not pull the whole startup flow down).
|
|
613
|
+
*/
|
|
155
614
|
type McpEntryClassification = {
|
|
156
615
|
kind: 'absent';
|
|
157
616
|
} | {
|
|
@@ -164,6 +623,16 @@ type McpEntryClassification = {
|
|
|
164
623
|
reason: McpDeclineReason;
|
|
165
624
|
};
|
|
166
625
|
declare function classifyExistingMcpEntry(target: EditorMcpTarget, cwd: string, home?: string, configPathOverride?: string): McpEntryClassification;
|
|
626
|
+
/**
|
|
627
|
+
* Detect every editor whose global config surface already exists. Each target
|
|
628
|
+
* can override the probe path when the config file itself is a poor signal
|
|
629
|
+
* (for example Claude writes `~/.claude.json`, but installation is better
|
|
630
|
+
* inferred from the presence of `~/.claude/`).
|
|
631
|
+
*
|
|
632
|
+
* Used by `runInit()` and the CLI to install to every editor that already has
|
|
633
|
+
* a config root on disk without creating new user-home directories for tools
|
|
634
|
+
* the user does not have.
|
|
635
|
+
*/
|
|
167
636
|
declare function detectInstalledEditors(cwd: string, home?: string): EditorId[];
|
|
168
637
|
//#endregion
|
|
169
638
|
//#region src/commands/mcp-decline-event.d.ts
|
|
@@ -181,11 +650,42 @@ interface McpConfigDeclineEvent {
|
|
|
181
650
|
surface: McpConfigDeclineSurface;
|
|
182
651
|
editorId: string;
|
|
183
652
|
reason: McpDeclineReason;
|
|
653
|
+
/**
|
|
654
|
+
* Index signature so this type is assignable to the loosely-typed
|
|
655
|
+
* `event: { event: string; [k: string]: unknown }` parameter the Desktop
|
|
656
|
+
* structured-event loggers accept — same reason as the migrate event.
|
|
657
|
+
*/
|
|
184
658
|
[key: string]: unknown;
|
|
185
659
|
}
|
|
186
660
|
declare function buildMcpConfigDeclineEvent(input: McpConfigDeclineInput): McpConfigDeclineEvent;
|
|
187
661
|
//#endregion
|
|
188
662
|
//#region src/commands/mcp-migrate-event.d.ts
|
|
663
|
+
/**
|
|
664
|
+
* Single-source builder for the `mcp-config-migrate` structured event.
|
|
665
|
+
*
|
|
666
|
+
* Three surfaces emit this event — CLI `ok start` reclaim, Desktop boot
|
|
667
|
+
* sweep, Desktop project-open sweep. They predate this builder and used
|
|
668
|
+
* to ship three different field shapes for the same event name (`editor`
|
|
669
|
+
* vs `editorId`, `configPath` present/absent, `priorArgs` truncated/not).
|
|
670
|
+
* That defeated the point of a unified event name: operators who counted
|
|
671
|
+
* `mcp-config-migrate` aggregated three incompatible schemas. This module
|
|
672
|
+
* is the only sanctioned construction site.
|
|
673
|
+
*
|
|
674
|
+
* Standardized fields:
|
|
675
|
+
* - `scope` — `'user' | 'project'` (cross-surface)
|
|
676
|
+
* - `surface` — free-form identifier of the emitting code path
|
|
677
|
+
* (`'cli-repair'`, `'desktop-startup'`,
|
|
678
|
+
* `'desktop-project-open'`). Always set.
|
|
679
|
+
* - `editorId` — matches `EditorMcpResult.editorId` and
|
|
680
|
+
* `RepairLogEvent.editorId`.
|
|
681
|
+
* - `configPath` — absolute path of the config file being rewritten.
|
|
682
|
+
* - `priorCommand` — truncated to 200 chars or `null` if absent.
|
|
683
|
+
* - `priorArgs` — first 10 entries, each string truncated to 200
|
|
684
|
+
* chars (CHAIN_V1's `args[2]` shell body is ~700
|
|
685
|
+
* chars; without truncation the event payload
|
|
686
|
+
* blows up Tempo/Prometheus label storage and
|
|
687
|
+
* every aggregation downstream).
|
|
688
|
+
*/
|
|
189
689
|
type McpConfigMigrateScope = 'user' | 'project';
|
|
190
690
|
interface McpConfigMigrateInput {
|
|
191
691
|
scope: McpConfigMigrateScope;
|
|
@@ -202,9 +702,29 @@ interface McpConfigMigrateEvent {
|
|
|
202
702
|
configPath: string;
|
|
203
703
|
priorCommand: string | null;
|
|
204
704
|
priorArgs: unknown[] | null;
|
|
705
|
+
/**
|
|
706
|
+
* Index signature so this type is assignable to the loosely-typed
|
|
707
|
+
* `event: { event: string; [k: string]: unknown }` parameter the Desktop
|
|
708
|
+
* structured-event loggers accept. Future extensions (e.g. a `traceId`
|
|
709
|
+
* field) don't need a type-system migration in every consumer.
|
|
710
|
+
*/
|
|
205
711
|
[key: string]: unknown;
|
|
206
712
|
}
|
|
207
713
|
declare function buildMcpConfigMigrateEvent(input: McpConfigMigrateInput): McpConfigMigrateEvent;
|
|
714
|
+
/**
|
|
715
|
+
* Bound the payload of `priorCommand` / `priorArgs` before structured-event
|
|
716
|
+
* sinks index them. `CHAIN_V1`'s `args[2]` is a ~700-char shell script;
|
|
717
|
+
* unbounded inclusion in a high-volume metric label explodes downstream
|
|
718
|
+
* storage.
|
|
719
|
+
*
|
|
720
|
+
* Re-exported via `packages/cli/src/index.ts` for workspace-only
|
|
721
|
+
* consumption — the Desktop `project-mcp-reclaim` sibling event applies
|
|
722
|
+
* identical bounds. External consumers of `@inkeep/open-knowledge` should
|
|
723
|
+
* reach for `buildMcpConfigMigrateEvent` instead; this helper is the
|
|
724
|
+
* inner mechanism, not a stable surface.
|
|
725
|
+
*
|
|
726
|
+
* @internal
|
|
727
|
+
*/
|
|
208
728
|
declare function truncatePriorEntry(entry: Record<string, unknown>): {
|
|
209
729
|
priorCommand: string | null;
|
|
210
730
|
priorArgs: unknown[] | null;
|
|
@@ -253,6 +773,11 @@ interface StopOutcome {
|
|
|
253
773
|
}>;
|
|
254
774
|
hadTargets: boolean;
|
|
255
775
|
}
|
|
776
|
+
/**
|
|
777
|
+
* Execute a stop plan. Exported for tests so they can drive it without
|
|
778
|
+
* going through Commander. The Commander action wraps this and translates
|
|
779
|
+
* `failed.length > 0` into `process.exitCode = 1`.
|
|
780
|
+
*/
|
|
256
781
|
declare function runStop(deps: RunStopDeps): StopOutcome;
|
|
257
782
|
//#endregion
|
|
258
783
|
//#region src/config/loader.d.ts
|
|
@@ -263,6 +788,29 @@ interface LoadConfigResult {
|
|
|
263
788
|
declare function loadConfig(cwd?: string): LoadConfigResult;
|
|
264
789
|
//#endregion
|
|
265
790
|
//#region src/github/folder-validator.d.ts
|
|
791
|
+
/**
|
|
792
|
+
* Validate that a user-picked folder is a clone of the GitHub repo a share
|
|
793
|
+
* URL points at — drives the "I have it locally →" path on the in-OK receive
|
|
794
|
+
* dialog. The receive dialog calls this
|
|
795
|
+
* after the user picks a folder; on `kind: 'ok'` it registers the folder as
|
|
796
|
+
* a `RecentProject` (with the canonical `gitRemoteUrl`) and opens the doc.
|
|
797
|
+
*
|
|
798
|
+
* Symlink discipline mirrors `discoverProject` in
|
|
799
|
+
* `packages/desktop/src/main/folder-admission.ts`: realpath canonicalize,
|
|
800
|
+
* then verify the picked folder hasn't escaped via a symlink that resolves
|
|
801
|
+
* outside its apparent parent. A `.git` directory that symlinks outside the
|
|
802
|
+
* realpath'd folder is also rejected — the AC's "FR security, inherits OK
|
|
803
|
+
* Worktree pointers (`.git` is a regular file
|
|
804
|
+
* containing `gitdir: <path>`) are exempt from the inside-folder check —
|
|
805
|
+
* legitimate worktrees ALWAYS point at a separate gitdir outside the
|
|
806
|
+
* worktree folder.
|
|
807
|
+
*
|
|
808
|
+
* Owner / repo comparison is case-insensitive: GitHub URLs accept any case
|
|
809
|
+
* combination (`/Inkeep/Open-Knowledge` and `/inkeep/open-knowledge` resolve
|
|
810
|
+
* to the same repo), so a clone whose origin uses different case from the
|
|
811
|
+
* share URL must still match.
|
|
812
|
+
*/
|
|
813
|
+
/** Outcome of `validateLocalFolderForShare`. Discriminated by `kind`. */
|
|
266
814
|
type ShareFolderValidationResult = {
|
|
267
815
|
kind: 'ok';
|
|
268
816
|
gitRemoteUrl: string;
|
|
@@ -283,27 +831,53 @@ interface ExpectedShareRepo {
|
|
|
283
831
|
readonly owner: string;
|
|
284
832
|
readonly repo: string;
|
|
285
833
|
}
|
|
834
|
+
/**
|
|
835
|
+
* Read the repo's `config` (`<folderPath>/.git/config` for a primary checkout;
|
|
836
|
+
* for a git-worktree pointer, the shared common dir's config reached via the
|
|
837
|
+
* worktree gitdir's `commondir` — a linked worktree's gitdir holds no `config`
|
|
838
|
+
* of its own), parse `[remote "origin"]`, and classify against the expected
|
|
839
|
+
* `{owner, repo}` from the share URL.
|
|
840
|
+
*
|
|
841
|
+
* Never throws — every filesystem or parse failure maps to a structured
|
|
842
|
+
* result kind so the caller can render a friendly toast.
|
|
843
|
+
*/
|
|
286
844
|
declare function validateLocalFolderForShare(folderPath: string, expected: ExpectedShareRepo): Promise<ShareFolderValidationResult>;
|
|
287
845
|
//#endregion
|
|
288
846
|
//#region src/github/url.d.ts
|
|
847
|
+
/**
|
|
848
|
+
* Parsed Git URL result.
|
|
849
|
+
*/
|
|
289
850
|
interface ParsedGitUrl {
|
|
290
851
|
protocol: 'https' | 'ssh' | 'git';
|
|
291
852
|
hostname: string;
|
|
292
853
|
owner: string;
|
|
293
854
|
name: string;
|
|
294
855
|
}
|
|
856
|
+
/**
|
|
857
|
+
* Parsed GitHub blob URL result.
|
|
858
|
+
*/
|
|
295
859
|
interface ParsedGitHubBlobUrl {
|
|
296
860
|
owner: string;
|
|
297
861
|
repo: string;
|
|
298
862
|
branch: string;
|
|
299
863
|
path: string;
|
|
300
864
|
}
|
|
865
|
+
/**
|
|
866
|
+
* Parsed GitHub tree (folder) URL result. `path` is the folder path relative
|
|
867
|
+
* to the repo root and MAY be the empty string for a repo/branch root
|
|
868
|
+
* (`tree/<branch>` or `tree/<branch>/`).
|
|
869
|
+
*/
|
|
301
870
|
interface ParsedGitHubTreeUrl {
|
|
302
871
|
owner: string;
|
|
303
872
|
repo: string;
|
|
304
873
|
branch: string;
|
|
305
874
|
path: string;
|
|
306
875
|
}
|
|
876
|
+
/**
|
|
877
|
+
* Unified result of the share-URL dispatcher. A GitHub blob URL is a `doc`
|
|
878
|
+
* target; a GitHub tree URL is a `folder` target (whose `path` may be empty
|
|
879
|
+
* for the repo/branch root).
|
|
880
|
+
*/
|
|
307
881
|
type ParsedGitHubShareTarget = {
|
|
308
882
|
kind: 'doc';
|
|
309
883
|
owner: string;
|
|
@@ -317,13 +891,170 @@ type ParsedGitHubShareTarget = {
|
|
|
317
891
|
branch: string;
|
|
318
892
|
path: string;
|
|
319
893
|
};
|
|
894
|
+
/**
|
|
895
|
+
* Parse a git remote URL or shorthand into its components.
|
|
896
|
+
*
|
|
897
|
+
* Handles:
|
|
898
|
+
* - https://host[:port]/owner/repo[.git]
|
|
899
|
+
* - http://host[:port]/owner/repo[.git]
|
|
900
|
+
* - ssh://[user@]host[:port]/owner/repo[.git]
|
|
901
|
+
* - git://host[:port]/owner/repo[.git]
|
|
902
|
+
* - git@host:owner/repo[.git] (SCP-style SSH)
|
|
903
|
+
* - [user@]host.ghe.com:owner/repo[.git] (GHES SCP-style)
|
|
904
|
+
* - git:host/owner/repo[.git] (bare git protocol)
|
|
905
|
+
* - owner/repo[.git] (shorthand → github.com)
|
|
906
|
+
*
|
|
907
|
+
* Returns null for invalid or unrecognised input.
|
|
908
|
+
*/
|
|
320
909
|
declare function parseGitUrl(input: string): ParsedGitUrl | null;
|
|
910
|
+
/**
|
|
911
|
+
* Parse a GitHub blob URL of the form
|
|
912
|
+
* https://github.com/<owner>/<repo>/blob/<branch>/<path...>
|
|
913
|
+
* into its `{ owner, repo, branch, path }` components.
|
|
914
|
+
*
|
|
915
|
+
* Branch slashes must be percent-encoded (`feat%2Ffoo`) — the URL form
|
|
916
|
+
* `https://github.com/o/r/blob/feat/foo/file.md` is ambiguous between
|
|
917
|
+
* `branch=feat,path=foo/file.md` and `branch=feat/foo,path=file.md`,
|
|
918
|
+
* and we cannot disambiguate without a GitHub API call. The sender
|
|
919
|
+
* encodes; the parser decodes.
|
|
920
|
+
*
|
|
921
|
+
* Returns null for any URL that is not a well-formed GitHub blob URL.
|
|
922
|
+
*/
|
|
321
923
|
declare function parseGitHubBlobUrl(input: string): ParsedGitHubBlobUrl | null;
|
|
924
|
+
/**
|
|
925
|
+
* Parse a GitHub tree (folder) URL of the form
|
|
926
|
+
* https://github.com/<owner>/<repo>/tree/<branch>[/<path...>]
|
|
927
|
+
* into its `{ owner, repo, branch, path }` components.
|
|
928
|
+
*
|
|
929
|
+
* Unlike `parseGitHubBlobUrl`, the folder path MAY be empty — `tree/<branch>`
|
|
930
|
+
* and `tree/<branch>/` both denote the repo/branch root and yield `path: ''`.
|
|
931
|
+
* (The builder emits no trailing slash; the parser tolerates both
|
|
932
|
+
* shapes defensively.)
|
|
933
|
+
*
|
|
934
|
+
* Branch slashes must be percent-encoded (`feat%2Ffoo`) for the same
|
|
935
|
+
* disambiguation reason as the blob parser — the sender encodes, the parser
|
|
936
|
+
* decodes.
|
|
937
|
+
*
|
|
938
|
+
* Returns null for any URL that is not a well-formed GitHub tree URL.
|
|
939
|
+
*/
|
|
322
940
|
declare function parseGitHubTreeUrl(input: string): ParsedGitHubTreeUrl | null;
|
|
941
|
+
/**
|
|
942
|
+
* Dispatch a share URL to its target kind. A GitHub blob URL resolves to a
|
|
943
|
+
* `doc` target; a GitHub tree URL resolves to a `folder` target. Blob is
|
|
944
|
+
* tried first because the two prefixes (`/blob/` vs `/tree/`) are mutually
|
|
945
|
+
* exclusive — a URL can satisfy at most one.
|
|
946
|
+
*
|
|
947
|
+
* Returns null when the input is neither a well-formed blob nor tree URL.
|
|
948
|
+
*/
|
|
323
949
|
declare function parseGitHubShareUrl(input: string): ParsedGitHubShareTarget | null;
|
|
324
950
|
//#endregion
|
|
951
|
+
//#region src/integrations/path-shim.d.ts
|
|
952
|
+
/**
|
|
953
|
+
* The PATH-shim contract — shared by the DESKTOP installer (which writes the
|
|
954
|
+
* shim) and the CLI reverter (which removes it for `ok uninstall`).
|
|
955
|
+
*
|
|
956
|
+
* The desktop app (macOS packaged only) puts `ok` on the user's PATH by:
|
|
957
|
+
* - symlinking `~/.ok/bin/{ok,open-knowledge}` at the app's CLI wrapper,
|
|
958
|
+
* - writing `~/.ok/env.sh` (prepends `~/.ok/bin` to PATH),
|
|
959
|
+
* - injecting a fenced managed block into each shell rc file that sources
|
|
960
|
+
* `~/.ok/env.sh`, and
|
|
961
|
+
* - recording every change in a manifest at
|
|
962
|
+
* `~/Library/Application Support/OpenKnowledge/path-install.json`.
|
|
963
|
+
*
|
|
964
|
+
* The install side lives in the desktop package (`main/path-install.ts`), which
|
|
965
|
+
* imports the fence markers + marker path + marker shape FROM HERE so the
|
|
966
|
+
* install and revert can never disagree about what a managed block looks like
|
|
967
|
+
* or where the manifest lives. The CLI can't import desktop (the dependency
|
|
968
|
+
* runs desktop→cli), so this — the lower layer both share — is the single
|
|
969
|
+
* source of truth for the contract, and the home of the CLI-side revert.
|
|
970
|
+
*
|
|
971
|
+
* The revert itself is deliberately manifest-driven: it strips ONLY the recorded
|
|
972
|
+
* rc files' managed blocks and removes ONLY the recorded extra symlinks (and
|
|
973
|
+
* only while they still point at the recorded target), so a user's own PATH
|
|
974
|
+
* lines and unrelated `ok`-named binaries are never touched.
|
|
975
|
+
*/
|
|
976
|
+
/** Fence opening the managed block in a shell rc file. */
|
|
977
|
+
declare const PATH_SHIM_BEGIN = "# >>> open-knowledge cli >>>";
|
|
978
|
+
/** Fence closing the managed block. */
|
|
979
|
+
declare const PATH_SHIM_END = "# <<< open-knowledge cli <<<";
|
|
980
|
+
/**
|
|
981
|
+
* Matches the whole fenced managed block (fence-to-fence, incl. its trailing
|
|
982
|
+
* newline). Multiline + non-greedy so a file with the block anywhere — and only
|
|
983
|
+
* that block — is stripped. IDENTICAL to the install-side `BLOCK_RE`; the two
|
|
984
|
+
* MUST stay in lock-step, which is why both sides import this one constant.
|
|
985
|
+
*/
|
|
986
|
+
declare const PATH_SHIM_BLOCK_RE: RegExp;
|
|
987
|
+
/** Diagnostic snapshot of the interactive PATH captured at install time. */
|
|
988
|
+
interface PathDiscovery {
|
|
989
|
+
capturedAt: string;
|
|
990
|
+
pathEntries: string[];
|
|
991
|
+
shellUsed: string;
|
|
992
|
+
okBinAlreadyOnPath: boolean;
|
|
993
|
+
}
|
|
994
|
+
/**
|
|
995
|
+
* The user's rc-append consent record. Additive on version-1 markers:
|
|
996
|
+
* pre-consent markers carry no field, and older builds reading a marker with
|
|
997
|
+
* the field ignore it. Absence means "no decision recorded" — the desktop
|
|
998
|
+
* installer then falls back to grandfather evidence (a healthy managed block
|
|
999
|
+
* already on disk ⇒ granted) or, with no evidence either, leaves the user's
|
|
1000
|
+
* rc files untouched until the first-launch consent dialog decides. The
|
|
1001
|
+
* revert ignores it (`ok uninstall` deletes the whole manifest).
|
|
1002
|
+
*/
|
|
1003
|
+
interface PathInstallConsent {
|
|
1004
|
+
status: 'granted' | 'declined';
|
|
1005
|
+
at: string;
|
|
1006
|
+
}
|
|
1007
|
+
/**
|
|
1008
|
+
* The install manifest — the complete record of every PATH change, written to
|
|
1009
|
+
* `~/Library/Application Support/OpenKnowledge/path-install.json`. The revert
|
|
1010
|
+
* reads `rcFiles` (blocks to strip) and `extraSymlinks` (guarded removals);
|
|
1011
|
+
* `binDir` + `envShimPath` live under `~/.ok/` and are swept by the whole-dir
|
|
1012
|
+
* removal.
|
|
1013
|
+
*/
|
|
1014
|
+
interface PathInstallMarker {
|
|
1015
|
+
version: 1;
|
|
1016
|
+
installedAt: string;
|
|
1017
|
+
bundleVersion: string;
|
|
1018
|
+
bundleWrapperPath: string;
|
|
1019
|
+
binDir: string;
|
|
1020
|
+
envShimPath: string;
|
|
1021
|
+
rcFiles: string[];
|
|
1022
|
+
/** Rc files the user stripped the managed block from — never written to
|
|
1023
|
+
* again by the installer. */
|
|
1024
|
+
rcOptOuts: string[];
|
|
1025
|
+
pathDiscovery: PathDiscovery | null;
|
|
1026
|
+
extraSymlinks: Array<{
|
|
1027
|
+
path: string;
|
|
1028
|
+
target: string;
|
|
1029
|
+
createdAt: string;
|
|
1030
|
+
kind: 'created' | 'refreshed-our-own';
|
|
1031
|
+
}>;
|
|
1032
|
+
/** Rc-append consent record — see `PathInstallConsent`. `version` stays 1. */
|
|
1033
|
+
consent?: PathInstallConsent;
|
|
1034
|
+
}
|
|
1035
|
+
/** Absolute path to the PATH-install manifest (macOS layout — the shim is
|
|
1036
|
+
* macOS-packaged-desktop only, so this path is where it is ever written). */
|
|
1037
|
+
declare function pathInstallMarkerPath(home: string): string;
|
|
1038
|
+
//#endregion
|
|
325
1039
|
//#region src/integrations/project-integration-writers.d.ts
|
|
326
1040
|
type IntegrationId = 'mcp-config' | 'project-skill';
|
|
1041
|
+
/**
|
|
1042
|
+
* Per-(editor × integration) outcome.
|
|
1043
|
+
*
|
|
1044
|
+
* `action` discriminates five states:
|
|
1045
|
+
* - `'written'` — wrote a fresh artifact
|
|
1046
|
+
* - `'overwritten'` — replaced an existing artifact
|
|
1047
|
+
* - `'skipped-unsupported'` — editor has no surface for this integration
|
|
1048
|
+
* (e.g. Claude Desktop has no `projectConfigPath` / no `projectSkillPath`)
|
|
1049
|
+
* - `'declined'` — a present config OK can't safely edit was left
|
|
1050
|
+
* byte-unchanged (guest-ownership); `reason` is the bounded cause. NOT a
|
|
1051
|
+
* failure — registration was skipped non-destructively.
|
|
1052
|
+
* - `'failed'` — error occurred; `error` is set
|
|
1053
|
+
*
|
|
1054
|
+
* `path` is the absolute target path when one is meaningful; absent for
|
|
1055
|
+
* `skipped-unsupported`. `error` is set iff `action === 'failed'`; `reason` is
|
|
1056
|
+
* set iff `action === 'declined'`.
|
|
1057
|
+
*/
|
|
327
1058
|
interface IntegrationWriteOutcome {
|
|
328
1059
|
readonly integration: IntegrationId;
|
|
329
1060
|
readonly editorId: EditorId;
|
|
@@ -334,6 +1065,33 @@ interface IntegrationWriteOutcome {
|
|
|
334
1065
|
}
|
|
335
1066
|
//#endregion
|
|
336
1067
|
//#region src/integrations/resolve-project-root.d.ts
|
|
1068
|
+
/**
|
|
1069
|
+
* Resolve a CLI project root via ancestor-walk for `.ok/config.yml` first,
|
|
1070
|
+
* git-root promotion second. Mirrors desktop `discoverProject` from
|
|
1071
|
+
* `packages/desktop/src/main/folder-admission.ts` with a flat record shape and
|
|
1072
|
+
* synchronous execution suited to CLI ergonomics — `ok init` calls this
|
|
1073
|
+
* before any filesystem side effect. It is init-only by design: git-root
|
|
1074
|
+
* promotion and the home-dir stop are scaffolding concerns. Lifecycle
|
|
1075
|
+
* commands anchor to an EXISTING project via the CLI preAction hook's
|
|
1076
|
+
* `resolveProjectAnchor` (`findEnclosingProjectRoot` semantics) instead.
|
|
1077
|
+
*
|
|
1078
|
+
* Walk-up rules:
|
|
1079
|
+
* - Realpath cwd, stop at home, filesystem root, or 30 levels.
|
|
1080
|
+
* - First `.ok/config.yml` hit wins; cursor != cwd ⇒ ancestorPromoted.
|
|
1081
|
+
* - No ancestor: try `git rev-parse --show-toplevel`; promote only when the
|
|
1082
|
+
* resolved root is a strict descendant of homeDir (carve-out for
|
|
1083
|
+
* hypothetical `~/.git/`).
|
|
1084
|
+
* - Otherwise: projectRoot = cwd, no promotion (today's CLI behavior).
|
|
1085
|
+
*
|
|
1086
|
+
* `defaultContentDir` is always `'.'` — content scope equals the resolved
|
|
1087
|
+
* `projectRoot`. On git-root promotion the user can still narrow scope via
|
|
1088
|
+
* `config.yml`'s `content.dir`, but the default aligns "opened folder" and
|
|
1089
|
+
* "content dir" so the two never diverge silently.
|
|
1090
|
+
*
|
|
1091
|
+
* Pure of stdout — the caller decides whether to print `[ok] Opened existing
|
|
1092
|
+
* project at …` or a git-root disclosure line based on the returned record
|
|
1093
|
+
* plus its own `existsSync(<projectRoot>/.ok)` probe.
|
|
1094
|
+
*/
|
|
337
1095
|
interface ResolveProjectRootResult {
|
|
338
1096
|
/** Where `.ok/` lives or will live. Equals `realpath(cwd)` when no
|
|
339
1097
|
* promotion happened; otherwise the ancestor that owned `.ok/config.yml`
|
|
@@ -344,6 +1102,7 @@ interface ResolveProjectRootResult {
|
|
|
344
1102
|
* NOT used as a default scope — `projectRoot` and content scope align by
|
|
345
1103
|
* default; the user can narrow via `content.dir` post-init. */
|
|
346
1104
|
readonly defaultContentDir: string;
|
|
1105
|
+
/** True iff a `.ok/` was found above `cwd`. */
|
|
347
1106
|
readonly ancestorPromoted: boolean;
|
|
348
1107
|
/** True iff the git working-tree root sat above `cwd` and won the
|
|
349
1108
|
* promotion (no ancestor `.ok/`). Mutually exclusive with
|
|
@@ -359,6 +1118,11 @@ interface ResolveProjectRootOptions {
|
|
|
359
1118
|
* to avoid spinning up real git fixtures for unit-level coverage. */
|
|
360
1119
|
gitTopLevel?: (cwd: string) => string | null;
|
|
361
1120
|
}
|
|
1121
|
+
/**
|
|
1122
|
+
* Classify `cwd` for the CLI scaffolding decision. See module docstring for
|
|
1123
|
+
* the rule order; the result fully describes which `projectRoot` and
|
|
1124
|
+
* `content.dir` value the caller should use.
|
|
1125
|
+
*/
|
|
362
1126
|
declare function resolveProjectRoot(cwd: string, opts?: ResolveProjectRootOptions): ResolveProjectRootResult;
|
|
363
1127
|
//#endregion
|
|
364
1128
|
//#region src/integrations/write-project-ai-integrations.d.ts
|
|
@@ -372,5 +1136,5 @@ interface ProjectAiIntegrationsResult {
|
|
|
372
1136
|
}
|
|
373
1137
|
declare function writeProjectAiIntegrations(projectDir: string, selectedEditorIds: readonly EditorId[], installOptions?: McpInstallOptions): ProjectAiIntegrationsResult;
|
|
374
1138
|
//#endregion
|
|
375
|
-
export { ALL_EDITOR_IDS, EDITOR_LABELS, EDITOR_TARGETS, type EditorId, type EditorMcpResult, type EditorMcpTarget, type ExcludeWriteResult, type ExpectedShareRepo, type GhDetectResult, HOSTS_WITH_USER_SKILL_DIR, type IntegrationWriteOutcome, LAUNCH_CONFIG_NAME, LAUNCH_UI_CHAIN_SENTINEL, LAUNCH_UI_CHAIN_V1, type LaunchJsonResult, type LoadConfigResult, type McpConfigDeclineEvent, type McpConfigDeclineScope, type McpConfigMigrateEvent, type McpConfigMigrateScope, type McpDeclineReason, type McpEntryClassification, type McpInstallOptions, type ParsedGitHubBlobUrl, type ParsedGitHubShareTarget, type ParsedGitHubTreeUrl, type PreviewResult, type ProjectAiIntegrationsResult, type ResolveProjectRootOptions, type ResolveProjectRootResult, type ShareFolderValidationResult, type SharingMode, type TokenStore, type TrackedRefusal, type UserMcpConfigsOptions, addOkPathsToGitExclude, assertProjectPathSafe, buildManagedServerEntry, buildMcpConfigDeclineEvent, buildMcpConfigMigrateEvent, classifyExistingMcpEntry, createTokenStore, detectGh, detectInstalledEditors, formatTrackedRemediation, getExcludedOkPaths, getOkArtifactPaths, isEntryUpToDate, isOwnManagedEntry, loadConfig, makeLazyProbeTokenStore, parseGitHubBlobUrl, parseGitHubShareUrl, parseGitHubTreeUrl, parseGitUrl, previewContent, probeTrackedOkPaths, readExistingMcpEntry, readSharingMode, removeOkPathsFromGitExclude, resolveProjectRoot, runStop, scaffoldLaunchJson, truncatePriorEntry, validateLocalFolderForShare, writeEditorMcpConfig, writeProjectAiIntegrations, writeUserMcpConfigs };
|
|
1139
|
+
export { ALL_EDITOR_IDS, EDITOR_LABELS, EDITOR_TARGETS, type EditorId, type EditorMcpResult, type EditorMcpTarget, type ExcludeWriteResult, type ExpectedShareRepo, type GhDetectResult, HOSTS_WITH_USER_SKILL_DIR, type IntegrationWriteOutcome, LAUNCH_CONFIG_NAME, LAUNCH_UI_CHAIN_SENTINEL, LAUNCH_UI_CHAIN_V1, type LaunchJsonResult, type LoadConfigResult, type McpConfigDeclineEvent, type McpConfigDeclineScope, type McpConfigMigrateEvent, type McpConfigMigrateScope, type McpDeclineReason, type McpEntryClassification, type McpInstallOptions, PATH_SHIM_BEGIN, PATH_SHIM_BLOCK_RE, PATH_SHIM_END, type ParsedGitHubBlobUrl, type ParsedGitHubShareTarget, type ParsedGitHubTreeUrl, type PathDiscovery, type PathInstallConsent, type PathInstallMarker, type PreviewResult, type ProjectAiIntegrationsResult, type ResolveProjectRootOptions, type ResolveProjectRootResult, type ShareFolderValidationResult, type SharingMode, type TokenStore, type TrackedRefusal, type UserMcpConfigsOptions, addOkPathsToGitExclude, assertProjectPathSafe, buildManagedServerEntry, buildMcpConfigDeclineEvent, buildMcpConfigMigrateEvent, classifyExistingMcpEntry, createTokenStore, detectGh, detectInstalledEditors, formatTrackedRemediation, getExcludedOkPaths, getOkArtifactPaths, isEntryUpToDate, isOwnManagedEntry, loadConfig, makeLazyProbeTokenStore, parseGitHubBlobUrl, parseGitHubShareUrl, parseGitHubTreeUrl, parseGitUrl, pathInstallMarkerPath, previewContent, probeTrackedOkPaths, readExistingMcpEntry, readSharingMode, removeOkPathsFromGitExclude, resolveProjectRoot, runStop, scaffoldLaunchJson, truncatePriorEntry, validateLocalFolderForShare, writeEditorMcpConfig, writeProjectAiIntegrations, writeUserMcpConfigs };
|
|
376
1140
|
//# sourceMappingURL=index.d.mts.map
|