@inkeep/open-knowledge 0.19.1-beta.0 → 0.19.1-beta.10
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 +10 -10
- package/dist/assets/skills/packs/codebase-wiki/SKILL.md +1 -1
- package/dist/assets/skills/packs/entity-vault/SKILL.md +1 -1
- package/dist/assets/skills/packs/knowledge-base/SKILL.md +1 -1
- package/dist/assets/skills/packs/okf/SKILL.md +3 -3
- package/dist/assets/skills/packs/plain-notes/SKILL.md +1 -1
- package/dist/assets/skills/packs/software-lifecycle/SKILL.md +1 -1
- package/dist/assets/skills/packs/worldbuilding/SKILL.md +1 -1
- package/dist/assets/skills/packs/writing-pipeline/SKILL.md +1 -1
- package/dist/assets/skills/project/SKILL.md +13 -13
- package/dist/cli.mjs +14 -14
- package/dist/config-schema.json +1 -1
- package/dist/config.project.schema.json +1 -1
- package/dist/constants-Bhw3dVi1.mjs +2 -0
- package/dist/{dist-CKbTJ2SP.mjs → dist-CSYT3uRJ.mjs} +1 -1
- package/dist/{dist-DijTLjBt.mjs → dist-dm_DI4lI.mjs} +24 -24
- package/dist/{gh-detect-Cvw39ew1.mjs → gh-detect-Drsi8mbA.mjs} +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +1 -1
- package/dist/init-BtJhGC1W.mjs +1 -0
- package/dist/{init-BsxfRS80.mjs → init-ChNWqX_K.mjs} +11 -11
- package/dist/{loader-BW4HWUZz.mjs → loader-B5gVF_x1.mjs} +2 -2
- package/dist/loader-Cb_y6hK2.mjs +1 -0
- package/dist/{preview-BnW3wj59.mjs → preview-C5P0CL_f.mjs} +2 -2
- package/dist/preview-CUHcO0zX.mjs +1 -0
- package/dist/public/assets/{ActivityModeContent-jZ6HnQxU.js → ActivityModeContent-Dy1_JO4s.js} +1 -1
- package/dist/public/assets/{ConsentDialogBody-DOf6_QiW.js → ConsentDialogBody-CPn5k8Yj.js} +1 -1
- package/dist/public/assets/{DocumentContext-DVhriDCf.js → DocumentContext-DppavGIB.js} +1 -1
- package/dist/public/assets/GraphPanel-B7tXBL9C.js +46 -0
- package/dist/public/assets/{McpConsentDialogBody-stteh15-.js → McpConsentDialogBody-_slAuRpY.js} +1 -1
- package/dist/public/assets/SettingsDialogBody-DgfCMlWX.js +7 -0
- package/dist/public/assets/{SourceEditor-DW3ZzZL8.js → SourceEditor-CvVog_I5.js} +1 -1
- package/dist/public/assets/{TerminalPanel-BQT_RT2t.js → TerminalPanel-gtDefA9J.js} +3 -3
- package/dist/public/assets/{config-validation-events-DSgrywOU.js → config-validation-events-De91seTf.js} +7 -7
- package/dist/public/assets/{dist-52GaUc7C.js → dist-DzbxRXt5.js} +13 -13
- package/dist/public/assets/{index-Ddc1Tv7f.js → index-DkmfFrL2.js} +95 -95
- package/dist/public/assets/index-DlZTOWgT.css +1 -0
- package/dist/public/assets/{keyboard-shortcuts-NT911PBK.js → keyboard-shortcuts-CrOPSj32.js} +1 -1
- package/dist/public/assets/{prop-types-DFOayjLw.js → prop-types-C0kDsvPx.js} +1 -1
- package/dist/public/assets/{target-navigation-intent-Ck2yPxGj.js → target-navigation-intent-BW8U2Njg.js} +1 -1
- package/dist/public/assets/toggle-group-DsgJIlng.js +1 -0
- package/dist/public/assets/{typing-burst-detector-CpE9cH17.js → typing-burst-detector-Wg72tb4K.js} +1 -1
- package/dist/public/index.html +11 -11
- package/dist/{repair-launch-json-C1BEgqKz.mjs → repair-launch-json-CARK9RAA.mjs} +2 -2
- package/dist/{repair-mcp-configs-Bs1HhvwH.mjs → repair-mcp-configs-D1ZLT9sG.mjs} +2 -2
- package/dist/repair-skills-B57xTnpU.mjs +1 -0
- package/dist/repair-skills-CsRymFFj.mjs +3 -0
- package/dist/schemas/v0/config.project.schema.json +1 -1
- package/dist/server-lock-8Lv6A-Xa-BTQcAAhW.mjs +1 -0
- package/dist/{server-lock-BpjJj3OD-DwwMezJh.mjs → server-lock-CN2YHwpP-Cvbk69Pj.mjs} +5 -5
- package/dist/{src-CK8w6qU6.mjs → src-BjJgR5K9.mjs} +3 -3
- package/dist/start-DZeLNeUa.mjs +3 -0
- package/dist/start-DvrS6uIC.mjs +1 -0
- package/dist/write-project-skill-C3yO9LBO.mjs +12 -0
- package/package.json +1 -1
- package/dist/constants-BNoR2_Qg.mjs +0 -2
- package/dist/init-DIT1ZqWz.mjs +0 -1
- package/dist/loader-dvZHcwcQ.mjs +0 -1
- package/dist/preview-Blsaqire.mjs +0 -1
- package/dist/public/assets/GraphPanel-Bqt3XRIg.js +0 -46
- package/dist/public/assets/SettingsDialogBody-CcxV23r0.js +0 -7
- package/dist/public/assets/index-6vGfMBbB.css +0 -1
- package/dist/public/assets/toggle-group-oSLn0Q3B.js +0 -1
- package/dist/repair-skills-Fvio4Y5j.mjs +0 -3
- package/dist/repair-skills-RiEpYpER.mjs +0 -1
- package/dist/server-lock-CyhBidkz-CtwSwoJc.mjs +0 -1
- package/dist/start-CYhN6fGd.mjs +0 -3
- package/dist/start-jTgkie2f.mjs +0 -1
- package/dist/write-project-skill-X3m0-n6F.mjs +0 -12
|
@@ -151,7 +151,7 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\
|
|
|
151
151
|
|
|
152
152
|
`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=jt,s=!gt.jitless,c=s&&Mt.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?ii([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function si(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!qt(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>Xt(e,r,_t())))}),t)}const ci=D(`$ZodUnion`,(e,t)=>{vr.init(e,t),Tt(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),Tt(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),Tt(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),Tt(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>St(e.source)).join(`|`)})$`)}});let n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let o=!1,s=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},a);if(t instanceof Promise)s.push(t),o=!0;else{if(t.issues.length===0)return t;s.push(t)}}return o?Promise.all(s).then(t=>si(t,i,e,a)):si(s,i,e,a)}}),li=D(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,ci.init(e,t);let n=e._zod.parse;Tt(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=bt(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!jt(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,input:o,path:[t.discriminator],inst:e}),i)}}),ui=D(`$ZodIntersection`,(e,t)=>{vr.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>fi(e,t,n)):fi(e,i,a)}});function di(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Nt(e)&&Nt(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=di(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=di(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function fi(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),qt(e))return e;let o=di(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const pi=D(`$ZodRecord`,(e,t)=>{vr.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Nt(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let e of o)if(typeof e==`string`||typeof e==`number`||typeof e==`symbol`){s.add(typeof e==`number`?e.toString():e);let o=t.valueType._zod.run({value:i[e],issues:[]},r);o instanceof Promise?a.push(o.then(t=>{t.issues.length&&n.issues.push(...Jt(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...Jt(e,o.issues)),n.value[e]=o.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`)continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof o==`string`&&Jn.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>Xt(e,r,_t())),input:o,path:[o],inst:e});continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...Jt(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...Jt(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),mi=D(`$ZodEnum`,(e,t)=>{vr.init(e,t);let n=vt(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>Ft.has(typeof e)).map(e=>typeof e==`string`?It(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),hi=D(`$ZodLiteral`,(e,t)=>{if(vr.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?It(e):e?It(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),gi=D(`$ZodTransform`,(e,t)=>{vr.init(e,t),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new ht(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new mt;return n.value=i,n}});function _i(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const vi=D(`$ZodOptional`,(e,t)=>{vr.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,Tt(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Tt(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${St(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>_i(t,e.value)):_i(r,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),yi=D(`$ZodExactOptional`,(e,t)=>{vi.init(e,t),Tt(e._zod,`values`,()=>t.innerType._zod.values),Tt(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),bi=D(`$ZodNullable`,(e,t)=>{vr.init(e,t),Tt(e._zod,`optin`,()=>t.innerType._zod.optin),Tt(e._zod,`optout`,()=>t.innerType._zod.optout),Tt(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${St(e.source)}|null)$`):void 0}),Tt(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),xi=D(`$ZodDefault`,(e,t)=>{vr.init(e,t),e._zod.optin=`optional`,Tt(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Si(e,t)):Si(r,t)}});function Si(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Ci=D(`$ZodPrefault`,(e,t)=>{vr.init(e,t),e._zod.optin=`optional`,Tt(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),wi=D(`$ZodNonOptional`,(e,t)=>{vr.init(e,t),Tt(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Ti(t,e)):Ti(i,e)}});function Ti(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}const Ei=D(`$ZodCatch`,(e,t)=>{vr.init(e,t),Tt(e._zod,`optin`,()=>t.innerType._zod.optin),Tt(e._zod,`optout`,()=>t.innerType._zod.optout),Tt(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>Xt(e,n,_t()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>Xt(e,n,_t()))},input:e.value}),e.issues=[]),e)}}),Di=D(`$ZodPipe`,(e,t)=>{vr.init(e,t),Tt(e._zod,`values`,()=>t.in._zod.values),Tt(e._zod,`optin`,()=>t.in._zod.optin),Tt(e._zod,`optout`,()=>t.out._zod.optout),Tt(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Oi(e,t.in,n)):Oi(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Oi(e,t.out,n)):Oi(r,t.out,n)}});function Oi(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const ki=D(`$ZodReadonly`,(e,t)=>{vr.init(e,t),Tt(e._zod,`propValues`,()=>t.innerType._zod.propValues),Tt(e._zod,`values`,()=>t.innerType._zod.values),Tt(e._zod,`optin`,()=>t.innerType?._zod?.optin),Tt(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Ai):Ai(r)}});function Ai(e){return e.value=Object.freeze(e.value),e}const ji=D(`$ZodLazy`,(e,t)=>{vr.init(e,t),Tt(e._zod,`innerType`,()=>t.getter()),Tt(e._zod,`pattern`,()=>e._zod.innerType?._zod?.pattern),Tt(e._zod,`propValues`,()=>e._zod.innerType?._zod?.propValues),Tt(e._zod,`optin`,()=>e._zod.innerType?._zod?.optin??void 0),Tt(e._zod,`optout`,()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),Mi=D(`$ZodCustom`,(e,t)=>{$n.init(e,t),vr.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Ni(t,n,r,e));Ni(i,n,r,e)}});function Ni(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(Qt(e))}}var Pi,Fi=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Ii(){return new Fi}(Pi=globalThis).__zod_globalRegistry??(Pi.__zod_globalRegistry=Ii());const Li=globalThis.__zod_globalRegistry;function Ri(e,t){return new e({type:`string`,...O(t)})}function zi(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...O(t)})}function Bi(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...O(t)})}function Vi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...O(t)})}function Hi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...O(t)})}function Ui(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...O(t)})}function Wi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...O(t)})}function Gi(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...O(t)})}function Ki(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...O(t)})}function qi(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...O(t)})}function Ji(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...O(t)})}function Yi(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...O(t)})}function Xi(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...O(t)})}function Zi(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...O(t)})}function Qi(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...O(t)})}function $i(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...O(t)})}function ea(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...O(t)})}function ta(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...O(t)})}function na(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...O(t)})}function ra(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...O(t)})}function ia(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...O(t)})}function aa(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...O(t)})}function oa(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...O(t)})}function sa(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...O(t)})}function ca(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...O(t)})}function la(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...O(t)})}function ua(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...O(t)})}function da(e,t){return new e({type:`number`,checks:[],...O(t)})}function fa(e,t){return new e({type:`number`,coerce:!0,checks:[],...O(t)})}function pa(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...O(t)})}function ma(e,t){return new e({type:`boolean`,...O(t)})}function ha(e,t){return new e({type:`null`,...O(t)})}function ga(e){return new e({type:`any`})}function _a(e){return new e({type:`unknown`})}function va(e,t){return new e({type:`never`,...O(t)})}function ya(e,t){return new tr({check:`less_than`,...O(t),value:e,inclusive:!1})}function ba(e,t){return new tr({check:`less_than`,...O(t),value:e,inclusive:!0})}function xa(e,t){return new nr({check:`greater_than`,...O(t),value:e,inclusive:!1})}function Sa(e,t){return new nr({check:`greater_than`,...O(t),value:e,inclusive:!0})}function Ca(e,t){return new rr({check:`multiple_of`,...O(t),value:e})}function wa(e,t){return new ar({check:`max_length`,...O(t),maximum:e})}function Ta(e,t){return new or({check:`min_length`,...O(t),minimum:e})}function Ea(e,t){return new sr({check:`length_equals`,...O(t),length:e})}function Da(e,t){return new lr({check:`string_format`,format:`regex`,...O(t),pattern:e})}function Oa(e){return new ur({check:`string_format`,format:`lowercase`,...O(e)})}function ka(e){return new dr({check:`string_format`,format:`uppercase`,...O(e)})}function Aa(e,t){return new fr({check:`string_format`,format:`includes`,...O(t),includes:e})}function ja(e,t){return new pr({check:`string_format`,format:`starts_with`,...O(t),prefix:e})}function Ma(e,t){return new mr({check:`string_format`,format:`ends_with`,...O(t),suffix:e})}function Na(e){return new hr({check:`overwrite`,tx:e})}function Pa(e){return Na(t=>t.normalize(e))}function Fa(){return Na(e=>e.trim())}function Ia(){return Na(e=>e.toLowerCase())}function La(){return Na(e=>e.toUpperCase())}function Ra(){return Na(e=>kt(e))}function za(e,t,n){return new e({type:`array`,element:t,...O(n)})}function Ba(e,t,n){let r=O(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function Va(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...O(n)})}function Ha(e){let t=Ua(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push(Qt(e,n.value,t._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=n.value,r.inst??=t,r.continue??=!t._zod.def.abort,n.issues.push(Qt(r))}},e(n.value,n)));return t}function Ua(e,t){let n=new $n({check:`custom`,...O(t)});return n._zod.check=e,n}function Wa(e){let t=new $n({check:`describe`});return t._zod.onattach=[t=>{let n=Li.get(t)??{};Li.add(t,{...n,description:e})}],t._zod.check=()=>{},t}function Ga(e){let t=new $n({check:`meta`});return t._zod.onattach=[t=>{let n=Li.get(t)??{};Li.add(t,{...n,...e})}],t._zod.check=()=>{},t}function Ka(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??Li,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function qa(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,qa(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&Xa(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function Ja(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
153
153
|
|
|
154
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function Ya(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(a[e.defId]=e.def)}e.external||Object.keys(a).length>0&&(e.target===`draft-2020-12`?i.$defs=a:i.definitions=a);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,`~standard`,{value:{...t[`~standard`],jsonSchema:{input:Qa(t,`input`,e.processors),output:Qa(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function Xa(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return Xa(r.element,n);if(r.type===`set`)return Xa(r.valueType,n);if(r.type===`lazy`)return Xa(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type===`default`||r.type===`prefault`)return Xa(r.innerType,n);if(r.type===`intersection`)return Xa(r.left,n)||Xa(r.right,n);if(r.type===`record`||r.type===`map`)return Xa(r.keyType,n)||Xa(r.valueType,n);if(r.type===`pipe`)return Xa(r.in,n)||Xa(r.out,n);if(r.type===`object`){for(let e in r.shape)if(Xa(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(Xa(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(Xa(e,n))return!0;return!!(r.rest&&Xa(r.rest,n))}return!1}const Za=(e,t={})=>n=>{let r=Ka({...n,processors:t});return qa(e,r),Ja(r,e),Ya(r,e)},Qa=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Ka({...i??{},target:a,io:t,processors:n});return qa(e,o),Ja(o,e),Ya(o,e)},$a={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},eo=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=$a[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},to=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`,typeof u==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u),typeof a==`number`&&(i.minimum=a,typeof u==`number`&&t.target!==`draft-04`&&(u>=a?delete i.minimum:delete i.exclusiveMinimum)),typeof l==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l),typeof o==`number`&&(i.maximum=o,typeof l==`number`&&t.target!==`draft-04`&&(l<=o?delete i.maximum:delete i.exclusiveMaximum)),typeof c==`number`&&(i.multipleOf=c)},no=(e,t,n,r)=>{n.type=`boolean`},ro=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`BigInt cannot be represented in JSON Schema`)},io=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Symbols cannot be represented in JSON Schema`)},ao=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},oo=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Undefined cannot be represented in JSON Schema`)},so=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`)},co=(e,t,n,r)=>{n.not={}},lo=(e,t,n,r)=>{},uo=(e,t,n,r)=>{},fo=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Date cannot be represented in JSON Schema`)},po=(e,t,n,r)=>{let i=e._zod.def,a=vt(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},mo=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},ho=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`NaN cannot be represented in JSON Schema`)},go=(e,t,n,r)=>{let i=n,a=e._zod.pattern;if(!a)throw Error(`Pattern not found in template literal`);i.type=`string`,i.pattern=a.source},_o=(e,t,n,r)=>{let i=n,a={type:`string`,format:`binary`,contentEncoding:`binary`},{minimum:o,maximum:s,mime:c}=e._zod.bag;o!==void 0&&(a.minLength=o),s!==void 0&&(a.maxLength=s),c?c.length===1?(a.contentMediaType=c[0],Object.assign(i,a)):(Object.assign(i,a),i.anyOf=c.map(e=>({contentMediaType:e}))):Object.assign(i,a)},vo=(e,t,n,r)=>{n.type=`boolean`},yo=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},bo=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Function types cannot be represented in JSON Schema`)},xo=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},So=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Map cannot be represented in JSON Schema`)},Co=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Set cannot be represented in JSON Schema`)},wo=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=qa(a.element,t,{...r,path:[...r.path,`items`]})},To=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=qa(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=qa(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Eo=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>qa(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Do=(e,t,n,r)=>{let i=e._zod.def,a=qa(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=qa(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},Oo=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>qa(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?qa(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null;t.target===`draft-2020-12`?(i.prefixItems=c,l&&(i.items=l)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),i.minItems=c.length,l||(i.maxItems=c.length)):(i.items=c,l&&(i.additionalItems=l));let{minimum:u,maximum:d}=e._zod.bag;typeof u==`number`&&(i.minItems=u),typeof d==`number`&&(i.maxItems=d)},ko=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=qa(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else (t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=qa(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=qa(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},Ao=(e,t,n,r)=>{let i=e._zod.def,a=qa(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},jo=(e,t,n,r)=>{let i=e._zod.def;qa(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Mo=(e,t,n,r)=>{let i=e._zod.def;qa(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},No=(e,t,n,r)=>{let i=e._zod.def;qa(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Po=(e,t,n,r)=>{let i=e._zod.def;qa(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},Fo=(e,t,n,r)=>{let i=e._zod.def,a=t.io===`input`?i.in._zod.def.type===`transform`?i.out:i.in:i.out;qa(a,t,r);let o=t.seen.get(e);o.ref=a},Io=(e,t,n,r)=>{let i=e._zod.def;qa(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Lo=(e,t,n,r)=>{let i=e._zod.def;qa(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Ro=(e,t,n,r)=>{let i=e._zod.def;qa(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},zo=(e,t,n,r)=>{let i=e._zod.innerType;qa(i,t,r);let a=t.seen.get(e);a.ref=i},Bo={string:eo,number:to,boolean:no,bigint:ro,symbol:io,null:ao,undefined:oo,void:so,never:co,any:lo,unknown:uo,date:fo,enum:po,literal:mo,nan:ho,template_literal:go,file:_o,success:vo,custom:yo,function:bo,transform:xo,map:So,set:Co,array:wo,object:To,union:Eo,intersection:Do,tuple:Oo,record:ko,nullable:Ao,nonoptional:jo,default:Mo,prefault:No,catch:Po,pipe:Fo,readonly:Io,promise:Lo,optional:Ro,lazy:zo};function Vo(e,t){if(`_idmap`in e){let n=e,r=Ka({...t,processors:Bo}),i={};for(let e of n._idmap.entries()){let[t,n]=e;qa(n,r)}let a={};r.external={registry:n,uri:t?.uri,defs:i};for(let e of n._idmap.entries()){let[t,n]=e;Ja(r,n),a[t]=Ya(r,n)}return Object.keys(i).length>0&&(a.__shared={[r.target===`draft-2020-12`?`$defs`:`definitions`]:i}),{schemas:a}}let n=Ka({...t,processors:Bo});return qa(e,n),Ja(n,e),Ya(n,e)}const Ho=D(`ZodISODateTime`,(e,t)=>{Mr.init(e,t),ms.init(e,t)});function Uo(e){return sa(Ho,e)}const Wo=D(`ZodISODate`,(e,t)=>{Nr.init(e,t),ms.init(e,t)});function Go(e){return ca(Wo,e)}const Ko=D(`ZodISOTime`,(e,t)=>{Pr.init(e,t),ms.init(e,t)});function qo(e){return la(Ko,e)}const Jo=D(`ZodISODuration`,(e,t)=>{Fr.init(e,t),ms.init(e,t)});function Yo(e){return ua(Jo,e)}const Xo=(e,t)=>{en.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>rn(e,t)},flatten:{value:t=>nn(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,yt,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,yt,2)}},isEmpty:{get(){return e.issues.length===0}}})};D(`ZodError`,Xo);const Zo=D(`ZodError`,Xo,{Parent:Error}),Qo=sn(Zo),$o=ln(Zo),es=dn(Zo),ts=pn(Zo),ns=hn(Zo),rs=gn(Zo),is=_n(Zo),as=vn(Zo),ss=yn(Zo),cs=bn(Zo),ls=xn(Zo),us=Sn(Zo),ds=D(`ZodType`,(e,t)=>(vr.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:Qa(e,`input`),output:Qa(e,`output`)}}),e.toJSONSchema=Za(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,`_def`,{value:t}),e.check=(...n)=>e.clone(Dt(t,{checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,n)=>Lt(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>Qo(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>es(e,t,n),e.parseAsync=async(t,n)=>$o(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>ts(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>ns(e,t,n),e.decode=(t,n)=>rs(e,t,n),e.encodeAsync=async(t,n)=>is(e,t,n),e.decodeAsync=async(t,n)=>as(e,t,n),e.safeEncode=(t,n)=>ss(e,t,n),e.safeDecode=(t,n)=>cs(e,t,n),e.safeEncodeAsync=async(t,n)=>ls(e,t,n),e.safeDecodeAsync=async(t,n)=>us(e,t,n),e.refine=(t,n)=>e.check(Ac(t,n)),e.superRefine=t=>e.check(jc(t)),e.overwrite=t=>e.check(Na(t)),e.optional=()=>lc(e),e.exactOptional=()=>dc(e),e.nullable=()=>pc(e),e.nullish=()=>lc(pc(e)),e.nonoptional=t=>yc(e,t),e.array=()=>M(e),e.or=t=>Zs([e,t]),e.and=t=>tc(e,t),e.transform=t=>Cc(e,sc(t)),e.default=t=>hc(e,t),e.prefault=t=>_c(e,t),e.catch=t=>xc(e,t),e.pipe=t=>Cc(e,t),e.readonly=()=>Tc(e),e.describe=t=>{let n=e.clone();return Li.add(n,{description:t}),n},Object.defineProperty(e,`description`,{get(){return Li.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return Li.get(e);let n=e.clone();return Li.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),fs=D(`_ZodString`,(e,t)=>{yr.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>eo(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(Da(...t)),e.includes=(...t)=>e.check(Aa(...t)),e.startsWith=(...t)=>e.check(ja(...t)),e.endsWith=(...t)=>e.check(Ma(...t)),e.min=(...t)=>e.check(Ta(...t)),e.max=(...t)=>e.check(wa(...t)),e.length=(...t)=>e.check(Ea(...t)),e.nonempty=(...t)=>e.check(Ta(1,...t)),e.lowercase=t=>e.check(Oa(t)),e.uppercase=t=>e.check(ka(t)),e.trim=()=>e.check(Fa()),e.normalize=(...t)=>e.check(Pa(...t)),e.toLowerCase=()=>e.check(Ia()),e.toUpperCase=()=>e.check(La()),e.slugify=()=>e.check(Ra())}),ps=D(`ZodString`,(e,t)=>{yr.init(e,t),fs.init(e,t),e.email=t=>e.check(zi(hs,t)),e.url=t=>e.check(Gi(vs,t)),e.jwt=t=>e.check(oa(Ps,t)),e.emoji=t=>e.check(Ki(bs,t)),e.guid=t=>e.check(Bi(gs,t)),e.uuid=t=>e.check(Vi(_s,t)),e.uuidv4=t=>e.check(Hi(_s,t)),e.uuidv6=t=>e.check(Ui(_s,t)),e.uuidv7=t=>e.check(Wi(_s,t)),e.nanoid=t=>e.check(qi(xs,t)),e.guid=t=>e.check(Bi(gs,t)),e.cuid=t=>e.check(Ji(Ss,t)),e.cuid2=t=>e.check(Yi(Cs,t)),e.ulid=t=>e.check(Xi(ws,t)),e.base64=t=>e.check(ra(js,t)),e.base64url=t=>e.check(ia(Ms,t)),e.xid=t=>e.check(Zi(Ts,t)),e.ksuid=t=>e.check(Qi(Es,t)),e.ipv4=t=>e.check($i(Ds,t)),e.ipv6=t=>e.check(ea(Os,t)),e.cidrv4=t=>e.check(ta(ks,t)),e.cidrv6=t=>e.check(na(As,t)),e.e164=t=>e.check(aa(Ns,t)),e.datetime=t=>e.check(Uo(t)),e.date=t=>e.check(Go(t)),e.time=t=>e.check(qo(t)),e.duration=t=>e.check(Yo(t))});function k(e){return Ri(ps,e)}const ms=D(`ZodStringFormat`,(e,t)=>{br.init(e,t),fs.init(e,t)}),hs=D(`ZodEmail`,(e,t)=>{Cr.init(e,t),ms.init(e,t)}),gs=D(`ZodGUID`,(e,t)=>{xr.init(e,t),ms.init(e,t)}),_s=D(`ZodUUID`,(e,t)=>{Sr.init(e,t),ms.init(e,t)}),vs=D(`ZodURL`,(e,t)=>{wr.init(e,t),ms.init(e,t)});function ys(e){return Gi(vs,e)}const bs=D(`ZodEmoji`,(e,t)=>{Tr.init(e,t),ms.init(e,t)}),xs=D(`ZodNanoID`,(e,t)=>{Er.init(e,t),ms.init(e,t)}),Ss=D(`ZodCUID`,(e,t)=>{Dr.init(e,t),ms.init(e,t)}),Cs=D(`ZodCUID2`,(e,t)=>{Or.init(e,t),ms.init(e,t)}),ws=D(`ZodULID`,(e,t)=>{kr.init(e,t),ms.init(e,t)}),Ts=D(`ZodXID`,(e,t)=>{Ar.init(e,t),ms.init(e,t)}),Es=D(`ZodKSUID`,(e,t)=>{jr.init(e,t),ms.init(e,t)}),Ds=D(`ZodIPv4`,(e,t)=>{Ir.init(e,t),ms.init(e,t)}),Os=D(`ZodIPv6`,(e,t)=>{Lr.init(e,t),ms.init(e,t)}),ks=D(`ZodCIDRv4`,(e,t)=>{Rr.init(e,t),ms.init(e,t)}),As=D(`ZodCIDRv6`,(e,t)=>{zr.init(e,t),ms.init(e,t)}),js=D(`ZodBase64`,(e,t)=>{Vr.init(e,t),ms.init(e,t)}),Ms=D(`ZodBase64URL`,(e,t)=>{Ur.init(e,t),ms.init(e,t)}),Ns=D(`ZodE164`,(e,t)=>{Wr.init(e,t),ms.init(e,t)}),Ps=D(`ZodJWT`,(e,t)=>{Kr.init(e,t),ms.init(e,t)}),Fs=D(`ZodNumber`,(e,t)=>{qr.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>to(e,t,n,r),e.gt=(t,n)=>e.check(xa(t,n)),e.gte=(t,n)=>e.check(Sa(t,n)),e.min=(t,n)=>e.check(Sa(t,n)),e.lt=(t,n)=>e.check(ya(t,n)),e.lte=(t,n)=>e.check(ba(t,n)),e.max=(t,n)=>e.check(ba(t,n)),e.int=t=>e.check(Ls(t)),e.safe=t=>e.check(Ls(t)),e.positive=t=>e.check(xa(0,t)),e.nonnegative=t=>e.check(Sa(0,t)),e.negative=t=>e.check(ya(0,t)),e.nonpositive=t=>e.check(ba(0,t)),e.multipleOf=(t,n)=>e.check(Ca(t,n)),e.step=(t,n)=>e.check(Ca(t,n)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function A(e){return da(Fs,e)}const Is=D(`ZodNumberFormat`,(e,t)=>{Jr.init(e,t),Fs.init(e,t)});function Ls(e){return pa(Is,e)}const Rs=D(`ZodBoolean`,(e,t)=>{Yr.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>no(e,t,n,r)});function j(e){return ma(Rs,e)}const zs=D(`ZodNull`,(e,t)=>{Xr.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ao(e,t,n,r)});function Bs(e){return ha(zs,e)}const Vs=D(`ZodAny`,(e,t)=>{Zr.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Hs(){return ga(Vs)}const Us=D(`ZodUnknown`,(e,t)=>{Qr.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Ws(){return _a(Us)}const Gs=D(`ZodNever`,(e,t)=>{$r.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>co(e,t,n,r)});function Ks(e){return va(Gs,e)}const qs=D(`ZodArray`,(e,t)=>{ti.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wo(e,t,n,r),e.element=t.element,e.min=(t,n)=>e.check(Ta(t,n)),e.nonempty=t=>e.check(Ta(1,t)),e.max=(t,n)=>e.check(wa(t,n)),e.length=(t,n)=>e.check(Ea(t,n)),e.unwrap=()=>e.element});function M(e,t){return za(qs,e,t)}const Js=D(`ZodObject`,(e,t)=>{oi.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>To(e,t,n,r),Tt(e,`shape`,()=>t.shape),e.keyof=()=>P(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Ws()}),e.loose=()=>e.clone({...e._zod.def,catchall:Ws()}),e.strict=()=>e.clone({...e._zod.def,catchall:Ks()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>Ht(e,t),e.safeExtend=t=>Ut(e,t),e.merge=t=>Wt(e,t),e.pick=t=>Bt(e,t),e.omit=t=>Vt(e,t),e.partial=(...t)=>Gt(cc,e,t[0]),e.required=(...t)=>Kt(vc,e,t[0])});function N(e,t){return new Js({type:`object`,shape:e??{},...O(t)})}function Ys(e,t){return new Js({type:`object`,shape:e,catchall:Ws(),...O(t)})}const Xs=D(`ZodUnion`,(e,t)=>{ci.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Eo(e,t,n,r),e.options=t.options});function Zs(e,t){return new Xs({type:`union`,options:e,...O(t)})}const Qs=D(`ZodDiscriminatedUnion`,(e,t)=>{Xs.init(e,t),li.init(e,t)});function $s(e,t,n){return new Qs({type:`union`,options:t,discriminator:e,...O(n)})}const ec=D(`ZodIntersection`,(e,t)=>{ui.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Do(e,t,n,r)});function tc(e,t){return new ec({type:`intersection`,left:e,right:t})}const nc=D(`ZodRecord`,(e,t)=>{pi.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ko(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function rc(e,t,n){return new nc({type:`record`,keyType:e,valueType:t,...O(n)})}const ic=D(`ZodEnum`,(e,t)=>{mi.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>po(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new ic({...t,checks:[],...O(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new ic({...t,checks:[],...O(r),entries:i})}});function P(e,t){return new ic({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...O(t)})}const ac=D(`ZodLiteral`,(e,t)=>{hi.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mo(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,`value`,{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function F(e,t){return new ac({type:`literal`,values:Array.isArray(e)?e:[e],...O(t)})}const oc=D(`ZodTransform`,(e,t)=>{gi.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xo(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new ht(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Qt(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(Qt(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function sc(e){return new oc({type:`transform`,transform:e})}const cc=D(`ZodOptional`,(e,t)=>{vi.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ro(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function lc(e){return new cc({type:`optional`,innerType:e})}const uc=D(`ZodExactOptional`,(e,t)=>{yi.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ro(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function dc(e){return new uc({type:`optional`,innerType:e})}const fc=D(`ZodNullable`,(e,t)=>{bi.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ao(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function pc(e){return new fc({type:`nullable`,innerType:e})}const mc=D(`ZodDefault`,(e,t)=>{xi.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function hc(e,t){return new mc({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Pt(t)}})}const gc=D(`ZodPrefault`,(e,t)=>{Ci.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>No(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function _c(e,t){return new gc({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Pt(t)}})}const vc=D(`ZodNonOptional`,(e,t)=>{wi.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function yc(e,t){return new vc({type:`nonoptional`,innerType:e,...O(t)})}const bc=D(`ZodCatch`,(e,t)=>{Ei.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Po(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function xc(e,t){return new bc({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}const Sc=D(`ZodPipe`,(e,t)=>{Di.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fo(e,t,n,r),e.in=t.in,e.out=t.out});function Cc(e,t){return new Sc({type:`pipe`,in:e,out:t})}const wc=D(`ZodReadonly`,(e,t)=>{ki.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Io(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Tc(e){return new wc({type:`readonly`,innerType:e})}const Ec=D(`ZodLazy`,(e,t)=>{ji.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zo(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function Dc(e){return new Ec({type:`lazy`,getter:e})}const Oc=D(`ZodCustom`,(e,t)=>{Mi.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yo(e,t,n,r)});function kc(e,t){return Ba(Oc,e??(()=>!0),t)}function Ac(e,t={}){return Va(Oc,e,t)}function jc(e){return Ha(e)}function Mc(e,t){return Cc(sc(e),t)}var Nc=ft();a();const Pc=Symbol.for(`@inkeep/open-knowledge/field-registry`),Fc=globalThis;Fc[Pc]===void 0&&(Fc[Pc]=Ii());const Ic=Fc[Pc];function Lc(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=Rc(t)?Ic.get(t):void 0;if(e!==void 0)return e;let n=t._zod?.def?.innerType;if(n===void 0)return;t=n}}function Rc(e){return typeof e==`object`&&!!e&&`_zod`in e&&`parse`in e}const zc=Object.freeze([`authorization`,`auth.token`,`auth.bearer`,`cookie`,`set-cookie`,`x-api-key`,`password`,`secret`]),Bc=52428800,Vc=26214400,Hc=`https://api.openai.com/v1`,Uc=`text-embedding-3-small`,Wc=Ys({content:Ys({dir:k().register(Ic,{scope:`project`,agentSettable:!1,defaultScope:`project`,description:`Folder Open Knowledge reads and writes documents under, relative to the project root (the folder that contains .ok/). Defaults to the project root. Exclude paths with .okignore.`}).default(`.`)}).default({dir:`.`}),appearance:Ys({theme:P([`light`,`dark`,`system`]).register(Ic,{scope:`user`,agentSettable:!1,defaultScope:`user`,description:`Editor color theme: 'light', 'dark', or 'system' (follow the OS). A personal preference (user scope) — not shared with the project.`}).optional(),preview:Ys({autoOpen:j().register(Ic,{scope:`user`,agentSettable:!1,defaultScope:`user`,description:`When on, the agent opens or refreshes the live preview after each edit. Turn off if you manage your own preview window. A personal preference (user scope).`}).default(!0)}).default({autoOpen:!0}),sidebar:Ys({showHiddenFiles:j().register(Ic,{scope:`project-local`,agentSettable:!1,defaultScope:`project-local`,description:`Show dot-prefixed entries (e.g. .ok/, .okignore) in the file tree. Per-machine (project-local) — not shared with collaborators.`}).default(!1)}).optional()}).default({preview:{autoOpen:!0}}),editor:Ys({wordWrap:j().register(Ic,{scope:`user`,agentSettable:!1,defaultScope:`user`,description:`Soft-wrap long lines in the source (CodeMirror) editor. A personal preference (user scope).`}).default(!0)}).default({wordWrap:!0}),autoSync:Ys({enabled:j().register(Ic,{scope:`project-local`,agentSettable:!1,defaultScope:`project-local`,description:`Whether this machine auto-pulls and auto-pushes git commits for this project. null = not chosen yet (onboarding asks). Per-machine (project-local) — not shared.`}).nullable().default(null),default:j().register(Ic,{scope:`project`,agentSettable:!1,defaultScope:`project`,description:`Committed project default for a machine's autoSync.enabled on first open: true = auto-sync on, false = off, null = ask (show the onboarding prompt). Shared via git. A per-machine autoSync.enabled choice overrides it.`}).nullable().default(null)}).default({enabled:null,default:null}),terminal:Ys({enabled:j().register(Ic,{scope:`project-local`,agentSettable:!1,defaultScope:`project-local`,description:`Opt-out for the in-app terminal (a real OS shell at full user privilege). The terminal is on by default; set false to disable it for this project on this machine. Per-machine (project-local) — never shared via git, clone, or sync.`}).nullable().default(null)}).default({enabled:null}),telemetry:Ys({localSink:Ys({enabled:j().register(Ic,{scope:`project`,agentSettable:!1,defaultScope:`project`,description:"Write local diagnostic spans + logs under .ok/local/ for `ok diagnose bundle`. Local-only — never leaves the machine until you run bundle. Set false for sensitive workspaces. Shared across collaborators."}).default(!0),spans:Ys({maxBytes:A().register(Ic,{scope:`project`,agentSettable:!1,defaultScope:`project`,description:`Maximum size, in bytes, of the local diagnostic spans file before it rotates (default ~50 MB).`}).default(Bc)}).default({maxBytes:Bc}),logs:Ys({maxBytes:A().register(Ic,{scope:`project`,agentSettable:!1,defaultScope:`project`,description:`Maximum size, in bytes, of the local diagnostic logs file before it rotates (default ~25 MB).`}).default(Vc)}).default({maxBytes:Vc}),attributeDenylist:M(k()).register(Ic,{scope:`project`,agentSettable:!1,defaultScope:`project`,description:`Telemetry attribute keys whose values are redacted before any local span/log is written (credential / secret guard). Extends the built-in denylist.`}).default([...zc])}).default({enabled:!0,spans:{maxBytes:Bc},logs:{maxBytes:Vc},attributeDenylist:[...zc]})}).default({localSink:{enabled:!0,spans:{maxBytes:Bc},logs:{maxBytes:Vc},attributeDenylist:[...zc]}}),search:Ys({semantic:Ys({enabled:j().register(Ic,{scope:`project-local`,agentSettable:!1,defaultScope:`project-local`,description:"Add semantic (embeddings) ranking to the MCP search tool, fused with the lexical engine so conceptually-related pages surface even with no shared keywords. When ON and an API key is set (`ok embeddings set-key`), the search query and matching document content are sent to the configured embeddings provider — content egress. Default OFF. Per-machine (project-local) — not shared with collaborators."}).default(!1),baseUrl:k().register(Ic,{scope:`project-local`,agentSettable:!1,defaultScope:`project-local`,description:"Base URL of the OpenAI-compatible embeddings API (default https://api.openai.com/v1). Override for Azure / self-hosted / other providers. The API key is NOT stored here — set it with `ok embeddings set-key` (OS keyring)."}).default(Hc),model:k().register(Ic,{scope:`project-local`,agentSettable:!1,defaultScope:`project-local`,description:`Embeddings model id (default text-embedding-3-small). Must be served by the provider at baseUrl. Changing it re-embeds the corpus (the cache is keyed by provider + model + dimensions).`}).default(Uc),dimensions:A().int().positive().register(Ic,{scope:`project-local`,agentSettable:!1,defaultScope:`project-local`,description:`Optional output vector dimensions. Omit to use the model's native size (1536 for text-embedding-3-small). Set a smaller value (text-embedding-3 supports e.g. 512 / 1024) to shrink the on-disk cache, trading a little retrieval quality. Changing it re-embeds the corpus.`}).optional(),similarityFloor:A().min(0).max(1).register(Ic,{scope:`project-local`,agentSettable:!1,defaultScope:`project-local`,description:`Optional hard cutoff: drop any "by meaning" match whose cosine similarity is below this value. Off by default (0) because retrieval is rank-based (the closest pages are returned regardless of absolute score) and the right cutoff is model-specific. Set it only to suppress weak matches for a specific provider/model whose cosine scale you know. Most setups should leave it unset and rely on the result-count cap.`}).optional()}).default({enabled:!1,baseUrl:Hc,model:Uc})}).default({semantic:{enabled:!1,baseUrl:Hc,model:Uc}})}),Gc=`open-knowledge-config`;async function Kc(e,t,n){let r=o.getTracer(Gc),a=t?{attributes:t}:{};return r.startActiveSpan(e,a,async e=>{try{return await n(e)}catch(t){throw e.recordException(t),e.setStatus({code:i.ERROR,message:t instanceof Error?t.message:String(t)}),t}finally{e.end()}})}function qc(e,t,n){let r=o.getTracer(Gc),a=t?{attributes:t}:{};return r.startActiveSpan(e,a,e=>{try{return n(e)}catch(t){throw e.recordException(t),e.setStatus({code:i.ERROR,message:t instanceof Error?t.message:String(t)}),t}finally{e.end()}})}function Jc(e,t){let n=o.getActiveSpan();n&&n.addEvent(e,t)}function Yc(e){let t=e;for(let e=0;e<16;e++){if(t==null||t?._zod?.def?.shape!==void 0)return t;let e=t?._zod?.def?.innerType;if(e===void 0)return t;t=e}return t}function Xc(e,t){let n=e;for(let e of t){n=Yc(n);let t=n?._zod?.def?.shape;if(!t||(n=t[String(e)],n===void 0))return}return n}function Zc(e,t){let n=Xc(e,t);if(n!==void 0)return Lc(n)}function Qc(e,t){return e===`either`?!0:e===t}function $c(e,t){let n=null;function r(e,i){if(n!==null||e===void 0)return;if(typeof e==`object`&&e&&!Array.isArray(e)){for(let[t,a]of Object.entries(e))if(r(a,[...i,t]),n!==null)return;return}let a=Zc(Wc,i);a?.scope!==void 0&&(Qc(a.scope,t)||(n={code:`SCOPE_VIOLATION`,path:i,expectedScope:a.scope,actualScope:t}))}for(let[t,i]of Object.entries(e))if(r(i,[t]),n!==null)break;return n}function el(e,t){for(let n=1;n<t.length;n++){let r=t.slice(0,n);e.hasIn(r)&&((0,Nc.isCollection)(e.getIn(r,!0))||e.deleteIn(r))}}function tl(e,t){let n=[];function r(t,i){if(t!==void 0){if(t===null){e.deleteIn(i),n.push(i.join(`.`));return}if(Array.isArray(t)){el(e,i),e.setIn(i,t),n.push(i.join(`.`));return}if(typeof t==`object`){for(let[e,n]of Object.entries(t))r(n,[...i,e]);return}el(e,i),e.setIn(i,t),n.push(i.join(`.`))}}for(let[e,n]of Object.entries(t))r(n,[e]);return n}function nl(e){return{path:e.path.map(e=>typeof e==`symbol`?String(e):e),message:e.message,issueCode:e.code}}const rl=N({file:k(),line:A().int().min(1),column:A().int().min(1),snippet:k().optional()}),il=N({path:M(Zs([k(),A()])),message:k(),issueCode:k(),params:rc(k(),Ws()).optional(),source:rl.optional()}),al=P([`user`,`project`,`project-local`,`either`]),ol=P([`user`,`project`,`project-local`]),sl=$s(`code`,[N({code:F(`YAML_PARSE`),detail:k()}),N({code:F(`SCHEMA_INVALID`),issues:M(il)}),N({code:F(`SCOPE_VIOLATION`),path:M(k()),expectedScope:al,actualScope:ol}),N({code:F(`NOT_AGENT_SETTABLE`),path:M(k())}),N({code:F(`MIXED_SCOPE`),paths:M(N({path:M(k()),scope:ol}))}),N({code:F(`REMOVED_KEY`),path:M(k()),redirect:k(),source:rl.optional()}),N({code:F(`WRITE_ERROR`),detail:k()}),N({code:F(`OKIGNORE_INVALID`),detail:k(),lineNumber:A().int().min(1).optional()}),N({code:F(`UNKNOWN`),message:k().optional()})]),cl=new Set(sl.options.map(e=>e.shape.code.value)),ll=Zs([sl,Ys({code:k(),message:k().optional()})]);function ul(e){return cl.has(e.code)}function dl(e){switch(e){case`user`:return`~/.ok/global.yml`;case`project`:return`.ok/config.yml`;case`project-local`:return`.ok/local/config.yml`;case`either`:return`.ok/config.yml or ~/.ok/global.yml`}}function fl(e){switch(e){case`user`:return`personal to you, across all projects`;case`project`:return`shared with your team via git`;case`project-local`:return`this machine only, not shared`;case`either`:return`user or project`}}function pl(e){if(!ul(e))return e.message??`Unknown error (${e.code}).`;switch(e.code){case`YAML_PARSE`:return`Failed to parse YAML: ${e.detail}`;case`SCHEMA_INVALID`:{if(e.issues.length===0)return`Invalid configuration.`;let t=new Map;for(let n of e.issues){let e=n.source?.file??`<no source>`,r=t.get(e)??[];r.push(n),t.set(e,r)}let n=[];for(let[e,r]of t){e===`<no source>`?n.push(`Invalid configuration:`):n.push(`Invalid configuration at ${e}:`);for(let t of r){let r=t.path.length===0?`<root>`:t.path.join(`.`);if(t.source){if(n.push(` ${e}:${t.source.line}:${t.source.column}`),n.push(` ${r}: ${t.message}`),t.source.snippet&&t.source.snippet.length>0)for(let e of t.source.snippet.split(`
|
|
154
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function Ya(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(a[e.defId]=e.def)}e.external||Object.keys(a).length>0&&(e.target===`draft-2020-12`?i.$defs=a:i.definitions=a);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,`~standard`,{value:{...t[`~standard`],jsonSchema:{input:Qa(t,`input`,e.processors),output:Qa(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function Xa(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return Xa(r.element,n);if(r.type===`set`)return Xa(r.valueType,n);if(r.type===`lazy`)return Xa(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type===`default`||r.type===`prefault`)return Xa(r.innerType,n);if(r.type===`intersection`)return Xa(r.left,n)||Xa(r.right,n);if(r.type===`record`||r.type===`map`)return Xa(r.keyType,n)||Xa(r.valueType,n);if(r.type===`pipe`)return Xa(r.in,n)||Xa(r.out,n);if(r.type===`object`){for(let e in r.shape)if(Xa(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(Xa(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(Xa(e,n))return!0;return!!(r.rest&&Xa(r.rest,n))}return!1}const Za=(e,t={})=>n=>{let r=Ka({...n,processors:t});return qa(e,r),Ja(r,e),Ya(r,e)},Qa=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Ka({...i??{},target:a,io:t,processors:n});return qa(e,o),Ja(o,e),Ya(o,e)},$a={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},eo=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=$a[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},to=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`,typeof u==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u),typeof a==`number`&&(i.minimum=a,typeof u==`number`&&t.target!==`draft-04`&&(u>=a?delete i.minimum:delete i.exclusiveMinimum)),typeof l==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l),typeof o==`number`&&(i.maximum=o,typeof l==`number`&&t.target!==`draft-04`&&(l<=o?delete i.maximum:delete i.exclusiveMaximum)),typeof c==`number`&&(i.multipleOf=c)},no=(e,t,n,r)=>{n.type=`boolean`},ro=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`BigInt cannot be represented in JSON Schema`)},io=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Symbols cannot be represented in JSON Schema`)},ao=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},oo=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Undefined cannot be represented in JSON Schema`)},so=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`)},co=(e,t,n,r)=>{n.not={}},lo=(e,t,n,r)=>{},uo=(e,t,n,r)=>{},fo=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Date cannot be represented in JSON Schema`)},po=(e,t,n,r)=>{let i=e._zod.def,a=vt(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},mo=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},ho=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`NaN cannot be represented in JSON Schema`)},go=(e,t,n,r)=>{let i=n,a=e._zod.pattern;if(!a)throw Error(`Pattern not found in template literal`);i.type=`string`,i.pattern=a.source},_o=(e,t,n,r)=>{let i=n,a={type:`string`,format:`binary`,contentEncoding:`binary`},{minimum:o,maximum:s,mime:c}=e._zod.bag;o!==void 0&&(a.minLength=o),s!==void 0&&(a.maxLength=s),c?c.length===1?(a.contentMediaType=c[0],Object.assign(i,a)):(Object.assign(i,a),i.anyOf=c.map(e=>({contentMediaType:e}))):Object.assign(i,a)},vo=(e,t,n,r)=>{n.type=`boolean`},yo=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},bo=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Function types cannot be represented in JSON Schema`)},xo=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},So=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Map cannot be represented in JSON Schema`)},Co=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Set cannot be represented in JSON Schema`)},wo=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=qa(a.element,t,{...r,path:[...r.path,`items`]})},To=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=qa(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=qa(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Eo=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>qa(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Do=(e,t,n,r)=>{let i=e._zod.def,a=qa(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=qa(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},Oo=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>qa(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?qa(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null;t.target===`draft-2020-12`?(i.prefixItems=c,l&&(i.items=l)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),i.minItems=c.length,l||(i.maxItems=c.length)):(i.items=c,l&&(i.additionalItems=l));let{minimum:u,maximum:d}=e._zod.bag;typeof u==`number`&&(i.minItems=u),typeof d==`number`&&(i.maxItems=d)},ko=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=qa(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else (t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=qa(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=qa(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},Ao=(e,t,n,r)=>{let i=e._zod.def,a=qa(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},jo=(e,t,n,r)=>{let i=e._zod.def;qa(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Mo=(e,t,n,r)=>{let i=e._zod.def;qa(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},No=(e,t,n,r)=>{let i=e._zod.def;qa(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Po=(e,t,n,r)=>{let i=e._zod.def;qa(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},Fo=(e,t,n,r)=>{let i=e._zod.def,a=t.io===`input`?i.in._zod.def.type===`transform`?i.out:i.in:i.out;qa(a,t,r);let o=t.seen.get(e);o.ref=a},Io=(e,t,n,r)=>{let i=e._zod.def;qa(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Lo=(e,t,n,r)=>{let i=e._zod.def;qa(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Ro=(e,t,n,r)=>{let i=e._zod.def;qa(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},zo=(e,t,n,r)=>{let i=e._zod.innerType;qa(i,t,r);let a=t.seen.get(e);a.ref=i},Bo={string:eo,number:to,boolean:no,bigint:ro,symbol:io,null:ao,undefined:oo,void:so,never:co,any:lo,unknown:uo,date:fo,enum:po,literal:mo,nan:ho,template_literal:go,file:_o,success:vo,custom:yo,function:bo,transform:xo,map:So,set:Co,array:wo,object:To,union:Eo,intersection:Do,tuple:Oo,record:ko,nullable:Ao,nonoptional:jo,default:Mo,prefault:No,catch:Po,pipe:Fo,readonly:Io,promise:Lo,optional:Ro,lazy:zo};function Vo(e,t){if(`_idmap`in e){let n=e,r=Ka({...t,processors:Bo}),i={};for(let e of n._idmap.entries()){let[t,n]=e;qa(n,r)}let a={};r.external={registry:n,uri:t?.uri,defs:i};for(let e of n._idmap.entries()){let[t,n]=e;Ja(r,n),a[t]=Ya(r,n)}return Object.keys(i).length>0&&(a.__shared={[r.target===`draft-2020-12`?`$defs`:`definitions`]:i}),{schemas:a}}let n=Ka({...t,processors:Bo});return qa(e,n),Ja(n,e),Ya(n,e)}const Ho=D(`ZodISODateTime`,(e,t)=>{Mr.init(e,t),ms.init(e,t)});function Uo(e){return sa(Ho,e)}const Wo=D(`ZodISODate`,(e,t)=>{Nr.init(e,t),ms.init(e,t)});function Go(e){return ca(Wo,e)}const Ko=D(`ZodISOTime`,(e,t)=>{Pr.init(e,t),ms.init(e,t)});function qo(e){return la(Ko,e)}const Jo=D(`ZodISODuration`,(e,t)=>{Fr.init(e,t),ms.init(e,t)});function Yo(e){return ua(Jo,e)}const Xo=(e,t)=>{en.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>rn(e,t)},flatten:{value:t=>nn(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,yt,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,yt,2)}},isEmpty:{get(){return e.issues.length===0}}})};D(`ZodError`,Xo);const Zo=D(`ZodError`,Xo,{Parent:Error}),Qo=sn(Zo),$o=ln(Zo),es=dn(Zo),ts=pn(Zo),ns=hn(Zo),rs=gn(Zo),is=_n(Zo),as=vn(Zo),ss=yn(Zo),cs=bn(Zo),ls=xn(Zo),us=Sn(Zo),ds=D(`ZodType`,(e,t)=>(vr.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:Qa(e,`input`),output:Qa(e,`output`)}}),e.toJSONSchema=Za(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,`_def`,{value:t}),e.check=(...n)=>e.clone(Dt(t,{checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,n)=>Lt(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>Qo(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>es(e,t,n),e.parseAsync=async(t,n)=>$o(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>ts(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>ns(e,t,n),e.decode=(t,n)=>rs(e,t,n),e.encodeAsync=async(t,n)=>is(e,t,n),e.decodeAsync=async(t,n)=>as(e,t,n),e.safeEncode=(t,n)=>ss(e,t,n),e.safeDecode=(t,n)=>cs(e,t,n),e.safeEncodeAsync=async(t,n)=>ls(e,t,n),e.safeDecodeAsync=async(t,n)=>us(e,t,n),e.refine=(t,n)=>e.check(Ac(t,n)),e.superRefine=t=>e.check(jc(t)),e.overwrite=t=>e.check(Na(t)),e.optional=()=>lc(e),e.exactOptional=()=>dc(e),e.nullable=()=>pc(e),e.nullish=()=>lc(pc(e)),e.nonoptional=t=>yc(e,t),e.array=()=>M(e),e.or=t=>Zs([e,t]),e.and=t=>tc(e,t),e.transform=t=>Cc(e,sc(t)),e.default=t=>hc(e,t),e.prefault=t=>_c(e,t),e.catch=t=>xc(e,t),e.pipe=t=>Cc(e,t),e.readonly=()=>Tc(e),e.describe=t=>{let n=e.clone();return Li.add(n,{description:t}),n},Object.defineProperty(e,`description`,{get(){return Li.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return Li.get(e);let n=e.clone();return Li.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),fs=D(`_ZodString`,(e,t)=>{yr.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>eo(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(Da(...t)),e.includes=(...t)=>e.check(Aa(...t)),e.startsWith=(...t)=>e.check(ja(...t)),e.endsWith=(...t)=>e.check(Ma(...t)),e.min=(...t)=>e.check(Ta(...t)),e.max=(...t)=>e.check(wa(...t)),e.length=(...t)=>e.check(Ea(...t)),e.nonempty=(...t)=>e.check(Ta(1,...t)),e.lowercase=t=>e.check(Oa(t)),e.uppercase=t=>e.check(ka(t)),e.trim=()=>e.check(Fa()),e.normalize=(...t)=>e.check(Pa(...t)),e.toLowerCase=()=>e.check(Ia()),e.toUpperCase=()=>e.check(La()),e.slugify=()=>e.check(Ra())}),ps=D(`ZodString`,(e,t)=>{yr.init(e,t),fs.init(e,t),e.email=t=>e.check(zi(hs,t)),e.url=t=>e.check(Gi(vs,t)),e.jwt=t=>e.check(oa(Ps,t)),e.emoji=t=>e.check(Ki(bs,t)),e.guid=t=>e.check(Bi(gs,t)),e.uuid=t=>e.check(Vi(_s,t)),e.uuidv4=t=>e.check(Hi(_s,t)),e.uuidv6=t=>e.check(Ui(_s,t)),e.uuidv7=t=>e.check(Wi(_s,t)),e.nanoid=t=>e.check(qi(xs,t)),e.guid=t=>e.check(Bi(gs,t)),e.cuid=t=>e.check(Ji(Ss,t)),e.cuid2=t=>e.check(Yi(Cs,t)),e.ulid=t=>e.check(Xi(ws,t)),e.base64=t=>e.check(ra(js,t)),e.base64url=t=>e.check(ia(Ms,t)),e.xid=t=>e.check(Zi(Ts,t)),e.ksuid=t=>e.check(Qi(Es,t)),e.ipv4=t=>e.check($i(Ds,t)),e.ipv6=t=>e.check(ea(Os,t)),e.cidrv4=t=>e.check(ta(ks,t)),e.cidrv6=t=>e.check(na(As,t)),e.e164=t=>e.check(aa(Ns,t)),e.datetime=t=>e.check(Uo(t)),e.date=t=>e.check(Go(t)),e.time=t=>e.check(qo(t)),e.duration=t=>e.check(Yo(t))});function k(e){return Ri(ps,e)}const ms=D(`ZodStringFormat`,(e,t)=>{br.init(e,t),fs.init(e,t)}),hs=D(`ZodEmail`,(e,t)=>{Cr.init(e,t),ms.init(e,t)}),gs=D(`ZodGUID`,(e,t)=>{xr.init(e,t),ms.init(e,t)}),_s=D(`ZodUUID`,(e,t)=>{Sr.init(e,t),ms.init(e,t)}),vs=D(`ZodURL`,(e,t)=>{wr.init(e,t),ms.init(e,t)});function ys(e){return Gi(vs,e)}const bs=D(`ZodEmoji`,(e,t)=>{Tr.init(e,t),ms.init(e,t)}),xs=D(`ZodNanoID`,(e,t)=>{Er.init(e,t),ms.init(e,t)}),Ss=D(`ZodCUID`,(e,t)=>{Dr.init(e,t),ms.init(e,t)}),Cs=D(`ZodCUID2`,(e,t)=>{Or.init(e,t),ms.init(e,t)}),ws=D(`ZodULID`,(e,t)=>{kr.init(e,t),ms.init(e,t)}),Ts=D(`ZodXID`,(e,t)=>{Ar.init(e,t),ms.init(e,t)}),Es=D(`ZodKSUID`,(e,t)=>{jr.init(e,t),ms.init(e,t)}),Ds=D(`ZodIPv4`,(e,t)=>{Ir.init(e,t),ms.init(e,t)}),Os=D(`ZodIPv6`,(e,t)=>{Lr.init(e,t),ms.init(e,t)}),ks=D(`ZodCIDRv4`,(e,t)=>{Rr.init(e,t),ms.init(e,t)}),As=D(`ZodCIDRv6`,(e,t)=>{zr.init(e,t),ms.init(e,t)}),js=D(`ZodBase64`,(e,t)=>{Vr.init(e,t),ms.init(e,t)}),Ms=D(`ZodBase64URL`,(e,t)=>{Ur.init(e,t),ms.init(e,t)}),Ns=D(`ZodE164`,(e,t)=>{Wr.init(e,t),ms.init(e,t)}),Ps=D(`ZodJWT`,(e,t)=>{Kr.init(e,t),ms.init(e,t)}),Fs=D(`ZodNumber`,(e,t)=>{qr.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>to(e,t,n,r),e.gt=(t,n)=>e.check(xa(t,n)),e.gte=(t,n)=>e.check(Sa(t,n)),e.min=(t,n)=>e.check(Sa(t,n)),e.lt=(t,n)=>e.check(ya(t,n)),e.lte=(t,n)=>e.check(ba(t,n)),e.max=(t,n)=>e.check(ba(t,n)),e.int=t=>e.check(Ls(t)),e.safe=t=>e.check(Ls(t)),e.positive=t=>e.check(xa(0,t)),e.nonnegative=t=>e.check(Sa(0,t)),e.negative=t=>e.check(ya(0,t)),e.nonpositive=t=>e.check(ba(0,t)),e.multipleOf=(t,n)=>e.check(Ca(t,n)),e.step=(t,n)=>e.check(Ca(t,n)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function A(e){return da(Fs,e)}const Is=D(`ZodNumberFormat`,(e,t)=>{Jr.init(e,t),Fs.init(e,t)});function Ls(e){return pa(Is,e)}const Rs=D(`ZodBoolean`,(e,t)=>{Yr.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>no(e,t,n,r)});function j(e){return ma(Rs,e)}const zs=D(`ZodNull`,(e,t)=>{Xr.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ao(e,t,n,r)});function Bs(e){return ha(zs,e)}const Vs=D(`ZodAny`,(e,t)=>{Zr.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Hs(){return ga(Vs)}const Us=D(`ZodUnknown`,(e,t)=>{Qr.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Ws(){return _a(Us)}const Gs=D(`ZodNever`,(e,t)=>{$r.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>co(e,t,n,r)});function Ks(e){return va(Gs,e)}const qs=D(`ZodArray`,(e,t)=>{ti.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wo(e,t,n,r),e.element=t.element,e.min=(t,n)=>e.check(Ta(t,n)),e.nonempty=t=>e.check(Ta(1,t)),e.max=(t,n)=>e.check(wa(t,n)),e.length=(t,n)=>e.check(Ea(t,n)),e.unwrap=()=>e.element});function M(e,t){return za(qs,e,t)}const Js=D(`ZodObject`,(e,t)=>{oi.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>To(e,t,n,r),Tt(e,`shape`,()=>t.shape),e.keyof=()=>P(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Ws()}),e.loose=()=>e.clone({...e._zod.def,catchall:Ws()}),e.strict=()=>e.clone({...e._zod.def,catchall:Ks()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>Ht(e,t),e.safeExtend=t=>Ut(e,t),e.merge=t=>Wt(e,t),e.pick=t=>Bt(e,t),e.omit=t=>Vt(e,t),e.partial=(...t)=>Gt(cc,e,t[0]),e.required=(...t)=>Kt(vc,e,t[0])});function N(e,t){return new Js({type:`object`,shape:e??{},...O(t)})}function Ys(e,t){return new Js({type:`object`,shape:e,catchall:Ws(),...O(t)})}const Xs=D(`ZodUnion`,(e,t)=>{ci.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Eo(e,t,n,r),e.options=t.options});function Zs(e,t){return new Xs({type:`union`,options:e,...O(t)})}const Qs=D(`ZodDiscriminatedUnion`,(e,t)=>{Xs.init(e,t),li.init(e,t)});function $s(e,t,n){return new Qs({type:`union`,options:t,discriminator:e,...O(n)})}const ec=D(`ZodIntersection`,(e,t)=>{ui.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Do(e,t,n,r)});function tc(e,t){return new ec({type:`intersection`,left:e,right:t})}const nc=D(`ZodRecord`,(e,t)=>{pi.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ko(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function rc(e,t,n){return new nc({type:`record`,keyType:e,valueType:t,...O(n)})}const ic=D(`ZodEnum`,(e,t)=>{mi.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>po(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new ic({...t,checks:[],...O(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new ic({...t,checks:[],...O(r),entries:i})}});function P(e,t){return new ic({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...O(t)})}const ac=D(`ZodLiteral`,(e,t)=>{hi.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mo(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,`value`,{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function F(e,t){return new ac({type:`literal`,values:Array.isArray(e)?e:[e],...O(t)})}const oc=D(`ZodTransform`,(e,t)=>{gi.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xo(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new ht(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Qt(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(Qt(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function sc(e){return new oc({type:`transform`,transform:e})}const cc=D(`ZodOptional`,(e,t)=>{vi.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ro(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function lc(e){return new cc({type:`optional`,innerType:e})}const uc=D(`ZodExactOptional`,(e,t)=>{yi.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ro(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function dc(e){return new uc({type:`optional`,innerType:e})}const fc=D(`ZodNullable`,(e,t)=>{bi.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ao(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function pc(e){return new fc({type:`nullable`,innerType:e})}const mc=D(`ZodDefault`,(e,t)=>{xi.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function hc(e,t){return new mc({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Pt(t)}})}const gc=D(`ZodPrefault`,(e,t)=>{Ci.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>No(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function _c(e,t){return new gc({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Pt(t)}})}const vc=D(`ZodNonOptional`,(e,t)=>{wi.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function yc(e,t){return new vc({type:`nonoptional`,innerType:e,...O(t)})}const bc=D(`ZodCatch`,(e,t)=>{Ei.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Po(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function xc(e,t){return new bc({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}const Sc=D(`ZodPipe`,(e,t)=>{Di.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fo(e,t,n,r),e.in=t.in,e.out=t.out});function Cc(e,t){return new Sc({type:`pipe`,in:e,out:t})}const wc=D(`ZodReadonly`,(e,t)=>{ki.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Io(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Tc(e){return new wc({type:`readonly`,innerType:e})}const Ec=D(`ZodLazy`,(e,t)=>{ji.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zo(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function Dc(e){return new Ec({type:`lazy`,getter:e})}const Oc=D(`ZodCustom`,(e,t)=>{Mi.init(e,t),ds.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yo(e,t,n,r)});function kc(e,t){return Ba(Oc,e??(()=>!0),t)}function Ac(e,t={}){return Va(Oc,e,t)}function jc(e){return Ha(e)}function Mc(e,t){return Cc(sc(e),t)}var Nc=ft();a();const Pc=Symbol.for(`@inkeep/open-knowledge/field-registry`),Fc=globalThis;Fc[Pc]===void 0&&(Fc[Pc]=Ii());const Ic=Fc[Pc];function Lc(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=Rc(t)?Ic.get(t):void 0;if(e!==void 0)return e;let n=t._zod?.def?.innerType;if(n===void 0)return;t=n}}function Rc(e){return typeof e==`object`&&!!e&&`_zod`in e&&`parse`in e}const zc=Object.freeze([`authorization`,`auth.token`,`auth.bearer`,`cookie`,`set-cookie`,`x-api-key`,`password`,`secret`]),Bc=52428800,Vc=26214400,Hc=`https://api.openai.com/v1`,Uc=`text-embedding-3-small`,Wc=Ys({content:Ys({dir:k().register(Ic,{scope:`project`,agentSettable:!1,defaultScope:`project`,description:`Folder OpenKnowledge reads and writes documents under, relative to the project root (the folder that contains .ok/). Defaults to the project root. Exclude paths with .okignore.`}).default(`.`)}).default({dir:`.`}),appearance:Ys({theme:P([`light`,`dark`,`system`]).register(Ic,{scope:`user`,agentSettable:!1,defaultScope:`user`,description:`Editor color theme: 'light', 'dark', or 'system' (follow the OS). A personal preference (user scope) — not shared with the project.`}).optional(),preview:Ys({autoOpen:j().register(Ic,{scope:`user`,agentSettable:!1,defaultScope:`user`,description:`When on, the agent opens or refreshes the live preview after each edit. Turn off if you manage your own preview window. A personal preference (user scope).`}).default(!0)}).default({autoOpen:!0}),sidebar:Ys({showHiddenFiles:j().register(Ic,{scope:`project-local`,agentSettable:!1,defaultScope:`project-local`,description:`Show dot-prefixed entries (e.g. .ok/, .okignore) in the file tree. Per-machine (project-local) — not shared with collaborators.`}).default(!1)}).optional()}).default({preview:{autoOpen:!0}}),editor:Ys({wordWrap:j().register(Ic,{scope:`user`,agentSettable:!1,defaultScope:`user`,description:`Soft-wrap long lines in the source (CodeMirror) editor. A personal preference (user scope).`}).default(!0)}).default({wordWrap:!0}),autoSync:Ys({enabled:j().register(Ic,{scope:`project-local`,agentSettable:!1,defaultScope:`project-local`,description:`Whether this machine auto-pulls and auto-pushes git commits for this project. null = not chosen yet (onboarding asks). Per-machine (project-local) — not shared.`}).nullable().default(null),default:j().register(Ic,{scope:`project`,agentSettable:!1,defaultScope:`project`,description:`Committed project default for a machine's autoSync.enabled on first open: true = auto-sync on, false = off, null = ask (show the onboarding prompt). Shared via git. A per-machine autoSync.enabled choice overrides it.`}).nullable().default(null)}).default({enabled:null,default:null}),terminal:Ys({enabled:j().register(Ic,{scope:`project-local`,agentSettable:!1,defaultScope:`project-local`,description:`Opt-out for the in-app terminal (a real OS shell at full user privilege). The terminal is on by default; set false to disable it for this project on this machine. Per-machine (project-local) — never shared via git, clone, or sync.`}).nullable().default(null)}).default({enabled:null}),telemetry:Ys({localSink:Ys({enabled:j().register(Ic,{scope:`project`,agentSettable:!1,defaultScope:`project`,description:"Write local diagnostic spans + logs under .ok/local/ for `ok diagnose bundle`. Local-only — never leaves the machine until you run bundle. Set false for sensitive workspaces. Shared across collaborators."}).default(!0),spans:Ys({maxBytes:A().register(Ic,{scope:`project`,agentSettable:!1,defaultScope:`project`,description:`Maximum size, in bytes, of the local diagnostic spans file before it rotates (default ~50 MB).`}).default(Bc)}).default({maxBytes:Bc}),logs:Ys({maxBytes:A().register(Ic,{scope:`project`,agentSettable:!1,defaultScope:`project`,description:`Maximum size, in bytes, of the local diagnostic logs file before it rotates (default ~25 MB).`}).default(Vc)}).default({maxBytes:Vc}),attributeDenylist:M(k()).register(Ic,{scope:`project`,agentSettable:!1,defaultScope:`project`,description:`Telemetry attribute keys whose values are redacted before any local span/log is written (credential / secret guard). Extends the built-in denylist.`}).default([...zc])}).default({enabled:!0,spans:{maxBytes:Bc},logs:{maxBytes:Vc},attributeDenylist:[...zc]})}).default({localSink:{enabled:!0,spans:{maxBytes:Bc},logs:{maxBytes:Vc},attributeDenylist:[...zc]}}),search:Ys({semantic:Ys({enabled:j().register(Ic,{scope:`project-local`,agentSettable:!1,defaultScope:`project-local`,description:"Add semantic (embeddings) ranking to the MCP search tool, fused with the lexical engine so conceptually-related pages surface even with no shared keywords. When ON and an API key is set (`ok embeddings set-key`), the search query and matching document content are sent to the configured embeddings provider — content egress. Default OFF. Per-machine (project-local) — not shared with collaborators."}).default(!1),baseUrl:k().register(Ic,{scope:`project-local`,agentSettable:!1,defaultScope:`project-local`,description:"Base URL of the OpenAI-compatible embeddings API (default https://api.openai.com/v1). Override for Azure / self-hosted / other providers. The API key is NOT stored here — set it with `ok embeddings set-key` (OS keyring)."}).default(Hc),model:k().register(Ic,{scope:`project-local`,agentSettable:!1,defaultScope:`project-local`,description:`Embeddings model id (default text-embedding-3-small). Must be served by the provider at baseUrl. Changing it re-embeds the corpus (the cache is keyed by provider + model + dimensions).`}).default(Uc),dimensions:A().int().positive().register(Ic,{scope:`project-local`,agentSettable:!1,defaultScope:`project-local`,description:`Optional output vector dimensions. Omit to use the model's native size (1536 for text-embedding-3-small). Set a smaller value (text-embedding-3 supports e.g. 512 / 1024) to shrink the on-disk cache, trading a little retrieval quality. Changing it re-embeds the corpus.`}).optional(),similarityFloor:A().min(0).max(1).register(Ic,{scope:`project-local`,agentSettable:!1,defaultScope:`project-local`,description:`Optional hard cutoff: drop any "by meaning" match whose cosine similarity is below this value. Off by default (0) because retrieval is rank-based (the closest pages are returned regardless of absolute score) and the right cutoff is model-specific. Set it only to suppress weak matches for a specific provider/model whose cosine scale you know. Most setups should leave it unset and rely on the result-count cap.`}).optional()}).default({enabled:!1,baseUrl:Hc,model:Uc})}).default({semantic:{enabled:!1,baseUrl:Hc,model:Uc}})}),Gc=`open-knowledge-config`;async function Kc(e,t,n){let r=o.getTracer(Gc),a=t?{attributes:t}:{};return r.startActiveSpan(e,a,async e=>{try{return await n(e)}catch(t){throw e.recordException(t),e.setStatus({code:i.ERROR,message:t instanceof Error?t.message:String(t)}),t}finally{e.end()}})}function qc(e,t,n){let r=o.getTracer(Gc),a=t?{attributes:t}:{};return r.startActiveSpan(e,a,e=>{try{return n(e)}catch(t){throw e.recordException(t),e.setStatus({code:i.ERROR,message:t instanceof Error?t.message:String(t)}),t}finally{e.end()}})}function Jc(e,t){let n=o.getActiveSpan();n&&n.addEvent(e,t)}function Yc(e){let t=e;for(let e=0;e<16;e++){if(t==null||t?._zod?.def?.shape!==void 0)return t;let e=t?._zod?.def?.innerType;if(e===void 0)return t;t=e}return t}function Xc(e,t){let n=e;for(let e of t){n=Yc(n);let t=n?._zod?.def?.shape;if(!t||(n=t[String(e)],n===void 0))return}return n}function Zc(e,t){let n=Xc(e,t);if(n!==void 0)return Lc(n)}function Qc(e,t){return e===`either`?!0:e===t}function $c(e,t){let n=null;function r(e,i){if(n!==null||e===void 0)return;if(typeof e==`object`&&e&&!Array.isArray(e)){for(let[t,a]of Object.entries(e))if(r(a,[...i,t]),n!==null)return;return}let a=Zc(Wc,i);a?.scope!==void 0&&(Qc(a.scope,t)||(n={code:`SCOPE_VIOLATION`,path:i,expectedScope:a.scope,actualScope:t}))}for(let[t,i]of Object.entries(e))if(r(i,[t]),n!==null)break;return n}function el(e,t){for(let n=1;n<t.length;n++){let r=t.slice(0,n);e.hasIn(r)&&((0,Nc.isCollection)(e.getIn(r,!0))||e.deleteIn(r))}}function tl(e,t){let n=[];function r(t,i){if(t!==void 0){if(t===null){e.deleteIn(i),n.push(i.join(`.`));return}if(Array.isArray(t)){el(e,i),e.setIn(i,t),n.push(i.join(`.`));return}if(typeof t==`object`){for(let[e,n]of Object.entries(t))r(n,[...i,e]);return}el(e,i),e.setIn(i,t),n.push(i.join(`.`))}}for(let[e,n]of Object.entries(t))r(n,[e]);return n}function nl(e){return{path:e.path.map(e=>typeof e==`symbol`?String(e):e),message:e.message,issueCode:e.code}}const rl=N({file:k(),line:A().int().min(1),column:A().int().min(1),snippet:k().optional()}),il=N({path:M(Zs([k(),A()])),message:k(),issueCode:k(),params:rc(k(),Ws()).optional(),source:rl.optional()}),al=P([`user`,`project`,`project-local`,`either`]),ol=P([`user`,`project`,`project-local`]),sl=$s(`code`,[N({code:F(`YAML_PARSE`),detail:k()}),N({code:F(`SCHEMA_INVALID`),issues:M(il)}),N({code:F(`SCOPE_VIOLATION`),path:M(k()),expectedScope:al,actualScope:ol}),N({code:F(`NOT_AGENT_SETTABLE`),path:M(k())}),N({code:F(`MIXED_SCOPE`),paths:M(N({path:M(k()),scope:ol}))}),N({code:F(`REMOVED_KEY`),path:M(k()),redirect:k(),source:rl.optional()}),N({code:F(`WRITE_ERROR`),detail:k()}),N({code:F(`OKIGNORE_INVALID`),detail:k(),lineNumber:A().int().min(1).optional()}),N({code:F(`UNKNOWN`),message:k().optional()})]),cl=new Set(sl.options.map(e=>e.shape.code.value)),ll=Zs([sl,Ys({code:k(),message:k().optional()})]);function ul(e){return cl.has(e.code)}function dl(e){switch(e){case`user`:return`~/.ok/global.yml`;case`project`:return`.ok/config.yml`;case`project-local`:return`.ok/local/config.yml`;case`either`:return`.ok/config.yml or ~/.ok/global.yml`}}function fl(e){switch(e){case`user`:return`personal to you, across all projects`;case`project`:return`shared with your team via git`;case`project-local`:return`this machine only, not shared`;case`either`:return`user or project`}}function pl(e){if(!ul(e))return e.message??`Unknown error (${e.code}).`;switch(e.code){case`YAML_PARSE`:return`Failed to parse YAML: ${e.detail}`;case`SCHEMA_INVALID`:{if(e.issues.length===0)return`Invalid configuration.`;let t=new Map;for(let n of e.issues){let e=n.source?.file??`<no source>`,r=t.get(e)??[];r.push(n),t.set(e,r)}let n=[];for(let[e,r]of t){e===`<no source>`?n.push(`Invalid configuration:`):n.push(`Invalid configuration at ${e}:`);for(let t of r){let r=t.path.length===0?`<root>`:t.path.join(`.`);if(t.source){if(n.push(` ${e}:${t.source.line}:${t.source.column}`),n.push(` ${r}: ${t.message}`),t.source.snippet&&t.source.snippet.length>0)for(let e of t.source.snippet.split(`
|
|
155
155
|
`))n.push(` ${e}`)}else n.push(` ${r}: ${t.message}`)}}return n.join(`
|
|
156
156
|
`)}case`SCOPE_VIOLATION`:return[`Setting ${e.path.join(`.`)} belongs in your ${e.expectedScope} config`,`(${dl(e.expectedScope)} — ${fl(e.expectedScope)}),`,`but it was set in the ${e.actualScope} config (${dl(e.actualScope)}).`,`Move it to ${dl(e.expectedScope)}.`].join(` `);case`NOT_AGENT_SETTABLE`:return[`Setting ${e.path.join(`.`)} is human-only and can't be changed by an agent.`,`Change it in the Settings pane, or edit the config.yml by hand.`].join(` `);case`MIXED_SCOPE`:return[`This change touches settings that live in different config files. Apply them one file at a time:`,e.paths.map(({path:e,scope:t})=>` ${e.join(`.`)} → ${dl(t)} (${t})`).join(`
|
|
157
157
|
`)].join(`
|
|
@@ -326,7 +326,7 @@ $2`).split(`
|
|
|
326
326
|
`),w=v.split(`
|
|
327
327
|
`),T=e=>{for(let t=0;t<e.length-1;t++){let n=(e[t]??``).trim(),r=(e[t+1]??``).trim(),i=n!==``&&r===``&&NG.test(n),a=n===``&&r!==``&&NG.test(r);if(i||a)return!0}return!1};(T(C)||T(w))&&n.push(`jsx-container-boundary-blank`);let E=e=>e.replace(/^[ \t]+/,``).replace(EG,`1$1`),ee=Math.min(C.length,w.length);for(let e=0;e<ee;e++){let t=C[e]??``,r=w[e]??``;if(t!==r&&E(t)===E(r)&&/^[ \t]*\d+[.)]\s/.test(t)){n.push(`ordered-list-marker-number`);break}}return(/[ \t]\n/.test(_)||/[ \t]\n/.test(v))&&n.push(`trailing-whitespace`),(/[ \t]$/.test(_)||/[ \t]$/.test(v))&&(n.includes(`trailing-whitespace`)||n.push(`trailing-whitespace`)),(/\n{3,}/.test(_)||/\n{3,}/.test(v))&&n.push(`blank-line-collapse`),_.endsWith(`
|
|
328
328
|
`)!==v.endsWith(`
|
|
329
|
-
`)&&n.push(`trailing-newline`),n}const BG={setTimeout:(e,t)=>globalThis.setTimeout(e,t),clearTimeout:e=>globalThis.clearTimeout(e),now:()=>Date.now()},VG={"emphasis-around-code":`pm-model-caused`,bom:`parser-caused`,crlf:`parser-caused`,"commonmark-escape":`parser-caused`,"leading-newline":`parser-caused`,"paragraph-continuation-indent":`parser-caused`,"doc-start-thematic":`parser-caused`,"block-separator-collapse":`serializer-caused`,"table-align-row-spacing":`serializer-caused`,"row-no-trailing-pipe":`serializer-caused`,"ordered-list-marker-number":`serializer-caused`,"list-indent-canonical":`serializer-caused`,"jsx-container-boundary-blank":`serializer-caused`,"trailing-whitespace":`serializer-caused`,"blank-line-collapse":`serializer-caused`,"trailing-newline":`serializer-caused`};function HG(e){return VG[e]}function UG(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++)if(e.charCodeAt(r)!==t.charCodeAt(r))return r;return e.length===t.length?-1:n}let WG=null;function GG(e){WG=e}function KG(e,t,n,r){if(!WG||e.length===0)return;let i=UG(t,n),a=new Date().toISOString();for(let t of e)WG({timestamp:a,className:t,documentName:r,codeUnitPosition:i,severity:HG(t)})}const qG=1,JG={protocol:`x-ok-client-protocol`,runtime:`x-ok-client-runtime`,kind:`x-ok-client-kind`};function YG({kind:e,runtimeVersion:t}){return{[JG.protocol]:`1`,[JG.runtime]:t,[JG.kind]:e}}const XG=`__system__`,ZG=1,QG=`__config__/project`,$G=`__user__/config.yml`,eK=`__local__/project`,tK=`__config__/okignore`,nK=Object.freeze([QG,eK,$G,tK]),rK=new Set(Object.keys({sh:`bash`,zsh:`bash`,bash:`bash`,c:`c`,cc:`cpp`,cpp:`cpp`,cxx:`cpp`,"c++":`cpp`,h:`c`,hh:`cpp`,hpp:`cpp`,cs:`csharp`,css:`css`,less:`less`,scss:`scss`,sass:`scss`,diff:`diff`,patch:`diff`,go:`go`,gql:`graphql`,graphql:`graphql`,ini:`ini`,cfg:`ini`,conf:`ini`,properties:`ini`,java:`java`,js:`javascript`,jsx:`javascript`,mjs:`javascript`,cjs:`javascript`,json:`json`,jsonc:`json`,kt:`kotlin`,kts:`kotlin`,lua:`lua`,makefile:`makefile`,md:`markdown`,mdx:`markdown`,m:`objectivec`,mm:`objectivec`,pl:`perl`,pm:`perl`,php:`php`,phtml:`php`,py:`python`,pyi:`python`,pyx:`python`,r:`r`,rb:`ruby`,rs:`rust`,sql:`sql`,swift:`swift`,ts:`typescript`,tsx:`typescript`,xml:`xml`,yaml:`yaml`,yml:`yaml`})),iK=[`.mdx`,`.md`],aK=`epoch`,oK=512*1024,sK=[`claude`,`claude-desktop`,`cursor`,`codex`],cK={claude:`Claude`,"claude-desktop":`Claude Desktop`,cursor:`Cursor`,codex:`Codex`},lK={cursor:/\bCursor(?:\([^)]+\))?\/\d/,codex:/\bCodex(?:\([^)]+\))?\/\d/,"claude-desktop":/\bClaude(?:\([^)]+\))?\/\d/},uK=`Ov23liqlSd0V1MwR6rhI`,dK=[`incoming`,`outgoing`,`both`];function fK(e){return dK.includes(e)}const pK=1e4,mK=`last-spawn-error.log`,hK=`open-knowledge`,gK=[{id:`chart`,title:`Chart`,description:`A bar chart whose series colors track the OK chart palette.`,html:`<div style="font-family:system-ui,sans-serif;padding:20px;color:var(--foreground)">
|
|
329
|
+
`)&&n.push(`trailing-newline`),n}const BG={setTimeout:(e,t)=>globalThis.setTimeout(e,t),clearTimeout:e=>globalThis.clearTimeout(e),now:()=>Date.now()},VG={"emphasis-around-code":`pm-model-caused`,bom:`parser-caused`,crlf:`parser-caused`,"commonmark-escape":`parser-caused`,"leading-newline":`parser-caused`,"paragraph-continuation-indent":`parser-caused`,"doc-start-thematic":`parser-caused`,"block-separator-collapse":`serializer-caused`,"table-align-row-spacing":`serializer-caused`,"row-no-trailing-pipe":`serializer-caused`,"ordered-list-marker-number":`serializer-caused`,"list-indent-canonical":`serializer-caused`,"jsx-container-boundary-blank":`serializer-caused`,"trailing-whitespace":`serializer-caused`,"blank-line-collapse":`serializer-caused`,"trailing-newline":`serializer-caused`};function HG(e){return VG[e]}function UG(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++)if(e.charCodeAt(r)!==t.charCodeAt(r))return r;return e.length===t.length?-1:n}let WG=null;function GG(e){WG=e}function KG(e,t,n,r){if(!WG||e.length===0)return;let i=UG(t,n),a=new Date().toISOString();for(let t of e)WG({timestamp:a,className:t,documentName:r,codeUnitPosition:i,severity:HG(t)})}const qG=1,JG={protocol:`x-ok-client-protocol`,runtime:`x-ok-client-runtime`,kind:`x-ok-client-kind`};function YG({kind:e,runtimeVersion:t}){return{[JG.protocol]:`1`,[JG.runtime]:t,[JG.kind]:e}}const XG=`__system__`,ZG=1,QG=`__config__/project`,$G=`__user__/config.yml`,eK=`__local__/project`,tK=`__config__/okignore`,nK=Object.freeze([QG,eK,$G,tK]),rK=new Set(Object.keys({sh:`bash`,zsh:`bash`,bash:`bash`,c:`c`,cc:`cpp`,cpp:`cpp`,cxx:`cpp`,"c++":`cpp`,h:`c`,hh:`cpp`,hpp:`cpp`,cs:`csharp`,css:`css`,less:`less`,scss:`scss`,sass:`scss`,diff:`diff`,patch:`diff`,go:`go`,gql:`graphql`,graphql:`graphql`,ini:`ini`,cfg:`ini`,conf:`ini`,properties:`ini`,java:`java`,js:`javascript`,jsx:`javascript`,mjs:`javascript`,cjs:`javascript`,json:`json`,jsonc:`json`,kt:`kotlin`,kts:`kotlin`,lua:`lua`,makefile:`makefile`,md:`markdown`,mdx:`markdown`,m:`objectivec`,mm:`objectivec`,pl:`perl`,pm:`perl`,php:`php`,phtml:`php`,py:`python`,pyi:`python`,pyx:`python`,r:`r`,rb:`ruby`,rs:`rust`,sql:`sql`,swift:`swift`,ts:`typescript`,tsx:`typescript`,xml:`xml`,yaml:`yaml`,yml:`yaml`})),iK=[`.mdx`,`.md`],aK=`epoch`,oK=512*1024,sK=[`claude`,`claude-desktop`,`cursor`,`codex`,`opencode`],cK={claude:`Claude`,"claude-desktop":`Claude Desktop`,cursor:`Cursor`,codex:`Codex`,opencode:`OpenCode`},lK={cursor:/\bCursor(?:\([^)]+\))?\/\d/,codex:/\bCodex(?:\([^)]+\))?\/\d/,"claude-desktop":/\bClaude(?:\([^)]+\))?\/\d/},uK=`Ov23liqlSd0V1MwR6rhI`,dK=[`incoming`,`outgoing`,`both`];function fK(e){return dK.includes(e)}const pK=1e4,mK=`last-spawn-error.log`,hK=`open-knowledge`,gK=[{id:`chart`,title:`Chart`,description:`A bar chart whose series colors track the OK chart palette.`,html:`<div style="font-family:system-ui,sans-serif;padding:20px;color:var(--foreground)">
|
|
330
330
|
<h3 style="margin:0 0 14px;font-size:15px;font-weight:600">Revenue by region</h3>
|
|
331
331
|
<div id="bars" style="display:flex;align-items:flex-end;gap:14px;height:170px"></div>
|
|
332
332
|
<script>
|
|
@@ -389,7 +389,7 @@ $2`).split(`
|
|
|
389
389
|
});
|
|
390
390
|
<\/script>
|
|
391
391
|
</div>`}];function _K(e){return["```html preview",e.html,"```"].join(`
|
|
392
|
-
`)}const vK=[{name:`--chart-1`,light:`oklch(0.62 0.19 259)`,dark:`oklch(0.72 0.14 259)`},{name:`--chart-2`,light:`oklch(0.58 0.14 145)`,dark:`oklch(0.73 0.13 145)`},{name:`--chart-3`,light:`oklch(0.62 0.15 70)`,dark:`oklch(0.77 0.14 70)`},{name:`--chart-4`,light:`oklch(0.55 0.18 290)`,dark:`oklch(0.72 0.16 290)`},{name:`--chart-5`,light:`oklch(0.58 0.21 25)`,dark:`oklch(0.72 0.2 25)`},{name:`--primary`,light:`oklch(0.6321 0.1983 259.59)`,dark:`#69a3ff`},{name:`--primary-foreground`,light:`oklch(0.985 0 0)`,dark:`oklch(0.205 0 0)`},{name:`--foreground`,light:`oklch(0.145 0 0)`,dark:`oklch(0.985 0 0)`},{name:`--background`,light:`oklch(1 0 0)`,dark:`oklch(0.145 0 0)`},{name:`--card`,light:`oklch(1 0 0)`,dark:`oklch(0.205 0 0)`},{name:`--card-foreground`,light:`oklch(0.145 0 0)`,dark:`oklch(0.985 0 0)`},{name:`--muted-foreground`,light:`oklch(0.556 0 0)`,dark:`oklch(0.708 0 0)`},{name:`--border`,light:`oklch(0.922 0 0)`,dark:`oklch(1 0 0 / 10%)`},{name:`--destructive`,light:`oklch(0.577 0.245 27.325)`,dark:`oklch(0.704 0.191 22.216)`},{name:`--radius`,light:`0.625rem`,dark:`0.625rem`}],yK=`localhost`,bK=[`image/jpeg`,`image/png`,`image/gif`,`image/webp`,`image/svg+xml`],xK=[`video/mp4`,`video/webm`,`video/ogg`],SK=[`audio/mpeg`,`audio/wav`,`audio/ogg`],CK=[`application/pdf`],wK=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`avif`,`svg`]),TK=new Set([`mp4`,`webm`,`mov`,`m4v`,`mkv`]),EK=new Set([`pdf`]),DK=new Set([`mp3`,`wav`,`ogg`,`m4a`,`flac`,`aac`,`opus`]),OK=new Set(`pdf.docx.xlsx.pptx.doc.xls.ppt.zip.7z.tar.gz.rar.csv.tsv.rtf.json.yaml.yml.xml.txt.pages.numbers.key.odt.ods.odp.epub.mobi`.split(`.`)),kK=new Set(`exe.bat.cmd.ps1.com.msi.vbs.js.jse.wsf.wsh.hta.sh.command.csh.ksh.bash.zsh.fish.desktop.action.workflow.html.htm.svg.xml.mhtml.svgz.dmg.pkg.mpkg.scpt.applescript.terminal.prefpane.webloc.inetloc.fileloc.jar.appimage.deb.rpm.msix.appx.ipa.apk.pif.scr.lnk.url`.split(`.`)),AK=new Set(`png.jpg.jpeg.gif.webp.avif.svg.apng.heic.heif.tiff.bmp.ico.pdf.mp4.webm.mov.m4v.mkv.avi.flv.wmv.mpeg.mpg.mp3.wav.ogg.m4a.flac.aac.opus.zip.7z.tar.gz.rar.woff.woff2.ttf.otf.eot.docx.xlsx.pptx.doc.xls.ppt.odt.ods.odp.pages.numbers.key.epub.mobi.csv.tsv.txt.rtf.json.yaml.yml.xml.toml.lock.gpx.html.htm`.split(`.`)),jK=new Set([`html`,`htm`]),MK=`sandbox allow-scripts; connect-src 'none'`,NK=new Set(`png.jpg.jpeg.gif.webp.avif.apng.heic.heif.tiff.bmp.ico.svg.pdf.mp4.webm.mov.m4v.mkv.mp3.wav.ogg.m4a.flac.aac.opus.json.toml.lock`.split(`.`)),PK=`same-dir`,FK=new Set(`png.jpg.jpeg.gif.webp.avif.svg.pdf.mp4.webm.mov.m4v.mkv.mp3.wav.ogg.m4a.flac.aac.opus.docx.xlsx.pptx.doc.xls.ppt.zip.7z.tar.gz.rar.csv.tsv.rtf.json.yaml.yml.xml.txt.pages.numbers.key.odt.ods.odp.epub.mobi`.split(`.`)),IK=[`png`,`jpg`,`jpeg`,`gif`,`webp`,`avif`],LK=[`mp4`,`webm`,`mov`,`m4v`],RK=[`mp3`,`wav`,`ogg`,`m4a`,`flac`,`aac`,`opus`],zK=[`pdf`],BK=[`json`,`toml`,`lock`];function VK(e,t,n){for(let r of t)if(!n.has(r))throw Error(`${e}: ${r} is not present in canonical upload constants`)}VK(`SIDEBAR_IMAGE_ASSET_EXTENSIONS`,IK,wK),VK(`SIDEBAR_VIDEO_ASSET_EXTENSIONS`,LK,TK),VK(`SIDEBAR_AUDIO_ASSET_EXTENSIONS`,RK,DK),VK(`SIDEBAR_PDF_ASSET_EXTENSIONS`,zK,EK),VK(`FILE_ATTACHMENT_EXTENSIONS`,[...OK],FK),VK(`WIKI_EMBED_EXTENSIONS`,[...FK],AK);const HK=new Set(IK),UK=new Set(LK),WK=new Set(RK),GK=new Set(zK),KK=new Set(BK);VK(`SIDEBAR_RENDERABLE_ASSET_EXTENSIONS`,[...new Set([...IK,...LK,...RK,...zK,...BK])],NK);const qK=new Set([`base`,`canvas`]),JK=new Set([...AK,...qK]);function YK(e){let t=e.toLowerCase().replace(/^\./,``);return HK.has(t)?`image`:UK.has(t)?`video`:WK.has(t)?`audio`:GK.has(t)?`pdf`:KK.has(t)||qK.has(t)||rK.has(t)?`text`:null}const XK=Ex.extend({priority:60,addAttributes(){return{...this.parent?.(),fenceDelimiter:{default:"`"},fenceLength:{default:3},meta:{default:null},sourceStyle:{default:`fenced`},sourceClosingFenceLength:{default:null,rendered:!1},sourceFenceIndent:{default:null,rendered:!1},sourceInfoPadding:{default:null,rendered:!1},sourceIndents:{default:null,rendered:!1}}}}),ZK=zx.extend({name:`emphasis`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`*`}}},addInputRules(){return[rx({find:Px,type:this.type,getAttributes:{sourceDelimiter:`*`}}),rx({find:Ix,type:this.type,getAttributes:{sourceDelimiter:`_`}})]}}),QK=Nx.extend({name:`strong`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`**`}}},addInputRules(){return[rx({find:Ox,type:this.type,getAttributes:{sourceDelimiter:`**`}}),rx({find:Ax,type:this.type,getAttributes:{sourceDelimiter:`__`}})]}}),$K=Ib.create({name:`escapeMark`,priority:10,excludes:``,inclusive:!1,parseHTML(){return[{tag:`span[data-escape-mark]`}]},renderHTML(){return[`span`,{"data-escape-mark":``},0]}}),eq=bx.create({name:`footnoteDefinition`,group:`block`,content:`block+`,defining:!0,priority:60,addAttributes(){return{identifier:{default:``},label:{default:null}}},parseHTML(){let e=e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-footnote-id`)||``;return{identifier:t,label:t||null}};return[{tag:`aside[data-footnote-def]`,getAttrs:e},{tag:`aside.footnote-def`,getAttrs:e}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.identifier??``);return[`aside`,{...t,"data-footnote-def":``,"data-footnote-id":n,id:`fn-${n}`,class:`footnote-def`},[`div`,{class:`footnote-body`},0],[`a`,{href:`#fnref-${n}`,class:`footnote-backref`,contentEditable:`false`,"aria-label":`Back to reference`},`↩`]]},addCommands(){return{insertFootnoteDefinition:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{identifier:e,label:e},content:[{type:`paragraph`}]})}}}),tq=bx.create({name:`footnoteReference`,group:`inline`,inline:!0,atom:!0,selectable:!0,draggable:!1,priority:60,addAttributes(){return{identifier:{default:``},label:{default:null}}},parseHTML(){return[{tag:`sup[data-footnote-ref]`,getAttrs:e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-footnote-id`)||``;return{identifier:t,label:t||null}}}]},renderHTML({node:e}){let t=String(e.attrs.identifier??``);return[`sup`,{id:`fnref-${t}`,"data-footnote-ref":``,"data-footnote-id":t,class:`footnote-ref`},[`a`,{href:`#fn-${t}`,class:`footnote-ref-link`},`[${t}]`]]},addCommands(){return{insertFootnoteReference:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{identifier:e,label:e}})}}}),nq=Vx.extend({priority:60,addAttributes(){return{...this.parent?.(),hardBreakStyle:{default:`backslash`}}}}),rq=Ux.extend({priority:60,addAttributes(){return{...this.parent?.(),headingStyle:{default:`atx`},sourceTrailingHashes:{default:null},sourceUnderlineLength:{default:null},sourceContiguousNext:{default:!1},sourceLeadingIndent:{default:null,rendered:!1},sourceInteriorSpacing:{default:null,rendered:!1}}}}),iq=bx.create({name:`htmlBlock`,group:`block`,atom:!0,priority:60,addAttributes(){return{content:{default:``}}},parseHTML(){return[{tag:`div[data-html-block]`}]},renderHTML({node:e}){return[`div`,{"data-html-block":``,class:`html-block`},e.attrs.content]}});function aq(e){if(typeof e!=`string`||!e.startsWith(`/`))return e;let t=globalThis.window?.okDesktop?.config?.apiOrigin;return typeof t==`string`&&t?t+e:e}const oq=Gx.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceUrl:{default:null,rendered:!1}}},renderHTML({HTMLAttributes:e}){let t=Dy(this.options.HTMLAttributes,e);return typeof t.src==`string`&&(t.src=aq(t.src)),[`img`,t]}}),sq=bx.create({name:`jsxComponent`,group:`block`,atom:!1,content:`block*`,isolating:!0,selectable:!0,defining:!0,priority:60,addAttributes(){return{componentName:{default:``},kind:{default:`element`},attributes:{default:[]},sourceRaw:{default:``},sourceDirty:{default:!1},props:{default:{}}}},parseHTML(){return[{tag:`div[data-jsx-component]`,getAttrs:e=>typeof e==`string`?!1:{componentName:e.getAttribute(`data-component-name`)||``,sourceRaw:e.getAttribute(`data-source-raw`)||``}}]},renderHTML({HTMLAttributes:e}){return[`div`,{"data-jsx-component":``,"data-component-name":e.componentName,"data-source-raw":e.sourceRaw},0]},addCommands(){return{insertJsxComponent:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{sourceRaw:e}})}}}),cq=bx.create({name:`jsxInline`,group:`inline`,inline:!0,atom:!1,content:`text*`,isolating:!1,selectable:!0,priority:60,addAttributes(){return{}},parseHTML(){return[{tag:`span[data-jsx-inline]`}]},renderHTML(){return[`span`,{"data-jsx-inline":``},0]}}),lq=[`https`,`http`,`mailto`,`tel`,`ftp`,`sms`],uq=lq.map(e=>`${e}:`).join(`|`);RegExp(`^(?:${uq}|\\/|#|\\?|\\.\\/|\\.\\.\\/)`,`i`);function dq(e){let t=e.trim();if(t===``)return!0;let n=t.indexOf(`:`);if(n===-1)return!0;let r=t.indexOf(`/`),i=t.indexOf(`?`),a=t.indexOf(`#`);return n>Math.min(r===-1?1/0:r,i===-1?1/0:i,a===-1?1/0:a)}const fq=new Set(lq.map(e=>`${e}:`));function pq(e){try{let t=new URL(e,`https://placeholder.invalid`);return fq.has(t.protocol.toLowerCase())}catch{return!1}}const mq=rS.extend({priority:60,addOptions(){return{openOnClick:!1,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer`},isAllowedUri:pq,validate:pq,shouldAutoLink:()=>!0}},addAttributes(){return{...this.parent?.(),linkStyle:{default:`inline`,rendered:!1},refLabel:{default:null,rendered:!1},sourceForm:{default:null,rendered:!1},target:{default:null,rendered:!1},anchor:{default:null,rendered:!1},alias:{default:null,rendered:!1},sourceUrlForm:{default:null,rendered:!1},sourceTitleMarker:{default:null,rendered:!1}}}}),hq=bx.create({name:`linkRefDef`,group:`block`,atom:!0,priority:60,addAttributes(){return{label:{default:``},href:{default:``},title:{default:null},sourceLayout:{default:null},sourceTitleMarker:{default:null}}},parseHTML(){return[{tag:`div[data-link-ref-def]`}]},renderHTML({node:e}){let{label:t,href:n,title:r}=e.attrs,i=r?`[${t}]: ${n} "${r}"`:`[${t}]: ${n}`;return[`div`,{"data-link-ref-def":``,class:`link-ref-def`},i]}});function gq(e){return e.type.name===`list`&&!e.attrs.ordered}function _q(e){return e.type.name===`list`&&!!e.attrs.ordered}function vq(e){let t=!1;return e.forEach(e=>{e.type.name===`listItem`&&e.attrs.checked!==null&&(t=!0)}),t}function yq(e,t,n,r,i,a,o){let s=_y(e=>e.type.name===`list`)(e.selection);if(s&&i(s.node)){let{$from:n,$to:i}=e.selection;return n.blockRange(i)?mp(r)(e,t):!1}if(s){if(!t)return!0;let{tr:n}=e;return n.setNodeMarkup(s.pos,void 0,{...s.node.attrs,...a}),o!==void 0&&s.node.forEach((e,t)=>{if(e.type.name===`listItem`){let r=s.pos+1+t;n.setNodeMarkup(r,void 0,{...e.attrs,...o})}}),t(n),!0}return dp(n,a)(e,void 0)?t?dp(n,a)(e,n=>{if(o){let t=n.mapping.map(e.selection.$from.pos),r=n.doc.resolve(t);for(let e=r.depth;e>0;e--){let t=r.node(e);if(t.type.name===`listItem`){n.setNodeMarkup(r.before(e),void 0,{...t.attrs,...o});break}}}t(n)}):!0:!1}const bq=bx.create({name:`list`,group:`block list`,content:`listItem+`,priority:60,addAttributes(){return{ordered:{default:!1},start:{default:1},spread:{default:!1},bulletMarker:{default:null},listMarkerDelimiter:{default:null}}},parseHTML(){return[{tag:`ul`,getAttrs:()=>({ordered:!1})},{tag:`ol`,getAttrs:e=>({ordered:!0,start:e.getAttribute(`start`)?Number(e.getAttribute(`start`)):1})}]},renderHTML({node:e,HTMLAttributes:t}){let n=e.attrs.ordered?`ol`:`ul`,r={};return e.attrs.ordered&&e.attrs.start!==1&&(r.start=e.attrs.start),[n,Dy(t,r),0]},addCommands(){return{toggleBulletList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:yq(e,t,n,r,e=>gq(e)&&!vq(e),{ordered:!1},{checked:null})},toggleOrderedList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:yq(e,t,n,r,e=>_q(e),{ordered:!0},{checked:null})},toggleTaskList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:yq(e,t,n,r,e=>gq(e)&&vq(e),{ordered:!1},{checked:!1})}}},addInputRules(){return[ox({find:/^\s*([-+*])(?!\s*\[[ xX]\])\s$/,type:this.type,getAttributes:e=>({ordered:!1,bulletMarker:e[1]})}),ox({find:/^\s*(\d+)([.)])\s$/,type:this.type,getAttributes:e=>({ordered:!0,start:Number(e[1]),listMarkerDelimiter:e[2]})}),new Ob({find:/^\s*[-*+]\s\[([ xX])\]\s$/,handler:({state:e,range:t,match:n})=>{let r=e.schema.nodes.list;if(!r)return null;let i=n[1]!==` `,a=e.tr.delete(t.from,t.to),o=a.doc.resolve(t.from).blockRange();if(!o)return null;let s=Ed(o,r,{ordered:!1});if(!s)return null;a.wrap(o,s);let c=a.doc.resolve(a.mapping.map(t.from));for(let e=c.depth;e>0;e--){let t=c.node(e);if(t.type.name===`listItem`){a.setNodeMarkup(c.before(e),void 0,{...t.attrs,checked:i});break}}}})]},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList(),"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList(),"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),xq=bx.create({name:`listItem`,content:`paragraph block*`,defining:!0,addAttributes(){return{checked:{default:null},spread:{default:!1},sourceMarkerSpacing:{default:null,rendered:!1},sourceOrdinal:{default:null,rendered:!1},sourceCheckboxChar:{default:null,rendered:!1},sourceContinuationIndent:{default:null,rendered:!1}}},parseHTML(){return[{tag:`li`,getAttrs:e=>{let t=e.querySelector(`input[type="checkbox"]`);return{checked:t?t.checked:null}}}]},renderHTML({node:e,HTMLAttributes:t}){return e.attrs.checked===null?[`li`,Dy(t),0]:[`li`,Dy(t,{"data-type":`taskItem`,"data-checked":e.attrs.checked?`true`:`false`}),[`label`,{contenteditable:`false`},[`input`,{type:`checkbox`,...e.attrs.checked?{checked:`checked`}:{}}]],[`div`,0]]},addNodeView(){return({node:e,getPos:t,editor:n,HTMLAttributes:r})=>{let i=document.createElement(`li`);Object.entries(Dy(r,e.attrs.checked===null?{}:{"data-type":`taskItem`,"data-checked":String(!!e.attrs.checked)})).forEach(([e,t])=>{t!=null&&i.setAttribute(e,String(t))});let a=null,o=null,s=document.createElement(`div`);return e.attrs.checked!==null&&(a=document.createElement(`label`),a.contentEditable=`false`,o=document.createElement(`input`),o.type=`checkbox`,o.checked=!!e.attrs.checked,n.isEditable||(o.disabled=!0),o.addEventListener(`change`,()=>{let r=t();r===void 0||typeof r!=`number`||n.view.dispatch(n.view.state.tr.setNodeMarkup(r,void 0,{...e.attrs,checked:o?.checked??!1}))}),a.appendChild(o),i.appendChild(a)),i.appendChild(s),{dom:i,contentDOM:s,update(t){return t.type!==e.type||t.attrs.checked!==null!=(e.attrs.checked!==null)?!1:(o&&t.attrs.checked!==null&&(o.checked=!!t.attrs.checked,i.setAttribute(`data-checked`,String(!!t.attrs.checked))),e=t,!0)}}}},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>{let{$from:e}=this.editor.state.selection;for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return this.editor.commands.sinkListItem(this.name);return!1},"Shift-Tab":()=>{let{$from:e}=this.editor.state.selection;for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return this.editor.commands.liftListItem(this.name);return!1}}}}),Sq=bq,Cq=xq,wq=bx.create({name:`mathInline`,group:`inline`,inline:!0,atom:!0,selectable:!0,priority:60,addAttributes(){return{formula:{default:``},id:{default:null},language:{default:`latex`},sourceDelimiter:{default:null,rendered:!1}}},parseHTML(){return[{tag:`span[data-math-inline]`,getAttrs:e=>typeof e==`string`?!1:{formula:e.getAttribute(`data-formula`)||``,id:e.getAttribute(`id`)||null,language:e.getAttribute(`data-language`)||`latex`}}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-math-inline":``,"data-formula":e.formula,"data-language":e.language,...e.id?{id:e.id}:{}}]},addCommands(){return{insertMathInline:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{formula:e}})}}}),Tq=bx.create({name:`rawMdxFallback`,group:`block`,atom:!1,content:`text*`,isolating:!0,selectable:!0,defining:!0,priority:60,addAttributes(){return{reason:{default:``},originalSpan:{default:{start:0,end:0}}}},parseHTML(){let e=e=>typeof e==`string`?!1:{reason:e.getAttribute(`data-reason`)||``};return[{tag:`div[data-raw-mdx-fallback]`,getAttrs:e},{tag:`pre[data-raw-mdx-fallback]`,getAttrs:e}]},renderHTML({HTMLAttributes:e}){return[`div`,{"data-raw-mdx-fallback":``,"data-raw-badge":`raw`,"data-reason":e.reason,contenteditable:`false`,class:`raw-mdx-fallback`},0]},addNodeView(){return({HTMLAttributes:e})=>{let t=document.createElement(`div`);t.setAttribute(`data-raw-mdx-fallback`,``),t.setAttribute(`data-raw-badge`,`raw`),t.setAttribute(`contenteditable`,`false`),t.classList.add(`raw-mdx-fallback`),e.reason&&t.setAttribute(`data-reason`,e.reason);let n=document.createElement(`pre`);return n.classList.add(`raw-mdx-fallback-content`),n.setAttribute(`contenteditable`,`false`),t.appendChild(n),{dom:t,contentDOM:n,ignoreMutation:()=>!0}}}}),Eq=mw.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceMarkerSpacings:{default:null}}}}),Dq=vw.extend({excludes:``,addAttributes(){return{...this.parent?.(),sourceFenceChar:{default:"`"},sourceFenceLength:{default:1},sourcePadded:{default:!1,rendered:!1}}}}),Oq=bx.create({name:`commentBlock`,group:`block`,content:`block+`,defining:!0,priority:60,addAttributes(){return{sourceForm:{default:`percent`,parseHTML:e=>e.getAttribute(`data-source-form`)===`html`?`html`:`percent`,renderHTML:e=>e.sourceForm===`html`?{"data-source-form":`html`}:{}},sourceLayout:{default:`block`,parseHTML:e=>e.getAttribute(`data-source-layout`)===`inline`?`inline`:`block`,renderHTML:e=>e.sourceLayout===`inline`?{"data-source-layout":`inline`}:{}}}},parseHTML(){return[{tag:`aside[data-comment-block]`},{tag:`aside.comment-block`}]},renderHTML({HTMLAttributes:e}){return[`aside`,{"data-comment-block":``,"data-clipboard-omit":`true`,class:`comment-block`,style:`display: none;`,...e},0]},addCommands(){return{setCommentBlock:()=>({commands:e})=>e.wrapIn(this.name),toggleCommentBlock:()=>({commands:e})=>e.toggleWrap(this.name),unsetCommentBlock:()=>({commands:e})=>e.lift(this.name)}}}),kq=Ib.create({name:`comment`,priority:10,excludes:``,inclusive:!1,addAttributes(){return{sourceForm:{default:`percent`,parseHTML:e=>e.getAttribute(`data-source-form`)===`html`?`html`:`percent`,renderHTML:e=>e.sourceForm===`html`?{"data-source-form":`html`}:{}}}},parseHTML(){return[{tag:`span[data-comment-mark]`}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-comment-mark":``,"data-clipboard-omit":`true`,class:`comment-mark`,style:`display: none;`,...e},0]},addCommands(){return{setComment:()=>({commands:e})=>e.setMark(this.name),toggleComment:()=>({commands:e})=>e.toggleMark(this.name),unsetComment:()=>({commands:e})=>e.unsetMark(this.name)}}}),Aq=Gb.create({name:`docFidelity`,addGlobalAttributes(){return[{types:[`doc`],attributes:{sourceDocBoundary:{default:null,rendered:!1}}}]}}),jq=bx.create({name:`imageReference`,group:`inline`,inline:!0,atom:!0,priority:60,addAttributes(){return{alt:{default:``},label:{default:``},identifier:{default:``},referenceType:{default:`shortcut`}}},parseHTML(){return[{tag:`img[data-image-reference]`}]},renderHTML({node:e}){let{alt:t,label:n,referenceType:r}=e.attrs,i=t||n;return[`img`,{"data-image-reference":``,"data-reference-type":r,"data-label":n,alt:i}]}}),Mq=new Map([[32,` `],[9,` `]]);function Nq(e){let t=/^&#(x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);$/.exec(e);if(!t)return null;let n=t[1],r=n[0]===`x`||n[0]===`X`,i=Number.parseInt(r?n.slice(1):n,r?16:10);return Number.isNaN(i)?null:i}function Pq(e){let t=Nq(e);return t!==null&&Mq.has(t)}function Fq(e){let t=Nq(e);return t===null?null:Mq.get(t)??null}const Iq=/&#(?:x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);/g;function Lq(e){Iq.lastIndex=0;let t=e.match(Iq);if(t===null||t.join(``)!==e)return null;let n=``;for(let e of t){let t=Fq(e);if(t===null)return null;n+=t}return n}const Rq=Ib.create({name:`sourceLiteral`,priority:10,excludes:``,inclusive:!1,addAttributes(){return{sourceRaw:{default:``}}},parseHTML(){return[{tag:`span[data-source-literal]`}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-source-literal":``,...e},0]}});function zq(e,t){if(typeof e!=`string`||typeof t!=`string`||/[\x00-\x1F\x7F]/.test(e))return!1;let n=e.replaceAll(`\xA0`,` `),r=t.replaceAll(`\xA0`,` `);return n===r||Bq(n)===r?!0:Lq(n)===r}function Bq(e){return e.replace(/\\([!-/:-@[-`{-~])/g,`$1`)}const Vq=iT.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`~~`,rendered:!1}}}}),Hq=dw.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDashCounts:{default:null},sourceOuterPipes:{default:null,rendered:!1},sourceAlignmentPadding:{default:null,rendered:!1}}}}),Uq=XC.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),Wq=ZC.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),Gq=bx.create({name:`tag`,group:`inline`,inline:!0,atom:!0,selectable:!0,priority:60,addAttributes(){return{value:{default:``}}},parseHTML(){return[{tag:`a[data-tag]`,getAttrs:e=>typeof e==`string`?!1:{value:e.getAttribute(`data-tag`)||``}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.value??``);return[`a`,{...t,"data-tag":n,href:`#tag/${n}`,class:`tag`},`#${n}`]},addCommands(){return{insertTag:e=>({chain:t})=>t().insertContent({type:`tag`,attrs:{value:e}}).run()}}}),Kq=/^(?:---|—-|___\s|\*\*\*\s)$/;function qq(e){let t=String(e[0]??``).replace(/\s+$/,``);return t===`—-`?`---`:t}const Jq=xw.extend({name:`thematicBreak`,priority:60,addAttributes(){return{...this.parent?.(),sourceRaw:{default:`---`}}},addInputRules(){return[ix({find:Kq,type:this.type,getAttributes:e=>({sourceRaw:qq(e)})})]}});function Yq(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function Xq(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}const Zq=bx.create({name:`wikiLink`,group:`inline`,inline:!0,atom:!0,priority:60,addAttributes(){return{target:{default:``},alias:{default:null},anchor:{default:null},resolved:{default:!1},sourceTarget:{default:null,rendered:!1},sourceAnchor:{default:null,rendered:!1},sourceAlias:{default:null,rendered:!1}}},parseHTML(){return[{tag:`span[data-wiki-link]`,getAttrs:e=>typeof e==`string`?!1:{target:e.getAttribute(`data-target`)||``,alias:Yq(e.getAttribute(`data-alias`)),anchor:Yq(e.getAttribute(`data-anchor`)),resolved:e.getAttribute(`data-resolved`)===`true`}},{tag:`a.wiki-link[data-target]`,priority:100,getAttrs:e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-target`)??``;return t?{target:t,alias:Yq(e.getAttribute(`data-alias`)),anchor:Yq(e.getAttribute(`data-anchor`)),resolved:!1}:!1}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.target??``),r=Yq(e.attrs.alias),i=Yq(e.attrs.anchor),a=e.attrs.resolved===!0;return[`span`,{...t,"data-wiki-link":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,"data-resolved":a?`true`:`false`},Xq({target:n,alias:r,anchor:i})]}});function Qq(e){let t=e.split(`/`).pop()??e,n=t.lastIndexOf(`.`);return n<=0||n===t.length-1?``:t.slice(n+1).toLowerCase()}function $q(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}const eJ=[sq,Tq,cq,wq,Zq,bx.create({name:`wikiLinkEmbed`,group:`inline`,inline:!0,atom:!0,priority:60,addAttributes(){return{target:{default:``},alias:{default:null},anchor:{default:null},resolvedSrc:{default:null,rendered:!1,parseHTML:()=>null}}},parseHTML(){let e=e=>typeof e==`string`||!e.hasAttribute(`data-wiki-embed`)?!1:{target:e.getAttribute(`data-target`)||``,alias:Yq(e.getAttribute(`data-alias`)),anchor:Yq(e.getAttribute(`data-anchor`))};return[{tag:`img[data-wiki-embed]`,getAttrs:e,priority:100},{tag:`a[data-wiki-embed]`,getAttrs:e,priority:100}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.target??``),r=Yq(e.attrs.alias),i=Yq(e.attrs.anchor),a=Yq(e.attrs.resolvedSrc),o=Qq(n);if(wK.has(o))return[`img`,{...t,"data-wiki-embed":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,src:a??n,alt:r??n}];let s=a??n;return[`a`,{...t,"data-wiki-embed":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,href:i?`${s}#${i}`:s,target:`_blank`,rel:`noopener noreferrer`},$q({target:n,alias:r,anchor:i})]}}),Gq,Sq,Cq,ZK,QK,Vq,Dq,XK,Eq,rq,Jq,mq,iq,hq,nq,$K,Aq,Rq,XT.configure({undoRedo:!1,bulletList:!1,orderedList:!1,listItem:!1,italic:!1,bold:!1,strike:!1,code:!1,codeBlock:!1,heading:!1,horizontalRule:!1,hardBreak:!1,link:!1,blockquote:!1,dropcursor:{color:`color-mix(in oklch, var(--primary) 50%, transparent)`,width:2}}),Hq.configure({resizable:!0}),QC,Wq,Uq,oq.configure({inline:!0}),jq,oS,kq,Oq,tq,eq],tJ=/^[a-zA-Z0-9][\w/-]*$/;function nJ(e){return e.startsWith(`#`)?e.slice(1):e}function rJ(e){return typeof e==`string`?[e]:Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function iJ(e){if(!e||e.trim()===``)return[];let{map:t}=qW(e);if(!t)return[];let n=rJ(t.tags),r=[];for(let e of n){let t=nJ(e);tJ.test(t)&&r.push(t)}return r}3072-aJ("This is an Open Knowledge project: load the `open-knowledge` skill and use the Open Knowledge MCP tools for all markdown — don't probe for `.ok/` or use native file tools on `.md` / `.mdx`. ",`cursor`);function aJ(e,t){let n=encodeURIComponent(e);return t===`cursor`?encodeURIComponent(n).length:n.length}function oJ(e){return`'${e.replace(/'/g,`'\\''`)}'`}`${oJ(JSON.stringify({enabledMcpjsonServers:[hK]}))}`;function sJ(e){if(e.length===0)return{ok:!1,reason:`docName must not be empty`};if(e.trim().length===0)return{ok:!1,reason:`docName must not be blank (whitespace only)`};if(e!==e.trim())return{ok:!1,reason:`docName must not have leading or trailing whitespace`};for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n<32||n===127)return{ok:!1,reason:`docName must not contain control characters`}}if(e.includes(`..`)||e.startsWith(`/`)||e.includes(`\\`))return{ok:!1,reason:`docName must not contain "..", a leading "/", or a backslash`};for(let t of e.split(`/`)){if(t.length===0)return{ok:!1,reason:`docName must not contain empty path segments (no leading, trailing, or doubled "/")`};if(t.startsWith(`.`))return{ok:!1,reason:`docName path segments must not start with "." (hidden files are not addressable)`}}return{ok:!0}}function cJ(e){return e.split(`/`).some(e=>e.startsWith(`.`))}function lJ(e,t){let n=sJ(e);n.ok||t.addIssue({code:`custom`,message:n.reason})}const uJ=k().superRefine(lJ).optional(),dJ={agentId:k().optional(),agentName:k().optional(),colorSeed:k().optional(),clientName:k().optional(),clientVersion:k().optional(),label:k().optional()},fJ=k().optional(),pJ=/^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,mJ=$s(`kind`,[N({kind:F(`doc`),docPath:k().min(1)}).loose(),N({kind:F(`folder`),folderPath:k()}).loose()]),hJ=P([`no-remote`,`detached-head`,`branch-not-on-origin`,`non-github-remote`,`invalid-path`]),gJ=$s(`ok`,[N({ok:F(!0),shareUrl:k().min(1),sharedUrl:k().min(1),branch:k().min(1)}).loose(),N({ok:F(!1),error:hJ,branch:k().min(1).optional()}).loose()]),_J=P([`user`,`org`]),vJ=N({login:k().min(1),kind:_J,avatarUrl:k().optional()}).loose(),yJ=P([`auth-required`,`network`]),bJ=$s(`ok`,[N({ok:F(!0),owners:M(vJ)}).loose(),N({ok:F(!1),error:yJ}).loose()]),xJ=$s(`ok`,[N({ok:F(!0),available:j()}).loose(),N({ok:F(!1),error:yJ}).loose()]),SJ=P([`public`,`private`]),CJ=N({owner:k().min(1),name:k().min(1),visibility:SJ,description:k().optional()}).loose(),wJ=P([`name-conflict`,`saml-sso`,`auth-required`,`push-failed`,`init-failed`,`network`,`no-project`]),TJ=$s(`ok`,[N({ok:F(!0),ownerLogin:k().min(1),repoName:k().min(1),cloneUrl:k().min(1),defaultBranch:k().min(1)}).loose(),N({ok:F(!1),error:wJ}).loose()]);function EJ(e){return!(typeof e!=`string`||e.length===0||e.startsWith(`-`)||/[\x00-\x1F\x7F]/.test(e)||/\s/.test(e)||e.includes(`:`)||e.split(`/`).includes(`..`))}const DJ=e=>e.refine(EJ,`invalid branch name`);function OJ(e){if(e==null)return!1;let t=e instanceof Error?e.message:String(e);return/couldn'?t find remote ref|Remote branch .+ not found/i.test(t)}const kJ=[/could not read (username|password)/i,/terminal prompts disabled/i],AJ=[/insufficient scopes/i,/missing.*scope/i,/required scope/i],jJ=[/permission denied.*\(publickey\)/i,/host key verification failed/i],MJ=[/\b(401|403)\b/,/authentication failed/i,/authorization failed/i,/invalid credentials/i,/credential helper/i,/bad credentials/i,/token.*expired/i,/expired.*token/i,/fatal:.*repository.*not found/i];function NJ(e){if(typeof e!=`object`||!e)return``;let t=e.git;return t==null?``:String(t)}function PJ(e){if(e==null)return{kind:`non-auth`};let t=`${e instanceof Error?e.message:String(e)}\n${NJ(e)}`;return kJ.some(e=>e.test(t))?{kind:`auth`,subclass:`no-credential`}:AJ.some(e=>e.test(t))?{kind:`auth`,subclass:`scope-mismatch`}:jJ.some(e=>e.test(t))?{kind:`auth`,subclass:`ssh-auth`}:MJ.some(e=>e.test(t))?/\b401\b/.test(t)||/token.*expired/i.test(t)?{kind:`auth`,subclass:`401`}:/\b403\b/.test(t)?{kind:`auth`,subclass:`403`}:{kind:`auth`,subclass:`unknown-auth`}:{kind:`non-auth`}}function FJ(e){return e.kind===`auth`?e.subclass===`no-credential`||e.subclass===`401`||e.subclass===`unknown-auth`:!1}const IJ={shareTargetExists:j(),dirtyConflicts:N({conflicts:j(),files:M(k().min(1))}).loose(),branchIsLocal:j()},LJ=$s(`detached`,[N({detached:F(!1),currentBranch:k().min(1).nullable(),currentHeadSha:Bs(),...IJ}).loose(),N({detached:F(!0),currentBranch:Bs(),currentHeadSha:k().min(1),...IJ}).loose()]),RJ=N({branch:DJ(k().min(1)),principalId:k().optional()}).loose(),zJ=P([`dirty-conflict`,`branch-not-found`,`fetch-failed`,`checkout-failed`,`branch-in-other-worktree`]),BJ=$s(`ok`,[N({ok:F(!0)}).loose(),N({ok:F(!1),reason:zJ,files:M(k().min(1)).optional(),otherWorktreePath:k().min(1).optional()}).loose()]),VJ=N({serverInstanceId:k().min(1),currentBranch:k().min(1).optional(),currentDiskAckSVs:rc(k().min(1),k().min(1)).optional()}).loose(),HJ=N({id:k().min(1),display_name:k().min(1),display_email:k(),source:P([`git-config`,`synthesized`]),created_at:k().min(1)}).loose(),UJ=N({collabUrl:k().nullable(),previewUrl:k().nullable(),port:A(),paneTarget:k().nullable(),singleFile:j().default(!1)}).loose(),WJ=P(`urn:ok:error:malformed-upload.urn:ok:error:collision-exhaustion.urn:ok:error:storage-full.urn:ok:error:storage-readonly.urn:ok:error:storage-error.urn:ok:error:no-file-received.urn:ok:error:path-escape.urn:ok:error:method-not-allowed.urn:ok:error:invalid-request.urn:ok:error:payload-too-large.urn:ok:error:request-timeout.urn:ok:error:internal-server-error.urn:ok:error:loopback-required.urn:ok:error:invalid-origin.urn:ok:error:url-not-allowed.urn:ok:error:dir-outside-home.urn:ok:error:concurrent-operation.urn:ok:error:clone-failed.urn:ok:error:clone-timeout.urn:ok:error:server-start-failed.urn:ok:error:reserved-doc-name.urn:ok:error:target-not-found.urn:ok:error:stale-target.urn:ok:error:frontmatter-edit-not-supported.urn:ok:error:invalid-frontmatter-patch.urn:ok:error:frontmatter-malformed.urn:ok:error:no-active-session.urn:ok:error:too-many-agent-sessions.urn:ok:error:disk-divergence.urn:ok:error:doc-not-found.urn:ok:error:doc-already-exists.urn:ok:error:doc-not-open.urn:ok:error:rollback-not-configured.urn:ok:error:doc-not-available.urn:ok:error:backlink-index-not-configured.urn:ok:error:file-rescan-not-configured.urn:ok:error:shadow-not-configured.urn:ok:error:host-not-allowed.urn:ok:error:principal-not-available.urn:ok:error:not-found.urn:ok:error:auth-failed.urn:ok:error:no-project-dir.urn:ok:error:server-open-failed.urn:ok:error:doc-in-conflict.urn:ok:error:no-conflict-tracked.urn:ok:error:sync-not-active.urn:ok:error:project-repo-not-configured.urn:ok:error:seed-prerequisite-missing.urn:ok:error:seed-invalid-root.urn:ok:error:tag-index-not-configured.urn:ok:error:template-not-found.urn:ok:error:unsupported-asset-type.urn:ok:error:asset-not-found.urn:ok:error:single-file-mode.urn:ok:error:collab-server-not-running.urn:ok:error:gateway-timeout.urn:ok:error:cursor-not-installed.urn:ok:error:cursor-spawn-timeout.urn:ok:error:cursor-spawn-failed.urn:ok:error:handoff-target-not-installed.urn:ok:error:handoff-spawn-timeout.urn:ok:error:handoff-spawn-failed`.split(`.`));function GJ(e){throw Error(`Unexpected ProblemType variant: ${JSON.stringify(e)}`)}const KJ=N({type:WJ,title:k().min(1),status:A().int().min(400).max(599),instance:k().regex(pJ,`instance must be urn:uuid:<uuid>`).optional(),detail:k().optional()}).loose(),qJ=N({parentDocName:k().min(1),agentId:k().min(1).optional(),agentName:k().min(1).optional()}).loose(),JJ=N({src:k().min(1),path:k().min(1).optional(),deduped:j().optional()}).loose(),YJ=N({url:k().min(1),dir:k().min(1),branch:k().min(1).refine(EJ,`invalid branch name`).optional()}).loose(),XJ=N({type:F(`error`),problem:KJ}).loose();function ZJ(e,t){let n=Array.isArray(e.attrs.attributes)?e.attrs.attributes.filter(e=>typeof e==`object`&&!!e&&`type`in e):[],r=e.attrs.props??{},i=new Map,a=new Set;if(t)for(let e of t)e.omitOnDefault===!0&&`defaultValue`in e&&e.defaultValue!==void 0&&i.set(e.name,e.defaultValue),e.type===`string`&&e.required===!1&&e.defaultValue===void 0&&a.add(e.name);for(let[e,t]of Object.entries(r)){let r=n.findIndex(t=>t.type===`mdxJsxAttribute`&&t.name===e);if(i.has(e)&&Object.is(i.get(e),t)){r>=0&&n.splice(r,1);continue}if(a.has(e)&&t===``){r>=0&&n.splice(r,1);continue}if(r>=0){let e=n[r];if(e.type===`mdxJsxAttribute`&&e.value!=null&&typeof e.value==`object`&&e.value.type===`mdxJsxAttributeValueExpression`&&QJ(e.value.value,t))continue}let o=$J(e,t);r>=0?n[r]=o:n.push(o)}return n}function QJ(e,t){try{return JSON.stringify(JSON.parse(e))===JSON.stringify(t)}catch{return!1}}function $J(e,t){if(t===!0)return{type:`mdxJsxAttribute`,name:e,value:null};if(t===!1)return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:`false`}};if(t==null)return{type:`mdxJsxAttribute`,name:e,value:null};if(typeof t==`string`)return{type:`mdxJsxAttribute`,name:e,value:t};if(typeof t==`number`)return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:JSON.stringify(t)}};if(typeof t==`object`){let n;try{n=JSON.stringify(t)}catch{n=String(t)}return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:n}}}return{type:`mdxJsxAttribute`,name:e,value:String(t)}}function eY(e,t,n,r){return{type:`mdxJsxFlowElement`,name:e,attributes:ZJ(t,r),children:n.all(t),data:{}}}const tY=/^[A-Za-z0-9]{20,}$/,nY=/^(?:\d+s?|(?:\d+h)?(?:\d+m)?(?:\d+s)?)$/;function rY(e){let t=e.toLowerCase();return t===`loom.com`||t===`www.loom.com`}function iY(e){let t=e.pathname.match(/^\/(?:share|embed)\/([A-Za-z0-9]+)\/?$/);if(!t)return null;let n=t[1]??``;return tY.test(n)?n:null}function aY(e){if(typeof e!=`string`||e.length===0)return null;let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`http:`&&t.protocol!==`https:`||!rY(t.hostname))return null;let n=iY(t);if(!n)return null;let r=t.searchParams.get(`t`);return{id:n,startRaw:r&&r.length>0&&nY.test(r)?r:null}}function oY(e){return aY(e)!==null}function sY(e){let t=e.toLowerCase();return t===`vimeo.com`||t===`www.vimeo.com`||t===`player.vimeo.com`}function cY(e){if(typeof e!=`string`||e.length===0)return!1;let t;try{t=new URL(e)}catch{return!1}return t.protocol!==`http:`&&t.protocol!==`https:`?!1:sY(t.hostname)}const lY=/^[A-Za-z0-9_-]{11}$/;function uY(e){let t=e.toLowerCase();return t===`youtube.com`||t===`www.youtube.com`||t===`m.youtube.com`||t===`music.youtube.com`||t===`youtu.be`||t===`youtube-nocookie.com`||t===`www.youtube-nocookie.com`}function dY(e){if(e.length===0)return null;if(/^[0-9]+$/.test(e)){let t=Number.parseInt(e,10);return t>0?t:null}let t=e.match(/^(?:([0-9]+)h)?(?:([0-9]+)m)?(?:([0-9]+)s?)?$/);if(!t)return null;let n=t[1]?Number.parseInt(t[1],10):0,r=t[2]?Number.parseInt(t[2],10):0,i=t[3]?Number.parseInt(t[3],10):0,a=n*3600+r*60+i;return a>0?a:null}function fY(e){if(e.hostname.toLowerCase()===`youtu.be`){let t=e.pathname.replace(/^\//,``).split(`/`)[0]??``;return lY.test(t)?t:null}if(e.pathname===`/watch`){let t=e.searchParams.get(`v`)??``;return lY.test(t)?t:null}let t=e.pathname.match(/^\/(?:embed|shorts|v)\/([A-Za-z0-9_-]{11})\/?$/);return t?t[1]??null:null}function pY(e){if(typeof e!=`string`||e.length===0)return null;let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`http:`&&t.protocol!==`https:`||!uY(t.hostname))return null;let n=fY(t);if(!n)return null;let r=t.searchParams.get(`t`)??t.searchParams.get(`start`)??``;return{id:n,startSeconds:r.length>0?dY(r):null,noCookie:t.hostname.toLowerCase().endsWith(`youtube-nocookie.com`)}}const mY=[{name:`type`,type:`enum`,enumValues:[`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`],defaultValue:`note`,required:!1,description:`Callout variant`},{name:`title`,type:`string`,required:!1,description:`Optional heading shown above the body`},{name:`icon`,type:`string`,required:!1,advanced:!0,description:"Custom lucide icon override (e.g. `lucide:Lightbulb`)",iconPicker:!0},{name:`color`,type:`string`,required:!1,advanced:!0,description:"Optional accent color override (hex — e.g. `#F05032`)",colorPicker:!0},{name:`collapsible`,type:`boolean`,required:!1,defaultValue:!1,advanced:!0,description:"Render as a foldable `<details>` (Obsidian `[!TYPE]+/-`)"},{name:`defaultOpen`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,description:`When collapsible, start in the open state`,hideWhen:e=>e.collapsible!==!0},{name:`children`,type:`reactnode`,required:!0,description:`Callout content`}],hY=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Image source URL`,accept:bK,autoFocus:!0},{name:`alt`,type:`string`,required:!0,description:`Alt text`},{name:`width`,type:`number`,required:!1,advanced:!0,description:`Image width`},{name:`height`,type:`number`,required:!1,advanced:!0,description:`Image height`},{name:`srcset`,type:`string`,required:!1,advanced:!0,description:`Responsive image candidate set (e.g. "x.png 1x, y.png 2x")`},{name:`sizes`,type:`string`,required:!1,advanced:!0,description:`Responsive image sizes hint paired with srcset`},{name:`loading`,type:`enum`,enumValues:[`eager`,`lazy`],defaultValue:`lazy`,required:!1,advanced:!0,omitOnDefault:!0,description:`Native img loading strategy (defaults to lazy)`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`decoding`,type:`enum`,enumValues:[`sync`,`async`,`auto`],defaultValue:`auto`,required:!1,advanced:!0,omitOnDefault:!0,description:`Hint for how the browser should decode the image`},{name:`fetchpriority`,type:`enum`,enumValues:[`high`,`low`,`auto`],defaultValue:`auto`,required:!1,advanced:!0,omitOnDefault:!0,description:`Resource fetch priority hint`},{name:`crossorigin`,type:`enum`,enumValues:[`anonymous`,`use-credentials`],required:!1,advanced:!0,description:`CORS mode for the image fetch`},{name:`referrerpolicy`,type:`string`,required:!1,advanced:!0,description:`Referrer policy for the image fetch (HTML referrerpolicy values)`},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],gY=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Embedded page URL (must start with http:// or https://)`,autoFocus:!0},{name:`title`,type:`string`,required:!1,description:`Iframe title (accessible label for screen readers)`},{name:`width`,type:`string`,required:!1,advanced:!0,description:`Embed width as a CSS length (e.g. "100%", "640px")`,cssLengthInput:!0},{name:`height`,type:`string`,required:!1,advanced:!0,description:`Embed height as a CSS length (e.g. "26rem", "480px")`,cssLengthInput:!0},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],_Y=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Video source URL`,accept:xK,autoFocus:!0},{name:`controls`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,omitOnDefault:!0,description:`Show native HTML5 video controls (defaults to true)`,hideWhen:e=>typeof e.src==`string`&&(cY(e.src)||oY(e.src))},{name:`autoplay`,type:`boolean`,required:!1,advanced:!0,description:`Begin playback as soon as possible (usually requires muted)`},{name:`poster`,type:`string`,required:!1,advanced:!0,description:`Poster image URL shown before playback`,accept:bK,hideWhen:e=>typeof e.src==`string`&&(cY(e.src)||oY(e.src))},{name:`width`,type:`number`,required:!1,advanced:!0,description:`Video width`},{name:`height`,type:`number`,required:!1,advanced:!0,description:`Video height`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`muted`,type:`boolean`,required:!1,advanced:!0,description:`Mute audio on load`},{name:`loop`,type:`boolean`,required:!1,advanced:!0,description:`Restart from the beginning when playback ends`,hideWhen:e=>typeof e.src==`string`&&oY(e.src)},{name:`playsinline`,type:`boolean`,required:!1,advanced:!0,description:`Play inline on iOS rather than entering fullscreen`,hideWhen:e=>typeof e.src==`string`&&(cY(e.src)||oY(e.src))},{name:`preload`,type:`enum`,enumValues:[`none`,`metadata`,`auto`],required:!1,advanced:!0,description:`Hint for how much of the video to preload`,hideWhen:e=>typeof e.src==`string`&&(pY(e.src)!==null||cY(e.src)||oY(e.src))},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],vY=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Audio source URL`,accept:SK,autoFocus:!0},{name:`controls`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,omitOnDefault:!0,description:`Show native HTML5 audio controls (defaults to true)`},{name:`autoplay`,type:`boolean`,required:!1,advanced:!0,description:`Begin playback as soon as possible (usually requires muted)`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`muted`,type:`boolean`,required:!1,advanced:!0,description:`Mute audio on load`},{name:`loop`,type:`boolean`,required:!1,advanced:!0,description:`Restart from the beginning when playback ends`},{name:`preload`,type:`enum`,enumValues:[`none`,`metadata`,`auto`],required:!1,advanced:!0,description:`Hint for how much of the audio to preload`}],yY=[{name:`title`,type:`string`,required:!0,description:`Accordion heading shown inside the <summary>`},{name:`defaultOpen`,type:`boolean`,required:!1,defaultValue:!1,description:`When true, the accordion renders expanded on initial load`},{name:`icon`,type:`string`,required:!1,advanced:!0,description:"Custom lucide icon override (e.g. `lucide:Rocket`)",iconPicker:!0},{name:`description`,type:`string`,required:!1,advanced:!0,description:`Optional subtitle rendered below the title inside <summary>`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#advanced-options`)"},{name:`name`,type:`string`,required:!1,advanced:!0,description:`HTML5 <details name=> group — siblings with the same name are mutually exclusive`}],bY=[mY[0],mY[1],mY[4],mY[5],mY[6]],xY=[hY[0],hY[1],hY[7]],SY=[yY[0],yY[1],yY[4],yY[5]],CY=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Alt text (Obsidian alias syntax: `![[file.png|alt text]]`)"}],wY=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[clip.mp4|title]]`)"}],TY=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[song.mp3|title]]`)"}],EY=[{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#install-tabs`)"}],DY=[{name:`label`,type:`string`,required:!0,autoFocus:!0,defaultValue:`Tab`,description:`Tab strip label — shown in the clickable pill at the top`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#tab-npm`)"}],OY=[{name:`formula`,type:`string`,required:!0,autoFocus:!0,language:`latex`,description:`LaTeX math source (rendered with KaTeX in the browser)`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#eq-pythagoras`)"},{name:`language`,type:`string`,required:!1,advanced:!0,description:"Forward-compat hint for the math source language (default `latex`). Reserved for future MathJax / Typst / AsciiMath substrates."}],kY=[OY[0]],AY=[OY[0]],jY=[{name:`chart`,type:`string`,required:!0,hidden:!0,description:`Mermaid chart source (graph / flowchart / sequenceDiagram / class / state / etc.)`}],MY=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Display name override (Obsidian alias syntax: `![[file.zip|label]]`)"}],NY=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`File URL`,accept:[`*/*`],autoFocus:!0}],PY=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`PDF source URL`,accept:CK,autoFocus:!0},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Accessible label for the embedded PDF viewer`},{name:`anchor`,type:`string`,required:!1,advanced:!0,description:"PDF viewer parameters as a single URL-fragment string (e.g. `page=3&height=600`)"}],FY=[{name:`src`,type:`string`,required:!0,description:"Path of the source doc, extension-less (e.g. `api-spec`).",autoFocus:!0},{name:`anchor`,type:`string`,required:!0,description:"Id of the `<MirrorSource>` block within the source doc."}],IY=[{name:`id`,type:`string`,required:!0,description:"Stable id agents and authors use to reference this block from `<Mirror>` elsewhere.",autoFocus:!0},{name:`children`,type:`reactnode`,required:!0,description:`Block content this MirrorSource owns — paragraphs, callouts, code, nested JSX, anything.`}];function LY(e){return e.replace(/&/g,`&`).replace(/"/g,`"`).replace(/</g,`<`).replace(/>/g,`>`)}function RY(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`)}function zY(e){let t=e.attrs.props,n=t?.target??``,r=typeof t?.alias==`string`&&t.alias.length>0?t.alias:null,i=typeof t?.anchor==`string`&&t.anchor.length>0?t.anchor:null,a=r??(i?`${n}#${i}`:n);return{type:`wikiLinkEmbed`,value:a,data:{target:n,anchor:i,alias:r},children:[{type:`text`,value:a}]}}const BY=[{name:`Callout`,surface:`canonical`,hasChildren:!0,props:mY,icon:`MessageSquareWarning`,category:`content`,displayName:`Callout`,description:`Alert / admonition with 15 type variants — 5 GFM (note, tip, important, warning, caution) plus 10 Obsidian-parity (abstract, info, todo, success, question, failure, danger, bug, example, quote)`,searchTerms:[`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`,`alert`,`admonition`,`callout`],serialize:(e,t)=>eY(`Callout`,e,t,mY)},{name:`img`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:hY,icon:`Image`,category:`media`,displayName:`Image`,description:`Image with click-to-zoom and HTML-native attributes`,searchTerms:[`image`,`zoom`,`picture`,`photo`],placeholder:{label:`Add an image`},serialize:(e,t)=>eY(`img`,e,t,hY)},{name:`video`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:_Y,icon:`SquarePlay`,category:`media`,displayName:`Video`,description:`HTML5 video player with native controls`,searchTerms:[`video`,`media`,`player`,`mp4`,`webm`,`movie`],placeholder:{label:`Add a video`},serialize:(e,t)=>eY(`video`,e,t,_Y)},{name:`audio`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:vY,icon:`Volume2`,category:`media`,displayName:`Audio`,description:`HTML5 audio player with native controls`,searchTerms:[`audio`,`sound`,`music`,`mp3`,`podcast`,`player`],placeholder:{label:`Add audio`},serialize:(e,t)=>eY(`audio`,e,t,vY)},{name:`Pdf`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:PY,icon:`FileText`,category:`media`,displayName:`PDF`,description:"Embedded PDF viewer (`#page=N` to open at page N, `#height=N` for viewer height)",searchTerms:[`pdf`,`document`,`embed`,`pdfjs`],placeholder:{label:`Add a PDF`},serialize:(e,t)=>eY(`Pdf`,e,t,PY)},{name:`File`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:NY,icon:`Paperclip`,category:`media`,displayName:`File`,description:`Downloadable file attachment — inline row with name + size + download link`,searchTerms:[`file`,`attachment`,`download`,`document`,`zip`,`docx`,`doc`],placeholder:{label:`Add a file`},serialize:(e,t)=>eY(`File`,e,t,NY)},{name:`Embed`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:gY,icon:`AppWindow`,category:`media`,displayName:`Embed`,description:'Inline web embed (iframe) — drop a URL, get a resizable preview pane. For YouTube / Vimeo / Loom prefer `<video src="…">` (player props, click-facade); `<Embed>` auto-rewrites watch URLs as a fallback.',searchTerms:[`embed`,`iframe`,`website`,`page`,`inline`,`frame`,`preview`],placeholder:{label:`Embed a URL`},serialize:(e,t)=>eY(`Embed`,e,t,gY)},{name:`Accordion`,surface:`canonical`,hasChildren:!0,props:yY,icon:`ChevronRight`,category:`content`,displayName:`Accordion`,description:"Standalone expand/collapse via native HTML5 <details>/<summary>. Group siblings with the `name` prop for exclusive-accordion UX.",searchTerms:[`toggle`,`accordion`,`expandable`,`details`,`disclosure`,`collapse`,`fold`],exampleBody:`Body content revealed when the accordion is expanded.`,serialize:(e,t)=>eY(`Accordion`,e,t,yY)},{name:`Tabs`,surface:`canonical`,hasChildren:!0,emptyChildName:`Tab`,props:EY,icon:`LayoutPanelTop`,category:`content`,displayName:`Tabs`,description:"Horizontal tab strip + active panel below. Each `<Tab>` child is one panel; clickable pills at the top switch the active one. Active selection is ephemeral (resets on reload).",searchTerms:[`tabs`,`tabbed`,`panels`,`tabgroup`,`switcher`],exampleBody:`<Tab label="One">Body of the first tab panel.</Tab>
|
|
392
|
+
`)}const vK=[{name:`--chart-1`,light:`oklch(0.62 0.19 259)`,dark:`oklch(0.72 0.14 259)`},{name:`--chart-2`,light:`oklch(0.58 0.14 145)`,dark:`oklch(0.73 0.13 145)`},{name:`--chart-3`,light:`oklch(0.62 0.15 70)`,dark:`oklch(0.77 0.14 70)`},{name:`--chart-4`,light:`oklch(0.55 0.18 290)`,dark:`oklch(0.72 0.16 290)`},{name:`--chart-5`,light:`oklch(0.58 0.21 25)`,dark:`oklch(0.72 0.2 25)`},{name:`--primary`,light:`oklch(0.6321 0.1983 259.59)`,dark:`#69a3ff`},{name:`--primary-foreground`,light:`oklch(0.985 0 0)`,dark:`oklch(0.205 0 0)`},{name:`--foreground`,light:`oklch(0.145 0 0)`,dark:`oklch(0.985 0 0)`},{name:`--background`,light:`oklch(1 0 0)`,dark:`oklch(0.145 0 0)`},{name:`--card`,light:`oklch(1 0 0)`,dark:`oklch(0.205 0 0)`},{name:`--card-foreground`,light:`oklch(0.145 0 0)`,dark:`oklch(0.985 0 0)`},{name:`--muted-foreground`,light:`oklch(0.556 0 0)`,dark:`oklch(0.708 0 0)`},{name:`--border`,light:`oklch(0.922 0 0)`,dark:`oklch(1 0 0 / 10%)`},{name:`--destructive`,light:`oklch(0.577 0.245 27.325)`,dark:`oklch(0.704 0.191 22.216)`},{name:`--radius`,light:`0.625rem`,dark:`0.625rem`}],yK=`localhost`,bK=[`image/jpeg`,`image/png`,`image/gif`,`image/webp`,`image/svg+xml`],xK=[`video/mp4`,`video/webm`,`video/ogg`],SK=[`audio/mpeg`,`audio/wav`,`audio/ogg`],CK=[`application/pdf`],wK=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`avif`,`svg`]),TK=new Set([`mp4`,`webm`,`mov`,`m4v`,`mkv`]),EK=new Set([`pdf`]),DK=new Set([`mp3`,`wav`,`ogg`,`m4a`,`flac`,`aac`,`opus`]),OK=new Set(`pdf.docx.xlsx.pptx.doc.xls.ppt.zip.7z.tar.gz.rar.csv.tsv.rtf.json.yaml.yml.xml.txt.pages.numbers.key.odt.ods.odp.epub.mobi`.split(`.`)),kK=new Set(`exe.bat.cmd.ps1.com.msi.vbs.js.jse.wsf.wsh.hta.sh.command.csh.ksh.bash.zsh.fish.desktop.action.workflow.html.htm.svg.xml.mhtml.svgz.dmg.pkg.mpkg.scpt.applescript.terminal.prefpane.webloc.inetloc.fileloc.jar.appimage.deb.rpm.msix.appx.ipa.apk.pif.scr.lnk.url`.split(`.`)),AK=new Set(`png.jpg.jpeg.gif.webp.avif.svg.apng.heic.heif.tiff.bmp.ico.pdf.mp4.webm.mov.m4v.mkv.avi.flv.wmv.mpeg.mpg.mp3.wav.ogg.m4a.flac.aac.opus.zip.7z.tar.gz.rar.woff.woff2.ttf.otf.eot.docx.xlsx.pptx.doc.xls.ppt.odt.ods.odp.pages.numbers.key.epub.mobi.csv.tsv.txt.rtf.json.yaml.yml.xml.toml.lock.gpx.html.htm`.split(`.`)),jK=new Set([`html`,`htm`]),MK=`sandbox allow-scripts; connect-src 'none'`,NK=new Set(`png.jpg.jpeg.gif.webp.avif.apng.heic.heif.tiff.bmp.ico.svg.pdf.mp4.webm.mov.m4v.mkv.mp3.wav.ogg.m4a.flac.aac.opus.json.toml.lock`.split(`.`)),PK=`same-dir`,FK=new Set(`png.jpg.jpeg.gif.webp.avif.svg.pdf.mp4.webm.mov.m4v.mkv.mp3.wav.ogg.m4a.flac.aac.opus.docx.xlsx.pptx.doc.xls.ppt.zip.7z.tar.gz.rar.csv.tsv.rtf.json.yaml.yml.xml.txt.pages.numbers.key.odt.ods.odp.epub.mobi`.split(`.`)),IK=[`png`,`jpg`,`jpeg`,`gif`,`webp`,`avif`],LK=[`mp4`,`webm`,`mov`,`m4v`],RK=[`mp3`,`wav`,`ogg`,`m4a`,`flac`,`aac`,`opus`],zK=[`pdf`],BK=[`json`,`toml`,`lock`];function VK(e,t,n){for(let r of t)if(!n.has(r))throw Error(`${e}: ${r} is not present in canonical upload constants`)}VK(`SIDEBAR_IMAGE_ASSET_EXTENSIONS`,IK,wK),VK(`SIDEBAR_VIDEO_ASSET_EXTENSIONS`,LK,TK),VK(`SIDEBAR_AUDIO_ASSET_EXTENSIONS`,RK,DK),VK(`SIDEBAR_PDF_ASSET_EXTENSIONS`,zK,EK),VK(`FILE_ATTACHMENT_EXTENSIONS`,[...OK],FK),VK(`WIKI_EMBED_EXTENSIONS`,[...FK],AK);const HK=new Set(IK),UK=new Set(LK),WK=new Set(RK),GK=new Set(zK),KK=new Set(BK);VK(`SIDEBAR_RENDERABLE_ASSET_EXTENSIONS`,[...new Set([...IK,...LK,...RK,...zK,...BK])],NK);const qK=new Set([`base`,`canvas`]),JK=new Set([...AK,...qK]);function YK(e){let t=e.toLowerCase().replace(/^\./,``);return HK.has(t)?`image`:UK.has(t)?`video`:WK.has(t)?`audio`:GK.has(t)?`pdf`:KK.has(t)||qK.has(t)||rK.has(t)?`text`:null}const XK=Ex.extend({priority:60,addAttributes(){return{...this.parent?.(),fenceDelimiter:{default:"`"},fenceLength:{default:3},meta:{default:null},sourceStyle:{default:`fenced`},sourceClosingFenceLength:{default:null,rendered:!1},sourceFenceIndent:{default:null,rendered:!1},sourceInfoPadding:{default:null,rendered:!1},sourceIndents:{default:null,rendered:!1}}}}),ZK=zx.extend({name:`emphasis`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`*`}}},addInputRules(){return[rx({find:Px,type:this.type,getAttributes:{sourceDelimiter:`*`}}),rx({find:Ix,type:this.type,getAttributes:{sourceDelimiter:`_`}})]}}),QK=Nx.extend({name:`strong`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`**`}}},addInputRules(){return[rx({find:Ox,type:this.type,getAttributes:{sourceDelimiter:`**`}}),rx({find:Ax,type:this.type,getAttributes:{sourceDelimiter:`__`}})]}}),$K=Ib.create({name:`escapeMark`,priority:10,excludes:``,inclusive:!1,parseHTML(){return[{tag:`span[data-escape-mark]`}]},renderHTML(){return[`span`,{"data-escape-mark":``},0]}}),eq=bx.create({name:`footnoteDefinition`,group:`block`,content:`block+`,defining:!0,priority:60,addAttributes(){return{identifier:{default:``},label:{default:null}}},parseHTML(){let e=e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-footnote-id`)||``;return{identifier:t,label:t||null}};return[{tag:`aside[data-footnote-def]`,getAttrs:e},{tag:`aside.footnote-def`,getAttrs:e}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.identifier??``);return[`aside`,{...t,"data-footnote-def":``,"data-footnote-id":n,id:`fn-${n}`,class:`footnote-def`},[`div`,{class:`footnote-body`},0],[`a`,{href:`#fnref-${n}`,class:`footnote-backref`,contentEditable:`false`,"aria-label":`Back to reference`},`↩`]]},addCommands(){return{insertFootnoteDefinition:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{identifier:e,label:e},content:[{type:`paragraph`}]})}}}),tq=bx.create({name:`footnoteReference`,group:`inline`,inline:!0,atom:!0,selectable:!0,draggable:!1,priority:60,addAttributes(){return{identifier:{default:``},label:{default:null}}},parseHTML(){return[{tag:`sup[data-footnote-ref]`,getAttrs:e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-footnote-id`)||``;return{identifier:t,label:t||null}}}]},renderHTML({node:e}){let t=String(e.attrs.identifier??``);return[`sup`,{id:`fnref-${t}`,"data-footnote-ref":``,"data-footnote-id":t,class:`footnote-ref`},[`a`,{href:`#fn-${t}`,class:`footnote-ref-link`},`[${t}]`]]},addCommands(){return{insertFootnoteReference:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{identifier:e,label:e}})}}}),nq=Vx.extend({priority:60,addAttributes(){return{...this.parent?.(),hardBreakStyle:{default:`backslash`}}}}),rq=Ux.extend({priority:60,addAttributes(){return{...this.parent?.(),headingStyle:{default:`atx`},sourceTrailingHashes:{default:null},sourceUnderlineLength:{default:null},sourceContiguousNext:{default:!1},sourceLeadingIndent:{default:null,rendered:!1},sourceInteriorSpacing:{default:null,rendered:!1}}}}),iq=bx.create({name:`htmlBlock`,group:`block`,atom:!0,priority:60,addAttributes(){return{content:{default:``}}},parseHTML(){return[{tag:`div[data-html-block]`}]},renderHTML({node:e}){return[`div`,{"data-html-block":``,class:`html-block`},e.attrs.content]}});function aq(e){if(typeof e!=`string`||!e.startsWith(`/`))return e;let t=globalThis.window?.okDesktop?.config?.apiOrigin;return typeof t==`string`&&t?t+e:e}const oq=Gx.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceUrl:{default:null,rendered:!1}}},renderHTML({HTMLAttributes:e}){let t=Dy(this.options.HTMLAttributes,e);return typeof t.src==`string`&&(t.src=aq(t.src)),[`img`,t]}}),sq=bx.create({name:`jsxComponent`,group:`block`,atom:!1,content:`block*`,isolating:!0,selectable:!0,defining:!0,priority:60,addAttributes(){return{componentName:{default:``},kind:{default:`element`},attributes:{default:[]},sourceRaw:{default:``},sourceDirty:{default:!1},props:{default:{}}}},parseHTML(){return[{tag:`div[data-jsx-component]`,getAttrs:e=>typeof e==`string`?!1:{componentName:e.getAttribute(`data-component-name`)||``,sourceRaw:e.getAttribute(`data-source-raw`)||``}}]},renderHTML({HTMLAttributes:e}){return[`div`,{"data-jsx-component":``,"data-component-name":e.componentName,"data-source-raw":e.sourceRaw},0]},addCommands(){return{insertJsxComponent:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{sourceRaw:e}})}}}),cq=bx.create({name:`jsxInline`,group:`inline`,inline:!0,atom:!1,content:`text*`,isolating:!1,selectable:!0,priority:60,addAttributes(){return{}},parseHTML(){return[{tag:`span[data-jsx-inline]`}]},renderHTML(){return[`span`,{"data-jsx-inline":``},0]}}),lq=[`https`,`http`,`mailto`,`tel`,`ftp`,`sms`],uq=lq.map(e=>`${e}:`).join(`|`);RegExp(`^(?:${uq}|\\/|#|\\?|\\.\\/|\\.\\.\\/)`,`i`);function dq(e){let t=e.trim();if(t===``)return!0;let n=t.indexOf(`:`);if(n===-1)return!0;let r=t.indexOf(`/`),i=t.indexOf(`?`),a=t.indexOf(`#`);return n>Math.min(r===-1?1/0:r,i===-1?1/0:i,a===-1?1/0:a)}const fq=new Set(lq.map(e=>`${e}:`));function pq(e){try{let t=new URL(e,`https://placeholder.invalid`);return fq.has(t.protocol.toLowerCase())}catch{return!1}}const mq=rS.extend({priority:60,addOptions(){return{openOnClick:!1,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer`},isAllowedUri:pq,validate:pq,shouldAutoLink:()=>!0}},addAttributes(){return{...this.parent?.(),linkStyle:{default:`inline`,rendered:!1},refLabel:{default:null,rendered:!1},sourceForm:{default:null,rendered:!1},target:{default:null,rendered:!1},anchor:{default:null,rendered:!1},alias:{default:null,rendered:!1},sourceUrlForm:{default:null,rendered:!1},sourceTitleMarker:{default:null,rendered:!1}}}}),hq=bx.create({name:`linkRefDef`,group:`block`,atom:!0,priority:60,addAttributes(){return{label:{default:``},href:{default:``},title:{default:null},sourceLayout:{default:null},sourceTitleMarker:{default:null}}},parseHTML(){return[{tag:`div[data-link-ref-def]`}]},renderHTML({node:e}){let{label:t,href:n,title:r}=e.attrs,i=r?`[${t}]: ${n} "${r}"`:`[${t}]: ${n}`;return[`div`,{"data-link-ref-def":``,class:`link-ref-def`},i]}});function gq(e){return e.type.name===`list`&&!e.attrs.ordered}function _q(e){return e.type.name===`list`&&!!e.attrs.ordered}function vq(e){let t=!1;return e.forEach(e=>{e.type.name===`listItem`&&e.attrs.checked!==null&&(t=!0)}),t}function yq(e,t,n,r,i,a,o){let s=_y(e=>e.type.name===`list`)(e.selection);if(s&&i(s.node)){let{$from:n,$to:i}=e.selection;return n.blockRange(i)?mp(r)(e,t):!1}if(s){if(!t)return!0;let{tr:n}=e;return n.setNodeMarkup(s.pos,void 0,{...s.node.attrs,...a}),o!==void 0&&s.node.forEach((e,t)=>{if(e.type.name===`listItem`){let r=s.pos+1+t;n.setNodeMarkup(r,void 0,{...e.attrs,...o})}}),t(n),!0}return dp(n,a)(e,void 0)?t?dp(n,a)(e,n=>{if(o){let t=n.mapping.map(e.selection.$from.pos),r=n.doc.resolve(t);for(let e=r.depth;e>0;e--){let t=r.node(e);if(t.type.name===`listItem`){n.setNodeMarkup(r.before(e),void 0,{...t.attrs,...o});break}}}t(n)}):!0:!1}const bq=bx.create({name:`list`,group:`block list`,content:`listItem+`,priority:60,addAttributes(){return{ordered:{default:!1},start:{default:1},spread:{default:!1},bulletMarker:{default:null},listMarkerDelimiter:{default:null}}},parseHTML(){return[{tag:`ul`,getAttrs:()=>({ordered:!1})},{tag:`ol`,getAttrs:e=>({ordered:!0,start:e.getAttribute(`start`)?Number(e.getAttribute(`start`)):1})}]},renderHTML({node:e,HTMLAttributes:t}){let n=e.attrs.ordered?`ol`:`ul`,r={};return e.attrs.ordered&&e.attrs.start!==1&&(r.start=e.attrs.start),[n,Dy(t,r),0]},addCommands(){return{toggleBulletList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:yq(e,t,n,r,e=>gq(e)&&!vq(e),{ordered:!1},{checked:null})},toggleOrderedList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:yq(e,t,n,r,e=>_q(e),{ordered:!0},{checked:null})},toggleTaskList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:yq(e,t,n,r,e=>gq(e)&&vq(e),{ordered:!1},{checked:!1})}}},addInputRules(){return[ox({find:/^\s*([-+*])(?!\s*\[[ xX]\])\s$/,type:this.type,getAttributes:e=>({ordered:!1,bulletMarker:e[1]}),joinPredicate:(e,t)=>t.attrs.ordered===!1}),ox({find:/^\s*(\d+)([.)])\s$/,type:this.type,getAttributes:e=>({ordered:!0,start:Number(e[1]),listMarkerDelimiter:e[2]}),joinPredicate:(e,t)=>t.attrs.ordered===!0}),new Ob({find:/^\s*[-*+]\s\[([ xX])\]\s$/,handler:({state:e,range:t,match:n})=>{let r=e.schema.nodes.list;if(!r)return null;let i=n[1]!==` `,a=e.tr.delete(t.from,t.to),o=a.doc.resolve(t.from).blockRange();if(!o)return null;let s=Ed(o,r,{ordered:!1});if(!s)return null;a.wrap(o,s);let c=a.doc.resolve(a.mapping.map(t.from));for(let e=c.depth;e>0;e--){let t=c.node(e);if(t.type.name===`listItem`){a.setNodeMarkup(c.before(e),void 0,{...t.attrs,checked:i});break}}}})]},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList(),"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList(),"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),xq=bx.create({name:`listItem`,content:`paragraph block*`,defining:!0,addAttributes(){return{checked:{default:null},spread:{default:!1},sourceMarkerSpacing:{default:null,rendered:!1},sourceOrdinal:{default:null,rendered:!1},sourceCheckboxChar:{default:null,rendered:!1},sourceContinuationIndent:{default:null,rendered:!1}}},parseHTML(){return[{tag:`li`,getAttrs:e=>{let t=e.querySelector(`input[type="checkbox"]`);return{checked:t?t.checked:null}}}]},renderHTML({node:e,HTMLAttributes:t}){return e.attrs.checked===null?[`li`,Dy(t),0]:[`li`,Dy(t,{"data-type":`taskItem`,"data-checked":e.attrs.checked?`true`:`false`}),[`label`,{contenteditable:`false`},[`input`,{type:`checkbox`,...e.attrs.checked?{checked:`checked`}:{}}]],[`div`,0]]},addNodeView(){return({node:e,getPos:t,editor:n,HTMLAttributes:r})=>{let i=document.createElement(`li`);Object.entries(Dy(r,e.attrs.checked===null?{}:{"data-type":`taskItem`,"data-checked":String(!!e.attrs.checked)})).forEach(([e,t])=>{t!=null&&i.setAttribute(e,String(t))});let a=null,o=null,s=document.createElement(`div`),c=()=>{o&&(o.disabled=!n.isEditable)};return e.attrs.checked!==null&&(a=document.createElement(`label`),a.contentEditable=`false`,o=document.createElement(`input`),o.type=`checkbox`,o.checked=!!e.attrs.checked,c(),n.on(`update`,c),o.addEventListener(`change`,()=>{let r=t();r===void 0||typeof r!=`number`||n.view.dispatch(n.view.state.tr.setNodeMarkup(r,void 0,{...e.attrs,checked:o?.checked??!1}))}),a.appendChild(o),i.appendChild(a)),i.appendChild(s),{dom:i,contentDOM:s,update(t){return t.type!==e.type||t.attrs.checked!==null!=(e.attrs.checked!==null)?!1:(o&&t.attrs.checked!==null&&(o.checked=!!t.attrs.checked,o.disabled=!n.isEditable,i.setAttribute(`data-checked`,String(!!t.attrs.checked))),e=t,!0)},destroy(){n.off(`update`,c)}}}},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>{let{$from:e}=this.editor.state.selection;for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return this.editor.commands.sinkListItem(this.name);return!1},"Shift-Tab":()=>{let{$from:e}=this.editor.state.selection;for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return this.editor.commands.liftListItem(this.name);return!1}}}}),Sq=bq,Cq=xq,wq=bx.create({name:`mathInline`,group:`inline`,inline:!0,atom:!0,selectable:!0,priority:60,addAttributes(){return{formula:{default:``},id:{default:null},language:{default:`latex`},sourceDelimiter:{default:null,rendered:!1}}},parseHTML(){return[{tag:`span[data-math-inline]`,getAttrs:e=>typeof e==`string`?!1:{formula:e.getAttribute(`data-formula`)||``,id:e.getAttribute(`id`)||null,language:e.getAttribute(`data-language`)||`latex`}}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-math-inline":``,"data-formula":e.formula,"data-language":e.language,...e.id?{id:e.id}:{}}]},addCommands(){return{insertMathInline:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{formula:e}})}}}),Tq=bx.create({name:`rawMdxFallback`,group:`block`,atom:!1,content:`text*`,isolating:!0,selectable:!0,defining:!0,priority:60,addAttributes(){return{reason:{default:``},originalSpan:{default:{start:0,end:0}}}},parseHTML(){let e=e=>typeof e==`string`?!1:{reason:e.getAttribute(`data-reason`)||``};return[{tag:`div[data-raw-mdx-fallback]`,getAttrs:e},{tag:`pre[data-raw-mdx-fallback]`,getAttrs:e}]},renderHTML({HTMLAttributes:e}){return[`div`,{"data-raw-mdx-fallback":``,"data-raw-badge":`raw`,"data-reason":e.reason,contenteditable:`false`,class:`raw-mdx-fallback`},0]},addNodeView(){return({HTMLAttributes:e})=>{let t=document.createElement(`div`);t.setAttribute(`data-raw-mdx-fallback`,``),t.setAttribute(`data-raw-badge`,`raw`),t.setAttribute(`contenteditable`,`false`),t.classList.add(`raw-mdx-fallback`),e.reason&&t.setAttribute(`data-reason`,e.reason);let n=document.createElement(`pre`);return n.classList.add(`raw-mdx-fallback-content`),n.setAttribute(`contenteditable`,`false`),t.appendChild(n),{dom:t,contentDOM:n,ignoreMutation:()=>!0}}}}),Eq=mw.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceMarkerSpacings:{default:null}}}}),Dq=vw.extend({excludes:``,addAttributes(){return{...this.parent?.(),sourceFenceChar:{default:"`"},sourceFenceLength:{default:1},sourcePadded:{default:!1,rendered:!1}}}}),Oq=bx.create({name:`commentBlock`,group:`block`,content:`block+`,defining:!0,priority:60,addAttributes(){return{sourceForm:{default:`percent`,parseHTML:e=>e.getAttribute(`data-source-form`)===`html`?`html`:`percent`,renderHTML:e=>e.sourceForm===`html`?{"data-source-form":`html`}:{}},sourceLayout:{default:`block`,parseHTML:e=>e.getAttribute(`data-source-layout`)===`inline`?`inline`:`block`,renderHTML:e=>e.sourceLayout===`inline`?{"data-source-layout":`inline`}:{}}}},parseHTML(){return[{tag:`aside[data-comment-block]`},{tag:`aside.comment-block`}]},renderHTML({HTMLAttributes:e}){return[`aside`,{"data-comment-block":``,"data-clipboard-omit":`true`,class:`comment-block`,style:`display: none;`,...e},0]},addCommands(){return{setCommentBlock:()=>({commands:e})=>e.wrapIn(this.name),toggleCommentBlock:()=>({commands:e})=>e.toggleWrap(this.name),unsetCommentBlock:()=>({commands:e})=>e.lift(this.name)}}}),kq=Ib.create({name:`comment`,priority:10,excludes:``,inclusive:!1,addAttributes(){return{sourceForm:{default:`percent`,parseHTML:e=>e.getAttribute(`data-source-form`)===`html`?`html`:`percent`,renderHTML:e=>e.sourceForm===`html`?{"data-source-form":`html`}:{}}}},parseHTML(){return[{tag:`span[data-comment-mark]`}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-comment-mark":``,"data-clipboard-omit":`true`,class:`comment-mark`,style:`display: none;`,...e},0]},addCommands(){return{setComment:()=>({commands:e})=>e.setMark(this.name),toggleComment:()=>({commands:e})=>e.toggleMark(this.name),unsetComment:()=>({commands:e})=>e.unsetMark(this.name)}}}),Aq=Gb.create({name:`docFidelity`,addGlobalAttributes(){return[{types:[`doc`],attributes:{sourceDocBoundary:{default:null,rendered:!1}}}]}}),jq=bx.create({name:`imageReference`,group:`inline`,inline:!0,atom:!0,priority:60,addAttributes(){return{alt:{default:``},label:{default:``},identifier:{default:``},referenceType:{default:`shortcut`}}},parseHTML(){return[{tag:`img[data-image-reference]`}]},renderHTML({node:e}){let{alt:t,label:n,referenceType:r}=e.attrs,i=t||n;return[`img`,{"data-image-reference":``,"data-reference-type":r,"data-label":n,alt:i}]}}),Mq=new Map([[32,` `],[9,` `]]);function Nq(e){let t=/^&#(x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);$/.exec(e);if(!t)return null;let n=t[1],r=n[0]===`x`||n[0]===`X`,i=Number.parseInt(r?n.slice(1):n,r?16:10);return Number.isNaN(i)?null:i}function Pq(e){let t=Nq(e);return t!==null&&Mq.has(t)}function Fq(e){let t=Nq(e);return t===null?null:Mq.get(t)??null}const Iq=/&#(?:x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);/g;function Lq(e){Iq.lastIndex=0;let t=e.match(Iq);if(t===null||t.join(``)!==e)return null;let n=``;for(let e of t){let t=Fq(e);if(t===null)return null;n+=t}return n}const Rq=Ib.create({name:`sourceLiteral`,priority:10,excludes:``,inclusive:!1,addAttributes(){return{sourceRaw:{default:``}}},parseHTML(){return[{tag:`span[data-source-literal]`}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-source-literal":``,...e},0]}});function zq(e,t){if(typeof e!=`string`||typeof t!=`string`||/[\x00-\x1F\x7F]/.test(e))return!1;let n=e.replaceAll(`\xA0`,` `),r=t.replaceAll(`\xA0`,` `);return n===r||Bq(n)===r?!0:Lq(n)===r}function Bq(e){return e.replace(/\\([!-/:-@[-`{-~])/g,`$1`)}const Vq=iT.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`~~`,rendered:!1}}}}),Hq=dw.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDashCounts:{default:null},sourceOuterPipes:{default:null,rendered:!1},sourceAlignmentPadding:{default:null,rendered:!1}}}}),Uq=XC.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),Wq=ZC.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),Gq=bx.create({name:`tag`,group:`inline`,inline:!0,atom:!0,selectable:!0,priority:60,addAttributes(){return{value:{default:``}}},parseHTML(){return[{tag:`a[data-tag]`,getAttrs:e=>typeof e==`string`?!1:{value:e.getAttribute(`data-tag`)||``}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.value??``);return[`a`,{...t,"data-tag":n,href:`#tag/${n}`,class:`tag`},`#${n}`]},addCommands(){return{insertTag:e=>({chain:t})=>t().insertContent({type:`tag`,attrs:{value:e}}).run()}}}),Kq=/^(?:---|—-|___\s|\*\*\*\s)$/;function qq(e){let t=String(e[0]??``).replace(/\s+$/,``);return t===`—-`?`---`:t}const Jq=xw.extend({name:`thematicBreak`,priority:60,addAttributes(){return{...this.parent?.(),sourceRaw:{default:`---`}}},addInputRules(){return[ix({find:Kq,type:this.type,getAttributes:e=>({sourceRaw:qq(e)})})]}});function Yq(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function Xq(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}const Zq=bx.create({name:`wikiLink`,group:`inline`,inline:!0,atom:!0,priority:60,addAttributes(){return{target:{default:``},alias:{default:null},anchor:{default:null},resolved:{default:!1},sourceTarget:{default:null,rendered:!1},sourceAnchor:{default:null,rendered:!1},sourceAlias:{default:null,rendered:!1}}},parseHTML(){return[{tag:`span[data-wiki-link]`,getAttrs:e=>typeof e==`string`?!1:{target:e.getAttribute(`data-target`)||``,alias:Yq(e.getAttribute(`data-alias`)),anchor:Yq(e.getAttribute(`data-anchor`)),resolved:e.getAttribute(`data-resolved`)===`true`}},{tag:`a.wiki-link[data-target]`,priority:100,getAttrs:e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-target`)??``;return t?{target:t,alias:Yq(e.getAttribute(`data-alias`)),anchor:Yq(e.getAttribute(`data-anchor`)),resolved:!1}:!1}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.target??``),r=Yq(e.attrs.alias),i=Yq(e.attrs.anchor),a=e.attrs.resolved===!0;return[`span`,{...t,"data-wiki-link":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,"data-resolved":a?`true`:`false`},Xq({target:n,alias:r,anchor:i})]}});function Qq(e){let t=e.split(`/`).pop()??e,n=t.lastIndexOf(`.`);return n<=0||n===t.length-1?``:t.slice(n+1).toLowerCase()}function $q(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}const eJ=[sq,Tq,cq,wq,Zq,bx.create({name:`wikiLinkEmbed`,group:`inline`,inline:!0,atom:!0,priority:60,addAttributes(){return{target:{default:``},alias:{default:null},anchor:{default:null},resolvedSrc:{default:null,rendered:!1,parseHTML:()=>null}}},parseHTML(){let e=e=>typeof e==`string`||!e.hasAttribute(`data-wiki-embed`)?!1:{target:e.getAttribute(`data-target`)||``,alias:Yq(e.getAttribute(`data-alias`)),anchor:Yq(e.getAttribute(`data-anchor`))};return[{tag:`img[data-wiki-embed]`,getAttrs:e,priority:100},{tag:`a[data-wiki-embed]`,getAttrs:e,priority:100}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.target??``),r=Yq(e.attrs.alias),i=Yq(e.attrs.anchor),a=Yq(e.attrs.resolvedSrc),o=Qq(n);if(wK.has(o))return[`img`,{...t,"data-wiki-embed":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,src:a??n,alt:r??n}];let s=a??n;return[`a`,{...t,"data-wiki-embed":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,href:i?`${s}#${i}`:s,target:`_blank`,rel:`noopener noreferrer`},$q({target:n,alias:r,anchor:i})]}}),Gq,Sq,Cq,ZK,QK,Vq,Dq,XK,Eq,rq,Jq,mq,iq,hq,nq,$K,Aq,Rq,XT.configure({undoRedo:!1,bulletList:!1,orderedList:!1,listItem:!1,listKeymap:{listTypes:[{itemName:`listItem`,wrapperNames:[`list`]}]},italic:!1,bold:!1,strike:!1,code:!1,codeBlock:!1,heading:!1,horizontalRule:!1,hardBreak:!1,link:!1,blockquote:!1,dropcursor:{color:`color-mix(in oklch, var(--primary) 50%, transparent)`,width:2}}),Hq.configure({resizable:!0}),QC,Wq,Uq,oq.configure({inline:!0}),jq,oS,kq,Oq,tq,eq],tJ=/^[a-zA-Z0-9][\w/-]*$/;function nJ(e){return e.startsWith(`#`)?e.slice(1):e}function rJ(e){return typeof e==`string`?[e]:Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function iJ(e){if(!e||e.trim()===``)return[];let{map:t}=qW(e);if(!t)return[];let n=rJ(t.tags),r=[];for(let e of n){let t=nJ(e);tJ.test(t)&&r.push(t)}return r}3072-aJ("This is an OpenKnowledge project: load the `open-knowledge` skill and use the OpenKnowledge MCP tools for all markdown — don't probe for `.ok/` or use native file tools on `.md` / `.mdx`. ",`cursor`);function aJ(e,t){let n=encodeURIComponent(e);return t===`cursor`?encodeURIComponent(n).length:n.length}function oJ(e){return`'${e.replace(/'/g,`'\\''`)}'`}`${oJ(JSON.stringify({enabledMcpjsonServers:[hK]}))}`;function sJ(e){if(e.length===0)return{ok:!1,reason:`docName must not be empty`};if(e.trim().length===0)return{ok:!1,reason:`docName must not be blank (whitespace only)`};if(e!==e.trim())return{ok:!1,reason:`docName must not have leading or trailing whitespace`};for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n<32||n===127)return{ok:!1,reason:`docName must not contain control characters`}}if(e.includes(`..`)||e.startsWith(`/`)||e.includes(`\\`))return{ok:!1,reason:`docName must not contain "..", a leading "/", or a backslash`};for(let t of e.split(`/`)){if(t.length===0)return{ok:!1,reason:`docName must not contain empty path segments (no leading, trailing, or doubled "/")`};if(t.startsWith(`.`))return{ok:!1,reason:`docName path segments must not start with "." (hidden files are not addressable)`}}return{ok:!0}}function cJ(e){return e.split(`/`).some(e=>e.startsWith(`.`))}function lJ(e,t){let n=sJ(e);n.ok||t.addIssue({code:`custom`,message:n.reason})}const uJ=k().superRefine(lJ).optional(),dJ={agentId:k().optional(),agentName:k().optional(),colorSeed:k().optional(),clientName:k().optional(),clientVersion:k().optional(),label:k().optional()},fJ=k().optional(),pJ=/^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,mJ=$s(`kind`,[N({kind:F(`doc`),docPath:k().min(1)}).loose(),N({kind:F(`folder`),folderPath:k()}).loose()]),hJ=P([`no-remote`,`detached-head`,`branch-not-on-origin`,`non-github-remote`,`invalid-path`]),gJ=$s(`ok`,[N({ok:F(!0),shareUrl:k().min(1),sharedUrl:k().min(1),branch:k().min(1)}).loose(),N({ok:F(!1),error:hJ,branch:k().min(1).optional()}).loose()]),_J=P([`user`,`org`]),vJ=N({login:k().min(1),kind:_J,avatarUrl:k().optional()}).loose(),yJ=P([`auth-required`,`network`]),bJ=$s(`ok`,[N({ok:F(!0),owners:M(vJ)}).loose(),N({ok:F(!1),error:yJ}).loose()]),xJ=$s(`ok`,[N({ok:F(!0),available:j()}).loose(),N({ok:F(!1),error:yJ}).loose()]),SJ=P([`public`,`private`]),CJ=N({owner:k().min(1),name:k().min(1),visibility:SJ,description:k().optional()}).loose(),wJ=P([`name-conflict`,`saml-sso`,`auth-required`,`push-failed`,`init-failed`,`network`,`no-project`]),TJ=$s(`ok`,[N({ok:F(!0),ownerLogin:k().min(1),repoName:k().min(1),cloneUrl:k().min(1),defaultBranch:k().min(1)}).loose(),N({ok:F(!1),error:wJ}).loose()]);function EJ(e){return!(typeof e!=`string`||e.length===0||e.startsWith(`-`)||/[\x00-\x1F\x7F]/.test(e)||/\s/.test(e)||e.includes(`:`)||e.split(`/`).includes(`..`))}const DJ=e=>e.refine(EJ,`invalid branch name`);function OJ(e){if(e==null)return!1;let t=e instanceof Error?e.message:String(e);return/couldn'?t find remote ref|Remote branch .+ not found/i.test(t)}const kJ=[/could not read (username|password)/i,/terminal prompts disabled/i],AJ=[/insufficient scopes/i,/missing.*scope/i,/required scope/i],jJ=[/permission denied.*\(publickey\)/i,/host key verification failed/i],MJ=[/\b(401|403)\b/,/authentication failed/i,/authorization failed/i,/invalid credentials/i,/credential helper/i,/bad credentials/i,/token.*expired/i,/expired.*token/i,/fatal:.*repository.*not found/i];function NJ(e){if(typeof e!=`object`||!e)return``;let t=e.git;return t==null?``:String(t)}function PJ(e){if(e==null)return{kind:`non-auth`};let t=`${e instanceof Error?e.message:String(e)}\n${NJ(e)}`;return kJ.some(e=>e.test(t))?{kind:`auth`,subclass:`no-credential`}:AJ.some(e=>e.test(t))?{kind:`auth`,subclass:`scope-mismatch`}:jJ.some(e=>e.test(t))?{kind:`auth`,subclass:`ssh-auth`}:MJ.some(e=>e.test(t))?/\b401\b/.test(t)||/token.*expired/i.test(t)?{kind:`auth`,subclass:`401`}:/\b403\b/.test(t)?{kind:`auth`,subclass:`403`}:{kind:`auth`,subclass:`unknown-auth`}:{kind:`non-auth`}}function FJ(e){return e.kind===`auth`?e.subclass===`no-credential`||e.subclass===`401`||e.subclass===`unknown-auth`:!1}const IJ={shareTargetExists:j(),dirtyConflicts:N({conflicts:j(),files:M(k().min(1))}).loose(),branchIsLocal:j()},LJ=$s(`detached`,[N({detached:F(!1),currentBranch:k().min(1).nullable(),currentHeadSha:Bs(),...IJ}).loose(),N({detached:F(!0),currentBranch:Bs(),currentHeadSha:k().min(1),...IJ}).loose()]),RJ=N({branch:DJ(k().min(1)),principalId:k().optional()}).loose(),zJ=P([`dirty-conflict`,`branch-not-found`,`fetch-failed`,`checkout-failed`,`branch-in-other-worktree`]),BJ=$s(`ok`,[N({ok:F(!0)}).loose(),N({ok:F(!1),reason:zJ,files:M(k().min(1)).optional(),otherWorktreePath:k().min(1).optional()}).loose()]),VJ=N({serverInstanceId:k().min(1),currentBranch:k().min(1).optional(),currentDiskAckSVs:rc(k().min(1),k().min(1)).optional()}).loose(),HJ=N({id:k().min(1),display_name:k().min(1),display_email:k(),source:P([`git-config`,`synthesized`]),created_at:k().min(1)}).loose(),UJ=N({collabUrl:k().nullable(),previewUrl:k().nullable(),port:A(),paneTarget:k().nullable(),singleFile:j().default(!1)}).loose(),WJ=P(`urn:ok:error:malformed-upload.urn:ok:error:collision-exhaustion.urn:ok:error:storage-full.urn:ok:error:storage-readonly.urn:ok:error:storage-error.urn:ok:error:no-file-received.urn:ok:error:path-escape.urn:ok:error:method-not-allowed.urn:ok:error:invalid-request.urn:ok:error:payload-too-large.urn:ok:error:request-timeout.urn:ok:error:internal-server-error.urn:ok:error:loopback-required.urn:ok:error:invalid-origin.urn:ok:error:url-not-allowed.urn:ok:error:dir-outside-home.urn:ok:error:concurrent-operation.urn:ok:error:clone-failed.urn:ok:error:clone-timeout.urn:ok:error:server-start-failed.urn:ok:error:reserved-doc-name.urn:ok:error:target-not-found.urn:ok:error:stale-target.urn:ok:error:frontmatter-edit-not-supported.urn:ok:error:invalid-frontmatter-patch.urn:ok:error:frontmatter-malformed.urn:ok:error:no-active-session.urn:ok:error:too-many-agent-sessions.urn:ok:error:disk-divergence.urn:ok:error:doc-not-found.urn:ok:error:doc-already-exists.urn:ok:error:doc-not-open.urn:ok:error:rollback-not-configured.urn:ok:error:doc-not-available.urn:ok:error:backlink-index-not-configured.urn:ok:error:file-rescan-not-configured.urn:ok:error:shadow-not-configured.urn:ok:error:host-not-allowed.urn:ok:error:principal-not-available.urn:ok:error:not-found.urn:ok:error:auth-failed.urn:ok:error:no-project-dir.urn:ok:error:server-open-failed.urn:ok:error:doc-in-conflict.urn:ok:error:no-conflict-tracked.urn:ok:error:sync-not-active.urn:ok:error:project-repo-not-configured.urn:ok:error:seed-prerequisite-missing.urn:ok:error:seed-invalid-root.urn:ok:error:tag-index-not-configured.urn:ok:error:template-not-found.urn:ok:error:unsupported-asset-type.urn:ok:error:asset-not-found.urn:ok:error:single-file-mode.urn:ok:error:collab-server-not-running.urn:ok:error:gateway-timeout.urn:ok:error:cursor-not-installed.urn:ok:error:cursor-spawn-timeout.urn:ok:error:cursor-spawn-failed.urn:ok:error:handoff-target-not-installed.urn:ok:error:handoff-spawn-timeout.urn:ok:error:handoff-spawn-failed`.split(`.`));function GJ(e){throw Error(`Unexpected ProblemType variant: ${JSON.stringify(e)}`)}const KJ=N({type:WJ,title:k().min(1),status:A().int().min(400).max(599),instance:k().regex(pJ,`instance must be urn:uuid:<uuid>`).optional(),detail:k().optional()}).loose(),qJ=N({parentDocName:k().min(1),agentId:k().min(1).optional(),agentName:k().min(1).optional()}).loose(),JJ=N({src:k().min(1),path:k().min(1).optional(),deduped:j().optional()}).loose(),YJ=N({url:k().min(1),dir:k().min(1),branch:k().min(1).refine(EJ,`invalid branch name`).optional()}).loose(),XJ=N({type:F(`error`),problem:KJ}).loose();function ZJ(e,t){let n=Array.isArray(e.attrs.attributes)?e.attrs.attributes.filter(e=>typeof e==`object`&&!!e&&`type`in e):[],r=e.attrs.props??{},i=new Map,a=new Set;if(t)for(let e of t)e.omitOnDefault===!0&&`defaultValue`in e&&e.defaultValue!==void 0&&i.set(e.name,e.defaultValue),e.type===`string`&&e.required===!1&&e.defaultValue===void 0&&a.add(e.name);for(let[e,t]of Object.entries(r)){let r=n.findIndex(t=>t.type===`mdxJsxAttribute`&&t.name===e);if(i.has(e)&&Object.is(i.get(e),t)){r>=0&&n.splice(r,1);continue}if(a.has(e)&&t===``){r>=0&&n.splice(r,1);continue}if(r>=0){let e=n[r];if(e.type===`mdxJsxAttribute`&&e.value!=null&&typeof e.value==`object`&&e.value.type===`mdxJsxAttributeValueExpression`&&QJ(e.value.value,t))continue}let o=$J(e,t);r>=0?n[r]=o:n.push(o)}return n}function QJ(e,t){try{return JSON.stringify(JSON.parse(e))===JSON.stringify(t)}catch{return!1}}function $J(e,t){if(t===!0)return{type:`mdxJsxAttribute`,name:e,value:null};if(t===!1)return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:`false`}};if(t==null)return{type:`mdxJsxAttribute`,name:e,value:null};if(typeof t==`string`)return{type:`mdxJsxAttribute`,name:e,value:t};if(typeof t==`number`)return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:JSON.stringify(t)}};if(typeof t==`object`){let n;try{n=JSON.stringify(t)}catch{n=String(t)}return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:n}}}return{type:`mdxJsxAttribute`,name:e,value:String(t)}}function eY(e,t,n,r){return{type:`mdxJsxFlowElement`,name:e,attributes:ZJ(t,r),children:n.all(t),data:{}}}const tY=/^[A-Za-z0-9]{20,}$/,nY=/^(?:\d+s?|(?:\d+h)?(?:\d+m)?(?:\d+s)?)$/;function rY(e){let t=e.toLowerCase();return t===`loom.com`||t===`www.loom.com`}function iY(e){let t=e.pathname.match(/^\/(?:share|embed)\/([A-Za-z0-9]+)\/?$/);if(!t)return null;let n=t[1]??``;return tY.test(n)?n:null}function aY(e){if(typeof e!=`string`||e.length===0)return null;let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`http:`&&t.protocol!==`https:`||!rY(t.hostname))return null;let n=iY(t);if(!n)return null;let r=t.searchParams.get(`t`);return{id:n,startRaw:r&&r.length>0&&nY.test(r)?r:null}}function oY(e){return aY(e)!==null}function sY(e){let t=e.toLowerCase();return t===`vimeo.com`||t===`www.vimeo.com`||t===`player.vimeo.com`}function cY(e){if(typeof e!=`string`||e.length===0)return!1;let t;try{t=new URL(e)}catch{return!1}return t.protocol!==`http:`&&t.protocol!==`https:`?!1:sY(t.hostname)}const lY=/^[A-Za-z0-9_-]{11}$/;function uY(e){let t=e.toLowerCase();return t===`youtube.com`||t===`www.youtube.com`||t===`m.youtube.com`||t===`music.youtube.com`||t===`youtu.be`||t===`youtube-nocookie.com`||t===`www.youtube-nocookie.com`}function dY(e){if(e.length===0)return null;if(/^[0-9]+$/.test(e)){let t=Number.parseInt(e,10);return t>0?t:null}let t=e.match(/^(?:([0-9]+)h)?(?:([0-9]+)m)?(?:([0-9]+)s?)?$/);if(!t)return null;let n=t[1]?Number.parseInt(t[1],10):0,r=t[2]?Number.parseInt(t[2],10):0,i=t[3]?Number.parseInt(t[3],10):0,a=n*3600+r*60+i;return a>0?a:null}function fY(e){if(e.hostname.toLowerCase()===`youtu.be`){let t=e.pathname.replace(/^\//,``).split(`/`)[0]??``;return lY.test(t)?t:null}if(e.pathname===`/watch`){let t=e.searchParams.get(`v`)??``;return lY.test(t)?t:null}let t=e.pathname.match(/^\/(?:embed|shorts|v)\/([A-Za-z0-9_-]{11})\/?$/);return t?t[1]??null:null}function pY(e){if(typeof e!=`string`||e.length===0)return null;let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`http:`&&t.protocol!==`https:`||!uY(t.hostname))return null;let n=fY(t);if(!n)return null;let r=t.searchParams.get(`t`)??t.searchParams.get(`start`)??``;return{id:n,startSeconds:r.length>0?dY(r):null,noCookie:t.hostname.toLowerCase().endsWith(`youtube-nocookie.com`)}}const mY=[{name:`type`,type:`enum`,enumValues:[`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`],defaultValue:`note`,required:!1,description:`Callout variant`},{name:`title`,type:`string`,required:!1,description:`Optional heading shown above the body`},{name:`icon`,type:`string`,required:!1,advanced:!0,description:"Custom lucide icon override (e.g. `lucide:Lightbulb`)",iconPicker:!0},{name:`color`,type:`string`,required:!1,advanced:!0,description:"Optional accent color override (hex — e.g. `#F05032`)",colorPicker:!0},{name:`collapsible`,type:`boolean`,required:!1,defaultValue:!1,advanced:!0,description:"Render as a foldable `<details>` (Obsidian `[!TYPE]+/-`)"},{name:`defaultOpen`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,description:`When collapsible, start in the open state`,hideWhen:e=>e.collapsible!==!0},{name:`children`,type:`reactnode`,required:!0,description:`Callout content`}],hY=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Image source URL`,accept:bK,autoFocus:!0},{name:`alt`,type:`string`,required:!0,description:`Alt text`},{name:`width`,type:`number`,required:!1,advanced:!0,description:`Image width`},{name:`height`,type:`number`,required:!1,advanced:!0,description:`Image height`},{name:`srcset`,type:`string`,required:!1,advanced:!0,description:`Responsive image candidate set (e.g. "x.png 1x, y.png 2x")`},{name:`sizes`,type:`string`,required:!1,advanced:!0,description:`Responsive image sizes hint paired with srcset`},{name:`loading`,type:`enum`,enumValues:[`eager`,`lazy`],defaultValue:`lazy`,required:!1,advanced:!0,omitOnDefault:!0,description:`Native img loading strategy (defaults to lazy)`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`decoding`,type:`enum`,enumValues:[`sync`,`async`,`auto`],defaultValue:`auto`,required:!1,advanced:!0,omitOnDefault:!0,description:`Hint for how the browser should decode the image`},{name:`fetchpriority`,type:`enum`,enumValues:[`high`,`low`,`auto`],defaultValue:`auto`,required:!1,advanced:!0,omitOnDefault:!0,description:`Resource fetch priority hint`},{name:`crossorigin`,type:`enum`,enumValues:[`anonymous`,`use-credentials`],required:!1,advanced:!0,description:`CORS mode for the image fetch`},{name:`referrerpolicy`,type:`string`,required:!1,advanced:!0,description:`Referrer policy for the image fetch (HTML referrerpolicy values)`},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],gY=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Embedded page URL (must start with http:// or https://)`,autoFocus:!0},{name:`title`,type:`string`,required:!1,description:`Iframe title (accessible label for screen readers)`},{name:`width`,type:`string`,required:!1,advanced:!0,description:`Embed width as a CSS length (e.g. "100%", "640px")`,cssLengthInput:!0},{name:`height`,type:`string`,required:!1,advanced:!0,description:`Embed height as a CSS length (e.g. "26rem", "480px")`,cssLengthInput:!0},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],_Y=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Video source URL`,accept:xK,autoFocus:!0},{name:`controls`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,omitOnDefault:!0,description:`Show native HTML5 video controls (defaults to true)`,hideWhen:e=>typeof e.src==`string`&&(cY(e.src)||oY(e.src))},{name:`autoplay`,type:`boolean`,required:!1,advanced:!0,description:`Begin playback as soon as possible (usually requires muted)`},{name:`poster`,type:`string`,required:!1,advanced:!0,description:`Poster image URL shown before playback`,accept:bK,hideWhen:e=>typeof e.src==`string`&&(cY(e.src)||oY(e.src))},{name:`width`,type:`number`,required:!1,advanced:!0,description:`Video width`},{name:`height`,type:`number`,required:!1,advanced:!0,description:`Video height`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`muted`,type:`boolean`,required:!1,advanced:!0,description:`Mute audio on load`},{name:`loop`,type:`boolean`,required:!1,advanced:!0,description:`Restart from the beginning when playback ends`,hideWhen:e=>typeof e.src==`string`&&oY(e.src)},{name:`playsinline`,type:`boolean`,required:!1,advanced:!0,description:`Play inline on iOS rather than entering fullscreen`,hideWhen:e=>typeof e.src==`string`&&(cY(e.src)||oY(e.src))},{name:`preload`,type:`enum`,enumValues:[`none`,`metadata`,`auto`],required:!1,advanced:!0,description:`Hint for how much of the video to preload`,hideWhen:e=>typeof e.src==`string`&&(pY(e.src)!==null||cY(e.src)||oY(e.src))},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],vY=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Audio source URL`,accept:SK,autoFocus:!0},{name:`controls`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,omitOnDefault:!0,description:`Show native HTML5 audio controls (defaults to true)`},{name:`autoplay`,type:`boolean`,required:!1,advanced:!0,description:`Begin playback as soon as possible (usually requires muted)`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`muted`,type:`boolean`,required:!1,advanced:!0,description:`Mute audio on load`},{name:`loop`,type:`boolean`,required:!1,advanced:!0,description:`Restart from the beginning when playback ends`},{name:`preload`,type:`enum`,enumValues:[`none`,`metadata`,`auto`],required:!1,advanced:!0,description:`Hint for how much of the audio to preload`}],yY=[{name:`title`,type:`string`,required:!0,description:`Accordion heading shown inside the <summary>`},{name:`defaultOpen`,type:`boolean`,required:!1,defaultValue:!1,description:`When true, the accordion renders expanded on initial load`},{name:`icon`,type:`string`,required:!1,advanced:!0,description:"Custom lucide icon override (e.g. `lucide:Rocket`)",iconPicker:!0},{name:`description`,type:`string`,required:!1,advanced:!0,description:`Optional subtitle rendered below the title inside <summary>`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#advanced-options`)"},{name:`name`,type:`string`,required:!1,advanced:!0,description:`HTML5 <details name=> group — siblings with the same name are mutually exclusive`}],bY=[mY[0],mY[1],mY[4],mY[5],mY[6]],xY=[hY[0],hY[1],hY[7]],SY=[yY[0],yY[1],yY[4],yY[5]],CY=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Alt text (Obsidian alias syntax: `![[file.png|alt text]]`)"}],wY=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[clip.mp4|title]]`)"}],TY=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[song.mp3|title]]`)"}],EY=[{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#install-tabs`)"}],DY=[{name:`label`,type:`string`,required:!0,autoFocus:!0,defaultValue:`Tab`,description:`Tab strip label — shown in the clickable pill at the top`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#tab-npm`)"}],OY=[{name:`formula`,type:`string`,required:!0,autoFocus:!0,language:`latex`,description:`LaTeX math source (rendered with KaTeX in the browser)`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#eq-pythagoras`)"},{name:`language`,type:`string`,required:!1,advanced:!0,description:"Forward-compat hint for the math source language (default `latex`). Reserved for future MathJax / Typst / AsciiMath substrates."}],kY=[OY[0]],AY=[OY[0]],jY=[{name:`chart`,type:`string`,required:!0,hidden:!0,description:`Mermaid chart source (graph / flowchart / sequenceDiagram / class / state / etc.)`}],MY=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Display name override (Obsidian alias syntax: `![[file.zip|label]]`)"}],NY=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`File URL`,accept:[`*/*`],autoFocus:!0}],PY=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`PDF source URL`,accept:CK,autoFocus:!0},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Accessible label for the embedded PDF viewer`},{name:`anchor`,type:`string`,required:!1,advanced:!0,description:"PDF viewer parameters as a single URL-fragment string (e.g. `page=3&height=600`)"}],FY=[{name:`src`,type:`string`,required:!0,description:"Path of the source doc, extension-less (e.g. `api-spec`).",autoFocus:!0},{name:`anchor`,type:`string`,required:!0,description:"Id of the `<MirrorSource>` block within the source doc."}],IY=[{name:`id`,type:`string`,required:!0,description:"Stable id agents and authors use to reference this block from `<Mirror>` elsewhere.",autoFocus:!0},{name:`children`,type:`reactnode`,required:!0,description:`Block content this MirrorSource owns — paragraphs, callouts, code, nested JSX, anything.`}];function LY(e){return e.replace(/&/g,`&`).replace(/"/g,`"`).replace(/</g,`<`).replace(/>/g,`>`)}function RY(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`)}function zY(e){let t=e.attrs.props,n=t?.target??``,r=typeof t?.alias==`string`&&t.alias.length>0?t.alias:null,i=typeof t?.anchor==`string`&&t.anchor.length>0?t.anchor:null,a=r??(i?`${n}#${i}`:n);return{type:`wikiLinkEmbed`,value:a,data:{target:n,anchor:i,alias:r},children:[{type:`text`,value:a}]}}const BY=[{name:`Callout`,surface:`canonical`,hasChildren:!0,props:mY,icon:`MessageSquareWarning`,category:`content`,displayName:`Callout`,description:`Alert / admonition with 15 type variants — 5 GFM (note, tip, important, warning, caution) plus 10 Obsidian-parity (abstract, info, todo, success, question, failure, danger, bug, example, quote)`,searchTerms:[`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`,`alert`,`admonition`,`callout`],serialize:(e,t)=>eY(`Callout`,e,t,mY)},{name:`img`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:hY,icon:`Image`,category:`media`,displayName:`Image`,description:`Image with click-to-zoom and HTML-native attributes`,searchTerms:[`image`,`zoom`,`picture`,`photo`],placeholder:{label:`Add an image`},serialize:(e,t)=>eY(`img`,e,t,hY)},{name:`video`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:_Y,icon:`SquarePlay`,category:`media`,displayName:`Video`,description:`HTML5 video player with native controls`,searchTerms:[`video`,`media`,`player`,`mp4`,`webm`,`movie`],placeholder:{label:`Add a video`},serialize:(e,t)=>eY(`video`,e,t,_Y)},{name:`audio`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:vY,icon:`Volume2`,category:`media`,displayName:`Audio`,description:`HTML5 audio player with native controls`,searchTerms:[`audio`,`sound`,`music`,`mp3`,`podcast`,`player`],placeholder:{label:`Add audio`},serialize:(e,t)=>eY(`audio`,e,t,vY)},{name:`Pdf`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:PY,icon:`FileText`,category:`media`,displayName:`PDF`,description:"Embedded PDF viewer (`#page=N` to open at page N, `#height=N` for viewer height)",searchTerms:[`pdf`,`document`,`embed`,`pdfjs`],placeholder:{label:`Add a PDF`},serialize:(e,t)=>eY(`Pdf`,e,t,PY)},{name:`File`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:NY,icon:`Paperclip`,category:`media`,displayName:`File`,description:`Downloadable file attachment — inline row with name + size + download link`,searchTerms:[`file`,`attachment`,`download`,`document`,`zip`,`docx`,`doc`],placeholder:{label:`Add a file`},serialize:(e,t)=>eY(`File`,e,t,NY)},{name:`Embed`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:gY,icon:`AppWindow`,category:`media`,displayName:`Embed`,description:'Inline web embed (iframe) — drop a URL, get a resizable preview pane. For YouTube / Vimeo / Loom prefer `<video src="…">` (player props, click-facade); `<Embed>` auto-rewrites watch URLs as a fallback.',searchTerms:[`embed`,`iframe`,`website`,`page`,`inline`,`frame`,`preview`],placeholder:{label:`Embed a URL`},serialize:(e,t)=>eY(`Embed`,e,t,gY)},{name:`Accordion`,surface:`canonical`,hasChildren:!0,props:yY,icon:`ChevronRight`,category:`content`,displayName:`Accordion`,description:"Standalone expand/collapse via native HTML5 <details>/<summary>. Group siblings with the `name` prop for exclusive-accordion UX.",searchTerms:[`toggle`,`accordion`,`expandable`,`details`,`disclosure`,`collapse`,`fold`],exampleBody:`Body content revealed when the accordion is expanded.`,serialize:(e,t)=>eY(`Accordion`,e,t,yY)},{name:`Tabs`,surface:`canonical`,hasChildren:!0,emptyChildName:`Tab`,props:EY,icon:`LayoutPanelTop`,category:`content`,displayName:`Tabs`,description:"Horizontal tab strip + active panel below. Each `<Tab>` child is one panel; clickable pills at the top switch the active one. Active selection is ephemeral (resets on reload).",searchTerms:[`tabs`,`tabbed`,`panels`,`tabgroup`,`switcher`],exampleBody:`<Tab label="One">Body of the first tab panel.</Tab>
|
|
393
393
|
<Tab label="Two">Body of the second tab panel.</Tab>`,serialize:(e,t)=>eY(`Tabs`,e,t,EY)},{name:`Tab`,surface:`canonical`,hasChildren:!0,props:DY,icon:`PanelTop`,category:`content`,displayName:`Tab`,description:"A single tab panel inside a `<Tabs>` container — carries the strip label and the block-content body.",searchTerms:[`tab`,`panel`],exampleBody:"Panel content — must be nested inside a `<Tabs>` parent.",serialize:(e,t)=>eY(`Tab`,e,t,DY)},{name:`Math`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:OY,icon:`Sigma`,category:`content`,displayName:`Math`,description:`Block math equation rendered with KaTeX from a LaTeX source string`,searchTerms:[`math`,`latex`,`equation`,`formula`,`katex`,`tex`],serialize:(e,t)=>eY(`Math`,e,t,OY)},{name:`MermaidFence`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:jY,icon:`Workflow`,category:`content`,displayName:`Mermaid`,description:"Diagram rendered from Mermaid source (flowchart, sequence, class, state, ER, gantt, pie). Authored exclusively as ` ```mermaid ` fenced code.",searchTerms:[`mermaid`,`diagram`,`flowchart`,`graph`,`sequence`,`sequencediagram`,`class`,`state`,`er`,`erdiagram`,`gantt`,`pie`,`chart`],serialize:e=>({type:`code`,lang:`mermaid`,meta:null,value:e.attrs.props?.chart??``})},{name:`Mirror`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:FY,icon:`CopyPlus`,category:`content`,displayName:`Mirror`,description:"Render a read-only copy of a `<MirrorSource>` block from another doc. Use to keep the same content in sync across multiple docs without copy-paste — edits land at the source, every Mirror reflects the change.",searchTerms:[`mirror`,`sync`,`synced`,`transclude`,`embed`,`reference`,`shared block`],serialize:(e,t)=>eY(`Mirror`,e,t,FY)},{name:`MirrorSource`,surface:`canonical`,hasChildren:!0,props:IY,icon:`GitBranch`,category:`content`,displayName:`Mirror Source`,description:'Mark a block as the source of truth for content that appears in multiple docs. Wrap any block content; `<Mirror src="…" anchor="<id>">` references render this verbatim read-only at every call-site. Edit here, propagate everywhere.',searchTerms:[`mirror source`,`sync source`,`source block`,`master block`,`shared`],exampleBody:"Authoritative content lives inside this block — edits here propagate to every `<Mirror>` that references this id.",serialize:(e,t)=>eY(`MirrorSource`,e,t,IY)},{name:`GFMCallout`,surface:`compat`,hasChildren:!0,props:bY,icon:`MessageSquareWarning`,category:`content`,displayName:`GFM Callout`,description:"GFM blockquote alert (`> [!NOTE]`) — read-only compat. Preserves `> [!NOTE]` syntax on round-trip; insert a fresh Callout block for the full prop surface.",rendersAs:`Callout`,translateProps:e=>e,serialize:(e,t)=>{let n=e.attrs.props,r=new Set([`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`]),i=n?.type??`note`;return{type:`blockquote`,children:[{type:`html`,value:`[!${(r.has(i.toLowerCase())?i:`note`).toUpperCase()}]${n?.collapsible?n.defaultOpen===!1?`-`:`+`:``}${n?.title?` ${n.title}`:``}`},...t.all(e).filter(e=>{if(e.type!==`paragraph`)return!0;let t=e;return Array.isArray(t.children)&&t.children.length>0})]}}},{name:`CommonMarkImage`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:xY,icon:`Image`,category:`media`,displayName:`CommonMark Image`,description:'CommonMark image (``) — read-only compat. Preserves `` syntax on round-trip; insert a fresh Image block for the full HTML-native attribute surface (srcset, sizes, decoding, etc.).',rendersAs:`img`,translateProps:e=>e,serialize:e=>{let t=e.attrs.props;return{type:`paragraph`,children:[{type:`image`,url:t?.sourceUrl??t?.src??``,alt:t?.alt??``,title:t?.title??null}]}}},{name:`WikiEmbedImage`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:CY,icon:`ZoomIn`,category:`media`,displayName:`Wiki Embed Image`,description:"Obsidian-style `![[file.png]]` wiki-embed — read-only compat. Edit the alt-text via the alias slot; the embed target / anchor stay on the prop bag and round-trip byte-identical.",rendersAs:`img`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.target==`string`?e.target:``;return{src:e.src,alt:t??n}},serialize:zY},{name:`WikiEmbedVideo`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:wY,icon:`Film`,category:`media`,displayName:`Wiki Embed Video`,description:"Obsidian-style `![[clip.mp4]]` wiki-embed — read-only compat. Edit the title via the alias slot; the embed target / anchor stay on the prop bag and round-trip byte-identical.",rendersAs:`video`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.target==`string`?e.target:``;return{src:e.src,title:t??n}},serialize:zY},{name:`WikiEmbedAudio`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:TY,icon:`Volume2`,category:`media`,displayName:`Wiki Embed Audio`,description:"Obsidian-style `![[song.mp3]]` wiki-embed — read-only compat. Edit the title via the alias slot; the embed target / anchor stay on the prop bag and round-trip byte-identical.",rendersAs:`audio`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.target==`string`?e.target:``;return{src:e.src,title:t??n}},serialize:zY},{name:`WikiEmbedFile`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:MY,icon:`Paperclip`,category:`media`,displayName:`Wiki Embed File`,description:"Obsidian-style `![[file.zip]]` wiki-embed — read-only compat for arbitrary downloadable attachments. Renders through the `File` canonical (inline row with file-up icon + bold name + optional dim size). Edit the display name via the alias slot.",rendersAs:`File`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.size==`string`&&e.size.length>0?e.size:null;return{src:e.src,name:t??void 0,size:n??void 0}},serialize:zY},{name:`HtmlDetailsAccordion`,surface:`compat`,hasChildren:!0,props:SY,icon:`ChevronRight`,category:`content`,displayName:`HTML5 Details`,description:"HTML5 `<details><summary>` collapsible — read-only compat. Preserves `<details>` syntax on round-trip; insert a fresh Accordion block for icon / description / group-name props.",rendersAs:`Accordion`,translateProps:e=>e,serialize:(e,t)=>{let n=e.attrs.props,r=n?.defaultOpen?` open`:``,i=n?.name?` name="${LY(n.name)}"`:``,a=n?.id?` id="${LY(n.id)}"`:``,o=n?.title?.trim(),s=o?`<summary>${RY(o)}</summary>`:``;return{type:`mdxJsxFlowElement`,name:`HtmlDetailsAccordion`,attributes:[],children:t.all(e),data:{htmlBoundary:{opener:`<details${r}${i}${a}>\n${s}`,closer:`</details>`}}}}},{name:`DollarMath`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:kY,icon:`Sigma`,category:`content`,displayName:`Dollar Math`,description:"Block math via `$$…$$` syntax — read-only compat. Preserves `$$…$$` form on round-trip; insert a fresh Math block for the full prop surface (id, language).",rendersAs:`Math`,translateProps:e=>e,serialize:e=>({type:`math`,value:e.attrs.props?.formula??``})},{name:`MathFence`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:AY,icon:`Sigma`,category:`content`,displayName:`Math Fence`,description:"Block math via ` ```math ` fenced code syntax — read-only compat. Preserves the fence form on round-trip; insert a fresh Math block for the full prop surface (id, language).",rendersAs:`Math`,translateProps:e=>e,serialize:e=>({type:`code`,lang:`math`,meta:null,value:e.attrs.props?.formula??``})}],VY={name:`*`,surface:`canonical`,hasChildren:!0,props:[],description:`Unregistered component — children editable as markdown`,serialize:(e,t)=>eY(e.attrs.componentName||`*`,e,t)};function HY(){let e=new Map;e.set(`*`,VY);for(let t of BY)e.set(t.name,t);return{get(t){return e.get(t)},getOrWildcard(t){return e.get(t)??e.get(`*`)},set(t,n){e.set(t,n)},has(t){return e.has(t)},entries(){return e.entries()}}}function UY(){let e=globalThis;return e.__okYpsCounters||={block:0,inline:0},e.__okYpsCounters}const WY={parseFallback:{blockLevel:0,wholeDoc:0,wholeDocBudget:0},jsxRenderFailure:{},jsxAutoConvertFailed:{},jsxAutoConvertSucceeded:{},jsxPropDropped:{},jsxMoveFailed:{},jsxStuckCopyFailed:{},jsxStuckDeleteFailed:{},jsxPopoverCloseRestoreFailed:{},jsxKeyboardDeleteFailed:{},blockGripClickSelectFailed:{},jsxArrowNodeSelectFailed:{}};function GY(){WY.parseFallback.blockLevel++}function KY(){WY.parseFallback.wholeDoc++}function qY(){WY.parseFallback.wholeDocBudget++}function JY(){let e=UY();return{parseFallback:{...WY.parseFallback},ypsMismatch:{block:e.block,inline:e.inline},jsxRenderFailure:{...WY.jsxRenderFailure},jsxAutoConvertFailed:{...WY.jsxAutoConvertFailed},jsxAutoConvertSucceeded:{...WY.jsxAutoConvertSucceeded},jsxPropDropped:{...WY.jsxPropDropped},jsxMoveFailed:{...WY.jsxMoveFailed},jsxStuckCopyFailed:{...WY.jsxStuckCopyFailed},jsxStuckDeleteFailed:{...WY.jsxStuckDeleteFailed},jsxPopoverCloseRestoreFailed:{...WY.jsxPopoverCloseRestoreFailed},jsxKeyboardDeleteFailed:{...WY.jsxKeyboardDeleteFailed},blockGripClickSelectFailed:{...WY.blockGripClickSelectFailed},jsxArrowNodeSelectFailed:{...WY.jsxArrowNodeSelectFailed}}}const YY=/^(`{3,}|~{3,})/gm;function XY(e){let t=[],n=null;for(let r of e.matchAll(YY)){let e=r[1],i=r.index;n?e[0]===n.marker[0]&&e.length>=n.marker.length&&(t.push([n.offset,i+r[0].length]),n=null):n={marker:e,offset:i}}return n&&t.push([n.offset,e.length]),t}function ZY(e,t){return t.some(([t,n])=>e>=t&&e<n)}const QY=/^[ \t]{0,3}\[([^\]]+)\]:\s*(\S+)(\s+(?:"[^"]*"|'[^']*'|\([^)]*\)))?\s*$/gm;function $Y(e){let t=XY(e),n=[];for(let r of e.matchAll(QY))ZY(r.index,t)||n.push(r[0].trimEnd());return n.length>0?`${n.join(`
|
|
394
394
|
`)}\n\n`:``}function eX(e,t){let n={startMs:typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now(),calls:0};return rX(e,t.parse,0,n)}function tX(e){return e.calls>=1e3?!0:(typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now())-e.startMs>=500}function nX(e){return e instanceof Error?{name:e.name,message:e.message.slice(0,500),stack:e.stack?.split(`
|
|
395
395
|
`).slice(0,4).join(`
|
|
@@ -447,5 +447,5 @@ $2`).split(`
|
|
|
447
447
|
`)}const a1=N({docName:uJ,summary:fJ,content:k().optional(),...dJ}).loose(),o1=N({docName:uJ,summary:fJ,markdown:k(),position:P([`append`,`prepend`,`replace`]).optional(),extension:P(iK).optional(),...dJ}).loose(),s1=N({docName:uJ,summary:fJ,find:k().min(1),replace:k(),offset:A().int().nonnegative().optional(),...dJ}).loose(),c1=N({docName:uJ,connectionId:k().min(1),scope:P([`last`,`session`,`file`]).optional(),...dJ}).loose(),l1=N({value:k(),truncatedFrom:A().int().nonnegative().optional(),hint:k().optional()}).loose(),u1=$s(`kind`,[N({kind:F(`inline`),content:k()}),N({kind:F(`truncated`),byteLength:A().int().nonnegative(),hint:k()})]),d1=N({kind:F(`content-divergence`),intendedBytes:A().int().nonnegative(),actualBytes:A().int().nonnegative(),byteDelta:A().int(),divergenceType:k().optional(),currentState:u1.optional(),hint:k().optional()}).loose(),f1=N({type:F(`orphan`),parentCandidates:M(k()),message:k()}).loose(),p1=N({kind:F(`disk-edit-reconciled`),intendedBytes:A().int().nonnegative(),actualBytes:A().int().nonnegative(),byteDelta:A().int(),mergeOutcome:k().optional(),hint:k().optional()}).loose(),m1=$s(`kind`,[d1,p1]),h1=$s(`kind`,[d1,p1,N({kind:F(`mermaid-parse-error`),fenceIndex:A().int().positive(),fenceFirstLine:k(),message:k(),line:A().int().positive().optional()}).loose()]),g1=M(h1).min(1),_1=N({timestamp:k().min(1),summary:l1.optional(),warning:m1.optional(),warnings:g1.optional()}).loose(),v1=N({timestamp:k().min(1),subscriberCount:A().int().nonnegative(),systemSubscriberCount:A().int().nonnegative(),hints:M(f1).optional(),summary:l1.optional(),warning:m1.optional(),warnings:g1.optional()}).loose(),y1=N({timestamp:k().min(1),subscriberCount:A().int().nonnegative(),systemSubscriberCount:A().int().nonnegative(),summary:l1.optional(),warning:m1.optional(),warnings:g1.optional()}).loose(),b1=N({docName:k().min(1),scope:P([`last`,`session`]),undone:j()}).loose(),x1=N({docName:uJ,patch:rc(k(),Zs([zW,Bs()])),types:rc(k(),P(IW)).optional(),summary:fJ,...dJ}).loose(),S1=N({timestamp:k().min(1),subscriberCount:A().int().nonnegative(),systemSubscriberCount:A().int().nonnegative(),appliedKeys:M(k()),summary:l1.optional(),warning:m1.optional(),warnings:g1.optional()}).loose(),C1=N({entries:M(N({level:P([`info`,`warn`,`error`]),message:k().max(8192),event:k().optional(),fields:rc(k(),Ws()).optional(),ts:A().optional(),sourceId:k().optional(),lineNumber:A().optional()}).loose()).max(100)}).loose(),w1=N({accepted:A().int().min(0)}).loose(),T1=N({status:k().min(1),reason:k()}).loose(),E1=N({docName:k().min(1),content:k(),lifecycle:T1.nullable()}).loose(),D1=N({documents:M(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)`})),truncated:j().optional()}).loose(),O1=N({source:k().min(1),anchor:k().nullable(),title:k(),snippet:k().nullable()}).loose(),k1=N({docName:k().min(1),backlinks:M(O1)}).loose(),A1=N({counts:rc(k().min(1),A().int().nonnegative())}).loose(),j1=$s(`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()]),M1=N({docName:k().min(1),forwardLinks:M(j1)}).loose(),N1=$s(`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()]),P1=N({source:k().min(1),target:k().min(1)}).loose(),F1=N({nodes:M(N1),links:M(P1)}).loose(),I1=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(),L1=N({app:Zs([F(`cursor`),F(`codex`),F(`claude`),Bs()]),signals_fired:M(k())}).loose(),R1=N({entries:M(I1),count:A().int().min(0),detection:L1}).loose(),z1=N({writers:M(N({id:k().min(1),name:k().optional(),email:k().optional()}).loose()).optional(),summary:fJ,...dJ}).loose(),B1=N({checkpointRef:k().min(1)}).loose(),V1=N({v:A().int().optional(),id:k().min(1),name:k().min(1),colorSeed:k().optional(),docs:M(k()),summaries:M(k()).optional()}).loose(),H1=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(V1),checkpoint:Ws().nullable()}).loose()),total:A().int().nonnegative().optional(),truncated:j().optional(),hasMore:j().optional()}).loose(),U1=N({sha:k().regex(/^[0-9a-f]{40}$/i),content:k(),timestamp:k(),author:k()}).loose(),W1=N({contentDir:k().min(1),pathSeparator:P([`/`,`\\`]),symlinkResolved:j()}).loose(),G1=M($s(`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`."}),K1=N({orphans:M(N({docName:k().min(1),title:k()}).loose())}).loose(),q1=N({hubs:M(N({docName:k().min(1),title:k(),count:A().int().nonnegative()}).loose())}).loose(),J1=N({source:k().min(1),title:k(),snippet:k().nullable()}).loose(),Y1=N({deadLinks:M(N({target:k().min(1),sources:M(J1)}).loose())}).loose(),X1=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(),Z1=N({projectPath:k().min(1)}).loose(),Q1=P([`not-a-git-worktree`,`init-failed`]),$1=$s(`ok`,[N({ok:F(!0),projectPath:k().min(1)}).loose(),N({ok:F(!1),reason:Q1,message:k().min(1)}).loose()]),e0=N({host:k().min(1).optional()}).loose(),t0=N({key:k().min(1)}).loose(),n0=N({keyPresent:j()}).loose(),r0=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(),i0=N({authenticated:j()}).loose(),a0=N({}).loose(),o0=N({stackIndex:A().int().min(0),ts:A().int().min(0),additions:A().int().min(0),deletions:A().int().min(0)}).loose(),s0=N({docName:k().min(1),additionsTotal:A().int().min(0),deletionsTotal:A().int().min(0),lastTs:A().int().min(0),bursts:M(o0)}).loose(),c0=N({displayName:k().min(1),color:k().min(1),icon:k().optional(),connectionId:k().min(1)}).loose(),l0=N({sessionAlive:j(),agent:c0.nullable(),files:M(s0)}).loose(),u0=N({diff:k(),generatedAt:A().int().min(0)}).loose(),d0=N({}).loose(),f0=N({}).loose(),p0=N({}).loose(),m0=N({}).loose(),h0=N({}).loose(),g0=N({}).loose(),_0=N({displayName:k().min(1),icon:k(),color:k().min(1),currentDoc:k().nullable(),mode:P([`idle`,`writing`]),ts:A().int().min(0)}).loose(),v0=N({presence:rc(k().min(1),_0)}).loose(),y0=rc(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();const b0=N({}).loose(),x0=N({fromDocName:k().min(1),toDocName:k().min(1)}).loose(),S0=N({fromPath:k().min(1),toPath:k().min(1)}).loose(),C0=N({}).loose(),w0=N({path:k().min(1),...dJ,summary:fJ}).loose(),T0=N({docName:k().min(1)}).loose(),E0=N({path:k().min(1),...dJ,summary:fJ}).loose(),D0=N({path:k().min(1)}).loose(),O0=N({kind:P([`file`,`folder`]),path:k().min(1),...dJ,summary:fJ}).loose(),k0=N({kind:P([`file`,`folder`]),path:k().min(1),duplicatedDocNames:M(k().min(1))}).loose(),A0=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(),j0=N({level:A().int().min(1).max(6),text:k(),slug:k()}).loose(),M0=N({docName:k().min(1),headings:M(j0)}).loose(),N0=N({docName:k().min(1),rewrites:A().int().nonnegative()}).loose(),P0=N({kind:P([`file`,`folder`,`asset`]),fromPath:k().min(1),toPath:k().min(1),...dJ,summary:fJ}).loose(),F0=N({renamed:M(x0),renamedAssets:M(S0),rewrittenDocs:M(N0).optional(),summary:l1.optional()}).loose(),I0=N({kind:P([`file`,`folder`,`asset`]),path:k().min(1),...dJ}).loose(),L0=N({deletedDocNames:M(k().min(1))}).loose(),R0=N({kind:P([`file`,`folder`,`asset`]),path:k().min(1),...dJ,summary:fJ}).loose(),z0=N({deletedDocNames:M(k().min(1))}).loose(),B0=N({docName:k().min(1),commitSha:k().regex(/^[0-9a-f]{40}$/i,{message:`commitSha must be a 40-char git SHA`}),summary:fJ,...dJ}).loose(),V0=N({restoredFrom:k().min(1),timestamp:k().min(1),summary:l1.optional(),warning:d1.optional(),warnings:g1.optional()}).loose(),H0=P([`dormant`,`idle`,`fetching`,`pulling`,`pushing`,`conflict`,`offline`,`auth-error`,`disabled`]),U0=N({label:k().min(1),webUrl:ys().nullable()}).loose(),W0=$s(`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()]),G0=P([`auth-403`,`auth-401`,`auth-scope-mismatch`,`auth-no-credential`,`semantic-protected-branch`]),K0=N({state:H0,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:U0.nullable().optional(),pushError:k().optional(),pushErrorCode:G0.optional(),pullError:k().optional(),pullErrorCode:G0.optional(),pausedReason:k().optional(),pushPermission:W0.optional()}).loose(),q0=N({op:P([`sync`,`push`,`pull`]).optional()}).loose(),J0=N({op:P([`sync`,`push`,`pull`])}).loose(),Y0=N({conflicts:M(N({file:k().min(1),detectedAt:k().min(1),oursSha:k().optional(),theirsSha:k().optional(),baseSha:k().optional()}).loose())}).loose(),X0=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`]}),Z0=N({}).loose(),Q0=N({file:k().min(1),base:k(),ours:k(),theirs:k(),kind:P([`both-modified`,`delete-modify`,`modify-delete`]),lifecycleStatus:k().nullable()}).loose(),$0=N({plan:kc(e=>e!==void 0,{message:`plan is required`})}).loose(),e2=N({plan:kc(e=>e!==void 0,{message:`plan is required`})}).loose(),t2=N({result:kc(e=>e!==void 0,{message:`result is required`})}).loose(),n2=N({path:k().min(1),summary:k().min(1)}).loose(),r2=N({files:A().int().nonnegative(),folders:A().int().nonnegative()}).loose(),i2=N({packs:M(N({id:k().min(1),name:k().min(1),description:k().min(1),defaultSubfolder:k().optional(),folders:M(n2),entryCounts:r2}).loose())}).loose(),a2=N({noOpen:j().optional(),out:k().min(1).optional()}).loose(),o2=N({reason:P([`unsupported-platform`,`spawn-error`]),message:k()}).loose(),s2=$s(`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:o2.optional()}).loose(),N({status:F(`failed`),buildError:k()}).loose(),N({status:F(`skip-current`),skillVersion:k(),recordedAt:k().optional()}).loose()]),c2=N({tags:M(N({name:k().min(1),count:A().int().nonnegative(),isLeaf:j()}).loose())}).loose(),l2=N({docName:k().min(1),title:k(),matchingTags:M(k().min(1)),snippet:k().nullable()}).loose(),u2=N({name:k().min(1),docs:M(l2)}).loose(),d2=N({folder:Ws(),frontmatter_local:rc(k(),Ws()).nullable()}).loose(),f2=N({path:k(),frontmatter:rc(k(),Ws()).optional()}).loose(),p2=N({applied:Ws()}).loose(),m2=rc(k(),Ws()).meta({description:`Free-form frontmatter map embedded in template payloads.`}),h2=N({template:N({name:k().min(1),folder:k(),scope:P([`local`,`inherited`]),path:k().min(1),frontmatter:m2,body:k()}).strict()}).strict(),g2=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(),_2=N({folder:k(),name:k(),body:k().optional(),frontmatter:m2.optional(),...dJ,summary:fJ}).strict(),v2=N({path:k().min(1),created:j(),warnings:M(k())}).strict(),y2=N({existed:j(),path:k().min(1)}).strict(),b2=N({fromFolder:k(),fromName:k(),toFolder:k(),toName:k(),body:k().optional(),frontmatter:m2.optional(),...dJ,summary:fJ}).strict(),x2=N({from:k().min(1),to:k().min(1),committed:j()}).strict(),S2=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(),C2=N({kind:P([`page`,`folder`,`content`,`file`]),path:k().min(1),title:k(),score:A(),signals:rc(k(),Ws()),snippet:k().optional()}).loose(),w2=N({capable:j(),applied:j(),coverage:N({embedded:A().int().nonnegative(),total:A().int().nonnegative()})}).loose(),T2=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(),E2=N({query:k(),intent:P([`autocomplete`,`full_text`,`omnibar`]),results:M(C2),elapsedMs:A().nonnegative(),semantic:w2.optional(),truncated:j().optional(),ready:j().optional()}).loose(),D2=N({version:k().min(1),recordedAt:k().min(1)}).loose(),O2=N({currentVersion:k().min(1),targets:rc(k(),D2.nullable())}).loose(),k2=`server-info`,A2=`branch-switched`,j2=`disk-ack`,M2=`config-validation-rejected`,N2=`config-ignore-nested-error`,P2=P([`files`,`backlinks`,`graph`,`sync-status`,`session-activity`,`tags`]),F2=N({v:F(1),ch:F(k2),seq:A(),serverInstanceId:k().min(1),currentBranch:k().min(1).optional()}).loose(),I2=N({v:F(1),ch:F(A2),seq:A(),branch:k().min(1)}).loose(),L2=N({v:F(1),ch:P2,seq:A()}).loose(),R2=N({v:F(1),ch:F(j2),seq:A(),docName:k().min(1),sv:k().min(1)}).loose(),z2=N({v:F(1),ch:F(M2),seq:A(),docName:k().min(1),error:ll}).loose(),B2=N({v:F(1),ch:F(N2),seq:A(),path:k().min(1),error:k().min(1)}).loose(),V2={id:`string`,kind:`enum`,path:`string`,title:`string`,name:`string`,pathSegments:`string`,content:`string`,modifiedTs:`number`},H2=new WeakMap;function U2(e){return e===void 0||!Number.isFinite(e)?20:Math.max(1,Math.min(100,Math.trunc(e)))}function W2(e){return e.trim().toLowerCase()}const G2=/\.(?:md|mdx)$/;function K2(e,t){if(t!==`page`)return e;let n=e.replace(G2,``);return n.length>0?n:e}function q2(e){let t=e.split(`/`).filter(Boolean);return t[t.length-1]??e}function J2(e){let t=q2(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 Y2(e){let t=LU({schema:V2});return e.length>0&&JU(t,e),t}function X2(e){let t={documents:e};return H2.set(t,Y2(e)),t}function Z2(e){let t=H2.get(e);if(t)return t;let n=Y2(e.documents);return H2.set(e,n),n}function Q2(e){return e===`autocomplete`?[`page`]:e===`full_text`?[`page`,`content`,`file`]:[`page`,`folder`,`file`]}function $2(e,t){return t.has(e.kind)?!0:e.kind===`page`&&t.has(`content`)}function e4(e,t){let n=W2(t);if(!n)return 0;let r=K2(n,e.kind),i=W2(e.title),a=W2(e.name),o=W2(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}function t4(e,t){let n=e4(e,t);return n<=0?n:cJ(e.path)?n*.5:n}function n4(e){return e===`file`?-60:0}function r4(e,t,n,r,i){let a=i>0?t/i:0,o=n/50,s=r===`file`?-.001:0,c=1*a+1*o+s;return e*1e3+c}function i4(e,t,n,r){return e+t*20+n+n4(r)}function a4(e,t,n,r,i,a){return e===`relevance`?i4(t,n,r,i):r4(t,n,r,i,a)}function o4(e,t){return t||(e===`full_text`?`relevance`:`navigation`)}function s4(e,t){let n=0;for(let r of e){let e=t.get(r.id)??0;e>n&&(n=e)}return n}function c4(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 l4(e){return e===`full_text`?[`title`,`name`,`path`,`pathSegments`,`content`]:[`title`,`name`,`path`,`pathSegments`]}function u4(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 d4(e,t){return W2(t).length<4?0:e===`full_text`?1:0}function f4(e){let{lexical:t,fullText:n}=e.signals;return t>=500?`lexical`:t===450&&n<=0?`pathOnly`:`body`}function p4(e){let t=[],n=[],r=[];for(let i of e){let e=f4(i);e===`lexical`?t.length<100&&t.push(i):e===`body`?n.length<6&&n.push(i):r.length<4&&r.push(i)}return[...t,...n,...r]}function m4(e,t,n){if(t===`relevance`)return e.slice(0,n);let r=p4(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 h4(e,t,n={}){let r=n.intent??`omnibar`,i=o4(r,n.ranking),a=U2(n.limit),o=new Set(n.scopes??Q2(r)),s=e.documents.filter(e=>$2(e,o)),c=W2(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=wW(Z2(e),{term:c,properties:l4(r),boost:u4(r),tolerance:d4(r,c),limit:Math.max(a*4,40)}),u=new Map(l.hits.filter(e=>$2(e.document,o)).map(e=>[e.document.id,e.score])),d=c4(s),f=new Map;for(let e of s)t4(e,c)>=0&&f.set(e.id,e);for(let e of l.hits)$2(e.document,o)&&f.set(e.document.id,e.document);if(!n.semantic){let e=s4(f.values(),u);return m4([...f.values()].map(t=>{let n=Math.max(0,t4(t,c)),r=u.get(t.id)??0,a=d.get(t.id)??0;return{document:t,score:a4(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 m4(_4({scopedDocuments:s,candidates:f,fullTextScores:u,recency:d,normalizedQuery:c,ranking:i,semantic:n.semantic}),i,a)}function g4(e){let t=new Map;return e.forEach((e,n)=>{t.set(e,n+1)}),t}function _4(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=s4(n.values(),r),h=[...n.values()].map(e=>{let t=Math.max(0,t4(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?a4(o,t,n,s,e.kind,m):i4(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=g4(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)),_=g4(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?1:0,r=t.lexical>0?1: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 v4(e){let t=new TextEncoder().encode(e),n=new Uint8Array(1+t.length);return n[0]=1,n.set(t,1),y4(n)}function y4(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}const b4=Symbol.for(`@inkeep/open-knowledge/skill-state-field-registry`),x4=globalThis;x4[b4]===void 0&&(x4[b4]=Ii());const S4=x4[b4],C4=[`.ok`,`skill-state.yml`],w4=[`claude-cowork`,`cli-hosts`],T4=[`server-build-and-open`,`electron-build-and-open`,`cli-npx-skills-add`,`desktop-direct`,`cli-start`],E4=/^\d+\.\d+\.\d+(?:[-+][\w.-]+)?$/,D4=Ys({version:k().regex(E4,`version must match /^\\d+\\.\\d+\\.\\d+(?:[-+][\\w.-]+)?$/`).register(S4,{description:`Recorded skill version for this target.`}),recordedAt:Uo().register(S4,{description:`ISO 8601 timestamp of the most recent successful write. Updated on every write, including reinstalls of the same version.`}),surface:P(T4).register(S4,{description:`Install-source surface that recorded this entry.`}).optional()}),O4=Ys({schema:F(1).register(S4,{description:`Schema major version. Bumped only on breaking shape changes.`}),targets:Ys({"claude-cowork":D4.optional(),"cli-hosts":D4.optional()}).register(S4,{description:`Per-target install-state entries. Absent target = no recorded install.`}).default({})});function k4(){return{schema:1,targets:{}}}const A4=`template`;function j4(e){if(e.trim()===``)return{};let t;try{t=(0,Nc.parse)(e)}catch{return{}}return typeof t!=`object`||!t||Array.isArray(t)?{}:t}function M4(e,t){return e.trim()===``?t:`---\n${e}\n---\n${t}`}function N4(e){let{frontmatter:t,body:n}=UW(e);return t===``?{docFrontmatterText:``,markdown:e}:{docFrontmatterText:GW(t),markdown:n}}function P4(e){let t=e.split(`
|
|
448
448
|
`);if(!(t[0]??``).startsWith(`template:`))return null;let n=[t[0]??``],r=1;for(;r<t.length;){let e=t[r]??``;if(/^[ \t]/.test(e)){n.push(e),r++;continue}if(e.trim()===``){let i=r+1;for(;i<t.length&&(t[i]??``).trim()===``;)i++;if(i<t.length&&/^[ \t]/.test(t[i]??``)){n.push(e),r++;continue}}break}let i=j4(n.join(`
|
|
449
449
|
`))[A4];return{identity:typeof i==`object`&&i&&!Array.isArray(i)?i:{},docFrontmatterText:t.slice(r).join(`
|
|
450
|
-
`).replace(/\n+$/,``)}}function F4(e){let t=e.charCodeAt(0)===65279?e.slice(1):e,{frontmatter:n,body:r}=UW(t);if(n===``)return{identity:{},starterContent:t};let i=GW(n),a=P4(i);if(a)return{identity:a.identity,starterContent:M4(a.docFrontmatterText,r)};let{frontmatter:o}=UW(r);if(o!==``)return{identity:j4(i),starterContent:r};let s=j4(i);return typeof s.title==`string`?{identity:s,starterContent:r}:{identity:{},starterContent:M4(i,r)}}function I4(e,t){let{docFrontmatterText:n,markdown:r}=N4(t),i={};for(let[t,n]of Object.entries(e))n!==void 0&&(i[t]=n);let a=(0,Nc.stringify)({[A4]:i});return`---\n${n.trim()===``?a:`${a}${n}\n`}---\n${r}`}function L4(e){return F4(e).starterContent}function R4(){let e=!1,t=``,n=0;return r=>{let i=z4(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 z4(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}const B4=[`#D97757`,`#1B1912`,`#F9F3E9`,`#7A9DFF`,`#8534F3`,`#9663F0`,`#727CF3`],V4={claude:`#D97757`,cursor:`#1B1912`,windsurf:`#0B100F`,openai:`#7A9DFF`,github:`#8534F3`,cline:`#9663F0`,bot:`#727CF3`};function H4(e,t=B4){let n=0;for(let t of e)n=(n<<5)-n+t.charCodeAt(0)|0;return t[Math.abs(n)%t.length]}const U4={"claude-code":`claude`,"claude-ai":`claude`,cursor:`cursor`,"cursor-vscode":`cursor`,cascade:`windsurf`,codex:`openai`,"codex-mcp-client":`openai`,copilot:`github`,cline:`cline`};function W4(e){return e?U4[e]||(e.startsWith(`local-agent-mode-`)?`claude`:`bot`):`bot`}const G4={claude:`Claude`,cursor:`Cursor`,windsurf:`Windsurf`,openai:`Codex`,github:`Copilot`,cline:`Cline`};function K4(e){let t=e?.trim();return t?G4[W4(t)]??t:`Agent`}function q4(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}}const J4=/^[a-zA-Z][a-zA-Z\d+\-.]*:/;function Y4(e){let t=(e.split(/[?#]/)[0]??e).match(/\.([a-z0-9]+)$/i);return t?(t[1]??``).toLowerCase():null}function X4(e){let t=e.trim();return J4.test(t)||t.startsWith(`//`)}function Z4(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(X4(n))return{kind:`external`,url:n};let r=q4(n,t);if(r)return{kind:`doc`,docName:r.docName,anchor:r.anchor};let i=Y4(n);return i&&i!==`md`&&i!==`mdx`?{kind:`asset`,url:n,ext:i}:null}function Q4(e,t){let n=e.trim();if(!n)return null;if(X4(n))return{kind:`external`,url:t?`${n}#${t}`:n};let r=Y4(n);return r&&r!==`md`&&r!==`mdx`?{kind:`asset`,url:n,ext:r}:{kind:`doc`,docName:n,anchor:t?.trim()||null}}function $4(e,t){let n=e.trim();if(!n||J4.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 e3(e){let t=e;return t.startsWith(`./`)&&(t=t.slice(2)),t.startsWith(`/`)&&(t=t.slice(1)),t}function t3(e){let t=e.lastIndexOf(`/`);return t===-1?e:e.slice(t+1)}function n3(e){let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)}function r3(e){return e.split(`/`).filter(e=>e!==``)}function i3(e,t){let n=n3(t);return e===``||n===e?!0:n.startsWith(`${e}/`)}function a3(e,t){let n=n3(t);if(e===n)return 0;let r=e===``?n:n.slice(e.length+1);return r===``?0:r3(r).length}function o3(e,t){let n=r3(e),r=r3(t),i=0;for(;i<n.length&&i<r.length&&n[i]===r[i];)i++;return n.length-i+(r.length-i)}function s3(){let e=new Map;function t(t){let n=e3(t);if(n===``)return;let r=t3(n);if(r===``)return;let i=r.toLowerCase(),a=e.get(i);if(!a){e.set(i,[n]);return}a.includes(n)||a.push(n)}function n(t){let n=e3(t),r=t3(n).toLowerCase(),i=e.get(r);if(!i)return;let a=i.indexOf(n);a!==-1&&(i.splice(a,1),i.length===0&&e.delete(r))}function r(e,r){n(e),t(r)}function i(t,n){let r=t.toLowerCase(),i=e.get(r);if(!i||i.length===0)return null;if(i.length===1)return i[0];let a=n3(e3(n)),o=[],s=[];for(let e of i)i3(a,e)?o.push(e):s.push(e);return o.length>0?(e=>{let t=e[0],n=a3(a,t);for(let r=1;r<e.length;r++){let i=e[r],o=a3(a,i);(o<n||o===n&&i<t)&&(t=i,n=o)}return t})(o):(e=>{let t=e[0],n=o3(a,n3(t));for(let r=1;r<e.length;r++){let i=e[r],o=o3(a,n3(i));(o<n||o===n&&i<t)&&(t=i,n=o)}return t})(s)}function a(){let t=new Map;for(let[n,r]of e)t.set(n,[...r]);return t}function o(){e.clear()}return{add:t,remove:n,rename:r,resolveEmbed:i,clear:o,snapshot:a,size:()=>e.size}}function c3(e){if(!e)return[];let t=e.split(`/`),n=[],r=``;for(let e of t)r=r?`${r}/${e}`:e,n.push(r);return n}function l3(e,t){if(e.size===0)return new Set;if(t===``)return new Set(e);let n=new Set,r=`${t}/`;for(let i of e)(i===t||i.startsWith(r))&&n.add(i);return n}function u3(e){try{return process.kill(e,0),!0}catch(e){return!!(e&&typeof e==`object`&&`code`in e&&e.code===`EPERM`)}}function d3(e){return!(typeof e!=`number`||!Number.isInteger(e)||e<2||e>2147483647)}function f3(){try{let e=_(g(b(import.meta.url)),`..`,`package.json`),t=JSON.parse(d(e,`utf-8`));if(typeof t.version==`string`&&t.version.length>0)return t.version}catch{}return`0.0.0-unknown`}const p3=f3(),m3=1;var h3=class extends Error{existing;lockPath;lockName;constructor(e,t,n){super(`Open Knowledge ${n} already running on port ${e.port} (pid ${e.pid}, started ${e.startedAt}). Stop it first or use a different directory. Lock: ${t}`),this.name=`ProcessLockCollisionError`,this.existing=e,this.lockPath=t,this.lockName=n}};function g3(e,t){return _(e,`${t}.lock`)}const _3=new Map;function v3(e){_3.set(e,(_3.get(e)??0)+1)}function y3(e){let t=_3.get(e);return t===void 0||t<=1?(_3.delete(e),!0):(_3.set(e,t-1),!1)}function b3(e,t){try{let n=JSON.parse(d(e,`utf-8`));return n&&typeof n==`object`&&d3(n.pid)?n:(console.warn(`${t} Corrupt lock file at ${e} — replacing`),null)}catch{return console.warn(`${t} Corrupt lock file at ${e} — replacing`),null}}function x3(e){let{lockName:t,lockDir:n,metadata:r}=e,i=`[${t}-lock]`;l(n,{recursive:!0});let a=g3(n,t),o={pid:process.pid,hostname:y(),port:r.port,startedAt:new Date().toISOString(),worktreeRoot:r.worktreeRoot,...r.kind!==void 0&&{kind:r.kind},...r.parentPid!==void 0&&{parentPid:r.parentPid},...r.capabilities!==void 0&&{capabilities:r.capabilities},protocolVersion:r.protocolVersion??1,runtimeVersion:r.runtimeVersion??p3},d=JSON.stringify(o,null,2);for(let e=0;e<3;e++){if(!c(a))try{let e=u(a,`wx`,384);try{m(e,d)}finally{s(e)}return v3(a),S3({lockName:t,lockDir:n,lockPath:a})}catch(e){if(e.code!==`EEXIST`)throw e}let e=b3(a,i);if(e){let r=e.hostname===y();if(r&&e.pid===process.pid)return p(a,d,{encoding:`utf-8`,mode:384}),v3(a),S3({lockName:t,lockDir:n,lockPath:a});if(r&&u3(e.pid))throw new h3(e,a,t);console.warn(`${i} Stale lock detected (pid=${e.pid}, host=${e.hostname}) — replacing`)}try{f(a)}catch{}}throw Error(`${i} Failed to acquire ${a} after 3 attempts (concurrent acquire contention).`)}function S3(e){let{lockName:t,lockDir:n,lockPath:r}=e;return{lockPath:r,release:()=>E3({lockName:t,lockDir:n}),updatePort:e=>C3({lockName:t,lockDir:n,port:e})}}function C3(e){let{lockName:t,lockDir:n,port:r}=e,i=`[${t}-lock]`,a=g3(n,t);if(!c(a)){console.warn(`${i} Lock file missing at ${a} during port update — skipping`);return}let o;try{let e=JSON.parse(d(a,`utf-8`));if(!e||typeof e!=`object`||!d3(e.pid)){console.warn(`${i} Corrupt lock at ${a} during port update — skipping`);return}o=e}catch{console.warn(`${i} Unreadable lock at ${a} during port update — skipping`);return}if(o.pid===process.pid&&!(typeof o.hostname==`string`&&o.hostname!==y())){o.port=r;try{p(a,JSON.stringify(o,null,2),{encoding:`utf-8`,mode:384})}catch(e){console.warn(`${i} Failed to update port in ${a}: ${e instanceof Error?e.message:String(e)}`)}}}function w3(e){let{lockName:t,lockDir:n}=e,r=g3(n,t);if(!c(r))return null;let i;try{let e=JSON.parse(d(r,`utf-8`));if(!e||typeof e!=`object`||!d3(e.pid))return null;i=e}catch{return null}if(i.hostname!==y())return null;if(!u3(i.pid)){try{f(r)}catch{}return null}return i}function T3(e){let{lockName:t,lockDir:n}=e,r=g3(n,t);if(!c(r))return{status:`absent`};let i;try{i=JSON.parse(d(r,`utf-8`))}catch{return{status:`incompatible`,reason:`corrupt`,raw:void 0}}if(!i||typeof i!=`object`)return{status:`incompatible`,reason:`corrupt`,raw:i};let a=i;if(!d3(a.pid)||typeof a.hostname!=`string`||typeof a.port!=`number`||typeof a.startedAt!=`string`||typeof a.worktreeRoot!=`string`)return{status:`incompatible`,reason:`corrupt`,raw:i};let o={pid:a.pid,hostname:a.hostname,port:a.port,startedAt:a.startedAt,worktreeRoot:a.worktreeRoot,protocolVersion:typeof a.protocolVersion==`number`?a.protocolVersion:void 0,runtimeVersion:typeof a.runtimeVersion==`string`?a.runtimeVersion:void 0};if(o.hostname!==y())return{status:`stale`,lock:o};if(!u3(o.pid)){try{f(r)}catch{}return{status:`stale`,lock:o}}return o.protocolVersion===void 0||o.runtimeVersion===void 0?{status:`incompatible`,reason:`missing-fields`,raw:i}:{status:`live`,lock:o}}function E3(e){let{lockName:t,lockDir:n}=e,r=`[${t}-lock]`,i=g3(n,t);if(y3(i)&&c(i))try{let e=JSON.parse(d(i,`utf-8`));if(!e||typeof e!=`object`||typeof e.pid!=`number`||e.pid!==process.pid||typeof e.hostname==`string`&&e.hostname!==y())return;f(i)}catch(e){console.warn(`${r} Failed to release ${i}: ${e instanceof Error?e.message:String(e)}`)}}var D3=class extends h3{constructor(e,t){super(e,t,`server`),this.name=`ServerLockCollisionError`}};function O3(e,t){try{return x3({lockName:`server`,lockDir:e,metadata:t}).lockPath}catch(e){throw e instanceof h3&&e.lockName===`server`?new D3(e.existing,e.lockPath):e}}function k3(e,t){C3({lockName:`server`,lockDir:e,port:t})}function A3(e){return w3({lockName:`server`,lockDir:e})}function j3(e){E3({lockName:`server`,lockDir:e})}export{eK as $,cc as $i,u2 as $n,FJ as $r,v0 as $t,_1 as A,on as Aa,Df as Ai,i2 as An,nQ as Ar,S1 as At,L2 as B,wl as Bi,O2 as Bn,c3 as Br,JK as Bt,s1 as C,Ga as Ca,l3 as Ci,XG as Cn,Z4 as Cr,R1 as Ct,o1 as D,un as Da,sJ as Di,E2 as Dn,I4 as Dr,p2 as Dt,b1 as E,cn as Ea,GW as Ei,S2 as En,H4 as Er,f2 as Et,lG as F,pt as Fa,Uc as Fi,gJ as Fn,QW as Fr,NK as Ft,M2 as G,pl as Gi,Q0 as Gn,H$ as Gr,i0 as Gt,F2 as H,Jc as Hi,b0 as Hn,sG as Hr,a0 as Ht,vG as I,ft as Ia,Vc as Ii,xJ as In,K4 as Ir,a2 as It,ZG as J,nl as Ji,Z0 as Jn,W4 as Jr,t0 as Jt,j2 as K,ul as Ki,Y0 as Kn,JY as Kr,YJ as Kt,I2 as L,Bc as Li,bJ as Ln,KG as Lr,s2 as Lt,A1 as M,Tt as Ma,Cl as Mi,T2 as Mn,J2 as Mr,H1 as Mt,k1 as N,O as Na,Wc as Ni,VJ as Nn,BG as Nr,U1 as Nt,v1 as O,fn as Oa,ZW as Oi,e2 as On,s3 as Or,M1 as Ot,LJ as P,D as Pa,Hc as Pi,mJ as Pn,zG as Pr,q1 as Pt,QG as Q,Fs as Qi,A4 as Qn,cJ as Qr,T$ as Qt,B2 as R,zc as Ri,CJ as Rn,k4 as Rr,y0 as Rt,u0 as S,Wa as Sa,UW as Si,iK as Sn,PJ as Sr,kK as St,c1 as T,vr as Ta,B$ as Ti,B1 as Tn,YG as Tr,d2 as Tt,A2 as U,tl as Ui,XJ as Un,w$ as Ur,e0 as Ut,R2 as V,yl as Vi,O4 as Vn,iJ as Vr,F1 as Vt,N2 as W,Sl as Wi,X1 as Wn,J$ as Wr,r0 as Wt,nK as X,Kc as Xi,q0 as Xn,OJ as Xr,$1 as Xt,JG as Y,$c as Yi,K0 as Yn,L4 as Yr,Z1 as Yt,tK as Z,qc as Zi,J0 as Zn,VW as Zr,hK as Zt,V4 as _,Ws as _a,JW as _i,jK as _n,W1 as _r,D1 as _t,x3 as a,kc as aa,qW as ai,vK as an,_2 as ar,E0 as at,h1 as b,Vo as ba,oJ as bi,E4 as bn,oG as br,k0 as bt,d3 as c,F as ca,_K as ci,A0 as cn,m0 as cr,T0 as ct,T3 as d,N as da,tG as di,P0 as dn,d0 as dr,yK as dt,P as ea,fK as ei,g0 as en,c2 as er,$G as et,A3 as f,lc as fa,fG as fi,F0 as fn,R0 as fr,pK as ft,k3 as g,Zs as ga,h4 as gi,MK as gn,qJ as gr,L0 as gt,C3 as h,k as ha,q4 as hi,V0 as hn,JJ as hr,I0 as ht,D3 as i,j as ia,RG as ii,gK as in,x2 as ir,w1 as it,UJ as j,Lt as ja,I as ji,$0 as jn,X2 as jr,zW as jt,a1 as k,mn as ka,Ly as ki,t2 as kn,R4 as kr,x1 as kt,g3 as l,Ys as la,r1 as li,HJ as ln,f0 as lr,PK as lt,j3 as m,rc as ma,$4 as mi,B0 as mn,lK as mr,Y1 as mt,p3 as n,Hs as na,YK as ni,dK as nn,h2 as nr,BJ as nt,O3 as o,$s as oa,F4 as oi,qG as on,v2 as or,D0 as ot,E3 as p,Mc as pa,i1 as pi,G1 as pn,z0 as pr,oK as pt,k2 as q,_l as qi,X0 as qn,Xq as qr,n0 as qt,m3 as r,M as ra,hG as ri,K1 as rn,b2 as rr,C1 as rt,u3 as s,tc as sa,WW as si,M0 as sn,g2 as sr,w0 as st,h3 as t,Bs as ta,EJ as ti,h0 as tn,y2 as tr,RJ as tt,w3 as u,A as ua,pG as ui,KJ as un,p0 as ur,uK as ut,sK as v,ys as va,GG as vi,C4 as vn,NW as vr,E1 as vt,y1 as w,ai as wa,cG as wi,z1 as wn,Q4 as wr,C0 as wt,l0 as x,fa as xa,dG as xi,mK as xn,GJ as xr,cK as xt,AK as y,Uo as ya,eJ as yi,w4 as yn,MW as yr,O0 as yt,z2 as z,Tl as zi,TJ as zn,v4 as zr,aK as zt};
|
|
451
|
-
//# sourceMappingURL=server-lock-
|
|
450
|
+
`).replace(/\n+$/,``)}}function F4(e){let t=e.charCodeAt(0)===65279?e.slice(1):e,{frontmatter:n,body:r}=UW(t);if(n===``)return{identity:{},starterContent:t};let i=GW(n),a=P4(i);if(a)return{identity:a.identity,starterContent:M4(a.docFrontmatterText,r)};let{frontmatter:o}=UW(r);if(o!==``)return{identity:j4(i),starterContent:r};let s=j4(i);return typeof s.title==`string`?{identity:s,starterContent:r}:{identity:{},starterContent:M4(i,r)}}function I4(e,t){let{docFrontmatterText:n,markdown:r}=N4(t),i={};for(let[t,n]of Object.entries(e))n!==void 0&&(i[t]=n);let a=(0,Nc.stringify)({[A4]:i});return`---\n${n.trim()===``?a:`${a}${n}\n`}---\n${r}`}function L4(e){return F4(e).starterContent}function R4(){let e=!1,t=``,n=0;return r=>{let i=z4(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 z4(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}const B4=[`#D97757`,`#1B1912`,`#F9F3E9`,`#7A9DFF`,`#8534F3`,`#9663F0`,`#727CF3`],V4={claude:`#D97757`,cursor:`#1B1912`,windsurf:`#0B100F`,openai:`#7A9DFF`,github:`#8534F3`,cline:`#9663F0`,bot:`#727CF3`};function H4(e,t=B4){let n=0;for(let t of e)n=(n<<5)-n+t.charCodeAt(0)|0;return t[Math.abs(n)%t.length]}const U4={"claude-code":`claude`,"claude-ai":`claude`,cursor:`cursor`,"cursor-vscode":`cursor`,cascade:`windsurf`,codex:`openai`,"codex-mcp-client":`openai`,copilot:`github`,cline:`cline`};function W4(e){return e?U4[e]||(e.startsWith(`local-agent-mode-`)?`claude`:`bot`):`bot`}const G4={claude:`Claude`,cursor:`Cursor`,windsurf:`Windsurf`,openai:`Codex`,github:`Copilot`,cline:`Cline`};function K4(e){let t=e?.trim();return t?G4[W4(t)]??t:`Agent`}function q4(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}}const J4=/^[a-zA-Z][a-zA-Z\d+\-.]*:/;function Y4(e){let t=(e.split(/[?#]/)[0]??e).match(/\.([a-z0-9]+)$/i);return t?(t[1]??``).toLowerCase():null}function X4(e){let t=e.trim();return J4.test(t)||t.startsWith(`//`)}function Z4(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(X4(n))return{kind:`external`,url:n};let r=q4(n,t);if(r)return{kind:`doc`,docName:r.docName,anchor:r.anchor};let i=Y4(n);return i&&i!==`md`&&i!==`mdx`?{kind:`asset`,url:n,ext:i}:null}function Q4(e,t){let n=e.trim();if(!n)return null;if(X4(n))return{kind:`external`,url:t?`${n}#${t}`:n};let r=Y4(n);return r&&r!==`md`&&r!==`mdx`?{kind:`asset`,url:n,ext:r}:{kind:`doc`,docName:n,anchor:t?.trim()||null}}function $4(e,t){let n=e.trim();if(!n||J4.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 e3(e){let t=e;return t.startsWith(`./`)&&(t=t.slice(2)),t.startsWith(`/`)&&(t=t.slice(1)),t}function t3(e){let t=e.lastIndexOf(`/`);return t===-1?e:e.slice(t+1)}function n3(e){let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)}function r3(e){return e.split(`/`).filter(e=>e!==``)}function i3(e,t){let n=n3(t);return e===``||n===e?!0:n.startsWith(`${e}/`)}function a3(e,t){let n=n3(t);if(e===n)return 0;let r=e===``?n:n.slice(e.length+1);return r===``?0:r3(r).length}function o3(e,t){let n=r3(e),r=r3(t),i=0;for(;i<n.length&&i<r.length&&n[i]===r[i];)i++;return n.length-i+(r.length-i)}function s3(){let e=new Map;function t(t){let n=e3(t);if(n===``)return;let r=t3(n);if(r===``)return;let i=r.toLowerCase(),a=e.get(i);if(!a){e.set(i,[n]);return}a.includes(n)||a.push(n)}function n(t){let n=e3(t),r=t3(n).toLowerCase(),i=e.get(r);if(!i)return;let a=i.indexOf(n);a!==-1&&(i.splice(a,1),i.length===0&&e.delete(r))}function r(e,r){n(e),t(r)}function i(t,n){let r=t.toLowerCase(),i=e.get(r);if(!i||i.length===0)return null;if(i.length===1)return i[0];let a=n3(e3(n)),o=[],s=[];for(let e of i)i3(a,e)?o.push(e):s.push(e);return o.length>0?(e=>{let t=e[0],n=a3(a,t);for(let r=1;r<e.length;r++){let i=e[r],o=a3(a,i);(o<n||o===n&&i<t)&&(t=i,n=o)}return t})(o):(e=>{let t=e[0],n=o3(a,n3(t));for(let r=1;r<e.length;r++){let i=e[r],o=o3(a,n3(i));(o<n||o===n&&i<t)&&(t=i,n=o)}return t})(s)}function a(){let t=new Map;for(let[n,r]of e)t.set(n,[...r]);return t}function o(){e.clear()}return{add:t,remove:n,rename:r,resolveEmbed:i,clear:o,snapshot:a,size:()=>e.size}}function c3(e){if(!e)return[];let t=e.split(`/`),n=[],r=``;for(let e of t)r=r?`${r}/${e}`:e,n.push(r);return n}function l3(e,t){if(e.size===0)return new Set;if(t===``)return new Set(e);let n=new Set,r=`${t}/`;for(let i of e)(i===t||i.startsWith(r))&&n.add(i);return n}function u3(e){try{return process.kill(e,0),!0}catch(e){return!!(e&&typeof e==`object`&&`code`in e&&e.code===`EPERM`)}}function d3(e){return!(typeof e!=`number`||!Number.isInteger(e)||e<2||e>2147483647)}function f3(){try{let e=_(g(b(import.meta.url)),`..`,`package.json`),t=JSON.parse(d(e,`utf-8`));if(typeof t.version==`string`&&t.version.length>0)return t.version}catch{}return`0.0.0-unknown`}const p3=f3(),m3=1;var h3=class extends Error{existing;lockPath;lockName;constructor(e,t,n){super(`OpenKnowledge ${n} already running on port ${e.port} (pid ${e.pid}, started ${e.startedAt}). Stop it first or use a different directory. Lock: ${t}`),this.name=`ProcessLockCollisionError`,this.existing=e,this.lockPath=t,this.lockName=n}};function g3(e,t){return _(e,`${t}.lock`)}const _3=new Map;function v3(e){_3.set(e,(_3.get(e)??0)+1)}function y3(e){let t=_3.get(e);return t===void 0||t<=1?(_3.delete(e),!0):(_3.set(e,t-1),!1)}function b3(e,t){try{let n=JSON.parse(d(e,`utf-8`));return n&&typeof n==`object`&&d3(n.pid)?n:(console.warn(`${t} Corrupt lock file at ${e} — replacing`),null)}catch{return console.warn(`${t} Corrupt lock file at ${e} — replacing`),null}}function x3(e){let{lockName:t,lockDir:n,metadata:r}=e,i=`[${t}-lock]`;l(n,{recursive:!0});let a=g3(n,t),o={pid:process.pid,hostname:y(),port:r.port,startedAt:new Date().toISOString(),worktreeRoot:r.worktreeRoot,...r.kind!==void 0&&{kind:r.kind},...r.parentPid!==void 0&&{parentPid:r.parentPid},...r.capabilities!==void 0&&{capabilities:r.capabilities},protocolVersion:r.protocolVersion??1,runtimeVersion:r.runtimeVersion??p3},d=JSON.stringify(o,null,2);for(let e=0;e<3;e++){if(!c(a))try{let e=u(a,`wx`,384);try{m(e,d)}finally{s(e)}return v3(a),S3({lockName:t,lockDir:n,lockPath:a})}catch(e){if(e.code!==`EEXIST`)throw e}let e=b3(a,i);if(e){let r=e.hostname===y();if(r&&e.pid===process.pid)return p(a,d,{encoding:`utf-8`,mode:384}),v3(a),S3({lockName:t,lockDir:n,lockPath:a});if(r&&u3(e.pid))throw new h3(e,a,t);console.warn(`${i} Stale lock detected (pid=${e.pid}, host=${e.hostname}) — replacing`)}try{f(a)}catch{}}throw Error(`${i} Failed to acquire ${a} after 3 attempts (concurrent acquire contention).`)}function S3(e){let{lockName:t,lockDir:n,lockPath:r}=e;return{lockPath:r,release:()=>E3({lockName:t,lockDir:n}),updatePort:e=>C3({lockName:t,lockDir:n,port:e})}}function C3(e){let{lockName:t,lockDir:n,port:r}=e,i=`[${t}-lock]`,a=g3(n,t);if(!c(a)){console.warn(`${i} Lock file missing at ${a} during port update — skipping`);return}let o;try{let e=JSON.parse(d(a,`utf-8`));if(!e||typeof e!=`object`||!d3(e.pid)){console.warn(`${i} Corrupt lock at ${a} during port update — skipping`);return}o=e}catch{console.warn(`${i} Unreadable lock at ${a} during port update — skipping`);return}if(o.pid===process.pid&&!(typeof o.hostname==`string`&&o.hostname!==y())){o.port=r;try{p(a,JSON.stringify(o,null,2),{encoding:`utf-8`,mode:384})}catch(e){console.warn(`${i} Failed to update port in ${a}: ${e instanceof Error?e.message:String(e)}`)}}}function w3(e){let{lockName:t,lockDir:n}=e,r=g3(n,t);if(!c(r))return null;let i;try{let e=JSON.parse(d(r,`utf-8`));if(!e||typeof e!=`object`||!d3(e.pid))return null;i=e}catch{return null}if(i.hostname!==y())return null;if(!u3(i.pid)){try{f(r)}catch{}return null}return i}function T3(e){let{lockName:t,lockDir:n}=e,r=g3(n,t);if(!c(r))return{status:`absent`};let i;try{i=JSON.parse(d(r,`utf-8`))}catch{return{status:`incompatible`,reason:`corrupt`,raw:void 0}}if(!i||typeof i!=`object`)return{status:`incompatible`,reason:`corrupt`,raw:i};let a=i;if(!d3(a.pid)||typeof a.hostname!=`string`||typeof a.port!=`number`||typeof a.startedAt!=`string`||typeof a.worktreeRoot!=`string`)return{status:`incompatible`,reason:`corrupt`,raw:i};let o={pid:a.pid,hostname:a.hostname,port:a.port,startedAt:a.startedAt,worktreeRoot:a.worktreeRoot,protocolVersion:typeof a.protocolVersion==`number`?a.protocolVersion:void 0,runtimeVersion:typeof a.runtimeVersion==`string`?a.runtimeVersion:void 0};if(o.hostname!==y())return{status:`stale`,lock:o};if(!u3(o.pid)){try{f(r)}catch{}return{status:`stale`,lock:o}}return o.protocolVersion===void 0||o.runtimeVersion===void 0?{status:`incompatible`,reason:`missing-fields`,raw:i}:{status:`live`,lock:o}}function E3(e){let{lockName:t,lockDir:n}=e,r=`[${t}-lock]`,i=g3(n,t);if(y3(i)&&c(i))try{let e=JSON.parse(d(i,`utf-8`));if(!e||typeof e!=`object`||typeof e.pid!=`number`||e.pid!==process.pid||typeof e.hostname==`string`&&e.hostname!==y())return;f(i)}catch(e){console.warn(`${r} Failed to release ${i}: ${e instanceof Error?e.message:String(e)}`)}}var D3=class extends h3{constructor(e,t){super(e,t,`server`),this.name=`ServerLockCollisionError`}};function O3(e,t){try{return x3({lockName:`server`,lockDir:e,metadata:t}).lockPath}catch(e){throw e instanceof h3&&e.lockName===`server`?new D3(e.existing,e.lockPath):e}}function k3(e,t){C3({lockName:`server`,lockDir:e,port:t})}function A3(e){return w3({lockName:`server`,lockDir:e})}function j3(e){E3({lockName:`server`,lockDir:e})}export{eK as $,cc as $i,u2 as $n,FJ as $r,v0 as $t,_1 as A,on as Aa,Df as Ai,i2 as An,nQ as Ar,S1 as At,L2 as B,wl as Bi,O2 as Bn,c3 as Br,JK as Bt,s1 as C,Ga as Ca,l3 as Ci,XG as Cn,Z4 as Cr,R1 as Ct,o1 as D,un as Da,sJ as Di,E2 as Dn,I4 as Dr,p2 as Dt,b1 as E,cn as Ea,GW as Ei,S2 as En,H4 as Er,f2 as Et,lG as F,pt as Fa,Uc as Fi,gJ as Fn,QW as Fr,NK as Ft,M2 as G,pl as Gi,Q0 as Gn,H$ as Gr,i0 as Gt,F2 as H,Jc as Hi,b0 as Hn,sG as Hr,a0 as Ht,vG as I,ft as Ia,Vc as Ii,xJ as In,K4 as Ir,a2 as It,ZG as J,nl as Ji,Z0 as Jn,W4 as Jr,t0 as Jt,j2 as K,ul as Ki,Y0 as Kn,JY as Kr,YJ as Kt,I2 as L,Bc as Li,bJ as Ln,KG as Lr,s2 as Lt,A1 as M,Tt as Ma,Cl as Mi,T2 as Mn,J2 as Mr,H1 as Mt,k1 as N,O as Na,Wc as Ni,VJ as Nn,BG as Nr,U1 as Nt,v1 as O,fn as Oa,ZW as Oi,e2 as On,s3 as Or,M1 as Ot,LJ as P,D as Pa,Hc as Pi,mJ as Pn,zG as Pr,q1 as Pt,QG as Q,Fs as Qi,A4 as Qn,cJ as Qr,T$ as Qt,B2 as R,zc as Ri,CJ as Rn,k4 as Rr,y0 as Rt,u0 as S,Wa as Sa,UW as Si,iK as Sn,PJ as Sr,kK as St,c1 as T,vr as Ta,B$ as Ti,B1 as Tn,YG as Tr,d2 as Tt,A2 as U,tl as Ui,XJ as Un,w$ as Ur,e0 as Ut,R2 as V,yl as Vi,O4 as Vn,iJ as Vr,F1 as Vt,N2 as W,Sl as Wi,X1 as Wn,J$ as Wr,r0 as Wt,nK as X,Kc as Xi,q0 as Xn,OJ as Xr,$1 as Xt,JG as Y,$c as Yi,K0 as Yn,L4 as Yr,Z1 as Yt,tK as Z,qc as Zi,J0 as Zn,VW as Zr,hK as Zt,V4 as _,Ws as _a,JW as _i,jK as _n,W1 as _r,D1 as _t,x3 as a,kc as aa,qW as ai,vK as an,_2 as ar,E0 as at,h1 as b,Vo as ba,oJ as bi,E4 as bn,oG as br,k0 as bt,d3 as c,F as ca,_K as ci,A0 as cn,m0 as cr,T0 as ct,T3 as d,N as da,tG as di,P0 as dn,d0 as dr,yK as dt,P as ea,fK as ei,g0 as en,c2 as er,$G as et,A3 as f,lc as fa,fG as fi,F0 as fn,R0 as fr,pK as ft,k3 as g,Zs as ga,h4 as gi,MK as gn,qJ as gr,L0 as gt,C3 as h,k as ha,q4 as hi,V0 as hn,JJ as hr,I0 as ht,D3 as i,j as ia,RG as ii,gK as in,x2 as ir,w1 as it,UJ as j,Lt as ja,I as ji,$0 as jn,X2 as jr,zW as jt,a1 as k,mn as ka,Ly as ki,t2 as kn,R4 as kr,x1 as kt,g3 as l,Ys as la,r1 as li,HJ as ln,f0 as lr,PK as lt,j3 as m,rc as ma,$4 as mi,B0 as mn,lK as mr,Y1 as mt,p3 as n,Hs as na,YK as ni,dK as nn,h2 as nr,BJ as nt,O3 as o,$s as oa,F4 as oi,qG as on,v2 as or,D0 as ot,E3 as p,Mc as pa,i1 as pi,G1 as pn,z0 as pr,oK as pt,k2 as q,_l as qi,X0 as qn,Xq as qr,n0 as qt,m3 as r,M as ra,hG as ri,K1 as rn,b2 as rr,C1 as rt,u3 as s,tc as sa,WW as si,M0 as sn,g2 as sr,w0 as st,h3 as t,Bs as ta,EJ as ti,h0 as tn,y2 as tr,RJ as tt,w3 as u,A as ua,pG as ui,KJ as un,p0 as ur,uK as ut,sK as v,ys as va,GG as vi,C4 as vn,NW as vr,E1 as vt,y1 as w,ai as wa,cG as wi,z1 as wn,Q4 as wr,C0 as wt,l0 as x,fa as xa,dG as xi,mK as xn,GJ as xr,cK as xt,AK as y,Uo as ya,eJ as yi,w4 as yn,MW as yr,O0 as yt,z2 as z,Tl as zi,TJ as zn,v4 as zr,aK as zt};
|
|
451
|
+
//# sourceMappingURL=server-lock-CN2YHwpP-Cvbk69Pj.mjs.map
|