@inkeep/open-knowledge 0.48.10 → 0.48.11

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 (120) hide show
  1. package/dist/{acp-harness-probe-CB-w5fVA.mjs → acp-harness-probe-D_rHo13p.mjs} +2 -2
  2. package/dist/cli.mjs +7 -7
  3. package/dist/constants-BA9qYvyG.mjs +2 -0
  4. package/dist/git-handle-CYRWHEh7.mjs +1 -0
  5. package/dist/{git-handle-DyGrpFVy.mjs → git-handle-DFxY8JnX.mjs} +2 -2
  6. package/dist/index.mjs +1 -1
  7. package/dist/{init-BVlkzsae.mjs → init-BNFsNnJ6.mjs} +3 -3
  8. package/dist/init-CODoOhiA.mjs +1 -0
  9. package/dist/{launch-json-removal-DDTniBQD.mjs → launch-json-removal-DYKkMpt-.mjs} +2 -2
  10. package/dist/loader-CX3djixw.mjs +1 -0
  11. package/dist/{loader-CG8cJCSI.mjs → loader-DDQVcyQh.mjs} +2 -2
  12. package/dist/md-manager-DZ8UJzkg.mjs +2 -0
  13. package/dist/{open-browser-DAPyP3Fq.mjs → open-browser-Y-oAEZKD.mjs} +2 -2
  14. package/dist/parse-worker.mjs +1 -1
  15. package/dist/preview-D5r7TRLB.mjs +1 -0
  16. package/dist/{preview-CZDRmrWy.mjs → preview-Mi5rv_ve.mjs} +2 -2
  17. package/dist/public/assets/{ActivityModeContent-BNAxhpQj.js → ActivityModeContent-DM85auEh.js} +1 -1
  18. package/dist/public/assets/{AgentDiffPane-D7Khwouf.js → AgentDiffPane-h6KbuLuM.js} +1 -1
  19. package/dist/public/assets/{AgentThreadClientBinder-daoer6rt.js → AgentThreadClientBinder-da1LL_SY.js} +1 -1
  20. package/dist/public/assets/{ChangedOutsideBadge-CazpgqWA.js → ChangedOutsideBadge-BmpjMsBE.js} +1 -1
  21. package/dist/public/assets/{CodeMirrorPropInput-B98kUaCj.js → CodeMirrorPropInput-dxOdghCh.js} +1 -1
  22. package/dist/public/assets/{DocumentContext-BeNSZPYG.js → DocumentContext-PLpWHjz2.js} +1 -1
  23. package/dist/public/assets/{EditorModeToggle-BbMlOgkn.js → EditorModeToggle-B2lAbc17.js} +1 -1
  24. package/dist/public/assets/{EnableSyncConfirmDialog-CQetlwTb.js → EnableSyncConfirmDialog-B1OWd9EE.js} +1 -1
  25. package/dist/public/assets/FeedbackForm-DsnazcCt.js +1 -0
  26. package/dist/public/assets/{GraphPanel-BlKaOmvl.js → GraphPanel-DrUa36aL.js} +1 -1
  27. package/dist/public/assets/{ImportSkillDialog-BgrlE-MX.js → ImportSkillDialog-DBhf_4tt.js} +1 -1
  28. package/dist/public/assets/{LintConfigEditor-Cno_iGzp.js → LintConfigEditor-C7GgNqOT.js} +1 -1
  29. package/dist/public/assets/ManagedArtifactProperties-CzM8sRZ4.js +1 -0
  30. package/dist/public/assets/{ManagedArtifactProperties-CM6O_XVV.js → ManagedArtifactProperties-Du9v7VLv.js} +1 -1
  31. package/dist/public/assets/{McpConsentDialogBody-NLB2A56E.js → McpConsentDialogBody-Bb5WPldg.js} +1 -1
  32. package/dist/public/assets/{MermaidDocEditor-_Gx5VJXW.js → MermaidDocEditor-B2xQC_96.js} +1 -1
  33. package/dist/public/assets/{ReportBugDialogBody-C9wKJMEr.js → ReportBugDialogBody-DRk-vjXN.js} +1 -1
  34. package/dist/public/assets/{SchemaConfigEditor-KkMUeDV5.js → SchemaConfigEditor-3MujKW7M.js} +1 -1
  35. package/dist/public/assets/{SessionsHost-B1nUk2DA.js → SessionsHost-DkXKT8Bg.js} +2 -2
  36. package/dist/public/assets/{SettingsDialogBody--nklwAG-.js → SettingsDialogBody-CJqsa6rI.js} +1 -1
  37. package/dist/public/assets/{ShareBranchSwitchDialog-DWmVoqtB.js → ShareBranchSwitchDialog-Dni3fO-b.js} +1 -1
  38. package/dist/public/assets/{ShareReceiveDialog-Deigdttj.js → ShareReceiveDialog-ARj0KHnK.js} +1 -1
  39. package/dist/public/assets/{ShareReceiveMissDialog-Bw2-qhvJ.js → ShareReceiveMissDialog-Rdeoo1uW.js} +1 -1
  40. package/dist/public/assets/{SkillEditBanner-B31-HMnN.js → SkillEditBanner-BMTobzfv.js} +1 -1
  41. package/dist/public/assets/{SkillOriginInline-OqQA2gy_.js → SkillOriginInline-BYqEAfJO.js} +1 -1
  42. package/dist/public/assets/{SkillToolbarControls-E6fzzRjO.js → SkillToolbarControls-ekEK8_iu.js} +1 -1
  43. package/dist/public/assets/{SourceEditor-DtuqTQRl.js → SourceEditor-CfXLQtgg.js} +1 -1
  44. package/dist/public/assets/{TerminalPanel-BElaeDzL.js → TerminalPanel-BT4fp_IY.js} +1 -1
  45. package/dist/public/assets/{TerminalWindowApp-4aKMdHr2.js → TerminalWindowApp-DWsGECA5.js} +1 -1
  46. package/dist/public/assets/{TextDocEditor-hb2f-OfN.js → TextDocEditor-Lnp5tcTc.js} +1 -1
  47. package/dist/public/assets/{ThreadView-w-Y9spIX.js → ThreadView-BisHrqpk.js} +1 -1
  48. package/dist/public/assets/{TimelineDiffPane-BLLl6THu.js → TimelineDiffPane-s3uGKXLB.js} +1 -1
  49. package/dist/public/assets/{agent-diff-store-CLtKPNmI.js → agent-diff-store-tHURoOQg.js} +1 -1
  50. package/dist/public/assets/{agent-visibility-Dz506quD.js → agent-visibility-Cpdu85yR.js} +1 -1
  51. package/dist/public/assets/{auth-state-cache-epurX430.js → auth-state-cache-DUWEUIEQ.js} +1 -1
  52. package/dist/public/assets/{client-version-C9zQ1Cba.js → client-version-DU6zzjSY.js} +1 -1
  53. package/dist/public/assets/{comment-chips-Da14zLsr.js → comment-chips-8dFO3T9v.js} +1 -1
  54. package/dist/public/assets/{config-context-DyUEqnhn.js → config-context-DUQ3IUYG.js} +1 -1
  55. package/dist/public/assets/{config-provider-NjnhDMPo.js → config-provider-B659_kp5.js} +1 -1
  56. package/dist/public/assets/{dist-DOPRKSzO2.js → dist-CxCCVMAj2.js} +152 -152
  57. package/dist/public/assets/{doc-paths-Dr8av3tc.js → doc-paths-D5q41Smp.js} +1 -1
  58. package/dist/public/assets/{documents-events-Cd-1x5Ed.js → documents-events-H5yX50zU.js} +1 -1
  59. package/dist/public/assets/{file-tree-adapter-DbXLXHhN.js → file-tree-adapter-bY2IgJTi.js} +1 -1
  60. package/dist/public/assets/{file-tree-utils-DfeUmuaf.js → file-tree-utils-BA7sWXkr.js} +1 -1
  61. package/dist/public/assets/{folder-config-api-C3YTmDwB.js → folder-config-api-DIkSxeBg.js} +1 -1
  62. package/dist/public/assets/{follow-file-DTOzoU1M.js → follow-file-BMtvM3LC.js} +1 -1
  63. package/dist/public/assets/{index-D3MPqma3.js → index--L671yxd.js} +7 -7
  64. package/dist/public/assets/{lint-config-client-CeUWUhyK.js → lint-config-client-Dxc9eTCn.js} +1 -1
  65. package/dist/public/assets/{markdownlint-rule-browser-DfPiRgim.js → markdownlint-rule-browser-BrP845kO.js} +1 -1
  66. package/dist/public/assets/{navigation-targets-DxC4QM5f.js → navigation-targets-BOddXVqk.js} +1 -1
  67. package/dist/public/assets/{open-managed-artifact-tab-DN3NM6Ff.js → open-managed-artifact-tab-Dmf8ibYA.js} +1 -1
  68. package/dist/public/assets/{pending-receive-nav-store-B4JTMHp-.js → pending-receive-nav-store-BT_62FW1.js} +1 -1
  69. package/dist/public/assets/{prop-types-BC9HEC35.js → prop-types-BKHWo79O.js} +1 -1
  70. package/dist/public/assets/{receive-store-BCddK7iB.js → receive-store-CnA3ZNCE.js} +1 -1
  71. package/dist/public/assets/{selection-context-CHSH5Ljn.js → selection-context-BcBbGype.js} +1 -1
  72. package/dist/public/assets/{skill-actions-GGPV2_FQ.js → skill-actions-wa9glOzI.js} +1 -1
  73. package/dist/public/assets/{skill-scope-CEtnfeg4.js → skill-scope-ByPD9jGU.js} +1 -1
  74. package/dist/public/assets/{skills-api-Bt6QqZxu.js → skills-api-CASzL--x.js} +1 -1
  75. package/dist/public/assets/{src-BtmmehSp.js → src-t7Eus2r6.js} +1 -1
  76. package/dist/public/assets/{tag-pill-input-DFIdRT0e.js → tag-pill-input-DegUWgEi.js} +1 -1
  77. package/dist/public/assets/{target-navigation-intent-2M1YK6Wd.js → target-navigation-intent-CiL48bjQ.js} +1 -1
  78. package/dist/public/assets/{terminal-launch-events-C2Gz2G0L.js → terminal-launch-events-aUowmXQB.js} +1 -1
  79. package/dist/public/assets/{terminal-telemetry-CS_Zz_F-.js → terminal-telemetry-B-3b1USB.js} +1 -1
  80. package/dist/public/assets/{typing-burst-detector-DKVkQeXL.js → typing-burst-detector-wI2Qegxz.js} +1 -1
  81. package/dist/public/assets/{uninstall-iZnahGQ3.js → uninstall-CHf6PWrM.js} +1 -1
  82. package/dist/public/assets/{use-activity-panel-B0DFdV4C.js → use-activity-panel-_dm8Md6u.js} +1 -1
  83. package/dist/public/assets/{use-collab-url-CMgoqd7H.js → use-collab-url-CZkvhvOU.js} +1 -1
  84. package/dist/public/assets/{use-live-xterm-theme-KGb9fc_e.js → use-live-xterm-theme-CQWGwN3R.js} +1 -1
  85. package/dist/public/assets/{use-open-skill-DhpKvkHk.js → use-open-skill-By3CcfFH.js} +1 -1
  86. package/dist/public/assets/{use-settings-route-ClTq87t7.js → use-settings-route-CqX06UAI.js} +1 -1
  87. package/dist/public/assets/{use-skill-directory-CLM2VHZh.js → use-skill-directory-B23W-S2y.js} +1 -1
  88. package/dist/public/assets/{use-skill-origin-DxVRIW_T.js → use-skill-origin-D4AI1_PK.js} +1 -1
  89. package/dist/public/assets/{use-skills-CDcSIIym.js → use-skills-CNWx7hdZ.js} +1 -1
  90. package/dist/public/assets/{use-terminal-enabled-DTsNSKJU.js → use-terminal-enabled-CgNhU4kg.js} +1 -1
  91. package/dist/public/assets/{use-timeline-entry-diff-Cj4GIfcv.js → use-timeline-entry-diff-Ddw7I-lf.js} +1 -1
  92. package/dist/public/assets/{use-workspace-BNdbTGXU.js → use-workspace-BgoyRZK_.js} +1 -1
  93. package/dist/public/index.html +43 -43
  94. package/dist/public/uninstall.html +2 -2
  95. package/dist/{repair-launch-json-DDkNs8yV.mjs → repair-launch-json-C3CZcBrw.mjs} +2 -2
  96. package/dist/{repair-mcp-configs-iUN_iUGe.mjs → repair-mcp-configs-CGog_bNF.mjs} +2 -2
  97. package/dist/{repair-skills-y_pZk48z.mjs → repair-skills-BEHylDaY.mjs} +2 -2
  98. package/dist/repair-skills-OJwbra_v.mjs +1 -0
  99. package/dist/server-lock-CjRizrkx.mjs +1 -0
  100. package/dist/{server-lock-DsDrc4RU.mjs → server-lock-D72pz8rW.mjs} +2 -2
  101. package/dist/{skill-teardown-DLiJoeFc.mjs → skill-teardown-BQErQ4B8.mjs} +2 -2
  102. package/dist/{src-DheM9mHj.mjs → src-C6bSdZgY.mjs} +4 -4
  103. package/dist/{src-DGg3BDMz.mjs → src-DNuZTDQn.mjs} +1 -1
  104. package/dist/{src-edjGsw9_.mjs → src-kFwg01Rz.mjs} +2 -2
  105. package/dist/{src-azBs1EPY.mjs → src-kQDLvgVC.mjs} +35 -35
  106. package/dist/{start-Drci_0Fq.mjs → start-D0L_PnNa.mjs} +3 -3
  107. package/dist/start-DNLjpvau.mjs +1 -0
  108. package/dist/{write-project-skill-DXCs8P98.mjs → write-project-skill-C8ZViZ1q.mjs} +2 -2
  109. package/package.json +5 -5
  110. package/dist/constants-iTnxIxio.mjs +0 -2
  111. package/dist/git-handle-CtdWfsLv.mjs +0 -1
  112. package/dist/init-CG2qmeVE.mjs +0 -1
  113. package/dist/loader-Bf89Jy7n.mjs +0 -1
  114. package/dist/md-manager-C54e9m9K.mjs +0 -2
  115. package/dist/preview-Bw6p_N8u.mjs +0 -1
  116. package/dist/public/assets/FeedbackForm-lhCUNLbD.js +0 -1
  117. package/dist/public/assets/ManagedArtifactProperties-DUFF_4AB.js +0 -1
  118. package/dist/repair-skills-DNC6qLQ6.mjs +0 -1
  119. package/dist/server-lock-BoNixvAi.mjs +0 -1
  120. package/dist/start-CMlQb6bV.mjs +0 -1
@@ -1 +1 @@
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
+ import{Sa as e}from"./dist-CxCCVMAj2.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-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
+ import{k as e}from"./dist-CxCCVMAj2.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{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};
1
+ import{Oo as e,So as t,wo as n}from"./dist-CxCCVMAj2.js";import{d as r,f as i,p as a}from"./doc-paths-D5q41Smp.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-BA7sWXkr.js";import{a as u}from"./navigation-targets-BOddXVqk.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};
@@ -1 +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
+ import{Fa as e,mr as t,yr as n}from"./dist-CxCCVMAj2.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-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
+ import{t as e}from"./createLucideIcon-BbgVV4EV.js";import{t}from"./parse-api-error-BFe1cdS7.js";import{s as n}from"./documents-events-H5yX50zU.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-BeNSZPYG.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(e===null||e.loading||e.error!==null)return{};let t=e.pages;return{docExists:e=>t.has(e)}}function N(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 P(e,t,n,r){let i=N(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.docExists!==void 0&&!r.docExists(e)?null:e}return null}function F(e,t,n={}){if(e.toolKind===`delete`)return null;let r=P(e.rawInput,e.title,t,n);if(r!==null)return r;if(t===null)return null;let i=e.toolKind!==`edit`&&e.toolKind!==`move`&&n.docExists!==void 0;for(let r=e.locations.length-1;r>=0;r--){let a=e.locations[r];if(a===void 0)continue;let o=O(a.path,t);if(o!==null)return i&&!n.docExists?.(o)?null:o}return null}function I(e,t,n={}){let r=null;for(let i of e){if(i.kind!==`tool_call`)continue;let e=F(i,t,n);e!==null&&(r=e)}return r}export{E as a,_ as c,D as i,m as l,T as n,S as o,M as r,x as s,I as t,h as u};
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{zn as n}from"./DocumentContext-PLpWHjz2.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(e===null||e.loading||e.error!==null)return{};let t=e.pages;return{docExists:e=>t.has(e)}}function N(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 P(e,t,n,r){let i=N(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.docExists!==void 0&&!r.docExists(e)?null:e}return null}function F(e,t,n={}){if(e.toolKind===`delete`)return null;let r=P(e.rawInput,e.title,t,n);if(r!==null)return r;if(t===null)return null;let i=e.toolKind!==`edit`&&e.toolKind!==`move`&&n.docExists!==void 0;for(let r=e.locations.length-1;r>=0;r--){let a=e.locations[r];if(a===void 0)continue;let o=O(a.path,t);if(o!==null)return i&&!n.docExists?.(o)?null:o}return null}function I(e,t,n={}){let r=null;for(let i of e){if(i.kind!==`tool_call`)continue;let e=F(i,t,n);e!==null&&(r=e)}return r}export{E as a,_ as c,D as i,m as l,T as n,S as o,M as r,x as s,I as t,h as u};