@inkeep/open-knowledge 0.86.22 → 0.86.23-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/THIRD_PARTY_NOTICES.md +3 -2
- package/dist/cli.mjs +6 -6
- package/dist/constants-By4R8-uX.mjs +1 -0
- package/dist/dist-Ds1SZERP.mjs +2213 -0
- package/dist/{dist-0qA3xZU8.mjs → dist-nfglEvqM.mjs} +1 -1
- package/dist/index.mjs +218 -219
- package/dist/init-BlaAYYwU.mjs +1 -0
- package/dist/{init-DQY_k8Bb.mjs → init-Cm89v8Xi.mjs} +2 -2
- package/dist/{launch-json-removal-BToQcc3e.mjs → launch-json-removal-fS0NXdND.mjs} +1 -1
- package/dist/{loader-BcKRvBDf.mjs → loader-C95tIva3.mjs} +1 -1
- package/dist/loader-Cw-S1fW6.mjs +1 -0
- package/dist/{md-manager-BGnqyqi1-BzZ_8EQ9.mjs → md-manager-BGnqyqi1-I7NmBKjQ.mjs} +108 -108
- package/dist/native/native-config.win32-arm64-msvc.node +0 -0
- package/dist/native/native-config.win32-x64-msvc.node +0 -0
- package/dist/{open-browser-DhYyRIyx.mjs → open-browser-BGyDP4ZD.mjs} +1 -1
- package/dist/parse-worker.mjs +1 -1
- package/dist/{preview-BNlI5MHG.mjs → preview-DZRElswd.mjs} +1 -1
- package/dist/preview-aa1rCKsw.mjs +1 -0
- package/dist/public/assets/{AboutSection-LPELvEUl.js → AboutSection-Bddd4fs4.js} +1 -1
- package/dist/public/assets/{AccountSection-Dla17okM.js → AccountSection-BVjZBoES.js} +1 -1
- package/dist/public/assets/ActivityModeContent-CoHF_gnh.js +1 -0
- package/dist/public/assets/{AddPropertiesButton-C0bGsu-F.js → AddPropertiesButton-CYDU0_-q.js} +2 -2
- package/dist/public/assets/AgentConnectionsSection-B9_oKPEW.js +1 -0
- package/dist/public/assets/{AgentDiffPane-BIzndumu.js → AgentDiffPane-Cl_3oYJE.js} +1 -1
- package/dist/public/assets/{AppMenubar-ClplcAeM.js → AppMenubar-vPHVy2jk.js} +1 -1
- package/dist/public/assets/{AttachmentsSection-BjrHOhme.js → AttachmentsSection-IYSFEmCT.js} +1 -1
- package/dist/public/assets/AuthModal-YZGpNH__.js +3 -0
- package/dist/public/assets/{BugReportHistory-BM589t1t.js → BugReportHistory-CHujhV74.js} +1 -1
- package/dist/public/assets/{BugReportHistoryDialog-BfdDMBqN.js → BugReportHistoryDialog-CaE3cXFx.js} +1 -1
- package/dist/public/assets/{ChangedOutsideBadge-DhpGZlDx.js → ChangedOutsideBadge-BfH3veLO.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-C5fRuWf2.js → CodeMirrorPropInput-C4twOWg9.js} +3 -3
- package/dist/public/assets/{ConsentDialogBody-CaPp8huq.js → ConsentDialogBody-k0k7metW.js} +1 -1
- package/dist/public/assets/{ContentRulesSection-B5CAsULt.js → ContentRulesSection-Cy2iebbj.js} +1 -1
- package/dist/public/assets/{DiffViewBoundary-Czp-0Arc.js → DiffViewBoundary-DFNHnF7f.js} +1 -1
- package/dist/public/assets/{DocumentContext-DDDUTQJi.js → DocumentContext-DvbRWp3l.js} +5 -5
- package/dist/public/assets/{EditorModeToggle-Bd8FyUeG.js → EditorModeToggle-BPKJDvW2.js} +1 -1
- package/dist/public/assets/{ExcalidrawDocEditor-4RZPPTS9.js → ExcalidrawDocEditor-AKrXbagc.js} +1 -1
- package/dist/public/assets/FeedbackForm-CRGgaSe0.js +1 -0
- package/dist/public/assets/{GraphPanel-D1tkoAHM.js → GraphPanel-4ARXQVWm.js} +1 -1
- package/dist/public/assets/{HotkeysSection-C9sCf3j3.js → HotkeysSection-D1qQH68p.js} +1 -1
- package/dist/public/assets/{ImportSkillDialog-Be_RD2Gk.js → ImportSkillDialog-DA5V3vTp.js} +1 -1
- package/dist/public/assets/{IntegrationsSection-D3htSKMO.js → IntegrationsSection-r5E7Aje8.js} +1 -1
- package/dist/public/assets/{LinkPreviewsSection-D0uy1PxC.js → LinkPreviewsSection-BK_VujeD.js} +1 -1
- package/dist/public/assets/{LintConfigEditor-l01M8Bbg.js → LintConfigEditor-Br64-ZiC.js} +1 -1
- package/dist/public/assets/{LintingSection-12fgbDnF.js → LintingSection-BZt9ON8F.js} +1 -1
- package/dist/public/assets/{ManagedArtifactProperties-vcuTAbYr.js → ManagedArtifactProperties-C2PsrqWE.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-Cp4wmQq3.js +1 -0
- package/dist/public/assets/McpConsentDialogBody-CVZcuVhW.js +1 -0
- package/dist/public/assets/{Mermaid-Dqzqybsn.js → Mermaid-DqNhHNi1.js} +2 -2
- package/dist/public/assets/{MermaidDocEditor-BCNSGhNo.js → MermaidDocEditor-BAvcjPw_.js} +1 -1
- package/dist/public/assets/{NetworkAccessSection-Cxln0QK5.js → NetworkAccessSection-BE_FE25E.js} +1 -1
- package/dist/public/assets/{OkignoreSection-BudJQycp.js → OkignoreSection-DplnnxQb.js} +2 -2
- package/dist/public/assets/{ProjectTemplatesSection-DCliKsre.js → ProjectTemplatesSection-BEchYRnN.js} +1 -1
- package/dist/public/assets/{PropertyDisplayRow-CGpmYjl6.js → PropertyDisplayRow-BOYcZEUU.js} +1 -1
- package/dist/public/assets/{PublishToGitHubDialog-BCeR1wkm.js → PublishToGitHubDialog-18N1T5qL.js} +1 -1
- package/dist/public/assets/{RegisteredAgentIcon-FmoZTlpS.js → RegisteredAgentIcon-B0qjAvei.js} +1 -1
- package/dist/public/assets/ReportBugDialogBody-jHepd9au.js +3 -0
- package/dist/public/assets/ReportBugMenuTrigger-KsljCE5p.js +1 -0
- package/dist/public/assets/SchemaConfigEditor-BHQHHYgU.js +1 -0
- package/dist/public/assets/{SearchSection-Bcm55yb6.js → SearchSection-CtemEd7d.js} +1 -1
- package/dist/public/assets/{SessionsHost-DQ1ys2Oj.js → SessionsHost-DKxZ8pxJ.js} +2 -2
- package/dist/public/assets/{SettingsDialogBody-BZpyRgRK.js → SettingsDialogBody-Bno3kKmn.js} +2 -2
- package/dist/public/assets/{SettingsSectionHeader-DDNA1hrR.js → SettingsSectionHeader-BKhNIRp2.js} +1 -1
- package/dist/public/assets/{ShareReceiveDialog-DVtBOlIm.js → ShareReceiveDialog-DJbtqR4t.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-NFqekHGn.js → ShareReceiveMissDialog-U2EHS1uL.js} +1 -1
- package/dist/public/assets/{SharingSection-Y4AD8HPt.js → SharingSection-C-9tTPow.js} +1 -1
- package/dist/public/assets/SkillCostValue-DK-VfwfI.js +1 -0
- package/dist/public/assets/{SkillForkDialog-CPkWchji.js → SkillForkDialog-BHqkO5bK.js} +1 -1
- package/dist/public/assets/{SkillInstallMenu-DyKWxkEY.js → SkillInstallMenu-29VzNm-A.js} +1 -1
- package/dist/public/assets/{SkillOriginInline-D6YyylB6.js → SkillOriginInline-Z5JCe0T2.js} +1 -1
- package/dist/public/assets/{SkillPluginBundleDialog-BmLQqQms.js → SkillPluginBundleDialog-BnQu_DSM.js} +1 -1
- package/dist/public/assets/{SkillToolbarControls-Bs8p51PI.js → SkillToolbarControls-C7fY-mJs.js} +1 -1
- package/dist/public/assets/{SkillsManagerSection-C0pgRzfs.js → SkillsManagerSection-D4YW1uOY.js} +1 -1
- package/dist/public/assets/{SlidesPluginSection-B8KiQkqa.js → SlidesPluginSection-BhUKklqb.js} +1 -1
- package/dist/public/assets/{SlidesToolbarControls-DxIDubwo.js → SlidesToolbarControls-DXn_DkWH.js} +1 -1
- package/dist/public/assets/{SourceEditor-DP0HyTpn.js → SourceEditor-C-G5e44O.js} +1 -1
- package/dist/public/assets/{SpellingSettings-CElN7mrA.js → SpellingSettings-C72xD-Zu.js} +1 -1
- package/dist/public/assets/{SyncSection-C1jLDoRh.js → SyncSection-CZLVQSW3.js} +1 -1
- package/dist/public/assets/SyncStatusBadge-DHRx1bqM.js +1 -0
- package/dist/public/assets/{TemplateRow-DsoFn6-i.js → TemplateRow-4LHta_yW.js} +2 -2
- package/dist/public/assets/{TerminalLaunchContext-DWUMDSpw.js → TerminalLaunchContext-DprnLNoQ.js} +1 -1
- package/dist/public/assets/{TerminalPanel-ByCiyPt3.js → TerminalPanel-BKIxzbz3.js} +2 -2
- package/dist/public/assets/{TerminalSection-C8HHQC_K.js → TerminalSection-TLomVk80.js} +1 -1
- package/dist/public/assets/{TerminalWindowApp-D6hHsUKZ.js → TerminalWindowApp-CJSZN0dW.js} +1 -1
- package/dist/public/assets/{TextDocEditor-BZCB5p1t.js → TextDocEditor-DqqSFRlb.js} +1 -1
- package/dist/public/assets/ThemePluginSection-BHfep7sw.js +6 -0
- package/dist/public/assets/ThreadView-BomEeVEG.js +28 -0
- package/dist/public/assets/{TimelineDiffPane-BiVpBG0u.js → TimelineDiffPane-DxSkLGZO.js} +1 -1
- package/dist/public/assets/agent-connections-D6YhmKlS.js +1 -0
- package/dist/public/assets/{agent-registry-DoeDgmSS.js → agent-registry-BdHe0AEQ.js} +1 -1
- package/dist/public/assets/badge-BIamhtRR.js +1 -0
- package/dist/public/assets/{bridge-BeevbgaB.js → bridge-BMIee44l.js} +1 -1
- package/dist/public/assets/{catalog-C1GEA-Va.js → catalog-CEXii1s5.js} +1 -1
- package/dist/public/assets/{client-version-CVbC_NDn.js → client-version-D7T2EsHi.js} +1 -1
- package/dist/public/assets/{comment-chips-bT3Pgeu8.js → comment-chips-pHMesJY8.js} +1 -1
- package/dist/public/assets/{config-provider-4lMZjvv1.js → config-provider-XgOiT52f.js} +1 -1
- package/dist/public/assets/config-schema-zP71feeS.js +1 -0
- package/dist/public/assets/{css-color-to-hex-BRv_r6oZ.js → css-color-to-hex-Csde6-Qs.js} +1 -1
- package/dist/public/assets/{dist-BrKroYq_.js → dist-DjMGDcCv.js} +2 -2
- package/dist/public/assets/{doc-undo-manager-BKDHRnV-.js → doc-undo-manager-CBMYbYB_.js} +1 -1
- package/dist/public/assets/field-controls-B49FSs4r.js +1 -0
- package/dist/public/assets/field-controls-DBnF9Har.js +6 -0
- package/dist/public/assets/globals-kLKgmkBv.css +1 -0
- package/dist/public/assets/{ime-composition-_BDVzXn4.js → ime-composition-DSJh5ynW.js} +1 -1
- package/dist/public/assets/index-CgakiuU1.js +2209 -0
- package/dist/public/assets/{lint-config-client-DRJNyM2s.js → lint-config-client-B249C1D2.js} +1 -1
- package/dist/public/assets/{lint-plugins-Dufc6pEn.js → lint-plugins-2r6I9zxf.js} +1 -1
- package/dist/public/assets/{markdown-lint-BuEapKhE.js → markdown-lint-BMeMGAz_.js} +1 -1
- package/dist/public/assets/{markdownlint-rule-browser-BQ4c4vDN.js → markdownlint-rule-browser-Bt2f856y.js} +1 -1
- package/dist/public/assets/{pending-receive-nav-store-3JlvmWi7.js → pending-receive-nav-store-BYOZNhry.js} +1 -1
- package/dist/public/assets/{preferred-session-events-Crz1K3Z-.js → preferred-session-events-DYXcUDcT.js} +1 -1
- package/dist/public/assets/{progress-BK046Tty.js → progress-DYv5uhkl.js} +1 -1
- package/dist/public/assets/saved-themes-client-DFijgxrT.js +1 -0
- package/dist/public/assets/{schema-section-CalUQFIh.js → schema-section-BHt16UFk.js} +1 -1
- package/dist/public/assets/{schemas-api-CD98jV86.js → schemas-api-CL5ZXlEj.js} +4 -4
- package/dist/public/assets/{selection-context-BbfG0HO9.js → selection-context-DsOL83qw.js} +1 -1
- package/dist/public/assets/{skills-api-zXSg3eSX.js → skills-api-CCijBzjo.js} +1 -1
- package/dist/public/assets/{src-D_7G4loI.js → src-BJwX3eee.js} +1 -1
- package/dist/public/assets/storage-scope-GPc8n3Ml.js +1 -0
- package/dist/public/assets/{tag-pill-input-D6mNhknm.js → tag-pill-input-qgfgpKpV.js} +1 -1
- package/dist/public/assets/{telemetry-impl-C8ZWEJkv.js → telemetry-impl-BzeBx635.js} +1 -1
- package/dist/public/assets/{telemetry-startup-DNrsQYjz.js → telemetry-startup-CZ4d9lDQ.js} +1 -1
- package/dist/public/assets/{terminal-launch-events-BhFGIVo_.js → terminal-launch-events-3vnER_eI.js} +1 -1
- package/dist/public/assets/typing-burst-detector-Bgsdpwz2.js +8 -0
- package/dist/public/assets/{uninstall-DFTOzPT_.js → uninstall-Is26Mh1k.js} +1 -1
- package/dist/public/assets/{use-activity-panel-D5VDwOQt.js → use-activity-panel-b2uO_q1d.js} +1 -1
- package/dist/public/assets/{use-apply-config-color-theme-hiddt1uL.js → use-apply-config-color-theme-Bpi7AD0s.js} +2 -2
- package/dist/public/assets/{use-conflicts-BAjZ5TAV.js → use-conflicts-CIjDyM9c.js} +1 -1
- package/dist/public/assets/use-installed-clis-BTrIR9--.js +2 -0
- package/dist/public/assets/{use-live-xterm-theme-C1wLG0Im.js → use-live-xterm-theme-BJbDRXxo.js} +1 -1
- package/dist/public/assets/{use-open-skill-CFZd4B8h.js → use-open-skill-DHZCUXJl.js} +1 -1
- package/dist/public/assets/{use-semantic-search-status-CRj98qO1.js → use-semantic-search-status-7_z6UOU1.js} +1 -1
- package/dist/public/assets/{use-skill-origin-BAc45a3e.js → use-skill-origin-B9YRoKsz.js} +1 -1
- package/dist/public/assets/{use-skill-targets-DIBQkXNG.js → use-skill-targets-DZmqRDS7.js} +1 -1
- package/dist/public/assets/{use-skills-B2fLFrq6.js → use-skills-CkvdjORj.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-B51ji6oG.js → use-terminal-enabled-CKtacdLs.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-B6Z6EtU2.js → use-timeline-entry-diff-CJ74dVx4.js} +1 -1
- package/dist/public/assets/{use-workspace-Bgh-YT5K.js → use-workspace-h2j0Puyv.js} +1 -1
- package/dist/public/index.html +54 -54
- package/dist/public/uninstall.html +4 -4
- package/dist/{registry-probes-DPKKrRUM.mjs → registry-probes-Geo36jYd.mjs} +1 -1
- package/dist/{removal-file-path-Bxa6y1-K.mjs → removal-file-path-DmLILHKq.mjs} +1 -1
- package/dist/{repair-launch-json-GQqTV6X4.mjs → repair-launch-json-17c1P8Be.mjs} +1 -1
- package/dist/{repair-mcp-configs-CZ1wHZDY.mjs → repair-mcp-configs-FaVp0WPm.mjs} +1 -1
- package/dist/{src-DZwvkGg3.mjs → src-BcR9UuZe.mjs} +1 -1
- package/dist/src-LBH_QDrh.mjs +1 -0
- package/dist/{start-DGllIRmH.mjs → start-CqpDF2BZ.mjs} +3 -3
- package/dist/start-ERGYXvxq.mjs +1 -0
- package/package.json +4 -4
- package/dist/constants-CKiX5Z0-.mjs +0 -1
- package/dist/dist-CJAnJkM1.mjs +0 -2213
- package/dist/init-BSBhjVTS.mjs +0 -1
- package/dist/loader-vXeyPd6b.mjs +0 -1
- package/dist/preview-Cvm5I8jO.mjs +0 -1
- package/dist/public/assets/ActivityModeContent-fbqWmmqu.js +0 -1
- package/dist/public/assets/AgentConnectionsSection-DhbJCdHu.js +0 -1
- package/dist/public/assets/AuthModal-DT32BOAJ.js +0 -3
- package/dist/public/assets/FeedbackForm-DTSn-xTq.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-BNV1pKhc.js +0 -1
- package/dist/public/assets/McpConsentDialogBody-BwguVGDQ.js +0 -1
- package/dist/public/assets/ReportBugDialogBody-J5o6Nxwn.js +0 -3
- package/dist/public/assets/ReportBugMenuTrigger-CAUKQKXn.js +0 -1
- package/dist/public/assets/SchemaConfigEditor-CHGUkiVe.js +0 -1
- package/dist/public/assets/SkillCostValue-DBT6aDG-.js +0 -1
- package/dist/public/assets/SyncStatusBadge-uu4Is4Gu.js +0 -1
- package/dist/public/assets/ThemePluginSection-McKmY5If.js +0 -6
- package/dist/public/assets/ThreadView-OBNSZb0r.js +0 -28
- package/dist/public/assets/agent-connections-DSKODCmO.js +0 -1
- package/dist/public/assets/badge-DmdA1C7r.js +0 -1
- package/dist/public/assets/config-schema-CIaXsCAX.js +0 -1
- package/dist/public/assets/field-controls-CCcf2ybM.js +0 -1
- package/dist/public/assets/field-controls-CKb1JSHS.js +0 -6
- package/dist/public/assets/globals-Cr0S8PDH.css +0 -1
- package/dist/public/assets/index-xygm6gU4.js +0 -2209
- package/dist/public/assets/saved-themes-client-D09wxYQm.js +0 -1
- package/dist/public/assets/storage-scope-ldi41iCU.js +0 -1
- package/dist/public/assets/typing-burst-detector-DQWG6VAz.js +0 -8
- package/dist/public/assets/use-installed-clis-BopBqnEZ.js +0 -2
- package/dist/src-DJMiqowA.mjs +0 -1
- package/dist/start-BAXRLMKN.mjs +0 -1
- /package/dist/public/assets/{globals-DHDe92Ga.js → globals-CcgTjZMO.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./dist-Ds1SZERP.mjs";import{v as e}from"./init-Cm89v8Xi.mjs";export{e as runInit};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as e,o as t,t as n}from"./rolldown-runtime-tZXQYakl.mjs";import{$u as r,Bf as i,Cf as a,Df as o,Ef as s,Ga as c,Jc as l,K as u,Mf as d,Nf as f,Pf as p,Sf as m,Tf as h,V as g,Wa as _,_ as v,_f as y,a as b,df as x,gd as S,jf as C,lf as ee,mf as te,pf as ne,tt as re,uf as ie,vc as ae,vf as oe,yd as se,z as ce,zf as le}from"./md-manager-BGnqyqi1-
|
|
1
|
+
import{i as e,o as t,t as n}from"./rolldown-runtime-tZXQYakl.mjs";import{$u as r,Bf as i,Cf as a,Df as o,Ef as s,Ga as c,Jc as l,K as u,Mf as d,Nf as f,Pf as p,Sf as m,Tf as h,V as g,Wa as _,_ as v,_f as y,a as b,df as x,gd as S,jf as C,lf as ee,mf as te,pf as ne,tt as re,uf as ie,vc as ae,vf as oe,yd as se,z as ce,zf as le}from"./md-manager-BGnqyqi1-I7NmBKjQ.mjs";import{Ao as ue,At as de,F as fe,Fo as pe,Fr as me,Hi as he,Jo as ge,Ko as w,No as _e,R as ve,U as ye,Vr as be,Xo as xe,Yo as Se,Yr as Ce,Zn as we,at as Te,ci as Ee,cs as De,di as Oe,dn as ke,ir as Ae,ja as je,m as Me,ma as Ne,ms as Pe,pa as Fe,qo as Ie,qr as Le,rt as Re,ts as T,va as ze,z as Be}from"./dist-Ds1SZERP.mjs";import{i as Ve,n as E,o as D,r as He,s as O,t as k}from"./colors-r_owlCuY.mjs";import{t as A}from"./is-object-BGze3w87.mjs";import{t as Ue}from"./constants-By4R8-uX.mjs";import{t as We}from"./preview-DZRElswd.mjs";import{createRequire as Ge}from"node:module";import{execFileSync as Ke}from"node:child_process";import qe,{basename as Je,dirname as j,isAbsolute as Ye,join as M,posix as Xe,relative as N,resolve as P,sep as F,win32 as Ze}from"node:path";import I from"node:process";import{fileURLToPath as Qe}from"node:url";import{cpSync as $e,existsSync as L,lstatSync as et,mkdirSync as tt,readFileSync as R,readdirSync as nt,readlinkSync as rt,realpathSync as it,rmSync as at,statSync as ot,writeFileSync as st}from"node:fs";import{homedir as z}from"node:os";import{inspect as ct,stripVTControlCharacters as lt,styleText as B}from"node:util";import*as ut from"node:readline";import{AsyncLocalStorage as dt,AsyncResource as ft}from"node:async_hooks";var pt=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})),mt=n((e=>{let{InvalidArgumentError:t}=pt();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})),ht=n((e=>{let{humanReadableArgName:t}=mt();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})),gt=n((e=>{let{InvalidArgumentError:t}=pt();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:Wa(e)}),a&&g===o?{kind:`unchanged`}:{kind:d?`overwritten`:`written`}}const Lo=e=>e!==`project`,Ro=e=>e!==`user`;async function zo(){let e=await $a({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 Bo(e){return e.mcp===!1?null:e.scope?e.scope:e.isTTY??process.stdout.isTTY?(e.promptFn??zo)():`both`}async function Vo(e){return io({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 \`${C()} config-sharing share\`.`}]})}async function Ho(e){if(e.sharing!==void 0)return e.sharing;let t=pa(e.projectRoot)===`local-only`||e.freshProject===!0?`local-only`:`shared`;return e.isTTY??process.stdout.isTTY?(e.promptFn??Vo)(t):t}var Uo=class extends Error{constructor(e){super(e),this.name=`ContentDirError`}},Wo=class extends Error{constructor(e){super(`A dev MCP entry is written to project config only, never to user-level editor config, so --scope ${e} is not supported with --dev-mcp or OK_CHANNEL=dev. Re-run with --scope project or without --scope.`),this.name=`DevMcpScopeError`}};const Go=`A dev build registers OpenKnowledge MCP in project config only, never in user-level editor config. Run \`${h} init --dev-mcp\` in the project, or set OK_CHANNEL=stable.`;function Ko(e){if(e===void 0||e===!0)return new Set(Re);if(e===!1)return new Set;let t=e.split(`,`).map(e=>e.trim()).filter(Boolean);return new Set(de.filter(e=>t.includes(e)))}function qo(e,t,n){let r=P(n,e),i;try{i=ot(r)}catch(e){let t=e.code;throw t===`ENOENT`?new Uo(`--content-dir path does not exist: ${r}`):new Uo(`--content-dir path is not accessible (${t??`unknown error`}): ${r}`)}if(!i.isDirectory())throw new Uo(`--content-dir must be a directory: ${r}`);let a=Jo(t),o=Jo(r),s=N(a,o);if(s.startsWith(`..`)||Ye(s))throw new Uo(`--content-dir must be inside the project root (${t}); got ${r}`);return s===``?`.`:s}function Jo(e){try{return it(e)}catch{return e}}const Yo=`open-knowledge-ui`;function Xo(e,t,n){try{let r=e.detectPath?.(t,n)??j(e.configPath(t,n));return L(r)}catch{return!1}}function Zo(e,t,n){try{let r=P(j(e.configPath(t,n))),i=P(e.detectPath?.(t,n)??r);return i===r||r.startsWith(i+F)}catch{return!1}}function Qo(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`||!L(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||Zo(e,t,r);if(!i&&c&&!Xo(e,t,r))return{editorId:e.id,label:e.label,action:`skipped-missing`,configPath:o,serverName:a};if(i!==void 0)try{Da(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 es(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||tt(j(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{De(`${o}.lock`,()=>{let t=_o(o).writePath;if(s||tt(j(t),{recursive:!0}),e.format===`toml`){let r=No(ai(),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=Io(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=Mo(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 $o={pi:co};function es(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=$o[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{tt(j(t),{recursive:!0})}catch(e){return o(e)}let l={action:`written`};try{De(`${t}.lock`,()=>{let e=null;try{e=R(t,`utf-8`)}catch{e=null}if(e===c){l.action=`overwritten`;return}T(t,c,e===null?void 0:{mode:Wa(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 ts(e,t){let n=e.projectConfigPath?.(t);if(!(!n||!L(n)))return{editorId:e.id,label:e.label,path:n}}async function ns(e){let t=oa(e.editors).filter(e=>e.scope===`global`);if(le())return t.map(t=>({editorId:t.id,label:t.label,action:`failed`,configPath:t.configPath(``,e.home),serverName:t.serverName(``),error:Go}));let n={mode:`published`,skipAvailabilityCheck:!0,...e.replaceEntry===!0?{replaceEntry:!0}:{},...e.pruneOnly===!0?{pruneOnly:!0}:{}};return t.map(t=>Qo(t,``,n,e.home))}function rs(e,t,n,r){let i=as(e,t,n,r);return i.kind===`present`?i.entry:null}function is(e,t,n,r){let i=jo(e,t,r);if(!A(i))return{kind:`no-entry`};let a=i[n];return A(a)?{kind:`present`,entry:a}:{kind:`no-entry`}}function as(e,t,n,r){let i;try{i=r??e.configPath(t,n)}catch{return{kind:`absent`}}if(!L(i))return{kind:`absent`};try{if(ot(i).size>To)return{kind:`decline`,reason:`oversize`}}catch(e){return{kind:`decline`,reason:Ba(e)}}let a;try{a=R(i,`utf-8`)}catch(e){return{kind:`decline`,reason:Ba(e)}}if(a.trim()===``)return{kind:`absent`};if(e.format===`file`)return{kind:`present`,entry:so(a)};let o=e.serverName(t);if(e.format===`toml`){let t;try{t=ai().parseToObject(a)}catch{return{kind:`decline`,reason:`unparseable`}}return is(t,e.topLevelKey,o,e.serverMapSubKey)}if(e.format===`yaml`){let t=(0,Kr.parseDocument)(a.charCodeAt(0)===65279?a.slice(1):a);return t.errors.length>0?{kind:`decline`,reason:`unparseable`}:is(t.toJS()??{},e.topLevelKey,o,e.serverMapSubKey)}let s=bo(a);return s?xo(s,e.topLevelKey)>1?{kind:`decline`,reason:`duplicate-container`}:is(Ie(s),e.topLevelKey,o,e.serverMapSubKey):{kind:`decline`,reason:`unparseable`}}async function os(e={}){let t=P(e.cwd??process.cwd()),n=fo(t,{homeDir:e.home}),r=n.projectRoot;if(Ce(r,e.home??z()))throw new ye(r);if(Le(r))throw new fe(r);let i=!L(M(r,`.ok`)),a=n.gitRootPromoted?N(r,t):void 0,o=e.contentDir===void 0?n.defaultContentDir:qo(e.contentDir,r,t);n.ancestorPromoted?console.log(`[ok] Opened existing project at ${r}`):n.gitRootPromoted&&i&&o===`.`&&process.stderr.write(`${O(`[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 \`${C()} init --content-dir .\`, or set content.dir: ${a} in .ok/config.yml.\n`);let s={mode:e.devMcp?`dev`:`published`},l=e.devMcp===!0||le();if(l&&e.mcp!==!1&&e.scope&&e.scope!==`project`)throw new Wo(e.scope);let u=await Ae(r),d;try{d=me(r,{contentDir:o})}catch(t){let i=$.claude.configPath(r,e.home);return{projectRoot:r,contentCreated:[],contentUpdated:[],contentSkipped:[],editors:[],projectSkills:[],legacyProjectConfigs:[],didGitInit:u.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 f=d.created.includes(Ue),p=!1;if(u.didInit)try{p=pe(r)===`created`}catch(e){console.warn(`[ok] Skipping .gitignore seed at ${r}: ${e instanceof Error?e.message:String(e)}`)}try{Fe(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 m=await Bo({scope:l?`project`:e.scope,mcp:e.mcp,isTTY:e.isTTY,promptFn:e.promptFn}),h=e.editors??fs(r,e.home),g=e.editors??h,_=oa(h),v=oa(g),y=e.mcp===!1||m===null,b=Array.from(new Map([..._,...y?[]:v].map(e=>[e.id,e])).values()),x=_.filter(t=>Xo(t,r,e.home)),S=[],ee=[],te=new Set;for(let t of b){if(y){let n=``;try{n=t.configPath(r,e.home)}catch{}S.push({editorId:t.id,label:t.label,action:`skipped-flag`,configPath:n,serverName:t.serverName(r)});continue}if(Lo(m)&&_.includes(t)&&t.scope===`global`&&S.push(Qo(t,r,s,e.home)),Ro(m)&&v.includes(t)&&t.projectConfigPath){let n=t.projectConfigPath(r),i=Qo(t,r,s,e.home,n);S.push(i),(i.action===`written`||i.action===`overwritten`)&&te.add(n)}}let ne=new Set;for(let t of v){let n=t.projectSkillPath?.(r);!n||ne.has(n)||(ne.add(n),ee.push(Ra(t,r,{home:e.home})))}let re=La(r,v.map(e=>e.id));re&&ee.push(re);let ie=ee.filter(e=>e.action===`written`||e.action===`overwritten`).map(e=>e.editorId);if(ie.length>0){let t=e.home??z();Ne({source:c,skills:[Me.project],agents:ie,scope:r},{home:t,enabled:je(t).enabled})}let ae=!y&&m!==null&&Ro(m)?v.filter(e=>!e.projectConfigPath&&!e.projectSkillPath).map(e=>e.label):void 0,oe=y?[]:x.map(e=>ts(e,r)).filter(e=>e!==void 0).filter(e=>!te.has(e.path)),se=e.installUserSkill??be,ce=e.home??z(),ue=Ko(e.skills),ge=typeof e.skills!=`string`,w=!1,ve=!1,xe=!1,Se=!1,Te=!1,Ee=!1,De=!1,ke=[];for(let t of de){if(!ue.has(t))continue;if(w=!0,ge){let e=await he(ce,Me[t]).then(e=>({ok:!0,value:e}),()=>({ok:!1}));if(!e.ok){ke.push({bundleId:t,result:`decision-read-failed`}),De=!0;continue}if(e.value===!1){ke.push({bundleId:t,result:`opted-out`}),Ee=!0;continue}}await _e(ce,Me[t],!0).catch(()=>{});let n=await se({home:e.home,bundleId:t,force:!0});ke.push({bundleId:t,result:n}),n===`installed`?ve=!0:n===`failed`?xe=!0:n===`no-hosts`?Te=!0:Se=!0}let Pe=xe?`failed`:De?`decision-read-failed`:ve?`installed`:w&&Se?`skip-current`:w&&Te?`no-hosts`:Ee?`opted-out`:`declined`,Ie=ve?we(ce).map(e=>e.editorId):[],Re=je(ce).enabled&&!Oe(),T=y?`skipped-flag`:`skipped-missing`,ze=S.find(e=>e.editorId===`claude`)??S[0]??{action:T,configPath:$.claude.configPath(r,e.home)},Be=await ss({projectRoot:r,desiredMode:await Ho({sharing:e.sharing,projectRoot:r,isTTY:e.isTTY,freshProject:i,promptFn:e.sharingPromptFn}),explicitFlag:e.sharing});return{projectRoot:r,contentCreated:d.created,contentUpdated:d.updated,contentSkipped:d.skipped,editors:S,projectSkills:ee,legacyProjectConfigs:oe,skillInstall:Pe,skillBundles:ke,skillsRequested:e.skills,skillHosts:Ie,skillInstallsCounted:Re,didGitInit:u.didInit,rootGitignoreCreated:p,gitRootPromoted:n.gitRootPromoted,promotedFromDir:a,contentDir:f?o:void 0,contentDirRequested:e.contentDir,contentScaffoldFailed:!1,mcpAction:ze.action,mcpPath:ze.configPath,mcpError:`error`in ze?ze.error:void 0,projectScopeUnsupportedLabels:ae,sharing:Be}}async function ss(e){let{projectRoot:t,desiredMode:n,explicitFlag:r}=e,i=pa(t);if(i===`no-git`)return{kind:`no-exclude`,reason:`no-git`,localOnlyRequested:r===`local-only`};let a=la(t);if(n===`local-only`){let e=da(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`}:cs(t,e,`add`)}if(i===`shared`)return{kind:`applied`,mode:`shared`,action:`noop`,appended:[],alreadyPresent:[],removed:[]};let o=fa(t,a);return o.kind===`no-exclude`?{kind:`no-exclude`,reason:o.reason,localOnlyRequested:!1}:cs(t,o,`remove`)}function cs(e,t,n){let r=pa(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 ls(e){switch(e){case`permission-denied`:return`permission denied; check file and parent-directory permissions`;case`unresolved-symlink`:return`could not resolve the path or symlink; check permissions and symlink cycles`;case`not-a-file`:return`config path is not a regular file`;case`disappeared`:return`config disappeared while being read; retry to check its current state`;case`unreadable`:return`could not read the config file; check that the path is accessible`;case`unparseable`:return`config could not be parsed`;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`;case void 0:return`config not readable`;default:throw Error(`unhandled MCP decline reason: ${e}`)}}function us(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 c=M(t,`.ok`);if(e.contentCreated.length>0||e.contentUpdated.length>0?(n.push(k(`Content scaffolded at ${c}/`)),e.contentCreated.length>0&&n.push(` Created: ${e.contentCreated.join(`, `)}`),e.contentUpdated.length>0&&n.push(` Updated: ${e.contentUpdated.join(`, `)}`)):n.push(k(`Content already present at ${c}/`)),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(k(`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(k(`MCP server configuration:`)),n.push(` No supported editor config directories detected; skipped MCP registration`);else{n.push(k(`MCP server configuration:`));for(let r of e.editors){let e=r.configPath.startsWith(t)?N(t,r.configPath):r.configPath.replace(/^\/Users\/[^/]+/,`~`),i=r.serverName===f()?``:` (${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} ${D(`registered`)}${i}${c}`);break;case`overwritten`:n.push(` ${o}${s}${e} ${D(`updated`)}${i}${c}`);break;case`skipped-missing`:n.push(` ${o}${s}${e} config root missing; skipped`);break;case`failed`:n.push(` ${o}${s}${e} ${He(`FAILED`)}: ${r.error}`);break;case`declined`:n.push(` ${o}${s}${e} left unchanged (${ls(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`)}let r=s.dev.mcpServerName;e.editors.some(e=>e.serverName===r&&(e.action===`written`||e.action===`overwritten`))&&n.push(` The ${r} entry runs this checkout on this machine only; keep it out of commits.`)}if(e.projectSkills.length>0){n.push(``),n.push(k(`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?N(t,r.path):``;switch(r.action){case`written`:n.push(` ${e}${i}${a} ${D(`installed`)}`);break;case`overwritten`:n.push(` ${e}${i}${a} ${D(`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} ${He(`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} ${N(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===`declined`)n.push(``),n.push(k(`User-global skills:`)),typeof e.skillsRequested==`string`?(n.push(` ${E(`none installed — --skills "${e.skillsRequested}" names no known skill bundle (known: ${de.join(`, `)})`)}`),n.push(` ${E(`No user-global skill was installed or removed.`)}`)):(n.push(` ${E(`none installed — skipped for this run (--no-skills)`)}`),n.push(` ${E(`No user-global skill was installed or removed; any already on this`)}`),n.push(` ${E(`machine are untouched. Run init without the flag to install them:`)}`),n.push(` ${E(` ${C()} init`)}`),n.push(` ${E(`--no-skills covers user-global skills only, not project-local skills.`)}`));else if(e.skillInstall){n.push(``),n.push(k(`User-global skills:`));let t=e.skillBundles??[],r=Math.max(0,...t.map(e=>Me[e.bundleId].length));for(let i of t){let t=Me[i.bundleId].padEnd(r);switch(i.result){case`installed`:{let r=(e.skillHosts??[]).map(e=>X[e]??e),i=r.length>0?r.join(`, `):`the shared ~/.agents store`;n.push(` ${t} ${D(`installed for ${i}`)}`);break}case`skip-current`:n.push(` ${t} ${D(`already installed at current version`)}`);break;case`no-hosts`:n.push(` ${t} ${E(`skipped — no supported agent host detected in your home directory`)}`);break;case`failed`:n.push(` ${O(`${t} install failed`)}`);break;case`opted-out`:n.push(` ${t} ${E(`not installed — turned off on this machine; reinstall with ${C()} init --skills ${i.bundleId} or Settings → Skills Studio`)}`);break;case`decision-read-failed`:n.push(` ${O(`${t} not installed — could not read whether it is turned off on this machine; rerun ${C()} init once ${l(v)} is readable`)}`);break;default:i.result}}e.skillInstallsCounted&&t.some(e=>e.result===`installed`)&&(n.push(` ${E(`Counted on skills.sh (skill name + source repo, once per machine).`)}`),n.push(` ${E(`Opt out: DO_NOT_TRACK=1, or Settings → User → Preferences.`)}`)),t.some(e=>e.result===`failed`)&&n.push(` ${O(`Retry with: ${C()} repair-skills`)}`)}e.contentDirRequested!==void 0&&e.contentDir===void 0&&!e.contentScaffoldFailed?(n.push(``),n.push(O(`⚠ --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(O(`⚠ 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 \`${C()} 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 \`${C()} 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(...hs(e.sharing,t));let u=e=>[`${e}- ${Ve(`${C()} seed --list-packs`)} — browse the starter packs`,`${e}- ${Ve(`${C()} seed`)} — scaffold an empty repo`];if(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(`${D(`✓`)} ${k(`Next steps:`)}`),n.push(` 1. Open your editor (${Ve(r.join(` / `))})`),n.push(` 2. Approve the MCP server when prompted`);let i=3;e.contentScaffoldFailed||(n.push(` ${i++}. (Optional) scaffold the starter knowledge-base structure:`),n.push(...u(` `))),n.push(` ${i}. 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.`)}else e.contentScaffoldFailed||(n.push(``),n.push(`${k(`Next steps:`)} (optional) scaffold the starter knowledge-base structure:`),n.push(...u(` `)));return n.join(`
|
|
691
691
|
`)}function ds(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 fs(e,t){let n=[];for(let r of si)r!==`claude-desktop`&&Xo($[r],e,t)&&n.push(r);return n}function ps(){let e={log:console.log,info:console.info,debug:console.debug},t=(...e)=>{process.stderr.write(`${e.map(e=>typeof e==`string`?e:ct(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 ms(){return new Et(`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 (node + packages/cli/dist/cli.mjs, debug logging) in project config only, as the dev channel unless OK_CHANNEL is set`).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 Ot(`--scope <scope>`,`Write MCP config at user level, project level, or both`).choices([`user`,`project`,`both`])).addOption(new Ot(`--shared`,`Commit OK config alongside content (the default for fresh repos)`).conflicts(`localOnly`)).addOption(new Ot(`--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();e.devMcp&&p(process.env);let n=e.shared?`shared`:e.localOnly?`local-only`:void 0,r=e.json?ps():null;try{let r;try{r=await os({cwd:t,mcp:e.mcp,devMcp:e.devMcp,scope:e.scope,sharing:n,contentDir:e.contentDir,skills:e.skills})}catch(e){if(e instanceof Uo||e instanceof Wo||e instanceof ye||e instanceof fe){process.stderr.write(`${e.message}\n`),process.exitCode=64;return}if(e instanceof ve||e instanceof Be){process.stderr.write(`${e.message}\n`),process.exitCode=78;return}if(e instanceof Te){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-Cw-S1fW6.mjs`),{resolveContentDir:s}=await import(`./dist-nfglEvqM.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-aa1rCKsw.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(ds(r,{contentDir:i,contentFileCount:a}),null,2)}\n`):process.stdout.write(`${us(r,r.projectRoot)}\n`),(r.editors.some(e=>e.action===`failed`)||r.mcpAction===`failed`)&&(process.exitCode=1)}finally{r?.()}})}function hs(e,t){let n=[];switch(e.kind){case`applied`:return n.push(k(`Sharing mode:`)),e.mode===`local-only`?e.action===`added`?(n.push(` ${D(`local-only`)} — appended ${e.appended.length} path(s) to ${k(`${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(` ${D(`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(` ${D(`local-only`)} — already excluded; nothing to do.`):n.push(` ${D(`local-only`)}`):e.action===`removed`?n.push(` ${D(`shared`)} — removed OK paths from ${k(`${t}/.git/info/exclude`)}; commit the files to share with teammates.`):n.push(` ${D(`shared`)} — OK config will be committed alongside content.`),n;case`refused-tracked`:n.push(O(`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 ${Ve(`${C()} config-sharing unshare`)} after resolving to complete the switch.`),n;case`no-exclude`:if(e.localOnlyRequested)n.push(O(`Sharing mode: --local-only requested but no git repo found — option ignored`)),n.push(` Run ${Ve(`git init`)} (or open this folder via OK Desktop, which can scaffold a repo) and then ${Ve(`${C()} config-sharing unshare`)}.`);else if(e.reason===`no-git`)return[];else n.push(O(`Sharing mode unavailable: ${e.reason}.`));return n}}export{Z as $,Ua as A,Ra as B,_o as C,Rt as Ct,io as D,oo as E,Ot as Et,Aa as F,la as G,ya as H,Da as I,fa as J,ha as K,Oa as L,Va as M,Ba as N,$a as O,Ea as P,ci as Q,za as R,Zo as S,H as St,co as T,wt as Tt,ma as U,da as V,ua as W,X,si as Y,$ as Z,Ho as _,hr as _t,ss as a,Ti as at,Qo as b,fn as bt,fs as c,Wi as ct,ms as d,oi as dt,Bi as et,Xo as f,ai as ft,qo as g,Zr as gt,Bo as h,Jr as ht,$o as i,Si as it,Ga as j,Wa as k,us as l,ta as lt,Ko as m,Yr as mt,Wo as n,Vi as nt,ds as o,Ui as ot,rs as p,Y as pt,pa as q,Yo as r,Hi as rt,as as s,Q as st,Uo as t,zi as tt,hs as u,ki as ut,os as v,ir as vt,fo as w,Et as wt,ns as x,dn as xt,ko as y,hn as yt,ja as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Xo as e,qo as t,ts as n}from"./dist-
|
|
1
|
+
import{Xo as e,qo as t,ts as n}from"./dist-Ds1SZERP.mjs";import{N as r,j as i,k as a}from"./init-Cm89v8Xi.mjs";import{t as o}from"./is-object-BGze3w87.mjs";import{t as s}from"./removal-file-path-DmLILHKq.mjs";import{join as c}from"node:path";import{readFileSync as l}from"node:fs";const u={allowTrailingComma:!0,disallowComments:!1};function d(e,t){return e.error===1&&e.offset===0&&t.charCodeAt(0)===65279}function f(o){let f=s(c(o,`.claude`,`launch.json`));if(f.kind!==`ready`)return f;let m=f.path,h;try{h=l(m,`utf-8`)}catch(e){return{kind:`declined`,reason:r(e)}}let g=[],_=e(h,g,u)??void 0;if(g.some(e=>!d(e,h))||_?.type!==`object`)return{kind:`declined`,reason:`unparseable`};let v=t(_).configurations;if(!Array.isArray(v))return{kind:`not-present`};let y=v.findIndex(p);if(y===-1)return{kind:`not-present`};let{text:b,changed:x}=i(h,[`configurations`,y]);return x?(n(m,b,{mode:a(m)}),{kind:`removed`}):{kind:`not-present`}}function p(e){if(!o(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`?m.some(e=>h(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 m=[[`@inkeep/open-knowledge`,`ui`],[`-y`,`@inkeep/open-knowledge`,`ui`],[`-y`,`@inkeep/open-knowledge@latest`,`ui`]];function h(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}export{f as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$u as e,Ic as t,Pc as n,cl as r,il as i,k as a,nl as o}from"./md-manager-BGnqyqi1-
|
|
1
|
+
import{$u as e,Ic as t,Pc as n,cl as r,il as i,k as a,nl as o}from"./md-manager-BGnqyqi1-I7NmBKjQ.mjs";import{is as s,os as c,x as l}from"./dist-Ds1SZERP.mjs";import{t as u}from"./is-object-BGze3w87.mjs";import{t as d}from"./constants-By4R8-uX.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=e();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(e){let i=e??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=(e,t=!1)=>{let n=v(e);if(n.diagnostic!==void 0&&p.push(n.diagnostic),n.value===null)return{};let i=o({value:n.value,file:n.path,source:n.source,doc:n.doc});p.push(...i),u.push(e);let s=i.length>0?r(n.value):n.value;return t&&h.push(...a({value:s,file:n.path,source:n.source,doc:n.doc})),s},x=f(i,`.ok`,d),S=b(x,!0),C=b(c(`project-local`,i)),w=n(_.value,S,C),T=l.safeParse(w);if(!T.success){let e=v(x),n={code:`SCHEMA_INVALID`,issues:y(T.error.issues,e)};throw Error(t(n))}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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./loader-C95tIva3.mjs";export{e as loadConfig};
|