@inkeep/open-knowledge 0.47.3 → 0.47.5
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/{acp-harness-probe-QNrRVJhc.mjs → acp-harness-probe-inKMbnTO.mjs} +2 -2
- package/dist/cli.mjs +57 -57
- package/dist/constants-iJqy8Hia.mjs +2 -0
- package/dist/{git-handle-CllEzrX4.mjs → git-handle-BKNpWc-0.mjs} +2 -2
- package/dist/git-handle-vAOkZizz.mjs +1 -0
- package/dist/index.mjs +1 -1
- package/dist/init-Bp0b6aXB.mjs +1 -0
- package/dist/{init-DL_j9FNQ.mjs → init-D0r4e25M.mjs} +36 -36
- package/dist/{launch-json-removal-B-K7szy8.mjs → launch-json-removal-p9WHQkrd.mjs} +2 -2
- package/dist/loader-C6qDEjnp.mjs +1 -0
- package/dist/{loader-Ro5TBLoF.mjs → loader-DI6RYqwy.mjs} +2 -2
- package/dist/md-manager-BuZAb56s.mjs +2 -0
- package/dist/{open-browser-DiR8zaBV.mjs → open-browser-BGPHwSRQ.mjs} +2 -2
- package/dist/parse-worker.mjs +1 -1
- package/dist/{preview-CyVtre2s.mjs → preview-B-2W99IX.mjs} +2 -2
- package/dist/preview-CITNy9Et.mjs +1 -0
- package/dist/public/assets/{ActivityModeContent-2l8BA531.js → ActivityModeContent-Cs_G4A2z.js} +1 -1
- package/dist/public/assets/{AgentDiffPane-wqdF9lpR.js → AgentDiffPane-CWfs6hRd.js} +1 -1
- package/dist/public/assets/{AgentThreadClientBinder-56IhVeqo.js → AgentThreadClientBinder-GaJMQpHN.js} +1 -1
- package/dist/public/assets/{ChangedOutsideBadge-eT1ODdAD.js → ChangedOutsideBadge-DhOK_p1U.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-L7fbBlLy.js → CodeMirrorPropInput-DvoNWmdR.js} +1 -1
- package/dist/public/assets/{DocumentContext-DD95gIt4.js → DocumentContext-BaYg4CBg.js} +1 -1
- package/dist/public/assets/{EditorModeToggle-CR5jA0YM.js → EditorModeToggle-C9I-Efpm.js} +1 -1
- package/dist/public/assets/{EnableSyncConfirmDialog-C5fNw26t.js → EnableSyncConfirmDialog-DCen-fKk.js} +1 -1
- package/dist/public/assets/FeedbackForm-EBcXu2CA.js +1 -0
- package/dist/public/assets/{GraphPanel-BDGxPSvY.js → GraphPanel-B9HMPssx.js} +1 -1
- package/dist/public/assets/{ImportSkillDialog-B2ilfqxe.js → ImportSkillDialog-BjLITatU.js} +1 -1
- package/dist/public/assets/{LintConfigEditor-ByUOzhaw.js → LintConfigEditor-D6dnss9h.js} +1 -1
- package/dist/public/assets/{ManagedArtifactProperties-CVGjtd3P.js → ManagedArtifactProperties-BO70pd59.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-BkBzFhn7.js +1 -0
- package/dist/public/assets/{McpConsentDialogBody-B3ubISnW.js → McpConsentDialogBody-CZC9r_Ug.js} +1 -1
- package/dist/public/assets/{MermaidDocEditor-CftVeU4U.js → MermaidDocEditor-C6SV6GjT.js} +1 -1
- package/dist/public/assets/{ReportBugDialogBody-CWbkwdNL.js → ReportBugDialogBody-BZrgGB1Z.js} +1 -1
- package/dist/public/assets/{SchemaConfigEditor-UkvF3UAn.js → SchemaConfigEditor-BYBjMHsb.js} +1 -1
- package/dist/public/assets/{SessionsHost-Pa6hY3sI.js → SessionsHost-llsZYWbP.js} +2 -2
- package/dist/public/assets/{SettingsDialogBody-Be8P3Vqa.js → SettingsDialogBody-DXaeMFz_.js} +1 -1
- package/dist/public/assets/{ShareBranchSwitchDialog-BmGWQCY6.js → ShareBranchSwitchDialog-DUzjoGVJ.js} +1 -1
- package/dist/public/assets/{ShareReceiveDialog-BoqZXYhT.js → ShareReceiveDialog-BQhhG70Y.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-B_DT1dz2.js → ShareReceiveMissDialog-CaI0eq9C.js} +1 -1
- package/dist/public/assets/{SkillEditBanner-hcLaEQ2F.js → SkillEditBanner-WG0cwpb-.js} +1 -1
- package/dist/public/assets/{SkillOriginInline-CtSdZ4_j.js → SkillOriginInline-8KJ3qbz8.js} +1 -1
- package/dist/public/assets/{SkillToolbarControls-DQYbvJTe.js → SkillToolbarControls-LDRTNFTx.js} +1 -1
- package/dist/public/assets/{SourceEditor-DX9L1Mci.js → SourceEditor-nYPGo8QU.js} +1 -1
- package/dist/public/assets/{TerminalPanel-WTiFd3Z6.js → TerminalPanel-CkcArSmy.js} +1 -1
- package/dist/public/assets/{TerminalWindowApp-CnhrK_tv.js → TerminalWindowApp-COjq6Uas.js} +1 -1
- package/dist/public/assets/{TextDocEditor-BGlQEeBq.js → TextDocEditor-eS5P-G2H.js} +1 -1
- package/dist/public/assets/{ThreadView-CExveDEV.js → ThreadView-v9Y3Ih_a.js} +1 -1
- package/dist/public/assets/{TimelineDiffPane-DDFvXSlv.js → TimelineDiffPane-3nkpH5uW.js} +1 -1
- package/dist/public/assets/{agent-diff-store-jazihC28.js → agent-diff-store-PJFwSxS1.js} +1 -1
- package/dist/public/assets/{agent-visibility-Ch0XQMkJ.js → agent-visibility-Cieocxzz.js} +1 -1
- package/dist/public/assets/{auth-state-cache-D47fide1.js → auth-state-cache-B8KE-_17.js} +1 -1
- package/dist/public/assets/{client-version-CHRlMl4l.js → client-version-uMlMQx33.js} +1 -1
- package/dist/public/assets/{config-context-B2fceTMP.js → config-context-BIynQsCe.js} +1 -1
- package/dist/public/assets/{config-provider-Cb43FIW2.js → config-provider-DKj_NBqh.js} +1 -1
- package/dist/public/assets/{dist-5ovMzVKN2.js → dist-CrqBb5y32.js} +175 -175
- package/dist/public/assets/{doc-paths-BFNbv2er.js → doc-paths-CCYuGvJq.js} +1 -1
- package/dist/public/assets/{documents-events-BM8xyAJz.js → documents-events-CdU1iFH9.js} +1 -1
- package/dist/public/assets/{file-tree-adapter-C1zJK1Gk.js → file-tree-adapter-a1hBKu8z.js} +1 -1
- package/dist/public/assets/{file-tree-utils-Dma5c4k_.js → file-tree-utils-CClHAhYa.js} +1 -1
- package/dist/public/assets/{folder-config-api-BxuLFuqM.js → folder-config-api-6QhNU0oa.js} +1 -1
- package/dist/public/assets/{index-DlH6tzhG.js → index-kaTVsIsC.js} +108 -108
- package/dist/public/assets/{lint-config-client-DDxBMTZk.js → lint-config-client-B0H2okzr.js} +1 -1
- package/dist/public/assets/{markdownlint-rule-browser-c2Uv_5Ry.js → markdownlint-rule-browser-BXGIkBuD.js} +1 -1
- package/dist/public/assets/{navigation-targets-D9VW9WdW.js → navigation-targets-BwmQHp3k.js} +1 -1
- package/dist/public/assets/{open-managed-artifact-tab-CLwVAGCD.js → open-managed-artifact-tab-BzW5kLR0.js} +1 -1
- package/dist/public/assets/{pending-receive-nav-store-BmcjNZOu.js → pending-receive-nav-store-B1W7hvut.js} +1 -1
- package/dist/public/assets/{prop-types-BPmLSxhG.js → prop-types-DIaGyPZM.js} +1 -1
- package/dist/public/assets/{receive-store-BlAqmJZT.js → receive-store-DlIsfkuF.js} +1 -1
- package/dist/public/assets/{selection-context-DJvv-kK_.js → selection-context-DS--IqEv.js} +1 -1
- package/dist/public/assets/{skill-actions-CfQkZqK6.js → skill-actions-DCISbh85.js} +2 -2
- package/dist/public/assets/skill-scope-7fBhGcjl.js +1 -0
- package/dist/public/assets/{skills-api-BTy9LAk0.js → skills-api-wUsPYcxD.js} +1 -1
- package/dist/public/assets/{src-hNXjwMT1.js → src-ScxRfF8q.js} +1 -1
- package/dist/public/assets/{tag-pill-input-DVdwNfBT.js → tag-pill-input-Bx_oWl-2.js} +1 -1
- package/dist/public/assets/{target-navigation-intent-C6AhTsfc.js → target-navigation-intent-D2TXEip5.js} +1 -1
- package/dist/public/assets/{terminal-launch-events-B1DGOVIv.js → terminal-launch-events-B3gBFWc1.js} +1 -1
- package/dist/public/assets/{terminal-telemetry-CviFLmIq.js → terminal-telemetry-Bv3GE2Aw.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-B4AQIJp7.js → typing-burst-detector-lX1cLLkC.js} +2 -2
- package/dist/public/assets/{uninstall-CfW-qETg.js → uninstall-BILpXTW1.js} +1 -1
- package/dist/public/assets/{use-activity-panel-D8pDT3xu.js → use-activity-panel-CxtCUEYv.js} +1 -1
- package/dist/public/assets/{use-collab-url-CUHlgRv5.js → use-collab-url-BjRhUqsT.js} +1 -1
- package/dist/public/assets/{use-live-xterm-theme-CLCjRdjJ.js → use-live-xterm-theme-Cvtrg0j6.js} +1 -1
- package/dist/public/assets/{use-open-skill-akwbVkG4.js → use-open-skill-BHdzD0v1.js} +1 -1
- package/dist/public/assets/{use-settings-route-BnOIfxuB.js → use-settings-route-aXWIMVRt.js} +1 -1
- package/dist/public/assets/{use-skill-directory-CSx9txvQ.js → use-skill-directory-BV092Gnw.js} +1 -1
- package/dist/public/assets/{use-skill-origin-DvSOmIz_.js → use-skill-origin-DMt7ay7U.js} +1 -1
- package/dist/public/assets/{use-skills-DcLUuUJ9.js → use-skills-C7huRzJa.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-CgG0yd-l.js → use-terminal-enabled-C5zv0ln-.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-DD-1OHsM.js → use-timeline-entry-diff-EbqHCjsV.js} +1 -1
- package/dist/public/assets/{use-workspace-J5QvjwOx.js → use-workspace-D80aSSBD.js} +1 -1
- package/dist/public/index.html +41 -41
- package/dist/public/uninstall.html +2 -2
- package/dist/{repair-launch-json-DlAJs_pz.mjs → repair-launch-json-CSPeJG-m.mjs} +2 -2
- package/dist/{repair-mcp-configs-Bg-qmFa_.mjs → repair-mcp-configs-Basw3obQ.mjs} +2 -2
- package/dist/{repair-skills-CYkvjSVb.mjs → repair-skills-CXOdNyyU.mjs} +2 -2
- package/dist/repair-skills-CdFjRSeM.mjs +1 -0
- package/dist/{server-lock-CmYdHyX7.mjs → server-lock-9wk8At58.mjs} +2 -2
- package/dist/server-lock-DxjYF04b.mjs +1 -0
- package/dist/src-7fluFHtm.mjs +1 -0
- package/dist/{src-2gMaOH-l.mjs → src-BA6UmYHS.mjs} +418 -418
- package/dist/src-D81OiBLA.mjs +20 -0
- package/dist/{src-CHSJwcpc.mjs → src-Dkrbi5Bh.mjs} +87 -87
- package/dist/start-B5xwD4lL.mjs +1 -0
- package/dist/{start-CszIxyyk.mjs → start-DUP_Th9B.mjs} +3 -3
- package/dist/{write-project-skill-jk9SeWrA.mjs → write-project-skill-D_i5y_ki.mjs} +4 -4
- package/package.json +4 -4
- package/dist/constants-C5EnGQBy.mjs +0 -2
- package/dist/git-handle-DJPLRe3o.mjs +0 -1
- package/dist/init-I4_eavst.mjs +0 -1
- package/dist/loader-_DlE802w.mjs +0 -1
- package/dist/md-manager-DqRVEVmJ.mjs +0 -2
- package/dist/preview-CwNUTst2.mjs +0 -1
- package/dist/public/assets/FeedbackForm-macxQS8x.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-m1GRSrIt.js +0 -1
- package/dist/public/assets/skill-scope-DwJ84s_r.js +0 -1
- package/dist/repair-skills-R8jaRgSC.mjs +0 -1
- package/dist/server-lock-D61z37T2.mjs +0 -1
- package/dist/src--MxQA4BK.mjs +0 -20
- package/dist/src-B7qPUQHJ.mjs +0 -1
- package/dist/start-BFzPdz8R.mjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{xa as e}from"./dist-
|
|
1
|
+
import{xa as e}from"./dist-CrqBb5y32.js";function t(t){return e.includes(t)}function n(e){if(e.startsWith(h)||e.startsWith(y)||e.startsWith(b)||e.startsWith(C)||!e.startsWith(`#/`))return null;let t=e.slice(2),n=g(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(h)||!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}}function i(e,t){let n=`#/${e}`;return t?`${n}#${encodeURIComponent(t)}`:n}var a=`__okHashHistoryEntry`;function o(e){return{...typeof e==`object`&&e?e:{},[a]:!0}}function s(e){return typeof e==`object`&&!!e&&e[a]===!0}function c(){s(window.history.state)||window.history.replaceState(o(window.history.state),``)}function l(e){let{pathname:t,search:n}=window.location;window.history.replaceState(o(window.history.state),``,`${t}${n}${e}`)}function u(e){if(window.location.hash===e)return;let{pathname:t,search:n}=window.location;window.history.pushState(o(window.history.state),``,`${t}${n}${e}`)}function d(e){return e.endsWith(`.mdx`)?e.slice(0,-4):e.endsWith(`.md`)?e.slice(0,-3):e}function f(e,t){let n=e.replace(/^\/+|\/+$/g,``),r=n?`#/${n}/`:`#/`;return t?`${r}#${encodeURIComponent(t)}`:r}function p(e,t,n){if(e===`folder`)return f(t);let r=`#/${encodeURIComponent(t)}`;return n==null||n===``?r:`${r}?branch=${encodeURIComponent(n)}`}function m(e){if(e===`#/`)return!0;if(!e.startsWith(`#/`))return!1;let t=e.slice(2);return t.length>0&&t[0]===`?`}var h=`#/__asset__/`;function g(e){let t=e.indexOf(`?`),n=e.indexOf(`#`);return t<0?n:n<0?t:Math.min(t,n)}function _(e){if(!e.startsWith(h))return null;let t=e.slice(12);if(!t)return null;try{return t.split(`/`).map(decodeURIComponent).join(`/`)}catch{return t}}function v(e){return`${h}${e.split(`/`).map(encodeURIComponent).join(`/`)}`}var y=`#/__skill-file__/`,b=`#/__skills__`;function x(){return b}function S(e){return e===b||e.startsWith(`${b}/`)}var C=`#/__skill-preview__/`,w=[`explore`,`detected`,`builtin`];function T(e){return e!==void 0&&w.includes(e)}var E=`project`;function D(e){return[e.flavor,e.source,e.name,e.subtitle,e.level??E].map(encodeURIComponent).join(`/`)}function O(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!T(r)||!i||!a?null:{flavor:r,source:i,name:a,subtitle:o??``,...s&&t(s)?{level:s}:{},...c?{path:c}:{}}}function k(e){let t=D(e);return e.path&&(t+=`/${encodeURIComponent(e.path)}`),`${C}${t}`}function A(e){return e.startsWith(C)?O(e.slice(20)):null}function j(e,t){let n=A(e);if(n)return D(n)===D(t)?n.path:void 0}var M=`:`;function N(e){let t=e.host===void 0?e.name:`${e.name}${M}${e.host}`;return`${y}${[e.scope,t].map(encodeURIComponent).join(`/`)}/${e.path.split(`/`).map(encodeURIComponent).join(`/`)}`}function P(e){if(!e.startsWith(y))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(M),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}var F=/\.(md|mdx)$/i;function I(e){return e.trim().replace(/^\.\/+/,``).replace(/^\/+/,``)}function L(e){return I(e).replace(F,``)}function R(e){let t=I(e);return t?F.test(t)?t:`${t}.md`:`untitled.md`}function z(e){let t=L(e),n=t.lastIndexOf(`/`);return{initialDir:n>0?t.slice(0,n):``,suggestedName:`${n>=0?t.slice(n+1):t||`untitled`}.md`}}export{P as C,j as S,S as T,m as _,_ as a,u as b,p as c,v as d,i as f,x as g,k as h,r as i,D as l,N as m,R as n,O as o,f as p,L as r,n as s,z as t,d as u,s as v,A as w,l as x,c as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{k as e}from"./dist-
|
|
1
|
+
import{k as e}from"./dist-CrqBb5y32.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)}var o=`open-knowledge:doc-persisted`;function s(e){window.dispatchEvent(new CustomEvent(o,{detail:{docName:e}}))}function c(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(o,t),()=>window.removeEventListener(o,t)}var l=`open-knowledge:branch-changed`;function u(e){window.dispatchEvent(new CustomEvent(l,{detail:{branch:e}}))}function d(e){let t=t=>{if(!(t instanceof CustomEvent))return;let n=t.detail;e(n?.branch??null)};return window.addEventListener(l,t),()=>window.removeEventListener(l,t)}var f=`open-knowledge:templates-changed`;function p(){window.dispatchEvent(new CustomEvent(f))}function m(e){let t=()=>e();return window.addEventListener(f,t),()=>window.removeEventListener(f,t)}var h=`open-knowledge:skills-changed`;function g(){window.dispatchEvent(new CustomEvent(h))}function _(e){let t=()=>e();return window.addEventListener(h,t),()=>window.removeEventListener(h,t)}var v=new Set,y=(e,t)=>`${e}\u0000${t}`;function b(e,t){v.add(y(e,t)),g()}function x(e,t){v.delete(y(e,t))&&g()}function S(e){return v.size===0?e:e.filter(e=>!v.has(y(e.scope,e.name)))}export{i as a,x as c,a as d,_ as f,s as i,d as l,b as n,g as o,m as p,u as r,p as s,S as t,c as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Co as e,Do as t,xo as n}from"./dist-
|
|
1
|
+
import{Co as e,Do as t,xo as n}from"./dist-CrqBb5y32.js";import{d as r,f as i,p as a}from"./doc-paths-CCYuGvJq.js";import{t as o}from"./file-tree-rename-validation-1Yh3dC3l.js";import{c as s,l as c,s as l}from"./file-tree-utils-CClHAhYa.js";import{a as u}from"./navigation-targets-BwmQHp3k.js";var d=`application/x-open-knowledge-sidebar-item+json`,f={image:!0,video:!0,audio:!0,pdf:!0,text:!0,mermaid:!0};function p(e){return JSON.stringify(e)}function m(e){return e.kind===`folder`?{target:{kind:`folder`,target:e.folderPath,folderPath:e.folderPath},hash:a(e.folderPath)}:e.kind===`asset`?{target:{kind:`asset`,target:e.assetPath,assetPath:e.assetPath,mediaKind:e.mediaKind},hash:r(e.assetPath)}:{target:u(e.docName,e.size)??{kind:`doc`,target:e.docName,docName:e.docName},hash:i(e.docName)}}function h(e){if(!e||!Array.from(e.types).includes(`application/x-open-knowledge-sidebar-item+json`))return null;let t=e.getData(d);if(!t)return null;let n;try{n=JSON.parse(t)}catch{return null}if(!g(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&&!_(e)?null:{v:1,kind:`asset`,assetPath:n.assetPath,mediaKind:e}}return null}function g(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function _(e){return typeof e==`string`&&Object.hasOwn(f,e)}var v=`.md`,y=/\.(md|mdx)$/i;function b(t,r=v){return y.test(t)||e(t)||n(t)?t:`${t}${r}`}function x(e){return $(e).replace(y,``)}function S(e,t){let n=$(e),r=k(t),i=t.find(e=>s(e)&&A(e,r)===n)??t.find(e=>s(e)&&w(e)===n);if(i)return i.docName;let a=x(n);return t.find(e=>{let t=w(e);return t!==n&&y.test(t)&&x(t)===a})&&y.test(n)?n:a}function C(e,t){let n=k(t);return t.find(t=>A(t,n)===e)??t.find(t=>w(t)===e)}function w(e){return c(e)?D(e.path):l(e)?e.path:b(e.docName,e.docExt)}function T(e){let t=$(e).match(y);return t?`.${t[1].toLowerCase()}`:void 0}function E(e){return $(e)}function D(e){let t=$(e.trim());return t?`${t}/`:``}function O(e){return e.endsWith(`/`)?E(e):x(e)}function k(e){let t=new Map;for(let n of e){if(!s(n))continue;let e=n.docName.match(y);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=w(e);if(!s(e))return n;let r=e.docName.match(y);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??v}`}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=(c(r)||l(r)?r.path:r.docName).split(`/`).filter(Boolean);if(!t.includeOkFolders&&e.includes(`.ok`))continue;if(c(r)){let e=D(r.path);e&&n.add(e)}let i=c(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(y,``)).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=T(e);if(r)return r;let i=n.find(e=>s(e)&&e.docName===t);return i?i.docExt??v:Q(e).includes(`.`)?void 0:v}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(!l(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(T(e))return null;let r=n.find(e=>l(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?E(e.path):S(e.path,t);if(n)return{kind:`folder`,name:$(Q(e.path)).replace(y,``),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(y,``),path:r,treePath:V(e.path,!1),docExt:a}}function B(e){return e.kind===`directory`?E(e.path):e.path}function V(e,t){return t?D(e):y.test(e)?e:`${e}${v}`}function H(e,t,n){let r=D(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}${v}`;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):`${E(t)}/index${v}`}function W(e,t){return t.kind===`root`||t.directoryPath==null?Q(e):`${t.directoryPath}${Q(e)}`}function G(e,t){if(t)return E(D(e));let n=x(e),r=n.lastIndexOf(`/`);return r===-1?``:n.slice(0,r)}function K(e,t){let n=E(D(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,n){let r=o(e).toLowerCase();if(r===``)return null;let i=new Date().toISOString();if(r===`.md`||r===`.mdx`)return{kind:`document`,docName:x(e),docExt:r,modified:i,size:n.size};let a=r.startsWith(`.`)?r.slice(1):r;return{kind:`asset`,path:e,assetExt:a,mediaKind:t(a),modified:i,size:n.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{p as A,z as C,d as D,J as E,m as O,S,O as T,G as _,U as a,E as b,j as c,w as d,X as f,V as g,Y as h,W as i,h as k,N as l,D as m,P as n,H as o,C as p,F as r,b as s,q as t,Z as u,B as v,M as w,x,L as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Pa as e,mr as t}from"./dist-
|
|
1
|
+
import{Pa as e,mr as t}from"./dist-CrqBb5y32.js";function n(e){return e.kind===`asset`}function r(e){return e.kind===`document`}function i(e){return e.kind===`folder`}function a(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??o(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 o(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 s(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 c(e){if(!e)return``;let t=e.lastIndexOf(`/`);return t>0?e.slice(0,t):``}function l(e){return e.split(`/`).some(e=>e.toLowerCase()===`.ok`)}function u(e,t){return t&&e!==`document`&&e!==`folder`}function d(e,n){return!n&&t(e)}function f(e,n={}){let{showHiddenFiles:r=!1,showOnlyMarkdownFiles:i=!1,showOkFolders:a=!1}=n;return e.filter(e=>{let n=e.docName??e.path??``;if(n===``||u(e.kind,i))return!1;let o=n.split(`/`),s=o.indexOf(`.ok`);if(s!==-1){if(!a)return!1;let e=o.slice(0,s).join(`/`);return r||e===``||!t(e)}return!d(n,r)})}function p(t,n={}){let{showHiddenFiles:r=!1,showOnlyMarkdownFiles:i=!1}=n,a=t.docName??t.path??``;return a===``||e(a)||l(a)?{hiddenFiles:!1,onlyMarkdownFiles:!1}:{hiddenFiles:d(a,r),onlyMarkdownFiles:u(t.kind,i)}}function m(e){let{visibility:t={},unfilteredRootEntryCount:n,knownPageCount:r}=e;return(n>0||r>0)&&(t.showOnlyMarkdownFiles??!1)?`filtered-to-zero`:`true-empty`}export{f as a,r as c,a as d,c as i,i as l,m as n,l as o,s as r,n as s,p as t,o as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./createLucideIcon-DihYAFEK.js";import{t}from"./parse-api-error-Dmlzsw8v.js";import{s as n}from"./documents-events-
|
|
1
|
+
import{t as e}from"./createLucideIcon-DihYAFEK.js";import{t}from"./parse-api-error-Dmlzsw8v.js";import{s as n}from"./documents-events-CdU1iFH9.js";var r=e(`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(e){try{let t=await fetch(`/api/template`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await i(t)};let r=await t.json().catch(()=>null);return n(),{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(e,t){try{let r=`?folder=${encodeURIComponent(e)}&name=${encodeURIComponent(t)}`,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 n(),{ok:!0,existed:o?.existed??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function c(e){try{let t=await fetch(`/api/template`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await i(t)};let r=await t.json().catch(()=>null);return n(),{ok:!0,committed:r?.committed??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function l(e){try{let t=await fetch(`/api/template/import`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await i(t)};let r=await t.json().catch(()=>null);return n(),{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};
|