@inkeep/open-knowledge 0.52.4 → 0.52.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{acp-harness-probe-XTgNAWCH.mjs → acp-harness-probe-D8lWeMYs.mjs} +2 -2
- package/dist/cli.mjs +6 -6
- package/dist/constants-Cq9xPd4B.mjs +2 -0
- package/dist/index.mjs +1 -1
- package/dist/init-Bdkg_LMu.mjs +1 -0
- package/dist/{init-BLgGQUiA.mjs → init-DAp0k8pn.mjs} +3 -3
- package/dist/{launch-json-removal-BY0JfYzW.mjs → launch-json-removal-C1xPWBKL.mjs} +2 -2
- package/dist/loader-D6TvYuZR.mjs +1 -0
- package/dist/{loader-DFPCRuiv.mjs → loader-DEQaoLYB.mjs} +2 -2
- package/dist/preview-Bzc9OLIC.mjs +1 -0
- package/dist/{preview-BuOydejY.mjs → preview-CHL4RkuG.mjs} +2 -2
- package/dist/public/assets/{ActivityModeContent-82sBOezj.js → ActivityModeContent-DgOXZQPM.js} +1 -1
- package/dist/public/assets/{AgentDiffPane-CoeEE99v.js → AgentDiffPane-DxMmxvZ_.js} +1 -1
- package/dist/public/assets/{AgentThreadClientBinder-DoXKRY3h.js → AgentThreadClientBinder-Dr4KCMFV.js} +1 -1
- package/dist/public/assets/{ChangedOutsideBadge-D047_w8_.js → ChangedOutsideBadge-ChinF2OV.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-AfI-A739.js → CodeMirrorPropInput-BG6vAU3f.js} +1 -1
- package/dist/public/assets/{DocumentContext-RfseIiCK.js → DocumentContext-dF2iyDoR.js} +1 -1
- package/dist/public/assets/{EditorModeToggle-BFLOwOkQ.js → EditorModeToggle-v0ruFGAI.js} +1 -1
- package/dist/public/assets/{EnableSyncConfirmDialog-DrKJd8P_.js → EnableSyncConfirmDialog-CoTYoRIg.js} +1 -1
- package/dist/public/assets/FeedbackForm-hMBuqLQh.js +1 -0
- package/dist/public/assets/{GraphPanel-CIsyWZZL.js → GraphPanel-ovwXA2NQ.js} +1 -1
- package/dist/public/assets/{ImportSkillDialog-R8BKwyCS.js → ImportSkillDialog-C4hZ7UL5.js} +1 -1
- package/dist/public/assets/{LintConfigEditor-CMXHDFZF.js → LintConfigEditor-Qiz8julD.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-16Q3Ko9H.js +1 -0
- package/dist/public/assets/{ManagedArtifactProperties-BfpBSbt8.js → ManagedArtifactProperties-CNc3-2jZ.js} +1 -1
- package/dist/public/assets/{McpConsentDialogBody-D6qWh37S.js → McpConsentDialogBody-BSCT3OvM.js} +1 -1
- package/dist/public/assets/{MermaidDocEditor-DbdolXNy.js → MermaidDocEditor-C4p4uQqN.js} +1 -1
- package/dist/public/assets/{ReportBugDialogBody-0zuUulQL.js → ReportBugDialogBody-BicwB-J9.js} +1 -1
- package/dist/public/assets/{SchemaConfigEditor-rEKhSqJM.js → SchemaConfigEditor-D6hcCq89.js} +1 -1
- package/dist/public/assets/{SessionsHost-CGV_FZVZ.js → SessionsHost-OteEtmPR.js} +2 -2
- package/dist/public/assets/{SettingsDialogBody-DPjbScQ8.js → SettingsDialogBody-eShyjwp_.js} +1 -1
- package/dist/public/assets/{ShareBranchSwitchDialog-BHZw8v-i.js → ShareBranchSwitchDialog-DDrNzFpA.js} +1 -1
- package/dist/public/assets/{ShareReceiveDialog-CA7GkSOU.js → ShareReceiveDialog-CXNvnUuO.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-BVb9iCe7.js → ShareReceiveMissDialog-Bzfc6gmc.js} +1 -1
- package/dist/public/assets/{SkillEditBanner-Dc5M38zl.js → SkillEditBanner-BAS_3XLj.js} +1 -1
- package/dist/public/assets/{SkillOriginInline-B-wdZ-wi.js → SkillOriginInline-CLT-BIkT.js} +1 -1
- package/dist/public/assets/{SkillToolbarControls-B1VGCLbB.js → SkillToolbarControls-ChzkHlc2.js} +1 -1
- package/dist/public/assets/{SlidesToolbarControls-DpEF1_8n.js → SlidesToolbarControls-XPbdtH71.js} +1 -1
- package/dist/public/assets/{SourceEditor-BXsOQKW8.js → SourceEditor-GHoDb1-I.js} +1 -1
- package/dist/public/assets/{TerminalPanel-D4k0ePYg.js → TerminalPanel-DxlLFrrc.js} +1 -1
- package/dist/public/assets/{TerminalWindowApp-C1Ej4Kb1.js → TerminalWindowApp-CYIfwjHf.js} +1 -1
- package/dist/public/assets/{TextDocEditor-DxhziylX.js → TextDocEditor-DfWDVWNo.js} +1 -1
- package/dist/public/assets/{ThreadView-DlpPbPgC.js → ThreadView-CbGlUw2z.js} +1 -1
- package/dist/public/assets/{TimelineDiffPane-35Fhuse-.js → TimelineDiffPane-CPn64osU.js} +1 -1
- package/dist/public/assets/{agent-diff-store-BTtYfAZI.js → agent-diff-store-D6dVnd_h.js} +1 -1
- package/dist/public/assets/{auth-state-cache-j2uCE1rv.js → auth-state-cache-Cgyydfw6.js} +1 -1
- package/dist/public/assets/{client-version-UVydSM1_.js → client-version-CjhiC-Jt.js} +1 -1
- package/dist/public/assets/{comment-chips-CspvZbMA.js → comment-chips-msfGGi8U.js} +1 -1
- package/dist/public/assets/{config-provider-DAD08DXO.js → config-provider-D-VNxNBY.js} +1 -1
- package/dist/public/assets/{dist-CKFXiBrL.js → dist-8YlYwLg8.js} +1 -1
- package/dist/public/assets/{doc-paths-aGtYCY4p.js → doc-paths-78wumkT9.js} +1 -1
- package/dist/public/assets/{documents-events-BNjnUfCu.js → documents-events-DKMYe_0X.js} +1 -1
- package/dist/public/assets/{file-tree-adapter-BnKrzDCF.js → file-tree-adapter-CGtSLM3V.js} +1 -1
- package/dist/public/assets/{file-tree-utils-CPfKs0_W.js → file-tree-utils-CZ9kiPBg.js} +1 -1
- package/dist/public/assets/{folder-config-api-C00aXHgv.js → folder-config-api-fyPH9MBe.js} +1 -1
- package/dist/public/assets/{follow-file-ClUkwvTW.js → follow-file-BaVLq6cx.js} +1 -1
- package/dist/public/assets/i18n-gFEbQZNX.js +1 -0
- package/dist/public/assets/{index-DkaSwI0X.js → index-BSXrWulb.js} +8 -8
- package/dist/public/assets/{lint-config-client-CwpzRrsJ.js → lint-config-client-CedjssG2.js} +1 -1
- package/dist/public/assets/{markdownlint-rule-browser-DDivenan.js → markdownlint-rule-browser-BxyZeWyD.js} +1 -1
- package/dist/public/assets/{navigation-targets-BN-b0SwY.js → navigation-targets-BS-NLUXq.js} +1 -1
- package/dist/public/assets/{open-managed-artifact-tab-Dxiu79gQ.js → open-managed-artifact-tab-CVw5wiFN.js} +1 -1
- package/dist/public/assets/{pending-receive-nav-store-DTGiCG3P.js → pending-receive-nav-store-DyyFinN6.js} +1 -1
- package/dist/public/assets/{prop-types-RgJQCViX.js → prop-types-BKsu1Pla.js} +1 -1
- package/dist/public/assets/{receive-store-C7RBAUmu.js → receive-store-DbAkD4vm.js} +1 -1
- package/dist/public/assets/{selection-context-D_1ahjGj.js → selection-context-DJzHAfeZ.js} +1 -1
- package/dist/public/assets/{skill-actions-BKW-L6YY.js → skill-actions-ZS4T13Ax.js} +1 -1
- package/dist/public/assets/{skill-scope-D3fqbCKZ.js → skill-scope-CnsZQNOC.js} +1 -1
- package/dist/public/assets/{skills-api-BAB9Nk_K.js → skills-api-BYVWoHSe.js} +1 -1
- package/dist/public/assets/{src-Dfy4grTv.js → src-Kocvrol1.js} +1 -1
- package/dist/public/assets/{tag-pill-input-vgqgNkXB.js → tag-pill-input-CaySXFvi.js} +1 -1
- package/dist/public/assets/{target-navigation-intent-DEiFgbdU.js → target-navigation-intent-Djv7KQmO.js} +1 -1
- package/dist/public/assets/{terminal-cli-display-Du0YYwUl.js → terminal-cli-display-DghW2MNw.js} +1 -1
- package/dist/public/assets/{terminal-launch-events-C5JkD3Qb.js → terminal-launch-events-CBR70eGX.js} +1 -1
- package/dist/public/assets/{terminal-telemetry-Cj_uo6eX.js → terminal-telemetry-C1pBFgq5.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-vxYjrFWQ.js → typing-burst-detector-mfCCGiI2.js} +1 -1
- package/dist/public/assets/{uninstall-C6wmbgyN.js → uninstall-DtIVpzW8.js} +1 -1
- package/dist/public/assets/{use-activity-panel-DtCqiYlm.js → use-activity-panel-w209_TE7.js} +1 -1
- package/dist/public/assets/{use-apply-config-color-theme-DkVlJHc4.js → use-apply-config-color-theme-lxp6AFtt.js} +1 -1
- package/dist/public/assets/{use-collab-url-CpJYowg_.js → use-collab-url-B0illVqB.js} +1 -1
- package/dist/public/assets/{use-live-xterm-theme-DfHZqsch.js → use-live-xterm-theme-D4pfJFa6.js} +1 -1
- package/dist/public/assets/{use-open-skill-DdTYxJp4.js → use-open-skill-BF7e4PgL.js} +1 -1
- package/dist/public/assets/{use-popular-skills-C9TB91tU.js → use-popular-skills-D2yWnUy-.js} +1 -1
- package/dist/public/assets/{use-settings-route-D_8EQ_KO.js → use-settings-route-CSes8Uwx.js} +1 -1
- package/dist/public/assets/{use-skill-origin-BjB7AiHp.js → use-skill-origin-B7sZ5WC1.js} +1 -1
- package/dist/public/assets/{use-skills-DMV2hvXx.js → use-skills-BxzTRUh9.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-D2pvXg6e.js → use-terminal-enabled-DM8hVWf8.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-Do0ZBwge.js → use-timeline-entry-diff-DxEnQQVQ.js} +1 -1
- package/dist/public/assets/{use-workspace-e-krFmvC.js → use-workspace-DogmR2pu.js} +1 -1
- package/dist/public/index.html +44 -44
- package/dist/public/uninstall.html +3 -3
- package/dist/{repair-launch-json-BgwsX3Jx.mjs → repair-launch-json-Dl0Gey9L.mjs} +2 -2
- package/dist/{repair-mcp-configs-CcLsbctb.mjs → repair-mcp-configs-DvqxHaU5.mjs} +2 -2
- package/dist/{src-DtvO7rZS.mjs → src-DuQtFnj2.mjs} +2 -2
- package/dist/src-lASptBjy.mjs +1 -0
- package/dist/start-CXRN7Bpx.mjs +1 -0
- package/dist/{start-HJ61fNSx.mjs → start-DhG8qpNf.mjs} +2 -2
- package/package.json +5 -5
- package/dist/constants-DjzJQLPT.mjs +0 -2
- package/dist/init-DRq2NWqE.mjs +0 -1
- package/dist/loader-NVyWW4oJ.mjs +0 -1
- package/dist/preview-T7rJOVHM.mjs +0 -1
- package/dist/public/assets/FeedbackForm-CpyB0Ay7.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-CaU-7RSA.js +0 -1
- package/dist/public/assets/i18n-DnAdj3V4.js +0 -1
- package/dist/src-BAzYWv6h.mjs +0 -1
- package/dist/start-CTUHFYX2.mjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Qo as e,Xo as t,ns as n}from"./dist-
|
|
1
|
+
import{Qo as e,Xo as t,ns as n}from"./dist-8YlYwLg8.js";import{d as r,f as i,p as a}from"./doc-paths-78wumkT9.js";import{t as o}from"./file-tree-rename-validation-CCqiFGp1.js";import{c as s,l as c,s as l}from"./file-tree-utils-CZ9kiPBg.js";import{a as u}from"./navigation-targets-BS-NLUXq.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)||e(n)||t(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{Pr as e,io as t,kr as n}from"./dist-
|
|
1
|
+
import{Pr as e,io as t,kr as n}from"./dist-8YlYwLg8.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-
|
|
1
|
+
import{s as e}from"./documents-events-DKMYe_0X.js";import{t}from"./parse-api-error-DfesE4Y7.js";import{t as n}from"./createLucideIcon-Bhw2PmPp.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,4 +1,4 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{mn as n,pn as r,un as i}from"./DocumentContext-RfseIiCK.js";import{t as a}from"./react-f2sANaYj.js";import{r as o}from"./dist-Nvb76hAm.js";import{t as s}from"./compiler-runtime-BfE3aGVn.js";import{t as c}from"./utils-CPqDy6Hr.js";import{r as l,t as u}from"./button-CA0dewJJ.js";import{$ as d,H as f,J as p,V as m,f as h,l as g,q as _,tt as v,u as y}from"./CodeMirrorPropInput-AfI-A739.js";import{t as b}from"./separator-vdmCepR4.js";import{Gi as x,Hi as S,Mi as C,Ni as w,Pi as T,ca as E,fa as D,ji as O,ya as k}from"./dist-CKFXiBrL.js";import{t as A}from"./dist-DUfEoSbR.js";import{t as j}from"./workspace-paths-CKUFX0v6.js";import{t as M}from"./createLucideIcon-Bhw2PmPp.js";import{t as N}from"./x-DS57FvHW.js";var P=M(`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`}]]),F=s(),I=t(),L=l(`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 R(e){let t=(0,F.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=c(L({orientation:r}),n),t[4]=n,t[5]=r,t[6]=a):a=t[6];let o;return t[7]!==r||t[8]!==i||t[9]!==a?(o=(0,I.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]=o):o=t[10],o}function z(e){let t=(0,F.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,o;t[4]===n?o=t[5]:(o=c(`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]=o);let s;return t[6]!==a||t[7]!==r||t[8]!==o?(s=(0,I.jsx)(b,{"data-slot":`button-group-separator`,orientation:a,className:o,...r}),t[6]=a,t[7]=r,t[8]=o,t[9]=s):s=t[9],s}var B=e(a(),1),V=`ok-ask-ai-draft-v2`,H={doc:null,dismissed:!1};function U(){if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}var W=null,G=new Set;function K(e){if(e===null)return!0;let t=e.content;return!Array.isArray(t)||t.length===0?!0:t.every(e=>{let t=e.content;return!Array.isArray(t)||t.length===0})}function ee(){let e=U();if(!e)return H;try{let t=e.getItem(V);if(!t)return H;let n=JSON.parse(t);return typeof n!=`object`||!n||Array.isArray(n)?H:{doc:n,dismissed:!1}}catch(e){return console.warn(`failed to parse stored draft — clearing`,e),H}}function te(){return W===null&&(W=ee()),W}function ne(e){let t=U();if(t)try{e&&!K(e)?t.setItem(V,JSON.stringify(e)):t.removeItem(V)}catch{}}function re(){for(let e of G)e()}function ie(){return te()}function ae(e){let t=e&&!K(e)?e:null;W={...te(),doc:t},ne(t),re()}function oe(){ae(null)}var se=`button, a[href], [role="menuitem"], [role="button"], input, textarea, select, [contenteditable="true"]`;function ce(e,t){e.target instanceof HTMLElement&&(!(e.currentTarget instanceof HTMLElement)||!e.currentTarget.contains(e.target)||e.target.closest(se)||(e.preventDefault(),t.current?.focus()))}var le=O;function ue(e){let t=h(e).kind;return t===`folder`||t===`asset`?t:`page`}function de(e){let t=(0,F.c)(14),{items:n,query:r,selectedIndex:a,onSelect:s,loading:c,error:l,hasMore:u}=e,d=c===void 0?!1:c,f=l===void 0?!1:l,p=u===void 0?!1:u,{_:m}=o(),h=(0,B.useId)(),g=(0,B.useRef)(null),_,v;t[0]===a?(_=t[1],v=t[2]):(_=()=>{(g.current?.querySelectorAll(`[role="option"]`))?.item(a)?.scrollIntoView({block:`nearest`})},v=[a],t[0]=a,t[1]=_,t[2]=v),(0,B.useEffect)(_,v);let y=a>=0&&a<n.length?n[a]:null,b;return t[3]!==m||t[4]!==f||t[5]!==p||t[6]!==n||t[7]!==h||t[8]!==d||t[9]!==s||t[10]!==r||t[11]!==a||t[12]!==y?(b=(0,I.jsx)(`div`,{ref:g,className:`w-80 max-w-[min(28rem,90vw)] overflow-hidden rounded-lg border bg-popover p-1 text-popover-foreground shadow-md`,children:d?(0,I.jsx)(`p`,{className:`px-2 py-1.5 text-sm text-muted-foreground`,"aria-live":`polite`,children:m({id:`3m2GBo`})}):f?(0,I.jsx)(`p`,{className:`px-2 py-1.5 text-sm text-muted-foreground`,"aria-live":`assertive`,children:m({id:`weP6me`})}):n.length===0?(0,I.jsx)(`p`,{className:`px-2 py-1.5 text-sm text-muted-foreground`,"aria-live":`polite`,children:r.trim()===``?m({id:`0E9DR6`}):m({id:`yQyglE`})}):(0,I.jsxs)(`div`,{role:`listbox`,id:h,"aria-label":m({id:`05n5wS`}),tabIndex:-1,className:`max-h-64 overflow-y-auto subtle-scrollbar`,children:[(0,I.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,"aria-atomic":`true`,children:y?y.title:``}),n.map((e,t)=>{let n=t===a,r=ue(e.path),o=r===`folder`,c=o?`${e.path}/`:e.path;return(0,I.jsxs)(`button`,{id:`${h}-option-${t}`,type:`button`,role:`option`,"aria-selected":n,"data-active":n,"data-mention-kind":r,"data-testid":`composer-mention-option-${e.docName}`,className:`flex w-full items-start gap-2 rounded-md px-2 py-1.5 text-left ${n?`bg-accent text-accent-foreground`:``}`,onMouseDown:t=>{t.preventDefault(),s(e)},children:[(0,I.jsx)(i,{path:e.path,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),(0,I.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,I.jsxs)(`span`,{className:`flex items-baseline gap-1.5`,children:[(0,I.jsx)(`span`,{className:`truncate text-sm font-medium`,children:e.title}),o?(0,I.jsx)(`span`,{className:`shrink-0 text-[10px] font-medium uppercase tracking-wide text-muted-foreground`,children:m({id:`kNqMMd`})}):null]}),(0,I.jsx)(`span`,{className:`line-clamp-2 break-all text-xs text-muted-foreground`,children:c})]})]},e.docName)}),p?(0,I.jsx)(`div`,{className:`px-2 py-1 text-xs text-muted-foreground`,"aria-hidden":!0,children:m({id:`F1T9y_`})}):null]})}),t[3]=m,t[4]=f,t[5]=p,t[6]=n,t[7]=h,t[8]=d,t[9]=s,t[10]=r,t[11]=a,t[12]=y,t[13]=b):b=t[13],b}var fe=8,q=new k(`composerMentionSuggestion`);function pe(e){return e.kind===`asset`?e.docName.replace(/^\//,``):e.kind===`folder`?e.docName:j(e.docName)}var me=x.create({name:`doc`,topNode:!0,content:`paragraph+`}),he=x.create({name:`paragraph`,group:`block`,content:`inline*`,parseHTML(){return[{tag:`p`}]},renderHTML(){return[`p`,0]}}),ge=x.create({name:`text`,group:`inline`}),_e=x.create({name:`hardBreak`,group:`inline`,inline:!0,selectable:!1,parseHTML(){return[{tag:`br`}]},renderHTML(){return[`br`]},addKeyboardShortcuts(){return{"Shift-Enter":()=>this.editor.commands.insertContent({type:`hardBreak`})}}}),ve=S.create({name:`composerHistory`,addProseMirrorPlugins(){return[C(),D({"Mod-z":T,"Mod-y":w,"Shift-Mod-z":w})]}}),ye=x.create({name:`composerMention`,group:`inline`,inline:!0,atom:!0,selectable:!0,addAttributes(){return{path:{default:``},label:{default:``}}},parseHTML(){return[{tag:`span[data-composer-mention]`}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.label||e.attrs.path);return[`span`,E(t,{"data-composer-mention":String(e.attrs.path??``),class:`composer-mention-chip`}),`@${n}`]},renderText({node:e}){return`@${e.attrs.path}`},addNodeView(){return({node:e,editor:t,getPos:i})=>{let a=String(e.attrs.path??``),o=String(e.attrs.label||e.attrs.path),s=document.createElement(`span`);s.className=`composer-mention-chip group/mention`,s.setAttribute(`data-composer-mention`,a),s.title=o;let c=document.createElement(`button`);c.type=`button`,c.className=`composer-mention-icon`,c.setAttribute(`aria-label`,A._({id:`Xzy0s0`,values:{fullLabel:o}}));let l=document.createElement(`span`);l.className=`composer-mention-glyph composer-mention-glyph-icon`,l.setAttribute(`aria-hidden`,`true`),l.innerHTML=r(a),c.appendChild(l);let u=document.createElement(`span`);u.className=`composer-mention-glyph composer-mention-glyph-x`,u.setAttribute(`aria-hidden`,`true`),u.innerHTML=n(N),c.appendChild(u),c.addEventListener(`mousedown`,e=>e.preventDefault()),c.addEventListener(`click`,n=>{n.preventDefault();let r=typeof i==`function`?i():null;r!=null&&t.chain().focus().deleteRange({from:r,to:r+e.nodeSize}).run()}),s.appendChild(c);let d=document.createElement(`span`);return d.className=`composer-mention-label`,d.textContent=o,s.appendChild(d),{dom:s}}},addProseMirrorPlugins(){return[Se(this.editor)]}});function be(e){return[me,he,ge,_e,ve,ye,...e?.placeholder?[le.configure({placeholder:e.placeholder,showOnlyWhenEditable:!1})]:[]]}function xe(e=g){let t=[],n=!1,r=null,i=!1;return{snapshot(){return{loaded:n,error:i}},async getItems(a){if(!n){r||=e();try{t=await r,n=!0,i=!1}catch(e){console.error(`[composer-mention] failed to fetch pages`,e),t=[],i=!0}finally{r=null}}return y(t,a).map(e=>({docName:e.docName,title:e.title,path:pe(e)})).filter(e=>e.path!==``)},reset(){t=[],n=!1,r=null,i=!1}}}function Se(e){let t=xe();return _({editor:e,pluginKey:q,char:`@`,items:({query:e})=>t.getItems(e),command:({editor:e,range:t,props:n})=>{try{e.chain().focus().deleteRange(t).insertContent([{type:`composerMention`,attrs:{path:n.path,label:n.title}},{type:`text`,text:` `}]).run()}catch(e){console.error(`[composer-mention] insert failed`,{item:n,range:t},e)}},render:()=>{let e=null,n=null,r=0,i={popup:null,stopAutoUpdate:null},a=null,o=null,s=e=>{n?.command(e)},c=e=>{let n=e.items??[],{loaded:i,error:a}=t.snapshot();return{items:n,query:e.query??``,selectedIndex:r,onSelect:s,loading:!i&&!a,error:a,hasMore:n.length>=fe}},l=()=>{!e||!n||e.updateProps(c(n))};return{onBeforeStart(t){n=t,r=0;let s=m(()=>n,`composer-mention`);i.popup=s.popup,a=s.doPosition,o=s.reveal,e=new d(de,{props:c(t),editor:t.editor}),s.popup.appendChild(e.element),i.stopAutoUpdate=s.startAutoUpdate()},onStart(e){n=e,r=0,l(),o?.()},onUpdate(e){n=e,r=Math.min(r,Math.max(0,e.items.length-1)),l(),a?.()},onKeyDown({event:e}){if(!n)return!1;let t=n.items;if(e.key===`ArrowDown`)return t.length===0?!1:(r=(r+1)%t.length,l(),!0);if(e.key===`ArrowUp`)return t.length===0?!1:(r=(r-1+t.length)%t.length,l(),!0);if(e.key===`Enter`||e.key===`Tab`){let e=t[r];return e?(n.command(e),!0):!1}return!1},onExit(){f(i),a=null,o=null,e?.destroy(),e=null,n=null,r=0,t.reset()}}}})}function J(e){let t=[],n=new Set,r=[];return e.state.doc.forEach(e=>{let i=``;e.forEach(e=>{if(e.type.name===`composerMention`){let r=String(e.attrs.path??``);r!==``&&(i+=`@${r}`,n.has(r)||(n.add(r),t.push(r)))}else e.isText?i+=e.text??``:e.type.name===`hardBreak`&&(i+=`
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{mn as n,pn as r,un as i}from"./DocumentContext-dF2iyDoR.js";import{t as a}from"./react-f2sANaYj.js";import{r as o}from"./dist-Nvb76hAm.js";import{t as s}from"./compiler-runtime-BfE3aGVn.js";import{t as c}from"./utils-CPqDy6Hr.js";import{r as l,t as u}from"./button-CA0dewJJ.js";import{$ as d,H as f,J as p,V as m,f as h,l as g,q as _,tt as v,u as y}from"./CodeMirrorPropInput-BG6vAU3f.js";import{t as b}from"./separator-vdmCepR4.js";import{Gi as x,Hi as S,Mi as C,Ni as w,Pi as T,ca as E,fa as D,ji as O,ya as k}from"./dist-8YlYwLg8.js";import{t as A}from"./dist-DUfEoSbR.js";import{t as j}from"./workspace-paths-CKUFX0v6.js";import{t as M}from"./createLucideIcon-Bhw2PmPp.js";import{t as N}from"./x-DS57FvHW.js";var P=M(`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`}]]),F=s(),I=t(),L=l(`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 R(e){let t=(0,F.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=c(L({orientation:r}),n),t[4]=n,t[5]=r,t[6]=a):a=t[6];let o;return t[7]!==r||t[8]!==i||t[9]!==a?(o=(0,I.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]=o):o=t[10],o}function z(e){let t=(0,F.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,o;t[4]===n?o=t[5]:(o=c(`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]=o);let s;return t[6]!==a||t[7]!==r||t[8]!==o?(s=(0,I.jsx)(b,{"data-slot":`button-group-separator`,orientation:a,className:o,...r}),t[6]=a,t[7]=r,t[8]=o,t[9]=s):s=t[9],s}var B=e(a(),1),V=`ok-ask-ai-draft-v2`,H={doc:null,dismissed:!1};function U(){if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}var W=null,G=new Set;function K(e){if(e===null)return!0;let t=e.content;return!Array.isArray(t)||t.length===0?!0:t.every(e=>{let t=e.content;return!Array.isArray(t)||t.length===0})}function ee(){let e=U();if(!e)return H;try{let t=e.getItem(V);if(!t)return H;let n=JSON.parse(t);return typeof n!=`object`||!n||Array.isArray(n)?H:{doc:n,dismissed:!1}}catch(e){return console.warn(`failed to parse stored draft — clearing`,e),H}}function te(){return W===null&&(W=ee()),W}function ne(e){let t=U();if(t)try{e&&!K(e)?t.setItem(V,JSON.stringify(e)):t.removeItem(V)}catch{}}function re(){for(let e of G)e()}function ie(){return te()}function ae(e){let t=e&&!K(e)?e:null;W={...te(),doc:t},ne(t),re()}function oe(){ae(null)}var se=`button, a[href], [role="menuitem"], [role="button"], input, textarea, select, [contenteditable="true"]`;function ce(e,t){e.target instanceof HTMLElement&&(!(e.currentTarget instanceof HTMLElement)||!e.currentTarget.contains(e.target)||e.target.closest(se)||(e.preventDefault(),t.current?.focus()))}var le=O;function ue(e){let t=h(e).kind;return t===`folder`||t===`asset`?t:`page`}function de(e){let t=(0,F.c)(14),{items:n,query:r,selectedIndex:a,onSelect:s,loading:c,error:l,hasMore:u}=e,d=c===void 0?!1:c,f=l===void 0?!1:l,p=u===void 0?!1:u,{_:m}=o(),h=(0,B.useId)(),g=(0,B.useRef)(null),_,v;t[0]===a?(_=t[1],v=t[2]):(_=()=>{(g.current?.querySelectorAll(`[role="option"]`))?.item(a)?.scrollIntoView({block:`nearest`})},v=[a],t[0]=a,t[1]=_,t[2]=v),(0,B.useEffect)(_,v);let y=a>=0&&a<n.length?n[a]:null,b;return t[3]!==m||t[4]!==f||t[5]!==p||t[6]!==n||t[7]!==h||t[8]!==d||t[9]!==s||t[10]!==r||t[11]!==a||t[12]!==y?(b=(0,I.jsx)(`div`,{ref:g,className:`w-80 max-w-[min(28rem,90vw)] overflow-hidden rounded-lg border bg-popover p-1 text-popover-foreground shadow-md`,children:d?(0,I.jsx)(`p`,{className:`px-2 py-1.5 text-sm text-muted-foreground`,"aria-live":`polite`,children:m({id:`3m2GBo`})}):f?(0,I.jsx)(`p`,{className:`px-2 py-1.5 text-sm text-muted-foreground`,"aria-live":`assertive`,children:m({id:`weP6me`})}):n.length===0?(0,I.jsx)(`p`,{className:`px-2 py-1.5 text-sm text-muted-foreground`,"aria-live":`polite`,children:r.trim()===``?m({id:`0E9DR6`}):m({id:`yQyglE`})}):(0,I.jsxs)(`div`,{role:`listbox`,id:h,"aria-label":m({id:`05n5wS`}),tabIndex:-1,className:`max-h-64 overflow-y-auto subtle-scrollbar`,children:[(0,I.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,"aria-atomic":`true`,children:y?y.title:``}),n.map((e,t)=>{let n=t===a,r=ue(e.path),o=r===`folder`,c=o?`${e.path}/`:e.path;return(0,I.jsxs)(`button`,{id:`${h}-option-${t}`,type:`button`,role:`option`,"aria-selected":n,"data-active":n,"data-mention-kind":r,"data-testid":`composer-mention-option-${e.docName}`,className:`flex w-full items-start gap-2 rounded-md px-2 py-1.5 text-left ${n?`bg-accent text-accent-foreground`:``}`,onMouseDown:t=>{t.preventDefault(),s(e)},children:[(0,I.jsx)(i,{path:e.path,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),(0,I.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,I.jsxs)(`span`,{className:`flex items-baseline gap-1.5`,children:[(0,I.jsx)(`span`,{className:`truncate text-sm font-medium`,children:e.title}),o?(0,I.jsx)(`span`,{className:`shrink-0 text-[10px] font-medium uppercase tracking-wide text-muted-foreground`,children:m({id:`kNqMMd`})}):null]}),(0,I.jsx)(`span`,{className:`line-clamp-2 break-all text-xs text-muted-foreground`,children:c})]})]},e.docName)}),p?(0,I.jsx)(`div`,{className:`px-2 py-1 text-xs text-muted-foreground`,"aria-hidden":!0,children:m({id:`F1T9y_`})}):null]})}),t[3]=m,t[4]=f,t[5]=p,t[6]=n,t[7]=h,t[8]=d,t[9]=s,t[10]=r,t[11]=a,t[12]=y,t[13]=b):b=t[13],b}var fe=8,q=new k(`composerMentionSuggestion`);function pe(e){return e.kind===`asset`?e.docName.replace(/^\//,``):e.kind===`folder`?e.docName:j(e.docName)}var me=x.create({name:`doc`,topNode:!0,content:`paragraph+`}),he=x.create({name:`paragraph`,group:`block`,content:`inline*`,parseHTML(){return[{tag:`p`}]},renderHTML(){return[`p`,0]}}),ge=x.create({name:`text`,group:`inline`}),_e=x.create({name:`hardBreak`,group:`inline`,inline:!0,selectable:!1,parseHTML(){return[{tag:`br`}]},renderHTML(){return[`br`]},addKeyboardShortcuts(){return{"Shift-Enter":()=>this.editor.commands.insertContent({type:`hardBreak`})}}}),ve=S.create({name:`composerHistory`,addProseMirrorPlugins(){return[C(),D({"Mod-z":T,"Mod-y":w,"Shift-Mod-z":w})]}}),ye=x.create({name:`composerMention`,group:`inline`,inline:!0,atom:!0,selectable:!0,addAttributes(){return{path:{default:``},label:{default:``}}},parseHTML(){return[{tag:`span[data-composer-mention]`}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.label||e.attrs.path);return[`span`,E(t,{"data-composer-mention":String(e.attrs.path??``),class:`composer-mention-chip`}),`@${n}`]},renderText({node:e}){return`@${e.attrs.path}`},addNodeView(){return({node:e,editor:t,getPos:i})=>{let a=String(e.attrs.path??``),o=String(e.attrs.label||e.attrs.path),s=document.createElement(`span`);s.className=`composer-mention-chip group/mention`,s.setAttribute(`data-composer-mention`,a),s.title=o;let c=document.createElement(`button`);c.type=`button`,c.className=`composer-mention-icon`,c.setAttribute(`aria-label`,A._({id:`Xzy0s0`,values:{fullLabel:o}}));let l=document.createElement(`span`);l.className=`composer-mention-glyph composer-mention-glyph-icon`,l.setAttribute(`aria-hidden`,`true`),l.innerHTML=r(a),c.appendChild(l);let u=document.createElement(`span`);u.className=`composer-mention-glyph composer-mention-glyph-x`,u.setAttribute(`aria-hidden`,`true`),u.innerHTML=n(N),c.appendChild(u),c.addEventListener(`mousedown`,e=>e.preventDefault()),c.addEventListener(`click`,n=>{n.preventDefault();let r=typeof i==`function`?i():null;r!=null&&t.chain().focus().deleteRange({from:r,to:r+e.nodeSize}).run()}),s.appendChild(c);let d=document.createElement(`span`);return d.className=`composer-mention-label`,d.textContent=o,s.appendChild(d),{dom:s}}},addProseMirrorPlugins(){return[Se(this.editor)]}});function be(e){return[me,he,ge,_e,ve,ye,...e?.placeholder?[le.configure({placeholder:e.placeholder,showOnlyWhenEditable:!1})]:[]]}function xe(e=g){let t=[],n=!1,r=null,i=!1;return{snapshot(){return{loaded:n,error:i}},async getItems(a){if(!n){r||=e();try{t=await r,n=!0,i=!1}catch(e){console.error(`[composer-mention] failed to fetch pages`,e),t=[],i=!0}finally{r=null}}return y(t,a).map(e=>({docName:e.docName,title:e.title,path:pe(e)})).filter(e=>e.path!==``)},reset(){t=[],n=!1,r=null,i=!1}}}function Se(e){let t=xe();return _({editor:e,pluginKey:q,char:`@`,items:({query:e})=>t.getItems(e),command:({editor:e,range:t,props:n})=>{try{e.chain().focus().deleteRange(t).insertContent([{type:`composerMention`,attrs:{path:n.path,label:n.title}},{type:`text`,text:` `}]).run()}catch(e){console.error(`[composer-mention] insert failed`,{item:n,range:t},e)}},render:()=>{let e=null,n=null,r=0,i={popup:null,stopAutoUpdate:null},a=null,o=null,s=e=>{n?.command(e)},c=e=>{let n=e.items??[],{loaded:i,error:a}=t.snapshot();return{items:n,query:e.query??``,selectedIndex:r,onSelect:s,loading:!i&&!a,error:a,hasMore:n.length>=fe}},l=()=>{!e||!n||e.updateProps(c(n))};return{onBeforeStart(t){n=t,r=0;let s=m(()=>n,`composer-mention`);i.popup=s.popup,a=s.doPosition,o=s.reveal,e=new d(de,{props:c(t),editor:t.editor}),s.popup.appendChild(e.element),i.stopAutoUpdate=s.startAutoUpdate()},onStart(e){n=e,r=0,l(),o?.()},onUpdate(e){n=e,r=Math.min(r,Math.max(0,e.items.length-1)),l(),a?.()},onKeyDown({event:e}){if(!n)return!1;let t=n.items;if(e.key===`ArrowDown`)return t.length===0?!1:(r=(r+1)%t.length,l(),!0);if(e.key===`ArrowUp`)return t.length===0?!1:(r=(r-1+t.length)%t.length,l(),!0);if(e.key===`Enter`||e.key===`Tab`){let e=t[r];return e?(n.command(e),!0):!1}return!1},onExit(){f(i),a=null,o=null,e?.destroy(),e=null,n=null,r=0,t.reset()}}}})}function J(e){let t=[],n=new Set,r=[];return e.state.doc.forEach(e=>{let i=``;e.forEach(e=>{if(e.type.name===`composerMention`){let r=String(e.attrs.path??``);r!==``&&(i+=`@${r}`,n.has(r)||(n.add(r),t.push(r)))}else e.isText?i+=e.text??``:e.type.name===`hardBreak`&&(i+=`
|
|
2
2
|
`)}),r.push(i)}),{instruction:r.join(`
|
|
3
3
|
`).trim(),mentions:t}}function Y(e){let{instruction:t,mentions:n}=J(e);return t===``&&n.length===0}function Ce(e){let t=e?.content;return!Array.isArray(t)||t.length===0?!1:t.some(e=>Array.isArray(e.content)&&e.content.length>0)}function we(e){return e.split(`
|
|
4
4
|
`).map(e=>({type:`paragraph`,content:e===``?[]:[{type:`text`,text:e}]}))}function Te(e){let t=(0,F.c)(43),{ref:n,ariaLabel:r,onEmptyChange:i,onContentChange:a,onMentionsChange:o,onSubmit:s,onEscape:l,className:u,placeholder:d,initialDoc:f,disabled:m,testId:h}=e,g=m===void 0?!1:m,_=(0,B.useRef)(i),y=(0,B.useRef)(a),b=(0,B.useRef)(o),x=(0,B.useRef)(s),S=(0,B.useRef)(l),C;t[0]!==a||t[1]!==i||t[2]!==l||t[3]!==o||t[4]!==s?(C=()=>{_.current=i,y.current=a,b.current=o,x.current=s,S.current=l},t[0]=a,t[1]=i,t[2]=l,t[3]=o,t[4]=s,t[5]=C):C=t[5],(0,B.useEffect)(C);let w;t[6]===d?w=t[7]:(w=be({placeholder:d}),t[6]=d,t[7]=w);let T=f??void 0,E=!g,D;t[8]===h?D=t[9]:(D=h===void 0?{}:{"data-testid":h},t[8]=h,t[9]=D);let O;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(O=c(`composer-prosemirror py-1 outline-none`),t[10]=O):O=t[10];let k;t[11]!==r||t[12]!==D?(k={role:`textbox`,"aria-label":r,"aria-multiline":`true`,...D,class:O},t[11]=r,t[12]=D,t[13]=k):k=t[13];let A;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(A=(e,t)=>t.key===`Escape`?q.getState(e.state)?.active?!1:S.current===void 0?(e.dom.blur(),!0):(S.current(),!0):t.key===`Enter`&&!t.shiftKey&&!t.isComposing&&!e.composing?q.getState(e.state)?.active?!1:(x.current(),!0):!1,t[14]=A):A=t[14];let j;t[15]===k?j=t[16]:(j={attributes:k,handleKeyDown:A},t[15]=k,t[16]=j);let M;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(M=e=>{let{editor:t}=e;_.current(Y(t)),y.current?.(t.getJSON()),b.current?.(J(t).mentions)},t[17]=M):M=t[17];let N;t[18]!==j||t[19]!==w||t[20]!==T||t[21]!==E?(N={extensions:w,content:T,immediatelyRender:!0,editable:E,editorProps:j,onUpdate:M},t[18]=j,t[19]=w,t[20]=T,t[21]=E,t[22]=N):N=t[22];let P=v(N),L,R;t[23]!==r||t[24]!==P||t[25]!==d?(L=()=>{if(!P||P.isDestroyed)return;let e=P.extensionManager.extensions.find(Ee);e&&(e.options.placeholder=d??``);let t=P.editorView;t&&(t.dom.setAttribute(`aria-label`,r??``),t.dispatch(P.state.tr.setMeta(`addToHistory`,!1)))},R=[P,d,r],t[23]=r,t[24]=P,t[25]=d,t[26]=L,t[27]=R):(L=t[26],R=t[27]),(0,B.useEffect)(L,R);let z,V;t[28]!==g||t[29]!==P?(z=()=>{if(!P||P.isDestroyed)return;let e=!g;P.isEditable!==e&&P.setEditable(e,!1);let t=P.editorView;t&&(g?t.dom.setAttribute(`aria-disabled`,`true`):t.dom.removeAttribute(`aria-disabled`))},V=[P,g],t[28]=g,t[29]=P,t[30]=z,t[31]=V):(z=t[30],V=t[31]),(0,B.useEffect)(z,V);let H;t[32]!==P||t[33]!==f?(H=()=>{P&&(Y(P)&&Ce(f)&&(console.warn(`composer draft was incompatible with the current schema — clearing it`),oe()),_.current(Y(P)),b.current?.(J(P).mentions))},t[32]=P,t[33]=f,t[34]=H):H=t[34];let U;t[35]===P?U=t[36]:(U=[P],t[35]=P,t[36]=U),(0,B.useEffect)(H,U);let W,G;t[37]===P?(W=t[38],G=t[39]):(W=()=>({focus:()=>P?.commands.focus(),blur:()=>P?.commands.blur(),clear:()=>P?.commands.clearContent(!0),setText:e=>{P&&(P.commands.setContent(e),y.current?.(P.getJSON()),b.current?.(J(P).mentions))},appendText:e=>{!P||e===``||(Y(P)?P.commands.setContent(we(e)):P.commands.insertContentAt(P.state.doc.content.size,[{type:`paragraph`,content:[]},...we(e)]),_.current(Y(P)),y.current?.(P.getJSON()),b.current?.(J(P).mentions))},getContent:()=>P?J(P):{instruction:``,mentions:[]}}),G=[P],t[37]=P,t[38]=W,t[39]=G),(0,B.useImperativeHandle)(n,W,G);let K;return t[40]!==u||t[41]!==P?(K=(0,I.jsx)(p,{editor:P,className:u}),t[40]=u,t[41]=P,t[42]=K):K=t[42],K}function Ee(e){return e.name===`placeholder`}function De(e){let t=e.lastIndexOf(`/`);return t>=0?e.slice(t+1):e}function Oe(e){let t=(0,F.c)(21),{path:n,onRemove:r}=e,{_:a}=o(),s,c;t[0]!==a||t[1]!==n?(s=De(n),c=a({id:`hnq8fP`,values:{label:s}}),t[0]=a,t[1]=n,t[2]=s,t[3]=c):(s=t[2],c=t[3]);let l=c,d=`composer-context-chip-file-${n}`,f;t[4]===r?f=t[5]:(f=e=>{(e.key===`Backspace`||e.key===`Delete`)&&(e.preventDefault(),r())},t[4]=r,t[5]=f);let p;t[6]===n?p=t[7]:(p=(0,I.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,I.jsx)(i,{path:n,className:`size-3`,showExtensionBadge:!1})}),t[6]=n,t[7]=p);let m;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,I.jsx)(N,{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]=m):m=t[8];let h;t[9]!==r||t[10]!==l||t[11]!==f||t[12]!==p?(h=(0,I.jsxs)(u,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":l,onClick:r,onKeyDown:f,className:`group/remove relative size-3.5 shrink-0 rounded-sm text-muted-foreground/80 hover:text-foreground`,children:[p,m]}),t[9]=r,t[10]=l,t[11]=f,t[12]=p,t[13]=h):h=t[13];let g;t[14]===s?g=t[15]:(g=(0,I.jsx)(`span`,{className:`min-w-0 truncate`,children:s}),t[14]=s,t[15]=g);let _;return t[16]!==n||t[17]!==d||t[18]!==h||t[19]!==g?(_=(0,I.jsxs)(`span`,{"data-testid":d,title:n,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:[h,g]}),t[16]=n,t[17]=d,t[18]=h,t[19]=g,t[20]=_):_=t[20],_}function ke(e){let t=(0,F.c)(13),{files:n,onRemoveFile:r,className:i,children:a}=e,o;t[0]===n?o=t[1]:(o=n===void 0?[]:n,t[0]=n,t[1]=o);let s=o;if(s.length===0&&B.Children.toArray(a).length===0)return null;let l;t[2]===i?l=t[3]:(l=c(`flex flex-wrap items-center gap-1`,i),t[2]=i,t[3]=l);let u;if(t[4]!==s||t[5]!==r){let e;t[7]===r?e=t[8]:(e=e=>(0,I.jsx)(Oe,{path:e,onRemove:()=>r?.(e)},e),t[7]=r,t[8]=e),u=s.map(e),t[4]=s,t[5]=r,t[6]=u}else u=t[6];let d;return t[9]!==a||t[10]!==l||t[11]!==u?(d=(0,I.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 Ae(){let e=(0,F.c)(2),[t,n]=(0,B.useState)(je),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 je(){return typeof window<`u`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function X(e,t){let n=e[t];return typeof n==`string`&&n!==``?n:null}function Me(e){if(typeof e!=`object`||!e)return null;let t=e,n=X(t,`tool`)??X(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 Z=`ok-acp-follow-file-v1`;function Ne(){try{return localStorage.getItem(Z)!==`0`}catch{return!0}}function Pe(e){try{localStorage.setItem(Z,e?`1`:`0`)}catch{}}function Q(e){return e===``||e.startsWith(`/`)||e.startsWith(`\\`)||e.split(`/`).some(e=>e===``||e.startsWith(`.`))?null:e}function $(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:Q(o.slice(0,-s[0].length))}var Fe=new Set([`cat`,`ls`,`grep`,`rg`,`find`,`head`,`tail`,`wc`,`sort`,`uniq`,`cut`,`sed`,`awk`,`bat`,`less`,`more`]);function Ie(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||!Fe.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=$(e,t);if(n!==null)return n}continue}let r=Q(e.replace(/^\.\//,``).slice(0,-n[0].length));if(r!==null)return r}return null}function Le(e){if(e===null||e.loading||e.error!==null)return{};let t=e.pages;return{docExists:e=>t.has(e)}}function Re(e,t,n,r){let i=Me(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:X(s,`path`))??(c===null?null:X(c,`path`))??X(o,`to`)??X(o,`docName`);if(l!==null)return Q(l.replace(/\.(md|mdx)$/,``));let u=X(o,`command`);if(u!==null){let e=Ie(u,n);return e!==null&&r.docExists!==void 0&&!r.docExists(e)?null:e}return null}function ze(e,t,n={}){if(e.toolKind===`delete`)return null;let r=Re(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=$(a.path,t);if(o!==null)return i&&!n.docExists?.(o)?null:o}return null}var Be={lastFollowed:null,yielded:!1,reArmed:!1};function Ve(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 He(e,t,n={}){let r=null;for(let i of e){if(i.kind!==`tool_call`)continue;let e=ze(i,t,n);e!==null&&(r=e)}return r}export{ae as _,Le as a,P as b,X as c,ke as d,Te as f,ie as g,oe as h,Ne as i,Me as l,ce as m,Ve as n,Q as o,le as p,He as r,Pe as s,Be as t,Ae as u,R as v,z as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./dist-8YlYwLg8.js";import{t as e}from"./dist-DUfEoSbR.js";import{t}from"./messages-CT0uUq60.js";e.load(`en`,t.messages),e.activate(`en`);
|