@inkeep/open-knowledge 0.72.0-beta.7 → 0.72.0-beta.9
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 +67 -67
- package/dist/constants-WajEvPW8.mjs +1 -0
- package/dist/{dist-CVs8BCwZ.mjs → dist-BIuTfjrw.mjs} +1 -1
- package/dist/{dist-CQFFmkEE.mjs → dist-D5b5OBne.mjs} +1 -1
- package/dist/index.mjs +31 -31
- package/dist/init-BNPtEZJV.mjs +1 -0
- package/dist/{init-CH3pTYUX.mjs → init-CslyZfpg.mjs} +30 -30
- package/dist/{launch-json-removal-Bi5IeUUF.mjs → launch-json-removal-uhnp0EI8.mjs} +1 -1
- package/dist/loader-BMbP9mQQ.mjs +1 -0
- package/dist/{loader-CB4bM4Vr.mjs → loader-DdvJ0osj.mjs} +1 -1
- package/dist/{md-manager-BGnqyqi1-Bo-Rq5FL.mjs → md-manager-BGnqyqi1-Blqj8T6I.mjs} +2 -2
- package/dist/native/index.d.ts +10 -0
- package/dist/native/index.js +1 -0
- package/dist/native/native-config.darwin-arm64.node +0 -0
- package/dist/native/native-config.darwin-x64.node +0 -0
- package/dist/native/native-config.linux-arm64-gnu.node +0 -0
- package/dist/native/native-config.linux-arm64-musl.node +0 -0
- package/dist/native/native-config.linux-x64-gnu.node +0 -0
- package/dist/native/native-config.linux-x64-musl.node +0 -0
- 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-C5MWfuW0.mjs → open-browser-8rJSn4m9.mjs} +1 -1
- package/dist/parse-worker.mjs +1 -1
- package/dist/{preview-Ba7L_87z.mjs → preview-DTFamA5M.mjs} +1 -1
- package/dist/preview-r5erdYWo.mjs +1 -0
- package/dist/public/assets/{ActivityModeContent-Bh-aOINO.js → ActivityModeContent-B1tYvMjG.js} +1 -1
- package/dist/public/assets/{AddPropertiesButton-CKvbln-l.js → AddPropertiesButton-DA_wnJVq.js} +2 -2
- package/dist/public/assets/{AgentDiffPane-h0k7R2PC.js → AgentDiffPane-nALW1rk2.js} +1 -1
- package/dist/public/assets/{AgentIconCluster-BfdKE6ui.js → AgentIconCluster-Bl8DKDkL.js} +1 -1
- package/dist/public/assets/{AgentThreadClientBinder-DjubXLi6.js → AgentThreadClientBinder-DGdoTSnA.js} +1 -1
- package/dist/public/assets/{BugReportHistory-C_ZU9yMs.js → BugReportHistory-B13YkOFp.js} +1 -1
- package/dist/public/assets/{BugReportHistoryDialog-DJiu9Guq.js → BugReportHistoryDialog-BPFa-AKJ.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-CsU-AE2e.js → CodeMirrorPropInput-CIpNZbyi.js} +1 -1
- package/dist/public/assets/{ConsentDialogBody-Dqev0b07.js → ConsentDialogBody-BN0jXwqh.js} +1 -1
- package/dist/public/assets/DiffViewBoundary-CQioOPfO.js +29 -0
- package/dist/public/assets/{DocumentContext-CaB8wd1_.js → DocumentContext-hQasPNmq.js} +1 -1
- package/dist/public/assets/{EditorModeToggle-CmusAWSZ.js → EditorModeToggle-BJi-tIYS.js} +1 -1
- package/dist/public/assets/EnableSyncConfirmDialog-B32e9ixI.js +1 -0
- package/dist/public/assets/{ExcalidrawDocEditor-CCrqGTpz.js → ExcalidrawDocEditor-CAi9KCSo.js} +1 -1
- package/dist/public/assets/FeedbackForm-B2crmmRs.js +1 -0
- package/dist/public/assets/{GraphPanel-Brw8ehEB.js → GraphPanel-BuRgcdoN.js} +1 -1
- package/dist/public/assets/{ImageAttachments-CC1lPWjh.js → ImageAttachments-DSwkgT46.js} +1 -1
- package/dist/public/assets/{ImportSkillDialog-DU5H3G2e.js → ImportSkillDialog-C3syCrZU.js} +1 -1
- package/dist/public/assets/{LintConfigEditor-BFpjLGZ_.js → LintConfigEditor-Y2PiagxM.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-DTZf3f7W.js +1 -0
- package/dist/public/assets/{ManagedArtifactProperties-DPLTTAuN.js → ManagedArtifactProperties-Dve7HGeo.js} +1 -1
- package/dist/public/assets/McpConsentDialogBody-DFMtnXkl.js +1 -0
- package/dist/public/assets/{MermaidDocEditor-DFksLDPw.js → MermaidDocEditor-qZNT_N8A.js} +1 -1
- package/dist/public/assets/{OpenInAgentMenuItem-pI7QqxQ8.js → OpenInAgentMenuItem-POLIjc2M.js} +1 -1
- package/dist/public/assets/{PropertyDisplayRow-rtfso48w.js → PropertyDisplayRow-DdwZsI5k.js} +1 -1
- package/dist/public/assets/{RegisteredAgentIcon-H1tWUX4M.js → RegisteredAgentIcon-f7rhRPkz.js} +1 -1
- package/dist/public/assets/{ReportBugDialogBody-B0Hz8PSu.js → ReportBugDialogBody-LW0TkzIt.js} +1 -1
- package/dist/public/assets/{ReportBugMenuTrigger-fqTsxaHY.js → ReportBugMenuTrigger-CgcCCpOJ.js} +2 -2
- package/dist/public/assets/{SchemaConfigEditor-BKnKFgWH.js → SchemaConfigEditor-Bj1blZmn.js} +1 -1
- package/dist/public/assets/SessionsHost-LMGYpj1j.js +2 -0
- package/dist/public/assets/{SettingsDialogBody-CLyWK9_-.js → SettingsDialogBody-Dl1_T-dX.js} +1 -1
- package/dist/public/assets/{ShareBranchSwitchDialog-DOFGWcAi.js → ShareBranchSwitchDialog-Dz5dzjqg.js} +1 -1
- package/dist/public/assets/{ShareReceiveDialog-DeXX0A9G.js → ShareReceiveDialog-B3QVYu0-.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-Dt5uoAmv.js → ShareReceiveMissDialog-CS1tQXQL.js} +1 -1
- package/dist/public/assets/{SkillCostValue-Bz3F4Rhv.js → SkillCostValue-CIZWI0R9.js} +1 -1
- package/dist/public/assets/{SkillEditBanner-CwcNkco_.js → SkillEditBanner-CxH3mBEV.js} +1 -1
- package/dist/public/assets/{SkillForkDialog-CkG_oW7h.js → SkillForkDialog-BgRd4B1t.js} +1 -1
- package/dist/public/assets/{SkillInstallMenu-B87ijGMQ.js → SkillInstallMenu-B6JBWSgx.js} +1 -1
- package/dist/public/assets/{SkillOriginInline-Ca3SXbe0.js → SkillOriginInline-BFVU_u1Z.js} +1 -1
- package/dist/public/assets/{SkillToolbarControls-BdthwmpX.js → SkillToolbarControls-D5cCHeYM.js} +1 -1
- package/dist/public/assets/{SlidesToolbarControls-8RmRXuaP.js → SlidesToolbarControls-CHXEsnXH.js} +1 -1
- package/dist/public/assets/{SourceEditor-BiO9HLmi.js → SourceEditor-B-E1K488.js} +1 -1
- package/dist/public/assets/{TerminalPanel-Bxt1nIhY.js → TerminalPanel-Bw19RDik.js} +1 -1
- package/dist/public/assets/{TerminalWindowApp-DEMYVkAB.js → TerminalWindowApp-B3KL5SfD.js} +1 -1
- package/dist/public/assets/{TextDocEditor-B8DepRN7.js → TextDocEditor-C-XMjLEL.js} +1 -1
- package/dist/public/assets/{ThemePicker-BB-6lF8V.js → ThemePicker-wGe4WU58.js} +1 -1
- package/dist/public/assets/{ThreadView-BoQYnWvN.js → ThreadView-m7-Vva2z.js} +1 -1
- package/dist/public/assets/{TimelineDiffPane-DtoYKVQR.js → TimelineDiffPane-BLdUVNWr.js} +1 -1
- package/dist/public/assets/{agent-connection-status-CgdIUJFO.js → agent-connection-status-KQE4pKAU.js} +1 -1
- package/dist/public/assets/{auth-state-cache-g0tpeNul.js → auth-state-cache-Cv9XR57i.js} +1 -1
- package/dist/public/assets/{bug-report-send-manager-0zuWMSw7.js → bug-report-send-manager-CWtbSZGy.js} +1 -1
- package/dist/public/assets/{client-version-CH6DzlkY.js → client-version-C2arCD0H.js} +1 -1
- package/dist/public/assets/{comment-chips-DSoCMI7Q.js → comment-chips-CyXHPWvr.js} +1 -1
- package/dist/public/assets/{config-provider-CI1IgVHl.js → config-provider-DImA7HLe.js} +1 -1
- package/dist/public/assets/{css-color-to-hex-DPzuRcEY.js → css-color-to-hex-DHNASQbt.js} +1 -1
- package/dist/public/assets/{dist-BBNlIz6B.js → dist-BwXhTYUh.js} +3 -3
- package/dist/public/assets/{doc-hash-BP0Io59r.js → doc-hash-BA6YSppY.js} +1 -1
- package/dist/public/assets/{doc-undo-manager-b7w4Wb9M.js → doc-undo-manager-BiKe2QRY.js} +1 -1
- package/dist/public/assets/{documents-events-BhW9c1L3.js → documents-events-CPlDP7Ae.js} +1 -1
- package/dist/public/assets/dropdown-menu-DjQ8GtwR.js +1 -0
- package/dist/public/assets/{file-tree-adapter-CV_ZL37X.js → file-tree-adapter-TfCZK294.js} +1 -1
- package/dist/public/assets/{file-tree-utils-Ba9yRKBT.js → file-tree-utils-CaAcsCBR.js} +1 -1
- package/dist/public/assets/{folder-config-api-VEvZwzig.js → folder-config-api-DW2mqTUS.js} +1 -1
- package/dist/public/assets/index-B4sntfVD.js +2205 -0
- package/dist/public/assets/{lint-config-client-qZ7mC1Zy.js → lint-config-client-DHlRRRWI.js} +1 -1
- package/dist/public/assets/{markdownlint-rule-browser-BJMH4HJX.js → markdownlint-rule-browser-Cj7KRpe7.js} +1 -1
- package/dist/public/assets/messages-8o9dkJJ8.js +1 -0
- package/dist/public/assets/messages-BApjWZBM.js +1 -0
- package/dist/public/assets/messages-BKwDlgqX.js +1 -0
- package/dist/public/assets/messages-BcN2AMRx.js +1 -0
- package/dist/public/assets/messages-BvWDj_ta.js +1 -0
- package/dist/public/assets/messages-C5r4coom.js +1 -0
- package/dist/public/assets/messages-CDBtIcly.js +1 -0
- package/dist/public/assets/{messages-C0RTwTFq.js → messages-DToR3YWR.js} +1 -1
- package/dist/public/assets/messages-DY_W63qi.js +1 -0
- package/dist/public/assets/messages-DaESnN9t.js +1 -0
- package/dist/public/assets/messages-DnLgXawv.js +1 -0
- package/dist/public/assets/messages-oUlW9lVw.js +1 -0
- package/dist/public/assets/{navigation-targets-DBLYH48Z.js → navigation-targets-CF3xv2zv.js} +1 -1
- package/dist/public/assets/{page-list-cache-ia70Eztn.js → page-list-cache-BhPo07tx.js} +1 -1
- package/dist/public/assets/{pending-receive-nav-store-C-oPT_Kg.js → pending-receive-nav-store-CJ33NMQe.js} +1 -1
- package/dist/public/assets/{progress-CzvNMH_z.js → progress-djWCWVWt.js} +1 -1
- package/dist/public/assets/{project-paths-BWUfIMzR.js → project-paths-kRoWTXYO.js} +1 -1
- package/dist/public/assets/{prop-types-Cu1KjM7N.js → prop-types-Bme3P4bM.js} +1 -1
- package/dist/public/assets/{receive-store-MWZ6Efgw.js → receive-store-DfAqJq4B.js} +1 -1
- package/dist/public/assets/{selection-context-BUgPXj5h.js → selection-context-D4LRlMoH.js} +1 -1
- package/dist/public/assets/{skill-scope-nA3yMJC-.js → skill-scope-DbkstvsW.js} +1 -1
- package/dist/public/assets/{skills-api-DM_st9cJ.js → skills-api-CdnH4hed.js} +1 -1
- package/dist/public/assets/{src-79HN8GE9.js → src-DaSohxab.js} +1 -1
- package/dist/public/assets/{startup-marks-DjGilb1Q.js → startup-marks-B6Irsnc4.js} +1 -1
- package/dist/public/assets/{tag-pill-input-I-zmy30v.js → tag-pill-input-CCdgCoeb.js} +1 -1
- package/dist/public/assets/{target-navigation-intent-ZRGm8Ebz.js → target-navigation-intent-DkkS7KB9.js} +1 -1
- package/dist/public/assets/{telemetry-startup-C_vDSOkT.js → telemetry-startup-6hxQUwyY.js} +1 -1
- package/dist/public/assets/terminal-cli-display-eqrZni7m.js +1 -0
- package/dist/public/assets/{terminal-command-events-MPQ3tB2h.js → terminal-command-events-ZJXjKmsv.js} +1 -1
- package/dist/public/assets/{terminal-launch-events-BBSlYIZk.js → terminal-launch-events-Dbutv_lH.js} +1 -1
- package/dist/public/assets/{terminal-telemetry-pvyydkXE.js → terminal-telemetry-BBNIhVrN.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-BQKKqosX.js → typing-burst-detector-Dp5in-Tf.js} +1 -1
- package/dist/public/assets/{uninstall-Bb6vCccP.js → uninstall-DD4-ormb.js} +1 -1
- package/dist/public/assets/{use-activity-panel-pDb7IY6s.js → use-activity-panel-C9qUq7qT.js} +1 -1
- package/dist/public/assets/{use-apply-config-language-48pLGsax.js → use-apply-config-language-D3HyWReP.js} +2 -2
- package/dist/public/assets/use-apply-config-theme-B5w38X1P.js +1 -0
- package/dist/public/assets/{use-collab-url-D-Rpmggc.js → use-collab-url-vE7HSGvm.js} +1 -1
- package/dist/public/assets/{use-conflicts-GDmwqh_O.js → use-conflicts-gcxm9sIo.js} +1 -1
- package/dist/public/assets/{use-live-xterm-theme-RBRq5pG-.js → use-live-xterm-theme-D4uZ9snC.js} +1 -1
- package/dist/public/assets/{use-open-skill-C4iRLb07.js → use-open-skill-00r6KaZQ.js} +1 -1
- package/dist/public/assets/{use-settings-route-DmYoFPHM.js → use-settings-route-BeMu2Onr.js} +1 -1
- package/dist/public/assets/{use-skill-origin-DbioIXic.js → use-skill-origin-Dg8gp1PQ.js} +1 -1
- package/dist/public/assets/{use-skills-BagPzj6D.js → use-skills-BK5nRn5o.js} +1 -1
- package/dist/public/assets/use-terminal-enabled-z4Fyrlvn.js +1 -0
- package/dist/public/assets/{use-timeline-entry-diff-Cv356cHC.js → use-timeline-entry-diff-BbkXE03W.js} +1 -1
- package/dist/public/assets/{use-workspace-BX0piG-D.js → use-workspace-BPV3WN3b.js} +1 -1
- package/dist/public/index.html +57 -57
- package/dist/public/uninstall.html +4 -4
- package/dist/{registry-probes-BvtvRW2N.mjs → registry-probes-ChP-TE8C.mjs} +1 -1
- package/dist/{removal-file-path-RVB0vSi1.mjs → removal-file-path-Dyx7lq7A.mjs} +1 -1
- package/dist/{repair-launch-json-BnlV_psu.mjs → repair-launch-json-tsF1BGn0.mjs} +1 -1
- package/dist/{repair-mcp-configs-CVnSDcwe.mjs → repair-mcp-configs-CVGkvW1p.mjs} +1 -1
- package/dist/{src-BinCag7Z.mjs → src-BZQKfkX2.mjs} +2 -2
- package/dist/src-mlu1pFgN.mjs +1 -0
- package/dist/start-BkzftrP9.mjs +1 -0
- package/dist/{start-DrsgK-zS.mjs → start-CYKX2Pp6.mjs} +3 -3
- package/package.json +5 -5
- package/dist/constants-CWW8AXUs.mjs +0 -1
- package/dist/init-CVn6YFNi.mjs +0 -1
- package/dist/loader-Cxge_ign.mjs +0 -1
- package/dist/preview-DU00Ukqf.mjs +0 -1
- package/dist/public/assets/DiffViewBoundary-CFZjF4Xj.js +0 -29
- package/dist/public/assets/EnableSyncConfirmDialog-DmhIDAV-.js +0 -1
- package/dist/public/assets/FeedbackForm-CDCCOd52.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-j9ihkOtM.js +0 -1
- package/dist/public/assets/McpConsentDialogBody-CXF6JRwT.js +0 -1
- package/dist/public/assets/SessionsHost-DuBW7e2j.js +0 -2
- package/dist/public/assets/dropdown-menu-SORDKiaq.js +0 -1
- package/dist/public/assets/index-DWjHCX39.js +0 -2205
- package/dist/public/assets/messages-BOC9mOzO.js +0 -1
- package/dist/public/assets/messages-BhYfldC5.js +0 -1
- package/dist/public/assets/messages-BoCdYQSk.js +0 -1
- package/dist/public/assets/messages-BqTuEu2G.js +0 -1
- package/dist/public/assets/messages-C8BAfoNQ.js +0 -1
- package/dist/public/assets/messages-D3e2EYtP.js +0 -1
- package/dist/public/assets/messages-DIaB-As6.js +0 -1
- package/dist/public/assets/messages-DKzsGETG.js +0 -1
- package/dist/public/assets/messages-DYwug_Cl.js +0 -1
- package/dist/public/assets/messages-DvW7r91G.js +0 -1
- package/dist/public/assets/messages-aNdi0uM6.js +0 -1
- package/dist/public/assets/terminal-cli-display-UR6Dbpk0.js +0 -1
- package/dist/public/assets/use-apply-config-theme-DpLdjUDN.js +0 -1
- package/dist/public/assets/use-terminal-enabled-b0w6NCxQ.js +0 -1
- package/dist/src-DZbeDCEs.mjs +0 -1
- package/dist/start-DApOX8So.mjs +0 -1
|
@@ -174,14 +174,14 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\
|
|
|
174
174
|
`)+t:t}function Ud(e){if(e===``)return``;let t=e.match(zd);return t?(t[1]??``).replace(/\r?\n$/,``):e}var Wd={defaultKeyType:`PLAIN`,defaultStringType:`PLAIN`,lineWidth:0};function Gd(e){if(e.trim()===``)return{doc:new pu({}),map:{}};let t;try{t=wd(e)}catch(e){let t=e instanceof Error?e.message:String(e);return{doc:new pu({}),map:null,parseError:`parse threw: ${t}`}}if(t.errors.length>0)return{doc:t,map:null,parseError:t.errors[0]?.message??`yaml parse errors`};let n;try{n=t.toJS()}catch(e){let n=e instanceof Error?e.message:String(e);return{doc:t,map:null,parseError:`toJS threw: ${n}`}}if(typeof n!=`object`||!n||Array.isArray(n))return{doc:t,map:null,parseError:`top-level value is not a mapping`};let r=Fd.safeParse(n);if(!r.success){let e=r.error.issues[0],n=e&&Array.isArray(e.path)?e.path.join(`.`):``,i=e?.message??`unknown`;return{doc:t,map:null,parseError:n?`value at "${n}" failed schema: ${i}`:`schema validation failed: ${i}`}}return{doc:t,map:r.data}}function Kd(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function qd(e,t,n){if(Array.isArray(n)){let r=e.createNode(n),i=Gs(t)?t.flow:void 0;return i!==void 0&&(r.flow=i),r}if(Kd(n)){let r=e.createNode(n),i=Hs(t)?t.flow:void 0;return i!==void 0&&(r.flow=i),r}return n}function Jd(e){return e===``?``:`---\n${e.endsWith(`
|
|
175
175
|
`)?e.slice(0,-1):e}\n---\n`}function Yd(e){let t=e.contents;return typeof t!=`object`||!t||!(`items`in t)?[]:t.items.map(e=>{let t=e.key;return typeof t==`string`?t:t&&typeof t==`object`&&`value`in t&&typeof t.value==`string`?t.value:null}).filter(e=>e!==null)}var Xd=`__system__`,Zd=`__config__/project`,Qd=`__user__/config.yml`,$d=`__local__/project`,ef=`__config__/okignore`,tf=Object.freeze([Zd,$d,Qd,ef]),nf=`__skill__/`,rf=`__extskill__/`,af=[`project`,`global`];function of(e){return e.startsWith(`__skill__/`)||e.startsWith(`__template__/`)||e.startsWith(`__extskill__/`)}function sf(e){return`${rf}${e}`}function cf(e,t){return`${rf}${e}/${df(t)}`}function lf(e){return e.startsWith(rf)}function uf(e){if(!e.startsWith(`__extskill__/`))return null;let t=e.slice(13),n=t.indexOf(`/`),r=n<0?t:t.slice(0,n),i=n<0?null:t.slice(n+1);return/^[a-z0-9-]+$/.test(r)?{name:r,rel:i&&i.length>0?i:null}:null}function df(e){return e.replace(/\.mdx?$/i,``)}var ff=`.ok/skills`;function pf(e){return`${ff}/${e}/SKILL`}var mf=[`references`,`scripts`];function hf(e,t){let n=e.trim();if(!n.startsWith(`/`))return null;let r=n.slice(1);if(r===``||r.includes(`/`))return null;let i=/^(\.[A-Za-z0-9_-]+\/skills)\/[^/]+\/(?:SKILL|references\/.+)$/.exec(t);return i?`${i[1]}/${r}/SKILL`:/^__skill__\/(global)\/[^/]+(?:\/references\/.+)?$/.exec(t)?xf(`global`,r):null}function gf(e,t){let n=/^(\.[A-Za-z0-9_-]+\/skills\/[^/]+)\/(?:SKILL|references\/.+)$/.exec(t)??/^(__skill__\/global\/[^/]+)(?:\/references\/.+)?$/.exec(t)??/^(__extskill__\/[^/]+)(?:\/.+)?$/.exec(t);if(!n)return null;let r=n[1],i=df(e.trim()).split(`/`).filter(e=>e!==``&&e!==`.`),[a]=i;return!a||!mf.includes(a)||i.includes(`..`)||i.length<2?null:`${r}/${i.join(`/`)}`}var _f=/^\.[A-Za-z0-9_-]+\/skills\/([^/]+)\/(SKILL|references\/.+)$/;function vf(e){let t=_f.exec(e);if(!t)return null;let n=t[1],r=t[2];return r===`SKILL`?{name:n,kind:`skill`,rel:null}:{name:n,kind:`reference`,rel:r.slice(11)}}var yf=/^__skill__\/global\/([^/]+)(?:\/(references\/.+))?$/;function bf(e){let t=yf.exec(e);if(!t)return null;let{name:n,host:r}=Sf(t[1]),i=t[2];return i===void 0?{name:n,kind:`skill`,rel:null,host:r}:{name:n,kind:`reference`,rel:i.slice(11),host:r}}function xf(e,t,n){return e===`project`?pf(t):`${nf}${e}/${t}${n?`@${n}`:``}`}function Sf(e){let t=e.indexOf(`@`);if(t<0)return{name:e,host:null};let n=e.slice(t+1);return{name:e.slice(0,t),host:n===``?null:n}}function Cf(e,t,n,r){let i=df(n);return e===`project`?`${ff}/${t}/${i}`:`${nf}${e}/${t}${r?`@${r}`:``}/${i}`}function wf(e){if(e===``)return``;try{return e.split(`/`).map(e=>decodeURIComponent(e)).join(`/`)}catch{return e}}function Tf(e){if(e.startsWith(`__skill__/`)){let t=e.slice(10),n=t.indexOf(`/`);if(n<0)return null;let r=t.slice(0,n);if(r!==`global`&&r!==`project`)return null;let i=t.slice(n+1);if(!i)return null;let a=wf(i),o=a.indexOf(`/`),s=o<0?a:a.slice(0,o);if(!s)return null;let c=o<0?null:a.slice(o+1),{name:l,host:u}=Sf(s);return l?{kind:`skill`,scope:r,name:l,host:u,rel:c}:null}return null}var Ef=/^(?:(.+)\/)?\.ok\/templates\/([^/]+?)(?:\.md)?$/;function Df(e,t){let n=e.replace(/^\/+|\/+$/g,``);return n?`${n}/.ok/templates/${t}`:`.ok/templates/${t}`}function Of(e){let t=Ef.exec(e);return t?{folder:(t[1]??``).replace(/^\/+|\/+$/g,``),name:t[2]}:null}function kf(e){if(!e.startsWith(`__template__/`))return null;let t=e.slice(13);if(!t)return null;let n=t.lastIndexOf(`/`),r=n<0?t:t.slice(n+1);return r?{folder:wf(n<0?``:t.slice(0,n)),name:wf(r)}:null}var Af=`.agents/skills`,jf=`open-knowledge-pack-`,Mf=`inkeep/open-knowledge-skills`,Nf=/(^|[\s([])\/([a-z0-9][a-z0-9-]{1,63})(?=$|[\s.,;:!?)\]])/g,Pf=new Set([`tmp`,`usr`,`etc`,`var`,`dev`,`opt`,`bin`,`api`,`home`,`root`]);function Ff(e){return!Pf.has(e)}var If=L({name:M(),description:M(),files:L({skillMd:M(),scripts:F(M()),references:F(M())})}),Lf=L({pluginProvider:M().optional(),plugin:M().optional(),marketplace:M().optional(),repositoryUrl:M().optional(),version:M().optional(),gitCommitSha:M().optional(),scope:M().optional(),projectPath:M().optional()}),Rf=L({commands:P(),hooks:P(),mcp:P()}),zf=L({...If.shape,sourceHarness:M(),sourceHarnesses:F(M()),home:M(),provenance:Lf,inert:Rf,outsideProject:P().optional()}),Bf=L({schema:z(1),name:M(),version:M(),description:M().optional(),author:L({name:M()}).optional(),skills:F(M()),hostCompatibility:F(M()).optional(),capabilities:L({scripts:M(),network:M(),inert:F(M())}).optional(),provenance:L({source:M(),ref:M(),contentHash:M()}).optional()});I({skills:F(zf),packs:F(Bf)}).loose(),I({results:F(I({id:M().min(1),name:M().min(1),source:M().min(1),description:M(),installs:N().int().nonnegative().nullable(),publisher:M().nullable()}).loose()),backend:R([`skills.sh`,`github-fallback`]),degraded:P()}).loose(),I({title:M(),description:M(),image:M().nullable(),skillsUrl:M().nullable(),sourceKind:R([`github`,`site`]),sourceUrl:M()}).loose(),I({skills:F(I({name:M(),description:M().nullable()}).loose())}).loose(),I({kind:R([`local`,`import`,`none`]),scope:R(af).optional(),name:M().optional(),dir:M().optional(),source:M().optional(),ref:M().optional(),via:R([`source`,`publisher`]).optional()}).loose();var Vf=I({relPath:M(),content:M().nullable()}).loose(),Hf=I({provider:M(),plugin:M(),version:M().optional(),marketplace:M().optional(),repositoryUrl:M().optional()}).loose(),Uf=I({provider:M(),plugin:M(),version:M().optional(),description:M().optional(),repositoryUrl:M().optional(),bundledSkills:F(M()),capabilities:I({commands:P(),hooks:P(),mcp:P(),agents:P()}),setupSupported:P()}).loose();I({name:M(),description:M().nullable(),skillMd:M(),files:F(Vf),plugin:Hf.optional(),pluginBundle:Uf.optional()}).loose();var Wf=new Set([`project`,`local`]);function Gf(e){return e!==void 0&&Wf.has(e)?`project`:`global`}var Kf=/^([\w.-]+)\/([\w.-]+)$/,qf=/^(?=.{1,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/i;function Jf(e){let t=Kf.exec(e);if(t){let[,e,n]=t;if(e&&n)return{kind:`github`,owner:e,repo:n}}return qf.test(e)?{kind:`site`,hostname:e}:null}function Yf(e,t){let n=Jf(e),r=t.trim();if(!n||!r)return null;let i=encodeURIComponent(r);if(n.kind===`github`){let e=encodeURIComponent(n.owner),t=encodeURIComponent(n.repo);return{sourceKind:`github`,skillsUrl:`https://www.skills.sh/${e}/${t}/${i}`,sourceUrl:`https://github.com/${e}/${t}`}}return{sourceKind:`site`,skillsUrl:`https://www.skills.sh/site/${encodeURIComponent(n.hostname)}/${i}`,sourceUrl:`https://${n.hostname}`}}function Xf(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(16).padStart(8,`0`)}var Zf={"bridge-merge-loss":{visibility:`surfaced`,gcBucket:`bridge-merge-loss`,bundleExposure:`subject-only`,chainAnchor:!1},"producer-guard-loss":{visibility:`surfaced`,gcBucket:`producer-guard-loss`,bundleExposure:`metadata`,chainAnchor:!1},"observer-a-duplication":{visibility:`surfaced`,gcBucket:`observer-a-duplication`,bundleExposure:`metadata`,chainAnchor:!1},"external-change-rescue":{visibility:`surfaced`,gcBucket:`external-change-rescue`,bundleExposure:`metadata`,chainAnchor:!1},"defer-exhaustion-loss":{visibility:`surfaced`,gcBucket:`defer-exhaustion-loss`,bundleExposure:`metadata`,chainAnchor:!1},"observer-a-apply-loss":{visibility:`surfaced`,gcBucket:`observer-a-apply-loss`,bundleExposure:`subject-only`,chainAnchor:!1},"bridge-derive-loss":{visibility:`surfaced`,gcBucket:`bridge-derive-loss`,bundleExposure:`subject-only`,chainAnchor:!1},"bridge-backstop-trip":{visibility:`surfaced`,gcBucket:`bridge-backstop-trip`,bundleExposure:`metadata`,chainAnchor:!1},"persistence-reconcile-loss":{visibility:`surfaced`,gcBucket:`persistence-reconcile-loss`,bundleExposure:`metadata`,chainAnchor:!1},"persistence-duplication-reset":{visibility:`surfaced`,gcBucket:`persistence-duplication-reset`,bundleExposure:`metadata`,chainAnchor:!1},"persistence-divergence-realign":{visibility:`surfaced`,gcBucket:`persistence-divergence-realign`,bundleExposure:`metadata`,chainAnchor:!1},"managed-artifact-reconcile":{visibility:`surfaced`,gcBucket:`managed-artifact-reconcile`,bundleExposure:`metadata`,chainAnchor:!1},"auto-consolidation":{visibility:`hidden`,gcBucket:`auto-consolidation`,bundleExposure:`none`,chainAnchor:!0}};function Qf(e){return e==null?!0:Zf[e].visibility===`surfaced`}var $f=[`off`,`follow`,`full`],ep=`pull`,tp=[`off`,`follow`,`full`,ep],np=[`follow`,`full`,ep];function rp(e){return e===ep?`follow`:ip(e)?e:null}function ip(e){return typeof e==`string`&&$f.includes(e)}function ap(e){return e===!0?`full`:e===!1?`off`:null}function op(e){return e===!0?`full`:e===!1?`off`:rp(e)}function sp(e){let t=rp(e?.mode);return t===null?ap(e?.enabled):t}var cp=3600,lp=[30,60,300,900,3600];function up(e,t){return typeof e!=`number`||!Number.isFinite(e)?t:Math.min(cp,Math.max(30,Math.round(e)))}function dp(e){return{pullIntervalSeconds:up(e?.pullIntervalSeconds,30),pushIntervalSeconds:up(e?.pushIntervalSeconds,60)}}var fp={sh:`bash`,zsh:`bash`,bash:`bash`,c:`c`,cc:`cpp`,cpp:`cpp`,cxx:`cpp`,"c++":`cpp`,h:`c`,hh:`cpp`,hpp:`cpp`,cs:`csharp`,css:`css`,less:`less`,scss:`scss`,sass:`scss`,diff:`diff`,patch:`diff`,feature:`gherkin`,go:`go`,gql:`graphql`,graphql:`graphql`,ini:`ini`,cfg:`ini`,conf:`ini`,properties:`ini`,java:`java`,js:`javascript`,jsx:`javascript`,mjs:`javascript`,cjs:`javascript`,json:`json`,jsonc:`json`,kt:`kotlin`,kts:`kotlin`,lua:`lua`,makefile:`makefile`,md:`markdown`,mdx:`markdown`,m:`objectivec`,mm:`objectivec`,pl:`perl`,pm:`perl`,php:`php`,phtml:`php`,py:`python`,pyi:`python`,pyx:`python`,r:`r`,rb:`ruby`,rs:`rust`,sql:`sql`,swift:`swift`,ts:`typescript`,tsx:`typescript`,xml:`xml`,yaml:`yaml`,yml:`yaml`},pp=new Set(Object.keys(fp));function mp(e){return fp[e.toLowerCase().replace(/^\./,``)]??null}var hp=new Set([`md`,`mdx`,`mmd`,`mermaid`]),gp=new Set([...pp,`txt`,`text`,`csv`,`tsv`,`log`,`toml`,`html`,`htm`,`svg`,`vue`,`svelte`,`astro`,`lock`].filter(e=>!hp.has(e))),_p={html:`html`,htm:`html`,svg:`xml`,vue:`html`,svelte:`html`,astro:`html`,lock:`yaml`};function vp(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);return n<=0?!1:gp.has(t.slice(n+1).toLowerCase())}var yp=[`image/jpeg`,`image/png`,`image/gif`,`image/webp`,`image/svg+xml`],bp=[`video/mp4`,`video/webm`,`video/ogg`],xp=[`audio/mpeg`,`audio/wav`,`audio/ogg`],Sp=[`application/pdf`],Cp=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`avif`,`svg`]),wp=new Set([`mp4`,`webm`,`mov`,`m4v`,`mkv`]),Tp=new Set([`pdf`]),Ep=new Set([`mp3`,`wav`,`ogg`,`m4a`,`flac`,`aac`,`opus`]),Dp=new Set(`pdf.docx.xlsx.pptx.doc.xls.ppt.zip.7z.tar.gz.rar.csv.tsv.rtf.json.yaml.yml.xml.txt.pages.numbers.key.odt.ods.odp.epub.mobi`.split(`.`)),Op=new Set(`png.jpg.jpeg.gif.webp.avif.svg.apng.heic.heif.tiff.bmp.ico.pdf.mp4.webm.mov.m4v.mkv.avi.flv.wmv.mpeg.mpg.mp3.wav.ogg.m4a.flac.aac.opus.zip.7z.tar.gz.rar.woff.woff2.ttf.otf.eot.docx.xlsx.pptx.doc.xls.ppt.odt.ods.odp.pages.numbers.key.epub.mobi.csv.tsv.txt.rtf.json.yaml.yml.xml.toml.lock.gpx.html.htm`.split(`.`)),kp=new Set(`png.jpg.jpeg.gif.webp.avif.apng.heic.heif.tiff.bmp.ico.svg.pdf.mp4.webm.mov.m4v.mkv.mp3.wav.ogg.m4a.flac.aac.opus.json.toml.lock`.split(`.`)),Ap=`wikiembed`,jp=`toast`,Mp=new Set(`png.jpg.jpeg.gif.webp.avif.svg.pdf.mp4.webm.mov.m4v.mkv.mp3.wav.ogg.m4a.flac.aac.opus.docx.xlsx.pptx.doc.xls.ppt.zip.7z.tar.gz.rar.csv.tsv.rtf.json.yaml.yml.xml.txt.pages.numbers.key.odt.ods.odp.epub.mobi`.split(`.`)),Np=[`png`,`jpg`,`jpeg`,`gif`,`webp`,`avif`],Pp=[`mp4`,`webm`,`mov`,`m4v`],Fp=[`mp3`,`wav`,`ogg`,`m4a`,`flac`,`aac`,`opus`],Ip=[`pdf`],Lp=[`json`,`toml`,`lock`];function Rp(e,t,n){for(let r of t)if(!n.has(r))throw Error(`${e}: ${r} is not present in canonical upload constants`)}Rp(`SIDEBAR_IMAGE_ASSET_EXTENSIONS`,Np,Cp),Rp(`SIDEBAR_VIDEO_ASSET_EXTENSIONS`,Pp,wp),Rp(`SIDEBAR_AUDIO_ASSET_EXTENSIONS`,Fp,Ep),Rp(`SIDEBAR_PDF_ASSET_EXTENSIONS`,Ip,Tp),Rp(`FILE_ATTACHMENT_EXTENSIONS`,[...Dp],Mp),Rp(`WIKI_EMBED_EXTENSIONS`,[...Mp],Op);var zp=new Set(Np),Bp=new Set(Pp),Vp=new Set(Fp),Hp=new Set(Ip),Up=new Set(Lp);Rp(`SIDEBAR_RENDERABLE_ASSET_EXTENSIONS`,[...new Set([...Np,...Pp,...Fp,...Ip,...Lp])],kp);var Wp=new Set([`base`,`canvas`]),Gp=new Set([`mmd`,`mermaid`]);function Kp(e){let t=e.lastIndexOf(`.`);return t<0?!1:Gp.has(e.slice(t+1).toLowerCase())}var qp=new Set([`excalidraw`]);function Jp(e){let t=e.lastIndexOf(`.`);return t<0?!1:qp.has(e.slice(t+1).toLowerCase())}function Yp(e){return!Kp(e)&&!Jp(e)&&!vp(e)}[...Op,...Wp,...Gp,...qp];function Xp(e){let t=e.toLowerCase().replace(/^\./,``);return zp.has(t)?`image`:Bp.has(t)?`video`:Vp.has(t)?`audio`:Hp.has(t)?`pdf`:Up.has(t)||Wp.has(t)?`text`:Gp.has(t)?`mermaid`:qp.has(t)?`excalidraw`:pp.has(t)?`text`:null}var Zp=[`en`,`zh-Hans`,`zh-Hant`,`hi`,`es`,`ar`,`fr`,`bn`,`pt-BR`,`id`,`ur`,`ko`],Qp=[`en`,`zh-Hans`,`zh-Hant`,`hi`,`es`,`fr`,`bn`,`pt-BR`,`id`,`ko`],$p=new Set([`ar`,`ur`]),em=Zp.filter(e=>!$p.has(e)),tm=[`markdownlint`,`frontmatter`,`okf`],nm=[`missing`,`invalid`];function rm(e){return e.frontmatterScope!==void 0}[...tm];var im=[`off`,`warning`,`error`],am=`warning`,om=[`error`,`warning`],sm=[`base00`,`base01`,`base02`,`base03`,`base04`,`base05`,`base06`,`base07`,`base08`,`base09`,`base0A`,`base0B`,`base0C`,`base0D`,`base0E`,`base0F`],cm={base00:`default background`,base01:`alt background — cards, popovers, sidebar`,base02:`selection background, borders`,base03:`comments, invisibles`,base04:`secondary text`,base05:`default foreground`,base06:`light foreground`,base07:`lightest foreground`,base08:`red — variables, tags, diff deleted`,base09:`orange — numbers, constants`,base0A:`yellow — classes, search highlight`,base0B:`green — strings, diff inserted`,base0C:`cyan — support, escapes, quotes`,base0D:`blue — functions, headings, accent`,base0E:`magenta — keywords, storage`,base0F:`deprecated markers, embedded tags`},lm=/^#[0-9a-fA-F]{6}$/,um=/\P{White_Space}/u;function dm(e){return um.test(e)}function fm(e){return typeof e==`string`&&lm.test(e)}function pm(e){let t=e.palette;return{background:t.base00,foreground:t.base05,card:t.base01,"card-foreground":t.base05,popover:t.base01,"popover-foreground":t.base05,primary:t.base0D,"primary-foreground":t.base00,secondary:t.base01,"secondary-foreground":t.base05,muted:t.base01,"muted-foreground":t.base04,accent:t.base02,"accent-foreground":t.base05,destructive:t.base08,border:t.base02,input:t.base02,ring:t.base0D,"selection-soft":t.base02,"chart-1":t.base0D,"chart-2":t.base0B,"chart-3":t.base0A,"chart-4":t.base0E,"chart-5":t.base08,sidebar:t.base01,"sidebar-foreground":t.base05,"sidebar-primary":t.base0D,"sidebar-primary-foreground":t.base00,"sidebar-accent":t.base02,"sidebar-accent-foreground":t.base0D,"sidebar-hover":t.base02,"sidebar-border":t.base02,"sidebar-ring":t.base0D,"syntax-keyword":t.base0E,"syntax-tag":t.base08,"syntax-attr":t.base0D,"syntax-string":t.base0B,"syntax-number":t.base09,"syntax-atom":t.base0C,"syntax-comment":t.base03,"syntax-func":t.base0D,"syntax-var":t.base08,"syntax-type":t.base0A,"syntax-operator":t.base05,"syntax-meta":t.base0F,"syntax-bg":t.base01,"link-color":t.base0D,"broken-link-color":t.base08,"lint-warning-color":t.base0A,"lint-error-color":t.base08,"diff-added":t.base0B,"diff-removed":t.base08,"diff-modified":t.base0D,"callout-note-color":t.base0D,"callout-info-color":t.base0D,"callout-todo-color":t.base0D,"callout-abstract-color":t.base0C,"callout-tip-color":t.base0B,"callout-success-color":t.base0B,"callout-important-color":t.base0E,"callout-example-color":t.base0E,"callout-question-color":t.base0E,"callout-warning-color":t.base0A,"callout-caution-color":t.base09,"callout-danger-color":t.base09,"callout-failure-color":t.base08,"callout-bug-color":t.base08,"callout-quote-color":t.base03,...gm(t)}}var mm={black:`base00`,red:`base08`,green:`base0B`,yellow:`base0A`,blue:`base0D`,magenta:`base0E`,cyan:`base0C`,white:`base05`,brightBlack:`base03`,brightRed:`base08`,brightGreen:`base0B`,brightYellow:`base0A`,brightBlue:`base0D`,brightMagenta:`base0E`,brightCyan:`base0C`,brightWhite:`base07`},hm=Object.keys(mm);function gm(e){let t={};for(let n of hm)t[`ansi-${_m(n)}`]=e[mm[n]];return t}function _m(e){return e.replace(/([a-z])([A-Z])/g,`$1-$2`).toLowerCase()}function vm(e){return JSON.stringify(e).replace(/[\u007f-\u009f\u2028\u2029\ufffe\uffff]/g,e=>`\\u${e.charCodeAt(0).toString(16).padStart(4,`0`)}`)}function ym(e){return`${[`system: "base16"`,`name: ${vm(e.name)}`,...e.author?[`author: ${vm(e.author)}`]:[],`variant: ${vm(e.variant)}`,`palette:`,...sm.map(t=>` ${t}: ${vm(e.palette[t])}`)].join(`
|
|
176
176
|
`)}\n`}function bm(e){let t;try{t=Td(e,{schema:`failsafe`})}catch(e){let t=e?.linePos;return{ok:!1,error:{kind:`unparseable`,line:typeof t?.[0]?.line==`number`?t[0].line:void 0}}}if(!t||typeof t!=`object`||Array.isArray(t))return{ok:!1,error:{kind:`not-a-scheme`}};let n=t,r=n.palette,i=r&&typeof r==`object`&&!Array.isArray(r)?r:n,a={},o=[],s=[];for(let e of sm){let t=i[e]??i[e.toLowerCase()];if(t==null){o.push(e);continue}let n=xm(t);if(!n){s.push(e);continue}a[e]=n}return o.length?{ok:!1,error:{kind:`missing-slots`,slots:o}}:s.length?{ok:!1,error:{kind:`bad-hex`,slots:s}}:typeof n.name==`string`&&!dm(n.name)||typeof n.author==`string`&&!dm(n.author)?{ok:!1,error:{kind:`not-a-scheme`}}:{ok:!0,scheme:{name:typeof n.name==`string`?n.name:`Imported`,author:typeof n.author==`string`?n.author:void 0,variant:n.variant===`light`||n.variant===`dark`?n.variant:wm(a),palette:a}}}function xm(e){if(typeof e!=`string`)return null;let t=e.trim();return t.startsWith(`#`)||(t=`#${t}`),/^#[0-9a-fA-F]{3}$/.test(t)&&(t=`#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}`),lm.test(t)?t.toLowerCase():null}function Sm(e,t,n){let r=fm(e)?e:`#000000`,i=fm(t)?t:`#000000`,a=Math.min(1,Math.max(0,n)),o=`#`;for(let e=0;e<3;e++){let t=Number.parseInt(r.slice(1+e*2,3+e*2),16),n=Number.parseInt(i.slice(1+e*2,3+e*2),16);o+=Math.round(t+(n-t)*a).toString(16).padStart(2,`0`)}return o}function Cm(e){let t=fm(e)?e:`#000000`,n=e=>{let n=Number.parseInt(t.slice(1+e*2,3+e*2),16)/255;return n<=.03928?n/12.92:((n+.055)/1.055)**2.4};return .2126*n(0)+.7152*n(1)+.0722*n(2)}function wm(e){return Cm(e.base00)<Cm(e.base05)?`dark`:`light`}var nne={name:`Dracula`,author:`clach04 (https://github.com/clach04)`,variant:`dark`,palette:{base00:`#282a36`,base01:`#21222c`,base02:`#44475a`,base03:`#6272a4`,base04:`#9ea8c7`,base05:`#f8f8f2`,base06:`#f8f8f2`,base07:`#ffffff`,base08:`#ff5555`,base09:`#ffb86c`,base0A:`#f1fa8c`,base0B:`#50fa7b`,base0C:`#8be9fd`,base0D:`#bd93f9`,base0E:`#ff79c6`,base0F:`#993333`}},rne={name:`Catppuccin Frappé`,author:`https://github.com/catppuccin/catppuccin`,variant:`dark`,palette:{base00:`#303446`,base01:`#292c3c`,base02:`#414559`,base03:`#51576d`,base04:`#626880`,base05:`#c6d0f5`,base06:`#f2d5cf`,base07:`#babbf1`,base08:`#e78284`,base09:`#ef9f76`,base0A:`#e5c890`,base0B:`#a6d189`,base0C:`#81c8be`,base0D:`#8caaee`,base0E:`#ca9ee6`,base0F:`#eebebe`}},ine={name:`Catppuccin Latte`,author:`https://github.com/catppuccin/catppuccin`,variant:`light`,palette:{base00:`#eff1f5`,base01:`#e6e9ef`,base02:`#ccd0da`,base03:`#bcc0cc`,base04:`#acb0be`,base05:`#4c4f69`,base06:`#dc8a78`,base07:`#7287fd`,base08:`#d20f39`,base09:`#fe640b`,base0A:`#df8e1d`,base0B:`#40a02b`,base0C:`#179299`,base0D:`#1d62ec`,base0E:`#8839ef`,base0F:`#dd7878`}},ane={name:`Monokai`,author:`Wimer Hazenberg (http://www.monokai.nl)`,variant:`dark`,palette:{base00:`#272822`,base01:`#383830`,base02:`#49483e`,base03:`#75715e`,base04:`#a59f85`,base05:`#f8f8f2`,base06:`#f5f4f1`,base07:`#f9f8f5`,base08:`#f92672`,base09:`#fd971f`,base0A:`#f4bf75`,base0B:`#a6e22e`,base0C:`#a1efe4`,base0D:`#66d9ef`,base0E:`#ae81ff`,base0F:`#cc6633`}},one={name:`Gruvbox dark, medium`,author:`Dawid Kurek, morhetz (https://github.com/morhetz/gruvbox)`,variant:`dark`,palette:{base00:`#282828`,base01:`#3c3836`,base02:`#504945`,base03:`#665c54`,base04:`#bdae93`,base05:`#d5c4a1`,base06:`#ebdbb2`,base07:`#fbf1c7`,base08:`#fb4934`,base09:`#fe8019`,base0A:`#fabd2f`,base0B:`#b8bb26`,base0C:`#8ec07c`,base0D:`#83a598`,base0E:`#d3869b`,base0F:`#d65d0e`}},sne={name:`Solarized Dark`,author:`Ethan Schoonover (modified by aramisgithub)`,variant:`dark`,palette:{base00:`#002b36`,base01:`#073642`,base02:`#586e75`,base03:`#657b83`,base04:`#839496`,base05:`#93a1a1`,base06:`#eee8d5`,base07:`#fdf6e3`,base08:`#dc322f`,base09:`#cb4b16`,base0A:`#b58900`,base0B:`#859900`,base0C:`#2aa198`,base0D:`#2995e1`,base0E:`#6c71c4`,base0F:`#d33682`}};function Tm(e,t,n){return{id:e,label:t,kind:n.variant,scheme:n,toTokens:()=>pm(n)}}function Em(e,t){return{id:e,label:t,kind:`system`}}var Dm=[Em(`default`,`Default`),Tm(`dracula`,`Dracula`,nne),Tm(`catppuccin-frappe`,`Catppuccin Frappé`,rne),Tm(`catppuccin-latte`,`Catppuccin Latte`,ine),Tm(`monokai`,`Monokai`,ane),Tm(`gruvbox`,`Gruvbox`,one),Tm(`solarized`,`Solarized`,sne),Em(`custom`,`Custom`)],cne=Dm.map(e=>e.id),Om=/^[a-z0-9-]{1,32}$/,lne=`saved-`,km=26,une=/\p{M}+/gu,dne=/['\u2019\u02bc]+/gu,fne=/[^a-z0-9]+/g;function pne(e){let t=2166136261;for(let n of e)t^=n.codePointAt(0)??0,t=Math.imul(t,16777619);return(t>>>0).toString(16).padStart(8,`0`)}function mne(e){let t=e.trim();if(t.length===0)return{ok:!1,code:`empty`};let n=t.normalize(`NFKD`).replace(une,``).toLowerCase().replace(dne,``).replace(fne,`-`).replace(/^-+|-+$/g,``),r=pne(t),i=n.length===0?`theme-${r}`:n.length<=km?n:`${n.slice(0,km-r.length-1).replace(/-+$/g,``)}-${r}`,a=hne(i);if(!a.ok)throw Error(`Saved theme name derivation produced an invalid id`);return{ok:!0,name:t,stem:i,id:a.id}}function hne(e){if(e.length===0)return{ok:!1,code:`empty`};let t=lne+e;return Om.test(t)?{ok:!0,id:t}:{ok:!1,code:/^[a-z0-9-]+$/.test(t)?`too-long`:`invalid-chars`}}function gne(e){if(!Om.test(e)||!e.startsWith(`saved-`))return{ok:!1};let t=e.slice(6);return t.length===0?{ok:!1}:{ok:!0,stem:t}}var _ne=new Map(Dm.map(e=>[e.id,e]));function vne(e){return e&&_ne.get(e)||Dm[0]}function yne(e,t=Dm){let n=new Set(t.map(e=>e.id)),r=e?.colorTheme,i=r&&n.has(r)?r:Dm[0].id,a=e=>e===void 0?i:n.has(e)?e:Dm[0].id;return{light:a(e?.colorThemeLight),dark:a(e?.colorThemeDark)}}function bne(e,t){return e===`light`||e===`dark`?e:t?`dark`:`light`}function xne(e,t,n){return`${e} {\n color-scheme: ${t};\n${Object.entries(n).map(([e,t])=>` --${e}: ${t};`).join(`
|
|
177
|
-
`)}\n}`}var Am=Symbol.for(`@inkeep/open-knowledge/field-registry`),jm=globalThis;jm[Am]===void 0&&(jm[Am]=pr());var U=jm[Am];function Mm(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=Sne(t)?U.get(t):void 0;if(e!==void 0)return e;let n=t._zod?.def?.innerType;if(n===void 0)return;t=n}}function Sne(e){return typeof e==`object`&&!!e&&`_zod`in e&&`parse`in e}function Cne(){return Object.fromEntries(sm.map(e=>[e,M().register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Custom theme: base16 ${e} — ${cm[e]}, as a #rrggbb hex string.`}).optional()]))}function Nm(){return cne.filter(e=>e!==`default`&&e!==`custom`).map(e=>`'${e}'`).join(`, `)}var Pm=Object.freeze([`authorization`,`auth.token`,`auth.bearer`,`cookie`,`set-cookie`,`x-api-key`,`password`,`secret`]),Fm=52428800,Im=26214400,Lm=12582912,Rm=`https://api.openai.com/v1`,zm=`text-embedding-3-small`,Bm=96e3,Vm=3e4,Hm=2048,Um=16384e3,Wm=6e5,Gm=Object.freeze([`127.0.0.1`]),wne=/^[1-9]\d*(s|m|h)$/,Tne=/^https?:\/\//,Ene=24550;function Dne(e){let t;try{t=new URL(e)}catch{return!1}let n=t.hostname.toLowerCase();return n===`localhost`||n===`127.0.0.1`||n===`[::1]`}function One(e){let t;try{t=new URL(e)}catch{return`invalid-url`}return t.protocol===`https:`||t.protocol===`http:`&&Dne(e)?null:`insecure-scheme`}function Km(e){let t=e.trim();return t===``?`./`:t}function kne(e){let t=Km(e);return t.includes(`\0`)||t.includes(`\\`)?!1:t===`/`?!0:!(t.startsWith(`/`)||/^[A-Za-z]:/.test(t)||t.split(`/`).some(e=>e===`..`))}var qm=L({content:L({dir:M().register(U,{scope:`project`,agentSettable:!1,reload:`boot`,defaultScope:`project`,description:`Folder OpenKnowledge reads and writes documents under, relative to the project root (the folder that contains .ok/). Defaults to the project root. Exclude paths with .okignore. Read at server start; changing it requires a restart.`}).default(`.`),attachmentFolderPath:M().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Where pasted and dropped assets are stored, relative to the content root. './' colocates beside the current document (default); '/' targets the content root; './subdir' targets a subfolder under the current document folder; 'folder' targets a fixed folder under the content root. Whitespace-only values are treated as './'.`}).refine(kne,{message:`Invalid attachment folder path: must not contain '..' segments, NUL bytes, backslashes, or OS absolute paths (use '/' for the content root).`}).default(`./`)}).default({dir:`.`,attachmentFolderPath:`./`}),appearance:L({theme:R([`light`,`dark`,`system`]).register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Editor color theme: 'light', 'dark', or 'system' (follow the OS). A personal preference (user scope) — not shared with the project.`}).optional(),language:R([`system`,...Zp]).register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Interface language. 'system' follows the operating system. A personal preference (user scope) — not shared with the project, and never applied to document content.`}).optional(),colorThemeLight:M().register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`IDE color palette applied in light mode: 'default' (no palette), 'custom' (your own colors from appearance.customTheme), one of ${Nm()}, or the id of a saved theme. A short id of lowercase letters, digits, and hyphens (max 32 characters); an id no palette matches falls back to 'default' for this mode only, leaving the rest of your config untouched. A personal preference (user scope) — not shared with the project.`}).regex(Om,{message:`Theme id must be lowercase letters, digits, and hyphens, 1–32 characters (e.g. 'dracula', 'custom', or a saved theme id).`}).optional(),colorThemeDark:M().register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`IDE color palette applied in dark mode: 'default' (no palette), 'custom' (your own colors from appearance.customTheme), one of ${Nm()}, or the id of a saved theme. A short id of lowercase letters, digits, and hyphens (max 32 characters); an id no palette matches falls back to 'default' for this mode only, leaving the rest of your config untouched. A personal preference (user scope) — not shared with the project.`}).regex(Om,{message:`Theme id must be lowercase letters, digits, and hyphens, 1–32 characters (e.g. 'dracula', 'custom', or a saved theme id).`}).optional(),colorTheme:M().register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Superseded by appearance.colorThemeLight / appearance.colorThemeDark. Read as the palette for both modes while neither of those is set. A short theme id (lowercase letters, digits, and hyphens; max 32 characters); an id no palette matches falls back to 'default'. A personal preference (user scope) — not shared with the project.`}).regex(Om,{message:`Theme id must be lowercase letters, digits, and hyphens, 1–32 characters (e.g. 'dracula', 'custom', or a saved theme id).`}).optional(),colorThemeEnabled:P().register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Whether the Themes plugin appears in Settings → Plugins. A personal preference (user scope). Default on.`}).optional(),customTheme:L({name:M().register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Custom theme: the scheme's display name.`}).optional(),author:M().register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Custom theme: the scheme's author credit, carried through from an imported base16 scheme.`}).optional(),variant:R([`dark`,`light`]).register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Custom theme: whether the scheme is 'dark' or 'light'. Auto-detected from the palette when omitted.`}).optional(),...Cne()}).optional(),preview:L({autoOpen:P().register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`When on, the agent opens or refreshes the live preview after each edit. Turn off if you manage your own preview window. A personal preference (user scope).`}).default(!0)}).default({autoOpen:!0}),sidebar:L({showHiddenFiles:P().register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Show dot-prefixed entries (e.g. .ok/, .okignore) in the file tree. Per-machine (project-local) — not shared with collaborators.`}).default(!1),showOnlyMarkdownFiles:P().register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Show only markdown documents (.md/.mdx) and folders in the file tree, hiding other file types from view. View-only: hidden files stay on disk and remain reachable via links and search. Per-machine (project-local) — not shared with collaborators.`}).default(!1),showSkillsSection:P().register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Show the Skills section in the sidebar. Skill documents remain reachable via links and search while the section is hidden. Per-machine (project-local) — not shared with collaborators.`}).default(!0),showOkFolders:P().register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Show .ok folders (skills, templates, and other OpenKnowledge-managed state) in the file tree as read-only entries. .ok/worktrees and .ok/local never appear. Per-machine (project-local) — not shared with collaborators.`}).default(!1),showSkillGroups:P().register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Group skills in the sidebar by where they came from — the publisher they were imported from, or the plugin that ships them. Skills you authored stay ungrouped at the top of their scope. Per-machine (project-local) — not shared with collaborators.`}).default(!0),pinnedProjectSkills:F(M()).register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Project-scope skills pinned to the top of the Skills sidebar, by name. A pinned skill also keeps its normal row, so a provenance group still lists everything from its source. Per-machine (project-local) — not shared with collaborators.`}).default([]),pinnedGlobalSkills:F(M()).register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Global-scope skills pinned to the top of the Skills sidebar, by name. Stored per USER rather than per project, so a pinned global skill follows you into every project.`}).default([])}).optional()}).default({preview:{autoOpen:!0}}),editor:L({wordWrap:P().register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Soft-wrap long lines in the source (CodeMirror) editor. A personal preference (user scope).`}).default(!0),previewTabs:P().register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Reuse one tab when clicking through the Files and Skills sidebars, the way an editor preview tab works. Turn off to open every click in its own tab. Pinned tabs keep their own tab either way. A personal preference (user scope).`}).default(!0)}).default({wordWrap:!0,previewTabs:!0}),agents:L({autoApproveOkTools:P().register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:"Auto-approve OpenKnowledge's own tools (and `ok open` on Claude) for agents launched from the built-in terminal. Destructive tools (delete/move/share/install) still prompt. Per-machine personal preference (user scope)."}).default(!0)}).default({autoApproveOkTools:!0}),autoSync:L({mode:R(tp).register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`What this machine syncs on a schedule for this project: 'off' (Manual — nothing scheduled; the manual pull/push actions still work), 'follow' (Auto, pull only — scheduled pulls, never a scheduled push; 'pull' is accepted as a legacy alias), or 'full' (Auto, pull and push — bidirectional). Explicit user-triggered pushes work in every mode. null = not chosen yet (onboarding asks). Per-machine (project-local) — not shared. Supersedes the legacy autoSync.enabled boolean.`}).nullable().default(null),enabled:P().register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Legacy per-machine sync toggle, superseded by autoSync.mode. Read only when mode is absent (true = full, false = off). null = not chosen yet. Per-machine (project-local) — not shared.`}).nullable().default(null),resumeMode:R(np).register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`When sync is paused (autoSync.mode 'off') after having been enabled, the active mode to resume into ('follow' | 'full'). Per-machine UI memory; ignored while a mode is active. Not shared.`}).optional(),pullIntervalSeconds:N().int().min(30).max(cp).register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Seconds between scheduled pulls while autoSync.mode is follow or full (default 30). An unauthenticated follower is additionally floored to the anonymous poll minimum, so a lower value there has no effect. Per-machine (project-local) — not shared.`}).optional().catch(void 0),pushIntervalSeconds:N().int().min(30).max(cp).register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Seconds between scheduled pushes while autoSync.mode is full (default 60). Ignored in every other mode, which never pushes on a schedule. Each cycle with pending edits authors a commit, so a shorter interval means more, smaller commits in the repo's shared history. Per-machine (project-local) — not shared.`}).optional().catch(void 0),default:Ya([P(),R(tp)]).register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Committed project default for a machine's sync mode on first open: 'off' | 'follow' | 'full', or the legacy boolean (true = full, false = off). null = ask (show the onboarding prompt). Shared via git. A per-machine autoSync.mode choice overrides it.`}).nullable().default(null)}).default({mode:null,enabled:null,default:null}),terminal:L({enabled:P().register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Opt-out for the in-app terminal (a real OS shell at full user privilege). The terminal is on by default; set false to disable it for this project on this machine. Per-machine (project-local) — never shared via git, clone, or sync.`}).nullable().default(null),shell:M().register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Absolute Windows shell executable override for the in-app terminal. PowerShell, cmd.exe, and Git Bash support OpenKnowledge-managed launches (agent chat tabs and fixed commands such as Resolve in terminal or Install Slidev) and dropped-file path insertion. A different existing executable remains usable for plain terminal tabs and shows a capability notice; requested agent and command launches open only the plain shell without running the agent or command, and dropped-file paths are refused. Empty values use automatic shell discovery. Per-machine (project-local), human-managed, and never shared via git, clone, or sync.`}).optional()}).default({enabled:null}),slides:L({enabled:P().register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:"Whether the Slides plugin appears in Settings → Plugins. When on, a document whose frontmatter has `slides: true` offers an action that opens the deck in a dedicated window (desktop only, requires a resolvable slidev). A personal preference (user scope). Default off."}).default(!1)}).default({enabled:!1}),telemetry:L({localSink:L({enabled:P().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:"Write local diagnostic spans + logs under .ok/local/ for `ok diagnose bundle`. Local-only — never leaves the machine until you run bundle. Set false for sensitive workspaces. Shared across collaborators."}).default(!0),spans:L({maxBytes:N().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Maximum size, in bytes, of the local diagnostic spans file before it rotates (default ~50 MB).`}).default(Fm)}).default({maxBytes:Fm}),logs:L({maxBytes:N().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Maximum size, in bytes, of the local diagnostic logs file before it rotates (default ~25 MB).`}).default(Im)}).default({maxBytes:Im}),attributeDenylist:F(M()).register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Telemetry attribute keys whose values are redacted before any local span/log is written (credential / secret guard). Extends the built-in denylist.`}).default([...Pm])}).default({enabled:!0,spans:{maxBytes:Fm},logs:{maxBytes:Im},attributeDenylist:[...Pm]}),skillInstallReports:L({enabled:P().register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Report skill installs to skills.sh so a published skill shows an accurate install count. Sends the skill name, its source repo, and which agent tools it was installed for — never file contents, and never for a private or local source. One report per skill per machine. Default on; the DO_NOT_TRACK and DISABLE_TELEMETRY environment variables also turn it off.`}).default(!0)}).default({enabled:!0})}).default({localSink:{enabled:!0,spans:{maxBytes:Fm},logs:{maxBytes:Im},attributeDenylist:[...Pm]},skillInstallReports:{enabled:!0}}),lossCapture:L({enabled:P().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:"Record bridge loss-class events (content-free) under .ok/local/loss-capture/ for `ok diagnose bundle`. Local-only — never leaves the machine until you run bundle. Set false for sensitive workspaces. Shared across collaborators."}).default(!0),maxBytes:N().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Maximum size, in bytes, of the local loss-capture file before it rotates (default ~12 MB).`}).default(Lm)}).default({enabled:!0,maxBytes:Lm}),bridge:L({backgroundThrottle:L({enabled:P().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Keep the desktop window's timers running at full rate while it holds unsynced work, so backgrounding the app never starves sync or recovery; when the window is idle the OS-default background throttling is restored (battery). Honored by the desktop app. Default ON — disable only to isolate a suspected regression.`}).default(!0)}).default({enabled:!0}),deferGuard:L({enabled:P().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Defer a drain-shaped Observer B re-derive when the WYSIWYG fragment holds an un-propagated keystroke Y.Text lacks, so the keystroke survives instead of being stomped. Default ON — disable only to isolate a suspected regression.`}).default(!0)}).default({enabled:!0}),lossDetector:L({enabled:P().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Detect content the bridge silently dropped at its reconciliation boundary (an Observer-A apply arm or a paired agent-undo derive) and write a recovery checkpoint plus a content-free loss event. Detection only — never blocks a write. Default ON — disable only to isolate a suspected regression.`}).default(!0)}).default({enabled:!0}),fixedPoint:L({enabled:P().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Bound the Y.Text→WYSIWYG re-derive loop with a drain-count backstop: a run of re-derive drains that never reaches a raw-byte fixed point freezes the re-derive loop and writes a recovery checkpoint plus a content-free loss event, instead of churning unbounded. Default ON — disable only to isolate a suspected regression.`}).default(!0)}).default({enabled:!0}),preDrain:L({enabled:P().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Before an agent write or undo rebuilds the WYSIWYG fragment, flush an un-propagated keystroke that provably does not overlap the operation into Y.Text so the keystroke survives instead of needing recovery; overlapping or unmodellable cases fall back to the checkpoint floor. Scope: appending writes and single-frame undos — a write that replaces the whole body (replace / edit) overwrites the keystroke either way, so those always take the checkpoint floor. Default ON — disable only to isolate a suspected regression.`}).default(!0)}).default({enabled:!0}),flushOnHide:L({enabled:P().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`On tab hide/unload, force-send each doc's unsynced work to the server and commit its local cache, and re-sync on return to foreground, so a backgrounded tab never strands edits that IndexedDB alone would lose on recycle. Honored client-side. Default ON — disable only to isolate a suspected regression.`}).default(!0)}).default({enabled:!0})}).default({backgroundThrottle:{enabled:!0},deferGuard:{enabled:!0},lossDetector:{enabled:!0},fixedPoint:{enabled:!0},preDrain:{enabled:!0},flushOnHide:{enabled:!0}}),search:L({semantic:L({enabled:P().register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:"Add semantic (embeddings) ranking to the MCP search tool, fused with the lexical engine so conceptually-related pages surface even with no shared keywords. When ON and an API key is set (`ok embeddings set-key`), the search query and matching document content are sent to the configured embeddings provider — content egress. Default OFF. Per-machine (project-local) — not shared with collaborators."}).default(!1),baseUrl:M().register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:"Base URL of the OpenAI-compatible embeddings API (default https://api.openai.com/v1). Override to point at a self-hosted server (Ollama / vLLM / LM Studio) or another provider. The API key is NOT stored here — set it with `ok embeddings set-key` (`~/.ok/secrets.yml`); it is sent to whichever endpoint this names."}).default(Rm),model:M().register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Embeddings model id (default text-embedding-3-small). Must be served by the provider at baseUrl. Changing it re-embeds the corpus (the cache is keyed by provider + model + dimensions).`}).default(zm),dimensions:N().int().positive().register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Optional output vector dimensions. Omit (recommended) to detect the model's native size from its first response — that is what lets a non-OpenAI model work without knowing its size up front. Set a smaller value (text-embedding-3 supports e.g. 512 / 1024) to shrink the on-disk cache, trading a little retrieval quality; a server that ignores the request param then fails loudly instead of silently. Changing it re-embeds the corpus.`}).optional(),similarityFloor:N().min(0).max(1).register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Optional hard cutoff: drop any "by meaning" match whose cosine similarity is below this value. Off by default (0) because retrieval is rank-based (the closest pages are returned regardless of absolute score) and the right cutoff is model-specific. Set it only to suppress weak matches for a specific provider/model whose cosine scale you know. Most setups should leave it unset and rely on the result-count cap.`}).optional(),maxBatchSize:N().int().min(1).max(Hm).register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Maximum number of text chunks sent in one indexing request (1–2048, default 96). The ceiling follows OpenAI's input-array limit; other providers may impose different limits. Larger requests may still be split by the character budget. Changing it preserves cached vectors and document chunking; it applies to the next indexing pass. Invalid values use the default and are reported by ok config validate and server logs.`}).default(96).catch(96),maxBatchChars:N().int().min(1).max(Um).register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Approximate cumulative character budget per indexing request (1–16384000, default 96000). A single chunk can exceed this budget. OpenAI separately caps total input at 300000 tokens per request; this character budget does not enforce that limit, and high values can produce rejected requests. Other providers have their own limits. Changing it preserves cached vectors and document chunking; it applies to the next indexing pass. Invalid values use the default and are reported by ok config validate and server logs.`}).default(Bm).catch(Bm),docTimeoutMs:N().int().min(1).max(Wm).register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Timeout in milliseconds for each indexing request attempt (1–600000, default 30000). A request can retry four times, and a failed grouped request can trigger individual-document requests. There is no total indexing-pass deadline: large timeouts can delay newly queued work for hours. The query timeout remains 8 seconds per attempt. Changing it preserves cached vectors and applies to the next indexing pass; an in-progress pass keeps its current timeout. Invalid values use the default and are reported by ok config validate and server logs.`}).default(Vm).catch(Vm)}).default({enabled:!1,baseUrl:Rm,model:zm,maxBatchSize:96,maxBatchChars:Bm,docTimeoutMs:Vm})}).default({semantic:{enabled:!1,baseUrl:Rm,model:zm,maxBatchSize:96,maxBatchChars:Bm,docTimeoutMs:Vm}}),contentRules:L({markdownlint:I({enabled:P().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Whether the markdownlint plugin (body rules) contributes diagnostics.`}).default(!1)}).default({enabled:!1}),frontmatter:I({enabled:P().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Whether the frontmatter plugin (JSON-Schema validation of document frontmatter) contributes diagnostics.`}).default(!1),schemas:F(I({appliesTo:Ya([M(),F(M())]).optional(),file:M(),enabled:P().optional()})).register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Frontmatter schema mappings: which docs (appliesTo globs) validate against which JSON Schema file (project-root-relative path).`}).default([])}).default({enabled:!1,schemas:[]}),okf:I({enabled:P().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Whether the OKF plugin (Open Knowledge Format portability + conformance rules) contributes diagnostics. Advisory warnings; never blocks a write.`}).default(!1),rules:to(M(),P()).register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Per-rule opt-outs for the OKF plugin, keyed by rule id (e.g. no-wiki-links). Omit a rule to leave it enabled; set false to silence it while keeping the plugin on.`}).optional(),generate:I({index:P().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Whether OK generates and maintains a navigation index.md in every folder that contains Markdown, each listing the documents in that folder grouped by frontmatter type and linking to its subfolders. OK owns these files: edits to them are replaced on the next rebuild.`}).default(!1)}).default({index:!1})}).default({enabled:!1,generate:{index:!1}})}).default({markdownlint:{enabled:!1},frontmatter:{enabled:!1,schemas:[]},okf:{enabled:!1,generate:{index:!1}}}),validation:L({links:R(im).register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`How broken internal links are reported on the validation plane: 'off' hides them, 'warning' (default) or 'error' sets their severity.`}).default(am),fileTreeIndicators:P().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Whether the file tree tints and badges files that have validation problems.`}).default(!0),suppressLogLinkAdvisories:P().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Whether unresolved links in the reserved change-history documents (lowercase-stemmed log.md / log.mdx at any depth, where the extension's case does not matter and the stem's does) are omitted from broken-link advisories: the Problems panel, file-tree indicators, source diagnostics, audits, and agent write/edit results. Default true. Raw link views still show them, and LOG.md, Log.md, and every other stem spelling are ordinary documents.`}).default(!0)}).default({links:am,fileTreeIndicators:!0,suppressLogLinkAdvisories:!0}),linkPreviews:L({enabled:P().register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Show a rich preview card (site name, page title, description, favicon) when you hover an external link in the editor. When ON, hovering an external link sends that link's URL to the destination site to fetch its preview metadata — outbound egress, one request per previewed link. Default ON; set to false to turn external previews off. Per-machine (project-local) — not shared with collaborators. Previews of links to other documents in this project are read from the local index with no network request and are always on.`}).default(!0)}).default({enabled:!0}),server:L({port:N().int().min(1).max(65535).register(U,{scope:`project`,agentSettable:!1,reload:`boot`,defaultScope:`project`,description:`TCP port the server listens on. Unset by default: a local start picks a free port dynamically, and deployment platforms inject the PORT environment variable instead. Read at server start; changing it requires a restart.`}).optional(),bind:F(M().min(1)).min(1).register(U,{scope:`project-local`,agentSettable:!1,reload:`boot`,defaultScope:`project-local`,description:`Addresses the server binds, e.g. [127.0.0.1] or [0.0.0.0]. Default loopback-only ([127.0.0.1]): nothing off this machine can connect. A non-loopback bind additionally requires the server.allowExternal consent interlock. Per-machine (project-local): a value committed to .ok/config.yml is ignored, so one machine exposing the server can never break local clones for the rest of the team — the exposing host sets it via OK_BIND, --bind, or .ok/local/config.yml. Lists replace, never merge. Read at server start; changing it requires a restart.`}).default([...Gm]),externalUrl:ya({protocol:/^https?$/}).regex(Tne).register(U,{scope:`project`,agentSettable:!1,reload:`boot`,defaultScope:`project`,description:`Canonical external origin the server is reached at, e.g. https://kb.example.com — its host joins the Host/Origin allowlists (external-Host + CORS admission). Unset by default: the server admits only loopback Hosts. Setting it declares external exposure, which additionally requires the server.allowExternal consent interlock. Read at server start; changing it requires a restart.`}).optional(),allowExternal:P().register(U,{scope:`project-local`,agentSettable:!1,reload:`boot`,defaultScope:`project-local`,description:`Exposure consent interlock. A non-loopback server.bind without allowExternal: true is refused at boot with a one-line fix; a server.externalUrl without it boots (a committed externalUrl never arms exposure on clones — but it is project-scoped, so its host still joins the Host/Origin allowlists there), but requests carrying forwarding headers (X-Forwarded-For etc.) are refused until consent is given — proxy tolerance requires both keys. Default off. The server has no authentication of its own, so only consent behind an authenticating edge. Per-machine (project-local) — consent never travels via git, clone, or share; containers consent via the environment instead.`}).default(!1),openBrowser:P().register(U,{scope:`project-local`,agentSettable:!1,reload:`boot`,defaultScope:`project-local`,description:`Open the UI in a browser when the server starts. Default derived: true when every bind address is loopback (a laptop start pops the UI), false otherwise (a container or exposed bind is headless and must never try). Acts once at start. Per-machine (project-local) — not shared.`}).optional(),idleShutdown:Ya([z(`off`),M().regex(wne)]).register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Shut the server down after this long with no activity: a duration like '30m' (positive integer with unit s, m, or h), or 'off'. Default derived: '30m' for a loopback-only, unexposed server; 'off' otherwise — a non-loopback bind, or a loopback bind declared externally reachable (server.allowExternal + server.externalUrl), stays up, because a remote agent keeps it busy over /mcp, which the idle timer does not count. Residual case the derivation cannot see: a loopback server reached by remote agents with no server.externalUrl (e.g. behind a same-box reverse proxy) still idles at 30m — set 'off' by hand. Reloadable — a valid change applies without a restart. Per-machine (project-local) — not shared.`}).optional()}).default({bind:[...Gm],allowExternal:!1})}),Ane=`open-knowledge-config`;function Jm(e,t,n){let r=c.getTracer(Ane),i=t?{attributes:t}:{};return r.startActiveSpan(e,i,e=>{try{return n(e)}catch(t){throw e.recordException(t),e.setStatus({code:s.ERROR,message:t instanceof Error?t.message:String(t)}),t}finally{e.end()}})}function Ym(e,t){let n=c.getActiveSpan();n&&n.addEvent(e,t)}function jne(e){let t=e;for(let e=0;e<16;e++){if(t==null||t?._zod?.def?.shape!==void 0)return t;let e=t?._zod?.def?.innerType;if(e===void 0)return t;t=e}return t}function Xm(e,t){let n=e;for(let e of t){n=jne(n);let t=n?._zod?.def?.shape;if(!t||(n=t[String(e)],n===void 0))return}return n}function Zm(e,t){let n=Xm(e,t);if(n!==void 0)return Mm(n)}function Mne(e,t){return e===`either`?!0:e===t}function Nne(e,t){let n=null;function r(e,i){if(n!==null||e===void 0)return;if(typeof e==`object`&&e&&!Array.isArray(e)){for(let[t,a]of Object.entries(e))if(r(a,[...i,t]),n!==null)return;return}let a=Zm(qm,i);a?.scope!==void 0&&(Mne(a.scope,t)||(n={code:`SCOPE_VIOLATION`,path:i,expectedScope:a.scope,actualScope:t}))}for(let[t,i]of Object.entries(e))if(r(i,[t]),n!==null)break;return n}function Qm(e,t){for(let n=1;n<t.length;n++){let r=t.slice(0,n);e.hasIn(r)&&(Ks(e.getIn(r,!0))||e.deleteIn(r))}}function Pne(e,t){let n=[];function r(t,i){if(t!==void 0){if(t===null){e.deleteIn(i),n.push(i.join(`.`));return}if(Array.isArray(t)){Qm(e,i),e.setIn(i,t),n.push(i.join(`.`));return}if(typeof t==`object`){for(let[e,n]of Object.entries(t))r(n,[...i,e]);return}Qm(e,i),e.setIn(i,t),n.push(i.join(`.`))}}for(let[e,n]of Object.entries(t))r(n,[e]);return n}function Fne(e){return{path:e.path.map(e=>typeof e==`symbol`?String(e):e),message:e.message,issueCode:e.code}}var $m=I({file:M(),line:N().int().min(1),column:N().int().min(1),snippet:M().optional()}),Ine=I({path:F(Ya([M(),N()])),message:M(),issueCode:M(),params:to(M(),Ha()).optional(),source:$m.optional()}),Lne=R([`user`,`project`,`project-local`,`either`]),eh=R([`user`,`project`,`project-local`]),th=I({code:z(`YAML_PARSE`),detail:M()}),nh=I({code:z(`UNREADABLE`),detail:M()}),rh=I({code:z(`SCHEMA_INVALID`),issues:F(Ine)}),ih=I({code:z(`REMOVED_KEY`),path:F(M()),redirect:M(),source:$m.optional()}),ah=I({path:F(M()),message:M(),source:$m.omit({snippet:!0}).optional()}),oh=I({code:z(`VALUE_FALLBACK`),issues:F(ah)}),sh=Za(`code`,[th,rh,nh,I({code:z(`SCOPE_VIOLATION`),path:F(M()),expectedScope:Lne,actualScope:eh}),I({code:z(`NOT_AGENT_SETTABLE`),path:F(M())}),I({code:z(`MIXED_SCOPE`),paths:F(I({path:F(M()),scope:eh}))}),ih,I({code:z(`WRITE_ERROR`),detail:M()}),I({code:z(`OKIGNORE_INVALID`),detail:M(),lineNumber:N().int().min(1).optional()}),I({code:z(`UNKNOWN`),message:M().optional()})]);Za(`code`,[ih,oh,th,rh,nh]),I({diagnostics:F(Za(`code`,[I({code:z(`VALUE_FALLBACK`),scope:eh,file:M(),issues:F(ah.omit({source:!0}).extend({line:$m.shape.line.optional(),column:$m.shape.column.optional()}))}),I({code:z(`REMOVED_KEY`),scope:eh,file:M(),path:F(M()),redirect:M()}),I({code:z(`YAML_PARSE`),scope:eh,file:M()}),I({code:z(`SCHEMA_INVALID`),scope:eh,file:M()}),I({code:z(`UNREADABLE`),scope:eh,file:M()})]))});var Rne=new Set(sh.options.map(e=>e.shape.code.value)),zne=Ya([sh,L({code:M(),message:M().optional()})]);function ch(e){return Rne.has(e.code)}function lh(e){switch(e){case`user`:return`~/.ok/global.yml`;case`project`:return`.ok/config.yml`;case`project-local`:return`.ok/local/config.yml`;case`either`:return`.ok/config.yml or ~/.ok/global.yml`}}function Bne(e){switch(e){case`user`:return`personal to you, across all projects`;case`project`:return`shared with your team via git`;case`project-local`:return`this machine only, not shared`;case`either`:return`user or project`}}function Vne(e){if(e.code===`VALUE_FALLBACK`){let t=oh.safeParse(e);if(t.success){if(t.data.issues.length===0)return`Configuration loaded with defaults for invalid settings.`;let e=[`Configuration loaded with defaults for invalid settings:`];for(let n of t.data.issues)n.source&&e.push(` ${n.source.file}:${n.source.line}:${n.source.column}`),e.push(` ${n.path.join(`.`)}: ${n.message}`);return e.join(`
|
|
177
|
+
`)}\n}`}var Am=Symbol.for(`@inkeep/open-knowledge/field-registry`),jm=globalThis;jm[Am]===void 0&&(jm[Am]=pr());var U=jm[Am];function Mm(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=Sne(t)?U.get(t):void 0;if(e!==void 0)return e;let n=t._zod?.def?.innerType;if(n===void 0)return;t=n}}function Sne(e){return typeof e==`object`&&!!e&&`_zod`in e&&`parse`in e}function Cne(){return Object.fromEntries(sm.map(e=>[e,M().register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Custom theme: base16 ${e} — ${cm[e]}, as a #rrggbb hex string.`}).optional()]))}function Nm(){return cne.filter(e=>e!==`default`&&e!==`custom`).map(e=>`'${e}'`).join(`, `)}var Pm=Object.freeze([`authorization`,`auth.token`,`auth.bearer`,`cookie`,`set-cookie`,`x-api-key`,`password`,`secret`]),Fm=52428800,Im=26214400,Lm=12582912,Rm=`https://api.openai.com/v1`,zm=`text-embedding-3-small`,Bm=96e3,Vm=3e4,Hm=2048,Um=16384e3,Wm=6e5,Gm=Object.freeze([`127.0.0.1`]),wne=/^[1-9]\d*(s|m|h)$/,Tne=/^https?:\/\//,Ene=24550;function Dne(e){let t;try{t=new URL(e)}catch{return!1}let n=t.hostname.toLowerCase();return n===`localhost`||n===`127.0.0.1`||n===`[::1]`}function One(e){let t;try{t=new URL(e)}catch{return`invalid-url`}return t.protocol===`https:`||t.protocol===`http:`&&Dne(e)?null:`insecure-scheme`}function Km(e){let t=e.trim();return t===``?`./`:t}function kne(e){let t=Km(e);return t.includes(`\0`)||t.includes(`\\`)?!1:t===`/`?!0:!(t.startsWith(`/`)||/^[A-Za-z]:/.test(t)||t.split(`/`).some(e=>e===`..`))}var qm=L({content:L({dir:M().register(U,{scope:`project`,agentSettable:!1,reload:`boot`,defaultScope:`project`,description:`Folder OpenKnowledge reads and writes documents under, relative to the project root (the folder that contains .ok/). Defaults to the project root. Exclude paths with .okignore. Read at server start; changing it requires a restart.`}).default(`.`),attachmentFolderPath:M().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Where pasted and dropped assets are stored, relative to the content root. './' colocates beside the current document (default); '/' targets the content root; './subdir' targets a subfolder under the current document folder; 'folder' targets a fixed folder under the content root. Whitespace-only values are treated as './'.`}).refine(kne,{message:`Invalid attachment folder path: must not contain '..' segments, NUL bytes, backslashes, or OS absolute paths (use '/' for the content root).`}).default(`./`)}).default({dir:`.`,attachmentFolderPath:`./`}),appearance:L({theme:R([`light`,`dark`,`system`]).register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Editor color theme: 'light', 'dark', or 'system' (follow the OS). A personal preference (user scope) — not shared with the project.`}).optional(),language:R([`system`,...Zp]).register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Interface language. 'system' follows the operating system. A personal preference (user scope) — not shared with the project, and never applied to document content.`}).optional(),colorThemeLight:M().register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`IDE color palette applied in light mode: 'default' (no palette), 'custom' (your own colors from appearance.customTheme), one of ${Nm()}, or the id of a saved theme. A short id of lowercase letters, digits, and hyphens (max 32 characters); an id no palette matches falls back to 'default' for this mode only, leaving the rest of your config untouched. A personal preference (user scope) — not shared with the project.`}).regex(Om,{message:`Theme id must be lowercase letters, digits, and hyphens, 1–32 characters (e.g. 'dracula', 'custom', or a saved theme id).`}).optional(),colorThemeDark:M().register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`IDE color palette applied in dark mode: 'default' (no palette), 'custom' (your own colors from appearance.customTheme), one of ${Nm()}, or the id of a saved theme. A short id of lowercase letters, digits, and hyphens (max 32 characters); an id no palette matches falls back to 'default' for this mode only, leaving the rest of your config untouched. A personal preference (user scope) — not shared with the project.`}).regex(Om,{message:`Theme id must be lowercase letters, digits, and hyphens, 1–32 characters (e.g. 'dracula', 'custom', or a saved theme id).`}).optional(),colorTheme:M().register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Superseded by appearance.colorThemeLight / appearance.colorThemeDark. Read as the palette for both modes while neither of those is set. A short theme id (lowercase letters, digits, and hyphens; max 32 characters); an id no palette matches falls back to 'default'. A personal preference (user scope) — not shared with the project.`}).regex(Om,{message:`Theme id must be lowercase letters, digits, and hyphens, 1–32 characters (e.g. 'dracula', 'custom', or a saved theme id).`}).optional(),colorThemeEnabled:P().register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Whether the Themes plugin appears in Settings → Plugins. A personal preference (user scope). Default on.`}).optional(),customTheme:L({name:M().register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Custom theme: the scheme's display name.`}).optional(),author:M().register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Custom theme: the scheme's author credit, carried through from an imported base16 scheme.`}).optional(),variant:R([`dark`,`light`]).register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Custom theme: whether the scheme is 'dark' or 'light'. Auto-detected from the palette when omitted.`}).optional(),...Cne()}).optional(),preview:L({autoOpen:P().register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`When on, the agent opens or refreshes the live preview after each edit. Turn off if you manage your own preview window. A personal preference (user scope).`}).default(!0)}).default({autoOpen:!0}),sidebar:L({showHiddenFiles:P().register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Show dot-prefixed entries (e.g. .ok/, .okignore) in the file tree. Per-machine (project-local) — not shared with collaborators.`}).default(!1),showOnlyMarkdownFiles:P().register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Show only markdown documents (.md/.mdx) and folders in the file tree, hiding other file types from view. View-only: hidden files stay on disk and remain reachable via links and search. Per-machine (project-local) — not shared with collaborators.`}).default(!1),showSkillsSection:P().register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Show the Skills section in the sidebar. Skill documents remain reachable via links and search while the section is hidden. Per-machine (project-local) — not shared with collaborators.`}).default(!0),showOkFolders:P().register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Show .ok folders (skills, templates, and other OpenKnowledge-managed state) in the file tree as read-only entries. .ok/worktrees and .ok/local never appear. Per-machine (project-local) — not shared with collaborators.`}).default(!1),showSkillGroups:P().register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Group skills in the sidebar by where they came from — the publisher they were imported from, or the plugin that ships them. Skills you authored stay ungrouped at the top of their scope. Per-machine (project-local) — not shared with collaborators.`}).default(!0),pinnedProjectSkills:F(M()).register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Project-scope skills pinned to the top of the Skills sidebar, by name. A pinned skill also keeps its normal row, so a provenance group still lists everything from its source. Per-machine (project-local) — not shared with collaborators.`}).default([]),pinnedGlobalSkills:F(M()).register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Global-scope skills pinned to the top of the Skills sidebar, by name. Stored per USER rather than per project, so a pinned global skill follows you into every project.`}).default([])}).optional()}).default({preview:{autoOpen:!0}}),editor:L({wordWrap:P().register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Soft-wrap long lines in the source (CodeMirror) editor. A personal preference (user scope).`}).default(!0),previewTabs:P().register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Reuse one tab when clicking through the Files and Skills sidebars, the way an editor preview tab works. Turn off to open every click in its own tab. Pinned tabs keep their own tab either way. A personal preference (user scope).`}).default(!0)}).default({wordWrap:!0,previewTabs:!0}),agents:L({autoApproveOkTools:P().register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:"Auto-approve OpenKnowledge's own tools (and `ok open` on Claude) for agents launched from the built-in terminal. Destructive tools (delete/move/share/install) still prompt. Per-machine personal preference (user scope)."}).default(!0)}).default({autoApproveOkTools:!0}),autoSync:L({mode:R(tp).register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`What this machine syncs on a schedule for this project: 'off' (Manual — nothing scheduled; the manual pull/push actions still work), 'follow' (Auto, pull only — scheduled pulls, never a scheduled push; 'pull' is accepted as a legacy alias), or 'full' (Auto, pull and push — bidirectional). Explicit user-triggered pushes work in every mode. null = not chosen yet (onboarding asks). Per-machine (project-local) — not shared. Supersedes the legacy autoSync.enabled boolean.`}).nullable().default(null),enabled:P().register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Legacy per-machine sync toggle, superseded by autoSync.mode. Read only when mode is absent (true = full, false = off). null = not chosen yet. Per-machine (project-local) — not shared.`}).nullable().default(null),resumeMode:R(np).register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`When sync is paused (autoSync.mode 'off') after having been enabled, the active mode to resume into ('follow' | 'full'). Per-machine UI memory; ignored while a mode is active. Not shared.`}).optional(),pullIntervalSeconds:N().int().min(30).max(cp).register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Seconds between scheduled pulls while autoSync.mode is follow or full (default 30). An unauthenticated follower is additionally floored to the anonymous poll minimum, so a lower value there has no effect. Per-machine (project-local) — not shared.`}).optional().catch(void 0),pushIntervalSeconds:N().int().min(30).max(cp).register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Seconds between scheduled pushes while autoSync.mode is full (default 60). Ignored in every other mode, which never pushes on a schedule. Each cycle with pending edits authors a commit, so a shorter interval means more, smaller commits in the repo's shared history. Per-machine (project-local) — not shared.`}).optional().catch(void 0),default:Ya([P(),R(tp)]).register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Committed project default for a machine's sync mode on first open: 'off' | 'follow' | 'full', or the legacy boolean (true = full, false = off). null = ask (show the onboarding prompt). Shared via git. A per-machine autoSync.mode choice overrides it.`}).nullable().default(null)}).default({mode:null,enabled:null,default:null}),terminal:L({enabled:P().register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Opt-out for the in-app terminal (a real OS shell at full user privilege). The terminal is on by default; set false to disable it for this project on this machine. Per-machine (project-local) — never shared via git, clone, or sync.`}).nullable().default(null),shell:M().register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Absolute Windows shell executable override for the in-app terminal. PowerShell, cmd.exe, and Git Bash support OpenKnowledge-managed launches (agent chat tabs and fixed commands such as Resolve in terminal or Install Slidev) and dropped-file path insertion. A different existing executable remains usable for plain terminal tabs and shows a capability notice; requested agent and command launches open only the plain shell without running the agent or command, and dropped-file paths are refused. Empty values use automatic shell discovery. Per-machine (project-local), human-managed, and never shared via git, clone, or sync.`}).optional()}).default({enabled:null}),slides:L({enabled:P().register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:"Whether the Slides plugin appears in Settings → Plugins. When on, a document whose frontmatter has `slides: true` offers an action that opens the deck in a dedicated window (desktop only, requires a resolvable slidev). A personal preference (user scope). Default off."}).default(!1)}).default({enabled:!1}),telemetry:L({localSink:L({enabled:P().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:"Write local diagnostic spans + logs under .ok/local/ for `ok diagnose bundle`. Local-only — never leaves the machine until you run bundle. Set false for sensitive workspaces. Shared across collaborators."}).default(!0),spans:L({maxBytes:N().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Maximum size, in bytes, of the local diagnostic spans file before it rotates (default ~50 MB).`}).default(Fm)}).default({maxBytes:Fm}),logs:L({maxBytes:N().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Maximum size, in bytes, of the local diagnostic logs file before it rotates (default ~25 MB).`}).default(Im)}).default({maxBytes:Im}),attributeDenylist:F(M()).register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Telemetry attribute keys whose values are redacted before any local span/log is written (credential / secret guard). Extends the built-in denylist.`}).default([...Pm])}).default({enabled:!0,spans:{maxBytes:Fm},logs:{maxBytes:Im},attributeDenylist:[...Pm]}),skillInstallReports:L({enabled:P().register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Report skill installs to skills.sh so a published skill shows an accurate install count. Sends the skill name, its source repo, and which agent tools it was installed for — never file contents, and never for a private or local source. One report per skill per machine. Default on; the DO_NOT_TRACK and DISABLE_TELEMETRY environment variables also turn it off.`}).default(!0)}).default({enabled:!0})}).default({localSink:{enabled:!0,spans:{maxBytes:Fm},logs:{maxBytes:Im},attributeDenylist:[...Pm]},skillInstallReports:{enabled:!0}}),lossCapture:L({enabled:P().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:"Record bridge loss-class events (content-free) under .ok/local/loss-capture/ for `ok diagnose bundle`. Local-only — never leaves the machine until you run bundle. Set false for sensitive workspaces. Shared across collaborators."}).default(!0),maxBytes:N().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Maximum size, in bytes, of the local loss-capture file before it rotates (default ~12 MB).`}).default(Lm)}).default({enabled:!0,maxBytes:Lm}),bridge:L({backgroundThrottle:L({enabled:P().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Keep the desktop window's timers running at full rate while it holds unsynced work, so backgrounding the app never starves sync or recovery; when the window is idle the OS-default background throttling is restored (battery). Honored by the desktop app. Default ON — disable only to isolate a suspected regression.`}).default(!0)}).default({enabled:!0}),deferGuard:L({enabled:P().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Defer a drain-shaped Observer B re-derive when the WYSIWYG fragment holds an un-propagated keystroke Y.Text lacks, so the keystroke survives instead of being stomped. Default ON — disable only to isolate a suspected regression.`}).default(!0)}).default({enabled:!0}),lossDetector:L({enabled:P().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Detect content the bridge silently dropped at its reconciliation boundary (an Observer-A apply arm or a paired agent-undo derive) and write a recovery checkpoint plus a content-free loss event. Detection only — never blocks a write. Default ON — disable only to isolate a suspected regression.`}).default(!0)}).default({enabled:!0}),fixedPoint:L({enabled:P().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Bound the Y.Text→WYSIWYG re-derive loop with a drain-count backstop: a run of re-derive drains that never reaches a raw-byte fixed point freezes the re-derive loop and writes a recovery checkpoint plus a content-free loss event, instead of churning unbounded. Default ON — disable only to isolate a suspected regression.`}).default(!0)}).default({enabled:!0}),preDrain:L({enabled:P().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Before an agent write or undo rebuilds the WYSIWYG fragment, flush an un-propagated keystroke that provably does not overlap the operation into Y.Text so the keystroke survives instead of needing recovery; overlapping or unmodellable cases fall back to the checkpoint floor. Scope: appending writes and single-frame undos — a write that replaces the whole body (replace / edit) overwrites the keystroke either way, so those always take the checkpoint floor. Default ON — disable only to isolate a suspected regression.`}).default(!0)}).default({enabled:!0}),flushOnHide:L({enabled:P().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`On tab hide/unload, force-send each doc's unsynced work to the server and commit its local cache, and re-sync on return to foreground, so a backgrounded tab never strands edits that IndexedDB alone would lose on recycle. Honored client-side. Default ON — disable only to isolate a suspected regression.`}).default(!0)}).default({enabled:!0})}).default({backgroundThrottle:{enabled:!0},deferGuard:{enabled:!0},lossDetector:{enabled:!0},fixedPoint:{enabled:!0},preDrain:{enabled:!0},flushOnHide:{enabled:!0}}),search:L({semantic:L({enabled:P().register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:"Add semantic (embeddings) ranking to the MCP search tool, fused with the lexical engine so conceptually-related pages surface even with no shared keywords. When ON and an API key is set (`ok embeddings set-key`), the search query and matching document content are sent to the configured embeddings provider — content egress. Default OFF. Per-machine (project-local) — not shared with collaborators."}).default(!1),baseUrl:M().register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:"Base URL of the OpenAI-compatible embeddings API (default https://api.openai.com/v1). Override to point at a self-hosted server (Ollama / vLLM / LM Studio) or another provider. The API key is NOT stored here — set it with `ok embeddings set-key` (`~/.ok/secrets.yml`); it is sent to whichever endpoint this names."}).default(Rm),model:M().register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Embeddings model id (default text-embedding-3-small). Must be served by the provider at baseUrl. Changing it re-embeds the corpus (the cache is keyed by provider + model + dimensions).`}).default(zm),dimensions:N().int().positive().register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Optional output vector dimensions. Omit (recommended) to detect the model's native size from its first response — that is what lets a non-OpenAI model work without knowing its size up front. Set a smaller value (text-embedding-3 supports e.g. 512 / 1024) to shrink the on-disk cache, trading a little retrieval quality; a server that ignores the request param then fails loudly instead of silently. Changing it re-embeds the corpus.`}).optional(),similarityFloor:N().min(0).max(1).register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Optional hard cutoff: drop any "by meaning" match whose cosine similarity is below this value. Off by default (0) because retrieval is rank-based (the closest pages are returned regardless of absolute score) and the right cutoff is model-specific. Set it only to suppress weak matches for a specific provider/model whose cosine scale you know. Most setups should leave it unset and rely on the result-count cap.`}).optional(),maxBatchSize:N().int().min(1).max(Hm).register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Maximum number of text chunks sent in one indexing request (1–2048, default 96). The ceiling follows OpenAI's input-array limit; other providers may impose different limits. Larger requests may still be split by the character budget. Changing it preserves cached vectors and document chunking; it applies to the next indexing pass. Invalid values use the default and are reported by ok config validate and server logs.`}).default(96).catch(96),maxBatchChars:N().int().min(1).max(Um).register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Approximate cumulative character budget per indexing request (1–16384000, default 96000). A single chunk can exceed this budget. OpenAI separately caps total input at 300000 tokens per request; this character budget does not enforce that limit, and high values can produce rejected requests. Other providers have their own limits. Changing it preserves cached vectors and document chunking; it applies to the next indexing pass. Invalid values use the default and are reported by ok config validate and server logs.`}).default(Bm).catch(Bm),docTimeoutMs:N().int().min(1).max(Wm).register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Timeout in milliseconds for each indexing request attempt (1–600000, default 30000). A request can retry four times, and a failed grouped request can trigger individual-document requests. There is no total indexing-pass deadline: large timeouts can delay newly queued work for hours. The query timeout remains 8 seconds per attempt. Changing it preserves cached vectors and applies to the next indexing pass; an in-progress pass keeps its current timeout. Invalid values use the default and are reported by ok config validate and server logs.`}).default(Vm).catch(Vm)}).default({enabled:!1,baseUrl:Rm,model:zm,maxBatchSize:96,maxBatchChars:Bm,docTimeoutMs:Vm})}).default({semantic:{enabled:!1,baseUrl:Rm,model:zm,maxBatchSize:96,maxBatchChars:Bm,docTimeoutMs:Vm}}),contentRules:L({markdownlint:I({enabled:P().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Whether the markdownlint plugin (body rules) contributes diagnostics.`}).default(!1)}).default({enabled:!1}),frontmatter:I({enabled:P().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Whether the frontmatter plugin (JSON-Schema validation of document frontmatter) contributes diagnostics.`}).default(!1),schemas:F(I({appliesTo:Ya([M(),F(M())]).optional(),file:M(),enabled:P().optional()})).register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Frontmatter schema mappings: which docs (appliesTo globs) validate against which JSON Schema file (project-root-relative path).`}).default([])}).default({enabled:!1,schemas:[]}),okf:I({enabled:P().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Whether the OKF plugin (Open Knowledge Format portability + conformance rules) contributes diagnostics. Advisory warnings; never blocks a write.`}).default(!1),rules:to(M(),P()).register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Per-rule opt-outs for the OKF plugin, keyed by rule id (e.g. no-wiki-links). Omit a rule to leave it enabled; set false to silence it while keeping the plugin on.`}).optional(),generate:I({index:P().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Whether OK generates and maintains a navigation index.md in every folder that contains Markdown, each listing the documents in that folder grouped by frontmatter type and linking to its subfolders. OK owns these files: edits to them are replaced on the next rebuild.`}).default(!1)}).default({index:!1})}).default({enabled:!1,generate:{index:!1}})}).default({markdownlint:{enabled:!1},frontmatter:{enabled:!1,schemas:[]},okf:{enabled:!1,generate:{index:!1}}}),validation:L({links:R(im).register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`How broken internal links are reported on the validation plane: 'off' hides them, 'warning' (default) or 'error' sets their severity.`}).default(am),fileTreeIndicators:P().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Whether the file tree tints and badges files that have validation problems.`}).default(!0),suppressLogLinkAdvisories:P().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Whether unresolved links in the reserved change-history documents (lowercase-stemmed log.md / log.mdx at any depth, where the extension's case does not matter and the stem's does) are omitted from broken-link advisories: the Problems panel, file-tree indicators, source diagnostics, audits, and agent write/edit results. Default true. Raw link views still show them, and LOG.md, Log.md, and every other stem spelling are ordinary documents.`}).default(!0)}).default({links:am,fileTreeIndicators:!0,suppressLogLinkAdvisories:!0}),linkPreviews:L({enabled:P().register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Show a rich preview card (site name, page title, description, favicon) when you hover an external link in the editor. When ON, hovering an external link sends that link's URL to the destination site to fetch its preview metadata — outbound egress, one request per previewed link. Default ON; set to false to turn external previews off. Per-machine (project-local) — not shared with collaborators. Previews of links to other documents in this project are read from the local index with no network request and are always on.`}).default(!0)}).default({enabled:!0}),server:L({port:N().int().min(1).max(65535).register(U,{scope:`project`,agentSettable:!1,reload:`boot`,defaultScope:`project`,description:`TCP port the server listens on. Unset by default: a local start picks a free port dynamically, and deployment platforms inject the PORT environment variable instead. Read at server start; changing it requires a restart.`}).optional(),bind:F(M().min(1)).min(1).register(U,{scope:`project-local`,agentSettable:!1,reload:`boot`,defaultScope:`project-local`,description:`Addresses the server binds, e.g. [127.0.0.1] or [0.0.0.0]. Default loopback-only ([127.0.0.1]): nothing off this machine can connect. A non-loopback bind additionally requires the server.allowExternal consent interlock. Per-machine (project-local): a value committed to .ok/config.yml is ignored, so one machine exposing the server can never break local clones for the rest of the team — the exposing host sets it via OK_BIND, --bind, or .ok/local/config.yml. Lists replace, never merge. Read at server start; changing it requires a restart.`}).default([...Gm]),externalUrl:ya({protocol:/^https?$/}).regex(Tne).register(U,{scope:`project`,agentSettable:!1,reload:`boot`,defaultScope:`project`,description:`Canonical external origin the server is reached at, e.g. https://kb.example.com — its host joins the Host/Origin allowlists (external-Host + CORS admission). Unset by default: the server admits only loopback Hosts. Setting it declares external exposure, which additionally requires the server.allowExternal consent interlock. Read at server start; changing it requires a restart.`}).optional(),allowExternal:P().register(U,{scope:`project-local`,agentSettable:!1,reload:`boot`,defaultScope:`project-local`,description:`Exposure consent interlock. A non-loopback server.bind without allowExternal: true is refused at boot with a one-line fix; a server.externalUrl without it boots (a committed externalUrl never arms exposure on clones — but it is project-scoped, so its host still joins the Host/Origin allowlists there), but requests carrying forwarding headers (X-Forwarded-For etc.) are refused until consent is given — proxy tolerance requires both keys. Default off. The server has no authentication of its own, so only consent behind an authenticating edge. Per-machine (project-local) — consent never travels via git, clone, or share; containers consent via the environment instead.`}).default(!1),openBrowser:P().register(U,{scope:`project-local`,agentSettable:!1,reload:`boot`,defaultScope:`project-local`,description:`Open the UI in a browser when the server starts. Default derived: true when every bind address is loopback (a laptop start pops the UI), false otherwise (a container or exposed bind is headless and must never try). Acts once at start. Per-machine (project-local) — not shared.`}).optional(),idleShutdown:Ya([z(`off`),M().regex(wne)]).register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Shut the server down after this long with no activity: a duration like '30m' (positive integer with unit s, m, or h), or 'off'. Default derived: '30m' for a loopback-only, unexposed server; 'off' otherwise — a non-loopback bind, or a loopback bind declared externally reachable (server.allowExternal + server.externalUrl), stays up, because a remote agent keeps it busy over /mcp, which the idle timer does not count. Residual case the derivation cannot see: a loopback server reached by remote agents with no server.externalUrl (e.g. behind a same-box reverse proxy) still idles at 30m — set 'off' by hand. Reloadable — a valid change applies without a restart. Per-machine (project-local) — not shared.`}).optional()}).default({bind:[...Gm],allowExternal:!1})}),Ane=`open-knowledge-config`;function Jm(e,t,n){let r=c.getTracer(Ane),i=t?{attributes:t}:{};return r.startActiveSpan(e,i,e=>{try{return n(e)}catch(t){throw e.recordException(t),e.setStatus({code:s.ERROR,message:t instanceof Error?t.message:String(t)}),t}finally{e.end()}})}function Ym(e,t){let n=c.getActiveSpan();n&&n.addEvent(e,t)}function jne(e){let t=e;for(let e=0;e<16;e++){if(t==null||t?._zod?.def?.shape!==void 0)return t;let e=t?._zod?.def?.innerType;if(e===void 0)return t;t=e}return t}function Xm(e,t){let n=e;for(let e of t){n=jne(n);let t=n?._zod?.def?.shape;if(!t||(n=t[String(e)],n===void 0))return}return n}function Zm(e,t){let n=Xm(e,t);if(n!==void 0)return Mm(n)}function Mne(e,t){return e===`either`?!0:e===t}function Nne(e,t){let n=null;function r(e,i){if(n!==null||e===void 0)return;if(typeof e==`object`&&e&&!Array.isArray(e)){for(let[t,a]of Object.entries(e))if(r(a,[...i,t]),n!==null)return;return}let a=Zm(qm,i);a?.scope!==void 0&&(Mne(a.scope,t)||(n={code:`SCOPE_VIOLATION`,path:i,expectedScope:a.scope,actualScope:t}))}for(let[t,i]of Object.entries(e))if(r(i,[t]),n!==null)break;return n}function Qm(e,t){for(let n=1;n<t.length;n++){let r=t.slice(0,n);e.hasIn(r)&&(Ks(e.getIn(r,!0))||e.deleteIn(r))}}function Pne(e,t){let n=[];function r(t,i){if(t!==void 0){if(t===null){e.deleteIn(i),n.push(i.join(`.`));return}if(Array.isArray(t)){Qm(e,i),e.setIn(i,t),n.push(i.join(`.`));return}if(typeof t==`object`){for(let[e,n]of Object.entries(t))r(n,[...i,e]);return}Qm(e,i),e.setIn(i,t),n.push(i.join(`.`))}}for(let[e,n]of Object.entries(t))r(n,[e]);return n}function Fne(e){return{path:e.path.map(e=>typeof e==`symbol`?String(e):e),message:e.message,issueCode:e.code}}var $m=I({file:M(),line:N().int().min(1),column:N().int().min(1),snippet:M().optional()}),Ine=I({path:F(Ya([M(),N()])),message:M(),issueCode:M(),params:to(M(),Ha()).optional(),source:$m.optional()}),Lne=R([`user`,`project`,`project-local`,`either`]),eh=R([`user`,`project`,`project-local`]),th=I({code:z(`YAML_PARSE`),detail:M()}),nh=I({code:z(`UNREADABLE`),detail:M()}),rh=I({code:z(`SCHEMA_INVALID`),issues:F(Ine)}),ih=I({code:z(`REMOVED_KEY`),path:F(M()),redirect:M(),source:$m.optional()}),ah=I({path:F(M()),message:M(),source:$m.omit({snippet:!0}).optional()}),oh=I({code:z(`VALUE_FALLBACK`),issues:F(ah)}),sh=Za(`code`,[th,rh,nh,I({code:z(`SCOPE_VIOLATION`),path:F(M()),expectedScope:Lne,actualScope:eh}),I({code:z(`NOT_AGENT_SETTABLE`),path:F(M())}),I({code:z(`MIXED_SCOPE`),paths:F(I({path:F(M()),scope:eh}))}),ih,I({code:z(`NOT_SYNCED`),detail:M()}),I({code:z(`WRITE_ERROR`),detail:M()}),I({code:z(`OKIGNORE_INVALID`),detail:M(),lineNumber:N().int().min(1).optional()}),I({code:z(`UNKNOWN`),message:M().optional()})]);Za(`code`,[ih,oh,th,rh,nh]),I({diagnostics:F(Za(`code`,[I({code:z(`VALUE_FALLBACK`),scope:eh,file:M(),issues:F(ah.omit({source:!0}).extend({line:$m.shape.line.optional(),column:$m.shape.column.optional()}))}),I({code:z(`REMOVED_KEY`),scope:eh,file:M(),path:F(M()),redirect:M()}),I({code:z(`YAML_PARSE`),scope:eh,file:M()}),I({code:z(`SCHEMA_INVALID`),scope:eh,file:M()}),I({code:z(`UNREADABLE`),scope:eh,file:M()})]))});var Rne=new Set(sh.options.map(e=>e.shape.code.value)),zne=Ya([sh,L({code:M(),message:M().optional()})]);function ch(e){return Rne.has(e.code)}function lh(e){switch(e){case`user`:return`~/.ok/global.yml`;case`project`:return`.ok/config.yml`;case`project-local`:return`.ok/local/config.yml`;case`either`:return`.ok/config.yml or ~/.ok/global.yml`}}function Bne(e){switch(e){case`user`:return`personal to you, across all projects`;case`project`:return`shared with your team via git`;case`project-local`:return`this machine only, not shared`;case`either`:return`user or project`}}function Vne(e){if(e.code===`VALUE_FALLBACK`){let t=oh.safeParse(e);if(t.success){if(t.data.issues.length===0)return`Configuration loaded with defaults for invalid settings.`;let e=[`Configuration loaded with defaults for invalid settings:`];for(let n of t.data.issues)n.source&&e.push(` ${n.source.file}:${n.source.line}:${n.source.column}`),e.push(` ${n.path.join(`.`)}: ${n.message}`);return e.join(`
|
|
178
178
|
`)}}if(!ch(e))return e.message??`Unknown error (${e.code}).`;switch(e.code){case`YAML_PARSE`:return`Failed to parse YAML: ${e.detail}`;case`UNREADABLE`:return`Could not read the file: ${e.detail}`;case`SCHEMA_INVALID`:{if(e.issues.length===0)return`Invalid configuration.`;let t=new Map;for(let n of e.issues){let e=n.source?.file??`<no source>`,r=t.get(e)??[];r.push(n),t.set(e,r)}let n=[];for(let[e,r]of t){e===`<no source>`?n.push(`Invalid configuration:`):n.push(`Invalid configuration at ${e}:`);for(let t of r){let r=t.path.length===0?`<root>`:t.path.join(`.`);if(t.source){if(n.push(` ${e}:${t.source.line}:${t.source.column}`),n.push(` ${r}: ${t.message}`),t.source.snippet&&t.source.snippet.length>0)for(let e of t.source.snippet.split(`
|
|
179
179
|
`))n.push(` ${e}`)}else n.push(` ${r}: ${t.message}`)}}return n.join(`
|
|
180
180
|
`)}case`SCOPE_VIOLATION`:return[`Setting ${e.path.join(`.`)} belongs in your ${e.expectedScope} config`,`(${lh(e.expectedScope)} — ${Bne(e.expectedScope)}),`,`but it was set in the ${e.actualScope} config (${lh(e.actualScope)}).`,`Move it to ${lh(e.expectedScope)}.`].join(` `);case`NOT_AGENT_SETTABLE`:return[`Setting ${e.path.join(`.`)} is human-only and can't be changed by an agent.`,`Change it in the Settings pane, or edit the config.yml by hand.`].join(` `);case`MIXED_SCOPE`:return[`This change touches settings that live in different config files. Apply them one file at a time:`,e.paths.map(({path:e,scope:t})=>` ${e.join(`.`)} → ${lh(t)} (${t})`).join(`
|
|
181
181
|
`)].join(`
|
|
182
182
|
`);case`REMOVED_KEY`:{let t=e.path.join(`.`),n=[`${e.source?`Removed key at ${e.source.file}:${e.source.line}:${e.source.column}`:`Removed key in configuration`}: ${t}`,e.redirect];if(e.source?.snippet&&e.source.snippet.length>0)for(let t of e.source.snippet.split(`
|
|
183
183
|
`))n.push(` ${t}`);return n.join(`
|
|
184
|
-
`)}case`WRITE_ERROR`:return`Failed to write config file: ${e.detail}`;case`OKIGNORE_INVALID`:return e.lineNumber===void 0?`.okignore: ${e.detail}`:`.okignore line ${e.lineNumber}: ${e.detail}`;case`UNKNOWN`:return e.message??`Unknown error.`}}var uh="Run `ok config migrate` to strip the obsolete key automatically, or remove it by hand.";[`content.include has been removed.`,`For subdirectory scoping, set content.dir in .ok/config.yml instead.`,`For pattern-based filtering, use .okignore (gitignore syntax — exclude-only; do not copy include patterns directly).`,uh].join(` `),[`Move these patterns to .okignore at the project root (gitignore syntax, 1:1 migration).`,uh].join(` `),[`folders is no longer a top-level config field.`,"A folder's own frontmatter (open-shape, like a doc's) lives in nested `<folder>/.ok/frontmatter.yml`; new-doc starting properties come from templates in `<folder>/.ok/templates/`.","Edit via the folder overview in the editor sidebar, or `edit({ folder: { path, frontmatter } })` via the MCP.",uh].join(` `),[`appearance.editorModeDefault was removed and is never read — new docs always open in WYSIWYG; toggle mode via the editor mode button.`,uh].join(` `),[`streaming uploads have no user-facing cap; the value is hardcoded in @inkeep/open-knowledge-core.`,uh].join(` `),[`Use the OPEN_KNOWLEDGE_GITHUB_CLIENT_ID environment variable instead.`,uh].join(` `),[`Use server.bind in .ok/config.yml instead — a list of bind addresses, e.g. [127.0.0.1]; a non-loopback bind additionally requires server.allowExternal.`,`The --bind CLI flag and HOST environment variable also remain available.`,uh].join(` `),[`remote.url has been removed. Use server.externalUrl in .ok/config.yml instead (the public origin your tunnel serves).`,uh].join(` `),[`remote.port has been removed. Use server.port in .ok/config.yml instead.`,uh].join(` `),[`server.publicUrl has been removed. Use server.externalUrl in .ok/config.yml instead (the same key under its current name).`,uh].join(` `),[`This behavior was removed; the value is hardcoded.`,uh].join(` `),[`To disable MCP auto-start, set OK_MCP_AUTOSTART=0.`,uh].join(` `),[`This value is hardcoded in @inkeep/open-knowledge-core.`,uh].join(` `),[`This value is hardcoded in @inkeep/open-knowledge-core.`,uh].join(` `),[`The search result cap is hardcoded in @inkeep/open-knowledge-core; this config key was removed.`,uh].join(` `),["preview URLs now resolve only to the running server — start one with `ok start`.",uh].join(` `),[`preview.scriptSrc has been removed.`,`The code-block preview iframe now runs a fixed open network policy (it is no longer configurable).`,uh].join(` `),[`appearance.sidebar.showAllFiles has been removed.`,`The sidebar lists every file on disk by default; dot-prefixed entries are gated by appearance.sidebar.showHiddenFiles, and appearance.sidebar.showOnlyMarkdownFiles scopes the tree down to markdown documents as a per-machine view preference.`,uh].join(` `);function Hne(e){try{let t=Intl.getCanonicalLocales(e)[0];return t===void 0?null:t}catch{return null}}function dh(e){let t=[];for(let n of e){let e=Hne(n);e!==null&&t.push(e)}return t}function fh(e){try{let t=Intl.getCanonicalLocales(e)[0];if(t===void 0)return null;let n=new Intl.Locale(t).maximize();return!n.language||!n.script?null:`${n.language}-${n.script}`}catch{return null}}var ph=r(a(((e,t)=>{var n=function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32},r=-1,i=1,a=0;n.Diff=function(e,t){return[e,t]},n.prototype.diff_main=function(e,t,r,i){i===void 0&&(i=this.Diff_Timeout<=0?Number.MAX_VALUE:new Date().getTime()+this.Diff_Timeout*1e3);var o=i;if(e==null||t==null)throw Error(`Null input. (diff_main)`);if(e==t)return e?[new n.Diff(a,e)]:[];r===void 0&&(r=!0);var s=r,c=this.diff_commonPrefix(e,t),l=e.substring(0,c);e=e.substring(c),t=t.substring(c),c=this.diff_commonSuffix(e,t);var u=e.substring(e.length-c);e=e.substring(0,e.length-c),t=t.substring(0,t.length-c);var d=this.diff_compute_(e,t,s,o);return l&&d.unshift(new n.Diff(a,l)),u&&d.push(new n.Diff(a,u)),this.diff_cleanupMerge(d),d},n.prototype.diff_compute_=function(e,t,o,s){var c;if(!e)return[new n.Diff(i,t)];if(!t)return[new n.Diff(r,e)];var l=e.length>t.length?e:t,u=e.length>t.length?t:e,d=l.indexOf(u);if(d!=-1)return c=[new n.Diff(i,l.substring(0,d)),new n.Diff(a,u),new n.Diff(i,l.substring(d+u.length))],e.length>t.length&&(c[0][0]=c[2][0]=r),c;if(u.length==1)return[new n.Diff(r,e),new n.Diff(i,t)];var f=this.diff_halfMatch_(e,t);if(f){var p=f[0],m=f[1],h=f[2],g=f[3],_=f[4],v=this.diff_main(p,h,o,s),y=this.diff_main(m,g,o,s);return v.concat([new n.Diff(a,_)],y)}return o&&e.length>100&&t.length>100?this.diff_lineMode_(e,t,s):this.diff_bisect_(e,t,s)},n.prototype.diff_lineMode_=function(e,t,o){var s=this.diff_linesToChars_(e,t);e=s.chars1,t=s.chars2;var c=s.lineArray,l=this.diff_main(e,t,!1,o);this.diff_charsToLines_(l,c),this.diff_cleanupSemantic(l),l.push(new n.Diff(a,``));for(var u=0,d=0,f=0,p=``,m=``;u<l.length;){switch(l[u][0]){case i:f++,m+=l[u][1];break;case r:d++,p+=l[u][1];break;case a:if(d>=1&&f>=1){l.splice(u-d-f,d+f),u=u-d-f;for(var h=this.diff_main(p,m,!1,o),g=h.length-1;g>=0;g--)l.splice(u,0,h[g]);u+=h.length}f=0,d=0,p=``,m=``;break}u++}return l.pop(),l},n.prototype.diff_bisect_=function(e,t,a){for(var o=e.length,s=t.length,c=Math.ceil((o+s)/2),l=c,u=2*c,d=Array(u),f=Array(u),p=0;p<u;p++)d[p]=-1,f[p]=-1;d[l+1]=0,f[l+1]=0;for(var m=o-s,h=m%2!=0,g=0,_=0,v=0,y=0,b=0;b<c&&!(new Date().getTime()>a);b++){for(var x=-b+g;x<=b-_;x+=2){for(var S=l+x,C=x==-b||x!=b&&d[S-1]<d[S+1]?d[S+1]:d[S-1]+1,w=C-x;C<o&&w<s&&e.charAt(C)==t.charAt(w);)C++,w++;if(d[S]=C,C>o)_+=2;else if(w>s)g+=2;else if(h){var ee=l+m-x;if(ee>=0&&ee<u&&f[ee]!=-1){var T=o-f[ee];if(C>=T)return this.diff_bisectSplit_(e,t,C,w,a)}}}for(var E=-b+v;E<=b-y;E+=2){for(var ee=l+E,T=E==-b||E!=b&&f[ee-1]<f[ee+1]?f[ee+1]:f[ee-1]+1,te=T-E;T<o&&te<s&&e.charAt(o-T-1)==t.charAt(s-te-1);)T++,te++;if(f[ee]=T,T>o)y+=2;else if(te>s)v+=2;else if(!h){var S=l+m-E;if(S>=0&&S<u&&d[S]!=-1){var C=d[S],w=l+C-S;if(T=o-T,C>=T)return this.diff_bisectSplit_(e,t,C,w,a)}}}}return[new n.Diff(r,e),new n.Diff(i,t)]},n.prototype.diff_bisectSplit_=function(e,t,n,r,i){var a=e.substring(0,n),o=t.substring(0,r),s=e.substring(n),c=t.substring(r),l=this.diff_main(a,o,!1,i),u=this.diff_main(s,c,!1,i);return l.concat(u)},n.prototype.diff_linesToChars_=function(e,t){var n=[],r={};n[0]=``;function i(e){for(var t=``,i=0,o=-1,s=n.length;o<e.length-1;){o=e.indexOf(`
|
|
184
|
+
`)}case`NOT_SYNCED`:return`Settings are still loading. Try again in a moment.`;case`WRITE_ERROR`:return`Failed to write config file: ${e.detail}`;case`OKIGNORE_INVALID`:return e.lineNumber===void 0?`.okignore: ${e.detail}`:`.okignore line ${e.lineNumber}: ${e.detail}`;case`UNKNOWN`:return e.message??`Unknown error.`}}var uh="Run `ok config migrate` to strip the obsolete key automatically, or remove it by hand.";[`content.include has been removed.`,`For subdirectory scoping, set content.dir in .ok/config.yml instead.`,`For pattern-based filtering, use .okignore (gitignore syntax — exclude-only; do not copy include patterns directly).`,uh].join(` `),[`Move these patterns to .okignore at the project root (gitignore syntax, 1:1 migration).`,uh].join(` `),[`folders is no longer a top-level config field.`,"A folder's own frontmatter (open-shape, like a doc's) lives in nested `<folder>/.ok/frontmatter.yml`; new-doc starting properties come from templates in `<folder>/.ok/templates/`.","Edit via the folder overview in the editor sidebar, or `edit({ folder: { path, frontmatter } })` via the MCP.",uh].join(` `),[`appearance.editorModeDefault was removed and is never read — new docs always open in WYSIWYG; toggle mode via the editor mode button.`,uh].join(` `),[`streaming uploads have no user-facing cap; the value is hardcoded in @inkeep/open-knowledge-core.`,uh].join(` `),[`Use the OPEN_KNOWLEDGE_GITHUB_CLIENT_ID environment variable instead.`,uh].join(` `),[`Use server.bind in .ok/config.yml instead — a list of bind addresses, e.g. [127.0.0.1]; a non-loopback bind additionally requires server.allowExternal.`,`The --bind CLI flag and HOST environment variable also remain available.`,uh].join(` `),[`remote.url has been removed. Use server.externalUrl in .ok/config.yml instead (the public origin your tunnel serves).`,uh].join(` `),[`remote.port has been removed. Use server.port in .ok/config.yml instead.`,uh].join(` `),[`server.publicUrl has been removed. Use server.externalUrl in .ok/config.yml instead (the same key under its current name).`,uh].join(` `),[`This behavior was removed; the value is hardcoded.`,uh].join(` `),[`To disable MCP auto-start, set OK_MCP_AUTOSTART=0.`,uh].join(` `),[`This value is hardcoded in @inkeep/open-knowledge-core.`,uh].join(` `),[`This value is hardcoded in @inkeep/open-knowledge-core.`,uh].join(` `),[`The search result cap is hardcoded in @inkeep/open-knowledge-core; this config key was removed.`,uh].join(` `),["preview URLs now resolve only to the running server — start one with `ok start`.",uh].join(` `),[`preview.scriptSrc has been removed.`,`The code-block preview iframe now runs a fixed open network policy (it is no longer configurable).`,uh].join(` `),[`appearance.sidebar.showAllFiles has been removed.`,`The sidebar lists every file on disk by default; dot-prefixed entries are gated by appearance.sidebar.showHiddenFiles, and appearance.sidebar.showOnlyMarkdownFiles scopes the tree down to markdown documents as a per-machine view preference.`,uh].join(` `);function Hne(e){try{let t=Intl.getCanonicalLocales(e)[0];return t===void 0?null:t}catch{return null}}function dh(e){let t=[];for(let n of e){let e=Hne(n);e!==null&&t.push(e)}return t}function fh(e){try{let t=Intl.getCanonicalLocales(e)[0];if(t===void 0)return null;let n=new Intl.Locale(t).maximize();return!n.language||!n.script?null:`${n.language}-${n.script}`}catch{return null}}var ph=r(a(((e,t)=>{var n=function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32},r=-1,i=1,a=0;n.Diff=function(e,t){return[e,t]},n.prototype.diff_main=function(e,t,r,i){i===void 0&&(i=this.Diff_Timeout<=0?Number.MAX_VALUE:new Date().getTime()+this.Diff_Timeout*1e3);var o=i;if(e==null||t==null)throw Error(`Null input. (diff_main)`);if(e==t)return e?[new n.Diff(a,e)]:[];r===void 0&&(r=!0);var s=r,c=this.diff_commonPrefix(e,t),l=e.substring(0,c);e=e.substring(c),t=t.substring(c),c=this.diff_commonSuffix(e,t);var u=e.substring(e.length-c);e=e.substring(0,e.length-c),t=t.substring(0,t.length-c);var d=this.diff_compute_(e,t,s,o);return l&&d.unshift(new n.Diff(a,l)),u&&d.push(new n.Diff(a,u)),this.diff_cleanupMerge(d),d},n.prototype.diff_compute_=function(e,t,o,s){var c;if(!e)return[new n.Diff(i,t)];if(!t)return[new n.Diff(r,e)];var l=e.length>t.length?e:t,u=e.length>t.length?t:e,d=l.indexOf(u);if(d!=-1)return c=[new n.Diff(i,l.substring(0,d)),new n.Diff(a,u),new n.Diff(i,l.substring(d+u.length))],e.length>t.length&&(c[0][0]=c[2][0]=r),c;if(u.length==1)return[new n.Diff(r,e),new n.Diff(i,t)];var f=this.diff_halfMatch_(e,t);if(f){var p=f[0],m=f[1],h=f[2],g=f[3],_=f[4],v=this.diff_main(p,h,o,s),y=this.diff_main(m,g,o,s);return v.concat([new n.Diff(a,_)],y)}return o&&e.length>100&&t.length>100?this.diff_lineMode_(e,t,s):this.diff_bisect_(e,t,s)},n.prototype.diff_lineMode_=function(e,t,o){var s=this.diff_linesToChars_(e,t);e=s.chars1,t=s.chars2;var c=s.lineArray,l=this.diff_main(e,t,!1,o);this.diff_charsToLines_(l,c),this.diff_cleanupSemantic(l),l.push(new n.Diff(a,``));for(var u=0,d=0,f=0,p=``,m=``;u<l.length;){switch(l[u][0]){case i:f++,m+=l[u][1];break;case r:d++,p+=l[u][1];break;case a:if(d>=1&&f>=1){l.splice(u-d-f,d+f),u=u-d-f;for(var h=this.diff_main(p,m,!1,o),g=h.length-1;g>=0;g--)l.splice(u,0,h[g]);u+=h.length}f=0,d=0,p=``,m=``;break}u++}return l.pop(),l},n.prototype.diff_bisect_=function(e,t,a){for(var o=e.length,s=t.length,c=Math.ceil((o+s)/2),l=c,u=2*c,d=Array(u),f=Array(u),p=0;p<u;p++)d[p]=-1,f[p]=-1;d[l+1]=0,f[l+1]=0;for(var m=o-s,h=m%2!=0,g=0,_=0,v=0,y=0,b=0;b<c&&!(new Date().getTime()>a);b++){for(var x=-b+g;x<=b-_;x+=2){for(var S=l+x,C=x==-b||x!=b&&d[S-1]<d[S+1]?d[S+1]:d[S-1]+1,w=C-x;C<o&&w<s&&e.charAt(C)==t.charAt(w);)C++,w++;if(d[S]=C,C>o)_+=2;else if(w>s)g+=2;else if(h){var ee=l+m-x;if(ee>=0&&ee<u&&f[ee]!=-1){var T=o-f[ee];if(C>=T)return this.diff_bisectSplit_(e,t,C,w,a)}}}for(var E=-b+v;E<=b-y;E+=2){for(var ee=l+E,T=E==-b||E!=b&&f[ee-1]<f[ee+1]?f[ee+1]:f[ee-1]+1,te=T-E;T<o&&te<s&&e.charAt(o-T-1)==t.charAt(s-te-1);)T++,te++;if(f[ee]=T,T>o)y+=2;else if(te>s)v+=2;else if(!h){var S=l+m-E;if(S>=0&&S<u&&d[S]!=-1){var C=d[S],w=l+C-S;if(T=o-T,C>=T)return this.diff_bisectSplit_(e,t,C,w,a)}}}}return[new n.Diff(r,e),new n.Diff(i,t)]},n.prototype.diff_bisectSplit_=function(e,t,n,r,i){var a=e.substring(0,n),o=t.substring(0,r),s=e.substring(n),c=t.substring(r),l=this.diff_main(a,o,!1,i),u=this.diff_main(s,c,!1,i);return l.concat(u)},n.prototype.diff_linesToChars_=function(e,t){var n=[],r={};n[0]=``;function i(e){for(var t=``,i=0,o=-1,s=n.length;o<e.length-1;){o=e.indexOf(`
|
|
185
185
|
`,i),o==-1&&(o=e.length-1);var c=e.substring(i,o+1);(r.hasOwnProperty?r.hasOwnProperty(c):r[c]!==void 0)?t+=String.fromCharCode(r[c]):(s==a&&(c=e.substring(i),o=e.length),t+=String.fromCharCode(s),r[c]=s,n[s++]=c),i=o+1}return t}var a=4e4,o=i(e);return a=65535,{chars1:o,chars2:i(t),lineArray:n}},n.prototype.diff_charsToLines_=function(e,t){for(var n=0;n<e.length;n++){for(var r=e[n][1],i=[],a=0;a<r.length;a++)i[a]=t[r.charCodeAt(a)];e[n][1]=i.join(``)}},n.prototype.diff_commonPrefix=function(e,t){if(!e||!t||e.charAt(0)!=t.charAt(0))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,a=0;n<i;)e.substring(a,i)==t.substring(a,i)?(n=i,a=n):r=i,i=Math.floor((r-n)/2+n);return i},n.prototype.diff_commonSuffix=function(e,t){if(!e||!t||e.charAt(e.length-1)!=t.charAt(t.length-1))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,a=0;n<i;)e.substring(e.length-i,e.length-a)==t.substring(t.length-i,t.length-a)?(n=i,a=n):r=i,i=Math.floor((r-n)/2+n);return i},n.prototype.diff_commonOverlap_=function(e,t){var n=e.length,r=t.length;if(n==0||r==0)return 0;n>r?e=e.substring(n-r):n<r&&(t=t.substring(0,n));var i=Math.min(n,r);if(e==t)return i;for(var a=0,o=1;;){var s=e.substring(i-o),c=t.indexOf(s);if(c==-1)return a;o+=c,(c==0||e.substring(i-o)==t.substring(0,o))&&(a=o,o++)}},n.prototype.diff_halfMatch_=function(e,t){if(this.Diff_Timeout<=0)return null;var n=e.length>t.length?e:t,r=e.length>t.length?t:e;if(n.length<4||r.length*2<n.length)return null;var i=this;function a(e,t,n){for(var r=e.substring(n,n+Math.floor(e.length/4)),a=-1,o=``,s,c,l,u;(a=t.indexOf(r,a+1))!=-1;){var d=i.diff_commonPrefix(e.substring(n),t.substring(a)),f=i.diff_commonSuffix(e.substring(0,n),t.substring(0,a));o.length<f+d&&(o=t.substring(a-f,a)+t.substring(a,a+d),s=e.substring(0,n-f),c=e.substring(n+d),l=t.substring(0,a-f),u=t.substring(a+d))}return o.length*2>=e.length?[s,c,l,u,o]:null}var o=a(n,r,Math.ceil(n.length/4)),s=a(n,r,Math.ceil(n.length/2)),c;if(!o&&!s)return null;c=s?o&&o[4].length>s[4].length?o:s:o;var l,u,d,f;e.length>t.length?(l=c[0],u=c[1],d=c[2],f=c[3]):(d=c[0],f=c[1],l=c[2],u=c[3]);var p=c[4];return[l,u,d,f,p]},n.prototype.diff_cleanupSemantic=function(e){for(var t=!1,o=[],s=0,c=null,l=0,u=0,d=0,f=0,p=0;l<e.length;)e[l][0]==a?(o[s++]=l,u=f,d=p,f=0,p=0,c=e[l][1]):(e[l][0]==i?f+=e[l][1].length:p+=e[l][1].length,c&&c.length<=Math.max(u,d)&&c.length<=Math.max(f,p)&&(e.splice(o[s-1],0,new n.Diff(r,c)),e[o[s-1]+1][0]=i,s--,s--,l=s>0?o[s-1]:-1,u=0,d=0,f=0,p=0,c=null,t=!0)),l++;for(t&&this.diff_cleanupMerge(e),this.diff_cleanupSemanticLossless(e),l=1;l<e.length;){if(e[l-1][0]==r&&e[l][0]==i){var m=e[l-1][1],h=e[l][1],g=this.diff_commonOverlap_(m,h),_=this.diff_commonOverlap_(h,m);g>=_?(g>=m.length/2||g>=h.length/2)&&(e.splice(l,0,new n.Diff(a,h.substring(0,g))),e[l-1][1]=m.substring(0,m.length-g),e[l+1][1]=h.substring(g),l++):(_>=m.length/2||_>=h.length/2)&&(e.splice(l,0,new n.Diff(a,m.substring(0,_))),e[l-1][0]=i,e[l-1][1]=h.substring(0,h.length-_),e[l+1][0]=r,e[l+1][1]=m.substring(_),l++),l++}l++}},n.prototype.diff_cleanupSemanticLossless=function(e){function t(e,t){if(!e||!t)return 6;var r=e.charAt(e.length-1),i=t.charAt(0),a=r.match(n.nonAlphaNumericRegex_),o=i.match(n.nonAlphaNumericRegex_),s=a&&r.match(n.whitespaceRegex_),c=o&&i.match(n.whitespaceRegex_),l=s&&r.match(n.linebreakRegex_),u=c&&i.match(n.linebreakRegex_),d=l&&e.match(n.blanklineEndRegex_),f=u&&t.match(n.blanklineStartRegex_);return d||f?5:l||u?4:a&&!s&&c?3:s||c?2:a||o?1:0}for(var r=1;r<e.length-1;){if(e[r-1][0]==a&&e[r+1][0]==a){var i=e[r-1][1],o=e[r][1],s=e[r+1][1],c=this.diff_commonSuffix(i,o);if(c){var l=o.substring(o.length-c);i=i.substring(0,i.length-c),o=l+o.substring(0,o.length-c),s=l+s}for(var u=i,d=o,f=s,p=t(i,o)+t(o,s);o.charAt(0)===s.charAt(0);){i+=o.charAt(0),o=o.substring(1)+s.charAt(0),s=s.substring(1);var m=t(i,o)+t(o,s);m>=p&&(p=m,u=i,d=o,f=s)}e[r-1][1]!=u&&(u?e[r-1][1]=u:(e.splice(r-1,1),r--),e[r][1]=d,f?e[r+1][1]=f:(e.splice(r+1,1),r--))}r++}},n.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,n.whitespaceRegex_=/\s/,n.linebreakRegex_=/[\r\n]/,n.blanklineEndRegex_=/\n\r?\n$/,n.blanklineStartRegex_=/^\r?\n\r?\n/,n.prototype.diff_cleanupEfficiency=function(e){for(var t=!1,o=[],s=0,c=null,l=0,u=!1,d=!1,f=!1,p=!1;l<e.length;)e[l][0]==a?(e[l][1].length<this.Diff_EditCost&&(f||p)?(o[s++]=l,u=f,d=p,c=e[l][1]):(s=0,c=null),f=p=!1):(e[l][0]==r?p=!0:f=!0,c&&(u&&d&&f&&p||c.length<this.Diff_EditCost/2&&u+d+f+p==3)&&(e.splice(o[s-1],0,new n.Diff(r,c)),e[o[s-1]+1][0]=i,s--,c=null,u&&d?(f=p=!0,s=0):(s--,l=s>0?o[s-1]:-1,f=p=!1),t=!0)),l++;t&&this.diff_cleanupMerge(e)},n.prototype.diff_cleanupMerge=function(e){e.push(new n.Diff(a,``));for(var t=0,o=0,s=0,c=``,l=``,u;t<e.length;)switch(e[t][0]){case i:s++,l+=e[t][1],t++;break;case r:o++,c+=e[t][1],t++;break;case a:o+s>1?(o!==0&&s!==0&&(u=this.diff_commonPrefix(l,c),u!==0&&(t-o-s>0&&e[t-o-s-1][0]==a?e[t-o-s-1][1]+=l.substring(0,u):(e.splice(0,0,new n.Diff(a,l.substring(0,u))),t++),l=l.substring(u),c=c.substring(u)),u=this.diff_commonSuffix(l,c),u!==0&&(e[t][1]=l.substring(l.length-u)+e[t][1],l=l.substring(0,l.length-u),c=c.substring(0,c.length-u))),t-=o+s,e.splice(t,o+s),c.length&&(e.splice(t,0,new n.Diff(r,c)),t++),l.length&&(e.splice(t,0,new n.Diff(i,l)),t++),t++):t!==0&&e[t-1][0]==a?(e[t-1][1]+=e[t][1],e.splice(t,1)):t++,s=0,o=0,c=``,l=``;break}e[e.length-1][1]===``&&e.pop();var d=!1;for(t=1;t<e.length-1;)e[t-1][0]==a&&e[t+1][0]==a&&(e[t][1].substring(e[t][1].length-e[t-1][1].length)==e[t-1][1]?(e[t][1]=e[t-1][1]+e[t][1].substring(0,e[t][1].length-e[t-1][1].length),e[t+1][1]=e[t-1][1]+e[t+1][1],e.splice(t-1,1),d=!0):e[t][1].substring(0,e[t+1][1].length)==e[t+1][1]&&(e[t-1][1]+=e[t+1][1],e[t][1]=e[t][1].substring(e[t+1][1].length)+e[t+1][1],e.splice(t+1,1),d=!0)),t++;d&&this.diff_cleanupMerge(e)},n.prototype.diff_xIndex=function(e,t){var n=0,a=0,o=0,s=0,c;for(c=0;c<e.length&&(e[c][0]!==i&&(n+=e[c][1].length),e[c][0]!==r&&(a+=e[c][1].length),!(n>t));c++)o=n,s=a;return e.length!=c&&e[c][0]===r?s:s+(t-o)},n.prototype.diff_prettyHtml=function(e){for(var t=[],n=/&/g,o=/</g,s=/>/g,c=/\n/g,l=0;l<e.length;l++){var u=e[l][0],d=e[l][1].replace(n,`&`).replace(o,`<`).replace(s,`>`).replace(c,`¶<br>`);switch(u){case i:t[l]=`<ins style="background:#e6ffe6;">`+d+`</ins>`;break;case r:t[l]=`<del style="background:#ffe6e6;">`+d+`</del>`;break;case a:t[l]=`<span>`+d+`</span>`;break}}return t.join(``)},n.prototype.diff_text1=function(e){for(var t=[],n=0;n<e.length;n++)e[n][0]!==i&&(t[n]=e[n][1]);return t.join(``)},n.prototype.diff_text2=function(e){for(var t=[],n=0;n<e.length;n++)e[n][0]!==r&&(t[n]=e[n][1]);return t.join(``)},n.prototype.diff_levenshtein=function(e){for(var t=0,n=0,o=0,s=0;s<e.length;s++){var c=e[s][0],l=e[s][1];switch(c){case i:n+=l.length;break;case r:o+=l.length;break;case a:t+=Math.max(n,o),n=0,o=0;break}}return t+=Math.max(n,o),t},n.prototype.diff_toDelta=function(e){for(var t=[],n=0;n<e.length;n++)switch(e[n][0]){case i:t[n]=`+`+encodeURI(e[n][1]);break;case r:t[n]=`-`+e[n][1].length;break;case a:t[n]=`=`+e[n][1].length;break}return t.join(` `).replace(/%20/g,` `)},n.prototype.diff_fromDelta=function(e,t){for(var o=[],s=0,c=0,l=t.split(/\t/g),u=0;u<l.length;u++){var d=l[u].substring(1);switch(l[u].charAt(0)){case`+`:try{o[s++]=new n.Diff(i,decodeURI(d))}catch{throw Error(`Illegal escape in diff_fromDelta: `+d)}break;case`-`:case`=`:var f=parseInt(d,10);if(isNaN(f)||f<0)throw Error(`Invalid number in diff_fromDelta: `+d);var p=e.substring(c,c+=f);l[u].charAt(0)==`=`?o[s++]=new n.Diff(a,p):o[s++]=new n.Diff(r,p);break;default:if(l[u])throw Error(`Invalid diff operation in diff_fromDelta: `+l[u])}}if(c!=e.length)throw Error(`Delta length (`+c+`) does not equal source text length (`+e.length+`).`);return o},n.prototype.match_main=function(e,t,n){if(e==null||t==null||n==null)throw Error(`Null input. (match_main)`);return n=Math.max(0,Math.min(n,e.length)),e==t?0:e.length?e.substring(n,n+t.length)==t?n:this.match_bitap_(e,t,n):-1},n.prototype.match_bitap_=function(e,t,n){if(t.length>this.Match_MaxBits)throw Error(`Pattern too long for this browser.`);var r=this.match_alphabet_(t),i=this;function a(e,r){var a=e/t.length,o=Math.abs(n-r);return i.Match_Distance?a+o/i.Match_Distance:o?1:a}var o=this.Match_Threshold,s=e.indexOf(t,n);s!=-1&&(o=Math.min(a(0,s),o),s=e.lastIndexOf(t,n+t.length),s!=-1&&(o=Math.min(a(0,s),o)));var c=1<<t.length-1;s=-1;for(var l,u,d=t.length+e.length,f,p=0;p<t.length;p++){for(l=0,u=d;l<u;)a(p,n+u)<=o?l=u:d=u,u=Math.floor((d-l)/2+l);d=u;var m=Math.max(1,n-u+1),h=Math.min(n+u,e.length)+t.length,g=Array(h+2);g[h+1]=(1<<p)-1;for(var _=h;_>=m;_--){var v=r[e.charAt(_-1)];if(p===0?g[_]=(g[_+1]<<1|1)&v:g[_]=(g[_+1]<<1|1)&v|(f[_+1]|f[_])<<1|1|f[_+1],g[_]&c){var y=a(p,_-1);if(y<=o)if(o=y,s=_-1,s>n)m=Math.max(1,2*n-s);else break}}if(a(p+1,n)>o)break;f=g}return s},n.prototype.match_alphabet_=function(e){for(var t={},n=0;n<e.length;n++)t[e.charAt(n)]=0;for(var n=0;n<e.length;n++)t[e.charAt(n)]|=1<<e.length-n-1;return t},n.prototype.patch_addContext_=function(e,t){if(t.length!=0){if(e.start2===null)throw Error(`patch not initialized`);for(var r=t.substring(e.start2,e.start2+e.length1),i=0;t.indexOf(r)!=t.lastIndexOf(r)&&r.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)i+=this.Patch_Margin,r=t.substring(e.start2-i,e.start2+e.length1+i);i+=this.Patch_Margin;var o=t.substring(e.start2-i,e.start2);o&&e.diffs.unshift(new n.Diff(a,o));var s=t.substring(e.start2+e.length1,e.start2+e.length1+i);s&&e.diffs.push(new n.Diff(a,s)),e.start1-=o.length,e.start2-=o.length,e.length1+=o.length+s.length,e.length2+=o.length+s.length}},n.prototype.patch_make=function(e,t,o){var s,c;if(typeof e==`string`&&typeof t==`string`&&o===void 0)s=e,c=this.diff_main(s,t,!0),c.length>2&&(this.diff_cleanupSemantic(c),this.diff_cleanupEfficiency(c));else if(e&&typeof e==`object`&&t===void 0&&o===void 0)c=e,s=this.diff_text1(c);else if(typeof e==`string`&&t&&typeof t==`object`&&o===void 0)s=e,c=t;else if(typeof e==`string`&&typeof t==`string`&&o&&typeof o==`object`)s=e,c=o;else throw Error(`Unknown call format to patch_make.`);if(c.length===0)return[];for(var l=[],u=new n.patch_obj,d=0,f=0,p=0,m=s,h=s,g=0;g<c.length;g++){var _=c[g][0],v=c[g][1];switch(!d&&_!==a&&(u.start1=f,u.start2=p),_){case i:u.diffs[d++]=c[g],u.length2+=v.length,h=h.substring(0,p)+v+h.substring(p);break;case r:u.length1+=v.length,u.diffs[d++]=c[g],h=h.substring(0,p)+h.substring(p+v.length);break;case a:v.length<=2*this.Patch_Margin&&d&&c.length!=g+1?(u.diffs[d++]=c[g],u.length1+=v.length,u.length2+=v.length):v.length>=2*this.Patch_Margin&&d&&(this.patch_addContext_(u,m),l.push(u),u=new n.patch_obj,d=0,m=h,f=p);break}_!==i&&(f+=v.length),_!==r&&(p+=v.length)}return d&&(this.patch_addContext_(u,m),l.push(u)),l},n.prototype.patch_deepCopy=function(e){for(var t=[],r=0;r<e.length;r++){var i=e[r],a=new n.patch_obj;a.diffs=[];for(var o=0;o<i.diffs.length;o++)a.diffs[o]=new n.Diff(i.diffs[o][0],i.diffs[o][1]);a.start1=i.start1,a.start2=i.start2,a.length1=i.length1,a.length2=i.length2,t[r]=a}return t},n.prototype.patch_apply=function(e,t){if(e.length==0)return[t,[]];e=this.patch_deepCopy(e);var n=this.patch_addPadding(e);t=n+t+n,this.patch_splitMax(e);for(var o=0,s=[],c=0;c<e.length;c++){var l=e[c].start2+o,u=this.diff_text1(e[c].diffs),d,f=-1;if(u.length>this.Match_MaxBits?(d=this.match_main(t,u.substring(0,this.Match_MaxBits),l),d!=-1&&(f=this.match_main(t,u.substring(u.length-this.Match_MaxBits),l+u.length-this.Match_MaxBits),(f==-1||d>=f)&&(d=-1))):d=this.match_main(t,u,l),d==-1)s[c]=!1,o-=e[c].length2-e[c].length1;else{s[c]=!0,o=d-l;var p=f==-1?t.substring(d,d+u.length):t.substring(d,f+this.Match_MaxBits);if(u==p)t=t.substring(0,d)+this.diff_text2(e[c].diffs)+t.substring(d+u.length);else{var m=this.diff_main(u,p,!1);if(u.length>this.Match_MaxBits&&this.diff_levenshtein(m)/u.length>this.Patch_DeleteThreshold)s[c]=!1;else{this.diff_cleanupSemanticLossless(m);for(var h=0,g,_=0;_<e[c].diffs.length;_++){var v=e[c].diffs[_];v[0]!==a&&(g=this.diff_xIndex(m,h)),v[0]===i?t=t.substring(0,d+g)+v[1]+t.substring(d+g):v[0]===r&&(t=t.substring(0,d+g)+t.substring(d+this.diff_xIndex(m,h+v[1].length))),v[0]!==r&&(h+=v[1].length)}}}}}return t=t.substring(n.length,t.length-n.length),[t,s]},n.prototype.patch_addPadding=function(e){for(var t=this.Patch_Margin,r=``,i=1;i<=t;i++)r+=String.fromCharCode(i);for(var i=0;i<e.length;i++)e[i].start1+=t,e[i].start2+=t;var o=e[0],s=o.diffs;if(s.length==0||s[0][0]!=a)s.unshift(new n.Diff(a,r)),o.start1-=t,o.start2-=t,o.length1+=t,o.length2+=t;else if(t>s[0][1].length){var c=t-s[0][1].length;s[0][1]=r.substring(s[0][1].length)+s[0][1],o.start1-=c,o.start2-=c,o.length1+=c,o.length2+=c}if(o=e[e.length-1],s=o.diffs,s.length==0||s[s.length-1][0]!=a)s.push(new n.Diff(a,r)),o.length1+=t,o.length2+=t;else if(t>s[s.length-1][1].length){var c=t-s[s.length-1][1].length;s[s.length-1][1]+=r.substring(0,c),o.length1+=c,o.length2+=c}return r},n.prototype.patch_splitMax=function(e){for(var t=this.Match_MaxBits,o=0;o<e.length;o++)if(!(e[o].length1<=t)){var s=e[o];e.splice(o--,1);for(var c=s.start1,l=s.start2,u=``;s.diffs.length!==0;){var d=new n.patch_obj,f=!0;for(d.start1=c-u.length,d.start2=l-u.length,u!==``&&(d.length1=d.length2=u.length,d.diffs.push(new n.Diff(a,u)));s.diffs.length!==0&&d.length1<t-this.Patch_Margin;){var p=s.diffs[0][0],m=s.diffs[0][1];p===i?(d.length2+=m.length,l+=m.length,d.diffs.push(s.diffs.shift()),f=!1):p===r&&d.diffs.length==1&&d.diffs[0][0]==a&&m.length>2*t?(d.length1+=m.length,c+=m.length,f=!1,d.diffs.push(new n.Diff(p,m)),s.diffs.shift()):(m=m.substring(0,t-d.length1-this.Patch_Margin),d.length1+=m.length,c+=m.length,p===a?(d.length2+=m.length,l+=m.length):f=!1,d.diffs.push(new n.Diff(p,m)),m==s.diffs[0][1]?s.diffs.shift():s.diffs[0][1]=s.diffs[0][1].substring(m.length))}u=this.diff_text2(d.diffs),u=u.substring(u.length-this.Patch_Margin);var h=this.diff_text1(s.diffs).substring(0,this.Patch_Margin);h!==``&&(d.length1+=h.length,d.length2+=h.length,d.diffs.length!==0&&d.diffs[d.diffs.length-1][0]===a?d.diffs[d.diffs.length-1][1]+=h:d.diffs.push(new n.Diff(a,h))),f||e.splice(++o,0,d)}}},n.prototype.patch_toText=function(e){for(var t=[],n=0;n<e.length;n++)t[n]=e[n];return t.join(``)},n.prototype.patch_fromText=function(e){var t=[];if(!e)return t;for(var o=e.split(`
|
|
186
186
|
`),s=0,c=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;s<o.length;){var l=o[s].match(c);if(!l)throw Error(`Invalid patch string: `+o[s]);var u=new n.patch_obj;for(t.push(u),u.start1=parseInt(l[1],10),l[2]===``?(u.start1--,u.length1=1):l[2]==`0`?u.length1=0:(u.start1--,u.length1=parseInt(l[2],10)),u.start2=parseInt(l[3],10),l[4]===``?(u.start2--,u.length2=1):l[4]==`0`?u.length2=0:(u.start2--,u.length2=parseInt(l[4],10)),s++;s<o.length;){var d=o[s].charAt(0);try{var f=decodeURI(o[s].substring(1))}catch{throw Error(`Illegal escape in patch_fromText: `+f)}if(d==`-`)u.diffs.push(new n.Diff(r,f));else if(d==`+`)u.diffs.push(new n.Diff(i,f));else if(d==` `)u.diffs.push(new n.Diff(a,f));else if(d==`@`)break;else if(d!==``)throw Error(`Invalid patch mode "`+d+`" in: `+f);s++}}return t},n.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0},n.patch_obj.prototype.toString=function(){for(var e=this.length1===0?this.start1+`,0`:this.length1==1?this.start1+1:this.start1+1+`,`+this.length1,t=this.length2===0?this.start2+`,0`:this.length2==1?this.start2+1:this.start2+1+`,`+this.length2,n=[`@@ -`+e+` +`+t+` @@
|
|
187
187
|
`],o,s=0;s<this.diffs.length;s++){switch(this.diffs[s][0]){case i:o=`+`;break;case r:o=`-`;break;case a:o=` `;break}n[s+1]=o+encodeURI(this.diffs[s][1])+`
|
|
@@ -422,7 +422,7 @@ $2`).split(`
|
|
|
422
422
|
`,{inlineOnly:i=!1}={}){let a=``,o=!0;return e.nodesBetween(t,n,(e,s)=>{let c=e.isText?(e.text??``).slice(Math.max(t,s)-s,n-s):i&&e.isBlock?``:SQ(e);return e.isBlock&&(e.isTextblock||c.length>0)&&r&&(o?o=!1:a+=r),a+=c,!0},0),a}var wQ=new Map([[32,` `],[9,` `],[160,`\xA0`]]);function TQ(e){let t=/^&#(x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);$/.exec(e);if(!t)return null;let n=t[1],r=n[0]===`x`||n[0]===`X`,i=Number.parseInt(r?n.slice(1):n,r?16:10);return Number.isNaN(i)?null:i}function EQ(e){let t=TQ(e);return t!==null&&wQ.has(t)}function DQ(e){let t=TQ(e);return t===null?null:wQ.get(t)??null}var OQ=/&#(?:x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);/g;function kQ(e){OQ.lastIndex=0;let t=e.match(OQ);if(t===null||t.join(``)!==e)return null;let n=``;for(let e of t){let t=DQ(e);if(t===null)return null;n+=t}return n}var AQ=new Set([`*`,`_`,"`",`~`,`\\`,`$`]),jQ=/^={2,}/,MQ=/^<(?:[A-Za-z][A-Za-z0-9+.-]*:[^<>\s]*|[^\s<>@]+@[^\s<>]+)>/,NQ=512;function PQ(e,t){return MQ.test(e.slice(t,t+NQ))}function FQ(e,t){let n=e.lastIndexOf(`<`,t);return n<0||t-n>NQ?!1:MQ.exec(e.slice(n,t+1))?.[0].length===t+1-n}var IQ=/^<\/?[A-Za-z][A-Za-z0-9-]*(?:\s[^>]*?)?\/?>/,LQ=512,RQ=/^!(?=\[)/,zQ=/^\[\^/,BQ=/^\]\[[^\]]*\]/,VQ=/^\[\[[^\][|]*\|/,HQ=/^#[^\][|]*(?=\]\])/,UQ=512,WQ=/^\]\([^)]*\)/,GQ=512,KQ=/^(?:#{1,6}[ \t]+|>[ \t]?|(?:[-*+]|\d{1,9}[.)])[ \t]+(?:\[[ xX]\][ \t]+)?)/,qQ=32,JQ=`|`,YQ=/^(?:`{3,}[^`\n]*|~{3,}[^\n]*)$/,XQ=/^(?:(?:[-*_][ \t]*){3,}|=+[ \t]*|[|\-: \t]*-[|\-: \t]*)$/,ZQ=1024;function QQ(e,t){let n=e.indexOf(`
|
|
423
423
|
`,t),r=n===-1?e.length:n;if(r>t&&e[r-1]===`\r`&&--r,r-t>ZQ)return 0;let i=e.slice(t,r);return i.length===0||!YQ.test(i)&&!XQ.test(i)?0:i.length}var $Q=/&#(?:x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);/y;function e$(e,t){if(e[t]!==`&`)return null;let n=t,r=``;for(;;){$Q.lastIndex=n;let t=$Q.exec(e)?.[0];if(t===void 0)break;let i=DQ(t);if(i===null)break;r+=i,n+=t.length}return n===t?null:{length:n-t,rendered:r}}function t$(e){return e===` `||e===` `||e===`
|
|
424
424
|
`||e===`\r`||e===`\f`||e===`\v`}function n$(e,t){for(let n=t-1;n>=0;--n){let t=e[n];if(t===`
|
|
425
|
-
`)return!0;if(t!==` `&&t!==` `)return!1}return!0}function r$(e,t){let n=e[t];if(n===void 0)return 0;if(n$(e,t)){let n=QQ(e,t);if(n>0)return n}if(n===JQ)return 1;if(n===`<`){let n=IQ.exec(e.slice(t,t+LQ))?.[0].length;return n===void 0?+!!PQ(e,t):n}if(n===`>`&&FQ(e,t))return 1;if(n===`=`){let n=jQ.exec(e.slice(t,t+3))?.[0].length;if(n!==void 0)return n}if(n===`!`)return+!!RQ.test(e.slice(t,t+2));if(AQ.has(n))return 1;if(n===`[`){let n=e.slice(t,t+UQ),r=VQ.exec(n)?.[0].length;return r===void 0?zQ.test(n)?2:1:r}if(n===`#`){let n=HQ.exec(e.slice(t,t+UQ))?.[0].length;if(n!==void 0)return n}if(n===`]`){if(e[t+1]===`]`)return 2;let n=e.slice(t,t+Math.max(GQ,UQ)),r=WQ.exec(n)?.[0].length;if(r!==void 0)return r;let i=BQ.exec(n)?.[0].length;return i===void 0?1:i}return n$(e,t)?KQ.exec(e.slice(t,t+qQ))?.[0].length??0:0}function i$(e,t,{syntaxIn:n}){let r=[];if(t.length===0)return r;let i=n===`haystack`;for(let n=0;n<e.length;n+=1){let a=e[n];if(a===void 0||t$(a)||i&&a!==t[0]&&(r$(e,n)>0||e$(e,n)!==null))continue;let o=n,s=0;for(;o<e.length&&s<t.length;){let n=e[o],r=t[s];if(n===r){o+=1,s+=1;continue}if(t$(r)){s+=1;continue}if(t$(n)){o+=1;continue}let a=i?r$(e,o):r$(t,s);if(a>0){i?o+=a:s+=a;continue}let c=i?e$(e,o):e$(t,s);if(c!==null){let n=i?t:e,r=i?s:o,a=!0;for(let e of c.rendered)if(!t$(e)){for(;r<n.length&&t$(n[r]);)r+=1;if(n[r]!==e){a=!1;break}r+=1}if(!a)break;i?(o+=c.length,s=r):(s+=c.length,o=r);continue}break}for(;s<t.length&&t$(t[s]);)s+=1;s===t.length&&r.push({start:n,end:o})}return r}var a$=8,o$=64;function s$(e,t,n,r){let i=``,a=Math.max(0,t),o=Math.min(e.length,n);for(;a<o;){let t=e[a];if(t$(t)){a+=1;continue}if(r){let t=r$(e,a);if(t>0){a+=t;continue}let n=e$(e,a);if(n!==null){for(let e of n.rendered)t$(e)||(i+=e);a+=n.length;continue}}i+=t,a+=1}return i}function c$(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e[e.length-1-r]===t[t.length-1-r];)r+=1;return r}function l$(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e[r]===t[r];)r+=1;return r}function u$(e,t,n,{syntaxIn:r,syntaxInContext:i=!1}){let a=n.prefix??``,o=n.suffix??``,s=r===`haystack`,c=0;if(a.length>0){let n=a.length*a$+o$;c+=c$(s$(a,0,a.length,i),s$(e,t.start-n,t.start,s))}if(o.length>0){let n=o.length*a$+o$;c+=l$(s$(o,0,o.length,i),s$(e,t.end,t.end+n,s))}return c}function d$(e,{syntaxInContext:t=!1}={}){let n=s$(e.prefix??``,0,1/0,t).length+s$(e.suffix??``,0,1/0,t).length;return Math.min(8,n)}function f$(e){return Math.max(e*4,e+64)}var p$=`source`;function m$(e){return{ok:!1,error:e}}function h$(e){return{ok:!0,...e}}function g$(){return qm.parse({})}function _$(e,t){let n=e.toString();if(n.length===0)return g$();let r=wd(n);if(r.errors.length>0)return console.warn(`[bindConfigDoc:${t}] Y.Text contains invalid YAML; returning schema defaults. Errors: ${r.errors.map(e=>e.message).join(`; `)}`),g$();let i=r.toJSON()??{},a=qm.safeParse(i);return a.success?a.data:(console.warn(`[bindConfigDoc:${t}] Y.Text content fails schema validation; returning schema defaults. First issue: ${a.error.issues[0]?.message??`(unknown)`}`),g$())}function v$(e,t,n={}){return Jm(`config.bind`,{"config.scope":t,"config.transport":`ytext`},()=>y$(e,t,n))}function y$(e,t,n){let{ytextKey:r=p$}=n,i=e.document,a=i.getText(r),o=new Set,s=new Set,c=!1,l=!1;function u(){if(c)return;let e=_$(a,t);for(let n of o)try{n(e)}catch(e){console.warn(`[bindConfigDoc:${t}] listener threw:`,e)}}function d(){if(c||(u(),l))return;l=!0;let e=[...s];s.clear();for(let n of e)try{n()}catch(e){console.warn(`[bindConfigDoc:${t}] synced listener threw:`,e)}}a.observe(u),e.on(`synced`,d);function f(e){if(c)return m$({code:`WRITE_ERROR`,detail:`ConfigBinding (${t}) has been disposed`});let n=Nne(e,t);if(n!==null)return m$(n);let r=wd(a.toString()),o=r.contents!==null&&!Hs(r.contents);if(r.errors.length>0||o){Ym(`config.corrupt-ytext-reset`,{"config.scope":t,"config.parse.errorCount":r.errors.length,"config.parse.topLevelNonMap":o});let e=r.errors.length>0?r.errors.map(e=>e.message).join(`; `):`top-level YAML is not a mapping`;console.warn(`[bindConfigDoc:${t}] dropping corrupt Y.Text and re-applying patch onto empty doc. Reason: ${e}`),r=wd(``)}r.contents===null&&(r.contents=r.createNode({}));let s=Pne(r,e),
|
|
425
|
+
`)return!0;if(t!==` `&&t!==` `)return!1}return!0}function r$(e,t){let n=e[t];if(n===void 0)return 0;if(n$(e,t)){let n=QQ(e,t);if(n>0)return n}if(n===JQ)return 1;if(n===`<`){let n=IQ.exec(e.slice(t,t+LQ))?.[0].length;return n===void 0?+!!PQ(e,t):n}if(n===`>`&&FQ(e,t))return 1;if(n===`=`){let n=jQ.exec(e.slice(t,t+3))?.[0].length;if(n!==void 0)return n}if(n===`!`)return+!!RQ.test(e.slice(t,t+2));if(AQ.has(n))return 1;if(n===`[`){let n=e.slice(t,t+UQ),r=VQ.exec(n)?.[0].length;return r===void 0?zQ.test(n)?2:1:r}if(n===`#`){let n=HQ.exec(e.slice(t,t+UQ))?.[0].length;if(n!==void 0)return n}if(n===`]`){if(e[t+1]===`]`)return 2;let n=e.slice(t,t+Math.max(GQ,UQ)),r=WQ.exec(n)?.[0].length;if(r!==void 0)return r;let i=BQ.exec(n)?.[0].length;return i===void 0?1:i}return n$(e,t)?KQ.exec(e.slice(t,t+qQ))?.[0].length??0:0}function i$(e,t,{syntaxIn:n}){let r=[];if(t.length===0)return r;let i=n===`haystack`;for(let n=0;n<e.length;n+=1){let a=e[n];if(a===void 0||t$(a)||i&&a!==t[0]&&(r$(e,n)>0||e$(e,n)!==null))continue;let o=n,s=0;for(;o<e.length&&s<t.length;){let n=e[o],r=t[s];if(n===r){o+=1,s+=1;continue}if(t$(r)){s+=1;continue}if(t$(n)){o+=1;continue}let a=i?r$(e,o):r$(t,s);if(a>0){i?o+=a:s+=a;continue}let c=i?e$(e,o):e$(t,s);if(c!==null){let n=i?t:e,r=i?s:o,a=!0;for(let e of c.rendered)if(!t$(e)){for(;r<n.length&&t$(n[r]);)r+=1;if(n[r]!==e){a=!1;break}r+=1}if(!a)break;i?(o+=c.length,s=r):(s+=c.length,o=r);continue}break}for(;s<t.length&&t$(t[s]);)s+=1;s===t.length&&r.push({start:n,end:o})}return r}var a$=8,o$=64;function s$(e,t,n,r){let i=``,a=Math.max(0,t),o=Math.min(e.length,n);for(;a<o;){let t=e[a];if(t$(t)){a+=1;continue}if(r){let t=r$(e,a);if(t>0){a+=t;continue}let n=e$(e,a);if(n!==null){for(let e of n.rendered)t$(e)||(i+=e);a+=n.length;continue}}i+=t,a+=1}return i}function c$(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e[e.length-1-r]===t[t.length-1-r];)r+=1;return r}function l$(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e[r]===t[r];)r+=1;return r}function u$(e,t,n,{syntaxIn:r,syntaxInContext:i=!1}){let a=n.prefix??``,o=n.suffix??``,s=r===`haystack`,c=0;if(a.length>0){let n=a.length*a$+o$;c+=c$(s$(a,0,a.length,i),s$(e,t.start-n,t.start,s))}if(o.length>0){let n=o.length*a$+o$;c+=l$(s$(o,0,o.length,i),s$(e,t.end,t.end+n,s))}return c}function d$(e,{syntaxInContext:t=!1}={}){let n=s$(e.prefix??``,0,1/0,t).length+s$(e.suffix??``,0,1/0,t).length;return Math.min(8,n)}function f$(e){return Math.max(e*4,e+64)}var p$=`source`;function m$(e){return{ok:!1,error:e}}function h$(e){return{ok:!0,...e}}function g$(){return qm.parse({})}function _$(e,t){let n=e.toString();if(n.length===0)return g$();let r=wd(n);if(r.errors.length>0)return console.warn(`[bindConfigDoc:${t}] Y.Text contains invalid YAML; returning schema defaults. Errors: ${r.errors.map(e=>e.message).join(`; `)}`),g$();let i=r.toJSON()??{},a=qm.safeParse(i);return a.success?a.data:(console.warn(`[bindConfigDoc:${t}] Y.Text content fails schema validation; returning schema defaults. First issue: ${a.error.issues[0]?.message??`(unknown)`}`),g$())}function v$(e,t,n={}){return Jm(`config.bind`,{"config.scope":t,"config.transport":`ytext`},()=>y$(e,t,n))}function y$(e,t,n){let{ytextKey:r=p$}=n,i=e.document,a=i.getText(r),o=new Set,s=new Set,c=!1,l=!1;function u(){if(c)return;let e=_$(a,t);for(let n of o)try{n(e)}catch(e){console.warn(`[bindConfigDoc:${t}] listener threw:`,e)}}function d(){if(c||(u(),l))return;l=!0;let e=[...s];s.clear();for(let n of e)try{n()}catch(e){console.warn(`[bindConfigDoc:${t}] synced listener threw:`,e)}}a.observe(u),e.on(`synced`,d);function f(e){if(c)return m$({code:`WRITE_ERROR`,detail:`ConfigBinding (${t}) has been disposed`});if(!l)return m$({code:`NOT_SYNCED`,detail:`ConfigBinding (${t}) has not completed initial sync`});let n=Nne(e,t);if(n!==null)return m$(n);let r=wd(a.toString()),o=r.contents!==null&&!Hs(r.contents);if(r.errors.length>0||o){Ym(`config.corrupt-ytext-reset`,{"config.scope":t,"config.parse.errorCount":r.errors.length,"config.parse.topLevelNonMap":o});let e=r.errors.length>0?r.errors.map(e=>e.message).join(`; `):`top-level YAML is not a mapping`;console.warn(`[bindConfigDoc:${t}] dropping corrupt Y.Text and re-applying patch onto empty doc. Reason: ${e}`),r=wd(``)}r.contents===null&&(r.contents=r.createNode({}));let s=Pne(r,e),u=r.toJSON()??{},d=Jm(`config.validate`,{"config.scope":t,"config.validation.layer":`L1`},e=>{let t=qm.safeParse(u);if(e.setAttribute(`config.outcome`,t.success?`success`:`rejected`),!t.success)for(let e of t.error.issues)Ym(`config.validation.issue`,{"issue.path":e.path.map(e=>String(e)).join(`.`),"issue.message":e.message});return t});if(!d.success)return m$({code:`SCHEMA_INVALID`,issues:d.error.issues.map(Fne)});let f=r.toString();return i.transact(()=>{a.length>0&&a.delete(0,a.length),a.insert(0,f)}),h$({effective:d.data,appliedPaths:s})}return{current(){return _$(a,t)},patch(e){return Jm(`config.patch`,{"config.scope":t,"config.transport":`ytext`},t=>{let n=f(e);return t.setAttribute(`config.outcome`,n.ok?`success`:`rejected`),n.ok||t.setAttribute(`config.error.code`,n.error.code),n})},subscribe(e){return o.add(e),()=>{o.delete(e)}},hasSynced(){return l},subscribeSynced(e){if(c)return()=>{};if(l){let n=!1;return queueMicrotask(()=>{if(!(n||c))try{e()}catch(e){console.warn(`[bindConfigDoc:${t}] synced listener threw:`,e)}}),()=>{n=!0}}return s.add(e),()=>{s.delete(e)}},dispose(){c||(c=!0,a.unobserve(u),e.off(`synced`,d),o.clear(),s.clear())}}}var b$=`source`,x$=800;function S$(e){return{ok:!1,error:e}}function C$(e){return{ok:!0,...e}}function w$(e,t={}){let{ytextKey:n=b$,acceptanceDelayMs:r=x$}=t,i=e.document,a=i.getText(n),o=new Set,s=new Set,c=new Set,l=!1,u=`idle`,d=null;function f(){d!==null&&(clearTimeout(d),d=null)}function p(e){if(!l&&u!==e){u=e;for(let t of c)try{t(e)}catch(e){console.warn(`[bindOkignoreDoc] status listener threw:`,e)}}}function m(){if(l)return;let e=a.toString();for(let t of o)try{t(e)}catch(e){console.warn(`[bindOkignoreDoc] text listener threw:`,e)}}function h(e){if(!l)for(let t of s)try{t(e)}catch(e){console.warn(`[bindOkignoreDoc] rejection listener threw:`,e)}}return a.observe(m),e.on(`synced`,m),{current(){return a.toString()},patch(e){return l?S$({code:`WRITE_ERROR`,detail:`OkignoreBinding has been disposed`}):(i.transact(()=>{a.length>0&&a.delete(0,a.length),e.length>0&&a.insert(0,e)}),f(),p(`pending`),d=setTimeout(()=>{d=null,!l&&u===`pending`&&p(`accepted`)},r),C$({text:e}))},subscribe(e){return o.add(e),()=>{o.delete(e)}},subscribeRejection(e){return s.add(e),()=>{s.delete(e)}},subscribeStatus(e){return c.add(e),()=>{c.delete(e)}},status(){return u},notifyRejection(e){l||(f(),p(`rejected`),h({error:e,text:a.toString()}))},dispose(){l||(l=!0,f(),a.unobserve(m),e.off(`synced`,m),o.clear(),s.clear(),c.clear())}}}function T$(e,t,n){return E$([e,t,n],[])}function E$(e,t){if(t.length>0){let n=Zm(qm,t);if(n?.scope===`user`)return e[0];if(n?.scope===`project`)return e[1]??e[0];if(n?.scope===`project-local`)return e[2]??e[0]}let n=D$(e);if(n===void 0)return;if(n===null)return null;if(Array.isArray(n)||typeof n!=`object`)return n;let r=e.map(e=>O$(e)?e:void 0),i=new Set;for(let e of r)if(e!==void 0)for(let t of Object.keys(e))i.add(t);let a={};for(let e of i)a[e]=E$(r.map(t=>t===void 0?void 0:t[e]),[...t,e]);return a}function D$(e){for(let t=e.length-1;t>=0;t--)if(e[t]!==void 0)return e[t]}function O$(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var k$=`(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)`;RegExp(`^127\\.${k$}\\.${k$}\\.${k$}$`);var A$=2e3;function j$(e){let t=Date.now();for(let[n,r]of e.entries()){let i=r;i.timestamp&&t-i.timestamp>3e4&&e.delete(n)}}function M$(e,t){for(let[,n]of e.entries()){let e=n;if(e.timestamp&&e.timestamp>t)return!0}return!1}var N$=`#fafafa`,P$=`#171717`,F$=[`invalid-args`,`nested-project`,`target-not-empty`,`mkdir-failed`,`git-init-failed`,`init-failed`,`discovery-failed`],I$=[`.mdx`,`.md`],L$=`epoch`,R$=524288;function z$(e,t=R$){return typeof e==`number`&&Number.isFinite(e)&&e>t}var B$=10485760,V$={cursor:/\bCursor(?:\([^)]+\))?\/\d/,codex:/\bCodex(?:\([^)]+\))?\/\d/,"claude-desktop":/\bClaude(?:\([^)]+\))?\/\d/};function H$(){if(typeof navigator>`u`)return null;let e=navigator.userAgent;for(let[t,n]of Object.entries(V$))if(n.test(e))return t;return null}var U$=[`incoming`,`outgoing`,`both`];function W$(e){return U$.includes(e)}var G$=3e5,K$=`https://github.com/inkeep/open-knowledge`,q$=[{id:`chart`,title:`Chart`,description:`A bar chart whose series colors track the OK chart palette.`,html:`<div style="font-family:system-ui,sans-serif;padding:20px;color:var(--foreground)">
|
|
426
426
|
<h3 style="margin:0 0 14px;font-size:15px;font-weight:600">Revenue by region</h3>
|
|
427
427
|
<div id="bars" style="display:flex;align-items:flex-end;gap:14px;height:170px"></div>
|
|
428
428
|
<script>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Ns as e}from"./dist-
|
|
1
|
+
import{Ns as e}from"./dist-BwXhTYUh.js";function t(t){return e.includes(t)}function n(e){if(e.startsWith(b)||e.startsWith(w)||e.startsWith(T)||e.startsWith(D)||!e.startsWith(`#/`))return null;let t=e.slice(2),n=x(t),r=n>=0?t.slice(0,n):t;if(!r)return null;try{return r.split(`/`).map(decodeURIComponent).join(`/`)}catch{return r}}function r(e){if(e.startsWith(b)||!e.startsWith(`#/`))return null;let t=e.slice(2),n=t.indexOf(`#`);if(n<0)return null;let r=t.slice(n+1);if(!r)return null;try{return decodeURIComponent(r)}catch{return r}}var i=/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g;function a(e){return encodeURIComponent(e.replace(i,`�`))}function o(e){return e.split(`/`).map(a).join(`/`)}function s(e,t){let n=`#/${o(e)}`;return t?`${n}#${a(t)}`:n}function c(e,t){return e===t||l(e)===l(t)}function l(e){try{return decodeURIComponent(e)}catch{return e}}var u=`__okHashHistoryEntry`;function d(e){return{...typeof e==`object`&&e?e:{},[u]:!0}}function f(e){return typeof e==`object`&&!!e&&e[u]===!0}function p(){f(window.history.state)||window.history.replaceState(d(window.history.state),``)}function m(e){let{pathname:t,search:n}=window.location;window.history.replaceState(d(window.history.state),``,`${t}${n}${e}`)}function h(e){if(c(window.location.hash,e))return;let{pathname:t,search:n}=window.location;window.history.pushState(d(window.history.state),``,`${t}${n}${e}`)}function g(e){return e.endsWith(`.mdx`)?e.slice(0,-4):e.endsWith(`.md`)?e.slice(0,-3):e}function _(e,t){let n=e.replace(/^\/+|\/+$/g,``),r=n?`#/${o(n)}/`:`#/`;return t?`${r}#${a(t)}`:r}function v(e,t,n){if(e===`folder`)return _(t);let r=`#/${a(t)}`;return n==null||n===``?r:`${r}?branch=${a(n)}`}function y(e){if(e===`#/`)return!0;if(!e.startsWith(`#/`))return!1;let t=e.slice(2);return t.length>0&&t[0]===`?`}var b=`#/__asset__/`;function x(e){let t=e.indexOf(`?`),n=e.indexOf(`#`);return t<0?n:n<0?t:Math.min(t,n)}function S(e){if(!e.startsWith(b))return null;let t=e.slice(12);if(!t)return null;try{return t.split(`/`).map(decodeURIComponent).join(`/`)}catch{return t}}function C(e){return`${b}${o(e)}`}var w=`#/__skill-file__/`,T=`#/__skills__`;function E(e){return e===T||e.startsWith(`${T}/`)}var D=`#/__skill-preview__/`,O=[`explore`,`detected`,`builtin`,`foreign`,`linked`];function k(e){return e!==void 0&&O.includes(e)}var A=`project`;function j(e){return[e.flavor,e.source,e.name,e.subtitle,e.level??A].map(a).join(`/`)}function M(e){if(!e)return null;let n;try{n=e.split(`/`).map(decodeURIComponent)}catch{return null}if(n.length<4||n.length>6)return null;let[r,i,a,o,s,c]=n;return!k(r)||!i||!a?null:{flavor:r,source:i,name:a,subtitle:o??``,...s&&t(s)?{level:s}:{},...c?{path:c}:{}}}function N(e){let t=j(e);return e.path&&(t+=`/${a(e.path)}`),`${D}${t}`}function P(e){return e.startsWith(D)?M(e.slice(20)):null}var F=`:`;function I(e){let t=e.host===void 0?e.name:`${e.name}${F}${e.host}`;return`${w}${[e.scope,t].map(a).join(`/`)}/${o(e.path)}`}function L(e){if(!e.startsWith(w))return null;let n=e.slice(17);if(!n)return null;let r;try{r=n.split(`/`).map(decodeURIComponent)}catch{return null}if(r.length<3)return null;let[i,a,...o]=r,s=o.join(`/`);if(!i||!a||!s||!t(i))return null;let c=a.indexOf(F),l=c===-1?a:a.slice(0,c),u=c===-1?void 0:a.slice(c+1);return l?{scope:i,name:l,path:s,...u?{host:u}:{}}:null}export{h as _,v as a,P as b,C as c,I as d,N as f,p as g,c as h,n as i,s as l,f as m,S as n,j as o,y as p,M as r,g as s,r as t,_ as u,m as v,E as x,L as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e}from"./config-provider-
|
|
1
|
+
import{p as e}from"./config-provider-DImA7HLe.js";var t=new WeakMap;function n(n,r){let i=t.get(r);if(i)return i;let a=new e(r);t.set(r,a);let o=r.doc,s=!1,c=()=>{s||(s=!0,n.off(`destroy`,c),o?.off(`destroy`,c),t.get(r)===a&&t.delete(r),a.clear(),a.destroy())};return n.on(`destroy`,c),o?.on(`destroy`,c),a}export{n as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{N as e}from"./dist-
|
|
1
|
+
import{N as e}from"./dist-BwXhTYUh.js";var t=`open-knowledge:documents-changed`,n=new Set(e.options);function r(e){return e===void 0||!Array.isArray(e)?[`files`]:[...new Set(e.filter(e=>n.has(e)))]}function i(e=[`files`]){window.dispatchEvent(new CustomEvent(t,{detail:{channels:r(e)}}))}function a(e){let n=t=>{e(r(t instanceof CustomEvent?t.detail?.channels:void 0))};return window.addEventListener(t,n),()=>window.removeEventListener(t,n)}function o(e){return e.includes(`local-targets`)||e.includes(`files`)}var s=`open-knowledge:doc-persisted`;function c(e){window.dispatchEvent(new CustomEvent(s,{detail:{docName:e}}))}function l(e){let t=t=>{if(!(t instanceof CustomEvent))return;let n=t.detail?.docName;typeof n==`string`&&n.length>0&&e(n)};return window.addEventListener(s,t),()=>window.removeEventListener(s,t)}var u=`open-knowledge:branch-changed`;function d(e){window.dispatchEvent(new CustomEvent(u,{detail:{branch:e}}))}function f(e){let t=t=>{if(!(t instanceof CustomEvent))return;let n=t.detail;e(n?.branch??null)};return window.addEventListener(u,t),()=>window.removeEventListener(u,t)}var p=`open-knowledge:templates-changed`;function m(){window.dispatchEvent(new CustomEvent(p))}function h(e){let t=()=>e();return window.addEventListener(p,t),()=>window.removeEventListener(p,t)}var g=`open-knowledge:skills-changed`;function _(){window.dispatchEvent(new CustomEvent(g))}function v(e){let t=()=>e();return window.addEventListener(g,t),()=>window.removeEventListener(g,t)}var y=`open-knowledge:skill-scope-moved`;function b(e){window.dispatchEvent(new CustomEvent(y,{detail:e}))}function x(e){let t=t=>e(t.detail);return window.addEventListener(y,t),()=>window.removeEventListener(y,t)}var S=new Set,C=(e,t)=>`${e}\u0000${t}`;function w(e,t){S.add(C(e,t)),_()}function T(e,t){S.delete(C(e,t))&&_()}var E=new Map;function D(e,t){let n=C(e,t);E.set(n,(E.get(n)??0)+1),_()}function O(e,t){let n=C(e,t),r=E.get(n);r!==void 0&&(r<=1?E.delete(n):E.set(n,r-1),_())}function k(e,t){return E.has(C(e,t))}function A(){return[...E.keys()].sort().join(``)}function j(e,t){return S.has(C(e,t))}function M(e){return S.size===0?e:e.filter(e=>!S.has(C(e.scope,e.name)))}export{l as _,c as a,v as b,_ as c,O as d,o as f,f as g,A as h,d as i,m as l,k as m,w as n,i as o,j as p,D as r,b as s,M as t,T as u,a as v,h as x,x as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./jsx-runtime-BUgB2tll.js";import{t}from"./compiler-runtime-BfE3aGVn.js";import{t as n}from"./utils-CPqDy6Hr.js";import{a as r,c as i,d as a,f as o,h as s,i as c,l,m as u,n as d,o as f,p,r as m,s as h,t as g,u as _}from"./dist-BX7qfUal.js";import{t as v}from"./createLucideIcon-B6ULg5PN.js";import{t as y}from"./check-BzfGb3KU.js";import{t as b}from"./chevron-right-C-g4JuT4.js";var x=v(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),S=t(),C=e();function w(e){let t=(0,S.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,C.jsx)(_,{"data-slot":`dropdown-menu`,...n}),t[2]=n,t[3]=r),r}function T(e){let t=(0,S.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,C.jsx)(h,{"data-slot":`dropdown-menu-portal`,...n}),t[2]=n,t[3]=r),r}function E(e){let t=(0,S.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,C.jsx)(s,{"data-slot":`dropdown-menu-trigger`,...n}),t[2]=n,t[3]=r),r}function D(e){let t=(0,S.c)(12),r,i,a,o;t[0]===e?(r=t[1],i=t[2],a=t[3],o=t[4]):({className:r,align:a,sideOffset:o,...i}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=a,t[4]=o);let s=a===void 0?`start`:a,c=o===void 0?4:o,l;t[5]===r?l=t[6]:(l=n(`z-50 max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 data-[state=closed]:overflow-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 motion-reduce:data-open:animate-none motion-reduce:data-closed:animate-none motion-reduce:duration-0 subtle-scrollbar`,r),t[5]=r,t[6]=l);let u;return t[7]!==s||t[8]!==i||t[9]!==c||t[10]!==l?(u=(0,C.jsx)(h,{children:(0,C.jsx)(d,{"data-slot":`dropdown-menu-content`,sideOffset:c,align:s,className:l,...i})}),t[7]=s,t[8]=i,t[9]=c,t[10]=l,t[11]=u):u=t[11],u}function O(e){let t=(0,S.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,C.jsx)(m,{"data-slot":`dropdown-menu-group`,...n}),t[2]=n,t[3]=r),r}function k(e){let t=(0,S.c)(12),r,i,a,o;t[0]===e?(r=t[1],i=t[2],a=t[3],o=t[4]):({className:r,inset:i,variant:o,...a}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=a,t[4]=o);let s=o===void 0?`default`:o,l;t[5]===r?l=t[6]:(l=n(`group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 aria-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive`,r),t[5]=r,t[6]=l);let u;return t[7]!==i||t[8]!==a||t[9]!==l||t[10]!==s?(u=(0,C.jsx)(c,{"data-slot":`dropdown-menu-item`,"data-inset":i,"data-variant":s,className:l,...a}),t[7]=i,t[8]=a,t[9]=l,t[10]=s,t[11]=u):u=t[11],u}function A(e){let t=(0,S.c)(15),i,a,o,s,c;t[0]===e?(i=t[1],a=t[2],o=t[3],s=t[4],c=t[5]):({className:o,children:a,checked:i,inset:s,...c}=e,t[0]=e,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=c);let l;t[6]===o?l=t[7]:(l=n(`relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 aria-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,o),t[6]=o,t[7]=l);let u;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,C.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex items-center justify-center`,"data-slot":`dropdown-menu-checkbox-item-indicator`,children:(0,C.jsx)(r,{children:(0,C.jsx)(y,{})})}),t[8]=u):u=t[8];let d;return t[9]!==i||t[10]!==a||t[11]!==s||t[12]!==c||t[13]!==l?(d=(0,C.jsxs)(g,{"data-slot":`dropdown-menu-checkbox-item`,"data-inset":s,className:l,checked:i,...c,children:[u,a]}),t[9]=i,t[10]=a,t[11]=s,t[12]=c,t[13]=l,t[14]=d):d=t[14],d}function j(e){let t=(0,S.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,C.jsx)(i,{"data-slot":`dropdown-menu-radio-group`,...n}),t[2]=n,t[3]=r),r}function M(e){let t=(0,S.c)(13),i,a,o,s;t[0]===e?(i=t[1],a=t[2],o=t[3],s=t[4]):({className:a,children:i,inset:o,...s}=e,t[0]=e,t[1]=i,t[2]=a,t[3]=o,t[4]=s);let c;t[5]===a?c=t[6]:(c=n(`relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,a),t[5]=a,t[6]=c);let u;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,C.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex items-center justify-center`,"data-slot":`dropdown-menu-radio-item-indicator`,children:(0,C.jsx)(r,{children:(0,C.jsx)(x,{className:`size-2 fill-current`})})}),t[7]=u):u=t[7];let d;return t[8]!==i||t[9]!==o||t[10]!==s||t[11]!==c?(d=(0,C.jsxs)(l,{"data-slot":`dropdown-menu-radio-item`,"data-inset":o,className:c,...s,children:[u,i]}),t[8]=i,t[9]=o,t[10]=s,t[11]=c,t[12]=d):d=t[12],d}function N(e){let t=(0,S.c)(10),r,i,a;t[0]===e?(r=t[1],i=t[2],a=t[3]):({className:r,inset:i,...a}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=a);let o;t[4]===r?o=t[5]:(o=n(`px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7`,r),t[4]=r,t[5]=o);let s;return t[6]!==i||t[7]!==a||t[8]!==o?(s=(0,C.jsx)(f,{"data-slot":`dropdown-menu-label`,"data-inset":i,className:o,...a}),t[6]=i,t[7]=a,t[8]=o,t[9]=s):s=t[9],s}function P(e){let t=(0,S.c)(8),r,i;t[0]===e?(r=t[1],i=t[2]):({className:r,...i}=e,t[0]=e,t[1]=r,t[2]=i);let o;t[3]===r?o=t[4]:(o=n(`-mx-1 my-1 h-px bg-border`,r),t[3]=r,t[4]=o);let s;return t[5]!==i||t[6]!==o?(s=(0,C.jsx)(a,{"data-slot":`dropdown-menu-separator`,className:o,...i}),t[5]=i,t[6]=o,t[7]=s):s=t[7],s}function F(e){let t=(0,S.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,C.jsx)(o,{"data-slot":`dropdown-menu-sub`,...n}),t[2]=n,t[3]=r),r}function I(e){let t=(0,S.c)(13),r,i,a,o;t[0]===e?(r=t[1],i=t[2],a=t[3],o=t[4]):({className:i,inset:a,children:r,...o}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=a,t[4]=o);let s;t[5]===i?s=t[6]:(s=n(`flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,i),t[5]=i,t[6]=s);let c;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,C.jsx)(b,{className:`ml-auto`}),t[7]=c):c=t[7];let l;return t[8]!==r||t[9]!==a||t[10]!==o||t[11]!==s?(l=(0,C.jsxs)(u,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":a,className:s,...o,children:[r,c]}),t[8]=r,t[9]=a,t[10]=o,t[11]=s,t[12]=l):l=t[12],l}function L(e){let t=(0,S.c)(8),r,i;t[0]===e?(r=t[1],i=t[2]):({className:r,...i}=e,t[0]=e,t[1]=r,t[2]=i);let a;t[3]===r?a=t[4]:(a=n(`z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[96px] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 data-[state=closed]:overflow-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 motion-reduce:data-open:animate-none motion-reduce:data-closed:animate-none motion-reduce:duration-0 subtle-scrollbar`,r),t[3]=r,t[4]=a);let o;return t[5]!==i||t[6]!==a?(o=(0,C.jsx)(p,{"data-slot":`dropdown-menu-sub-content`,className:a,...i}),t[5]=i,t[6]=a,t[7]=o):o=t[7],o}export{k as a,j as c,F as d,L as f,O as i,M as l,E as m,A as n,N as o,I as p,D as r,T as s,w as t,P as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cs as e,is as t,rs as n,us as r}from"./dist-
|
|
1
|
+
import{cs as e,is as t,rs as n,us as r}from"./dist-BwXhTYUh.js";import{c as i,l as a,u as o}from"./doc-hash-BA6YSppY.js";import{i as s}from"./navigation-targets-CF3xv2zv.js";import{c,l,s as u}from"./file-tree-utils-CaAcsCBR.js";import{t as d}from"./file-tree-rename-validation-CaMw2nJs.js";var f=`application/x-open-knowledge-sidebar-item+json`,p={image:!0,video:!0,audio:!0,pdf:!0,text:!0,mermaid:!0,excalidraw:!0};function m(e){return JSON.stringify(e)}function h(e){return e?Array.from(e.types).includes(f):!1}function ee(e){return e.kind===`folder`?{target:{kind:`folder`,target:e.folderPath,folderPath:e.folderPath},hash:o(e.folderPath)}:e.kind===`asset`?{target:{kind:`asset`,target:e.assetPath,assetPath:e.assetPath,mediaKind:e.mediaKind},hash:i(e.assetPath)}:{target:s(e.docName,e.size)??{kind:`doc`,target:e.docName,docName:e.docName},hash:a(e.docName)}}function g(e){if(!e||!h(e))return null;let t=e.getData(f);if(!t)return null;let n;try{n=JSON.parse(t)}catch{return null}if(!_(n)||n.v!==1||typeof n.kind!=`string`)return null;if(n.kind===`doc`){if(typeof n.docName!=`string`||n.docName.length===0)return null;let e=n.size;return e!==null&&typeof e!=`number`?null:{v:1,kind:`doc`,docName:n.docName,size:e}}if(n.kind===`folder`)return typeof n.folderPath==`string`?{v:1,kind:`folder`,folderPath:n.folderPath}:null;if(n.kind===`asset`){if(typeof n.assetPath!=`string`||n.assetPath.length===0)return null;let e=n.mediaKind;return e!==null&&!v(e)?null:{v:1,kind:`asset`,assetPath:n.assetPath,mediaKind:e}}return null}function _(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function v(e){return typeof e==`string`&&Object.hasOwn(p,e)}var y=`.md`,b=/\.(md|mdx)$/i;function x(r,i=y){return b.test(r)||e(r)||t(r)||n(r)?r:`${r}${i}`}function S(e){return $(e).replace(b,``)}function C(e,t){let n=$(e),r=k(t),i=t.find(e=>c(e)&&A(e,r)===n)??t.find(e=>c(e)&&T(e)===n);if(i)return i.docName;let a=S(n);return t.find(e=>{let t=T(e);return t!==n&&b.test(t)&&S(t)===a})&&b.test(n)?n:a}function w(e,t){let n=k(t);return t.find(t=>A(t,n)===e)??t.find(t=>T(t)===e)}function T(e){return l(e)?O(e.path):u(e)?e.path:x(e.docName,e.docExt)}function E(e){let t=$(e).match(b);return t?`.${t[1].toLowerCase()}`:void 0}function D(e){return $(e)}function O(e){let t=$(e.trim());return t?`${t}/`:``}function te(e){return e.endsWith(`/`)?D(e):S(e)}function k(e){let t=new Map;for(let n of e){if(!c(n))continue;let e=n.docName.match(b);if(!e)continue;let r=n.docName.slice(0,-e[0].length),i=t.get(r);i?i.add(e[0]):t.set(r,new Set([e[0]]))}return t}function A(e,t){let n=T(e);if(!c(e))return n;let r=e.docName.match(b);if(!r)return n;let i=e.docName.slice(0,-r[0].length);return(t.get(i)?.size??0)>1?n:`${e.docName}${e.docExt??y}`}function j(e){let t=k(e),n=new Set,r=[];for(let i of e){let e=A(i,t);n.has(e)||(n.add(e),r.push(e))}return r}function M(e){return[...e].sort().join(`\0`)}function N(e){return M(j(e))}function P(e,t={}){let n=new Set;for(let r of e){let e=(l(r)||u(r)?r.path:r.docName).split(`/`).filter(Boolean);if(!t.includeOkFolders&&e.includes(`.ok`))continue;if(l(r)){let e=O(r.path);e&&n.add(e)}let i=l(r)?e.length:e.length-1;for(let t=1;t<=i;t++)n.add(`${e.slice(0,t).join(`/`)}/`)}return[...n].sort()}function F(e){if(!e)return[];let t=$(e.replace(b,``)).split(`/`).filter(Boolean),n=[],r=e.endsWith(`/`)?t.length:t.length-1;for(let e=1;e<=r;e++)n.push(`${t.slice(0,e).join(`/`)}/`);return n}function I(e,t,n){let r=E(e);if(r)return r;let i=n.find(e=>c(e)&&e.docName===t);return i?i.docExt??y:Q(e).includes(`.`)?void 0:y}function L(e,t){let n=e.lastIndexOf(`/`),r=n===-1?``:e.slice(0,n+1),i=n===-1?e:e.slice(n+1),a=t.filter(e=>{if(!u(e)||!e.path.startsWith(r))return!1;let t=e.path.slice(r.length);return!t.includes(`/`)&&t.startsWith(`${i}.`)});return a.length===1?a[0].path:null}function R(e,t,n){if(E(e))return null;let r=n.find(e=>u(e)&&e.path===t);return r?r.path:Q(e).includes(`.`)?t:L(t,n)}function z(e,t){let n=e.kind===`directory`,r=n?D(e.path):C(e.path,t);if(n)return{kind:`folder`,name:$(Q(e.path)).replace(b,``),path:r,treePath:V(e.path,!0)};let i=R(e.path,r,t);if(i)return{kind:`asset`,name:$(Q(i)),path:i,treePath:i};let a=I(e.path,r,t);return{kind:`file`,name:$(Q(e.path)).replace(b,``),path:r,treePath:V(e.path,!1),docExt:a}}function B(e){return e.kind===`directory`?D(e.path):e.path}function V(e,t){return t?O(e):b.test(e)?e:`${e}${y}`}function H(e,t,n){let r=O(t),i=new Set(n);for(let t=0;t<100;t++){let n=t===0?``:` ${t+1}`;if(e===`file`){let e=`${r}Untitled${n}${y}`;if(!i.has(e))return{addPath:e,renamePath:e};continue}let a=`${r}New Folder${n}/`;if(!i.has(a))return{addPath:a,renamePath:a}}throw Error(`Could not allocate a unique tree placeholder`)}function U(e,t){return e===`file`?V(t,!1):`${D(t)}/index${y}`}function W(e,t){return t.kind===`root`||t.directoryPath==null?Q(e):`${t.directoryPath}${Q(e)}`}function G(e,t){if(t)return D(O(e));let n=S(e),r=n.lastIndexOf(`/`);return r===-1?``:n.slice(0,r)}function K(e,t){let n=D(O(e));return n?`${n}/${t}`:t}function q(e,t,n){e.append(`parentDocName`,K(t,n)),e.append(`placement`,`parent-dir`)}function J(e,t){return(t.path??K(e,t.src)).replace(/^\/+/,``)}function Y(e){let t=e.dataTransfer?.types;if(!t)return!1;let n=Array.from(t);return n.includes(`Files`)&&!n.includes(`application/x-open-knowledge-sidebar-item+json`)}function X(e){return Array.from(e.dataTransfer?.files??[]).filter(e=>e.name.length>0||e.size>0)}function Z(e,t){let n=d(e).toLowerCase();if(n===``)return null;let i=new Date().toISOString();if(n===`.md`||n===`.mdx`)return{kind:`document`,docName:S(e),docExt:n,modified:i,size:t.size};let a=n.startsWith(`.`)?n.slice(1):n;return{kind:`asset`,path:e,assetExt:a,mediaKind:r(a),modified:i,size:t.size}}function Q(e){let t=$(e),n=t.lastIndexOf(`/`),r=n===-1?t:t.slice(n+1);return e.endsWith(`/`)?`${r}/`:r}function $(e){return e.endsWith(`/`)?e.slice(0,-1):e}export{g as A,z as C,f as D,J as E,h as O,C as S,te as T,G as _,U as a,D as b,j as c,T as d,X as f,V as g,Y as h,W as i,m as j,ee as k,N as l,O as m,P as n,H as o,w as p,F as r,x as s,q as t,Z as u,B as v,M as w,S as x,L as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Ks as e,li as t,ri as n}from"./dist-
|
|
1
|
+
import{Ks as e,li as t,ri as n}from"./dist-BwXhTYUh.js";function r(e){return e.kind===`asset`}function i(e){return e.kind===`document`}function a(e){return e.kind===`folder`}function o(e){let t=[],n=0;for(let r of e)switch(r.kind){case`document`:if(r.docName===void 0){n+=1;break}t.push({kind:`document`,docName:r.docName,docExt:r.docExt,size:r.size,modified:r.modified,isSymlink:r.isSymlink,canonicalDocName:r.canonicalDocName,targetPath:r.targetPath});break;case`asset`:if(r.path===void 0||r.assetExt===void 0){n+=1;break}t.push({kind:`asset`,path:r.path,assetExt:r.assetExt,mediaKind:r.mediaKind??null,size:r.size,modified:r.modified,referencedBy:r.referencedBy});break;case`file`:if(r.path===void 0){n+=1;break}t.push({kind:`asset`,path:r.path,assetExt:r.assetExt??s(r.path),mediaKind:null,size:r.size,modified:r.modified,referencedBy:[]});break;case`folder`:if(r.path===void 0){n+=1;break}t.push({kind:`folder`,path:r.path,size:r.size,modified:r.modified,hasChildren:r.hasChildren,isSymlink:r.isSymlink,targetPath:r.targetPath});break;default:r.kind;break}return n>0&&console.warn(`[file-tree-utils] dropped ${n} listing entries missing variant identity fields`),t}function s(e){let t=e.includes(`/`)?e.split(`/`).pop()??e:e,n=t.lastIndexOf(`.`);return n>0&&n<t.length-1?t.slice(n+1).toLowerCase():t.startsWith(`.`)&&t.length>1?t.slice(1).toLowerCase():`file`}function c(e){if(!e)return[];let t=e.split(`/`).filter(Boolean),n=[];for(let e=1;e<t.length;e++)n.push(t.slice(0,e).join(`/`));return n}function l(e){if(!e)return``;let t=e.lastIndexOf(`/`);return t>0?e.slice(0,t):``}function u(e){return e.split(`/`).some(e=>e.toLowerCase()===`.ok`)}function d(e,t){return t&&e!==`document`&&e!==`folder`}function f(e,t){return!t&&n(e)}function p(e,r={}){let{showHiddenFiles:i=!1,showOnlyMarkdownFiles:a=!1,showOkFolders:o=!1}=r;return e.filter(e=>{let r=e.docName??e.path??``;if(r===``||d(e.kind,a))return!1;let s=r.split(`/`),c=s.indexOf(`.ok`);if(c!==-1){if(!o)return!1;let e=s.slice(0,c).join(`/`);return i||e===``||!n(e)}return t(r)?!1:!f(r,i)})}function m(n,r={}){let{showHiddenFiles:i=!1,showOnlyMarkdownFiles:a=!1}=r,o=n.docName??n.path??``;return o===``||e(o)||t(o)||u(o)?{hiddenFiles:!1,onlyMarkdownFiles:!1}:{hiddenFiles:f(o,i),onlyMarkdownFiles:d(n.kind,a)}}function h(e){let{visibility:t={},unfilteredRootEntryCount:n,knownPageCount:r}=e;return(n>0||r>0)&&(t.showOnlyMarkdownFiles??!1)?`filtered-to-zero`:`true-empty`}export{p as a,i as c,o as d,l as i,a as l,h as n,u as o,c as r,r as s,m as t,s as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as e}from"./documents-events-
|
|
1
|
+
import{l as e}from"./documents-events-CPlDP7Ae.js";import{t}from"./parse-api-error-BtEdpaFC.js";import{t as n}from"./createLucideIcon-B6ULg5PN.js";var r=n(`grip-vertical`,[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]);async function i(e){return t(await e.json().catch(()=>null))??`HTTP ${e.status}`}async function a(e,t){try{let n=await fetch(`/api/folder-config`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:e,frontmatter:t})});return n.ok?{ok:!0}:{ok:!1,error:await i(n)}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function o(t){try{let n=await fetch(`/api/template`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)});if(!n.ok)return{ok:!1,error:await i(n)};let r=await n.json().catch(()=>null);return e(),{ok:!0,created:r?.created??!1,warnings:r?.warnings??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function s(t,n){try{let r=`?folder=${encodeURIComponent(t)}&name=${encodeURIComponent(n)}`,a=await fetch(`/api/template${r}`,{method:`DELETE`});if(!a.ok)return{ok:!1,error:await i(a)};let o=await a.json().catch(()=>null);return e(),{ok:!0,existed:o?.existed??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function c(t){try{let n=await fetch(`/api/template`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)});if(!n.ok)return{ok:!1,error:await i(n)};let r=await n.json().catch(()=>null);return e(),{ok:!0,committed:r?.committed??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function l(t){try{let n=await fetch(`/api/template/import`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)});if(!n.ok)return{ok:!1,error:await i(n)};let r=await n.json().catch(()=>null);return e(),{ok:!0,path:r?.path??``,created:r?.created??!1,warnings:r?.warnings??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}export{o as a,a as i,l as n,r as o,c as r,s as t};
|