@inkeep/open-knowledge 0.25.0-beta.9 → 0.25.1-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/skills/discovery/SKILL.md +1 -1
- package/dist/assets/skills/project/SKILL.md +1 -1
- package/dist/assets/skills/write-skill/SKILL.md +1 -1
- package/dist/cli.mjs +65 -65
- package/dist/constants-CgXx1dPb.mjs +2 -0
- package/dist/{dist-Bj79e9B6.mjs → dist-D13xYuEX.mjs} +47 -51
- package/dist/dist-D9WKY736.mjs +1 -0
- package/dist/{gh-detect-Ck0zE5NU.mjs → gh-detect-BcBj3YlE.mjs} +2 -2
- package/dist/{git-handle-DY9lXoT3-CfssnuIB.mjs → git-handle-Bhgrj9qX-DBwQr-02.mjs} +2 -2
- package/dist/git-handle-DjEtQkHv-DQXg1XhZ.mjs +1 -0
- package/dist/index.d.mts +758 -1
- package/dist/index.mjs +1 -1
- package/dist/init-BOHFI-M4.mjs +321 -0
- package/dist/init-CWlEXg63.mjs +1 -0
- package/dist/loader-BZIOGAPP.mjs +1 -0
- package/dist/{loader-1IrHrVRY.mjs → loader-ea54dQyy.mjs} +3 -3
- package/dist/{preview-qP8Vfz3W.mjs → preview-CLxs2bk2.mjs} +2 -2
- package/dist/preview-YrlSomd6.mjs +1 -0
- package/dist/public/assets/ActivityModeContent-mJH5LtOR.js +2 -0
- package/dist/public/assets/ConsentDialogBody-Bza0TMPd.js +2 -0
- package/dist/public/assets/DocumentContext-WluK-pvu.js +32 -0
- package/dist/public/assets/EnableSyncConfirmDialog-BWfcC03w.js +1 -0
- package/dist/public/assets/{GraphPanel-DiyMfzQg.js → GraphPanel-Cf9lwwnw.js} +3 -3
- package/dist/public/assets/ManagedArtifactProperties-BoAxNvK5.js +1 -0
- package/dist/public/assets/McpConsentDialogBody-DXwlUNR4.js +1 -0
- package/dist/public/assets/PropertyPanel-Bbn9RXvr.js +2 -0
- package/dist/public/assets/SettingsDialogBody-BVNxduDH.js +7 -0
- package/dist/public/assets/ShareBranchSwitchDialog-Bo95Aacz.js +1 -0
- package/dist/public/assets/ShareReceiveDialog-jEI9GD0l.js +1 -0
- package/dist/public/assets/ShareReceiveMissDialog-8HKZBtux.js +1 -0
- package/dist/public/assets/{SkillEditorActions-BsGotb40.js → SkillEditorActions-85awfZeZ.js} +1 -1
- package/dist/public/assets/SourceEditor-D0oQT5qb.js +2 -0
- package/dist/public/assets/{TerminalPanel-XlICQw5o.js → TerminalPanel-BNR82pgE.js} +2 -2
- package/dist/public/assets/{_baseFor-D25oCqSU.js → _baseFor-D774tcxR.js} +1 -1
- package/dist/public/assets/{agent-presence-BRmBPq78.js → agent-presence-C79Orlhd.js} +1 -1
- package/dist/public/assets/{arc-DHpQGPKi.js → arc-CbtK-u7K.js} +1 -1
- package/dist/public/assets/architecture-YZFGNWBL-BuVsq_Vy.js +1 -0
- package/dist/public/assets/{architectureDiagram-Q4EWVU46-Dl6zKdMi.js → architectureDiagram-Q4EWVU46-BEI0DR2f.js} +1 -1
- package/dist/public/assets/arrow-up-right-DoN2FmSd.js +1 -0
- package/dist/public/assets/auth-state-cache-CaiWuhtJ.js +11 -0
- package/dist/public/assets/{blockDiagram-DXYQGD6D-TTNbipzm.js → blockDiagram-DXYQGD6D-CvhaR3v1.js} +1 -1
- package/dist/public/assets/button-cneJOVxD.js +1 -0
- package/dist/public/assets/{c4Diagram-AHTNJAMY-DJ6_yNro.js → c4Diagram-AHTNJAMY-CGJ_dXh7.js} +1 -1
- package/dist/public/assets/{calendar-BefXYqrv.js → calendar-D62otKE3.js} +1 -1
- package/dist/public/assets/channel-DQ8biAJJ.js +1 -0
- package/dist/public/assets/check-Dqb-7gfx.js +1 -0
- package/dist/public/assets/checkbox-P04sbGVQ.js +1 -0
- package/dist/public/assets/chevron-down-D3nis7uo.js +1 -0
- package/dist/public/assets/chevron-left-C6Q_NKVx.js +1 -0
- package/dist/public/assets/chevron-right-BfmqRYl8.js +1 -0
- package/dist/public/assets/{chunk-2KRD3SAO-tPsWTtQ8.js → chunk-2KRD3SAO-CTZc4q6X.js} +1 -1
- package/dist/public/assets/{chunk-336JU56O-BDNF8ABQ.js → chunk-336JU56O-Df_WdTwV.js} +2 -2
- package/dist/public/assets/chunk-426QAEUC-Bmtezokd.js +1 -0
- package/dist/public/assets/{chunk-4BX2VUAB-B11p4CCh.js → chunk-4BX2VUAB-DdaeBv7j.js} +1 -1
- package/dist/public/assets/{chunk-4TB4RGXK-k8il4Vah.js → chunk-4TB4RGXK-Z_KF79WQ.js} +1 -1
- package/dist/public/assets/chunk-55IACEB6-BMw0jGoU.js +1 -0
- package/dist/public/assets/{chunk-5FUZZQ4R-BhDATrAC.js → chunk-5FUZZQ4R-BP1tPdP4.js} +1 -1
- package/dist/public/assets/{chunk-5PVQY5BW-7GSXpGpA.js → chunk-5PVQY5BW-DHmdYl18.js} +1 -1
- package/dist/public/assets/{chunk-67CJDMHE-DhsO5dA4.js → chunk-67CJDMHE-Dr8TgESK.js} +1 -1
- package/dist/public/assets/{chunk-7N4EOEYR-_OPnqGDq.js → chunk-7N4EOEYR-wyEzdjqa.js} +1 -1
- package/dist/public/assets/{chunk-AA7GKIK3-CmQNMaMq.js → chunk-AA7GKIK3-DwcoEi3L.js} +1 -1
- package/dist/public/assets/{chunk-BSJP7CBP-DRn1Q8qZ.js → chunk-BSJP7CBP-Bi10nqUB.js} +1 -1
- package/dist/public/assets/{chunk-CIAEETIT-B6L60eSe.js → chunk-CIAEETIT-BRhaZZvf.js} +1 -1
- package/dist/public/assets/{chunk-EDXVE4YY-TfqLQBKW.js → chunk-EDXVE4YY-Cdm2p7eD.js} +1 -1
- package/dist/public/assets/{chunk-ENJZ2VHE-CqUfmxZL.js → chunk-ENJZ2VHE-CtYN5PYG.js} +1 -1
- package/dist/public/assets/{chunk-FMBD7UC4-_M3xiFqk.js → chunk-FMBD7UC4-yxpni0iy.js} +1 -1
- package/dist/public/assets/{chunk-FOC6F5B3-R--gjWDw.js → chunk-FOC6F5B3-zU_D2qL3.js} +1 -1
- package/dist/public/assets/{chunk-ICPOFSXX-MhneOmo1.js → chunk-ICPOFSXX-B1LaL7po.js} +2 -2
- package/dist/public/assets/{chunk-K5T4RW27-kfFBI7dm.js → chunk-K5T4RW27-CMA0573G.js} +1 -1
- package/dist/public/assets/{chunk-KGLVRYIC-MGoiNxXR.js → chunk-KGLVRYIC-4qBf2hVO.js} +1 -1
- package/dist/public/assets/{chunk-LIHQZDEY-3OBi6RFi.js → chunk-LIHQZDEY-DLhCQB7m.js} +1 -1
- package/dist/public/assets/{chunk-ORNJ4GCN-D1jJqGHz.js → chunk-ORNJ4GCN-DYvOtc7p.js} +1 -1
- package/dist/public/assets/{chunk-OYMX7WX6-Dn8GoIJo.js → chunk-OYMX7WX6-Cb6J6ILi.js} +1 -1
- package/dist/public/assets/chunk-QZHKN3VN-D9Augrqb.js +1 -0
- package/dist/public/assets/{chunk-U2HBQHQK-Wd4MIHD7.js → chunk-U2HBQHQK-BQEFtvNE.js} +1 -1
- package/dist/public/assets/{chunk-X2U36JSP-DgR3BYDC.js → chunk-X2U36JSP-B0NFvVYj.js} +1 -1
- package/dist/public/assets/{chunk-XPW4576I-BIhGQhfc.js → chunk-XPW4576I-CWtaxsuf.js} +1 -1
- package/dist/public/assets/{chunk-YZCP3GAM-DfCU0Z-P.js → chunk-YZCP3GAM-wveZpL2J.js} +1 -1
- package/dist/public/assets/{chunk-ZZ45TVLE-Bml1MOax.js → chunk-ZZ45TVLE-DjoyvapL.js} +1 -1
- package/dist/public/assets/classDiagram-6PBFFD2Q-Bh_mU7DM.js +1 -0
- package/dist/public/assets/classDiagram-v2-HSJHXN6E-thFVFTz4.js +1 -0
- package/dist/public/assets/clone-CJvW7gHo.js +1 -0
- package/dist/public/assets/collapsible-iVWLn36m.js +1 -0
- package/dist/public/assets/config-context-CVpOcWSZ.js +1 -0
- package/dist/public/assets/config-provider-D-gGfmXm.js +4 -0
- package/dist/public/assets/{cose-bilkent-S5V4N54A-CIV0yZWV.js → cose-bilkent-S5V4N54A--ojmzpj3.js} +1 -1
- package/dist/public/assets/{cursor-CpjEfgnv.js → cursor-CGeB2PU5.js} +1 -1
- package/dist/public/assets/{dagre-BUnZfAns.js → dagre-D_jVclke.js} +1 -1
- package/dist/public/assets/{dagre-KV5264BT-Bscv1HQo.js → dagre-KV5264BT-LC6-Nebl.js} +1 -1
- package/dist/public/assets/desktop-bridge-types-C22Y6m5Y.js +1 -0
- package/dist/public/assets/{diagram-5BDNPKRD-QBP7yg8z.js → diagram-5BDNPKRD-HYhuDT0y.js} +1 -1
- package/dist/public/assets/{diagram-G4DWMVQ6-CMdeZ41j.js → diagram-G4DWMVQ6-CSvJiR_m.js} +1 -1
- package/dist/public/assets/{diagram-MMDJMWI5-DCz0ew8n.js → diagram-MMDJMWI5-CaR4m-x5.js} +1 -1
- package/dist/public/assets/{diagram-TYMM5635-zN9Dx1fB.js → diagram-TYMM5635-C2IGbfjW.js} +1 -1
- package/dist/public/assets/dialog-BiB39Lhy.js +45 -0
- package/dist/public/assets/dist-0Zj_lz7j.js +11 -0
- package/dist/public/assets/{dist-BdwnfcKi.js → dist-BEW6C_CZ.js} +1 -1
- package/dist/public/assets/dist-BVOt51sU.js +1 -0
- package/dist/public/assets/dist-BkxMNfFN.js +528 -0
- package/dist/public/assets/{dist-znFZQjzE.js → dist-BuoXuHTG.js} +1 -1
- package/dist/public/assets/dist-C0qRhuIN.js +1 -0
- package/dist/public/assets/{dist-CHEQzAl9.js → dist-CPpRuwFX.js} +1 -1
- package/dist/public/assets/{dist-3l3ADjEo.js → dist-CgYE3gek.js} +1 -1
- package/dist/public/assets/{dist-Dtxdqotp.js → dist-CkLidFHS.js} +1 -1
- package/dist/public/assets/{dist-E5KjgWw7.js → dist-D7I9jMga.js} +1 -1
- package/dist/public/assets/{dist-BgLh90uo2.js → dist-D8Itza26.js} +1 -1
- package/dist/public/assets/dist-D9WIglau.js +1 -0
- package/dist/public/assets/{dist-C3ftUzLd.js → dist-DI8cI4NP.js} +1 -1
- package/dist/public/assets/{dist-BZEgBj4N.js → dist-DPfhM7y8.js} +1 -1
- package/dist/public/assets/{dist-AQSp7Qij.js → dist-DQdOYnjt.js} +1 -1
- package/dist/public/assets/{dist-DWaLpHcz.js → dist-DVPtn9Zx.js} +1 -1
- package/dist/public/assets/dist-DfThKWJX.js +1 -0
- package/dist/public/assets/{dist-Bqo1ZTng.js → dist-Dg5nhLZ2.js} +1 -1
- package/dist/public/assets/{dist-KBKQayVB.js → dist-IEs1iCqd.js} +1 -1
- package/dist/public/assets/doc-hash-5OIPOG-G.js +1 -0
- package/dist/public/assets/documents-events-D064jVvV.js +1 -0
- package/dist/public/assets/{erDiagram-SMLLAGMA-CFPPEjz0.js → erDiagram-SMLLAGMA-D1J1j3Yx.js} +1 -1
- package/dist/public/assets/file-tree-adapter-Bg8FQvOB.js +1 -0
- package/dist/public/assets/{flatten-sS3L8FSH.js → flatten-CaB4Oqne.js} +1 -1
- package/dist/public/assets/{flowDiagram-DWJPFMVM-DOjygKY4.js → flowDiagram-DWJPFMVM-CMNxv96M.js} +1 -1
- package/dist/public/assets/{ganttDiagram-T4ZO3ILL-Cox3d5Yp.js → ganttDiagram-T4ZO3ILL-DSJ51gJ8.js} +1 -1
- package/dist/public/assets/git-branch-DtntyZcb.js +1 -0
- package/dist/public/assets/gitGraph-7Q5UKJZL-t28UFBv3.js +1 -0
- package/dist/public/assets/{gitGraphDiagram-UUTBAWPF-BXvw3bmB.js → gitGraphDiagram-UUTBAWPF-eqtXz7Hn.js} +1 -1
- package/dist/public/assets/{graphlib-FYrXvm7X.js → graphlib-CgeMr8SV.js} +1 -1
- package/dist/public/assets/index-BG8OZejR.js +2003 -0
- package/dist/public/assets/index-D53MQUCD.css +1 -0
- package/dist/public/assets/info-B_9IOYHV.js +1 -0
- package/dist/public/assets/info-OMHHGYJF-B1OgcQSI.js +1 -0
- package/dist/public/assets/{infoDiagram-42DDH7IO-Bk54rrHD.js → infoDiagram-42DDH7IO-CB_Gw_tn.js} +1 -1
- package/dist/public/assets/{input-DkQ8Zmzd.js → input-D0MSkqYi.js} +1 -1
- package/dist/public/assets/{isEmpty-DKKUMPPC.js → isEmpty-DA9OVgr8.js} +1 -1
- package/dist/public/assets/isSymbol-BR3mCdgP.js +1 -0
- package/dist/public/assets/{ishikawaDiagram-UXIWVN3A-Bc3G_190.js → ishikawaDiagram-UXIWVN3A-Cnz_ITKx.js} +1 -1
- package/dist/public/assets/{journeyDiagram-VCZTEJTY-CLrtuKm7.js → journeyDiagram-VCZTEJTY-3INdsNOc.js} +1 -1
- package/dist/public/assets/{kanban-definition-6JOO6SKY-DwQiIK5Z.js → kanban-definition-6JOO6SKY-BXFLNQXS.js} +1 -1
- package/dist/public/assets/keyboard-shortcuts-DiiTkD4P.js +1 -0
- package/dist/public/assets/label-hTzLGQhh.js +1 -0
- package/dist/public/assets/{line-Dk1foLQO.js → line-DXPDJkMA.js} +1 -1
- package/dist/public/assets/{linear-D7qoVA2u.js → linear-BmFs-_tv.js} +1 -1
- package/dist/public/assets/loader-circle-CiIO3Fk-.js +1 -0
- package/dist/public/assets/{mermaid-parser.core-WlD4T62P.js → mermaid-parser.core-B0CngrEV.js} +2 -2
- package/dist/public/assets/{mermaid.core-CLOkRfd8.js → mermaid.core-BKAbpHOL.js} +3 -3
- package/dist/public/assets/{mindmap-definition-QFDTVHPH-DYJRBCQs.js → mindmap-definition-QFDTVHPH-Bm9VbqSR.js} +1 -1
- package/dist/public/assets/miss-dialog-store-Ay7SdCdU.js +1 -0
- package/dist/public/assets/{now-C9pOxV0O.js → now-Cnt3xXdO.js} +1 -1
- package/dist/public/assets/{open-managed-artifact-tab-DBkxdYp_.js → open-managed-artifact-tab-TH1tyrz4.js} +2 -2
- package/dist/public/assets/{ordinal-BLFf0NQg.js → ordinal-Ca5DZ3xr.js} +1 -1
- package/dist/public/assets/packet-4T2RLAQJ-BPKm0rz4.js +1 -0
- package/dist/public/assets/panel-BH2RZRZQ.js +1 -0
- package/dist/public/assets/pending-receive-nav-store-BV9CpxST.js +1 -0
- package/dist/public/assets/pie-ZZUOXDRM-C37JdEN8.js +1 -0
- package/dist/public/assets/{pieDiagram-DEJITSTG-BtJ94Yhu.js → pieDiagram-DEJITSTG-0LpqYimt.js} +1 -1
- package/dist/public/assets/project-paths-Dvd83Cnz.js +1 -0
- package/dist/public/assets/prop-types-PwAyvfNz.js +1 -0
- package/dist/public/assets/{propagation-api-CR2CQW4x.js → propagation-api-BHhJitgG.js} +1 -1
- package/dist/public/assets/{quadrantDiagram-34T5L4WZ-B8wf6FVG.js → quadrantDiagram-34T5L4WZ-D4bhJC5O.js} +1 -1
- package/dist/public/assets/radar-PYXPWWZC-BqODBTH1.js +1 -0
- package/dist/public/assets/radio-group-1_2tsQbc.js +1 -0
- package/dist/public/assets/receive-store-z_JiltPn.js +2 -0
- package/dist/public/assets/{reduce-CrpTR7cO.js → reduce-BkAOm6E5.js} +1 -1
- package/dist/public/assets/refresh-cw-EVALIeLp.js +1 -0
- package/dist/public/assets/{requirementDiagram-MS252O5E-PrH6Wk-f.js → requirementDiagram-MS252O5E-CrZIuUV5.js} +1 -1
- package/dist/public/assets/{sankeyDiagram-XADWPNL6-DuDWdyws.js → sankeyDiagram-XADWPNL6-CDJh0Hcw.js} +1 -1
- package/dist/public/assets/{selection-context-vh0MmCBb.js → selection-context-DG6CuE_n.js} +1 -1
- package/dist/public/assets/{sequenceDiagram-FGHM5R23-BvF_oV_w.js → sequenceDiagram-FGHM5R23-Crf8F-0v.js} +1 -1
- package/dist/public/assets/share-metadata-rows-COyU9rhn.js +1 -0
- package/dist/public/assets/skill-actions-DmQL_HGK.js +1 -0
- package/dist/public/assets/skill-scope-Bt2TwqtA.js +1 -0
- package/dist/public/assets/skills-api-T8UMKFuI.js +1 -0
- package/dist/public/assets/{src-DEzC9TbA.js → src-60u1_sM3.js} +1 -1
- package/dist/public/assets/{stateDiagram-FHFEXIEX-BvOoHTsD.js → stateDiagram-FHFEXIEX-CoUQpm-3.js} +1 -1
- package/dist/public/assets/stateDiagram-v2-QKLJ7IA2-BM5GAHWg.js +1 -0
- package/dist/public/assets/target-navigation-intent-idRDy9hG.js +1 -0
- package/dist/public/assets/{telemetry-impl-BM7BnAv2.js → telemetry-impl-6qacFa_I.js} +2 -2
- package/dist/public/assets/telemetry-startup-ZaSL-kj2.js +1 -0
- package/dist/public/assets/{textarea-BQFFQ9_l.js → textarea-CUjvX3CU.js} +1 -1
- package/dist/public/assets/{timeline-definition-GMOUNBTQ-_VzX4HAF.js → timeline-definition-GMOUNBTQ-CiQZrQPS.js} +1 -1
- package/dist/public/assets/toggle-group-IN7Np0Is.js +1 -0
- package/dist/public/assets/tooltip-C9Dd0rIc.js +1 -0
- package/dist/public/assets/treeView-SZITEDCU-ByrE6Vcb.js +1 -0
- package/dist/public/assets/treemap-W4RFUUIX-BcYBme24.js +1 -0
- package/dist/public/assets/triangle-alert-r1Ou0VrE.js +1 -0
- package/dist/public/assets/{typing-burst-detector-BT98lJOb.js → typing-burst-detector-D-XypHNF.js} +3 -3
- package/dist/public/assets/{vennDiagram-DHZGUBPP-BiS2w_m-.js → vennDiagram-DHZGUBPP-CoqI8iiY.js} +1 -1
- package/dist/public/assets/wardley-RL74JXVD-DDdV8nDz.js +1 -0
- package/dist/public/assets/{wardleyDiagram-NUSXRM2D-BgB2gOdF.js → wardleyDiagram-NUSXRM2D-6pXCRu0Y.js} +1 -1
- package/dist/public/assets/{xychartDiagram-5P7HB3ND-DIurDFny.js → xychartDiagram-5P7HB3ND-C3ELwBEZ.js} +1 -1
- package/dist/public/index.html +74 -58
- package/dist/{repair-launch-json-B2igGItE.mjs → repair-launch-json-DsDdzz5S.mjs} +2 -2
- package/dist/{repair-mcp-configs-B0YDgxKo.mjs → repair-mcp-configs-CAw5k6Ut.mjs} +2 -2
- package/dist/repair-skills-BbCNUguw.mjs +3 -0
- package/dist/repair-skills-Bj4d8jaz.mjs +1 -0
- package/dist/server-lock-GuuouVft-BG2sFhIR.mjs +1 -0
- package/dist/{server-lock-CN2YHwpP-BYuwTc93.mjs → server-lock-iLcBw_q0-CPFOrsBn.mjs} +186 -184
- package/dist/src-7DlZEyGh.mjs +3 -0
- package/dist/start-CMWosjhu.mjs +3 -0
- package/dist/start-ame0DmVr.mjs +1 -0
- package/dist/write-project-skill-4cQ_oGJO.mjs +36 -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/constants-BwIQxzxy.mjs +0 -2
- package/dist/dist-DUXDeyBp.mjs +0 -1
- package/dist/git-handle-DdgvPBh6-C80s8fFN.mjs +0 -1
- package/dist/init-BzdKgHZr.mjs +0 -321
- package/dist/init-HqjPAvpy.mjs +0 -1
- package/dist/loader-BEm7pFin.mjs +0 -1
- package/dist/preview-BoSe54Y5.mjs +0 -1
- package/dist/public/assets/ActivityModeContent-QvRIx_do.js +0 -2
- package/dist/public/assets/ConsentDialogBody-CPX75E6Q.js +0 -2
- package/dist/public/assets/DocumentContext-zL3ZbwDo.js +0 -34
- package/dist/public/assets/ManagedArtifactProperties-OxkUY14x.js +0 -1
- package/dist/public/assets/McpConsentDialogBody-Dr_AIi2H.js +0 -1
- package/dist/public/assets/PropertyPanel-D9A27c2E.js +0 -2
- package/dist/public/assets/SettingsDialogBody-cotnwVMw.js +0 -7
- package/dist/public/assets/SourceEditor-BZ3cbLjs.js +0 -2
- package/dist/public/assets/architecture-YZFGNWBL-0pWnpYMK.js +0 -1
- package/dist/public/assets/button-DGf25ccp.js +0 -1
- package/dist/public/assets/channel-ClECMrL_.js +0 -1
- package/dist/public/assets/checkbox-EGJP9xna.js +0 -1
- package/dist/public/assets/chevron-down-CzFz_0zd.js +0 -1
- package/dist/public/assets/chevron-left-Bb3WBx0B.js +0 -1
- package/dist/public/assets/chevron-right-jyIhGBkw.js +0 -1
- package/dist/public/assets/chunk-426QAEUC-UlKin18B.js +0 -1
- package/dist/public/assets/chunk-55IACEB6-maKdi3q_.js +0 -1
- package/dist/public/assets/chunk-QZHKN3VN-DUJDGGgJ.js +0 -1
- package/dist/public/assets/classDiagram-6PBFFD2Q-C9zXtHUq.js +0 -1
- package/dist/public/assets/classDiagram-v2-HSJHXN6E-BLmW_Iw2.js +0 -1
- package/dist/public/assets/clone-1iKEKVKL.js +0 -1
- package/dist/public/assets/collapsible-CjgfK1G5.js +0 -1
- package/dist/public/assets/config-context-DhhN0rlf.js +0 -1
- package/dist/public/assets/config-validation-events-yB2QWKKJ.js +0 -11
- package/dist/public/assets/dialog-CIq9aQLf.js +0 -45
- package/dist/public/assets/dist-BRGUidv4.js +0 -526
- package/dist/public/assets/dist-BXd_K33i.js +0 -1
- package/dist/public/assets/dist-ICp_3rWY.js +0 -1
- package/dist/public/assets/documents-events-DA8Q5ICz.js +0 -11
- package/dist/public/assets/file-tree-adapter-CP3Xa3us.js +0 -1
- package/dist/public/assets/gitGraph-7Q5UKJZL-DNLE-2Tt.js +0 -1
- package/dist/public/assets/index-CG7gf_6X.css +0 -1
- package/dist/public/assets/index-CoukPsjj.js +0 -2004
- package/dist/public/assets/info-OMHHGYJF-BiaOigFV.js +0 -1
- package/dist/public/assets/isSymbol-BgthEULk.js +0 -1
- package/dist/public/assets/keyboard-shortcuts-DOkzBlgc.js +0 -1
- package/dist/public/assets/label-DyT4OD9H.js +0 -1
- package/dist/public/assets/navigation-targets-DNRja8Z0.js +0 -1
- package/dist/public/assets/packet-4T2RLAQJ-v1yqEdTP.js +0 -1
- package/dist/public/assets/panel-BbrtnF__.js +0 -1
- package/dist/public/assets/pie-ZZUOXDRM-pmbX_rAr.js +0 -1
- package/dist/public/assets/project-paths-CcPGtodV.js +0 -1
- package/dist/public/assets/prop-types-C-aZftyS.js +0 -1
- package/dist/public/assets/radar-PYXPWWZC-CQRfh76o.js +0 -1
- package/dist/public/assets/radio-group-CFPLlVag.js +0 -1
- package/dist/public/assets/skill-actions-Sc4IN52j.js +0 -1
- package/dist/public/assets/skills-api-ts3L80AV.js +0 -1
- package/dist/public/assets/stateDiagram-v2-QKLJ7IA2-B02IOISZ.js +0 -1
- package/dist/public/assets/target-navigation-intent-CIKQ1Hj-.js +0 -1
- package/dist/public/assets/telemetry-startup-Pz1ro4a2.js +0 -1
- package/dist/public/assets/toggle-group-Bc5FaFo3.js +0 -1
- package/dist/public/assets/tooltip-DiL7DBhT.js +0 -1
- package/dist/public/assets/treeView-SZITEDCU-iExObZ_v.js +0 -1
- package/dist/public/assets/treemap-W4RFUUIX-B-jRsyTq.js +0 -1
- package/dist/public/assets/wardley-RL74JXVD-DGsNLwY0.js +0 -1
- package/dist/repair-skills-Cv_2HgEN.mjs +0 -3
- package/dist/repair-skills-XaoNNrHC.mjs +0 -1
- package/dist/server-lock-8Lv6A-Xa-xTK-ENFB.mjs +0 -1
- package/dist/src-DD9KqmOQ.mjs +0 -3
- package/dist/start-B4zA8vv3.mjs +0 -1
- package/dist/start-DYPIgVG4.mjs +0 -3
- package/dist/write-project-skill-HXJW0bDK.mjs +0 -36
- /package/dist/public/assets/{ActivityPanelDiffView-TEHR9A38.js → ActivityPanelDiffView-BPrpOwiv.js} +0 -0
- /package/dist/public/assets/{__vite-browser-external-DimdflAw.js → __vite-browser-external-DfbEpKPK.js} +0 -0
- /package/dist/public/assets/{array-CXyn2wAU.js → array-DrKFfLpK.js} +0 -0
- /package/dist/public/assets/{clike-kHME1xsl.js → clike-CY4jFeI9.js} +0 -0
- /package/dist/public/assets/{colors-DOVRXUpv.js → colors-BwB-X4pV.js} +0 -0
- /package/dist/public/assets/{cytoscape.esm-DGKrBfTH.js → cytoscape.esm-B72MXB0V.js} +0 -0
- /package/dist/public/assets/{defaultLocale-CIVmmKdD.js → defaultLocale-DEFJZ-43.js} +0 -0
- /package/dist/public/assets/{diff-B_7QuALZ.js → diff-VsLDmRbo.js} +0 -0
- /package/dist/public/assets/{dist-BAzUe-Rb.js → dist-BdpTVkuI.js} +0 -0
- /package/dist/public/assets/{dist-ug68MPTZ.js → dist-CbgmYSt6.js} +0 -0
- /package/dist/public/assets/{external-link-Bc6KvE1i.js → external-link-ChNdN5KK.js} +0 -0
- /package/dist/public/assets/{file-tree-rename-validation-BqGkSO9-.js → file-tree-rename-validation-BkATWpiZ.js} +0 -0
- /package/dist/public/assets/{format-Fsxus_sZ.js → format-CFXD031r.js} +0 -0
- /package/dist/public/assets/{go-DlHfV6Cv.js → go-CJnIK4Uo.js} +0 -0
- /package/dist/public/assets/{init-DAmDTHXL.js → init-20ACqh4a.js} +0 -0
- /package/dist/public/assets/{isObjectLike-0yTn5bno.js → isObjectLike-DURfeUEd.js} +0 -0
- /package/dist/public/assets/{katex-gTwLOSI2.js → katex-BunQWEOH.js} +0 -0
- /package/dist/public/assets/{lua-Cpo6SgEb.js → lua-BTUOHEPy.js} +0 -0
- /package/dist/public/assets/{mcp-consent-store-Q_heVQ86.js → mcp-consent-store-Bx7YkTj-.js} +0 -0
- /package/dist/public/assets/{min-CGFu6QbN.js → min-cXlECwx8.js} +0 -0
- /package/dist/public/assets/{panzoom.es-1vRDHCmL.js → panzoom.es-BPpDWM66.js} +0 -0
- /package/dist/public/assets/{path-1iyJ-o9O.js → path-Bbctax8p.js} +0 -0
- /package/dist/public/assets/{pdf-BjE4l7oX.js → pdf-Cz6vffXS.js} +0 -0
- /package/dist/public/assets/{pdf.worker-CU7PVDgr.js → pdf.worker-CUSszLRa.js} +0 -0
- /package/dist/public/assets/{perl-uq5LpsPX.js → perl-CSl7RrAK.js} +0 -0
- /package/dist/public/assets/{properties-DuLkwqft.js → properties-KpJMIKzZ.js} +0 -0
- /package/dist/public/assets/{r-DcEDABBa.js → r-DFsc7DIH.js} +0 -0
- /package/dist/public/assets/{rough.esm-Bk-GM2I8.js → rough.esm-CTApjP9q.js} +0 -0
- /package/dist/public/assets/{ruby-C6V5dDsD.js → ruby-dZPnOz8h.js} +0 -0
- /package/dist/public/assets/{shell-CVvCNjui.js → shell-CYSl653a.js} +0 -0
- /package/dist/public/assets/{sql-CQQBnjZX.js → sql-BfVjfYES.js} +0 -0
- /package/dist/public/assets/{src-C3imF5Zq.js → src-BjEzLuzr.js} +0 -0
- /package/dist/public/assets/{startup-marks-CWTDb1CP.js → startup-marks-DdMtjWR-.js} +0 -0
- /package/dist/public/assets/{stex-coA_FIxI.js → stex-DYxKXJZx.js} +0 -0
- /package/dist/public/assets/{swift-BBOV2SBg.js → swift-DjBuuwmF.js} +0 -0
- /package/dist/public/assets/{toml-lQGk0tnp.js → toml-C3_Svn60.js} +0 -0
- /package/dist/public/assets/{trace-api-MhJXZpsM.js → trace-api-D6fqC5Nw.js} +0 -0
- /package/dist/public/assets/{w3c-keyname-beU76Hfb.js → w3c-keyname-CHcJEDvG.js} +0 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{s as e}from"./chunk-C94x7I9S.mjs";import{c as t,l as n,s as r,u as i}from"./server-lock-iLcBw_q0-CPFOrsBn.mjs";import{Mr as a,Nr as o,Tn as s,ii as c,pn as l,xn as u}from"./dist-D13xYuEX.mjs";import{t as d}from"./esm-CsQUg9js.mjs";import"./gh-detect-BcBj3YlE.mjs";import{x as f,y as p}from"./init-BOHFI-M4.mjs";import{l as m,n as ee}from"./write-project-skill-4cQ_oGJO.mjs";import"./loader-ea54dQyy.mjs";import{c as te}from"./colors-8SzMRIVy.mjs";import"./preview-CLxs2bk2.mjs";import{dirname as ne,isAbsolute as h,join as g,relative as _,resolve as v}from"node:path";import{hostname as re}from"node:os";import{existsSync as y,lstatSync as ie,readFileSync as b,readlinkSync as x,statSync as S}from"node:fs";import{readFile as C,realpath as w}from"node:fs/promises";function T(e,a,o={}){let s=i(e,a);if(!y(s))return{status:`missing`,lockPath:s};let c;try{c=JSON.parse(b(s,`utf-8`))}catch{return{status:`corrupt`,lockPath:s}}if(!c||typeof c!=`object`||!n(c.pid))return{status:`corrupt`,lockPath:s};let l=c;if(!(o.isAlive??t)(l.pid))return{status:`dead-pid`,lockPath:s,lock:l};if(typeof l.machineId==`string`)return l.machineId===(o.machineId??r())?{status:`alive`,lockPath:s,lock:l}:{status:`foreign-host`,lockPath:s,lock:l};let u=o.host??re();return l.hostname===u?{status:`alive`,lockPath:s,lock:l}:{status:`foreign-host`,lockPath:s,lock:l}}function E(e){return e.replace(/:\d+$/,``)}function D(e){let t=e.trim();if(!t)return null;{let e=/^https?:\/\/([^/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`https`,hostname:E(e[1]),owner:e[2],name:e[3]}}{let e=/^ssh:\/\/(?:[\w.-]+@)?([^/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`ssh`,hostname:E(e[1]),owner:e[2],name:e[3]}}{let e=/^git:\/\/([^/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`git`,hostname:E(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 O(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(`/`)}}function k(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(`/`);if(n.length<5||n[0]!==``||n[3]!==`tree`)return null;let r=n.slice(5);r.length===1&&r[0]===``&&r.pop();let i,a,o,s;try{i=decodeURIComponent(n[1]),a=decodeURIComponent(n[2]),o=decodeURIComponent(n[4]),s=r.map(e=>decodeURIComponent(e))}catch{return null}return!i||!a||!o||s.some(e=>e.length===0)?null:{owner:i,repo:a,branch:o,path:s.join(`/`)}}function ae(e){let t=O(e);if(t)return{kind:`doc`,...t};let n=k(e);return n?{kind:`folder`,...n}:null}const oe=`# >>> open-knowledge cli >>>`,se=`# <<< open-knowledge cli <<<`,A=/^# >>> open-knowledge cli >>>\n[\s\S]*?^# <<< open-knowledge cli <<<\n?/m;function j(e){return g(e,`Library`,`Application Support`,`OpenKnowledge`,`path-install.json`)}const M={existsSync:e=>y(e),readFileSync:(e,t)=>b(e,t),lstatSync:e=>ie(e),readlinkSync:e=>x(e)};function N(e,t=M){let n=j(e);if(!t.existsSync(n))return null;try{let e=JSON.parse(t.readFileSync(n,`utf8`));return e?.version===1?e:null}catch{return null}}function P(e){let t=e.replace(A,``);return{text:t,changed:t!==e,emptyAfter:t.trim()===``}}function F(e,t,n=M){try{return n.lstatSync(e).isSymbolicLink()?n.readlinkSync(e)===t:!1}catch{return!1}}const I=new Set([`start`,`stop`,`status`,`clean`,`ui`,`mcp`,`preview`,`deinit`]);function L(e,t,n=s){if(e!==void 0&&!I.has(e))return null;let r=n(t);return r===null||r.distance===0?null:r.rootPath}let R=null;function z(e){R=e}function B(){return R??process.cwd()}var V=e(te(),1);function H(e){return e==null?!1:e.includes(`--type=utility`)&&e.includes(`--utility-sub-type=node.mojom.NodeService`)}function U(e,t=Date.now()){let n=new Date(e).getTime();if(Number.isNaN(n))return`—`;let r=t-n,i=Math.floor(r/1e3);if(i<60)return`${i}s`;let a=Math.floor(i/60);if(a<60)return`${a}m ago`;let o=Math.floor(a/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}function W(e,t,n,r,i,a){if(t.status===`missing`||t.status===`corrupt`)return null;let o=t.lock,s=null;if(n.status!==`missing`&&n.status!==`corrupt`){let e=n.lock;s={port:e.port,status:n.status,pid:e.pid,startedAt:e.startedAt,usage:a}}return{directory:o.worktreeRoot,server:{port:o.port,status:t.status,pid:o.pid,startedAt:o.startedAt,usage:i},ui:s,hostname:o.hostname,lockPath:t.lockPath,binary:r==null?null:u(r),command:r,isDesktop:H(r)}}function G(e){return e.ui==null?!1:e.ui.status===`alive`||e.ui.status===`foreign-host`}function K(e){let t=e.server.status;return t===`alive`||t===`foreign-host`?e.isDesktop?`desktop`:t===`alive`?`running`:`foreign`:t===`dead-pid`&&G(e)?`ui-orphan`:`stale`}const ce=new Set([`running`,`desktop`,`foreign`,`ui-orphan`]);function le(e){switch(e){case`running`:return V.default.green(e);case`desktop`:return V.default.blue(e);case`foreign`:return V.default.cyan(e);case`ui-orphan`:return V.default.magenta(e);case`stale`:return V.default.yellow(e)}}function q(e){return e==null?`—`:`${e.cpuPercent.toFixed(1)}% / ${e.memPercent.toFixed(1)}%`}function ue(e){return`${q(e.server.usage)} | ${q(e.ui?.usage??null)}`}function de(e){return`${e.server.port===0?`(starting)`:String(e.server.port)} / ${e.ui==null||e.ui.status===`dead-pid`?`—`:String(e.ui.port)}`}function fe(e){if(e.length===0)return`No open-knowledge servers found.`;let t=[`DIRECTORY`,`PORTS (API/UI)`,`CPU/MEM (API | UI)`,`STATUS`,`PID`,`STARTED`,`BINARY`],n=e.map(e=>{let t=K(e),n=t===`ui-orphan`&&e.ui!=null?e.ui.pid:e.server.pid;return[e.directory,de(e),ue(e),t,String(n),U(e.server.startedAt),e.binary??`—`]}),r=t.length,i=t.map(e=>e.length);for(let e of n)for(let t=0;t<r;t++)i[t]=Math.max(i[t]??0,(e[t]??``).length);let a=t.map((e,t)=>e.padEnd(i[t]??0)).join(` `).trimEnd(),o=e.map((e,t)=>{let a=n[t]??[],o=[];for(let t=0;t<r;t++){let n=(a[t]??``).padEnd(i[t]??0);if(t===3){let r=a[t]??``;n=le(K(e))+` `.repeat(Math.max(0,(i[t]??0)-r.length))}o.push(n)}return o.join(` `).trimEnd()}),s=V.default.dim(`To stop a server: ok stop <port|pid|directory|all>`);return[a,...o,``,s].join(`
|
|
2
|
+
`)}async function J(e={}){let t=e.discover??l,n=e.inspect??T,r=e.log??(e=>console.log(e)),i=e.resolveCommand??a,s=e.resolveUsage??o,c=await t(),u=[];for(let e of c){let t=n(e,`server`),r=n(e,`ui`),a=W(e,t,r,t.status===`missing`||t.status===`corrupt`?null:i(t.lock.pid),t.status===`missing`||t.status===`corrupt`?null:s(t.lock.pid),r.status===`missing`||r.status===`corrupt`?null:s(r.lock.pid));a!=null&&u.push(a)}if(e.json){let e=u.map(e=>({...e,displayStatus:K(e)}));r(JSON.stringify(e,null,2));return}r(fe(e.all?u:u.filter(e=>ce.has(K(e)))))}function pe(){return new d(`ps`).description(`List all running open-knowledge servers`).argument(`[modifier]`,`"all" to include stale (dead-pid) entries`).option(`--all`,`Include stale (dead-pid) entries (foreign-host shows by default)`).option(`--json`,`Emit structured JSON (always includes all statuses)`).action(async(e,t)=>{await J({all:t.all===!0||e===`all`,json:t.json===!0})})}function me(e,n,r={}){let i=r.isAlive??t,a=[];for(let[t,r]of[[`server`,e],[`ui`,n]])(r.status===`alive`||r.status===`foreign-host`&&i(r.lock.pid))&&a.push({name:t,pid:r.lock.pid,port:r.lock.port});return{targets:a}}function Y(e){let t=e.inspect??(t=>T(e.lockDir,t)),n=e.kill??((e,t)=>process.kill(e,t)),r=e.log??(e=>console.log(e)),i=e.error??(e=>console.error(e)),a=me(t(`server`),t(`ui`),{isAlive:e.isAlive});if(a.targets.length===0)return r(`No running open-knowledge processes.`),{stopped:[],failed:[],hadTargets:!1};let o=[],s=[];for(let e of a.targets)try{n(e.pid,`SIGTERM`),o.push(e)}catch(t){s.push({target:e,error:t instanceof Error?t.message:String(t)})}return o.length>0&&r(`Stopped: ${o.map(e=>`${e.name} (pid=${e.pid}, port=${e.port})`).join(`, `)}`),s.length>0&&i(`Failed to stop: ${s.map(({target:e,error:t})=>`${e.name} (pid=${e.pid}): ${t}`).join(`; `)}`),{stopped:o,failed:s,hadTargets:!0}}function X(e,t){return e.status===`alive`?!0:e.status===`foreign-host`?t(e.lock.pid):!1}async function he(e,n=t){let r=await l(),i=null;for(let t of r){let r=T(t,`server`),a=T(t,`ui`);if(X(r,n)&&r.lock.port===e||X(a,n)&&a.lock.port===e)return t;i===null&&(X(r,n)&&r.lock.pid===e||X(a,n)&&a.lock.pid===e)&&(i=t)}return i}function Z(e){let t=Y({lockDir:e});return t.failed.length>0&&(process.exitCode=1),t}function ge(e){return new d(`stop`).description(`Stop open-knowledge server(s). With no argument: stops the server for the current directory. Pass a port number, a directory path, or "all" to target globally.`).argument(`[target...]`,`port number, directory path (spaces OK), or "all"`).action(async n=>{let r=n.length===0?void 0:n.join(` `);if(r===void 0){e();let t=Y({lockDir:c(process.cwd()),log:()=>{}});if(t.hadTargets){if(t.stopped.length>0){let e=t.stopped.map(e=>`${e.name} (pid=${e.pid}, port=${e.port})`).join(`, `);console.log(`Stopped: ${e}`)}t.failed.length>0&&(process.exitCode=1)}else await J({});return}if(r===`all`){let e=await l();if(e.length===0){console.log(`No running open-knowledge servers found.`);return}let n=0;for(let r of e){let e=T(r,`server`),i=T(r,`ui`);!X(e,t)&&!X(i,t)||(Z(r),n++)}n===0&&console.log(`No running open-knowledge servers found.`);return}if(/^\d+$/.test(r)){let e=Number.parseInt(r,10),t=await he(e);if(t===null){console.log(`No running open-knowledge server found with port or PID ${e}.`);return}Z(t);return}Z(c(v(B(),r)))})}function _e(e){return{event:`mcp-config-decline`,scope:e.scope,surface:e.surface,editorId:e.editorId,reason:e.reason}}async function Q(e,t){let n,r;try{n=await w(v(e)),r=await w(v(ne(e)))}catch{return{kind:`not-git`}}if(!$(n,r))return{kind:`symlink-escape`};let i=g(n,`.git`),a;try{a=S(i)}catch{return{kind:`not-git`}}let o;if(a.isDirectory()){let e;try{e=await w(i)}catch{return{kind:`not-git`}}if(!$(e,n))return{kind:`symlink-escape`};o=e}else if(a.isFile()){let e;try{e=await C(i,`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(),a=h(r)?r:v(n,r);try{o=await w(a)}catch{return{kind:`not-git`}}}else return{kind:`not-git`};let s=g(await ve(o),`config`),c;try{c=await C(s,`utf-8`)}catch{return{kind:`not-git`}}let l=be(c);if(l===null)return{kind:`no-origin`};let u=D(l);if(u===null||u.hostname!==`github.com`)return{kind:`non-github`};let d=u.owner.toLowerCase()===t.owner.toLowerCase(),f=u.name.toLowerCase()===t.repo.toLowerCase();return!d||!f?{kind:`wrong-repo`,actualOwner:u.owner,actualRepo:u.name}:{kind:`ok`,gitRemoteUrl:`https://github.com/${u.owner}/${u.name}.git`}}async function ve(e){let t;try{t=(await C(g(e,`commondir`),`utf-8`)).trim()}catch{return e}if(t.length===0)return e;let n=h(t)?t:v(e,t);try{return await w(n)}catch{return n}}function $(e,t){if(e===t)return!0;let n=_(t,e);return n.length>0&&!n.startsWith(`..`)&&!h(n)}function ye(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 be(e){let t=!1;for(let n of e.split(/\r?\n/)){let e=ye(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 xe(r[1])}return null}function xe(e){let t=e.trim();return t.startsWith(`"`)&&t.endsWith(`"`)||t.startsWith(`'`)&&t.endsWith(`'`)?t.slice(1,-1):t}const Se=[{id:`mcp-config`,write(e,t,n){let r=e.projectConfigPath?.(t);if(!r)return{integration:`mcp-config`,editorId:e.id,action:`skipped-unsupported`};try{let i=f(e,t,n,void 0,r);return i.action===`written`||i.action===`overwritten`?{integration:`mcp-config`,editorId:e.id,action:i.action,path:i.configPath}:i.action===`failed`?{integration:`mcp-config`,editorId:e.id,action:`failed`,path:i.configPath,error:i.error??`unknown failure`}:i.action===`declined`?{integration:`mcp-config`,editorId:e.id,action:`declined`,path:i.configPath,...i.declineReason===void 0?{}:{reason:i.declineReason}}:{integration:`mcp-config`,editorId:e.id,action:`failed`,path:i.configPath,error:`unexpected project-scope action: ${i.action}`}}catch(t){return{integration:`mcp-config`,editorId:e.id,action:`failed`,path:r,error:t instanceof Error?t.message:String(t)}}}},{id:`project-skill`,write(e,t,n){try{let n=ee(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 Ce(e,t,n={},r=Se){let i=[];for(let a of t){let t=m[a];for(let a of r)i.push(a.write(t,e,n))}return i}function we(e,t,n={}){return{integrations:Ce(e,t,n),claudeLaunchJson:t.includes(`claude`)?p(e,n):void 0}}export{ae as _,ge as a,T as b,L as c,se as d,F as f,O as g,P as h,Y as i,oe as l,N as m,Q as n,pe as o,j as p,_e as r,z as s,we as t,A as u,k as v,D as y};
|
|
3
|
+
//# sourceMappingURL=src-7DlZEyGh.mjs.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{Mn as e,ht as t}from"./server-lock-iLcBw_q0-CPFOrsBn.mjs";import{cr as n,jr as r,xr as i}from"./dist-D13xYuEX.mjs";import{n as a,t as o}from"./esm-CsQUg9js.mjs";import{i as s,t as c}from"./gh-detect-BcBj3YlE.mjs";import{n as l}from"./constants-CgXx1dPb.mjs";import{spawn as u}from"node:child_process";import{basename as d,dirname as f,join as p}from"node:path";import{homedir as m}from"node:os";import{closeSync as h,existsSync as g,mkdirSync as _,openSync as v,statSync as y}from"node:fs";import{rm as b}from"node:fs/promises";import{setTimeout as x}from"node:timers/promises";const S=`OpenKnowledge.app`,C=`/Applications/${S}`;function w(){return{platform:process.platform,env:process.env,execPath:process.execPath,isTTY:process.stdout.isTTY,statSync:e=>{try{return y(e,{throwIfNoEntry:!1})??null}catch{return null}}}}function T(e){if(e.env.ELECTRON_RUN_AS_NODE===`1`){let t=/(.+?\.app)\/Contents\/MacOS\//.exec(e.execPath);if(t?.[1])return t[1]}if(E(e,C))return C;let t=p(e.homeDir??m(),`Applications`,S);return E(e,t)?t:null}function E(e,t){try{let n=p(t,`Contents`,`MacOS`,`OpenKnowledge`),r=e.statSync(n);return r&&typeof r.isFile==`function`?r.isFile():!1}catch{return!1}}function D(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=T(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 O(e){(e.log??(e=>console.error(e)))("Launching OpenKnowledge 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 k(e=`no-bundle`){switch(e){case`no-bundle`:return`Desktop app not found at ${C}. 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 ${C} (filesystem error). Check permissions or use --mode=browser.`;case`available`:return`Desktop app appears available at ${C} but launch dispatch did not fire (caller bug).`}}function A(e){return p(f(e),`..`,`Frameworks`,`OpenKnowledge Server.app`,`Contents`,`MacOS`,`OpenKnowledge Helper`)}const j=/\/[^/]+\.app\/Contents\/MacOS\/[^/]+$/;function M(e){if(e.platform!==`darwin`||!j.test(e.execPath))return null;let t=A(e.execPath);return e.exists(t)?t:null}function N(e={}){let t=e.execPath??process.execPath,n=e.platform??process.platform,r=e.argv??process.argv,i=e.exists??g,a=r[1];return a?{command:M({execPath:t,platform:n,exists:i})??t,prefixArgs:[a]}:(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(r)}`),{command:`npx`,prefixArgs:[`-y`,`@inkeep/open-knowledge@latest`]})}function P(e,t){return e.host??t.HOST??`127.0.0.1`}function F(e){let t=d(e).replace(/[^\x20-\x7E]/g,``).trim().slice(0,64);return`open-knowledge-server ${t.length>0?t:`unknown`}`}var I=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 L(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 R(t){g(t.lockDir)||_(t.lockDir,{recursive:!0});let n=v(p(t.lockDir,e),`w`),r=t.spawn??u,{PORT:i,...a}=process.env,o=N();try{let e=r(o.command,[...o.prefixArgs,...t.args??[`ui`]],{detached:!0,stdio:[`ignore`,`ignore`,n],cwd:t.cwd,env:{...a,ELECTRON_RUN_AS_NODE:`1`}});return e.unref(),e}finally{try{h(n)}catch{}}}function z(e,t,n){return e??(n===void 0?t:void 0)}function B(e,t){return e!==void 0&&t!==null&&t.port>0&&t.draining!==!0}function V(e,t,n){return e??(t!=null&&!n?1:0)}async function H(e){let t=e.spawn??u,n=N(),{PORT:r,...i}=process.env,a=t(n.command,[...n.prefixArgs,`ui`,`--port`,String(e.uiPort)],{cwd:e.cwd,stdio:`inherit`,env:{...i,ELECTRON_RUN_AS_NODE:`1`}}),o=!1,s=e=>{o=!0;try{a.kill(e)}catch{}},c=()=>s(`SIGINT`),l=()=>s(`SIGTERM`);process.once(`SIGINT`,c),process.once(`SIGTERM`,l),await new Promise(e=>{a.on(`exit`,(t,n)=>{process.exitCode=V(t,n,o),e()}),a.on(`error`,t=>{console.error(`[start] connect fallback: failed to spawn ok ui — ${t instanceof Error?t.message:String(t)}`),process.exitCode=1,e()})}),process.removeListener(`SIGINT`,c),process.removeListener(`SIGTERM`,l)}async function U(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 W=t;function G(e,t,n=e=>b(e,{recursive:!0,force:!0})){return async()=>{try{await e()}finally{try{await n(t)}catch(e){process.stderr.write(`[start] ephemeral temp dir reap failed for ${t}: ${e instanceof Error?e.message:String(e)}\n`)}}}}function K(e,t={}){let n=t.exit??(e=>process.exit(e)),r=t.getActiveHandles??(()=>{let e=process._getActiveHandles;return e?e.call(process):null});return async()=>{let i=!1;try{await e()}catch(e){i=!0,t.log?.error({err:e},`idle-shutdown: destroy failed — exiting anyway`)}finally{let e=null;try{let t=r();if(t!==null){e={};for(let n of t){let t=n?.constructor?.name??`unknown`;e[t]=(e[t]??0)+1}}}catch{e=null}t.log?.info({event:`idle-shutdown-exit`,exitCode:i?1:0,openHandles:e??{},handlesAvailable:e!==null},`idle-shutdown: teardown finished — exiting process`),n(i?1:0)}}}function q(e){let t=e.sigtermGraceMs??W,n=e.sigtermPollIntervalMs??200,r=e.sleep??(e=>x(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 J(e){let{config:t,cwd:a,host:o}=e,l=e.skipAutoInit??!1,u=e.skipUiAutoSpawn??!1,d=e.idleThresholdMs??18e5,{existsSync:f,mkdirSync:p}=await import(`node:fs`),{basename:m,dirname:h}=await import(`node:path`),{bootServer:g,getLogger:_,isProcessAlive:v,readUiLock:y,resolveContentDir:b,resolveLockDir:S,waitForServerLockDrain:C}=await import(`./dist-D9WKY736.mjs`),w=e.log??_(`start`),T=e.singleFile!==void 0,E=e.projectDir??a,D=T?r(e.singleFile).canonicalFilePath:void 0,O=D?h(D):void 0,k=D?m(D):void 0;if(!T){if(!l&&!n(a))throw new I(a);let t=process.env.OK_RECLAIM_DISABLE??null,r=e=>{let t=typeof e.event==`string`?e.event:``;(t.endsWith(`-failed`)||t.endsWith(`-error`)||t.endsWith(`-missing`))&&w.warn({event:e},`[start] reclaim sweep reported a problem`)};try{(e.repairMcpConfigsFn??(await import(`./repair-mcp-configs-CAw5k6Ut.mjs`)).repairMcpConfigs)({projectDir:a,reclaimDisableEnv:t,logger:r})}catch(e){w.warn({err:e},`[start] mcp-config repair sweep failed; continuing`)}try{(e.repairLaunchJsonFn??(await import(`./repair-launch-json-DsDdzz5S.mjs`)).repairLaunchJson)({projectDir:a,reclaimDisableEnv:t,logger:r})}catch(e){w.warn({err:e},`[start] launch.json repair sweep failed; continuing`)}try{await(e.repairSkillsFn??(await import(`./repair-skills-Bj4d8jaz.mjs`)).repairSkills)({projectDir:a,reclaimDisableEnv:t,logger:r})}catch(e){w.warn({err:e},`[start] skill repair sweep failed; continuing`)}}let A=O??b(t,a);!T&&!f(A)&&(p(A,{recursive:!0}),w.info({contentDir:A},`Created content directory`));let j=null,M=async({lockDir:t})=>{if(j=L({uiLock:y(t),isAlive:v}),j.action===`spawn`&&!u)try{let n=e.uiPort===void 0?void 0:[`ui`,`--port`,String(e.uiPort)];R({lockDir:t,cwd:a,spawn:e.spawn,args:n}),w.info({reason:j.reason,uiPort:e.uiPort},`[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 j.action===`skip`&&w.info({port:j.port,pid:j.pid},`UI already running at port ${j.port}`)},N=e.reactShellDistDir===void 0,P=s(),F=i();{let e=S(T?E:a),t=Date.now(),n=await C(e);n!==`no-drain`&&w.info({event:`start-waited-for-draining-predecessor`,outcome:n,waitedMs:Date.now()-t,drainLockDir:e},n===`released`?`[start] predecessor server finished draining — proceeding`:`[start] predecessor server still draining after wait — proceeding to collide`)}let z=await g({config:t,contentDir:A,projectDir:T?E:a,contentRoot:T?void 0:t.content.dir,port:e.port,host:o,quiet:!1,detectGh:c,tokenStore:P,embeddingsKeyStore:F,...T?{ephemeral:!0,singleDocRelPath:k,gitEnabled:!1,gitPreflight:()=>({ok:!0,version:`0.0.0`,resolvedPath:`git`,source:`PATH`})}:{},localOpCliArgs:[process.execPath,process.argv[1]],attachUiSibling:N,idleShutdownMs:d,skipAutoInit:!0,...N?{spawnUiSiblingFn:M}:{},idleShutdownHandler:t=>{let n=q({readUiLock:()=>y(z.lockDir),isAlive:v,killPid:(e,t)=>{process.kill(e,t)},destroy:t,log:w});return K(T?G(n,E):n,{log:w,exit:e.idleExit})},log:w,...e.serveContentAssets?{serveContentAssets:!0}:{},...e.reactShellDistDir?{reactShellDistDir:e.reactShellDistDir}:{}});j||={action:`skip`,reason:`alive`,pid:0,port:0};let B=j,V=null;if(B.action===`skip`)V=B.port>0?B.port:null;else if(!u){let t=e.uiBindTimeoutMs??3e3;V=await U({readUiLock:()=>y(z.lockDir),now:Date.now,sleep:e=>x(e),timeoutMs:t,pollIntervalMs:50}),V===null&&w.warn({timeoutMs:t},`[start] ok ui did not bind within timeout — banner falls back to API URL`)}return{httpServer:z.httpServer,destroy:z.destroy,lockDir:z.lockDir,contentDir:A,port:z.port,ready:z.ready,degraded:z.degraded,uiSpawnDecision:j,resolvedUiPort:V}}function ee(e){if(e===`browser`||e===`app`)return e;throw new a(`--mode must be 'browser' or 'app'`)}function te(e){let t=Number.parseInt(e,10);if(Number.isNaN(t)||t<1||t>65535)throw new a(`--ui-port must be a port number between 1 and 65535`);return t}function Y(e){return e.OK_CONSOLE_LEVEL!==void 0||e.LOG_LEVEL!==void 0?null:`warn`}function X(e){let t=[`Stopping OpenKnowledge…`,`Saving pending changes and releasing the server lock — this can take a few seconds.`];return e===`SIGINT`&&t.push(`Press Ctrl+C again to force quit.`),t}async function Z(e,t){let n=Y(process.env);n!==null&&(process.env.OK_CONSOLE_LEVEL=n);let{renderBanner:r}=await import(`./banner-BxCFCyu8.mjs`),{accent:i,dim:a,error:o,warning:s}=await import(`./colors-CmkIIbww.mjs`),c=process.cwd(),u=e;process.title=F(c);let d=P(t,process.env),f=t.port===void 0?void 0:Number(t.port),p=process.env.PORT?Number(process.env.PORT):void 0,m=t.uiPort===void 0?void 0:Number(t.uiPort),h=z(f,p,m);if(m!==void 0){let{readServerLock:e,resolveLockDir:t}=await import(`./dist-D9WKY736.mjs`);if(B(m,e(t(c)))){await H({cwd:c,uiPort:m});return}}let g;try{g=await J({config:u,cwd:c,host:d,port:h,...m===void 0?{}:{uiPort:m},...t.serveContentAssets?{serveContentAssets:!0}:{},...t.reactShellDistDir?{reactShellDistDir:t.reactShellDistDir}:{},...t.singleFile?{singleFile:t.singleFile}:{},...t.projectDir?{projectDir:t.projectDir}:{}})}catch(e){e instanceof I&&(console.error(o(e.message)),process.exit(1));let t=await import(`./dist-D9WKY736.mjs`);if((e instanceof t.GitNotAvailableError||e instanceof t.GitTooOldError)&&process.exit(78),(e instanceof t.SingleFileNotFoundError||e instanceof t.SingleFileNotAFileError||e instanceof t.SingleFileNotMarkdownError)&&(console.error(o(e.message)),process.exit(1)),m!==void 0&&Q(e,t)){await H({cwd:c,uiPort:m});return}let n=$(e,c,t);n!==null&&(console.error(o(n)),process.exit(1)),console.error(`${o(`Failed to start:`)} ${e instanceof Error?e.stack??e.message:String(e)}`),process.exit(1)}let _=!1,v=async e=>{if(_)return;_=!0;let[t,...n]=X(e);console.log(i(`\n${t}`));for(let e of n)console.log(a(` ${e}`));try{await g.destroy()}catch(e){console.error(`${o(`destroy() failed:`)} ${e instanceof Error?e.stack??e.message:String(e)}`),process.exitCode=1}process.exit(process.exitCode??0)};process.once(`SIGINT`,()=>{v(`SIGINT`)}),process.once(`SIGTERM`,()=>{v(`SIGTERM`)});let y=`http://${d}:${g.port}`,b=d===`0.0.0.0`||d===`::`?`http://0.0.0.0:${g.port}`:void 0,x=g.resolvedUiPort,S=x!==null&&x>0?`http://${d}:${x}`:y;console.log(r({name:`open-knowledge`,version:l,localUrl:S,apiUrl:S===y?void 0:y,networkUrl:b,nextSteps:[`Open the Editor URL in your browser to start editing.`]}));let C={"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`};g.ready.then(async()=>{if(g.degraded.length>0){console.log();for(let e of g.degraded){let t=C[e]??`${e} (check server logs for details)`;console.warn(` ${s(`⚠`)} ${s(e)}: ${a(t)}`)}console.log()}if(t.open){let{openBrowser:e}=await import(`./open-browser-DHTbHSqx.mjs`);e(S)}}).catch(e=>{console.error(` ${o(`Server initialization failed:`)} ${e instanceof Error?e.message:String(e)}`)})}function Q(e,t){let n=t.ServerLockCollisionError;return n!==void 0&&e instanceof n}function $(e,t,n){let r=n.ServerLockCollisionError;if(r===void 0||!(e instanceof r))return null;try{let e=p(t,`.ok`),r=n.readServerLock(e);return r?r.kind===`interactive`?`OpenKnowledge 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`.":"OpenKnowledge server is already running on this project — check `ok status` or `ok stop`.":"OpenKnowledge server is already running on this project — check `ok status` or `ok stop`."}catch{return null}}function ne(e){return new o(`start`).description(`Start the knowledge base collab server`).option(`-p, --port <port>`,`Server port`,void 0).option(`--ui-port <port>`,`Pin the ok ui sibling to <port> and connect (not exit) if a server already runs here — the worktree-preview recipe path`,te).option(`-H, --host <host>`,`Server host`,void 0).option(`--open`,`Open browser after start`).option(`--mode <mode>`,`Force dispatch mode: 'browser' or 'app'`,ee).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)`).option(`--single-file <path>`,`No-project ephemeral single-file mode: scope the server to one markdown file (git + MCP off)`).option(`--project-dir <dir>`,`Throwaway project root for --single-file (where ephemeral .ok/ state lives)`).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.uiPort!==void 0&&e.push(`--ui-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=D(w());if(n.available){O({spawn:u});return}console.error(k(n.reason)),process.exit(1)}await Z(n,t)})}export{D as C,w as S,ne as _,V as a,K as b,F as c,z as d,P as f,R as g,B as h,q as i,X as l,Z as m,U as n,H as o,Y as p,J as r,L as s,I as t,Q as u,$ as v,O as w,N as x,G as y};
|
|
3
|
+
//# sourceMappingURL=start-CMWosjhu.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e,f as t,r as n}from"./start-CMWosjhu.mjs";export{n as bootStartServer,t as resolveHost,e as startCommand};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import{It as e,S as t,an as n,wt as r}from"./server-lock-iLcBw_q0-CPFOrsBn.mjs";import{d as i,ei as a,ut as o}from"./dist-D13xYuEX.mjs";import{basename as s,dirname as c,isAbsolute as l,join as u,posix as d,relative as f,resolve as p,sep as m,win32 as h}from"node:path";import{homedir as g}from"node:os";import{cpSync as _,existsSync as v,lstatSync as y,mkdirSync as b,realpathSync as x,rmSync as S}from"node:fs";const C=t,w=r,T=e,E=`node`,D={MCP_DEBUG:`1`,OK_LOG_FILE:`/tmp/ok-mcp.log`},O=`# ok-mcp-v1`,k=`# ok-mcp-v1
|
|
2
|
+
USER_BUNDLE="$HOME/Applications/OpenKnowledge.app/Contents/Resources/cli/bin/ok.sh"
|
|
3
|
+
[ -f "$USER_BUNDLE" ] && [ -x "$USER_BUNDLE" ] && exec "$USER_BUNDLE" mcp
|
|
4
|
+
BUNDLE="/Applications/OpenKnowledge.app/Contents/Resources/cli/bin/ok.sh"
|
|
5
|
+
[ -f "$BUNDLE" ] && [ -x "$BUNDLE" ] && exec "$BUNDLE" mcp
|
|
6
|
+
command -v npx >/dev/null 2>&1 && exec npx -y @inkeep/open-knowledge@latest mcp
|
|
7
|
+
for 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
|
|
8
|
+
[ -f "$d/npx" ] && [ -x "$d/npx" ] && exec "$d/npx" -y @inkeep/open-knowledge@latest mcp
|
|
9
|
+
done
|
|
10
|
+
echo "OpenKnowledge: install OK Desktop or Node.js 24+, then restart your editor" >&2
|
|
11
|
+
exit 127`,A=`# ok-mcp-win-v1`,j=`# ok-mcp-win-v1
|
|
12
|
+
if ($env:PATHEXT -notmatch 'CMD') { $env:PATHEXT = '.COM;.EXE;.BAT;.CMD;' + $env:PATHEXT }
|
|
13
|
+
if ($env:APPDATA) {
|
|
14
|
+
$shim = Join-Path $env:APPDATA 'npm\\ok.cmd'
|
|
15
|
+
if (Test-Path -LiteralPath $shim -PathType Leaf) { & $shim mcp; exit $LASTEXITCODE }
|
|
16
|
+
}
|
|
17
|
+
$ok = Get-Command ok.cmd -CommandType Application -ErrorAction SilentlyContinue
|
|
18
|
+
if ($ok) { & $ok.Source mcp; exit $LASTEXITCODE }
|
|
19
|
+
$npx = Get-Command npx.cmd -CommandType Application -ErrorAction SilentlyContinue
|
|
20
|
+
if ($npx) { & $npx.Source -y '@inkeep/open-knowledge@latest' mcp; exit $LASTEXITCODE }
|
|
21
|
+
$dirs = @()
|
|
22
|
+
if ($env:ProgramFiles) { $dirs += Join-Path $env:ProgramFiles 'nodejs' }
|
|
23
|
+
if ($env:NVM_SYMLINK) { $dirs += $env:NVM_SYMLINK }
|
|
24
|
+
if ($env:LOCALAPPDATA) {
|
|
25
|
+
$dirs += Join-Path $env:LOCALAPPDATA 'fnm\\aliases\\default'
|
|
26
|
+
$dirs += Join-Path $env:LOCALAPPDATA 'Volta\\bin'
|
|
27
|
+
$dirs += Join-Path $env:LOCALAPPDATA 'pnpm'
|
|
28
|
+
}
|
|
29
|
+
if ($env:USERPROFILE) { $dirs += Join-Path $env:USERPROFILE 'scoop\\shims' }
|
|
30
|
+
foreach ($d in $dirs) {
|
|
31
|
+
$probe = Join-Path $d 'npx.cmd'
|
|
32
|
+
if (Test-Path -LiteralPath $probe -PathType Leaf) { & $probe -y '@inkeep/open-knowledge@latest' mcp; exit $LASTEXITCODE }
|
|
33
|
+
}
|
|
34
|
+
[Console]::Error.WriteLine('OpenKnowledge: install Node.js 24+ (npm i -g @inkeep/open-knowledge), then restart your editor')
|
|
35
|
+
exit 127`;function M(e){if(typeof e!=`object`||!e)return!1;let t=e;if(t.command===`/bin/sh`){if(!Array.isArray(t.args)||t.args[0]!==`-l`||t.args[1]!==`-c`)return!1;let e=t.args[2];return typeof e==`string`&&e.includes(`# ok-mcp-v1`)}if(t.command===`powershell`){if(!Array.isArray(t.args)||t.args[0]!==`-NoProfile`||t.args[1]!==`-NonInteractive`||t.args[2]!==`-Command`)return!1;let e=t.args[3];return typeof e==`string`&&e.includes(`# ok-mcp-win-v1`)}if(t.type===`local`&&Array.isArray(t.command)){if(t.command[0]===`/bin/sh`){if(t.command[1]!==`-l`||t.command[2]!==`-c`)return!1;let e=t.command[3];return typeof e==`string`&&e.includes(`# ok-mcp-v1`)}if(t.command[0]===`powershell`){if(t.command[1]!==`-NoProfile`||t.command[2]!==`-NonInteractive`||t.command[3]!==`-Command`)return!1;let e=t.command[4];return typeof e==`string`&&e.includes(`# ok-mcp-win-v1`)}return!1}return!1}function N(e=process.argv[1]){if(!e)throw Error(`Cannot infer the local CLI entry for --dev-mcp because process.argv[1] is empty.`);let t=p(e);if(s(t)===`cli.mjs`&&s(c(t))===`dist`)return t;let n=t.split(m),r=n.lastIndexOf(`packages`);if(r===-1||n[r+1]!==`cli`)throw Error(`Cannot infer the repo root for --dev-mcp from ${t}. Run the local CLI from this repo so the built dist path can be derived.`);let i=n.slice(0,r);return u(i.length===0?m:i.join(m),`packages`,`cli`,`dist`,`cli.mjs`)}function P(e={}){return e.mode===`dev`?{command:E,args:[N(),`mcp`],env:{...D}}:(e.platformName??process.platform)===`win32`?{command:`powershell`,args:[`-NoProfile`,`-NonInteractive`,`-Command`,j]}:{command:`/bin/sh`,args:[`-l`,`-c`,k]}}function F(e={}){return e.mode===`dev`?{type:`local`,enabled:!0,command:[E,N(),`mcp`],environment:{...D}}:(e.platformName??process.platform)===`win32`?{type:`local`,enabled:!0,command:[`powershell`,`-NoProfile`,`-NonInteractive`,`-Command`,j]}:{type:`local`,enabled:!0,command:[`/bin/sh`,`-l`,`-c`,k]}}function I(e){if(typeof e!=`object`||!e)return!1;let t=e;return L(t,P({mode:`published`,platformName:`darwin`}))||L(t,P({mode:`published`,platformName:`win32`}))}function L(e,t){if(Object.keys(e).length!==Object.keys(t).length||e.command!==t.command)return!1;let n=t.args;return!Array.isArray(n)||!Array.isArray(e.args)||e.args.length!==n.length?!1:e.args.every((e,t)=>e===n[t])}function R(e){return e===`win32`?h:d}function z(e={}){let t=e.platformName??process.platform,n=e.home??g(),r=e.env??process.env,i=R(t);return t===`darwin`?i.join(n,`Library`,`Application Support`):t===`win32`?r.APPDATA??i.join(n,`AppData`,`Roaming`):r.XDG_CONFIG_HOME??i.join(n,`.config`)}function B(e={}){let t=e.platformName??process.platform,n=e.home??g();return R(t).join(n,`.claude.json`)}function V(e={}){let t=e.platformName??process.platform,n=e.home??g(),r=e.env??process.env;if(t===`darwin`)return d.join(n,`Library`,`Application Support`,`Claude`,`claude_desktop_config.json`);if(t===`win32`){let e=r.APPDATA??h.join(n,`AppData`,`Roaming`);return h.join(e,`Claude`,`claude_desktop_config.json`)}throw Error(`Claude Desktop is not available on ${t}. Supported: macOS, Windows.`)}function H(e={}){let t=e.platformName??process.platform,n=e.home??g();return R(t).join(n,`.cursor`,`mcp.json`)}function U(e={}){let t=e.platformName??process.platform,n=e.home??g();return(e.env??process.env).CODEX_HOME??R(t).join(n,`.codex`)}function W(e={}){return R(e.platformName??process.platform).join(U(e),`config.toml`)}function G(e={}){let t=e.platformName??process.platform,n=e.home??g(),r=e.env??process.env,i=R(t);if(t===`win32`){let e=r.APPDATA??i.join(n,`AppData`,`Roaming`);return i.join(e,`opencode`)}let a=r.XDG_CONFIG_HOME??i.join(n,`.config`);return i.join(a,`opencode`)}function K(e={}){return R(e.platformName??process.platform).join(G(e),`opencode.json`)}function q(e={}){let t=e.platformName??process.platform,n=e.home??g();return R(t).join(n,`.openclaw`,`openclaw.json`)}const J={claude:{id:`claude`,label:w.claude,configPath:(e,t)=>B({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>n,buildEntry:(e,t)=>P(t),scope:`global`,detectPath:(e,t)=>u(t??g(),`.claude`),projectConfigPath:e=>u(e,`.mcp.json`),projectSkillPath:e=>u(e,`.claude`,`skills`,`open-knowledge`,`SKILL.md`)},"claude-desktop":{id:`claude-desktop`,label:w[`claude-desktop`],configPath:(e,t)=>V({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>n,buildEntry:(e,t)=>P(t),scope:`global`,detectPath:(e,t)=>c(V({home:t}))},cursor:{id:`cursor`,label:w.cursor,configPath:(e,t)=>H({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>n,buildEntry:(e,t)=>P(t),scope:`global`,detectPath:(e,t)=>c(H({home:t})),projectConfigPath:e=>u(e,`.cursor`,`mcp.json`),projectSkillPath:e=>u(e,`.cursor`,`skills`,`open-knowledge`,`SKILL.md`)},codex:{id:`codex`,label:w.codex,configPath:(e,t)=>W({home:t}),format:`toml`,topLevelKey:`mcp_servers`,serverName:()=>n,buildEntry:(e,t)=>P(t),scope:`global`,detectPath:(e,t)=>c(W({home:t})),projectConfigPath:e=>u(e,`.codex`,`config.toml`),projectSkillPath:e=>u(e,`.codex`,`skills`,`open-knowledge`,`SKILL.md`)},opencode:{id:`opencode`,label:w.opencode,configPath:(e,t)=>K({home:t}),format:`json`,topLevelKey:`mcp`,serverName:()=>n,buildEntry:(e,t)=>F(t),scope:`global`,detectPath:(e,t)=>c(K({home:t})),projectConfigPath:e=>u(e,`opencode.json`),projectSkillPath:e=>u(e,`.opencode`,`skills`,`open-knowledge`,`SKILL.md`)},openclaw:{id:`openclaw`,label:w.openclaw,configPath:(e,t)=>q({home:t}),format:`json`,topLevelKey:`mcp`,serverMapSubKey:`servers`,serverName:()=>n,buildEntry:(e,t)=>P(t),scope:`global`,detectPath:(e,t)=>u(t??g(),`.openclaw`),offerOnlyWhenDetected:!0}};function Y(e){let t=e.filter(e=>!Object.hasOwn(J,e));if(t.length>0)throw Error(`Unknown editor(s): ${t.join(`, `)}. Valid options: ${C.join(`, `)}`);return e.map(e=>J[e])}function X(e){let t=[];for(let n of o){let r=i[n];t.push({path:u(e,`.agents`,`skills`,r),bundleId:n,scope:`central`});for(let i of T)t.push({path:u(e,i.hostDir,`skills`,r),bundleId:n,scope:`host`,hostDir:i.hostDir})}return t}function Z(e,t){let n=[];for(let r of X(e))if(r.bundleId===t)try{S(r.path,{recursive:!0,force:!0})}catch(e){n.push(e instanceof Error?e:Error(String(e)))}if(n.length>0)throw AggregateError(n,`Failed to remove ${n.length} path(s) for ${t}`)}function Q(e,t){let n;try{n=x(t)}catch{n=p(t)}let r;try{r=y(e)}catch(e){if(e.code!==`ENOENT`)throw e}if(r?.isSymbolicLink())throw Error(`Refusing to write through a symbolic link at ${e}. Remove the symlink and re-run project setup.`);let i=c(e);for(;i.length>1&&i!==m;){let t;try{t=x(i)}catch(e){if(e.code===`ENOENT`){i=c(i);continue}throw e}let r=f(n,t);if(r===``||!r.startsWith(`..`)&&!l(r))return;throw Error(`Refusing to write at ${e}: ancestor ${i} resolves to ${t}, which is outside the project directory ${n}. A symbolic link in the path likely escapes the project. Remove the symlink and re-run project setup.`)}}function $(e,t){let n=e.projectSkillPath?.(t);if(!n)return{editorId:e.id,label:e.label,action:`skipped-unsupported`,path:``};try{let r=a(`project`,{checkDesktop:!0}),i=c(n);Q(i,t);let o=v(n)?`overwritten`:`written`;return S(i,{recursive:!0,force:!0}),b(c(i),{recursive:!0}),_(r,i,{recursive:!0}),{editorId:e.id,label:e.label,action:o,path:n}}catch(t){return{editorId:e.id,label:e.label,action:`failed`,path:n,error:t instanceof Error?t.message:String(t)}}}export{C as a,w as c,P as d,M as f,Y as g,N as h,X as i,J as l,z as m,$ as n,O as o,I as p,Z as r,A as s,Q as t,T as u};
|
|
36
|
+
//# sourceMappingURL=write-project-skill-4cQ_oGJO.mjs.map
|
package/package.json
CHANGED
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
+
/**
|
|
3
|
+
* Aggregate tolerance-class fire-rate data from the JSONL telemetry log
|
|
4
|
+
* produced by OK_BRIDGE_TOLERANCE_TELEMETRY=1.
|
|
5
|
+
*
|
|
6
|
+
* Usage:
|
|
7
|
+
* bun run packages/cli/scripts/aggregate-tolerance-class-fires.ts <path-to-tolerance-telemetry.jsonl>
|
|
8
|
+
*
|
|
9
|
+
* Output: JSON to stdout with per-class, per-document, and per-severity breakdowns.
|
|
10
|
+
*/
|
|
2
11
|
|
|
3
12
|
import { readFileSync } from 'node:fs';
|
|
4
13
|
|
|
5
14
|
import type { ToleranceFireLine } from '@inkeep/open-knowledge-server';
|
|
6
15
|
|
|
16
|
+
// The line shape is owned by the writer (tolerance-telemetry-writer.ts) and
|
|
17
|
+
// imported here so a producer-side field rename fails this script's
|
|
18
|
+
// typecheck instead of silently desyncing the aggregation.
|
|
7
19
|
type FireRecord = ToleranceFireLine;
|
|
8
20
|
|
|
9
21
|
interface ClassStats {
|
|
@@ -35,6 +47,9 @@ function main(): void {
|
|
|
35
47
|
records.push(parsed);
|
|
36
48
|
}
|
|
37
49
|
} catch {
|
|
50
|
+
// Torn/truncated lines are expected after sink rotation
|
|
51
|
+
// (RotatingAppender ring); count rather than silently drop so a
|
|
52
|
+
// corrupt log can't under-report totals without a signal.
|
|
38
53
|
skipped += 1;
|
|
39
54
|
}
|
|
40
55
|
}
|
|
@@ -1,4 +1,49 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
+
/**
|
|
3
|
+
* Emit per-scope JSON Schemas from `ConfigSchema` for IDE intellisense.
|
|
4
|
+
*
|
|
5
|
+
* Schema versioning is **independent** of the npm package version. The
|
|
6
|
+
* artifact directory is `dist/schemas/v<CONFIG_SCHEMA_MAJOR>/…`; the magic
|
|
7
|
+
* comment URL pins to `@latest` of the package + the schema-major path. As
|
|
8
|
+
* a result, additive changes (new optional fields, new enum values) reach
|
|
9
|
+
* existing users automatically — their YAML's `$schema=…/v0/…` URL stays
|
|
10
|
+
* valid, and unpkg's `@latest` redirect surfaces the newest schema. A
|
|
11
|
+
* schema-major bump (v0 → v1) is reserved for breaking changes and emits
|
|
12
|
+
* to a new directory; the old directory keeps shipping for legacy YAMLs.
|
|
13
|
+
*
|
|
14
|
+
* Files emitted (per major):
|
|
15
|
+
* - `dist/schemas/v<N>/config.project.schema.json` — project-valid
|
|
16
|
+
* fields (scope: 'project' or 'either')
|
|
17
|
+
* - `dist/schemas/v<N>/config.user.schema.json` — user-valid fields
|
|
18
|
+
* (scope: 'user' or 'either')
|
|
19
|
+
* - `dist/schemas/v<N>/config.project-local.schema.json` — project-local
|
|
20
|
+
* fields (scope: 'project-local' or 'either'); IDE autocomplete inside
|
|
21
|
+
* `<projectDir>/.ok/local/config.yml` only surfaces these.
|
|
22
|
+
*
|
|
23
|
+
* Also emitted at the dist root (back-compat aliases for pre-versioning
|
|
24
|
+
* magic comments still in the wild):
|
|
25
|
+
* - `dist/config-schema.json` — full schema, every field
|
|
26
|
+
* - `dist/config.project.schema.json` — same as v<current>/project
|
|
27
|
+
* - `dist/config.user.schema.json` — same as v<current>/user
|
|
28
|
+
* - `dist/config.project-local.schema.json` — same as v<current>/project-local
|
|
29
|
+
*
|
|
30
|
+
* `ok init`'s scaffolded project `config.yml` magic-comment points at the
|
|
31
|
+
* versioned project schema; `writeConfigPatch`'s lazy first-write of
|
|
32
|
+
* `~/.ok/global.yml` points at the versioned user schema.
|
|
33
|
+
* Each file's autocomplete then surfaces only the fields that are valid
|
|
34
|
+
* AT that scope — an `appearance.theme` typed in project YAML squiggles,
|
|
35
|
+
* a `content.dir` typed in user YAML squiggles.
|
|
36
|
+
*
|
|
37
|
+
* `io: 'input'` (not `'output'`) is load-bearing: the IDE must show the user
|
|
38
|
+
* what they TYPE (every defaulted field optional), not what the runtime
|
|
39
|
+
* resolves (every defaulted field required). The CI test in
|
|
40
|
+
* `src/config/json-schema-equivalence.test.ts` guards this contract.
|
|
41
|
+
*
|
|
42
|
+
* `metadata: fieldRegistry` flows the per-field `scope` / `agentSettable` /
|
|
43
|
+
* `defaultScope` annotations into the JSON Schema as custom keys. JSON
|
|
44
|
+
* Schema draft-07 ignores unknown keywords; the keys ride along for any
|
|
45
|
+
* future consumer that wants to introspect them.
|
|
46
|
+
*/
|
|
2
47
|
import { mkdirSync, writeFileSync } from 'node:fs';
|
|
3
48
|
import { dirname, resolve } from 'node:path';
|
|
4
49
|
import { fileURLToPath } from 'node:url';
|
|
@@ -18,6 +63,22 @@ const fullSchema = z.toJSONSchema(ConfigSchema, {
|
|
|
18
63
|
mkdirSync(distDir, { recursive: true });
|
|
19
64
|
mkdirSync(versionedDir, { recursive: true });
|
|
20
65
|
|
|
66
|
+
/**
|
|
67
|
+
* Recursively prune properties that don't apply at `targetScope`.
|
|
68
|
+
*
|
|
69
|
+
* - A leaf with no `scope` keyword → kept (nothing to filter).
|
|
70
|
+
* - A leaf with `scope: 'either'` → kept everywhere.
|
|
71
|
+
* - A leaf with `scope: 'user'` → kept only in the user schema.
|
|
72
|
+
* - A leaf with `scope: 'project'` → kept only in the project schema.
|
|
73
|
+
* - A leaf with `scope: 'project-local'` → kept only in the project-local schema.
|
|
74
|
+
* - An object with `properties` is walked; if EVERY child property is
|
|
75
|
+
* pruned, the parent object itself is pruned (no dangling empty
|
|
76
|
+
* sections in the IDE autocomplete).
|
|
77
|
+
*
|
|
78
|
+
* Defaults are preserved as-is — JSON Schema's `default` keyword lets the
|
|
79
|
+
* IDE show the runtime default when hovering, even though the field is
|
|
80
|
+
* optional in the input view.
|
|
81
|
+
*/
|
|
21
82
|
function pruneByScope(node, targetScope) {
|
|
22
83
|
if (node === null || typeof node !== 'object') return node;
|
|
23
84
|
if (Array.isArray(node)) return node.map((item) => pruneByScope(item, targetScope));
|
|
@@ -39,6 +100,8 @@ function pruneByScope(node, targetScope) {
|
|
|
39
100
|
}
|
|
40
101
|
}
|
|
41
102
|
if (kept === 0 && leafScope === undefined) {
|
|
103
|
+
// No descendants survived; drop the object itself unless it has its
|
|
104
|
+
// own `scope` registered (which we'd already have honored above).
|
|
42
105
|
return undefined;
|
|
43
106
|
}
|
|
44
107
|
out.properties = newProps;
|
|
@@ -59,10 +122,16 @@ const projectSchema = pruneByScope(fullSchema, 'project');
|
|
|
59
122
|
const userSchema = pruneByScope(fullSchema, 'user');
|
|
60
123
|
const projectLocalSchema = pruneByScope(fullSchema, 'project-local');
|
|
61
124
|
|
|
125
|
+
// Versioned (canonical) — the URLs `ok init` and `writeConfigPatch`
|
|
126
|
+
// scaffold point here. Bump CONFIG_SCHEMA_MAJOR + emit to a new dir
|
|
127
|
+
// for breaking changes; keep emitting old majors forever.
|
|
62
128
|
writeSchema(resolve(versionedDir, 'config.project.schema.json'), projectSchema);
|
|
63
129
|
writeSchema(resolve(versionedDir, 'config.user.schema.json'), userSchema);
|
|
64
130
|
writeSchema(resolve(versionedDir, 'config.project-local.schema.json'), projectLocalSchema);
|
|
65
131
|
|
|
132
|
+
// Back-compat aliases at dist root — pre-versioning magic comments
|
|
133
|
+
// point here. Removing these would break existing `~/.ok/
|
|
134
|
+
// config.yml` files that never re-pinned to a versioned URL.
|
|
66
135
|
writeSchema(resolve(distDir, 'config-schema.json'), fullSchema);
|
|
67
136
|
writeSchema(resolve(distDir, 'config.project.schema.json'), projectSchema);
|
|
68
137
|
writeSchema(resolve(distDir, 'config.user.schema.json'), userSchema);
|
package/scripts/postinstall.mjs
CHANGED
|
@@ -1,11 +1,25 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* `@inkeep/open-knowledge` postinstall hook.
|
|
4
|
+
*
|
|
5
|
+
* Fires `installUserSkill()` once per `npm install` / `bun install` / `npx`
|
|
6
|
+
* cache population. Non-fatal: any failure is swallowed so the host install
|
|
7
|
+
* never blocks.
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
2
10
|
|
|
3
11
|
async function run() {
|
|
4
12
|
let installUserSkill;
|
|
5
13
|
try {
|
|
14
|
+
// Relative import resolves inside the published npm tarball at
|
|
15
|
+
// <pkg-root>/dist/index.mjs — the tsdown-bundled entry that re-exports
|
|
16
|
+
// `installUserSkill` from @inkeep/open-knowledge-server.
|
|
6
17
|
const mod = await import('../dist/index.mjs');
|
|
7
18
|
installUserSkill = mod.installUserSkill;
|
|
8
19
|
} catch {
|
|
20
|
+
// Dev-install scenarios (e.g. running `npm install` against a tarball
|
|
21
|
+
// where dist/ is missing, `--ignore-scripts`, or source-only installs)
|
|
22
|
+
// never block — fall through to exit 0.
|
|
9
23
|
return;
|
|
10
24
|
}
|
|
11
25
|
|
|
@@ -15,6 +29,8 @@ async function run() {
|
|
|
15
29
|
try {
|
|
16
30
|
result = await installUserSkill();
|
|
17
31
|
} catch {
|
|
32
|
+
// installUserSkill is documented as never-throws; this catch is pure
|
|
33
|
+
// defensive hardening so a broken build never blocks `npm install`.
|
|
18
34
|
return;
|
|
19
35
|
}
|
|
20
36
|
|
|
@@ -26,8 +42,11 @@ async function run() {
|
|
|
26
42
|
"npx skills@~1.5.0 add <bundled-path> --agent '*' -g -y --copy\n",
|
|
27
43
|
);
|
|
28
44
|
}
|
|
45
|
+
// result === 'skip-current' → silent.
|
|
29
46
|
}
|
|
30
47
|
|
|
48
|
+
// Fire-and-forget. Always exit 0 regardless of outcome —
|
|
49
|
+
// `npm install` must never fail because skill-install hit an edge case.
|
|
31
50
|
run().finally(() => {
|
|
32
51
|
process.exit(0);
|
|
33
52
|
});
|
package/scripts/probe-exec.ts
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* End-to-end probe: buildExecResult through the full pipeline
|
|
3
|
+
* (parseCommand → just-bash → extractPaths → enrichPath → dual-channel
|
|
4
|
+
* response). Hand-runnable — not part of the test suite.
|
|
5
|
+
*
|
|
6
|
+
* Run via: `bun run packages/cli/scripts/probe-exec.ts`
|
|
7
|
+
*/
|
|
1
8
|
import { mkdirSync, rmSync, writeFileSync } from 'node:fs';
|
|
2
9
|
import { tmpdir } from 'node:os';
|
|
3
10
|
import { resolve } from 'node:path';
|
|
@@ -34,6 +41,7 @@ async function main(): Promise<void> {
|
|
|
34
41
|
'---\ntitle: SSO\ntags:\n - auth\n---\n\n# SSO\n\noauth provider...\n',
|
|
35
42
|
);
|
|
36
43
|
|
|
44
|
+
// Shadow-repo activity
|
|
37
45
|
const shadow = await initShadowRepo(root);
|
|
38
46
|
const branch = (await simpleGit(root).revparse(['--abbrev-ref', 'HEAD'])).trim();
|
|
39
47
|
const agent: WriterIdentity = { id: 'agent-claude-7x', name: 'Claude (Tim)', email: 'a@ok.test' };
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* End-to-end probe: buildReadResult flowing through the shared enrichPath
|
|
3
|
+
* → readShadowLog → shadow-repo bare git reads. Confirms agent/human
|
|
4
|
+
* attribution lands in the rendered output.
|
|
5
|
+
*
|
|
6
|
+
* Run via: `bun run packages/cli/scripts/probe-read-document.ts`
|
|
7
|
+
* Not part of the test suite — a hand-runnable probe.
|
|
8
|
+
*/
|
|
1
9
|
import { mkdirSync, rmSync, writeFileSync } from 'node:fs';
|
|
2
10
|
import { tmpdir } from 'node:os';
|
|
3
11
|
import { resolve } from 'node:path';
|
|
@@ -15,6 +23,7 @@ const root = resolve(tmpdir(), `ok-probe-${Date.now()}`);
|
|
|
15
23
|
mkdirSync(root, { recursive: true });
|
|
16
24
|
|
|
17
25
|
async function main(): Promise<void> {
|
|
26
|
+
// 1. Set up a real git-backed project
|
|
18
27
|
const git = simpleGit(root);
|
|
19
28
|
await git.init();
|
|
20
29
|
await git.raw('config', 'user.name', 'Probe');
|
|
@@ -41,6 +50,7 @@ OAuth is a protocol that...
|
|
|
41
50
|
`,
|
|
42
51
|
);
|
|
43
52
|
|
|
53
|
+
// 2. Initialize the shadow repo and record some activity
|
|
44
54
|
const shadow = await initShadowRepo(root);
|
|
45
55
|
const branch = (await simpleGit(root).revparse(['--abbrev-ref', 'HEAD'])).trim();
|
|
46
56
|
|
|
@@ -63,10 +73,12 @@ OAuth is a protocol that...
|
|
|
63
73
|
writeFileSync(resolve(contentDir, 'auth.md'), '# Auth v3\n\nFixed typo.\n');
|
|
64
74
|
await commitWip(shadow, human, contentDir, 'typo fix', branch);
|
|
65
75
|
await wait(1100);
|
|
76
|
+
// And a fake "upstream" git pull import
|
|
66
77
|
const oldHead = 'a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0';
|
|
67
78
|
const newHead = 'f0e1d2c3b4a5f6e7d8c9b0a1f2e3d4c5b6a7f8e9';
|
|
68
79
|
await commitUpstreamImport(shadow, contentDir, oldHead, newHead, branch);
|
|
69
80
|
|
|
81
|
+
// 3. Call buildReadResult — the actual MCP-tool body, end to end
|
|
70
82
|
const output = await buildReadResult(
|
|
71
83
|
{ path: 'content/auth.md' },
|
|
72
84
|
{
|
package/dist/dist-DUXDeyBp.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Fi as e,J as t,Oi as n,Vt as r,a as i,c as a,d as o,dn as s,f as c,g as l,h as u,i as d,ii as f,kn as p,l as m,m as h,n as g,o as _,on as v,p as y,r as b,s as x,t as S,tn as C,u as w,wn as T}from"./server-lock-CN2YHwpP-BYuwTc93.mjs";import{$ as E,$i as D,$n as O,$r as k,$t as A,A as j,Ai as M,An as N,Ar as P,At as F,B as I,Bi as L,Bn as R,Br as z,Bt as B,C as V,Ci as H,Cn as U,Cr as W,Ct as G,D as K,Di as q,Dn as J,Dr as Y,Dt as X,E as Z,Ei as Q,En as $,Er as ee,Et as te,F as ne,Fi as re,Fn as ie,Fr as ae,Ft as oe,G as se,Gi as ce,Gn as le,Gr as ue,Gt as de,H as fe,Hi as pe,Hn as me,Hr as he,Ht as ge,I as _e,Ii as ve,In as ye,Ir as be,It as xe,J as Se,Ji as Ce,Jn as we,Jr as Te,Jt as Ee,K as De,Ki as Oe,Kn as ke,Kr as Ae,Kt as je,L as Me,Li as Ne,Ln as Pe,Lr as Fe,Lt as Ie,M as Le,Mi as Re,Mn as ze,Mr as Be,Mt as Ve,N as He,Ni as Ue,Nn as We,Nr as Ge,Nt as Ke,O as qe,Oi as Je,On as Ye,Or as Xe,Ot as Ze,P as Qe,Pi as $e,Pn as et,Pr as tt,Pt as nt,Q as rt,Qi as it,Qn as at,Qr as ot,Qt as st,R as ct,Ri as lt,Rn as ut,Rr as dt,Rt as ft,S as pt,Si as mt,Sn as ht,Sr as gt,St as _t,T as vt,Ti as yt,Tn as bt,Tr as xt,Tt as St,U as Ct,Ui as wt,Un as Tt,Ur as Et,Ut as Dt,V as Ot,Vi as kt,Vn as At,Vr as jt,Vt as Mt,W as Nt,Wi as Pt,Wn as Ft,Wr as It,Wt as Lt,X as Rt,Xi as zt,Xn as Bt,Xr as Vt,Xt as Ht,Y as Ut,Yi as Wt,Yn as Gt,Yr as Kt,Yt as qt,Z as Jt,Zi as Yt,Zn as Xt,Zr as Zt,Zt as Qt,_ as $t,_a as en,_i as tn,_n as nn,_r as rn,_t as an,a as on,aa as sn,ai as cn,an as ln,ar as un,at as dn,b as fn,bi as pn,bn as mn,br as hn,bt as gn,c as _n,ci as vn,cn as yn,cr as bn,ct as xn,d as Sn,di as Cn,dn as wn,dr as Tn,dt as En,ea as Dn,ei as On,en as kn,er as An,et as jn,f as Mn,fi as Nn,fn as Pn,fr as Fn,ft as In,g as Ln,gi as Rn,gn as zn,gr as Bn,gt as Vn,h as Hn,hi as Un,hn as Wn,hr as Gn,ht as Kn,i as qn,ia as Jn,ii as Yn,in as Xn,ir as Zn,it as Qn,j as $n,ji as er,jn as tr,jr as nr,jt as rr,k as ir,ki as ar,kn as or,kr as sr,kt as cr,l as lr,li as ur,ln as dr,lr as fr,lt as pr,m as mr,mi as hr,mn as gr,mr as _r,mt as vr,n as yr,na as br,ni as xr,nn as Sr,nr as Cr,nt as wr,o as Tr,oi as Er,on as Dr,or as Or,ot as kr,p as Ar,pi as jr,pn as Mr,pr as Nr,pt as Pr,q as Fr,qi as Ir,qn as Lr,qr as Rr,qt as zr,r as Br,ra as Vr,ri as Hr,rn as Ur,rr as Wr,rt as Gr,s as Kr,si as qr,sn as Jr,sr as Yr,st as Xr,t as Zr,ta as Qr,ti as $r,tn as ei,tr as ti,tt as ni,u as ri,ui as ii,un as ai,ur as oi,ut as si,v as ci,va as li,vi as ui,vn as di,vr as fi,vt as pi,w as mi,wi as hi,wn as gi,wr as _i,wt as vi,x as yi,xi as bi,xn as xi,xr as Si,xt as Ci,y as wi,yi as Ti,yn as Ei,yr as Di,yt as Oi,z as ki,zi as Ai,zn as ji,zr as Mi,zt as Ni}from"./dist-Bj79e9B6.mjs";export{Zr as AGENT_ID_MAX_LEN,yr as AGENT_ID_RE,Br as AGENT_WRITE_ORIGIN,qn as AgentFocusBroadcaster,on as AgentPresenceBroadcaster,Tr as AgentSessionCapacityError,Kr as AgentSessionManager,_n as AutoStartDisabledError,lr as BUNDLE_IDS,ri as BUNDLE_SCOPE,Sn as BUNDLE_SKILL_NAME,Mn as BacklinkIndex,Ar as CC1Broadcaster,t as CC1_CONTRACT_VERSION,mr as CONFIG_FILENAME,Hn as CONFLICT_MARKER_RE,Ln as CURSOR_BUNDLE_PATHS_BY_PLATFORM,$t as ConfigSchema,ci as DEFAULT_CHECKPOINT_RETENTION,wi as DEFAULT_EMBEDDINGS_DIMENSIONS,fn as DEFAULT_PACK_ID,yi as EMBEDDINGS_API_KEY_ENV,pt as FILE_SYSTEM_WRITER,V as FILE_WATCHER_ORIGIN,mi as FileEmbeddingsBackend,vt as GIT_PREFLIGHT_FAIL_SPAN_NAME,Z as GIT_UPSTREAM_WRITER,en as GitDirAccessError,K as GitNotAvailableError,qe as GitTooOldError,ir as HOCUSPOCUS_AUTH_REJECTION_REASONS,j as HocuspocusAuthRejection,$n as HocuspocusAuthTokenSchema,Le as INSTALLED_AGENTS_SCHEMES,r as LINEAGE_EPOCH_KEY,He as LIVE_DERIVED_INDEX_DEBOUNCE_MS,Qe as LOG_MD_TEMPLATE,ne as MANAGED_RENAME_ORIGIN,_e as MAX_AGENT_SESSIONS,Me as MCP_CONNECTION_ID_HEADER,C as MCP_SERVER_NAME,ct as MIN_GIT_VERSION,ki as MISSING_OK_CONFIG_MESSAGE,li as MalformedGitPointerError,I as McpLogger,Ot as MissingOkConfigError,fe as OBSERVER_SYNC_ORIGIN,Ct as OK_OKIGNORE_TEMPLATE,v as ORPHAN_MODES,Nt as PANE_TARGET_TTL_MS,s as PROTOCOL_VERSION,se as PinoLogger,S as ProcessLockCollisionError,De as ProjectGitInitError,Fr as ROLLBACK_ORIGIN,Se as ROOT_GITIGNORE_TEMPLATE,g as RUNTIME_VERSION,Ut as SERVICE_WRITER,Rt as SKILL_INSTALL_EVENTS_FILE_REL,T as SKILL_STATE_TARGETS,Jt as STARTER_FOLDERS,rt as STARTER_FOLDER_FRONTMATTER_FILENAME,E as STARTER_PACKS,jn as STARTER_PACK_IDS,ni as STARTER_TEMPLATES,wr as STATE_MANIFEST_FILENAME,b as STATE_SCHEMA_VERSION,p as SYSTEM_DOC_NAME,Gr as SeedPrerequisiteError,Qn as SeedRootDirError,d as ServerLockCollisionError,dn as SingleFileNotAFileError,kr as SingleFileNotFoundError,Xr as SingleFileNotMarkdownError,xn as StateManifestError,pr as TagIndex,si as USER_GLOBAL_BUNDLE_IDS,En as UiLockCollisionError,In as __getShowAllWalkStatsForTesting,Pr as __resetShowAllWalkStatsForTesting,i as acquireProcessLock,_ as acquireServerLock,vr as acquireUiLock,Kn as applyAgentMarkdownWrite,Vn as applyExternalChange,an as applySeed,pi as armPaneTarget,Oi as assertCompatibleStateManifest,gn as assertGitAvailable,Ci as assertNeverDiskEvent,_t as attachIdleShutdown,G as bootServer,vi as buildAndOpenSkill,St as buildConfigYmlContent,te as buildExecResult,X as buildSkillZip,Ze as buildStarterFolderFrontmatterYaml,cr as buildWipTree,F as bundleSkillMdPath,rr as classifyEvents,Ve as classifyFsPath,Ke as clearArmedPaneTarget,nt as clearContributors,oe as clearEmbeddingsKeyFromAllBackends,xe as coercePackId,f as colorFromSeed,Ie as commitUpstreamImport,ft as commitWip,Ni as commitWipFromTree,B as compareSemver,Mt as containsConflictMarkers,ge as contentHash,Dt as contributorCount,Lt as countShadowObjects,de as countStaleAgentWipRefs,je as countWipRefs,zr as createApiExtension,Ee as createAssetServeMiddleware,qt as createContentFilter,Ht as createContentFilterAsync,Qt as createEmbeddingsSecretStore,st as createEphemeralProjectDir,A as createExternalChangeHandler,kn as createFileLogger,ei as createLiveDerivedIndexExtension,Sr as createMcpHttpHandler,Ur as createOsProbe,Xn as createPersistenceExtension,ln as createServer,Dr as createServerObserverExtension,Jr as createStreamingErrorWriter,yn as createTestLogger,dr as describeStoredEmbeddingsKey,ai as detectClaudeDesktopPresence,wn as detectGit,Pn as detectProjectShape,Mr as discoverLockDirs,gr as emitPreflightFailureSpan,Wn as encodeDocName,zn as encodeFolderRoute,nn as encodeSkillRoute,di as ensureProjectGit,Ei as errorResponse,mn as evictStaleTrackerEntries,xi as extractOkBinaryPath,ht as extractWikiLinksFromMarkdown,U as fallbackPaths,gi as findEnclosingGitRoot,bt as findEnclosingProjectRoot,$ as flushFileLogger,J as formatAuthRejectionWire,Ye as formatContributors,or as formatContributorsFrom,N as formatPackRationale,tr as gcCheckpointRefs,ze as getCurrentMcpLogger,We as getLocalDir,et as getLogFilePath,ie as getLogger,ye as getLogsDir,Pe as getMeter,ut as getMetrics,ji as getTracer,R as handleCollabSocketError,At as handleSpawnCursor,me as hasGcLogLatch,n as iconFromClientName,Tt as incrementCollabSocketFilteredError,Ft as incrementServerObserverFire,le as initContent,ke as initShadowRepo,Lr as initTelemetry,we as initToleranceTelemetryWriter,Gt as installPrettyZodErrors,Bt as installTestLoggers,Xt as installUserSkill,at as isAllowedApiOrigin,O as isAllowedWorkspaceHostHeader,An as isConfigDoc,ti as isHocuspocusAuthRejectionReason,Cr as isKnownPackId,Wr as isLinkIndexExcludedDoc,Zn as isLoopbackAddress,un as isManagedArtifactDoc,e as isOrphanMode,Or as isPairedWriteOrigin,Yr as isPathWithinDir,x as isProcessAlive,bn as isProjectRoot,fr as isProjectSkillManaged,oi as isReservedForUserTree,Tn as isSelfWrite,Fn as isSystemDoc,Nr as isToleranceTelemetryEnabled,a as isValidLockPid,_r as lastKnownHash,Gn as listRescueCheckpoints,Bn as listStarterPacks,rn as loadPrincipal,m as lockFilePath,fi as loggerFactory,Di as logsCurrentPath,hn as logsPreviousPath,Si as makeLazyEmbeddingsKeyStore,gt as mountMcpAndApi,W as normalizeFsPath,_i as packageVersionMajorMinor,xt as parseAuthRejectionWire,ee as parseGitVersion,Y as parseHocuspocusAuthToken,Xe as parseKeepaliveConnectionId,sr as pathToDocName,P as planSeed,nr as prepareSingleFileOpen,Be as processCommand,Ge as processUsage,tt as readAllTargets,ae as readArmedPaneTarget,be as readBranchFromHead,w as readProcessLock,o as readProcessLockDetailed,Fe as readProjectLocalSemanticConfig,c as readServerLock,dt as readServerPackageVersion,Mi as readSkillInstallStateSnapshot,z as readSkillManagement,jt as readStateManifest,he as readTargetRecordedAt,Et as readTargetVersion,It as readUiLock,ue as reconcile,Ae as recordContributor,Rr as recordSkillInstallEvent,Te as registerAllTools,Kt as registerWrite,y as releaseProcessLock,h as releaseServerLock,Vt as releaseUiLock,Zt as removeLastKnownHash,ot as resetMetrics,k as resolveBundledSkillDir,On as resolveContentDir,$r as resolveCursorBinaryDefault,xr as resolveCursorSpawnInvocation,Hr as resolveLockDir,Yn as resolvePack,cn as resolvePackageVersion,Er as resolveUiInfo,qr as restoreContributors,vn as restoreLifecycleFromConflictsJson,ur as rewriteMarkdownLinksForDocumentRename,ii as rewriteWikiLinksForDocumentRename,Cn as runAuthReposSubprocess,Nn as runAuthStatusSubprocess,jr as runCloneSubprocess,hr as runDeviceFlowSubprocess,Un as runWithMcpLogger,Rn as safeContentPath,tn as safeSubdir,ui as safetyCheckpoint,Ti as sanitizeClientName,pn as saveInMemoryCheckpoint,bi as saveVersion,mt as seedBasenameIndex,H as serializeError,hi as setActiveSpanAttributes,yt as shadowGit,Q as shutdownTelemetry,q as skillManagementPath,Je as spansCurrentPath,ar as spansPreviousPath,M as spawnDetached,er as splitMarkdownBlocks,Re as startWatcher,Ue as streamingProblemEvent,$e as swapContributors,re as teardownToleranceTelemetryWriter,ve as toBroadcasterKey,Ne as tracedAppendFileSync,lt as tracedLinkSync,Ai as tracedMkdir,L as tracedMkdirSync,kt as tracedRename,pe as tracedRenameSync,wt as tracedRmSync,Pt as tracedRmdirSync,ce as tracedUnlinkSync,Oe as tracedWriteFile,Ir as tracedWriteFileSync,Ce as updateLastKnownHash,u as updateProcessLockPort,l as updateServerLockPort,Wt as updateUiLockPort,zt as validateAgentId,Yt as validateCloneInputs,it as validateSkillZip,D as withSpan,Dn as withSpanSync,Qr as writeRootGitignoreForNewRepo,br as writeSkillManagement,Vr as writeStateManifest,Jn as writeTargetVersion,sn as writeTracker};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./git-handle-DY9lXoT3-CfssnuIB.mjs";export{e as createGitInstance};
|