@inkeep/open-knowledge 0.25.0-beta.23 → 0.25.0-beta.24
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/assets/skills/discovery/SKILL.md +1 -1
- package/dist/assets/skills/project/SKILL.md +1 -1
- package/dist/cli.mjs +66 -66
- package/dist/constants-DVW-9MaB.mjs +2 -0
- package/dist/{dist-TG9U-N9P.mjs → dist-AG4Gq9ev.mjs} +7 -7
- package/dist/dist-BWUwqOdN.mjs +1 -0
- package/dist/{gh-detect-agW-_3XF.mjs → gh-detect-DD9zzsz3.mjs} +2 -2
- package/dist/index.d.mts +28 -1
- package/dist/index.mjs +1 -1
- package/dist/init-BLlGTkgO.mjs +1 -0
- package/dist/init-D3sweWsY.mjs +321 -0
- package/dist/{loader-CSvhwjWc.mjs → loader-C32u3Dvc.mjs} +3 -3
- package/dist/loader-bq73r__P.mjs +1 -0
- package/dist/preview-Bi4xON6m.mjs +1 -0
- package/dist/{preview-Ca2ZjZ3C.mjs → preview-DnAEOXGa.mjs} +2 -2
- package/dist/public/assets/{ActivityModeContent-Bq2-szSy.js → ActivityModeContent-BiGyPtzs.js} +1 -1
- package/dist/public/assets/{DocumentContext-Cp5LrwUt.js → DocumentContext-DzW0Hd8f.js} +1 -1
- package/dist/public/assets/{EnableSyncConfirmDialog-D6td4gmM.js → EnableSyncConfirmDialog-DjDTAYSx.js} +1 -1
- package/dist/public/assets/{GraphPanel-CzvW16mF.js → GraphPanel-BRea0zG5.js} +1 -1
- package/dist/public/assets/{ManagedArtifactProperties-7tx2h5fh.js → ManagedArtifactProperties-Bvb-RQEJ.js} +1 -1
- package/dist/public/assets/McpConsentDialogBody-C5k8PPDu.js +1 -0
- package/dist/public/assets/{PropertyPanel-BYMeaHwv.js → PropertyPanel-BL6tDKwT.js} +1 -1
- package/dist/public/assets/{SettingsDialogBody-C4TH7Apf.js → SettingsDialogBody-CqgTnPy8.js} +1 -1
- package/dist/public/assets/{ShareBranchSwitchDialog-CAYidTth.js → ShareBranchSwitchDialog-1U2vVhQb.js} +1 -1
- package/dist/public/assets/{ShareReceiveDialog-B_g3WoKU.js → ShareReceiveDialog-Dxk-LrDr.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-Bi8yB_Er.js → ShareReceiveMissDialog-Dr6VnJNL.js} +1 -1
- package/dist/public/assets/{SkillEditorActions-zGJNqarO.js → SkillEditorActions-BE4zpvxO.js} +1 -1
- package/dist/public/assets/{SourceEditor-z66BI1TW.js → SourceEditor-B76IS9B5.js} +1 -1
- package/dist/public/assets/{TerminalPanel-vd5LQunA.js → TerminalPanel-CuIUVEfX.js} +1 -1
- package/dist/public/assets/{auth-state-cache-CBnUAJVI.js → auth-state-cache-Dl3ZiBZL.js} +1 -1
- package/dist/public/assets/{config-provider-VM6ptPr5.js → config-provider-NM1p9Zm_.js} +1 -1
- package/dist/public/assets/{dist-BGXCkPeI.js → dist-BkxMNfFN.js} +1 -1
- package/dist/public/assets/{doc-hash-CyR3apuv.js → doc-hash-DYyNsXAD.js} +1 -1
- package/dist/public/assets/{documents-events-Bsq-Lwvc.js → documents-events-DFqHwl8q.js} +1 -1
- package/dist/public/assets/{file-tree-adapter-CI7t-Quy.js → file-tree-adapter-BarjCzXT.js} +1 -1
- package/dist/public/assets/{index-BuvV9Y-n.js → index-0Zv6gs2U.js} +7 -7
- package/dist/public/assets/{keyboard-shortcuts-BeQiNPv5.js → keyboard-shortcuts-DyCddAiu.js} +1 -1
- package/dist/public/assets/{open-managed-artifact-tab-C0CwefFo.js → open-managed-artifact-tab-D3bPW_N7.js} +1 -1
- package/dist/public/assets/{pending-receive-nav-store-BPFyzD9L.js → pending-receive-nav-store-CLwh-9nE.js} +1 -1
- package/dist/public/assets/{prop-types-DgIMu1uN.js → prop-types-BEZe0Mr0.js} +1 -1
- package/dist/public/assets/{receive-store-EKQrlEsf.js → receive-store-BZp1qikL.js} +1 -1
- package/dist/public/assets/{selection-context-B7L1o08O.js → selection-context-DDtYeIS_.js} +1 -1
- package/dist/public/assets/{skill-actions-BWXoXFJf.js → skill-actions-UwN9vpAE.js} +1 -1
- package/dist/public/assets/{skills-api-C8U58cr0.js → skills-api-CJJjd5CV.js} +1 -1
- package/dist/public/assets/{target-navigation-intent-D0W-SiFr.js → target-navigation-intent-B_RqIRfv.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-g8ADg4Q2.js → typing-burst-detector-8OH-dz6h.js} +1 -1
- package/dist/public/index.html +20 -20
- package/dist/{repair-launch-json-BdS0KA96.mjs → repair-launch-json-rZGx8Hlk.mjs} +2 -2
- package/dist/{repair-mcp-configs-YekheR94.mjs → repair-mcp-configs-Idc5CsVt.mjs} +2 -2
- package/dist/repair-skills-BJsTibpj.mjs +3 -0
- package/dist/repair-skills-DClA9KZj.mjs +1 -0
- package/dist/server-lock-LsXsWtim-BrcDoV-6.mjs +1 -0
- package/dist/{server-lock-ltHt39S2-FrJuEUby.mjs → server-lock-ltHt39S2-p0c2u2YF.mjs} +5 -5
- package/dist/{src-DVqpkZBo.mjs → src-ZKUfOXO5.mjs} +3 -3
- package/dist/start-CWAkTUKC.mjs +1 -0
- package/dist/{start-CxeFUd5x.mjs → start-DaZwGnwh.mjs} +2 -2
- package/dist/write-project-skill-DK3lBBLD.mjs +36 -0
- package/package.json +1 -1
- package/dist/constants-CzBmH11i.mjs +0 -2
- package/dist/dist-CDX3FPEf.mjs +0 -1
- package/dist/init-BXDoVLHF.mjs +0 -1
- package/dist/init-Cel6eyMR.mjs +0 -321
- package/dist/loader-Cv-fyaiJ.mjs +0 -1
- package/dist/preview-DF3xntXn.mjs +0 -1
- package/dist/public/assets/McpConsentDialogBody-BNMbefiw.js +0 -1
- package/dist/repair-skills-BEfm4X9B.mjs +0 -3
- package/dist/repair-skills-Bz8yC6_P.mjs +0 -1
- package/dist/server-lock-LsXsWtim-BLIrqdzC.mjs +0 -1
- package/dist/start-DxuxuT3n.mjs +0 -1
- package/dist/write-project-skill-qMcfR4xG.mjs +0 -36
|
@@ -525,4 +525,4 @@ Read more at https://docs.orama.com/docs/orama-js/plugins/plugin-secure-proxy#pl
|
|
|
525
525
|
`;return l.join(f)},table(e,t,n,r){let i=n.enter(`table`),a=[],o=[],s=e.children??[];for(let e of s){let t=e.children??[],i=[],s=[];for(let e of t){let t=n.enter(`tableCell`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,{...r,before:` `,after:` `});a(),t(),i.push(o);let c=e.data?.sourcePadding;s.push(c&&typeof c.left==`number`&&typeof c.right==`number`?{left:c.left,right:c.right}:null)}a.push(i),o.push(s)}i();let c=e.align??[],l=e.data?.sourceDashCounts,u=a[0]?.length??0,d=a.slice(1).reduce((e,t)=>Math.max(e,t.length),0),f=Math.max(u,d,c.length);if(f===0)return console.warn(JSON.stringify({event:`table-serialize-dropped-empty`,rows:s.length})),``;let p=[];for(let e=0;e<f;e++){let t=c[e],n=``,r=``;t===`center`?(n=`:`,r=`:`):t===`left`?n=`:`:t===`right`&&(r=`:`);let i=l?.[e],a=typeof i==`number`&&i>=1?i:1;p.push(n+`-`.repeat(a)+r)}let m=(e,t)=>{let n=[];for(let r=0;r<f;r++){let i=e[r]??``,a=t[r]??{left:1,right:1};n.push(` `.repeat(a.left)+i+` `.repeat(a.right))}let r=v&&!v.leading?``:`|`,i=v&&!v.trailing?``:`|`;return`${r}${n.join(`|`)}${i}`},h=e.data?.sourceAlignmentPadding,g=Array.from({length:f},(e,t)=>{let n=h?.[t];return n&&typeof n.left==`number`&&typeof n.right==`number`?n:null}),_=e.data?.sourceOuterPipes,v=_&&f>=2&&a.every(e=>{let t=(e[0]??``).trim(),n=(e[f-1]??``).trim();return(_.leading||t.length>0)&&(_.trailing||n.length>0&&!n.endsWith(`\\`))})?_:null;if(a.length===0)return m(p,g);let y=[];y.push(m(a[0],o[0]??[])),y.push(m(p,g));for(let e=1;e<a.length;e++)y.push(m(a[e],o[e]??[]));return y.join(`
|
|
526
526
|
`)},mdxJsxFlowElement(e,t,n,r){let i=e,a=i.data?.sourceRaw;if(typeof a==`string`)return a;let o=i.data?.htmlBoundary;if(o&&typeof o.opener==`string`&&typeof o.closer==`string`){let e=n.containerFlow({type:`root`,children:i.children??[]},r);return`${o.opener}\n\n${e}\n\n${o.closer}`}let s=i.name??``,c=m7(i.attributes??[]);return!i.children||i.children.length===0?s?c?`<${s} ${c} />`:`<${s} />`:``:une({...i,attributes:(i.attributes??[]).map(fne)},t,n,r)},mark(e,t,n,r){let i=n.createTracker(r),a=n.enter(`mark`),o=i.move(`==`);return o+=x7(n.containerPhrasing(e,{before:o,after:`==`,...i.current()}),r,`==`),o+=i.move(`==`),a(),o},comment(e,t,n,r){let i=e.data?.sourceForm,a=i===`html`?`<!-- `:`%%`,o=i===`html`?` -->`:`%%`,s=n.createTracker(r),c=n.enter(`comment`),l=s.move(a);return l+=n.containerPhrasing(e,{before:l,after:o,...s.current()}),l+=s.move(o),c(),l},commentBlock(e,t,n,r){let i=n.createTracker(r),a=n.enter(`commentBlock`),o=e.children??[],s=e.data?.sourceForm,c=e.data?.sourceLayout,l=o.length===1&&o[0]?.type===`paragraph`;if(s===`html`&&l){let e=o[0],t=n.containerPhrasing(e,{before:`<!-- `,after:` -->`,...i.current()});return a(),`<!-- ${t} -->`}if(c===`inline`&&l){let e=o[0],t=n.containerPhrasing(e,{before:`%% `,after:` %%`,...i.current()});return a(),`%% ${t} %%`}let u=n.containerFlow(e,i.current());return a(),`%%\n\n${u}\n\n%%`},mdxJsxTextElement(e){let t=e.data?.sourceRaw;if(typeof t==`string`)return t;let n=e.name??``,r=m7(e.attributes??[]);return r?`<${n} ${r} />`:`<${n}/>`},rawMdxFallback(e){return e.value??``},blockquote(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.containerFlow(e,a.current());i();let s=e.data?.sourceMarkerSpacings,c=0;return n.indentLines(o,(e,t,n)=>{if(n)return`>`;let r=s?.[c++];return r===`none`||r===0?`>${e}`:typeof r==`number`&&r>=2&&!e.startsWith(` `)?`>${` `.repeat(r)}${e}`:`> ${e}`})}};function m7(e){let t=[];for(let n of e){if(n.type===`mdxJsxExpressionAttribute`){t.push(`{${n.value}}`);continue}let e=n.name;if(n.value===null||n.value===void 0){t.push(e);continue}if(typeof n.value==`string`){n.value.includes(`"`)?t.push(`${e}={${h7(n.value)}}`):t.push(`${e}="${n.value}"`);continue}t.push(`${e}={${n.value.value}}`)}return t.join(` `)}function h7(e){return`"${e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}"`}function fne(e){return e.type===`mdxJsxAttribute`&&typeof e.value==`string`&&e.value.includes(`"`)?{type:`mdxJsxAttribute`,name:e.name,value:{type:`mdxJsxAttributeValueExpression`,value:h7(e.value)}}:e}function g7(e,t,n=` `){return t===`single`?`${n}'${e.replace(/'/g,`\\'`)}'`:t===`paren`?`${n}(${e.replace(/[()]/g,`\\$&`)})`:`${n}"${e.replace(/"/g,`\\"`)}"`}function _7(e){if(!e)return``;let t=0,n=!0;for(let r of e)r===`(`?t++:r===`)`&&(t--,t<0&&(n=!1));return t!==0&&(n=!1),n?e:e.replace(/[\\()]/g,`\\$&`)}function pne(e){return e.replace(/(?<!\\)&(?=(#[0-9]+|#[xX][0-9A-Fa-f]+|[A-Za-z][A-Za-z0-9]*);)/g,(e,t)=>mne(t)?e:`\\${e}`)}function mne(e){if(e.charCodeAt(0)!==35)return!1;let t=e[1]===`x`||e[1]===`X`?Number.parseInt(e.slice(2),16):Number.parseInt(e.slice(1),10);return t===9||t===10||t===11||t===12||t===13||t===32}function v7(e,t,n){let r=e.unsafe;e.unsafe=r.filter(e=>!(e.character===`&`&&e.after===`[#A-Za-z]`||e.character===`<`||e.character===`[`||e.character===`(`||e.character==="`"||(e.character===`*`||e.character===`_`||e.character===`~`)&&e.inConstruct===`phrasing`||e.character===`=`&&e.atBreak===!0||e.character===` `&&e.inConstruct===`phrasing`&&e.after===`[\\r\\n]`||e.character===` `&&e.inConstruct===`phrasing`&&e.after===`[\\r\\n]`));let i;try{i=e.safe(t,n)}finally{e.unsafe=r}return pne(vne(i,n))}var y7=1,hne=2;function b7(e){if(Number.isNaN(e))return`ws`;let t=az(e);return t===y7?`ws`:t===hne?`punct`:`other`}function gne(e,t,n){let r=b7(t),i=b7(n),a=i!==`ws`&&(i===`other`||r!==`other`),o=r!==`ws`&&(r===`other`||i!==`other`);return e===`_`?a&&(!o||r===`punct`)||o&&(!a||i===`punct`):a||o}function _ne(e,t,n){let r=t;for(;r<e.length&&(e[r]===` `||e[r]===` `);)r++;if(r<e.length)return e[r]===`
|
|
527
527
|
`||e[r]===`\r`;let i=n.after.charCodeAt(0);return Number.isNaN(i)||i===10||i===13}function vne(e,t){let n=``,r=0;for(;r<e.length;){let i=e.charAt(r);if(i===`\\`){n+=e.slice(r,r+2),r+=2;continue}if(i===`*`||i===`_`||i===`~`||i===`=`){let a=r+1;for(;a<e.length&&e.charAt(a)===i;)a++;let o=r===0?t.before.charCodeAt(t.before.length-1):e.charCodeAt(r-1);if(i===`=`)n+=(Number.isNaN(o)||o===10||o===13)&&_ne(e,a,t)?`\\${e.slice(r,a)}`:e.slice(r,a);else{let s=a<e.length?e.charCodeAt(a):t.after.charCodeAt(0);n+=gne(i,o,s)?`\\${i}`.repeat(a-r):e.slice(r,a)}r=a;continue}n+=i,r+=1}return n}function x7(e,t,n){let r=n.startsWith(`_`)?`_`:`*`,i=t.before??``,a=t.after??``,o=e,s=o.charCodeAt(0);S7(i.charCodeAt(i.length-1),s,r)&&(o=C7(s)+o.slice(1));let c=o.charCodeAt(o.length-1);return S7(a.charCodeAt(0),c,r)&&(o=o.slice(0,-1)+C7(c)),o}function S7(e,t,n){return!(az(t)!==y7||n===`_`&&az(e)===void 0)}function C7(e){return`&#x${e.toString(16).toUpperCase()};`}function yne(e,t,n,r){let i=e.value??``,a=e.data?.sourceDelimiter,o=typeof a==`string`&&/^\$+$/.test(a)?a.length:2;for(o===1&&!xne(i,r)&&(o=2);RegExp(`(^|[^$])${`\\$`.repeat(o)}([^$]|$)`).test(i);)o++;let s=`$`.repeat(o);/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^\$|\$$/.test(i))&&(i=` ${i} `);let c=-1;for(;++c<n.unsafe.length;){let e=n.unsafe[c];if(!e.atBreak)continue;let t=n.compilePattern(e),r;for(;(r=t.exec(i))!==null;){let e=r.index;i.codePointAt(e)===10&&i.codePointAt(e-1)===13&&e--,i=`${i.slice(0,e)} ${i.slice(r.index+1)}`}}return s+i+s}function bne(e,t,n,r){let i=e.data?.sourceDelimiter===`~`?`~`:`~~`,a=n.createTracker(r),o=n.enter(`strikethrough`),s=a.move(i);return s+=x7(n.containerPhrasing(e,{...a.current(),before:s,after:`~`}),r,i),s+=a.move(i),o(),s}function xne(e,t){return!(e.length===0||!/^\S/.test(e)||!/\S$/.test(e)||/[$\r\n]/.test(e)||e.endsWith(`\\`)||/\\[!-/:-@[-`{-~]/.test(e)||/^\d/.test(t.after)||t.before.endsWith(`\\`))}function w7(e){if(!Number.isFinite(e)||e<0)return``;if(e<1024)return`${e} B`;let t=[`KiB`,`MiB`,`GiB`,`TiB`],n=e/1024,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;return`${n.toFixed(1).replace(/\.0$/,``)} ${t[r]}`}var Sne=class{schema;handlers;pmNodeHandlers;pmMarkHandlers;parseProcessor;serializeProcessor;parseCtx={current:{}};constructor(e){this.schema=Tb(e.extensions),this.handlers=One(this.schema,this.parseCtx);let{nodeHandlers:t,markHandlers:n}=kne(this.schema);this.pmNodeHandlers=t,this.pmMarkHandlers=n,this.parseProcessor=$te({schema:this.schema,handlers:this.handlers,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers}),this.serializeProcessor=ene({toMarkdownHandlers:dne})}parse(e,t){if(!e.trim())return{type:`doc`,content:[{type:`paragraph`,content:[]}]};this.parseCtx.current=t??{};try{return nne(e,this.parseProcessor).toJSON()}finally{this.parseCtx.current={}}}parseToMdast(e){return e.trim()?rne(e,this.parseProcessor):{type:`root`,children:[]}}parseWithFallback(e,t){return e.trim()?$3(e,{parse:e=>this.parse(e,t)}):{type:`doc`,content:[{type:`paragraph`,content:[]}]}}serialize(e){let t;try{t=this.schema.nodeFromJSON(e)}catch(t){let n=`MarkdownManager.serialize() failed: schema rejected JSONContent (type=${e.type}, childCount=${e.content?.length??0})`;throw Error(n,{cause:t})}return ine(t,this.serializeProcessor,{schema:this.schema,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers})}},T7=A3();function Cne(e,t){let n=new Map;for(let e of t)n.set(e.name,e);let r={};for(let t of e){if(t.type===`mdxJsxExpressionAttribute`)continue;let e=t.name,i=n.get(e);if(t.value===null||t.value===void 0){r[e]=!0;continue}if(typeof t.value==`string`){if(i?.type===`number`){let n=Number(t.value);r[e]=Number.isNaN(n)?t.value:n}else i?.type===`boolean`?r[e]=t.value===`true`:r[e]=t.value;continue}let a=t.value.value;try{r[e]=JSON.parse(a)}catch{r[e]=a}}return r}function wne(e){let t=!1;return e.descendants(e=>t||e.type.name===`jsxInline`?!1:e.type.name===`jsxComponent`&&e.attrs.sourceDirty?(t=!0,!1):!0),t}function Tne(e){return e.attrs.sourceDirty||wne(e)}function Ene(e){if(e.type!==`paragraph`)return!1;let t=e.children??[];return t.length===0?!0:t.every(e=>e.type===`text`&&e.value===``)}function E7(e,t){if(!t)return e;let n={};return t.sourceFenceChar&&(n.sourceFenceChar=t.sourceFenceChar),typeof t.sourceFenceLength==`number`&&(n.sourceFenceLength=t.sourceFenceLength),t.sourcePadded===!0&&(n.sourcePadded=!0),Object.keys(n).length===0?e:{...e,data:n}}function D7(e,t){if(e.length===0)return E7({type:`inlineCode`,value:``},t);if(e.every(e=>e.type===`text`))return E7({type:`inlineCode`,value:e.map(e=>e.value).join(``)},t);if(e.length===1&&`children`in e[0]){let n=e[0];return{...n,children:[D7(n.children,t)]}}return E7({type:`inlineCode`,value:O7(e)},t)}function O7(e){let t=``;for(let n of e)n.type===`text`?t+=n.value:`children`in n&&Array.isArray(n.children)?t+=O7(n.children):`value`in n&&typeof n.value==`string`&&(t+=n.value);return t}var Dne=Fl;function One(e,t){let n=e.nodes,r=e.marks,i={};n.paragraph&&(i.paragraph=(e,t,r)=>{let i=r.all(e).flat(),a=i.some(e=>e?.isBlock&&!e?.isInline),o=i.some(e=>e?.isInline||e?.isText||e?.isTextblock);if(a&&!o)return i.length===1?i[0]:i;if(a&&o){let e=i.filter(e=>!e?.isBlock||e?.isInline),t=i.filter(e=>e?.isBlock&&!e?.isInline),r=[],a=n.paragraph.createAndFill(null,e.length>0?e:null);return a&&r.push(a),r.push(...t),r.length===1?r[0]:r}return n.paragraph.createAndFill(null,i.length>0?i:null)}),n.blockquote&&(i.blockquote=JU(n.blockquote,e=>({sourceMarkerSpacings:e.data?.sourceMarkerSpacings??null}))),n.tableCell&&(i.tableCell=(e=>(t,r,i)=>{let a=i.all(t).flat();if(a.length>0&&n.paragraph){let t=n.paragraph.create(null,a);return e.createAndFill(null,[t])}return e.createAndFill(null,null)})(n.tableCell)),n.tableRow&&(i.tableRow=JU(n.tableRow)),n.table&&n.tableRow&&n.tableCell&&(i.table=(e,t,r)=>{let i=e.align??[],a=e.children??[],o=[];for(let e=0;e<a.length;e++){let t=a[e];if(t.type!==`tableRow`)continue;let s=t.children??[],c=[];for(let t=0;t<s.length;t++){let a=s[t];if(a.type!==`tableCell`)continue;let o=r.all(a).flat(),l=o.length>0&&n.paragraph?[n.paragraph.create(null,o)]:null,u=i[t]??null,d=e===0&&n.tableHeader?n.tableHeader:n.tableCell,f=a.data?.sourcePadding??null,p=d.createAndFill({align:u,sourcePadding:f},l);p&&c.push(p)}let l=n.tableRow.createAndFill(null,c.length>0?c:null);l&&o.push(l)}let s=e.data?.sourceDashCounts??null,c=e.data?.sourceOuterPipes??null,l=e.data?.sourceAlignmentPadding??null;return n.table.createAndFill({sourceDashCounts:s,sourceOuterPipes:c,sourceAlignmentPadding:l},o.length>0?o:null)}),n.image&&(i.image=e=>{let r=e.url??``,i=p7(r,t.current.sourcePath);return n.image.createAndFill({src:i,alt:e.alt??null,title:e.title??null,sourceUrl:i===r?null:r})},n.imageReference?i.imageReference=e=>n.imageReference.createAndFill({alt:e.alt??``,label:e.label??e.identifier??``,identifier:e.identifier??``,referenceType:e.referenceType??`shortcut`}):i.imageReference=e=>n.image.createAndFill({src:``,alt:e.alt??null,title:null})),r.escapeMark&&(i.text=t=>{let n=t.value??``,i=typeof t.data?.sourceRaw==`string`?t.data.sourceRaw:null;if(!n&&!i)return null;if(i){let t=n.replaceAll(`\xA0`,` `);return r.sourceLiteral?e.text(t,[r.sourceLiteral.create({sourceRaw:i})]):e.text(t)}let a=t.data?.escapedChars,o=t.data?.entityRefSpans;if(!a?.length&&!o?.length)return e.text(n.replaceAll(`\xA0`,` `));let s=[...(a??[]).map(e=>({kind:`escape`,offset:e.offset,length:1})),...(o??[]).map(e=>({kind:`entity`,offset:e.offset,length:e.length,raw:e.raw}))];s.sort((e,t)=>e.offset-t.offset);let c=[];for(let e of s){let t=c[c.length-1];e.kind===`entity`&&t?.kind===`entity`&&t.offset+t.length===e.offset&&V1(t.raw)!==null&&R1(e.raw)?c[c.length-1]={kind:`entity`,offset:t.offset,length:t.length+e.length,raw:t.raw+e.raw}:c.push(e)}let l=[],u=0;for(let t of c){if(t.offset>u){let r=n.slice(u,t.offset).replaceAll(`\xA0`,` `);r&&l.push(e.text(r))}if(t.offset<n.length){let i=n.slice(t.offset,t.offset+t.length).replaceAll(`\xA0`,` `);if(i)if(t.kind===`escape`)l.push(e.text(i,[r.escapeMark.create()]));else if(r.sourceLiteral){let n=V1(t.raw);l.push(e.text(n??i,[r.sourceLiteral.create({sourceRaw:t.raw})]))}else l.push(e.text(i));u=t.offset+t.length}}if(u<n.length){let t=n.slice(u).replaceAll(`\xA0`,` `);t&&l.push(e.text(t))}return l.length===1?l[0]:l}),r.code&&(i.inlineCode=t=>e.text(t.value,[r.code.create({sourceFenceChar:t.data?.sourceFenceChar??"`",sourceFenceLength:typeof t.data?.sourceFenceLength==`number`?t.data.sourceFenceLength:1,sourcePadded:t.data?.sourcePadded===!0})]));let a=r.strike??r.delete;if(a&&(i.delete=YU(a,e=>({sourceDelimiter:e.data?.sourceDelimiter===`~`?`~`:`~~`}))),r.highlight&&(i.mark=YU(r.highlight)),r.comment&&(i.comment=YU(r.comment,e=>({sourceForm:e.data?.sourceForm??`percent`}))),n.commentBlock&&(i.commentBlock=JU(n.commentBlock,e=>({sourceForm:e.data?.sourceForm??`percent`,sourceLayout:e.data?.sourceLayout??`block`}))),r.emphasis&&(i.emphasis=YU(r.emphasis,e=>({sourceDelimiter:e.data?.sourceDelimiter??`*`}))),r.strong&&(i.strong=YU(r.strong,e=>({sourceDelimiter:e.data?.sourceDelimiter??`**`}))),n.heading&&(i.heading=JU(n.heading,e=>({level:e.depth,headingStyle:e.data?.sourceStyle??`atx`,sourceTrailingHashes:e.data?.sourceTrailingHashes??null,sourceUnderlineLength:e.data?.sourceUnderlineLength??null,sourceContiguousNext:e.data?.sourceContiguousNext??!1,sourceLeadingIndent:e.data?.sourceLeadingIndent??null,sourceInteriorSpacing:e.data?.sourceInteriorSpacing??null}))),n.codeBlock&&(i.code=t=>{let r=t.value?[e.text(t.value)]:[];return n.codeBlock.createAndFill({language:t.lang??null,meta:t.meta??null,fenceDelimiter:t.data?.sourceFenceChar??"`",fenceLength:t.data?.sourceFenceLength??3,sourceStyle:t.data?.sourceStyle??`fenced`,sourceClosingFenceLength:t.data?.sourceClosingFenceLength??null,sourceFenceIndent:t.data?.sourceFenceIndent??null,sourceInfoPadding:t.data?.sourceInfoPadding??null,sourceIndents:t.data?.sourceIndents??null},r)}),n.thematicBreak&&(i.thematicBreak=e=>n.thematicBreak.createAndFill({sourceRaw:e.data?.sourceRaw??`---`})),n.hardBreak&&(i.break=e=>n.hardBreak.createAndFill({hardBreakStyle:e.data?.sourceStyle??`spaces`,sourceRaw:e.data?.sourceRaw??null})),n.list&&(i.list=JU(n.list,e=>({ordered:!!e.ordered,start:e.start??1,spread:!!e.spread,bulletMarker:e.data?.bulletMarker??null,listMarkerDelimiter:e.data?.listMarkerDelimiter??null}))),n.listItem&&(i.listItem=JU(n.listItem,e=>({checked:e.checked??null,spread:!!e.spread,sourceMarkerSpacing:e.data?.sourceMarkerSpacing??null,sourceOrdinal:e.data?.sourceOrdinal??null,sourceCheckboxChar:e.data?.sourceCheckboxChar??null,sourceContinuationIndent:e.data?.sourceContinuationIndent??null}))),r.link){let t=r.sourceLiteral;i.link=(n,i,a)=>{if((n.children??[]).length===0){let r=typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:`[](${n.url??``})`;return r?t?e.text(r,[t.create({sourceRaw:r})]):e.text(r):null}let o=a.all(n).flat(),s=r.link.create({href:n.url??``,title:n.title??null,linkStyle:n.data?.sourceStyle??`inline`,refLabel:null,sourceUrlForm:n.data?.sourceUrlForm??null,sourceTitleMarker:n.data?.sourceTitleMarker??null});return o.map(e=>e.mark(s.addToSet(e.marks)))},i.linkReference=(n,i,a)=>{if((n.children??[]).length===0){let r=typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:`[${n.label??``}][${n.identifier??``}]`;return r?t?e.text(r,[t.create({sourceRaw:r})]):e.text(r):null}let o=a.all(n).flat(),s=r.link.create({href:``,title:null,linkStyle:n.referenceType??`shortcut`,refLabel:n.label??n.identifier??null});return o.map(e=>e.mark(s.addToSet(e.marks)))}}n.htmlBlock&&(i.html=e=>n.htmlBlock.createAndFill({content:e.value??``}));let o=n.linkDefinition??n.linkRefDef;if(o){let e=!!o.spec.attrs?.url,t=!!o.spec.attrs?.href,n=!!o.spec.attrs?.identifier,r=!!o.spec.attrs?.sourceLayout,a=!!o.spec.attrs?.sourceTitleMarker;i.definition=i=>{let s={title:i.title??null};return n&&(s.identifier=i.identifier??``),s.label=i.label??i.identifier??``,e?s.url=i.url??``:t&&(s.href=i.url??``),r&&(s.sourceLayout=i.data?.sourceLayout??null),a&&(s.sourceTitleMarker=i.data?.sourceTitleMarker??null),o.createAndFill(s)}}if(n.jsxComponent){let r=e=>{if(e&&typeof e==`object`&&`sourceRaw`in e){let t=e.sourceRaw;if(typeof t==`string`)return t}};i.mdxJsxFlowElement=(e,i,a)=>{let o=e.name??``,s=T7.getOrWildcard(o),c=Cne(e.attributes,s.props);if(o===`CommonMarkImage`&&typeof c.src==`string`){let e=c.src,n=p7(e,t.current.sourcePath);n!==e&&(c.src=n,c.sourceUrl=e)}let l=a.all(e).flat();return n.jsxComponent.createAndFill({componentName:o,kind:`element`,attributes:e.attributes,sourceRaw:r(e.data)??``,sourceDirty:!1,props:c},l.length?l:void 0)};let a=(e,t)=>{let n=e.attributes?.find(e=>e.type===`mdxJsxAttribute`&&e.name===t);return n&&typeof n.value==`string`?n.value:null};i.mdxJsxTextElement=t=>{if(t.name===`InlineMath`&&n.mathInline){let e=a(t,`formula`)??``,r=a(t,`id`);return n.mathInline.create({formula:e,id:r??null})}if(t.name===`Tag`&&n.tag){let e=a(t,`value`)??``;return n.tag.create({value:e})}if(n.jsxInline){let i=r(t.data)??``;return n.jsxInline.createAndFill({},i?[e.text(i)]:null)}return n.jsxComponent.createAndFill({sourceRaw:r(t.data)??``})},i.mdxFlowExpression=e=>{let t=r(e.data)??`{${e.value??``}}`;return n.jsxComponent.createAndFill({kind:`expression`,sourceRaw:t,sourceDirty:!1})},i.mdxTextExpression=t=>{let n=r(t.data)??`{${t.value??``}}`;return e.text(n)}}return n.wikiLink&&(i.wikiLink=e=>n.wikiLink.createAndFill({target:e.data?.target??``,alias:e.data?.alias??null,anchor:e.data?.anchor??null,sourceTarget:e.data?.sourceTarget??null,sourceAnchor:e.data?.sourceAnchor??null,sourceAlias:e.data?.sourceAlias??null})),n.tag&&(i.tag=e=>n.tag.createAndFill({value:e.value})),n.wikiLinkEmbed&&(i.wikiLinkEmbed=(i,a)=>{let o=i.data?.target??``,s=i.data?.alias??null,c=i.data?.anchor??null,l=i0(o),{resolveEmbed:u,sourcePath:d}=t.current,f=u&&d?u(o,d)??null:null,p=f?`/${f}`:o,m=a?.type===`paragraph`&&Array.isArray(a.children)&&a.children.length===1;if(m&&Dne.has(l)&&n.jsxComponent&&T7.has(`WikiEmbedImage`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedImage`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,alt:s??o,target:o,anchor:c,alias:s}});if(m&&Il.has(l)&&n.jsxComponent&&T7.has(`WikiEmbedVideo`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedVideo`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,title:s??o,target:o,anchor:c,alias:s}});if(m&&Rl.has(l)&&n.jsxComponent&&T7.has(`WikiEmbedAudio`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedAudio`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,title:s??o,target:o,anchor:c,alias:s}});if(m&&zl.has(l)&&n.jsxComponent&&T7.has(`WikiEmbedFile`)){let{resolveSize:e}=t.current,r=e&&d?e(o,d)??null:null,i=r===null?null:w7(r);return n.jsxComponent.createAndFill({componentName:`WikiEmbedFile`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,target:o,anchor:c,alias:s,size:i}})}let h=s||(c?`${o}#${c}`:o);if(r.link){let t=r.link.create({href:p,title:null,linkStyle:`inline`,refLabel:null,sourceForm:`wikiembed`,target:o,anchor:c,alias:s});return e.text(h,[t])}throw Error("[wikiLinkEmbed handler] schema lacks `link` mark — cannot dispatch without violating the STOP rule against emitting PM wikiLinkEmbed server-side")}),n.mathInline&&(i.inlineMath=e=>n.mathInline.create({formula:e.value??``,sourceDelimiter:e.data?.sourceDelimiter??null})),i.math||=t=>{let r=t.value==null?`«unknown:${t.type}»`:t.value;return n.rawMdxFallback?(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.type,reason:`Unhandled block mdast: ${t.type}`})),n.rawMdxFallback.createAndFill({reason:`Unhandled block mdast: ${t.type}`},r?[e.text(r)]:null)):null},i.inlineMath||=t=>(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.type,reason:`Unhandled inline mdast: ${t.type}`})),t.value==null?e.text(`«unknown:${t.type}»`):e.text(t.value)),n.footnoteReference?i.footnoteReference=e=>n.footnoteReference.create({identifier:e.identifier,label:e.label??e.identifier}):i.footnoteReference||=t=>(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:`footnoteReference`,reason:`FootnoteReference extension missing — recovering [^id] source`})),e.text(`[^${t.label??t.identifier}]`)),n.footnoteDefinition?i.footnoteDefinition=JU(n.footnoteDefinition,e=>{let t=e;return{identifier:t.identifier,label:t.label??t.identifier}}):i.footnoteDefinition||=t=>{console.warn(JSON.stringify({event:`unknown-mdast-type`,type:`footnoteDefinition`,reason:`FootnoteDefinition extension missing — recovering [^id]: marker`}));let r=`[^${t.label??t.identifier}]: `;return n.paragraph?n.paragraph.create(null,e.text(r)):null},i.rawMdxFallbackMdast=t=>{if(!n.rawMdxFallback)return null;let r=t.position?{start:t.position.start?.offset??0,end:t.position.end?.offset??0}:{start:0,end:0};return console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.originalType,reason:`Unhandled mdast: ${t.originalType}`,unresolvedPosition:t.unresolvedPosition??!1})),n.rawMdxFallback.createAndFill({reason:`Unhandled mdast: ${t.originalType}`,originalSpan:r},t.value?[e.text(t.value)]:null)},i}function kne(e){let t={},n={},r=e.nodes,i=e.marks;r.paragraph&&(t.paragraph=eW(`paragraph`)),r.blockquote&&(t.blockquote=eW(`blockquote`,e=>{let t=e.attrs.sourceMarkerSpacings,n={};return Array.isArray(t)&&t.length>0&&(n.sourceMarkerSpacings=t),Object.keys(n).length>0?{data:n}:{}})),r.heading&&(t.heading=eW(`heading`,e=>({depth:e.attrs.level,data:{sourceStyle:e.attrs.headingStyle,sourceTrailingHashes:e.attrs.sourceTrailingHashes??void 0,sourceUnderlineLength:e.attrs.sourceUnderlineLength??void 0,sourceContiguousNext:e.attrs.sourceContiguousNext===!0?!0:void 0,sourceLeadingIndent:e.attrs.sourceLeadingIndent??void 0,sourceInteriorSpacing:e.attrs.sourceInteriorSpacing??void 0}}))),r.codeBlock&&(t.codeBlock=e=>{let t=e.attrs.sourceStyle===`indented`?`indented`:`fenced`;return{type:`code`,lang:t===`indented`?null:e.attrs.language??null,meta:t===`indented`?null:e.attrs.meta??null,value:e.textContent??``,data:{sourceFenceChar:e.attrs.fenceDelimiter,sourceFenceLength:e.attrs.fenceLength,sourceStyle:t,sourceClosingFenceLength:e.attrs.sourceClosingFenceLength??void 0,sourceFenceIndent:e.attrs.sourceFenceIndent??void 0,sourceInfoPadding:e.attrs.sourceInfoPadding??void 0,sourceIndents:e.attrs.sourceIndents??void 0}}}),r.thematicBreak&&(t.thematicBreak=e=>({type:`thematicBreak`,data:{sourceRaw:e.attrs.sourceRaw}})),r.hardBreak&&(t.hardBreak=e=>({type:`break`,data:{sourceStyle:e.attrs.hardBreakStyle,...typeof e.attrs.sourceRaw==`string`&&e.attrs.sourceRaw.length>0?{sourceRaw:e.attrs.sourceRaw}:{}}})),r.list&&(t.list=eW(`list`,e=>({ordered:e.attrs.ordered??!1,start:e.attrs.ordered?e.attrs.start??1:null,spread:e.attrs.spread??!1,data:{bulletMarker:e.attrs.bulletMarker,listMarkerDelimiter:e.attrs.listMarkerDelimiter}}))),r.listItem&&(t.listItem=(e,t,n)=>{let r=n.all(e),i=r.length>1&&Ene(r[0])?r.slice(1):r,a={};return typeof e.attrs.sourceMarkerSpacing==`number`&&(a.sourceMarkerSpacing=e.attrs.sourceMarkerSpacing),typeof e.attrs.sourceOrdinal==`number`&&(a.sourceOrdinal=e.attrs.sourceOrdinal),e.attrs.sourceCheckboxChar===`X`&&(a.sourceCheckboxChar=`X`),typeof e.attrs.sourceContinuationIndent==`number`&&(a.sourceContinuationIndent=e.attrs.sourceContinuationIndent),{type:`listItem`,checked:e.attrs.checked??null,spread:e.attrs.spread??!1,...Object.keys(a).length>0?{data:a}:{},children:i}}),r.table&&(t.table=(e,t,n)=>{let r=n.all(e),i=[],a=e.firstChild;a&&a.forEach(e=>{let t=e.attrs.align;i.push(t===`left`||t===`right`||t===`center`?t:null)});let o=r.filter(e=>e.type===`tableRow`),s=e.attrs.sourceDashCounts,c={};Array.isArray(s)&&s.length>0&&(c.sourceDashCounts=s);let l=e.attrs.sourceOuterPipes;typeof l==`object`&&l&&typeof l.leading==`boolean`&&typeof l.trailing==`boolean`&&(c.sourceOuterPipes=l);let u=e.attrs.sourceAlignmentPadding;Array.isArray(u)&&u.length>0&&(c.sourceAlignmentPadding=u);let d=Object.keys(c).length>0?c:void 0,f={type:`table`,align:i,children:o};return d&&(f.data=d),f}),r.tableRow&&(t.tableRow=eW(`tableRow`));let a=(e,t)=>{let n={type:`tableCell`,children:N4(t)},r=e.attrs.sourcePadding;return typeof r==`object`&&r&&typeof r.left==`number`&&typeof r.right==`number`&&(n.data={sourcePadding:r}),n};if(r.tableCell&&(t.tableCell=(e,t,n)=>a(e,n.all(e))),r.tableHeader&&(t.tableHeader=(e,t,n)=>a(e,n.all(e))),r.image&&(t.image=e=>({type:`image`,url:e.attrs.sourceUrl??e.attrs.src,alt:e.attrs.alt,title:e.attrs.title})),r.imageReference&&(t.imageReference=e=>{let t=e.attrs.label??``,n=e.attrs.identifier??t;return{type:`imageReference`,alt:e.attrs.alt??``,identifier:n,label:t||n,referenceType:e.attrs.referenceType??`shortcut`}}),r.htmlBlock&&(t.htmlBlock=e=>({type:`html`,value:e.attrs.content})),r.linkDefinition??r.linkRefDef){let e=r.linkDefinition?`linkDefinition`:`linkRefDef`;t[e]=e=>{let t={},n=e.attrs.sourceLayout;(n===`multiline`||n===`inline`)&&(t.sourceLayout=n);let r=e.attrs.sourceTitleMarker;(r===`single`||r===`double`||r===`paren`)&&(t.sourceTitleMarker=r);let i={type:`definition`,identifier:e.attrs.identifier??e.attrs.label??``,label:e.attrs.label??e.attrs.identifier??``,url:e.attrs.url??e.attrs.href??``,title:e.attrs.title};return Object.keys(t).length>0&&(i.data=t),i}}if(r.jsxComponent&&(t.jsxComponent=(e,t,n)=>{if(e.attrs.kind===`expression`)return{type:`html`,value:e.attrs.sourceRaw??``};let r=e.attrs.componentName||null,i=Array.isArray(e.attrs.attributes)?e.attrs.attributes:[];return!Tne(e)&&e.attrs.sourceRaw?{type:`mdxJsxFlowElement`,name:r,attributes:i,children:[],data:{sourceRaw:String(e.attrs.sourceRaw)}}:T7.getOrWildcard(r??`*`).serialize(e,{all:e=>n.all(e),registry:T7,serializeChildren:()=>{throw Error(`SerializeContext.serializeChildren is not available in the PM→mdast handler. Compat descriptors that need markdown-byte body rendering must emit a marker mdast node and let the to-markdown handler render the body via state.containerFlow.`)}})}),r.rawMdxFallback&&(t.rawMdxFallback=e=>{let t=e.textContent??``,n=typeof e.attrs.reason==`string`?e.attrs.reason:``,r=e.attrs.originalSpan;return{type:`rawMdxFallback`,value:t,data:{reason:n,originalSpan:r&&typeof r==`object`&&`start`in r&&`end`in r?{start:Number(r.start)||0,end:Number(r.end)||0}:{start:0,end:0}}}}),r.jsxInline&&(t.jsxInline=e=>{let t=e.attrs.sourceRaw||e.textContent||``;return{type:`mdxJsxTextElement`,name:null,attributes:[],children:[],data:{sourceRaw:String(t)}}}),r.mathInline&&(t.mathInline=e=>{let t=e.attrs.formula??``,n=e.attrs.id;if(typeof n==`string`&&n.length>0)return{type:`mdxJsxTextElement`,name:`InlineMath`,attributes:[{type:`mdxJsxAttribute`,name:`formula`,value:t},{type:`mdxJsxAttribute`,name:`id`,value:n}],children:[]};let r=e.attrs.sourceDelimiter;return{type:`inlineMath`,value:t,...typeof r==`string`&&r.length>0?{data:{sourceDelimiter:r}}:{}}}),r.wikiLink&&(t.wikiLink=e=>{let t=e.attrs.target??``,n=e.attrs.anchor??null,r=e.attrs.alias??null,i=r||(n?`${t}#${n}`:t);return{type:`wikiLink`,value:i,data:{target:t,anchor:n,alias:r,sourceTarget:typeof e.attrs.sourceTarget==`string`?e.attrs.sourceTarget:null,sourceAnchor:typeof e.attrs.sourceAnchor==`string`?e.attrs.sourceAnchor:null,sourceAlias:typeof e.attrs.sourceAlias==`string`?e.attrs.sourceAlias:null},children:[{type:`text`,value:i}]}}),r.tag&&(t.tag=e=>({type:`tag`,value:String(e.attrs.value??``)})),r.wikiLinkEmbed&&(t.wikiLinkEmbed=e=>{let t=e.attrs.target??``,n=e.attrs.anchor??null,r=e.attrs.alias??null,i=r||(n?`${t}#${n}`:t);return{type:`wikiLinkEmbed`,value:i,data:{target:t,anchor:n,alias:r},children:[{type:`text`,value:i}]}}),i.emphasis&&(n.emphasis=tW(`emphasis`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),i.strong&&(n.strong=tW(`strong`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),i.code&&(n.code=(e,t,n)=>{let r=e.attrs.sourceFenceChar,i=e.attrs.sourceFenceLength;return D7(n,{sourceFenceChar:r,sourceFenceLength:i,sourcePadded:e.attrs.sourcePadded===!0?!0:void 0})}),i.strike??i.delete){let e=i.strike?`strike`:`delete`;n[e]=tW(`delete`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter===`~`?`~`:`~~`}}))}return i.highlight&&(n.highlight=tW(`mark`)),i.comment&&(n.comment=tW(`comment`,e=>({data:{sourceForm:e.attrs.sourceForm===`html`?`html`:`percent`}}))),r.commentBlock&&(t.commentBlock=eW(`commentBlock`,e=>({data:{sourceForm:e.attrs.sourceForm===`html`?`html`:`percent`,sourceLayout:e.attrs.sourceLayout===`inline`?`inline`:`block`}}))),r.footnoteReference&&(t.footnoteReference=e=>{let t=String(e.attrs.identifier??``);return{type:`footnoteReference`,identifier:t,label:e.attrs.label?String(e.attrs.label):t}}),r.footnoteDefinition&&(t.footnoteDefinition=eW(`footnoteDefinition`,e=>({identifier:String(e.attrs.identifier??``),label:e.attrs.label?String(e.attrs.label):String(e.attrs.identifier??``)}))),i.link&&(n.link=(e,t,n)=>{if(e.attrs.sourceForm===`wikiembed`){let t=typeof e.attrs.target==`string`&&e.attrs.target.length>0?e.attrs.target:e.attrs.href??``,r=typeof e.attrs.anchor==`string`&&e.attrs.anchor.length>0?e.attrs.anchor:null,i=typeof e.attrs.alias==`string`&&e.attrs.alias.length>0?e.attrs.alias:null,a=i||(r?`${t}#${r}`:t),o=n.map(e=>`value`in e&&typeof e.value==`string`?e.value:``).join(``);return o!==a&&o.trim().length>0&&!o.includes(`]]`)&&(i=o,a=o),{type:`wikiLinkEmbed`,value:a,data:{target:t,anchor:r,alias:i},children:[{type:`text`,value:a}]}}let r=e.attrs.linkStyle;if(r===`autolink`)return{type:`link`,url:e.attrs.href??``,title:null,children:n,data:{sourceStyle:`autolink`}};if(r===`gfm-autolink`)return{type:`link`,url:e.attrs.href??``,title:null,children:n,data:{sourceStyle:`gfm-autolink`}};if(r===`inline`||!r){let t={};e.attrs.sourceUrlForm===`angle-bracketed`&&(t.sourceUrlForm=`angle-bracketed`);let r=e.attrs.sourceTitleMarker;return(r===`single`||r===`double`||r===`paren`)&&(t.sourceTitleMarker=r),{type:`link`,url:e.attrs.href??``,title:e.attrs.title??null,children:n,...Object.keys(t).length>0?{data:t}:{}}}return{type:`linkReference`,identifier:(e.attrs.refLabel??``).toLowerCase(),label:e.attrs.refLabel,referenceType:r,children:n}}),i.escapeMark&&(n.escapeMark=(e,t,n)=>{for(let e of n)if(e.type===`text`&&e.value){let t=e;t.data??={},t.data.escapedChars??=[];for(let e=0;e<t.value.length;e++)t.data.escapedChars.push({offset:e,char:t.value[e]})}return n.length===1?n[0]:n}),i.sourceLiteral&&(n.sourceLiteral=(e,t,n)=>{let r=typeof e.attrs.sourceRaw==`string`?e.attrs.sourceRaw:``;if(n.length===1&&n[0]?.type===`text`){let e=n[0],t=r||e.value;return U1(t,e.value)&&(e.data??={},e.data.sourceRaw=t),e}return{type:`text`,value:n.filter(e=>e.type===`text`).map(e=>e.value??``).join(``)||r}}),{nodeHandlers:t,markHandlers:n}}var Ane=/\p{M}+/gu,jne=/[^\p{L}\p{N}]+/gu,Mne=/^-+|-+$/g;function k7(e){return e.trim().normalize(`NFKD`).replace(Ane,``).toLowerCase().replace(jne,`-`).replace(Mne,``)}function Nne(e,t){let n=t.get(e)??0;return t.set(e,n+1),n===0?e:`${e}-${n}`}function Pne(e,t){let n=k7(e);return n?Nne(n,t):``}function A7(e,t){let n=k7(e);return t?`#${n}-${k7(t)}`:`#${n}`}var j7=new Set([`img`,`video`,`audio`,`mark`]),Fne=new Map(O3.flatMap(e=>e.surface===`compat`&&j7.has(e.rendersAs)?[[e.name,e]]:[]));function M7(e){let t={};for(let n of e.attributes){if(n.type!==`mdxJsxAttribute`)return null;let e=n.name.toLowerCase();if(!(e.length>=3&&e.startsWith(`on`)))if(n.value===null)t[n.name]=!0;else if(typeof n.value==`string`)t[n.name]=n.value;else return null}return t}function N7(e){let t=e.name;if(!t||!j7.has(t))return null;let n=M7(e);return n===null?null:{type:`element`,tagName:t,properties:n,children:[]}}function P7(e){let t=e.name;if(!t)return null;let n=Fne.get(t);if(!n)return null;let r=M7(e);if(r===null)return null;let i=n.translateProps(r),a={};for(let[e,t]of Object.entries(i))(typeof t==`string`||typeof t==`boolean`)&&(a[e]=t);return{type:`element`,tagName:n.rendersAs,properties:a,children:[]}}var Ine=(e,t)=>{let n=t,{target:r,anchor:i,alias:a}=n.data,o={type:`element`,tagName:`a`,properties:{className:[`wiki-link`],dataTarget:r,dataAnchor:i??``,dataAlias:a??``,href:A7(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},Lne=(e,t)=>{let n=t,{target:r,anchor:i,alias:a}=n.data,o={type:`element`,tagName:`a`,properties:{className:[`wiki-embed`],dataTarget:r,dataAnchor:i??``,dataAlias:a??``,href:A7(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},Rne=(e,t)=>{let n=t,r=N7(n);if(r)return n.children.length>0&&(r.children=e.all(n)),e.patch(t,r),e.applyData(t,r);let i=P7(n);if(i){e.patch(t,i);let n=e.applyData(t,i);return n.tagName===`img`?{type:`element`,tagName:`p`,properties:{},children:[n]}:n}let a={type:`element`,tagName:`pre`,properties:{className:[`mdx-component`]},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:``}]}]};return e.patch(t,a),e.applyData(t,a)},zne=(e,t)=>{let n=t,r=N7(n);if(r)return n.children.length>0&&(r.children=e.all(n)),e.patch(t,r),e.applyData(t,r);let i=P7(n);if(i)return e.patch(t,i),e.applyData(t,i);let a={type:`element`,tagName:`span`,properties:{className:[`mdx-inline`],dataJsxInline:``},children:[{type:`text`,value:typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:``}]};return e.patch(t,a),e.applyData(t,a)},Bne=(e,t)=>{let n=t,r=n.data.reason||`unknown`,i=n.value||``,a=r.replace(/--/g,`—`),o={type:`comment`,value:` Parse error: ${a} `},s={type:`element`,tagName:`pre`,properties:{className:[`mdx-fallback`],dataRawMdxFallback:``,dataReason:a},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:i}]}]};return e.patch(t,s),[o,e.applyData(t,s)]},Vne=(e,t)=>{let n={type:`element`,tagName:`mark`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)};function F7(e){if(typeof e!=`object`||!e)return``;let t=e;return typeof t.value==`string`?t.value:Array.isArray(t.children)?t.children.map(F7).join(``):``}var I7={wikiLink:Ine,wikiLinkEmbed:Lne,mdxJsxFlowElement:Rne,mdxJsxTextElement:zne,rawMdxFallback:Bne,mark:Vne,tag:(e,t)=>{let n=t.value,r={type:`element`,tagName:`a`,properties:{className:[`tag`],dataTag:n,href:`#tag/${n}`},children:[{type:`text`,value:`#${n}`}]};return e.patch(t,r),e.applyData(t,r)},comment:(e,t)=>{let n={type:`comment`,value:F7(t).replace(/--/g,`—`)};return e.patch(t,n),e.applyData(t,n)},commentBlock:(e,t)=>{let n={type:`comment`,value:F7(t).replace(/--/g,`—`)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:(e,t)=>{let n=t.identifier,r={type:`element`,tagName:`sup`,properties:{id:`fnref-${n}`,dataFootnoteRef:``,dataFootnoteId:n,className:[`footnote-ref`]},children:[{type:`element`,tagName:`a`,properties:{href:`#fn-${n}`,className:[`footnote-ref-link`]},children:[{type:`text`,value:`[${n}]`}]}]};return e.patch(t,r),e.applyData(t,r)},footnoteDefinition:(e,t)=>{let n=t.identifier,r={type:`element`,tagName:`aside`,properties:{id:`fn-${n}`,dataFootnoteDef:``,dataFootnoteId:n,className:[`footnote-def`]},children:[{type:`element`,tagName:`div`,properties:{className:[`footnote-body`]},children:e.all(t)},{type:`element`,tagName:`a`,properties:{href:`#fnref-${n}`,className:[`footnote-backref`],ariaLabel:`Back to reference`},children:[{type:`text`,value:`↩`}]}]};return e.patch(t,r),e.applyData(t,r)}},Hne=/url\s*\(\s*['"]?\s*(?:javascript|vbscript|data)\s*:/i,Une=/\bexpression\s*\(/i,Wne=1e4;function Gne(e){return!(e.length>Wne||Hne.test(e)||Une.test(e))}function L7(e){for(let t of e.split(`,`)){let e=t.trim();if(e!==``&&!p1(e.split(/\s+/)[0]??``))return!1}return!0}var Kne={a:[`href`,`title`],img:[`src`,`alt`,`title`],video:[`src`,`title`],audio:[`src`,`title`],code:[`className`]},qne=new Set([`href`,`src`]),Jne=oV(`<>`),R7=()=>e=>{PF(e,`element`,e=>{let t=Kne[e.tagName.toLowerCase()],n=e.properties;if(!(!t||!n))for(let e of t){let t=n[e];if(Array.isArray(t)){let r=t.map(e=>typeof e==`string`?K6(e):e);r.some((e,n)=>e!==t[n])&&(n[e]=r);continue}if(typeof t!=`string`)continue;let r;if(qne.has(e))if(t===`<>`||t===Jne)r=``;else{let e=K6(t);r=e===t?t:oV(e)}else r=K6(t);r!==t&&(n[e]=r)}})},z7=()=>e=>{PF(e,`element`,e=>{let t=e.tagName.toLowerCase(),n=e.properties;if(!n)return;if(t===`a`||t===`area`||t===`link`||t===`base`){let e=n.href;typeof e==`string`&&!p1(e)&&delete n.href}if(t===`img`||t===`iframe`||t===`script`||t===`embed`||t===`source`||t===`audio`||t===`video`||t===`track`){let e=n.src;typeof e==`string`&&!p1(e)&&delete n.src}if(t===`form`){let e=n.action;typeof e==`string`&&!p1(e)&&delete n.action}if(t===`img`||t===`source`){let e=n.srcSet;typeof e==`string`&&!L7(e)&&delete n.srcSet;let t=n.srcset;typeof t==`string`&&!L7(t)&&delete n.srcset}if(t===`video`){let e=n.poster;typeof e==`string`&&!p1(e)&&delete n.poster}let r=n.style;typeof r==`string`&&!Gne(r)&&delete n.style})};function Yne(e){let t=TU().use(YJ,{handlers:I7}).use(R7).use(z7).use(cJ),n=t.runSync(e);return String(t.stringify(n))}function Xne(e){let t=TU().use(CG).use(SW,[`yaml`]).use(j5).use(gU).use(s7).use(YJ,{handlers:I7}).use(R7).use(z7).use(cJ);return String(t.processSync(e))}uq(),CK(),wK();var B7=`frontmatter`,V7=[`text`,`number`,`boolean`,`date`,`list`,`object`];P(V7);var Zne=nl([k(),A(),j()]),H7=Sl(()=>nl([Zne.transform(e=>String(e)),il(k(),U7),M(H7)])),U7=Sl(()=>nl([k(),A(),j(),M(H7),il(k(),U7)])),Qne=/^\d{4}-\d{2}-\d{2}$/;function $ne(e){return typeof e==`string`&&Qne.test(e)}function ere(e){return Array.isArray(e)?`list`:typeof e==`object`&&e?`object`:typeof e==`boolean`?`boolean`:typeof e==`number`?`number`:$ne(e)?`date`:`text`}function W7(e){if(Array.isArray(e)){let t=[];for(let n of e)n!==null&&t.push(W7(n));return t}if(typeof e==`object`&&e){let t={};for(let[n,r]of Object.entries(e))t[n]=r===null?``:W7(r);return t}return e}var tre=Dl(W7,il(k(),U7)),nre=il(k(),nl([U7,Xc()]));function rre(e){return!!(e===null||typeof e==`string`&&e===``||Array.isArray(e)&&e.length===0)}function G7(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!G7(e[n],t[n]))return!1;return!0}if(e!==null&&t!==null&&typeof e==`object`&&typeof t==`object`&&!Array.isArray(e)&&!Array.isArray(t)){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.hasOwn(t,r)||!G7(e[r],t[r]))return!1;return!0}return!1}N({docName:f2,summary:m2,content:k().optional(),...p2}).loose(),N({docName:f2,summary:m2,markdown:k(),position:P([`append`,`prepend`,`replace`]).optional(),extension:P(k$).optional(),...p2}).loose(),N({docName:f2,summary:m2,find:k().min(1),replace:k(),offset:A().int().nonnegative().optional(),...p2}).loose(),N({docName:f2,connectionId:k().min(1),scope:P([`last`,`session`,`file`]).optional(),...p2}).loose();var K7=N({value:k(),truncatedFrom:A().int().nonnegative().optional(),hint:k().optional()}).loose(),ire=rl(`kind`,[N({kind:F(`inline`),content:k()}),N({kind:F(`truncated`),byteLength:A().int().nonnegative(),hint:k()})]),q7=N({kind:F(`content-divergence`),intendedBytes:A().int().nonnegative(),actualBytes:A().int().nonnegative(),byteDelta:A().int(),divergenceType:k().optional(),currentState:ire.optional(),hint:k().optional()}).loose(),are=N({type:F(`orphan`),parentCandidates:M(k()),message:k()}).loose(),J7=N({kind:F(`disk-edit-reconciled`),intendedBytes:A().int().nonnegative(),actualBytes:A().int().nonnegative(),byteDelta:A().int(),mergeOutcome:k().optional(),hint:k().optional()}).loose(),Y7=rl(`kind`,[q7,J7]),X7=M(rl(`kind`,[q7,J7,N({kind:F(`mermaid-parse-error`),fenceIndex:A().int().positive(),fenceFirstLine:k(),message:k(),line:A().int().positive().optional()}).loose()])).min(1),Z7=M(N({href:k(),resolvedTo:k().nullable(),reason:P([`no-such-doc`,`no-such-file`,`unresolvable`])}).loose());N({timestamp:k().min(1),summary:K7.optional(),warning:Y7.optional(),warnings:X7.optional()}).loose(),N({timestamp:k().min(1),subscriberCount:A().int().nonnegative(),systemSubscriberCount:A().int().nonnegative(),hints:M(are).optional(),summary:K7.optional(),warning:Y7.optional(),warnings:X7.optional(),brokenLinks:Z7}).loose(),N({timestamp:k().min(1),subscriberCount:A().int().nonnegative(),systemSubscriberCount:A().int().nonnegative(),summary:K7.optional(),warning:Y7.optional(),warnings:X7.optional(),brokenLinks:Z7}).loose(),N({docName:k().min(1),scope:P([`last`,`session`]),undone:j()}).loose(),N({docName:f2,patch:il(k(),nl([U7,Xc()])),types:il(k(),P(V7)).optional(),summary:m2,...p2}).loose(),N({timestamp:k().min(1),subscriberCount:A().int().nonnegative(),systemSubscriberCount:A().int().nonnegative(),appliedKeys:M(k()),summary:K7.optional(),warning:Y7.optional(),warnings:X7.optional(),brokenLinks:Z7}).loose(),N({entries:M(N({level:P([`info`,`warn`,`error`]),message:k().max(BQ),event:k().optional(),fields:il(k(),Qc()).optional(),ts:A().optional(),sourceId:k().optional(),lineNumber:A().optional()}).loose()).max(100)}).loose(),N({accepted:A().int().min(0)}).loose();var ore=N({status:k().min(1),reason:k()}).loose();N({docName:k().min(1),content:k(),lifecycle:ore.nullable()}).loose();var Q7=N({kind:P([`document`,`asset`,`folder`,`file`]).default(`document`),docName:k().min(1).optional(),docExt:k().min(1).default(`.md`),size:A().int().nonnegative(),modified:k().min(1),isSymlink:j().default(!1),canonicalDocName:k().nullable().default(null),targetPath:k().nullable().default(null),path:k().min(1).optional(),assetExt:k().min(1).optional(),mediaKind:P([`image`,`video`,`audio`,`pdf`,`text`]).nullable().optional(),referencedBy:M(k().min(1)).optional(),hasChildren:j().optional()}).loose().refine(e=>e.kind===`document`?e.docName!==void 0&&e.path===void 0&&e.assetExt===void 0&&e.mediaKind===void 0&&e.referencedBy===void 0&&e.hasChildren===void 0:e.kind===`folder`?e.docName===void 0&&e.path!==void 0&&e.assetExt===void 0&&e.mediaKind===void 0&&e.referencedBy===void 0:e.kind===`file`?e.path!==void 0&&e.mediaKind===void 0&&e.referencedBy===void 0&&e.hasChildren===void 0:e.path!==void 0&&e.assetExt!==void 0&&e.referencedBy!==void 0&&e.hasChildren===void 0,{message:`document/asset/folder/file kind must match its required fields (document → docName; asset → path+assetExt+referencedBy; folder → path only, no docName; file → path, no mediaKind/referencedBy/hasChildren)`}),sre=N({documents:M(Q7),truncated:j().optional()}).loose(),cre=N({source:k().min(1),anchor:k().nullable(),title:k(),snippet:k().nullable()}).loose(),lre=N({docName:k().min(1),backlinks:M(cre)}).loose();N({counts:il(k().min(1),A().int().nonnegative())}).loose();var ure=rl(`kind`,[N({kind:F(`doc`),docName:k().min(1),anchor:k().nullable(),title:k(),snippet:k().nullable()}).loose(),N({kind:F(`external`),url:k().min(1),title:k(),snippet:k().nullable()}).loose()]),dre=N({docName:k().min(1),forwardLinks:M(ure)}).loose(),fre=rl(`kind`,[N({id:k().min(1),kind:F(`doc`),docName:k().min(1),anchor:k().nullable(),label:k(),cluster:k().nullable(),category:k().nullable(),tags:M(k()).nullable()}).loose(),N({id:k().min(1),kind:F(`external`),url:k().min(1),label:k()}).loose()]),pre=N({source:k().min(1),target:k().min(1)}).loose(),mre=N({nodes:M(fre),links:M(pre)}).loose(),hre=N({ts:A().int().min(0),url:k(),method:k(),ua:k().optional(),origin:k().optional(),referer:k().optional(),host:k().optional(),remote:k().optional(),secChUa:k().optional(),secChUaMobile:k().optional(),secChUaPlatform:k().optional(),secFetchSite:k().optional(),secFetchDest:k().optional(),secFetchMode:k().optional(),secFetchUser:k().optional()}).loose(),gre=N({app:nl([F(`cursor`),F(`codex`),F(`claude`),Xc()]),signals_fired:M(k())}).loose();N({entries:M(hre),count:A().int().min(0),detection:gre}).loose(),N({writers:M(N({id:k().min(1),name:k().optional(),email:k().optional()}).loose()).optional(),summary:m2,...p2}).loose(),N({checkpointRef:k().min(1)}).loose();var _re=N({v:A().int().optional(),id:k().min(1),name:k().min(1),colorSeed:k().optional(),docs:M(k()),summaries:M(k()).optional()}).loose();N({entries:M(N({sha:k().min(1),timestamp:k().min(1),author:k(),authorEmail:k(),type:P([`checkpoint`,`wip`,`upstream`,`park`]),message:k(),contributors:M(_re),checkpoint:Qc().nullable()}).loose()),total:A().int().nonnegative().optional(),truncated:j().optional(),hasMore:j().optional()}).loose(),N({sha:k().regex(/^[0-9a-f]{40}$/i),content:k(),timestamp:k(),author:k()}).loose();var vre=N({contentDir:k().min(1),pathSeparator:P([`/`,`\\`]),symlinkResolved:j()}).loose();M(rl(`source`,[N({docName:k().min(1),timestamp:k().min(1),size:A().int().nonnegative(),source:F(`flat`)}).loose(),N({docName:k().min(1),timestamp:k().min(1),source:F(`timeline`),sha:k().min(1)}).loose()])).meta({description:"Flat array of rescue buffer entries; discriminated via `source`."});var yre=N({orphans:M(N({docName:k().min(1),title:k()}).loose())}).loose(),bre=N({hubs:M(N({docName:k().min(1),title:k(),count:A().int().nonnegative()}).loose())}).loose(),xre=N({source:k().min(1),title:k(),snippet:k().nullable()}).loose();N({deadLinks:M(N({target:k().min(1),sources:M(xre)}).loose())}).loose(),N({target:N({docName:k().min(1),title:k(),aliases:M(k())}).loose(),mentions:M(N({source:k().min(1),excerpt:k(),offset:A().int().nonnegative()}).loose()),truncated:j()}).loose(),N({projectPath:k().min(1)}).loose();var Sre=P([`not-a-git-worktree`,`init-failed`]);rl(`ok`,[N({ok:F(!0),projectPath:k().min(1)}).loose(),N({ok:F(!1),reason:Sre,message:k().min(1)}).loose()]),N({host:k().min(1).optional()}).loose(),N({key:k().min(1)}).loose(),N({keyPresent:j()}).loose(),N({name:k().refine(e=>e.trim().length>0,{message:`name must be non-empty`}),email:k().refine(e=>e.trim().length>0,{message:`email must be non-empty`})}).loose(),N({authenticated:j()}).loose(),N({}).loose();var Cre=N({stackIndex:A().int().min(0),ts:A().int().min(0),additions:A().int().min(0),deletions:A().int().min(0)}).loose(),wre=N({docName:k().min(1),additionsTotal:A().int().min(0),deletionsTotal:A().int().min(0),lastTs:A().int().min(0),bursts:M(Cre)}).loose(),Tre=N({displayName:k().min(1),color:k().min(1),icon:k().optional(),connectionId:k().min(1)}).loose(),Ere=N({sessionAlive:j(),agent:Tre.nullable(),files:M(wre)}).loose(),Dre=N({diff:k(),generatedAt:A().int().min(0)}).loose();N({}).loose(),N({}).loose(),N({}).loose(),N({}).loose(),N({}).loose(),N({}).loose();var Ore=N({displayName:k().min(1),icon:k(),color:k().min(1),currentDoc:k().nullable(),mode:P([`idle`,`writing`]),ts:A().int().min(0)}).loose();N({presence:il(k().min(1),Ore)}).loose(),il(k().min(1),j()).meta({description:`Flat boolean record keyed by agent-scheme name (claude / codex / cursor). True = installed.`}),N({path:k().min(1,`path must be non-empty`)}).loose(),N({}).loose();var kre=N({fromDocName:k().min(1),toDocName:k().min(1)}).loose(),Are=N({fromPath:k().min(1),toPath:k().min(1)}).loose();N({}).loose(),N({path:k().min(1),...p2,summary:m2}).loose();var jre=N({docName:k().min(1)}).loose();N({path:k().min(1),...p2,summary:m2}).loose();var Mre=N({path:k().min(1)}).loose();N({kind:P([`file`,`folder`]),path:k().min(1),...p2,summary:m2}).loose();var Nre=N({kind:P([`file`,`folder`]),path:k().min(1),duplicatedDocNames:M(k().min(1))}).loose(),Pre=N({pages:M(N({docName:k().min(1),title:k(),docExt:k().min(1),size:A().int().nonnegative(),modified:k().min(1),icon:k().min(1).max(2048).optional()}).loose())}).loose(),Fre=N({level:A().int().min(1).max(6),text:k(),slug:k()}).loose(),Ire=N({docName:k().min(1),headings:M(Fre)}).loose(),Lre=N({docName:k().min(1),rewrites:A().int().nonnegative()}).loose();N({kind:P([`file`,`folder`,`asset`]),fromPath:k().min(1),toPath:k().min(1),...p2,summary:m2}).loose();var Rre=N({renamed:M(kre),renamedAssets:M(Are),rewrittenDocs:M(Lre).optional(),summary:K7.optional()}).loose();N({kind:P([`file`,`folder`,`asset`]),path:k().min(1),...p2}).loose();var zre=N({deletedDocNames:M(k().min(1))}).loose();N({kind:P([`file`,`folder`,`asset`]),path:k().min(1),...p2,summary:m2}).loose();var Bre=N({deletedDocNames:M(k().min(1))}).loose();N({docName:k().min(1),commitSha:k().regex(/^[0-9a-f]{40}$/i,{message:`commitSha must be a 40-char git SHA`}),summary:m2,...p2}).loose(),N({restoredFrom:k().min(1),timestamp:k().min(1),summary:K7.optional(),warning:q7.optional(),warnings:X7.optional()}).loose();var Vre=P([`dormant`,`idle`,`fetching`,`pulling`,`pushing`,`conflict`,`offline`,`auth-error`,`disabled`]),Hre=N({label:k().min(1),webUrl:kc().nullable()}).loose(),Ure=rl(`checkStatus`,[N({checkStatus:F(`allowed`)}).loose(),N({checkStatus:F(`denied`),deniedReason:P([`no-collaborator`,`private-no-access`,`repo-not-found`])}).loose(),N({checkStatus:F(`unknown`),unknownError:P([`network`,`timeout`,`rate-limit`,`token-invalid`,`malformed-response`]).optional()}).loose()]),$7=P([`auth-403`,`auth-401`,`auth-scope-mismatch`,`auth-no-credential`,`semantic-protected-branch`]);N({state:Vre,lastSyncUtc:k().nullable(),lastFetchUtc:k().nullable(),lastPushedSha:k().nullable(),ahead:A().int().min(0),behind:A().int().min(0),consecutiveFailures:A().int().min(0),conflictCount:A().int().min(0),hasRemote:j(),syncEnabled:j(),identityUnresolved:j(),remote:Hre.nullable().optional(),pushError:k().optional(),pushErrorCode:$7.optional(),pullError:k().optional(),pullErrorCode:$7.optional(),pausedReason:k().optional(),pushPermission:Ure.optional()}).loose(),N({op:P([`sync`,`push`,`pull`]).optional()}).loose(),N({op:P([`sync`,`push`,`pull`])}).loose(),N({conflicts:M(N({file:k().min(1),detectedAt:k().min(1),oursSha:k().optional(),theirsSha:k().optional(),baseSha:k().optional()}).loose())}).loose(),N({file:k().min(1),strategy:P([`mine`,`theirs`,`content`,`delete`]),content:k().optional()}).loose().refine(e=>e.strategy!==`content`||e.content!==void 0&&e.content!==``,{message:`content must be a non-empty string when strategy is 'content'`,path:[`content`]}),N({}).loose(),N({file:k().min(1),base:k(),ours:k(),theirs:k(),kind:P([`both-modified`,`delete-modify`,`modify-delete`]),lifecycleStatus:k().nullable()}).loose(),N({plan:wl(e=>e!==void 0,{message:`plan is required`})}).loose(),N({plan:wl(e=>e!==void 0,{message:`plan is required`})}).loose(),N({result:wl(e=>e!==void 0,{message:`result is required`})}).loose();var Wre=N({path:k().min(1),summary:k().min(1)}).loose(),Gre=N({files:A().int().nonnegative(),folders:A().int().nonnegative()}).loose();N({packs:M(N({id:k().min(1),name:k().min(1),description:k().min(1),defaultSubfolder:k().optional(),folders:M(Wre),entryCounts:Gre}).loose())}).loose(),N({noOpen:j().optional(),out:k().min(1).optional()}).loose();var Kre=N({reason:P([`unsupported-platform`,`spawn-error`]),message:k()}).loose();rl(`status`,[N({status:F(`installed`),outputPath:k(),size:A().int().nonnegative(),sha256:k(),skillVersion:k()}).loose(),N({status:F(`built`),outputPath:k(),size:A().int().nonnegative(),sha256:k(),skillVersion:k(),handoffError:Kre.optional()}).loose(),N({status:F(`failed`),buildError:k()}).loose(),N({status:F(`skip-current`),skillVersion:k(),recordedAt:k().optional()}).loose()]);var e9=P(I$);el({schema:F(1),targets:M(e9).default([])}),N({tags:M(N({name:k().min(1),count:A().int().nonnegative(),isLeaf:j()}).loose())}).loose();var qre=N({docName:k().min(1),title:k(),matchingTags:M(k().min(1)),snippet:k().nullable()}).loose();N({name:k().min(1),docs:M(qre)}).loose(),N({folder:Qc(),frontmatter_local:il(k(),Qc()).nullable()}).loose(),N({path:k(),frontmatter:il(k(),Qc()).optional()}).loose(),N({applied:Qc()}).loose();var t9=il(k(),Qc()).meta({description:`Free-form frontmatter map embedded in template payloads.`});N({template:N({name:k().min(1),folder:k(),scope:P([`local`,`inherited`]),path:k().min(1),frontmatter:t9,body:k()}).strict()}).strict();var Jre=N({templates:M(N({name:k().min(1),title:k().optional(),description:k().optional(),path:k().min(1),source_folder:k()}).strict()),truncated:j()}).strict();N({folder:k(),name:k(),body:k().optional(),frontmatter:t9.optional(),...p2,summary:m2}).strict(),N({path:k().min(1),created:j(),warnings:M(k())}).strict(),N({existed:j(),path:k().min(1)}).strict(),N({fromFolder:k(),fromName:k(),toFolder:k(),toName:k(),body:k().optional(),frontmatter:t9.optional(),...p2,summary:m2}).strict(),N({from:k().min(1),to:k().min(1),committed:j()}).strict();var n9=P(_$),Yre=/^[a-z0-9-]+$/,Xre=/^[A-Za-z0-9_-]+$/,r9=N({name:k(),description:k()}).strict();N({skill:N({name:k().min(1),scope:n9,path:k().min(1),frontmatter:r9,body:k(),files:M(N({path:k().min(1),text:k().nullable()})).optional()}).strict()}).strict();var Zre=N({skills:M(N({name:k().min(1),description:k().optional(),scope:n9,path:k().min(1),absolutePath:k().min(1).optional(),installed:j(),hosts:M(k()),installedVersion:k().optional(),bundledVersion:k().optional(),updateAvailable:j().optional()}).strict()),truncated:j()}).strict();N({scope:n9.default(`project`),name:k(),body:k().optional(),frontmatter:r9,...p2,summary:m2}).strict(),N({path:k().min(1),created:j(),warnings:M(k())}).strict(),N({scope:n9.default(`project`),name:k(),...p2,summary:m2}).strict(),N({name:k().min(1),version:k().min(1),previousVersion:k().optional(),checkpointRef:k().optional()}).strict(),N({existed:j(),path:k().min(1)}).strict(),N({scope:n9.default(`project`),fromName:k(),toName:k(),body:k().optional(),frontmatter:r9.optional(),...p2,summary:m2}).strict(),N({from:k().min(1),to:k().min(1),committed:j()}).strict();var i9=P([`reference`,`script`]);N({scope:n9.default(`project`),name:k(),path:k().min(1),content:k(),...p2,summary:m2}).strict(),N({path:k().min(1),created:j(),kind:i9,content:j()}).strict(),N({path:k().min(1),kind:i9,text:k()}).strict(),N({path:k().min(1),existed:j(),kind:i9}).strict(),N({scope:n9.default(`project`),name:k(),targets:M(e9).optional().meta({description:`Explicit editor ids to install into; omit to use project-configured editors.`}),...p2,summary:m2}).strict(),N({name:k().min(1),hosts:M(k()),scripts:j(),warnings:M(k()),warningCodes:M(P([`no-targets`,`scripts-present`]))}).strict(),N({scope:n9.default(`project`),name:k()}).strict(),N({name:k().min(1),uninstalled:j()}).strict();var Qre=N({targets:M(e9),configured:j()}).strict();N({targets:M(e9)}).strict(),N({targets:M(e9),reprojected:M(N({name:k(),hosts:M(k())}).strict()),bundleHosts:M(k()),removedFrom:M(k())}).strict(),N({scope:n9.default(`project`),name:k(),version:k().regex(/^[0-9a-f]{40}$/i),...p2,summary:m2}).strict(),N({name:k().min(1),version:k(),restoredFiles:M(k()),warnings:M(k())}).strict(),N({query:k().optional(),intent:P([`autocomplete`,`full_text`,`omnibar`]).optional(),ranking:P([`navigation`,`relevance`]).optional(),scopes:M(P([`page`,`folder`,`content`,`file`])).optional(),scope:k().optional(),limit:A().int().nonnegative().optional(),semantic:j().optional(),source:P([`omnibar`,`mcp`,`http`]).optional()}).loose();var $re=N({kind:P([`page`,`folder`,`content`,`file`]),path:k().min(1),title:k(),score:A(),signals:il(k(),Qc()),snippet:k().optional()}).loose(),eie=N({capable:j(),applied:j(),coverage:N({embedded:A().int().nonnegative(),total:A().int().nonnegative()})}).loose();N({enabled:j(),keyPresent:j(),keySource:P([`file`,`env`]).nullable(),keyHint:k().nullable(),ready:j(),capable:j(),embedded:A().int().nonnegative(),total:A().int().nonnegative()}).loose(),N({query:k(),intent:P([`autocomplete`,`full_text`,`omnibar`]),results:M($re),elapsedMs:A().nonnegative(),semantic:eie.optional(),truncated:j().optional(),ready:j().optional()}).loose();var tie=N({version:k().min(1),recordedAt:k().min(1)}).loose();N({currentVersion:k().min(1),targets:il(k(),tie.nullable())}).loose();var nie=`server-info`,rie=`branch-switched`,iie=`disk-ack`,aie=`config-validation-rejected`,oie=`config-ignore-nested-error`,a9=P([`files`,`backlinks`,`graph`,`sync-status`,`session-activity`,`tags`]),sie=N({v:F(1),ch:F(nie),seq:A(),serverInstanceId:k().min(1),currentBranch:k().min(1).optional()}).loose(),cie=N({v:F(1),ch:F(rie),seq:A(),branch:k().min(1)}).loose(),lie=N({v:F(1),ch:a9,seq:A()}).loose(),uie=N({v:F(1),ch:F(iie),seq:A(),docName:k().min(1),sv:k().min(1)}).loose(),die=N({v:F(1),ch:F(aie),seq:A(),docName:k().min(1),error:Pu}).loose(),fie=N({v:F(1),ch:F(oie),seq:A(),path:k().min(1),error:k().min(1)}).loose();function pie(e){let t;try{t=new URL(e)}catch{return null}let n=t.pathname.match(/^\/video\/(\d+)/);if(n)return n[1]??null;let r=t.pathname.match(/^\/(\d+)/);return r?r[1]??null:null}function mie(e){if(typeof e!=`string`||e.length===0)return e;let t=t3(e);if(t){let e=t.noCookie?`www.youtube-nocookie.com`:`www.youtube.com`,n=t.startSeconds===null?``:`?start=${t.startSeconds}`;return`https://${e}/embed/${t.id}${n}`}if(X4(e)){let t=pie(e);return t?`https://player.vimeo.com/video/${t}`:e}let n=q4(e);if(n){let e=n.startRaw===null?``:`?t=${n.startRaw}`;return`https://www.loom.com/embed/${n.id}${e}`}return e}var hie=`https://api.github.com/repos/inkeep/open-knowledge`;async function gie(e){let{signal:t,...n}=e??{},r=t?AbortSignal.any([AbortSignal.timeout(5e3),t]):AbortSignal.timeout(5e3);try{let e=await fetch(hie,{headers:{accept:`application/vnd.github+json`,"user-agent":`openknowledge.ai`},...n,signal:r});if(!e.ok)return console.warn(`[github-stars] GitHub API responded ${e.status}`),null;let t=await e.json();return typeof t.stargazers_count==`number`?t.stargazers_count:null}catch(e){return console.warn(`[github-stars] fetch failed: ${e instanceof Error?e.message:String(e)}`),null}}function _ie(e){if(!e)return{height:null,viewerFragment:``};let t=e.split(`&`).filter(e=>e.length>0),n=null,r=[];for(let e of t){let t=e.indexOf(`=`);if(t===-1){r.push(e);continue}let i=e.slice(0,t),a=e.slice(t+1);if(i===`height`){let e=Number.parseInt(a,10);!Number.isNaN(e)&&e>0&&(n=e);continue}r.push(e)}return{height:n,viewerFragment:r.join(`&`)}}new FQ.default;var vie=new FQ.default;vie.Diff_Timeout=.25;var yie=N({path:M(nl([k(),A()])),message:k(),issueCode:k()});rl(`code`,[N({code:F(`SCHEMA_INVALID`),issues:M(yie)}),N({code:F(`WRITE_ERROR`),detail:k()})]);function bie(e){return{path:e.path.map(e=>typeof e==`symbol`?String(e):e),message:e.message,issueCode:e.code}}function xie(e){if(e.code!==`SCHEMA_INVALID`)return{};let t={};for(let n of e.issues){let e=n.path[0];typeof e==`string`&&(t[e]=t[e]?`${t[e]}; ${n.message}`:n.message)}return t}var Sie={defaultKeyType:`PLAIN`,defaultStringType:`PLAIN`,lineWidth:0};function Cie(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function o9(e,t,n){if(Array.isArray(n)){let r=e.createNode(n),i=y(t)?t.flow:void 0;return i!==void 0&&(r.flow=i),r}if(Cie(n)){let r=e.createNode(n),i=g(t)?t.flow:void 0;return i!==void 0&&(r.flow=i),r}return n}function wie(e){return e===``?``:`---\n${e.endsWith(`
|
|
528
|
-
`)?e.slice(0,-1):e}\n---\n`}var s9=65536;function c9(e){let t=e.match($$);return t?{fenced:t[0],body:e.slice(t[0].length)}:{fenced:``,body:e}}function Tie(e){if(e.trim()===``)return{doc:new pn({}),map:{}};let t;try{t=vr(e,{uniqueKeys:!1})}catch(e){let t=e instanceof Error?e.message:String(e);return{doc:new pn({}),map:null,parseError:`parse threw: ${t}`}}if(t.errors.length>0)return{doc:t,map:null,parseError:t.errors[0]?.message??`yaml parse errors`};let n;try{n=t.toJS()}catch(e){let n=e instanceof Error?e.message:String(e);return{doc:t,map:null,parseError:`toJS threw: ${n}`}}if(typeof n!=`object`||!n||Array.isArray(n))return{doc:t,map:null,parseError:`top-level value is not a mapping`};let r=tre.safeParse(n);if(!r.success){let e=r.error.issues[0],n=e&&Array.isArray(e.path)?e.path.join(`.`):``,i=e?.message??`unknown`;return{doc:t,map:null,parseError:n?`value at "${n}" failed schema: ${i}`:`schema validation failed: ${i}`}}return{doc:t,map:r.data}}function l9(e){return e===``?{doc:new pn({}),map:{}}:Tie(n1(e))}function u9(e){let{fenced:t}=c9(e),{map:n,parseError:r}=l9(t);return{map:n??{},parseError:r}}function d9(e){let{fenced:t}=c9(e);if(t===``)return[];let{doc:n,map:r}=l9(t);return r===null?[]:h9(n)}function f9(e){return typeof e==`object`&&!!e&&`key`in e}function p9(e){let t=e.key;return typeof t==`string`?t:t&&typeof t==`object`&&`value`in t&&typeof t.value==`string`?t.value:null}function m9(e,t){let n=e.key;if(typeof n==`string`){e.key=t;return}if(n&&typeof n==`object`){n.value=t;return}e.key=t}function h9(e){let t=e.contents;if(!t||!(`items`in t)||!Array.isArray(t.items))return[];let n=[];for(let e of t.items){if(!f9(e))continue;let t=p9(e);t!==null&&n.push(t)}return n}function g9(e){if(e.contents==null||!(`items`in e.contents)){let t=e.createNode({});return e.contents=t,t}return e.contents}function Eie(e){let t=e.contents;return!t||!(`items`in t)||(t.items?.length??0)===0?``:wie(e.toString(Sie))}function Die(e){let t=new TextEncoder().encode(e).byteLength;return t>65536?{kind:`region_too_large`,bytes:t,limit:s9}:null}function _9(e){let t=Eie(e),n=Die(t);return n?{ok:!1,error:n}:{ok:!0,nextFenced:t}}function Oie(e,t){if(Object.hasOwn(t,`frontmatter`))return{ok:!1,error:{kind:`reserved_key`,key:B7}};let{doc:n,map:r}=l9(e);if(r===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};try{g9(n);for(let[e,r]of Object.entries(t)){if(r===null){n.delete(e);continue}let t=U7.safeParse(r);if(!t.success)return{ok:!1,error:{kind:`invalid_value`,key:e,reason:t.error.issues[0]?.message??`invalid value`}};n.set(e,o9(n,n.get(e,!0),t.data))}return _9(n)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function kie(e,t,n,r={}){if(t===`frontmatter`||n===`frontmatter`)return{ok:!1,error:{kind:`reserved_key`,key:B7}};let{doc:i,map:a}=l9(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};if(t===n)return{ok:!0,nextFenced:e};let o=i.contents;if(!o||!(`items`in o)||!Array.isArray(o.items))return{ok:!1,error:{kind:`unknown_key`,key:t}};let s=o.items.find(e=>f9(e)&&p9(e)===t);if(!s)return{ok:!1,error:{kind:`unknown_key`,key:t}};if(!r.allowDuplicate&&o.items.some(e=>f9(e)&&e!==s&&p9(e)===n))return{ok:!1,error:{kind:`duplicate_target`,key:n}};try{return m9(s,n),_9(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function v9(e,t){let{doc:n,map:r}=l9(e);if(r===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let i=n.contents;if(!i||!(`items`in i)||!Array.isArray(i.items))return{ok:!0,nextFenced:e};let a=h9(n);if(a.length!==t.length||!y9(a,t))return{ok:!1,error:{kind:`reorder_mismatch`,expected:a,got:[...t]}};try{let e=i.items.filter(f9),r=[];for(let n of t){let i=e.findIndex(e=>p9(e)===n);if(i===-1)return{ok:!1,error:{kind:`reorder_mismatch`,expected:a,got:[...t]}};let[o]=e.splice(i,1);o&&r.push(o)}return i.items=r,_9(n)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function y9(e,t){let n=new Map;for(let t of e)n.set(t,(n.get(t)??0)+1);for(let e of t){let t=(n.get(e)??0)-1;if(t<0)return!1;n.set(e,t)}for(let e of n.values())if(e!==0)return!1;return!0}function b9(e){if(e.length===0)return{kind:`invalid_path`,path:[...e],reason:`path must have at least one segment`};for(let t=0;t<e.length;t++){let n=e[t];if(typeof n!=`string`&&typeof n!=`number`)return{kind:`invalid_path`,path:[...e],reason:`path segment at index ${t} must be string or number`};if(typeof n==`number`&&(!Number.isInteger(n)||n<0))return{kind:`invalid_path`,path:[...e],reason:`numeric path segment at index ${t} must be a non-negative integer`}}return e[0]===`frontmatter`?{kind:`reserved_key`,key:B7}:null}function Aie(e,t,n){let r=b9(t);if(r)return{ok:!1,error:r};let{doc:i,map:a}=l9(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let o=U7.safeParse(n);if(!o.success)return{ok:!1,error:{kind:`invalid_value`,key:String(t[t.length-1]),reason:o.error.issues[0]?.message??`invalid value`}};try{return g9(i),i.setIn(t,o9(i,i.getIn(t,!0),o.data)),_9(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function jie(e,t){let n=b9(t);if(n)return{ok:!1,error:n};let{doc:r,map:i}=l9(e);if(i===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};try{return r.getIn(t,!0)===void 0?{ok:!0,nextFenced:e}:(r.deleteIn(t),_9(r))}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function Mie(e,t){if(t.length===0){let t=e.contents;return g(t)?t:null}let n=e.getIn(t,!0);return g(n)?n:null}function Nie(e,t,n,r={}){let i=b9(t);if(i)return{ok:!1,error:i};let a=t[t.length-1];if(typeof a!=`string`)return{ok:!1,error:{kind:`invalid_path`,path:[...t],reason:`cannot rename: last path segment must be a string (map key)`}};if(t.length===1&&n===`frontmatter`)return{ok:!1,error:{kind:`reserved_key`,key:B7}};let{doc:o,map:s}=l9(e);if(s===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};if(a===n)return{ok:!0,nextFenced:e};let c=Mie(o,t.slice(0,-1));if(!c)return{ok:!1,error:{kind:`unknown_key`,key:a}};let l=c.items.find(e=>f9(e)&&p9(e)===a);if(!l)return{ok:!1,error:{kind:`unknown_key`,key:a}};if(!r.allowDuplicate&&c.items.some(e=>f9(e)&&e!==l&&p9(e)===n))return{ok:!1,error:{kind:`duplicate_target`,key:n}};try{return m9(l,n),_9(o)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function Pie(e,t,n){if(t.length===0)return v9(e,n);let r=b9(t);if(r)return{ok:!1,error:r};let{doc:i,map:a}=l9(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let o=i.getIn(t,!0);if(!g(o))return{ok:!1,error:{kind:`invalid_path`,path:[...t],reason:`cannot reorder: target is not a map`}};let s=[];for(let e of o.items){if(!f9(e))continue;let t=p9(e);t!==null&&s.push(t)}if(s.length!==n.length||!y9(s,n))return{ok:!1,error:{kind:`reorder_mismatch`,expected:s,got:[...n]}};try{let e=o.items.filter(f9),t=[];for(let r of n){let i=e.findIndex(e=>p9(e)===r);if(i===-1)return{ok:!1,error:{kind:`reorder_mismatch`,expected:s,got:[...n]}};let[a]=e.splice(i,1);a&&t.push(a)}return o.items=t,_9(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function Fie(e,t,n){let r=b9(t);if(r)return{ok:!1,error:r};let{doc:i,map:a}=l9(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let o=i.getIn(t,!0);if(!y(o))return{ok:!1,error:{kind:`invalid_path`,path:[...t],reason:`cannot reorder: target is not a sequence`}};let s=o,c=s.items.length,l=Array.from({length:c},(e,t)=>t),u=[...n];if(!Iie(u,c))return{ok:!1,error:{kind:`reorder_mismatch`,expected:l.map(String),got:u.map(String)}};try{let e=s.items.slice();return s.items=u.map(t=>e[t]),_9(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function Iie(e,t){if(e.length!==t)return!1;let n=Array(t).fill(!1);for(let r of e){if(!Number.isInteger(r)||r<0||r>=t||n[r])return!1;n[r]=!0}return!0}var Lie=Object.freeze({source:`local`,skipStoreHooks:!1,context:Object.freeze({origin:`form-write`})});function x9(e){return{ok:!1,error:e}}function Rie(e){return{ok:!0,...e}}function zie(e){return{ok:!0,...e}}function Bie(e){return{ok:!0,...e}}function S9(e){return{ok:!0,...e}}function C9(e){switch(e.kind){case`unknown_key`:return{code:`SCHEMA_INVALID`,issues:[{path:[e.key],message:`unknown key '${e.key}'`,issueCode:`unknown_key`}]};case`duplicate_target`:return{code:`SCHEMA_INVALID`,issues:[{path:[e.key],message:`key '${e.key}' already exists`,issueCode:`duplicate_target`}]};case`invalid_value`:return{code:`SCHEMA_INVALID`,issues:[{path:[e.key],message:e.reason,issueCode:`invalid_value`}]};case`reserved_key`:return{code:`SCHEMA_INVALID`,issues:[{path:[e.key],message:`'${e.key}' is a reserved frontmatter key`,issueCode:`reserved_key`}]};case`reorder_mismatch`:return{code:`WRITE_ERROR`,detail:`reorder list does not match current keys (state changed mid-drag)`};case`region_too_large`:return{code:`SCHEMA_INVALID`,issues:[{path:[],message:`Frontmatter region exceeds ${s9}-byte limit (would be ${e.bytes})`,issueCode:`region_too_large`}]};case`parse_failed`:return{code:`WRITE_ERROR`,detail:`Frontmatter YAML is malformed; fix in source mode to commit (${e.reason})`};case`invalid_path`:return{code:`SCHEMA_INVALID`,issues:[{path:[...e.path],message:e.reason,issueCode:`invalid_path`}]}}}function Vie(e,t){if(e.parseError!==t.parseError||e.keys.length!==t.keys.length)return!1;for(let n=0;n<e.keys.length;n++)if(e.keys[n]!==t.keys[n])return!1;for(let n of e.keys)if(!G7(e.map[n],t.map[n]))return!1;return!0}var Hie=5;function w9(e){let t=e.toString();return{snapshot:Uie(t),raw:t}}function Uie(e){let{map:t,parseError:n}=u9(e);return{map:t,keys:d9(e),parseError:n}}function T9(e){return e.startsWith(`---`)}function Wie(e){let t=e.document,n=t.getText(`source`),r=new Set,i=w9(n),a=i.snapshot,o=c9(i.raw).fenced,s=T9(i.raw),c=!1;function l(e=!1){if(c)return;let t,i;try{let e=w9(n);t=e.snapshot,i=e.raw}catch(e){console.warn(`[bindFrontmatterDoc] readSnapshotFromYText threw:`,e);return}if(!e&&Vie(a,t)){s=T9(i);return}a=t,o=c9(i).fenced,s=T9(i);for(let e of r)try{e(t)}catch(e){console.warn(`[bindFrontmatterDoc] listener threw:`,e)}}let u=e=>{c||Gie(e,o.length,s)&&l()};n.observe(u),e.on(`synced`,d);function d(){l(!0)}function f(e){let r;return t.transact(()=>{let{fenced:t}=c9(n.toString());r=e(t),r.ok&&r.nextFenced!==t&&(n.delete(0,t.length),r.nextFenced!==``&&n.insert(0,r.nextFenced))},Lie),r??{ok:!1,error:{kind:`parse_failed`,reason:`commit transact produced no result`}}}function p(e){if(c)return x9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});if(Object.hasOwn(e,`frontmatter`))return x9({code:`SCHEMA_INVALID`,issues:[{path:[B7],message:`'${B7}' is a reserved frontmatter key`,issueCode:`reserved_key`}]});let t=nre.safeParse(e);if(!t.success)return x9({code:`SCHEMA_INVALID`,issues:t.error.issues.map(bie)});let n=t.data,r=Object.keys(n),i=f(e=>Oie(e,n));return i.ok?Rie({appliedKeys:r}):x9(C9(i.error))}function m(e,t,n={}){if(c)return x9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let r=f(r=>kie(r,e,t,n));return r.ok?zie({oldKey:e,newKey:t}):x9(C9(r.error))}function h(e){if(c)return x9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let t=f(t=>v9(t,e));return t.ok?Bie({orderedKeys:[...e]}):x9(C9(t.error))}function g(e,t){if(c)return x9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let n=f(n=>Aie(n,e,t));return n.ok?S9({path:[...e]}):x9(C9(n.error))}function _(e){if(c)return x9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let t=f(t=>jie(t,e));return t.ok?S9({path:[...e]}):x9(C9(t.error))}function v(e,t,n={}){if(c)return x9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let r=f(r=>Nie(r,e,t,n));return r.ok?S9({path:[...e]}):x9(C9(r.error))}function y(e,t){if(c)return x9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let n=f(n=>Pie(n,e,t));return n.ok?S9({path:[...e]}):x9(C9(n.error))}function b(e,t){if(c)return x9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let n=f(n=>Fie(n,e,t));return n.ok?S9({path:[...e]}):x9(C9(n.error))}return{current(){return w9(n).snapshot},patch(e){return p(e)},rename(e,t,n){return m(e,t,n)},reorder(e){return h(e)},patchPath(e,t){return g(e,t)},deletePath(e){return _(e)},renamePath(e,t,n){return v(e,t,n)},reorderPath(e,t){return y(e,t)},reorderSeqPath(e,t){return b(e,t)},subscribe(e){return r.add(e),()=>{r.delete(e)}},dispose(){c||(c=!0,n.unobserve(u),e.off(`synced`,d),r.clear())}}}function Gie(e,t,n){if(t===0&&n)return!0;let r=t>0?t:Hie,i=0;for(let t of e.delta){if(typeof t.retain==`number`){i+=t.retain;continue}if(typeof t.insert==`string`){if(i<r)return!0;i+=t.insert.length;continue}if(t.insert!==void 0){if(i<r)return!0;i+=1;continue}if(typeof t.delete==`number`&&i<r)return!0}return!1}var Kie=new FQ.default;Kie.Match_Threshold=.5;var E9=/^[a-zA-Z0-9][\w/-]*$/;function qie(e){if(typeof e!=`string`)return!1;let t=e.startsWith(`#`)?e.slice(1):e;return E9.test(t)}var Jie=`Tags must start with a letter or digit and contain only letters, digits, underscores, dashes, and slashes.`,Yie=P(_$),Xie=el({hosts:M(k()),scope:Yie,scripts:j(),installedAt:$s()});el({schema:F(1),skills:il(k(),Xie).default({})});var Zie=100,Qie=500,$ie=450,eae={id:`string`,kind:`enum`,path:`string`,title:`string`,name:`string`,pathSegments:`string`,content:`string`,modifiedTs:`number`},D9=new WeakMap;function tae(e){return e===void 0||!Number.isFinite(e)?20:Math.max(1,Math.min(100,Math.trunc(e)))}function O9(e){return e.trim().toLowerCase()}var nae=/\.(?:md|mdx)$/;function rae(e,t){if(t!==`page`)return e;let n=e.replace(nae,``);return n.length>0?n:e}function k9(e){let t=e.split(`/`).filter(Boolean);return t[t.length-1]??e}function iae(e){let t=k9(e.path),n=e.title?.trim()||t,r=e.modifiedTs??0,i=e.path.split(`/`).filter(Boolean),a=new Set(i),o=[...new Set((e.aliases??[]).flatMap(e=>e.split(`/`).filter(Boolean)).filter(e=>!a.has(e)))];return{id:`${e.kind}:${e.path}`,kind:e.kind,path:e.path,title:n,name:t,pathSegments:[...i,...o].join(` `),content:e.content??``,modifiedTs:Number.isFinite(r)?r:0}}function A9(e){let t=GZ({schema:eae});return e.length>0&&nQ(t,e),t}function aae(e){let t={documents:e};return D9.set(t,A9(e)),t}function oae(e){let t=D9.get(e);if(t)return t;let n=A9(e.documents);return D9.set(e,n),n}function sae(e){return e===`autocomplete`?[`page`]:e===`full_text`?[`page`,`content`,`file`]:[`page`,`folder`,`file`]}function j9(e,t){return t.has(e.kind)?!0:e.kind===`page`&&t.has(`content`)}function cae(e,t){let n=O9(t);if(!n)return 0;let r=rae(n,e.kind),i=O9(e.title),a=O9(e.name),o=O9(e.path),s=o.split(`/`);return i===r||a===r?700:o===r?650:i.startsWith(r)||a.startsWith(r)?600:s.some(e=>e.startsWith(r))?550:i.includes(r)||a.includes(r)?500:o.includes(r)?450:-1}var lae=.5;function M9(e,t){let n=cae(e,t);return n<=0?n:u2(e.path)?n*lae:n}var uae=60;function dae(e){return e===`file`?-uae:0}var fae=1e3,N9=50,pae=1,mae=1,hae=.001;function gae(e,t,n,r,i){let a=i>0?t/i:0,o=N9>0?n/N9:0,s=r===`file`?-hae:0,c=pae*a+mae*o+s;return e*fae+c}function P9(e,t,n,r){return e+t*20+n+dae(r)}function F9(e,t,n,r,i,a){return e===`relevance`?P9(t,n,r,i):gae(t,n,r,i,a)}function _ae(e,t){return t||(e===`full_text`?`relevance`:`navigation`)}function I9(e,t){let n=0;for(let r of e){let e=t.get(r.id)??0;e>n&&(n=e)}return n}function vae(e){let t=e.map(e=>e.modifiedTs).filter(e=>Number.isFinite(e)&&e>0);if(t.length===0)return new Map;let n=1/0,r=-1/0;for(let e of t)e<n&&(n=e),e>r&&(r=e);let i=Math.max(1,r-n);return new Map(e.map(e=>[e.id,e.modifiedTs>0?(e.modifiedTs-n)/i*50:0]))}function yae(e){return e===`full_text`?[`title`,`name`,`path`,`pathSegments`,`content`]:[`title`,`name`,`path`,`pathSegments`]}function bae(e){return e===`full_text`?{title:8,name:7,path:5,pathSegments:4,content:1}:e===`autocomplete`?{title:10,name:9,path:5,pathSegments:4}:{title:8,name:7,path:5,pathSegments:4}}function xae(e,t){return O9(t).length<4?0:+(e===`full_text`)}function Sae(e){let{lexical:t,fullText:n}=e.signals;return t>=Qie?`lexical`:t===$ie&&n<=0?`pathOnly`:`body`}function Cae(e){let t=[],n=[],r=[];for(let i of e){let e=Sae(i);e===`lexical`?t.length<Zie&&t.push(i):e===`body`?n.length<6&&n.push(i):r.length<4&&r.push(i)}return[...t,...n,...r]}function L9(e,t,n){if(t===`relevance`)return e.slice(0,n);let r=Cae(e),i=[],a=0,o=0;for(let e of r){if(e.document.kind===`folder`){if(a>=3)continue;a+=1}else if(e.document.kind===`file`){if(o>=3)continue;o+=1}if(i.push(e),i.length>=n)break}return i}function wae(e,t,n={}){let r=n.intent??`omnibar`,i=_ae(r,n.ranking),a=tae(n.limit),o=new Set(n.scopes??sae(r)),s=e.documents.filter(e=>j9(e,o)),c=O9(t);if(!c)return s.slice().sort((e,t)=>e.path.localeCompare(t.path)).slice(0,a).map(e=>({document:e,score:0,signals:{lexical:0,fullText:0,recency:0}}));let l=MQ(oae(e),{term:c,properties:yae(r),boost:bae(r),tolerance:xae(r,c),limit:Math.max(a*4,40)}),u=new Map(l.hits.filter(e=>j9(e.document,o)).map(e=>[e.document.id,e.score])),d=vae(s),f=new Map;for(let e of s)M9(e,c)>=0&&f.set(e.id,e);for(let e of l.hits)j9(e.document,o)&&f.set(e.document.id,e.document);if(!n.semantic){let e=I9(f.values(),u);return L9([...f.values()].map(t=>{let n=Math.max(0,M9(t,c)),r=u.get(t.id)??0,a=d.get(t.id)??0;return{document:t,score:F9(i,n,r,a,t.kind,e),signals:{lexical:n,fullText:r,recency:a}}}).sort((e,t)=>e.score===t.score?e.document.path.localeCompare(t.document.path):t.score-e.score),i,a)}return L9(Tae({scopedDocuments:s,candidates:f,fullTextScores:u,recency:d,normalizedQuery:c,ranking:i,semantic:n.semantic}),i,a)}function R9(e){let t=new Map;return e.forEach((e,n)=>{t.set(e,n+1)}),t}function Tae(e){let{scopedDocuments:t,candidates:n,fullTextScores:r,recency:i,normalizedQuery:a,ranking:o,semantic:s}=e,c=s.rrfK??60,l=s.candidateLimit??64,u=s.similarityFloor??0,d=s.scores,f=new Map(t.map(e=>[e.id,e])),p=[...d.entries()].filter(([e,t])=>t>=u&&f.has(e)).sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0])).slice(0,l);for(let[e]of p)if(!n.has(e)){let t=f.get(e);t&&n.set(e,t)}let m=I9(n.values(),r),h=[...n.values()].map(e=>{let t=Math.max(0,M9(e,a)),n=r.get(e.id)??0,s=i.get(e.id)??0,c=d.get(e.id),l=c!==void 0&&c>=u;return{document:e,score:t>0?F9(o,t,n,s,e.kind,m):P9(t,n,s,e.kind),signals:l?{lexical:t,fullText:n,recency:s,vector:c}:{lexical:t,fullText:n,recency:s},lexical:t,fullText:n,recency:s,cosine:c}}),g=R9(h.filter(e=>e.fullText>0).sort((e,t)=>t.fullText-e.fullText||e.document.path.localeCompare(t.document.path)).map(e=>e.document.id)),_=R9(h.filter(e=>e.cosine!==void 0&&e.cosine>=u).sort((e,t)=>t.cosine-e.cosine||e.document.path.localeCompare(t.document.path)).map(e=>e.document.id)),v=e=>{let t=0,n=g.get(e);n!==void 0&&(t+=1/(c+n));let r=_.get(e);return r!==void 0&&(t+=1/(c+r)),t};return h.sort((e,t)=>{let n=+(e.lexical>0),r=+(t.lexical>0);if(n!==r)return r-n;if(n===1)return e.score===t.score?e.document.path.localeCompare(t.document.path):t.score-e.score;let i=v(e.document.id),a=v(t.document.id);return i===a?e.recency===t.recency?e.document.path.localeCompare(t.document.path):t.recency-e.recency:a-i}).map(({document:e,score:t,signals:n})=>({document:e,score:t,signals:n}))}function Eae(e){return`https://github.com/${e.owner}/${e.repo}.git`}function Dae(e,t){return!e||e.length===0?`true`:t.detached?`detached`:t.currentBranch===null||t.currentBranch===e?`true`:`false`}var z9=Symbol.for(`@inkeep/open-knowledge/skill-state-field-registry`),B9=globalThis;B9[z9]===void 0&&(B9[z9]=mo());var V9=B9[z9],H9=el({version:k().regex(/^\d+\.\d+\.\d+(?:[-+][\w.-]+)?$/,`version must match /^\\d+\\.\\d+\\.\\d+(?:[-+][\\w.-]+)?$/`).register(V9,{description:`Recorded skill version for this target.`}),recordedAt:$s().register(V9,{description:`ISO 8601 timestamp of the most recent successful write. Updated on every write, including reinstalls of the same version.`}),surface:P([`server-build-and-open`,`electron-build-and-open`,`cli-npx-skills-add`,`desktop-direct`,`cli-start`]).register(V9,{description:`Install-source surface that recorded this entry.`}).optional()});el({schema:F(1).register(V9,{description:`Schema major version. Bumped only on breaking shape changes.`}),targets:el({"claude-cowork":H9.optional(),"cli-hosts":H9.optional()}).register(V9,{description:`Per-target install-state entries. Absent target = no recorded install.`}).default({})});var U9=class extends Error{chunksCompleted;totalChunks;bytesWritten;bytesRemaining;cause;constructor(e,t){let n=e instanceof Error?e.message:typeof e==`string`?e:`unknown error`;super(`chunked insert failed after ${t.chunksCompleted}/${t.totalChunks} chunks (${t.bytesWritten} bytes written, ${t.bytesRemaining} bytes lost): ${n}`),this.name=`ChunkedInsertError`,this.chunksCompleted=t.chunksCompleted,this.totalChunks=t.totalChunks,this.bytesWritten=t.bytesWritten,this.bytesRemaining=t.bytesRemaining,this.cause=e}};async function Oae(e,t,n,r,i={}){let a=i.thresholdBytes??512e3,o=i.chunkSizeBytes??51200,s=i.origin,c=i.yieldFn??kae,l=i.resolveOffset??(e=>e);if(r.length<=a){e.transact(()=>{t.insert(n,r)},s);return}let u=Math.ceil(r.length/o),d=0,f=n,p=0,m=0;for(;d<r.length;){let n=Math.min(d+o,r.length),i=r.slice(d,n);try{let n=l(f);e.transact(()=>{t.insert(n,i)},s)}catch(e){throw new U9(e,{chunksCompleted:p,totalChunks:u,bytesWritten:m,bytesRemaining:r.length-d})}p++,m+=i.length,f+=i.length,d=n,d<r.length&&await c()}}function kae(){return new Promise(e=>{let t=globalThis;t.document?.hidden!==!0&&typeof t.requestAnimationFrame==`function`?t.requestAnimationFrame(()=>e()):setTimeout(()=>e(),0)})}function Aae(){let e=!1,t=``,n=0;return r=>{let i=jae(r);return e?(i&&i.char===t&&i.len>=n&&!i.hasInfo&&(e=!1,t=``,n=0),!0):i?(e=!0,t=i.char,n=i.len,!0):!1}}function jae(e){let t=(e.endsWith(`\r`)?e.slice(0,-1):e).match(/^ {0,3}([`~])(\1{2,})(.*)$/);return t?{char:t[1],len:1+t[2].length,hasInfo:t[3].trim()!==``}:null}var Mae=[`#D97757`,`#1B1912`,`#F9F3E9`,`#7A9DFF`,`#8534F3`,`#9663F0`,`#727CF3`],Nae={claude:`#D97757`,cursor:`#1B1912`,windsurf:`#0B100F`,openai:`#7A9DFF`,github:`#8534F3`,cline:`#9663F0`,bot:`#727CF3`},Pae={cursor:`#FFFFFF`,windsurf:`#FFFFFF`},W9=[`#f0ece3`,`#fff5e1`,`#f9e1db`,`#f5def7`,`#ece2fb`,`#dce8fa`,`#DBF3FB`];function Fae(e,t=Mae){let n=0;for(let t of e)n=(n<<5)-n+t.charCodeAt(0)|0;return t[Math.abs(n)%t.length]}function Iae(e){let t=e.trim();if(!t)return`?`;let n=t.split(/[-\s]+/).filter(Boolean);if(!n.length)return`?`;if(n.length>=2)return n.slice(0,2).map(e=>e[0]??``).join(``).toUpperCase();let r=n[0],i=[r[0]];for(let e=1;e<r.length&&i.length<2;e++){let t=r[e-1],n=r[e];t===t.toLowerCase()&&n===n.toUpperCase()&&n!==n.toLowerCase()&&i.push(n)}return i.length>=2?i.join(``).toUpperCase():r.slice(0,2).toUpperCase()}function Lae(e){let t=e.trim();if(!t)return e;if(t.includes(` `)||!/[-_]/.test(t))return t;let n=t.split(/[-_]+/).filter(Boolean);return n.length?n.map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(` `):t}var Rae={"claude-code":`claude`,"claude-ai":`claude`,cursor:`cursor`,"cursor-vscode":`cursor`,cascade:`windsurf`,codex:`openai`,"codex-mcp-client":`openai`,copilot:`github`,cline:`cline`};function zae(e){return e?Rae[e]||(e.startsWith(`local-agent-mode-`)?`claude`:`bot`):`bot`}function Bae(e){let t=parseInt(e.slice(1,3),16)/255,n=parseInt(e.slice(3,5),16)/255,r=parseInt(e.slice(5,7),16)/255,i=Math.max(t,n,r),a=Math.min(t,n,r),o=(i+a)/2;if(i===a)return[0,0,o*100];let s=i-a,c=o>.5?s/(2-i-a):s/(i+a),l;return l=i===t?((n-r)/s+(n<r?6:0))/6:i===n?((r-t)/s+2)/6:((t-n)/s+4)/6,[l*360,c*100,o*100]}function Vae(e,t,n){let r=t/100,i=n/100,a=r*Math.min(i,1-i),o=t=>{let n=(t+e/30)%12,r=i-a*Math.max(Math.min(n-3,9-n,1),-1);return Math.round(255*r).toString(16).padStart(2,`0`)};return`#${o(0)}${o(8)}${o(4)}`}function Hae(e){let[t]=Bae(e);return Vae(t,45,32)}var Uae=[`Curious`,`Brave`,`Clever`,`Swift`,`Gentle`,`Bright`,`Wise`,`Bold`,`Calm`,`Keen`],Wae=[`Bird`,`Cat`,`Dog`,`Fish`,`Mouse`,`Rabbit`,`Shrimp`,`Snail`,`Squirrel`,`Turtle`],G9=`ok-user-name-v3`,K9=`ok-user-color-v3`;function q9(e){return e[Math.floor(Math.random()*e.length)]}function Gae(){return`${q9(Uae)} ${q9(Wae)}`}function Kae(){return q9(W9)}function J9(e){try{return localStorage.getItem(e)}catch{return null}}function Y9(e,t){try{localStorage.setItem(e,t)}catch{}}function qae(){let e=new URLSearchParams(window.location.search).get(`coeditor`)||`standalone`,t=crypto.randomUUID(),n=J9(G9),r=J9(K9);return n||(n=Gae(),Y9(G9,n)),r||(r=Kae(),Y9(K9,r)),{name:n,color:r,coeditor:e,tabId:t}}function Jae(e,t){let n=e.trim();if(!n||/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n)||n.startsWith(`//`)||n.startsWith(`#`))return null;let r=n.indexOf(`#`),i=r>=0?n.slice(0,r):n,a=r>=0?n.slice(r+1):null,o=(i.split(`?`)[0]??``).trim();if(!o)return null;let s=(o.split(`/`).pop()??``).match(/\.([a-z0-9]+)$/i);if(s){let e=(s[1]??``).toLowerCase();if(e!==`md`&&e!==`mdx`)return null}let c=o.toLowerCase(),l=c.endsWith(`.mdx`)?o.slice(0,-4):c.endsWith(`.md`)?o.slice(0,-3):o,u=l.startsWith(`/`),d=u?l.slice(1):l,f=u?[]:t.includes(`/`)?t.split(`/`).slice(0,-1):[];for(let e of d.split(`/`))if(e===`..`){if(f.length===0)return null;f.pop()}else e!==`.`&&e!==``&&f.push(e);return f.length===0?null:{docName:f.join(`/`),anchor:a||null}}function Yae(e){throw Error(`Unhandled ClassifiedLinkTarget variant: ${JSON.stringify(e)}`)}var X9=/^[a-zA-Z][a-zA-Z\d+\-.]*:/;function Z9(e){let t=(e.split(/[?#]/)[0]??e).match(/\.([a-z0-9]+)$/i);return t?(t[1]??``).toLowerCase():null}function Q9(e){return e.split(`/`).filter(Boolean)}function $9(e){let t=e.trim();return X9.test(t)||t.startsWith(`//`)}function Xae(e,t){let n=e.trim();if(!n)return null;if(n.startsWith(`#`)){let e=n.slice(1).trim();return e?{kind:`anchor`,anchor:e}:null}if($9(n))return{kind:`external`,url:n};let r=Jae(n,t);if(r)return{kind:`doc`,docName:r.docName,anchor:r.anchor};let i=Z9(n);return i&&i!==`md`&&i!==`mdx`?{kind:`asset`,url:n,ext:i}:null}function Zae(e,t){let n=e.trim();if(!n)return null;if($9(n))return{kind:`external`,url:t?`${n}#${t}`:n};let r=Z9(n);return r&&r!==`md`&&r!==`mdx`?{kind:`asset`,url:n,ext:r}:{kind:`doc`,docName:n,anchor:t?.trim()||null}}function Qae(e,t){let n=e.trim();if(!n||X9.test(n)||n.startsWith(`//`)||n.startsWith(`#`))return null;let r=n.indexOf(`#`),i=((r>=0?n.slice(0,r):n).split(`?`)[0]??``).trim();if(!i)return null;let a=i.startsWith(`/`),o=a?i.slice(1):i,s=a?[]:t.includes(`/`)?t.split(`/`).slice(0,-1):[];for(let e of o.split(`/`))if(e===`..`){if(s.length===0)return null;s.pop()}else e!==`.`&&e!==``&&s.push(e);return s.length===0?null:s.join(`/`)}function $ae(e,t,n=null,r=`.md`){let i=Q9(e);i.pop();let a=Q9(t),o=0;for(;o<i.length&&o<a.length&&i[o]===a[o];)o+=1;let s=i.slice(o).map(()=>`..`),c=a.slice(o),l=[...s,...c].join(`/`);return l||=a.at(-1)??t,!l.startsWith(`./`)&&!l.startsWith(`../`)&&(l=`./${l}`),`${l}${r}${n?`#${n}`:``}`}function eoe(e){return e.replace(/[/\\:*?"<>|\0]/g,`-`).replace(/\s+/g,` `).replace(/-+/g,`-`).trim().replace(/^[-.\s]+|[-.\s]+$/g,``)}export{I$ as $,R4 as $n,uS as $r,w0 as $t,s$ as A,Wl as Ai,L3 as An,Bte as Ar,o0 as At,c1 as B,N as Bi,$9 as Bn,tS as Br,f0 as Bt,j$ as C,Rl as Ci,n0 as Cn,o1 as Cr,a2 as Ct,sre as D,zl as Di,W3 as Dn,A7 as Dr,Bre as Dt,Q7 as E,Hl as Ei,zae as En,n1 as Er,Jre as Et,W9 as F,ru as Fi,F3 as Fn,LT as Fr,Wie as Ft,_$ as G,B$ as Gn,SS as Gr,Xae as Gt,v1 as H,ui as Hi,u2 as Hn,qb as Hr,Eae as Ht,P4 as I,mu as Ii,B3 as In,vT as Ir,n$ as It,y0 as J,qie as Jn,gb as Jr,zQ as Jt,Sne as K,m1 as Kn,lS as Kr,Zae as Kt,bre as L,xu as Li,V3 as Ln,XT as Lr,l0 as Lt,Jie as M,su as Mi,z3 as Mn,UO as Mr,r2 as Mt,E9 as N,Ru as Ni,H3 as Nn,KO as Nr,Yae as Nt,Nre as O,Fl as Oi,G3 as On,v0 as Or,F2 as Ot,dre as P,Fu as Pi,R3 as Pn,GO as Pr,XQ as Pt,U$ as Q,Yne as Qn,Jb as Qr,T0 as Qt,g5 as R,Tc as Ri,ere as Rn,nE as Rr,s2 as Rt,jre as S,jl as Si,qae as Sn,c0 as Sr,Xre as St,a9 as T,Ul as Ti,L4 as Tn,WQ as Tr,Y1 as Tt,mre as U,fi as Ui,J4 as Un,wS as Ur,Oae as Ut,A$ as V,k as Vi,rre as Vn,Bx as Vr,$ae as Vt,g$ as W,ai as Wi,v$ as Wn,TS as Wr,Dae as Wt,yre as X,D$ as Xn,Db as Xr,Fae as Xt,z$ as Y,X4 as Yn,Tb as Yr,X$ as Yt,H$ as Z,Xne as Zn,Ob as Zr,K0 as Zt,f$ as _,Tf as _i,w7 as _n,wae as _r,S2 as _t,Dre as a,iS as ai,Iae as an,q4 as ar,BQ as at,W$ as b,hd as bi,gie as bn,C$ as br,Qre as bt,fie as c,rv as ci,aae as cn,UQ as cr,Rre as ct,uie as d,B as di,R$ as dn,b$ as dr,y$ as dt,Ny as ei,x0 as en,r$ as er,Ire as et,sie as f,qp as fi,c$ as fn,d9 as fr,Yre as ft,p$ as g,z as gi,Z$ as gn,eoe as gr,C2 as gt,d$ as h,Op as hi,xie as hn,mie as hr,v2 as ht,Ere as i,xS as ii,b0 as in,S$ as ir,VQ as it,e1 as j,Al as ji,U3 as jn,Ite as jr,vre as jt,P$ as k,Il as ki,I3 as kn,k9 as kr,r0 as kt,die as l,Lv as li,iae as ln,t0 as lr,u1 as lt,m$ as m,R as mi,Z9 as mn,Qae as mr,M2 as mt,Pae as n,hb as ni,W0 as nn,p7 as nr,N2 as nt,lre as o,Xv as oi,Aae as on,T$ as or,B7 as ot,IQ as p,Xp as pi,i0 as pn,u9 as pr,u$ as pt,O1 as q,p1 as qn,nb as qr,RQ as qt,N$ as r,Xb as ri,S0 as rn,e0 as rr,P2 as rt,cie as s,ev as si,A3 as sn,_ie as sr,k1 as st,Nae as t,uy as ti,C0 as tn,Y$ as tr,Pre as tt,lie as u,Np as ui,Hae as un,t3 as ur,f1 as ut,O$ as v,sf as vi,Lae as vn,s0 as vr,E2 as vt,zre as w,gu as wi,l$ as wn,k7 as wr,o2 as wt,Mre as x,L as xi,Pne as xn,t1 as xr,Zre as xt,U9 as y,I as yi,G7 as yn,i2 as yr,e9 as yt,s1 as z,F as zi,M$ as zn,qT as zr,u0 as zt};
|
|
528
|
+
`)?e.slice(0,-1):e}\n---\n`}var s9=65536;function c9(e){let t=e.match($$);return t?{fenced:t[0],body:e.slice(t[0].length)}:{fenced:``,body:e}}function Tie(e){if(e.trim()===``)return{doc:new pn({}),map:{}};let t;try{t=vr(e,{uniqueKeys:!1})}catch(e){let t=e instanceof Error?e.message:String(e);return{doc:new pn({}),map:null,parseError:`parse threw: ${t}`}}if(t.errors.length>0)return{doc:t,map:null,parseError:t.errors[0]?.message??`yaml parse errors`};let n;try{n=t.toJS()}catch(e){let n=e instanceof Error?e.message:String(e);return{doc:t,map:null,parseError:`toJS threw: ${n}`}}if(typeof n!=`object`||!n||Array.isArray(n))return{doc:t,map:null,parseError:`top-level value is not a mapping`};let r=tre.safeParse(n);if(!r.success){let e=r.error.issues[0],n=e&&Array.isArray(e.path)?e.path.join(`.`):``,i=e?.message??`unknown`;return{doc:t,map:null,parseError:n?`value at "${n}" failed schema: ${i}`:`schema validation failed: ${i}`}}return{doc:t,map:r.data}}function l9(e){return e===``?{doc:new pn({}),map:{}}:Tie(n1(e))}function u9(e){let{fenced:t}=c9(e),{map:n,parseError:r}=l9(t);return{map:n??{},parseError:r}}function d9(e){let{fenced:t}=c9(e);if(t===``)return[];let{doc:n,map:r}=l9(t);return r===null?[]:h9(n)}function f9(e){return typeof e==`object`&&!!e&&`key`in e}function p9(e){let t=e.key;return typeof t==`string`?t:t&&typeof t==`object`&&`value`in t&&typeof t.value==`string`?t.value:null}function m9(e,t){let n=e.key;if(typeof n==`string`){e.key=t;return}if(n&&typeof n==`object`){n.value=t;return}e.key=t}function h9(e){let t=e.contents;if(!t||!(`items`in t)||!Array.isArray(t.items))return[];let n=[];for(let e of t.items){if(!f9(e))continue;let t=p9(e);t!==null&&n.push(t)}return n}function g9(e){if(e.contents==null||!(`items`in e.contents)){let t=e.createNode({});return e.contents=t,t}return e.contents}function Eie(e){let t=e.contents;return!t||!(`items`in t)||(t.items?.length??0)===0?``:wie(e.toString(Sie))}function Die(e){let t=new TextEncoder().encode(e).byteLength;return t>65536?{kind:`region_too_large`,bytes:t,limit:s9}:null}function _9(e){let t=Eie(e),n=Die(t);return n?{ok:!1,error:n}:{ok:!0,nextFenced:t}}function Oie(e,t){if(Object.hasOwn(t,`frontmatter`))return{ok:!1,error:{kind:`reserved_key`,key:B7}};let{doc:n,map:r}=l9(e);if(r===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};try{g9(n);for(let[e,r]of Object.entries(t)){if(r===null){n.delete(e);continue}let t=U7.safeParse(r);if(!t.success)return{ok:!1,error:{kind:`invalid_value`,key:e,reason:t.error.issues[0]?.message??`invalid value`}};n.set(e,o9(n,n.get(e,!0),t.data))}return _9(n)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function kie(e,t,n,r={}){if(t===`frontmatter`||n===`frontmatter`)return{ok:!1,error:{kind:`reserved_key`,key:B7}};let{doc:i,map:a}=l9(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};if(t===n)return{ok:!0,nextFenced:e};let o=i.contents;if(!o||!(`items`in o)||!Array.isArray(o.items))return{ok:!1,error:{kind:`unknown_key`,key:t}};let s=o.items.find(e=>f9(e)&&p9(e)===t);if(!s)return{ok:!1,error:{kind:`unknown_key`,key:t}};if(!r.allowDuplicate&&o.items.some(e=>f9(e)&&e!==s&&p9(e)===n))return{ok:!1,error:{kind:`duplicate_target`,key:n}};try{return m9(s,n),_9(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function v9(e,t){let{doc:n,map:r}=l9(e);if(r===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let i=n.contents;if(!i||!(`items`in i)||!Array.isArray(i.items))return{ok:!0,nextFenced:e};let a=h9(n);if(a.length!==t.length||!y9(a,t))return{ok:!1,error:{kind:`reorder_mismatch`,expected:a,got:[...t]}};try{let e=i.items.filter(f9),r=[];for(let n of t){let i=e.findIndex(e=>p9(e)===n);if(i===-1)return{ok:!1,error:{kind:`reorder_mismatch`,expected:a,got:[...t]}};let[o]=e.splice(i,1);o&&r.push(o)}return i.items=r,_9(n)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function y9(e,t){let n=new Map;for(let t of e)n.set(t,(n.get(t)??0)+1);for(let e of t){let t=(n.get(e)??0)-1;if(t<0)return!1;n.set(e,t)}for(let e of n.values())if(e!==0)return!1;return!0}function b9(e){if(e.length===0)return{kind:`invalid_path`,path:[...e],reason:`path must have at least one segment`};for(let t=0;t<e.length;t++){let n=e[t];if(typeof n!=`string`&&typeof n!=`number`)return{kind:`invalid_path`,path:[...e],reason:`path segment at index ${t} must be string or number`};if(typeof n==`number`&&(!Number.isInteger(n)||n<0))return{kind:`invalid_path`,path:[...e],reason:`numeric path segment at index ${t} must be a non-negative integer`}}return e[0]===`frontmatter`?{kind:`reserved_key`,key:B7}:null}function Aie(e,t,n){let r=b9(t);if(r)return{ok:!1,error:r};let{doc:i,map:a}=l9(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let o=U7.safeParse(n);if(!o.success)return{ok:!1,error:{kind:`invalid_value`,key:String(t[t.length-1]),reason:o.error.issues[0]?.message??`invalid value`}};try{return g9(i),i.setIn(t,o9(i,i.getIn(t,!0),o.data)),_9(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function jie(e,t){let n=b9(t);if(n)return{ok:!1,error:n};let{doc:r,map:i}=l9(e);if(i===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};try{return r.getIn(t,!0)===void 0?{ok:!0,nextFenced:e}:(r.deleteIn(t),_9(r))}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function Mie(e,t){if(t.length===0){let t=e.contents;return g(t)?t:null}let n=e.getIn(t,!0);return g(n)?n:null}function Nie(e,t,n,r={}){let i=b9(t);if(i)return{ok:!1,error:i};let a=t[t.length-1];if(typeof a!=`string`)return{ok:!1,error:{kind:`invalid_path`,path:[...t],reason:`cannot rename: last path segment must be a string (map key)`}};if(t.length===1&&n===`frontmatter`)return{ok:!1,error:{kind:`reserved_key`,key:B7}};let{doc:o,map:s}=l9(e);if(s===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};if(a===n)return{ok:!0,nextFenced:e};let c=Mie(o,t.slice(0,-1));if(!c)return{ok:!1,error:{kind:`unknown_key`,key:a}};let l=c.items.find(e=>f9(e)&&p9(e)===a);if(!l)return{ok:!1,error:{kind:`unknown_key`,key:a}};if(!r.allowDuplicate&&c.items.some(e=>f9(e)&&e!==l&&p9(e)===n))return{ok:!1,error:{kind:`duplicate_target`,key:n}};try{return m9(l,n),_9(o)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function Pie(e,t,n){if(t.length===0)return v9(e,n);let r=b9(t);if(r)return{ok:!1,error:r};let{doc:i,map:a}=l9(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let o=i.getIn(t,!0);if(!g(o))return{ok:!1,error:{kind:`invalid_path`,path:[...t],reason:`cannot reorder: target is not a map`}};let s=[];for(let e of o.items){if(!f9(e))continue;let t=p9(e);t!==null&&s.push(t)}if(s.length!==n.length||!y9(s,n))return{ok:!1,error:{kind:`reorder_mismatch`,expected:s,got:[...n]}};try{let e=o.items.filter(f9),t=[];for(let r of n){let i=e.findIndex(e=>p9(e)===r);if(i===-1)return{ok:!1,error:{kind:`reorder_mismatch`,expected:s,got:[...n]}};let[a]=e.splice(i,1);a&&t.push(a)}return o.items=t,_9(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function Fie(e,t,n){let r=b9(t);if(r)return{ok:!1,error:r};let{doc:i,map:a}=l9(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let o=i.getIn(t,!0);if(!y(o))return{ok:!1,error:{kind:`invalid_path`,path:[...t],reason:`cannot reorder: target is not a sequence`}};let s=o,c=s.items.length,l=Array.from({length:c},(e,t)=>t),u=[...n];if(!Iie(u,c))return{ok:!1,error:{kind:`reorder_mismatch`,expected:l.map(String),got:u.map(String)}};try{let e=s.items.slice();return s.items=u.map(t=>e[t]),_9(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function Iie(e,t){if(e.length!==t)return!1;let n=Array(t).fill(!1);for(let r of e){if(!Number.isInteger(r)||r<0||r>=t||n[r])return!1;n[r]=!0}return!0}var Lie=Object.freeze({source:`local`,skipStoreHooks:!1,context:Object.freeze({origin:`form-write`})});function x9(e){return{ok:!1,error:e}}function Rie(e){return{ok:!0,...e}}function zie(e){return{ok:!0,...e}}function Bie(e){return{ok:!0,...e}}function S9(e){return{ok:!0,...e}}function C9(e){switch(e.kind){case`unknown_key`:return{code:`SCHEMA_INVALID`,issues:[{path:[e.key],message:`unknown key '${e.key}'`,issueCode:`unknown_key`}]};case`duplicate_target`:return{code:`SCHEMA_INVALID`,issues:[{path:[e.key],message:`key '${e.key}' already exists`,issueCode:`duplicate_target`}]};case`invalid_value`:return{code:`SCHEMA_INVALID`,issues:[{path:[e.key],message:e.reason,issueCode:`invalid_value`}]};case`reserved_key`:return{code:`SCHEMA_INVALID`,issues:[{path:[e.key],message:`'${e.key}' is a reserved frontmatter key`,issueCode:`reserved_key`}]};case`reorder_mismatch`:return{code:`WRITE_ERROR`,detail:`reorder list does not match current keys (state changed mid-drag)`};case`region_too_large`:return{code:`SCHEMA_INVALID`,issues:[{path:[],message:`Frontmatter region exceeds ${s9}-byte limit (would be ${e.bytes})`,issueCode:`region_too_large`}]};case`parse_failed`:return{code:`WRITE_ERROR`,detail:`Frontmatter YAML is malformed; fix in source mode to commit (${e.reason})`};case`invalid_path`:return{code:`SCHEMA_INVALID`,issues:[{path:[...e.path],message:e.reason,issueCode:`invalid_path`}]}}}function Vie(e,t){if(e.parseError!==t.parseError||e.keys.length!==t.keys.length)return!1;for(let n=0;n<e.keys.length;n++)if(e.keys[n]!==t.keys[n])return!1;for(let n of e.keys)if(!G7(e.map[n],t.map[n]))return!1;return!0}var Hie=5;function w9(e){let t=e.toString();return{snapshot:Uie(t),raw:t}}function Uie(e){let{map:t,parseError:n}=u9(e);return{map:t,keys:d9(e),parseError:n}}function T9(e){return e.startsWith(`---`)}function Wie(e){let t=e.document,n=t.getText(`source`),r=new Set,i=w9(n),a=i.snapshot,o=c9(i.raw).fenced,s=T9(i.raw),c=!1;function l(e=!1){if(c)return;let t,i;try{let e=w9(n);t=e.snapshot,i=e.raw}catch(e){console.warn(`[bindFrontmatterDoc] readSnapshotFromYText threw:`,e);return}if(!e&&Vie(a,t)){s=T9(i);return}a=t,o=c9(i).fenced,s=T9(i);for(let e of r)try{e(t)}catch(e){console.warn(`[bindFrontmatterDoc] listener threw:`,e)}}let u=e=>{c||Gie(e,o.length,s)&&l()};n.observe(u),e.on(`synced`,d);function d(){l(!0)}function f(e){let r;return t.transact(()=>{let{fenced:t}=c9(n.toString());r=e(t),r.ok&&r.nextFenced!==t&&(n.delete(0,t.length),r.nextFenced!==``&&n.insert(0,r.nextFenced))},Lie),r??{ok:!1,error:{kind:`parse_failed`,reason:`commit transact produced no result`}}}function p(e){if(c)return x9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});if(Object.hasOwn(e,`frontmatter`))return x9({code:`SCHEMA_INVALID`,issues:[{path:[B7],message:`'${B7}' is a reserved frontmatter key`,issueCode:`reserved_key`}]});let t=nre.safeParse(e);if(!t.success)return x9({code:`SCHEMA_INVALID`,issues:t.error.issues.map(bie)});let n=t.data,r=Object.keys(n),i=f(e=>Oie(e,n));return i.ok?Rie({appliedKeys:r}):x9(C9(i.error))}function m(e,t,n={}){if(c)return x9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let r=f(r=>kie(r,e,t,n));return r.ok?zie({oldKey:e,newKey:t}):x9(C9(r.error))}function h(e){if(c)return x9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let t=f(t=>v9(t,e));return t.ok?Bie({orderedKeys:[...e]}):x9(C9(t.error))}function g(e,t){if(c)return x9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let n=f(n=>Aie(n,e,t));return n.ok?S9({path:[...e]}):x9(C9(n.error))}function _(e){if(c)return x9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let t=f(t=>jie(t,e));return t.ok?S9({path:[...e]}):x9(C9(t.error))}function v(e,t,n={}){if(c)return x9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let r=f(r=>Nie(r,e,t,n));return r.ok?S9({path:[...e]}):x9(C9(r.error))}function y(e,t){if(c)return x9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let n=f(n=>Pie(n,e,t));return n.ok?S9({path:[...e]}):x9(C9(n.error))}function b(e,t){if(c)return x9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let n=f(n=>Fie(n,e,t));return n.ok?S9({path:[...e]}):x9(C9(n.error))}return{current(){return w9(n).snapshot},patch(e){return p(e)},rename(e,t,n){return m(e,t,n)},reorder(e){return h(e)},patchPath(e,t){return g(e,t)},deletePath(e){return _(e)},renamePath(e,t,n){return v(e,t,n)},reorderPath(e,t){return y(e,t)},reorderSeqPath(e,t){return b(e,t)},subscribe(e){return r.add(e),()=>{r.delete(e)}},dispose(){c||(c=!0,n.unobserve(u),e.off(`synced`,d),r.clear())}}}function Gie(e,t,n){if(t===0&&n)return!0;let r=t>0?t:Hie,i=0;for(let t of e.delta){if(typeof t.retain==`number`){i+=t.retain;continue}if(typeof t.insert==`string`){if(i<r)return!0;i+=t.insert.length;continue}if(t.insert!==void 0){if(i<r)return!0;i+=1;continue}if(typeof t.delete==`number`&&i<r)return!0}return!1}var Kie=new FQ.default;Kie.Match_Threshold=.5;var E9=/^[a-zA-Z0-9][\w/-]*$/;function qie(e){if(typeof e!=`string`)return!1;let t=e.startsWith(`#`)?e.slice(1):e;return E9.test(t)}var Jie=`Tags must start with a letter or digit and contain only letters, digits, underscores, dashes, and slashes.`,Yie=P(_$),Xie=el({hosts:M(k()),scope:Yie,scripts:j(),installedAt:$s()});el({schema:F(1),skills:il(k(),Xie).default({})});var Zie=100,Qie=500,$ie=450,eae={id:`string`,kind:`enum`,path:`string`,title:`string`,name:`string`,pathSegments:`string`,content:`string`,modifiedTs:`number`},D9=new WeakMap;function tae(e){return e===void 0||!Number.isFinite(e)?20:Math.max(1,Math.min(100,Math.trunc(e)))}function O9(e){return e.trim().toLowerCase()}var nae=/\.(?:md|mdx)$/;function rae(e,t){if(t!==`page`)return e;let n=e.replace(nae,``);return n.length>0?n:e}function k9(e){let t=e.split(`/`).filter(Boolean);return t[t.length-1]??e}function iae(e){let t=k9(e.path),n=e.title?.trim()||t,r=e.modifiedTs??0,i=e.path.split(`/`).filter(Boolean),a=new Set(i),o=[...new Set((e.aliases??[]).flatMap(e=>e.split(`/`).filter(Boolean)).filter(e=>!a.has(e)))];return{id:`${e.kind}:${e.path}`,kind:e.kind,path:e.path,title:n,name:t,pathSegments:[...i,...o].join(` `),content:e.content??``,modifiedTs:Number.isFinite(r)?r:0}}function A9(e){let t=GZ({schema:eae});return e.length>0&&nQ(t,e),t}function aae(e){let t={documents:e};return D9.set(t,A9(e)),t}function oae(e){let t=D9.get(e);if(t)return t;let n=A9(e.documents);return D9.set(e,n),n}function sae(e){return e===`autocomplete`?[`page`]:e===`full_text`?[`page`,`content`,`file`]:[`page`,`folder`,`file`]}function j9(e,t){return t.has(e.kind)?!0:e.kind===`page`&&t.has(`content`)}function cae(e,t){let n=O9(t);if(!n)return 0;let r=rae(n,e.kind),i=O9(e.title),a=O9(e.name),o=O9(e.path),s=o.split(`/`);return i===r||a===r?700:o===r?650:i.startsWith(r)||a.startsWith(r)?600:s.some(e=>e.startsWith(r))?550:i.includes(r)||a.includes(r)?500:o.includes(r)?450:-1}var lae=.5;function M9(e,t){let n=cae(e,t);return n<=0?n:u2(e.path)?n*lae:n}var uae=60;function dae(e){return e===`file`?-uae:0}var fae=1e3,N9=50,pae=1,mae=1,hae=.001;function gae(e,t,n,r,i){let a=i>0?t/i:0,o=N9>0?n/N9:0,s=r===`file`?-hae:0,c=pae*a+mae*o+s;return e*fae+c}function P9(e,t,n,r){return e+t*20+n+dae(r)}function F9(e,t,n,r,i,a){return e===`relevance`?P9(t,n,r,i):gae(t,n,r,i,a)}function _ae(e,t){return t||(e===`full_text`?`relevance`:`navigation`)}function I9(e,t){let n=0;for(let r of e){let e=t.get(r.id)??0;e>n&&(n=e)}return n}function vae(e){let t=e.map(e=>e.modifiedTs).filter(e=>Number.isFinite(e)&&e>0);if(t.length===0)return new Map;let n=1/0,r=-1/0;for(let e of t)e<n&&(n=e),e>r&&(r=e);let i=Math.max(1,r-n);return new Map(e.map(e=>[e.id,e.modifiedTs>0?(e.modifiedTs-n)/i*50:0]))}function yae(e){return e===`full_text`?[`title`,`name`,`path`,`pathSegments`,`content`]:[`title`,`name`,`path`,`pathSegments`]}function bae(e){return e===`full_text`?{title:8,name:7,path:5,pathSegments:4,content:1}:e===`autocomplete`?{title:10,name:9,path:5,pathSegments:4}:{title:8,name:7,path:5,pathSegments:4}}function xae(e,t){return O9(t).length<4?0:+(e===`full_text`)}function Sae(e){let{lexical:t,fullText:n}=e.signals;return t>=Qie?`lexical`:t===$ie&&n<=0?`pathOnly`:`body`}function Cae(e){let t=[],n=[],r=[];for(let i of e){let e=Sae(i);e===`lexical`?t.length<Zie&&t.push(i):e===`body`?n.length<6&&n.push(i):r.length<4&&r.push(i)}return[...t,...n,...r]}function L9(e,t,n){if(t===`relevance`)return e.slice(0,n);let r=Cae(e),i=[],a=0,o=0;for(let e of r){if(e.document.kind===`folder`){if(a>=3)continue;a+=1}else if(e.document.kind===`file`){if(o>=3)continue;o+=1}if(i.push(e),i.length>=n)break}return i}function wae(e,t,n={}){let r=n.intent??`omnibar`,i=_ae(r,n.ranking),a=tae(n.limit),o=new Set(n.scopes??sae(r)),s=e.documents.filter(e=>j9(e,o)),c=O9(t);if(!c)return s.slice().sort((e,t)=>e.path.localeCompare(t.path)).slice(0,a).map(e=>({document:e,score:0,signals:{lexical:0,fullText:0,recency:0}}));let l=MQ(oae(e),{term:c,properties:yae(r),boost:bae(r),tolerance:xae(r,c),limit:Math.max(a*4,40)}),u=new Map(l.hits.filter(e=>j9(e.document,o)).map(e=>[e.document.id,e.score])),d=vae(s),f=new Map;for(let e of s)M9(e,c)>=0&&f.set(e.id,e);for(let e of l.hits)j9(e.document,o)&&f.set(e.document.id,e.document);if(!n.semantic){let e=I9(f.values(),u);return L9([...f.values()].map(t=>{let n=Math.max(0,M9(t,c)),r=u.get(t.id)??0,a=d.get(t.id)??0;return{document:t,score:F9(i,n,r,a,t.kind,e),signals:{lexical:n,fullText:r,recency:a}}}).sort((e,t)=>e.score===t.score?e.document.path.localeCompare(t.document.path):t.score-e.score),i,a)}return L9(Tae({scopedDocuments:s,candidates:f,fullTextScores:u,recency:d,normalizedQuery:c,ranking:i,semantic:n.semantic}),i,a)}function R9(e){let t=new Map;return e.forEach((e,n)=>{t.set(e,n+1)}),t}function Tae(e){let{scopedDocuments:t,candidates:n,fullTextScores:r,recency:i,normalizedQuery:a,ranking:o,semantic:s}=e,c=s.rrfK??60,l=s.candidateLimit??64,u=s.similarityFloor??0,d=s.scores,f=new Map(t.map(e=>[e.id,e])),p=[...d.entries()].filter(([e,t])=>t>=u&&f.has(e)).sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0])).slice(0,l);for(let[e]of p)if(!n.has(e)){let t=f.get(e);t&&n.set(e,t)}let m=I9(n.values(),r),h=[...n.values()].map(e=>{let t=Math.max(0,M9(e,a)),n=r.get(e.id)??0,s=i.get(e.id)??0,c=d.get(e.id),l=c!==void 0&&c>=u;return{document:e,score:t>0?F9(o,t,n,s,e.kind,m):P9(t,n,s,e.kind),signals:l?{lexical:t,fullText:n,recency:s,vector:c}:{lexical:t,fullText:n,recency:s},lexical:t,fullText:n,recency:s,cosine:c}}),g=R9(h.filter(e=>e.fullText>0).sort((e,t)=>t.fullText-e.fullText||e.document.path.localeCompare(t.document.path)).map(e=>e.document.id)),_=R9(h.filter(e=>e.cosine!==void 0&&e.cosine>=u).sort((e,t)=>t.cosine-e.cosine||e.document.path.localeCompare(t.document.path)).map(e=>e.document.id)),v=e=>{let t=0,n=g.get(e);n!==void 0&&(t+=1/(c+n));let r=_.get(e);return r!==void 0&&(t+=1/(c+r)),t};return h.sort((e,t)=>{let n=+(e.lexical>0),r=+(t.lexical>0);if(n!==r)return r-n;if(n===1)return e.score===t.score?e.document.path.localeCompare(t.document.path):t.score-e.score;let i=v(e.document.id),a=v(t.document.id);return i===a?e.recency===t.recency?e.document.path.localeCompare(t.document.path):t.recency-e.recency:a-i}).map(({document:e,score:t,signals:n})=>({document:e,score:t,signals:n}))}function Eae(e){return`https://github.com/${e.owner}/${e.repo}.git`}function Dae(e,t){return!e||e.length===0?`true`:t.detached?`detached`:t.currentBranch===null||t.currentBranch===e?`true`:`false`}var z9=Symbol.for(`@inkeep/open-knowledge/skill-state-field-registry`),B9=globalThis;B9[z9]===void 0&&(B9[z9]=mo());var V9=B9[z9],H9=el({version:k().regex(/^\d+\.\d+\.\d+(?:[-+][\w.-]+)?$/,`version must match /^\\d+\\.\\d+\\.\\d+(?:[-+][\\w.-]+)?$/`).register(V9,{description:`Recorded skill version for this target.`}),recordedAt:$s().register(V9,{description:`ISO 8601 timestamp of the most recent successful write. Updated on every write, including reinstalls of the same version.`}),surface:P([`server-build-and-open`,`electron-build-and-open`,`cli-npx-skills-add`,`desktop-direct`,`cli-start`]).register(V9,{description:`Install-source surface that recorded this entry.`}).optional()}),Oae=el({enabled:j().register(V9,{description:`Whether this user-global skill bundle is opted in.`}),decidedAt:$s().register(V9,{description:`ISO 8601 timestamp of the opt-in / opt-out decision.`})});el({schema:F(1).register(V9,{description:`Schema major version. Bumped only on breaking shape changes.`}),targets:el({"claude-cowork":H9.optional(),"cli-hosts":H9.optional()}).register(V9,{description:`Per-target install-state entries. Absent target = no recorded install.`}).default({}),bundles:il(k(),Oae).register(V9,{description:`Per-bundle opt-in decisions keyed by install name. Absent key = no recorded decision.`}).optional()});var U9=class extends Error{chunksCompleted;totalChunks;bytesWritten;bytesRemaining;cause;constructor(e,t){let n=e instanceof Error?e.message:typeof e==`string`?e:`unknown error`;super(`chunked insert failed after ${t.chunksCompleted}/${t.totalChunks} chunks (${t.bytesWritten} bytes written, ${t.bytesRemaining} bytes lost): ${n}`),this.name=`ChunkedInsertError`,this.chunksCompleted=t.chunksCompleted,this.totalChunks=t.totalChunks,this.bytesWritten=t.bytesWritten,this.bytesRemaining=t.bytesRemaining,this.cause=e}};async function kae(e,t,n,r,i={}){let a=i.thresholdBytes??512e3,o=i.chunkSizeBytes??51200,s=i.origin,c=i.yieldFn??Aae,l=i.resolveOffset??(e=>e);if(r.length<=a){e.transact(()=>{t.insert(n,r)},s);return}let u=Math.ceil(r.length/o),d=0,f=n,p=0,m=0;for(;d<r.length;){let n=Math.min(d+o,r.length),i=r.slice(d,n);try{let n=l(f);e.transact(()=>{t.insert(n,i)},s)}catch(e){throw new U9(e,{chunksCompleted:p,totalChunks:u,bytesWritten:m,bytesRemaining:r.length-d})}p++,m+=i.length,f+=i.length,d=n,d<r.length&&await c()}}function Aae(){return new Promise(e=>{let t=globalThis;t.document?.hidden!==!0&&typeof t.requestAnimationFrame==`function`?t.requestAnimationFrame(()=>e()):setTimeout(()=>e(),0)})}function jae(){let e=!1,t=``,n=0;return r=>{let i=Mae(r);return e?(i&&i.char===t&&i.len>=n&&!i.hasInfo&&(e=!1,t=``,n=0),!0):i?(e=!0,t=i.char,n=i.len,!0):!1}}function Mae(e){let t=(e.endsWith(`\r`)?e.slice(0,-1):e).match(/^ {0,3}([`~])(\1{2,})(.*)$/);return t?{char:t[1],len:1+t[2].length,hasInfo:t[3].trim()!==``}:null}var Nae=[`#D97757`,`#1B1912`,`#F9F3E9`,`#7A9DFF`,`#8534F3`,`#9663F0`,`#727CF3`],Pae={claude:`#D97757`,cursor:`#1B1912`,windsurf:`#0B100F`,openai:`#7A9DFF`,github:`#8534F3`,cline:`#9663F0`,bot:`#727CF3`},Fae={cursor:`#FFFFFF`,windsurf:`#FFFFFF`},W9=[`#f0ece3`,`#fff5e1`,`#f9e1db`,`#f5def7`,`#ece2fb`,`#dce8fa`,`#DBF3FB`];function Iae(e,t=Nae){let n=0;for(let t of e)n=(n<<5)-n+t.charCodeAt(0)|0;return t[Math.abs(n)%t.length]}function Lae(e){let t=e.trim();if(!t)return`?`;let n=t.split(/[-\s]+/).filter(Boolean);if(!n.length)return`?`;if(n.length>=2)return n.slice(0,2).map(e=>e[0]??``).join(``).toUpperCase();let r=n[0],i=[r[0]];for(let e=1;e<r.length&&i.length<2;e++){let t=r[e-1],n=r[e];t===t.toLowerCase()&&n===n.toUpperCase()&&n!==n.toLowerCase()&&i.push(n)}return i.length>=2?i.join(``).toUpperCase():r.slice(0,2).toUpperCase()}function Rae(e){let t=e.trim();if(!t)return e;if(t.includes(` `)||!/[-_]/.test(t))return t;let n=t.split(/[-_]+/).filter(Boolean);return n.length?n.map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(` `):t}var zae={"claude-code":`claude`,"claude-ai":`claude`,cursor:`cursor`,"cursor-vscode":`cursor`,cascade:`windsurf`,codex:`openai`,"codex-mcp-client":`openai`,copilot:`github`,cline:`cline`};function Bae(e){return e?zae[e]||(e.startsWith(`local-agent-mode-`)?`claude`:`bot`):`bot`}function Vae(e){let t=parseInt(e.slice(1,3),16)/255,n=parseInt(e.slice(3,5),16)/255,r=parseInt(e.slice(5,7),16)/255,i=Math.max(t,n,r),a=Math.min(t,n,r),o=(i+a)/2;if(i===a)return[0,0,o*100];let s=i-a,c=o>.5?s/(2-i-a):s/(i+a),l;return l=i===t?((n-r)/s+(n<r?6:0))/6:i===n?((r-t)/s+2)/6:((t-n)/s+4)/6,[l*360,c*100,o*100]}function Hae(e,t,n){let r=t/100,i=n/100,a=r*Math.min(i,1-i),o=t=>{let n=(t+e/30)%12,r=i-a*Math.max(Math.min(n-3,9-n,1),-1);return Math.round(255*r).toString(16).padStart(2,`0`)};return`#${o(0)}${o(8)}${o(4)}`}function Uae(e){let[t]=Vae(e);return Hae(t,45,32)}var Wae=[`Curious`,`Brave`,`Clever`,`Swift`,`Gentle`,`Bright`,`Wise`,`Bold`,`Calm`,`Keen`],Gae=[`Bird`,`Cat`,`Dog`,`Fish`,`Mouse`,`Rabbit`,`Shrimp`,`Snail`,`Squirrel`,`Turtle`],G9=`ok-user-name-v3`,K9=`ok-user-color-v3`;function q9(e){return e[Math.floor(Math.random()*e.length)]}function Kae(){return`${q9(Wae)} ${q9(Gae)}`}function qae(){return q9(W9)}function J9(e){try{return localStorage.getItem(e)}catch{return null}}function Y9(e,t){try{localStorage.setItem(e,t)}catch{}}function Jae(){let e=new URLSearchParams(window.location.search).get(`coeditor`)||`standalone`,t=crypto.randomUUID(),n=J9(G9),r=J9(K9);return n||(n=Kae(),Y9(G9,n)),r||(r=qae(),Y9(K9,r)),{name:n,color:r,coeditor:e,tabId:t}}function Yae(e,t){let n=e.trim();if(!n||/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n)||n.startsWith(`//`)||n.startsWith(`#`))return null;let r=n.indexOf(`#`),i=r>=0?n.slice(0,r):n,a=r>=0?n.slice(r+1):null,o=(i.split(`?`)[0]??``).trim();if(!o)return null;let s=(o.split(`/`).pop()??``).match(/\.([a-z0-9]+)$/i);if(s){let e=(s[1]??``).toLowerCase();if(e!==`md`&&e!==`mdx`)return null}let c=o.toLowerCase(),l=c.endsWith(`.mdx`)?o.slice(0,-4):c.endsWith(`.md`)?o.slice(0,-3):o,u=l.startsWith(`/`),d=u?l.slice(1):l,f=u?[]:t.includes(`/`)?t.split(`/`).slice(0,-1):[];for(let e of d.split(`/`))if(e===`..`){if(f.length===0)return null;f.pop()}else e!==`.`&&e!==``&&f.push(e);return f.length===0?null:{docName:f.join(`/`),anchor:a||null}}function Xae(e){throw Error(`Unhandled ClassifiedLinkTarget variant: ${JSON.stringify(e)}`)}var X9=/^[a-zA-Z][a-zA-Z\d+\-.]*:/;function Z9(e){let t=(e.split(/[?#]/)[0]??e).match(/\.([a-z0-9]+)$/i);return t?(t[1]??``).toLowerCase():null}function Q9(e){return e.split(`/`).filter(Boolean)}function $9(e){let t=e.trim();return X9.test(t)||t.startsWith(`//`)}function Zae(e,t){let n=e.trim();if(!n)return null;if(n.startsWith(`#`)){let e=n.slice(1).trim();return e?{kind:`anchor`,anchor:e}:null}if($9(n))return{kind:`external`,url:n};let r=Yae(n,t);if(r)return{kind:`doc`,docName:r.docName,anchor:r.anchor};let i=Z9(n);return i&&i!==`md`&&i!==`mdx`?{kind:`asset`,url:n,ext:i}:null}function Qae(e,t){let n=e.trim();if(!n)return null;if($9(n))return{kind:`external`,url:t?`${n}#${t}`:n};let r=Z9(n);return r&&r!==`md`&&r!==`mdx`?{kind:`asset`,url:n,ext:r}:{kind:`doc`,docName:n,anchor:t?.trim()||null}}function $ae(e,t){let n=e.trim();if(!n||X9.test(n)||n.startsWith(`//`)||n.startsWith(`#`))return null;let r=n.indexOf(`#`),i=((r>=0?n.slice(0,r):n).split(`?`)[0]??``).trim();if(!i)return null;let a=i.startsWith(`/`),o=a?i.slice(1):i,s=a?[]:t.includes(`/`)?t.split(`/`).slice(0,-1):[];for(let e of o.split(`/`))if(e===`..`){if(s.length===0)return null;s.pop()}else e!==`.`&&e!==``&&s.push(e);return s.length===0?null:s.join(`/`)}function eoe(e,t,n=null,r=`.md`){let i=Q9(e);i.pop();let a=Q9(t),o=0;for(;o<i.length&&o<a.length&&i[o]===a[o];)o+=1;let s=i.slice(o).map(()=>`..`),c=a.slice(o),l=[...s,...c].join(`/`);return l||=a.at(-1)??t,!l.startsWith(`./`)&&!l.startsWith(`../`)&&(l=`./${l}`),`${l}${r}${n?`#${n}`:``}`}function toe(e){return e.replace(/[/\\:*?"<>|\0]/g,`-`).replace(/\s+/g,` `).replace(/-+/g,`-`).trim().replace(/^[-.\s]+|[-.\s]+$/g,``)}export{I$ as $,R4 as $n,uS as $r,w0 as $t,s$ as A,Wl as Ai,L3 as An,Bte as Ar,o0 as At,c1 as B,N as Bi,$9 as Bn,tS as Br,f0 as Bt,j$ as C,Rl as Ci,n0 as Cn,o1 as Cr,a2 as Ct,sre as D,zl as Di,W3 as Dn,A7 as Dr,Bre as Dt,Q7 as E,Hl as Ei,Bae as En,n1 as Er,Jre as Et,W9 as F,ru as Fi,F3 as Fn,LT as Fr,Wie as Ft,_$ as G,B$ as Gn,SS as Gr,Zae as Gt,v1 as H,ui as Hi,u2 as Hn,qb as Hr,Eae as Ht,P4 as I,mu as Ii,B3 as In,vT as Ir,n$ as It,y0 as J,qie as Jn,gb as Jr,zQ as Jt,Sne as K,m1 as Kn,lS as Kr,Qae as Kt,bre as L,xu as Li,V3 as Ln,XT as Lr,l0 as Lt,Jie as M,su as Mi,z3 as Mn,UO as Mr,r2 as Mt,E9 as N,Ru as Ni,H3 as Nn,KO as Nr,Xae as Nt,Nre as O,Fl as Oi,G3 as On,v0 as Or,F2 as Ot,dre as P,Fu as Pi,R3 as Pn,GO as Pr,XQ as Pt,U$ as Q,Yne as Qn,Jb as Qr,T0 as Qt,g5 as R,Tc as Ri,ere as Rn,nE as Rr,s2 as Rt,jre as S,jl as Si,Jae as Sn,c0 as Sr,Xre as St,a9 as T,Ul as Ti,L4 as Tn,WQ as Tr,Y1 as Tt,mre as U,fi as Ui,J4 as Un,wS as Ur,kae as Ut,A$ as V,k as Vi,rre as Vn,Bx as Vr,eoe as Vt,g$ as W,ai as Wi,v$ as Wn,TS as Wr,Dae as Wt,yre as X,D$ as Xn,Db as Xr,Iae as Xt,z$ as Y,X4 as Yn,Tb as Yr,X$ as Yt,H$ as Z,Xne as Zn,Ob as Zr,K0 as Zt,f$ as _,Tf as _i,w7 as _n,wae as _r,S2 as _t,Dre as a,iS as ai,Lae as an,q4 as ar,BQ as at,W$ as b,hd as bi,gie as bn,C$ as br,Qre as bt,fie as c,rv as ci,aae as cn,UQ as cr,Rre as ct,uie as d,B as di,R$ as dn,b$ as dr,y$ as dt,Ny as ei,x0 as en,r$ as er,Ire as et,sie as f,qp as fi,c$ as fn,d9 as fr,Yre as ft,p$ as g,z as gi,Z$ as gn,toe as gr,C2 as gt,d$ as h,Op as hi,xie as hn,mie as hr,v2 as ht,Ere as i,xS as ii,b0 as in,S$ as ir,VQ as it,e1 as j,Al as ji,U3 as jn,Ite as jr,vre as jt,P$ as k,Il as ki,I3 as kn,k9 as kr,r0 as kt,die as l,Lv as li,iae as ln,t0 as lr,u1 as lt,m$ as m,R as mi,Z9 as mn,$ae as mr,M2 as mt,Fae as n,hb as ni,W0 as nn,p7 as nr,N2 as nt,lre as o,Xv as oi,jae as on,T$ as or,B7 as ot,IQ as p,Xp as pi,i0 as pn,u9 as pr,u$ as pt,O1 as q,p1 as qn,nb as qr,RQ as qt,N$ as r,Xb as ri,S0 as rn,e0 as rr,P2 as rt,cie as s,ev as si,A3 as sn,_ie as sr,k1 as st,Pae as t,uy as ti,C0 as tn,Y$ as tr,Pre as tt,lie as u,Np as ui,Uae as un,t3 as ur,f1 as ut,O$ as v,sf as vi,Rae as vn,s0 as vr,E2 as vt,zre as w,gu as wi,l$ as wn,k7 as wr,o2 as wt,Mre as x,L as xi,Pne as xn,t1 as xr,Zre as xt,U9 as y,I as yi,G7 as yn,i2 as yr,e9 as yt,s1 as z,F as zi,M$ as zn,qT as zr,u0 as zt};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as e,G as t,Hn as n,Wn as r,Xn as i,dr as a,ir as o,or as s,wr as c,zn as l}from"./dist-
|
|
1
|
+
import{C as e,G as t,Hn as n,Wn as r,Xn as i,dr as a,ir as o,or as s,wr as c,zn as l}from"./dist-BkxMNfFN.js";function u(e){return e.kind===`asset`}function d(e){return e.kind===`document`}function f(e){return e.kind===`folder`}function p(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??m(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 m(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 h(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 g(e){if(!e)return``;let t=e.lastIndexOf(`/`);return t>0?e.slice(0,t):``}function _(e,t=!1){return e.filter(e=>{let r=e.docName??e.path??``;return r===``?!1:t?!0:!n(r)})}function v(e){return e.trim().replace(/^\.\/+/,``).replace(/^\/+/,``).replace(/\.mdx?$/i,``)}function y(e){let t=v(e);return t?`${t}.md`:`untitled.md`}function b(e){let t=v(e),n=t.lastIndexOf(`/`);return{initialDir:n>0?t.slice(0,n):``,suggestedName:`${n>=0?t.slice(n+1):t||`untitled`}.md`}}function x(e){let t=e.trim();return{normalizedTarget:v(t).replace(/\/+$/g,``),expectsFolder:/\/+$/.test(t)}}function S(e){let t=new Set;for(let n of e)for(let e of h(n))t.add(e);return t}function C(e,t){if(!t)return;let n=c(e);if(n)return t.get(n)}function w(e,t){if(!t||e.includes(`/`))return;let n=c(e);if(n)return t.get(n)}function T(e,t){if(r(e)){let t=o(e);if(t?.kind===`reference`){let e=`references/${t.rel}.md`;return{kind:`skill-file`,target:`global/${t.name}/${e}`,scope:`global`,name:t.name,path:e}}let n=s(e);if(n?.kind===`skill`&&n.scope===`project`){let e=a(n.name);return{kind:`doc`,target:e,docName:e}}return{kind:`doc`,target:e,docName:e}}let n=i(e);if(n)return{kind:`doc`,target:n,docName:n};let{normalizedTarget:c,expectsFolder:l}=x(e);if(!c)return{kind:`missing`,target:c};if(!l&&t.pages.has(c))return{kind:`doc`,target:c,docName:c};if(!l){let e=C(c,t.pagesBySlug);if(e)return{kind:`doc`,target:e,docName:e}}let u=`${c}/index`;if(t.pages.has(u))return{kind:`folder-index`,target:c,folderPath:c,docName:u,noteKind:`canonical-index`};let d=c.split(`/`).pop(),f=d?`${c}/${d}`:null;if(f&&t.pages.has(f))return{kind:`folder-index`,target:c,folderPath:c,docName:f,noteKind:`legacy-folder-note`};if(!l){let e=w(c,t.pagesByBasename);if(e)return{kind:`doc`,target:e,docName:e}}return(t.folderPaths??S(t.pages)).has(c)?{kind:`folder`,target:c,folderPath:c}:{kind:`missing`,target:c}}function E(e){return e.kind===`folder-index`?{kind:`folder`,target:e.folderPath,folderPath:e.folderPath}:e}function D(t,n,r=e){return typeof n!=`number`||!l(n,r)?null:{kind:`large-file`,target:t,docName:t,size:n,limit:r}}function O(t,n,r=e){return t.kind!==`doc`&&t.kind!==`folder-index`?t:D(t.docName,n.get(t.docName)?.size,r)??t}function k(e){switch(e.kind){case`doc`:case`folder-index`:case`large-file`:return e.docName;case`missing`:return e.target;case`asset`:case`skill-file`:case`folder`:return null}}function A(e){return t.includes(e)}function j(e){if(e.startsWith(z)||e.startsWith(U)||!e.startsWith(`#/`))return null;let t=e.slice(2),n=B(t),r=n>=0?t.slice(0,n):t;if(!r)return null;try{return r.split(`/`).map(decodeURIComponent).join(`/`)}catch{return r}}function M(e){if(e.startsWith(z)||!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 N(e,t){let n=`#/${e}`;return t?`${n}#${encodeURIComponent(t)}`:n}function P(e){if(window.location.hash===e)return;let{pathname:t,search:n}=window.location;window.history.replaceState(null,``,`${t}${n}${e}`)}function F(e){return e.endsWith(`.mdx`)?e.slice(0,-4):e.endsWith(`.md`)?e.slice(0,-3):e}function I(e,t){let n=e.replace(/^\/+|\/+$/g,``),r=n?`#/${n}/`:`#/`;return t?`${r}#${encodeURIComponent(t)}`:r}function L(e,t,n){if(e===`folder`)return I(t);let r=`#/${encodeURIComponent(t)}`;return n==null||n===``?r:`${r}?branch=${encodeURIComponent(n)}`}function R(e){if(e===`#/`)return!0;if(!e.startsWith(`#/`))return!1;let t=e.slice(2);return t.length>0&&t[0]===`?`}var z=`#/__asset__/`;function B(e){let t=e.indexOf(`?`),n=e.indexOf(`#`);return t<0?n:n<0?t:Math.min(t,n)}function V(e){if(!e.startsWith(z))return null;let t=e.slice(12);if(!t)return null;try{return t.split(`/`).map(decodeURIComponent).join(`/`)}catch{return t}}function H(e){return`${z}${e.split(`/`).map(encodeURIComponent).join(`/`)}`}var U=`#/__skill-file__/`;function W(e){return`${U}${[e.scope,e.name].map(encodeURIComponent).join(`/`)}/${e.path.split(`/`).map(encodeURIComponent).join(`/`)}`}function G(e){if(!e.startsWith(U))return null;let t=e.slice(17);if(!t)return null;let n;try{n=t.split(`/`).map(decodeURIComponent)}catch{return null}if(n.length<3)return null;let[r,i,...a]=n,o=a.join(`/`);return!r||!i||!o||!A(r)?null:{scope:r,name:i,path:o}}export{g as C,f as D,d as E,m as O,v as S,u as T,x as _,F as a,b,I as c,P as d,G as f,D as g,E as h,L as i,p as k,W as l,k as m,V as n,H as o,S as p,j as r,N as s,M as t,R as u,T as v,_ as w,y as x,O as y};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{T as e}from"./dist-
|
|
1
|
+
import{T as e}from"./dist-BkxMNfFN.js";function t(e){if(typeof e!=`object`||!e)return;let t=e;if(typeof t.title==`string`&&t.title.length>0)return t.title}var n=e=>typeof e==`string`,r=e=>typeof e==`function`,i=new Map,a=`en`;function o(e){return[...Array.isArray(e)?e:[e],a]}function s(e,t,r){let i=o(e);r||=`default`;let a;if(typeof r==`string`)switch(a={day:`numeric`,month:`short`,year:`numeric`},r){case`full`:a.weekday=`long`;case`long`:a.month=`long`;break;case`short`:a.month=`numeric`;break}else a=r;return d(()=>f(`date`,i,r),()=>new Intl.DateTimeFormat(i,a)).format(n(t)?new Date(t):t)}function c(e,t,n){let r;if(n||=`default`,typeof n==`string`)switch(r={second:`numeric`,minute:`numeric`,hour:`numeric`},n){case`full`:case`long`:r.timeZoneName=`short`;break;case`short`:delete r.second}else r=n;return s(e,t,r)}function l(e,t,n){let r=o(e);return d(()=>f(`number`,r,n),()=>new Intl.NumberFormat(r,n)).format(t)}function u(e,t,n,{offset:r=0,...i}){let a=o(e),s=t?d(()=>f(`plural-ordinal`,a),()=>new Intl.PluralRules(a,{type:`ordinal`})):d(()=>f(`plural-cardinal`,a),()=>new Intl.PluralRules(a,{type:`cardinal`}));return i[n]??i[s.select(n-r)]??i.other}function d(e,t){let n=e(),r=i.get(n);return r||(r=t(),i.set(n,r)),r}function f(e,t,n){return`${e}-${t.join(`-`)}-${JSON.stringify(n)}`}var p=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/,m=e=>e.replace(/\\u([a-fA-F0-9]{4})|\\x([a-fA-F0-9]{2})/g,(e,t,n)=>{if(t){let e=parseInt(t,16);return String.fromCharCode(e)}else{let e=parseInt(n,16);return String.fromCharCode(e)}}),h=`%__lingui_octothorpe__%`,g=(e,t,n={})=>{let r=t||e,i=e=>typeof e==`object`?e:n[e],a=(e,t)=>{let a=l(r,e,Object.keys(n).length?i(`number`):void 0);return t.replace(new RegExp(h,`g`),a)};return{plural:(e,t)=>{let{offset:n=0}=t,i=u(r,!1,e,t);return a(e-n,i)},selectordinal:(e,t)=>{let{offset:n=0}=t,i=u(r,!0,e,t);return a(e-n,i)},select:_,number:(e,t)=>l(r,e,i(t)||{style:t}),date:(e,t)=>s(r,e,i(t)||t),time:(e,t)=>c(r,e,i(t)||t)}},_=(e,t)=>t[e]??t.other;function v(e,t,r){return(i={},a)=>{let o=g(t,r,a),s=(e,t=!1)=>Array.isArray(e)?e.reduce((e,r)=>{if(r===`#`&&t)return e+h;if(n(r))return e+r;let[a,c,l]=r,u={};c===`plural`||c===`selectordinal`||c===`select`?Object.entries(l).forEach(([e,t])=>{u[e]=s(t,c===`plural`||c===`selectordinal`)}):u=l;let d;if(c){let e=o[c];d=e(i[a],u)}else d=i[a];return d==null?e:e+d},``):e,c=s(e);return n(c)&&p.test(c)?m(c):n(c)?c:c?String(c):``}}var y=class{_events={};on(e,t){return this._events[e]??=new Set,this._events[e].add(t),()=>this.removeListener(e,t)}removeListener(e,t){let n=this._events[e];n?.delete(t),n?.size===0&&delete this._events[e]}emit(e,...t){let n=this._events[e];if(n)for(let e of[...n])e.apply(this,t)}},b=class extends y{_locale=``;_locales;_messages={};_missing;_messageCompiler;constructor(e){super(),e.missing!=null&&(this._missing=e.missing),e.messages!=null&&this.load(e.messages),(typeof e.locale==`string`||e.locales)&&this.activate(e.locale??a,e.locales)}get locale(){return this._locale}get locales(){return this._locales}get messages(){return this._messages[this._locale]??{}}setMessagesCompiler(e){return this._messageCompiler=e,this}_load(e,t){let n=this._messages[e];n?Object.assign(n,t):this._messages[e]=t}load(e,t){typeof e==`string`&&typeof t==`object`?this._load(e,t):Object.entries(e).forEach(([e,t])=>this._load(e,t)),this.emit(`change`)}loadAndActivate({locale:e,locales:t,messages:n}){this._locale=e,this._locales=t||void 0,this._messages[this._locale]=n,this.emit(`change`)}activate(e,t){this._locale=e,this._locales=t,this.emit(`change`)}_(e,t,i){if(!this.locale)throw Error(`Lingui: Attempted to call a translation function without setting a locale.
|
|
2
2
|
Make sure to call \`i18n.activate(locale)\` before using Lingui functions.
|
|
3
3
|
This issue may also occur due to a race condition in your initialization logic.`);let a=i?.message;e||=``,n(e)||(t=e.values||t,a=e.message,e=e.id);let o=this.messages[e],s=o===void 0,c=this._missing;if(c&&s)return r(c)?c(this._locale,e):c;s&&this.emit(`missing`,{id:e,locale:this._locale});let l=o||a||e;return n(l)&&(this._messageCompiler?l=this._messageCompiler(l):console.warn(`Uncompiled message detected! Message:
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Fi as e}from"./dist-
|
|
1
|
+
import{Fi as e}from"./dist-BkxMNfFN.js";import{t}from"./file-tree-rename-validation-BnIyXPzi.js";import{D as n,E as r,T as i,c as a,g as o,o as s,s as c}from"./doc-hash-DYyNsXAD.js";var l=`application/x-open-knowledge-sidebar-item+json`,u={image:!0,video:!0,audio:!0,pdf:!0,text:!0};function d(e){return JSON.stringify(e)}function f(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:s(e.assetPath)}:{target:o(e.docName,e.size)??{kind:`doc`,target:e.docName,docName:e.docName},hash:c(e.docName)}}function p(e){if(!e||!Array.from(e.types).includes(`application/x-open-knowledge-sidebar-item+json`))return null;let t=e.getData(l);if(!t)return null;let n;try{n=JSON.parse(t)}catch{return null}if(!m(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&&!h(e)?null:{v:1,kind:`asset`,assetPath:n.assetPath,mediaKind:e}}return null}function m(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function h(e){return typeof e==`string`&&Object.hasOwn(u,e)}var g={background:`#171717`,foreground:`#e5e5e5`,cursor:`#e5e5e5`,cursorAccent:`#171717`,selectionBackground:`#3a3d41`,black:`#000000`,red:`#cd3131`,green:`#0dbc79`,yellow:`#e5e510`,blue:`#2472c8`,magenta:`#bc3fbc`,cyan:`#11a8cd`,white:`#e5e5e5`,brightBlack:`#666666`,brightRed:`#f14c4c`,brightGreen:`#23d18b`,brightYellow:`#f5f543`,brightBlue:`#3b8eea`,brightMagenta:`#d670d6`,brightCyan:`#29b8db`,brightWhite:`#ffffff`},_={background:`#ffffff`,foreground:`#262626`,cursor:`#262626`,cursorAccent:`#ffffff`,selectionBackground:`#add6ff`,black:`#000000`,red:`#cd3131`,green:`#00bc00`,yellow:`#949800`,blue:`#0451a5`,magenta:`#bc05bc`,cyan:`#0598bc`,white:`#555555`,brightBlack:`#666666`,brightRed:`#cd3131`,brightGreen:`#14ce14`,brightYellow:`#b5ba00`,brightBlue:`#0451a5`,brightMagenta:`#bc05bc`,brightCyan:`#0598bc`,brightWhite:`#a5a5a5`};function v(e){return e===`dark`?g:_}var y=`.md`,b=/\.(md|mdx)$/i;function x(e,t=y){return`${e}${t}`}function S(e){return X(e).replace(b,``)}function C(e){return n(e)?E(e.path):i(e)?e.path:x(e.docName,e.docExt)}function w(e){let t=X(e).match(b);return t?`.${t[1].toLowerCase()}`:void 0}function T(e){return X(e)}function E(e){let t=X(e.trim());return t?`${t}/`:``}function D(e){return e.endsWith(`/`)?T(e):S(e)}function O(e){return e.map(C)}function k(e){return[...e].sort().join(`\0`)}function A(e){return k(O(e))}function j(e){let t=new Set;for(let r of e){let e=(n(r)||i(r)?r.path:r.docName).split(`/`).filter(Boolean);if(e.includes(`.ok`))continue;if(n(r)){let e=E(r.path);e&&t.add(e)}let a=n(r)?e.length:e.length-1;for(let n=1;n<=a;n++)t.add(`${e.slice(0,n).join(`/`)}/`)}return[...t].sort()}function M(e){if(!e)return[];let t=X(e.replace(b,``)).split(`/`).filter(Boolean),n=[],r=e.endsWith(`/`)?t.length:t.length-1;for(let e=1;e<=r;e++)n.push(`${t.slice(0,e).join(`/`)}/`);return n}function N(e,t,n){let i=w(e);if(i)return i;let a=n.find(e=>r(e)&&e.docName===t);return a?a.docExt??y:Y(e).includes(`.`)?void 0:y}function P(e,t){let n=e.lastIndexOf(`/`),r=n===-1?``:e.slice(0,n+1),a=n===-1?e:e.slice(n+1),o=t.filter(e=>{if(!i(e)||!e.path.startsWith(r))return!1;let t=e.path.slice(r.length);return!t.includes(`/`)&&t.startsWith(`${a}.`)});return o.length===1?o[0].path:null}function F(e,t,n){if(w(e))return null;let r=n.find(e=>i(e)&&e.path===t);return r?r.path:Y(e).includes(`.`)?t:P(t,n)}function I(e,t){let n=e.kind===`directory`,r=n?T(e.path):S(e.path);if(n)return{kind:`folder`,name:X(Y(e.path)).replace(b,``),path:r,treePath:R(e.path,!0)};let i=F(e.path,r,t);if(i)return{kind:`asset`,name:X(Y(i)),path:i,treePath:i};let a=N(e.path,r,t);return{kind:`file`,name:X(Y(e.path)).replace(b,``),path:r,treePath:R(e.path,!1),docExt:a}}function L(e){return e.kind===`directory`?T(e.path):e.path}function R(e,t){return t?E(e):b.test(e)?e:`${e}${y}`}function z(e,t,n){let r=E(t),i=new Set(n);for(let t=0;t<100;t++){let n=t===0?``:` ${t+1}`;if(e===`file`){let e=`${r}Untitled${n}${y}`;if(!i.has(e))return{addPath:e,renamePath:e};continue}let a=`${r}New Folder${n}/`;if(!i.has(a))return{addPath:a,renamePath:a}}throw Error(`Could not allocate a unique tree placeholder`)}function B(e,t){return e===`file`?R(t,!1):`${T(t)}/index${y}`}function V(e,t){return t.kind===`root`||t.directoryPath==null?Y(e):`${t.directoryPath}${Y(e)}`}function H(e,t){if(t)return T(E(e));let n=S(e),r=n.lastIndexOf(`/`);return r===-1?``:n.slice(0,r)}function U(e,t){let n=T(E(e));return n?`${n}/${t}`:t}function W(e,t,n){e.append(`parentDocName`,U(t,n)),e.append(`placement`,`parent-dir`)}function G(e,t){return(t.path??U(e,t.src)).replace(/^\/+/,``)}function K(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 q(e){return Array.from(e.dataTransfer?.files??[]).filter(e=>e.name.length>0||e.size>0)}function J(n,r){let i=t(n).toLowerCase();if(i===``)return null;let a=new Date().toISOString();if(i===`.md`||i===`.mdx`)return{kind:`document`,docName:S(n),docExt:i,modified:a,size:r.size};let o=i.startsWith(`.`)?i.slice(1):i;return{kind:`asset`,path:n,assetExt:o,mediaKind:e(o),modified:a,size:r.size}}function Y(e){let t=X(e),n=t.lastIndexOf(`/`),r=n===-1?t:t.slice(n+1);return e.endsWith(`/`)?`${r}/`:r}function X(e){return e.endsWith(`/`)?e.slice(0,-1):e}export{D as C,f as D,l as E,p as O,k as S,v as T,L as _,B as a,S as b,O as c,C as d,q as f,H as g,R as h,V as i,d as k,A as l,K as m,j as n,z as o,E as p,M as r,x as s,W as t,J as u,P as v,G as w,I as x,T as y};
|