@inkeep/open-knowledge 0.0.0-dev-20260424071819 → 0.0.0-dev-20260424150009
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/open-knowledge/SKILL.md +228 -0
- package/dist/{banner-cxbl_Ely.mjs → banner-CI3--er0.mjs} +2 -2
- package/dist/{chokidar-C6yIgAJZ.mjs → chokidar-Z9-8o-jG.mjs} +1 -1
- package/dist/cli.mjs +348 -274
- package/dist/colors-Cmha5EZJ.mjs +2 -0
- package/dist/colors-CxLEz90E.mjs +1 -0
- package/dist/constants-QFqPbiZ7.mjs +2 -0
- package/dist/{execAsync-DPeftusp.mjs → execAsync-CUbOIvpN.mjs} +1 -1
- package/dist/{execAsync-DhDvXMWQ.mjs → execAsync-CjzNx_Wg.mjs} +1 -1
- package/dist/{execAsync-RJZP-H-A.mjs → execAsync-xymjJFLm.mjs} +1 -1
- package/dist/{getMachineId-bsd-DcLiB1Fb.mjs → getMachineId-bsd-B_JlAoG9.mjs} +2 -2
- package/dist/{getMachineId-bsd-B-D2bOSl.mjs → getMachineId-bsd-CMAUw13R.mjs} +2 -2
- package/dist/{getMachineId-bsd-Dl-xGqjV.mjs → getMachineId-bsd-DrOrzTD2.mjs} +2 -2
- package/dist/{getMachineId-darwin-A7Xy885j.mjs → getMachineId-darwin-BQcf5peQ.mjs} +2 -2
- package/dist/{getMachineId-darwin-BQro2RrT.mjs → getMachineId-darwin-DC2qb-xd.mjs} +2 -2
- package/dist/{getMachineId-darwin-DPoYqu2E.mjs → getMachineId-darwin-DTGIdpu7.mjs} +2 -2
- package/dist/{getMachineId-linux-BwDCbiIf.mjs → getMachineId-linux-C3A6DqVu.mjs} +1 -1
- package/dist/{getMachineId-linux-DLyT3DBf.mjs → getMachineId-linux-CMta7vmz.mjs} +1 -1
- package/dist/{getMachineId-linux-B6DWkXLm.mjs → getMachineId-linux-nez-pYOw.mjs} +1 -1
- package/dist/{getMachineId-unsupported-CnUw0N-q.mjs → getMachineId-unsupported-BrxgPAkN.mjs} +1 -1
- package/dist/{getMachineId-unsupported-VfwZ1yF9.mjs → getMachineId-unsupported-gFGrtRr7.mjs} +1 -1
- package/dist/{getMachineId-unsupported-CQbaY6vv.mjs → getMachineId-unsupported-j-7WDfTT.mjs} +1 -1
- package/dist/{getMachineId-win-Bmzw0GhO.mjs → getMachineId-win-CfF1zVez.mjs} +2 -2
- package/dist/{getMachineId-win-DHI6zfnJ.mjs → getMachineId-win-D8Js6D_D.mjs} +2 -2
- package/dist/{getMachineId-win-BYymgu0m.mjs → getMachineId-win-DsIEIIis.mjs} +2 -2
- package/dist/index.d.mts +0 -7
- package/dist/index.mjs +1 -1
- package/dist/init-Bw4LWW1o.mjs +1 -0
- package/dist/init-D0FupYPY.mjs +1 -0
- package/dist/init-D2rQPwU1.mjs +120 -0
- package/dist/init-DUIYyxaK.mjs +5 -0
- package/dist/{is-object-DVVYT5oa.mjs → is-object-7k010cEq.mjs} +1 -1
- package/dist/{keepalive-BqSeN73F.mjs → keepalive-CfaIYv9f.mjs} +1 -1
- package/dist/{loader-C-EaZX2e.mjs → loader-C3Wwbx8H.mjs} +2 -2
- package/dist/loader-DNeW8gS5.mjs +1 -0
- package/dist/{paths-BPoLusOz.mjs → paths-Ba3tNHQr.mjs} +2 -2
- package/dist/paths-ORyeejxG.mjs +1 -0
- package/dist/preview-BR34uHnQ.mjs +1 -0
- package/dist/{preview-T_RVYqtF.mjs → preview-QLsD0vVK.mjs} +2 -2
- package/dist/public/assets/McpConsentDialogBody-BpxsNx0A.js +1 -0
- package/dist/public/assets/index-Bnp3jcJM.js +27 -0
- package/dist/public/assets/index-tR5M38z1.css +1 -0
- package/dist/public/index.html +2 -2
- package/dist/src-CeiyJxyd.mjs +1 -0
- package/dist/{src-DQq7h88V.mjs → src-DIoA15kL.mjs} +25 -8
- package/dist/src-lFQj9tkB.mjs +1 -0
- package/dist/start-B9LXLMio.mjs +1 -0
- package/dist/{start-B84Wdu83.mjs → start-C79L5QTe.mjs} +2 -2
- package/dist/{wrapper-DhAZwCvI.mjs → wrapper-BlhyhsXg.mjs} +1 -1
- package/package.json +6 -2
- package/scripts/postinstall.mjs +53 -0
- package/scripts/probe-exec.ts +100 -0
- package/scripts/probe-read-document.ts +111 -0
- package/dist/colors-CDmFQ1jq.mjs +0 -1
- package/dist/colors-CEQEtnHQ.mjs +0 -2
- package/dist/constants-CXDXntb9.mjs +0 -2
- package/dist/init-BBVwEA2N.mjs +0 -5
- package/dist/init-DsXM9hPp.mjs +0 -1
- package/dist/init-DvES_bXI.mjs +0 -1
- package/dist/init-QQvPB0Au.mjs +0 -230
- package/dist/loader-Ck-HQgHI.mjs +0 -1
- package/dist/paths-B483looM.mjs +0 -1
- package/dist/preview-C5sfPOVh.mjs +0 -1
- package/dist/public/assets/McpConsentDialogBody-Dg7gdIrj.js +0 -1
- package/dist/public/assets/index-B33JcCrk.js +0 -27
- package/dist/public/assets/index-Cj5uVVs3.css +0 -1
- package/dist/src-DN3CCqaD.mjs +0 -1
- package/dist/src-DuGm387u.mjs +0 -1
- package/dist/start-h-f1SVhW.mjs +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import e from"picocolors";const t=t=>e.red(t),n=t=>e.yellow(t),r=t=>e.green(t),i=t=>e.cyan(t),a=t=>e.gray(t),o=t=>e.bold(t);function s(t,n){return e.isColorSupported?`\u001B]8;;${n}\u0007${t}\u001B]8;;\u0007`:t}export{s as a,i,a as n,r as o,t as r,n as s,o as t};
|
|
2
|
+
//# sourceMappingURL=colors-Cmha5EZJ.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,n as t,r as n,s as r}from"./colors-Cmha5EZJ.mjs";export{t as dim,n as error,e as info,r as warning};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{i as e,t}from"./chunk-FK9Q3tQk.mjs";var n=t((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.execAsync=void 0;let n=e(`child_process`);t.execAsync=e(`util`).promisify(n.exec)}));export{n as t};
|
|
2
|
-
//# sourceMappingURL=execAsync-
|
|
2
|
+
//# sourceMappingURL=execAsync-CUbOIvpN.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{i as e,t}from"./chunk-FK9Q3tQk.mjs";var n=t((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.execAsync=void 0;let n=e(`child_process`);t.execAsync=e(`util`).promisify(n.exec)}));export{n as t};
|
|
2
|
-
//# sourceMappingURL=execAsync-
|
|
2
|
+
//# sourceMappingURL=execAsync-CjzNx_Wg.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{i as e,t}from"./chunk-FK9Q3tQk.mjs";var n=t((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.execAsync=void 0;let n=e(`child_process`);t.execAsync=e(`util`).promisify(n.exec)}));export{n as t};
|
|
2
|
-
//# sourceMappingURL=execAsync-
|
|
2
|
+
//# sourceMappingURL=execAsync-xymjJFLm.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,i as t,t as n}from"./chunk-FK9Q3tQk.mjs";import{n as r,t as i}from"./esm-BbkJd7ro.mjs";import{t as a}from"./execAsync-
|
|
2
|
-
//# sourceMappingURL=getMachineId-bsd-
|
|
1
|
+
import{a as e,i as t,t as n}from"./chunk-FK9Q3tQk.mjs";import{n as r,t as i}from"./esm-BbkJd7ro.mjs";import{t as a}from"./execAsync-CUbOIvpN.mjs";var o=n((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.getMachineId=void 0;let o=t(`fs`),s=a(),c=(r(),e(i));async function l(){try{return(await o.promises.readFile(`/etc/hostid`,{encoding:`utf8`})).trim()}catch(e){c.diag.debug(`error reading machine id: ${e}`)}try{return(await(0,s.execAsync)(`kenv -q smbios.system.uuid`)).stdout.trim()}catch(e){c.diag.debug(`error reading machine id: ${e}`)}}n.getMachineId=l}));export default o();export{};
|
|
2
|
+
//# sourceMappingURL=getMachineId-bsd-B_JlAoG9.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,i as t,t as n}from"./chunk-FK9Q3tQk.mjs";import{n as r,t as i}from"./esm-BbkJd7ro.mjs";import{t as a}from"./execAsync-
|
|
2
|
-
//# sourceMappingURL=getMachineId-bsd-
|
|
1
|
+
import{a as e,i as t,t as n}from"./chunk-FK9Q3tQk.mjs";import{n as r,t as i}from"./esm-BbkJd7ro.mjs";import{t as a}from"./execAsync-CjzNx_Wg.mjs";var o=n((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.getMachineId=void 0;let o=t(`fs`),s=a(),c=(r(),e(i));async function l(){try{return(await o.promises.readFile(`/etc/hostid`,{encoding:`utf8`})).trim()}catch(e){c.diag.debug(`error reading machine id: ${e}`)}try{return(await(0,s.execAsync)(`kenv -q smbios.system.uuid`)).stdout.trim()}catch(e){c.diag.debug(`error reading machine id: ${e}`)}}n.getMachineId=l}));export default o();export{};
|
|
2
|
+
//# sourceMappingURL=getMachineId-bsd-CMAUw13R.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,i as t,t as n}from"./chunk-FK9Q3tQk.mjs";import{n as r,t as i}from"./esm-BbkJd7ro.mjs";import{t as a}from"./execAsync-
|
|
2
|
-
//# sourceMappingURL=getMachineId-bsd-
|
|
1
|
+
import{a as e,i as t,t as n}from"./chunk-FK9Q3tQk.mjs";import{n as r,t as i}from"./esm-BbkJd7ro.mjs";import{t as a}from"./execAsync-xymjJFLm.mjs";var o=n((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.getMachineId=void 0;let o=t(`fs`),s=a(),c=(r(),e(i));async function l(){try{return(await o.promises.readFile(`/etc/hostid`,{encoding:`utf8`})).trim()}catch(e){c.diag.debug(`error reading machine id: ${e}`)}try{return(await(0,s.execAsync)(`kenv -q smbios.system.uuid`)).stdout.trim()}catch(e){c.diag.debug(`error reading machine id: ${e}`)}}n.getMachineId=l}));export default o();export{};
|
|
2
|
+
//# sourceMappingURL=getMachineId-bsd-DrOrzTD2.mjs.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as e,t}from"./chunk-FK9Q3tQk.mjs";import{n,t as r}from"./esm-BbkJd7ro.mjs";import{t as i}from"./execAsync-
|
|
1
|
+
import{a as e,t}from"./chunk-FK9Q3tQk.mjs";import{n,t as r}from"./esm-BbkJd7ro.mjs";import{t as i}from"./execAsync-CjzNx_Wg.mjs";var a=t((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.getMachineId=void 0;let a=i(),o=(n(),e(r));async function s(){try{let e=(await(0,a.execAsync)(`ioreg -rd1 -c "IOPlatformExpertDevice"`)).stdout.split(`
|
|
2
2
|
`).find(e=>e.includes(`IOPlatformUUID`));if(!e)return;let t=e.split(`" = "`);if(t.length===2)return t[1].slice(0,-1)}catch(e){o.diag.debug(`error reading machine id: ${e}`)}}t.getMachineId=s}));export default a();export{};
|
|
3
|
-
//# sourceMappingURL=getMachineId-darwin-
|
|
3
|
+
//# sourceMappingURL=getMachineId-darwin-BQcf5peQ.mjs.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as e,t}from"./chunk-FK9Q3tQk.mjs";import{n,t as r}from"./esm-BbkJd7ro.mjs";import{t as i}from"./execAsync-
|
|
1
|
+
import{a as e,t}from"./chunk-FK9Q3tQk.mjs";import{n,t as r}from"./esm-BbkJd7ro.mjs";import{t as i}from"./execAsync-xymjJFLm.mjs";var a=t((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.getMachineId=void 0;let a=i(),o=(n(),e(r));async function s(){try{let e=(await(0,a.execAsync)(`ioreg -rd1 -c "IOPlatformExpertDevice"`)).stdout.split(`
|
|
2
2
|
`).find(e=>e.includes(`IOPlatformUUID`));if(!e)return;let t=e.split(`" = "`);if(t.length===2)return t[1].slice(0,-1)}catch(e){o.diag.debug(`error reading machine id: ${e}`)}}t.getMachineId=s}));export default a();export{};
|
|
3
|
-
//# sourceMappingURL=getMachineId-darwin-
|
|
3
|
+
//# sourceMappingURL=getMachineId-darwin-DC2qb-xd.mjs.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as e,t}from"./chunk-FK9Q3tQk.mjs";import{n,t as r}from"./esm-BbkJd7ro.mjs";import{t as i}from"./execAsync-
|
|
1
|
+
import{a as e,t}from"./chunk-FK9Q3tQk.mjs";import{n,t as r}from"./esm-BbkJd7ro.mjs";import{t as i}from"./execAsync-CUbOIvpN.mjs";var a=t((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.getMachineId=void 0;let a=i(),o=(n(),e(r));async function s(){try{let e=(await(0,a.execAsync)(`ioreg -rd1 -c "IOPlatformExpertDevice"`)).stdout.split(`
|
|
2
2
|
`).find(e=>e.includes(`IOPlatformUUID`));if(!e)return;let t=e.split(`" = "`);if(t.length===2)return t[1].slice(0,-1)}catch(e){o.diag.debug(`error reading machine id: ${e}`)}}t.getMachineId=s}));export default a();export{};
|
|
3
|
-
//# sourceMappingURL=getMachineId-darwin-
|
|
3
|
+
//# sourceMappingURL=getMachineId-darwin-DTGIdpu7.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{a as e,i as t,t as n}from"./chunk-FK9Q3tQk.mjs";import{n as r,t as i}from"./esm-BbkJd7ro.mjs";var a=n((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.getMachineId=void 0;let a=t(`fs`),o=(r(),e(i));async function s(){for(let e of[`/etc/machine-id`,`/var/lib/dbus/machine-id`])try{return(await a.promises.readFile(e,{encoding:`utf8`})).trim()}catch(e){o.diag.debug(`error reading machine id: ${e}`)}}n.getMachineId=s}));export default a();export{};
|
|
2
|
-
//# sourceMappingURL=getMachineId-linux-
|
|
2
|
+
//# sourceMappingURL=getMachineId-linux-C3A6DqVu.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{a as e,i as t,t as n}from"./chunk-FK9Q3tQk.mjs";import{n as r,t as i}from"./esm-BbkJd7ro.mjs";var a=n((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.getMachineId=void 0;let a=t(`fs`),o=(r(),e(i));async function s(){for(let e of[`/etc/machine-id`,`/var/lib/dbus/machine-id`])try{return(await a.promises.readFile(e,{encoding:`utf8`})).trim()}catch(e){o.diag.debug(`error reading machine id: ${e}`)}}n.getMachineId=s}));export default a();export{};
|
|
2
|
-
//# sourceMappingURL=getMachineId-linux-
|
|
2
|
+
//# sourceMappingURL=getMachineId-linux-CMta7vmz.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{a as e,i as t,t as n}from"./chunk-FK9Q3tQk.mjs";import{n as r,t as i}from"./esm-BbkJd7ro.mjs";var a=n((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.getMachineId=void 0;let a=t(`fs`),o=(r(),e(i));async function s(){for(let e of[`/etc/machine-id`,`/var/lib/dbus/machine-id`])try{return(await a.promises.readFile(e,{encoding:`utf8`})).trim()}catch(e){o.diag.debug(`error reading machine id: ${e}`)}}n.getMachineId=s}));export default a();export{};
|
|
2
|
-
//# sourceMappingURL=getMachineId-linux-
|
|
2
|
+
//# sourceMappingURL=getMachineId-linux-nez-pYOw.mjs.map
|
package/dist/{getMachineId-unsupported-CnUw0N-q.mjs → getMachineId-unsupported-BrxgPAkN.mjs}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{a as e,t}from"./chunk-FK9Q3tQk.mjs";import{n,t as r}from"./esm-BbkJd7ro.mjs";var i=t((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.getMachineId=void 0;let i=(n(),e(r));async function a(){i.diag.debug(`could not read machine-id: unsupported platform`)}t.getMachineId=a}));export default i();export{};
|
|
2
|
-
//# sourceMappingURL=getMachineId-unsupported-
|
|
2
|
+
//# sourceMappingURL=getMachineId-unsupported-BrxgPAkN.mjs.map
|
package/dist/{getMachineId-unsupported-VfwZ1yF9.mjs → getMachineId-unsupported-gFGrtRr7.mjs}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{a as e,t}from"./chunk-FK9Q3tQk.mjs";import{n,t as r}from"./esm-BbkJd7ro.mjs";var i=t((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.getMachineId=void 0;let i=(n(),e(r));async function a(){i.diag.debug(`could not read machine-id: unsupported platform`)}t.getMachineId=a}));export default i();export{};
|
|
2
|
-
//# sourceMappingURL=getMachineId-unsupported-
|
|
2
|
+
//# sourceMappingURL=getMachineId-unsupported-gFGrtRr7.mjs.map
|
package/dist/{getMachineId-unsupported-CQbaY6vv.mjs → getMachineId-unsupported-j-7WDfTT.mjs}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{a as e,t}from"./chunk-FK9Q3tQk.mjs";import{n,t as r}from"./esm-BbkJd7ro.mjs";var i=t((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.getMachineId=void 0;let i=(n(),e(r));async function a(){i.diag.debug(`could not read machine-id: unsupported platform`)}t.getMachineId=a}));export default i();export{};
|
|
2
|
-
//# sourceMappingURL=getMachineId-unsupported-
|
|
2
|
+
//# sourceMappingURL=getMachineId-unsupported-j-7WDfTT.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,i as t,t as n}from"./chunk-FK9Q3tQk.mjs";import{n as r,t as i}from"./esm-BbkJd7ro.mjs";import{t as a}from"./execAsync-
|
|
2
|
-
//# sourceMappingURL=getMachineId-win-
|
|
1
|
+
import{a as e,i as t,t as n}from"./chunk-FK9Q3tQk.mjs";import{n as r,t as i}from"./esm-BbkJd7ro.mjs";import{t as a}from"./execAsync-CjzNx_Wg.mjs";var o=n((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.getMachineId=void 0;let o=t(`process`),s=a(),c=(r(),e(i));async function l(){let e=`%windir%\\System32\\REG.exe`;o.arch===`ia32`&&`PROCESSOR_ARCHITEW6432`in o.env&&(e=`%windir%\\sysnative\\cmd.exe /c `+e);try{let t=(await(0,s.execAsync)(`${e} QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid`)).stdout.split(`REG_SZ`);if(t.length===2)return t[1].trim()}catch(e){c.diag.debug(`error reading machine id: ${e}`)}}n.getMachineId=l}));export default o();export{};
|
|
2
|
+
//# sourceMappingURL=getMachineId-win-CfF1zVez.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,i as t,t as n}from"./chunk-FK9Q3tQk.mjs";import{n as r,t as i}from"./esm-BbkJd7ro.mjs";import{t as a}from"./execAsync-
|
|
2
|
-
//# sourceMappingURL=getMachineId-win-
|
|
1
|
+
import{a as e,i as t,t as n}from"./chunk-FK9Q3tQk.mjs";import{n as r,t as i}from"./esm-BbkJd7ro.mjs";import{t as a}from"./execAsync-xymjJFLm.mjs";var o=n((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.getMachineId=void 0;let o=t(`process`),s=a(),c=(r(),e(i));async function l(){let e=`%windir%\\System32\\REG.exe`;o.arch===`ia32`&&`PROCESSOR_ARCHITEW6432`in o.env&&(e=`%windir%\\sysnative\\cmd.exe /c `+e);try{let t=(await(0,s.execAsync)(`${e} QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid`)).stdout.split(`REG_SZ`);if(t.length===2)return t[1].trim()}catch(e){c.diag.debug(`error reading machine id: ${e}`)}}n.getMachineId=l}));export default o();export{};
|
|
2
|
+
//# sourceMappingURL=getMachineId-win-D8Js6D_D.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,i as t,t as n}from"./chunk-FK9Q3tQk.mjs";import{n as r,t as i}from"./esm-BbkJd7ro.mjs";import{t as a}from"./execAsync-
|
|
2
|
-
//# sourceMappingURL=getMachineId-win-
|
|
1
|
+
import{a as e,i as t,t as n}from"./chunk-FK9Q3tQk.mjs";import{n as r,t as i}from"./esm-BbkJd7ro.mjs";import{t as a}from"./execAsync-CUbOIvpN.mjs";var o=n((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.getMachineId=void 0;let o=t(`process`),s=a(),c=(r(),e(i));async function l(){let e=`%windir%\\System32\\REG.exe`;o.arch===`ia32`&&`PROCESSOR_ARCHITEW6432`in o.env&&(e=`%windir%\\sysnative\\cmd.exe /c `+e);try{let t=(await(0,s.execAsync)(`${e} QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid`)).stdout.split(`REG_SZ`);if(t.length===2)return t[1].trim()}catch(e){c.diag.debug(`error reading machine id: ${e}`)}}n.getMachineId=l}));export default o();export{};
|
|
2
|
+
//# sourceMappingURL=getMachineId-win-DsIEIIis.mjs.map
|
package/dist/index.d.mts
CHANGED
|
@@ -55,13 +55,6 @@ interface EditorMcpTarget {
|
|
|
55
55
|
detectPath?: (cwd: string, home?: string) => string;
|
|
56
56
|
/** Legacy project-local MCP config path from pre-global installs, if any. */
|
|
57
57
|
legacyProjectConfigPath?: (cwd: string) => string;
|
|
58
|
-
/**
|
|
59
|
-
* Project-local agent instruction file to inject the Open Knowledge section
|
|
60
|
-
* into, if any. Claude reads CLAUDE.md; every other editor picks up the
|
|
61
|
-
* tool-agnostic root AGENTS.md which `open-knowledge init` always writes.
|
|
62
|
-
* Only declared for editors that can't read AGENTS.md directly.
|
|
63
|
-
*/
|
|
64
|
-
instructionsPath?: (cwd: string) => string;
|
|
65
58
|
}
|
|
66
59
|
declare const EDITOR_TARGETS: Record<EditorId, EditorMcpTarget>;
|
|
67
60
|
//#endregion
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e,i as t,l as n,o as r,s as i,t as a}from"./init-
|
|
1
|
+
import{c as e,i as t,l as n,o as r,s as i,t as a}from"./init-DUIYyxaK.mjs";import{n as o,r as s}from"./loader-C3Wwbx8H.mjs";import"./src-CeiyJxyd.mjs";export{e as ALL_EDITOR_IDS,s as ConfigSchema,n as EDITOR_TARGETS,a as detectInstalledEditors,o as loadConfig,t as readExistingMcpEntry,r as writeEditorMcpConfig,i as writeUserMcpConfigs};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,i as t,n,o as r,r as i,s as a,t as o}from"./init-DUIYyxaK.mjs";export{o as detectInstalledEditors,n as formatInitResult,i as initCommand,t as readExistingMcpEntry,e as runInit,r as writeEditorMcpConfig,a as writeUserMcpConfigs};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./init-D2rQPwU1.mjs";export{t as ensureOkGitignoredAtRoot,e as initContent};
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import{n as e,t}from"./constants-QFqPbiZ7.mjs";import{O as n}from"./src-CB-sXsMW.mjs";import{existsSync as r,mkdirSync as i,readFileSync as a,writeFileSync as o}from"node:fs";import{join as s,resolve as c}from"node:path";const l=`# Open Knowledge — workspace configuration
|
|
2
|
+
#
|
|
3
|
+
# This file overrides built-in defaults for this workspace. Every key below
|
|
4
|
+
# is commented out and shows its current default value. Uncomment any key
|
|
5
|
+
# to override it.
|
|
6
|
+
#
|
|
7
|
+
# Precedence (lowest -> highest):
|
|
8
|
+
# Built-in defaults
|
|
9
|
+
# -> ~/${n}/config.yml (user defaults)
|
|
10
|
+
# -> ./${n}/config.yml (this file)
|
|
11
|
+
#
|
|
12
|
+
# Schema reference: packages/cli/src/config/schema.ts
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
# --- Content ---------------------------------------------------------------
|
|
16
|
+
# dir: where the CRDT editor reads/writes documents. Relative to the project
|
|
17
|
+
# root (the directory containing ${n}/), NOT to this file.
|
|
18
|
+
#
|
|
19
|
+
# include/exclude: glob patterns for tracked content files. Relative to the
|
|
20
|
+
# content directory (content.dir).
|
|
21
|
+
#
|
|
22
|
+
# content:
|
|
23
|
+
# dir: .
|
|
24
|
+
# include:
|
|
25
|
+
# - "**/*.md"
|
|
26
|
+
# exclude: []
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
# --- Suggested lifecycle (optional pattern) --------------------------------
|
|
30
|
+
# Projects that want an explicit knowledge-maturation flow can organize as
|
|
31
|
+
# three tiers *relative to the content directory* — create the subfolders
|
|
32
|
+
# only when you need them:
|
|
33
|
+
#
|
|
34
|
+
# 1. external-sources/ — raw content fetched from URLs, PDFs. No analysis,
|
|
35
|
+
# just preservation. Use the \`ingest\` MCP tool.
|
|
36
|
+
# 2. research/ — analysis and synthesis. Provisional findings,
|
|
37
|
+
# trade-offs, open questions. Use the \`research\`
|
|
38
|
+
# MCP tool.
|
|
39
|
+
# 3. articles/ — canonical knowledge. Use the \`consolidate\` MCP
|
|
40
|
+
# tool to promote research -> articles once
|
|
41
|
+
# decisions are made.
|
|
42
|
+
#
|
|
43
|
+
# This is a pattern, not a requirement. Projects with existing layouts
|
|
44
|
+
# (\`specs/\`, \`reports/\`, \`docs/\`, etc.) should use those; the lifecycle
|
|
45
|
+
# exists as mental scaffolding, not as enforced filesystem structure.
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
# --- Server ----------------------------------------------------------------
|
|
49
|
+
# HTTP/WebSocket listener for the Hocuspocus server + static React app.
|
|
50
|
+
#
|
|
51
|
+
# openOnAgentEdit: when true, the browser opens automatically the first time
|
|
52
|
+
# an agent writes to the knowledge base in this server session. Debounced to
|
|
53
|
+
# one open per boot. Useful for pairing with Claude Code — you see the edit
|
|
54
|
+
# land live. Leave false for headless/CI.
|
|
55
|
+
#
|
|
56
|
+
# server:
|
|
57
|
+
# port: 3000
|
|
58
|
+
# host: localhost
|
|
59
|
+
# openOnAgentEdit: false
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
# --- Persistence -----------------------------------------------------------
|
|
63
|
+
# How aggressively CRDT updates are flushed to disk.
|
|
64
|
+
# persistence:
|
|
65
|
+
# debounceMs: 2000
|
|
66
|
+
# maxDebounceMs: 10000
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
# --- Folders: per-folder frontmatter defaults -------------------------------
|
|
70
|
+
#
|
|
71
|
+
# TL;DR glob gotcha: \`**\` is ONLY a multi-segment wildcard when it is a
|
|
72
|
+
# standalone path segment. \`foo-**\` behaves like \`foo-*\` (single segment, NOT
|
|
73
|
+
# descendants). Use \`foo/**\` or \`foo-*/**\` to match descendants.
|
|
74
|
+
#
|
|
75
|
+
# Declare title/description/tags defaults keyed by glob \`match:\`. Rules merge
|
|
76
|
+
# with a file's own frontmatter at read time:
|
|
77
|
+
# - Per scalar (title, description): the FILE wins when declared; folder
|
|
78
|
+
# rule fills in blanks.
|
|
79
|
+
# - Tags: concatenated across ALL matching rules (in declaration order) with
|
|
80
|
+
# file tags last; first-occurrence preserved on dedup.
|
|
81
|
+
# - Evaluation is positional — LATER rules in this array override earlier
|
|
82
|
+
# rules for scalars. Put general rules first, specific rules last.
|
|
83
|
+
#
|
|
84
|
+
# Picomatch glob cheatsheet:
|
|
85
|
+
# \`match: 'foo'\` — matches ONLY the folder \`foo\` itself
|
|
86
|
+
# \`match: 'foo/**'\` — matches \`foo\` AND all descendants (files + dirs)
|
|
87
|
+
# \`match: 'foo-*'\` — matches \`foo-1\`, \`foo-bar\` (single segment)
|
|
88
|
+
# \`match: 'foo-**'\` — behaves like \`foo-*\` (NOT multi-segment); see
|
|
89
|
+
# TL;DR above. Use \`foo-*/**\` if you want
|
|
90
|
+
# \`foo-X\` plus its descendants.
|
|
91
|
+
#
|
|
92
|
+
# Tip: run \`ok seed\` to scaffold the Karpathy three-layer starter
|
|
93
|
+
# (external-sources/, research/, articles/) with matching \`folders:\` entries.
|
|
94
|
+
# The commented example below is the exact structure \`ok seed\` writes.
|
|
95
|
+
#
|
|
96
|
+
# Example:
|
|
97
|
+
# folders:
|
|
98
|
+
# - match: 'external-sources/**'
|
|
99
|
+
# frontmatter:
|
|
100
|
+
# title: External Sources
|
|
101
|
+
# description: Raw preserved sources (URLs, PDFs, files). Immutable — captured verbatim via \`ingest\`. No analysis in these files; takeaways belong in \`research/\`.
|
|
102
|
+
# tags: [source, immutable, layer-ingest]
|
|
103
|
+
# - match: 'research/**'
|
|
104
|
+
# frontmatter:
|
|
105
|
+
# title: Research
|
|
106
|
+
# description: Provisional analysis synthesizing external sources. Produced by the \`research\` tool. Promote to \`articles/\` via \`consolidate\` when the team decides.
|
|
107
|
+
# tags: [research, provisional, layer-research]
|
|
108
|
+
# - match: 'articles/**'
|
|
109
|
+
# frontmatter:
|
|
110
|
+
# title: Articles
|
|
111
|
+
# description: Canonical knowledge committed after a team decision. Produced by the \`consolidate\` tool with a \`supersedes:\` chain tying back to the research that preceded it.
|
|
112
|
+
# tags: [article, canonical, layer-consolidate]
|
|
113
|
+
`;function u(e,t){return r(e)?!1:(o(e,t,`utf-8`),!0)}function d(e){let t=s(e,`.gitignore`),i=`# Open Knowledge — local editor config (not tracked upstream)\n${n}/\n`;if(!r(t))return o(t,i,`utf-8`),`created`;let c=a(t,`utf-8`),l=new Set([n,`${n}/`,`/${n}`,`/${n}/`]);return c.split(`
|
|
114
|
+
`).map(e=>e.trim()).some(e=>l.has(e))?`already-present`:(o(t,`${c}${c.length===0||c.endsWith(`
|
|
115
|
+
`)?``:`
|
|
116
|
+
`}${c.length>0&&!c.endsWith(`
|
|
117
|
+
|
|
118
|
+
`)?`
|
|
119
|
+
`:``}${i}`,`utf-8`),`appended`)}const f=[{name:`.gitignore`,content:`${t}/\nserver.lock\nui.lock\nsync-state.json\n`},{name:e,content:l}];function p(e){let r=c(e,n),a=[],o=[];i(r,{recursive:!0}),i(s(r,t),{recursive:!0});for(let e of f)u(s(r,e.name),e.content)?a.push(e.name):o.push(e.name);return{created:a,skipped:o}}export{p as n,d as t};
|
|
120
|
+
//# sourceMappingURL=init-D2rQPwU1.mjs.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{r as e}from"./constants-QFqPbiZ7.mjs";import{O as t}from"./src-CB-sXsMW.mjs";import{n,r,t as i}from"./src-DIoA15kL.mjs";import{n as a}from"./init-D2rQPwU1.mjs";import{t as o}from"./preview-QLsD0vVK.mjs";import{s}from"./colors-Cmha5EZJ.mjs";import{t as c}from"./is-object-7k010cEq.mjs";import{Command as l}from"commander";import{existsSync as u,mkdirSync as d,readFileSync as f,writeFileSync as p}from"node:fs";import{homedir as m}from"node:os";import{basename as h,dirname as g,join as _,posix as v,relative as y,resolve as b,sep as x,win32 as S}from"node:path";import{parse as ee,stringify as C}from"smol-toml";const w=[`claude`,`claude-desktop`,`cursor`,`vscode`,`windsurf`,`codex`],T=[`@inkeep/open-knowledge`,`mcp`],te={MCP_DEBUG:`1`,OK_LOG_FILE:`/tmp/ok-mcp.log`};function E(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=b(e);if(h(t)===`cli.mjs`&&h(g(t))===`dist`)return t;let n=t.split(x),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 _(i.length===0?x:i.join(x),`packages`,`cli`,`dist`,`cli.mjs`)}function D(e={}){return e.cliPath?{command:e.cliPath,args:[`mcp`]}:e.mode===`dev`?{command:`node`,args:[E(e.cliEntryPath),`mcp`],env:{...te}}:{command:`npx`,args:[...T]}}function O(e){return e===`win32`?S:v}function k(e={}){let t=e.platformName??process.platform,n=e.home??m(),r=e.env??process.env,i=O(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 A(e={}){let t=e.platformName??process.platform,n=e.home??m();return O(t).join(n,`.claude.json`)}function j(e={}){let t=e.platformName??process.platform,n=e.home??m(),r=e.env??process.env;if(t===`darwin`)return v.join(n,`Library`,`Application Support`,`Claude`,`claude_desktop_config.json`);if(t===`win32`){let e=r.APPDATA??S.join(n,`AppData`,`Roaming`);return S.join(e,`Claude`,`claude_desktop_config.json`)}throw Error(`Claude Desktop is not available on ${t}. Supported: macOS, Windows.`)}function M(e={}){let t=e.platformName??process.platform,n=e.home??m();return O(t).join(n,`.cursor`,`mcp.json`)}function N(e={}){return O(e.platformName??process.platform).join(k(e),`Code`,`User`,`mcp.json`)}function P(e={}){let t=e.platformName??process.platform,n=e.home??m();return O(t).join(n,`.codeium`,`windsurf`,`mcp_config.json`)}function F(e={}){let t=e.platformName??process.platform,n=e.home??m();return(e.env??process.env).CODEX_HOME??O(t).join(n,`.codex`)}function I(e={}){return O(e.platformName??process.platform).join(F(e),`config.toml`)}function L(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((e,n)=>L(e,t[n]));if(c(e)&&c(t)){let n=Object.keys(e).sort(),r=Object.keys(t).sort();return n.length===r.length&&n.every((e,t)=>e===r[t])&&n.every(n=>L(e[n],t[n]))}return!1}function R(e,t){return Object.entries(t).every(([t,n])=>L(e[t],n))}function z(e,t){return{...e,...t}}function B(e){return{...e,isCompatible(t,n,r){return R(t,e.buildEntry(n,r))},mergeManagedFields(t,n,r){return z(t,e.buildEntry(n,r))}}}const V={claude:B({id:`claude`,label:`Claude Code`,configPath:(e,t)=>A({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>e,buildEntry:(e,t)=>D(t),scope:`global`,detectPath:(e,t)=>_(t??m(),`.claude`),legacyProjectConfigPath:e=>_(e,`.mcp.json`)}),"claude-desktop":B({id:`claude-desktop`,label:`Claude Desktop`,configPath:(e,t)=>j({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>e,buildEntry:(e,t)=>D(t),scope:`global`,detectPath:(e,t)=>g(j({home:t}))}),cursor:B({id:`cursor`,label:`Cursor`,configPath:(e,t)=>M({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>e,buildEntry:(e,t)=>D(t),scope:`global`,detectPath:(e,t)=>g(M({home:t})),legacyProjectConfigPath:e=>_(e,`.cursor`,`mcp.json`)}),vscode:B({id:`vscode`,label:`VS Code`,configPath:(e,t)=>N({home:t}),format:`json`,topLevelKey:`servers`,serverName:()=>e,buildEntry:(e,t)=>({type:`stdio`,...D(t)}),scope:`global`,detectPath:(e,t)=>g(N({home:t})),legacyProjectConfigPath:e=>_(e,`.vscode`,`mcp.json`)}),windsurf:B({id:`windsurf`,label:`Windsurf`,configPath:(e,t)=>P({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>e,buildEntry:(e,t)=>D(t),scope:`global`,detectPath:(e,t)=>g(P({home:t}))}),codex:B({id:`codex`,label:`Codex`,configPath:(e,t)=>I({home:t}),format:`toml`,topLevelKey:`mcp_servers`,serverName:()=>e,buildEntry:(e,t)=>D(t),scope:`global`,detectPath:(e,t)=>g(I({home:t})),legacyProjectConfigPath:e=>_(e,`.codex`,`config.toml`)})};function H(e){let t=e.filter(e=>!(e in V));if(t.length>0)throw Error(`Unknown editor(s): ${t.join(`, `)}. Valid options: ${w.join(`, `)}`);return e.map(e=>V[e])}function U(e){if(!u(e))return{};let t=f(e,`utf-8`).trim();if(t===``)return{};try{let n=JSON.parse(t);if(c(n))return n;throw Error(`${e} root must be a JSON object`)}catch(t){throw t instanceof SyntaxError?Error(`${e} contains invalid JSON: ${t.message}`):t}}function W(e){if(!u(e))return{};let t=f(e,`utf-8`).trim();if(t===``)return{};try{let n=ee(t);if(c(n))return n;throw Error(`${e} root must be a TOML table`)}catch(t){throw Error(`${e} contains invalid TOML: ${t instanceof Error?t.message:String(t)}`)}}function G(e,t){d(g(e),{recursive:!0}),p(e,`${JSON.stringify(t,null,2)}\n`,`utf-8`)}function K(e,t){d(g(e),{recursive:!0});let n=C(t);p(e,n.endsWith(`
|
|
2
|
+
`)?n:`${n}\n`,`utf-8`)}const q=`0.0.1`,J=`open-knowledge-ui`;function ne(e,t={}){let n=_(e,`.claude`,`launch.json`),r=t.mode===`dev`?{name:J,runtimeExecutable:`node`,runtimeArgs:[E(t.cliEntryPath),`ui`],port:3e3}:{name:J,runtimeExecutable:`npx`,runtimeArgs:[`@inkeep/open-knowledge`,`ui`],port:3e3};try{if(!u(n))return d(g(n),{recursive:!0}),p(n,`${JSON.stringify({version:q,configurations:[r]},null,2)}\n`,`utf-8`),{action:`created`,configPath:n};let e=f(n,`utf-8`).trim(),t=e?JSON.parse(e):{};if(!c(t))return{action:`failed`,configPath:n,error:`launch.json root is not an object`};let i=Array.isArray(t.configurations)?t.configurations:[],a=i.findIndex(e=>c(e)&&e.name===J);a>=0?i[a]=r:i.push(r);let o={...t,version:t.version??q,configurations:i};return p(n,`${JSON.stringify(o,null,2)}\n`,`utf-8`),{action:a>=0?`merged`:`created`,configPath:n}}catch(e){return{action:`failed`,configPath:n,error:e instanceof Error?e.message:String(e)}}}function Y(e,t,n){try{return u(e.detectPath?.(t,n)??g(e.configPath(t,n)))}catch{return!1}}function X(e,t,n,r){let i=e.serverName(t),a;try{a=e.configPath(t,r)}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:``,serverName:i,error:t instanceof Error?t.message:String(t)}}if(!n.skipAvailabilityCheck&&!Y(e,t,r))return{editorId:e.id,label:e.label,action:`skipped-missing`,configPath:a,serverName:i};let o;try{o=e.format===`toml`?W(a):U(a)}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:a,serverName:i,error:t instanceof Error?t.message:String(t)}}let s=o[e.topLevelKey]??{},c=s[i],l;try{l=e.buildEntry(t,n)}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:a,serverName:i,error:t instanceof Error?t.message:String(t)}}let u={...o,[e.topLevelKey]:{...s,[i]:l}};try{e.format===`toml`?K(a,u):G(a,u)}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:a,serverName:i,error:t instanceof Error?t.message:String(t)}}return{editorId:e.id,label:e.label,action:c===void 0?`written`:`overwritten`,configPath:a,serverName:i}}function re(e,t){let n=e.legacyProjectConfigPath?.(t);if(!(!n||!u(n)))return{editorId:e.id,label:e.label,path:n}}async function ie(e){let t=H(e.editors),n={mode:`published`,cliPath:e.cliPath,skipAvailabilityCheck:!0};return t.map(t=>X(t,``,n,e.home))}function ae(e,t,n){let r;try{r=e.configPath(t,n)}catch{return null}let i;try{i=e.format===`toml`?W(r):U(r)}catch{return null}let a=i[e.topLevelKey];if(!c(a))return null;let o=a[e.serverName(t)];return c(o)?o:null}async function Z(e={}){let t=b(e.cwd??process.cwd()),n={mode:e.devMcp?`dev`:`published`,cliEntryPath:e.cliEntryPath},o=await r(t),s;try{s=a(t)}catch(n){let r=V.claude.configPath(t,e.home);return{contentCreated:[],contentSkipped:[],editors:[],legacyProjectConfigs:[],didGitInit:o.didInit,mcpAction:`failed`,mcpPath:r,mcpError:`Content scaffolding failed: ${n instanceof Error?n.message:String(n)}`}}let c=H(e.editors??$(t,e.home)),l=c.filter(n=>Y(n,t,e.home)),u=[];for(let r of c){if(e.mcp===!1){let n=``;try{n=r.configPath(t,e.home)}catch{}u.push({editorId:r.id,label:r.label,action:`skipped-flag`,configPath:n,serverName:r.serverName(t)});continue}u.push(X(r,t,n,e.home))}let d=e.mcp===!1?[]:l.map(e=>re(e,t)).filter(e=>e!==void 0),f=l.some(e=>e.id===`claude`)&&e.mcp!==!1?ne(t,n):void 0,p=await(e.installUserSkill??i)({home:e.home}),m=e.mcp===!1?`skipped-flag`:`skipped-missing`,h=u.find(e=>e.editorId===`claude`)??u[0]??{action:m,configPath:V.claude.configPath(t,e.home)};return{contentCreated:s.created,contentSkipped:s.skipped,editors:u,legacyProjectConfigs:d,launchJson:f,skillInstall:p,didGitInit:o.didInit,mcpAction:h.action,mcpPath:h.configPath,mcpError:`error`in h?h.error:void 0}}function Q(e,n){let r=[],i=e.editors.some(e=>e.action===`written`||e.action===`overwritten`),a=e.editors.some(e=>e.action===`failed`),c=e.editors.length>0&&e.editors.every(e=>e.action===`skipped-flag`),l=e.editors.length>0&&e.editors.every(e=>e.action===`skipped-missing`),u=e=>{let t=e.configPath.startsWith(n)?y(n,e.configPath):e.configPath;switch(e.action){case`created`:return` app preview server ${t} configured for Claude Code Desktop embedded browser`;case`merged`:return` app preview server ${t} updated for Claude Code Desktop embedded browser`;case`failed`:return` app preview server ${t} FAILED: ${e.error}`}};e.didGitInit&&r.push(`Initialized git repo at ${n}/.git/ (default branch: main)`);let d=_(n,t);if(e.contentCreated.length>0?(r.push(`Content scaffolded at ${d}/`),r.push(` Created: ${e.contentCreated.join(`, `)}`)):r.push(`Content already present at ${d}/`),e.contentSkipped.length>0&&r.push(` Skipped (already exist): ${e.contentSkipped.join(`, `)}`),r.push(``),e.mcpError&&e.editors.length===0)r.push(`Warning: ${e.mcpError}`);else if(e.editors.length===0)r.push(`MCP server configuration:`),r.push(e.mcpAction===`skipped-flag`?` MCP config not written — use without --no-mcp to configure editors`:` No supported editor config directories detected; skipped MCP registration`);else if(c)r.push(`MCP config not written — use without --no-mcp to configure editors`);else if(l)r.push(`MCP server configuration:`),r.push(` No supported editor config directories detected; skipped MCP registration`);else{r.push(`MCP server configuration:`);for(let t of e.editors){let i=t.configPath.startsWith(n)?y(n,t.configPath):t.configPath.replace(/^\/Users\/[^/]+/,`~`),a=t.serverName===`open-knowledge`?``:` (${t.serverName})`,o=` `.repeat(Math.max(1,14-t.label.length)),s=t.editorId===`claude-desktop`&&(t.action===`written`||t.action===`overwritten`)?` — quit and relaunch Claude Desktop to activate`:``;switch(t.action){case`written`:r.push(` ${t.label}${o}${i} registered${a}${s}`);break;case`overwritten`:r.push(` ${t.label}${o}${i} updated${a}${s}`);break;case`skipped-missing`:r.push(` ${t.label}${o}${i} config root missing; skipped`);break;case`failed`:r.push(` ${t.label}${o}${i} FAILED: ${t.error}`);break;case`skipped-flag`:break}t.editorId===`claude`&&e.launchJson&&r.push(u(e.launchJson))}}if(a&&(r.push(``),r.push(`For failed editors, add the MCP server entry manually. See:`),r.push(` https://github.com/inkeep/open-knowledge#mcp-setup`)),e.legacyProjectConfigs.length>0){r.push(``),r.push(`Legacy project MCP configs detected:`);for(let t of e.legacyProjectConfigs)r.push(` ${t.label} ${y(n,t.path)}`);r.push(` These project-local files may override the new global config. Remove them if you want fully user-scoped MCP setup in this project.`)}if(e.skillInstall)switch(r.push(``),r.push(`User-global skill:`),e.skillInstall){case`installed`:r.push(" open-knowledge installed to detected agent hosts via `npx skills`");break;case`skip-current`:r.push(` open-knowledge already installed at current version`);break;case`failed`:r.push(` ${s(`open-knowledge install failed — MCP still configured; run manually:`)}`),r.push(` ${s(` npx skills@~1.5.0 add <bundled-path> --agent '*' -g -y --copy`)}`);break}if(e.preview?(r.push(``),r.push(o(e.preview,n))):e.previewWarning&&(r.push(``),r.push(`Content preview unavailable: ${e.previewWarning}`)),i){let t=e.editors.filter(e=>e.action===`written`||e.action===`overwritten`).map(e=>e.label);r.push(``),r.push(`Next steps:`),r.push(` 1. Open your editor (${t.join(` / `)})`),r.push(` 2. Approve the MCP server when prompted`),r.push(` 3. (Optional) scaffold the starter knowledge-base structure:`),r.push(` - ok seed`),r.push(` 4. Use the three MCP workflow tools as you build the wiki:`),r.push(` - mcp__open-knowledge__ingest — capture an external source`),r.push(` - mcp__open-knowledge__research — gather sources and write findings`),r.push(` - mcp__open-knowledge__consolidate — promote research to canonical articles`)}return r.join(`
|
|
3
|
+
`)}function $(e,t){let n=[];for(let r of w)Y(V[r],e,t)&&n.push(r);return n}function oe(){return new l(`init`).description(`Scaffold ${t}/ in the current directory and register the MCP server for your editor(s)`).option(`--mcp`,`Register the MCP server for selected editors (default: true)`,!0).option(`--no-mcp`,`Scaffold the ${t}/ directory but do not touch MCP config`).option(`--dev-mcp`,`Register a local dev MCP entry using node + packages/cli/dist/cli.mjs with debug logging`).action(async e=>{let t=process.cwd(),r;try{r=await Z({cwd:t,mcp:e.mcp,devMcp:e.devMcp})}catch(e){if(e instanceof n){process.stderr.write(`open-knowledge requires git to initialize a parent repo. Install git or run 'git init' yourself, then re-run.
|
|
4
|
+
`),e.stderr&&process.stderr.write(`${e.stderr.trim()}\n`),process.exitCode=1;return}throw e}try{let{previewContent:e}=await import(`./preview-BR34uHnQ.mjs`),{loadConfig:n}=await import(`./loader-DNeW8gS5.mjs`),{resolveContentDir:i}=await import(`./paths-ORyeejxG.mjs`),{config:a}=n(t),o=i(a,t);r.preview=e({projectDir:t,contentDir:o,include:a.content.include,exclude:a.content.exclude})}catch(e){r.previewWarning=e instanceof Error?e.message:String(e)}process.stdout.write(`${Q(r,t)}\n`),(r.editors.some(e=>e.action===`failed`)||r.mcpAction===`failed`)&&(process.exitCode=1)})}export{Z as a,w as c,ae as i,V as l,Q as n,X as o,oe as r,ie as s,$ as t};
|
|
5
|
+
//# sourceMappingURL=init-DUIYyxaK.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
function e(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}export{e as t};
|
|
2
|
-
//# sourceMappingURL=is-object-
|
|
2
|
+
//# sourceMappingURL=is-object-7k010cEq.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
function e(e){let t=e.scheduler??{setTimeout:(e,t)=>globalThis.setTimeout(e,t),clearTimeout:e=>globalThis.clearTimeout(e)},n=e.initialBackoffMs??1e3,r=e.maxBackoffMs??3e4,i=e.createWebSocket??(e=>new WebSocket(e)),a=e.logger??null,o=e.log,s=null,c=null,l=!1,u=n;function d(e,t,n){try{a?a[e](t,n):o?.(t)}catch{}}function f(){if(l)return;c!==null&&t.clearTimeout(c);let e=u;u=Math.min(u*2,r),d(`debug`,`scheduling reconnect`,{backoffMs:e}),c=t.setTimeout(()=>{c=null,p().catch(e=>d(`warn`,`reconnect failed`,{error:String(e)}))},e)}async function p(){if(l)return;let t;try{t=await e.resolveWsUrl()}catch(e){d(`warn`,`resolveWsUrl threw`,{error:String(e)}),f();return}if(!t){f();return}let r=e.connectionId?`&connectionId=${encodeURIComponent(e.connectionId)}`:``,a=`${t}/collab/keepalive?pid=${process.pid}${r}`;try{s=i(a)}catch(e){d(`warn`,`WebSocket constructor failed`,{url:a,error:String(e)}),s=null,f();return}s.addEventListener(`open`,()=>{d(`info`,`connected`,{url:t}),u=n}),s.addEventListener(`close`,()=>{l||(d(`info`,`disconnected`,{url:t}),s=null,f())}),s.addEventListener(`error`,()=>{d(`debug`,`websocket error observed`,{url:t,readyState:s?.readyState,reason:`error-event`})})}return queueMicrotask(()=>{p().catch(e=>d(`warn`,`initial connect failed`,{error:String(e)}))}),{close:()=>{if(!l&&(l=!0,c!==null&&(t.clearTimeout(c),c=null),s)){try{s.close()}catch{}s=null}},isConnected:()=>s!==null&&s.readyState===1}}export{e as startKeepalive};
|
|
2
|
-
//# sourceMappingURL=keepalive-
|
|
2
|
+
//# sourceMappingURL=keepalive-CfaIYv9f.mjs.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{n as e}from"./constants-QFqPbiZ7.mjs";import{O as t}from"./src-CB-sXsMW.mjs";import{t as n}from"./is-object-7k010cEq.mjs";import{existsSync as r,readFileSync as i}from"node:fs";import{homedir as a}from"node:os";import{resolve as o}from"node:path";import{parse as s}from"yaml";import{realpath as c}from"node:fs/promises";import{z as l}from"zod";async function u(e){let t=o(e);try{return await c(t)}catch(e){if(e.code!==`ENOENT`){let n=e instanceof Error?e.message:String(e);console.warn(`[normalize-cwd] realpath failed for ${t}: ${n}`)}return t}}const d=l.object({title:l.string().optional(),description:l.string().optional(),tags:l.array(l.string()).optional()}).strict(),f=l.object({match:l.string().min(1,"`match` must be a non-empty glob pattern (e.g. 'specs/**' or 'reports/*/**')"),frontmatter:d}).strict(),p=l.object({content:l.object({dir:l.string().default(`.`),include:l.array(l.string()).min(1).default([`**/*.md`,`**/*.mdx`]),exclude:l.array(l.string()).default([])}).default({dir:`.`,include:[`**/*.md`,`**/*.mdx`],exclude:[]}),github:l.object({oauthAppClientId:l.string().default(`Ov23liqlSd0V1MwR6rhI`)}).default({oauthAppClientId:`Ov23liqlSd0V1MwR6rhI`}),sync:l.object({enabled:l.boolean().optional(),pushIntervalSeconds:l.number().int().min(1).default(60),pullIntervalSeconds:l.number().int().min(1).default(30),autoCommit:l.boolean().default(!0),autoPush:l.boolean().default(!0),autoPull:l.boolean().default(!0),commitMessage:l.string().default(`auto`)}).default({pushIntervalSeconds:60,pullIntervalSeconds:30,autoCommit:!0,autoPush:!0,autoPull:!0,commitMessage:`auto`}),server:l.object({port:l.number().int().min(0).max(65535).default(0),host:l.string().regex(/^[\w.\-:]+$/,`Invalid hostname`).default(`localhost`),openOnAgentEdit:l.boolean().default(!1)}).default({port:0,host:`localhost`,openOnAgentEdit:!1}),persistence:l.object({debounceMs:l.number().int().min(0).default(2e3),maxDebounceMs:l.number().int().min(0).default(1e4)}).default({debounceMs:2e3,maxDebounceMs:1e4}),preview:l.object({baseUrl:l.url().optional()}).default({}),folders:l.array(f).default([]),mcp:l.object({autoStart:l.boolean().default(!0),tools:l.object({read_document:l.object({historyDepth:l.number().int().min(0).default(5)}).default({historyDepth:5}),search:l.object({maxResults:l.number().int().min(1).default(50)}).default({maxResults:50})}).default({read_document:{historyDepth:5},search:{maxResults:50}})}).default({autoStart:!0,tools:{read_document:{historyDepth:5},search:{maxResults:50}}})});function m(e,t){let r={...e};for(let i of Object.keys(t)){let a=e[i],o=t[i];n(o)&&n(a)?r[i]=m(a,o):o!==void 0&&(r[i]=o)}return r}function h(e){if(!r(e))return null;try{let t=s(i(e,`utf-8`));return n(t)?t:null}catch(t){return console.warn(`[config] Failed to parse ${e}: ${t instanceof Error?t.message:t}`),null}}function g(n){let r=n??process.cwd(),i=[],s=o(a(),t,e),c={},l=h(s);l&&(c=m(c,l),i.push(s));let u=o(r,t,e),d=h(u);d&&(c=m(c,d),i.push(u));let f=p.safeParse(c);if(!f.success){let e=f.error.issues.map(e=>` ${e.path.join(`.`)}: ${e.message}`);throw Error(`Invalid configuration:\n${e.join(`
|
|
2
2
|
`)}`)}return{config:f.data,sources:i}}function _(e,t=process.env){let n=e;return t.PORT&&(n={...n,server:{...n.server,port:Number(t.PORT)}}),t.HOST&&(n={...n,server:{...n.server,host:t.HOST}}),n}function v(e){let t=e.env??process.env,n=e.cacheMs??1e3,r=e.loadConfigFn??g,i=new Map,a=new Map,o=u(e.startupCwd);return async s=>{let c=await u(s??e.startupCwd),l=Date.now(),d=i.get(c);if(d&&d.expiresAt>l)return d.config;let f=a.get(c);if(f)return await f;let p=(async()=>{if(c===await o){let r=_(e.startupConfig,t);return i.set(c,{config:r,expiresAt:Date.now()+n}),r}let a=_(r(c).config,t);return i.set(c,{config:a,expiresAt:Date.now()+n}),a})();a.set(c,p);try{return await p}finally{a.delete(c)}}}export{u as i,g as n,p as r,v as t};
|
|
3
|
-
//# sourceMappingURL=loader-
|
|
3
|
+
//# sourceMappingURL=loader-C3Wwbx8H.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./loader-C3Wwbx8H.mjs";export{e as loadConfig};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./constants-
|
|
2
|
-
//# sourceMappingURL=paths-
|
|
1
|
+
import"./constants-QFqPbiZ7.mjs";import{O as e}from"./src-CB-sXsMW.mjs";import{resolve as t}from"node:path";function n(e,n){return t(n,e.content.dir)}function r(n){return t(n,e)}export{r as n,n as t};
|
|
2
|
+
//# sourceMappingURL=paths-Ba3tNHQr.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./paths-Ba3tNHQr.mjs";export{t as resolveContentDir,e as resolveLockDir};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./preview-QLsD0vVK.mjs";export{t as formatPreviewBlock,e as previewContent};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import"./constants-
|
|
1
|
+
import"./constants-QFqPbiZ7.mjs";import{O as e}from"./src-CB-sXsMW.mjs";import{h as t}from"./src-DIoA15kL.mjs";import{existsSync as n,lstatSync as r,readdirSync as i,realpathSync as a,statSync as o}from"node:fs";import{join as s,relative as c}from"node:path";function l(e){let{projectDir:n,contentDir:l,include:u,exclude:d,sampleCap:f=5}=e,p=[],m=[];try{r(l)}catch(e){return{totalCount:0,sample:[],contentDir:l,include:u,exclude:d,warnings:[`cannot access content directory ${l}: ${e instanceof Error?e.message:String(e)}`]}}let h;try{h=t({projectDir:n,contentDir:l,includePatterns:u,excludePatterns:d})}catch(e){return{totalCount:0,sample:[],contentDir:l,include:u,exclude:d,warnings:[e instanceof Error?e.message:String(e)]}}function g(e){let t;try{t=i(e,{withFileTypes:!0})}catch(t){let n=t instanceof Error?t.message:String(t);p.push(`could not read directory ${c(l,e)||`.`}: ${n}`);return}for(let n of t){let t=s(e,n.name);if(n.isSymbolicLink()){let e;try{e=a(t)}catch(e){let n=e.code;n===`ENOENT`||n===`ELOOP`?p.push(`broken or cyclic symlink: ${c(l,t)}`):p.push(`cannot resolve symlink ${c(l,t)}: ${n??`unknown error`}`);continue}let n;try{n=o(e)}catch{continue}if(n.isDirectory()){let e=c(l,t);if(h.isDirExcluded(e))continue;g(t)}else if(n.isFile()){let e=c(l,t);if(h.isExcluded(e))continue;m.push(e)}}else if(n.isDirectory()){let e=c(l,t);if(h.isDirExcluded(e))continue;g(t)}else if(n.isFile()){let e=c(l,t);if(h.isExcluded(e))continue;m.push(e)}}}return g(l),{totalCount:m.length,sample:m.slice(0,f),contentDir:l,include:u,exclude:d,warnings:p}}function u(t,r){let i=[],a=c(r,t.contentDir),o=a===``?`./`:`./${a}`;i.push(`Content:`),i.push(` Found ${t.totalCount} markdown files in ${o}`);let l=t.include.join(`, `),u=t.exclude.length>0?t.exclude.join(`, `):`(none)`;if(i.push(` Scope: include=${l} exclude=${u}`),t.sample.length>0){let e=t.sample.join(`, `),n=t.totalCount>t.sample.length?`, …`:``;i.push(` Sample: ${e}${n}`)}if(t.warnings.length>0)for(let e of t.warnings)i.push(` Warning: ${e}`);return i.push(``),n(s(r,`.open-knowledge`,`config.yml`))?(i.push(` To adjust, edit ${e}/config.yml:`),i.push(` content:`),i.push(` include: ${JSON.stringify(t.include)}`),i.push(` exclude: ${JSON.stringify(t.exclude)}`)):(i.push(" Run `open-knowledge init` to scaffold config, then adjust:"),i.push(` ${e}/config.yml → content.include / content.exclude`)),i.push(``),i.push(` Re-check anytime: open-knowledge preview`),i.join(`
|
|
2
2
|
`)}export{l as n,u as t};
|
|
3
|
-
//# sourceMappingURL=preview-
|
|
3
|
+
//# sourceMappingURL=preview-QLsD0vVK.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,n as t,r as n,t as r}from"./index-Bnp3jcJM.js";export{r as McpConsentDialogBody,r as default,t as computeInitialSelection,n as selectedIdsOrdered,e as toggleSelectedId};
|