@inkeep/open-knowledge 0.29.1 → 0.30.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/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 +6 -6
- package/dist/constants-ruS6yqIq.mjs +2 -0
- package/dist/{dist-DU6kAT_L.mjs → dist-BbS1zQiy.mjs} +4 -4
- package/dist/{dist-BC-5uOuA.mjs → dist-ClIxicL4.mjs} +1 -1
- package/dist/{gh-detect-C8cgnhPS.mjs → gh-detect-Co-jRtcQ.mjs} +2 -2
- package/dist/index.d.mts +5 -4
- package/dist/index.mjs +1 -1
- package/dist/init-CZ1SNbzi.mjs +695 -0
- package/dist/init-YPWG3akm.mjs +1 -0
- package/dist/{loader-Dz99u1bW.mjs → loader-B0Twaq2k.mjs} +2 -2
- package/dist/loader-_YxuPUFp.mjs +1 -0
- package/dist/{open-browser-Csh_BnzS.mjs → open-browser-DMRT-DpW.mjs} +2 -2
- package/dist/{preview-Dbug2tNM.mjs → preview-CNYn-min.mjs} +2 -2
- package/dist/preview-Nr0DWwkh.mjs +1 -0
- package/dist/public/assets/{ActivityModeContent-CbZqvb_A.js → ActivityModeContent-mVRGV66w.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-BztfvSJa.js → CodeMirrorPropInput-D5H6xSL_.js} +2 -2
- package/dist/public/assets/{DocumentContext-DZcMx7fa.js → DocumentContext-CKEIVeX1.js} +2 -2
- package/dist/public/assets/{EnableSyncConfirmDialog-HrN6822q.js → EnableSyncConfirmDialog-BLuCj6gn.js} +1 -1
- package/dist/public/assets/{GraphPanel-CjZ-1di7.js → GraphPanel-B4d24Bm9.js} +1 -1
- package/dist/public/assets/{ManagedArtifactProperties-PioGnkt4.js → ManagedArtifactProperties-D-LbzNYB.js} +1 -1
- package/dist/public/assets/{McpConsentDialogBody-BeIUh4bz.js → McpConsentDialogBody-IQQRiBVd.js} +1 -1
- package/dist/public/assets/{MermaidDocEditor-wX2uMFi1.js → MermaidDocEditor-CdV2PRKa.js} +1 -1
- package/dist/public/assets/{PropertyPanel-BWc1WL_7.js → PropertyPanel-B7eV5Tcu.js} +1 -1
- package/dist/public/assets/{SettingsDialogBody-CKvf-ve4.js → SettingsDialogBody-DACGgbgK.js} +1 -1
- package/dist/public/assets/{ShareBranchSwitchDialog-CSO2vi9J.js → ShareBranchSwitchDialog-BJmWeDPf.js} +1 -1
- package/dist/public/assets/{ShareReceiveDialog-DddOjvn2.js → ShareReceiveDialog-BVOJDKXk.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-D2gqyxrq.js → ShareReceiveMissDialog-CH6uraGh.js} +1 -1
- package/dist/public/assets/{SkillEditorActions-DWcvLtye.js → SkillEditorActions-1SA0Sfoq.js} +1 -1
- package/dist/public/assets/{SourceEditor-huOeP2VE.js → SourceEditor-BA4ZZSKZ.js} +1 -1
- package/dist/public/assets/{TerminalPanel-D0lg824P.js → TerminalPanel-Cvai8HvA.js} +37 -37
- package/dist/public/assets/{agent-presence-SWQihO8a.js → agent-presence-CWtl35ms.js} +1 -1
- package/dist/public/assets/{auth-state-cache-B8olfOAk.js → auth-state-cache-ROXaeSig.js} +1 -1
- package/dist/public/assets/{config-provider-Cpc4mCc5.js → config-provider-C7vWo2tJ.js} +2 -2
- package/dist/public/assets/{dist-B3cFd6-R.js → dist-C-f1kbPA.js} +1 -1
- package/dist/public/assets/{dist-Chq5t0fA.js → dist-DN4vicwQ.js} +1 -1
- package/dist/public/assets/{doc-hash-KNy1saqI.js → doc-hash-BRcc1l8V.js} +1 -1
- package/dist/public/assets/{documents-events-D9ifI_ZN.js → documents-events-Z18kbrmq.js} +1 -1
- package/dist/public/assets/documents-fetch-oup83IZh.js +1 -0
- package/dist/public/assets/file-tree-adapter-DJIk8Mtr.js +1 -0
- package/dist/public/assets/{index-Dh9q-MJv.js → index-DrjcjzLS.js} +10 -10
- package/dist/public/assets/{keyboard-shortcuts-BMEqPQU6.js → keyboard-shortcuts-DVv_UWZp.js} +1 -1
- package/dist/public/assets/navigation-targets-2KIKb2N7.js +1 -0
- package/dist/public/assets/{open-managed-artifact-tab-DEPmVkDy.js → open-managed-artifact-tab-BYHLuUIG.js} +1 -1
- package/dist/public/assets/{pending-receive-nav-store-C8dcyMzt.js → pending-receive-nav-store-DynS4M_y.js} +1 -1
- package/dist/public/assets/{prop-types-Cktxy2Ty.js → prop-types-CdM6RVrV.js} +1 -1
- package/dist/public/assets/{receive-store-BzfAUT48.js → receive-store-BBXikFBW.js} +1 -1
- package/dist/public/assets/{selection-context-BV4d2iWa.js → selection-context-DM7dh9w8.js} +1 -1
- package/dist/public/assets/{skill-actions-UtDN9_sZ.js → skill-actions-BGFjwgz8.js} +1 -1
- package/dist/public/assets/{skills-api-CmDm6eQu.js → skills-api-BOT-8Fw4.js} +1 -1
- package/dist/public/assets/{src-DgbhCjBm.js → src-D2FMxg7w.js} +1 -1
- package/dist/public/assets/{target-navigation-intent-Dzc6XGok.js → target-navigation-intent-OcEXysbL.js} +1 -1
- package/dist/public/assets/{telemetry-impl-kX0htzfi.js → telemetry-impl-CSONG7_p.js} +1 -1
- package/dist/public/assets/{telemetry-startup-CCtOwEyz.js → telemetry-startup-BK7tF5N1.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-DBgbqLL7.js → typing-burst-detector-BFnDTZhU.js} +1 -1
- package/dist/public/assets/{workspace-paths-CLhojMmt.js → workspace-paths-DAj8e6IA.js} +1 -1
- package/dist/public/index.html +26 -26
- package/dist/{repair-launch-json-B7J0wqq7.mjs → repair-launch-json-CERDu05c.mjs} +2 -2
- package/dist/{repair-mcp-configs-D2WfP2U5.mjs → repair-mcp-configs-CHisR-P4.mjs} +2 -2
- package/dist/{repair-skills-C_l1phOf.mjs → repair-skills-B_uZNXYU.mjs} +2 -2
- package/dist/repair-skills-DzXDE27i.mjs +1 -0
- package/dist/server-lock-GuuouVft-DP6WTOjI.mjs +1 -0
- package/dist/{server-lock-iLcBw_q0-CdaRzkXM.mjs → server-lock-iLcBw_q0-i_GNVPAP.mjs} +2 -2
- package/dist/src-DZiSWqgp.mjs +11 -0
- package/dist/{start-CLhScnKM.mjs → start-DIaR6Cov.mjs} +2 -2
- package/dist/start-PB9hDssp.mjs +1 -0
- package/dist/write-project-skill-DXeyiTpq.mjs +36 -0
- package/package.json +1 -1
- package/dist/constants-M17LTYw2.mjs +0 -2
- package/dist/init-BpTEYASv.mjs +0 -1
- package/dist/init-CxTuDUeq.mjs +0 -690
- package/dist/loader-C3lxLqgx.mjs +0 -1
- package/dist/preview-C_AxguUR.mjs +0 -1
- package/dist/public/assets/documents-fetch-DqIXnUVU.js +0 -1
- package/dist/public/assets/file-tree-adapter-CZb_x9ou.js +0 -1
- package/dist/public/assets/navigation-targets-PfRiZDK9.js +0 -1
- package/dist/repair-skills-B0B7a5IA.mjs +0 -1
- package/dist/server-lock-GuuouVft-DSQyMetL.mjs +0 -1
- package/dist/src-BCVlEG7o.mjs +0 -7
- package/dist/start-B6YwIiZ5.mjs +0 -1
- package/dist/write-project-skill-BnCIY7g1.mjs +0 -36
package/dist/loader-C3lxLqgx.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./loader-Dz99u1bW.mjs";export{e as loadConfig};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./preview-Dbug2tNM.mjs";export{t as formatPreviewBlock,e as previewContent};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=null,t=new Set;function n(e,t){if(e===t)return!0;if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function r(e,t){return e===null?!1:e===t?!0:n(e.pages,t.pages)&&n(e.folderPaths,t.folderPaths)&&n(e.assetPaths??new Set,t.assetPaths??new Set)&&n(e.filePaths??new Set,t.filePaths??new Set)&&i(e.pageIcons,t.pageIcons)}function i(e,t){if(e===t)return!0;let n=e?.size??0;if(n!==(t?.size??0))return!1;if(n===0)return!0;for(let[n,r]of e)if(t.get(n)!==r)return!1;return!0}function a(e,t){let n=new Map;for(let r of e){let e=t(r);e&&!n.has(e)&&n.set(e,r)}return n}function o(e,t){let n=new Map,r=[...e].sort((e,t)=>e.localeCompare(t));for(let e of r){let r=e.lastIndexOf(`/`),i=t(r===-1?e:e.slice(r+1));i&&!n.has(i)&&n.set(i,e)}return n}function s(e){let t=new Map;for(let[n,r]of e){let e=r.icon;typeof e==`string`&&e.trim()!==``&&t.set(n,e)}return t}function c(){return e}function l(n){if(!r(e,n)){e=n;for(let e of Array.from(t))try{e(n)}catch(e){console.error(`[page-list-cache] subscriber threw:`,e)}}}function u(n){if(t.add(n),e!==null)try{n(e)}catch(e){console.error(`[page-list-cache] subscriber threw on replay:`,e)}return()=>{t.delete(n)}}var d=null;function f(){if(d)return d;let e=(async()=>{let e=await fetch(`/api/documents`),t=await e.json().catch(e=>(console.warn(`[documents-fetch] /api/documents response was not valid JSON:`,e),null));return{ok:e.ok,status:e.status,body:t}})();return d=e,e.then(()=>{d===e&&(d=null)},()=>{d===e&&(d=null)}),e}export{c as a,a as i,s as n,l as o,o as r,u as s,f as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Hi as e,Ui as t}from"./dist-Chq5t0fA.js";import{t as n}from"./file-tree-rename-validation-DeKIxKnc.js";import{d as r,i,l as a,u as o}from"./navigation-targets-PfRiZDK9.js";import{c as s,o as c,s as l}from"./doc-hash-KNy1saqI.js";var u=`application/x-open-knowledge-sidebar-item+json`,d={image:!0,video:!0,audio:!0,pdf:!0,text:!0,mermaid:!0};function f(e){return JSON.stringify(e)}function p(e){return e.kind===`folder`?{target:{kind:`folder`,target:e.folderPath,folderPath:e.folderPath},hash:s(e.folderPath)}:e.kind===`asset`?{target:{kind:`asset`,target:e.assetPath,assetPath:e.assetPath,mediaKind:e.mediaKind},hash:c(e.assetPath)}:{target:i(e.docName,e.size)??{kind:`doc`,target:e.docName,docName:e.docName},hash:l(e.docName)}}function m(e){if(!e||!Array.from(e.types).includes(`application/x-open-knowledge-sidebar-item+json`))return null;let t=e.getData(u);if(!t)return null;let n;try{n=JSON.parse(t)}catch{return null}if(!h(n)||n.v!==1||typeof n.kind!=`string`)return null;if(n.kind===`doc`){if(typeof n.docName!=`string`||n.docName.length===0)return null;let e=n.size;return e!==null&&typeof e!=`number`?null:{v:1,kind:`doc`,docName:n.docName,size:e}}if(n.kind===`folder`)return typeof n.folderPath==`string`?{v:1,kind:`folder`,folderPath:n.folderPath}:null;if(n.kind===`asset`){if(typeof n.assetPath!=`string`||n.assetPath.length===0)return null;let e=n.mediaKind;return e!==null&&!g(e)?null:{v:1,kind:`asset`,assetPath:n.assetPath,mediaKind:e}}return null}function h(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function g(e){return typeof e==`string`&&Object.hasOwn(d,e)}var _={background:`#171717`,foreground:`#e5e5e5`,cursor:`#e5e5e5`,cursorAccent:`#171717`,selectionBackground:`#3a3d41`,black:`#000000`,red:`#cd3131`,green:`#0dbc79`,yellow:`#e5e510`,blue:`#2472c8`,magenta:`#bc3fbc`,cyan:`#11a8cd`,white:`#e5e5e5`,brightBlack:`#666666`,brightRed:`#f14c4c`,brightGreen:`#23d18b`,brightYellow:`#f5f543`,brightBlue:`#3b8eea`,brightMagenta:`#d670d6`,brightCyan:`#29b8db`,brightWhite:`#ffffff`},v={background:`#ffffff`,foreground:`#262626`,cursor:`#262626`,cursorAccent:`#ffffff`,selectionBackground:`#add6ff`,black:`#000000`,red:`#cd3131`,green:`#00bc00`,yellow:`#949800`,blue:`#0451a5`,magenta:`#bc05bc`,cyan:`#0598bc`,white:`#555555`,brightBlack:`#666666`,brightRed:`#cd3131`,brightGreen:`#14ce14`,brightYellow:`#b5ba00`,brightBlue:`#0451a5`,brightMagenta:`#bc05bc`,brightCyan:`#0598bc`,brightWhite:`#a5a5a5`};function y(e){return e===`dark`?_:v}var b=`.md`,x=/\.(md|mdx)$/i;function S(t,n=b){return x.test(t)||e(t)?t:`${t}${n}`}function C(e){return Q(e).replace(x,``)}function w(e,t){let n=Q(e),r=t.find(e=>o(e)&&T(e)===n);if(r)return r.docName;let i=C(n);return t.find(e=>{let t=T(e);return t!==n&&x.test(t)&&C(t)===i})&&x.test(n)?n:i}function T(e){return r(e)?O(e.path):a(e)?e.path:S(e.docName,e.docExt)}function E(e){let t=Q(e).match(x);return t?`.${t[1].toLowerCase()}`:void 0}function D(e){return Q(e)}function O(e){let t=Q(e.trim());return t?`${t}/`:``}function k(e){return e.endsWith(`/`)?D(e):C(e)}function A(e){return e.map(T)}function j(e){return[...e].sort().join(`\0`)}function M(e){return j(A(e))}function N(e){let t=new Set;for(let n of e){let e=(r(n)||a(n)?n.path:n.docName).split(`/`).filter(Boolean);if(e.includes(`.ok`))continue;if(r(n)){let e=O(n.path);e&&t.add(e)}let i=r(n)?e.length:e.length-1;for(let n=1;n<=i;n++)t.add(`${e.slice(0,n).join(`/`)}/`)}return[...t].sort()}function P(e){if(!e)return[];let t=Q(e.replace(x,``)).split(`/`).filter(Boolean),n=[],r=e.endsWith(`/`)?t.length:t.length-1;for(let e=1;e<=r;e++)n.push(`${t.slice(0,e).join(`/`)}/`);return n}function F(e,t,n){let r=E(e);if(r)return r;let i=n.find(e=>o(e)&&e.docName===t);return i?i.docExt??b:Z(e).includes(`.`)?void 0:b}function I(e,t){let n=e.lastIndexOf(`/`),r=n===-1?``:e.slice(0,n+1),i=n===-1?e:e.slice(n+1),o=t.filter(e=>{if(!a(e)||!e.path.startsWith(r))return!1;let t=e.path.slice(r.length);return!t.includes(`/`)&&t.startsWith(`${i}.`)});return o.length===1?o[0].path:null}function L(e,t,n){if(E(e))return null;let r=n.find(e=>a(e)&&e.path===t);return r?r.path:Z(e).includes(`.`)?t:I(t,n)}function R(e,t){let n=e.kind===`directory`,r=n?D(e.path):w(e.path,t);if(n)return{kind:`folder`,name:Q(Z(e.path)).replace(x,``),path:r,treePath:B(e.path,!0)};let i=L(e.path,r,t);if(i)return{kind:`asset`,name:Q(Z(i)),path:i,treePath:i};let a=F(e.path,r,t);return{kind:`file`,name:Q(Z(e.path)).replace(x,``),path:r,treePath:B(e.path,!1),docExt:a}}function z(e){return e.kind===`directory`?D(e.path):e.path}function B(e,t){return t?O(e):x.test(e)?e:`${e}${b}`}function V(e,t,n){let r=O(t),i=new Set(n);for(let t=0;t<100;t++){let n=t===0?``:` ${t+1}`;if(e===`file`){let e=`${r}Untitled${n}${b}`;if(!i.has(e))return{addPath:e,renamePath:e};continue}let a=`${r}New Folder${n}/`;if(!i.has(a))return{addPath:a,renamePath:a}}throw Error(`Could not allocate a unique tree placeholder`)}function H(e,t){return e===`file`?B(t,!1):`${D(t)}/index${b}`}function U(e,t){return t.kind===`root`||t.directoryPath==null?Z(e):`${t.directoryPath}${Z(e)}`}function W(e,t){if(t)return D(O(e));let n=C(e),r=n.lastIndexOf(`/`);return r===-1?``:n.slice(0,r)}function G(e,t){let n=D(O(e));return n?`${n}/${t}`:t}function K(e,t,n){e.append(`parentDocName`,G(t,n)),e.append(`placement`,`parent-dir`)}function q(e,t){return(t.path??G(e,t.src)).replace(/^\/+/,``)}function J(e){let t=e.dataTransfer?.types;if(!t)return!1;let n=Array.from(t);return n.includes(`Files`)&&!n.includes(`application/x-open-knowledge-sidebar-item+json`)}function Y(e){return Array.from(e.dataTransfer?.files??[]).filter(e=>e.name.length>0||e.size>0)}function X(e,r){let i=n(e).toLowerCase();if(i===``)return null;let a=new Date().toISOString();if(i===`.md`||i===`.mdx`)return{kind:`document`,docName:C(e),docExt:i,modified:a,size:r.size};let o=i.startsWith(`.`)?i.slice(1):i;return{kind:`asset`,path:e,assetExt:o,mediaKind:t(o),modified:a,size:r.size}}function Z(e){let t=Q(e),n=t.lastIndexOf(`/`),r=n===-1?t:t.slice(n+1);return e.endsWith(`/`)?`${r}/`:r}function Q(e){return e.endsWith(`/`)?e.slice(0,-1):e}export{f as A,j as C,u as D,y as E,p as O,R as S,q as T,z as _,H as a,C as b,A as c,T as d,Y as f,W as g,B as h,U as i,m as k,M as l,J as m,N as n,V as o,O as p,P as r,S as s,K as t,X as u,I as v,k as w,w as x,D as y};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{C as e,Er as t,Hi as n,Kn as r,Qn as i,Vn as a,Wn as o,cr as s,or as c,pr as l}from"./dist-Chq5t0fA.js";import{h as u}from"./doc-hash-KNy1saqI.js";function d(e){return e.kind===`asset`}function f(e){return e.kind===`document`}function p(e){return e.kind===`folder`}function m(e){let t=[],n=0;for(let r of e)switch(r.kind){case`document`:if(r.docName===void 0){n+=1;break}t.push({kind:`document`,docName:r.docName,docExt:r.docExt,size:r.size,modified:r.modified,isSymlink:r.isSymlink,canonicalDocName:r.canonicalDocName,targetPath:r.targetPath});break;case`asset`:if(r.path===void 0||r.assetExt===void 0){n+=1;break}t.push({kind:`asset`,path:r.path,assetExt:r.assetExt,mediaKind:r.mediaKind??null,size:r.size,modified:r.modified,referencedBy:r.referencedBy});break;case`file`:if(r.path===void 0){n+=1;break}t.push({kind:`asset`,path:r.path,assetExt:r.assetExt??h(r.path),mediaKind:null,size:r.size,modified:r.modified,referencedBy:[]});break;case`folder`:if(r.path===void 0){n+=1;break}t.push({kind:`folder`,path:r.path,size:r.size,modified:r.modified,hasChildren:r.hasChildren,isSymlink:r.isSymlink,targetPath:r.targetPath});break;default:r.kind;break}return n>0&&console.warn(`[file-tree-utils] dropped ${n} listing entries missing variant identity fields`),t}function h(e){let t=e.includes(`/`)?e.split(`/`).pop()??e:e,n=t.lastIndexOf(`.`);return n>0&&n<t.length-1?t.slice(n+1).toLowerCase():t.startsWith(`.`)&&t.length>1?t.slice(1).toLowerCase():`file`}function g(e){if(!e)return[];let t=e.split(`/`).filter(Boolean),n=[];for(let e=1;e<t.length;e++)n.push(t.slice(0,e).join(`/`));return n}function _(e){if(!e)return``;let t=e.lastIndexOf(`/`);return t>0?e.slice(0,t):``}function v(e,t=!1){return e.filter(e=>{let n=e.docName??e.path??``;return n===``?!1:t?!0:!o(n)})}function y(e){let t=e.trim();return{normalizedTarget:t.replace(/^\.\/+/,``).replace(/^\/+/,``).replace(/\/+$/g,``),expectsFolder:/\/+$/.test(t)}}function b(e){return u(e).replace(/\/+$/g,``)}function x(e){let t=new Set;for(let n of e)for(let e of g(n))t.add(e);return t}function S(e,n){if(!n)return;let r=t(e);if(r)return n.get(r)}function C(e,n){if(!n||e.includes(`/`))return;let r=t(e);if(r)return n.get(r)}function w(e,t){if(r(e)){let t=c(e);if(t?.kind===`reference`){let e=`references/${t.rel}.md`;return{kind:`skill-file`,target:`global/${t.name}/${e}`,scope:`global`,name:t.name,path:e}}let n=s(e);if(n?.kind===`skill`&&n.scope===`project`){let e=l(n.name);return{kind:`doc`,target:e,docName:e}}return{kind:`doc`,target:e,docName:e}}let a=i(e);if(a)return{kind:`doc`,target:a,docName:a};let{normalizedTarget:o,expectsFolder:u}=y(e);if(!o)return{kind:`missing`,target:o};if(!u&&n(o))return{kind:`doc`,target:o,docName:o};let d=b(e);if(!u&&t.pages.has(o))return{kind:`doc`,target:o,docName:o};if(!u&&d!==o&&t.pages.has(d))return{kind:`doc`,target:d,docName:d};if(!u){let e=S(d,t.pagesBySlug);if(e)return{kind:`doc`,target:e,docName:e}}let f=`${d}/index`;if(t.pages.has(f))return{kind:`folder-index`,target:d,folderPath:d,docName:f,noteKind:`canonical-index`};let p=d.split(`/`).pop(),m=p?`${d}/${p}`:null;if(m&&t.pages.has(m))return{kind:`folder-index`,target:d,folderPath:d,docName:m,noteKind:`legacy-folder-note`};if(!u){let e=C(d,t.pagesByBasename);if(e)return{kind:`doc`,target:e,docName:e}}return(t.folderPaths??x(t.pages)).has(d)?{kind:`folder`,target:d,folderPath:d}:{kind:`missing`,target:d||o}}function T(e){return e.kind===`folder-index`?{kind:`folder`,target:e.folderPath,folderPath:e.folderPath}:e}function E(t,n,r=e){return typeof n!=`number`||!a(n,r)?null:{kind:`large-file`,target:t,docName:t,size:n,limit:r}}function D(t,n,r=e){return t.kind!==`doc`&&t.kind!==`folder-index`?t:E(t.docName,n.get(t.docName)?.size,r)??t}function O(e){switch(e.kind){case`doc`:case`folder-index`:case`large-file`:return e.docName;case`missing`:return e.target;case`asset`:case`skill-file`:case`folder`:return null}}export{w as a,v as c,p as d,h as f,E as i,d as l,O as n,D as o,m as p,T as r,_ as s,x as t,f as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./repair-skills-C_l1phOf.mjs";export{e as repairSkills};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as e,f as t,y as n}from"./server-lock-iLcBw_q0-CdaRzkXM.mjs";export{t as markServerLockDraining,e as releaseServerLock,n as updateServerLockPort};
|
package/dist/src-BCVlEG7o.mjs
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
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-CdaRzkXM.mjs";import{Mr as a,Nr as o,Tn as s,ga as c,ii as l,pn as u,xn as d}from"./dist-DU6kAT_L.mjs";import{t as f}from"./esm-CsQUg9js.mjs";import"./gh-detect-C8cgnhPS.mjs";import{C as ee,D as p,M as m,N as h,S as te,d as g,j as _,k as v,w as y}from"./init-CxTuDUeq.mjs";import{_ as ne,d as re,i as ie,v as ae}from"./write-project-skill-BnCIY7g1.mjs";import"./loader-Dz99u1bW.mjs";import{c as oe}from"./colors-8SzMRIVy.mjs";import"./preview-Dbug2tNM.mjs";import{dirname as se,isAbsolute as b,join as x,relative as S,resolve as C}from"node:path";import{hostname as w}from"node:os";import{existsSync as T,lstatSync as E,readFileSync as D,readlinkSync as ce,rmSync as le,statSync as ue}from"node:fs";import{readFile as O,realpath as k}from"node:fs/promises";function A(e,a,o={}){let s=i(e,a);if(!T(s))return{status:`missing`,lockPath:s};let c;try{c=JSON.parse(D(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??w();return l.hostname===u?{status:`alive`,lockPath:s,lock:l}:{status:`foreign-host`,lockPath:s,lock:l}}function j(e){return e.replace(/:\d+$/,``)}function M(e){let t=e.trim();if(!t)return null;{let e=/^https?:\/\/([^/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`https`,hostname:j(e[1]),owner:e[2],name:e[3]}}{let e=/^ssh:\/\/(?:[\w.-]+@)?([^/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`ssh`,hostname:j(e[1]),owner:e[2],name:e[3]}}{let e=/^git:\/\/([^/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`git`,hostname:j(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 N(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 P(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 F(e){let t=N(e);if(t)return{kind:`doc`,...t};let n=P(e);return n?{kind:`folder`,...n}:null}const I=`# >>> open-knowledge cli >>>`,L=`# <<< open-knowledge cli <<<`,R=/^# >>> open-knowledge cli >>>\n[\s\S]*?^# <<< open-knowledge cli <<<\n?/m;function z(e){return x(e,`Library`,`Application Support`,`OpenKnowledge`,`path-install.json`)}const B={existsSync:e=>T(e),readFileSync:(e,t)=>D(e,t),lstatSync:e=>E(e),readlinkSync:e=>ce(e)};function V(e,t=B){let n=z(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 H(e){let t=e.replace(R,``);return{text:t,changed:t!==e,emptyAfter:t.trim()===``}}function U(e,t,n=B){try{return n.lstatSync(e).isSymbolicLink()?n.readlinkSync(e)===t:!1}catch{return!1}}function de(e){return ne(e)||ae(e)||v(e)}function fe(e,t,n,r){let i=g(e,t,n,r);if(i.kind===`absent`||i.kind===`no-entry`)return{kind:`not-present`};if(i.kind===`decline`)return{kind:`declined`,reason:i.reason};if(!de(i.entry))return{kind:`left-foreign`};let a;try{a=r??e.configPath(t,n)}catch{return{kind:`not-present`}}let o=e.serverName(t);return e.format===`file`?(le(a,{force:!0}),{kind:`removed`}):e.format===`toml`?me(a,o):pe(a,e.topLevelKey,e.serverMapSubKey,o)}function pe(e,t,n,r){let i;try{i=D(e,`utf-8`)}catch{return{kind:`declined`,reason:`unparseable`}}if(Buffer.byteLength(i,`utf-8`)>10485760)return{kind:`declined`,reason:`oversize`};let{text:a,changed:o}=h(i,ee(t,n,r));return o?(c(e,a,{mode:_(e)}),{kind:`removed`}):{kind:`not-present`}}function me(e,t){let n=p();if(n.backend===`fallback`)return{kind:`declined`,reason:`no-native-writer`};let r;try{r=D(e,`utf-8`)}catch{return{kind:`declined`,reason:`unparseable`}}let i=r.charCodeAt(0)===65279,a=i?r.slice(1):r,o=m(a),s=a.trim()===``||a.endsWith(`
|
|
2
|
-
`),l;try{l=n.removeEntry(a,t)}catch{return{kind:`declined`,reason:`unparseable`}}if(!l.existed)return{kind:`not-present`};let u=l.text;s?u.endsWith(`
|
|
3
|
-
`)||(u=`${u}\n`):u=u.replace(/\n+$/,``),o&&(u=u.replace(/\r\n/g,`
|
|
4
|
-
`).replace(/\n/g,`\r
|
|
5
|
-
`));let d=`${i?``:``}${u}`;return d!==r&&c(e,d,{mode:_(e)}),{kind:`removed`}}const he=new Set([`start`,`stop`,`status`,`clean`,`ui`,`mcp`,`preview`,`deinit`]);function ge(e,t,n=s){if(e!==void 0&&!he.has(e))return null;let r=n(t);return r===null||r.distance===0?null:r.rootPath}let W=null;function _e(e){W=e}function G(){return W??process.cwd()}var K=e(oe(),1);function ve(e){return e==null?!1:e.includes(`--type=utility`)&&e.includes(`--utility-sub-type=node.mojom.NodeService`)}function ye(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 be(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:d(r),command:r,isDesktop:ve(r)}}function xe(e){return e.ui==null?!1:e.ui.status===`alive`||e.ui.status===`foreign-host`}function q(e){let t=e.server.status;return t===`alive`||t===`foreign-host`?e.isDesktop?`desktop`:t===`alive`?`running`:`foreign`:t===`dead-pid`&&xe(e)?`ui-orphan`:`stale`}const Se=new Set([`running`,`desktop`,`foreign`,`ui-orphan`]);function Ce(e){switch(e){case`running`:return K.default.green(e);case`desktop`:return K.default.blue(e);case`foreign`:return K.default.cyan(e);case`ui-orphan`:return K.default.magenta(e);case`stale`:return K.default.yellow(e)}}function J(e){return e==null?`—`:`${e.cpuPercent.toFixed(1)}% / ${e.memPercent.toFixed(1)}%`}function we(e){return`${J(e.server.usage)} | ${J(e.ui?.usage??null)}`}function Te(e){return`${e.server.port===0?`(starting)`:String(e.server.port)} / ${e.ui==null||e.ui.status===`dead-pid`?`—`:String(e.ui.port)}`}function Ee(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=q(e),n=t===`ui-orphan`&&e.ui!=null?e.ui.pid:e.server.pid;return[e.directory,Te(e),we(e),t,String(n),ye(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=Ce(q(e))+` `.repeat(Math.max(0,(i[t]??0)-r.length))}o.push(n)}return o.join(` `).trimEnd()}),s=K.default.dim(`To stop a server: ok stop <port|pid|directory|all>`);return[a,...o,``,s].join(`
|
|
6
|
-
`)}async function Y(e={}){let t=e.discover??u,n=e.inspect??A,r=e.log??(e=>console.log(e)),i=e.resolveCommand??a,s=e.resolveUsage??o,c=await t(),l=[];for(let e of c){let t=n(e,`server`),r=n(e,`ui`),a=be(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&&l.push(a)}if(e.json){let e=l.map(e=>({...e,displayStatus:q(e)}));r(JSON.stringify(e,null,2));return}r(Ee(e.all?l:l.filter(e=>Se.has(q(e)))))}function De(){return new f(`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 Y({all:t.all===!0||e===`all`,json:t.json===!0})})}function Oe(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 X(e){let t=e.inspect??(t=>A(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=Oe(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 Z(e,t){return e.status===`alive`?!0:e.status===`foreign-host`?t(e.lock.pid):!1}async function ke(e,n=t){let r=await u(),i=null;for(let t of r){let r=A(t,`server`),a=A(t,`ui`);if(Z(r,n)&&r.lock.port===e||Z(a,n)&&a.lock.port===e)return t;i===null&&(Z(r,n)&&r.lock.pid===e||Z(a,n)&&a.lock.pid===e)&&(i=t)}return i}function Q(e){let t=X({lockDir:e});return t.failed.length>0&&(process.exitCode=1),t}function Ae(e){return new f(`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=X({lockDir:l(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 Y({});return}if(r===`all`){let e=await u();if(e.length===0){console.log(`No running open-knowledge servers found.`);return}let n=0;for(let r of e){let e=A(r,`server`),i=A(r,`ui`);!Z(e,t)&&!Z(i,t)||(Q(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 ke(e);if(t===null){console.log(`No running open-knowledge server found with port or PID ${e}.`);return}Q(t);return}Q(l(C(G(),r)))})}function je(e){return{event:`mcp-config-decline`,scope:e.scope,surface:e.surface,editorId:e.editorId,reason:e.reason}}async function Me(e,t){let n,r;try{n=await k(C(e)),r=await k(C(se(e)))}catch{return{kind:`not-git`}}if(!$(n,r))return{kind:`symlink-escape`};let i=x(n,`.git`),a;try{a=ue(i)}catch{return{kind:`not-git`}}let o;if(a.isDirectory()){let e;try{e=await k(i)}catch{return{kind:`not-git`}}if(!$(e,n))return{kind:`symlink-escape`};o=e}else if(a.isFile()){let e;try{e=await O(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=b(r)?r:C(n,r);try{o=await k(a)}catch{return{kind:`not-git`}}}else return{kind:`not-git`};let s=x(await Ne(o),`config`),c;try{c=await O(s,`utf-8`)}catch{return{kind:`not-git`}}let l=Fe(c);if(l===null)return{kind:`no-origin`};let u=M(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 Ne(e){let t;try{t=(await O(x(e,`commondir`),`utf-8`)).trim()}catch{return e}if(t.length===0)return e;let n=b(t)?t:C(e,t);try{return await k(n)}catch{return n}}function $(e,t){if(e===t)return!0;let n=S(t,e);return n.length>0&&!n.startsWith(`..`)&&!b(n)}function Pe(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 Fe(e){let t=!1;for(let n of e.split(/\r?\n/)){let e=Pe(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 Ie(r[1])}return null}function Ie(e){let t=e.trim();return t.startsWith(`"`)&&t.endsWith(`"`)||t.startsWith(`'`)&&t.endsWith(`'`)?t.slice(1,-1):t}const Le=[{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=y(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=ie(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 Re(e,t,n={},r=Le){let i=[];for(let a of t){let t=re[a];for(let a of r)i.push(a.write(t,e,n))}return i}function ze(e,t,n={}){return{integrations:Re(e,t,n),claudeLaunchJson:t.includes(`claude`)?te(e,n):void 0}}export{N as _,Ae as a,M as b,ge as c,R as d,L as f,H as g,V as h,X as i,fe as l,z as m,Me as n,De as o,U as p,je as r,_e as s,ze as t,I as u,F as v,A as x,P as y};
|
|
7
|
-
//# sourceMappingURL=src-BCVlEG7o.mjs.map
|
package/dist/start-B6YwIiZ5.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as e,f as t,r as n}from"./start-CLhScnKM.mjs";export{n as bootStartServer,t as resolveHost,e as startCommand};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import{It as e,S as t,an as n,wt as r}from"./server-lock-iLcBw_q0-CdaRzkXM.mjs";import{d as i,ei as a,ut as o}from"./dist-DU6kAT_L.mjs";import{basename as s,dirname as c,isAbsolute as ee,join as l,posix as u,relative as d,resolve as f,sep as p,win32 as m}from"node:path";import{homedir as h}from"node:os";import{cpSync as te,existsSync as g,lstatSync as _,mkdirSync as v,realpathSync as y,rmSync as b}from"node:fs";const x=t,S=r,C=e,w=`node`,T={MCP_DEBUG:`1`,OK_LOG_FILE:`/tmp/ok-mcp.log`},ne=`# ok-mcp-v1`,E=`# 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`,D=`# ok-mcp-win-v1`,O=`# 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`,k=`// ok-pi-bridge`,A=`${k}-v1`,j=`ok-pi-managed-extension`;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}if(t.command===`ok-pi-managed-extension`){if(!Array.isArray(t.args))return!1;let e=t.args[0];return typeof e==`string`&&e.startsWith(A)}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=f(e);if(s(t)===`cli.mjs`&&s(c(t))===`dist`)return t;let n=t.split(p),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 l(i.length===0?p:i.join(p),`packages`,`cli`,`dist`,`cli.mjs`)}function P(e={}){return e.mode===`dev`?{command:w,args:[N(),`mcp`],env:{...T}}:(e.platformName??process.platform)===`win32`?{command:`powershell`,args:[`-NoProfile`,`-NonInteractive`,`-Command`,O]}:{command:`/bin/sh`,args:[`-l`,`-c`,E]}}function re(e={}){return e.mode===`dev`?{type:`local`,enabled:!0,command:[w,N(),`mcp`],environment:{...T}}:(e.platformName??process.platform)===`win32`?{type:`local`,enabled:!0,command:[`powershell`,`-NoProfile`,`-NonInteractive`,`-Command`,O]}:{type:`local`,enabled:!0,command:[`/bin/sh`,`-l`,`-c`,E]}}function ie(e){if(typeof e!=`object`||!e)return!1;let t=e;return F(t,P({mode:`published`,platformName:`darwin`}))||F(t,P({mode:`published`,platformName:`win32`}))}function F(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 I(e){return e===`win32`?m:u}function ae(e={}){let t=e.platformName??process.platform,n=e.home??h(),r=e.env??process.env,i=I(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 L(e={}){let t=e.platformName??process.platform,n=e.home??h();return I(t).join(n,`.claude.json`)}function R(e={}){let t=e.platformName??process.platform,n=e.home??h(),r=e.env??process.env;if(t===`darwin`)return u.join(n,`Library`,`Application Support`,`Claude`,`claude_desktop_config.json`);if(t===`win32`){let e=r.APPDATA??m.join(n,`AppData`,`Roaming`);return m.join(e,`Claude`,`claude_desktop_config.json`)}throw Error(`Claude Desktop is not available on ${t}. Supported: macOS, Windows.`)}function z(e={}){let t=e.platformName??process.platform,n=e.home??h();return I(t).join(n,`.cursor`,`mcp.json`)}function B(e={}){let t=e.platformName??process.platform,n=e.home??h();return(e.env??process.env).CODEX_HOME??I(t).join(n,`.codex`)}function V(e={}){return I(e.platformName??process.platform).join(B(e),`config.toml`)}function H(e={}){let t=e.platformName??process.platform,n=e.home??h(),r=e.env??process.env,i=I(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 U(e={}){return I(e.platformName??process.platform).join(H(e),`opencode.json`)}function W(e={}){let t=e.platformName??process.platform,n=e.home??h();return I(t).join(n,`.openclaw`,`openclaw.json`)}function G(e={}){let t=e.platformName??process.platform,n=e.home??h();return(e.env??process.env).PI_CODING_AGENT_DIR??I(t).join(n,`.pi`,`agent`)}function K(e={}){let t=e.platformName??process.platform,n=e.home??h();return I(t).join(n,`.gemini`,`config`,`mcp_config.json`)}function q(e,t){let n=I(t),r=n.join(e,`.lmstudio`,`mcp.json`),i=n.join(e,`.cache`,`lm-studio`,`mcp.json`);return t===`darwin`?[i,r]:[r,i]}function J(e={}){let t=e.platformName??process.platform,n=q(e.home??h(),t);return n.find(e=>g(e))||n.find(e=>g(c(e)))||n[0]}const Y={claude:{id:`claude`,label:S.claude,configPath:(e,t)=>L({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>n,buildEntry:(e,t)=>P(t),scope:`global`,detectPath:(e,t)=>l(t??h(),`.claude`),projectConfigPath:e=>l(e,`.mcp.json`),projectSkillPath:e=>l(e,`.claude`,`skills`,`open-knowledge`,`SKILL.md`)},"claude-desktop":{id:`claude-desktop`,label:S[`claude-desktop`],configPath:(e,t)=>R({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>n,buildEntry:(e,t)=>P(t),scope:`global`,detectPath:(e,t)=>c(R({home:t}))},cursor:{id:`cursor`,label:S.cursor,configPath:(e,t)=>z({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>n,buildEntry:(e,t)=>P(t),scope:`global`,detectPath:(e,t)=>c(z({home:t})),projectConfigPath:e=>l(e,`.cursor`,`mcp.json`),projectSkillPath:e=>l(e,`.cursor`,`skills`,`open-knowledge`,`SKILL.md`)},codex:{id:`codex`,label:S.codex,configPath:(e,t)=>V({home:t}),format:`toml`,topLevelKey:`mcp_servers`,serverName:()=>n,buildEntry:(e,t)=>P(t),scope:`global`,detectPath:(e,t)=>c(V({home:t})),projectConfigPath:e=>l(e,`.codex`,`config.toml`),projectSkillPath:e=>l(e,`.codex`,`skills`,`open-knowledge`,`SKILL.md`)},opencode:{id:`opencode`,label:S.opencode,configPath:(e,t)=>U({home:t}),format:`json`,topLevelKey:`mcp`,serverName:()=>n,buildEntry:(e,t)=>re(t),scope:`global`,detectPath:(e,t)=>c(U({home:t})),projectConfigPath:e=>l(e,`opencode.json`),projectSkillPath:e=>l(e,`.opencode`,`skills`,`open-knowledge`,`SKILL.md`)},openclaw:{id:`openclaw`,label:S.openclaw,configPath:(e,t)=>W({home:t}),format:`json`,topLevelKey:`mcp`,serverMapSubKey:`servers`,serverName:()=>n,buildEntry:(e,t)=>P(t),scope:`global`,detectPath:(e,t)=>l(t??h(),`.openclaw`),offerOnlyWhenDetected:!0},pi:{id:`pi`,label:S.pi,configPath:()=>{throw Error("Pi has no user-global MCP config; OK's integration is the project-scoped bridge extension at .pi/extensions/open-knowledge.ts (run `ok init` in the project).")},format:`file`,topLevelKey:`mcpServers`,serverName:()=>n,buildEntry:()=>{throw Error(`Pi has no MCP entry shape; the managed bridge file is built by buildPiExtensionSource (integrations/pi-extension.ts).`)},scope:`project`,detectPath:(e,t)=>G({home:t}),projectConfigPath:e=>l(e,`.pi`,`extensions`,`open-knowledge.ts`),projectSkillPath:e=>l(e,`.pi`,`skills`,`open-knowledge`,`SKILL.md`)},antigravity:{id:`antigravity`,label:S.antigravity,configPath:(e,t)=>K({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>n,buildEntry:(e,t)=>P(t),scope:`global`,detectPath:(e,t)=>l(t??h(),`.gemini`),offerOnlyWhenDetected:!0},"lm-studio":{id:`lm-studio`,label:S[`lm-studio`],configPath:(e,t)=>J({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>n,buildEntry:(e,t)=>P(t),scope:`global`,detectPath:(e,t)=>c(J({home:t})),offerOnlyWhenDetected:!0}};function oe(e){let t=e.filter(e=>!Object.hasOwn(Y,e));if(t.length>0)throw Error(`Unknown editor(s): ${t.join(`, `)}. Valid options: ${x.join(`, `)}`);return e.map(e=>Y[e])}function X(e){let t=[];for(let n of o){let r=i[n];t.push({path:l(e,`.agents`,`skills`,r),bundleId:n,scope:`central`});for(let i of C)t.push({path:l(e,i.hostDir,`skills`,r),bundleId:n,scope:`host`,hostDir:i.hostDir})}return t}function se(e,t){let n=[];for(let r of X(e))if(r.bundleId===t)try{b(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 Z(e,t){let n;try{n=_(e)}catch(e){if(e.code!==`ENOENT`)throw e}if(n?.isSymbolicLink())throw Error(`Refusing to write through a symbolic link at ${e}. Remove the symlink and re-run project setup.`);$(e,t)}function Q(e,t){$(e,t)}function $(e,t){let n;try{n=y(t)}catch{n=f(t)}let r=c(e);for(;r.length>1&&r!==p;){let t;try{t=y(r)}catch(e){if(e.code===`ENOENT`){r=c(r);continue}throw e}let i=d(n,t);if(i===``||!i.startsWith(`..`)&&!ee(i))return;throw Error(`Refusing to write at ${e}: ancestor ${r} resolves to ${t}, which is outside the project directory ${n}. A symbolic link in the path likely escapes the project. Remove the symlink and re-run project setup.`)}}function ce(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);Z(i,t);let o=g(n)?`overwritten`:`written`;return b(i,{recursive:!0,force:!0}),v(c(i),{recursive:!0}),te(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)}}}function le(e,t){let n=e.projectSkillPath?.(t);if(!n)return{editorId:e.id,label:e.label,action:`skipped-unsupported`,path:``};try{let r=c(n);return g(n)?(Q(r,t),b(r,{recursive:!0,force:!0}),{editorId:e.id,label:e.label,action:`removed`,path:n}):{editorId:e.id,label:e.label,action:`not-present`,path:n}}catch(t){return{editorId:e.id,label:e.label,action:`failed`,path:n,error:t instanceof Error?t.message:String(t)}}}export{M as _,se as a,N as b,ne as c,Y as d,C as f,P as g,j as h,ce as i,D as l,A as m,Q as n,X as o,k as p,le as r,x as s,Z as t,S as u,ie as v,oe as x,ae as y};
|
|
36
|
-
//# sourceMappingURL=write-project-skill-BnCIY7g1.mjs.map
|