@inkeep/open-knowledge 0.50.0-beta.2 → 0.50.0-beta.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 (160) hide show
  1. package/dist/{acp-harness-probe-B2O8b7vV.mjs → acp-harness-probe-BL-kL5a3.mjs} +2 -2
  2. package/dist/cli.mjs +35 -35
  3. package/dist/constants-BsKxR1wP.mjs +2 -0
  4. package/dist/git-handle-Rma56ZDs.mjs +1 -0
  5. package/dist/{git-handle-Dxwd5VZx.mjs → git-handle-oaKkz-wn.mjs} +2 -2
  6. package/dist/index.d.mts +4 -4
  7. package/dist/index.mjs +1 -1
  8. package/dist/init-Dc-aeDeC.mjs +1 -0
  9. package/dist/{init-4ofrk0JJ.mjs → init-GU2008y6.mjs} +4 -4
  10. package/dist/{launch-json-removal-C9nV7D7y.mjs → launch-json-removal-CBvAsHwv.mjs} +2 -2
  11. package/dist/loader-BLWCSy5o.mjs +1 -0
  12. package/dist/{loader-CPqAK5Ri.mjs → loader-C07VPlQo.mjs} +2 -2
  13. package/dist/md-manager-wsrK03Vr.mjs +2 -0
  14. package/dist/{open-browser-BeG-Qyr0.mjs → open-browser-S-UcIs_h.mjs} +2 -2
  15. package/dist/parse-worker.mjs +1 -1
  16. package/dist/preview-DMl0bCHE.mjs +1 -0
  17. package/dist/{preview-D8ff_aYG.mjs → preview-JHv_lbF-.mjs} +2 -2
  18. package/dist/public/assets/{ActivityModeContent-tZoww6TE.js → ActivityModeContent-oK0Ukipq.js} +1 -1
  19. package/dist/public/assets/{AgentDiffPane-RQKV9x4r.js → AgentDiffPane-c-eXlgET.js} +1 -1
  20. package/dist/public/assets/{AgentThreadClientBinder-DcMbo1L-.js → AgentThreadClientBinder-BjgVrGGG.js} +1 -1
  21. package/dist/public/assets/{ChangedOutsideBadge-DDfgk0eX.js → ChangedOutsideBadge-Tm9eQzQd.js} +1 -1
  22. package/dist/public/assets/{CodeMirrorPropInput-CdGGv03H.js → CodeMirrorPropInput-D6Vpy6cC.js} +1 -1
  23. package/dist/public/assets/{DocumentContext-D4iAETgy.js → DocumentContext-BZs9wGsy.js} +10 -10
  24. package/dist/public/assets/{EditorModeToggle-Dz5xVGpy.js → EditorModeToggle-Dx-H0DAT.js} +1 -1
  25. package/dist/public/assets/{EnableSyncConfirmDialog-CLmAu8o9.js → EnableSyncConfirmDialog-Djkj66_G.js} +1 -1
  26. package/dist/public/assets/FeedbackForm-DK3Eafhu.js +1 -0
  27. package/dist/public/assets/{GraphPanel-D0ikjJ7b.js → GraphPanel-5y13eIH-.js} +1 -1
  28. package/dist/public/assets/ImportSkillDialog-BpbNmo53.js +1 -0
  29. package/dist/public/assets/{LintConfigEditor-Yk4196ji.js → LintConfigEditor-B8UqIDri.js} +1 -1
  30. package/dist/public/assets/ManagedArtifactProperties-BoQaa-VP.js +2 -0
  31. package/dist/public/assets/ManagedArtifactProperties-F3vbLcfn.js +1 -0
  32. package/dist/public/assets/{McpConsentDialogBody-CnYmnzCt.js → McpConsentDialogBody-DmSeUtFh.js} +1 -1
  33. package/dist/public/assets/{MermaidDocEditor-BimLfRlC.js → MermaidDocEditor-yGV5TYvo.js} +1 -1
  34. package/dist/public/assets/{ReportBugDialogBody-C-PxBPo3.js → ReportBugDialogBody-B0bj47YU.js} +1 -1
  35. package/dist/public/assets/{SchemaConfigEditor-PBcainDT.js → SchemaConfigEditor-OWVRrCyd.js} +1 -1
  36. package/dist/public/assets/{SessionsHost-BgdbnOid.js → SessionsHost-CldPPD2R.js} +2 -2
  37. package/dist/public/assets/SettingsDialogBody-B-5j1KKE.js +12 -0
  38. package/dist/public/assets/{ShareBranchSwitchDialog-E4sJceRx.js → ShareBranchSwitchDialog-295DE9n_.js} +1 -1
  39. package/dist/public/assets/{ShareReceiveDialog-CZ8wF8EG.js → ShareReceiveDialog-BbOB46ar.js} +1 -1
  40. package/dist/public/assets/{ShareReceiveMissDialog-Ff2iKkDU.js → ShareReceiveMissDialog-iz73ffK2.js} +1 -1
  41. package/dist/public/assets/{SkillEditBanner-LZDhvyzV.js → SkillEditBanner-C0motCdk.js} +1 -1
  42. package/dist/public/assets/{SkillOriginInline-CfZfwviY.js → SkillOriginInline-BKp-kWXv.js} +1 -1
  43. package/dist/public/assets/{SkillToolbarControls-BwnWrxnA.js → SkillToolbarControls-DnCihwAh.js} +1 -1
  44. package/dist/public/assets/{SlidesToolbarControls-B_tRlqt3.js → SlidesToolbarControls-CD_n21A3.js} +1 -1
  45. package/dist/public/assets/SourceEditor-BuOJMaXx.js +1 -0
  46. package/dist/public/assets/{TerminalPanel-DnS0vsLe.js → TerminalPanel-CLfRiG4p.js} +1 -1
  47. package/dist/public/assets/{TerminalWindowApp-B2fvTB6m.js → TerminalWindowApp-B2TPEGtR.js} +1 -1
  48. package/dist/public/assets/{TextDocEditor-CbIK48pc.js → TextDocEditor-DmN6Zt5R.js} +1 -1
  49. package/dist/public/assets/{ThreadView-C8wyEp28.js → ThreadView-Cn6Viupp.js} +1 -1
  50. package/dist/public/assets/{TimelineDiffPane-CDc4yUVO.js → TimelineDiffPane-DzMaO_MM.js} +1 -1
  51. package/dist/public/assets/{agent-diff-store-C8dyF7LO.js → agent-diff-store-CBfJPWXq.js} +1 -1
  52. package/dist/public/assets/auth-state-cache-DBVfH7MV.js +11 -0
  53. package/dist/public/assets/{client-version-Brtmi6Tl.js → client-version-BESEvZR7.js} +1 -1
  54. package/dist/public/assets/{comment-chips-CE2VnZuT.js → comment-chips-DYqcIz_E.js} +1 -1
  55. package/dist/public/assets/{config-provider-zCjx6lVk.js → config-provider-DAxeLK4k.js} +3 -3
  56. package/dist/public/assets/{dist-BBh-Rx_62.js → dist-D1vjmDZ_2.js} +150 -150
  57. package/dist/public/assets/{doc-paths-PNMXyOQj.js → doc-paths-v_LqWyej.js} +1 -1
  58. package/dist/public/assets/{documents-events-C930MM9G.js → documents-events-BVk5JL1j.js} +1 -1
  59. package/dist/public/assets/{file-tree-adapter-D0uVE8rS.js → file-tree-adapter-j4_0rR4k.js} +1 -1
  60. package/dist/public/assets/{file-tree-utils-D9c8Kaxh.js → file-tree-utils-ChaLadja.js} +1 -1
  61. package/dist/public/assets/{folder-config-api-DnXS5Q8-.js → folder-config-api-Cyxss03I.js} +1 -1
  62. package/dist/public/assets/{follow-file-DAC-ZC3M.js → follow-file-BMJH7ZWv.js} +1 -1
  63. package/dist/public/assets/globals-CyYdI-wx.css +1 -0
  64. package/dist/public/assets/i18n-CqChyNE3.js +1 -0
  65. package/dist/public/assets/{index-B9U39Y87.js → index-CJ9IqjVe.js} +108 -108
  66. package/dist/public/assets/{lint-config-client-Dnm7kl-A.js → lint-config-client-CN7WtJJN.js} +1 -1
  67. package/dist/public/assets/{markdownlint-rule-browser-DjTNNqKF.js → markdownlint-rule-browser-uB5xoBRt.js} +1 -1
  68. package/dist/public/assets/messages-BTQ6QHGD.js +1 -0
  69. package/dist/public/assets/messages-C1_vqjO0.js +1 -0
  70. package/dist/public/assets/messages-CcNmHSRm.js +1 -0
  71. package/dist/public/assets/messages-CuCFXL8u.js +1 -0
  72. package/dist/public/assets/messages-D-wGArHz.js +1 -0
  73. package/dist/public/assets/messages-DCORBVvf.js +1 -0
  74. package/dist/public/assets/messages-DK20PMTg.js +1 -0
  75. package/dist/public/assets/messages-DaaRRAol.js +1 -0
  76. package/dist/public/assets/messages-TrWXqll1.js +1 -0
  77. package/dist/public/assets/messages-_5gcf9E8.js +1 -0
  78. package/dist/public/assets/messages-l5kO2Bq5.js +1 -0
  79. package/dist/public/assets/{navigation-targets-hMP35CWp.js → navigation-targets-BmGfXtLg.js} +1 -1
  80. package/dist/public/assets/{open-managed-artifact-tab-BXbv1vZH.js → open-managed-artifact-tab-CFg9s1Dl.js} +1 -1
  81. package/dist/public/assets/{pending-receive-nav-store-BBGIBWy4.js → pending-receive-nav-store-By3F7IeX.js} +1 -1
  82. package/dist/public/assets/{prop-types-C8xSIHU7.js → prop-types-BUGU9oYX.js} +1 -1
  83. package/dist/public/assets/{receive-store-Dy9Hb1sU.js → receive-store-DQ2cxNlN.js} +1 -1
  84. package/dist/public/assets/{selection-context-CPtyx9WW.js → selection-context-Q2igplxe.js} +1 -1
  85. package/dist/public/assets/{skill-actions-mpV_nPtR.js → skill-actions-CBlHW4d_.js} +2 -2
  86. package/dist/public/assets/{skill-scope-q42erPyI.js → skill-scope-CLm-DjVO.js} +1 -1
  87. package/dist/public/assets/skills-api-Do-yD8Wd.js +1 -0
  88. package/dist/public/assets/{src-hzPGvn2R.js → src-rGs2GXpJ.js} +1 -1
  89. package/dist/public/assets/{tag-pill-input-KrIJOPkF.js → tag-pill-input-DLcAHAth.js} +1 -1
  90. package/dist/public/assets/{target-navigation-intent-BPFSqMEn.js → target-navigation-intent-AJHzhxLh.js} +1 -1
  91. package/dist/public/assets/{terminal-cli-display-BCPlwXFC.js → terminal-cli-display-DcmUJBJ0.js} +1 -1
  92. package/dist/public/assets/{terminal-launch-events-BDizFas3.js → terminal-launch-events-DL9JJPUH.js} +1 -1
  93. package/dist/public/assets/{terminal-telemetry-DGeT-gdl.js → terminal-telemetry-BaIL0R4h.js} +1 -1
  94. package/dist/public/assets/typing-burst-detector-CPW5PZdn.js +8 -0
  95. package/dist/public/assets/{uninstall-DSQiimxB.js → uninstall-DEqbq9oi.js} +1 -1
  96. package/dist/public/assets/{use-activity-panel-4WV0PNPB.js → use-activity-panel-HhWhJyPS.js} +1 -1
  97. package/dist/public/assets/{use-apply-config-color-theme-BT2P9Cg6.js → use-apply-config-color-theme-dRh7Xul9.js} +1 -1
  98. package/dist/public/assets/{use-collab-url-ByKwzGpm.js → use-collab-url-CtzTnNTo.js} +1 -1
  99. package/dist/public/assets/{use-live-xterm-theme-O1QzvrK2.js → use-live-xterm-theme-CEFo40Qe.js} +1 -1
  100. package/dist/public/assets/{use-open-skill-CqyjlzbO.js → use-open-skill-Cscl8Yx2.js} +1 -1
  101. package/dist/public/assets/use-popular-skills-Yh3HxWUQ.js +1 -0
  102. package/dist/public/assets/{use-settings-route-BvOZe32W.js → use-settings-route-BDWFTRtx.js} +1 -1
  103. package/dist/public/assets/{use-skill-origin-BWwJ-V8H.js → use-skill-origin-JUAmtC9e.js} +1 -1
  104. package/dist/public/assets/{use-skills-CCrPufi9.js → use-skills-BmTj83Vv.js} +1 -1
  105. package/dist/public/assets/{use-terminal-enabled-CPGBEBb0.js → use-terminal-enabled-BJe4ZzuL.js} +1 -1
  106. package/dist/public/assets/{use-timeline-entry-diff-BjX3mxut.js → use-timeline-entry-diff-BEA4Wm90.js} +4 -4
  107. package/dist/public/assets/{use-workspace-B4DagT1C.js → use-workspace-BJfeN9YT.js} +1 -1
  108. package/dist/public/index.html +47 -47
  109. package/dist/public/uninstall.html +6 -6
  110. package/dist/{repair-launch-json-D51ljyuu.mjs → repair-launch-json-Dnhl7E_E.mjs} +2 -2
  111. package/dist/{repair-mcp-configs-DayNzsuC.mjs → repair-mcp-configs-BTst6dOY.mjs} +2 -2
  112. package/dist/repair-skills-BmOui_rF.mjs +1 -0
  113. package/dist/{repair-skills-Dz6gjuVz.mjs → repair-skills-hf9Efmkp.mjs} +2 -2
  114. package/dist/{server-lock-_SrmIVon.mjs → server-lock-DEOF_T1n.mjs} +2 -2
  115. package/dist/server-lock-Rh5J9yH2.mjs +1 -0
  116. package/dist/{skill-teardown-N2at_ImB.mjs → skill-teardown-B7FIoHkS.mjs} +2 -2
  117. package/dist/{src-DVIrkd60.mjs → src-CDtgwazs.mjs} +2 -2
  118. package/dist/src-EOJBnmi7.mjs +1 -0
  119. package/dist/{src-DexEZ0uX.mjs → src-T22OxNCJ.mjs} +319 -319
  120. package/dist/src-f1gCZ4_a.mjs +1 -0
  121. package/dist/{src-BgYGdjBz.mjs → src-v83peLAF.mjs} +121 -121
  122. package/dist/{start-Rw1sV-cl.mjs → start-D1GiMBz1.mjs} +3 -3
  123. package/dist/start-DvQmqx2l.mjs +1 -0
  124. package/dist/{write-project-skill-DirISflr.mjs → write-project-skill-Ds6QPmhs.mjs} +4 -4
  125. package/package.json +4 -4
  126. package/dist/constants-DSWWdx8p.mjs +0 -2
  127. package/dist/git-handle-Bit5ywOl.mjs +0 -1
  128. package/dist/init-0d3ew4vm.mjs +0 -1
  129. package/dist/loader-AtToxX4x.mjs +0 -1
  130. package/dist/md-manager-DAm5uhV1.mjs +0 -2
  131. package/dist/preview-nbLafS3W.mjs +0 -1
  132. package/dist/public/assets/FeedbackForm-DnQ1QxLQ.js +0 -1
  133. package/dist/public/assets/ImportSkillDialog-BjcIqYkh.js +0 -1
  134. package/dist/public/assets/ManagedArtifactProperties-D4_7P1io.js +0 -2
  135. package/dist/public/assets/ManagedArtifactProperties-wYo67QNN.js +0 -1
  136. package/dist/public/assets/SettingsDialogBody-5ydE1HAX.js +0 -12
  137. package/dist/public/assets/SourceEditor-DU-zzoJo.js +0 -1
  138. package/dist/public/assets/auth-state-cache-C5lSklJm.js +0 -11
  139. package/dist/public/assets/globals-CIRDbOmQ.css +0 -1
  140. package/dist/public/assets/i18n-CGL69Msh.js +0 -1
  141. package/dist/public/assets/messages-52Q73NDn.js +0 -1
  142. package/dist/public/assets/messages-B-LUKCxb.js +0 -1
  143. package/dist/public/assets/messages-Bjt29O_q.js +0 -1
  144. package/dist/public/assets/messages-BzwBNPDu.js +0 -1
  145. package/dist/public/assets/messages-CGjveR2E.js +0 -1
  146. package/dist/public/assets/messages-CkanzrCR.js +0 -1
  147. package/dist/public/assets/messages-Cy75Ipbk.js +0 -1
  148. package/dist/public/assets/messages-D2UntltU.js +0 -1
  149. package/dist/public/assets/messages-D8H0FnV4.js +0 -1
  150. package/dist/public/assets/messages-Dl7JEKLk.js +0 -1
  151. package/dist/public/assets/messages-s-nrsPLp.js +0 -1
  152. package/dist/public/assets/skills-api-DxH6BgPG.js +0 -1
  153. package/dist/public/assets/typing-burst-detector-CFUTEwX8.js +0 -8
  154. package/dist/public/assets/use-skill-directory-CL-lJ_fc.js +0 -1
  155. package/dist/repair-skills-kKrHm4Sp.mjs +0 -1
  156. package/dist/server-lock-DLY6qJ31.mjs +0 -1
  157. package/dist/src-DDAV9cNj.mjs +0 -1
  158. package/dist/src-DJHJJDlb.mjs +0 -1
  159. package/dist/start-Rl1Y20eU.mjs +0 -1
  160. /package/dist/public/assets/{globals-C9aYStL7.js → globals-fH7sZOn9.js} +0 -0
@@ -1 +1 @@
1
- import{ka as e}from"./dist-BBh-Rx_62.js";function t(t){return e.includes(t)}function n(e){if(e.startsWith(_)||e.startsWith(x)||e.startsWith(S)||e.startsWith(T)||!e.startsWith(`#/`))return null;let t=e.slice(2),n=v(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(_)||!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}function a(e,t){return e===t||o(e)===o(t)}function o(e){try{return decodeURIComponent(e)}catch{return e}}var s=`__okHashHistoryEntry`;function c(e){return{...typeof e==`object`&&e?e:{},[s]:!0}}function l(e){return typeof e==`object`&&!!e&&e[s]===!0}function u(){l(window.history.state)||window.history.replaceState(c(window.history.state),``)}function d(e){let{pathname:t,search:n}=window.location;window.history.replaceState(c(window.history.state),``,`${t}${n}${e}`)}function f(e){if(a(window.location.hash,e))return;let{pathname:t,search:n}=window.location;window.history.pushState(c(window.history.state),``,`${t}${n}${e}`)}function p(e){return e.endsWith(`.mdx`)?e.slice(0,-4):e.endsWith(`.md`)?e.slice(0,-3):e}function m(e,t){let n=e.replace(/^\/+|\/+$/g,``),r=n?`#/${n}/`:`#/`;return t?`${r}#${encodeURIComponent(t)}`:r}function h(e,t,n){if(e===`folder`)return m(t);let r=`#/${encodeURIComponent(t)}`;return n==null||n===``?r:`${r}?branch=${encodeURIComponent(n)}`}function g(e){if(e===`#/`)return!0;if(!e.startsWith(`#/`))return!1;let t=e.slice(2);return t.length>0&&t[0]===`?`}var _=`#/__asset__/`;function v(e){let t=e.indexOf(`?`),n=e.indexOf(`#`);return t<0?n:n<0?t:Math.min(t,n)}function y(e){if(!e.startsWith(_))return null;let t=e.slice(12);if(!t)return null;try{return t.split(`/`).map(decodeURIComponent).join(`/`)}catch{return t}}function b(e){return`${_}${e.split(`/`).map(encodeURIComponent).join(`/`)}`}var x=`#/__skill-file__/`,S=`#/__skills__`;function C(){return S}function w(e){return e===S||e.startsWith(`${S}/`)}var T=`#/__skill-preview__/`,E=[`explore`,`detected`,`builtin`,`foreign`];function D(e){return e!==void 0&&E.includes(e)}var O=`project`;function k(e){return[e.flavor,e.source,e.name,e.subtitle,e.level??O].map(encodeURIComponent).join(`/`)}function A(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!D(r)||!i||!a?null:{flavor:r,source:i,name:a,subtitle:o??``,...s&&t(s)?{level:s}:{},...c?{path:c}:{}}}function j(e){let t=k(e);return e.path&&(t+=`/${encodeURIComponent(e.path)}`),`${T}${t}`}function M(e){return e.startsWith(T)?A(e.slice(20)):null}var N=`:`;function P(e){let t=e.host===void 0?e.name:`${e.name}${N}${e.host}`;return`${x}${[e.scope,t].map(encodeURIComponent).join(`/`)}/${e.path.split(`/`).map(encodeURIComponent).join(`/`)}`}function F(e){if(!e.startsWith(x))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(N),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 I=/\.(md|mdx)$/i;function L(e){return e.trim().replace(/^\.\/+/,``).replace(/^\/+/,``)}function R(e){return L(e).replace(I,``)}function z(e){let t=L(e);return t?I.test(t)?t:`${t}.md`:`untitled.md`}function B(e){let t=R(e),n=t.lastIndexOf(`/`);return{initialDir:n>0?t.slice(0,n):``,suggestedName:`${n>=0?t.slice(n+1):t||`untitled`}.md`}}export{M as C,F as S,g as _,y as a,f as b,h as c,b as d,i as f,C as g,j as h,r as i,k as l,P as m,z as n,A as o,m as p,R as r,n as s,B as t,p as u,a as v,w,d as x,u as y};
1
+ import{ka as e}from"./dist-D1vjmDZ_2.js";function t(t){return e.includes(t)}function n(e){if(e.startsWith(_)||e.startsWith(x)||e.startsWith(S)||e.startsWith(T)||!e.startsWith(`#/`))return null;let t=e.slice(2),n=v(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(_)||!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}function a(e,t){return e===t||o(e)===o(t)}function o(e){try{return decodeURIComponent(e)}catch{return e}}var s=`__okHashHistoryEntry`;function c(e){return{...typeof e==`object`&&e?e:{},[s]:!0}}function l(e){return typeof e==`object`&&!!e&&e[s]===!0}function u(){l(window.history.state)||window.history.replaceState(c(window.history.state),``)}function d(e){let{pathname:t,search:n}=window.location;window.history.replaceState(c(window.history.state),``,`${t}${n}${e}`)}function f(e){if(a(window.location.hash,e))return;let{pathname:t,search:n}=window.location;window.history.pushState(c(window.history.state),``,`${t}${n}${e}`)}function p(e){return e.endsWith(`.mdx`)?e.slice(0,-4):e.endsWith(`.md`)?e.slice(0,-3):e}function m(e,t){let n=e.replace(/^\/+|\/+$/g,``),r=n?`#/${n}/`:`#/`;return t?`${r}#${encodeURIComponent(t)}`:r}function h(e,t,n){if(e===`folder`)return m(t);let r=`#/${encodeURIComponent(t)}`;return n==null||n===``?r:`${r}?branch=${encodeURIComponent(n)}`}function g(e){if(e===`#/`)return!0;if(!e.startsWith(`#/`))return!1;let t=e.slice(2);return t.length>0&&t[0]===`?`}var _=`#/__asset__/`;function v(e){let t=e.indexOf(`?`),n=e.indexOf(`#`);return t<0?n:n<0?t:Math.min(t,n)}function y(e){if(!e.startsWith(_))return null;let t=e.slice(12);if(!t)return null;try{return t.split(`/`).map(decodeURIComponent).join(`/`)}catch{return t}}function b(e){return`${_}${e.split(`/`).map(encodeURIComponent).join(`/`)}`}var x=`#/__skill-file__/`,S=`#/__skills__`;function C(){return S}function w(e){return e===S||e.startsWith(`${S}/`)}var T=`#/__skill-preview__/`,E=[`explore`,`detected`,`builtin`,`foreign`];function D(e){return e!==void 0&&E.includes(e)}var O=`project`;function k(e){return[e.flavor,e.source,e.name,e.subtitle,e.level??O].map(encodeURIComponent).join(`/`)}function A(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!D(r)||!i||!a?null:{flavor:r,source:i,name:a,subtitle:o??``,...s&&t(s)?{level:s}:{},...c?{path:c}:{}}}function j(e){let t=k(e);return e.path&&(t+=`/${encodeURIComponent(e.path)}`),`${T}${t}`}function M(e){return e.startsWith(T)?A(e.slice(20)):null}var N=`:`;function P(e){let t=e.host===void 0?e.name:`${e.name}${N}${e.host}`;return`${x}${[e.scope,t].map(encodeURIComponent).join(`/`)}/${e.path.split(`/`).map(encodeURIComponent).join(`/`)}`}function F(e){if(!e.startsWith(x))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(N),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 I=/\.(md|mdx)$/i;function L(e){return e.trim().replace(/^\.\/+/,``).replace(/^\/+/,``)}function R(e){return L(e).replace(I,``)}function z(e){let t=L(e);return t?I.test(t)?t:`${t}.md`:`untitled.md`}function B(e){let t=R(e),n=t.lastIndexOf(`/`);return{initialDir:n>0?t.slice(0,n):``,suggestedName:`${n>=0?t.slice(n+1):t||`untitled`}.md`}}export{M as C,F as S,g as _,y as a,f as b,h as c,b as d,i as f,C as g,j as h,r as i,k as l,P as m,z as n,A as o,m as p,R as r,n as s,B as t,p as u,a as v,w,d as x,u as y};
@@ -1 +1 @@
1
- import{k as e}from"./dist-BBh-Rx_62.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-D1vjmDZ_2.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{Bo as e,Io as t,Po as n}from"./dist-BBh-Rx_62.js";import{d as r,f as i,p as a}from"./doc-paths-PNMXyOQj.js";import{t as o}from"./file-tree-rename-validation-Dt6fQYnB.js";import{c as s,l as c,s as l}from"./file-tree-utils-D9c8Kaxh.js";import{a as u}from"./navigation-targets-hMP35CWp.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)||t(e)||n(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{Fo as e,Lo as t,Vo as n}from"./dist-D1vjmDZ_2.js";import{d as r,f as i,p as a}from"./doc-paths-v_LqWyej.js";import{t as o}from"./file-tree-rename-validation-Dt6fQYnB.js";import{c as s,l as c,s as l}from"./file-tree-utils-ChaLadja.js";import{a as u}from"./navigation-targets-BmGfXtLg.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(n,r=v){return y.test(n)||t(n)||e(n)?n:`${n}${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,t){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:t.size};let a=r.startsWith(`.`)?r.slice(1):r;return{kind:`asset`,path:e,assetExt:a,mediaKind:n(a),modified:i,size:t.size}}function Q(e){let t=$(e),n=t.lastIndexOf(`/`),r=n===-1?t:t.slice(n+1);return e.endsWith(`/`)?`${r}/`:r}function $(e){return e.endsWith(`/`)?e.slice(0,-1):e}export{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{Cr as e,Ha as t,vr as n}from"./dist-BBh-Rx_62.js";function r(e){return e.kind===`asset`}function i(e){return e.kind===`document`}function a(e){return e.kind===`folder`}function o(e){let t=[],n=0;for(let r of e)switch(r.kind){case`document`:if(r.docName===void 0){n+=1;break}t.push({kind:`document`,docName:r.docName,docExt:r.docExt,size:r.size,modified:r.modified,isSymlink:r.isSymlink,canonicalDocName:r.canonicalDocName,targetPath:r.targetPath});break;case`asset`:if(r.path===void 0||r.assetExt===void 0){n+=1;break}t.push({kind:`asset`,path:r.path,assetExt:r.assetExt,mediaKind:r.mediaKind??null,size:r.size,modified:r.modified,referencedBy:r.referencedBy});break;case`file`:if(r.path===void 0){n+=1;break}t.push({kind:`asset`,path:r.path,assetExt:r.assetExt??s(r.path),mediaKind:null,size:r.size,modified:r.modified,referencedBy:[]});break;case`folder`:if(r.path===void 0){n+=1;break}t.push({kind:`folder`,path:r.path,size:r.size,modified:r.modified,hasChildren:r.hasChildren,isSymlink:r.isSymlink,targetPath:r.targetPath});break;default:r.kind;break}return n>0&&console.warn(`[file-tree-utils] dropped ${n} listing entries missing variant identity fields`),t}function s(e){let t=e.includes(`/`)?e.split(`/`).pop()??e:e,n=t.lastIndexOf(`.`);return n>0&&n<t.length-1?t.slice(n+1).toLowerCase():t.startsWith(`.`)&&t.length>1?t.slice(1).toLowerCase():`file`}function c(e){if(!e)return[];let t=e.split(`/`).filter(Boolean),n=[];for(let e=1;e<t.length;e++)n.push(t.slice(0,e).join(`/`));return n}function l(e){if(!e)return``;let t=e.lastIndexOf(`/`);return t>0?e.slice(0,t):``}function u(e){return e.split(`/`).some(e=>e.toLowerCase()===`.ok`)}function d(e,t){return t&&e!==`document`&&e!==`folder`}function f(e,t){return!t&&n(e)}function p(t,r={}){let{showHiddenFiles:i=!1,showOnlyMarkdownFiles:a=!1,showOkFolders:o=!1}=r;return t.filter(t=>{let r=t.docName??t.path??``;if(r===``||d(t.kind,a))return!1;let s=r.split(`/`),c=s.indexOf(`.ok`);if(c!==-1){if(!o)return!1;let e=s.slice(0,c).join(`/`);return i||e===``||!n(e)}return e(r)?!1:!f(r,i)})}function m(n,r={}){let{showHiddenFiles:i=!1,showOnlyMarkdownFiles:a=!1}=r,o=n.docName??n.path??``;return o===``||t(o)||e(o)||u(o)?{hiddenFiles:!1,onlyMarkdownFiles:!1}:{hiddenFiles:f(o,i),onlyMarkdownFiles:d(n.kind,a)}}function h(e){let{visibility:t={},unfilteredRootEntryCount:n,knownPageCount:r}=e;return(n>0||r>0)&&(t.showOnlyMarkdownFiles??!1)?`filtered-to-zero`:`true-empty`}export{p as a,i as c,o as d,l as i,a as l,h as n,u as o,c as r,r as s,m as t,s as u};
1
+ import{Cr as e,Ua as t,vr as n}from"./dist-D1vjmDZ_2.js";function r(e){return e.kind===`asset`}function i(e){return e.kind===`document`}function a(e){return e.kind===`folder`}function o(e){let t=[],n=0;for(let r of e)switch(r.kind){case`document`:if(r.docName===void 0){n+=1;break}t.push({kind:`document`,docName:r.docName,docExt:r.docExt,size:r.size,modified:r.modified,isSymlink:r.isSymlink,canonicalDocName:r.canonicalDocName,targetPath:r.targetPath});break;case`asset`:if(r.path===void 0||r.assetExt===void 0){n+=1;break}t.push({kind:`asset`,path:r.path,assetExt:r.assetExt,mediaKind:r.mediaKind??null,size:r.size,modified:r.modified,referencedBy:r.referencedBy});break;case`file`:if(r.path===void 0){n+=1;break}t.push({kind:`asset`,path:r.path,assetExt:r.assetExt??s(r.path),mediaKind:null,size:r.size,modified:r.modified,referencedBy:[]});break;case`folder`:if(r.path===void 0){n+=1;break}t.push({kind:`folder`,path:r.path,size:r.size,modified:r.modified,hasChildren:r.hasChildren,isSymlink:r.isSymlink,targetPath:r.targetPath});break;default:r.kind;break}return n>0&&console.warn(`[file-tree-utils] dropped ${n} listing entries missing variant identity fields`),t}function s(e){let t=e.includes(`/`)?e.split(`/`).pop()??e:e,n=t.lastIndexOf(`.`);return n>0&&n<t.length-1?t.slice(n+1).toLowerCase():t.startsWith(`.`)&&t.length>1?t.slice(1).toLowerCase():`file`}function c(e){if(!e)return[];let t=e.split(`/`).filter(Boolean),n=[];for(let e=1;e<t.length;e++)n.push(t.slice(0,e).join(`/`));return n}function l(e){if(!e)return``;let t=e.lastIndexOf(`/`);return t>0?e.slice(0,t):``}function u(e){return e.split(`/`).some(e=>e.toLowerCase()===`.ok`)}function d(e,t){return t&&e!==`document`&&e!==`folder`}function f(e,t){return!t&&n(e)}function p(t,r={}){let{showHiddenFiles:i=!1,showOnlyMarkdownFiles:a=!1,showOkFolders:o=!1}=r;return t.filter(t=>{let r=t.docName??t.path??``;if(r===``||d(t.kind,a))return!1;let s=r.split(`/`),c=s.indexOf(`.ok`);if(c!==-1){if(!o)return!1;let e=s.slice(0,c).join(`/`);return i||e===``||!n(e)}return e(r)?!1:!f(r,i)})}function m(n,r={}){let{showHiddenFiles:i=!1,showOnlyMarkdownFiles:a=!1}=r,o=n.docName??n.path??``;return o===``||t(o)||e(o)||u(o)?{hiddenFiles:!1,onlyMarkdownFiles:!1}:{hiddenFiles:f(o,i),onlyMarkdownFiles:d(n.kind,a)}}function h(e){let{visibility:t={},unfilteredRootEntryCount:n,knownPageCount:r}=e;return(n>0||r>0)&&(t.showOnlyMarkdownFiles??!1)?`filtered-to-zero`:`true-empty`}export{p as a,i as c,o as d,l as i,a as l,h as n,u as o,c as r,r as s,m as t,s as u};
@@ -1 +1 @@
1
- import{s as e}from"./documents-events-C930MM9G.js";import{t}from"./parse-api-error-Mgtc4OJu.js";import{t as n}from"./createLucideIcon-BcLKHslE.js";var r=n(`grip-vertical`,[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]);async function i(e){return t(await e.json().catch(()=>null))??`HTTP ${e.status}`}async function a(e,t){try{let n=await fetch(`/api/folder-config`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:e,frontmatter:t})});return n.ok?{ok:!0}:{ok:!1,error:await i(n)}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function o(t){try{let n=await fetch(`/api/template`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)});if(!n.ok)return{ok:!1,error:await i(n)};let r=await n.json().catch(()=>null);return e(),{ok:!0,created:r?.created??!1,warnings:r?.warnings??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function s(t,n){try{let r=`?folder=${encodeURIComponent(t)}&name=${encodeURIComponent(n)}`,a=await fetch(`/api/template${r}`,{method:`DELETE`});if(!a.ok)return{ok:!1,error:await i(a)};let o=await a.json().catch(()=>null);return e(),{ok:!0,existed:o?.existed??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function c(t){try{let n=await fetch(`/api/template`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)});if(!n.ok)return{ok:!1,error:await i(n)};let r=await n.json().catch(()=>null);return e(),{ok:!0,committed:r?.committed??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function l(t){try{let n=await fetch(`/api/template/import`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)});if(!n.ok)return{ok:!1,error:await i(n)};let r=await n.json().catch(()=>null);return e(),{ok:!0,path:r?.path??``,created:r?.created??!1,warnings:r?.warnings??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}export{o as a,a as i,l as n,r as o,c as r,s as t};
1
+ import{s as e}from"./documents-events-BVk5JL1j.js";import{t}from"./parse-api-error-Mgtc4OJu.js";import{t as n}from"./createLucideIcon-BcLKHslE.js";var r=n(`grip-vertical`,[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]);async function i(e){return t(await e.json().catch(()=>null))??`HTTP ${e.status}`}async function a(e,t){try{let n=await fetch(`/api/folder-config`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:e,frontmatter:t})});return n.ok?{ok:!0}:{ok:!1,error:await i(n)}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function o(t){try{let n=await fetch(`/api/template`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)});if(!n.ok)return{ok:!1,error:await i(n)};let r=await n.json().catch(()=>null);return e(),{ok:!0,created:r?.created??!1,warnings:r?.warnings??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function s(t,n){try{let r=`?folder=${encodeURIComponent(t)}&name=${encodeURIComponent(n)}`,a=await fetch(`/api/template${r}`,{method:`DELETE`});if(!a.ok)return{ok:!1,error:await i(a)};let o=await a.json().catch(()=>null);return e(),{ok:!0,existed:o?.existed??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function c(t){try{let n=await fetch(`/api/template`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)});if(!n.ok)return{ok:!1,error:await i(n)};let r=await n.json().catch(()=>null);return e(),{ok:!0,committed:r?.committed??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function l(t){try{let n=await fetch(`/api/template/import`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)});if(!n.ok)return{ok:!1,error:await i(n)};let r=await n.json().catch(()=>null);return e(),{ok:!0,path:r?.path??``,created:r?.created??!1,warnings:r?.warnings??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}export{o as a,a as i,l as n,r as o,c as r,s as t};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{sn as n}from"./DocumentContext-D4iAETgy.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-BXBsYPiB.js";import{t as u}from"./createLucideIcon-BcLKHslE.js";import{t as d}from"./x-D8xzRaMT.js";var f=u(`share-2`,[[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}],[`circle`,{cx:`6`,cy:`12`,r:`3`,key:`w7nqdw`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`line`,{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`,key:`47mynk`}],[`line`,{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`,key:`1n3mei`}]]),p=a(),m=t(),h=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 g(e){let t=(0,p.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(h({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,m.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 _(e){let t=(0,p.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,m.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 v=`button, a[href], [role="menuitem"], [role="button"], input, textarea, select, [contenteditable="true"]`;function y(e,t){e.target instanceof HTMLElement&&(!(e.currentTarget instanceof HTMLElement)||!e.currentTarget.contains(e.target)||e.target.closest(v)||(e.preventDefault(),t.current?.focus()))}var b=e(r(),1);function x(e){let t=e.lastIndexOf(`/`);return t>=0?e.slice(t+1):e}function S(e){let t=(0,p.c)(21),{path:r,onRemove:a}=e,{_:o}=i(),s,l;t[0]!==o||t[1]!==r?(s=x(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 u=l,f=`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,m.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,m.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,m.jsx)(d,{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]!==u||t[11]!==h||t[12]!==g?(v=(0,m.jsxs)(c,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":u,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]=u,t[11]=h,t[12]=g,t[13]=v):v=t[13];let y;t[14]===s?y=t[15]:(y=(0,m.jsx)(`span`,{className:`min-w-0 truncate`,children:s}),t[14]=s,t[15]=y);let b;return t[16]!==r||t[17]!==f||t[18]!==v||t[19]!==y?(b=(0,m.jsxs)(`span`,{"data-testid":f,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,y]}),t[16]=r,t[17]=f,t[18]=v,t[19]=y,t[20]=b):b=t[20],b}function C(e){let t=(0,p.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&&b.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,m.jsx)(S,{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 d;return t[9]!==a||t[10]!==l||t[11]!==u?(d=(0,m.jsxs)(`div`,{className:l,"data-testid":`composer-context-chips`,children:[u,a]}),t[9]=a,t[10]=l,t[11]=u,t[12]=d):d=t[12],d}function w(){let e=(0,p.c)(2),[t,n]=(0,b.useState)(T),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,b.useEffect)(r,i),t}function T(){return typeof window<`u`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function E(e,t){let n=e[t];return typeof n==`string`&&n!==``?n:null}function D(e){if(typeof e!=`object`||!e)return null;let t=e,n=E(t,`tool`)??E(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}}var O=`ok-acp-follow-file-v1`;function k(){try{return localStorage.getItem(O)!==`0`}catch{return!0}}function A(e){try{localStorage.setItem(O,e?`1`:`0`)}catch{}}function j(e){return e===``||e.startsWith(`/`)||e.startsWith(`\\`)||e.split(`/`).some(e=>e===``||e.startsWith(`.`))?null:e}function M(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:j(o.slice(0,-s[0].length))}var N=new Set([`cat`,`ls`,`grep`,`rg`,`find`,`head`,`tail`,`wc`,`sort`,`uniq`,`cut`,`sed`,`awk`,`bat`,`less`,`more`]);function P(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||!N.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=M(e,t);if(n!==null)return n}continue}let r=j(e.replace(/^\.\//,``).slice(0,-n[0].length));if(r!==null)return r}return null}function F(e){if(e===null||e.loading||e.error!==null)return{};let t=e.pages;return{docExists:e=>t.has(e)}}function I(e,t,n,r){let i=D(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:E(s,`path`))??(c===null?null:E(c,`path`))??E(o,`to`)??E(o,`docName`);if(l!==null)return j(l.replace(/\.(md|mdx)$/,``));let u=E(o,`command`);if(u!==null){let e=P(u,n);return e!==null&&r.docExists!==void 0&&!r.docExists(e)?null:e}return null}function L(e,t,n={}){if(e.toolKind===`delete`)return null;let r=I(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=M(a.path,t);if(o!==null)return i&&!n.docExists?.(o)?null:o}return null}var R={lastFollowed:null,yielded:!1,reArmed:!1};function z(e,t,n){if(e===null||n.lastFollowed===e)return{navigateTo:null,state:n};if(n.lastFollowed!==null&&t!==null&&t!==n.lastFollowed&&t!==e&&!n.reArmed)return{navigateTo:null,state:{...n,yielded:!0}};if(n.yielded&&!n.reArmed)return{navigateTo:null,state:n};let r={lastFollowed:e,yielded:!1,reArmed:!1};return t===e?{navigateTo:null,state:r}:{navigateTo:e,state:r}}function B(e,t,n={}){let r=null;for(let i of e){if(i.kind!==`tool_call`)continue;let e=L(i,t,n);e!==null&&(r=e)}return r}export{F as a,E as c,C as d,y as f,f as h,k as i,D as l,_ as m,z as n,j as o,g as p,B as r,A as s,R as t,w as u};
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{sn as n}from"./DocumentContext-BZs9wGsy.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-BXBsYPiB.js";import{t as u}from"./createLucideIcon-BcLKHslE.js";import{t as d}from"./x-D8xzRaMT.js";var f=u(`share-2`,[[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}],[`circle`,{cx:`6`,cy:`12`,r:`3`,key:`w7nqdw`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`line`,{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`,key:`47mynk`}],[`line`,{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`,key:`1n3mei`}]]),p=a(),m=t(),h=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 g(e){let t=(0,p.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(h({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,m.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 _(e){let t=(0,p.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,m.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 v=`button, a[href], [role="menuitem"], [role="button"], input, textarea, select, [contenteditable="true"]`;function y(e,t){e.target instanceof HTMLElement&&(!(e.currentTarget instanceof HTMLElement)||!e.currentTarget.contains(e.target)||e.target.closest(v)||(e.preventDefault(),t.current?.focus()))}var b=e(r(),1);function x(e){let t=e.lastIndexOf(`/`);return t>=0?e.slice(t+1):e}function S(e){let t=(0,p.c)(21),{path:r,onRemove:a}=e,{_:o}=i(),s,l;t[0]!==o||t[1]!==r?(s=x(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 u=l,f=`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,m.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,m.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,m.jsx)(d,{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]!==u||t[11]!==h||t[12]!==g?(v=(0,m.jsxs)(c,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":u,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]=u,t[11]=h,t[12]=g,t[13]=v):v=t[13];let y;t[14]===s?y=t[15]:(y=(0,m.jsx)(`span`,{className:`min-w-0 truncate`,children:s}),t[14]=s,t[15]=y);let b;return t[16]!==r||t[17]!==f||t[18]!==v||t[19]!==y?(b=(0,m.jsxs)(`span`,{"data-testid":f,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,y]}),t[16]=r,t[17]=f,t[18]=v,t[19]=y,t[20]=b):b=t[20],b}function C(e){let t=(0,p.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&&b.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,m.jsx)(S,{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 d;return t[9]!==a||t[10]!==l||t[11]!==u?(d=(0,m.jsxs)(`div`,{className:l,"data-testid":`composer-context-chips`,children:[u,a]}),t[9]=a,t[10]=l,t[11]=u,t[12]=d):d=t[12],d}function w(){let e=(0,p.c)(2),[t,n]=(0,b.useState)(T),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,b.useEffect)(r,i),t}function T(){return typeof window<`u`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function E(e,t){let n=e[t];return typeof n==`string`&&n!==``?n:null}function D(e){if(typeof e!=`object`||!e)return null;let t=e,n=E(t,`tool`)??E(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}}var O=`ok-acp-follow-file-v1`;function k(){try{return localStorage.getItem(O)!==`0`}catch{return!0}}function A(e){try{localStorage.setItem(O,e?`1`:`0`)}catch{}}function j(e){return e===``||e.startsWith(`/`)||e.startsWith(`\\`)||e.split(`/`).some(e=>e===``||e.startsWith(`.`))?null:e}function M(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:j(o.slice(0,-s[0].length))}var N=new Set([`cat`,`ls`,`grep`,`rg`,`find`,`head`,`tail`,`wc`,`sort`,`uniq`,`cut`,`sed`,`awk`,`bat`,`less`,`more`]);function P(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||!N.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=M(e,t);if(n!==null)return n}continue}let r=j(e.replace(/^\.\//,``).slice(0,-n[0].length));if(r!==null)return r}return null}function F(e){if(e===null||e.loading||e.error!==null)return{};let t=e.pages;return{docExists:e=>t.has(e)}}function I(e,t,n,r){let i=D(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:E(s,`path`))??(c===null?null:E(c,`path`))??E(o,`to`)??E(o,`docName`);if(l!==null)return j(l.replace(/\.(md|mdx)$/,``));let u=E(o,`command`);if(u!==null){let e=P(u,n);return e!==null&&r.docExists!==void 0&&!r.docExists(e)?null:e}return null}function L(e,t,n={}){if(e.toolKind===`delete`)return null;let r=I(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=M(a.path,t);if(o!==null)return i&&!n.docExists?.(o)?null:o}return null}var R={lastFollowed:null,yielded:!1,reArmed:!1};function z(e,t,n){if(e===null||n.lastFollowed===e)return{navigateTo:null,state:n};if(n.lastFollowed!==null&&t!==null&&t!==n.lastFollowed&&t!==e&&!n.reArmed)return{navigateTo:null,state:{...n,yielded:!0}};if(n.yielded&&!n.reArmed)return{navigateTo:null,state:n};let r={lastFollowed:e,yielded:!1,reArmed:!1};return t===e?{navigateTo:null,state:r}:{navigateTo:e,state:r}}function B(e,t,n={}){let r=null;for(let i of e){if(i.kind!==`tool_call`)continue;let e=L(i,t,n);e!==null&&(r=e)}return r}export{F as a,E as c,C as d,y as f,f as h,k as i,D as l,_ as m,z as n,j as o,g as p,B as r,A as s,R as t,w as u};