@inkeep/open-knowledge 0.0.0-dev-20260501150416 → 0.0.0-dev-20260501181216

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/dist/cli.mjs +6 -6
  2. package/dist/config-schema.json +25 -0
  3. package/dist/config.project.schema.json +25 -0
  4. package/dist/config.user.schema.json +25 -0
  5. package/dist/constants-BnNhFY0P.mjs +2 -0
  6. package/dist/{dist-oDoSs1Bl.mjs → dist-BmX1Ns7C.mjs} +2 -2
  7. package/dist/{dist-B969m3rv.mjs → dist-C5mH5cvM.mjs} +1 -1
  8. package/dist/{dist-BR3nldpO.mjs → dist-CQ3cd3s_.mjs} +7 -8
  9. package/dist/index.d.mts +9 -0
  10. package/dist/index.mjs +1 -1
  11. package/dist/{init-B3ijkT7_.mjs → init-CAeQdWL6.mjs} +3 -3
  12. package/dist/init-CCYsXS_y.mjs +1 -0
  13. package/dist/init-CIM4I1tW.mjs +1 -0
  14. package/dist/{init-Czgpyj7J.mjs → init-DHwfj3AW.mjs} +2 -2
  15. package/dist/{loader-Dk5RaTzD.mjs → loader-CC_RQ-w2.mjs} +2 -2
  16. package/dist/loader-DqreB0_J.mjs +1 -0
  17. package/dist/paths-1NW3UxwQ.mjs +1 -0
  18. package/dist/paths-BwrGhrga.mjs +2 -0
  19. package/dist/{preview-BkLJiEZ1.mjs → preview-B-rYWHOQ.mjs} +2 -2
  20. package/dist/preview-Sf_RYYpl.mjs +1 -0
  21. package/dist/public/assets/{ActivityModeContent-BASIn1jX.js → ActivityModeContent-Cdl0frU2.js} +1 -1
  22. package/dist/public/assets/{DocumentContext-CSOslMNT.js → DocumentContext-BRyrYElZ.js} +9 -9
  23. package/dist/public/assets/{GraphPanel-D2ZevzyI.js → GraphPanel-BH5vs7kB.js} +1 -1
  24. package/dist/public/assets/{McpConsentDialogBody-Dx67JoKA.js → McpConsentDialogBody-CI9rAMX9.js} +1 -1
  25. package/dist/public/assets/{OutlinePanel-D_xYEkm6.js → OutlinePanel-BcdH74Qw.js} +1 -1
  26. package/dist/public/assets/SettingsPane-rdUN7cCp.js +6 -0
  27. package/dist/public/assets/{SourceEditor-Bw3inYl7.js → SourceEditor-Df4RyC-2.js} +2 -2
  28. package/dist/public/assets/{config-validation-events-mqmIrycG.js → config-validation-events-CWaXc07D.js} +1 -1
  29. package/dist/public/assets/index-DN_1M53F.js +1850 -0
  30. package/dist/public/assets/{target-navigation-intent-1238Z_HW.js → target-navigation-intent-CIITpiPs.js} +1 -1
  31. package/dist/public/assets/{toggle-group-C5MXNna8.js → toggle-group-1sl8rMnA.js} +1 -1
  32. package/dist/public/assets/{tooltip-CzI9zWJi.js → tooltip-CFeKxs4p.js} +1 -1
  33. package/dist/public/index.html +8 -8
  34. package/dist/schemas/v0/config.project.schema.json +25 -0
  35. package/dist/schemas/v0/config.user.schema.json +25 -0
  36. package/dist/{server-Cb1yd7Zc.mjs → server-CJdOKLcU.mjs} +2 -2
  37. package/dist/src-8G0QyHkY.mjs +1 -0
  38. package/dist/start-BlAW3ifD.mjs +1 -0
  39. package/dist/{start-_eaR3T65.mjs → start-CrKpyaZC.mjs} +2 -2
  40. package/package.json +1 -1
  41. package/dist/constants-CGiUuTdz.mjs +0 -2
  42. package/dist/init-0WpsEJer.mjs +0 -1
  43. package/dist/init-BRl7X3F9.mjs +0 -1
  44. package/dist/loader-Jnb82Nxh.mjs +0 -1
  45. package/dist/paths-NLm46qS1.mjs +0 -2
  46. package/dist/paths-s1VdY11r.mjs +0 -1
  47. package/dist/preview-DFbaN55s.mjs +0 -1
  48. package/dist/public/assets/SettingsPane-o4hmcrlw.js +0 -6
  49. package/dist/public/assets/index-CRwvkGXF.js +0 -1848
  50. package/dist/src-BtSrIQfg.mjs +0 -1
  51. package/dist/start-RBQezJG7.mjs +0 -1
  52. /package/dist/public/assets/{mcp-consent-store-BBTXqzE6.js → mcp-consent-store-B9QLSyUV.js} +0 -0
@@ -1 +1 @@
1
- import{f as e}from"./toggle-group-C5MXNna8.js";import{S as t}from"./button-Dyz7QGIk.js";var n=t(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),r=t(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]);function i(e){switch(e.kind){case`doc`:return`doc`;case`folder`:case`folder-index`:return`folder`;case`missing`:return`missing`}}function a(t,n){let r=e(t,n);return{resolvedTarget:r,hashDocName:r.target,displayState:i(r)}}export{r as n,n as r,a as t};
1
+ import{f as e}from"./toggle-group-1sl8rMnA.js";import{S as t}from"./button-Dyz7QGIk.js";var n=t(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),r=t(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]);function i(e){switch(e.kind){case`doc`:return`doc`;case`folder`:case`folder-index`:return`folder`;case`missing`:return`missing`}}function a(t,n){let r=e(t,n);return{resolvedTarget:r,hashDocName:r.target,displayState:i(r)}}export{r as n,n as r,a as t};
@@ -243,7 +243,7 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\
243
243
 
244
244
  `)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=_b,s=!nb.jitless,c=s&&vb.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?zS([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function HS(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=>!Nb(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=>Ib(e,r,rb())))}),t)}var US=L(`$ZodUnion`,(e,t)=>{eS.init(e,t),db(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),db(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),db(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),db(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=>cb(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=>HS(t,i,e,a)):HS(s,i,e,a)}}),WS=L(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,US.init(e,t);let n=e._zod.parse;db(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=ob(()=>{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(!_b(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)}}),GS=L(`$ZodIntersection`,(e,t)=>{eS.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])=>qS(e,t,n)):qS(e,i,a)}});function KS(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(yb(e)&&yb(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=KS(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=KS(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 qS(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}),Nb(e))return e;let o=KS(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var JS=L(`$ZodRecord`,(e,t)=>{eS.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!yb(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(...Pb(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...Pb(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`&&Ax.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=>Ib(e,r,rb())),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(...Pb(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...Pb(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),YS=L(`$ZodEnum`,(e,t)=>{eS.init(e,t);let n=ib(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>xb.has(typeof e)).map(e=>typeof e==`string`?Sb(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}}),XS=L(`$ZodLiteral`,(e,t)=>{if(eS.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`?Sb(e):e?Sb(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}}),ZS=L(`$ZodTransform`,(e,t)=>{eS.init(e,t),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new tb(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 eb;return n.value=i,n}});function QS(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}var $S=L(`$ZodOptional`,(e,t)=>{eS.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,db(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),db(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${cb(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=>QS(t,e.value)):QS(r,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),eC=L(`$ZodExactOptional`,(e,t)=>{$S.init(e,t),db(e._zod,`values`,()=>t.innerType._zod.values),db(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),tC=L(`$ZodNullable`,(e,t)=>{eS.init(e,t),db(e._zod,`optin`,()=>t.innerType._zod.optin),db(e._zod,`optout`,()=>t.innerType._zod.optout),db(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${cb(e.source)}|null)$`):void 0}),db(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)}),nC=L(`$ZodDefault`,(e,t)=>{eS.init(e,t),e._zod.optin=`optional`,db(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=>rC(e,t)):rC(r,t)}});function rC(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var iC=L(`$ZodPrefault`,(e,t)=>{eS.init(e,t),e._zod.optin=`optional`,db(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))}),aC=L(`$ZodNonOptional`,(e,t)=>{eS.init(e,t),db(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=>oC(t,e)):oC(i,e)}});function oC(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var sC=L(`$ZodCatch`,(e,t)=>{eS.init(e,t),db(e._zod,`optin`,()=>t.innerType._zod.optin),db(e._zod,`optout`,()=>t.innerType._zod.optout),db(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=>Ib(e,n,rb()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>Ib(e,n,rb()))},input:e.value}),e.issues=[]),e)}}),cC=L(`$ZodPipe`,(e,t)=>{eS.init(e,t),db(e._zod,`values`,()=>t.in._zod.values),db(e._zod,`optin`,()=>t.in._zod.optin),db(e._zod,`optout`,()=>t.out._zod.optout),db(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=>lC(e,t.in,n)):lC(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>lC(e,t.out,n)):lC(r,t.out,n)}});function lC(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var uC=L(`$ZodReadonly`,(e,t)=>{eS.init(e,t),db(e._zod,`propValues`,()=>t.innerType._zod.propValues),db(e._zod,`values`,()=>t.innerType._zod.values),db(e._zod,`optin`,()=>t.innerType?._zod?.optin),db(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(dC):dC(r)}});function dC(e){return e.value=Object.freeze(e.value),e}var fC=L(`$ZodCustom`,(e,t)=>{Fx.init(e,t),eS.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=>pC(t,n,r,e));pC(i,n,r,e)}});function pC(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(Rb(e))}}var mC,hC=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 gC(){return new hC}(mC=globalThis).__zod_globalRegistry??(mC.__zod_globalRegistry=gC());var _C=globalThis.__zod_globalRegistry;function vC(e,t){return new e({type:`string`,...R(t)})}function yC(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...R(t)})}function bC(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...R(t)})}function xC(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...R(t)})}function SC(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...R(t)})}function CC(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...R(t)})}function wC(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...R(t)})}function TC(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...R(t)})}function EC(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...R(t)})}function DC(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...R(t)})}function OC(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...R(t)})}function kC(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...R(t)})}function AC(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...R(t)})}function jC(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...R(t)})}function MC(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...R(t)})}function NC(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...R(t)})}function PC(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...R(t)})}function FC(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...R(t)})}function IC(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...R(t)})}function LC(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...R(t)})}function RC(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...R(t)})}function zC(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...R(t)})}function BC(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...R(t)})}function VC(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...R(t)})}function HC(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...R(t)})}function UC(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...R(t)})}function WC(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...R(t)})}function GC(e,t){return new e({type:`number`,checks:[],...R(t)})}function KC(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...R(t)})}function qC(e,t){return new e({type:`boolean`,...R(t)})}function JC(e,t){return new e({type:`null`,...R(t)})}function YC(e){return new e({type:`unknown`})}function XC(e,t){return new e({type:`never`,...R(t)})}function ZC(e,t){return new Lx({check:`less_than`,...R(t),value:e,inclusive:!1})}function QC(e,t){return new Lx({check:`less_than`,...R(t),value:e,inclusive:!0})}function $C(e,t){return new Rx({check:`greater_than`,...R(t),value:e,inclusive:!1})}function ew(e,t){return new Rx({check:`greater_than`,...R(t),value:e,inclusive:!0})}function tw(e,t){return new zx({check:`multiple_of`,...R(t),value:e})}function nw(e,t){return new Vx({check:`max_length`,...R(t),maximum:e})}function rw(e,t){return new Hx({check:`min_length`,...R(t),minimum:e})}function iw(e,t){return new Ux({check:`length_equals`,...R(t),length:e})}function aw(e,t){return new Gx({check:`string_format`,format:`regex`,...R(t),pattern:e})}function ow(e){return new Kx({check:`string_format`,format:`lowercase`,...R(e)})}function sw(e){return new qx({check:`string_format`,format:`uppercase`,...R(e)})}function cw(e,t){return new Jx({check:`string_format`,format:`includes`,...R(t),includes:e})}function lw(e,t){return new Yx({check:`string_format`,format:`starts_with`,...R(t),prefix:e})}function uw(e,t){return new Xx({check:`string_format`,format:`ends_with`,...R(t),suffix:e})}function dw(e){return new Zx({check:`overwrite`,tx:e})}function fw(e){return dw(t=>t.normalize(e))}function pw(){return dw(e=>e.trim())}function mw(){return dw(e=>e.toLowerCase())}function hw(){return dw(e=>e.toUpperCase())}function gw(){return dw(e=>hb(e))}function _w(e,t,n){return new e({type:`array`,element:t,...R(n)})}function vw(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...R(n)})}function yw(e){let t=bw(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push(Rb(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(Rb(r))}},e(n.value,n)));return t}function bw(e,t){let n=new Fx({check:`custom`,...R(t)});return n._zod.check=e,n}function xw(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??_C,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 Sw(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,Sw(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`&&Tw(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 Cw(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>
245
245
 
246
- 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 ww(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:Dw(t,`input`,e.processors),output:Dw(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function Tw(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 Tw(r.element,n);if(r.type===`set`)return Tw(r.valueType,n);if(r.type===`lazy`)return Tw(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 Tw(r.innerType,n);if(r.type===`intersection`)return Tw(r.left,n)||Tw(r.right,n);if(r.type===`record`||r.type===`map`)return Tw(r.keyType,n)||Tw(r.valueType,n);if(r.type===`pipe`)return Tw(r.in,n)||Tw(r.out,n);if(r.type===`object`){for(let e in r.shape)if(Tw(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(Tw(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(Tw(e,n))return!0;return!!(r.rest&&Tw(r.rest,n))}return!1}var Ew=(e,t={})=>n=>{let r=xw({...n,processors:t});return Sw(e,r),Cw(r,e),ww(r,e)},Dw=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=xw({...i??{},target:a,io:t,processors:n});return Sw(e,o),Cw(o,e),ww(o,e)},Ow={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},kw=(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=Ow[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}))])}},Aw=(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)},jw=(e,t,n,r)=>{n.type=`boolean`},Mw=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},Nw=(e,t,n,r)=>{n.not={}},Pw=(e,t,n,r)=>{let i=e._zod.def,a=ib(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},Fw=(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},Iw=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},Lw=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},Rw=(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=Sw(a.element,t,{...r,path:[...r.path,`items`]})},zw=(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]=Sw(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=Sw(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Bw=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>Sw(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Vw=(e,t,n,r)=>{let i=e._zod.def,a=Sw(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=Sw(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]]},Hw=(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=Sw(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=Sw(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=Sw(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)}},Uw=(e,t,n,r)=>{let i=e._zod.def,a=Sw(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`}]},Ww=(e,t,n,r)=>{let i=e._zod.def;Sw(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Gw=(e,t,n,r)=>{let i=e._zod.def;Sw(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Kw=(e,t,n,r)=>{let i=e._zod.def;Sw(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)))},qw=(e,t,n,r)=>{let i=e._zod.def;Sw(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},Jw=(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;Sw(a,t,r);let o=t.seen.get(e);o.ref=a},Yw=(e,t,n,r)=>{let i=e._zod.def;Sw(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Xw=(e,t,n,r)=>{let i=e._zod.def;Sw(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Zw=L(`ZodISODateTime`,(e,t)=>{mS.init(e,t),ST.init(e,t)});function Qw(e){return VC(Zw,e)}var $w=L(`ZodISODate`,(e,t)=>{hS.init(e,t),ST.init(e,t)});function eT(e){return HC($w,e)}var tT=L(`ZodISOTime`,(e,t)=>{gS.init(e,t),ST.init(e,t)});function nT(e){return UC(tT,e)}var rT=L(`ZodISODuration`,(e,t)=>{_S.init(e,t),ST.init(e,t)});function iT(e){return WC(rT,e)}var aT=(e,t)=>{Bb.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Ub(e,t)},flatten:{value:t=>Hb(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,ab,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,ab,2)}},isEmpty:{get(){return e.issues.length===0}}})};L(`ZodError`,aT);var oT=L(`ZodError`,aT,{Parent:Error}),sT=Wb(oT),cT=Gb(oT),lT=Kb(oT),uT=Jb(oT),dT=Xb(oT),fT=Zb(oT),pT=Qb(oT),mT=$b(oT),hT=ex(oT),gT=tx(oT),_T=nx(oT),vT=rx(oT),yT=L(`ZodType`,(e,t)=>(eS.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:Dw(e,`input`),output:Dw(e,`output`)}}),e.toJSONSchema=Ew(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,`_def`,{value:t}),e.check=(...n)=>e.clone(pb(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)=>Cb(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>sT(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>lT(e,t,n),e.parseAsync=async(t,n)=>cT(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>uT(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>dT(e,t,n),e.decode=(t,n)=>fT(e,t,n),e.encodeAsync=async(t,n)=>pT(e,t,n),e.decodeAsync=async(t,n)=>mT(e,t,n),e.safeEncode=(t,n)=>hT(e,t,n),e.safeDecode=(t,n)=>gT(e,t,n),e.safeEncodeAsync=async(t,n)=>_T(e,t,n),e.safeDecodeAsync=async(t,n)=>vT(e,t,n),e.refine=(t,n)=>e.check(zE(t,n)),e.superRefine=t=>e.check(BE(t)),e.overwrite=t=>e.check(dw(t)),e.optional=()=>xE(e),e.exactOptional=()=>CE(e),e.nullable=()=>TE(e),e.nullish=()=>xE(TE(e)),e.nonoptional=t=>jE(e,t),e.array=()=>nE(e),e.or=t=>sE([e,t]),e.and=t=>dE(e,t),e.transform=t=>FE(e,yE(t)),e.default=t=>DE(e,t),e.prefault=t=>kE(e,t),e.catch=t=>NE(e,t),e.pipe=t=>FE(e,t),e.readonly=()=>LE(e),e.describe=t=>{let n=e.clone();return _C.add(n,{description:t}),n},Object.defineProperty(e,`description`,{get(){return _C.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return _C.get(e);let n=e.clone();return _C.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),bT=L(`_ZodString`,(e,t)=>{tS.init(e,t),yT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>kw(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(aw(...t)),e.includes=(...t)=>e.check(cw(...t)),e.startsWith=(...t)=>e.check(lw(...t)),e.endsWith=(...t)=>e.check(uw(...t)),e.min=(...t)=>e.check(rw(...t)),e.max=(...t)=>e.check(nw(...t)),e.length=(...t)=>e.check(iw(...t)),e.nonempty=(...t)=>e.check(rw(1,...t)),e.lowercase=t=>e.check(ow(t)),e.uppercase=t=>e.check(sw(t)),e.trim=()=>e.check(pw()),e.normalize=(...t)=>e.check(fw(...t)),e.toLowerCase=()=>e.check(mw()),e.toUpperCase=()=>e.check(hw()),e.slugify=()=>e.check(gw())}),xT=L(`ZodString`,(e,t)=>{tS.init(e,t),bT.init(e,t),e.email=t=>e.check(yC(CT,t)),e.url=t=>e.check(TC(ET,t)),e.jwt=t=>e.check(BC(HT,t)),e.emoji=t=>e.check(EC(OT,t)),e.guid=t=>e.check(bC(wT,t)),e.uuid=t=>e.check(xC(TT,t)),e.uuidv4=t=>e.check(SC(TT,t)),e.uuidv6=t=>e.check(CC(TT,t)),e.uuidv7=t=>e.check(wC(TT,t)),e.nanoid=t=>e.check(DC(kT,t)),e.guid=t=>e.check(bC(wT,t)),e.cuid=t=>e.check(OC(AT,t)),e.cuid2=t=>e.check(kC(jT,t)),e.ulid=t=>e.check(AC(MT,t)),e.base64=t=>e.check(LC(zT,t)),e.base64url=t=>e.check(RC(BT,t)),e.xid=t=>e.check(jC(NT,t)),e.ksuid=t=>e.check(MC(PT,t)),e.ipv4=t=>e.check(NC(FT,t)),e.ipv6=t=>e.check(PC(IT,t)),e.cidrv4=t=>e.check(FC(LT,t)),e.cidrv6=t=>e.check(IC(RT,t)),e.e164=t=>e.check(zC(VT,t)),e.datetime=t=>e.check(Qw(t)),e.date=t=>e.check(eT(t)),e.time=t=>e.check(nT(t)),e.duration=t=>e.check(iT(t))});function z(e){return vC(xT,e)}var ST=L(`ZodStringFormat`,(e,t)=>{nS.init(e,t),bT.init(e,t)}),CT=L(`ZodEmail`,(e,t)=>{aS.init(e,t),ST.init(e,t)}),wT=L(`ZodGUID`,(e,t)=>{rS.init(e,t),ST.init(e,t)}),TT=L(`ZodUUID`,(e,t)=>{iS.init(e,t),ST.init(e,t)}),ET=L(`ZodURL`,(e,t)=>{oS.init(e,t),ST.init(e,t)});function DT(e){return TC(ET,e)}var OT=L(`ZodEmoji`,(e,t)=>{sS.init(e,t),ST.init(e,t)}),kT=L(`ZodNanoID`,(e,t)=>{cS.init(e,t),ST.init(e,t)}),AT=L(`ZodCUID`,(e,t)=>{lS.init(e,t),ST.init(e,t)}),jT=L(`ZodCUID2`,(e,t)=>{uS.init(e,t),ST.init(e,t)}),MT=L(`ZodULID`,(e,t)=>{dS.init(e,t),ST.init(e,t)}),NT=L(`ZodXID`,(e,t)=>{fS.init(e,t),ST.init(e,t)}),PT=L(`ZodKSUID`,(e,t)=>{pS.init(e,t),ST.init(e,t)}),FT=L(`ZodIPv4`,(e,t)=>{vS.init(e,t),ST.init(e,t)}),IT=L(`ZodIPv6`,(e,t)=>{yS.init(e,t),ST.init(e,t)}),LT=L(`ZodCIDRv4`,(e,t)=>{bS.init(e,t),ST.init(e,t)}),RT=L(`ZodCIDRv6`,(e,t)=>{xS.init(e,t),ST.init(e,t)}),zT=L(`ZodBase64`,(e,t)=>{CS.init(e,t),ST.init(e,t)}),BT=L(`ZodBase64URL`,(e,t)=>{TS.init(e,t),ST.init(e,t)}),VT=L(`ZodE164`,(e,t)=>{ES.init(e,t),ST.init(e,t)}),HT=L(`ZodJWT`,(e,t)=>{OS.init(e,t),ST.init(e,t)}),UT=L(`ZodNumber`,(e,t)=>{kS.init(e,t),yT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Aw(e,t,n,r),e.gt=(t,n)=>e.check($C(t,n)),e.gte=(t,n)=>e.check(ew(t,n)),e.min=(t,n)=>e.check(ew(t,n)),e.lt=(t,n)=>e.check(ZC(t,n)),e.lte=(t,n)=>e.check(QC(t,n)),e.max=(t,n)=>e.check(QC(t,n)),e.int=t=>e.check(KT(t)),e.safe=t=>e.check(KT(t)),e.positive=t=>e.check($C(0,t)),e.nonnegative=t=>e.check(ew(0,t)),e.negative=t=>e.check(ZC(0,t)),e.nonpositive=t=>e.check(QC(0,t)),e.multipleOf=(t,n)=>e.check(tw(t,n)),e.step=(t,n)=>e.check(tw(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 WT(e){return GC(UT,e)}var GT=L(`ZodNumberFormat`,(e,t)=>{AS.init(e,t),UT.init(e,t)});function KT(e){return KC(GT,e)}var qT=L(`ZodBoolean`,(e,t)=>{jS.init(e,t),yT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jw(e,t,n,r)});function JT(e){return qC(qT,e)}var YT=L(`ZodNull`,(e,t)=>{MS.init(e,t),yT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mw(e,t,n,r)});function XT(e){return JC(YT,e)}var ZT=L(`ZodUnknown`,(e,t)=>{NS.init(e,t),yT.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function QT(){return YC(ZT)}var $T=L(`ZodNever`,(e,t)=>{PS.init(e,t),yT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Nw(e,t,n,r)});function eE(e){return XC($T,e)}var tE=L(`ZodArray`,(e,t)=>{IS.init(e,t),yT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Rw(e,t,n,r),e.element=t.element,e.min=(t,n)=>e.check(rw(t,n)),e.nonempty=t=>e.check(rw(1,t)),e.max=(t,n)=>e.check(nw(t,n)),e.length=(t,n)=>e.check(iw(t,n)),e.unwrap=()=>e.element});function nE(e,t){return _w(tE,e,t)}var rE=L(`ZodObject`,(e,t)=>{VS.init(e,t),yT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zw(e,t,n,r),db(e,`shape`,()=>t.shape),e.keyof=()=>hE(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:QT()}),e.loose=()=>e.clone({...e._zod.def,catchall:QT()}),e.strict=()=>e.clone({...e._zod.def,catchall:eE()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>Ob(e,t),e.safeExtend=t=>kb(e,t),e.merge=t=>Ab(e,t),e.pick=t=>Eb(e,t),e.omit=t=>Db(e,t),e.partial=(...t)=>jb(bE,e,t[0]),e.required=(...t)=>Mb(AE,e,t[0])});function iE(e,t){return new rE({type:`object`,shape:e??{},...R(t)})}function aE(e,t){return new rE({type:`object`,shape:e,catchall:QT(),...R(t)})}var oE=L(`ZodUnion`,(e,t)=>{US.init(e,t),yT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bw(e,t,n,r),e.options=t.options});function sE(e,t){return new oE({type:`union`,options:e,...R(t)})}var cE=L(`ZodDiscriminatedUnion`,(e,t)=>{oE.init(e,t),WS.init(e,t)});function lE(e,t,n){return new cE({type:`union`,options:t,discriminator:e,...R(n)})}var uE=L(`ZodIntersection`,(e,t)=>{GS.init(e,t),yT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vw(e,t,n,r)});function dE(e,t){return new uE({type:`intersection`,left:e,right:t})}var fE=L(`ZodRecord`,(e,t)=>{JS.init(e,t),yT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hw(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function pE(e,t,n){return new fE({type:`record`,keyType:e,valueType:t,...R(n)})}var mE=L(`ZodEnum`,(e,t)=>{YS.init(e,t),yT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Pw(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 mE({...t,checks:[],...R(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 mE({...t,checks:[],...R(r),entries:i})}});function hE(e,t){return new mE({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...R(t)})}var gE=L(`ZodLiteral`,(e,t)=>{XS.init(e,t),yT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fw(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 _E(e,t){return new gE({type:`literal`,values:Array.isArray(e)?e:[e],...R(t)})}var vE=L(`ZodTransform`,(e,t)=>{ZS.init(e,t),yT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Lw(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new tb(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Rb(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(Rb(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function yE(e){return new vE({type:`transform`,transform:e})}var bE=L(`ZodOptional`,(e,t)=>{$S.init(e,t),yT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xw(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function xE(e){return new bE({type:`optional`,innerType:e})}var SE=L(`ZodExactOptional`,(e,t)=>{eC.init(e,t),yT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xw(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function CE(e){return new SE({type:`optional`,innerType:e})}var wE=L(`ZodNullable`,(e,t)=>{tC.init(e,t),yT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Uw(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function TE(e){return new wE({type:`nullable`,innerType:e})}var EE=L(`ZodDefault`,(e,t)=>{nC.init(e,t),yT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gw(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function DE(e,t){return new EE({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():bb(t)}})}var OE=L(`ZodPrefault`,(e,t)=>{iC.init(e,t),yT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Kw(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function kE(e,t){return new OE({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():bb(t)}})}var AE=L(`ZodNonOptional`,(e,t)=>{aC.init(e,t),yT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ww(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function jE(e,t){return new AE({type:`nonoptional`,innerType:e,...R(t)})}var ME=L(`ZodCatch`,(e,t)=>{sC.init(e,t),yT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qw(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function NE(e,t){return new ME({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var PE=L(`ZodPipe`,(e,t)=>{cC.init(e,t),yT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Jw(e,t,n,r),e.in=t.in,e.out=t.out});function FE(e,t){return new PE({type:`pipe`,in:e,out:t})}var IE=L(`ZodReadonly`,(e,t)=>{uC.init(e,t),yT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yw(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function LE(e){return new IE({type:`readonly`,innerType:e})}var RE=L(`ZodCustom`,(e,t)=>{fC.init(e,t),yT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Iw(e,t,n,r)});function zE(e,t={}){return vw(RE,e,t)}function BE(e){return yw(e)}var VE=Symbol.for(`@inkeep/open-knowledge/field-registry`),HE=globalThis;HE[VE]===void 0&&(HE[VE]=gC());var UE=HE[VE];function WE(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=GE(t)?UE.get(t):void 0;if(e!==void 0)return e;let n=t._zod?.def?.innerType;if(n===void 0)return;t=n}}function GE(e){return typeof e==`object`&&!!e&&`_zod`in e&&`parse`in e}var KE=aE({title:z().optional(),description:z().optional(),tags:nE(z()).optional()}),qE=aE({match:z().min(1,"`match` must be a non-empty glob pattern (e.g. 'specs/**' or 'reports/*/**')"),frontmatter:KE}),JE=aE({content:aE({dir:z().register(UE,{scope:`project`,agentSettable:!1,defaultScope:`project`}).default(`.`)}).default({dir:`.`}),github:aE({oauthAppClientId:z().register(UE,{scope:`either`,agentSettable:!1,defaultScope:`user`}).default(`Ov23liqlSd0V1MwR6rhI`)}).default({oauthAppClientId:`Ov23liqlSd0V1MwR6rhI`}),server:aE({host:z().regex(/^[\w.\-:]+$/,`Invalid hostname`).register(UE,{scope:`either`,agentSettable:!1,defaultScope:`user`}).default(`localhost`),openOnAgentEdit:JT().register(UE,{scope:`either`,agentSettable:!1,defaultScope:`user`}).default(!1)}).default({host:`localhost`,openOnAgentEdit:!1}),preview:aE({baseUrl:DT().register(UE,{scope:`project`,agentSettable:!1}).optional()}).default({}),folders:nE(qE).register(UE,{scope:`either`,agentSettable:!0,defaultScope:`project`}).default([]),mcp:aE({autoStart:JT().register(UE,{scope:`either`,agentSettable:!1,defaultScope:`user`}).default(!0),tools:aE({read_document:aE({historyDepth:WT().int().min(0).register(UE,{scope:`either`,agentSettable:!0,defaultScope:`user`}).default(5)}).default({historyDepth:5}),search:aE({maxResults:WT().int().min(1).register(UE,{scope:`either`,agentSettable:!0,defaultScope:`user`}).default(50)}).default({maxResults:50})}).default({read_document:{historyDepth:5},search:{maxResults:50}})}).default({autoStart:!0,tools:{read_document:{historyDepth:5},search:{maxResults:50}}}),appearance:aE({theme:hE([`light`,`dark`,`system`]).register(UE,{scope:`user`,agentSettable:!1,defaultScope:`user`}).optional(),editorModeDefault:hE([`wysiwyg`,`source`]).register(UE,{scope:`user`,agentSettable:!1,defaultScope:`user`}).optional()}).default({})}),YE=`open-knowledge-config`;function XE(e,t,n){let r=S.getTracer(YE),i=t?{attributes:t}:{};return r.startActiveSpan(e,i,e=>{try{return n(e)}catch(t){throw e.recordException(t),e.setStatus({code:x.ERROR,message:t instanceof Error?t.message:String(t)}),t}finally{e.end()}})}function ZE(e,t){let n=S.getActiveSpan();n&&n.addEvent(e,t)}function QE(e,t){for(let n=1;n<t.length;n++){let r=t.slice(0,n);e.hasIn(r)&&(wg(e.getIn(r,!0))||e.deleteIn(r))}}function $E(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)){QE(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}QE(e,i),e.setIn(i,t),n.push(i.join(`.`))}}for(let[e,n]of Object.entries(t))r(n,[e]);return n}function eD(e){return{path:e.path.map(e=>typeof e==`symbol`?String(e):e),message:e.message,issueCode:e.code}}function tD(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?rD(e.position):`start`in e||`end`in e?rD(e):`line`in e||`column`in e?nD(e):``}function nD(e){return iD(e&&e.line)+`:`+iD(e&&e.column)}function rD(e){return nD(e&&e.start)+`-`+nD(e&&e.end)}function iD(e){return e&&typeof e==`number`?e:1}var aD=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=tD(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};aD.prototype.file=``,aD.prototype.name=``,aD.prototype.reason=``,aD.prototype.message=``,aD.prototype.stack=``,aD.prototype.column=void 0,aD.prototype.line=void 0,aD.prototype.ancestors=void 0,aD.prototype.cause=void 0,aD.prototype.fatal=void 0,aD.prototype.place=void 0,aD.prototype.ruleId=void 0,aD.prototype.source=void 0;var oD=4,sD=/^```([a-z]+)?[\s\n]$/,cD=/^~~~([a-z]+)?[\s\n]$/,lD=cg.create({name:`codeBlock`,addOptions(){return{languageClassPrefix:`language-`,exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:oD,HTMLAttributes:{}}},content:`text*`,marks:``,group:`block`,code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{let{languageClassPrefix:t}=this.options;return t&&[...e.firstElementChild?.classList||[]].filter(e=>e.startsWith(t)).map(e=>e.replace(t,``))[0]||null},rendered:!1}}},parseHTML(){return[{tag:`pre`,preserveWhitespace:`full`}]},renderHTML({node:e,HTMLAttributes:t}){return[`pre`,$p(this.options.HTMLAttributes,t),[`code`,{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},markdownTokenName:`code`,parseMarkdown:(e,t)=>e.raw?.startsWith("```")===!1&&e.raw?.startsWith(`~~~`)===!1&&e.codeBlockStyle!==`indented`?[]:t.createNode(`codeBlock`,{language:e.lang||null},e.text?[t.createTextNode(e.text)]:[]),renderMarkdown:(e,t)=>{let n=``,r=e.attrs?.language||``;return n=e.content?[`\`\`\`${r}`,t.renderChildren(e.content),"```"].join(`
246
+ 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 ww(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:Dw(t,`input`,e.processors),output:Dw(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function Tw(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 Tw(r.element,n);if(r.type===`set`)return Tw(r.valueType,n);if(r.type===`lazy`)return Tw(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 Tw(r.innerType,n);if(r.type===`intersection`)return Tw(r.left,n)||Tw(r.right,n);if(r.type===`record`||r.type===`map`)return Tw(r.keyType,n)||Tw(r.valueType,n);if(r.type===`pipe`)return Tw(r.in,n)||Tw(r.out,n);if(r.type===`object`){for(let e in r.shape)if(Tw(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(Tw(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(Tw(e,n))return!0;return!!(r.rest&&Tw(r.rest,n))}return!1}var Ew=(e,t={})=>n=>{let r=xw({...n,processors:t});return Sw(e,r),Cw(r,e),ww(r,e)},Dw=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=xw({...i??{},target:a,io:t,processors:n});return Sw(e,o),Cw(o,e),ww(o,e)},Ow={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},kw=(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=Ow[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}))])}},Aw=(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)},jw=(e,t,n,r)=>{n.type=`boolean`},Mw=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},Nw=(e,t,n,r)=>{n.not={}},Pw=(e,t,n,r)=>{let i=e._zod.def,a=ib(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},Fw=(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},Iw=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},Lw=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},Rw=(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=Sw(a.element,t,{...r,path:[...r.path,`items`]})},zw=(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]=Sw(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=Sw(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Bw=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>Sw(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Vw=(e,t,n,r)=>{let i=e._zod.def,a=Sw(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=Sw(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]]},Hw=(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=Sw(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=Sw(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=Sw(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)}},Uw=(e,t,n,r)=>{let i=e._zod.def,a=Sw(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`}]},Ww=(e,t,n,r)=>{let i=e._zod.def;Sw(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Gw=(e,t,n,r)=>{let i=e._zod.def;Sw(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Kw=(e,t,n,r)=>{let i=e._zod.def;Sw(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)))},qw=(e,t,n,r)=>{let i=e._zod.def;Sw(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},Jw=(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;Sw(a,t,r);let o=t.seen.get(e);o.ref=a},Yw=(e,t,n,r)=>{let i=e._zod.def;Sw(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Xw=(e,t,n,r)=>{let i=e._zod.def;Sw(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Zw=L(`ZodISODateTime`,(e,t)=>{mS.init(e,t),ST.init(e,t)});function Qw(e){return VC(Zw,e)}var $w=L(`ZodISODate`,(e,t)=>{hS.init(e,t),ST.init(e,t)});function eT(e){return HC($w,e)}var tT=L(`ZodISOTime`,(e,t)=>{gS.init(e,t),ST.init(e,t)});function nT(e){return UC(tT,e)}var rT=L(`ZodISODuration`,(e,t)=>{_S.init(e,t),ST.init(e,t)});function iT(e){return WC(rT,e)}var aT=(e,t)=>{Bb.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Ub(e,t)},flatten:{value:t=>Hb(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,ab,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,ab,2)}},isEmpty:{get(){return e.issues.length===0}}})};L(`ZodError`,aT);var oT=L(`ZodError`,aT,{Parent:Error}),sT=Wb(oT),cT=Gb(oT),lT=Kb(oT),uT=Jb(oT),dT=Xb(oT),fT=Zb(oT),pT=Qb(oT),mT=$b(oT),hT=ex(oT),gT=tx(oT),_T=nx(oT),vT=rx(oT),yT=L(`ZodType`,(e,t)=>(eS.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:Dw(e,`input`),output:Dw(e,`output`)}}),e.toJSONSchema=Ew(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,`_def`,{value:t}),e.check=(...n)=>e.clone(pb(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)=>Cb(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>sT(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>lT(e,t,n),e.parseAsync=async(t,n)=>cT(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>uT(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>dT(e,t,n),e.decode=(t,n)=>fT(e,t,n),e.encodeAsync=async(t,n)=>pT(e,t,n),e.decodeAsync=async(t,n)=>mT(e,t,n),e.safeEncode=(t,n)=>hT(e,t,n),e.safeDecode=(t,n)=>gT(e,t,n),e.safeEncodeAsync=async(t,n)=>_T(e,t,n),e.safeDecodeAsync=async(t,n)=>vT(e,t,n),e.refine=(t,n)=>e.check(zE(t,n)),e.superRefine=t=>e.check(BE(t)),e.overwrite=t=>e.check(dw(t)),e.optional=()=>xE(e),e.exactOptional=()=>CE(e),e.nullable=()=>TE(e),e.nullish=()=>xE(TE(e)),e.nonoptional=t=>jE(e,t),e.array=()=>nE(e),e.or=t=>sE([e,t]),e.and=t=>dE(e,t),e.transform=t=>FE(e,yE(t)),e.default=t=>DE(e,t),e.prefault=t=>kE(e,t),e.catch=t=>NE(e,t),e.pipe=t=>FE(e,t),e.readonly=()=>LE(e),e.describe=t=>{let n=e.clone();return _C.add(n,{description:t}),n},Object.defineProperty(e,`description`,{get(){return _C.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return _C.get(e);let n=e.clone();return _C.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),bT=L(`_ZodString`,(e,t)=>{tS.init(e,t),yT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>kw(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(aw(...t)),e.includes=(...t)=>e.check(cw(...t)),e.startsWith=(...t)=>e.check(lw(...t)),e.endsWith=(...t)=>e.check(uw(...t)),e.min=(...t)=>e.check(rw(...t)),e.max=(...t)=>e.check(nw(...t)),e.length=(...t)=>e.check(iw(...t)),e.nonempty=(...t)=>e.check(rw(1,...t)),e.lowercase=t=>e.check(ow(t)),e.uppercase=t=>e.check(sw(t)),e.trim=()=>e.check(pw()),e.normalize=(...t)=>e.check(fw(...t)),e.toLowerCase=()=>e.check(mw()),e.toUpperCase=()=>e.check(hw()),e.slugify=()=>e.check(gw())}),xT=L(`ZodString`,(e,t)=>{tS.init(e,t),bT.init(e,t),e.email=t=>e.check(yC(CT,t)),e.url=t=>e.check(TC(ET,t)),e.jwt=t=>e.check(BC(HT,t)),e.emoji=t=>e.check(EC(OT,t)),e.guid=t=>e.check(bC(wT,t)),e.uuid=t=>e.check(xC(TT,t)),e.uuidv4=t=>e.check(SC(TT,t)),e.uuidv6=t=>e.check(CC(TT,t)),e.uuidv7=t=>e.check(wC(TT,t)),e.nanoid=t=>e.check(DC(kT,t)),e.guid=t=>e.check(bC(wT,t)),e.cuid=t=>e.check(OC(AT,t)),e.cuid2=t=>e.check(kC(jT,t)),e.ulid=t=>e.check(AC(MT,t)),e.base64=t=>e.check(LC(zT,t)),e.base64url=t=>e.check(RC(BT,t)),e.xid=t=>e.check(jC(NT,t)),e.ksuid=t=>e.check(MC(PT,t)),e.ipv4=t=>e.check(NC(FT,t)),e.ipv6=t=>e.check(PC(IT,t)),e.cidrv4=t=>e.check(FC(LT,t)),e.cidrv6=t=>e.check(IC(RT,t)),e.e164=t=>e.check(zC(VT,t)),e.datetime=t=>e.check(Qw(t)),e.date=t=>e.check(eT(t)),e.time=t=>e.check(nT(t)),e.duration=t=>e.check(iT(t))});function z(e){return vC(xT,e)}var ST=L(`ZodStringFormat`,(e,t)=>{nS.init(e,t),bT.init(e,t)}),CT=L(`ZodEmail`,(e,t)=>{aS.init(e,t),ST.init(e,t)}),wT=L(`ZodGUID`,(e,t)=>{rS.init(e,t),ST.init(e,t)}),TT=L(`ZodUUID`,(e,t)=>{iS.init(e,t),ST.init(e,t)}),ET=L(`ZodURL`,(e,t)=>{oS.init(e,t),ST.init(e,t)});function DT(e){return TC(ET,e)}var OT=L(`ZodEmoji`,(e,t)=>{sS.init(e,t),ST.init(e,t)}),kT=L(`ZodNanoID`,(e,t)=>{cS.init(e,t),ST.init(e,t)}),AT=L(`ZodCUID`,(e,t)=>{lS.init(e,t),ST.init(e,t)}),jT=L(`ZodCUID2`,(e,t)=>{uS.init(e,t),ST.init(e,t)}),MT=L(`ZodULID`,(e,t)=>{dS.init(e,t),ST.init(e,t)}),NT=L(`ZodXID`,(e,t)=>{fS.init(e,t),ST.init(e,t)}),PT=L(`ZodKSUID`,(e,t)=>{pS.init(e,t),ST.init(e,t)}),FT=L(`ZodIPv4`,(e,t)=>{vS.init(e,t),ST.init(e,t)}),IT=L(`ZodIPv6`,(e,t)=>{yS.init(e,t),ST.init(e,t)}),LT=L(`ZodCIDRv4`,(e,t)=>{bS.init(e,t),ST.init(e,t)}),RT=L(`ZodCIDRv6`,(e,t)=>{xS.init(e,t),ST.init(e,t)}),zT=L(`ZodBase64`,(e,t)=>{CS.init(e,t),ST.init(e,t)}),BT=L(`ZodBase64URL`,(e,t)=>{TS.init(e,t),ST.init(e,t)}),VT=L(`ZodE164`,(e,t)=>{ES.init(e,t),ST.init(e,t)}),HT=L(`ZodJWT`,(e,t)=>{OS.init(e,t),ST.init(e,t)}),UT=L(`ZodNumber`,(e,t)=>{kS.init(e,t),yT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Aw(e,t,n,r),e.gt=(t,n)=>e.check($C(t,n)),e.gte=(t,n)=>e.check(ew(t,n)),e.min=(t,n)=>e.check(ew(t,n)),e.lt=(t,n)=>e.check(ZC(t,n)),e.lte=(t,n)=>e.check(QC(t,n)),e.max=(t,n)=>e.check(QC(t,n)),e.int=t=>e.check(KT(t)),e.safe=t=>e.check(KT(t)),e.positive=t=>e.check($C(0,t)),e.nonnegative=t=>e.check(ew(0,t)),e.negative=t=>e.check(ZC(0,t)),e.nonpositive=t=>e.check(QC(0,t)),e.multipleOf=(t,n)=>e.check(tw(t,n)),e.step=(t,n)=>e.check(tw(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 WT(e){return GC(UT,e)}var GT=L(`ZodNumberFormat`,(e,t)=>{AS.init(e,t),UT.init(e,t)});function KT(e){return KC(GT,e)}var qT=L(`ZodBoolean`,(e,t)=>{jS.init(e,t),yT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jw(e,t,n,r)});function JT(e){return qC(qT,e)}var YT=L(`ZodNull`,(e,t)=>{MS.init(e,t),yT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mw(e,t,n,r)});function XT(e){return JC(YT,e)}var ZT=L(`ZodUnknown`,(e,t)=>{NS.init(e,t),yT.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function QT(){return YC(ZT)}var $T=L(`ZodNever`,(e,t)=>{PS.init(e,t),yT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Nw(e,t,n,r)});function eE(e){return XC($T,e)}var tE=L(`ZodArray`,(e,t)=>{IS.init(e,t),yT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Rw(e,t,n,r),e.element=t.element,e.min=(t,n)=>e.check(rw(t,n)),e.nonempty=t=>e.check(rw(1,t)),e.max=(t,n)=>e.check(nw(t,n)),e.length=(t,n)=>e.check(iw(t,n)),e.unwrap=()=>e.element});function nE(e,t){return _w(tE,e,t)}var rE=L(`ZodObject`,(e,t)=>{VS.init(e,t),yT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zw(e,t,n,r),db(e,`shape`,()=>t.shape),e.keyof=()=>hE(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:QT()}),e.loose=()=>e.clone({...e._zod.def,catchall:QT()}),e.strict=()=>e.clone({...e._zod.def,catchall:eE()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>Ob(e,t),e.safeExtend=t=>kb(e,t),e.merge=t=>Ab(e,t),e.pick=t=>Eb(e,t),e.omit=t=>Db(e,t),e.partial=(...t)=>jb(bE,e,t[0]),e.required=(...t)=>Mb(AE,e,t[0])});function iE(e,t){return new rE({type:`object`,shape:e??{},...R(t)})}function aE(e,t){return new rE({type:`object`,shape:e,catchall:QT(),...R(t)})}var oE=L(`ZodUnion`,(e,t)=>{US.init(e,t),yT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bw(e,t,n,r),e.options=t.options});function sE(e,t){return new oE({type:`union`,options:e,...R(t)})}var cE=L(`ZodDiscriminatedUnion`,(e,t)=>{oE.init(e,t),WS.init(e,t)});function lE(e,t,n){return new cE({type:`union`,options:t,discriminator:e,...R(n)})}var uE=L(`ZodIntersection`,(e,t)=>{GS.init(e,t),yT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vw(e,t,n,r)});function dE(e,t){return new uE({type:`intersection`,left:e,right:t})}var fE=L(`ZodRecord`,(e,t)=>{JS.init(e,t),yT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hw(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function pE(e,t,n){return new fE({type:`record`,keyType:e,valueType:t,...R(n)})}var mE=L(`ZodEnum`,(e,t)=>{YS.init(e,t),yT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Pw(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 mE({...t,checks:[],...R(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 mE({...t,checks:[],...R(r),entries:i})}});function hE(e,t){return new mE({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...R(t)})}var gE=L(`ZodLiteral`,(e,t)=>{XS.init(e,t),yT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fw(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 _E(e,t){return new gE({type:`literal`,values:Array.isArray(e)?e:[e],...R(t)})}var vE=L(`ZodTransform`,(e,t)=>{ZS.init(e,t),yT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Lw(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new tb(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Rb(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(Rb(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function yE(e){return new vE({type:`transform`,transform:e})}var bE=L(`ZodOptional`,(e,t)=>{$S.init(e,t),yT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xw(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function xE(e){return new bE({type:`optional`,innerType:e})}var SE=L(`ZodExactOptional`,(e,t)=>{eC.init(e,t),yT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xw(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function CE(e){return new SE({type:`optional`,innerType:e})}var wE=L(`ZodNullable`,(e,t)=>{tC.init(e,t),yT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Uw(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function TE(e){return new wE({type:`nullable`,innerType:e})}var EE=L(`ZodDefault`,(e,t)=>{nC.init(e,t),yT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gw(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function DE(e,t){return new EE({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():bb(t)}})}var OE=L(`ZodPrefault`,(e,t)=>{iC.init(e,t),yT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Kw(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function kE(e,t){return new OE({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():bb(t)}})}var AE=L(`ZodNonOptional`,(e,t)=>{aC.init(e,t),yT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ww(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function jE(e,t){return new AE({type:`nonoptional`,innerType:e,...R(t)})}var ME=L(`ZodCatch`,(e,t)=>{sC.init(e,t),yT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qw(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function NE(e,t){return new ME({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var PE=L(`ZodPipe`,(e,t)=>{cC.init(e,t),yT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Jw(e,t,n,r),e.in=t.in,e.out=t.out});function FE(e,t){return new PE({type:`pipe`,in:e,out:t})}var IE=L(`ZodReadonly`,(e,t)=>{uC.init(e,t),yT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yw(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function LE(e){return new IE({type:`readonly`,innerType:e})}var RE=L(`ZodCustom`,(e,t)=>{fC.init(e,t),yT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Iw(e,t,n,r)});function zE(e,t={}){return vw(RE,e,t)}function BE(e){return yw(e)}var VE=Symbol.for(`@inkeep/open-knowledge/field-registry`),HE=globalThis;HE[VE]===void 0&&(HE[VE]=gC());var UE=HE[VE];function WE(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=GE(t)?UE.get(t):void 0;if(e!==void 0)return e;let n=t._zod?.def?.innerType;if(n===void 0)return;t=n}}function GE(e){return typeof e==`object`&&!!e&&`_zod`in e&&`parse`in e}var KE=aE({title:z().optional(),description:z().optional(),tags:nE(z()).optional()}),qE=aE({match:z().min(1,"`match` must be a non-empty glob pattern (e.g. 'specs/**' or 'reports/*/**')"),frontmatter:KE}),JE=aE({content:aE({dir:z().register(UE,{scope:`project`,agentSettable:!1,defaultScope:`project`}).default(`.`)}).default({dir:`.`}),github:aE({oauthAppClientId:z().register(UE,{scope:`either`,agentSettable:!1,defaultScope:`user`}).default(`Ov23liqlSd0V1MwR6rhI`)}).default({oauthAppClientId:`Ov23liqlSd0V1MwR6rhI`}),server:aE({host:z().regex(/^[\w.\-:]+$/,`Invalid hostname`).register(UE,{scope:`either`,agentSettable:!1,defaultScope:`user`}).default(`localhost`),openOnAgentEdit:JT().register(UE,{scope:`either`,agentSettable:!1,defaultScope:`user`}).default(!1)}).default({host:`localhost`,openOnAgentEdit:!1}),preview:aE({baseUrl:DT().register(UE,{scope:`project`,agentSettable:!1}).optional()}).default({}),folders:nE(qE).register(UE,{scope:`either`,agentSettable:!0,defaultScope:`project`}).default([]),mcp:aE({autoStart:JT().register(UE,{scope:`either`,agentSettable:!1,defaultScope:`user`}).default(!0),tools:aE({read_document:aE({historyDepth:WT().int().min(0).register(UE,{scope:`either`,agentSettable:!0,defaultScope:`user`}).default(5)}).default({historyDepth:5}),search:aE({maxResults:WT().int().min(1).register(UE,{scope:`either`,agentSettable:!0,defaultScope:`user`}).default(50)}).default({maxResults:50})}).default({read_document:{historyDepth:5},search:{maxResults:50}})}).default({autoStart:!0,tools:{read_document:{historyDepth:5},search:{maxResults:50}}}),appearance:aE({theme:hE([`light`,`dark`,`system`]).register(UE,{scope:`user`,agentSettable:!1,defaultScope:`user`}).optional(),editorModeDefault:hE([`wysiwyg`,`source`]).register(UE,{scope:`user`,agentSettable:!1,defaultScope:`user`}).optional()}).default({}),autoSync:aE({onboardingResolvedAt:Qw().register(UE,{scope:`project`,agentSettable:!1,defaultScope:`project`}).nullable().default(null)}).default({onboardingResolvedAt:null})}),YE=`open-knowledge-config`;function XE(e,t,n){let r=S.getTracer(YE),i=t?{attributes:t}:{};return r.startActiveSpan(e,i,e=>{try{return n(e)}catch(t){throw e.recordException(t),e.setStatus({code:x.ERROR,message:t instanceof Error?t.message:String(t)}),t}finally{e.end()}})}function ZE(e,t){let n=S.getActiveSpan();n&&n.addEvent(e,t)}function QE(e,t){for(let n=1;n<t.length;n++){let r=t.slice(0,n);e.hasIn(r)&&(wg(e.getIn(r,!0))||e.deleteIn(r))}}function $E(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)){QE(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}QE(e,i),e.setIn(i,t),n.push(i.join(`.`))}}for(let[e,n]of Object.entries(t))r(n,[e]);return n}function eD(e){return{path:e.path.map(e=>typeof e==`symbol`?String(e):e),message:e.message,issueCode:e.code}}function tD(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?rD(e.position):`start`in e||`end`in e?rD(e):`line`in e||`column`in e?nD(e):``}function nD(e){return iD(e&&e.line)+`:`+iD(e&&e.column)}function rD(e){return nD(e&&e.start)+`-`+nD(e&&e.end)}function iD(e){return e&&typeof e==`number`?e:1}var aD=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=tD(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};aD.prototype.file=``,aD.prototype.name=``,aD.prototype.reason=``,aD.prototype.message=``,aD.prototype.stack=``,aD.prototype.column=void 0,aD.prototype.line=void 0,aD.prototype.ancestors=void 0,aD.prototype.cause=void 0,aD.prototype.fatal=void 0,aD.prototype.place=void 0,aD.prototype.ruleId=void 0,aD.prototype.source=void 0;var oD=4,sD=/^```([a-z]+)?[\s\n]$/,cD=/^~~~([a-z]+)?[\s\n]$/,lD=cg.create({name:`codeBlock`,addOptions(){return{languageClassPrefix:`language-`,exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:oD,HTMLAttributes:{}}},content:`text*`,marks:``,group:`block`,code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{let{languageClassPrefix:t}=this.options;return t&&[...e.firstElementChild?.classList||[]].filter(e=>e.startsWith(t)).map(e=>e.replace(t,``))[0]||null},rendered:!1}}},parseHTML(){return[{tag:`pre`,preserveWhitespace:`full`}]},renderHTML({node:e,HTMLAttributes:t}){return[`pre`,$p(this.options.HTMLAttributes,t),[`code`,{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},markdownTokenName:`code`,parseMarkdown:(e,t)=>e.raw?.startsWith("```")===!1&&e.raw?.startsWith(`~~~`)===!1&&e.codeBlockStyle!==`indented`?[]:t.createNode(`codeBlock`,{language:e.lang||null},e.text?[t.createTextNode(e.text)]:[]),renderMarkdown:(e,t)=>{let n=``,r=e.attrs?.language||``;return n=e.content?[`\`\`\`${r}`,t.renderChildren(e.content),"```"].join(`
247
247
  `):`\`\`\`${r}
248
248
 
249
249
  \`\`\``,n},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,`paragraph`,e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:e,$anchor:t}=this.editor.state.selection,n=t.pos===1;return!e||t.parent.type.name!==this.name?!1:n||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:e})=>{if(!this.options.enableTabIndentation)return!1;let t=this.options.tabSize??oD,{state:n}=e,{selection:r}=n,{$from:i,empty:a}=r;if(i.parent.type!==this.type)return!1;let o=` `.repeat(t);return a?e.commands.insertContent(o):e.commands.command(({tr:e})=>{let{from:t,to:i}=r,a=n.doc.textBetween(t,i,`
@@ -1 +1 @@
1
- import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./compiler-runtime-Y11fyRVL.js";import{An as i,Mn as a,Nn as o,Pn as s,jn as c}from"./toggle-group-C5MXNna8.js";import{a as l,b as u,c as d,d as f,i as p,l as m,m as h,p as g,r as _,s as ee,v}from"./button-Dyz7QGIk.js";var y=e(t(),1),b=n(),x=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),S=`VisuallyHidden`,C=y.forwardRef((e,t)=>(0,b.jsx)(h.span,{...e,ref:t,style:{...x,...e.style}}));C.displayName=S;var w=C,[T,E]=g(`Tooltip`,[s]),D=s(),O=`TooltipProvider`,k=700,A=`tooltip.open`,[te,j]=T(O),M=e=>{let{__scopeTooltip:t,delayDuration:n=k,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=y.useRef(!0),s=y.useRef(!1),c=y.useRef(0);return y.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,b.jsx)(te,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:y.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:y.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:y.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};M.displayName=O;var N=`Tooltip`,[P,F]=T(N),I=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:s,delayDuration:c}=e,l=j(N,e.__scopeTooltip),u=D(t),[d,f]=y.useState(null),p=ee(),h=y.useRef(0),g=s??l.disableHoverableContent,_=c??l.delayDuration,v=y.useRef(!1),[x,S]=m({prop:r,defaultProp:i??!1,onChange:e=>{e?(l.onOpen(),document.dispatchEvent(new CustomEvent(A))):l.onClose(),a?.(e)},caller:N}),C=y.useMemo(()=>x?v.current?`delayed-open`:`instant-open`:`closed`,[x]),w=y.useCallback(()=>{window.clearTimeout(h.current),h.current=0,v.current=!1,S(!0)},[S]),T=y.useCallback(()=>{window.clearTimeout(h.current),h.current=0,S(!1)},[S]),E=y.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{v.current=!0,S(!0),h.current=0},_)},[_,S]);return y.useEffect(()=>()=>{h.current&&=(window.clearTimeout(h.current),0)},[]),(0,b.jsx)(o,{...u,children:(0,b.jsx)(P,{scope:t,contentId:p,open:x,stateAttribute:C,trigger:d,onTriggerChange:f,onTriggerEnter:y.useCallback(()=>{l.isOpenDelayedRef.current?E():w()},[l.isOpenDelayedRef,E,w]),onTriggerLeave:y.useCallback(()=>{g?T():(window.clearTimeout(h.current),h.current=0)},[T,g]),onOpen:w,onClose:T,disableHoverableContent:g,children:n})})};I.displayName=N;var L=`TooltipTrigger`,R=y.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,a=F(L,n),o=j(L,n),s=D(n),c=u(t,y.useRef(null),a.onTriggerChange),l=y.useRef(!1),d=y.useRef(!1),p=y.useCallback(()=>l.current=!1,[]);return y.useEffect(()=>()=>document.removeEventListener(`pointerup`,p),[p]),(0,b.jsx)(i,{asChild:!0,...s,children:(0,b.jsx)(h.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...r,ref:c,onPointerMove:f(e.onPointerMove,e=>{e.pointerType!==`touch`&&!d.current&&!o.isPointerInTransitRef.current&&(a.onTriggerEnter(),d.current=!0)}),onPointerLeave:f(e.onPointerLeave,()=>{a.onTriggerLeave(),d.current=!1}),onPointerDown:f(e.onPointerDown,()=>{a.open&&a.onClose(),l.current=!0,document.addEventListener(`pointerup`,p,{once:!0})}),onFocus:f(e.onFocus,()=>{l.current||a.onOpen()}),onBlur:f(e.onBlur,a.onClose),onClick:f(e.onClick,a.onClose)})})});R.displayName=L;var z=`TooltipPortal`,[B,V]=T(z,{forceMount:void 0}),H=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=F(z,t);return(0,b.jsx)(B,{scope:t,forceMount:n,children:(0,b.jsx)(d,{present:n||a.open,children:(0,b.jsx)(p,{asChild:!0,container:i,children:r})})})};H.displayName=z;var U=`TooltipContent`,W=y.forwardRef((e,t)=>{let n=V(U,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=F(U,e.__scopeTooltip);return(0,b.jsx)(d,{present:r||o.open,children:o.disableHoverableContent?(0,b.jsx)(Y,{side:i,...a,ref:t}):(0,b.jsx)(G,{side:i,...a,ref:t})})}),G=y.forwardRef((e,t)=>{let n=F(U,e.__scopeTooltip),r=j(U,e.__scopeTooltip),i=y.useRef(null),a=u(t,i),[o,s]=y.useState(null),{trigger:c,onClose:l}=n,d=i.current,{onPointerInTransitChange:f}=r,p=y.useCallback(()=>{s(null),f(!1)},[f]),m=y.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=re(r,ne(r,n.getBoundingClientRect())),a=ie(t.getBoundingClientRect());s(oe([...i,...a])),f(!0)},[f]);return y.useEffect(()=>()=>p(),[p]),y.useEffect(()=>{if(c&&d){let e=e=>m(e,d),t=e=>m(e,c);return c.addEventListener(`pointerleave`,e),d.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),d.removeEventListener(`pointerleave`,t)}}},[c,d,m,p]),y.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||d?.contains(t),i=!ae(n,o);r?p():i&&(p(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,d,o,l,p]),(0,b.jsx)(Y,{...e,ref:a})}),[K,q]=T(N,{isInside:!1}),J=v(`TooltipContent`),Y=y.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,u=F(U,n),d=D(n),{onClose:f}=u;return y.useEffect(()=>(document.addEventListener(A,f),()=>document.removeEventListener(A,f)),[f]),y.useEffect(()=>{if(u.trigger){let e=e=>{e.target?.contains(u.trigger)&&f()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[u.trigger,f]),(0,b.jsx)(l,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:f,children:(0,b.jsxs)(a,{"data-state":u.stateAttribute,...d,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,b.jsx)(J,{children:r}),(0,b.jsx)(K,{scope:n,isInside:!0,children:(0,b.jsx)(w,{id:u.contentId,role:`tooltip`,children:i||r})})]})})});W.displayName=U;var X=`TooltipArrow`,Z=y.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=D(n);return q(X,n).isInside?null:(0,b.jsx)(c,{...i,...r,ref:t})});Z.displayName=X;function ne(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function re(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function ie(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function ae(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function oe(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),se(t)}function se(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Q=M,ce=I,le=R,ue=H,de=W,fe=Z,$=r();function pe(e){let t=(0,$.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({delayDuration:r,...n}=e,t[0]=e,t[1]=n,t[2]=r);let i=r===void 0?0:r,a;return t[3]!==i||t[4]!==n?(a=(0,b.jsx)(Q,{"data-slot":`tooltip-provider`,delayDuration:i,...n}),t[3]=i,t[4]=n,t[5]=a):a=t[5],a}function me(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,b.jsx)(ce,{"data-slot":`tooltip`,...n}),t[2]=n,t[3]=r),r}function he(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,b.jsx)(le,{"data-slot":`tooltip-trigger`,...n}),t[2]=n,t[3]=r),r}function ge(e){let t=(0,$.c)(13),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,sideOffset:a,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?0:a,s;t[5]===r?s=t[6]:(s=_(`z-50 inline-flex w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,r),t[5]=r,t[6]=s);let c;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,b.jsx)(fe,{className:`z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground`}),t[7]=c):c=t[7];let l;return t[8]!==n||t[9]!==i||t[10]!==o||t[11]!==s?(l=(0,b.jsx)(ue,{children:(0,b.jsxs)(de,{"data-slot":`tooltip-content`,sideOffset:o,className:s,...i,children:[n,c]})}),t[8]=n,t[9]=i,t[10]=o,t[11]=s,t[12]=l):l=t[12],l}export{he as i,ge as n,pe as r,me as t};
1
+ import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./compiler-runtime-Y11fyRVL.js";import{An as i,Mn as a,Nn as o,Pn as s,jn as c}from"./toggle-group-1sl8rMnA.js";import{a as l,b as u,c as d,d as f,i as p,l as m,m as h,p as g,r as _,s as ee,v}from"./button-Dyz7QGIk.js";var y=e(t(),1),b=n(),x=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),S=`VisuallyHidden`,C=y.forwardRef((e,t)=>(0,b.jsx)(h.span,{...e,ref:t,style:{...x,...e.style}}));C.displayName=S;var w=C,[T,E]=g(`Tooltip`,[s]),D=s(),O=`TooltipProvider`,k=700,A=`tooltip.open`,[te,j]=T(O),M=e=>{let{__scopeTooltip:t,delayDuration:n=k,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=y.useRef(!0),s=y.useRef(!1),c=y.useRef(0);return y.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,b.jsx)(te,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:y.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:y.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:y.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};M.displayName=O;var N=`Tooltip`,[P,F]=T(N),I=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:s,delayDuration:c}=e,l=j(N,e.__scopeTooltip),u=D(t),[d,f]=y.useState(null),p=ee(),h=y.useRef(0),g=s??l.disableHoverableContent,_=c??l.delayDuration,v=y.useRef(!1),[x,S]=m({prop:r,defaultProp:i??!1,onChange:e=>{e?(l.onOpen(),document.dispatchEvent(new CustomEvent(A))):l.onClose(),a?.(e)},caller:N}),C=y.useMemo(()=>x?v.current?`delayed-open`:`instant-open`:`closed`,[x]),w=y.useCallback(()=>{window.clearTimeout(h.current),h.current=0,v.current=!1,S(!0)},[S]),T=y.useCallback(()=>{window.clearTimeout(h.current),h.current=0,S(!1)},[S]),E=y.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{v.current=!0,S(!0),h.current=0},_)},[_,S]);return y.useEffect(()=>()=>{h.current&&=(window.clearTimeout(h.current),0)},[]),(0,b.jsx)(o,{...u,children:(0,b.jsx)(P,{scope:t,contentId:p,open:x,stateAttribute:C,trigger:d,onTriggerChange:f,onTriggerEnter:y.useCallback(()=>{l.isOpenDelayedRef.current?E():w()},[l.isOpenDelayedRef,E,w]),onTriggerLeave:y.useCallback(()=>{g?T():(window.clearTimeout(h.current),h.current=0)},[T,g]),onOpen:w,onClose:T,disableHoverableContent:g,children:n})})};I.displayName=N;var L=`TooltipTrigger`,R=y.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,a=F(L,n),o=j(L,n),s=D(n),c=u(t,y.useRef(null),a.onTriggerChange),l=y.useRef(!1),d=y.useRef(!1),p=y.useCallback(()=>l.current=!1,[]);return y.useEffect(()=>()=>document.removeEventListener(`pointerup`,p),[p]),(0,b.jsx)(i,{asChild:!0,...s,children:(0,b.jsx)(h.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...r,ref:c,onPointerMove:f(e.onPointerMove,e=>{e.pointerType!==`touch`&&!d.current&&!o.isPointerInTransitRef.current&&(a.onTriggerEnter(),d.current=!0)}),onPointerLeave:f(e.onPointerLeave,()=>{a.onTriggerLeave(),d.current=!1}),onPointerDown:f(e.onPointerDown,()=>{a.open&&a.onClose(),l.current=!0,document.addEventListener(`pointerup`,p,{once:!0})}),onFocus:f(e.onFocus,()=>{l.current||a.onOpen()}),onBlur:f(e.onBlur,a.onClose),onClick:f(e.onClick,a.onClose)})})});R.displayName=L;var z=`TooltipPortal`,[B,V]=T(z,{forceMount:void 0}),H=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=F(z,t);return(0,b.jsx)(B,{scope:t,forceMount:n,children:(0,b.jsx)(d,{present:n||a.open,children:(0,b.jsx)(p,{asChild:!0,container:i,children:r})})})};H.displayName=z;var U=`TooltipContent`,W=y.forwardRef((e,t)=>{let n=V(U,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=F(U,e.__scopeTooltip);return(0,b.jsx)(d,{present:r||o.open,children:o.disableHoverableContent?(0,b.jsx)(Y,{side:i,...a,ref:t}):(0,b.jsx)(G,{side:i,...a,ref:t})})}),G=y.forwardRef((e,t)=>{let n=F(U,e.__scopeTooltip),r=j(U,e.__scopeTooltip),i=y.useRef(null),a=u(t,i),[o,s]=y.useState(null),{trigger:c,onClose:l}=n,d=i.current,{onPointerInTransitChange:f}=r,p=y.useCallback(()=>{s(null),f(!1)},[f]),m=y.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=re(r,ne(r,n.getBoundingClientRect())),a=ie(t.getBoundingClientRect());s(oe([...i,...a])),f(!0)},[f]);return y.useEffect(()=>()=>p(),[p]),y.useEffect(()=>{if(c&&d){let e=e=>m(e,d),t=e=>m(e,c);return c.addEventListener(`pointerleave`,e),d.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),d.removeEventListener(`pointerleave`,t)}}},[c,d,m,p]),y.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||d?.contains(t),i=!ae(n,o);r?p():i&&(p(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,d,o,l,p]),(0,b.jsx)(Y,{...e,ref:a})}),[K,q]=T(N,{isInside:!1}),J=v(`TooltipContent`),Y=y.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,u=F(U,n),d=D(n),{onClose:f}=u;return y.useEffect(()=>(document.addEventListener(A,f),()=>document.removeEventListener(A,f)),[f]),y.useEffect(()=>{if(u.trigger){let e=e=>{e.target?.contains(u.trigger)&&f()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[u.trigger,f]),(0,b.jsx)(l,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:f,children:(0,b.jsxs)(a,{"data-state":u.stateAttribute,...d,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,b.jsx)(J,{children:r}),(0,b.jsx)(K,{scope:n,isInside:!0,children:(0,b.jsx)(w,{id:u.contentId,role:`tooltip`,children:i||r})})]})})});W.displayName=U;var X=`TooltipArrow`,Z=y.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=D(n);return q(X,n).isInside?null:(0,b.jsx)(c,{...i,...r,ref:t})});Z.displayName=X;function ne(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function re(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function ie(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function ae(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function oe(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),se(t)}function se(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Q=M,ce=I,le=R,ue=H,de=W,fe=Z,$=r();function pe(e){let t=(0,$.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({delayDuration:r,...n}=e,t[0]=e,t[1]=n,t[2]=r);let i=r===void 0?0:r,a;return t[3]!==i||t[4]!==n?(a=(0,b.jsx)(Q,{"data-slot":`tooltip-provider`,delayDuration:i,...n}),t[3]=i,t[4]=n,t[5]=a):a=t[5],a}function me(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,b.jsx)(ce,{"data-slot":`tooltip`,...n}),t[2]=n,t[3]=r),r}function he(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,b.jsx)(le,{"data-slot":`tooltip-trigger`,...n}),t[2]=n,t[3]=r),r}function ge(e){let t=(0,$.c)(13),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,sideOffset:a,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?0:a,s;t[5]===r?s=t[6]:(s=_(`z-50 inline-flex w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,r),t[5]=r,t[6]=s);let c;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,b.jsx)(fe,{className:`z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground`}),t[7]=c):c=t[7];let l;return t[8]!==n||t[9]!==i||t[10]!==o||t[11]!==s?(l=(0,b.jsx)(ue,{children:(0,b.jsxs)(de,{"data-slot":`tooltip-content`,sideOffset:o,className:s,...i,children:[n,c]})}),t[8]=n,t[9]=i,t[10]=o,t[11]=s,t[12]=l):l=t[12],l}export{he as i,ge as n,pe as r,me as t};
@@ -20,7 +20,7 @@
20
20
  nothing for the formatter to reindent.
21
21
  -->
22
22
  <script>(() => { let mode = 'wysiwyg'; try { const raw = localStorage.getItem('ok-editor-mode-v1'); if (raw === 'wysiwyg' || raw === 'source') mode = raw; } catch {} window.__OK_EDITOR_MODE__ = mode; })();</script>
23
- <script type="module" crossorigin src="./assets/index-CRwvkGXF.js"></script>
23
+ <script type="module" crossorigin src="./assets/index-DN_1M53F.js"></script>
24
24
  <link rel="modulepreload" crossorigin href="./assets/chunk-DECur_0Z.js">
25
25
  <link rel="modulepreload" crossorigin href="./assets/trace-api-CbLDdnQA.js">
26
26
  <link rel="modulepreload" crossorigin href="./assets/propagation-api-LnD10wq2.js">
@@ -29,18 +29,18 @@
29
29
  <link rel="modulepreload" crossorigin href="./assets/dist-oNAFjGrp.js">
30
30
  <link rel="modulepreload" crossorigin href="./assets/compiler-runtime-Y11fyRVL.js">
31
31
  <link rel="modulepreload" crossorigin href="./assets/button-Dyz7QGIk.js">
32
- <link rel="modulepreload" crossorigin href="./assets/toggle-group-C5MXNna8.js">
32
+ <link rel="modulepreload" crossorigin href="./assets/toggle-group-1sl8rMnA.js">
33
33
  <link rel="modulepreload" crossorigin href="./assets/dist-RVD4DzGH.js">
34
34
  <link rel="modulepreload" crossorigin href="./assets/dialog-FUclf-NK.js">
35
- <link rel="modulepreload" crossorigin href="./assets/DocumentContext-CSOslMNT.js">
35
+ <link rel="modulepreload" crossorigin href="./assets/DocumentContext-BRyrYElZ.js">
36
36
  <link rel="modulepreload" crossorigin href="./assets/panel-DT62BXGr.js">
37
- <link rel="modulepreload" crossorigin href="./assets/OutlinePanel-D_xYEkm6.js">
37
+ <link rel="modulepreload" crossorigin href="./assets/OutlinePanel-BcdH74Qw.js">
38
38
  <link rel="modulepreload" crossorigin href="./assets/circle-check-C-DpX4dU.js">
39
- <link rel="modulepreload" crossorigin href="./assets/config-validation-events-mqmIrycG.js">
40
- <link rel="modulepreload" crossorigin href="./assets/tooltip-CzI9zWJi.js">
39
+ <link rel="modulepreload" crossorigin href="./assets/config-validation-events-CWaXc07D.js">
40
+ <link rel="modulepreload" crossorigin href="./assets/tooltip-CFeKxs4p.js">
41
41
  <link rel="modulepreload" crossorigin href="./assets/agent-presence-BxT9uQ-C.js">
42
- <link rel="modulepreload" crossorigin href="./assets/target-navigation-intent-1238Z_HW.js">
43
- <link rel="modulepreload" crossorigin href="./assets/mcp-consent-store-BBTXqzE6.js">
42
+ <link rel="modulepreload" crossorigin href="./assets/target-navigation-intent-CIITpiPs.js">
43
+ <link rel="modulepreload" crossorigin href="./assets/mcp-consent-store-B9QLSyUV.js">
44
44
  <link rel="stylesheet" crossorigin href="./assets/index-CKzUuzYV.css">
45
45
  </head>
46
46
 
@@ -184,6 +184,31 @@
184
184
  }
185
185
  },
186
186
  "additionalProperties": {}
187
+ },
188
+ "autoSync": {
189
+ "default": {
190
+ "onboardingResolvedAt": null
191
+ },
192
+ "type": "object",
193
+ "properties": {
194
+ "onboardingResolvedAt": {
195
+ "default": null,
196
+ "anyOf": [
197
+ {
198
+ "type": "string",
199
+ "format": "date-time",
200
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$",
201
+ "scope": "project",
202
+ "agentSettable": false,
203
+ "defaultScope": "project"
204
+ },
205
+ {
206
+ "type": "null"
207
+ }
208
+ ]
209
+ }
210
+ },
211
+ "additionalProperties": {}
187
212
  }
188
213
  },
189
214
  "additionalProperties": {}
@@ -183,6 +183,31 @@
183
183
  }
184
184
  },
185
185
  "additionalProperties": {}
186
+ },
187
+ "autoSync": {
188
+ "default": {
189
+ "onboardingResolvedAt": null
190
+ },
191
+ "type": "object",
192
+ "properties": {
193
+ "onboardingResolvedAt": {
194
+ "default": null,
195
+ "anyOf": [
196
+ {
197
+ "type": "string",
198
+ "format": "date-time",
199
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$",
200
+ "scope": "project",
201
+ "agentSettable": false,
202
+ "defaultScope": "project"
203
+ },
204
+ {
205
+ "type": "null"
206
+ }
207
+ ]
208
+ }
209
+ },
210
+ "additionalProperties": {}
186
211
  }
187
212
  },
188
213
  "additionalProperties": {}
@@ -1,3 +1,3 @@
1
- import{$ as e,Lt as t,X as n,Z as r,et as i,it as a,nt as o,rt as s,tt as c}from"./dist-oDoSs1Bl.mjs";import{dirname as l,isAbsolute as u,resolve as d}from"node:path";import{existsSync as f,readFileSync as p,renameSync as m,unlinkSync as h}from"node:fs";import{homedir as g}from"node:os";import{mkdir as _,rename as v,writeFile as y}from"node:fs/promises";var b=t();function x(e){return`https://unpkg.com/@inkeep/open-knowledge@latest/dist/schemas/${n}/${e===`user`?`config.user.schema.json`:`config.project.schema.json`}`}function S(e){return`# yaml-language-server: $schema=${x(e)}\n`}function C(e,t,n){return d(e===`user`?n??g():u(t)?t:d(t),`.ok`,`config.yml`)}function w(e){return{ok:!1,error:e}}function T(e){return{ok:!0,...e}}async function E(e,t){let n=`${e}.tmp.${crypto.randomUUID()}`;try{await y(n,t,{encoding:`utf-8`,mode:420}),await v(n,e)}catch(e){try{h(n)}catch{}throw e}}async function D(e){return s(`config.patch`,{"config.scope":e.scope,"config.transport":`fs`},async t=>{let n=await O(e);return t.setAttribute(`config.outcome`,n.ok?`success`:`rejected`),n.ok||t.setAttribute(`config.error.code`,n.error.code),n})}async function O(t){let{cwd:n,scope:s,patch:c,homedirOverride:u,firstWriteHeader:d}=t,m=C(s,n,u),h=``,g=!1;if(f(m)){g=!0;try{h=p(m,`utf-8`)}catch(e){return w({code:`WRITE_ERROR`,detail:`Could not read existing config: ${e instanceof Error?e.message:String(e)}`})}}let v=(0,b.parseDocument)(h);if(v.errors.length>0)return w({code:`YAML_PARSE`,detail:v.errors.map(e=>e.message).join(`; `)});if(v.contents===null)v.contents=v.createNode({});else if(!(0,b.isMap)(v.contents))return w({code:`YAML_PARSE`,detail:`Top-level YAML value must be a mapping (object), got ${(0,b.isSeq)(v.contents)?`sequence`:`scalar`}`});let y=i(v,c),x=v.toJSON(),D=a(`config.validate`,{"config.scope":s,"config.validation.layer":`L2`},t=>{let n=r.safeParse(x);if(t.setAttribute(`config.outcome`,n.success?`success`:`rejected`),!n.success)for(let t of n.error.issues)e(`config.validation.issue`,{"issue.path":t.path.map(e=>String(e)).join(`.`),"issue.message":t.message});return n});if(!D.success)return w({code:`SCHEMA_INVALID`,issues:D.error.issues.map(o)});let O=v.toString();if(!g){let e=d===void 0?S(s):d??``;e.length>0&&(O=`${e.endsWith(`
1
+ import{$ as e,Lt as t,X as n,Z as r,et as i,it as a,nt as o,rt as s,tt as c}from"./dist-BmX1Ns7C.mjs";import{dirname as l,isAbsolute as u,resolve as d}from"node:path";import{existsSync as f,readFileSync as p,renameSync as m,unlinkSync as h}from"node:fs";import{homedir as g}from"node:os";import{mkdir as _,rename as v,writeFile as y}from"node:fs/promises";var b=t();function x(e){return`https://unpkg.com/@inkeep/open-knowledge@latest/dist/schemas/${n}/${e===`user`?`config.user.schema.json`:`config.project.schema.json`}`}function S(e){return`# yaml-language-server: $schema=${x(e)}\n`}function C(e,t,n){return d(e===`user`?n??g():u(t)?t:d(t),`.ok`,`config.yml`)}function w(e){return{ok:!1,error:e}}function T(e){return{ok:!0,...e}}async function E(e,t){let n=`${e}.tmp.${crypto.randomUUID()}`;try{await y(n,t,{encoding:`utf-8`,mode:420}),await v(n,e)}catch(e){try{h(n)}catch{}throw e}}async function D(e){return s(`config.patch`,{"config.scope":e.scope,"config.transport":`fs`},async t=>{let n=await O(e);return t.setAttribute(`config.outcome`,n.ok?`success`:`rejected`),n.ok||t.setAttribute(`config.error.code`,n.error.code),n})}async function O(t){let{cwd:n,scope:s,patch:c,homedirOverride:u,firstWriteHeader:d}=t,m=C(s,n,u),h=``,g=!1;if(f(m)){g=!0;try{h=p(m,`utf-8`)}catch(e){return w({code:`WRITE_ERROR`,detail:`Could not read existing config: ${e instanceof Error?e.message:String(e)}`})}}let v=(0,b.parseDocument)(h);if(v.errors.length>0)return w({code:`YAML_PARSE`,detail:v.errors.map(e=>e.message).join(`; `)});if(v.contents===null)v.contents=v.createNode({});else if(!(0,b.isMap)(v.contents))return w({code:`YAML_PARSE`,detail:`Top-level YAML value must be a mapping (object), got ${(0,b.isSeq)(v.contents)?`sequence`:`scalar`}`});let y=i(v,c),x=v.toJSON(),D=a(`config.validate`,{"config.scope":s,"config.validation.layer":`L2`},t=>{let n=r.safeParse(x);if(t.setAttribute(`config.outcome`,n.success?`success`:`rejected`),!n.success)for(let t of n.error.issues)e(`config.validation.issue`,{"issue.path":t.path.map(e=>String(e)).join(`.`),"issue.message":t.message});return n});if(!D.success)return w({code:`SCHEMA_INVALID`,issues:D.error.issues.map(o)});let O=v.toString();if(!g){let e=d===void 0?S(s):d??``;e.length>0&&(O=`${e.endsWith(`
2
2
  `)?e:`${e}\n`}${O}`)}try{await _(l(m),{recursive:!0})}catch(e){return w({code:`WRITE_ERROR`,detail:`Could not create parent directory for ${m}: ${e instanceof Error?e.message:String(e)}`})}try{await E(m,O)}catch(e){return w({code:`WRITE_ERROR`,detail:`Could not write ${m}: ${e instanceof Error?e.message:String(e)}`})}return T({effective:D.data,appliedPaths:y,path:m,created:!g})}function k(e){if(!f(e))return[];let t=(0,b.parseDocument)(p(e,`utf-8`));if(t.errors.length>0)return[];let n=t.toJSON();if(!n||typeof n!=`object`||Array.isArray(n))return[];let r=n.folders;return Array.isArray(r)?r:[]}function A(e){return{ok:!1,error:e}}function j(e){return{ok:!0,...e}}async function M(e){let t=e.scope??`project`,n=C(t,e.cwd,e.homedirOverride),r;try{r=k(n)}catch(e){return A({code:`WRITE_ERROR`,detail:`Could not read current folders: ${e instanceof Error?e.message:String(e)}`})}let i=r.map(e=>({match:e.match,frontmatter:{...e.frontmatter}}));for(let t of e.rules){let e=t.new_match??t.match,n=i.findIndex(e=>e.match===t.match);if(t.new_match!==void 0&&t.new_match!==t.match){if(n>=0){let e=i.findIndex((e,r)=>r!==n&&e.match===t.new_match);e>=0&&i.splice(e,1);let r=e>=0&&e<n?n-1:n;i[r]={match:t.new_match,frontmatter:{...t.frontmatter}}}else{let n=i.findIndex(t=>t.match===e);n>=0?i[n]={match:e,frontmatter:{...t.frontmatter}}:i.push({match:e,frontmatter:{...t.frontmatter}})}continue}n>=0?i[n]={match:t.match,frontmatter:{...t.frontmatter}}:i.push({match:t.match,frontmatter:{...t.frontmatter}})}let a=await D({cwd:e.cwd,scope:t,patch:{folders:i},homedirOverride:e.homedirOverride});return a.ok?j({effective:a.effective,appliedPaths:a.appliedPaths,path:a.path,created:a.created}):A(a.error)}function N(e,t){let n=P(`user`,t),r=P(`project`,t),i=new Map;for(let t of e){let e=t.join(`.`);i.set(e,{user:F(n,t),project:F(r,t)})}return i}function P(e,t){let n=C(e,t.cwd,t.homedirOverride);if(!f(n))return null;let r;try{r=p(n,`utf-8`)}catch(t){return t.code!==`ENOENT`&&console.warn(`[inspectConfigPaths] could not read ${e} config at ${n}: ${t.message??t}`),null}let i=(0,b.parseDocument)(r);return i.errors.length>0?(console.warn(`[inspectConfigPaths] ${e} config at ${n} has YAML parse errors; treating as absent for scope inference`),null):i.toJSON()}function F(e,t){if(t.length===0)return e!=null;let n=e;for(let e of t){if(n==null)return!1;if(Array.isArray(n)&&typeof e==`number`){n=n[e];continue}if(typeof n==`object`){let t=String(e);if(!(t in n))return!1;n=n[t];continue}return!1}return n!==void 0}function I(e,t,n,r){return e.success?{code:`UNKNOWN`,message:`unexpected success in error path`}:{code:`SCHEMA_INVALID`,issues:e.error.issues.map(e=>{let i=e.path.map(e=>typeof e==`symbol`?String(e):e),a=c({file:r,source:n,doc:t,path:i});return{path:i,message:e.message,issueCode:e.code,...a===void 0?{}:{source:a}}})}}function L(e,t,n){let r=`${e}.invalid-${t.replace(/[:.]/g,`-`)}`;try{return m(e,r),r}catch(t){n(`[config] Could not sideline invalid config file ${e} → ${r}: ${t instanceof Error?t.message:String(t)}. File left in place; using schema defaults.`);return}}function R(e){let{absPath:t,sideline:n=!0,timestamp:i=new Date().toISOString()}=e,a=e.warn??(e=>console.warn(e)),o=r.parse({});if(!f(t))return{valid:!0,value:o,source:void 0};let s;try{s=p(t,`utf-8`)}catch(e){let n=e instanceof Error?e.message:String(e);return a(`[config] Could not read ${t}: ${n}. Using schema defaults.`),{valid:!1,value:o,error:{code:`UNKNOWN`,message:`Read failed: ${n}`}}}let c=(0,b.parseDocument)(s);if(c.errors.length>0){let e=c.errors.map(e=>e.message).join(`; `);a(`[config] ${t} contains invalid YAML (${e}). Using schema defaults.`+(n?``:` Pass-through mode: file left in place.`));let r=n?L(t,i,a):void 0;return{valid:!1,value:o,error:{code:`YAML_PARSE`,detail:e},...r===void 0?{}:{sidelinedTo:r}}}let l=c.toJSON()??{},u=r.safeParse(l);if(!u.success){let e=I(u,c,s,t);a(`[config] ${t} fails schema validation (${u.error.issues.length} issue(s)). Using schema defaults.`+(n?``:` Pass-through mode: file left in place.`));let r=n?L(t,i,a):void 0;return{valid:!1,value:o,error:e,...r===void 0?{}:{sidelinedTo:r}}}return{valid:!0,value:u.data,source:t}}export{D as a,C as i,N as n,R as r,M as t};
3
- //# sourceMappingURL=server-Cb1yd7Zc.mjs.map
3
+ //# sourceMappingURL=server-CJdOKLcU.mjs.map
@@ -0,0 +1 @@
1
+ import"./loader-CC_RQ-w2.mjs";import"./init-CAeQdWL6.mjs";export{};
@@ -0,0 +1 @@
1
+ import{o as e}from"./start-CrKpyaZC.mjs";export{e as startCommand};
@@ -1,2 +1,2 @@
1
- import{t as e}from"./esm-wByiX8MO.mjs";import{i as t}from"./constants-CGiUuTdz.mjs";import{spawn as n}from"node:child_process";import{join as r}from"node:path";import{closeSync as i,existsSync as a,mkdirSync as o,openSync as s}from"node:fs";import{setTimeout as c}from"node:timers/promises";function l(){let e=process.execPath,t=process.argv[1];return t?{command:e,prefixArgs:[t]}:(console.warn(`[self-spawn] process.argv[1] is empty — falling back to \`npx @inkeep/open-knowledge\`. This re-introduces the version-drift surface that re-exec was fixing. Observed argv: ${JSON.stringify(process.argv)}`),{command:`npx`,prefixArgs:[`@inkeep/open-knowledge`]})}function u(e){return e.uiLock?e.isAlive(e.uiLock.pid)?{action:`skip`,reason:`alive`,pid:e.uiLock.pid,port:e.uiLock.port}:{action:`spawn`,reason:`stale`,stalePid:e.uiLock.pid}:{action:`spawn`,reason:`absent`}}function d(e){a(e.lockDir)||o(e.lockDir,{recursive:!0});let t=s(r(e.lockDir,`last-spawn-error.log`),`w`),c=e.spawn??n,{PORT:u,...d}=process.env,f=l();try{let n=c(f.command,[...f.prefixArgs,...e.args??[`ui`]],{detached:!0,stdio:[`ignore`,`ignore`,t],cwd:e.cwd,env:d});return n.unref(),n}finally{try{i(t)}catch{}}}async function f(e){let t=e.now()+e.timeoutMs;for(;e.now()<t;){let t=e.readUiLock();if(t&&t.port>0)return t.port;await e.sleep(e.pollIntervalMs)}let n=e.readUiLock();return n&&n.port>0?n.port:null}function p(e){let t=e.sigtermGraceMs??1e4,n=e.sigtermPollIntervalMs??200,r=e.sleep??(e=>c(e));return async()=>{try{let i=e.readUiLock();if(i&&e.isAlive(i.pid))try{e.killPid(i.pid,`SIGTERM`),e.log?.info({pid:i.pid,port:i.port},`idle-shutdown: SIGTERM UI sibling`);let a=Date.now()+t;for(;Date.now()<a&&e.isAlive(i.pid);)await r(n);if(e.isAlive(i.pid))try{e.killPid(i.pid,`SIGKILL`),e.log?.warn({pid:i.pid,graceMs:t},`idle-shutdown: SIGTERM grace expired — escalated to SIGKILL`)}catch(t){e.log?.error({pid:i.pid,err:t instanceof Error?t.message:String(t)},`idle-shutdown: SIGKILL failed`)}}catch(t){e.log?.warn({pid:i.pid,err:t instanceof Error?t.message:String(t)},`idle-shutdown: failed to SIGTERM UI sibling`)}}catch(t){e.log?.warn({err:t instanceof Error?t.message:String(t)},`idle-shutdown: UI lookup failed; proceeding with destroy`)}await e.destroy()}}async function m(e){let{config:t,cwd:n}=e,r=e.skipAutoInit??!1,i=e.skipUiAutoSpawn??!1,a=e.idleThresholdMs??18e5,{existsSync:o,mkdirSync:s}=await import(`node:fs`),{resolve:l}=await import(`node:path`),{bootServer:m,ensureProjectGit:h,getLogger:g,isProcessAlive:_,readUiLock:v}=await import(`./dist-B969m3rv.mjs`),{resolveContentDir:y}=await import(`./paths-s1VdY11r.mjs`),b=e.log??g(`start`),x=y(t,n);o(x)||(s(x,{recursive:!0}),b.info({contentDir:x},`Created content directory`));let S=!o(l(n,`.ok`)),C=r?void 0:async()=>{try{let{initContent:e}=await import(`./init-BRl7X3F9.mjs`),t=e(n);return S||t.created.length>0||t.updated.length>0}catch(e){return console.warn(`Auto-init failed:`,e instanceof Error?e.message:e),!1}},w=!1,T=l(x,`.ok`),E=t.server.openOnAgentEdit?()=>{if(w)return;let e=v(T);if(!e||e.port<=0||!_(e.pid))return;w=!0;let t=`http://localhost:${e.port}`;import(`./open-browser-hvFa-TeR.mjs`).then(({openBrowser:e})=>e(t)).catch(()=>{})}:void 0,D=null,O=await m({contentDir:x,projectDir:n,contentRoot:t.content.dir,port:e.port,host:t.server.host,quiet:!1,onAgentWrite:E,localOpCliArgs:[process.execPath,process.argv[1]],attachUiSibling:!0,idleShutdownMs:a,skipAutoInit:r,autoInitFn:C,ensureProjectGitFn:r?void 0:()=>h(n),spawnUiSiblingFn:async({lockDir:t})=>{if(D=u({uiLock:v(t),isAlive:_}),D.action===`spawn`&&!i)try{d({lockDir:t,cwd:n,spawn:e.spawn}),b.info({reason:D.reason},`[start] auto-spawned ok ui sibling`)}catch(e){console.warn(`[start] failed to auto-spawn ok ui: ${e instanceof Error?e.message:String(e)}`)}else D.action===`skip`&&b.info({port:D.port,pid:D.pid},`UI already running at port ${D.port}`)},idleShutdownHandler:e=>p({readUiLock:()=>v(O.lockDir),isAlive:_,killPid:(e,t)=>{process.kill(e,t)},destroy:e,log:b}),log:b});D||={action:`skip`,reason:`alive`,pid:0,port:0};let k=D,A=null;if(k.action===`skip`)A=k.port>0?k.port:null;else if(!i){let t=e.uiBindTimeoutMs??3e3;A=await f({readUiLock:()=>v(O.lockDir),now:Date.now,sleep:e=>c(e),timeoutMs:t,pollIntervalMs:50}),A===null&&b.warn({timeoutMs:t},`[start] ok ui did not bind within timeout — banner falls back to API URL`)}return{httpServer:O.httpServer,destroy:O.destroy,lockDir:O.lockDir,contentDir:x,port:O.port,ready:O.ready,degraded:O.degraded,uiSpawnDecision:D,resolvedUiPort:A,didAutoInit:O.didAutoInit,didGitInit:O.didGitInit}}function h(n){return new e(`start`).description(`Start the knowledge base collab server`).option(`-p, --port <port>`,`Server port`,void 0).option(`-H, --host <host>`,`Server host`,void 0).option(`--open`,`Open browser after start`).option(`--no-init`,`Skip auto-scaffolding of .ok/`).action(async e=>{let{renderBanner:r}=await import(`./banner-DoFNyNUH.mjs`),{dim:i,error:a,info:o,warning:s}=await import(`./colors-CswooXAS.mjs`),c=n(),l=process.cwd();e.host!==void 0&&(c.server.host=e.host);let u=e.port===void 0?void 0:Number(e.port),d=process.env.PORT?Number(process.env.PORT):void 0,f=u??d,p;try{p=await m({config:c,cwd:l,port:f,skipAutoInit:e.init===!1})}catch(e){let{ProjectGitInitError:t}=await import(`./dist-B969m3rv.mjs`);e instanceof t&&(console.error(a(`open-knowledge requires git to initialize a parent repo. Install git or run 'git init' yourself, then re-run.`)),e.stderr&&console.error(i(e.stderr.trim())),process.exit(1)),console.error(`${a(`Failed to start:`)} ${e instanceof Error?e.stack??e.message:String(e)}`),process.exit(1)}let h=!1,g=async e=>{if(!h){h=!0,console.log(i(`\nShutting down (${e})...`));try{await p.destroy()}catch(e){console.error(`${a(`destroy() failed:`)} ${e instanceof Error?e.stack??e.message:String(e)}`),process.exitCode=1}process.exit(process.exitCode??0)}};process.once(`SIGINT`,()=>{g(`SIGINT`)}),process.once(`SIGTERM`,()=>{g(`SIGTERM`)});let _=`http://${c.server.host}:${p.port}`,v=c.server.host===`0.0.0.0`||c.server.host===`::`?`http://0.0.0.0:${p.port}`:void 0,y=p.resolvedUiPort,b=y!==null&&y>0?`http://${c.server.host}:${y}`:_;console.log(r({name:`open-knowledge`,version:t,localUrl:b,apiUrl:b===_?void 0:_,networkUrl:v})),p.didAutoInit&&(console.log(` ${o(`✓`)} Scaffolded .ok/ (first run)`),console.log(` ${i("Tip: Run `open-knowledge init` to register MCP tools for Claude Code")}\n`));let x={"shadow-repo":`Version history and branch-switch safety unavailable`,"file-watcher":`External file changes will not sync to the editor`,"head-watcher":`Git branch switches may cause document inconsistency`};p.ready.then(async()=>{if(p.degraded.length>0){console.log();for(let e of p.degraded){let t=x[e]??`${e} (check server logs for details)`;console.warn(` ${s(`⚠`)} ${s(e)}: ${i(t)}`)}console.log()}if(p.didAutoInit||p.didGitInit)if(p.didGitInit&&console.log(`\n ${o(`✓`)} Initialized git repo at ${l}/.git/ (default branch: main)`),p.didAutoInit)try{let{previewContent:e,formatPreviewBlock:t}=await import(`./preview-DFbaN55s.mjs`),n=e({projectDir:l,contentDir:p.contentDir});console.log(`\n${t(n,l)}\n`)}catch(e){console.warn(`Content preview unavailable: ${e instanceof Error?e.message:String(e)}`)}else console.log();if(e.open){let{openBrowser:e}=await import(`./open-browser-hvFa-TeR.mjs`);e(b)}}).catch(e=>{console.error(` ${a(`Server initialization failed:`)} ${e instanceof Error?e.message:String(e)}`)})})}export{d as a,u as i,m as n,h as o,p as r,l as s,f as t};
2
- //# sourceMappingURL=start-_eaR3T65.mjs.map
1
+ import{t as e}from"./esm-wByiX8MO.mjs";import{i as t}from"./constants-BnNhFY0P.mjs";import{spawn as n}from"node:child_process";import{join as r}from"node:path";import{closeSync as i,existsSync as a,mkdirSync as o,openSync as s}from"node:fs";import{setTimeout as c}from"node:timers/promises";function l(){let e=process.execPath,t=process.argv[1];return t?{command:e,prefixArgs:[t]}:(console.warn(`[self-spawn] process.argv[1] is empty — falling back to \`npx @inkeep/open-knowledge\`. This re-introduces the version-drift surface that re-exec was fixing. Observed argv: ${JSON.stringify(process.argv)}`),{command:`npx`,prefixArgs:[`@inkeep/open-knowledge`]})}function u(e){return e.uiLock?e.isAlive(e.uiLock.pid)?{action:`skip`,reason:`alive`,pid:e.uiLock.pid,port:e.uiLock.port}:{action:`spawn`,reason:`stale`,stalePid:e.uiLock.pid}:{action:`spawn`,reason:`absent`}}function d(e){a(e.lockDir)||o(e.lockDir,{recursive:!0});let t=s(r(e.lockDir,`last-spawn-error.log`),`w`),c=e.spawn??n,{PORT:u,...d}=process.env,f=l();try{let n=c(f.command,[...f.prefixArgs,...e.args??[`ui`]],{detached:!0,stdio:[`ignore`,`ignore`,t],cwd:e.cwd,env:d});return n.unref(),n}finally{try{i(t)}catch{}}}async function f(e){let t=e.now()+e.timeoutMs;for(;e.now()<t;){let t=e.readUiLock();if(t&&t.port>0)return t.port;await e.sleep(e.pollIntervalMs)}let n=e.readUiLock();return n&&n.port>0?n.port:null}function p(e){let t=e.sigtermGraceMs??1e4,n=e.sigtermPollIntervalMs??200,r=e.sleep??(e=>c(e));return async()=>{try{let i=e.readUiLock();if(i&&e.isAlive(i.pid))try{e.killPid(i.pid,`SIGTERM`),e.log?.info({pid:i.pid,port:i.port},`idle-shutdown: SIGTERM UI sibling`);let a=Date.now()+t;for(;Date.now()<a&&e.isAlive(i.pid);)await r(n);if(e.isAlive(i.pid))try{e.killPid(i.pid,`SIGKILL`),e.log?.warn({pid:i.pid,graceMs:t},`idle-shutdown: SIGTERM grace expired — escalated to SIGKILL`)}catch(t){e.log?.error({pid:i.pid,err:t instanceof Error?t.message:String(t)},`idle-shutdown: SIGKILL failed`)}}catch(t){e.log?.warn({pid:i.pid,err:t instanceof Error?t.message:String(t)},`idle-shutdown: failed to SIGTERM UI sibling`)}}catch(t){e.log?.warn({err:t instanceof Error?t.message:String(t)},`idle-shutdown: UI lookup failed; proceeding with destroy`)}await e.destroy()}}async function m(e){let{config:t,cwd:n}=e,r=e.skipAutoInit??!1,i=e.skipUiAutoSpawn??!1,a=e.idleThresholdMs??18e5,{existsSync:o,mkdirSync:s}=await import(`node:fs`),{resolve:l}=await import(`node:path`),{bootServer:m,ensureProjectGit:h,getLogger:g,isProcessAlive:_,readUiLock:v}=await import(`./dist-C5mH5cvM.mjs`),{resolveContentDir:y}=await import(`./paths-1NW3UxwQ.mjs`),b=e.log??g(`start`),x=y(t,n);o(x)||(s(x,{recursive:!0}),b.info({contentDir:x},`Created content directory`));let S=!o(l(n,`.ok`)),C=r?void 0:async()=>{try{let{initContent:e}=await import(`./init-CIM4I1tW.mjs`),t=e(n);return S||t.created.length>0||t.updated.length>0}catch(e){return console.warn(`Auto-init failed:`,e instanceof Error?e.message:e),!1}},w=!1,T=l(x,`.ok`),E=t.server.openOnAgentEdit?()=>{if(w)return;let e=v(T);if(!e||e.port<=0||!_(e.pid))return;w=!0;let t=`http://localhost:${e.port}`;import(`./open-browser-hvFa-TeR.mjs`).then(({openBrowser:e})=>e(t)).catch(()=>{})}:void 0,D=null,O=await m({contentDir:x,projectDir:n,contentRoot:t.content.dir,port:e.port,host:t.server.host,quiet:!1,onAgentWrite:E,localOpCliArgs:[process.execPath,process.argv[1]],attachUiSibling:!0,idleShutdownMs:a,skipAutoInit:r,autoInitFn:C,ensureProjectGitFn:r?void 0:()=>h(n),spawnUiSiblingFn:async({lockDir:t})=>{if(D=u({uiLock:v(t),isAlive:_}),D.action===`spawn`&&!i)try{d({lockDir:t,cwd:n,spawn:e.spawn}),b.info({reason:D.reason},`[start] auto-spawned ok ui sibling`)}catch(e){console.warn(`[start] failed to auto-spawn ok ui: ${e instanceof Error?e.message:String(e)}`)}else D.action===`skip`&&b.info({port:D.port,pid:D.pid},`UI already running at port ${D.port}`)},idleShutdownHandler:e=>p({readUiLock:()=>v(O.lockDir),isAlive:_,killPid:(e,t)=>{process.kill(e,t)},destroy:e,log:b}),log:b});D||={action:`skip`,reason:`alive`,pid:0,port:0};let k=D,A=null;if(k.action===`skip`)A=k.port>0?k.port:null;else if(!i){let t=e.uiBindTimeoutMs??3e3;A=await f({readUiLock:()=>v(O.lockDir),now:Date.now,sleep:e=>c(e),timeoutMs:t,pollIntervalMs:50}),A===null&&b.warn({timeoutMs:t},`[start] ok ui did not bind within timeout — banner falls back to API URL`)}return{httpServer:O.httpServer,destroy:O.destroy,lockDir:O.lockDir,contentDir:x,port:O.port,ready:O.ready,degraded:O.degraded,uiSpawnDecision:D,resolvedUiPort:A,didAutoInit:O.didAutoInit,didGitInit:O.didGitInit}}function h(n){return new e(`start`).description(`Start the knowledge base collab server`).option(`-p, --port <port>`,`Server port`,void 0).option(`-H, --host <host>`,`Server host`,void 0).option(`--open`,`Open browser after start`).option(`--no-init`,`Skip auto-scaffolding of .ok/`).action(async e=>{let{renderBanner:r}=await import(`./banner-DoFNyNUH.mjs`),{dim:i,error:a,info:o,warning:s}=await import(`./colors-CswooXAS.mjs`),c=n(),l=process.cwd();e.host!==void 0&&(c.server.host=e.host);let u=e.port===void 0?void 0:Number(e.port),d=process.env.PORT?Number(process.env.PORT):void 0,f=u??d,p;try{p=await m({config:c,cwd:l,port:f,skipAutoInit:e.init===!1})}catch(e){let{ProjectGitInitError:t}=await import(`./dist-C5mH5cvM.mjs`);e instanceof t&&(console.error(a(`open-knowledge requires git to initialize a parent repo. Install git or run 'git init' yourself, then re-run.`)),e.stderr&&console.error(i(e.stderr.trim())),process.exit(1)),console.error(`${a(`Failed to start:`)} ${e instanceof Error?e.stack??e.message:String(e)}`),process.exit(1)}let h=!1,g=async e=>{if(!h){h=!0,console.log(i(`\nShutting down (${e})...`));try{await p.destroy()}catch(e){console.error(`${a(`destroy() failed:`)} ${e instanceof Error?e.stack??e.message:String(e)}`),process.exitCode=1}process.exit(process.exitCode??0)}};process.once(`SIGINT`,()=>{g(`SIGINT`)}),process.once(`SIGTERM`,()=>{g(`SIGTERM`)});let _=`http://${c.server.host}:${p.port}`,v=c.server.host===`0.0.0.0`||c.server.host===`::`?`http://0.0.0.0:${p.port}`:void 0,y=p.resolvedUiPort,b=y!==null&&y>0?`http://${c.server.host}:${y}`:_;console.log(r({name:`open-knowledge`,version:t,localUrl:b,apiUrl:b===_?void 0:_,networkUrl:v})),p.didAutoInit&&(console.log(` ${o(`✓`)} Scaffolded .ok/ (first run)`),console.log(` ${i("Tip: Run `open-knowledge init` to register MCP tools for Claude Code")}\n`));let x={"shadow-repo":`Version history and branch-switch safety unavailable`,"file-watcher":`External file changes will not sync to the editor`,"head-watcher":`Git branch switches may cause document inconsistency`};p.ready.then(async()=>{if(p.degraded.length>0){console.log();for(let e of p.degraded){let t=x[e]??`${e} (check server logs for details)`;console.warn(` ${s(`⚠`)} ${s(e)}: ${i(t)}`)}console.log()}if(p.didAutoInit||p.didGitInit)if(p.didGitInit&&console.log(`\n ${o(`✓`)} Initialized git repo at ${l}/.git/ (default branch: main)`),p.didAutoInit)try{let{previewContent:e,formatPreviewBlock:t}=await import(`./preview-Sf_RYYpl.mjs`),n=e({projectDir:l,contentDir:p.contentDir});console.log(`\n${t(n,l)}\n`)}catch(e){console.warn(`Content preview unavailable: ${e instanceof Error?e.message:String(e)}`)}else console.log();if(e.open){let{openBrowser:e}=await import(`./open-browser-hvFa-TeR.mjs`);e(b)}}).catch(e=>{console.error(` ${a(`Server initialization failed:`)} ${e instanceof Error?e.message:String(e)}`)})})}export{d as a,u as i,m as n,h as o,p as r,l as s,f as t};
2
+ //# sourceMappingURL=start-CrKpyaZC.mjs.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkeep/open-knowledge",
3
- "version": "0.0.0-dev-20260501150416",
3
+ "version": "0.0.0-dev-20260501181216",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "exports": {
@@ -1,2 +0,0 @@
1
- import"./dist-oDoSs1Bl.mjs";var e=`0.0.0-dev-20260501150416`;const t=`config.yml`,n=`cache`,r=e,i=`open-knowledge`;export{r as i,t as n,i as r,n as t};
2
- //# sourceMappingURL=constants-CGiUuTdz.mjs.map
@@ -1 +0,0 @@
1
- import{o as e}from"./init-B3ijkT7_.mjs";export{e as runInit};
@@ -1 +0,0 @@
1
- import{r as e}from"./init-Czgpyj7J.mjs";export{e as initContent};
@@ -1 +0,0 @@
1
- import{n as e}from"./loader-Dk5RaTzD.mjs";export{e as loadConfig};
@@ -1,2 +0,0 @@
1
- import"./constants-CGiUuTdz.mjs";import{resolve as e}from"node:path";function t(t,n){return e(n,t.content.dir)}function n(t){return e(t,`.ok`)}export{n,t};
2
- //# sourceMappingURL=paths-NLm46qS1.mjs.map
@@ -1 +0,0 @@
1
- import{n as e,t}from"./paths-NLm46qS1.mjs";export{t as resolveContentDir,e as resolveLockDir};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./preview-BkLJiEZ1.mjs";export{t as formatPreviewBlock,e as previewContent};