@inkeep/open-knowledge 0.70.2 → 0.70.4
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/cli.mjs +6 -6
- package/dist/constants-Deih7i0K.mjs +1 -0
- package/dist/{dist-Ct3NR8HA.mjs → dist-CSFai4j1.mjs} +1 -1
- package/dist/{dist-BfGPmTI1.mjs → dist-CmS0s3u8.mjs} +477 -477
- package/dist/index.mjs +3 -3
- package/dist/{init-DCm-_TKB.mjs → init-CtwvSCyQ.mjs} +2 -2
- package/dist/init-DJa55PQU.mjs +1 -0
- package/dist/{launch-json-removal-DKupr-jC.mjs → launch-json-removal-BE8E1vIW.mjs} +1 -1
- package/dist/loader-BzFUiCkF.mjs +1 -0
- package/dist/{loader-B2xPGQfd.mjs → loader-DlB4rhjA.mjs} +1 -1
- package/dist/{md-manager-BGnqyqi1-Eez8IlhB.mjs → md-manager-BGnqyqi1-Dg5Bl9Rs.mjs} +2 -2
- package/dist/{open-browser-rcp8z_R5.mjs → open-browser-BexG740O.mjs} +1 -1
- package/dist/parse-worker.mjs +1 -1
- package/dist/{preview-B8ghhW3C.mjs → preview-BqDHlB4I.mjs} +1 -1
- package/dist/preview-f4iVephM.mjs +1 -0
- package/dist/public/assets/{ActivityModeContent-Dzlz-p9w.js → ActivityModeContent-DZWkzSf1.js} +1 -1
- package/dist/public/assets/{AddPropertiesButton-BzvWvVbw.js → AddPropertiesButton-CZ_1FSZ_.js} +2 -2
- package/dist/public/assets/{AgentDiffPane-Badnd0z5.js → AgentDiffPane-Dx88nEFC.js} +1 -1
- package/dist/public/assets/{AgentThreadClientBinder-BDxB-fkd.js → AgentThreadClientBinder-BhZ7g12J.js} +1 -1
- package/dist/public/assets/{BugReportHistory-YsKDA8Wg.js → BugReportHistory-CfFMNT0L.js} +1 -1
- package/dist/public/assets/{BugReportHistoryDialog-Cm-lMz2-.js → BugReportHistoryDialog-CImauBFJ.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-CvenaDDl.js → CodeMirrorPropInput-33E7_d5L.js} +1 -1
- package/dist/public/assets/{ConsentDialogBody-Lw_SJixc.js → ConsentDialogBody-DAiGjncA.js} +1 -1
- package/dist/public/assets/{DiffViewBoundary-DuQPEMcv.js → DiffViewBoundary-DYrAptlH.js} +1 -1
- package/dist/public/assets/{DocumentContext-BWfYIGn-.js → DocumentContext-BEpM29CW.js} +1 -1
- package/dist/public/assets/{EditorModeToggle-B8xOZgYr.js → EditorModeToggle-BQbTgwTb.js} +1 -1
- package/dist/public/assets/{EnableSyncConfirmDialog-7Bq4UalT.js → EnableSyncConfirmDialog-CecCUsv_.js} +1 -1
- package/dist/public/assets/{ExcalidrawDocEditor-qHB2EWCE.js → ExcalidrawDocEditor-C9oVP6iE.js} +1 -1
- package/dist/public/assets/FeedbackForm-CJbAPiPo.js +1 -0
- package/dist/public/assets/{GraphPanel-sNH2eMK2.js → GraphPanel-D9q9_WBi.js} +1 -1
- package/dist/public/assets/{ImageAttachments-Dru1UxQV.js → ImageAttachments-VgESElX7.js} +1 -1
- package/dist/public/assets/{ImportSkillDialog-DNsoaSWE.js → ImportSkillDialog-CawY20dd.js} +1 -1
- package/dist/public/assets/{LintConfigEditor-Eajj_ona.js → LintConfigEditor-XdVzbUuy.js} +1 -1
- package/dist/public/assets/{ManagedArtifactProperties-xmkjmIcU.js → ManagedArtifactProperties-B4l-pO4C.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-BmtGXHjb.js +1 -0
- package/dist/public/assets/{MermaidDocEditor-DbApv8jA.js → MermaidDocEditor-CtxAqoKZ.js} +1 -1
- package/dist/public/assets/{PropertyDisplayRow-BZXUua7I.js → PropertyDisplayRow-C0l21vkw.js} +1 -1
- package/dist/public/assets/{RegisteredAgentIcon-DU5Zkepy.js → RegisteredAgentIcon-URW6mRal.js} +1 -1
- package/dist/public/assets/{ReportBugDialogBody-C275Hr72.js → ReportBugDialogBody-BC_SYWmo.js} +1 -1
- package/dist/public/assets/{ReportBugMenuTrigger-Ilx23iFu.js → ReportBugMenuTrigger-4CdA9Mp-.js} +2 -2
- package/dist/public/assets/{SchemaConfigEditor-DQcwju-H.js → SchemaConfigEditor-ByX85bDx.js} +1 -1
- package/dist/public/assets/{SessionsHost-BxTLJA09.js → SessionsHost-nYZICiDW.js} +2 -2
- package/dist/public/assets/{SettingsDialogBody-CRTA_WKg.js → SettingsDialogBody-VE4R_Wc7.js} +1 -1
- package/dist/public/assets/{ShareBranchSwitchDialog-CaH1eNpE.js → ShareBranchSwitchDialog-x37WR88-.js} +1 -1
- package/dist/public/assets/{ShareReceiveDialog-Fig-8wyz.js → ShareReceiveDialog-BOG4bhi-.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-BNUxcUmo.js → ShareReceiveMissDialog-BSUpUq9X.js} +1 -1
- package/dist/public/assets/{SkillCostValue-09FxLC0z.js → SkillCostValue-CD-UkSgT.js} +1 -1
- package/dist/public/assets/{SkillEditBanner-DxF5MrWn.js → SkillEditBanner-DjIJkNok.js} +1 -1
- package/dist/public/assets/{SkillForkDialog-DIIWYvbn.js → SkillForkDialog-Crpq5lBh.js} +1 -1
- package/dist/public/assets/{SkillInstallMenu-BSeeI8R-.js → SkillInstallMenu-CbSHcW8R.js} +1 -1
- package/dist/public/assets/{SkillOriginInline-B00Qx11t.js → SkillOriginInline-BFZf2JR9.js} +1 -1
- package/dist/public/assets/{SkillToolbarControls-CJLv0nyi.js → SkillToolbarControls-Y7AOB-xP.js} +1 -1
- package/dist/public/assets/{SlidesToolbarControls-CCNjUkub.js → SlidesToolbarControls-CHqriWLu.js} +1 -1
- package/dist/public/assets/{SourceEditor-ByNnsvQe.js → SourceEditor-DC10bZpS.js} +1 -1
- package/dist/public/assets/{TerminalPanel-CzywxJp9.js → TerminalPanel-4st3TySk.js} +1 -1
- package/dist/public/assets/{TerminalWindowApp-DPTNBmQ0.js → TerminalWindowApp-DXNm9dTO.js} +1 -1
- package/dist/public/assets/{TextDocEditor-B7AzPtXW.js → TextDocEditor-DiGZLPsh.js} +1 -1
- package/dist/public/assets/{ThreadView-BG9x4d_s.js → ThreadView-uHciD-Kx.js} +1 -1
- package/dist/public/assets/{TimelineDiffPane-BKQeyrX6.js → TimelineDiffPane-CLs-B1dB.js} +1 -1
- package/dist/public/assets/{agent-diff-store-C92NIPau.js → agent-diff-store-Dg3Bac6C.js} +1 -1
- package/dist/public/assets/{auth-state-cache-CXXOQdcM.js → auth-state-cache-BidOXkoe.js} +1 -1
- package/dist/public/assets/{bug-report-send-manager-BK30wBiV.js → bug-report-send-manager-9LfthUn-.js} +1 -1
- package/dist/public/assets/{client-version-B48BbTkz.js → client-version-seuqi8Cv.js} +1 -1
- package/dist/public/assets/{comment-chips-CdrJy7oX.js → comment-chips-C48UmG4n.js} +1 -1
- package/dist/public/assets/{config-provider-DlzcUiYU.js → config-provider-CuTQvb3e.js} +1 -1
- package/dist/public/assets/{dist-CGNkoXKB.js → dist-BhxUJnt3.js} +2 -2
- package/dist/public/assets/{doc-hash-CH3Kq7TA.js → doc-hash-Kdp6yoV7.js} +1 -1
- package/dist/public/assets/{doc-undo-manager-B2S3p7Kh.js → doc-undo-manager-7SQ4l4Nu.js} +1 -1
- package/dist/public/assets/{documents-events-kUbk4KBT.js → documents-events-Do-YHwQc.js} +1 -1
- package/dist/public/assets/{file-tree-adapter-Co9sJppq.js → file-tree-adapter-lIVLoHBG.js} +1 -1
- package/dist/public/assets/{file-tree-utils-D_wP4Dm1.js → file-tree-utils-CFQU54to.js} +1 -1
- package/dist/public/assets/{folder-config-api-BF554VSQ.js → folder-config-api-CqEs8lkj.js} +1 -1
- package/dist/public/assets/i18n-Bv8eiJWs.js +1 -0
- package/dist/public/assets/{index-DMDo5dFr.js → index-DeWGu3Fz.js} +8 -8
- package/dist/public/assets/{launcher-selection-C9GmEvOn.js → launcher-selection-CYk4BvNH.js} +1 -1
- package/dist/public/assets/{lint-config-client-B61iX5QY.js → lint-config-client-DRJy5ylG.js} +1 -1
- package/dist/public/assets/{markdownlint-rule-browser-CMXE3hvX.js → markdownlint-rule-browser-B2e579Uf.js} +1 -1
- package/dist/public/assets/{page-list-cache-DoLH1XoG.js → page-list-cache-4W3gy-jT.js} +1 -1
- package/dist/public/assets/{pending-receive-nav-store-CJEI5S0U.js → pending-receive-nav-store-DLAyo8mi.js} +1 -1
- package/dist/public/assets/{progress-C3Z1B6MH.js → progress-XpLQWrMN.js} +1 -1
- package/dist/public/assets/{project-paths-Bzd32aJI.js → project-paths-BTELVsG-.js} +1 -1
- package/dist/public/assets/{prop-types-CFuqY6TP.js → prop-types-De82BC_y.js} +1 -1
- package/dist/public/assets/{receive-store-BJw3I9N7.js → receive-store-7U3uc-LJ.js} +1 -1
- package/dist/public/assets/{selection-context-DJ_FIiJx.js → selection-context-soshQLlg.js} +1 -1
- package/dist/public/assets/{skill-scope-B1qEIboE.js → skill-scope-g1lFJ-Ds.js} +1 -1
- package/dist/public/assets/{skills-api-NyR-fZMK.js → skills-api-CRZyzHPE.js} +1 -1
- package/dist/public/assets/{src-BuzwpJZ-.js → src-dvZih_Vh.js} +1 -1
- package/dist/public/assets/{startup-marks-D0gyAKgY.js → startup-marks-DStB--sY.js} +1 -1
- package/dist/public/assets/{tag-pill-input-D1rYfOx4.js → tag-pill-input-CZmZF-XJ.js} +1 -1
- package/dist/public/assets/{target-navigation-intent-Bf41Ns6y.js → target-navigation-intent-BQU5n3Z_.js} +1 -1
- package/dist/public/assets/{telemetry-startup-EsQxKU36.js → telemetry-startup-DwkEBT3y.js} +1 -1
- package/dist/public/assets/{terminal-cli-display-BrLCqbMd.js → terminal-cli-display-Bd0HYJq3.js} +1 -1
- package/dist/public/assets/{terminal-command-events-CloL_dun.js → terminal-command-events-Dl_wyZ8W.js} +1 -1
- package/dist/public/assets/{terminal-telemetry-DBBf7dvq.js → terminal-telemetry-DLqNCiZH.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-CyxGjpoW.js → typing-burst-detector-BwBh8lkh.js} +1 -1
- package/dist/public/assets/{uninstall-BY4ebvpt.js → uninstall-B61_4YZE.js} +1 -1
- package/dist/public/assets/{use-activity-panel-114XoWfq.js → use-activity-panel-Cl6TYK1f.js} +1 -1
- package/dist/public/assets/{use-apply-config-color-theme-sUvEkbPv.js → use-apply-config-color-theme-QpFGIPF6.js} +1 -1
- package/dist/public/assets/{use-collab-url-BMqkaPvt.js → use-collab-url-DW8bwOaN.js} +1 -1
- package/dist/public/assets/{use-conflicts-2jTGKNOt.js → use-conflicts-pcxYwtG3.js} +1 -1
- package/dist/public/assets/{use-live-xterm-theme-BgQOsQLk.js → use-live-xterm-theme-79su-ECS.js} +1 -1
- package/dist/public/assets/{use-open-skill-DhmFoS02.js → use-open-skill-CC-Cxugv.js} +1 -1
- package/dist/public/assets/{use-settings-route-hU5QNNlM.js → use-settings-route-DMGQfb-V.js} +1 -1
- package/dist/public/assets/{use-skill-origin-FAiHzQpH.js → use-skill-origin-DbUW6s6z.js} +1 -1
- package/dist/public/assets/{use-skills-CI07Z3HF.js → use-skills-DQAWS2uW.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-CqCHYTWh.js → use-terminal-enabled-DAAuSBDz.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-BY6jlhQ-.js → use-timeline-entry-diff-D0kEZsvg.js} +1 -1
- package/dist/public/assets/{use-workspace-CfpIXxMZ.js → use-workspace-vRTzA3RL.js} +1 -1
- package/dist/public/index.html +52 -52
- package/dist/public/uninstall.html +3 -3
- package/dist/{registry-probes-DQTcgpB8.mjs → registry-probes-C133eEg2.mjs} +1 -1
- package/dist/{repair-launch-json-znn6W04D.mjs → repair-launch-json-Dg1iNDUl.mjs} +1 -1
- package/dist/{repair-mcp-configs-0aSQr0nM.mjs → repair-mcp-configs-CFC8Q6rq.mjs} +1 -1
- package/dist/src-CAD7Jq9J.mjs +1 -0
- package/dist/{src-DRvpu2Pc.mjs → src-CeTbcYYR.mjs} +1 -1
- package/dist/start-Cd7v3ush.mjs +1 -0
- package/dist/{start-DV546gMf.mjs → start-DVCuq0UU.mjs} +3 -3
- package/package.json +4 -4
- package/dist/constants-BmXRoN_y.mjs +0 -1
- package/dist/init-C-pPC1Zr.mjs +0 -1
- package/dist/loader-By_EKgl-.mjs +0 -1
- package/dist/preview-CHbSwlz5.mjs +0 -1
- package/dist/public/assets/FeedbackForm-Byfm4Jvi.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-yRhiyBSE.js +0 -1
- package/dist/public/assets/i18n-CRmWQMdd.js +0 -1
- package/dist/src-jvL9kWva.mjs +0 -1
- package/dist/start-BDvJdh1m.mjs +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as e,o as t,t as n}from"./rolldown-runtime-tZXQYakl.mjs";import{Gl as r,Hu as i,Ku as a,Ot as o,Vu as s,Wu as c,Xl as l,Xu as u,Yl as d,Zu as f,al as p,eu as m,qc as h,qo as g,qu as _,tl as v}from"./md-manager-BGnqyqi1-
|
|
1
|
+
import{i as e,o as t,t as n}from"./rolldown-runtime-tZXQYakl.mjs";import{Gl as r,Hu as i,Ku as a,Ot as o,Vu as s,Wu as c,Xl as l,Xu as u,Yl as d,Zu as f,al as p,eu as m,qc as h,qo as g,qu as _,tl as v}from"./md-manager-BGnqyqi1-Dg5Bl9Rs.mjs";import{Ao as y,Dr as b,F as x,Hi as S,Io as C,Ki as w,Ln as ee,Mr as te,P as ne,Tt as re,Ui as ie,Ur as ae,Wn as oe,Zt as se,_o as ce,bo as le,ia as ue,io as de,m as fe,oo as pe,rt as me,to as he,tt as ge,vo as _e,wo as T,xo as ve,xr as ye,yo as be,z as xe}from"./dist-CmS0s3u8.mjs";import{i as E,n as D,o as O,r as Se,s as k,t as A}from"./colors-r_owlCuY.mjs";import{t as j}from"./is-object-BGze3w87.mjs";import{t as Ce}from"./constants-Deih7i0K.mjs";import{t as we}from"./preview-BqDHlB4I.mjs";import{createRequire as Te}from"node:module";import{execFileSync as Ee}from"node:child_process";import De,{basename as Oe,dirname as M,isAbsolute as ke,join as N,posix as Ae,relative as P,resolve as F,sep as I,win32 as je}from"node:path";import L from"node:process";import{fileURLToPath as Me}from"node:url";import{cpSync as Ne,existsSync as R,lstatSync as Pe,mkdirSync as Fe,readFileSync as z,readdirSync as Ie,readlinkSync as Le,realpathSync as Re,rmSync as ze,statSync as Be,writeFileSync as Ve}from"node:fs";import{homedir as B}from"node:os";import*as He from"node:readline";import{inspect as Ue,stripVTControlCharacters as We,styleText as V}from"node:util";import{AsyncLocalStorage as Ge,AsyncResource as Ke}from"node:async_hooks";var qe=n((e=>{var t=class extends Error{constructor(e,t,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},n=class extends t{constructor(e){super(1,`commander.invalidArgument`,e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};e.CommanderError=t,e.InvalidArgumentError=n})),Je=n((e=>{let{InvalidArgumentError:t}=qe();var n=class{constructor(e,t){switch(this.description=t||``,this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case`<`:this.required=!0,this._name=e.slice(1,-1);break;case`[`:this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e}this._name.endsWith(`...`)&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,n)=>{if(!this.argChoices.includes(e))throw new t(`Allowed choices are ${this.argChoices.join(`, `)}.`);return this.variadic?this._collectValue(e,n):e},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function r(e){let t=e.name()+(e.variadic===!0?`...`:``);return e.required?`<`+t+`>`:`[`+t+`]`}e.Argument=n,e.humanReadableArgName=r})),Ye=n((e=>{let{humanReadableArgName:t}=Je();var n=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let t=e.commands.filter(e=>!e._hidden),n=e._getHelpCommand();return n&&!n._hidden&&t.push(n),this.sortSubcommands&&t.sort((e,t)=>e.name().localeCompare(t.name())),t}compareOptions(e,t){let n=e=>e.short?e.short.replace(/^-/,``):e.long.replace(/^--/,``);return n(e).localeCompare(n(t))}visibleOptions(e){let t=e.options.filter(e=>!e.hidden),n=e._getHelpOption();if(n&&!n.hidden){let r=n.short&&e._findOption(n.short),i=n.long&&e._findOption(n.long);!r&&!i?t.push(n):n.long&&!i?t.push(e.createOption(n.long,n.description)):n.short&&!r&&t.push(e.createOption(n.short,n.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let n=e.parent;n;n=n.parent){let e=n.options.filter(e=>!e.hidden);t.push(...e)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||``}),e.registeredArguments.find(e=>e.description)?e.registeredArguments:[]}subcommandTerm(e){let n=e.registeredArguments.map(e=>t(e)).join(` `);return e._name+(e._aliases[0]?`|`+e._aliases[0]:``)+(e.options.length?` [options]`:``)+(n?` `+n:``)}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleSubcommandTerm(t.subcommandTerm(n)))),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleArgumentTerm(t.argumentTerm(n)))),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+`|`+e._aliases[0]);let n=``;for(let t=e.parent;t;t=t.parent)n=t.name()+` `+n;return n+t+` `+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(`, `)}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue==`boolean`)&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0){let n=`(${t.join(`, `)})`;return e.description?`${e.description} ${n}`:n}return e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(`, `)}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let n=`(${t.join(`, `)})`;return e.description?`${e.description} ${n}`:n}return e.description}formatItemList(e,t,n){return t.length===0?[]:[n.styleTitle(e),...t,``]}groupItems(e,t,n){let r=new Map;return e.forEach(e=>{let t=n(e);r.has(t)||r.set(t,[])}),t.forEach(e=>{let t=n(e);r.has(t)||r.set(t,[]),r.get(t).push(e)}),r}formatHelp(e,t){let n=t.padWidth(e,t),r=t.helpWidth??80;function i(e,r){return t.formatItem(e,n,r,t)}let a=[`${t.styleTitle(`Usage:`)} ${t.styleUsage(t.commandUsage(e))}`,``],o=t.commandDescription(e);o.length>0&&(a=a.concat([t.boxWrap(t.styleCommandDescription(o),r),``]));let s=t.visibleArguments(e).map(e=>i(t.styleArgumentTerm(t.argumentTerm(e)),t.styleArgumentDescription(t.argumentDescription(e))));if(a=a.concat(this.formatItemList(`Arguments:`,s,t)),this.groupItems(e.options,t.visibleOptions(e),e=>e.helpGroupHeading??`Options:`).forEach((e,n)=>{let r=e.map(e=>i(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));a=a.concat(this.formatItemList(n,r,t))}),t.showGlobalOptions){let n=t.visibleGlobalOptions(e).map(e=>i(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));a=a.concat(this.formatItemList(`Global Options:`,n,t))}return this.groupItems(e.commands,t.visibleCommands(e),e=>e.helpGroup()||`Commands:`).forEach((e,n)=>{let r=e.map(e=>i(t.styleSubcommandTerm(t.subcommandTerm(e)),t.styleSubcommandDescription(t.subcommandDescription(e))));a=a.concat(this.formatItemList(n,r,t))}),a.join(`
|
|
2
2
|
`)}displayWidth(e){return r(e).length}styleTitle(e){return e}styleUsage(e){return e.split(` `).map(e=>e===`[options]`?this.styleOptionText(e):e===`[command]`?this.styleSubcommandText(e):e[0]===`[`||e[0]===`<`?this.styleArgumentText(e):this.styleCommandText(e)).join(` `)}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(` `).map(e=>e===`[options]`?this.styleOptionText(e):e[0]===`[`||e[0]===`<`?this.styleArgumentText(e):this.styleSubcommandText(e)).join(` `)}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,t,n,r){let i=` `.repeat(2);if(!n)return i+e;let a=e.padEnd(t+e.length-r.displayWidth(e)),o=(this.helpWidth??80)-t-2-2,s;return s=o<this.minWidthToWrap||r.preformatted(n)?n:r.boxWrap(n,o).replace(/\n/g,`
|
|
3
3
|
`+` `.repeat(t+2)),i+a+` `.repeat(2)+s.replace(/\n/g,`\n${i}`)}boxWrap(e,t){if(t<this.minWidthToWrap)return e;let n=e.split(/\r\n|\n/),r=/[\s]*[^\s]+/g,i=[];return n.forEach(e=>{let n=e.match(r);if(n===null){i.push(``);return}let a=[n.shift()],o=this.displayWidth(a[0]);n.forEach(e=>{let n=this.displayWidth(e);if(o+n<=t){a.push(e),o+=n;return}i.push(a.join(``));let r=e.trimStart();a=[r],o=this.displayWidth(r)}),i.push(a.join(``))}),i.join(`
|
|
4
4
|
`)}};function r(e){return e.replace(/\x1b\[\d*(;\d*)*m/g,``)}e.Help=n,e.stripColor=r})),Xe=n((e=>{let{InvalidArgumentError:t}=qe();var n=class{constructor(e,t){this.flags=e,this.description=t||``,this.required=e.includes(`<`),this.optional=e.includes(`[`),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let n=a(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith(`--no-`)),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;return typeof e==`string`&&(t={[e]:!0}),this.implied=Object.assign(this.implied||{},t),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,n)=>{if(!this.argChoices.includes(e))throw new t(`Allowed choices are ${this.argChoices.join(`, `)}.`);return this.variadic?this._collectValue(e,n):e},this}name(){return this.long?this.long.replace(/^--/,``):this.short.replace(/^-/,``)}attributeName(){return this.negate?i(this.name().replace(/^no-/,``)):i(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},r=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(e=>{e.negate?this.negativeOptions.set(e.attributeName(),e):this.positiveOptions.set(e.attributeName(),e)}),this.negativeOptions.forEach((e,t)=>{this.positiveOptions.has(t)&&this.dualOptions.add(t)})}valueFromOption(e,t){let n=t.attributeName();if(!this.dualOptions.has(n))return!0;let r=this.negativeOptions.get(n).presetArg,i=r!==void 0&&r;return t.negate===(i===e)}};function i(e){return e.split(`-`).reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}function a(e){let t,n,r=/^-[^-]$/,i=/^--[^-]/,a=e.split(/[ |,]+/).concat(`guard`);if(r.test(a[0])&&(t=a.shift()),i.test(a[0])&&(n=a.shift()),!t&&r.test(a[0])&&(t=a.shift()),!t&&i.test(a[0])&&(t=n,n=a.shift()),a[0].startsWith(`-`)){let t=a[0],n=`option creation failed due to '${t}' in option flags '${e}'`;throw/^-[^-][^-]/.test(t)?Error(`${n}
|
|
@@ -689,5 +689,5 @@ export default function okBridge(pi: {
|
|
|
689
689
|
`));let g=`${s?``:``}${m}`;return g!==o&&T(e,g,{mode:pa(e)}),a&&g===o?{kind:`unchanged`}:{kind:d?`overwritten`:`written`}}const oo=e=>e!==`project`,so=e=>e!==`user`;async function co(){let e=await Sa({message:`Where should the MCP server be configured?
|
|
690
690
|
`,required:!1,theme:{icon:{checked:`[x]`,unchecked:`[ ]`}},choices:[{name:`User-level (~/.claude.json, ~/.cursor/mcp.json, …)`,value:`user`,checked:!0},{name:`Project-level (.mcp.json, .cursor/mcp.json, …)`,value:`project`,checked:!0}]});return e.includes(`user`)&&e.includes(`project`)?`both`:e.includes(`user`)?`user`:e.includes(`project`)?`project`:null}async function lo(e){return e.mcp===!1?null:e.scope?e.scope:e.isTTY??process.stdout.isTTY?(e.promptFn??co)():`both`}async function uo(e){return Da({message:`How do you want to handle OpenKnowledge config files (.ok/, .mcp.json)?`,default:e,choices:[{name:`Share with my team (commit alongside content)`,value:`shared`,description:`OK config gets committed alongside your project content.`},{name:`Local only (keep out of git via .git/info/exclude)`,value:`local-only`,description:"OK config stays on this machine only; teammates do not see it. Safe escape hatch via `ok config-sharing share`."}]})}async function fo(e){if(e.sharing!==void 0)return e.sharing;let t=Hi(e.projectRoot)===`local-only`||e.freshProject===!0?`local-only`:`shared`;return e.isTTY??process.stdout.isTTY?(e.promptFn??uo)(t):t}var po=class extends Error{constructor(e){super(e),this.name=`ContentDirError`}};function mo(e){if(e===void 0||e===!0)return new Set(ge);if(e===!1)return new Set;let t=e.split(`,`).map(e=>e.trim()).filter(Boolean);return new Set(re.filter(e=>t.includes(e)))}function ho(e,t,n){let r=F(n,e),i;try{i=Be(r)}catch(e){let t=e.code;throw t===`ENOENT`?new po(`--content-dir path does not exist: ${r}`):new po(`--content-dir path is not accessible (${t??`unknown error`}): ${r}`)}if(!i.isDirectory())throw new po(`--content-dir must be a directory: ${r}`);let a=go(t),o=go(r),s=P(a,o);if(s.startsWith(`..`)||ke(s))throw new po(`--content-dir must be inside the project root (${t}); got ${r}`);return s===``?`.`:s}function go(e){try{return Re(e)}catch{return e}}const _o=`open-knowledge-ui`;function vo(e,t,n){try{let r=e.detectPath?.(t,n)??M(e.configPath(t,n));return R(r)}catch{return!1}}function yo(e,t,n){try{let r=F(M(e.configPath(t,n))),i=F(e.detectPath?.(t,n)??r);return i===r||r.startsWith(i+I)}catch{return!1}}function bo(e,t,n,r,i){let a=e.serverName(t),o;try{o=i??e.configPath(t,r)}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:``,serverName:a,error:t instanceof Error?t.message:String(t)}}let s=n.pruneOnly===!0;if(s&&(e.format===`file`||!R(o)))return{editorId:e.id,label:e.label,action:`skipped-flag`,configPath:o,serverName:a,...i===void 0?{}:{configScope:`project`}};let c=!n.skipAvailabilityCheck||e.offerOnlyWhenDetected===!0||yo(e,t,r);if(!i&&c&&!vo(e,t,r))return{editorId:e.id,label:e.label,action:`skipped-missing`,configPath:o,serverName:a};if(i!==void 0)try{Qi(o,t)}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:t instanceof Error?t.message:String(t),configScope:`project`}}if(e.format===`file`)return So(e,o,a,n,{isProjectScope:i!==void 0});let l;try{l=e.buildEntry(t,n)}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:t instanceof Error?t.message:String(t),...i===void 0?{}:{configScope:`project`}}}try{s||Fe(M(o),{recursive:!0})}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:t instanceof Error?t.message:String(t),...i===void 0?{}:{configScope:`project`}}}let u={action:`written`},d;try{y(`${o}.lock`,()=>{let t=Ba(o).writePath;if(s||Fe(M(t),{recursive:!0}),e.format===`toml`){let r=no(Rr(),t,e.topLevelKey,a,l,n.replaceEntry===!0,n.pruneOnly===!0);u.action=r.kind,r.kind===`declined`&&(u.declineReason=r.reason);return}if(e.format===`yaml`){let r=ao(t,e.topLevelKey,a,l,n.replaceEntry===!0,n.pruneOnly===!0);u.action=r.kind,r.kind===`declined`&&(u.declineReason=r.reason);return}let r=to(t,e.topLevelKey,a,l,e.serverMapSubKey,n.replaceEntry===!0,n.pruneOnly===!0);u.action=r.kind,r.kind===`declined`&&(u.declineReason=r.reason)},{onWarn:(e,t)=>process.stderr.write(`[ok] ${e} ${JSON.stringify(t)}\n`)})}catch(e){d=e instanceof Error?e:Error(String(e))}return d?{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:d.message,...i===void 0?{}:{configScope:`project`}}:u.action===`declined`?{editorId:e.id,label:e.label,action:`declined`,configPath:o,serverName:a,declineReason:u.declineReason,...i===void 0?{}:{configScope:`project`}}:{editorId:e.id,label:e.label,action:u.action===`unchanged`?`skipped-flag`:u.action,configPath:o,serverName:a,...i===void 0?{}:{configScope:`project`}}}const xo={pi:Ma};function So(e,t,n,r,i){let a=i.isProjectScope?{configScope:`project`}:{},o=r=>({editorId:e.id,label:e.label,action:`failed`,configPath:t,serverName:n,error:r instanceof Error?r.message:String(r),...a}),s=xo[e.id];if(!s)return o(Error(`No managed-file builder registered for editor "${e.id}" (format: 'file' targets need a MANAGED_FILE_BUILDERS entry).`));let c;try{c=s(r)}catch(e){return o(e)}try{Fe(M(t),{recursive:!0})}catch(e){return o(e)}let l={action:`written`};try{y(`${t}.lock`,()=>{let e=null;try{e=z(t,`utf-8`)}catch{e=null}if(e===c){l.action=`overwritten`;return}T(t,c,e===null?void 0:{mode:pa(t)}),l.action=e===null?`written`:`overwritten`},{onWarn:(e,t)=>process.stderr.write(`[ok] ${e} ${JSON.stringify(t)}\n`)})}catch(e){return o(e)}return{editorId:e.id,label:e.label,action:l.action,configPath:t,serverName:n,...a}}function Co(e,t){let n=e.projectConfigPath?.(t);if(!(!n||!R(n)))return{editorId:e.id,label:e.label,path:n}}async function wo(e){let t=Fi(e.editors).filter(e=>e.scope===`global`),n={mode:`published`,skipAvailabilityCheck:!0,...e.replaceEntry===!0?{replaceEntry:!0}:{},...e.pruneOnly===!0?{pruneOnly:!0}:{}};return t.map(t=>bo(t,``,n,e.home))}function To(e,t,n,r){let i=Do(e,t,n,r);return i.kind===`present`?i.entry:null}function Eo(e,t,n,r){let i=eo(e,t,r);if(!j(i))return{kind:`no-entry`};let a=i[n];return j(a)?{kind:`present`,entry:a}:{kind:`no-entry`}}function Do(e,t,n,r){let i;try{i=r??e.configPath(t,n)}catch{return{kind:`absent`}}if(!R(i))return{kind:`absent`};try{if(Be(i).size>Ja)return{kind:`decline`,reason:`oversize`}}catch{return{kind:`decline`,reason:`unparseable`}}let a;try{a=z(i,`utf-8`)}catch{return{kind:`decline`,reason:`unparseable`}}if(a.trim()===``)return{kind:`absent`};if(e.format===`file`)return{kind:`present`,entry:ja(a)};let o=e.serverName(t);if(e.format===`toml`){let t;try{t=Rr().parseToObject(a)}catch{return{kind:`decline`,reason:`unparseable`}}return Eo(t,e.topLevelKey,o,e.serverMapSubKey)}if(e.format===`yaml`){let t=(0,Dr.parseDocument)(a.charCodeAt(0)===65279?a.slice(1):a);return t.errors.length>0?{kind:`decline`,reason:`unparseable`}:Eo(t.toJS()??{},e.topLevelKey,o,e.serverMapSubKey)}let s=Ua(a);return s?Wa(s,e.topLevelKey)>1?{kind:`decline`,reason:`duplicate-container`}:Eo(_e(s),e.topLevelKey,o,e.serverMapSubKey):{kind:`decline`,reason:`unparseable`}}async function Oo(e={}){let t=F(e.cwd??process.cwd()),n=Fa(t,{homeDir:e.home}),r=n.projectRoot;if(te(r,e.home??B()))throw new xe(r);let i=!R(N(r,`.ok`)),a=n.gitRootPromoted?P(r,t):void 0,o=e.contentDir===void 0?n.defaultContentDir:ho(e.contentDir,r,t);n.ancestorPromoted?console.log(`[ok] Opened existing project at ${r}`):n.gitRootPromoted&&i&&o===`.`&&process.stderr.write(`${k(`[ok] Content scope promoted to the git repo root: ${r}`)}\n Ran in ${a}/, but .ok/ lives at the git root (one .ok/ per git repo),\n so the whole repo is now the content scope. To narrow it, re-run with\n \`ok init --content-dir .\`, or set content.dir: ${a} in .ok/config.yml.\n`);let s={mode:e.devMcp?`dev`:`published`},c=await oe(r),l;try{l=ye(r,{contentDir:o})}catch(t){let i=$.claude.configPath(r,e.home);return{projectRoot:r,contentCreated:[],contentUpdated:[],contentSkipped:[],editors:[],projectSkills:[],legacyProjectConfigs:[],didGitInit:c.didInit,rootGitignoreCreated:!1,gitRootPromoted:n.gitRootPromoted,promotedFromDir:a,contentDirRequested:e.contentDir,contentScaffoldFailed:!0,mcpAction:`failed`,mcpPath:i,mcpError:`Content scaffolding failed: ${t instanceof Error?t.message:String(t)}`,sharing:{kind:`no-exclude`,reason:`no-git`,localOnlyRequested:!1}}}let u=l.created.includes(Ce),d=!1;if(c.didInit)try{d=pe(r)===`created`}catch(e){console.warn(`[ok] Skipping .gitignore seed at ${r}: ${e instanceof Error?e.message:String(e)}`)}try{S(r)===`removed`&&console.warn(`[ok] Removed the OpenKnowledge project-skill lines from .gitignore. The skill is ordinary project content now — commit it if your team wants it on clone.`)}catch(e){console.warn(`[ok] Skipping project-skill .gitignore cleanup at ${r}: ${e instanceof Error?e.message:String(e)}`)}let f=await lo({scope:e.scope,mcp:e.mcp,isTTY:e.isTTY,promptFn:e.promptFn}),m=e.editors??Po(r,e.home),h=e.editors??m,g=Fi(m),_=Fi(h),v=e.mcp===!1||f===null,y=Array.from(new Map([...g,...v?[]:_].map(e=>[e.id,e])).values()),x=g.filter(t=>vo(t,r,e.home)),C=[],w=[],ne=new Set;for(let t of y){if(v){let n=``;try{n=t.configPath(r,e.home)}catch{}C.push({editorId:t.id,label:t.label,action:`skipped-flag`,configPath:n,serverName:t.serverName(r)});continue}if(oo(f)&&g.includes(t)&&t.scope===`global`&&C.push(bo(t,r,s,e.home)),so(f)&&_.includes(t)&&t.projectConfigPath){let n=t.projectConfigPath(r),i=bo(t,r,s,e.home,n);C.push(i),(i.action===`written`||i.action===`overwritten`)&&ne.add(n)}}let ae=new Set;for(let t of _){let n=t.projectSkillPath?.(r);!n||ae.has(n)||(ae.add(n),w.push(la(t,r,{home:e.home})))}let se=ca(r,_.map(e=>e.id));se&&w.push(se);let ce=w.filter(e=>e.action===`written`||e.action===`overwritten`).map(e=>e.editorId);if(ce.length>0){let t=e.home??B();ie({source:p,skills:[fe.project],agents:ce,scope:r},{home:t,enabled:ue(t).enabled})}let le=!v&&f!==null&&so(f)?_.filter(e=>!e.projectConfigPath&&!e.projectSkillPath).map(e=>e.label):void 0,me=v?[]:x.map(e=>Co(e,r)).filter(e=>e!==void 0).filter(e=>!ne.has(e.path)),he=e.installUserSkill??b,ge=e.home??B(),_e=mo(e.skills),T=!1,ve=!1,be=!1,E=!1,D=!1;for(let t of re){if(!_e.has(t))continue;await de(ge,fe[t],!0).catch(()=>{}),T=!0;let n=await he({home:e.home,bundleId:t,force:!0});n===`installed`?ve=!0:n===`failed`?be=!0:n===`no-hosts`?D=!0:E=!0}let O=be?`failed`:ve?`installed`:T&&E?`skip-current`:T&&D?`no-hosts`:`declined`,Se=ve?ee(ge).map(e=>e.editorId):[],A=v?`skipped-flag`:`skipped-missing`,j=C.find(e=>e.editorId===`claude`)??C[0]??{action:A,configPath:$.claude.configPath(r,e.home)},we=await ko({projectRoot:r,desiredMode:await fo({sharing:e.sharing,projectRoot:r,isTTY:e.isTTY,freshProject:i,promptFn:e.sharingPromptFn}),explicitFlag:e.sharing});return{projectRoot:r,contentCreated:l.created,contentUpdated:l.updated,contentSkipped:l.skipped,editors:C,projectSkills:w,legacyProjectConfigs:me,skillInstall:O,skillHosts:Se,didGitInit:c.didInit,rootGitignoreCreated:d,gitRootPromoted:n.gitRootPromoted,promotedFromDir:a,contentDir:u?o:void 0,contentDirRequested:e.contentDir,contentScaffoldFailed:!1,mcpAction:j.action,mcpPath:j.configPath,mcpError:`error`in j?j.error:void 0,projectScopeUnsupportedLabels:le,sharing:we}}async function ko(e){let{projectRoot:t,desiredMode:n,explicitFlag:r}=e,i=Hi(t);if(i===`no-git`)return{kind:`no-exclude`,reason:`no-git`,localOnlyRequested:r===`local-only`};let a=Ri(t);if(n===`local-only`){let e=Bi(t,a);if(e.kind===`refused-tracked`){let t=e;return{kind:`refused-tracked`,tracked:t.tracked,remediation:t.remediation}}return e.kind===`no-exclude`?{kind:`no-exclude`,reason:e.reason,localOnlyRequested:r===`local-only`}:Ao(t,e,`add`)}if(i===`shared`)return{kind:`applied`,mode:`shared`,action:`noop`,appended:[],alreadyPresent:[],removed:[]};let o=Vi(t,a);return o.kind===`no-exclude`?{kind:`no-exclude`,reason:o.reason,localOnlyRequested:!1}:Ao(t,o,`remove`)}function Ao(e,t,n){let r=Hi(e);return n===`add`?{kind:`applied`,mode:r,action:t.appended.length>0?`added`:t.removed.length>0?`cleaned`:`noop`,appended:t.appended,alreadyPresent:t.alreadyPresent,removed:t.removed}:{kind:`applied`,mode:r,action:`removed`,appended:[],alreadyPresent:[],removed:t.removed}}function jo(e){switch(e){case`oversize`:return`config too large to edit safely`;case`duplicate-container`:return`duplicate server block`;case`no-native-writer`:return`no format-preserving writer available`;default:return`config not readable`}}function Mo(e,t){let n=[],r=e.editors.some(e=>e.action===`written`||e.action===`overwritten`),i=e.editors.some(e=>e.action===`failed`)||e.projectSkills.some(e=>e.action===`failed`),a=e.editors.length>0&&e.editors.every(e=>e.action===`skipped-flag`),o=e.editors.length>0&&e.editors.every(e=>e.action===`skipped-missing`);e.didGitInit&&n.push(`Initialized git repo at ${t}/.git/ (default branch: main)`),e.rootGitignoreCreated&&n.push(`Seeded .gitignore at ${t}/.gitignore (.DS_Store)`);let s=N(t,`.ok`);if(e.contentCreated.length>0||e.contentUpdated.length>0?(n.push(A(`Content scaffolded at ${s}/`)),e.contentCreated.length>0&&n.push(` Created: ${e.contentCreated.join(`, `)}`),e.contentUpdated.length>0&&n.push(` Updated: ${e.contentUpdated.join(`, `)}`)):n.push(A(`Content already present at ${s}/`)),e.contentSkipped.length>0&&n.push(` Skipped (already exist): ${e.contentSkipped.join(`, `)}`),n.push(``),e.mcpError&&e.editors.length===0)n.push(`Warning: ${e.mcpError}`);else if(e.editors.length===0){if(n.push(A(`MCP server configuration:`)),e.mcpAction===`skipped-flag`)n.push(` MCP config not written — use without --no-mcp to configure editors`);else if(e.projectScopeUnsupportedLabels&&e.projectScopeUnsupportedLabels.length>0){let t=e.projectScopeUnsupportedLabels.join(`, `),r=e.projectScopeUnsupportedLabels.length===1?`does`:`do`;n.push(` ${t} ${r} not support project-level config; skipped`)}else n.push(` No supported editor config directories detected; skipped MCP registration`)}else if(a)n.push(`MCP config not written — use without --no-mcp to configure editors`);else if(o)n.push(A(`MCP server configuration:`)),n.push(` No supported editor config directories detected; skipped MCP registration`);else{n.push(A(`MCP server configuration:`));for(let r of e.editors){let e=r.configPath.startsWith(t)?P(t,r.configPath):r.configPath.replace(/^\/Users\/[^/]+/,`~`),i=r.serverName===`open-knowledge`?``:` (${r.serverName})`,a=r.configScope===`project`?` (project)`:``,o=`${r.label}${a}`,s=` `.repeat(Math.max(1,20-o.length)),c=r.editorId===`claude-desktop`&&(r.action===`written`||r.action===`overwritten`)?` — quit and relaunch Claude Desktop to activate`:``;switch(r.action){case`written`:n.push(` ${o}${s}${e} ${O(`registered`)}${i}${c}`);break;case`overwritten`:n.push(` ${o}${s}${e} ${O(`updated`)}${i}${c}`);break;case`skipped-missing`:n.push(` ${o}${s}${e} config root missing; skipped`);break;case`failed`:n.push(` ${o}${s}${e} ${Se(`FAILED`)}: ${r.error}`);break;case`declined`:n.push(` ${o}${s}${e} left unchanged (${jo(r.declineReason)})`);break;case`skipped-flag`:break;default:r.action}}if(e.projectScopeUnsupportedLabels&&e.projectScopeUnsupportedLabels.length>0){let t=e.projectScopeUnsupportedLabels.join(`, `),r=e.projectScopeUnsupportedLabels.length===1?`does`:`do`;n.push(` ${t} ${r} not support project-level config; skipped`)}}if(e.projectSkills.length>0){n.push(``),n.push(A(`Project-local skills:`));for(let r of e.projectSkills){let e=`${r.label} (project)`,i=` `.repeat(Math.max(1,20-e.length)),a=r.path?P(t,r.path):``;switch(r.action){case`written`:n.push(` ${e}${i}${a} ${O(`installed`)}`);break;case`overwritten`:n.push(` ${e}${i}${a} ${O(`updated`)}`);break;case`skipped-unsupported`:n.push(` ${e}${i}no known project skill surface; skipped`);break;case`skipped-prerequisite`:n.push(` ${e}${i}OpenKnowledge MCP is not configured; skipped`);break;case`failed`:n.push(` ${e}${i}${a} ${Se(`FAILED`)}: ${r.error}`)}}}if(i&&(n.push(``),n.push(`For failed editors, add the MCP server entry or project skill manually. See:`),n.push(` https://github.com/inkeep/open-knowledge#mcp-setup`)),e.legacyProjectConfigs.length>0){n.push(``),n.push(`Project MCP configs found:`);for(let r of e.legacyProjectConfigs)n.push(` ${r.label} ${P(t,r.path)}`);n.push(` These project-local files may override the global config. Remove them if you want fully user-scoped MCP setup in this project.`)}if(e.skillInstall)switch(n.push(``),n.push(A(`User-global skill:`)),e.skillInstall){case`installed`:{let t=(e.skillHosts??[]).map(e=>X[e]??e),r=t.length>0?t.join(`, `):`the shared ~/.agents store`;n.push(` open-knowledge ${O(`installed for ${r}`)}`),n.push(` ${D(`Counted on skills.sh (skill name + source repo, once per machine).`)}`),n.push(` ${D(`Opt out: DO_NOT_TRACK=1, or Settings → User → Preferences.`)}`);break}case`skip-current`:n.push(` open-knowledge ${O(`already installed at current version`)}`);break;case`declined`:n.push(` open-knowledge ${D(`skipped for this run (--no-skills)`)}`),n.push(` ${D(`Nothing was installed or removed. Any built-in skills already on this`)}`),n.push(` ${D(`machine are untouched. Run init without the flag to install them:`)}`),n.push(` ${D(` ok init`)}`);break;case`no-hosts`:n.push(` open-knowledge ${D(`skipped — no supported agent host detected in your home directory`)}`);break;case`failed`:n.push(` ${k(`open-knowledge install failed — MCP still configured; retry with:`)}`),n.push(` ${k(` ok repair-skills`)}`)}if(e.contentDirRequested!==void 0&&e.contentDir===void 0&&!e.contentScaffoldFailed?(n.push(``),n.push(k(`⚠ --content-dir ${e.contentDirRequested} ignored — .ok/config.yml already exists`)),n.push(` Edit .ok/config.yml → content.dir directly to change the content scope.`)):e.contentDir!==void 0&&e.contentDir!==`.`?(n.push(``),n.push(`Content scope set to ${e.contentDir}/ (content.dir in .ok/config.yml).`)):e.gitRootPromoted&&e.contentDir===`.`&&e.contentDirRequested===void 0&&(n.push(``),n.push(k(`⚠ Content scope promoted to the git repo root`)),n.push(` .ok/ was initialized at ${t} because it contains a .git folder (one .ok/ per git repo),`),n.push(` not the sub-folder you ran \`ok init\` in${e.promotedFromDir?` (${e.promotedFromDir})`:``}. The whole repo is now the content scope.`),e.promotedFromDir&&(n.push(" To scope to just that sub-folder, re-run `ok init --content-dir .` from there, or set"),n.push(` content.dir: ${e.promotedFromDir} in .ok/config.yml.`))),e.preview?(n.push(``),n.push(we(e.preview,t))):e.previewWarning&&(n.push(``),n.push(`Content preview unavailable: ${e.previewWarning}`)),n.push(``),n.push(...Lo(e.sharing,t)),r){let t=new Set,r=e.editors.filter(e=>e.action===`written`||e.action===`overwritten`).filter(e=>!t.has(e.editorId)&&t.add(e.editorId)).map(e=>e.label);n.push(``),n.push(`${O(`✓`)} ${A(`Next steps:`)}`),n.push(` 1. Open your editor (${E(r.join(` / `))})`),n.push(` 2. Approve the MCP server when prompted`),n.push(` 3. (Optional) scaffold the starter knowledge-base structure:`),n.push(` - ${E(`ok seed --list-packs`)} — browse the starter packs`),n.push(` - ${E(`ok seed`)} — scaffold an empty repo`),n.push(` 4. Ask your agent to capture a source, research a topic, or build a wiki —`),n.push(` the procedures ship as skills alongside the MCP tools.`)}return n.join(`
|
|
691
691
|
`)}function No(e,t){return{projectRoot:e.projectRoot,gitRootPromoted:e.gitRootPromoted,promotedFromDir:e.promotedFromDir??null,contentDir:t.contentDir,contentDirRequested:e.contentDirRequested??null,contentDirApplied:e.contentDir!==void 0,contentFileCount:t.contentFileCount,previewError:e.previewWarning??null,didGitInit:e.didGitInit,mcpAction:e.mcpAction,editors:e.editors.map(e=>({editorId:e.editorId,label:e.label,action:e.action,configPath:e.configPath,scope:e.configScope===`project`?`project`:`user`}))}}function Po(e,t){let n=[];for(let r of Br)r!==`claude-desktop`&&vo($[r],e,t)&&n.push(r);return n}function Fo(){let e={log:console.log,info:console.info,debug:console.debug},t=(...e)=>{process.stderr.write(`${e.map(e=>typeof e==`string`?e:Ue(e)).join(` `)}\n`)};return console.log=t,console.info=t,console.debug=t,()=>{console.log=e.log,console.info=e.info,console.debug=e.debug}}function Io(){return new ot(`init`).description(`Scaffold .ok/ 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 .ok/ 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`).option(`--content-dir <dir>`,`Limit content to <dir> instead of the whole project. <dir> is interpreted relative to your current directory (e.g. "." = the folder you run the command in), then saved to .ok/config.yml as content.dir.`).option(`--json`,`Emit a structured JSON summary to stdout (diagnostics stay on stderr)`).option(`--skills <ids>`,`Install only the named user-global skill bundles (comma list: discovery,write-skill)`).option(`--no-skills`,`Do not install any user-global skill bundles`).addOption(new ct(`--scope <scope>`,`Write MCP config at user level, project level, or both`).choices([`user`,`project`,`both`])).addOption(new ct(`--shared`,`Commit OK config alongside content (the default for fresh repos)`).conflicts(`localOnly`)).addOption(new ct(`--local-only`,`Keep OK config out of git via .git/info/exclude (per-clone, not committed)`).conflicts(`shared`)).action(async e=>{let t=process.cwd(),n=e.shared?`shared`:e.localOnly?`local-only`:void 0,r=e.json?Fo():null;try{let r;try{r=await Oo({cwd:t,mcp:e.mcp,devMcp:e.devMcp,scope:e.scope,sharing:n,contentDir:e.contentDir,skills:e.skills})}catch(e){if(e instanceof po||e instanceof xe){process.stderr.write(`${e.message}\n`),process.exitCode=64;return}if(e instanceof ne||e instanceof x){process.stderr.write(`${e.message}\n`),process.exitCode=78;return}if(e instanceof me){process.stderr.write(`open-knowledge could not initialize a git repo for this project. Re-run, or run 'git init' yourself in the project folder.
|
|
692
|
-
`),e.stderr&&process.stderr.write(`${e.stderr.trim()}\n`),process.exitCode=1;return}throw e}let i=r.contentDir??`.`,a=null,{loadConfig:o}=await import(`./loader-
|
|
692
|
+
`),e.stderr&&process.stderr.write(`${e.stderr.trim()}\n`),process.exitCode=1;return}throw e}let i=r.contentDir??`.`,a=null,{loadConfig:o}=await import(`./loader-BzFUiCkF.mjs`),{resolveContentDir:s}=await import(`./dist-CSFai4j1.mjs`),c;try{c=o(r.projectRoot).config,i=c.content.dir}catch(e){r.previewWarning=e instanceof Error?e.message:String(e)}if(c)try{let{previewContent:e}=await import(`./preview-f4iVephM.mjs`),t=s(c,r.projectRoot);r.preview=e({projectDir:r.projectRoot,contentDir:t}),a=r.preview.totalCount}catch(e){r.previewWarning=e instanceof Error?e.message:String(e)}e.json?process.stdout.write(`${JSON.stringify(No(r,{contentDir:i,contentFileCount:a}),null,2)}\n`):process.stdout.write(`${Mo(r,r.projectRoot)}\n`),(r.editors.some(e=>e.action===`failed`)||r.mcpAction===`failed`)&&(process.exitCode=1)}finally{r?.()}})}function Lo(e,t){let n=[];switch(e.kind){case`applied`:return n.push(A(`Sharing mode:`)),e.mode===`local-only`?e.action===`added`?(n.push(` ${O(`local-only`)} — appended ${e.appended.length} path(s) to ${A(`${t}/.git/info/exclude`)} (per-clone, not committed).`),e.removed.length>0&&n.push(` cleared ${e.removed.length} stale entry(s) left by an older version: ${e.removed.join(`, `)}.`)):e.action===`cleaned`?n.push(` ${O(`local-only`)} — already excluded; cleared ${e.removed.length} stale entry(s) left by an older version: ${e.removed.join(`, `)}.`):e.action===`noop`&&e.alreadyPresent.length>0?n.push(` ${O(`local-only`)} — already excluded; nothing to do.`):n.push(` ${O(`local-only`)}`):e.action===`removed`?n.push(` ${O(`shared`)} — removed OK paths from ${A(`${t}/.git/info/exclude`)}; commit the files to share with teammates.`):n.push(` ${O(`shared`)} — OK config will be committed alongside content.`),n;case`refused-tracked`:n.push(k(`Sharing mode: switch to local-only deferred`));for(let t of e.remediation.split(`
|
|
693
693
|
`))n.push(t.length>0?` ${t}`:``);return n.push(` Re-run ${E(`ok config-sharing unshare`)} after resolving to complete the switch.`),n;case`no-exclude`:if(e.localOnlyRequested)n.push(k(`Sharing mode: --local-only requested but no git repo found — option ignored`)),n.push(` Run ${E(`git init`)} (or open this folder via OK Desktop, which can scaffold a repo) and then ${E(`ok config-sharing unshare`)}.`);else if(e.reason===`no-git`)return[];else n.push(k(`Sharing mode unavailable: ${e.reason}.`));return n}}export{Zr as $,ta as A,Ri as B,Ma as C,pa as D,Sa as E,la as F,X as G,Hi as H,Bi as I,Z as J,$ as K,Gi as L,$i as M,ua as N,fa as O,na as P,_i as Q,Ui as R,Fa as S,Da as T,Vi as U,Wi as V,Br as W,mi as X,hi as Y,gi as Z,Oo as _,ct as _t,No as a,ii as at,wo as b,Mo as c,Xn as ct,vo as d,Gt as dt,ei as et,To as f,Wt as ft,fo as g,it as gt,ho as h,ot as ht,ko as i,Ai as it,Qi as j,ma as k,Lo as l,zn as lt,lo as m,vt as mt,_o as n,Q as nt,Do as o,zr as ot,mo as p,U as pt,Vr as q,xo as r,yi as rt,Po as s,Rr as st,po as t,vi as tt,Io as u,Jt as ut,Qa as v,Aa as w,yo as x,bo as y,zi as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./dist-CmS0s3u8.mjs";import{_ as e}from"./init-CtwvSCyQ.mjs";export{e as runInit};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{vo as e,wo as t,xo as n}from"./dist-
|
|
1
|
+
import{vo as e,wo as t,xo as n}from"./dist-CmS0s3u8.mjs";import{D as r,k as i}from"./init-CtwvSCyQ.mjs";import{t as a}from"./is-object-BGze3w87.mjs";import{join as o}from"node:path";import{existsSync as s,readFileSync as c}from"node:fs";const l={allowTrailingComma:!0,disallowComments:!1};function u(e,t){return e.error===1&&e.offset===0&&t.charCodeAt(0)===65279}function d(a){let d=o(a,`.claude`,`launch.json`);if(!s(d))return{kind:`not-present`};let p;try{p=c(d,`utf-8`)}catch{return{kind:`declined`}}let m=[],h=n(p,m,l)??void 0;if(m.some(e=>!u(e,p))||h?.type!==`object`)return{kind:`declined`};let g=e(h).configurations;if(!Array.isArray(g))return{kind:`not-present`};let _=g.findIndex(f);if(_===-1)return{kind:`not-present`};let{text:v,changed:y}=i(p,[`configurations`,_]);return y?(t(d,v,{mode:r(d)}),{kind:`removed`}):{kind:`not-present`}}function f(e){if(!a(e))return!1;let t=e;if(t.name!==`open-knowledge-ui`||!Array.isArray(t.runtimeArgs))return!1;let n=t.runtimeArgs;return t.runtimeExecutable===`/bin/sh`?n.length===3&&n[0]===`-l`&&n[1]===`-c`&&typeof n[2]==`string`&&/^# ok-ui-v[1-9]\d*$/.test(n[2].split(/\r?\n/,1)[0]??``):t.runtimeExecutable===`npx`?p.some(e=>m(n,e)):t.runtimeExecutable===`powershell`&&n.length===4&&n[0]===`-NoProfile`&&n[1]===`-NonInteractive`&&n[2]===`-Command`&&typeof n[3]==`string`&&/^# ok-ui-win-v[1-9]\d*$/.test(n[3].split(/\r?\n/,1)[0]??``)}const p=[[`@inkeep/open-knowledge`,`ui`],[`-y`,`@inkeep/open-knowledge`,`ui`],[`-y`,`@inkeep/open-knowledge@latest`,`ui`]];function m(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}export{d as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./loader-DlB4rhjA.mjs";export{e as loadConfig};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Fc as e,Gl as t,_c as n,hc as r,wc as i,za as a,zo as o}from"./md-manager-BGnqyqi1-
|
|
1
|
+
import{Fc as e,Gl as t,_c as n,hc as r,wc as i,za as a,zo as o}from"./md-manager-BGnqyqi1-Dg5Bl9Rs.mjs";import{Eo as s,Oo as c,b as l}from"./dist-CmS0s3u8.mjs";import{t as u}from"./is-object-BGze3w87.mjs";import{t as d}from"./constants-Deih7i0K.mjs";import{resolve as f}from"node:path";import{existsSync as p,readFileSync as m}from"node:fs";import{realpath as h}from"node:fs/promises";var g=t();async function _(e){let t=f(e);try{return await h(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}}function v(e){if(!p(e))return{value:null,path:e,source:null,doc:null};let t;try{t=m(e,`utf-8`)}catch(t){let n=t instanceof Error?t.message:String(t);return console.warn(`[config] Failed to read ${e}: ${n}`),{value:null,path:e,source:null,doc:null,diagnostic:{code:`UNREADABLE`,detail:`${e}: ${n}`}}}let n=(0,g.parseDocument)(t);if(n.errors.length>0){let r=n.errors.map(e=>e.message).join(`; `);return console.warn(`[config] Failed to parse ${e}: ${r}`),{value:null,path:e,source:t,doc:null,diagnostic:{code:`YAML_PARSE`,detail:`${e}: ${r}`}}}let r=n.toJSON();return u(r)?{value:r,path:e,source:t,doc:n}:{value:null,path:e,source:t,doc:n}}function y(e,t){return e.map(e=>{let n=e.path.map(e=>typeof e==`symbol`?String(e):e),r={path:n,message:e.message,issueCode:e.code};if(t.doc!==null&&t.source!==null){let e=i({file:t.path,source:t.source,doc:t.doc,path:n});if(e!==void 0)return{...r,source:e}}return r})}function b(t){let i=t??process.cwd(),u=[],p=[],m=[],h=[],g=c(`user`,i),_=s({absPath:g});p.push(..._.diagnostics),!_.valid&&_.sidelinedTo!==void 0&&m.push({from:g,to:_.sidelinedTo}),_.valid&&_.source!==void 0&&u.push(g);let b=(t,n=!1)=>{let i=v(t);if(i.diagnostic!==void 0&&p.push(i.diagnostic),i.value===null)return{};let o=r({value:i.value,file:i.path,source:i.source,doc:i.doc});p.push(...o),u.push(t);let s=o.length>0?e(i.value):i.value;return n&&h.push(...a({value:s,file:i.path,source:i.source,doc:i.doc})),s},x=f(i,`.ok`,d),S=b(x,!0),C=b(c(`project-local`,i)),w=o(_.value,S,C),T=l.safeParse(w);if(!T.success){let e=v(x),t={code:`SCHEMA_INVALID`,issues:y(T.error.issues,e)};throw Error(n(t))}return{config:T.data,sources:u,diagnostics:p,sidelined:m,ignoredCommittedKeys:h}}function x(e){let t=e.cacheMs??1e3,n=e.loadConfigFn??b,r=new Map,i=new Map,a=_(e.startupCwd);return async o=>{let s=await _(o??e.startupCwd),c=Date.now(),l=r.get(s);if(l&&l.expiresAt>c)return l.config;let u=i.get(s);if(u)return await u;let d=(async()=>{if(s===await a)return r.set(s,{config:e.startupConfig,expiresAt:Date.now()+t}),e.startupConfig;let i=n(s).config;return r.set(s,{config:i,expiresAt:Date.now()+t}),i})();i.set(s,d);try{return await d}finally{i.delete(s)}}}export{b as n,x as t};
|