@inkeep/open-knowledge 0.79.3-beta.1 → 0.79.4-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/dist/cli.mjs +6 -6
  2. package/dist/constants-CVfFMvio.mjs +1 -0
  3. package/dist/{dist-CZBCHPnO.mjs → dist-FjdiIkRL.mjs} +1 -1
  4. package/dist/{dist-Bt-cb2ik.mjs → dist-vJEqztHl.mjs} +1 -1
  5. package/dist/index.mjs +99 -99
  6. package/dist/{init-CU5RL6f6.mjs → init-BIBEHKMa.mjs} +2 -2
  7. package/dist/init-Cafyakgw.mjs +1 -0
  8. package/dist/{launch-json-removal-MAOA6UoT.mjs → launch-json-removal-YkYTVm2A.mjs} +1 -1
  9. package/dist/{loader-_iulGod2.mjs → loader-BdhgGm4r.mjs} +1 -1
  10. package/dist/loader-S0EtwrsC.mjs +1 -0
  11. package/dist/{md-manager-BGnqyqi1-BWyJhS5F.mjs → md-manager-BGnqyqi1-6BkNojVX.mjs} +83 -83
  12. package/dist/{open-browser-Co1psphf.mjs → open-browser-DLKK4ylU.mjs} +1 -1
  13. package/dist/parse-worker.mjs +1 -1
  14. package/dist/{preview-BFGjEB-3.mjs → preview-BuDZlhnJ.mjs} +1 -1
  15. package/dist/preview-Cuwhk9qi.mjs +1 -0
  16. package/dist/public/assets/{ActivityModeContent--2lvtA3c.js → ActivityModeContent-BGtaTVJg.js} +1 -1
  17. package/dist/public/assets/AddPropertiesButton-DvbyIRwO.js +2 -0
  18. package/dist/public/assets/{AgentDiffPane-D6x5wd4h.js → AgentDiffPane-Qm7w7MMr.js} +1 -1
  19. package/dist/public/assets/{AgentIconCluster-CqUXZZMo.js → AgentIconCluster-D5LuHNJO.js} +1 -1
  20. package/dist/public/assets/{AgentThreadClientBinder-CGvXydlP.js → AgentThreadClientBinder-BREHoaJm.js} +1 -1
  21. package/dist/public/assets/{BugReportHistory-DSKcw3JQ.js → BugReportHistory-BXl_6f4j.js} +1 -1
  22. package/dist/public/assets/{BugReportHistoryDialog-N-Ap1hJt.js → BugReportHistoryDialog-BWqDN7uS.js} +1 -1
  23. package/dist/public/assets/CodeMirrorPropInput-BwsvP1xu.js +3 -0
  24. package/dist/public/assets/{ConsentDialogBody-NBiDlYMd.js → ConsentDialogBody-BgP4KrNS.js} +1 -1
  25. package/dist/public/assets/{DeleteConfirmationDialog-DYyGQK4Z.js → DeleteConfirmationDialog-DQ_i0S6n.js} +1 -1
  26. package/dist/public/assets/{DiffViewBoundary-_HbzD0gR.js → DiffViewBoundary-DrINwqRY.js} +1 -1
  27. package/dist/public/assets/DocumentContext-C148CNRk.js +39 -0
  28. package/dist/public/assets/{EditorModeToggle-BOmmVDPD.js → EditorModeToggle-xGUsSRSe.js} +1 -1
  29. package/dist/public/assets/{EnableSyncConfirmDialog-C6j7G_kd.js → EnableSyncConfirmDialog-DOZ5zDzD.js} +1 -1
  30. package/dist/public/assets/{ExcalidrawDocEditor-CAYMSmAF.js → ExcalidrawDocEditor-BAwqoaef.js} +1 -1
  31. package/dist/public/assets/FeedbackForm-D1KEMTSC.js +1 -0
  32. package/dist/public/assets/{GraphPanel-BMOYeFVW.js → GraphPanel-D3cDqBdF.js} +2 -2
  33. package/dist/public/assets/{ImageAttachments-CbvAD6gO.js → ImageAttachments-BVOV31nW.js} +1 -1
  34. package/dist/public/assets/{ImportSkillDialog-BXsrd5h-.js → ImportSkillDialog-D-jdo49M.js} +1 -1
  35. package/dist/public/assets/{LintConfigEditor-D5DY2Ucg.js → LintConfigEditor-DOxBNJ_Y.js} +1 -1
  36. package/dist/public/assets/ManagedArtifactProperties-BNPEFiAe.js +1 -0
  37. package/dist/public/assets/{ManagedArtifactProperties-sumfs_C-.js → ManagedArtifactProperties-C9hPGM3p.js} +1 -1
  38. package/dist/public/assets/{MermaidDocEditor-CWmiEhhJ.js → MermaidDocEditor-CvAN1xAi.js} +1 -1
  39. package/dist/public/assets/{OpenInAgentMenuItem-D8HsZbz2.js → OpenInAgentMenuItem-bGK86cMV.js} +1 -1
  40. package/dist/public/assets/{PropertyDisplayRow-CrxEj3M3.js → PropertyDisplayRow-eiW07Rgj.js} +1 -1
  41. package/dist/public/assets/{RegisteredAgentIcon-Cg6tPVU5.js → RegisteredAgentIcon-COLTpZlS.js} +1 -1
  42. package/dist/public/assets/{ReportBugDialogBody-Dgdx0abm.js → ReportBugDialogBody-Dy3N7m08.js} +2 -2
  43. package/dist/public/assets/{ReportBugMenuTrigger-L6UKLhv7.js → ReportBugMenuTrigger-DtEHTCER.js} +1 -1
  44. package/dist/public/assets/{SchemaConfigEditor-DbbukpG5.js → SchemaConfigEditor-DeMX7_Uf.js} +1 -1
  45. package/dist/public/assets/{SessionsHost-DLUt2F6p.js → SessionsHost-DX5kcHin.js} +2 -2
  46. package/dist/public/assets/{SettingsDialogBody-PbyK1LoL.js → SettingsDialogBody-DtvcT1Ic.js} +4 -4
  47. package/dist/public/assets/{ShareBranchSwitchDialog-KJzH1_kA.js → ShareBranchSwitchDialog-BA7m9Q8u.js} +1 -1
  48. package/dist/public/assets/{ShareReceiveDialog-CLkMfCLe.js → ShareReceiveDialog-CFS9v40G.js} +1 -1
  49. package/dist/public/assets/{ShareReceiveMissDialog-CLVrxv3V.js → ShareReceiveMissDialog-BwGoicT3.js} +1 -1
  50. package/dist/public/assets/{SkillCostValue-gdZ-CbVJ.js → SkillCostValue-Canu7ulO.js} +1 -1
  51. package/dist/public/assets/{SkillEditBanner-Bd94eiPC.js → SkillEditBanner-CqgwduJW.js} +1 -1
  52. package/dist/public/assets/{SkillForkDialog-Cg2OBoX4.js → SkillForkDialog-CEeyhMAq.js} +1 -1
  53. package/dist/public/assets/{SkillInstallMenu-DBCnHXH-.js → SkillInstallMenu-CB9B4a1-.js} +2 -2
  54. package/dist/public/assets/{SkillOriginInline-kzOBcIFc.js → SkillOriginInline-oER8eGHE.js} +1 -1
  55. package/dist/public/assets/{SkillToolbarControls-DltyfwOH.js → SkillToolbarControls-H_1Oj-Sb.js} +1 -1
  56. package/dist/public/assets/{SlidesToolbarControls-CAxEUrS2.js → SlidesToolbarControls-DZgG0qpw.js} +1 -1
  57. package/dist/public/assets/{SourceEditor-DLEw1wic.js → SourceEditor-6D9Q1OLM.js} +1 -1
  58. package/dist/public/assets/{TerminalPanel-Cb8KkKGX.js → TerminalPanel-CmRsNKO-.js} +3 -3
  59. package/dist/public/assets/{TerminalWindowApp-BMEXM7e6.js → TerminalWindowApp-CYg9tzAx.js} +1 -1
  60. package/dist/public/assets/{TextDocEditor-DeqaHCag.js → TextDocEditor-Cu2_yCo4.js} +1 -1
  61. package/dist/public/assets/ThreadView-BQd3q3f4.js +24 -0
  62. package/dist/public/assets/{TimelineDiffPane-BCk40u8c.js → TimelineDiffPane-BMuCUA3C.js} +1 -1
  63. package/dist/public/assets/{agent-connection-status-BKDHFOP-.js → agent-connection-status-DZOB3Cf4.js} +1 -1
  64. package/dist/public/assets/{auth-state-cache-COORa9sc.js → auth-state-cache-nrk6LKdL.js} +3 -3
  65. package/dist/public/assets/{bug-report-send-manager-BCkcP5rY.js → bug-report-send-manager-BFol9sa2.js} +1 -1
  66. package/dist/public/assets/chunk-BO2N2NFS-or1uZCel.js +82 -0
  67. package/dist/public/assets/client-version-BSPrGsFB.js +1 -0
  68. package/dist/public/assets/{comment-chips-BGRnR7X7.js → comment-chips-DulSb70U.js} +1 -1
  69. package/dist/public/assets/config-provider-Bz9rjVO0.js +4 -0
  70. package/dist/public/assets/{css-color-to-hex-B54xiLpY.js → css-color-to-hex-CceC2fgU.js} +1 -1
  71. package/dist/public/assets/{diagnostic-breadcrumb-BUuIuodI.js → diagnostic-breadcrumb-DU0H47R5.js} +1 -1
  72. package/dist/public/assets/{dist-bQ5kvrpa.js → dist-BS18tPvg.js} +114 -110
  73. package/dist/public/assets/dist-Dv7C_sDf.js +50 -0
  74. package/dist/public/assets/{doc-paths-BKrv1Wyo.js → doc-paths-wf1Zwihi.js} +1 -1
  75. package/dist/public/assets/{doc-undo-manager-DxMjEKx4.js → doc-undo-manager-BheAKzP1.js} +1 -1
  76. package/dist/public/assets/{documents-events-j9AAd1Uc.js → documents-events-CJhE88yE.js} +1 -1
  77. package/dist/public/assets/{file-tree-adapter-BqzkXC53.js → file-tree-adapter-DEH021-T.js} +1 -1
  78. package/dist/public/assets/{file-tree-utils-B3QHZLn9.js → file-tree-utils-BepVdPY2.js} +1 -1
  79. package/dist/public/assets/{folder-config-api-DBYtfk4T.js → folder-config-api-BTtUsUJc.js} +1 -1
  80. package/dist/public/assets/{highlighted-body-OFNGDK62-jrcgBfTw.js → highlighted-body-OFNGDK62-B7E5UTmI.js} +1 -1
  81. package/dist/public/assets/index-BDB9B3sq.js +2205 -0
  82. package/dist/public/assets/{lint-config-client-C26s8yTI.js → lint-config-client-BrKjdAjt.js} +1 -1
  83. package/dist/public/assets/{markdownlint-rule-browser-D5yxtwtH.js → markdownlint-rule-browser-Cv--E2sT.js} +1 -1
  84. package/dist/public/assets/mermaid-GHXKKRXX-DuRPZW34.js +1 -0
  85. package/dist/public/assets/navigation-targets-CGmNW6bP.js +1 -0
  86. package/dist/public/assets/{page-list-cache-DP24ij3W.js → page-list-cache-3qGG2z03.js} +1 -1
  87. package/dist/public/assets/{pending-receive-nav-store-CQL0bv5o.js → pending-receive-nav-store-DX9ZlVdF.js} +1 -1
  88. package/dist/public/assets/{preferred-session-events-BEpzXSN8.js → preferred-session-events-C7578rLS.js} +1 -1
  89. package/dist/public/assets/{progress-CTr23hqQ.js → progress-BkUMvhVa.js} +3 -3
  90. package/dist/public/assets/{project-paths-B-FMrj5U.js → project-paths-BJF_em3Q.js} +1 -1
  91. package/dist/public/assets/{prop-types-BWPMh-sI.js → prop-types-DasLWSYV.js} +1 -1
  92. package/dist/public/assets/{receive-store-CU33mRR1.js → receive-store-C5Ksy1p_.js} +1 -1
  93. package/dist/public/assets/{selection-context-LrE0_TTe.js → selection-context-CfaQyBw5.js} +1 -1
  94. package/dist/public/assets/{sign-in-terminal-events-MVTdgKtV.js → sign-in-terminal-events-BYXamHPu.js} +1 -1
  95. package/dist/public/assets/{skill-scope-B73Ci61z.js → skill-scope-BkSXs9Lm.js} +1 -1
  96. package/dist/public/assets/{skills-api-BazLRy2N.js → skills-api-Cvk5ZT2-.js} +1 -1
  97. package/dist/public/assets/{src-BxNPgEkh.js → src-WuRhykee.js} +1 -1
  98. package/dist/public/assets/{startup-marks-c2tjYHWa.js → startup-marks-JBqTw7J_.js} +1 -1
  99. package/dist/public/assets/{tag-pill-input-B28iAFxa.js → tag-pill-input-Kw1eRXQ5.js} +1 -1
  100. package/dist/public/assets/{target-navigation-intent-BJZ9PSpW.js → target-navigation-intent-5WXmlPf2.js} +1 -1
  101. package/dist/public/assets/{telemetry-impl-CDsHOhvm.js → telemetry-impl-CSp2bjxK.js} +1 -1
  102. package/dist/public/assets/{telemetry-startup-D-KW_NaP.js → telemetry-startup-DpILQ7Sq.js} +1 -1
  103. package/dist/public/assets/{terminal-command-events-BQFgUjko.js → terminal-command-events-LkibGwt_.js} +1 -1
  104. package/dist/public/assets/{terminal-launch-events-E89-i5D1.js → terminal-launch-events-BNIYHJG5.js} +1 -1
  105. package/dist/public/assets/{terminal-telemetry-BA6DIKLO.js → terminal-telemetry-Bo0-Yp4s.js} +1 -1
  106. package/dist/public/assets/{thread-client-BS8GJcoK.js → thread-client-DvgdAVjP.js} +1 -1
  107. package/dist/public/assets/typing-burst-detector-D7fB4wtC.js +8 -0
  108. package/dist/public/assets/{uninstall-C5hq5xn8.js → uninstall-Dpv7hvKF.js} +1 -1
  109. package/dist/public/assets/{use-activity-panel-D1MJ-kqr.js → use-activity-panel-C1l1_f-a.js} +1 -1
  110. package/dist/public/assets/{use-apply-config-language-DBt73Gpy.js → use-apply-config-language-CsFHXy7e.js} +1 -1
  111. package/dist/public/assets/{use-collab-url-4KL8XQXU.js → use-collab-url-DdeZ1MQX.js} +1 -1
  112. package/dist/public/assets/{use-conflicts-BNUZnjy-.js → use-conflicts-ZQRJMYhG.js} +1 -1
  113. package/dist/public/assets/{use-git-sync-status-BnU8yWA0.js → use-git-sync-status-OS-MtdFB.js} +1 -1
  114. package/dist/public/assets/{use-installed-clis-D8GK8YwQ.js → use-installed-clis-CuUx3tVA.js} +2 -2
  115. package/dist/public/assets/{use-live-xterm-theme-CFX30um3.js → use-live-xterm-theme-X4_1Rmea.js} +1 -1
  116. package/dist/public/assets/{use-open-skill-BBxnHzMv.js → use-open-skill-98PouqrU.js} +1 -1
  117. package/dist/public/assets/{use-settings-route-C4w2E5xi.js → use-settings-route--nlw92BG.js} +1 -1
  118. package/dist/public/assets/{use-skill-origin-C2zSJntJ.js → use-skill-origin-CIxELV6T.js} +1 -1
  119. package/dist/public/assets/{use-skills-BZixx2iF.js → use-skills--ee80y05.js} +1 -1
  120. package/dist/public/assets/{use-terminal-enabled-BePo4VDS.js → use-terminal-enabled-nEwUkNGY.js} +1 -1
  121. package/dist/public/assets/use-timeline-entry-diff-C7Gv1P9i.js +5 -0
  122. package/dist/public/assets/{use-workspace-CchUoI6W.js → use-workspace-C-p6QNEA.js} +1 -1
  123. package/dist/public/index.html +60 -60
  124. package/dist/public/uninstall.html +4 -4
  125. package/dist/{registry-probes-DIjo4lc4.mjs → registry-probes-COYLriBj.mjs} +1 -1
  126. package/dist/{removal-file-path-DpLraZks.mjs → removal-file-path-XJ7v7PdF.mjs} +1 -1
  127. package/dist/{repair-launch-json-D8diDIHc.mjs → repair-launch-json-DBnVImS_.mjs} +1 -1
  128. package/dist/{repair-mcp-configs-pQlO34hz.mjs → repair-mcp-configs-Cc1b1LV6.mjs} +1 -1
  129. package/dist/{src-jzrJerbj.mjs → src-epHFsiAv.mjs} +1 -1
  130. package/dist/src-uHQrLo7N.mjs +1 -0
  131. package/dist/{start-D93NCq63.mjs → start-Bw9GIuv1.mjs} +3 -3
  132. package/dist/start-DBr7x8jd.mjs +1 -0
  133. package/package.json +4 -4
  134. package/dist/constants-CMlttrfV.mjs +0 -1
  135. package/dist/init-Cifsemq8.mjs +0 -1
  136. package/dist/loader-y0nJuvh8.mjs +0 -1
  137. package/dist/preview-x0kqNHT0.mjs +0 -1
  138. package/dist/public/assets/AddPropertiesButton-C-iLRZ1e.js +0 -2
  139. package/dist/public/assets/CodeMirrorPropInput-C6PE1vK2.js +0 -3
  140. package/dist/public/assets/DocumentContext-DjP4XRJx.js +0 -39
  141. package/dist/public/assets/FeedbackForm-BWVDETqI.js +0 -1
  142. package/dist/public/assets/ManagedArtifactProperties-BnJzcs6f.js +0 -1
  143. package/dist/public/assets/ThreadView-DcCcrnS8.js +0 -21
  144. package/dist/public/assets/chunk-BO2N2NFS-CrYfkrUQ.js +0 -103
  145. package/dist/public/assets/client-version-yBzdRoMs.js +0 -1
  146. package/dist/public/assets/config-provider-CTHdqAYx.js +0 -4
  147. package/dist/public/assets/index-0UAk3qu0.js +0 -2205
  148. package/dist/public/assets/lib-CPkc7nK4.js +0 -29
  149. package/dist/public/assets/mermaid-GHXKKRXX-BZXWx43A.js +0 -1
  150. package/dist/public/assets/navigation-targets-35tMAsBB.js +0 -1
  151. package/dist/public/assets/typing-burst-detector-BI7H8DPb.js +0 -8
  152. package/dist/public/assets/use-timeline-entry-diff-Cpz7ybaB.js +0 -5
  153. package/dist/src-w38zUUim.mjs +0 -1
  154. package/dist/start-BsY2TxeT.mjs +0 -1
@@ -1 +1 @@
1
- import{Us as e}from"./dist-bQ5kvrpa.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){let t=e.toLowerCase();return t.endsWith(`.mdx`)?e.slice(0,-4):t.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}var R=/\.(md|mdx)$/i;function z(e){return e.trim().replace(/^\.\/+/,``).replace(/^\/+/,``)}function B(e){return z(e).replace(R,``)}function V(e){let t=z(e);return t?R.test(t)?t:`${t}.md`:`untitled.md`}function H(e){let t=B(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,L as S,f as _,S as a,h as b,v as c,C as d,s as f,y as g,N as h,r as i,j as l,I as m,V as n,M as o,_ as p,B as r,n as s,H as t,g as u,c as v,E as w,m as x,p as y};
1
+ import{Ws as e}from"./dist-BS18tPvg.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){let t=e.toLowerCase();return t.endsWith(`.mdx`)?e.slice(0,-4):t.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}var R=/\.(md|mdx)$/i;function z(e){return e.trim().replace(/^\.\/+/,``).replace(/^\/+/,``)}function B(e){return z(e).replace(R,``)}function V(e){let t=z(e);return t?R.test(t)?t:`${t}.md`:`untitled.md`}function H(e){let t=B(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,L as S,f as _,S as a,h as b,v as c,C as d,s as f,y as g,N as h,r as i,j as l,I as m,V as n,M as o,_ as p,B as r,n as s,H as t,g as u,c as v,E as w,m as x,p as y};
@@ -1 +1 @@
1
- import{p as e}from"./config-provider-CTHdqAYx.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
+ import{p as e}from"./config-provider-Bz9rjVO0.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-bQ5kvrpa.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};
1
+ import{N as e}from"./dist-BS18tPvg.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};
@@ -1 +1 @@
1
- import{_s as e,fs as t,ps as n,ys as r}from"./dist-bQ5kvrpa.js";import{d as i,f as a,p as o}from"./doc-paths-BKrv1Wyo.js";import{i as s}from"./navigation-targets-35tMAsBB.js";import{c,l,s as u}from"./file-tree-utils-B3QHZLn9.js";import{t as d}from"./file-tree-rename-validation-C11Qcf3I.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)||n(r)||t(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
+ import{bs as e,ms as t,ps as n,vs as r}from"./dist-BS18tPvg.js";import{d as i,f as a,p as o}from"./doc-paths-wf1Zwihi.js";import{i as s}from"./navigation-targets-CGmNW6bP.js";import{c,l,s as u}from"./file-tree-utils-BepVdPY2.js";import{t as d}from"./file-tree-rename-validation-C11Qcf3I.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(e,i=y){return b.test(e)||r(e)||t(e)||n(e)?e:`${e}${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(t,n){let r=d(t).toLowerCase();if(r===``)return null;let i=new Date().toISOString();if(r===`.md`||r===`.mdx`)return{kind:`document`,docName:S(t),docExt:r,modified:i,size:n.size};let a=r.startsWith(`.`)?r.slice(1):r;return{kind:`asset`,path:t,assetExt:a,mediaKind:e(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{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{_i as e,di as t,nc as n}from"./dist-bQ5kvrpa.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,n){return!n&&t(e)}function p(n,r={}){let{showHiddenFiles:i=!1,showOnlyMarkdownFiles:a=!1,showOkFolders:o=!1}=r;return n.filter(n=>{let r=n.docName??n.path??``;if(r===``||d(n.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===``||!t(e)}return e(r)?!1:!f(r,i)})}function m(t,r={}){let{showHiddenFiles:i=!1,showOnlyMarkdownFiles:a=!1}=r,o=t.docName??t.path??``;return o===``||n(o)||e(o)||u(o)?{hiddenFiles:!1,onlyMarkdownFiles:!1}:{hiddenFiles:f(o,i),onlyMarkdownFiles:d(t.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
+ import{_i as e,di as t,rc as n}from"./dist-BS18tPvg.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,n){return!n&&t(e)}function p(n,r={}){let{showHiddenFiles:i=!1,showOnlyMarkdownFiles:a=!1,showOkFolders:o=!1}=r;return n.filter(n=>{let r=n.docName??n.path??``;if(r===``||d(n.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===``||!t(e)}return e(r)?!1:!f(r,i)})}function m(t,r={}){let{showHiddenFiles:i=!1,showOnlyMarkdownFiles:a=!1}=r,o=t.docName??t.path??``;return o===``||n(o)||e(o)||u(o)?{hiddenFiles:!1,onlyMarkdownFiles:!1}:{hiddenFiles:f(o,i),onlyMarkdownFiles:d(t.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-j9AAd1Uc.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};
1
+ import{l as e}from"./documents-events-CJhE88yE.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};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{a as r,r as i,t as a}from"./chunk-BO2N2NFS-CrYfkrUQ.js";var o=e(n(),1),s=t(),c=({code:e,language:t,raw:n,className:c,startLine:l,lineNumbers:u,...d})=>{let{shikiTheme:f}=(0,o.useContext)(r),p=i(),[m,h]=(0,o.useState)(n);return(0,o.useEffect)(()=>{if(!p){h(n);return}let r=p.highlight({code:e,language:t,themes:f},e=>{h(e)});r&&h(r)},[e,t,f,p,n]),(0,s.jsx)(a,{className:c,language:t,lineNumbers:u,result:m,startLine:l,...d})};export{c as HighlightedCodeBlockBody};
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{a as r,r as i,t as a}from"./chunk-BO2N2NFS-or1uZCel.js";var o=e(n(),1),s=t(),c=({code:e,language:t,raw:n,className:c,startLine:l,lineNumbers:u,...d})=>{let{shikiTheme:f}=(0,o.useContext)(r),p=i(),[m,h]=(0,o.useState)(n);return(0,o.useEffect)(()=>{if(!p){h(n);return}let r=p.highlight({code:e,language:t,themes:f},e=>{h(e)});r&&h(r)},[e,t,f,p,n]),(0,s.jsx)(a,{className:c,language:t,lineNumbers:u,result:m,startLine:l,...d})};export{c as HighlightedCodeBlockBody};