@inkeep/open-knowledge 0.48.3 → 0.48.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. package/dist/{acp-harness-probe-dGS3CfhR.mjs → acp-harness-probe-BJVJiVUs.mjs} +2 -2
  2. package/dist/build-BcDJ6qQ2.mjs +1 -0
  3. package/dist/{build-DYQrG4v7.mjs → build-CJW5ggp6.mjs} +1 -1
  4. package/dist/cli.mjs +35 -35
  5. package/dist/constants-CJWtjwW3.mjs +2 -0
  6. package/dist/git-handle-CtdWfsLv.mjs +1 -0
  7. package/dist/{git-handle-D6plgfL-.mjs → git-handle-DyGrpFVy.mjs} +2 -2
  8. package/dist/index.mjs +1 -1
  9. package/dist/{init-BRRzr201.mjs → init-Cd1_v3wI.mjs} +17 -17
  10. package/dist/init-X2eImden.mjs +1 -0
  11. package/dist/{launch-json-removal-DmEAv6Sr.mjs → launch-json-removal-7jg5jb8d.mjs} +2 -2
  12. package/dist/loader-Cl9H91kC.mjs +1 -0
  13. package/dist/{loader-DuZCwxq5.mjs → loader-Dut5v7PU.mjs} +2 -2
  14. package/dist/md-manager-C54e9m9K.mjs +2 -0
  15. package/dist/{open-browser-ifD987S6.mjs → open-browser-svTSfejY.mjs} +2 -2
  16. package/dist/parse-worker.mjs +1 -1
  17. package/dist/{preview-rbXV3HQ4.mjs → preview-BUTDo_sW.mjs} +2 -2
  18. package/dist/preview-De69hrdY.mjs +1 -0
  19. package/dist/public/assets/{ActivityModeContent-Ls6Ii2AR.js → ActivityModeContent-chf65mHv.js} +1 -1
  20. package/dist/public/assets/{AgentDiffPane-CRYL--uE.js → AgentDiffPane-BhDkUTFB.js} +1 -1
  21. package/dist/public/assets/{AgentThreadClientBinder-DkJCXESC.js → AgentThreadClientBinder-daoer6rt.js} +1 -1
  22. package/dist/public/assets/{ChangedOutsideBadge-C7ib2CLj.js → ChangedOutsideBadge-DXW-EIxq.js} +1 -1
  23. package/dist/public/assets/CodeMirrorPropInput-jnKiyo7e.js +3 -0
  24. package/dist/public/assets/DocumentContext-CbiUq_y_.js +38 -0
  25. package/dist/public/assets/{EditorModeToggle-Bzur2AVh.js → EditorModeToggle-MlyaASd4.js} +1 -1
  26. package/dist/public/assets/{EnableSyncConfirmDialog-Znrf_6pT.js → EnableSyncConfirmDialog-DJzKZH9_.js} +1 -1
  27. package/dist/public/assets/FeedbackForm-fZOaWDmn.js +1 -0
  28. package/dist/public/assets/{GraphPanel-WI6aG2BT.js → GraphPanel-BlKaOmvl.js} +1 -1
  29. package/dist/public/assets/{ImportSkillDialog-DbA_I30Z.js → ImportSkillDialog-BwFLLrFA.js} +1 -1
  30. package/dist/public/assets/{LintConfigEditor-DtuTsRPs.js → LintConfigEditor-DA3kBgdI.js} +1 -1
  31. package/dist/public/assets/ManagedArtifactProperties-CQrKB-iu.js +2 -0
  32. package/dist/public/assets/ManagedArtifactProperties-vdmxtWaH.js +1 -0
  33. package/dist/public/assets/{McpConsentDialogBody-BP8KTHru.js → McpConsentDialogBody-NLB2A56E.js} +1 -1
  34. package/dist/public/assets/{MermaidDocEditor-CnjxdTzJ.js → MermaidDocEditor-D2Fgv_Aq.js} +1 -1
  35. package/dist/public/assets/{ReportBugDialogBody-DcEMoxKz.js → ReportBugDialogBody-C9wKJMEr.js} +1 -1
  36. package/dist/public/assets/{SchemaConfigEditor-DzyMGxmc.js → SchemaConfigEditor-DxzvkAje.js} +1 -1
  37. package/dist/public/assets/{SessionsHost-31LO23Wl.js → SessionsHost-2n2SG2iI.js} +2 -2
  38. package/dist/public/assets/{SettingsDialogBody-DzlQ13IX.js → SettingsDialogBody-BqhxDjAz.js} +4 -4
  39. package/dist/public/assets/{ShareBranchSwitchDialog-DSnG7Vwo.js → ShareBranchSwitchDialog-DWmVoqtB.js} +1 -1
  40. package/dist/public/assets/{ShareReceiveDialog-hp8-_wD0.js → ShareReceiveDialog-Deigdttj.js} +1 -1
  41. package/dist/public/assets/{ShareReceiveMissDialog-Cw4ZtAVB.js → ShareReceiveMissDialog-BL3D9Gle.js} +1 -1
  42. package/dist/public/assets/{SkillEditBanner-CWVFuS5L.js → SkillEditBanner-B31-HMnN.js} +1 -1
  43. package/dist/public/assets/{SkillOriginInline-C5BvTKcL.js → SkillOriginInline-OqQA2gy_.js} +1 -1
  44. package/dist/public/assets/{SkillToolbarControls-B137QbKv.js → SkillToolbarControls-C0tVYIrM.js} +1 -1
  45. package/dist/public/assets/SourceEditor-DXYx8dGZ.js +1 -0
  46. package/dist/public/assets/{TerminalPanel-Bb4mBhjy.js → TerminalPanel-BElaeDzL.js} +3 -3
  47. package/dist/public/assets/{TerminalWindowApp-CVRgfXzw.js → TerminalWindowApp-DTnpYYTU.js} +1 -1
  48. package/dist/public/assets/{TextDocEditor-DRxNsWPL.js → TextDocEditor-Dsn5B9bP.js} +1 -1
  49. package/dist/public/assets/{ThreadView-lR-GvL11.js → ThreadView-y-Li0RF5.js} +1 -1
  50. package/dist/public/assets/{TimelineDiffPane-eky-61qS.js → TimelineDiffPane-DJuUFHpe.js} +1 -1
  51. package/dist/public/assets/{agent-diff-store-k2Na1UuM.js → agent-diff-store-u_AkgS0W.js} +1 -1
  52. package/dist/public/assets/{agent-visibility-BdUDvgZz.js → agent-visibility-Dz506quD.js} +1 -1
  53. package/dist/public/assets/auth-state-cache-CRaqub1o.js +11 -0
  54. package/dist/public/assets/client-version-ChKobTOZ.js +1 -0
  55. package/dist/public/assets/{comment-chips-BPKPgIfD.js → comment-chips-Ck1DpbRA.js} +1 -1
  56. package/dist/public/assets/{config-context-BQkCAyV-.js → config-context-DyUEqnhn.js} +1 -1
  57. package/dist/public/assets/{config-provider-BxPJaWVp.js → config-provider-DuPteqwn.js} +2 -2
  58. package/dist/public/assets/{dist-B1W6XlK32.js → dist-DOPRKSzO2.js} +113 -113
  59. package/dist/public/assets/{doc-paths-BPPZUgg6.js → doc-paths-Dr8av3tc.js} +1 -1
  60. package/dist/public/assets/{documents-events-yek6VMZz.js → documents-events-Cd-1x5Ed.js} +1 -1
  61. package/dist/public/assets/{file-tree-adapter-3ja1qlJs.js → file-tree-adapter-DbXLXHhN.js} +1 -1
  62. package/dist/public/assets/file-tree-utils-DfeUmuaf.js +1 -0
  63. package/dist/public/assets/{folder-config-api-DsCcuh72.js → folder-config-api-C3YTmDwB.js} +1 -1
  64. package/dist/public/assets/{follow-file-DFcAxjow.js → follow-file-C5qpRlbJ.js} +1 -1
  65. package/dist/public/assets/{globals-C_5FVIC1.css → globals-Bl3fKb9V.css} +1 -1
  66. package/dist/public/assets/{globals-DTeKgG7r.js → globals-DyXnUQBm.js} +1 -1
  67. package/dist/public/assets/{index-DoaRsdsH.js → index-BQbQPg_v.js} +14 -14
  68. package/dist/public/assets/{lint-config-client-CbBNbz5z.js → lint-config-client-CeUWUhyK.js} +1 -1
  69. package/dist/public/assets/{markdownlint-rule-browser-bRkNLTrS.js → markdownlint-rule-browser-DfPiRgim.js} +1 -1
  70. package/dist/public/assets/navigation-targets-DxC4QM5f.js +1 -0
  71. package/dist/public/assets/{open-managed-artifact-tab-BIfn2FfR.js → open-managed-artifact-tab-DN3NM6Ff.js} +1 -1
  72. package/dist/public/assets/{pending-receive-nav-store-B9cFPfgA.js → pending-receive-nav-store-CozIYvRQ.js} +1 -1
  73. package/dist/public/assets/{prop-types-Bhux6LAG.js → prop-types-BC9HEC35.js} +1 -1
  74. package/dist/public/assets/{receive-store-B49FgHLW.js → receive-store-BCddK7iB.js} +1 -1
  75. package/dist/public/assets/{selection-context-De7RWVbr.js → selection-context-RZc2oFXM.js} +1 -1
  76. package/dist/public/assets/{skill-actions-BPyEVJTE.js → skill-actions-DKiNlzTD.js} +2 -2
  77. package/dist/public/assets/{skill-scope-VJV5Rx86.js → skill-scope-CEtnfeg4.js} +1 -1
  78. package/dist/public/assets/{skills-api-BMRKwBUl.js → skills-api-Bt6QqZxu.js} +1 -1
  79. package/dist/public/assets/{src-Ch8D3fT_.js → src-rLjayzt6.js} +1 -1
  80. package/dist/public/assets/{tag-pill-input-DtKTv6kf.js → tag-pill-input-DFIdRT0e.js} +1 -1
  81. package/dist/public/assets/{target-navigation-intent-NvDqDHJ2.js → target-navigation-intent-2M1YK6Wd.js} +1 -1
  82. package/dist/public/assets/{telemetry-impl-DcyIvKPm.js → telemetry-impl-EncMlLA1.js} +1 -1
  83. package/dist/public/assets/{telemetry-startup-DZzEawLj.js → telemetry-startup-BsSuT6m6.js} +1 -1
  84. package/dist/public/assets/{terminal-launch-events-cjIUscHc.js → terminal-launch-events-C2Gz2G0L.js} +1 -1
  85. package/dist/public/assets/{terminal-telemetry-BoiP_PBP.js → terminal-telemetry-CS_Zz_F-.js} +1 -1
  86. package/dist/public/assets/{typing-burst-detector-VZnl_iVo.js → typing-burst-detector-Clr6bDgl.js} +3 -3
  87. package/dist/public/assets/{uninstall-Da1ho4P8.js → uninstall-iZnahGQ3.js} +1 -1
  88. package/dist/public/assets/{use-activity-panel-BcGb7XOc.js → use-activity-panel-BT36dYKp.js} +1 -1
  89. package/dist/public/assets/{use-collab-url-BKsQe4b1.js → use-collab-url-CMgoqd7H.js} +1 -1
  90. package/dist/public/assets/{use-live-xterm-theme-CpBGZzBF.js → use-live-xterm-theme-KGb9fc_e.js} +1 -1
  91. package/dist/public/assets/{use-open-skill-BFI8qRZm.js → use-open-skill-35kmiloX.js} +1 -1
  92. package/dist/public/assets/{use-settings-route-B15KAQLp.js → use-settings-route-ClTq87t7.js} +1 -1
  93. package/dist/public/assets/{use-skill-directory-B5pZTEfG.js → use-skill-directory-BUrX6BOI.js} +1 -1
  94. package/dist/public/assets/{use-skill-origin-CNiZj4lD.js → use-skill-origin-DxVRIW_T.js} +1 -1
  95. package/dist/public/assets/{use-skills-nDAfVSei.js → use-skills-CDcSIIym.js} +1 -1
  96. package/dist/public/assets/{use-terminal-enabled-DoIFtYZ1.js → use-terminal-enabled-CtmRTg35.js} +1 -1
  97. package/dist/public/assets/{use-timeline-entry-diff-Cqn9J0oR.js → use-timeline-entry-diff-6aW6CFXB.js} +2 -2
  98. package/dist/public/assets/{use-workspace-DVmty0IU.js → use-workspace-BNdbTGXU.js} +1 -1
  99. package/dist/public/index.html +45 -45
  100. package/dist/public/uninstall.html +4 -4
  101. package/dist/{repair-launch-json-y0Ye6Viu.mjs → repair-launch-json-LaRYC53y.mjs} +2 -2
  102. package/dist/{repair-mcp-configs-BpFSKCVX.mjs → repair-mcp-configs-DNrnNQOU.mjs} +2 -2
  103. package/dist/repair-skills-DHPneNpJ.mjs +1 -0
  104. package/dist/{repair-skills-Cm70zKLA.mjs → repair-skills-QLgUXS7O.mjs} +2 -2
  105. package/dist/server-lock-BoNixvAi.mjs +1 -0
  106. package/dist/{server-lock-DQJq-D9V.mjs → server-lock-DsDrc4RU.mjs} +2 -2
  107. package/dist/{skill-teardown-BQ0YQ9rO.mjs → skill-teardown-Cj1-Y6iS.mjs} +2 -2
  108. package/dist/src-DIjYfcIb.mjs +1 -0
  109. package/dist/src-DoSxfvJP.mjs +2030 -0
  110. package/dist/{src-COaJTUgj.mjs → src-DqtbCKg7.mjs} +6 -6
  111. package/dist/{src-y-VpYk60.mjs → src-azBs1EPY.mjs} +89 -89
  112. package/dist/{start-BnzFfXFP.mjs → start-CCrkqkXp.mjs} +3 -3
  113. package/dist/start-Da1v7kNr.mjs +1 -0
  114. package/dist/{write-project-skill-DQTCLDNM.mjs → write-project-skill-B77kdJNQ.mjs} +4 -4
  115. package/dist/{yazl-BafwB467.mjs → yazl-DZr4PyKA.mjs} +1 -1
  116. package/dist/yazl-jVENrf5i.mjs +1 -0
  117. package/package.json +4 -4
  118. package/dist/build-DcqN8tua.mjs +0 -1
  119. package/dist/constants-ByRd9AfD.mjs +0 -2
  120. package/dist/git-handle-qS6DQPrF.mjs +0 -1
  121. package/dist/init-BG5OnRTs.mjs +0 -1
  122. package/dist/loader-B0fVATtC.mjs +0 -1
  123. package/dist/md-manager-CpKO8i9i.mjs +0 -2
  124. package/dist/preview-MSrIrOjR.mjs +0 -1
  125. package/dist/public/assets/CodeMirrorPropInput-TJBj2ROv.js +0 -3
  126. package/dist/public/assets/DocumentContext-x5CUxxhI.js +0 -38
  127. package/dist/public/assets/FeedbackForm-DMTgXOQ0.js +0 -1
  128. package/dist/public/assets/ManagedArtifactProperties-673wYJvM.js +0 -2
  129. package/dist/public/assets/ManagedArtifactProperties-CrJ02738.js +0 -1
  130. package/dist/public/assets/SourceEditor-7UYreAPX.js +0 -1
  131. package/dist/public/assets/auth-state-cache-DGUqbXC_.js +0 -11
  132. package/dist/public/assets/client-version-BK_KR7U_.js +0 -1
  133. package/dist/public/assets/file-tree-utils-Bl84nllO.js +0 -1
  134. package/dist/public/assets/navigation-targets-BekPm3G2.js +0 -1
  135. package/dist/repair-skills-DT7FGT3w.mjs +0 -1
  136. package/dist/server-lock-CQ1oOrnO.mjs +0 -1
  137. package/dist/src-BTCvmkZK.mjs +0 -2030
  138. package/dist/src-BuZeH4bR.mjs +0 -1
  139. package/dist/start-Cm8K9jls.mjs +0 -1
  140. package/dist/yazl-vwTkB7U0.mjs +0 -1
@@ -1 +1 @@
1
- import{xa as e}from"./dist-B1W6XlK32.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}var j=`:`;function M(e){let t=e.host===void 0?e.name:`${e.name}${j}${e.host}`;return`${y}${[e.scope,t].map(encodeURIComponent).join(`/`)}/${e.path.split(`/`).map(encodeURIComponent).join(`/`)}`}function N(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(j),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 P=/\.(md|mdx)$/i;function F(e){return e.trim().replace(/^\.\/+/,``).replace(/^\/+/,``)}function I(e){return F(e).replace(P,``)}function L(e){let t=F(e);return t?P.test(t)?t:`${t}.md`:`untitled.md`}function R(e){let t=I(e),n=t.lastIndexOf(`/`);return{initialDir:n>0?t.slice(0,n):``,suggestedName:`${n>=0?t.slice(n+1):t||`untitled`}.md`}}export{S as C,A as S,m as _,_ as a,l as b,p as c,v as d,i as f,x as g,k as h,r as i,D as l,M as m,L as n,O as o,f as p,I as r,n as s,R as t,d as u,c as v,N as x,u as y};
1
+ import{Sa as e}from"./dist-DOPRKSzO2.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}var j=`:`;function M(e){let t=e.host===void 0?e.name:`${e.name}${j}${e.host}`;return`${y}${[e.scope,t].map(encodeURIComponent).join(`/`)}/${e.path.split(`/`).map(encodeURIComponent).join(`/`)}`}function N(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(j),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 P=/\.(md|mdx)$/i;function F(e){return e.trim().replace(/^\.\/+/,``).replace(/^\/+/,``)}function I(e){return F(e).replace(P,``)}function L(e){let t=F(e);return t?P.test(t)?t:`${t}.md`:`untitled.md`}function R(e){let t=I(e),n=t.lastIndexOf(`/`);return{initialDir:n>0?t.slice(0,n):``,suggestedName:`${n>=0?t.slice(n+1):t||`untitled`}.md`}}export{S as C,A as S,m as _,_ as a,l as b,p as c,v as d,i as f,x as g,k as h,r as i,D as l,M as m,L as n,O as o,f as p,I as r,n as s,R as t,d as u,c as v,N as x,u as y};
@@ -1 +1 @@
1
- import{k as e}from"./dist-B1W6XlK32.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
+ import{k as e}from"./dist-DOPRKSzO2.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-B1W6XlK32.js";import{d as r,f as i,p as a}from"./doc-paths-BPPZUgg6.js";import{t as o}from"./file-tree-rename-validation-DEz_ryBu.js";import{c as s,l as c,s as l}from"./file-tree-utils-Bl84nllO.js";import{a as u}from"./navigation-targets-BekPm3G2.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?Array.from(e.types).includes(d):!1}function ee(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||!m(e))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{h 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,p as j,ee 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
+ import{Oo as e,So as t,wo as n}from"./dist-DOPRKSzO2.js";import{d as r,f as i,p as a}from"./doc-paths-Dr8av3tc.js";import{t as o}from"./file-tree-rename-validation-DEz_ryBu.js";import{c as s,l as c,s as l}from"./file-tree-utils-DfeUmuaf.js";import{a as u}from"./navigation-targets-DxC4QM5f.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?Array.from(e.types).includes(d):!1}function ee(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||!m(e))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(e,r=v){return y.test(e)||n(e)||t(e)?e:`${e}${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(t,n){let r=o(t).toLowerCase();if(r===``)return null;let i=new Date().toISOString();if(r===`.md`||r===`.mdx`)return{kind:`document`,docName:x(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{h 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,p as j,ee 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};
@@ -0,0 +1 @@
1
+ import{Fa as e,mr as t,yr as n}from"./dist-DOPRKSzO2.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(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===``||!t(e)}return n(r)?!1:!f(r,i)})}function m(t,r={}){let{showHiddenFiles:i=!1,showOnlyMarkdownFiles:a=!1}=r,o=t.docName??t.path??``;return o===``||e(o)||n(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{t as e}from"./createLucideIcon-BbgVV4EV.js";import{t}from"./parse-api-error-BFe1cdS7.js";import{s as n}from"./documents-events-yek6VMZz.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};
1
+ import{t as e}from"./createLucideIcon-BbgVV4EV.js";import{t}from"./parse-api-error-BFe1cdS7.js";import{s as n}from"./documents-events-Cd-1x5Ed.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};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{zn as n}from"./DocumentContext-x5CUxxhI.js";import{t as r}from"./react-f2sANaYj.js";import{r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./utils-CPqDy6Hr.js";import{r as s,t as c}from"./button-RQ5o7P7w.js";import{t as l}from"./separator-C4EdGs_S.js";import{t as u}from"./x-B3zGPHCO.js";var d=a(),f=t(),p=s(`group/button-group flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-lg [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1`,{variants:{orientation:{horizontal:`[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-lg!`,vertical:`flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-lg!`}},defaultVariants:{orientation:`horizontal`}});function m(e){let t=(0,d.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,orientation:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]!==n||t[5]!==r?(a=o(p({orientation:r}),n),t[4]=n,t[5]=r,t[6]=a):a=t[6];let s;return t[7]!==r||t[8]!==i||t[9]!==a?(s=(0,f.jsx)(`div`,{role:`group`,"data-slot":`button-group`,"data-orientation":r,className:a,...i}),t[7]=r,t[8]=i,t[9]=a,t[10]=s):s=t[10],s}function h(e){let t=(0,d.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,orientation:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`vertical`:i,s;t[4]===n?s=t[5]:(s=o(`relative self-stretch bg-input data-horizontal:mx-px data-horizontal:w-auto data-vertical:my-px data-vertical:h-auto`,n),t[4]=n,t[5]=s);let c;return t[6]!==a||t[7]!==r||t[8]!==s?(c=(0,f.jsx)(l,{"data-slot":`button-group-separator`,orientation:a,className:s,...r}),t[6]=a,t[7]=r,t[8]=s,t[9]=c):c=t[9],c}var g=`button, a[href], [role="menuitem"], [role="button"], input, textarea, select, [contenteditable="true"]`;function _(e,t){e.target instanceof HTMLElement&&(!(e.currentTarget instanceof HTMLElement)||!e.currentTarget.contains(e.target)||e.target.closest(g)||(e.preventDefault(),t.current?.focus()))}var v=e(r(),1);function y(e){let t=e.lastIndexOf(`/`);return t>=0?e.slice(t+1):e}function b(e){let t=(0,d.c)(21),{path:r,onRemove:a}=e,{_:o}=i(),s,l;t[0]!==o||t[1]!==r?(s=y(r),l=o({id:`hnq8fP`,values:{label:s}}),t[0]=o,t[1]=r,t[2]=s,t[3]=l):(s=t[2],l=t[3]);let p=l,m=`composer-context-chip-file-${r}`,h;t[4]===a?h=t[5]:(h=e=>{(e.key===`Backspace`||e.key===`Delete`)&&(e.preventDefault(),a())},t[4]=a,t[5]=h);let g;t[6]===r?g=t[7]:(g=(0,f.jsx)(`span`,{className:`absolute top-1/2 left-1/2 inline-flex size-3 -translate-x-1/2 -translate-y-1/2 opacity-100 transition-opacity duration-150 ease-out group-hover/chip:opacity-0 group-focus-within/chip:opacity-0 motion-reduce:transition-none`,children:(0,f.jsx)(n,{path:r,className:`size-3`,showExtensionBadge:!1})}),t[6]=r,t[7]=g);let _;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,f.jsx)(u,{className:`absolute top-1/2 left-1/2 size-3 -translate-x-1/2 -translate-y-1/2 opacity-0 transition-opacity duration-150 ease-out group-hover/chip:opacity-100 group-focus-within/chip:opacity-100 motion-reduce:transition-none`,"aria-hidden":!0}),t[8]=_):_=t[8];let v;t[9]!==a||t[10]!==p||t[11]!==h||t[12]!==g?(v=(0,f.jsxs)(c,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":p,onClick:a,onKeyDown:h,className:`group/remove relative size-3.5 shrink-0 rounded-sm text-muted-foreground/80 hover:text-foreground`,children:[g,_]}),t[9]=a,t[10]=p,t[11]=h,t[12]=g,t[13]=v):v=t[13];let b;t[14]===s?b=t[15]:(b=(0,f.jsx)(`span`,{className:`min-w-0 truncate`,children:s}),t[14]=s,t[15]=b);let x;return t[16]!==r||t[17]!==m||t[18]!==v||t[19]!==b?(x=(0,f.jsxs)(`span`,{"data-testid":m,title:r,className:`group/chip inline-flex max-w-[14rem] items-center gap-1 rounded-md border bg-muted/40 py-0.5 pr-1.5 pl-1 text-muted-foreground text-xs`,children:[v,b]}),t[16]=r,t[17]=m,t[18]=v,t[19]=b,t[20]=x):x=t[20],x}function x(e){let t=(0,d.c)(13),{files:n,onRemoveFile:r,className:i,children:a}=e,s;t[0]===n?s=t[1]:(s=n===void 0?[]:n,t[0]=n,t[1]=s);let c=s;if(c.length===0&&v.Children.toArray(a).length===0)return null;let l;t[2]===i?l=t[3]:(l=o(`flex flex-wrap items-center gap-1`,i),t[2]=i,t[3]=l);let u;if(t[4]!==c||t[5]!==r){let e;t[7]===r?e=t[8]:(e=e=>(0,f.jsx)(b,{path:e,onRemove:()=>r?.(e)},e),t[7]=r,t[8]=e),u=c.map(e),t[4]=c,t[5]=r,t[6]=u}else u=t[6];let p;return t[9]!==a||t[10]!==l||t[11]!==u?(p=(0,f.jsxs)(`div`,{className:l,"data-testid":`composer-context-chips`,children:[u,a]}),t[9]=a,t[10]=l,t[11]=u,t[12]=p):p=t[12],p}function S(){let e=(0,d.c)(2),[t,n]=(0,v.useState)(C),r,i;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{let e=window.matchMedia(`(prefers-reduced-motion: reduce)`);n(e.matches);let t=e=>n(e.matches);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,v.useEffect)(r,i),t}function C(){return typeof window<`u`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}var w=`ok-acp-follow-file-v1`;function T(){try{return localStorage.getItem(w)!==`0`}catch{return!0}}function E(e){try{localStorage.setItem(w,e?`1`:`0`)}catch{}}function D(e){return e===``||e.startsWith(`/`)||e.startsWith(`\\`)||e.split(`/`).some(e=>e===``||e.startsWith(`.`))?null:e}function O(e,t){let n=t.pathSeparator,r=e=>n===`\\`?e.replaceAll(`\\`,`/`):e,i=r(t.contentDir).replace(/\/$/,``),a=r(e);if(!a.startsWith(`${i}/`))return null;let o=a.slice(i.length+1),s=/\.(md|mdx)$/.exec(o);return s===null?null:D(o.slice(0,-s[0].length))}function k(e,t){let n=e[t];return typeof n==`string`&&n!==``?n:null}var A=new Set([`cat`,`ls`,`grep`,`rg`,`find`,`head`,`tail`,`wc`,`sort`,`uniq`,`cut`,`sed`,`awk`,`bat`,`less`,`more`]);function j(e,t){let n=[],r=/"([^"]*)"|'([^']*)'|(\S+)/g,i=r.exec(e);for(;i!==null;)n.push(i[1]??i[2]??i[3]??``),i=r.exec(e);let a=n[0];if(a===void 0||!A.has(a))return null;for(let e of n.slice(1)){if(e.startsWith(`-`)||/[*?[\]]/.test(e))continue;let n=/\.(md|mdx)$/i.exec(e);if(n===null)continue;if(e.startsWith(`/`)||/^[A-Za-z]:[\\/]/.test(e)){if(t!==null){let n=O(e,t);if(n!==null)return n}continue}let r=D(e.replace(/^\.\//,``).slice(0,-n[0].length));if(r!==null)return r}return null}function M(e){if(typeof e!=`object`||!e)return null;let t=e,n=k(t,`tool`)??k(t,`name`),r=t;if(typeof t.arguments==`object`&&t.arguments!==null)r=t.arguments;else if(typeof t.arguments==`string`)try{let e=JSON.parse(t.arguments);typeof e==`object`&&e&&(r=e)}catch{}return{tool:n,args:r}}function N(e,t,n,r){let i=M(e);if(i===null)return null;let{tool:a,args:o}=i;if(a===`delete`||a===null&&/\bdelete\b/i.test(t))return null;let s=typeof o.document==`object`&&o.document!==null?o.document:null,c=null;if(Array.isArray(o.documents))for(let e=o.documents.length-1;e>=0;e--){let t=o.documents[e];if(typeof t==`object`&&t){c=t;break}}let l=(s===null?null:k(s,`path`))??(c===null?null:k(c,`path`))??k(o,`to`)??k(o,`docName`);if(l!==null)return D(l.replace(/\.(md|mdx)$/,``));let u=k(o,`command`);if(u!==null){let e=j(u,n);return e!==null&&r.commandTargetExists!==void 0&&!r.commandTargetExists(e)?null:e}return null}function P(e,t,n={}){if(e.toolKind===`delete`)return null;let r=N(e.rawInput,e.title,t,n);if(r!==null)return r;if(t===null)return null;for(let n=e.locations.length-1;n>=0;n--){let r=e.locations[n];if(r===void 0)continue;let i=O(r.path,t);if(i!==null)return i}return null}function F(e,t,n={}){let r=null;for(let i of e){if(i.kind!==`tool_call`)continue;let e=P(i,t,n);e!==null&&(r=e)}return r}export{S as a,m as c,E as i,h as l,T as n,x as o,D as r,_ as s,F as t};
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{zn as n}from"./DocumentContext-CbiUq_y_.js";import{t as r}from"./react-f2sANaYj.js";import{r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./utils-CPqDy6Hr.js";import{r as s,t as c}from"./button-RQ5o7P7w.js";import{t as l}from"./separator-C4EdGs_S.js";import{t as u}from"./x-B3zGPHCO.js";var d=a(),f=t(),p=s(`group/button-group flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-lg [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1`,{variants:{orientation:{horizontal:`[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-lg!`,vertical:`flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-lg!`}},defaultVariants:{orientation:`horizontal`}});function m(e){let t=(0,d.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,orientation:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]!==n||t[5]!==r?(a=o(p({orientation:r}),n),t[4]=n,t[5]=r,t[6]=a):a=t[6];let s;return t[7]!==r||t[8]!==i||t[9]!==a?(s=(0,f.jsx)(`div`,{role:`group`,"data-slot":`button-group`,"data-orientation":r,className:a,...i}),t[7]=r,t[8]=i,t[9]=a,t[10]=s):s=t[10],s}function h(e){let t=(0,d.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,orientation:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`vertical`:i,s;t[4]===n?s=t[5]:(s=o(`relative self-stretch bg-input data-horizontal:mx-px data-horizontal:w-auto data-vertical:my-px data-vertical:h-auto`,n),t[4]=n,t[5]=s);let c;return t[6]!==a||t[7]!==r||t[8]!==s?(c=(0,f.jsx)(l,{"data-slot":`button-group-separator`,orientation:a,className:s,...r}),t[6]=a,t[7]=r,t[8]=s,t[9]=c):c=t[9],c}var g=`button, a[href], [role="menuitem"], [role="button"], input, textarea, select, [contenteditable="true"]`;function _(e,t){e.target instanceof HTMLElement&&(!(e.currentTarget instanceof HTMLElement)||!e.currentTarget.contains(e.target)||e.target.closest(g)||(e.preventDefault(),t.current?.focus()))}var v=e(r(),1);function y(e){let t=e.lastIndexOf(`/`);return t>=0?e.slice(t+1):e}function b(e){let t=(0,d.c)(21),{path:r,onRemove:a}=e,{_:o}=i(),s,l;t[0]!==o||t[1]!==r?(s=y(r),l=o({id:`hnq8fP`,values:{label:s}}),t[0]=o,t[1]=r,t[2]=s,t[3]=l):(s=t[2],l=t[3]);let p=l,m=`composer-context-chip-file-${r}`,h;t[4]===a?h=t[5]:(h=e=>{(e.key===`Backspace`||e.key===`Delete`)&&(e.preventDefault(),a())},t[4]=a,t[5]=h);let g;t[6]===r?g=t[7]:(g=(0,f.jsx)(`span`,{className:`absolute top-1/2 left-1/2 inline-flex size-3 -translate-x-1/2 -translate-y-1/2 opacity-100 transition-opacity duration-150 ease-out group-hover/chip:opacity-0 group-focus-within/chip:opacity-0 motion-reduce:transition-none`,children:(0,f.jsx)(n,{path:r,className:`size-3`,showExtensionBadge:!1})}),t[6]=r,t[7]=g);let _;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,f.jsx)(u,{className:`absolute top-1/2 left-1/2 size-3 -translate-x-1/2 -translate-y-1/2 opacity-0 transition-opacity duration-150 ease-out group-hover/chip:opacity-100 group-focus-within/chip:opacity-100 motion-reduce:transition-none`,"aria-hidden":!0}),t[8]=_):_=t[8];let v;t[9]!==a||t[10]!==p||t[11]!==h||t[12]!==g?(v=(0,f.jsxs)(c,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":p,onClick:a,onKeyDown:h,className:`group/remove relative size-3.5 shrink-0 rounded-sm text-muted-foreground/80 hover:text-foreground`,children:[g,_]}),t[9]=a,t[10]=p,t[11]=h,t[12]=g,t[13]=v):v=t[13];let b;t[14]===s?b=t[15]:(b=(0,f.jsx)(`span`,{className:`min-w-0 truncate`,children:s}),t[14]=s,t[15]=b);let x;return t[16]!==r||t[17]!==m||t[18]!==v||t[19]!==b?(x=(0,f.jsxs)(`span`,{"data-testid":m,title:r,className:`group/chip inline-flex max-w-[14rem] items-center gap-1 rounded-md border bg-muted/40 py-0.5 pr-1.5 pl-1 text-muted-foreground text-xs`,children:[v,b]}),t[16]=r,t[17]=m,t[18]=v,t[19]=b,t[20]=x):x=t[20],x}function x(e){let t=(0,d.c)(13),{files:n,onRemoveFile:r,className:i,children:a}=e,s;t[0]===n?s=t[1]:(s=n===void 0?[]:n,t[0]=n,t[1]=s);let c=s;if(c.length===0&&v.Children.toArray(a).length===0)return null;let l;t[2]===i?l=t[3]:(l=o(`flex flex-wrap items-center gap-1`,i),t[2]=i,t[3]=l);let u;if(t[4]!==c||t[5]!==r){let e;t[7]===r?e=t[8]:(e=e=>(0,f.jsx)(b,{path:e,onRemove:()=>r?.(e)},e),t[7]=r,t[8]=e),u=c.map(e),t[4]=c,t[5]=r,t[6]=u}else u=t[6];let p;return t[9]!==a||t[10]!==l||t[11]!==u?(p=(0,f.jsxs)(`div`,{className:l,"data-testid":`composer-context-chips`,children:[u,a]}),t[9]=a,t[10]=l,t[11]=u,t[12]=p):p=t[12],p}function S(){let e=(0,d.c)(2),[t,n]=(0,v.useState)(C),r,i;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{let e=window.matchMedia(`(prefers-reduced-motion: reduce)`);n(e.matches);let t=e=>n(e.matches);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,v.useEffect)(r,i),t}function C(){return typeof window<`u`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}var w=`ok-acp-follow-file-v1`;function T(){try{return localStorage.getItem(w)!==`0`}catch{return!0}}function E(e){try{localStorage.setItem(w,e?`1`:`0`)}catch{}}function D(e){return e===``||e.startsWith(`/`)||e.startsWith(`\\`)||e.split(`/`).some(e=>e===``||e.startsWith(`.`))?null:e}function O(e,t){let n=t.pathSeparator,r=e=>n===`\\`?e.replaceAll(`\\`,`/`):e,i=r(t.contentDir).replace(/\/$/,``),a=r(e);if(!a.startsWith(`${i}/`))return null;let o=a.slice(i.length+1),s=/\.(md|mdx)$/.exec(o);return s===null?null:D(o.slice(0,-s[0].length))}function k(e,t){let n=e[t];return typeof n==`string`&&n!==``?n:null}var A=new Set([`cat`,`ls`,`grep`,`rg`,`find`,`head`,`tail`,`wc`,`sort`,`uniq`,`cut`,`sed`,`awk`,`bat`,`less`,`more`]);function j(e,t){let n=[],r=/"([^"]*)"|'([^']*)'|(\S+)/g,i=r.exec(e);for(;i!==null;)n.push(i[1]??i[2]??i[3]??``),i=r.exec(e);let a=n[0];if(a===void 0||!A.has(a))return null;for(let e of n.slice(1)){if(e.startsWith(`-`)||/[*?[\]]/.test(e))continue;let n=/\.(md|mdx)$/i.exec(e);if(n===null)continue;if(e.startsWith(`/`)||/^[A-Za-z]:[\\/]/.test(e)){if(t!==null){let n=O(e,t);if(n!==null)return n}continue}let r=D(e.replace(/^\.\//,``).slice(0,-n[0].length));if(r!==null)return r}return null}function M(e){if(typeof e!=`object`||!e)return null;let t=e,n=k(t,`tool`)??k(t,`name`),r=t;if(typeof t.arguments==`object`&&t.arguments!==null)r=t.arguments;else if(typeof t.arguments==`string`)try{let e=JSON.parse(t.arguments);typeof e==`object`&&e&&(r=e)}catch{}return{tool:n,args:r}}function N(e,t,n,r){let i=M(e);if(i===null)return null;let{tool:a,args:o}=i;if(a===`delete`||a===null&&/\bdelete\b/i.test(t))return null;let s=typeof o.document==`object`&&o.document!==null?o.document:null,c=null;if(Array.isArray(o.documents))for(let e=o.documents.length-1;e>=0;e--){let t=o.documents[e];if(typeof t==`object`&&t){c=t;break}}let l=(s===null?null:k(s,`path`))??(c===null?null:k(c,`path`))??k(o,`to`)??k(o,`docName`);if(l!==null)return D(l.replace(/\.(md|mdx)$/,``));let u=k(o,`command`);if(u!==null){let e=j(u,n);return e!==null&&r.commandTargetExists!==void 0&&!r.commandTargetExists(e)?null:e}return null}function P(e,t,n={}){if(e.toolKind===`delete`)return null;let r=N(e.rawInput,e.title,t,n);if(r!==null)return r;if(t===null)return null;for(let n=e.locations.length-1;n>=0;n--){let r=e.locations[n];if(r===void 0)continue;let i=O(r.path,t);if(i!==null)return i}return null}function F(e,t,n={}){let r=null;for(let i of e){if(i.kind!==`tool_call`)continue;let e=P(i,t,n);e!==null&&(r=e)}return r}export{S as a,m as c,E as i,h as l,T as n,x as o,D as r,_ as s,F as t};