@inkeep/open-knowledge 0.54.0-beta.1 → 0.54.0-beta.2

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 (33) hide show
  1. package/dist/{acp-harness-probe-BzmgSqA8.mjs → acp-harness-probe-CdgnSiX1.mjs} +2 -2
  2. package/dist/cli.mjs +6 -6
  3. package/dist/constants-BfTkfLb_.mjs +2 -0
  4. package/dist/index.mjs +1 -1
  5. package/dist/{init-DM4P6gP4.mjs → init-BMOmCTtk.mjs} +3 -3
  6. package/dist/init-BgBNBsz1.mjs +1 -0
  7. package/dist/{launch-json-removal-CdDuUhcm.mjs → launch-json-removal-lcolwR_B.mjs} +2 -2
  8. package/dist/{loader-CLFEaGX8.mjs → loader-21jtkH8-.mjs} +2 -2
  9. package/dist/loader-DBCQd3aT.mjs +1 -0
  10. package/dist/preview-CX7XU2cj.mjs +1 -0
  11. package/dist/{preview-DNJ9Xnme.mjs → preview-DILIawX2.mjs} +2 -2
  12. package/dist/public/assets/FeedbackForm-lEn2xy5h.js +1 -0
  13. package/dist/public/assets/SchemaConfigEditor-DhU_jWFU.js +1 -0
  14. package/dist/public/assets/{SettingsDialogBody-DgU6z-4x.js → SettingsDialogBody-FvV7PJ-x.js} +4 -4
  15. package/dist/public/assets/{index-BfoZXcbJ.js → index-CzQHudrL.js} +5 -5
  16. package/dist/public/assets/schema-fields-view-intent-DGCRVgw4.js +1 -0
  17. package/dist/public/index.html +1 -1
  18. package/dist/{repair-launch-json-ggaqjMTx.mjs → repair-launch-json-BGuk6v5-.mjs} +2 -2
  19. package/dist/{repair-mcp-configs-C9fi2PGL.mjs → repair-mcp-configs-CxB7cmFQ.mjs} +2 -2
  20. package/dist/src-D3K5FFwY.mjs +1 -0
  21. package/dist/{src-CzlLKhaZ.mjs → src-D3S37RZY.mjs} +2 -2
  22. package/dist/start-9YOKl_ky.mjs +1 -0
  23. package/dist/{start-D7fayOIn.mjs → start-Buf2BHBD.mjs} +2 -2
  24. package/package.json +4 -4
  25. package/dist/constants-DeP_CxzR.mjs +0 -2
  26. package/dist/init-DdBm3BKa.mjs +0 -1
  27. package/dist/loader-D0CeoXvV.mjs +0 -1
  28. package/dist/preview-ohubTKxE.mjs +0 -1
  29. package/dist/public/assets/FeedbackForm-CW1RBxOz.js +0 -1
  30. package/dist/public/assets/SchemaConfigEditor-CMR-IQnf.js +0 -1
  31. package/dist/public/assets/schema-fields-view-intent-D0jz38_6.js +0 -1
  32. package/dist/src-EOQRkCBx.mjs +0 -1
  33. package/dist/start-ClRDnoCe.mjs +0 -1
@@ -1,2 +1,2 @@
1
- import{d as e,ft as t,l as n,m as r,u as i}from"./sleep-C7muMiHm.mjs";import{Gs as a}from"./src-BqZfalMj.mjs";import{_ as o}from"./src-Da93CAF3.mjs";import{I as s,k as c}from"./fs-traced-CBFyXjv8.mjs";import{t as l}from"./constants-DeP_CxzR.mjs";import{t as u}from"./is-object-ByG7RnjH.mjs";import{resolve as d}from"node:path";import{existsSync as f,readFileSync as p}from"node:fs";import{realpath as m}from"node:fs/promises";var h=t();async function g(e){let t=d(e);try{return await m(t)}catch(e){if(e.code!==`ENOENT`){let n=e instanceof Error?e.message:String(e);console.warn(`[normalize-cwd] realpath failed for ${t}: ${n}`)}return t}}function _(e){if(!f(e))return{value:null,path:e,source:null,doc:null};let t;try{t=p(e,`utf-8`)}catch(t){let n=t instanceof Error?t.message:String(t);return console.warn(`[config] Failed to read ${e}: ${n}`),{value:null,path:e,source:null,doc:null,diagnostic:{code:`UNREADABLE`,detail:`${e}: ${n}`}}}let n=(0,h.parseDocument)(t);if(n.errors.length>0){let r=n.errors.map(e=>e.message).join(`; `);return console.warn(`[config] Failed to parse ${e}: ${r}`),{value:null,path:e,source:t,doc:null,diagnostic:{code:`YAML_PARSE`,detail:`${e}: ${r}`}}}let r=n.toJSON();return u(r)?{value:r,path:e,source:t,doc:n}:{value:null,path:e,source:t,doc:n}}function v(t,n){return t.map(t=>{let r=t.path.map(e=>typeof e==`symbol`?String(e):e),i={path:r,message:t.message,issueCode:t.code};if(n.doc!==null&&n.source!==null){let t=e({file:n.path,source:n.source,doc:n.doc,path:r});if(t!==void 0)return{...i,source:t}}return i})}function y(e){let t=e??process.cwd(),u=[],f=[],p=[],m=c(`user`,t),h=s({absPath:m});f.push(...h.diagnostics),!h.valid&&h.sidelinedTo!==void 0&&p.push({from:m,to:h.sidelinedTo}),h.valid&&h.source!==void 0&&u.push(m);let g=e=>{let t=_(e);if(t.diagnostic!==void 0&&f.push(t.diagnostic),t.value===null)return{};let r=n({value:t.value,file:t.path,source:t.source,doc:t.doc});return f.push(...r),u.push(e),r.length>0?i(t.value):t.value},y=d(t,`.ok`,l),b=g(y),x=g(c(`project-local`,t)),S=a(h.value,b,x),C=o.safeParse(S);if(!C.success){let e=_(y),t={code:`SCHEMA_INVALID`,issues:v(C.error.issues,e)};throw Error(r(t))}return{config:C.data,sources:u,diagnostics:f,sidelined:p}}function b(e){let t=e.cacheMs??1e3,n=e.loadConfigFn??y,r=new Map,i=new Map,a=g(e.startupCwd);return async o=>{let s=await g(o??e.startupCwd),c=Date.now(),l=r.get(s);if(l&&l.expiresAt>c)return l.config;let u=i.get(s);if(u)return await u;let d=(async()=>{if(s===await a)return r.set(s,{config:e.startupConfig,expiresAt:Date.now()+t}),e.startupConfig;let i=n(s).config;return r.set(s,{config:i,expiresAt:Date.now()+t}),i})();i.set(s,d);try{return await d}finally{i.delete(s)}}}export{y as n,b as t};
2
- //# sourceMappingURL=loader-CLFEaGX8.mjs.map
1
+ import{d as e,ft as t,l as n,m as r,u as i}from"./sleep-C7muMiHm.mjs";import{Gs as a}from"./src-BqZfalMj.mjs";import{_ as o}from"./src-Da93CAF3.mjs";import{I as s,k as c}from"./fs-traced-CBFyXjv8.mjs";import{t as l}from"./constants-BfTkfLb_.mjs";import{t as u}from"./is-object-ByG7RnjH.mjs";import{resolve as d}from"node:path";import{existsSync as f,readFileSync as p}from"node:fs";import{realpath as m}from"node:fs/promises";var h=t();async function g(e){let t=d(e);try{return await m(t)}catch(e){if(e.code!==`ENOENT`){let n=e instanceof Error?e.message:String(e);console.warn(`[normalize-cwd] realpath failed for ${t}: ${n}`)}return t}}function _(e){if(!f(e))return{value:null,path:e,source:null,doc:null};let t;try{t=p(e,`utf-8`)}catch(t){let n=t instanceof Error?t.message:String(t);return console.warn(`[config] Failed to read ${e}: ${n}`),{value:null,path:e,source:null,doc:null,diagnostic:{code:`UNREADABLE`,detail:`${e}: ${n}`}}}let n=(0,h.parseDocument)(t);if(n.errors.length>0){let r=n.errors.map(e=>e.message).join(`; `);return console.warn(`[config] Failed to parse ${e}: ${r}`),{value:null,path:e,source:t,doc:null,diagnostic:{code:`YAML_PARSE`,detail:`${e}: ${r}`}}}let r=n.toJSON();return u(r)?{value:r,path:e,source:t,doc:n}:{value:null,path:e,source:t,doc:n}}function v(t,n){return t.map(t=>{let r=t.path.map(e=>typeof e==`symbol`?String(e):e),i={path:r,message:t.message,issueCode:t.code};if(n.doc!==null&&n.source!==null){let t=e({file:n.path,source:n.source,doc:n.doc,path:r});if(t!==void 0)return{...i,source:t}}return i})}function y(e){let t=e??process.cwd(),u=[],f=[],p=[],m=c(`user`,t),h=s({absPath:m});f.push(...h.diagnostics),!h.valid&&h.sidelinedTo!==void 0&&p.push({from:m,to:h.sidelinedTo}),h.valid&&h.source!==void 0&&u.push(m);let g=e=>{let t=_(e);if(t.diagnostic!==void 0&&f.push(t.diagnostic),t.value===null)return{};let r=n({value:t.value,file:t.path,source:t.source,doc:t.doc});return f.push(...r),u.push(e),r.length>0?i(t.value):t.value},y=d(t,`.ok`,l),b=g(y),x=g(c(`project-local`,t)),S=a(h.value,b,x),C=o.safeParse(S);if(!C.success){let e=_(y),t={code:`SCHEMA_INVALID`,issues:v(C.error.issues,e)};throw Error(r(t))}return{config:C.data,sources:u,diagnostics:f,sidelined:p}}function b(e){let t=e.cacheMs??1e3,n=e.loadConfigFn??y,r=new Map,i=new Map,a=g(e.startupCwd);return async o=>{let s=await g(o??e.startupCwd),c=Date.now(),l=r.get(s);if(l&&l.expiresAt>c)return l.config;let u=i.get(s);if(u)return await u;let d=(async()=>{if(s===await a)return r.set(s,{config:e.startupConfig,expiresAt:Date.now()+t}),e.startupConfig;let i=n(s).config;return r.set(s,{config:i,expiresAt:Date.now()+t}),i})();i.set(s,d);try{return await d}finally{i.delete(s)}}}export{y as n,b as t};
2
+ //# sourceMappingURL=loader-21jtkH8-.mjs.map
@@ -0,0 +1 @@
1
+ import{n as e}from"./loader-21jtkH8-.mjs";export{e as loadConfig};
@@ -0,0 +1 @@
1
+ import{n as e,t}from"./preview-DILIawX2.mjs";export{t as formatPreviewBlock,e as previewContent};
@@ -1,3 +1,3 @@
1
- import{Vr as e}from"./src-Da93CAF3.mjs";import"./constants-DeP_CxzR.mjs";import{join as t,relative as n}from"node:path";import{existsSync as r,lstatSync as i,readdirSync as a,realpathSync as o,statSync as s}from"node:fs";function c(r){let{projectDir:c,contentDir:l,sampleCap:u=5}=r,d=[],f=[];try{i(l)}catch(e){return{totalCount:0,sample:[],contentDir:l,warnings:[`cannot access content directory ${l}: ${e instanceof Error?e.message:String(e)}`]}}let p;try{p=e({projectDir:c,contentDir:l})}catch(e){return{totalCount:0,sample:[],contentDir:l,warnings:[e instanceof Error?e.message:String(e)]}}function m(e){let r;try{r=a(e,{withFileTypes:!0})}catch(t){let r=t instanceof Error?t.message:String(t);d.push(`could not read directory ${n(l,e)||`.`}: ${r}`);return}for(let i of r){let r=t(e,i.name);if(i.isSymbolicLink()){let e;try{e=o(r)}catch(e){let t=e.code;t===`ENOENT`||t===`ELOOP`?d.push(`broken or cyclic symlink: ${n(l,r)}`):d.push(`cannot resolve symlink ${n(l,r)}: ${t??`unknown error`}`);continue}let t;try{t=s(e)}catch{continue}if(t.isDirectory()){let e=n(l,r);if(p.isDirExcluded(e))continue;m(r)}else if(t.isFile()){let e=n(l,r);if(p.isExcluded(e))continue;f.push(e)}}else if(i.isDirectory()){let e=n(l,r);if(p.isDirExcluded(e))continue;m(r)}else if(i.isFile()){let e=n(l,r);if(p.isExcluded(e))continue;f.push(e)}}}return m(l),{totalCount:f.length,sample:f.slice(0,u),contentDir:l,warnings:d}}function l(e,i){let a=[],o=n(i,e.contentDir),s=o===``?`./`:`./${o}`;if(a.push(`Content:`),a.push(` Found ${e.totalCount} markdown files in ${s}`),e.sample.length>0){let t=e.sample.join(`, `),n=e.totalCount>e.sample.length?`, …`:``;a.push(` Sample: ${t}${n}`)}if(e.warnings.length>0)for(let t of e.warnings)a.push(` Warning: ${t}`);return a.push(``),r(t(i,`.ok`,`config.yml`))?(a.push(` To adjust scope, add patterns to .okignore at the project root.`),a.push(` To change the content root, edit .ok/config.yml → content.dir.`)):a.push(" Run `open-knowledge init` to scaffold config + .okignore."),a.push(``),a.push(` Re-check anytime: open-knowledge preview`),a.join(`
1
+ import{Vr as e}from"./src-Da93CAF3.mjs";import"./constants-BfTkfLb_.mjs";import{join as t,relative as n}from"node:path";import{existsSync as r,lstatSync as i,readdirSync as a,realpathSync as o,statSync as s}from"node:fs";function c(r){let{projectDir:c,contentDir:l,sampleCap:u=5}=r,d=[],f=[];try{i(l)}catch(e){return{totalCount:0,sample:[],contentDir:l,warnings:[`cannot access content directory ${l}: ${e instanceof Error?e.message:String(e)}`]}}let p;try{p=e({projectDir:c,contentDir:l})}catch(e){return{totalCount:0,sample:[],contentDir:l,warnings:[e instanceof Error?e.message:String(e)]}}function m(e){let r;try{r=a(e,{withFileTypes:!0})}catch(t){let r=t instanceof Error?t.message:String(t);d.push(`could not read directory ${n(l,e)||`.`}: ${r}`);return}for(let i of r){let r=t(e,i.name);if(i.isSymbolicLink()){let e;try{e=o(r)}catch(e){let t=e.code;t===`ENOENT`||t===`ELOOP`?d.push(`broken or cyclic symlink: ${n(l,r)}`):d.push(`cannot resolve symlink ${n(l,r)}: ${t??`unknown error`}`);continue}let t;try{t=s(e)}catch{continue}if(t.isDirectory()){let e=n(l,r);if(p.isDirExcluded(e))continue;m(r)}else if(t.isFile()){let e=n(l,r);if(p.isExcluded(e))continue;f.push(e)}}else if(i.isDirectory()){let e=n(l,r);if(p.isDirExcluded(e))continue;m(r)}else if(i.isFile()){let e=n(l,r);if(p.isExcluded(e))continue;f.push(e)}}}return m(l),{totalCount:f.length,sample:f.slice(0,u),contentDir:l,warnings:d}}function l(e,i){let a=[],o=n(i,e.contentDir),s=o===``?`./`:`./${o}`;if(a.push(`Content:`),a.push(` Found ${e.totalCount} markdown files in ${s}`),e.sample.length>0){let t=e.sample.join(`, `),n=e.totalCount>e.sample.length?`, …`:``;a.push(` Sample: ${t}${n}`)}if(e.warnings.length>0)for(let t of e.warnings)a.push(` Warning: ${t}`);return a.push(``),r(t(i,`.ok`,`config.yml`))?(a.push(` To adjust scope, add patterns to .okignore at the project root.`),a.push(` To change the content root, edit .ok/config.yml → content.dir.`)):a.push(" Run `open-knowledge init` to scaffold config + .okignore."),a.push(``),a.push(` Re-check anytime: open-knowledge preview`),a.join(`
2
2
  `)}export{c as n,l as t};
3
- //# sourceMappingURL=preview-DNJ9Xnme.mjs.map
3
+ //# sourceMappingURL=preview-DILIawX2.mjs.map
@@ -0,0 +1 @@
1
+ import{t as e}from"./index-CzQHudrL.js";export{e as FeedbackForm};
@@ -0,0 +1 @@
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./utils-CPqDy6Hr.js";import{t as s}from"./button-CA0dewJJ.js";import{t as c}from"./label-B5yNUINo.js";import{i as l,n as u,o as d,s as f,t as p}from"./select-CguJodwX.js";import{t as m}from"./switch-B2sF5R0q.js";import{n as h}from"./dist-B6jB2qbD2.js";import{t as g}from"./createLucideIcon-Bhw2PmPp.js";import{t as _}from"./braces-CJEjDc1f.js";import{t as v}from"./case-sensitive-CE1B0vR4.js";import{t as y}from"./hash-PyoMEEnH.js";import{t as b}from"./trash-2-BWJWOK8-.js";import{t as x}from"./input-BFt4qZaV.js";import{d as S,f as C,o as w,r as T,s as E}from"./lint-config-client-kEetoezQ.js";import{i as D,r as ee,t as O}from"./EditorModeToggle-BlT04JPF.js";import{t as k}from"./tag-pill-input-Bcisv-E4.js";import{t as te}from"./useLintConfigViewMode-DX8l9aBY.js";import{r as A,t as ne}from"./schema-fields-view-intent-DGCRVgw4.js";var j=g(`brackets`,[[`path`,{d:`M16 3h3a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1h-3`,key:`1kt8lf`}],[`path`,{d:`M8 21H5a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h3`,key:`gduv9`}]]),M=g(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]),N=g(`toggle-left`,[[`circle`,{cx:`9`,cy:`12`,r:`3`,key:`u3jwor`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`5`,rx:`7`,key:`g7kal2`}]]),P=a(),F=e(n(),1),I=t(),L=[`string`,`number`,`boolean`,`array`,`object`],re=[`string`,`number`,`boolean`,`enum`,`array`,`object`],ie=[`string`,`number`,`boolean`,`enum`,`object`],R={string:{Icon:v,className:`text-green-500`},number:{Icon:y,className:`text-blue-500`},boolean:{Icon:N,className:`text-orange-500`},enum:{Icon:M,className:`text-yellow-500`},array:{Icon:j,className:`text-pink-500`},object:{Icon:_,className:`text-purple-500`}};function ae(e){let t=(0,P.c)(8),{option:n}=e,{Icon:r,className:i}=R[n],a;t[0]===i?a=t[1]:(a=o(`size-3.5 shrink-0`,i),t[0]=i,t[1]=a);let s;t[2]!==r||t[3]!==a?(s=(0,I.jsx)(r,{"aria-hidden":!0,className:a}),t[2]=r,t[3]=a,t[4]=s):s=t[4];let c;return t[5]!==n||t[6]!==s?(c=(0,I.jsxs)(`span`,{className:`flex items-center gap-2`,children:[s,n]}),t[5]=n,t[6]=s,t[7]=c):c=t[7],c}function oe(e){let t=(0,P.c)(5),{option:n}=e,{Icon:r,className:i}=R[n],a;t[0]===i?a=t[1]:(a=o(`size-4 shrink-0`,i),t[0]=i,t[1]=a);let s;return t[2]!==r||t[3]!==a?(s=(0,I.jsx)(r,{"aria-hidden":!0,className:a}),t[2]=r,t[3]=a,t[4]=s):s=t[4],s}var se=4,ce=new Set([`$schema`,`type`,`properties`,`required`]),z=new Set([`type`,`enum`,`pattern`,`format`,`items`,`description`,`properties`,`required`]);function B(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function le(e){return e===void 0?[]:Array.isArray(e)&&e.every(e=>typeof e==`string`)?e:null}function ue(e){if(Object.keys(e).some(e=>!z.has(e)))return!0;let t=e.items;if(t!==void 0){if(!B(t))return!0;let e=new Set([`enum`,`type`,`properties`,`required`,`description`]);if(Object.keys(t).some(t=>!e.has(t)))return!0}return!1}function de(e,t){return[...e.map(e=>typeof e==`string`?e:`[]`),t].join(`.`)}function fe(e){let t=(0,P.c)(28),{file:n}=e,{_:a}=i(),{data:o}=S(),s,c,l,u,d,f,p;if(t[0]!==a||t[1]!==o?.effective.plugins.frontmatter.schemas||t[2]!==n){let e=o?.effective.plugins.frontmatter.schemas.find(e=>e.file===n)?.schema,i=B(e)?Object.keys(e).filter(pe):[],m;t[10]!==a||t[11]!==n?(m={save:(e,t,r)=>{(async()=>{let i=await C(n,e,t,r);i.ok?T():h.error(i.errorDetail??a({id:`IQgeSn`}))})()},rename:(e,t,r)=>{(async()=>{let i=await E(n,e,t,r);i.ok?T():h.error(i.errorDetail??a({id:`kooyLJ`}))})()},remove:(e,t)=>{(async()=>{let r=await w(n,e,t);r.ok?T():h.error(r.errorDetail??a({id:`qC7PwZ`}))})()}},t[10]=a,t[11]=n,t[12]=m):m=t[12],c=m,u=`space-y-3`,d=`frontmatter-field-editor-${n}`,f=e===void 0&&(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,I.jsx)(r,{id:`ri6zS-`})}),t[13]!==n||t[14]!==i?(p=i.length>0&&(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,"data-testid":`frontmatter-schema-root-preserved-${n}`,children:(0,I.jsx)(r,{id:`98FP1E`,values:{0:i.join(`, `)}})}),t[13]=n,t[14]=i,t[15]=p):p=t[15],s=me,l=B(e)?e:{},t[0]=a,t[1]=o?.effective.plugins.frontmatter.schemas,t[2]=n,t[3]=s,t[4]=c,t[5]=l,t[6]=u,t[7]=d,t[8]=f,t[9]=p}else s=t[3],c=t[4],l=t[5],u=t[6],d=t[7],f=t[8],p=t[9];let m;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(m=[],t[16]=m):m=t[16];let g=`frontmatter-add-field-${n}`,_;t[17]!==s||t[18]!==c||t[19]!==l||t[20]!==g?(_=(0,I.jsx)(s,{node:l,parentPath:m,depth:0,addInputId:g,ops:c}),t[17]=s,t[18]=c,t[19]=l,t[20]=g,t[21]=_):_=t[21];let v;return t[22]!==u||t[23]!==d||t[24]!==f||t[25]!==p||t[26]!==_?(v=(0,I.jsxs)(`div`,{className:u,"data-testid":d,children:[f,p,_]}),t[22]=u,t[23]=d,t[24]=f,t[25]=p,t[26]=_,t[27]=v):v=t[27],v}function pe(e){return!ce.has(e)}function me(e){let t=(0,P.c)(19),{node:n,parentPath:r,depth:i,addInputId:a,ops:o}=e,s;t[0]===n.properties?s=t[1]:(s=B(n.properties)?n.properties:{},t[0]=n.properties,t[1]=s);let c=s,l,u;if(t[2]!==i||t[3]!==n.required||t[4]!==o||t[5]!==r||t[6]!==c){let e=Array.isArray(n.required)?n.required.filter(he):[];l=`space-y-2`,u=Object.entries(c).map(t=>{let[n,a]=t;return(0,I.jsx)(V,{field:n,property:B(a)?a:{},isRequired:e.includes(n),parentPath:r,depth:i,ops:o},n)}),t[2]=i,t[3]=n.required,t[4]=o,t[5]=r,t[6]=c,t[7]=l,t[8]=u}else l=t[7],u=t[8];let d;t[9]!==o||t[10]!==r?(d=e=>o.save(e,{type:`string`},r),t[9]=o,t[10]=r,t[11]=d):d=t[11];let f;t[12]!==a||t[13]!==d?(f=(0,I.jsx)(ve,{inputId:a,onAdd:d}),t[12]=a,t[13]=d,t[14]=f):f=t[14];let p;return t[15]!==l||t[16]!==u||t[17]!==f?(p=(0,I.jsxs)(`div`,{className:l,children:[u,f]}),t[15]=l,t[16]=u,t[17]=f,t[18]=p):p=t[18],p}function he(e){return typeof e==`string`}function V(e){let t=(0,P.c)(170),{field:n,property:a,isRequired:o,parentPath:l,depth:h,ops:g}=e,{_}=i(),[v,y]=(0,F.useState)(!1),[x,S]=(0,F.useState)(!1),C;t[0]!==n||t[1]!==l?(C=de(l,n),t[0]=n,t[1]=l,t[2]=C):C=t[2];let w=C,T=typeof a.type==`string`&&L.includes(a.type)?a.type:void 0,E;t[3]===a.enum?E=t[4]:(E=le(a.enum),t[3]=a.enum,t[4]=E);let D=E,ee;t[5]===a.items?ee=t[6]:(ee=B(a.items)?a.items:{},t[5]=a.items,t[6]=ee);let O=ee,te;t[7]===O.enum?te=t[8]:(te=le(O.enum),t[7]=O.enum,t[8]=te);let A=te,ne=typeof a.pattern==`string`?a.pattern:``,j=typeof a.description==`string`?a.description:``,M;t[9]===a?M=t[10]:(M=ue(a),t[9]=a,t[10]=M);let N=M,R=T!==`array`&&T!==`object`&&D!==null&&(v||T===void 0&&D.length>0),ae=T===`object`&&h<se,ce;t[11]===O.type?ce=t[12]:(ce=typeof O.type==`string`&&ie.includes(O.type)?O.type:void 0,t[11]=O.type,t[12]=ce);let z=ce,fe=z!==`object`&&A!==null&&(x||z===void 0&&A.length>0),pe=T===`array`&&z===`object`&&h<se,he=`frontmatter-field-row-${w}`,V;t[13]!==R||t[14]!==T?(V=(R||T!==void 0)&&(0,I.jsx)(oe,{option:R?`enum`:T}),t[13]=R,t[14]=T,t[15]=V):V=t[15];let ve=`frontmatter-field-name-${w}`,H;t[16]===_?H=t[17]:(H=_({id:`nrXDdR`}),t[16]=_,t[17]=H);let U;t[18]!==n||t[19]!==g||t[20]!==l?(U=e=>{e!==``&&e!==n&&g.rename(n,e,l)},t[18]=n,t[19]=g,t[20]=l,t[21]=U):U=t[21];let W;t[22]!==n||t[23]!==H||t[24]!==U||t[25]!==ve?(W=(0,I.jsx)(ye,{id:ve,initial:n,ariaLabel:H,className:`h-7 w-36 shrink-0 font-mono text-sm font-medium`,onCommit:U}),t[22]=n,t[23]=H,t[24]=U,t[25]=ve,t[26]=W):W=t[26];let be=`frontmatter-field-description-${w}`,G;t[27]===_?G=t[28]:(G=_({id:`PGPGsL`}),t[27]=_,t[28]=G);let K;t[29]!==_||t[30]!==n?(K=_({id:`IFALcX`,values:{field:n}}),t[29]=_,t[30]=n,t[31]=K):K=t[31];let q;t[32]!==n||t[33]!==g||t[34]!==l?(q=e=>g.save(n,{description:e===``?null:e},l),t[32]=n,t[33]=g,t[34]=l,t[35]=q):q=t[35];let J;t[36]!==j||t[37]!==be||t[38]!==G||t[39]!==K||t[40]!==q?(J=(0,I.jsx)(ye,{id:be,initial:j,placeholder:G,ariaLabel:K,className:`h-7 min-w-0 flex-1`,onCommit:q}),t[36]=j,t[37]=be,t[38]=G,t[39]=K,t[40]=q,t[41]=J):J=t[41];let xe=`frontmatter-field-required-${w}`,Se;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(Se=(0,I.jsx)(r,{id:`TMLAx2`}),t[42]=Se):Se=t[42];let Y;t[43]===xe?Y=t[44]:(Y=(0,I.jsx)(c,{htmlFor:xe,className:`shrink-0 text-xs text-muted-foreground`,children:Se}),t[43]=xe,t[44]=Y);let Ce=`frontmatter-field-required-${w}`,X;t[45]!==n||t[46]!==g||t[47]!==l?(X=e=>g.save(n,{required:e},l),t[45]=n,t[46]=g,t[47]=l,t[48]=X):X=t[48];let we=`frontmatter-field-required-${w}`,Z;t[49]!==o||t[50]!==Ce||t[51]!==X||t[52]!==we?(Z=(0,I.jsx)(m,{id:Ce,checked:o,onCheckedChange:X,"data-testid":we}),t[49]=o,t[50]=Ce,t[51]=X,t[52]=we,t[53]=Z):Z=t[53];let Te;t[54]!==n||t[55]!==g||t[56]!==l?(Te=()=>g.remove(n,l),t[54]=n,t[55]=g,t[56]=l,t[57]=Te):Te=t[57];let Ee;t[58]!==_||t[59]!==n?(Ee=_({id:`bF22t6`,values:{field:n}}),t[58]=_,t[59]=n,t[60]=Ee):Ee=t[60];let De=`frontmatter-field-remove-${w}`,Oe;t[61]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=(0,I.jsx)(b,{"aria-hidden":!0,className:`size-4`}),t[61]=Oe):Oe=t[61];let ke;t[62]!==Te||t[63]!==Ee||t[64]!==De?(ke=(0,I.jsx)(s,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,onClick:Te,"aria-label":Ee,"data-testid":De,children:Oe}),t[62]=Te,t[63]=Ee,t[64]=De,t[65]=ke):ke=t[65];let Ae;t[66]!==W||t[67]!==J||t[68]!==Y||t[69]!==Z||t[70]!==ke||t[71]!==V?(Ae=(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[V,W,J,Y,Z,ke]}),t[66]=W,t[67]=J,t[68]=Y,t[69]=Z,t[70]=ke,t[71]=V,t[72]=Ae):Ae=t[72];let je;t[73]!==w||t[74]!==N?(je=N&&(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,"data-testid":`frontmatter-field-preserved-${w}`,children:(0,I.jsx)(r,{id:`TdlVEN`})}),t[73]=w,t[74]=N,t[75]=je):je=t[75];let Me=`frontmatter-field-type-${w}`,Ne;t[76]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=(0,I.jsx)(r,{id:`-zy2Nq`}),t[76]=Ne):Ne=t[76];let Pe;t[77]===Me?Pe=t[78]:(Pe=(0,I.jsx)(c,{className:`text-xs`,htmlFor:Me,children:Ne}),t[77]=Me,t[78]=Pe);let Fe=R?`enum`:T??``,Ie;t[79]!==D?.length||t[80]!==n||t[81]!==g||t[82]!==l?(Ie=e=>{if(e===`enum`){y(!0);return}y(!1);let t=e!==`string`&&(D?.length??0)>0?{type:e,enum:null}:{type:e};g.save(n,t,l)},t[79]=D?.length,t[80]=n,t[81]=g,t[82]=l,t[83]=Ie):Ie=t[83];let Le=`frontmatter-field-type-${w}`,Re=`frontmatter-field-type-${w}`,Q;t[84]===_?Q=t[85]:(Q=_({id:`EkUnmS`}),t[84]=_,t[85]=Q);let ze;t[86]===Q?ze=t[87]:(ze=(0,I.jsx)(f,{placeholder:Q}),t[86]=Q,t[87]=ze);let Be;t[88]!==Le||t[89]!==Re||t[90]!==ze?(Be=(0,I.jsx)(d,{id:Le,"data-testid":Re,children:ze}),t[88]=Le,t[89]=Re,t[90]=ze,t[91]=Be):Be=t[91];let Ve;t[92]===Symbol.for(`react.memo_cache_sentinel`)?(Ve=(0,I.jsx)(u,{children:re.map(_e)}),t[92]=Ve):Ve=t[92];let He;t[93]!==Fe||t[94]!==Ie||t[95]!==Be?(He=(0,I.jsxs)(p,{value:Fe,onValueChange:Ie,children:[Be,Ve]}),t[93]=Fe,t[94]=Ie,t[95]=Be,t[96]=He):He=t[96];let Ue;t[97]!==Pe||t[98]!==He?(Ue=(0,I.jsxs)(`div`,{className:`space-y-1`,children:[Pe,He]}),t[97]=Pe,t[98]=He,t[99]=Ue):Ue=t[99];let We=`frontmatter-field-pattern-${w}`,Ge;t[100]===Symbol.for(`react.memo_cache_sentinel`)?(Ge=(0,I.jsx)(r,{id:`cstC0z`}),t[100]=Ge):Ge=t[100];let Ke;t[101]===We?Ke=t[102]:(Ke=(0,I.jsx)(c,{className:`text-xs`,htmlFor:We,children:Ge}),t[101]=We,t[102]=Ke);let qe=`frontmatter-field-pattern-${w}`,Je;t[103]!==n||t[104]!==g||t[105]!==l?(Je=e=>g.save(n,{pattern:e===``?null:e},l),t[103]=n,t[104]=g,t[105]=l,t[106]=Je):Je=t[106];let Ye;t[107]!==ne||t[108]!==qe||t[109]!==Je?(Ye=(0,I.jsx)(ye,{id:qe,initial:ne,onCommit:Je}),t[107]=ne,t[108]=qe,t[109]=Je,t[110]=Ye):Ye=t[110];let Xe;t[111]!==Ke||t[112]!==Ye?(Xe=(0,I.jsxs)(`div`,{className:`space-y-1`,children:[Ke,Ye]}),t[111]=Ke,t[112]=Ye,t[113]=Xe):Xe=t[113];let Ze;t[114]!==Ue||t[115]!==Xe?(Ze=(0,I.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[Ue,Xe]}),t[114]=Ue,t[115]=Xe,t[116]=Ze):Ze=t[116];let Qe;t[117]!==_||t[118]!==D||t[119]!==n||t[120]!==g||t[121]!==l||t[122]!==w||t[123]!==T?(Qe=T!==`array`&&T!==`object`&&D!==null&&(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(c,{className:`text-xs`,htmlFor:`frontmatter-field-enum-${w}`,children:(0,I.jsx)(r,{id:`UGeJuP`})}),(0,I.jsx)(k,{id:`frontmatter-field-enum-${w}`,value:D,grammar:`free-text`,onChange:e=>g.save(n,{enum:e.length===0?null:e},l),placeholder:_({id:`5tcmwY`}),"aria-label":_({id:`5qQr1u`,values:{field:n}})})]}),t[117]=_,t[118]=D,t[119]=n,t[120]=g,t[121]=l,t[122]=w,t[123]=T,t[124]=Qe):Qe=t[124];let $e;t[125]!==_||t[126]!==n||t[127]!==A?.length||t[128]!==z||t[129]!==g||t[130]!==l||t[131]!==w||t[132]!==fe||t[133]!==T?($e=T===`array`&&(0,I.jsx)(`div`,{className:`grid grid-cols-2 gap-2`,children:(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(c,{className:`text-xs`,htmlFor:`frontmatter-field-items-type-${w}`,children:(0,I.jsx)(r,{id:`6pe_G5`})}),(0,I.jsxs)(p,{value:fe?`enum`:z??``,onValueChange:e=>{if(e===`enum`){S(!0);return}S(!1);let t=e!==`string`&&(A?.length??0)>0?{itemsType:e,itemsEnum:null}:{itemsType:e};g.save(n,t,l)},children:[(0,I.jsx)(d,{id:`frontmatter-field-items-type-${w}`,"data-testid":`frontmatter-field-items-type-${w}`,children:(0,I.jsx)(f,{placeholder:_({id:`EkUnmS`})})}),(0,I.jsx)(u,{children:ie.map(ge)})]})]})}),t[125]=_,t[126]=n,t[127]=A?.length,t[128]=z,t[129]=g,t[130]=l,t[131]=w,t[132]=fe,t[133]=T,t[134]=$e):$e=t[134];let et;t[135]!==_||t[136]!==n||t[137]!==A||t[138]!==z||t[139]!==g||t[140]!==l||t[141]!==w||t[142]!==T?(et=T===`array`&&z!==`object`&&A!==null&&(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(c,{className:`text-xs`,htmlFor:`frontmatter-field-items-enum-${w}`,children:(0,I.jsx)(r,{id:`ezUmoU`})}),(0,I.jsx)(k,{id:`frontmatter-field-items-enum-${w}`,value:A,grammar:`free-text`,onChange:e=>g.save(n,{itemsEnum:e.length===0?null:e},l),placeholder:_({id:`5tcmwY`}),"aria-label":_({id:`e60wew`,values:{field:n}})})]}),t[135]=_,t[136]=n,t[137]=A,t[138]=z,t[139]=g,t[140]=l,t[141]=w,t[142]=T,t[143]=et):et=t[143];let tt;t[144]!==h||t[145]!==n||t[146]!==O||t[147]!==g||t[148]!==l||t[149]!==w||t[150]!==pe?(tt=pe&&(0,I.jsxs)(`div`,{className:`ml-2 space-y-1 border-l pl-3 pt-1`,"data-testid":`frontmatter-field-item-children-${w}`,children:[(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,I.jsx)(r,{id:`wU8WyK`})}),(0,I.jsx)(me,{node:O,parentPath:[...l,n,{items:!0}],depth:h+1,addInputId:`frontmatter-add-field-${w}.[]`,ops:g})]}),t[144]=h,t[145]=n,t[146]=O,t[147]=g,t[148]=l,t[149]=w,t[150]=pe,t[151]=tt):tt=t[151];let $;t[152]!==h||t[153]!==n||t[154]!==g||t[155]!==l||t[156]!==w||t[157]!==a||t[158]!==ae?($=ae&&(0,I.jsxs)(`div`,{className:`ml-2 space-y-1 border-l pl-3 pt-1`,"data-testid":`frontmatter-field-children-${w}`,children:[(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,I.jsx)(r,{id:`9nIrRp`})}),(0,I.jsx)(me,{node:a,parentPath:[...l,n],depth:h+1,addInputId:`frontmatter-add-field-${w}`,ops:g})]}),t[152]=h,t[153]=n,t[154]=g,t[155]=l,t[156]=w,t[157]=a,t[158]=ae,t[159]=$):$=t[159];let nt;return t[160]!==Ae||t[161]!==je||t[162]!==Ze||t[163]!==Qe||t[164]!==$e||t[165]!==et||t[166]!==tt||t[167]!==$||t[168]!==he?(nt=(0,I.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3`,"data-testid":he,children:[Ae,je,Ze,Qe,$e,et,tt,$]}),t[160]=Ae,t[161]=je,t[162]=Ze,t[163]=Qe,t[164]=$e,t[165]=et,t[166]=tt,t[167]=$,t[168]=he,t[169]=nt):nt=t[169],nt}function ge(e){return(0,I.jsx)(l,{value:e,children:(0,I.jsx)(ae,{option:e})},e)}function _e(e){return(0,I.jsx)(l,{value:e,children:(0,I.jsx)(ae,{option:e})},e)}function ve(e){let t=(0,P.c)(24),{inputId:n,onAdd:i}=e,[a,o]=(0,F.useState)(``),l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,I.jsx)(r,{id:`Va3xJe`}),t[0]=l):l=t[0];let u;t[1]===n?u=t[2]:(u=(0,I.jsx)(c,{htmlFor:n,className:`text-xs`,children:l}),t[1]=n,t[2]=u);let d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=e=>o(e.target.value),t[3]=d):d=t[3];let f=`${n}-input`,p;t[4]!==n||t[5]!==a||t[6]!==f?(p=(0,I.jsx)(x,{id:n,value:a,onChange:d,placeholder:`owner`,"data-testid":f}),t[4]=n,t[5]=a,t[6]=f,t[7]=p):p=t[7];let m;t[8]!==u||t[9]!==p?(m=(0,I.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[u,p]}),t[8]=u,t[9]=p,t[10]=m):m=t[10];let h;t[11]===a?h=t[12]:(h=a.trim(),t[11]=a,t[12]=h);let g=h===``,_;t[13]!==a||t[14]!==i?(_=()=>{i(a.trim()),o(``)},t[13]=a,t[14]=i,t[15]=_):_=t[15];let v=`${n}-save`,y;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,I.jsx)(r,{id:`m16xKo`}),t[16]=y):y=t[16];let b;t[17]!==v||t[18]!==g||t[19]!==_?(b=(0,I.jsx)(s,{size:`sm`,variant:`outline`,disabled:g,onClick:_,"data-testid":v,children:y}),t[17]=v,t[18]=g,t[19]=_,t[20]=b):b=t[20];let S;return t[21]!==b||t[22]!==m?(S=(0,I.jsxs)(`div`,{className:`flex items-end gap-2`,children:[m,b]}),t[21]=b,t[22]=m,t[23]=S):S=t[23],S}function ye(e){let t=(0,P.c)(15),{id:n,initial:r,onCommit:i,placeholder:a,ariaLabel:o,className:s}=e,[c,l]=(0,F.useState)(r),u;t[0]!==c||t[1]!==r||t[2]!==i?(u=()=>{c.trim()!==r&&i(c.trim())},t[0]=c,t[1]=r,t[2]=i,t[3]=u):u=t[3];let d=u,f;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(f=e=>l(e.target.value),t[4]=f):f=t[4];let p;t[5]===d?p=t[6]:(p=e=>{e.key===`Enter`&&d()},t[5]=d,t[6]=p);let m;return t[7]!==o||t[8]!==s||t[9]!==d||t[10]!==c||t[11]!==n||t[12]!==a||t[13]!==p?(m=(0,I.jsx)(x,{id:n,value:c,onChange:f,onBlur:d,onKeyDown:p,placeholder:a,"aria-label":o,className:s,"data-testid":n}),t[7]=o,t[8]=s,t[9]=d,t[10]=c,t[11]=n,t[12]=a,t[13]=p,t[14]=m):m=t[14],m}function H(e){return`/api/asset-text?path=${encodeURIComponent(e)}`}function U(e){let t=(0,P.c)(42),{assetPath:n}=e,{_:r}=i(),[a,o]=te(),[s,c]=(0,F.useState)(null),l=s??a,u;t[0]===o?u=t[1]:(u=e=>{c(e),o(e)},t[0]=o,t[1]=u);let d=u,f,p;t[2]===n?(f=t[3],p=t[4]):(f=()=>{let e=e=>{e===n&&ne(e)&&c(`rules`)};return e(n),A(e)},p=[n],t[2]=n,t[3]=f,t[4]=p),(0,F.useEffect)(f,p);let{data:m}=S(),h;t[5]===m?.effective.plugins.frontmatter.schemas?h=t[6]:(h=m?.effective.plugins.frontmatter.schemas??[],t[5]=m?.effective.plugins.frontmatter.schemas,t[6]=h);let g;if(t[7]!==n||t[8]!==h){let e;t[10]===n?e=t[11]:(e=e=>e.file===n,t[10]=n,t[11]=e),g=h.some(e),t[7]=n,t[8]=h,t[9]=g}else g=t[9];let _=g,v=!_||l===`source`,y;t[12]===n?y=t[13]:(y=n.split(`/`).pop()??n,t[12]=n,t[13]=y);let b=y,x;t[14]===b?x=t[15]:(x=b.includes(`.`)?(b.split(`.`).pop()??``).toLowerCase():``,t[14]=b,t[15]=x);let C=x,w;t[16]===n?w=t[17]:(w=(0,I.jsx)(ee,{entry:{kind:`asset`,path:n},className:`shrink-0 border-b bg-background px-3 py-1.5`}),t[16]=n,t[17]=w);let T;t[18]===d?T=t[19]:(T=e=>d(e===`source`?`source`:`rules`),t[18]=d,t[19]=T);let E=!_,k;t[20]===r?k=t[21]:(k=r({id:`vF68cg`}),t[20]=r,t[21]=k);let j;t[22]===r?j=t[23]:(j=r({id:`wdxz7K`}),t[22]=r,t[23]=j);let M;t[24]===r?M=t[25]:(M=r({id:`nc-ipN`}),t[24]=r,t[25]=M);let N;t[26]!==v||t[27]!==E||t[28]!==k||t[29]!==j||t[30]!==M||t[31]!==T?(N=(0,I.jsx)(`div`,{className:`flex shrink-0 items-center justify-center border-b bg-background py-2`,children:(0,I.jsx)(O,{isSourceMode:v,onModeChange:T,wysiwygDisabled:E,wysiwygLabel:k,sourceLabel:j,wysiwygDisabledReason:M})}),t[26]=v,t[27]=E,t[28]=k,t[29]=j,t[30]=M,t[31]=T,t[32]=N):N=t[32];let L;t[33]!==n||t[34]!==C||t[35]!==b||t[36]!==v?(L=v?(0,I.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:(0,I.jsx)(D,{src:H(n),assetPath:n,fileName:b,extension:C},n)}):(0,I.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-4 sm:px-6`,children:(0,I.jsx)(`div`,{className:`mx-auto w-full max-w-3xl`,children:(0,I.jsx)(fe,{file:n})})}),t[33]=n,t[34]=C,t[35]=b,t[36]=v,t[37]=L):L=t[37];let re;return t[38]!==N||t[39]!==L||t[40]!==w?(re=(0,I.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col bg-background`,"data-schema-config-editor":``,children:[w,N,L]}),t[38]=N,t[39]=L,t[40]=w,t[41]=re):re=t[41],re}export{U as SchemaConfigEditor};