@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.
Files changed (312) hide show
  1. package/dist/assets/skills/discovery/SKILL.md +1 -1
  2. package/dist/assets/skills/project/SKILL.md +1 -1
  3. package/dist/assets/skills/write-skill/SKILL.md +1 -1
  4. package/dist/cli.mjs +65 -65
  5. package/dist/constants-CgXx1dPb.mjs +2 -0
  6. package/dist/{dist-Bj79e9B6.mjs → dist-D13xYuEX.mjs} +47 -51
  7. package/dist/dist-D9WKY736.mjs +1 -0
  8. package/dist/{gh-detect-Ck0zE5NU.mjs → gh-detect-BcBj3YlE.mjs} +2 -2
  9. package/dist/{git-handle-DY9lXoT3-CfssnuIB.mjs → git-handle-Bhgrj9qX-DBwQr-02.mjs} +2 -2
  10. package/dist/git-handle-DjEtQkHv-DQXg1XhZ.mjs +1 -0
  11. package/dist/index.d.mts +758 -1
  12. package/dist/index.mjs +1 -1
  13. package/dist/init-BOHFI-M4.mjs +321 -0
  14. package/dist/init-CWlEXg63.mjs +1 -0
  15. package/dist/loader-BZIOGAPP.mjs +1 -0
  16. package/dist/{loader-1IrHrVRY.mjs → loader-ea54dQyy.mjs} +3 -3
  17. package/dist/{preview-qP8Vfz3W.mjs → preview-CLxs2bk2.mjs} +2 -2
  18. package/dist/preview-YrlSomd6.mjs +1 -0
  19. package/dist/public/assets/ActivityModeContent-mJH5LtOR.js +2 -0
  20. package/dist/public/assets/ConsentDialogBody-Bza0TMPd.js +2 -0
  21. package/dist/public/assets/DocumentContext-WluK-pvu.js +32 -0
  22. package/dist/public/assets/EnableSyncConfirmDialog-BWfcC03w.js +1 -0
  23. package/dist/public/assets/{GraphPanel-DiyMfzQg.js → GraphPanel-Cf9lwwnw.js} +3 -3
  24. package/dist/public/assets/ManagedArtifactProperties-BoAxNvK5.js +1 -0
  25. package/dist/public/assets/McpConsentDialogBody-DXwlUNR4.js +1 -0
  26. package/dist/public/assets/PropertyPanel-Bbn9RXvr.js +2 -0
  27. package/dist/public/assets/SettingsDialogBody-BVNxduDH.js +7 -0
  28. package/dist/public/assets/ShareBranchSwitchDialog-Bo95Aacz.js +1 -0
  29. package/dist/public/assets/ShareReceiveDialog-jEI9GD0l.js +1 -0
  30. package/dist/public/assets/ShareReceiveMissDialog-8HKZBtux.js +1 -0
  31. package/dist/public/assets/{SkillEditorActions-BsGotb40.js → SkillEditorActions-85awfZeZ.js} +1 -1
  32. package/dist/public/assets/SourceEditor-D0oQT5qb.js +2 -0
  33. package/dist/public/assets/{TerminalPanel-XlICQw5o.js → TerminalPanel-BNR82pgE.js} +2 -2
  34. package/dist/public/assets/{_baseFor-D25oCqSU.js → _baseFor-D774tcxR.js} +1 -1
  35. package/dist/public/assets/{agent-presence-BRmBPq78.js → agent-presence-C79Orlhd.js} +1 -1
  36. package/dist/public/assets/{arc-DHpQGPKi.js → arc-CbtK-u7K.js} +1 -1
  37. package/dist/public/assets/architecture-YZFGNWBL-BuVsq_Vy.js +1 -0
  38. package/dist/public/assets/{architectureDiagram-Q4EWVU46-Dl6zKdMi.js → architectureDiagram-Q4EWVU46-BEI0DR2f.js} +1 -1
  39. package/dist/public/assets/arrow-up-right-DoN2FmSd.js +1 -0
  40. package/dist/public/assets/auth-state-cache-CaiWuhtJ.js +11 -0
  41. package/dist/public/assets/{blockDiagram-DXYQGD6D-TTNbipzm.js → blockDiagram-DXYQGD6D-CvhaR3v1.js} +1 -1
  42. package/dist/public/assets/button-cneJOVxD.js +1 -0
  43. package/dist/public/assets/{c4Diagram-AHTNJAMY-DJ6_yNro.js → c4Diagram-AHTNJAMY-CGJ_dXh7.js} +1 -1
  44. package/dist/public/assets/{calendar-BefXYqrv.js → calendar-D62otKE3.js} +1 -1
  45. package/dist/public/assets/channel-DQ8biAJJ.js +1 -0
  46. package/dist/public/assets/check-Dqb-7gfx.js +1 -0
  47. package/dist/public/assets/checkbox-P04sbGVQ.js +1 -0
  48. package/dist/public/assets/chevron-down-D3nis7uo.js +1 -0
  49. package/dist/public/assets/chevron-left-C6Q_NKVx.js +1 -0
  50. package/dist/public/assets/chevron-right-BfmqRYl8.js +1 -0
  51. package/dist/public/assets/{chunk-2KRD3SAO-tPsWTtQ8.js → chunk-2KRD3SAO-CTZc4q6X.js} +1 -1
  52. package/dist/public/assets/{chunk-336JU56O-BDNF8ABQ.js → chunk-336JU56O-Df_WdTwV.js} +2 -2
  53. package/dist/public/assets/chunk-426QAEUC-Bmtezokd.js +1 -0
  54. package/dist/public/assets/{chunk-4BX2VUAB-B11p4CCh.js → chunk-4BX2VUAB-DdaeBv7j.js} +1 -1
  55. package/dist/public/assets/{chunk-4TB4RGXK-k8il4Vah.js → chunk-4TB4RGXK-Z_KF79WQ.js} +1 -1
  56. package/dist/public/assets/chunk-55IACEB6-BMw0jGoU.js +1 -0
  57. package/dist/public/assets/{chunk-5FUZZQ4R-BhDATrAC.js → chunk-5FUZZQ4R-BP1tPdP4.js} +1 -1
  58. package/dist/public/assets/{chunk-5PVQY5BW-7GSXpGpA.js → chunk-5PVQY5BW-DHmdYl18.js} +1 -1
  59. package/dist/public/assets/{chunk-67CJDMHE-DhsO5dA4.js → chunk-67CJDMHE-Dr8TgESK.js} +1 -1
  60. package/dist/public/assets/{chunk-7N4EOEYR-_OPnqGDq.js → chunk-7N4EOEYR-wyEzdjqa.js} +1 -1
  61. package/dist/public/assets/{chunk-AA7GKIK3-CmQNMaMq.js → chunk-AA7GKIK3-DwcoEi3L.js} +1 -1
  62. package/dist/public/assets/{chunk-BSJP7CBP-DRn1Q8qZ.js → chunk-BSJP7CBP-Bi10nqUB.js} +1 -1
  63. package/dist/public/assets/{chunk-CIAEETIT-B6L60eSe.js → chunk-CIAEETIT-BRhaZZvf.js} +1 -1
  64. package/dist/public/assets/{chunk-EDXVE4YY-TfqLQBKW.js → chunk-EDXVE4YY-Cdm2p7eD.js} +1 -1
  65. package/dist/public/assets/{chunk-ENJZ2VHE-CqUfmxZL.js → chunk-ENJZ2VHE-CtYN5PYG.js} +1 -1
  66. package/dist/public/assets/{chunk-FMBD7UC4-_M3xiFqk.js → chunk-FMBD7UC4-yxpni0iy.js} +1 -1
  67. package/dist/public/assets/{chunk-FOC6F5B3-R--gjWDw.js → chunk-FOC6F5B3-zU_D2qL3.js} +1 -1
  68. package/dist/public/assets/{chunk-ICPOFSXX-MhneOmo1.js → chunk-ICPOFSXX-B1LaL7po.js} +2 -2
  69. package/dist/public/assets/{chunk-K5T4RW27-kfFBI7dm.js → chunk-K5T4RW27-CMA0573G.js} +1 -1
  70. package/dist/public/assets/{chunk-KGLVRYIC-MGoiNxXR.js → chunk-KGLVRYIC-4qBf2hVO.js} +1 -1
  71. package/dist/public/assets/{chunk-LIHQZDEY-3OBi6RFi.js → chunk-LIHQZDEY-DLhCQB7m.js} +1 -1
  72. package/dist/public/assets/{chunk-ORNJ4GCN-D1jJqGHz.js → chunk-ORNJ4GCN-DYvOtc7p.js} +1 -1
  73. package/dist/public/assets/{chunk-OYMX7WX6-Dn8GoIJo.js → chunk-OYMX7WX6-Cb6J6ILi.js} +1 -1
  74. package/dist/public/assets/chunk-QZHKN3VN-D9Augrqb.js +1 -0
  75. package/dist/public/assets/{chunk-U2HBQHQK-Wd4MIHD7.js → chunk-U2HBQHQK-BQEFtvNE.js} +1 -1
  76. package/dist/public/assets/{chunk-X2U36JSP-DgR3BYDC.js → chunk-X2U36JSP-B0NFvVYj.js} +1 -1
  77. package/dist/public/assets/{chunk-XPW4576I-BIhGQhfc.js → chunk-XPW4576I-CWtaxsuf.js} +1 -1
  78. package/dist/public/assets/{chunk-YZCP3GAM-DfCU0Z-P.js → chunk-YZCP3GAM-wveZpL2J.js} +1 -1
  79. package/dist/public/assets/{chunk-ZZ45TVLE-Bml1MOax.js → chunk-ZZ45TVLE-DjoyvapL.js} +1 -1
  80. package/dist/public/assets/classDiagram-6PBFFD2Q-Bh_mU7DM.js +1 -0
  81. package/dist/public/assets/classDiagram-v2-HSJHXN6E-thFVFTz4.js +1 -0
  82. package/dist/public/assets/clone-CJvW7gHo.js +1 -0
  83. package/dist/public/assets/collapsible-iVWLn36m.js +1 -0
  84. package/dist/public/assets/config-context-CVpOcWSZ.js +1 -0
  85. package/dist/public/assets/config-provider-D-gGfmXm.js +4 -0
  86. package/dist/public/assets/{cose-bilkent-S5V4N54A-CIV0yZWV.js → cose-bilkent-S5V4N54A--ojmzpj3.js} +1 -1
  87. package/dist/public/assets/{cursor-CpjEfgnv.js → cursor-CGeB2PU5.js} +1 -1
  88. package/dist/public/assets/{dagre-BUnZfAns.js → dagre-D_jVclke.js} +1 -1
  89. package/dist/public/assets/{dagre-KV5264BT-Bscv1HQo.js → dagre-KV5264BT-LC6-Nebl.js} +1 -1
  90. package/dist/public/assets/desktop-bridge-types-C22Y6m5Y.js +1 -0
  91. package/dist/public/assets/{diagram-5BDNPKRD-QBP7yg8z.js → diagram-5BDNPKRD-HYhuDT0y.js} +1 -1
  92. package/dist/public/assets/{diagram-G4DWMVQ6-CMdeZ41j.js → diagram-G4DWMVQ6-CSvJiR_m.js} +1 -1
  93. package/dist/public/assets/{diagram-MMDJMWI5-DCz0ew8n.js → diagram-MMDJMWI5-CaR4m-x5.js} +1 -1
  94. package/dist/public/assets/{diagram-TYMM5635-zN9Dx1fB.js → diagram-TYMM5635-C2IGbfjW.js} +1 -1
  95. package/dist/public/assets/dialog-BiB39Lhy.js +45 -0
  96. package/dist/public/assets/dist-0Zj_lz7j.js +11 -0
  97. package/dist/public/assets/{dist-BdwnfcKi.js → dist-BEW6C_CZ.js} +1 -1
  98. package/dist/public/assets/dist-BVOt51sU.js +1 -0
  99. package/dist/public/assets/dist-BkxMNfFN.js +528 -0
  100. package/dist/public/assets/{dist-znFZQjzE.js → dist-BuoXuHTG.js} +1 -1
  101. package/dist/public/assets/dist-C0qRhuIN.js +1 -0
  102. package/dist/public/assets/{dist-CHEQzAl9.js → dist-CPpRuwFX.js} +1 -1
  103. package/dist/public/assets/{dist-3l3ADjEo.js → dist-CgYE3gek.js} +1 -1
  104. package/dist/public/assets/{dist-Dtxdqotp.js → dist-CkLidFHS.js} +1 -1
  105. package/dist/public/assets/{dist-E5KjgWw7.js → dist-D7I9jMga.js} +1 -1
  106. package/dist/public/assets/{dist-BgLh90uo2.js → dist-D8Itza26.js} +1 -1
  107. package/dist/public/assets/dist-D9WIglau.js +1 -0
  108. package/dist/public/assets/{dist-C3ftUzLd.js → dist-DI8cI4NP.js} +1 -1
  109. package/dist/public/assets/{dist-BZEgBj4N.js → dist-DPfhM7y8.js} +1 -1
  110. package/dist/public/assets/{dist-AQSp7Qij.js → dist-DQdOYnjt.js} +1 -1
  111. package/dist/public/assets/{dist-DWaLpHcz.js → dist-DVPtn9Zx.js} +1 -1
  112. package/dist/public/assets/dist-DfThKWJX.js +1 -0
  113. package/dist/public/assets/{dist-Bqo1ZTng.js → dist-Dg5nhLZ2.js} +1 -1
  114. package/dist/public/assets/{dist-KBKQayVB.js → dist-IEs1iCqd.js} +1 -1
  115. package/dist/public/assets/doc-hash-5OIPOG-G.js +1 -0
  116. package/dist/public/assets/documents-events-D064jVvV.js +1 -0
  117. package/dist/public/assets/{erDiagram-SMLLAGMA-CFPPEjz0.js → erDiagram-SMLLAGMA-D1J1j3Yx.js} +1 -1
  118. package/dist/public/assets/file-tree-adapter-Bg8FQvOB.js +1 -0
  119. package/dist/public/assets/{flatten-sS3L8FSH.js → flatten-CaB4Oqne.js} +1 -1
  120. package/dist/public/assets/{flowDiagram-DWJPFMVM-DOjygKY4.js → flowDiagram-DWJPFMVM-CMNxv96M.js} +1 -1
  121. package/dist/public/assets/{ganttDiagram-T4ZO3ILL-Cox3d5Yp.js → ganttDiagram-T4ZO3ILL-DSJ51gJ8.js} +1 -1
  122. package/dist/public/assets/git-branch-DtntyZcb.js +1 -0
  123. package/dist/public/assets/gitGraph-7Q5UKJZL-t28UFBv3.js +1 -0
  124. package/dist/public/assets/{gitGraphDiagram-UUTBAWPF-BXvw3bmB.js → gitGraphDiagram-UUTBAWPF-eqtXz7Hn.js} +1 -1
  125. package/dist/public/assets/{graphlib-FYrXvm7X.js → graphlib-CgeMr8SV.js} +1 -1
  126. package/dist/public/assets/index-BG8OZejR.js +2003 -0
  127. package/dist/public/assets/index-D53MQUCD.css +1 -0
  128. package/dist/public/assets/info-B_9IOYHV.js +1 -0
  129. package/dist/public/assets/info-OMHHGYJF-B1OgcQSI.js +1 -0
  130. package/dist/public/assets/{infoDiagram-42DDH7IO-Bk54rrHD.js → infoDiagram-42DDH7IO-CB_Gw_tn.js} +1 -1
  131. package/dist/public/assets/{input-DkQ8Zmzd.js → input-D0MSkqYi.js} +1 -1
  132. package/dist/public/assets/{isEmpty-DKKUMPPC.js → isEmpty-DA9OVgr8.js} +1 -1
  133. package/dist/public/assets/isSymbol-BR3mCdgP.js +1 -0
  134. package/dist/public/assets/{ishikawaDiagram-UXIWVN3A-Bc3G_190.js → ishikawaDiagram-UXIWVN3A-Cnz_ITKx.js} +1 -1
  135. package/dist/public/assets/{journeyDiagram-VCZTEJTY-CLrtuKm7.js → journeyDiagram-VCZTEJTY-3INdsNOc.js} +1 -1
  136. package/dist/public/assets/{kanban-definition-6JOO6SKY-DwQiIK5Z.js → kanban-definition-6JOO6SKY-BXFLNQXS.js} +1 -1
  137. package/dist/public/assets/keyboard-shortcuts-DiiTkD4P.js +1 -0
  138. package/dist/public/assets/label-hTzLGQhh.js +1 -0
  139. package/dist/public/assets/{line-Dk1foLQO.js → line-DXPDJkMA.js} +1 -1
  140. package/dist/public/assets/{linear-D7qoVA2u.js → linear-BmFs-_tv.js} +1 -1
  141. package/dist/public/assets/loader-circle-CiIO3Fk-.js +1 -0
  142. package/dist/public/assets/{mermaid-parser.core-WlD4T62P.js → mermaid-parser.core-B0CngrEV.js} +2 -2
  143. package/dist/public/assets/{mermaid.core-CLOkRfd8.js → mermaid.core-BKAbpHOL.js} +3 -3
  144. package/dist/public/assets/{mindmap-definition-QFDTVHPH-DYJRBCQs.js → mindmap-definition-QFDTVHPH-Bm9VbqSR.js} +1 -1
  145. package/dist/public/assets/miss-dialog-store-Ay7SdCdU.js +1 -0
  146. package/dist/public/assets/{now-C9pOxV0O.js → now-Cnt3xXdO.js} +1 -1
  147. package/dist/public/assets/{open-managed-artifact-tab-DBkxdYp_.js → open-managed-artifact-tab-TH1tyrz4.js} +2 -2
  148. package/dist/public/assets/{ordinal-BLFf0NQg.js → ordinal-Ca5DZ3xr.js} +1 -1
  149. package/dist/public/assets/packet-4T2RLAQJ-BPKm0rz4.js +1 -0
  150. package/dist/public/assets/panel-BH2RZRZQ.js +1 -0
  151. package/dist/public/assets/pending-receive-nav-store-BV9CpxST.js +1 -0
  152. package/dist/public/assets/pie-ZZUOXDRM-C37JdEN8.js +1 -0
  153. package/dist/public/assets/{pieDiagram-DEJITSTG-BtJ94Yhu.js → pieDiagram-DEJITSTG-0LpqYimt.js} +1 -1
  154. package/dist/public/assets/project-paths-Dvd83Cnz.js +1 -0
  155. package/dist/public/assets/prop-types-PwAyvfNz.js +1 -0
  156. package/dist/public/assets/{propagation-api-CR2CQW4x.js → propagation-api-BHhJitgG.js} +1 -1
  157. package/dist/public/assets/{quadrantDiagram-34T5L4WZ-B8wf6FVG.js → quadrantDiagram-34T5L4WZ-D4bhJC5O.js} +1 -1
  158. package/dist/public/assets/radar-PYXPWWZC-BqODBTH1.js +1 -0
  159. package/dist/public/assets/radio-group-1_2tsQbc.js +1 -0
  160. package/dist/public/assets/receive-store-z_JiltPn.js +2 -0
  161. package/dist/public/assets/{reduce-CrpTR7cO.js → reduce-BkAOm6E5.js} +1 -1
  162. package/dist/public/assets/refresh-cw-EVALIeLp.js +1 -0
  163. package/dist/public/assets/{requirementDiagram-MS252O5E-PrH6Wk-f.js → requirementDiagram-MS252O5E-CrZIuUV5.js} +1 -1
  164. package/dist/public/assets/{sankeyDiagram-XADWPNL6-DuDWdyws.js → sankeyDiagram-XADWPNL6-CDJh0Hcw.js} +1 -1
  165. package/dist/public/assets/{selection-context-vh0MmCBb.js → selection-context-DG6CuE_n.js} +1 -1
  166. package/dist/public/assets/{sequenceDiagram-FGHM5R23-BvF_oV_w.js → sequenceDiagram-FGHM5R23-Crf8F-0v.js} +1 -1
  167. package/dist/public/assets/share-metadata-rows-COyU9rhn.js +1 -0
  168. package/dist/public/assets/skill-actions-DmQL_HGK.js +1 -0
  169. package/dist/public/assets/skill-scope-Bt2TwqtA.js +1 -0
  170. package/dist/public/assets/skills-api-T8UMKFuI.js +1 -0
  171. package/dist/public/assets/{src-DEzC9TbA.js → src-60u1_sM3.js} +1 -1
  172. package/dist/public/assets/{stateDiagram-FHFEXIEX-BvOoHTsD.js → stateDiagram-FHFEXIEX-CoUQpm-3.js} +1 -1
  173. package/dist/public/assets/stateDiagram-v2-QKLJ7IA2-BM5GAHWg.js +1 -0
  174. package/dist/public/assets/target-navigation-intent-idRDy9hG.js +1 -0
  175. package/dist/public/assets/{telemetry-impl-BM7BnAv2.js → telemetry-impl-6qacFa_I.js} +2 -2
  176. package/dist/public/assets/telemetry-startup-ZaSL-kj2.js +1 -0
  177. package/dist/public/assets/{textarea-BQFFQ9_l.js → textarea-CUjvX3CU.js} +1 -1
  178. package/dist/public/assets/{timeline-definition-GMOUNBTQ-_VzX4HAF.js → timeline-definition-GMOUNBTQ-CiQZrQPS.js} +1 -1
  179. package/dist/public/assets/toggle-group-IN7Np0Is.js +1 -0
  180. package/dist/public/assets/tooltip-C9Dd0rIc.js +1 -0
  181. package/dist/public/assets/treeView-SZITEDCU-ByrE6Vcb.js +1 -0
  182. package/dist/public/assets/treemap-W4RFUUIX-BcYBme24.js +1 -0
  183. package/dist/public/assets/triangle-alert-r1Ou0VrE.js +1 -0
  184. package/dist/public/assets/{typing-burst-detector-BT98lJOb.js → typing-burst-detector-D-XypHNF.js} +3 -3
  185. package/dist/public/assets/{vennDiagram-DHZGUBPP-BiS2w_m-.js → vennDiagram-DHZGUBPP-CoqI8iiY.js} +1 -1
  186. package/dist/public/assets/wardley-RL74JXVD-DDdV8nDz.js +1 -0
  187. package/dist/public/assets/{wardleyDiagram-NUSXRM2D-BgB2gOdF.js → wardleyDiagram-NUSXRM2D-6pXCRu0Y.js} +1 -1
  188. package/dist/public/assets/{xychartDiagram-5P7HB3ND-DIurDFny.js → xychartDiagram-5P7HB3ND-C3ELwBEZ.js} +1 -1
  189. package/dist/public/index.html +74 -58
  190. package/dist/{repair-launch-json-B2igGItE.mjs → repair-launch-json-DsDdzz5S.mjs} +2 -2
  191. package/dist/{repair-mcp-configs-B0YDgxKo.mjs → repair-mcp-configs-CAw5k6Ut.mjs} +2 -2
  192. package/dist/repair-skills-BbCNUguw.mjs +3 -0
  193. package/dist/repair-skills-Bj4d8jaz.mjs +1 -0
  194. package/dist/server-lock-GuuouVft-BG2sFhIR.mjs +1 -0
  195. package/dist/{server-lock-CN2YHwpP-BYuwTc93.mjs → server-lock-iLcBw_q0-CPFOrsBn.mjs} +186 -184
  196. package/dist/src-7DlZEyGh.mjs +3 -0
  197. package/dist/start-CMWosjhu.mjs +3 -0
  198. package/dist/start-ame0DmVr.mjs +1 -0
  199. package/dist/write-project-skill-4cQ_oGJO.mjs +36 -0
  200. package/package.json +1 -1
  201. package/scripts/aggregate-tolerance-class-fires.ts +15 -0
  202. package/scripts/build-config-schema.mjs +69 -0
  203. package/scripts/postinstall.mjs +19 -0
  204. package/scripts/probe-exec.ts +8 -0
  205. package/scripts/probe-read-document.ts +12 -0
  206. package/dist/constants-BwIQxzxy.mjs +0 -2
  207. package/dist/dist-DUXDeyBp.mjs +0 -1
  208. package/dist/git-handle-DdgvPBh6-C80s8fFN.mjs +0 -1
  209. package/dist/init-BzdKgHZr.mjs +0 -321
  210. package/dist/init-HqjPAvpy.mjs +0 -1
  211. package/dist/loader-BEm7pFin.mjs +0 -1
  212. package/dist/preview-BoSe54Y5.mjs +0 -1
  213. package/dist/public/assets/ActivityModeContent-QvRIx_do.js +0 -2
  214. package/dist/public/assets/ConsentDialogBody-CPX75E6Q.js +0 -2
  215. package/dist/public/assets/DocumentContext-zL3ZbwDo.js +0 -34
  216. package/dist/public/assets/ManagedArtifactProperties-OxkUY14x.js +0 -1
  217. package/dist/public/assets/McpConsentDialogBody-Dr_AIi2H.js +0 -1
  218. package/dist/public/assets/PropertyPanel-D9A27c2E.js +0 -2
  219. package/dist/public/assets/SettingsDialogBody-cotnwVMw.js +0 -7
  220. package/dist/public/assets/SourceEditor-BZ3cbLjs.js +0 -2
  221. package/dist/public/assets/architecture-YZFGNWBL-0pWnpYMK.js +0 -1
  222. package/dist/public/assets/button-DGf25ccp.js +0 -1
  223. package/dist/public/assets/channel-ClECMrL_.js +0 -1
  224. package/dist/public/assets/checkbox-EGJP9xna.js +0 -1
  225. package/dist/public/assets/chevron-down-CzFz_0zd.js +0 -1
  226. package/dist/public/assets/chevron-left-Bb3WBx0B.js +0 -1
  227. package/dist/public/assets/chevron-right-jyIhGBkw.js +0 -1
  228. package/dist/public/assets/chunk-426QAEUC-UlKin18B.js +0 -1
  229. package/dist/public/assets/chunk-55IACEB6-maKdi3q_.js +0 -1
  230. package/dist/public/assets/chunk-QZHKN3VN-DUJDGGgJ.js +0 -1
  231. package/dist/public/assets/classDiagram-6PBFFD2Q-C9zXtHUq.js +0 -1
  232. package/dist/public/assets/classDiagram-v2-HSJHXN6E-BLmW_Iw2.js +0 -1
  233. package/dist/public/assets/clone-1iKEKVKL.js +0 -1
  234. package/dist/public/assets/collapsible-CjgfK1G5.js +0 -1
  235. package/dist/public/assets/config-context-DhhN0rlf.js +0 -1
  236. package/dist/public/assets/config-validation-events-yB2QWKKJ.js +0 -11
  237. package/dist/public/assets/dialog-CIq9aQLf.js +0 -45
  238. package/dist/public/assets/dist-BRGUidv4.js +0 -526
  239. package/dist/public/assets/dist-BXd_K33i.js +0 -1
  240. package/dist/public/assets/dist-ICp_3rWY.js +0 -1
  241. package/dist/public/assets/documents-events-DA8Q5ICz.js +0 -11
  242. package/dist/public/assets/file-tree-adapter-CP3Xa3us.js +0 -1
  243. package/dist/public/assets/gitGraph-7Q5UKJZL-DNLE-2Tt.js +0 -1
  244. package/dist/public/assets/index-CG7gf_6X.css +0 -1
  245. package/dist/public/assets/index-CoukPsjj.js +0 -2004
  246. package/dist/public/assets/info-OMHHGYJF-BiaOigFV.js +0 -1
  247. package/dist/public/assets/isSymbol-BgthEULk.js +0 -1
  248. package/dist/public/assets/keyboard-shortcuts-DOkzBlgc.js +0 -1
  249. package/dist/public/assets/label-DyT4OD9H.js +0 -1
  250. package/dist/public/assets/navigation-targets-DNRja8Z0.js +0 -1
  251. package/dist/public/assets/packet-4T2RLAQJ-v1yqEdTP.js +0 -1
  252. package/dist/public/assets/panel-BbrtnF__.js +0 -1
  253. package/dist/public/assets/pie-ZZUOXDRM-pmbX_rAr.js +0 -1
  254. package/dist/public/assets/project-paths-CcPGtodV.js +0 -1
  255. package/dist/public/assets/prop-types-C-aZftyS.js +0 -1
  256. package/dist/public/assets/radar-PYXPWWZC-CQRfh76o.js +0 -1
  257. package/dist/public/assets/radio-group-CFPLlVag.js +0 -1
  258. package/dist/public/assets/skill-actions-Sc4IN52j.js +0 -1
  259. package/dist/public/assets/skills-api-ts3L80AV.js +0 -1
  260. package/dist/public/assets/stateDiagram-v2-QKLJ7IA2-B02IOISZ.js +0 -1
  261. package/dist/public/assets/target-navigation-intent-CIKQ1Hj-.js +0 -1
  262. package/dist/public/assets/telemetry-startup-Pz1ro4a2.js +0 -1
  263. package/dist/public/assets/toggle-group-Bc5FaFo3.js +0 -1
  264. package/dist/public/assets/tooltip-DiL7DBhT.js +0 -1
  265. package/dist/public/assets/treeView-SZITEDCU-iExObZ_v.js +0 -1
  266. package/dist/public/assets/treemap-W4RFUUIX-B-jRsyTq.js +0 -1
  267. package/dist/public/assets/wardley-RL74JXVD-DGsNLwY0.js +0 -1
  268. package/dist/repair-skills-Cv_2HgEN.mjs +0 -3
  269. package/dist/repair-skills-XaoNNrHC.mjs +0 -1
  270. package/dist/server-lock-8Lv6A-Xa-xTK-ENFB.mjs +0 -1
  271. package/dist/src-DD9KqmOQ.mjs +0 -3
  272. package/dist/start-B4zA8vv3.mjs +0 -1
  273. package/dist/start-DYPIgVG4.mjs +0 -3
  274. package/dist/write-project-skill-HXJW0bDK.mjs +0 -36
  275. /package/dist/public/assets/{ActivityPanelDiffView-TEHR9A38.js → ActivityPanelDiffView-BPrpOwiv.js} +0 -0
  276. /package/dist/public/assets/{__vite-browser-external-DimdflAw.js → __vite-browser-external-DfbEpKPK.js} +0 -0
  277. /package/dist/public/assets/{array-CXyn2wAU.js → array-DrKFfLpK.js} +0 -0
  278. /package/dist/public/assets/{clike-kHME1xsl.js → clike-CY4jFeI9.js} +0 -0
  279. /package/dist/public/assets/{colors-DOVRXUpv.js → colors-BwB-X4pV.js} +0 -0
  280. /package/dist/public/assets/{cytoscape.esm-DGKrBfTH.js → cytoscape.esm-B72MXB0V.js} +0 -0
  281. /package/dist/public/assets/{defaultLocale-CIVmmKdD.js → defaultLocale-DEFJZ-43.js} +0 -0
  282. /package/dist/public/assets/{diff-B_7QuALZ.js → diff-VsLDmRbo.js} +0 -0
  283. /package/dist/public/assets/{dist-BAzUe-Rb.js → dist-BdpTVkuI.js} +0 -0
  284. /package/dist/public/assets/{dist-ug68MPTZ.js → dist-CbgmYSt6.js} +0 -0
  285. /package/dist/public/assets/{external-link-Bc6KvE1i.js → external-link-ChNdN5KK.js} +0 -0
  286. /package/dist/public/assets/{file-tree-rename-validation-BqGkSO9-.js → file-tree-rename-validation-BkATWpiZ.js} +0 -0
  287. /package/dist/public/assets/{format-Fsxus_sZ.js → format-CFXD031r.js} +0 -0
  288. /package/dist/public/assets/{go-DlHfV6Cv.js → go-CJnIK4Uo.js} +0 -0
  289. /package/dist/public/assets/{init-DAmDTHXL.js → init-20ACqh4a.js} +0 -0
  290. /package/dist/public/assets/{isObjectLike-0yTn5bno.js → isObjectLike-DURfeUEd.js} +0 -0
  291. /package/dist/public/assets/{katex-gTwLOSI2.js → katex-BunQWEOH.js} +0 -0
  292. /package/dist/public/assets/{lua-Cpo6SgEb.js → lua-BTUOHEPy.js} +0 -0
  293. /package/dist/public/assets/{mcp-consent-store-Q_heVQ86.js → mcp-consent-store-Bx7YkTj-.js} +0 -0
  294. /package/dist/public/assets/{min-CGFu6QbN.js → min-cXlECwx8.js} +0 -0
  295. /package/dist/public/assets/{panzoom.es-1vRDHCmL.js → panzoom.es-BPpDWM66.js} +0 -0
  296. /package/dist/public/assets/{path-1iyJ-o9O.js → path-Bbctax8p.js} +0 -0
  297. /package/dist/public/assets/{pdf-BjE4l7oX.js → pdf-Cz6vffXS.js} +0 -0
  298. /package/dist/public/assets/{pdf.worker-CU7PVDgr.js → pdf.worker-CUSszLRa.js} +0 -0
  299. /package/dist/public/assets/{perl-uq5LpsPX.js → perl-CSl7RrAK.js} +0 -0
  300. /package/dist/public/assets/{properties-DuLkwqft.js → properties-KpJMIKzZ.js} +0 -0
  301. /package/dist/public/assets/{r-DcEDABBa.js → r-DFsc7DIH.js} +0 -0
  302. /package/dist/public/assets/{rough.esm-Bk-GM2I8.js → rough.esm-CTApjP9q.js} +0 -0
  303. /package/dist/public/assets/{ruby-C6V5dDsD.js → ruby-dZPnOz8h.js} +0 -0
  304. /package/dist/public/assets/{shell-CVvCNjui.js → shell-CYSl653a.js} +0 -0
  305. /package/dist/public/assets/{sql-CQQBnjZX.js → sql-BfVjfYES.js} +0 -0
  306. /package/dist/public/assets/{src-C3imF5Zq.js → src-BjEzLuzr.js} +0 -0
  307. /package/dist/public/assets/{startup-marks-CWTDb1CP.js → startup-marks-DdMtjWR-.js} +0 -0
  308. /package/dist/public/assets/{stex-coA_FIxI.js → stex-DYxKXJZx.js} +0 -0
  309. /package/dist/public/assets/{swift-BBOV2SBg.js → swift-DjBuuwmF.js} +0 -0
  310. /package/dist/public/assets/{toml-lQGk0tnp.js → toml-C3_Svn60.js} +0 -0
  311. /package/dist/public/assets/{trace-api-MhJXZpsM.js → trace-api-D6fqC5Nw.js} +0 -0
  312. /package/dist/public/assets/{w3c-keyname-beU76Hfb.js → w3c-keyname-CHcJEDvG.js} +0 -0
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,28 +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
+ */
61
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
+ */
62
138
  skipAvailabilityCheck?: boolean;
63
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
+ */
64
160
  declare function isEntryUpToDate(entry: unknown): boolean;
65
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
+ */
66
185
  declare function isOwnManagedEntry(entry: unknown): boolean;
67
186
  interface EditorMcpTarget {
68
187
  id: EditorId;
188
+ /** Human-friendly name for CLI output. */
69
189
  label: string;
190
+ /** Resolve the absolute path to the MCP config file. */
70
191
  configPath: (cwd: string, home?: string) => string;
192
+ /** On-disk config format for this editor. */
71
193
  format: 'json' | 'toml';
194
+ /** Top-level key that holds the server map. */
72
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
+ */
73
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
+ */
74
213
  offerOnlyWhenDetected?: boolean;
214
+ /** Config key used for this project's MCP server entry. */
75
215
  serverName: (cwd: string) => string;
216
+ /** Build the server entry object for this editor. */
76
217
  buildEntry: (cwd: string, options?: McpInstallOptions) => Record<string, unknown>;
218
+ /** Whether the config is project-local or user-global. */
77
219
  scope: 'project' | 'global';
220
+ /** Filesystem path whose existence implies the editor is installed. */
78
221
  detectPath?: (cwd: string, home?: string) => string;
222
+ /** Project-local MCP config path (used for project-scope installs). */
79
223
  projectConfigPath?: (cwd: string) => string;
224
+ /** Project-local Agent Skill entrypoint, when the editor has a known skill surface. */
80
225
  projectSkillPath?: (cwd: string) => string;
81
226
  }
82
227
  declare const EDITOR_TARGETS: Record<EditorId, EditorMcpTarget>;
@@ -96,9 +241,64 @@ interface PreviewResult {
96
241
  declare function previewContent(opts: PreviewOptions): PreviewResult;
97
242
  //#endregion
98
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
+ */
99
267
  declare function assertProjectPathSafe(targetPath: string, cwd: string): void;
100
268
  //#endregion
101
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
+ */
102
302
  type ExcludeWriteResult = {
103
303
  kind: 'updated';
104
304
  appended: string[];
@@ -108,20 +308,124 @@ type ExcludeWriteResult = {
108
308
  kind: 'no-exclude';
109
309
  reason: 'no-git' | 'no-info-dir' | 'malformed-pointer' | 'inaccessible';
110
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
+ */
111
316
  interface TrackedRefusal {
112
317
  kind: 'refused-tracked';
318
+ /** Paths currently tracked upstream (subset of the input `paths`). */
113
319
  tracked: string[];
320
+ /** Pre-formatted, multi-line user-facing diagnostic. */
114
321
  remediation: string;
115
322
  }
323
+ /** Resolved sharing-mode reading derived from `.git/info/exclude` content. */
116
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
+ */
117
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
+ */
118
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
+ */
119
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
+ */
120
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
+ */
121
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
+ */
122
416
  declare function probeTrackedOkPaths(projectRoot: string, paths: readonly string[]): {
123
417
  tracked: string[];
124
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
+ */
125
429
  declare function formatTrackedRemediation(tracked: readonly string[]): string;
126
430
  //#endregion
127
431
  //#region src/commands/init.d.ts
@@ -132,11 +436,47 @@ interface EditorMcpResult {
132
436
  configPath: string;
133
437
  serverName: string;
134
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
+ */
135
444
  declineReason?: McpDeclineReason;
445
+ /** Set to 'project' when the result came from a project-scope write. */
136
446
  configScope?: 'project';
137
447
  }
138
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
+ */
139
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
+ */
140
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";
141
481
  type LaunchJsonAction = 'created' | 'merged' | 'failed';
142
482
  interface LaunchJsonResult {
@@ -144,15 +484,133 @@ interface LaunchJsonResult {
144
484
  configPath: string;
145
485
  error?: string;
146
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
+ */
147
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
+ */
148
513
  declare function writeEditorMcpConfig(target: EditorMcpTarget, cwd: string, installOptions: McpInstallOptions, home?: string, configPathOverride?: string): EditorMcpResult;
149
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
+ */
150
522
  editors: EditorId[];
523
+ /** Override `$HOME` for resolving user-scoped config paths (test hook). */
151
524
  home?: string;
152
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
+ */
153
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
+ */
154
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
+ */
155
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
+ */
156
614
  type McpEntryClassification = {
157
615
  kind: 'absent';
158
616
  } | {
@@ -165,6 +623,16 @@ type McpEntryClassification = {
165
623
  reason: McpDeclineReason;
166
624
  };
167
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
+ */
168
636
  declare function detectInstalledEditors(cwd: string, home?: string): EditorId[];
169
637
  //#endregion
170
638
  //#region src/commands/mcp-decline-event.d.ts
@@ -182,11 +650,42 @@ interface McpConfigDeclineEvent {
182
650
  surface: McpConfigDeclineSurface;
183
651
  editorId: string;
184
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
+ */
185
658
  [key: string]: unknown;
186
659
  }
187
660
  declare function buildMcpConfigDeclineEvent(input: McpConfigDeclineInput): McpConfigDeclineEvent;
188
661
  //#endregion
189
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
+ */
190
689
  type McpConfigMigrateScope = 'user' | 'project';
191
690
  interface McpConfigMigrateInput {
192
691
  scope: McpConfigMigrateScope;
@@ -203,9 +702,29 @@ interface McpConfigMigrateEvent {
203
702
  configPath: string;
204
703
  priorCommand: string | null;
205
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
+ */
206
711
  [key: string]: unknown;
207
712
  }
208
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
+ */
209
728
  declare function truncatePriorEntry(entry: Record<string, unknown>): {
210
729
  priorCommand: string | null;
211
730
  priorArgs: unknown[] | null;
@@ -254,6 +773,11 @@ interface StopOutcome {
254
773
  }>;
255
774
  hadTargets: boolean;
256
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
+ */
257
781
  declare function runStop(deps: RunStopDeps): StopOutcome;
258
782
  //#endregion
259
783
  //#region src/config/loader.d.ts
@@ -264,6 +788,29 @@ interface LoadConfigResult {
264
788
  declare function loadConfig(cwd?: string): LoadConfigResult;
265
789
  //#endregion
266
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`. */
267
814
  type ShareFolderValidationResult = {
268
815
  kind: 'ok';
269
816
  gitRemoteUrl: string;
@@ -284,27 +831,53 @@ interface ExpectedShareRepo {
284
831
  readonly owner: string;
285
832
  readonly repo: string;
286
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
+ */
287
844
  declare function validateLocalFolderForShare(folderPath: string, expected: ExpectedShareRepo): Promise<ShareFolderValidationResult>;
288
845
  //#endregion
289
846
  //#region src/github/url.d.ts
847
+ /**
848
+ * Parsed Git URL result.
849
+ */
290
850
  interface ParsedGitUrl {
291
851
  protocol: 'https' | 'ssh' | 'git';
292
852
  hostname: string;
293
853
  owner: string;
294
854
  name: string;
295
855
  }
856
+ /**
857
+ * Parsed GitHub blob URL result.
858
+ */
296
859
  interface ParsedGitHubBlobUrl {
297
860
  owner: string;
298
861
  repo: string;
299
862
  branch: string;
300
863
  path: string;
301
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
+ */
302
870
  interface ParsedGitHubTreeUrl {
303
871
  owner: string;
304
872
  repo: string;
305
873
  branch: string;
306
874
  path: string;
307
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
+ */
308
881
  type ParsedGitHubShareTarget = {
309
882
  kind: 'doc';
310
883
  owner: string;
@@ -318,21 +891,126 @@ type ParsedGitHubShareTarget = {
318
891
  branch: string;
319
892
  path: string;
320
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
+ */
321
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
+ */
322
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
+ */
323
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
+ */
324
949
  declare function parseGitHubShareUrl(input: string): ParsedGitHubShareTarget | null;
325
950
  //#endregion
326
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. */
327
977
  declare const PATH_SHIM_BEGIN = "# >>> open-knowledge cli >>>";
978
+ /** Fence closing the managed block. */
328
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
+ */
329
986
  declare const PATH_SHIM_BLOCK_RE: RegExp;
987
+ /** Diagnostic snapshot of the interactive PATH captured at install time. */
330
988
  interface PathDiscovery {
331
989
  capturedAt: string;
332
990
  pathEntries: string[];
333
991
  shellUsed: string;
334
992
  okBinAlreadyOnPath: boolean;
335
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
+ */
336
1014
  interface PathInstallMarker {
337
1015
  version: 1;
338
1016
  installedAt: string;
@@ -351,6 +1029,8 @@ interface PathInstallMarker {
351
1029
  createdAt: string;
352
1030
  kind: 'created' | 'refreshed-our-own';
353
1031
  }>;
1032
+ /** Rc-append consent record — see `PathInstallConsent`. `version` stays 1. */
1033
+ consent?: PathInstallConsent;
354
1034
  }
355
1035
  /** Absolute path to the PATH-install manifest (macOS layout — the shim is
356
1036
  * macOS-packaged-desktop only, so this path is where it is ever written). */
@@ -358,6 +1038,23 @@ declare function pathInstallMarkerPath(home: string): string;
358
1038
  //#endregion
359
1039
  //#region src/integrations/project-integration-writers.d.ts
360
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
+ */
361
1058
  interface IntegrationWriteOutcome {
362
1059
  readonly integration: IntegrationId;
363
1060
  readonly editorId: EditorId;
@@ -368,6 +1065,33 @@ interface IntegrationWriteOutcome {
368
1065
  }
369
1066
  //#endregion
370
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
+ */
371
1095
  interface ResolveProjectRootResult {
372
1096
  /** Where `.ok/` lives or will live. Equals `realpath(cwd)` when no
373
1097
  * promotion happened; otherwise the ancestor that owned `.ok/config.yml`
@@ -378,6 +1102,7 @@ interface ResolveProjectRootResult {
378
1102
  * NOT used as a default scope — `projectRoot` and content scope align by
379
1103
  * default; the user can narrow via `content.dir` post-init. */
380
1104
  readonly defaultContentDir: string;
1105
+ /** True iff a `.ok/` was found above `cwd`. */
381
1106
  readonly ancestorPromoted: boolean;
382
1107
  /** True iff the git working-tree root sat above `cwd` and won the
383
1108
  * promotion (no ancestor `.ok/`). Mutually exclusive with
@@ -393,8 +1118,40 @@ interface ResolveProjectRootOptions {
393
1118
  * to avoid spinning up real git fixtures for unit-level coverage. */
394
1119
  gitTopLevel?: (cwd: string) => string | null;
395
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
+ */
396
1126
  declare function resolveProjectRoot(cwd: string, opts?: ResolveProjectRootOptions): ResolveProjectRootResult;
397
1127
  //#endregion
1128
+ //#region src/integrations/skill-teardown.d.ts
1129
+ interface SkillBundleTarget {
1130
+ /** Absolute path of the bundle directory to remove. */
1131
+ path: string;
1132
+ /** Which built-in user-global bundle this directory holds. */
1133
+ bundleId: BundleId;
1134
+ /** `central` = the shared `~/.agents/skills` store; `host` = a per-editor dir. */
1135
+ scope: 'central' | 'host';
1136
+ /** The editor host dir (e.g. `.claude`) for `host`-scope targets. */
1137
+ hostDir?: string;
1138
+ }
1139
+ /**
1140
+ * Every user-global built-in skill-bundle directory OK installs, for the given
1141
+ * home dir. Ordered central-first per bundle so plan output reads bundle by
1142
+ * bundle.
1143
+ */
1144
+ declare function userGlobalSkillBundleTargets(home: string): SkillBundleTarget[];
1145
+ /**
1146
+ * Remove ONE user-global bundle's directories (central + every per-host copy)
1147
+ * from disk. Used by the opt-out paths (dialog decline, `ok init --no-skills`,
1148
+ * the reclaim/sweep gate) so an unchecked bundle actually leaves — the exact
1149
+ * reverse of `installUserBundleToHostDirs`. Tolerant of already-absent dirs
1150
+ * (`rmSync` with `force`). Only the specific `open-knowledge-*` dirs, never the
1151
+ * shared `~/.agents/skills` root.
1152
+ */
1153
+ declare function removeUserGlobalSkillBundle(home: string, bundleId: BundleId): void;
1154
+ //#endregion
398
1155
  //#region src/integrations/write-project-ai-integrations.d.ts
399
1156
  interface ProjectAiIntegrationsResult {
400
1157
  /** Per-(editor × integration) outcomes — MCP config and the project-local
@@ -406,5 +1163,5 @@ interface ProjectAiIntegrationsResult {
406
1163
  }
407
1164
  declare function writeProjectAiIntegrations(projectDir: string, selectedEditorIds: readonly EditorId[], installOptions?: McpInstallOptions): ProjectAiIntegrationsResult;
408
1165
  //#endregion
409
- 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 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 };
1166
+ 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 SkillBundleTarget, 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, removeUserGlobalSkillBundle, resolveProjectRoot, runStop, scaffoldLaunchJson, truncatePriorEntry, userGlobalSkillBundleTargets, validateLocalFolderForShare, writeEditorMcpConfig, writeProjectAiIntegrations, writeUserMcpConfigs };
410
1167
  //# sourceMappingURL=index.d.mts.map