@inkeep/open-knowledge 0.82.0-beta.4 → 0.82.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +6 -6
- package/dist/constants-ChfpQjIj.mjs +1 -0
- package/dist/{dist-DdoZ294B.mjs → dist-BKMK4uhh.mjs} +224 -224
- package/dist/{dist-C1WwDYOU.mjs → dist-DX-OB6FC.mjs} +1 -1
- package/dist/index.mjs +4 -4
- package/dist/{init-vgeY_wHD.mjs → init-Bvmrrn6M.mjs} +2 -2
- package/dist/init-kMgqplOQ.mjs +1 -0
- package/dist/{launch-json-removal-D4FuJ2Te.mjs → launch-json-removal-DGgpI_Jz.mjs} +1 -1
- package/dist/loader-DgBlR4_N.mjs +1 -0
- package/dist/{loader-DYbtvtxH.mjs → loader-DyhgFxyu.mjs} +1 -1
- package/dist/{md-manager-BGnqyqi1-D77IwxHB.mjs → md-manager-BGnqyqi1-CnT_8Ivp.mjs} +2 -2
- package/dist/{open-browser-Dg3gcrHM.mjs → open-browser-CuuJWVs1.mjs} +1 -1
- package/dist/parse-worker.mjs +1 -1
- package/dist/preview-3fHrsz6g.mjs +1 -0
- package/dist/{preview-1EGVW00C.mjs → preview-CS-ZP7yP.mjs} +1 -1
- package/dist/public/assets/{ActivityModeContent-qim4zFx-.js → ActivityModeContent-CVkgwfSl.js} +1 -1
- package/dist/public/assets/{AddPropertiesButton-DKXiB5hC.js → AddPropertiesButton-D16oCS_N.js} +2 -2
- package/dist/public/assets/{AgentDiffPane-BD8yOgrS.js → AgentDiffPane-HH8jeegf.js} +1 -1
- package/dist/public/assets/{AgentThreadClientBinder-18BD6ihn.js → AgentThreadClientBinder-BeRtMFJl.js} +1 -1
- package/dist/public/assets/{BugReportHistory-C2kxTgHh.js → BugReportHistory-B-6LLHxx.js} +1 -1
- package/dist/public/assets/{BugReportHistoryDialog-DgtiL-NP.js → BugReportHistoryDialog-CNK92-ge.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-D7ODqRwE.js → CodeMirrorPropInput-DF3sY_TW.js} +1 -1
- package/dist/public/assets/{ConsentDialogBody-CD7KM28d.js → ConsentDialogBody-c59kzsDd.js} +1 -1
- package/dist/public/assets/{DeleteConfirmationDialog-C1zIx9Bd.js → DeleteConfirmationDialog-CW-EDwBk.js} +1 -1
- package/dist/public/assets/{DiffViewBoundary-DGNf5H84.js → DiffViewBoundary-BCeCuRF4.js} +1 -1
- package/dist/public/assets/{DocumentContext-BHjfklWj.js → DocumentContext-Be48_bAF.js} +1 -1
- package/dist/public/assets/{EditorModeToggle-XKuoOdJs.js → EditorModeToggle-DtMDf2MQ.js} +1 -1
- package/dist/public/assets/{ExcalidrawDocEditor-I2eQXX7E.js → ExcalidrawDocEditor-BJ2A3QGa.js} +1 -1
- package/dist/public/assets/FeedbackForm-Ap-gvcmO.js +1 -0
- package/dist/public/assets/{GraphPanel-nDzxbZwr.js → GraphPanel-BCNpJurX.js} +1 -1
- package/dist/public/assets/{ImageAttachments-Dob2zdX6.js → ImageAttachments-DaSjleMs.js} +1 -1
- package/dist/public/assets/{ImportSkillDialog-CU7KSDgH.js → ImportSkillDialog-BldGupBv.js} +1 -1
- package/dist/public/assets/{LintConfigEditor-81_fDdG_.js → LintConfigEditor-DnD5pFzI.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-BsdnBIW1.js +1 -0
- package/dist/public/assets/{ManagedArtifactProperties-DTfJaeLZ.js → ManagedArtifactProperties-BtTz8dwV.js} +1 -1
- package/dist/public/assets/{MermaidDocEditor-Dw5SypSn.js → MermaidDocEditor-CkwkPZvu.js} +1 -1
- package/dist/public/assets/{OpenInAgentMenuItem-BMo7aLCS.js → OpenInAgentMenuItem-tMDoc20x.js} +1 -1
- package/dist/public/assets/{PropertyDisplayRow-Bn0kgK3p.js → PropertyDisplayRow-FgvNazvo.js} +1 -1
- package/dist/public/assets/{RegisteredAgentIcon-DbL9sShX.js → RegisteredAgentIcon-XDCjRE4q.js} +1 -1
- package/dist/public/assets/{ReportBugDialogBody-DEETk9Jo.js → ReportBugDialogBody-bsGBQfHH.js} +1 -1
- package/dist/public/assets/{ReportBugMenuTrigger-B1WREGjA.js → ReportBugMenuTrigger-BAbnNfBU.js} +1 -1
- package/dist/public/assets/{SchemaConfigEditor-BLXTxBGL.js → SchemaConfigEditor-BU8wFtDN.js} +1 -1
- package/dist/public/assets/{SessionsHost-DquHUp9T.js → SessionsHost-BdpjIit2.js} +2 -2
- package/dist/public/assets/{SettingsDialogBody-DKEUH63t.js → SettingsDialogBody-DmPhthSq.js} +1 -1
- package/dist/public/assets/{ShareBranchSwitchDialog-BUS2my96.js → ShareBranchSwitchDialog-CPn3XsGL.js} +1 -1
- package/dist/public/assets/{ShareReceiveDialog-BKgD7Duc.js → ShareReceiveDialog-CavmNNtc.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-_8dejDWk.js → ShareReceiveMissDialog-C6Yv1L_L.js} +1 -1
- package/dist/public/assets/{SkillCostValue-CmCcSYjJ.js → SkillCostValue-CxnOdbgc.js} +1 -1
- package/dist/public/assets/{SkillEditBanner-DFdS9BhL.js → SkillEditBanner-DFTQUggR.js} +1 -1
- package/dist/public/assets/{SkillForkDialog-D5Aha7ke.js → SkillForkDialog-Bl0Maun5.js} +1 -1
- package/dist/public/assets/{SkillInstallMenu-Cju9gFSt.js → SkillInstallMenu-BW2fj8iT.js} +1 -1
- package/dist/public/assets/{SkillOriginInline-DPQ0UfdG.js → SkillOriginInline-Bo9-sZlU.js} +1 -1
- package/dist/public/assets/{SkillToolbarControls-SRsQowBm.js → SkillToolbarControls-xd9ybWt3.js} +1 -1
- package/dist/public/assets/{SlidesToolbarControls-8Tu4pV-S.js → SlidesToolbarControls-CDqPA4DN.js} +1 -1
- package/dist/public/assets/{SourceEditor-DUhZs5yo.js → SourceEditor-xUkiBN-x.js} +1 -1
- package/dist/public/assets/{SyncStatusBadge-B9wP5KjD.js → SyncStatusBadge-CMEBaJDA.js} +1 -1
- package/dist/public/assets/{TerminalPanel-Db-Lo-iL.js → TerminalPanel-BAdFCbjj.js} +1 -1
- package/dist/public/assets/{TerminalWindowApp-CAjzSiBI.js → TerminalWindowApp-D8Gswz-L.js} +1 -1
- package/dist/public/assets/{TextDocEditor-C7dpFdVd.js → TextDocEditor-CjRA_0cY.js} +1 -1
- package/dist/public/assets/{ThreadView-CsZKSzs5.js → ThreadView-CKZltO5Y.js} +1 -1
- package/dist/public/assets/{TimelineDiffPane-DcChEu2J.js → TimelineDiffPane-BxiAJgWC.js} +1 -1
- package/dist/public/assets/{agent-connections-iuaYc-Gk.js → agent-connections-B2xlqiAt.js} +1 -1
- package/dist/public/assets/{auth-state-cache-Dz-Yvu70.js → auth-state-cache-DkvW2mTJ.js} +1 -1
- package/dist/public/assets/{bug-report-send-manager-0DIkaLj0.js → bug-report-send-manager-Ep6NupAy.js} +1 -1
- package/dist/public/assets/{client-version-DJFCNOKL.js → client-version-aG92qoP2.js} +1 -1
- package/dist/public/assets/{comment-chips-jwrddJ4n.js → comment-chips-C8z94Yh3.js} +1 -1
- package/dist/public/assets/{config-provider-B4cgjuAt.js → config-provider-myFxAeZJ.js} +1 -1
- package/dist/public/assets/{css-color-to-hex-oO6GoCcb.js → css-color-to-hex-B1w0Vq2i.js} +1 -1
- package/dist/public/assets/{diagnostic-breadcrumb-DK-Cqae0.js → diagnostic-breadcrumb-YcMRmDMq.js} +1 -1
- package/dist/public/assets/{dist-CUgbgEDy.js → dist-DmvVdMAc.js} +2 -2
- package/dist/public/assets/{doc-paths-DaHerw67.js → doc-paths-CU5xFEmw.js} +1 -1
- package/dist/public/assets/{doc-undo-manager-ZAJ7EhHf.js → doc-undo-manager-Bb2wXN7B.js} +1 -1
- package/dist/public/assets/{documents-events-AGLgPGQa.js → documents-events-DChefUoE.js} +1 -1
- package/dist/public/assets/{file-tree-adapter--GNP_kR2.js → file-tree-adapter-CrwKZd5V.js} +1 -1
- package/dist/public/assets/{file-tree-utils-lPpxK5Yq.js → file-tree-utils-B-KHAA0w.js} +1 -1
- package/dist/public/assets/{folder-config-api-DDOXhGdo.js → folder-config-api-y_2lDcJg.js} +1 -1
- package/dist/public/assets/{index-BdhkBLck.js → index-Xs-rHCdv.js} +8 -8
- package/dist/public/assets/{lint-config-client-B_xNfTBy.js → lint-config-client-kGMpwF3X.js} +1 -1
- package/dist/public/assets/{markdownlint-rule-browser-DzjG_qoM.js → markdownlint-rule-browser-BZlDsCDj.js} +1 -1
- package/dist/public/assets/{navigation-targets-DV1dMVAb.js → navigation-targets-BX0D_UPk.js} +1 -1
- package/dist/public/assets/{page-list-cache-BaKlIcC-.js → page-list-cache-DRXLxcuB.js} +1 -1
- package/dist/public/assets/{pending-receive-nav-store-4xt56kJR.js → pending-receive-nav-store-C6LJ2Kzv.js} +1 -1
- package/dist/public/assets/{preferred-session-events-CeCXvWmc.js → preferred-session-events-B7RLIJvY.js} +1 -1
- package/dist/public/assets/{progress-D6YLD7xV.js → progress-Dutcigeg.js} +1 -1
- package/dist/public/assets/{project-paths-Cs2SPmYR.js → project-paths-Rt7fORWq.js} +1 -1
- package/dist/public/assets/{prop-types-Dv_cZRA5.js → prop-types-B2w_fFJW.js} +1 -1
- package/dist/public/assets/{receive-store-CvglCO2B.js → receive-store-VACJKx3F.js} +1 -1
- package/dist/public/assets/{selection-context-CDv7YpZ_.js → selection-context-Cq2VCQBg.js} +1 -1
- package/dist/public/assets/{sign-in-terminal-events-BigKQgqQ.js → sign-in-terminal-events-DXTC0inU.js} +1 -1
- package/dist/public/assets/{skill-scope-BGcfBWlz.js → skill-scope-DX2Q9lzh.js} +1 -1
- package/dist/public/assets/{skills-api-mYKB0zDh.js → skills-api-Cpwwq_FO.js} +1 -1
- package/dist/public/assets/{src-xGMvMbEd.js → src-CGPFfpcu.js} +1 -1
- package/dist/public/assets/{startup-marks-yQqTMBm5.js → startup-marks-CJJqLRKP.js} +1 -1
- package/dist/public/assets/{tag-pill-input-BQLv6DZ1.js → tag-pill-input-DLQqKzbN.js} +1 -1
- package/dist/public/assets/{target-navigation-intent-BIFEl4OT.js → target-navigation-intent-BwAGdOsi.js} +1 -1
- package/dist/public/assets/{telemetry-startup-DyEWsvUO.js → telemetry-startup-CMJw54MN.js} +1 -1
- package/dist/public/assets/{terminal-command-events-CoTkNESn.js → terminal-command-events-CoI7bIgQ.js} +1 -1
- package/dist/public/assets/{terminal-launch-events-BBjjknBw.js → terminal-launch-events-BMFqKHQ8.js} +1 -1
- package/dist/public/assets/{terminal-telemetry-CGR3Wr8L.js → terminal-telemetry-C0nwSvRH.js} +1 -1
- package/dist/public/assets/{thread-client-V2_Sw10t.js → thread-client-2zOGI06i.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-Bwb8vXQS.js → typing-burst-detector-SGbZpXed.js} +1 -1
- package/dist/public/assets/{uninstall-BcI5d3jC.js → uninstall-Bqv6A4OL.js} +1 -1
- package/dist/public/assets/{use-activity-panel-Bm-_7omz.js → use-activity-panel-D3mCupUz.js} +1 -1
- package/dist/public/assets/{use-apply-config-language-Bzn7Rbw_.js → use-apply-config-language--jTlcFWU.js} +1 -1
- package/dist/public/assets/{use-collab-url-D3j3svaH.js → use-collab-url-Bs4wUHQ8.js} +1 -1
- package/dist/public/assets/{use-conflicts-8sSRJ_Uy.js → use-conflicts-Due_s21R.js} +1 -1
- package/dist/public/assets/{use-git-sync-status-CBlTkWfK.js → use-git-sync-status-CLv7EZOq.js} +1 -1
- package/dist/public/assets/{use-installed-clis-ClKL7RtP.js → use-installed-clis-L2RDjEtc.js} +2 -2
- package/dist/public/assets/{use-live-xterm-theme-bJiLIpxd.js → use-live-xterm-theme-XZgq5LKh.js} +1 -1
- package/dist/public/assets/{use-open-skill-BpW3ZhuK.js → use-open-skill-DV5hhMVO.js} +1 -1
- package/dist/public/assets/{use-settings-route-DL25HSeL.js → use-settings-route-DI6YfB7r.js} +1 -1
- package/dist/public/assets/{use-skill-origin-Cts8svd2.js → use-skill-origin-ChIkNH5y.js} +1 -1
- package/dist/public/assets/{use-skills-DXlhkRBq.js → use-skills-B1b-aZeu.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-Br80VTvl.js → use-terminal-enabled-Djcq-lbC.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-l604pHZz.js → use-timeline-entry-diff-BGpMCJkj.js} +1 -1
- package/dist/public/assets/{use-workspace-DtyUPSZ4.js → use-workspace-Byr5yIN5.js} +1 -1
- package/dist/public/index.html +59 -59
- package/dist/public/uninstall.html +3 -3
- package/dist/{registry-probes-BXgdIidc.mjs → registry-probes-BqQhP0ax.mjs} +1 -1
- package/dist/{removal-file-path-Ce-oxAGQ.mjs → removal-file-path-BeRPeEws.mjs} +1 -1
- package/dist/{repair-launch-json-CtsInz2s.mjs → repair-launch-json-CzMEUN6E.mjs} +1 -1
- package/dist/{repair-mcp-configs-BESnoIPY.mjs → repair-mcp-configs-DiEzfN1-.mjs} +1 -1
- package/dist/src-C_P2wuNq.mjs +1 -0
- package/dist/{src-KNAqsxPK.mjs → src-DwoFHSWS.mjs} +1 -1
- package/dist/start-Ct8veQKD.mjs +1 -0
- package/dist/{start-B8iic9V_.mjs → start-jgWvvxuy.mjs} +3 -3
- package/package.json +4 -4
- package/dist/constants-W9G4vRvJ.mjs +0 -1
- package/dist/init-DaBUbh8G.mjs +0 -1
- package/dist/loader-YyyVC5zh.mjs +0 -1
- package/dist/preview-BQhr7b8a.mjs +0 -1
- package/dist/public/assets/FeedbackForm-BQ8aBBom.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-yEjDaTS8.js +0 -1
- package/dist/src-BPwbNxCr.mjs +0 -1
- package/dist/start-BXE7aaH4.mjs +0 -1
package/dist/index.mjs
CHANGED
|
@@ -340,7 +340,7 @@ ${t.slice(l+2)}`,d+=1;else break}t.push({indent:l,number:parseInt(s,10),content:
|
|
|
340
340
|
`)],d);let{effectiveConfig:_,rulesEnabled:v,rulesSeverity:y}=LI(e,i,o),b=[...v.keys()];return s=new Map(v),c=s,u(t,p),u(t,m,h),u(t,g),{effectiveConfig:_,enabledRulesPerLineNumber:l,enabledRuleList:e.filter(e=>{let t=e.names[0].toUpperCase();return l.some(e=>e.get(t))}),rulesSeverity:y}}function zI(t,n,r,i,a,o,s,c,l,u,d,f){let p=e=>f(e instanceof Error?e:Error(e));i=i.replace(/^\uFEFF/,``);let m=FI(i,c),{frontMatterLines:h}=m;i=m.content;let{effectiveConfig:g,enabledRulesPerLineNumber:_,enabledRuleList:v,rulesSeverity:y}=RI(t,i.split(Q.newLineRe),h,u,o,s,n),b=v.some(e=>e.parser===`markdownit`||e.parser===void 0),x=v.some(e=>e.parser===`micromark`),S=t.length!==MI.length,C=x?tF(i,{freezeTokens:S}):[],w=i;i=Q.clearHtmlCommentText(i);let T=i.split(Q.newLineRe),E=e=>{let t=Object.freeze({markdownit:Object.freeze({tokens:e})}),n=Object.freeze({micromark:Object.freeze({tokens:C})}),i=Object.freeze({}),a={name:r,version:dN,lines:Object.freeze(T),frontMatterLines:Object.freeze(h)};oN({...a,parsers:n,config:{}});let o=[],s=s=>{let c=s.names[0].toUpperCase(),u={},d=i;s.parser===void 0?(u.tokens=e,d=t):s.parser===`markdownit`?d=t:s.parser===`micromark`&&(d=n);let f=Object.freeze({...a,...u,parsers:d,config:g[c]});function p(e){throw Error(`Value of '${e}' passed to onError by '${c}' is incorrect for '${r}'.`)}function m(e){(!e||!Q.isNumber(e.lineNumber)||e.lineNumber<1||e.lineNumber>T.length)&&p(`lineNumber`);let t=e.lineNumber+h.length;if(!_[t].get(c))return;e.detail&&!Q.isString(e.detail)&&p(`detail`),e.context&&!Q.isString(e.context)&&p(`context`),e.information&&!Q.isUrl(e.information)&&p(`information`),e.range&&(!Array.isArray(e.range)||e.range.length!==2||!Q.isNumber(e.range[0])||e.range[0]<1||!Q.isNumber(e.range[1])||e.range[1]<1||e.range[0]+e.range[1]-1>T[e.lineNumber-1].length)&&p(`range`);let n=e.fixInfo,r={};if(n){Q.isObject(n)||p(`fixInfo`),n.lineNumber!==void 0&&((!Q.isNumber(n.lineNumber)||n.lineNumber<1||n.lineNumber>T.length)&&p(`fixInfo.lineNumber`),r.lineNumber=n.lineNumber+h.length);let t=n.lineNumber||e.lineNumber;n.editColumn!==void 0&&((!Q.isNumber(n.editColumn)||n.editColumn<1||n.editColumn>T[t-1].length+1)&&p(`fixInfo.editColumn`),r.editColumn=n.editColumn),n.deleteCount!==void 0&&((!Q.isNumber(n.deleteCount)||n.deleteCount<-1||n.deleteCount>T[t-1].length)&&p(`fixInfo.deleteCount`),r.deleteCount=n.deleteCount),n.insertText!==void 0&&(Q.isString(n.insertText)||p(`fixInfo.insertText`),r.insertText=n.insertText)}let i=e.information||s.information;o.push({lineNumber:t,ruleNames:s.names,ruleDescription:s.description,ruleInformation:i?i.href:null,errorDetail:e.detail?.replace(Q.newLineRe,` `)||null,errorContext:e.context?.replace(Q.newLineRe,` `)||null,errorRange:e.range?[...e.range]:null,fixInfo:n?r:null,severity:y.get(c)})}let v=e=>m({lineNumber:1,detail:`This rule threw an exception: ${e.message||e}`}),b=()=>s.function(f,m);if(s.asynchronous){let e=Promise.resolve().then(b);return l?e.catch(v):e}try{b()}catch(e){if(l)v(e);else throw e}return null},c=()=>(o.sort((e,t)=>e.ruleNames[0].localeCompare(t.ruleNames[0])||e.lineNumber-t.lineNumber),o),u=v.filter(e=>e.asynchronous),d=v.filter(e=>!e.asynchronous),m=[...u,...d],b=()=>f(null,c());try{let e=m.map(s);u.length>0?Promise.all(e.slice(0,u.length)).then(b).catch(p):b()}catch(e){p(e)}finally{oN()}};!b||d?E(b?(0,hN.requireMarkdownItCjs)().getMarkdownItTokens(a(),w,T):[]):Promise.all([Promise.resolve().then(()=>e(fN(),1)),new Promise(e=>e(a()))]).then(([e,t])=>{let n=e.getMarkdownItTokens(t,w,T);E(n)}).catch(p)}function BI(e,t,n,r,i,a,o,s,c,l,u,d){function f(l,f){return l?d(l):zI(e,t,n,f,r,i,a,o,s,c,u,d)}u?f(null,l.readFileSync(n,`utf8`)):l.readFile(n,`utf8`,f)}function VI(e,t,n){e||={},n||=()=>{};let r=[e.customRules||[]].flat().map(e=>({names:Q.cloneIfArray(e.names),description:e.description,information:Q.cloneIfUrl(e.information),tags:Q.cloneIfArray(e.tags),parser:e.parser,asynchronous:e.asynchronous,function:e.function})),i=MI.concat(r),a=PI(i,t);if(a){n(a);return}let o=[];Array.isArray(e.files)?o=[...e.files]:e.files&&(o=[String(e.files)]);let s=e.strings||{},c=Object.keys(s),l=e.config||{default:!0},u=e.configParsers||void 0,d=e.frontMatter===void 0?Q.frontMatterRe:e.frontMatter,f=!!e.handleRuleFailures,p=!!e.noInlineConfig,m=e.markdownItFactory||(()=>{throw Error(`The option 'markdownItFactory' was required (due to the option 'customRules' including a rule requiring the 'markdown-it' parser), but 'markdownItFactory' was not set.`)}),h=e.fs||$M,g=II(i),_={},v=!1,y=0;function b(){let e;function r(r,i){return y--,r?(v=!0,n(r)):(_[e]=i,t||b(),null)}if(!v){if(e=o.shift())y++,BI(i,g,e,m,l,u,d,f,p,h,t,r);else if(e=c.shift())y++,zI(i,g,e,s[e]||``,m,l,u,d,f,p,t,r);else if(y===0){v=!0;let e=Object.entries(_);e.sort(([e],[t])=>e.localeCompare(t));let t=Object.fromEntries(e);return n(null,t)}}return null}if(t)for(;!v;)b();else b(),b(),b(),b(),b(),b(),b(),b()}function HI(e){let t=null;return VI(e,!0,function(e,n){if(e)throw e;t=n}),t}function UI(e,t=0){return{lineNumber:e.lineNumber||t,editColumn:e.editColumn||1,deleteCount:e.deleteCount||0,insertText:e.insertText||``}}function WI(e,t,n=`
|
|
341
341
|
`){let{editColumn:r,deleteCount:i,insertText:a}=UI(t),o=r-1;return i===-1?null:e.slice(0,o)+a.replace(/\n/g,n)+e.slice(o+i)}function GI(e,t){let n=Q.getPreferredLineEnding(e,eN),r=e.split(Q.newLineRe),i=t.filter(e=>e.fixInfo).map(e=>UI(e.fixInfo,e.lineNumber));i.sort((e,t)=>{let n=e.deleteCount===-1,r=t.deleteCount===-1;return t.lineNumber-e.lineNumber||(n?1:r?-1:0)||t.editColumn-e.editColumn||t.insertText.length-e.insertText.length});let a={};i=i.filter(e=>{let t=e.lineNumber!==a.lineNumber||e.editColumn!==a.editColumn||e.deleteCount!==a.deleteCount||e.insertText!==a.insertText;return a=e,t}),a={lineNumber:-1};for(let e of i)e.lineNumber===a.lineNumber&&e.editColumn===a.editColumn&&!e.insertText&&e.deleteCount>0&&a.insertText&&!a.deleteCount&&(e.insertText=a.insertText,a.lineNumber=0),a=e;i=i.filter(e=>e.lineNumber);let o=-1,s=-1;for(let e of i){let{lineNumber:t,editColumn:i,deleteCount:a}=e,c=t-1,l=i-1;(c!==o||a===-1||l+a<=s-(a>0?0:1))&&(r[c]=WI(r[c],e,n)),o=c,s=l}return r.filter(e=>e!==null).join(n)}function KI(e,t){let n=typeof e==`string`?e:e.origin,r=typeof e==`string`?void 0:e.url,i=n.split(`:`),a=i[1]?i[0]:void 0,o=i[1];return Object.defineProperty(s,"name",{value:n}),s;function s(e){let[n,i]=qI(o,e),s=n===2;if(n)return function(e,n,c){let l=n.messages.length-1;fO(t,function(e){let t=n.messages;if(e&&!t.includes(e))try{n.fail(e)}catch{}for(;++l<t.length;)Object.assign(t[l],{fatal:s,ruleId:o,source:a,url:r});c()})(e,n,i)}}}function qI(e,t){if(Array.isArray(t)){let[n,r]=t;switch(n){case!1:case 0:case`off`:return[0,r];case!0:case 1:case`on`:case`warn`:return[1,r];case 2:case`error`:return[2,r];default:if(typeof n==`number`)throw Error("Incorrect severity `"+n+"` for `"+e+"`, expected 0, 1, or 2");return[1,t]}}return[1,t]}var JI={SINGLE_TILDE:0,COMPARISON_OPERATORS:5,HTML_TAGS:10,SETEXT_HEADINGS:15,LINKS:20,BOLD_ITALIC:30,BOLD:35,ITALIC_DOUBLE_UNDERSCORE:40,ITALIC_SINGLE_ASTERISK:41,ITALIC_SINGLE_UNDERSCORE:42,INLINE_CODE:50,STRIKETHROUGH:60,KATEX:70,INLINE_KATEX:75,DEFAULT:100};JI.SINGLE_TILDE,JI.COMPARISON_OPERATORS,JI.HTML_TAGS,JI.SETEXT_HEADINGS,JI.LINKS,JI.BOLD_ITALIC,JI.BOLD,JI.ITALIC_DOUBLE_UNDERSCORE,JI.ITALIC_SINGLE_ASTERISK,JI.ITALIC_SINGLE_UNDERSCORE,JI.INLINE_CODE,JI.STRIKETHROUGH,JI.KATEX,JI.INLINE_KATEX,new Set(xa),[{id:`mcp-preapproval`,piece:`mcp`,scope:`project`,requiredStrictness:`pre-approval-exact`,revokedByForeignEntry:!1},{id:`tool-autoapprove`,piece:`mcp`,requiredStrictness:`pre-approval-exact`,revokedByForeignEntry:!0}].map(e=>e.id),U([`count-unverified`,`not-count`]),U([`acp-catalog-supported`,`harness-cli-on-path`,`os-scheme-handler`]),wa.filter(e=>e!==`session`);const YI={agent:Sa},XI={"followup.enable-manually":{params:Bi(YI)},"guidance.mcp.user-config":{params:Bi(YI)},"guidance.mcp.project-config":{params:Bi(YI)},"guidance.mcp.session-injection":{params:Bi(YI)},"guidance.mcp.managed-file":{params:Bi(YI)},"guidance.skill.project":{params:Bi(YI)},"guidance.skill.user":{params:Bi(YI)},"guidance.skill.central-store":{params:Bi(YI)},"troubleshooting.claude.project-entry-not-approved":{params:Bi(YI)},"troubleshooting.claude-desktop.per-tool-approval":{params:Bi(YI)},"troubleshooting.cursor.project-entry-not-loaded":{params:Bi({...YI,server:F().optional()})},"troubleshooting.codex.desktop-project-config":{params:Bi({...YI,honoredByDesktop:L()})},"troubleshooting.codex.folder-trust":{params:Bi(YI)},"troubleshooting.copilot.shared-workspace-config":{params:Bi({...YI,sourceAgent:Sa})},"troubleshooting.openclaw.central-store-missing":{params:Bi(YI)},"troubleshooting.pi.folder-trust":{params:Bi(YI)},"troubleshooting.lm-studio.config-path-mismatch":{params:Bi(YI)}};Object.keys(XI).sort(),Qa.flatMap(e=>e.probe.mode===`probeable`?[{satisfierId:e.id,agent:e.agent,piece:e.piece,scope:e.scope,kind:e.kind,pathId:e.pathId??null,strictness:e.probe.strictness}]:[]).map(e=>e.satisfierId);const ZI=U(ct),QI=B({kind:U([`source-read`,`measured`,`vendor-doc`,`upstream-issue`,`observation`]),ref:F().min(1),note:F().optional()}),$I=B({version:F().min(1).optional(),observedAt:F().min(1)}),eL=Wi(`confidence`,[B({confidence:W(`verified`),evidence:z(QI).min(1),verifiedAgainst:$I.optional()}),B({confidence:W(`assumed`),evidence:z(QI).min(1),verifiedAgainst:$I.optional()}),B({confidence:W(`contested`),evidence:z(QI).min(1),verifiedAgainst:$I})]),tL=B({id:_re,params:H(F(),V([F(),I(),L()])).optional()}),nL=Wi(`mode`,[B({mode:W(`probeable`),strictness:z(ba).min(1)}),B({mode:W(`unprobeable`),reason:U([`no-readable-state`,`different-machine`,`no-programmatic-path`,`session-scoped`]),note:F().optional()})]),rL=U([`this-project`,`this-user`,`this-machine`]),iL=U([`installable`,`user-completes`,`not-installable`]),aL=B({id:Ea,agent:Sa,piece:Ca,scope:Ta,kind:lre,pathId:gre.optional(),sharedWith:z(Sa).default([]),prerequisites:z(Ea).default([]),consentClass:ure.default(`none`),probe:nL,attestation:eL,audience:rL,installability:iL.default(`installable`),notInstallableReason:U([`no-non-interactive-verb`,`session-scoped`,`no-surface`]).optional(),preferred:L().default(!1),guidance:tL.optional(),followup:tL.optional(),troubleshooting:z(tL).default([])}),oL=B({piece:Ca,level:fre,satisfiedByAny:z(Ea)}),sL=B({acpAgentId:F().min(1),featuredOrder:I().int().nonnegative().nullable(),harnessCli:mre.nullable(),harnessReadsEditorConfig:ZI.nullable(),harnessReadsEditorConfigAttestation:eL,verifiedPosture:U([`asks`,`self-managed`,`autonomous`]).nullable()}),cL=B({cliId:F().min(1)}),lL=B({targetId:hre,knownOrder:I().int().nonnegative(),visible:L(),displayName:F().min(1),appBrandName:F().min(1).optional(),schemes:z(F().min(1)),installUrl:F().min(1),tagline:F().min(1).optional()}),uL=B({requirements:z(oL),caveats:z(tL).default([])});B({id:Sa,setupDocSlug:F().min(1).nullable(),offerOnlyWhenDetected:L().default(!1),offersConnectionRow:L().default(!1),detectionSources:z(F().min(1)).default([]),satisfiers:z(aL),modes:Xi(pre,uL),acp:sL.optional(),terminal:cL.optional(),external:lL.optional()}),B({id:F().min(1),requiredStrictness:ba,scope:Ta.optional(),piece:Ca,revokedByForeignEntry:L().default(!1),guidance:tL.optional()}),new ad.default;const dL=B({path:z(V([F(),I()])),message:F(),issueCode:F()});Wi(`code`,[B({code:W(`SCHEMA_INVALID`),issues:z(dL)}),B({code:W(`WRITE_ERROR`),detail:F()})]),Object.freeze({source:`local`,skipStoreHooks:!1,context:Object.freeze({origin:`form-write`})});function fL(e,t){return e>=(t===`leading`?2:1)?e:0}function pL(e,t){let n={line:e,column:1,offset:t};return{type:`paragraph`,children:[],position:{start:n,end:{...n}}}}function mL(e,t){let n=e.children,r=n.length===0||t.leading===void 0?0:fL(t.leading.length,`leading`),i=n.length===0||t.trailing===void 0?0:fL(t.trailing.length-1,`trailing`);if(r===0&&i===0)return t;let a=n[n.length-1]?.position?.end,o=[],s=[];if(r>0)for(let e=0;e<r;e++)o.push(pL(1+e,e));if(i>0&&typeof a?.offset==`number`&&typeof a.line==`number`)for(let e=0;e<i;e++)s.push(pL(a.line+1+e,a.offset+1+e));if(o.length===0&&s.length===0||(e.children=[...o,...n,...s],o.length>0&&delete t.leading,s.length>0&&delete t.trailing,t.bom!==void 0||t.leading!==void 0||t.trailing!==void 0))return t;e.data!==void 0&&delete e.data.sourceDocBoundary}const hL=new ad.default;hL.Match_Threshold=.5;function gL(e,t){let n=0;for(let r=0;r<t.length&&n<e.length;r++)e[n]===t[r]&&n++;return n===e.length}const _L=new Set([`sourceRaw`,`sourceDirty`,`position`]),vL=new Set([`jsxComponent`,`table`,`tableRow`,`tableCell`,`tableHeader`,`list`,`listItem`,`blockquote`,`codeBlock`,`heading`]),yL={type:`__br__`},bL=/^<br\s*\/?>$/i;function xL(e){let t=EL(e,xL);return(t.type===`tableCell`||t.type===`tableHeader`)&&t.content?{...t,content:SL(t.content)}:t}function SL(e){let t=[];for(let n of e){let e=CL(n);e.length!==0&&(t.length>0&&t.push(yL),t.push(...e))}return t}function CL(e){return e.text!==void 0||e.type===`hardBreak`||e.type===`jsxInline`?[e]:!e.content||e.content.length===0?[]:e.content.some(e=>e.text===void 0&&e.type!==`hardBreak`&&e.type!==`jsxInline`&&!!e.content)?SL(e.content):e.content}function wL(e){return e.type===`hardBreak`||e.type===yL.type||e.text!==void 0&&bL.test(e.text.trim())?yL:EL(e,wL)}const TL=[{label:`table-cell-block-flatten`,severity:`pm-model-caused`,rationale:`GFM table cells have no block spelling; a block placed in a cell is flattened to inline on serialize, so a cell-with-blocks and a cell-with-inline describe the same persisted document.`,proofPointer:`markdown/table-cell-flatten.ts flattenCellBlocks (table-cell-flatten-dropped-block event)`,canonicalize:xL},{label:`void-hardbreak-br`,severity:`serializer-caused`,rationale:`A void hardBreak inside a table cell or heading serializes to a literal <br /> that a fresh parse keeps as text; the node form and the literal form are the same break.`,proofPointer:`markdown/void-br-promoter.ts + markdown/to-markdown-handlers.ts break handler`,canonicalize:wL}];function EL(e,t){return e.content?{...e,content:e.content.map(t)}:e}function DL(e,t){let n={};e.type!==void 0&&(n.type=e.type),e.text!==void 0&&(n.text=e.text);let r=OL(e.attrs,t);return r&&(n.attrs=r),e.marks&&e.marks.length>0&&(n.marks=[...e.marks].map(e=>({type:e.type,attrs:OL(e.attrs,t)})).sort((e,t)=>AL(e).localeCompare(AL(t)))),e.content&&e.content.length>0&&(n.content=e.content.map(e=>DL(e,t))),n}function OL(e,t){if(!e)return null;let n={};for(let r of Object.keys(e).sort()){if(_L.has(r)||t?.(r))continue;let i=e[r];i!=null&&(n[r]=t?kL(i,t):i)}return Object.keys(n).length>0?n:null}function kL(e,t){if(Array.isArray(e))return e.map(e=>kL(e,t));if(e&&typeof e==`object`){let n={};for(let[r,i]of Object.entries(e))t(r)||(n[r]=kL(i,t));return n}return e}function AL(e){return JSON.stringify(e,(e,t)=>{if(t&&typeof t==`object`&&!Array.isArray(t)){let e={};for(let n of Object.keys(t).sort())e[n]=t[n];return e}return t})}function jL(e,t=!1){let n=``,r=e=>{if(!(t&&e.type===`rawMdxFallback`)&&(e.text!==void 0&&(n+=e.text),e.content))for(let t of e.content)r(t)};return r(e),n.replace(/\s+/g,``)}function ML(e){let t=[],n=e=>{if(e.type&&vL.has(e.type)){let n=e.type===`jsxComponent`?String(e.attrs?.componentName??``):``;t.push(n?`${e.type}:${n}`:e.type)}if(e.content)for(let t of e.content)n(t)};return n(e),t.sort()}function NL(e){let t=e,n=[];for(let e of TL){let r=AL(t),i=e.canonicalize(t);AL(i)!==r&&n.push(e.label),t=i}return{normalized:t,fired:n}}function PL(e,t,n={}){let r=NL(e),i=NL(t),a=[...new Set([...r.fired,...i.fired])],o=gL(jL(r.normalized),jL(i.normalized)),s=!o&&n.rawSourceSide===`expected`&&gL(jL(r.normalized,!0),jL(i.normalized,!0));if(!o&&!s)return{equivalent:!1,level:`L1`,reason:`content-loss`,appliedDegrades:a,detail:`authored text did not survive the round-trip`};let c=ML(r.normalized),l=ML(i.normalized);if(AL(c)!==AL(l))return{equivalent:!1,level:`L1`,reason:`structural-shatter`,appliedDegrades:a,detail:`container multiset diverged: [${c.join(`, `)}] vs [${l.join(`, `)}]`};let u=DL(r.normalized,n.ignoreAttrs),d=DL(i.normalized,n.ignoreAttrs);return AL(u)===AL(d)?{equivalent:!0,level:a.length>0?`L2`:`L1`,appliedDegrades:a}:{equivalent:!1,level:`L2`,reason:`structural-divergence`,appliedDegrades:a,detail:FL(u,d)}}function FL(e,t,n=`doc`){let r=e,i=t;if(!r||!i)return`${n}: node presence differs`;if(r.type!==i.type)return`${n}: type ${String(r.type)} vs ${String(i.type)}`;let a=r.content??[],o=i.content??[];if(a.length!==o.length)return`${n}(${String(r.type)}): child count ${a.length} vs ${o.length}`;for(let e=0;e<a.length;e++)if(AL(a[e])!==AL(o[e]))return FL(a[e],o[e],`${n}>${String(r.type)}[${e}]`);return`${n}(${String(r.type)}): attrs or marks differ`}function IL(e,t,n){return!PL(e,t,{ignoreAttrs:n}).equivalent}const LL=new Set([`src`,`href`,`size`]),RL=new Set([`WikiEmbedImage`,`WikiEmbedVideo`,`WikiEmbedAudio`,`WikiEmbedFile`]);function zL(e){if(Array.isArray(e))return e.map(e=>zL(e));if(e&&typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))LL.has(n)||(t[n]=zL(r));return t}return e}function BL(e){return e.type===`jsxComponent`&&typeof e.attrs?.componentName==`string`&&RL.has(e.attrs.componentName)?zL(e):e.content?{...e,content:e.content.map(BL)}:e}function VL(e){if(Array.isArray(e))return e.map(e=>VL(e));if(e&&typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))n!==`position`&&(t[n]=VL(r));return t}return e}function HL(e){if(e.type===`jsxComponent`)return e;if(e.content)for(let t of e.content){let e=HL(t);if(e)return e}}function UL(e){let t=e.cacheLimit??2048,n=new Map,r=r=>{let i=n.get(r);if(i!==void 0)return i;let a=HL(e.parse(r)),o=a?BL(VL(a)):null;if(n.size>=t){let e=n.keys().next().value;e!==void 0&&n.delete(e)}return n.set(r,o),o};return{isDiverged(e){if(e.type!==`jsxComponent`||!e.attrs||e.attrs.kind===`expression`)return!1;let t=e.attrs.sourceRaw;if(typeof t!=`string`||t.length===0)return!1;let n=r(t);return n?IL(n,BL(VL(e))):!1}}}const WL=`state/bug-reports`,GL=Vi({at:F(),transport:F(),outcome:F(),reference:F().optional(),error:F().optional(),errorCode:F().optional()}),KL=Vi({reason:F(),at:F(),errorCode:F().optional()});Vi({version:I().int().catch(1),id:F(),createdAt:F(),bundleLevel:F(),zipBytes:I().int().nonnegative().catch(0),zipDeleted:L().optional(),state:F(),systemWide:L().optional(),projectSlug:F().nullable().optional(),reference:F().optional(),lastError:KL.optional(),attempts:z(GL).optional(),note:F().optional()}),Vi({version:I().int().catch(1),id:F().optional(),sentAt:F().optional(),reference:F().optional()});const qL=new Map([[32,` `],[9,` `],[160,`\xA0`]]);function JL(e){let t=/^&#(x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);$/.exec(e);if(!t)return null;let n=t[1],r=n[0]===`x`||n[0]===`X`,i=Number.parseInt(r?n.slice(1):n,r?16:10);return Number.isNaN(i)?null:i}function YL(e){let t=JL(e);return t!==null&&qL.has(t)}function XL(e){let t=JL(e);return t===null?null:qL.get(t)??null}const ZL=/&#(?:x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);/g;function QL(e){ZL.lastIndex=0;let t=e.match(ZL);if(t===null||t.join(``)!==e)return null;let n=``;for(let e of t){let t=XL(e);if(t===null)return null;n+=t}return n}const $L=new Map([[`PORT`,[`server`,`port`]],[`OK_BIND`,[`server`,`bind`]],[`OK_EXTERNAL_URL`,[`server`,`externalUrl`]],[`OK_ALLOW_EXTERNAL`,[`server`,`allowExternal`]],[`OK_OPEN_BROWSER`,[`server`,`openBrowser`]],[`OK_IDLE_SHUTDOWN`,[`server`,`idleShutdown`]]]);function eR(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1_$2`).toUpperCase()}function tR(e){return`OK_${(e[0]===`server`?e.slice(1):e).map(eR).join(`_`)}`}function nR(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function rR(e){let{value:t,file:n,source:r,doc:i}=e,a=[],o=(e,t)=>{if(t.length>0){let e=_u(mu,t);if(e!==void 0){if(e.scope===`project-local`){let e=tR(t),o;i!=null&&r!=null&&n!=null&&(o=xu({file:n,source:r,doc:i,path:t})),a.push({path:[...t],...$L.has(e)?{envVar:e}:{},...o===void 0?{}:{source:o}})}return}}if(nR(e))for(let[n,r]of Object.entries(e))o(r,[...t,n])};return o(t,[]),a}function iR(e,t,n){return aR([e,t,n],[])}function aR(e,t){if(t.length>0){let n=_u(mu,t);if(n?.scope===`user`)return e[0];if(n?.scope===`project`)return e[1]??e[0];if(n?.scope===`project-local`)return e[2]??e[0]}let n=oR(e);if(n===void 0)return;if(n===null)return null;if(Array.isArray(n)||typeof n!=`object`)return n;let r=e.map(e=>sR(e)?e:void 0),i=new Set;for(let e of r)if(e!==void 0)for(let t of Object.keys(e))i.add(t);let a={};for(let e of i)a[e]=aR(r.map(t=>t===void 0?void 0:t[e]),[...t,e]);return a}function oR(e){for(let t=e.length-1;t>=0;t--)if(e[t]!==void 0)return e[t]}function sR(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const cR=`(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)`;RegExp(`^127\\.${cR}\\.${cR}\\.${cR}$`);const lR=[`.mdx`,`.md`],uR={cursor:/\bCursor(?:\([^)]+\))?\/\d/,codex:/\bCodex(?:\([^)]+\))?\/\d/,"claude-desktop":/\bClaude(?:\([^)]+\))?\/\d/};function dR(e,t){return e===`unix-chain`?`# ok-mcp${t}-v`:`# ok-mcp${t}-win-v`}function fR(e){return e.replace(/\/+/g,`/`).replace(/\/+$/,``)}function pR(e){return tt[e].userHomeDirName}function mR(e,t){return e===`stable`?`${fR(t)}/Library/Application Support/OpenKnowledge/path-install.json`:`${fR(t)}/${pR(e)}/path-install.json`}function hR(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);if(n<=0)return t;let r=t.slice(n).toLowerCase();return lR.includes(r)?t.slice(0,n):t}const gR=[`.ok`,to,`installed-skills.json`],_R=U(us),vR=Vi({hosts:z(F()),scope:_R,scripts:L(),installedAt:Vr(),projection:U([`symlink`,`copy`]).optional(),contentHash:F().optional()}),yR=Vi({schema:W(1),skills:H(F(),vR).default({})});function bR(e){let t;try{t=JSON.parse(e)}catch{return null}let n=yR.safeParse(t);return n.success?n.data:null}const xR=Object.freeze([{value:`workflow-fit`,label:`It didn't fit into my workflow`},{value:`missing-feature`,label:`It was missing a feature I needed`},{value:`hard-to-start`,label:`It was too hard to set up or get started`},{value:`unreliable`,label:`Bugs, crashes, or it felt unreliable`},{value:`switched-tool`,label:`I'm switching to another tool`},{value:`one-off`,label:`It was a trial or one-off project`},{value:`other`,label:`Something else`}]);new Set(xR.map(e=>e.value));const SR=Nb.extend({priority:60,addAttributes(){return{...this.parent?.(),fenceDelimiter:{default:"`"},fenceLength:{default:3},meta:{default:null},sourceStyle:{default:`fenced`},sourceClosingFenceLength:{default:null,rendered:!1},sourceUnclosedFence:{default:!1,rendered:!1},sourceFenceIndent:{default:null,rendered:!1},sourceInfoPadding:{default:null,rendered:!1},sourceIndents:{default:null,rendered:!1}}}}),CR=Kb.extend({name:`emphasis`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`*`}}},addInputRules(){return[db({find:Vb,type:this.type,getAttributes:{sourceDelimiter:`*`}}),db({find:Ub,type:this.type,getAttributes:{sourceDelimiter:`_`}})]}}),wR=Bb.extend({name:`strong`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`**`}}},addInputRules(){return[db({find:Fb,type:this.type,getAttributes:{sourceDelimiter:`**`}}),db({find:Lb,type:this.type,getAttributes:{sourceDelimiter:`__`}})]}}),TR=Zy.create({name:`escapeMark`,priority:10,excludes:``,inclusive:!1,parseHTML(){return[{tag:`span[data-escape-mark]`}]},renderHTML(){return[`span`,{"data-escape-mark":``},0]}}),ER=Db.create({name:`footnoteDefinition`,group:`block`,content:`block+`,defining:!0,priority:60,addAttributes(){return{identifier:{default:``},label:{default:null}}},parseHTML(){let e=e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-footnote-id`)||``;return{identifier:t,label:t||null}};return[{tag:`aside[data-footnote-def]`,getAttrs:e},{tag:`aside.footnote-def`,getAttrs:e}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.identifier??``);return[`aside`,{...t,"data-footnote-def":``,"data-footnote-id":n,id:`fn-${n}`,class:`footnote-def`},[`div`,{class:`footnote-body`},0],[`a`,{href:`#fnref-${n}`,class:`footnote-backref`,contentEditable:`false`,"aria-label":`Back to reference`},`↩`]]},addCommands(){return{insertFootnoteDefinition:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{identifier:e,label:e},content:[{type:`paragraph`}]})}}});function DR({node:e}){return``.repeat(e.nodeSize-e.content.size)}const OR=Db.create({name:`footnoteReference`,marks:`_`,group:`inline`,inline:!0,atom:!0,selectable:!0,draggable:!1,priority:60,renderText:DR,addAttributes(){return{identifier:{default:``},label:{default:null}}},parseHTML(){return[{tag:`sup[data-footnote-ref]`,getAttrs:e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-footnote-id`)||``;return{identifier:t,label:t||null}}}]},renderHTML({node:e}){let t=String(e.attrs.identifier??``);return[`sup`,{id:`fnref-${t}`,"data-footnote-ref":``,"data-footnote-id":t,class:`footnote-ref`},[`a`,{href:`#fn-${t}`,class:`footnote-ref-link`},`[${t}]`]]},addCommands(){return{insertFootnoteReference:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{identifier:e,label:e}})}}}),kR=Jb.extend({marks:`_`,priority:60,addAttributes(){return{...this.parent?.(),hardBreakStyle:{default:`backslash`},sourceRaw:{default:null}}}}),AR=Xb.extend({priority:60,addAttributes(){return{...this.parent?.(),headingStyle:{default:`atx`},sourceTrailingHashes:{default:null},sourceUnderlineLength:{default:null},sourceContiguousNext:{default:!1},sourceLeadingIndent:{default:null,rendered:!1},sourceInteriorSpacing:{default:null,rendered:!1}}}}),jR=Db.create({name:`htmlBlock`,group:`block`,atom:!0,priority:60,addAttributes(){return{content:{default:``}}},parseHTML(){return[{tag:`div[data-html-block]`}]},renderHTML({node:e}){return[`div`,{"data-html-block":``,class:`html-block`},e.attrs.content]}}),MR=Db.create({name:`imageReference`,marks:`_`,group:`inline`,inline:!0,atom:!0,priority:60,renderText:DR,addAttributes(){return{alt:{default:``},label:{default:``},identifier:{default:``},referenceType:{default:`shortcut`}}},parseHTML(){return[{tag:`img[data-image-reference]`}]},renderHTML({node:e}){let{alt:t,label:n,referenceType:r}=e.attrs;return[`img`,{"data-image-reference":``,"data-reference-type":r,"data-label":n,alt:t||n}]}});function NR(e){if(typeof e!=`string`||!e.startsWith(`/`))return e;let t=globalThis.window?.okDesktop?.config?.apiOrigin;return typeof t==`string`&&t?t+e:e}const PR=Qb.extend({marks:`_`,priority:60,renderText:DR,addAttributes(){return{...this.parent?.(),sourceUrl:{default:null,rendered:!1}}},renderHTML({HTMLAttributes:e}){let t=Jv(this.options.HTMLAttributes,e);return typeof t.src==`string`&&(t.src=NR(t.src)),[`img`,t]}}),FR=Db.create({name:`jsxComponent`,group:`block`,atom:!1,content:`block*`,isolating:!0,selectable:!0,defining:!0,priority:60,addAttributes(){return{componentName:{default:``},kind:{default:`element`},attributes:{default:[]},sourceRaw:{default:``},sourceDirty:{default:!1},props:{default:{}}}},parseHTML(){return[{tag:`div[data-jsx-component]`,getAttrs:e=>typeof e!=`string`&&{componentName:e.getAttribute(`data-component-name`)||``,sourceRaw:e.getAttribute(`data-source-raw`)||``}}]},renderHTML({HTMLAttributes:e}){return[`div`,{"data-jsx-component":``,"data-component-name":e.componentName,"data-source-raw":e.sourceRaw},0]},addCommands(){return{insertJsxComponent:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{sourceRaw:e}})}}}),IR=Db.create({name:`jsxInline`,group:`inline`,inline:!0,atom:!1,content:`text*`,isolating:!1,selectable:!0,priority:60,renderText:DR,addAttributes(){return{componentName:{default:``},kind:{default:`element`},attributes:{default:[]},sourceRaw:{default:``},sourceDirty:{default:!1},props:{default:{}}}},parseHTML(){return[{tag:`span[data-jsx-inline]`,getAttrs:e=>typeof e!=`string`&&{componentName:e.getAttribute(`data-component-name`)||``,sourceRaw:e.getAttribute(`data-source-raw`)||``}}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-jsx-inline":``,"data-component-name":e.componentName,"data-source-raw":e.sourceRaw},0]}}),LR=[`https`,`http`,`mailto`,`tel`,`ftp`,`sms`],RR=LR.map(e=>`${e}:`).join(`|`);RegExp(`^(?:${RR}|\\/|#|\\?|\\.\\/|\\.\\.\\/)`,`i`);function zR(e){let t=e.trim();if(t===``)return!0;let n=t.indexOf(`:`);if(n===-1)return!0;let r=t.indexOf(`/`),i=t.indexOf(`?`),a=t.indexOf(`#`);return n>Math.min(r===-1?1/0:r,i===-1?1/0:i,a===-1?1/0:a)}const BR=new Set(LR.map(e=>`${e}:`));function VR(e){try{let t=new URL(e,`https://placeholder.invalid`);return BR.has(t.protocol.toLowerCase())}catch{return!1}}const HR=`LinkFidelity must be derived from the Link extension`,UR=ux.extend({priority:60,addOptions(){let e=this.parent?.();if(e===void 0)throw Error(HR);return{...e,openOnClick:!1,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer`},isAllowedUri:VR,shouldAutoLink:()=>!0}},addAttributes(){let e=this.parent?.();if(e===void 0)throw Error(HR);return{...e,linkStyle:{default:`inline`,rendered:!1},refLabel:{default:null,rendered:!1},sourceForm:{default:null,rendered:!1},target:{default:null,rendered:!1},anchor:{default:null,rendered:!1},alias:{default:null,rendered:!1},sourceUrlForm:{default:null,rendered:!1},sourceTitleMarker:{default:null,rendered:!1},sourceTarget:{default:null,rendered:!1},sourceAnchor:{default:null,rendered:!1},sourceAlias:{default:null,rendered:!1}}}}),WR=Db.create({name:`linkRefDef`,group:`block`,atom:!0,priority:60,addAttributes(){return{label:{default:``},href:{default:``},title:{default:null},sourceLayout:{default:null},sourceTitleMarker:{default:null}}},parseHTML(){return[{tag:`div[data-link-ref-def]`}]},renderHTML({node:e}){let{label:t,href:n,title:r}=e.attrs;return[`div`,{"data-link-ref-def":``,class:`link-ref-def`},r?`[${t}]: ${n} "${r}"`:`[${t}]: ${n}`]}});function GR(e){return e.type.name===`list`&&!e.attrs.ordered}function KR(e){return e.type.name===`list`&&!!e.attrs.ordered}function qR(e){let t=!1;return e.forEach(e=>{e.type.name===`listItem`&&e.attrs.checked!==null&&(t=!0)}),t}function JR(e,t,n,r,i,a,o){let s=Rv(e=>e.type.name===`list`)(e.selection);if(s&&i(s.node)){let{$from:n,$to:i}=e.selection;return n.blockRange(i)?Lp(r)(e,t):!1}if(s){if(!t)return!0;let{tr:n}=e;return n.setNodeMarkup(s.pos,void 0,{...s.node.attrs,...a}),o!==void 0&&s.node.forEach((e,t)=>{if(e.type.name===`listItem`){let r=s.pos+1+t;n.setNodeMarkup(r,void 0,{...e.attrs,...o})}}),t(n),!0}return Ip(n,a)(e,void 0)?!t||Ip(n,a)(e,n=>{if(o){let t=n.mapping.map(e.selection.$from.pos),r=n.doc.resolve(t);for(let e=r.depth;e>0;e--){let t=r.node(e);if(t.type.name===`listItem`){n.setNodeMarkup(r.before(e),void 0,{...t.attrs,...o});break}}}t(n)}):!1}function YR(e){return e===`x`||e===`X`}function XR(e){return e===`X`?`X`:null}function ZR(e,t,n,r){let i=e.schema.nodes.list;if(!i)return!1;let a=e.doc.resolve(t.from),o=a.depth-1;if(o>0&&a.node(o).type.name===`listItem`&&a.index(o)===0){let i=a.node(o);return e.tr.delete(t.from,t.to).setNodeMarkup(a.before(o),void 0,{...i.attrs,checked:n,sourceCheckboxChar:r}),!0}let s=a.blockRange();if(!s)return!1;let c=Cf(s,i,{ordered:!1});if(!c)return!1;let l=e.tr;l.wrap(s,c),l.delete(l.mapping.map(t.from),l.mapping.map(t.to));let u=l.doc.resolve(l.mapping.map(t.from));for(let e=u.depth;e>0;e--){let t=u.node(e);if(t.type.name===`listItem`){l.setNodeMarkup(u.before(e),void 0,{...t.attrs,checked:n,sourceCheckboxChar:r});break}}return!0}const QR=/^\s*([-+*])\s$/,$R=/^\s*(\d+)([.)])\s$/,ez=/^\s*[-*+]\s\[([ xX]?)\]\s$/,tz=/^\s*\[([ xX]?)\]\s$/,nz=Db.create({name:`list`,group:`block list`,content:`listItem+`,priority:60,addAttributes(){return{ordered:{default:!1},start:{default:1},spread:{default:!1},bulletMarker:{default:null},listMarkerDelimiter:{default:null}}},parseHTML(){return[{tag:`ul`,getAttrs:()=>({ordered:!1})},{tag:`ol`,getAttrs:e=>({ordered:!0,start:e.getAttribute(`start`)?Number(e.getAttribute(`start`)):1})}]},renderHTML({node:e,HTMLAttributes:t}){let n=e.attrs.ordered?`ol`:`ul`,r={};return e.attrs.ordered&&e.attrs.start!==1&&(r.start=e.attrs.start),[n,Jv(t,r),0]},addCommands(){return{toggleBulletList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:JR(e,t,n,r,e=>GR(e)&&!qR(e),{ordered:!1},{checked:null})},toggleOrderedList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:JR(e,t,n,r,e=>KR(e),{ordered:!0},{checked:null})},toggleTaskList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:JR(e,t,n,r,e=>GR(e)&&qR(e),{ordered:!1},{checked:!1})}}},addInputRules(){return[mb({find:QR,type:this.type,getAttributes:e=>({ordered:!1,bulletMarker:e[1]}),joinPredicate:(e,t)=>t.attrs.ordered===!1}),mb({find:$R,type:this.type,getAttributes:e=>({ordered:!0,start:Number(e[1]),listMarkerDelimiter:e[2]}),joinPredicate:(e,t)=>t.attrs.ordered===!0}),new Ky({find:ez,handler:({state:e,range:t,match:n})=>ZR(e,t,YR(n[1]),XR(n[1]))?void 0:null}),new Ky({find:tz,handler:({state:e,range:t,match:n})=>ZR(e,t,YR(n[1]),XR(n[1]))?void 0:null})]},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList(),"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList(),"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),rz=Db.create({name:`listItem`,content:`paragraph block*`,defining:!0,addAttributes(){return{checked:{default:null},spread:{default:!1},sourceMarkerSpacing:{default:null,rendered:!1},sourceOrdinal:{default:null,rendered:!1},sourceCheckboxChar:{default:null,rendered:!1},sourceContinuationIndent:{default:null,rendered:!1}}},parseHTML(){return[{tag:`li`,getAttrs:e=>{let t=e.querySelector(`input[type="checkbox"]`);return{checked:t?t.checked:null}}}]},renderHTML({node:e,HTMLAttributes:t}){return e.attrs.checked===null?[`li`,Jv(t),0]:[`li`,Jv(t,{"data-type":`taskItem`,"data-checked":e.attrs.checked?`true`:`false`}),[`label`,{contenteditable:`false`},[`input`,{type:`checkbox`,...e.attrs.checked?{checked:`checked`}:{}}]],[`div`,0]]},addNodeView(){return({node:e,getPos:t,editor:n,HTMLAttributes:r})=>{let i=document.createElement(`li`);Object.entries(Jv(r,e.attrs.checked===null?{}:{"data-type":`taskItem`,"data-checked":String(!!e.attrs.checked)})).forEach(([e,t])=>{t!=null&&i.setAttribute(e,String(t))});let a=null,o=null,s=document.createElement(`div`),c=()=>{o&&(o.disabled=!n.isEditable)};return e.attrs.checked!==null&&(a=document.createElement(`label`),a.contentEditable=`false`,o=document.createElement(`input`),o.type=`checkbox`,o.checked=!!e.attrs.checked,c(),n.on(`update`,c),o.addEventListener(`change`,()=>{let r=t();r!==void 0&&typeof r==`number`&&n.view.dispatch(n.view.state.tr.setNodeMarkup(r,void 0,{...e.attrs,checked:o?.checked??!1}))}),a.appendChild(o),i.appendChild(a)),i.appendChild(s),{dom:i,contentDOM:s,update(t){return t.type!==e.type||t.attrs.checked!==null!=(e.attrs.checked!==null)?!1:(o&&t.attrs.checked!==null&&(o.checked=!!t.attrs.checked,o.disabled=!n.isEditable,i.setAttribute(`data-checked`,String(!!t.attrs.checked))),e=t,!0)},destroy(){n.off(`update`,c)}}}},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>{let{$from:e}=this.editor.state.selection;for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return this.editor.commands.sinkListItem(this.name);return!1},"Shift-Tab":()=>{let{$from:e}=this.editor.state.selection;for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return this.editor.commands.liftListItem(this.name);return!1}}}}),iz=nz,az=rz,oz=Db.create({name:`mathInline`,marks:`_`,group:`inline`,inline:!0,atom:!0,selectable:!0,priority:60,renderText:DR,addAttributes(){return{formula:{default:``},id:{default:null},language:{default:`latex`},sourceDelimiter:{default:null,rendered:!1}}},parseHTML(){return[{tag:`span[data-math-inline]`,getAttrs:e=>typeof e!=`string`&&{formula:e.getAttribute(`data-formula`)||``,id:e.getAttribute(`id`)||null,language:e.getAttribute(`data-language`)||`latex`}}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-math-inline":``,"data-formula":e.formula,"data-language":e.language,...e.id?{id:e.id}:{}}]},addCommands(){return{insertMathInline:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{formula:e}})}}}),sz=Db.create({name:`rawMdxFallback`,group:`block`,atom:!1,content:`text*`,isolating:!0,selectable:!0,defining:!0,priority:60,addAttributes(){return{reason:{default:``},originalSpan:{default:{start:0,end:0}}}},parseHTML(){let e=e=>typeof e!=`string`&&{reason:e.getAttribute(`data-reason`)||``};return[{tag:`div[data-raw-mdx-fallback]`,getAttrs:e},{tag:`pre[data-raw-mdx-fallback]`,getAttrs:e}]},renderHTML({HTMLAttributes:e}){return[`div`,{"data-raw-mdx-fallback":``,"data-raw-badge":`raw`,"data-reason":e.reason,contenteditable:`false`,class:`raw-mdx-fallback`},0]},addNodeView(){return({HTMLAttributes:e})=>{let t=document.createElement(`div`);t.setAttribute(`data-raw-mdx-fallback`,``),t.setAttribute(`data-raw-badge`,`raw`),t.setAttribute(`contenteditable`,`false`),t.classList.add(`raw-mdx-fallback`),e.reason&&t.setAttribute(`data-reason`,e.reason);let n=document.createElement(`pre`);return n.classList.add(`raw-mdx-fallback-content`),n.setAttribute(`contenteditable`,`false`),t.appendChild(n),{dom:t,contentDOM:n,ignoreMutation:()=>!0}}}}),cz=use.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceMarkerSpacings:{default:null}}}}),lz=pse.extend({excludes:``,addAttributes(){return{...this.parent?.(),sourceFenceChar:{default:"`"},sourceFenceLength:{default:1},sourcePadded:{default:!1,rendered:!1}}}}),uz=Db.create({name:`commentBlock`,group:`block`,content:`block+`,defining:!0,priority:60,addAttributes(){return{sourceForm:{default:`percent`,parseHTML:e=>e.getAttribute(`data-source-form`)===`html`?`html`:`percent`,renderHTML:e=>e.sourceForm===`html`?{"data-source-form":`html`}:{}},sourceLayout:{default:`block`,parseHTML:e=>e.getAttribute(`data-source-layout`)===`inline`?`inline`:`block`,renderHTML:e=>e.sourceLayout===`inline`?{"data-source-layout":`inline`}:{}}}},parseHTML(){return[{tag:`aside[data-comment-block]`},{tag:`aside.comment-block`}]},renderHTML({HTMLAttributes:e}){return[`aside`,{"data-comment-block":``,"data-clipboard-omit":`true`,class:`comment-block`,...e},0]},addCommands(){return{setCommentBlock:()=>({commands:e})=>e.wrapIn(this.name),toggleCommentBlock:()=>({commands:e})=>e.toggleWrap(this.name),unsetCommentBlock:()=>({commands:e})=>e.lift(this.name)}}}),dz=Zy.create({name:`comment`,priority:10,excludes:``,inclusive:!1,addAttributes(){return{sourceForm:{default:`percent`,parseHTML:e=>e.getAttribute(`data-source-form`)===`html`?`html`:`percent`,renderHTML:e=>e.sourceForm===`html`?{"data-source-form":`html`}:{}}}},parseHTML(){return[{tag:`span[data-comment-mark]`}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-comment-mark":``,"data-clipboard-omit":`true`,class:`comment-mark`,...e},0]},addCommands(){return{setComment:()=>({commands:e})=>e.setMark(this.name),toggleComment:()=>({commands:e})=>e.toggleMark(this.name),unsetComment:()=>({commands:e})=>e.unsetMark(this.name)}}}),fz=$y.create({name:`docFidelity`,addGlobalAttributes(){return[{types:[`doc`],attributes:{sourceDocBoundary:{default:null,rendered:!1}}}]}});function pz(e){for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return t;return null}function mz(e){let t=!1;return e.descendants(e=>!t&&(e.type.name===`list`&&(t=!0),!t)),t}function hz(e){let{selection:t}=e;return t instanceof Xf?t.$cursor:null}function gz(e){let t=hz(e);if(t?.parentOffset!==0)return!1;let n=pz(t);if(n===null||t.depth!==n+1||t.index(n)!==0)return!1;let r=t.index(n-1);return r!==0&&mz(t.node(n-1).child(r-1))}function _z(e,t){for(let n=t-1;n>=0;n--){let t=e.node(n),r=e.index(n);if(r<t.childCount-1){let e=t.child(r+1),i=n+1;for(;e.type.name===`list`&&e.firstChild;)e=e.firstChild,i+=1;return e.type.name===`listItem`?i:null}}return null}function vz(e){let t=hz(e);if(!t||t.parentOffset!==t.parent.content.size)return!1;let n=pz(t);if(n===null)return!1;for(let e=t.depth;e>n;e--)if(t.index(e-1)!==t.node(e-1).childCount-1)return!1;let r=_z(t,n);return r!==null&&r<n}const yz=$y.create({name:`listBoundaryMerge`,addKeyboardShortcuts(){let e=()=>{let{editor:e}=this;if(!gz(e.state))return!1;if(e.commands.undoInputRule())return!0;let{state:t,view:n}=e;return fp(t,n.dispatch,n)},t=()=>{let{editor:e}=this;if(!vz(e.state))return!1;let{state:t,view:n}=e;return pp(t,n.dispatch,n)};return{Backspace:e,"Mod-Backspace":e,Delete:t,"Mod-Delete":t}}}),bz=$y.create({name:`plainTextClipboard`,priority:1e3,addProseMirrorPlugins(){return[new ap({key:new cp(`okPlainTextClipboard`),props:{clipboardTextSerializer:e=>e.content.textBetween(0,e.content.size,`
|
|
342
342
|
|
|
343
|
-
`)}})]}}),xz=Zy.create({name:`sourceLiteral`,priority:10,excludes:``,inclusive:!1,addAttributes(){return{sourceRaw:{default:``}}},parseHTML(){return[{tag:`span[data-source-literal]`}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-source-literal":``,...e},0]}});function Sz(e,t){if(typeof e!=`string`||typeof t!=`string`||/[\x00-\x1F\x7F]/.test(e))return!1;let n=e.replaceAll(`\xA0`,` `),r=t.replaceAll(`\xA0`,` `);return n===r||Cz(n)===r||QL(e)===t}function Cz(e){return e.replace(/\\([!-/:-@[-`{-~])/g,`$1`)}const wz=Ase.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`~~`,rendered:!1}}}}),Tz=HS.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDashCounts:{default:null},sourceOuterPipes:{default:null,rendered:!1},sourceAlignmentPadding:{default:null,rendered:!1}}}}),Ez=FS.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),Dz=IS.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),Oz=Db.create({name:`tag`,marks:`_`,group:`inline`,inline:!0,atom:!0,selectable:!0,priority:60,renderText:DR,addAttributes(){return{value:{default:``}}},parseHTML(){return[{tag:`a[data-tag]`,getAttrs:e=>typeof e!=`string`&&{value:e.getAttribute(`data-tag`)||``}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.value??``);return[`a`,{...t,"data-tag":n,href:`#tag/${n}`,class:`tag`},`#${n}`]},addCommands(){return{insertTag:e=>({chain:t})=>t().insertContent({type:`tag`,attrs:{value:e}}).run()}}}),kz=/^(?:---|—-|___\s|\*\*\*\s)$/;function Az(e){let t=String(e[0]??``).replace(/\s+$/,``);return t===`—-`?`---`:t}const jz=hse.extend({name:`thematicBreak`,priority:60,addAttributes(){return{...this.parent?.(),sourceRaw:{default:`---`}}},addInputRules(){return[fb({find:kz,type:this.type,getAttributes:e=>({sourceRaw:Az(e)})})]}}),Mz=Mse.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceForm:{default:`u`,rendered:!1}}}});function Nz(e,t){let{target:n,anchor:r,alias:i}=e;if(!t.separatorCrossed)return e;if(r!==null){let e=Lz(r);return{target:n,anchor:e.length>0?e:null,alias:i===null?null:Rz(i)}}return{target:Lz(n),anchor:null,alias:i===null?null:Rz(i)}}function Pz(e,t,n){let r=e.trim();return r===t?!0:n===`alias`?Rz(r)===t:Lz(r)===t}function Fz(e,t,n){return typeof e==`string`&&Pz(e,t,n)?e:t}function Iz(e){return Lz(e.trim())===``}function Lz(e){return e.endsWith(`\\`)?e.slice(0,-1):e}function Rz(e){return e.replace(/\\\|/g,`|`)}function zz(e){let t=``,n=0;for(let r of e)r===`\\`?n++:(r===`|`&&n%2==0&&(t+=`\\`),n=0),t+=r;return t}function Bz(e){return e.replace(/\|/g,`\\|`)}function Vz(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function Hz(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}const Uz=Db.create({name:`wikiLink`,marks:`_`,group:`inline`,inline:!0,atom:!0,priority:60,renderText:DR,addAttributes(){return{target:{default:``},alias:{default:null},anchor:{default:null},resolved:{default:!1},sourceTarget:{default:null,rendered:!1},sourceAnchor:{default:null,rendered:!1},sourceAlias:{default:null,rendered:!1}}},parseHTML(){return[{tag:`span[data-wiki-link]`,getAttrs:e=>typeof e!=`string`&&{target:e.getAttribute(`data-target`)||``,alias:Vz(e.getAttribute(`data-alias`)),anchor:Vz(e.getAttribute(`data-anchor`)),resolved:e.getAttribute(`data-resolved`)===`true`}},{tag:`a.wiki-link[data-target]`,priority:100,getAttrs:e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-target`)??``;return t?{target:t,alias:Vz(e.getAttribute(`data-alias`)),anchor:Vz(e.getAttribute(`data-anchor`)),resolved:!1}:!1}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.target??``),r=Vz(e.attrs.alias),i=Vz(e.attrs.anchor),a=e.attrs.resolved===!0;return[`span`,{...t,"data-wiki-link":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,"data-resolved":a?`true`:`false`},Hz({target:n,alias:r,anchor:i})]}});function Wz(e){let t=e.split(`/`).pop()??e,n=t.lastIndexOf(`.`);return n<=0||n===t.length-1?``:t.slice(n+1).toLowerCase()}function Gz(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}const Kz=[FR,sz,IR,oz,Uz,Db.create({name:`wikiLinkEmbed`,group:`inline`,inline:!0,atom:!0,priority:60,renderText:DR,addAttributes(){return{target:{default:``},alias:{default:null},anchor:{default:null},resolvedSrc:{default:null,rendered:!1,parseHTML:()=>null}}},parseHTML(){let e=e=>typeof e==`string`||!e.hasAttribute(`data-wiki-embed`)?!1:{target:e.getAttribute(`data-target`)||``,alias:Vz(e.getAttribute(`data-alias`)),anchor:Vz(e.getAttribute(`data-anchor`))};return[{tag:`img[data-wiki-embed]`,getAttrs:e,priority:100},{tag:`a[data-wiki-embed]`,getAttrs:e,priority:100}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.target??``),r=Vz(e.attrs.alias),i=Vz(e.attrs.anchor),a=Vz(e.attrs.resolvedSrc),o=Wz(n);if(Kc.has(o))return[`img`,{...t,"data-wiki-embed":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,src:a??n,alt:r??n}];let s=a??n;return[`a`,{...t,"data-wiki-embed":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,href:i?`${s}#${i}`:s,target:`_blank`,rel:`noopener noreferrer`},Gz({target:n,alias:r,anchor:i})]}}),Oz,iz,az,CR,wR,wz,Mz,lz,SR,cz,AR,jz,UR,jR,WR,kR,TR,fz,xz,bz,nce.configure({trailingNode:!1,undoRedo:!1,bulletList:!1,orderedList:!1,listItem:!1,listKeymap:{listTypes:[{itemName:`listItem`,wrapperNames:[`list`]}]},italic:!1,bold:!1,strike:!1,underline:!1,code:!1,codeBlock:!1,heading:!1,horizontalRule:!1,hardBreak:!1,link:!1,blockquote:!1,dropcursor:{color:`color-mix(in oklch, var(--primary) 50%, transparent)`,width:2}}),yz,Tz.configure({resizable:!0}),LS,Dz,Ez,PR.configure({inline:!0}),MR,px,dz,uz,OR,ER],qz=B({changes:z(Wi(`kind`,[B({key:F(),kind:W(`added`),after:ss}).loose(),B({key:F(),kind:W(`removed`),before:ss}).loose(),B({key:F(),kind:W(`changed`),before:ss,after:ss}).loose()])),unparseable:B({before:F(),after:F()}).loose().nullable()}).loose();function Jz(e){if(e===``)throw Error(`toPathspec: empty path. ":(literal)" is an empty pattern that matches every tracked path; pass "." if you meant the repo root.`);return`:(literal)${e}`}function Yz(e){if(e.length===0)throw Error(`pathspecArgs: empty path list. A bare "--" removes the pathspec restriction rather than selecting nothing.`);return[`--`,...e.map(e=>Jz(e))]}3072-Xz("This is an OpenKnowledge project: load the `open-knowledge` skill and use the OpenKnowledge MCP tools for all markdown — don't probe for `.ok/` or use native file tools on `.md` / `.mdx`. ",`cursor`),new TextEncoder;function Xz(e,t){let n=encodeURIComponent(e);return t===`cursor`?encodeURIComponent(n).length:n.length}function Zz(e){if(e.length===0)return{ok:!1,reason:`docName must not be empty`};if(e.trim().length===0)return{ok:!1,reason:`docName must not be blank (whitespace only)`};if(e!==e.trim())return{ok:!1,reason:`docName must not have leading or trailing whitespace`};for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n<32||n===127)return{ok:!1,reason:`docName must not contain control characters`}}if(e.includes(`..`)||e.startsWith(`/`)||e.includes(`\\`))return{ok:!1,reason:`docName must not contain "..", a leading "/", or a backslash`};for(let t of e.split(`/`)){if(t.length===0)return{ok:!1,reason:`docName must not contain empty path segments (no leading, trailing, or doubled "/")`};if(t.startsWith(`.`))return{ok:!1,reason:`docName path segments must not start with "." (hidden files are not addressable)`}}return{ok:!0}}function Qz(e,t){let n=Zz(e);n.ok||t.addIssue({code:`custom`,message:n.reason})}const $z=F().superRefine(Qz).optional(),eB=F().superRefine(Qz),tB={agentId:F().optional(),agentName:F().optional(),colorSeed:F().optional(),clientName:F().optional(),clientVersion:F().optional(),label:F().optional()},nB=F().optional(),rB=/^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,iB=z(F().min(1)).max(50),aB=U([`dormant`,`idle`,`fetching`,`pulling`,`pushing`,`conflict`,`offline`,`auth-error`,`disabled`]),oB=B({label:F().min(1),webUrl:pi().nullable()}).loose(),sB=Wi(`checkStatus`,[B({checkStatus:W(`allowed`)}).loose(),B({checkStatus:W(`denied`),deniedReason:U([`no-collaborator`,`private-no-access`,`repo-not-found`,`not-authenticated`]),resolvedLogin:F().optional(),declaredLogin:F().optional(),declaredSource:F().optional()}).loose(),B({checkStatus:W(`unknown`),unknownError:U([`network`,`timeout`,`rate-limit`,`token-invalid`,`malformed-response`,`ssh-unverified`]).optional()}).loose()]),cB=U([`auth-403`,`auth-401`,`auth-scope-mismatch`,`auth-no-credential`,`auth-not-found-as-identity`,`semantic-protected-branch`]),lB=U(Sc),uB=U([`succeeded`,`up-to-date`,`conflict`,`refused`,`error`]);B({state:aB,lastSyncUtc:F().nullable(),lastRunUtc:F().nullable().optional(),lastPullOkUtc:F().nullable().optional(),lastPushOkUtc:F().nullable().optional(),lastFetchUtc:F().nullable(),lastPushedSha:F().nullable(),ahead:I().int().min(0),behind:I().int().min(0),consecutiveFailures:I().int().min(0),consecutivePushFailures:I().int().min(0).optional(),conflictCount:I().int().min(0),hasRemote:L(),syncEnabled:L(),identityUnresolved:L(),remote:oB.nullable().optional(),pushError:F().optional(),pushErrorCode:cB.optional(),pullError:F().optional(),pullErrorCode:cB.optional(),pausedReason:F().optional(),blockingPaths:z(F().min(1)).optional(),refusedSymlinkPaths:iB.optional(),pushPermission:sB.optional(),syncMode:lB.optional(),lastPullUtc:F().nullable().optional(),lastPullOutcome:uB.nullable().optional()}).loose(),B({action:U([`commit`]),paths:z(F().min(1)),commitSha:F().optional()}).loose(),B({action:U([`commit`])}).loose(),B({op:U([`sync`,`push`,`pull`,`fetch`]).optional()}).loose(),B({op:U([`sync`,`push`,`pull`,`fetch`])}).loose();const dB=U([`merge-native`,`working-tree`,`reconcile`]),fB=U([`merged-with-markers`,`refused-conflict-markers`,`refused-no-base`,`refused-too-large`,`disk-markers`,`stale-external-write`]),pB=U([`mine`,`theirs`,`content`,`delete`]);B({conflicts:z(B({file:F().min(1),detectedAt:F().min(1),conflict:dB,reason:fB.optional().catch(void 0),conflictKind:U([`git`,`stale-external-write`]).optional(),docName:F().nullable(),theirsSha:F().optional(),baseSha:F().optional()}).loose())}).loose(),B({file:F().min(1),strategy:U([`mine`,`theirs`,`content`,`delete`]),content:F().optional()}).loose().refine(e=>e.strategy!==`content`||e.content!==void 0,{message:`content must be provided when strategy is 'content' (an empty string keeps an empty file)`,path:[`content`]}),B({}).loose(),B({file:F().min(1),base:F(),ours:F(),theirs:F(),kind:U([`both-modified`,`delete-modify`,`modify-delete`]),conflict:dB,reason:fB.optional().catch(void 0),conflictKind:U([`git`,`stale-external-write`]).optional(),resolutionOptions:z(pB)}).loose(),B({plan:ga(e=>e!==void 0,{message:`plan is required`})}).loose(),B({plan:ga(e=>e!==void 0,{message:`plan is required`})}).loose(),B({result:ga(e=>e!==void 0,{message:`result is required`})}).loose(),B({packId:F().min(1)}).strict(),B({installedHosts:z(F()),skills:z(B({name:F().min(1),created:L()}).strict())}).strict();const mB=B({path:F().min(1),summary:F().min(1)}).loose(),hB=B({files:I().int().nonnegative(),folders:I().int().nonnegative()}).loose();B({packs:z(B({id:F().min(1),name:F().min(1),description:F().min(1),defaultSubfolder:F().optional(),folders:z(mB),entryCounts:hB}).loose())}).loose(),B({noOpen:L().optional(),out:F().min(1).optional()}).loose();const gB=B({reason:U([`unsupported-platform`,`spawn-error`]),message:F()}).loose();Wi(`status`,[B({status:W(`installed`),outputPath:F(),size:I().int().nonnegative(),sha256:F(),skillVersion:F()}).loose(),B({status:W(`built`),outputPath:F(),size:I().int().nonnegative(),sha256:F(),skillVersion:F(),handoffError:gB.optional()}).loose(),B({status:W(`failed`),buildError:F()}).loose(),B({status:W(`skip-current`),skillVersion:F(),recordedAt:F().optional()}).loose()]),Wi(`kind`,[B({kind:W(`doc`),docPath:F().min(1)}).loose(),B({kind:W(`folder`),folderPath:F()}).loose()]);const _B=U([`no-remote`,`detached-head`,`branch-not-on-origin`,`non-github-remote`,`invalid-path`,`unsupported-share-url`]),vB=U([`current`,`stale`,`absent`,`empty`]);Wi(`ok`,[B({ok:W(!0),shareUrl:F().min(1),sharedUrl:F().min(1),branch:F().min(1),freshness:vB.optional().catch(void 0)}).loose(),B({ok:W(!1),error:_B,branch:F().min(1).optional()}).loose()]);const yB=U([`user`,`org`]),bB=B({login:F().min(1),kind:yB,avatarUrl:F().optional()}).loose(),xB=U([`auth-required`,`network`]);Wi(`ok`,[B({ok:W(!0),owners:z(bB)}).loose(),B({ok:W(!1),error:xB}).loose()]),Wi(`ok`,[B({ok:W(!0),available:L()}).loose(),B({ok:W(!1),error:xB}).loose()]);const SB=U([`public`,`private`]);B({owner:F().min(1),name:F().min(1),visibility:SB,description:F().optional()}).loose();const CB=U([`name-conflict`,`saml-sso`,`auth-required`,`push-failed`,`init-failed`,`network`,`no-project`]);Wi(`ok`,[B({ok:W(!0),ownerLogin:F().min(1),repoName:F().min(1),cloneUrl:F().min(1),defaultBranch:F().min(1)}).loose(),B({ok:W(!1),error:CB}).loose()]);function wB(e){return!(typeof e!=`string`||e.length===0||e.startsWith(`-`)||/[\x00-\x1F\x7F]/.test(e)||/\s/.test(e)||e.includes(`:`)||e.split(`/`).includes(`..`))}const TB=e=>e.refine(wB,`invalid branch name`),EB={shareTargetExists:L(),dirtyConflicts:B({conflicts:L(),files:z(F().min(1))}).loose(),branchIsLocal:L(),shareTargetOnOriginBranch:L().optional()};Wi(`detached`,[B({detached:W(!1),currentBranch:F().min(1).nullable(),currentHeadSha:Pi(),...EB}).loose(),B({detached:W(!0),currentBranch:Pi(),currentHeadSha:F().min(1),...EB}).loose()]),B({branch:TB(F().min(1)),principalId:F().optional(),fastForward:L().optional()}).loose();const DB=U([`dirty-conflict`,`branch-not-found`,`fetch-failed`,`checkout-failed`,`branch-in-other-worktree`,`ff-diverged`,`unsafe-symlinks`,`symlink-check-failed`]);Wi(`ok`,[B({ok:W(!0)}).loose(),B({ok:W(!1),reason:DB,files:z(F().min(1)).optional(),otherWorktreePath:F().min(1).optional(),refusedSymlinkPaths:iB.optional()}).loose()]),U([`on-origin`,`renamed`,`deleted`,`never-on-branch`,`changed-locally`,`unknown`]),B({branch:TB(F().min(1)),path:F(),kind:U([`doc`,`folder`]),contentRootDepth:I().int().min(1).max(65535).optional()}).loose(),Wi(`verdict`,[B({verdict:W(`on-origin`)}).loose(),B({verdict:W(`renamed`),renamedTo:F().min(1)}).loose(),B({verdict:W(`deleted`)}).loose(),B({verdict:W(`never-on-branch`)}).loose(),B({verdict:W(`changed-locally`)}).loose(),B({verdict:W(`unknown`)}).loose()]).catch({verdict:`unknown`});const OB=B({startedAt:F().min(1),httpListenMs:I().nonnegative().optional(),seedWalkMs:I().nonnegative().optional(),indexesMs:I().nonnegative().optional(),readyMs:I().nonnegative().optional(),fileCount:I().nonnegative().optional()});B({serverInstanceId:F().min(1),currentBranch:F().min(1).optional(),currentDiskAckSVs:H(F().min(1),F().min(1)).optional(),boot:OB.optional(),collabClients:I().int().nonnegative().optional()}).loose(),B({id:F().min(1),display_name:F().min(1),display_email:F(),source:U([`git-config`,`synthesized`]),created_at:F().min(1)}).loose(),B({collabUrl:F().nullable(),previewUrl:F().nullable(),port:I(),singleFile:L().default(!1)}).loose();const kB=U(`urn:ok:error:malformed-upload.urn:ok:error:collision-exhaustion.urn:ok:error:storage-full.urn:ok:error:storage-readonly.urn:ok:error:storage-error.urn:ok:error:no-file-received.urn:ok:error:path-escape.urn:ok:error:symlink-refused.urn:ok:error:method-not-allowed.urn:ok:error:invalid-request.urn:ok:error:unsupported-media-type.urn:ok:error:payload-too-large.urn:ok:error:request-timeout.urn:ok:error:internal-server-error.urn:ok:error:derived-index-unavailable.urn:ok:error:loopback-required.urn:ok:error:invalid-origin.urn:ok:error:url-not-allowed.urn:ok:error:dir-outside-home.urn:ok:error:concurrent-operation.urn:ok:error:clone-failed.urn:ok:error:clone-timeout.urn:ok:error:server-start-failed.urn:ok:error:reserved-doc-name.urn:ok:error:target-not-found.urn:ok:error:stale-target.urn:ok:error:frontmatter-edit-not-supported.urn:ok:error:invalid-frontmatter-patch.urn:ok:error:frontmatter-malformed.urn:ok:error:no-active-session.urn:ok:error:too-many-agent-sessions.urn:ok:error:disk-divergence.urn:ok:error:stale-external-write.urn:ok:error:store-refused.urn:ok:error:doc-removed.urn:ok:error:doc-not-found.urn:ok:error:doc-already-exists.urn:ok:error:doc-not-open.urn:ok:error:rollback-not-configured.urn:ok:error:doc-not-available.urn:ok:error:backlink-index-not-configured.urn:ok:error:file-rescan-not-configured.urn:ok:error:shadow-not-configured.urn:ok:error:host-not-allowed.urn:ok:error:principal-not-available.urn:ok:error:not-found.urn:ok:error:auth-failed.urn:ok:error:no-project-dir.urn:ok:error:non-github-origin.urn:ok:error:server-open-failed.urn:ok:error:doc-in-conflict.urn:ok:error:concurrent-overwrite-refused.urn:ok:error:unresolved-conflict-markers.urn:ok:error:no-conflict-tracked.urn:ok:error:no-blocking-changes.urn:ok:error:sync-not-active.urn:ok:error:project-repo-not-configured.urn:ok:error:seed-prerequisite-missing.urn:ok:error:seed-invalid-root.urn:ok:error:tag-index-not-configured.urn:ok:error:template-not-found.urn:ok:error:unsupported-asset-type.urn:ok:error:asset-not-found.urn:ok:error:single-file-mode.urn:ok:error:collab-server-not-running.urn:ok:error:gateway-timeout.urn:ok:error:cursor-not-installed.urn:ok:error:cursor-spawn-timeout.urn:ok:error:cursor-spawn-failed.urn:ok:error:handoff-target-not-installed.urn:ok:error:handoff-spawn-timeout.urn:ok:error:handoff-spawn-failed.urn:ok:error:registry-unreachable.urn:ok:error:config-not-writable.urn:ok:error:audit-superseded.urn:ok:error:theme-name-taken.urn:ok:error:theme-name-invalid`.split(`.`)),AB=B({type:kB,title:F().min(1),status:I().int().min(400).max(599),instance:F().regex(rB,`instance must be urn:uuid:<uuid>`).optional(),detail:F().optional()}).loose();B({parentDocName:F().min(1),placement:U([`configured-attachments`,`parent-dir`]).default(`configured-attachments`),agentId:F().min(1).optional(),agentName:F().min(1).optional()}).loose(),B({src:F().min(1),path:F().min(1).optional(),deduped:L().optional()}).loose(),B({url:F().min(1),dir:F().min(1),branch:F().min(1).refine(wB,`invalid branch name`).optional()}).loose(),B({type:W(`error`),problem:AB}).loose();function jB(e,t){let n=t.map(e=>[Xu(e),e]);for(let t of e){let e=Xu(t);if(e===null)continue;let r=n.find(([t])=>t===e);if(r!==void 0)return r[1]}}function MB(e){let{override:t,storedPreference:n,preferenceList:r,supportedLocales:i}=e,a=e.autoDetectableLocales??i;if(t!==void 0){let e=jB([t],i);if(e!==void 0)return{locale:e,source:`override`}}if(n!==void 0&&n!==`system`&&i.includes(n))return{locale:n,source:`explicit`};let o=jB(r,a);return o===void 0?{locale:`en`,source:`fallback`}:{locale:o,source:`system`}}function NB(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e===45||e===95}function PB(e){if(!e.includes(`eyJ`))return null;let t=[],n=[];for(let r=0;r<e.length;r+=1)if(NB(e.charCodeAt(r))){for(t.push(r);r<e.length&&NB(e.charCodeAt(r));)r+=1;n.push(r)}let r=[];for(let t=e.indexOf(`eyJ`);t!==-1;t=e.indexOf(`eyJ`,t+1))r.push(t);let i=r=>r+1<t.length&&e[n[r]??-1]===`.`&&t[r+1]===(n[r]??-1)+1,a=[],o=0,s=0;for(let c=0;c+2<t.length;c+=1){let l=t[c]??0,u=n[c]??0;for(;s<r.length&&(r[s]??0)<l;)s+=1;if(!i(c)||!i(c+1))continue;let d=t[c+1]??0,f=n[c+1]??0,p=(n[c+2]??0)-(t[c+2]??0);if(!e.startsWith(`eyJ`,d)||f-d<11||p<8)continue;let m=r[s];m===void 0||m>=u||u-m<11||(a.push(e.slice(o,m),`[REDACTED-JWT]`),o=n[c+2]??e.length,c+=2)}return a.length===0?null:(a.push(e.slice(o)),a.join(``))}function FB(e){return RegExp(`(?:\\b|(?<=(?:\\[|\\u009b)[0-?]*[ -/]*[@-~]))${e.source}`,`g`)}const IB=[{name:`github-pat`,regex:/(ghp_|gho_|ghu_|ghs_|ghr_)[A-Za-z0-9]{36,}\b/g,replacement:`[REDACTED-GH-PAT]`},{name:`aws-access-key`,regex:FB(/(AKIA|ASIA|ABIA)[A-Z2-7]{16}\b/),replacement:`[REDACTED-AWS-KEY]`},{name:`anthropic-key`,regex:/sk-ant-api03-[A-Za-z0-9_-]{20,}\b/g,replacement:`[REDACTED-ANTHROPIC]`},{name:`openai-key`,regex:FB(/sk-[A-Za-z0-9]{20,}\b/),replacement:`[REDACTED-OPENAI]`},{name:`bearer-token`,regex:/([Aa]uthorization:\s*[Bb]earer\s+)(?:\\"[^\s"\\]+\\"|"[A-Za-z0-9\-._~+/=]+"|[^\s"\\]+)/g,replacement:`$1[REDACTED]`},{name:`jwt`,redact:PB},{name:`url-credentials`,regex:/:\/\/[^/\s:@"]+:[^/\s:@"]+@/g,replacement:`://[REDACTED]@`},{name:`github-pat-fine-grained`,regex:/github_pat_[0-9A-Za-z_]{20,}/g,replacement:`[REDACTED-GH-PAT]`},{name:`openai-key-modern`,regex:FB(/sk-(?:proj|svcacct|admin|None)-[A-Za-z0-9_-]{20,}/),replacement:`[REDACTED-OPENAI]`},{name:`slack-token`,regex:/xox[a-z]-[A-Za-z0-9-]{10,}/g,replacement:`[REDACTED-SLACK]`},{name:`google-api-key`,regex:/AIza[0-9A-Za-z_-]{35}/g,replacement:`[REDACTED-GOOGLE]`},{name:`stripe-secret-key`,regex:FB(/(?:sk|rk)_live_[0-9A-Za-z]{16,}\b/),replacement:`[REDACTED-STRIPE]`},{name:`gitlab-pat`,regex:/glpat-[0-9A-Za-z_-]{20,}/g,replacement:`[REDACTED-GITLAB]`},{name:`bearer-token-json`,regex:/("[Aa]uthorization"\s*:\s*"[Bb]earer\s+)(?:\\"[^"\\]+\\"|[^"\\]+)/g,replacement:`$1[REDACTED]`},{name:`macos-home-path`,regex:/\/Users\/[^/"\r]*[^/"\r\\]/g,replacement:`~`},{name:`linux-home-path`,regex:/\/home\/[^/"\r]*[^/"\r\\]/g,replacement:`~`},{name:`windows-home-path`,regex:/[A-Za-z]:\\{1,2}Users\\{1,2}(?:(?![A-Za-z]:\\)[^\\"\r])+/gi,replacement:`~`}],LB=IB.map(e=>e.name);function RB(e){let t=new Set,n=0;return{redacted:e.split(`
|
|
343
|
+
`)}})]}}),xz=Zy.create({name:`sourceLiteral`,priority:10,excludes:``,inclusive:!1,addAttributes(){return{sourceRaw:{default:``}}},parseHTML(){return[{tag:`span[data-source-literal]`}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-source-literal":``,...e},0]}});function Sz(e,t){if(typeof e!=`string`||typeof t!=`string`||/[\x00-\x1F\x7F]/.test(e))return!1;let n=e.replaceAll(`\xA0`,` `),r=t.replaceAll(`\xA0`,` `);return n===r||Cz(n)===r||QL(e)===t}function Cz(e){return e.replace(/\\([!-/:-@[-`{-~])/g,`$1`)}const wz=Ase.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`~~`,rendered:!1}}}}),Tz=HS.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDashCounts:{default:null},sourceOuterPipes:{default:null,rendered:!1},sourceAlignmentPadding:{default:null,rendered:!1}}}}),Ez=FS.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),Dz=IS.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),Oz=Db.create({name:`tag`,marks:`_`,group:`inline`,inline:!0,atom:!0,selectable:!0,priority:60,renderText:DR,addAttributes(){return{value:{default:``}}},parseHTML(){return[{tag:`a[data-tag]`,getAttrs:e=>typeof e!=`string`&&{value:e.getAttribute(`data-tag`)||``}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.value??``);return[`a`,{...t,"data-tag":n,href:`#tag/${n}`,class:`tag`},`#${n}`]},addCommands(){return{insertTag:e=>({chain:t})=>t().insertContent({type:`tag`,attrs:{value:e}}).run()}}}),kz=/^(?:---|—-|___\s|\*\*\*\s)$/;function Az(e){let t=String(e[0]??``).replace(/\s+$/,``);return t===`—-`?`---`:t}const jz=hse.extend({name:`thematicBreak`,priority:60,addAttributes(){return{...this.parent?.(),sourceRaw:{default:`---`}}},addInputRules(){return[fb({find:kz,type:this.type,getAttributes:e=>({sourceRaw:Az(e)})})]}}),Mz=Mse.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceForm:{default:`u`,rendered:!1}}}});function Nz(e,t){let{target:n,anchor:r,alias:i}=e;if(!t.separatorCrossed)return e;if(r!==null){let e=Lz(r);return{target:n,anchor:e.length>0?e:null,alias:i===null?null:Rz(i)}}return{target:Lz(n),anchor:null,alias:i===null?null:Rz(i)}}function Pz(e,t,n){let r=e.trim();return r===t?!0:n===`alias`?Rz(r)===t:Lz(r)===t}function Fz(e,t,n){return typeof e==`string`&&Pz(e,t,n)?e:t}function Iz(e){return Lz(e.trim())===``}function Lz(e){return e.endsWith(`\\`)?e.slice(0,-1):e}function Rz(e){return e.replace(/\\\|/g,`|`)}function zz(e){let t=``,n=0;for(let r of e)r===`\\`?n++:(r===`|`&&n%2==0&&(t+=`\\`),n=0),t+=r;return t}function Bz(e){return e.replace(/\|/g,`\\|`)}function Vz(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function Hz(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}const Uz=Db.create({name:`wikiLink`,marks:`_`,group:`inline`,inline:!0,atom:!0,priority:60,renderText:DR,addAttributes(){return{target:{default:``},alias:{default:null},anchor:{default:null},resolved:{default:!1},sourceTarget:{default:null,rendered:!1},sourceAnchor:{default:null,rendered:!1},sourceAlias:{default:null,rendered:!1}}},parseHTML(){return[{tag:`span[data-wiki-link]`,getAttrs:e=>typeof e!=`string`&&{target:e.getAttribute(`data-target`)||``,alias:Vz(e.getAttribute(`data-alias`)),anchor:Vz(e.getAttribute(`data-anchor`)),resolved:e.getAttribute(`data-resolved`)===`true`}},{tag:`a.wiki-link[data-target]`,priority:100,getAttrs:e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-target`)??``;return t?{target:t,alias:Vz(e.getAttribute(`data-alias`)),anchor:Vz(e.getAttribute(`data-anchor`)),resolved:!1}:!1}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.target??``),r=Vz(e.attrs.alias),i=Vz(e.attrs.anchor),a=e.attrs.resolved===!0;return[`span`,{...t,"data-wiki-link":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,"data-resolved":a?`true`:`false`},Hz({target:n,alias:r,anchor:i})]}});function Wz(e){let t=e.split(`/`).pop()??e,n=t.lastIndexOf(`.`);return n<=0||n===t.length-1?``:t.slice(n+1).toLowerCase()}function Gz(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}const Kz=[FR,sz,IR,oz,Uz,Db.create({name:`wikiLinkEmbed`,group:`inline`,inline:!0,atom:!0,priority:60,renderText:DR,addAttributes(){return{target:{default:``},alias:{default:null},anchor:{default:null},resolvedSrc:{default:null,rendered:!1,parseHTML:()=>null}}},parseHTML(){let e=e=>typeof e==`string`||!e.hasAttribute(`data-wiki-embed`)?!1:{target:e.getAttribute(`data-target`)||``,alias:Vz(e.getAttribute(`data-alias`)),anchor:Vz(e.getAttribute(`data-anchor`))};return[{tag:`img[data-wiki-embed]`,getAttrs:e,priority:100},{tag:`a[data-wiki-embed]`,getAttrs:e,priority:100}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.target??``),r=Vz(e.attrs.alias),i=Vz(e.attrs.anchor),a=Vz(e.attrs.resolvedSrc),o=Wz(n);if(Kc.has(o))return[`img`,{...t,"data-wiki-embed":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,src:a??n,alt:r??n}];let s=a??n;return[`a`,{...t,"data-wiki-embed":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,href:i?`${s}#${i}`:s,target:`_blank`,rel:`noopener noreferrer`},Gz({target:n,alias:r,anchor:i})]}}),Oz,iz,az,CR,wR,wz,Mz,lz,SR,cz,AR,jz,UR,jR,WR,kR,TR,fz,xz,bz,nce.configure({trailingNode:!1,undoRedo:!1,bulletList:!1,orderedList:!1,listItem:!1,listKeymap:{listTypes:[{itemName:`listItem`,wrapperNames:[`list`]}]},italic:!1,bold:!1,strike:!1,underline:!1,code:!1,codeBlock:!1,heading:!1,horizontalRule:!1,hardBreak:!1,link:!1,blockquote:!1,dropcursor:{color:`color-mix(in oklch, var(--primary) 50%, transparent)`,width:2}}),yz,Tz.configure({resizable:!0}),LS,Dz,Ez,PR.configure({inline:!0}),MR,px,dz,uz,OR,ER],qz=B({changes:z(Wi(`kind`,[B({key:F(),kind:W(`added`),after:ss}).loose(),B({key:F(),kind:W(`removed`),before:ss}).loose(),B({key:F(),kind:W(`changed`),before:ss,after:ss}).loose()])),unparseable:B({before:F(),after:F()}).loose().nullable()}).loose();function Jz(e){if(e===``)throw Error(`toPathspec: empty path. ":(literal)" is an empty pattern that matches every tracked path; pass "." if you meant the repo root.`);return`:(literal)${e}`}function Yz(e){if(e.length===0)throw Error(`pathspecArgs: empty path list. A bare "--" removes the pathspec restriction rather than selecting nothing.`);return[`--`,...e.map(e=>Jz(e))]}3072-Xz("This is an OpenKnowledge project: load the `open-knowledge` skill and use the OpenKnowledge MCP tools for all markdown — don't probe for `.ok/` or use native file tools on `.md` / `.mdx`. ",`cursor`),new TextEncoder;function Xz(e,t){let n=encodeURIComponent(e);return t===`cursor`?encodeURIComponent(n).length:n.length}function Zz(e){if(e.length===0)return{ok:!1,reason:`docName must not be empty`};if(e.trim().length===0)return{ok:!1,reason:`docName must not be blank (whitespace only)`};if(e!==e.trim())return{ok:!1,reason:`docName must not have leading or trailing whitespace`};for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n<32||n===127)return{ok:!1,reason:`docName must not contain control characters`}}if(e.includes(`..`)||e.startsWith(`/`)||e.includes(`\\`))return{ok:!1,reason:`docName must not contain "..", a leading "/", or a backslash`};for(let t of e.split(`/`)){if(t.length===0)return{ok:!1,reason:`docName must not contain empty path segments (no leading, trailing, or doubled "/")`};if(t.startsWith(`.`))return{ok:!1,reason:`docName path segments must not start with "." (hidden files are not addressable)`}}return{ok:!0}}function Qz(e,t){let n=Zz(e);n.ok||t.addIssue({code:`custom`,message:n.reason})}const $z=F().superRefine(Qz).optional(),eB=F().superRefine(Qz),tB={agentId:F().optional(),agentName:F().optional(),colorSeed:F().optional(),clientName:F().optional(),clientVersion:F().optional(),label:F().optional()},nB=F().optional(),rB=/^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,iB=z(F().min(1)).max(50),aB=U([`dormant`,`idle`,`fetching`,`pulling`,`pushing`,`conflict`,`offline`,`auth-error`,`disabled`]),oB=B({label:F().min(1),webUrl:pi().nullable()}).loose(),sB=Wi(`checkStatus`,[B({checkStatus:W(`allowed`)}).loose(),B({checkStatus:W(`denied`),deniedReason:U([`no-collaborator`,`private-no-access`,`repo-not-found`,`not-authenticated`]),resolvedLogin:F().optional(),declaredLogin:F().optional(),declaredSource:F().optional()}).loose(),B({checkStatus:W(`unknown`),unknownError:U([`network`,`timeout`,`rate-limit`,`token-invalid`,`malformed-response`,`ssh-unverified`]).optional()}).loose()]),cB=U([`auth-403`,`auth-401`,`auth-scope-mismatch`,`auth-no-credential`,`auth-not-found-as-identity`,`semantic-protected-branch`]),lB=U(Sc),uB=U([`succeeded`,`up-to-date`,`conflict`,`refused`,`error`]);B({state:aB,lastSyncUtc:F().nullable(),lastRunUtc:F().nullable().optional(),lastPullOkUtc:F().nullable().optional(),lastPushOkUtc:F().nullable().optional(),lastFetchUtc:F().nullable(),lastPushedSha:F().nullable(),ahead:I().int().min(0),behind:I().int().min(0),consecutiveFailures:I().int().min(0),consecutivePushFailures:I().int().min(0).optional(),conflictCount:I().int().min(0),hasRemote:L(),syncEnabled:L(),identityUnresolved:L(),remote:oB.nullable().optional(),pushError:F().optional(),pushErrorCode:cB.optional(),pullError:F().optional(),pullErrorCode:cB.optional(),pausedReason:F().optional(),blockingPaths:z(F().min(1)).optional(),refusedSymlinkPaths:iB.optional(),pushPermission:sB.optional(),syncMode:lB.optional(),lastPullUtc:F().nullable().optional(),lastPullOutcome:uB.nullable().optional()}).loose(),B({action:U([`commit`]),paths:z(F().min(1)),commitSha:F().optional()}).loose(),B({action:U([`commit`])}).loose(),B({op:U([`sync`,`push`,`pull`,`fetch`]).optional()}).loose(),B({op:U([`sync`,`push`,`pull`,`fetch`])}).loose();const dB=U([`merge-native`,`working-tree`,`reconcile`]),fB=U([`merged-with-markers`,`refused-conflict-markers`,`refused-no-base`,`refused-too-large`,`disk-markers`,`stale-external-write`]),pB=U([`mine`,`theirs`,`content`,`delete`]);B({conflicts:z(B({file:F().min(1),detectedAt:F().min(1),conflict:dB,reason:fB.optional().catch(void 0),conflictKind:U([`git`,`stale-external-write`]).optional(),docName:F().nullable(),theirsSha:F().optional(),baseSha:F().optional()}).loose())}).loose(),B({file:F().min(1),strategy:U([`mine`,`theirs`,`content`,`delete`]),content:F().optional()}).loose().refine(e=>e.strategy!==`content`||e.content!==void 0,{message:`content must be provided when strategy is 'content' (an empty string keeps an empty file)`,path:[`content`]}),B({}).loose(),B({file:F().min(1),base:F(),ours:F(),theirs:F(),kind:U([`both-modified`,`delete-modify`,`modify-delete`]),conflict:dB,reason:fB.optional().catch(void 0),conflictKind:U([`git`,`stale-external-write`]).optional(),resolutionOptions:z(pB)}).loose(),B({plan:ga(e=>e!==void 0,{message:`plan is required`})}).loose(),B({plan:ga(e=>e!==void 0,{message:`plan is required`})}).loose(),B({result:ga(e=>e!==void 0,{message:`result is required`})}).loose(),B({packId:F().min(1)}).strict(),B({installedHosts:z(F()),skills:z(B({name:F().min(1),created:L()}).strict())}).strict();const mB=B({path:F().min(1),summary:F().min(1)}).loose(),hB=B({files:I().int().nonnegative(),folders:I().int().nonnegative()}).loose();B({packs:z(B({id:F().min(1),name:F().min(1),description:F().min(1),defaultSubfolder:F().optional(),folders:z(mB),entryCounts:hB}).loose())}).loose(),B({noOpen:L().optional(),out:F().min(1).optional()}).loose();const gB=B({reason:U([`unsupported-platform`,`spawn-error`]),message:F()}).loose();Wi(`status`,[B({status:W(`installed`),outputPath:F(),size:I().int().nonnegative(),sha256:F(),skillVersion:F()}).loose(),B({status:W(`built`),outputPath:F(),size:I().int().nonnegative(),sha256:F(),skillVersion:F(),handoffError:gB.optional()}).loose(),B({status:W(`failed`),buildError:F()}).loose(),B({status:W(`skip-current`),skillVersion:F(),recordedAt:F().optional()}).loose()]),Wi(`kind`,[B({kind:W(`doc`),docPath:F().min(1)}).loose(),B({kind:W(`folder`),folderPath:F()}).loose()]);const _B=U([`no-remote`,`detached-head`,`branch-not-on-origin`,`non-github-remote`,`invalid-path`,`unsupported-share-url`]),vB=U([`current`,`stale`,`absent`,`empty`]);Wi(`ok`,[B({ok:W(!0),shareUrl:F().min(1),sharedUrl:F().min(1),branch:F().min(1),freshness:vB.optional().catch(void 0)}).loose(),B({ok:W(!1),error:_B,branch:F().min(1).optional()}).loose()]);const yB=U([`user`,`org`]),bB=B({login:F().min(1),kind:yB,avatarUrl:F().optional()}).loose(),xB=U([`auth-required`,`network`]);Wi(`ok`,[B({ok:W(!0),owners:z(bB)}).loose(),B({ok:W(!1),error:xB}).loose()]),Wi(`ok`,[B({ok:W(!0),available:L()}).loose(),B({ok:W(!1),error:xB}).loose()]);const SB=U([`public`,`private`]);B({owner:F().min(1),name:F().min(1),visibility:SB,description:F().optional()}).loose();const CB=U([`name-conflict`,`saml-sso`,`auth-required`,`push-failed`,`init-failed`,`network`,`no-project`]);Wi(`ok`,[B({ok:W(!0),ownerLogin:F().min(1),repoName:F().min(1),cloneUrl:F().min(1),defaultBranch:F().min(1)}).loose(),B({ok:W(!1),error:CB}).loose()]);function wB(e){return!(typeof e!=`string`||e.length===0||e.startsWith(`-`)||/[\x00-\x1F\x7F]/.test(e)||/\s/.test(e)||e.includes(`:`)||e.split(`/`).includes(`..`))}const TB=e=>e.refine(wB,`invalid branch name`),EB={shareTargetExists:L(),dirtyConflicts:B({conflicts:L(),files:z(F().min(1))}).loose(),branchIsLocal:L(),shareTargetOnOriginBranch:L().optional()};Wi(`detached`,[B({detached:W(!1),currentBranch:F().min(1).nullable(),currentHeadSha:Pi(),...EB}).loose(),B({detached:W(!0),currentBranch:Pi(),currentHeadSha:F().min(1),...EB}).loose()]),B({branch:TB(F().min(1)),principalId:F().optional(),fastForward:L().optional()}).loose();const DB=U([`dirty-conflict`,`branch-not-found`,`fetch-failed`,`checkout-failed`,`branch-in-other-worktree`,`ff-diverged`,`unsafe-symlinks`,`symlink-check-failed`]);Wi(`ok`,[B({ok:W(!0)}).loose(),B({ok:W(!1),reason:DB,files:z(F().min(1)).optional(),otherWorktreePath:F().min(1).optional(),refusedSymlinkPaths:iB.optional()}).loose()]),U([`on-origin`,`renamed`,`deleted`,`never-on-branch`,`changed-locally`,`unknown`]),B({branch:TB(F().min(1)),path:F(),kind:U([`doc`,`folder`]),contentRootDepth:I().int().min(1).max(65535).optional()}).loose(),Wi(`verdict`,[B({verdict:W(`on-origin`)}).loose(),B({verdict:W(`renamed`),renamedTo:F().min(1)}).loose(),B({verdict:W(`deleted`)}).loose(),B({verdict:W(`never-on-branch`)}).loose(),B({verdict:W(`changed-locally`)}).loose(),B({verdict:W(`unknown`)}).loose()]).catch({verdict:`unknown`});const OB=B({startedAt:F().min(1),httpListenMs:I().nonnegative().optional(),seedWalkMs:I().nonnegative().optional(),indexesMs:I().nonnegative().optional(),readyMs:I().nonnegative().optional(),fileCount:I().nonnegative().optional()});B({serverInstanceId:F().min(1),currentBranch:F().min(1).optional(),currentDiskAckSVs:H(F().min(1),F().min(1)).optional(),boot:OB.optional(),collabClients:I().int().nonnegative().optional()}).loose(),B({id:F().min(1),display_name:F().min(1),display_email:F(),source:U([`git-config`,`synthesized`]),created_at:F().min(1)}).loose(),B({collabUrl:F().nullable(),previewUrl:F().nullable(),port:I(),singleFile:L().default(!1)}).loose();const kB=U(`urn:ok:error:malformed-upload.urn:ok:error:collision-exhaustion.urn:ok:error:storage-full.urn:ok:error:storage-readonly.urn:ok:error:storage-error.urn:ok:error:no-file-received.urn:ok:error:path-escape.urn:ok:error:symlink-refused.urn:ok:error:links-not-permitted.urn:ok:error:method-not-allowed.urn:ok:error:invalid-request.urn:ok:error:unsupported-media-type.urn:ok:error:payload-too-large.urn:ok:error:request-timeout.urn:ok:error:internal-server-error.urn:ok:error:derived-index-unavailable.urn:ok:error:loopback-required.urn:ok:error:invalid-origin.urn:ok:error:url-not-allowed.urn:ok:error:dir-outside-home.urn:ok:error:concurrent-operation.urn:ok:error:clone-failed.urn:ok:error:clone-timeout.urn:ok:error:server-start-failed.urn:ok:error:reserved-doc-name.urn:ok:error:target-not-found.urn:ok:error:stale-target.urn:ok:error:frontmatter-edit-not-supported.urn:ok:error:invalid-frontmatter-patch.urn:ok:error:frontmatter-malformed.urn:ok:error:no-active-session.urn:ok:error:too-many-agent-sessions.urn:ok:error:disk-divergence.urn:ok:error:stale-external-write.urn:ok:error:store-refused.urn:ok:error:doc-removed.urn:ok:error:doc-not-found.urn:ok:error:doc-already-exists.urn:ok:error:doc-not-open.urn:ok:error:rollback-not-configured.urn:ok:error:doc-not-available.urn:ok:error:backlink-index-not-configured.urn:ok:error:file-rescan-not-configured.urn:ok:error:shadow-not-configured.urn:ok:error:host-not-allowed.urn:ok:error:principal-not-available.urn:ok:error:not-found.urn:ok:error:auth-failed.urn:ok:error:no-project-dir.urn:ok:error:non-github-origin.urn:ok:error:server-open-failed.urn:ok:error:doc-in-conflict.urn:ok:error:concurrent-overwrite-refused.urn:ok:error:unresolved-conflict-markers.urn:ok:error:no-conflict-tracked.urn:ok:error:no-blocking-changes.urn:ok:error:sync-not-active.urn:ok:error:project-repo-not-configured.urn:ok:error:seed-prerequisite-missing.urn:ok:error:seed-invalid-root.urn:ok:error:tag-index-not-configured.urn:ok:error:template-not-found.urn:ok:error:unsupported-asset-type.urn:ok:error:asset-not-found.urn:ok:error:single-file-mode.urn:ok:error:collab-server-not-running.urn:ok:error:gateway-timeout.urn:ok:error:cursor-not-installed.urn:ok:error:cursor-spawn-timeout.urn:ok:error:cursor-spawn-failed.urn:ok:error:handoff-target-not-installed.urn:ok:error:handoff-spawn-timeout.urn:ok:error:handoff-spawn-failed.urn:ok:error:registry-unreachable.urn:ok:error:config-not-writable.urn:ok:error:audit-superseded.urn:ok:error:theme-name-taken.urn:ok:error:theme-name-invalid`.split(`.`)),AB=B({type:kB,title:F().min(1),status:I().int().min(400).max(599),instance:F().regex(rB,`instance must be urn:uuid:<uuid>`).optional(),detail:F().optional()}).loose();B({parentDocName:F().min(1),placement:U([`configured-attachments`,`parent-dir`]).default(`configured-attachments`),agentId:F().min(1).optional(),agentName:F().min(1).optional()}).loose(),B({src:F().min(1),path:F().min(1).optional(),deduped:L().optional()}).loose(),B({url:F().min(1),dir:F().min(1),branch:F().min(1).refine(wB,`invalid branch name`).optional()}).loose(),B({type:W(`error`),problem:AB}).loose();function jB(e,t){let n=t.map(e=>[Xu(e),e]);for(let t of e){let e=Xu(t);if(e===null)continue;let r=n.find(([t])=>t===e);if(r!==void 0)return r[1]}}function MB(e){let{override:t,storedPreference:n,preferenceList:r,supportedLocales:i}=e,a=e.autoDetectableLocales??i;if(t!==void 0){let e=jB([t],i);if(e!==void 0)return{locale:e,source:`override`}}if(n!==void 0&&n!==`system`&&i.includes(n))return{locale:n,source:`explicit`};let o=jB(r,a);return o===void 0?{locale:`en`,source:`fallback`}:{locale:o,source:`system`}}function NB(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e===45||e===95}function PB(e){if(!e.includes(`eyJ`))return null;let t=[],n=[];for(let r=0;r<e.length;r+=1)if(NB(e.charCodeAt(r))){for(t.push(r);r<e.length&&NB(e.charCodeAt(r));)r+=1;n.push(r)}let r=[];for(let t=e.indexOf(`eyJ`);t!==-1;t=e.indexOf(`eyJ`,t+1))r.push(t);let i=r=>r+1<t.length&&e[n[r]??-1]===`.`&&t[r+1]===(n[r]??-1)+1,a=[],o=0,s=0;for(let c=0;c+2<t.length;c+=1){let l=t[c]??0,u=n[c]??0;for(;s<r.length&&(r[s]??0)<l;)s+=1;if(!i(c)||!i(c+1))continue;let d=t[c+1]??0,f=n[c+1]??0,p=(n[c+2]??0)-(t[c+2]??0);if(!e.startsWith(`eyJ`,d)||f-d<11||p<8)continue;let m=r[s];m===void 0||m>=u||u-m<11||(a.push(e.slice(o,m),`[REDACTED-JWT]`),o=n[c+2]??e.length,c+=2)}return a.length===0?null:(a.push(e.slice(o)),a.join(``))}function FB(e){return RegExp(`(?:\\b|(?<=(?:\\[|\\u009b)[0-?]*[ -/]*[@-~]))${e.source}`,`g`)}const IB=[{name:`github-pat`,regex:/(ghp_|gho_|ghu_|ghs_|ghr_)[A-Za-z0-9]{36,}\b/g,replacement:`[REDACTED-GH-PAT]`},{name:`aws-access-key`,regex:FB(/(AKIA|ASIA|ABIA)[A-Z2-7]{16}\b/),replacement:`[REDACTED-AWS-KEY]`},{name:`anthropic-key`,regex:/sk-ant-api03-[A-Za-z0-9_-]{20,}\b/g,replacement:`[REDACTED-ANTHROPIC]`},{name:`openai-key`,regex:FB(/sk-[A-Za-z0-9]{20,}\b/),replacement:`[REDACTED-OPENAI]`},{name:`bearer-token`,regex:/([Aa]uthorization:\s*[Bb]earer\s+)(?:\\"[^\s"\\]+\\"|"[A-Za-z0-9\-._~+/=]+"|[^\s"\\]+)/g,replacement:`$1[REDACTED]`},{name:`jwt`,redact:PB},{name:`url-credentials`,regex:/:\/\/[^/\s:@"]+:[^/\s:@"]+@/g,replacement:`://[REDACTED]@`},{name:`github-pat-fine-grained`,regex:/github_pat_[0-9A-Za-z_]{20,}/g,replacement:`[REDACTED-GH-PAT]`},{name:`openai-key-modern`,regex:FB(/sk-(?:proj|svcacct|admin|None)-[A-Za-z0-9_-]{20,}/),replacement:`[REDACTED-OPENAI]`},{name:`slack-token`,regex:/xox[a-z]-[A-Za-z0-9-]{10,}/g,replacement:`[REDACTED-SLACK]`},{name:`google-api-key`,regex:/AIza[0-9A-Za-z_-]{35}/g,replacement:`[REDACTED-GOOGLE]`},{name:`stripe-secret-key`,regex:FB(/(?:sk|rk)_live_[0-9A-Za-z]{16,}\b/),replacement:`[REDACTED-STRIPE]`},{name:`gitlab-pat`,regex:/glpat-[0-9A-Za-z_-]{20,}/g,replacement:`[REDACTED-GITLAB]`},{name:`bearer-token-json`,regex:/("[Aa]uthorization"\s*:\s*"[Bb]earer\s+)(?:\\"[^"\\]+\\"|[^"\\]+)/g,replacement:`$1[REDACTED]`},{name:`macos-home-path`,regex:/\/Users\/[^/"\r]*[^/"\r\\]/g,replacement:`~`},{name:`linux-home-path`,regex:/\/home\/[^/"\r]*[^/"\r\\]/g,replacement:`~`},{name:`windows-home-path`,regex:/[A-Za-z]:\\{1,2}Users\\{1,2}(?:(?![A-Za-z]:\\)[^\\"\r])+/gi,replacement:`~`}],LB=IB.map(e=>e.name);function RB(e){let t=new Set,n=0;return{redacted:e.split(`
|
|
344
344
|
`).map(e=>{let r=e,i=!1;for(let e of IB){if(`redact`in e){let n=e.redact(r);if(n===null)continue;t.add(e.name),i=!0,r=n;continue}let{name:n,regex:a,replacement:o}=e;a.lastIndex=0,a.test(r)&&(t.add(n),i=!0,a.lastIndex=0,r=r.replace(a,o))}return i&&n++,r}).join(`
|
|
345
345
|
`),patterns:[...t],lineCount:n}}function zB(e,t,n=3){let r=RegExp(`^ {0,3}(\\${e}+)[ \\t]*$`),i=Math.max(3,n);for(let e of t.split(`
|
|
346
346
|
`)){let t=r.exec(e);t&&t[1].length>=i&&(i=t[1].length+1)}return i}function BB(e){let t=[],n=0,r=()=>{t.length>0&&(n+=1)},i=e=>{for(;n>0;)t.push({type:`break`}),--n;t.push(e)},a=e=>{e.split(`
|
|
@@ -418,7 +418,7 @@ ${t.slice(l+2)}`,d+=1;else break}t.push({indent:l,number:parseInt(s,10),content:
|
|
|
418
418
|
`),s=e=>({start:{line:e,character:0},end:{line:e,character:o[e]?.length??0}}),c=[];for(let{schema:e,ruleId:n}of t){let t=Zq(e);if(t&&!t(i))for(let e of t.errors??[]){let t=e.keyword;if(t===`if`)continue;let o=0,l,u=`invalid`,d;if(t===`maxProperties`&&e.instancePath===``)l=`This document must not have frontmatter`;else if(t===`required`&&e.instancePath===``){let t=String(e.params.missingProperty??``);l=`Frontmatter property "${t}" is required`,u=`missing`,t!==``&&(d=t)}else if(e.instancePath===``)l=`Frontmatter ${e.message??`violates "${t}"`}`;else{let n=nJ(e.instancePath);n!==null&&(o=a.get(n)??0);let r=rJ(e.instancePath),s=n!==null&&r===n?i[n]:void 0;if(t===`enum`)l=`Frontmatter property "${r}" must be one of: ${(e.params.allowedValues??[]).map(String).join(`, `)}${tJ(s)}`;else if(t===`format`&&eJ(e.params)!==void 0){let t=e.params.format;l=`Frontmatter property "${r}" must be ${eJ(e.params)} (format "${String(t)}")${tJ(s)}`}else l=`Frontmatter property "${r}" ${e.message??`violates "${t}"`}`}c.push({range:s(o),severity:`warning`,source:r,code:n??t,message:l,frontmatterScope:u,...d===void 0?{}:{frontmatterProperty:d}})}}return c}function aJ(e,t){return GI(e,HI({strings:{doc:e},config:t}).doc??[])}function oJ(e,t){let n=HI({strings:{doc:e},config:t}).doc??[],r=e.split(`
|
|
419
419
|
`),i=sJ(t);return n.map(e=>qhe(e,r,cJ(e,i)))}function sJ(e){let t=new Map;return Object.entries(e).forEach(([e,n],r)=>{let i=e.toUpperCase();if(i===`DEFAULT`)return;let a=null;if(n===`error`||n===`warning`)a=n;else if(typeof n==`object`&&n&&!Array.isArray(n)){let e=n.severity;(e===`error`||e===`warning`)&&(a=e)}a!==null&&t.set(i,{entryIndex:r,severity:a})}),t}function cJ(e,t){let n;for(let r of e.ruleNames){let e=t.get(r.toUpperCase());e!==void 0&&(n===void 0||e.entryIndex>n.entryIndex)&&(n=e)}return n?.severity??`warning`}function qhe(e,t,n){let[r,i]=e.errorRange??[1,null],a=e.lineNumber-1,o=(r??1)-1,s=t[a]?.length??0,c=i==null?s:Math.min(o+i,s),l=e.fixInfo?[Jhe(e.fixInfo,e.lineNumber,t)]:void 0;return{range:{start:{line:a,character:o},end:{line:a,character:Math.max(c,o)}},severity:n,source:`markdownlint`,code:e.ruleNames[0]??`MD000`,message:e.errorDetail?`${e.ruleDescription}: ${e.errorDetail}`:e.ruleDescription,...l?{fixes:l}:{}}}function Jhe(e,t,n){let r=e.lineNumber??t,i=r-1;if(e.deleteCount===-1){if(r<n.length)return{range:{start:{line:i,character:0},end:{line:i+1,character:0}},newText:``};if(i>0){let e=n[i-1]?.length??0;return{range:{start:{line:i-1,character:e},end:{line:i,character:n[i]?.length??0}},newText:``}}return{range:{start:{line:0,character:0},end:{line:0,character:n[0]?.length??0}},newText:``}}let a=(e.editColumn??1)-1;return{range:{start:{line:i,character:a},end:{line:i,character:a+Math.max(0,e.deleteCount??0)}},newText:e.insertText??``}}const Yhe=[`no-wiki-links`,`log-shape`,`index-shape`,`reserved-casing`,`frontmatter-required`,`frontmatter-recommended`,`frontmatter-provenance`,`frontmatter-computation`,`frontmatter-reserved-index`,`frontmatter-root-index`,`project-no-mdx`];function lJ(e,t){return e?.[t]!==!1}function Xhe(e){return`${e.replace(/^frontmatter-/,``)}.schema.json`}function uJ(e){return`.ok/okf/${Xhe(e)}`}const Zhe={$schema:`http://json-schema.org/draft-07/schema#`,title:`OKF v0.2 — required frontmatter`,description:"The OKF v0.2 conformance floor. A bundle is conformant when every non-reserved .md file contains a parseable YAML frontmatter block whose `type` is non-empty. This schema is the whole of that floor: a concept carrying only `type` is fully conformant. Section numbers cite OKF v0.2: https://github.com/GoogleCloudPlatform/open-knowledge-format/blob/ad30107c31c06aec8a7d5636e0d1058118604e6f/SPEC.md#11-conformance",type:`object`,required:[`type`],properties:{type:{type:`string`,pattern:`\\S`,description:"REQUIRED, and the only always-required key in OKF. A short string identifying the kind of concept; consumers use it for routing, filtering, and presentation. Type values are not registered centrally — pick something descriptive and self-explanatory (`BigQuery Table`, `BigQuery Dataset`, `API Endpoint`, `Metric`, `Playbook`, `Reference`, `Attested Computation`). Consumers must tolerate unknown types, typically by treating them as generic concepts. The `\\S` pattern is what makes §11 rule 2 mean what it says, and it replaces a `minLength` rather than joining one: a length check alone accepts a whitespace-only value that no consumer can route on, and having both would report one mistake twice. OKF v0.2 §4.1, §11."}}},Qhe={$schema:`http://json-schema.org/draft-07/schema#`,title:`OKF v0.2 — recommended frontmatter`,description:"Shapes for the OKF v0.2 recommended keys. Every key here is optional, and nothing is constrained beyond the shape OKF states: declaring a key pins its YAML type when present (so `tags` written as a comma-separated string warns) and advertises it to agents at read time. Section numbers cite OKF v0.2: https://github.com/GoogleCloudPlatform/open-knowledge-format/blob/ad30107c31c06aec8a7d5636e0d1058118604e6f/SPEC.md#41-frontmatter",type:`object`,properties:{title:{type:`string`,description:`Human-readable display name. If omitted, consumers MAY derive a title from the filename. OKF v0.2 §4.1.`},description:{type:`string`,description:"A single sentence summarizing the concept. Used by `index.md` generators, search snippets, and previews. OKF v0.2 §4.1."},resource:{type:`string`,format:`uri-reference`,description:"A URI that uniquely identifies the underlying asset the concept describes. Absent for concepts that describe abstract ideas rather than physical resources. Path-valued: an absolute URL, a bundle-relative path beginning with `/`, or an ordinary relative path — hence `uri-reference`, not `uri`, which would reject `/tables/customers.md`. OKF v0.2 §4.1, §6.2."},tags:{type:`array`,items:{type:`string`},description:`A YAML list of short strings for cross-cutting categorization. Tags stay a first-class concept through this field; OKF specifies no separate per-tag file format, so a consumer that wants a tag-browsing view synthesizes one by scanning frontmatter. OKF v0.2 §3.1, §4.1.`},timestamp:{description:"LEGACY (OKF v0.1), superseded by `generated.at` in v0.2 — one of the two deliberate breaking changes. Consumers MAY fall back to it when `generated` is absent; new documents SHOULD write `generated: { by, at }` instead. Documented here so agents are told what it is and what replaced it, but deliberately left unconstrained: v0.2 does not define it as a producer field, so validating its shape would be a rule OKF no longer has. OKF v0.2 §5.2, §13.1."}}},$he={$schema:`http://json-schema.org/draft-07/schema#`,title:`OKF v0.2 — provenance, trust, and lifecycle frontmatter`,description:'The optional OKF v0.2 families that make "where did this come from", "how much should I trust it", and "is it still current" answerable from frontmatter alone. Every key is optional, and absence carries meaning rather than being an error: a concept with no `verified` is unverified, and a consumer must not reject it. Only `sources[].resource` and `generated.by` are required-when-their-parent-is-present, because those are the two fields OKF marks REQUIRED in this family; every other field is described but not mandated, so nothing else is enforced. Section numbers cite OKF v0.2: https://github.com/GoogleCloudPlatform/open-knowledge-format/blob/ad30107c31c06aec8a7d5636e0d1058118604e6f/SPEC.md#5-provenance-trust-and-lifecycle',type:`object`,properties:{sources:{type:`array`,description:"The materials this concept derives from, external or internal to the bundle. Lineage is expressed through links rather than a dedicated field: when an entry's `resource` points at another OKF concept, the derivation edge already exists in the bundle graph, so a consumer may recurse into that source's own `sources`. OKF v0.2 §5.1.",items:{type:`object`,required:[`resource`],properties:{resource:{type:`string`,description:"REQUIRED within an entry. Either a concrete artifact a consumer can follow (an absolute URL, a bundle-relative path, or a path into a `references/` subdirectory) or a population or scope descriptor it cannot, for example `all queries in BigQuery project X`. Deliberately NOT format-constrained: a scope descriptor is prose, so a `uri-reference` check here would warn on conformant documents. OKF v0.2 §5.1, §6.2, §6.3."},id:{type:`string`,description:"Optional. A stable key used to attribute individual claims: a markdown footnote whose label is this id (`[^ga4-schema]`) attributes the claim it follows. SHOULD be present when the body cites the source. Keyed rather than positional because agents constantly rewrite these documents — a positional index misattributes silently the moment the list is reordered. OKF v0.2 §5.1."},title:{type:`string`,description:`Optional. Human-readable label for the source. OKF v0.2 §5.1.`},author:{type:`string`,description:"Optional credibility signal — an authority signal: who or what produced the source. OKF describes this as following the actor convention (§7), but its own examples use a `team:<id>` prefix that the three §7 forms do not cover, so no pattern is enforced. OKF v0.2 §5.1, §7."},usage_count:{type:`integer`,description:"Optional credibility signal — an adoption and liveness signal: how often `resource` was exercised (dashboard views, query executions, page reads) over `usage_window`. For a single artifact it is that artifact's own exercise count; for a scope descriptor it is the number of exercises within the scope that touch the concept. Coarse by design: comparable at the alive-versus-dead and order-of-magnitude level and against a source's own history, but not a precise cross-kind ranking. Read as liveness and trend, not as a score. OKF v0.2 §5.1."},last_modified:{type:`string`,format:`date-time`,description:"Optional credibility signal — a recency signal: when the source itself last changed, as an ISO 8601 datetime with an explicit UTC offset (`2026-06-15T00:00:00Z`). Distinct from `generated.at`, which records when the concept was written. OKF v0.2 §5, §5.1."},usage_window:{type:`object`,description:"Optional per-entry override of the `usage_window` written as a sibling of `sources`. OKF v0.2 §5.1.",properties:{from:{type:`string`,format:`date-time`,description:"Start of the window framing this entry's `usage_count`, as an ISO 8601 datetime with an explicit UTC offset (`2026-06-01T00:00:00Z`). OKF v0.2 §5, §5.1."},to:{type:`string`,format:`date-time`,description:"End of the window framing this entry's `usage_count`, as an ISO 8601 datetime with an explicit UTC offset (`2026-06-30T00:00:00Z`). OKF v0.2 §5, §5.1."}}}}}},usage_window:{type:`object`,description:"Written once as a sibling of `sources`, this frames every `usage_count` in the list with a `{ from, to }` range. A single entry may carry its own `usage_window` to override it. OKF v0.2 §5, §5.1.",properties:{from:{type:`string`,format:`date-time`,description:"Start of the shared usage window, as an ISO 8601 datetime with an explicit UTC offset (`2026-06-01T00:00:00Z`). OKF v0.2 §5, §5.1."},to:{type:`string`,format:`date-time`,description:"End of the shared usage window, as an ISO 8601 datetime with an explicit UTC offset (`2026-06-30T00:00:00Z`). OKF v0.2 §5, §5.1."}}},generated:{type:`object`,required:[`by`],description:"How the current content was produced. Kept distinct from `verified` because who wrote a concept need not be who confirmed it. OKF v0.2 §5.2.",properties:{by:{type:`string`,description:"REQUIRED within `generated`. An actor in the OKF convention: `<producer>/<version>` for agents and tools (`reference_agent/gemini-2.5-pro`), `human:<id>` for a person (`human:ahormati`), or `process:<id>` for an automated process (`process:finance-nightly`). Consumers that classify trust key off the `human:` prefix, so producers MUST use it for hand-authored or human-confirmed content — a rule about which form to pick for which content, which frontmatter alone cannot check, so the three forms are documented here rather than enforced by a pattern. OKF v0.2 §5.2, §7."},at:{type:`string`,format:`date-time`,description:"An ISO 8601 datetime with an explicit UTC offset (`2026-06-30T14:00:00Z`) marking the content's last meaningful change. Consumers use it to tell a recent edit from a stale fact. Supersedes v0.1's top-level `timestamp`. OKF v0.2 §5, §5.2, §13.1."}}},verified:{description:'Who or what has confirmed the content against its sources or `resource` — a list of verification events. Multiple entries capture independent checks, for example a human sign-off plus a nightly process; "how recently" is the latest `at`. Independent of `generated.at`: content can change without re-confirmation, and facts can be re-confirmed without regeneration. A single verifier MAY be written as one bare `{ by, at }` mapping without the list dash, and consumers MUST treat that as a one-element list — hence the two accepted shapes here. Absence means unverified, which is a valid state, never a rejection. OKF v0.2 §5.2, §5.3, §11.',anyOf:[{type:`object`,description:`The bare single-verifier mapping form. OKF v0.2 §5.2.`,properties:{by:{type:`string`,description:"The verifying actor: `<producer>/<version>`, `human:<id>`, or `process:<id>`. A `human:` verifier is what raises the trust tier to human-reviewed; non-human verifiers alone yield machine-confirmed. OKF v0.2 §5.2, §5.3, §7."},at:{type:`string`,format:`date-time`,description:"An ISO 8601 datetime with an explicit UTC offset (`2026-07-01T09:00:00Z`) recording when the verification event happened. OKF v0.2 §5, §5.2."}}},{type:`array`,description:`The list form: one entry per independent verification event. OKF v0.2 §5.2.`,items:{type:`object`,properties:{by:{type:`string`,description:"The verifying actor: `<producer>/<version>`, `human:<id>`, or `process:<id>`. A `human:` verifier is what raises the trust tier to human-reviewed; non-human verifiers alone yield machine-confirmed. OKF v0.2 §5.2, §5.3, §7."},at:{type:`string`,format:`date-time`,description:"An ISO 8601 datetime with an explicit UTC offset (`2026-07-01T09:00:00Z`) recording when the verification event happened. OKF v0.2 §5, §5.2."}}}}]},status:{enum:[`draft`,`stable`,`deprecated`],description:"Lifecycle state. `draft` = not yet reviewed, possibly incomplete. `stable` = ready for consumption. `deprecated` = kept for links and history, no longer current. Absent means `stable`, so the key is only worth writing to say draft or deprecated. These three values are the whole set OKF defines, which is why this is the pack's only enum. OKF v0.2 §5.4."},stale_after:{type:`string`,format:`date-time`,description:"An absolute instant, an ISO 8601 datetime with an explicit UTC offset (`2026-12-31T00:00:00Z`): the concept is stale when `now >= stale_after`. Absolute rather than a relative TTL so staleness stays a plain comparison with no reference to when the concept was read. An instant in the past is a freshness signal for consumers, not a violation. OKF v0.2 §5, §5.5, §10.5."}}},ege={$schema:`http://json-schema.org/draft-07/schema#`,title:`OKF v0.2 — Attested Computation frontmatter`,description:'Shapes for the OKF v0.2 computation keys, which turn a concept into a sanctioned way to compute a value so a consumer can confirm the agent ran the blessed computation instead of improvising its own. Provenance answers "where did this claim come from"; attestation answers "was this number produced the way we said it must be". This file also carries the one value-shaped rule in the pack: `runtime` is the single key OKF marks REQUIRED here, and only when `type` is `Attested Computation`. Ordinary concepts never match that condition and are unaffected, and no other key in the family is mandated. OKF records the computation and the means to check it and executes nothing itself; receipts and verdicts are runtime artifacts that are never stored in the bundle. Section numbers cite OKF v0.2: https://github.com/GoogleCloudPlatform/open-knowledge-format/blob/ad30107c31c06aec8a7d5636e0d1058118604e6f/SPEC.md#10-attested-computations-concept',type:`object`,if:{required:[`type`],properties:{type:{const:`Attested Computation`,description:"The condition, not a constraint: everything in `then` applies only to documents whose `type` is exactly `Attested Computation`. An ordinary concept never matches, so nothing in this schema is ever asked of it. `type` is also required inside the condition so a document with no type at all fails the conformance floor once, rather than also being told it is missing a `runtime` for a type it never claimed."}}},then:{required:[`runtime`]},properties:{runtime:{type:`string`,description:"REQUIRED for `type: Attested Computation`. The single field that says how to run the computation, and therefore how the executor and attester interpret it and what `parameters` mean — a parameter is a SQL bind variable, a dbt var, or a Python argument depending on the runtime. Keeping `runtime` and `parameters` in one frontmatter is what makes the binding semantics self-evident. Example values: `bigquery`, `postgres`, `dbt`, `python`, `Looker`. Not a closed set, so no enum. OKF v0.2 §10.1, §10.2."},parameters:{type:`array`,description:`The typed, named holes the agent may fill. An agent MAY only supply values for these parameters; it MUST NOT author or edit the computation. That parameter-only surface is what makes "did the sanctioned thing run" a mechanical comparison rather than a judgement call. OKF v0.2 §10.2, §10.3.`,items:{type:`object`,properties:{name:{type:`string`,description:"The parameter name the computation binds, for example `year` bound as `@year` in BigQuery SQL or `{{ var('year') }}` in dbt. OKF v0.2 §10.2, §10.3."},type:{type:`string`,description:"The parameter's type, interpreted by `runtime` (`integer`, `string`, and so on). Deliberately not constrained to JSON Schema type names, because the vocabulary belongs to the runtime. OKF v0.2 §10.2."},required:{type:`boolean`,description:`Whether the agent must supply a value for this parameter. OKF v0.2 §10.2.`}}}},computation:{type:`string`,format:`uri-reference`,description:"Optional. A path to a file holding the computation, used instead of an inline body fence — best for a long or generated computation, or one already kept as a real file shared with non-OKF tooling. When absent, the body's `# Computation` fence IS the computation. Path-valued: an absolute URL, a bundle-relative path beginning with `/`, or a relative path. OKF v0.2 §6.2, §10.2, §10.3."},executor:{type:`object`,description:"How the computation is run. A runner — an agent, or deterministic consumer code — follows `resource`, and the run returns a receipt shaped by `receipt`. Binding the computation with the parameter values into the executable artifact is the consumer's job. OKF v0.2 §10.2, §10.5.",properties:{resource:{type:`string`,format:`uri-reference`,description:"Names the run instructions or code. What sits behind it — a Skill, a script, a container — is a packaging choice; OKF fixes the interface, not the packaging. Conventionally points into a `references/` subdirectory, for example `references/skills/run-on-bq.md`. OKF v0.2 §1, §6.2, §6.3, §10.2."},receipt:{type:`array`,items:{type:`string`},description:"Declares the fields a run must return — the evidence the attester inspects, for example `[job_id, executed_sql, result]` for BigQuery or `[run_id, compiled_sql, result]` for dbt. Because the attester compares the expanded, compiled artifact the receipt carries, a rewritten query, a swapped computation file, or a mutated dependency fails the check. The receipt itself is a runtime artifact and is never stored in the bundle. OKF v0.2 §10.2, §10.3, §10.5."}}},attester:{type:`object`,description:"The deterministic check that inspects a receipt and returns a verdict. Meant to run consumer-side. Distinct from `verified`: `verified` confirms the definition still matches policy and is recorded in the bundle, while attestation confirms a single run produced the value the sanctioned way and is not stored. OKF v0.2 §10.2, §10.6.",properties:{resource:{type:`string`,format:`uri-reference`,description:"Names code — no LLM — that takes a receipt and returns a verdict, independently re-deriving the binding of `computation` with the claimed parameter values to compare against what actually ran. Conventionally points into a `references/` subdirectory, for example `references/attesters/sql-equality.py`. OKF v0.2 §6.2, §6.3, §10.2, §10.3."}}}}},tge={$schema:`http://json-schema.org/draft-07/schema#`,title:`OKF v0.2 — index files carry no frontmatter`,description:"`index.md` is a reserved filename at any level of the hierarchy and must not be used for a concept document. Index files contain no frontmatter, with exactly one exception — a bundle-root `index.md` may carry `okf_version` — which the scope carves out with a `!index` exclusion rather than a keyword here. `maxProperties: 0` is the mechanism rather than the boolean schema `false`, because a document with no frontmatter block validates as `{}` and `false` would reject that too, flagging the very documents that are correct. `log.md` is deliberately NOT covered: §9 constrains a log's date headings, ordering, and prose entries but never its frontmatter, and OKF's own reference bundle ships a `log.md` carrying `type` and `title`. Section numbers cite OKF v0.2: https://github.com/GoogleCloudPlatform/open-knowledge-format/blob/ad30107c31c06aec8a7d5636e0d1058118604e6f/SPEC.md#8-index-files",type:`object`,maxProperties:0},nge={$schema:`http://json-schema.org/draft-07/schema#`,title:`OKF v0.2 — bundle-root index.md`,description:"The bundle-root `index.md` is the only index file OKF permits frontmatter in, and `okf_version` is the key it names there. OKF states the declaration as a MAY, so it is not required here. Nor is the frontmatter closed to other keys: §8 grants the exception for `okf_version` specifically, but §11 tells consumers not to reject a bundle over unknown additional keys, and that ambiguity is resolved in favor of the looser reading. The one thing pinned is the value's shape, because a YAML float is provably lossy where a version string is not. Section numbers cite OKF v0.2: https://github.com/GoogleCloudPlatform/open-knowledge-format/blob/ad30107c31c06aec8a7d5636e0d1058118604e6f/SPEC.md#12-versioning",type:`object`,properties:{okf_version:{type:`string`,pattern:`^[0-9]+\\.[0-9]+$`,description:'The OKF version this bundle targets, as `<major>.<minor>` — currently `"0.2"`. Quote it: unquoted `0.2` parses as a YAML number, so a consumer comparing version strings sees a float instead, and `0.10` would silently become `0.1`. A minor bump is backward-compatible additions; a major bump may rename required fields or change reserved filenames. Consumers that do not understand the declared version should attempt best-effort consumption rather than refusing the bundle. OKF v0.2 §12.'}}},dJ=[`**`,`!**/{index,log}`],fJ=[{id:`frontmatter-required`,appliesTo:dJ,schema:Zhe},{id:`frontmatter-recommended`,appliesTo:dJ,schema:Qhe},{id:`frontmatter-provenance`,appliesTo:dJ,schema:$he},{id:`frontmatter-computation`,appliesTo:dJ,schema:ege},{id:`frontmatter-reserved-index`,appliesTo:[`**/index`,`!index`],schema:tge},{id:`frontmatter-root-index`,appliesTo:[`index`],schema:nge}],rge=Object.fromEntries(Yhe.filter(e=>!fJ.some(t=>t.id===e)).map(e=>[e,!1]));function pJ(e,t){return t===void 0?[]:fJ.filter(n=>lJ(e,n.id)&&Rq([...n.appliesTo]).matches(t))}function ige(e){return fJ.filter(t=>lJ(e,t.id)).map(e=>({appliesTo:[...e.appliesTo],file:uJ(e.id)}))}function age(e,t,n){let r=pJ(t,n);return r.length===0?[]:iJ(e,r.map(e=>({file:uJ(e.id),schema:e.schema,ruleId:e.id})),{source:`okf`})}function mJ(e,t){return KI(`okf:${e}`,(n,r)=>{try{t(n,r)}catch(t){console.warn(`[lint] OKF rule "${e}" failed${r.data.okfDocName?` on "${r.data.okfDocName}"`:``}`,t)}})}function hJ(e,t,n){let r=Rq(t);return mJ(e,(e,t)=>{r.matches(t.data.okfDocName)&&n(e,t)})}const gJ=e=>({line:e.line-1,character:e.column-1});function oge(e,t){if(e&&`start`in e)return{start:gJ(e.start),end:gJ(e.end)};if(e){let n=gJ(e);return{start:n,end:{line:n.line,character:t[n.line]?.length??0}}}return{start:{line:0,character:0},end:{line:0,character:t[0]?.length??0}}}function sge(e,t){return{range:oge(e.place,t),severity:`warning`,source:`okf`,code:e.ruleId??`okf`,message:e.reason}}function cge(e,t,n){if(t.length===0)return[];let r=mO().use(wk).use(lO).use(RO,[`yaml`]);for(let e of t)r.use(e);let i=new eE({value:e});n!==void 0&&(i.data.okfDocName=n);let a=r.parse(i);r.runSync(a,i);let o=e.split(`
|
|
420
420
|
`);return i.messages.map(e=>sge(e,o))}function lge(e){let t=!1;return dE(e,[`link`,`linkReference`],()=>(t=!0,!1)),t}const uge=hJ(`index-shape`,`**/index`,(e,t)=>{let n=!1;for(let r of e.children){if(r.type===`heading`){n=!0;continue}r.type===`list`&&!n&&t.message(`This index list is not under a section heading, so an Open Knowledge Format consumer reading the file as navigation has no name to file its entries under — an index is one or more heading-led sections of bulleted links.`,r)}dE(e,`listItem`,e=>{e.children.some(e=>e.type===`list`)||lge(e)||t.message(`This index entry has no link, so an Open Knowledge Format consumer reading the file as navigation has nowhere to follow it. Every entry in the format's own reference bundles is a link followed by a short description.`,e)})}),dge=/^\s*(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])(?!\d)/;function fge(e,t,n){let r=new Date(Date.UTC(e,t-1,n));return r.getUTCFullYear()===e&&r.getUTCMonth()===t-1&&r.getUTCDate()===n}const pge=/^\s*\d{4}[-/.]\d{1,2}[-/.]\d{1,2}/;function _J(e){let t=e.trim();return t.length>60?`${t.slice(0,59)}…`:t}const mge=hJ(`log-shape`,`**/log`,(e,t)=>{let n;dE(e,`heading`,e=>{if(e.depth!==2)return;let r=fE(e),i=dge.exec(r);if(!i){t.message(pge.test(r)?`Log date heading "${_J(r)}" is not in ISO 8601 YYYY-MM-DD form, the one form an Open Knowledge Format log requires of its date headings.`:`Log entry heading "${_J(r)}" is not a date, so it falls outside the dated-entry format an Open Knowledge Format consumer reads a log as — nothing under it reaches the change-history timeline.`,e);return}let a=`${i[1]}-${i[2]}-${i[3]}`;if(!fge(Number(i[1]),Number(i[2]),Number(i[3]))){t.message(`Log date heading "${a}" is not a real calendar date, so it is not ISO 8601 — the one form an Open Knowledge Format log requires of its date headings.`,e);return}n!==void 0&&a>n&&t.message(`Log date heading "${a}" is newer than the entry above it — an Open Knowledge Format log is a flat list of date-grouped entries, newest first.`,e),n=a})}),hge=/\[\[[^[\]\n]+\]\]/g;function gge(e){let t=`Wiki-link ${e} won't resolve for an external Open Knowledge Format consumer — it renders as literal text and its graph edge is lost.`;return e.includes(`|`)?`${t} The alias "|" also splits a GFM table cell.`:t}const _ge=mJ(`no-wiki-links`,(e,t)=>{let n=typeof t.value==`string`?t.value:String(t.value);dE(e,`text`,e=>{let r=e.position?.start,i=e.position?.end,a=r?.offset,o=a===void 0||i?.offset===void 0?e.value:n.slice(a,i.offset),s=0,c=r?.line??0,l=r?.column??0,u=e=>{for(;s<e;s+=1)o[s]===`
|
|
421
|
-
`?(c+=1,l=1):l+=1;return{line:c,column:l}};for(let e of o.matchAll(hge)){let{index:i}=e;if((a===void 0?o[i-1]:n[a+i-1])===`!`)continue;let s=r&&a!==void 0?{start:u(i),end:u(i+e[0].length)}:void 0;t.message(gge(e[0]),s)}})}),vge=[`index`,`log`],yge=mJ(`reserved-casing`,(e,t)=>{let n=t.data.okfDocName;if(n===void 0)return;let r=hR(n),i=r.toLowerCase();vge.includes(i)&&r!==i&&t.message(`This file is named "${r}", but the Open Knowledge Format only recognizes "${i}". On a case-sensitive filesystem a consumer reads it as an ordinary concept document rather than the reserved file it is meant to be.`)}),vJ=[{id:`no-wiki-links`,rule:_ge},{id:`log-shape`,rule:mge},{id:`index-shape`,rule:uge},{id:`reserved-casing`,rule:yge}],bge=vJ.map(e=>e.rule);function xge(e){return e===void 0?bge:vJ.filter(t=>lJ(e,t.id)).map(e=>e.rule)}const Sge=V([L(),U(_l),H(F(),R())]),Cge={id:`markdownlint`,sliceSchema:B({enabled:L(),rules:H(F(),Sge)}),defaultSlice:{enabled:!1,rules:Fq},async lint(e,t){return oJ(e,Iq(t.rules))},fix(e,t){return aJ(e,Iq(t.rules))}},wge=B({appliesTo:V([F(),z(F())]).optional(),file:F(),enabled:L().optional(),key:F().optional(),schema:H(F(),R()).optional()}),yJ=[Cge,{id:`frontmatter`,sliceSchema:B({enabled:L(),schemas:z(wge)}),defaultSlice:{enabled:!1,schemas:[]},async lint(e,t,n){return iJ(e,zq(t.schemas,n.docName))},frontmatter:{schemasForDoc:(e,t)=>zq(e.schemas,t),narrowSliceToFrontmatter:e=>e,advertisedMappings:e=>e.schemas}},{id:`okf`,sliceSchema:B({enabled:L(),rules:H(F(),L()).optional(),generate:B({index:L().optional()}).optional()}),defaultSlice:{enabled:!1},async lint(e,t,n){return[...cge(e,xge(t.rules),n.docName),...age(e,t.rules,n.docName)]},frontmatter:{schemasForDoc:(e,t)=>pJ(e.rules,t),narrowSliceToFrontmatter:e=>({...e,rules:{...e.rules,...rge}}),advertisedMappings:e=>ige(e.rules)}}];Object.fromEntries(yJ.map(e=>[e.id,e.defaultSlice])),B({docName:$z,summary:nB,content:F().optional(),...tB}).loose(),B({docName:$z,summary:nB,markdown:F(),position:U([`append`,`prepend`,`replace`]).optional(),extension:U(lR).optional(),...tB}).loose(),B({docName:$z,summary:nB,find:F().min(1),replace:F(),offset:I().int().nonnegative().optional(),...tB}).loose(),B({docName:$z,connectionId:F().min(1),scope:U([`last`,`session`,`file`,`count`]).optional(),count:I().int().positive().optional(),...tB}).loose().refine(e=>e.scope!==`count`||e.count!==void 0,{message:`count is required when scope is 'count'`,path:[`count`]});const bJ=B({value:F(),truncatedFrom:I().int().nonnegative().optional(),hint:F().optional()}).loose(),Tge=Wi(`kind`,[B({kind:W(`inline`),content:F()}),B({kind:W(`truncated`),byteLength:I().int().nonnegative(),hint:F()})]),xJ=B({kind:W(`content-divergence`),intendedBytes:I().int().nonnegative(),actualBytes:I().int().nonnegative(),byteDelta:I().int(),divergenceType:F().optional(),currentState:Tge.optional(),hint:F().optional()}).loose(),Ege=B({type:W(`orphan`),parentCandidates:z(F()),message:F()}).loose(),SJ=B({kind:W(`disk-edit-reconciled`),intendedBytes:I().int().nonnegative(),actualBytes:I().int().nonnegative(),byteDelta:I().int(),mergeOutcome:F().optional(),hint:F().optional()}).loose();Wi(`kind`,[xJ,SJ]);const Dge=Object.keys({"content-divergence":!0,"disk-edit-reconciled":!0}),Oge=B({kind:W(`mermaid-parse-error`),fenceIndex:I().int().positive(),fenceFirstLine:F(),message:F(),line:I().int().positive().optional()}).loose(),CJ=B({href:F(),targetKind:F(),role:F(),sourceForm:F(),resolvedTarget:F().nullable(),reason:F(),resolutionMethod:F(),fallbackTarget:F().nullable().optional(),definition:B({line:I().int().nonnegative(),label:F()}).loose().optional()}).loose(),wJ=Wi(`kind`,[xJ,SJ,Oge,B({kind:W(`lint-violation`),source:F(),code:F(),message:F(),severity:U([`error`,`warning`,`info`,`hint`]),line:I().int().positive(),column:I().int().positive(),linkTarget:F().optional(),localTarget:CJ.optional()}).loose()]),TJ=z(wJ).min(1),EJ=B({href:F(),resolvedTo:F().nullable(),reason:U([`no-such-doc`,`no-such-file`,`unresolvable`]),localTarget:CJ.optional()}).loose(),DJ=z(EJ),OJ=B({reason:F().min(1),count:I().int().positive()}).loose();B({timestamp:F().min(1),summary:bJ.optional(),warnings:TJ.optional()}).loose(),B({timestamp:F().min(1),subscriberCount:I().int().nonnegative(),systemSubscriberCount:I().int().nonnegative(),hints:z(Ege).optional(),summary:bJ.optional(),warnings:TJ.optional(),brokenLinks:DJ,brokenLinkSuppression:OJ.optional()}).loose(),B({timestamp:F().min(1),subscriberCount:I().int().nonnegative(),systemSubscriberCount:I().int().nonnegative(),summary:bJ.optional(),warnings:TJ.optional(),brokenLinks:DJ,brokenLinkSuppression:OJ.optional()}).loose(),B({docName:F().min(1),scope:U([`last`,`session`,`count`]),undone:L()}).loose(),B({docs:z(B({docName:eB,markdown:F(),position:U([`append`,`prepend`,`replace`]).optional(),extension:U(lR).optional(),summary:nB}).loose()).min(1).max(100),...tB}).loose();const kge=B({type:kB,title:F(),detail:F().optional()}).loose(),Age=Wi(`status`,[B({status:W(`written`),docName:F().min(1),summary:bJ.optional(),warnings:TJ.optional(),brokenLinks:DJ,brokenLinkSuppression:OJ.optional()}).loose(),B({status:W(`error`),docName:F().min(1),error:kge}).loose()]);B({timestamp:F().min(1),results:z(Age),written:I().int().nonnegative(),failed:I().int().nonnegative()}).loose(),B({docName:$z,patch:H(F(),V([ss,Pi()])),types:H(F(),U(is)).optional(),summary:nB,...tB}).loose(),B({timestamp:F().min(1),subscriberCount:I().int().nonnegative(),systemSubscriberCount:I().int().nonnegative(),appliedKeys:z(F()),summary:bJ.optional(),warnings:TJ.optional(),brokenLinks:DJ,brokenLinkSuppression:OJ.optional()}).loose();const jge=Object.fromEntries(yJ.map(e=>[e.id,e.sliceSchema]));B({effective:B({enabled:L(),plugins:B(jge)}),configFile:F().nullable().optional(),configProblems:z(F()).optional()});const Mge=V([L(),H(F(),R())]),Nge=new Set([`__proto__`]),kJ=F().min(1).max(256).refine(e=>!Nge.has(e),{message:`schema property name cannot be __proto__`});B({ruleId:F().min(1).max(64).regex(/^[A-Za-z][A-Za-z0-9_-]*$/),value:V([Mge,Pi()])}),B({file:F().min(1).max(512),delete:W(!0).optional(),field:kJ.optional(),parentPath:z(V([kJ,B({items:W(!0)}).strict()])).max(8).optional(),removeField:W(!0).optional(),renameTo:kJ.optional(),constraint:B({type:U([`string`,`number`,`boolean`,`array`,`object`]).nullable().optional(),enum:z(V([F(),I(),L()])).nullable().optional(),itemsEnum:z(V([F(),I(),L()])).nullable().optional(),itemsType:U([`string`,`number`,`boolean`,`object`]).nullable().optional(),pattern:F().nullable().optional(),format:F().nullable().optional(),description:F().max(2048).nullable().optional(),required:L().optional()}).optional()}).refine(e=>e.delete===void 0||e.field===void 0&&e.constraint===void 0&&e.removeField===void 0&&e.renameTo===void 0,{message:`delete cannot be combined with a field edit`}).refine(e=>[e.constraint,e.removeField,e.renameTo].filter(e=>e!==void 0).length<=1,{message:`constraint, removeField, and renameTo are mutually exclusive`}).refine(e=>e.removeField===void 0&&e.renameTo===void 0||e.field!==void 0,{message:`removeField and renameTo require field`}).refine(e=>e.parentPath===void 0||e.field!==void 0,{message:`parentPath requires field`}).refine(e=>e.field===void 0?e.constraint===void 0:e.constraint!==void 0||e.removeField!==void 0||e.renameTo!==void 0,{message:`field requires constraint, removeField, or renameTo`}),B({schemas:z(F()),truncated:L()}).strict();const AJ=B({line:I(),character:I()}),jJ=B({start:AJ,end:AJ}),MJ=B({range:jJ,severity:U([`error`,`warning`,`info`,`hint`]),source:F(),code:F(),message:F(),fixes:z(B({range:jJ,newText:F()})).optional(),frontmatterScope:U(ml).optional(),frontmatterProperty:F().optional()}),NJ=z(F()).optional();B({files:z(B({file:F(),diagnostics:z(MJ),ran:NJ,warnings:z(F()).optional()})),fileCount:I(),errorCount:I(),warningCount:I(),warnings:z(F()),ran:NJ});const Pge=MJ.extend({linkTarget:F().optional(),localTarget:CJ.optional()});B({files:z(B({file:F(),diagnostics:z(Pge)})),fileCount:I(),errorCount:I(),warningCount:I(),warnings:z(F()),ran:NJ,brokenLinkSuppression:OJ.optional()});const PJ=B({errorCount:I().int().nonnegative(),warningCount:I().int().nonnegative()});B({files:z(B({file:F(),lint:PJ,links:PJ})),fileCount:I().int().nonnegative(),errorCount:I().int().nonnegative(),warningCount:I().int().nonnegative(),warnings:z(F()),brokenLinkSuppression:OJ.optional()}),B({docName:$z,summary:nB,...tB}).loose();const Fge=B({reason:U([`re-lint-threw`,`source-went-blind`]),message:F().min(1)});B({file:F(),fixedCount:I(),diagnostics:z(MJ),errorCount:I(),warningCount:I(),ran:NJ,warnings:z(F()).optional(),diagnosticsArePreFix:L().optional(),reLintFailure:Fge.optional()});const Ige=[{id:`MD001`,alias:`heading-increment`,aliases:[`heading-increment`],name:`Heading levels should only increment by one level at a time`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md001.md`,tags:[`headings`],options:[{key:`front_matter_title`,type:`string`,description:`RegExp for matching title in front matter`,default:`^\\s*title\\s*[:=]`}]},{id:`MD003`,alias:`heading-style`,aliases:[`heading-style`],name:`Heading style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md003.md`,tags:[`headings`],options:[{key:`style`,type:`enum`,description:`Heading style`,enum:[`consistent`,`atx`,`atx_closed`,`setext`,`setext_with_atx`,`setext_with_atx_closed`],default:`consistent`}]},{id:`MD004`,alias:`ul-style`,aliases:[`ul-style`],name:`Unordered list style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md004.md`,tags:[`bullet`,`ul`],options:[{key:`style`,type:`enum`,description:`List style`,enum:[`consistent`,`asterisk`,`plus`,`dash`,`sublist`],default:`consistent`}]},{id:`MD005`,alias:`list-indent`,aliases:[`list-indent`],name:`Inconsistent indentation for list items at the same level`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md005.md`,tags:[`bullet`,`ul`,`indentation`],options:[]},{id:`MD007`,alias:`ul-indent`,aliases:[`ul-indent`],name:`Unordered list indentation`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md007.md`,tags:[`bullet`,`ul`,`indentation`],options:[{key:`indent`,type:`integer`,description:`Spaces for indent`,default:2,minimum:1},{key:`start_indented`,type:`boolean`,description:`Whether to indent the first level of the list`,default:!1},{key:`start_indent`,type:`integer`,description:`Spaces for first level indent (when start_indented is set)`,default:2,minimum:1}]},{id:`MD009`,alias:`no-trailing-spaces`,aliases:[`no-trailing-spaces`],name:`Trailing spaces`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md009.md`,tags:[`whitespace`],options:[{key:`br_spaces`,type:`integer`,description:`Spaces for line break`,default:2,minimum:0},{key:`code_blocks`,type:`boolean`,description:`Include code blocks`,default:!1},{key:`list_item_empty_lines`,type:`boolean`,description:`Allow spaces for empty lines in list items`,default:!1},{key:`strict`,type:`boolean`,description:`Include unnecessary breaks`,default:!1}]},{id:`MD010`,alias:`no-hard-tabs`,aliases:[`no-hard-tabs`],name:`Hard tabs`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md010.md`,tags:[`whitespace`,`hard_tab`],options:[{key:`code_blocks`,type:`boolean`,description:`Include code blocks`,default:!0},{key:`ignore_code_languages`,type:`string-array`,description:`Fenced code languages to ignore`,default:[]},{key:`spaces_per_tab`,type:`integer`,description:`Number of spaces for each hard tab`,default:1,minimum:0}]},{id:`MD011`,alias:`no-reversed-links`,aliases:[`no-reversed-links`],name:`Reversed link syntax`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md011.md`,tags:[`links`],options:[]},{id:`MD012`,alias:`no-multiple-blanks`,aliases:[`no-multiple-blanks`],name:`Multiple consecutive blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md012.md`,tags:[`whitespace`,`blank_lines`],options:[{key:`maximum`,type:`integer`,description:`Consecutive blank lines`,default:1,minimum:1}]},{id:`MD013`,alias:`line-length`,aliases:[`line-length`],name:`Line length`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md013.md`,tags:[`line_length`],options:[{key:`line_length`,type:`integer`,description:`Number of characters`,default:80,minimum:1},{key:`heading_line_length`,type:`integer`,description:`Number of characters for headings`,default:80,minimum:1},{key:`code_block_line_length`,type:`integer`,description:`Number of characters for code blocks`,default:80,minimum:1},{key:`code_blocks`,type:`boolean`,description:`Include code blocks`,default:!0},{key:`tables`,type:`boolean`,description:`Include tables`,default:!0},{key:`headings`,type:`boolean`,description:`Include headings`,default:!0},{key:`strict`,type:`boolean`,description:`Strict length checking`,default:!1},{key:`stern`,type:`boolean`,description:`Stern length checking`,default:!1}]},{id:`MD014`,alias:`commands-show-output`,aliases:[`commands-show-output`],name:`Dollar signs used before commands without showing output`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md014.md`,tags:[`code`],options:[]},{id:`MD018`,alias:`no-missing-space-atx`,aliases:[`no-missing-space-atx`],name:`No space after hash on atx style heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md018.md`,tags:[`headings`,`atx`,`spaces`],options:[]},{id:`MD019`,alias:`no-multiple-space-atx`,aliases:[`no-multiple-space-atx`],name:`Multiple spaces after hash on atx style heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md019.md`,tags:[`headings`,`atx`,`spaces`],options:[]},{id:`MD020`,alias:`no-missing-space-closed-atx`,aliases:[`no-missing-space-closed-atx`],name:`No space inside hashes on closed atx style heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md020.md`,tags:[`headings`,`spaces`,`atx_closed`],options:[]},{id:`MD021`,alias:`no-multiple-space-closed-atx`,aliases:[`no-multiple-space-closed-atx`],name:`Multiple spaces inside hashes on closed atx style heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md021.md`,tags:[`headings`,`spaces`,`atx_closed`],options:[]},{id:`MD022`,alias:`blanks-around-headings`,aliases:[`blanks-around-headings`],name:`Headings should be surrounded by blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md022.md`,tags:[`headings`,`blank_lines`],options:[{key:`include_front_matter`,type:`boolean`,description:`Include front matter content`,default:!1},{key:`lines_above`,type:`unsupported`,description:`Blank lines above heading`,default:1},{key:`lines_below`,type:`unsupported`,description:`Blank lines below heading`,default:1}]},{id:`MD023`,alias:`heading-start-left`,aliases:[`heading-start-left`],name:`Headings must start at the beginning of the line`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md023.md`,tags:[`headings`,`spaces`],options:[]},{id:`MD024`,alias:`no-duplicate-heading`,aliases:[`no-duplicate-heading`],name:`Multiple headings with the same content`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md024.md`,tags:[`headings`],options:[{key:`siblings_only`,type:`boolean`,description:`Only check sibling headings`,default:!1}]},{id:`MD025`,alias:`single-title`,aliases:[`single-title`,`single-h1`],name:`Multiple top-level headings in the same document`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md025.md`,tags:[`headings`],options:[{key:`front_matter_title`,type:`string`,description:`RegExp for matching title in front matter`,default:`^\\s*title\\s*[:=]`},{key:`level`,type:`integer`,description:`Heading level`,default:1,minimum:1,maximum:6}]},{id:`MD026`,alias:`no-trailing-punctuation`,aliases:[`no-trailing-punctuation`],name:`Trailing punctuation in heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md026.md`,tags:[`headings`],options:[{key:`punctuation`,type:`string`,description:`Punctuation characters`,default:`.,;:!。,;:!`}]},{id:`MD027`,alias:`no-multiple-space-blockquote`,aliases:[`no-multiple-space-blockquote`],name:`Multiple spaces after blockquote symbol`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md027.md`,tags:[`indentation`,`whitespace`,`blockquote`],options:[{key:`list_items`,type:`boolean`,description:`Include list items`,default:!0}]},{id:`MD028`,alias:`no-blanks-blockquote`,aliases:[`no-blanks-blockquote`],name:`Blank line inside blockquote`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md028.md`,tags:[`whitespace`,`blockquote`],options:[]},{id:`MD029`,alias:`ol-prefix`,aliases:[`ol-prefix`],name:`Ordered list item prefix`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md029.md`,tags:[`ol`],options:[{key:`style`,type:`enum`,description:`List style`,enum:[`one`,`ordered`,`one_or_ordered`,`zero`],default:`one_or_ordered`}]},{id:`MD030`,alias:`list-marker-space`,aliases:[`list-marker-space`],name:`Spaces after list markers`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md030.md`,tags:[`ul`,`whitespace`,`ol`],options:[{key:`ul_single`,type:`integer`,description:`Spaces for single-line unordered list items`,default:1,minimum:1},{key:`ol_single`,type:`integer`,description:`Spaces for single-line ordered list items`,default:1,minimum:1},{key:`ul_multi`,type:`integer`,description:`Spaces for multi-line unordered list items`,default:1,minimum:1},{key:`ol_multi`,type:`integer`,description:`Spaces for multi-line ordered list items`,default:1,minimum:1}]},{id:`MD031`,alias:`blanks-around-fences`,aliases:[`blanks-around-fences`],name:`Fenced code blocks should be surrounded by blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md031.md`,tags:[`blank_lines`,`code`],options:[{key:`list_items`,type:`boolean`,description:`Include list items`,default:!0}]},{id:`MD032`,alias:`blanks-around-lists`,aliases:[`blanks-around-lists`],name:`Lists should be surrounded by blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md032.md`,tags:[`bullet`,`ul`,`blank_lines`,`ol`],options:[]},{id:`MD033`,alias:`no-inline-html`,aliases:[`no-inline-html`],name:`Inline HTML`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md033.md`,tags:[`html`],options:[{key:`allowed_elements`,type:`string-array`,description:`Allowed elements`,default:[]},{key:`table_allowed_elements`,type:`string-array`,description:`Allowed elements in tables`,default:[]}]},{id:`MD034`,alias:`no-bare-urls`,aliases:[`no-bare-urls`],name:`Bare URL used`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md034.md`,tags:[`links`,`url`],options:[]},{id:`MD035`,alias:`hr-style`,aliases:[`hr-style`],name:`Horizontal rule style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md035.md`,tags:[`hr`],options:[{key:`style`,type:`string`,description:`Horizontal rule style`,default:`consistent`}]},{id:`MD036`,alias:`no-emphasis-as-heading`,aliases:[`no-emphasis-as-heading`],name:`Emphasis used instead of a heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md036.md`,tags:[`headings`,`emphasis`],options:[{key:`punctuation`,type:`string`,description:`Punctuation characters`,default:`.,;:!?。,;:!?`}]},{id:`MD037`,alias:`no-space-in-emphasis`,aliases:[`no-space-in-emphasis`],name:`Spaces inside emphasis markers`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md037.md`,tags:[`whitespace`,`emphasis`],options:[]},{id:`MD038`,alias:`no-space-in-code`,aliases:[`no-space-in-code`],name:`Spaces inside code span elements`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md038.md`,tags:[`whitespace`,`code`],options:[]},{id:`MD039`,alias:`no-space-in-links`,aliases:[`no-space-in-links`],name:`Spaces inside link text`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md039.md`,tags:[`whitespace`,`links`],options:[]},{id:`MD040`,alias:`fenced-code-language`,aliases:[`fenced-code-language`],name:`Fenced code blocks should have a language specified`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md040.md`,tags:[`code`,`language`],options:[{key:`allowed_languages`,type:`string-array`,description:`List of languages`,default:[]},{key:`language_only`,type:`boolean`,description:`Require language only`,default:!1}]},{id:`MD041`,alias:`first-line-heading`,aliases:[`first-line-heading`,`first-line-h1`],name:`First line in a file should be a top-level heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md041.md`,tags:[`headings`],options:[{key:`allow_preamble`,type:`boolean`,description:`Allow content before first heading`,default:!1},{key:`front_matter_title`,type:`string`,description:`RegExp for matching title in front matter`,default:`^\\s*title\\s*[:=]`},{key:`level`,type:`integer`,description:`Heading level`,default:1,minimum:1,maximum:6}]},{id:`MD042`,alias:`no-empty-links`,aliases:[`no-empty-links`],name:`No empty links`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md042.md`,tags:[`links`],options:[]},{id:`MD043`,alias:`required-headings`,aliases:[`required-headings`],name:`Required heading structure`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md043.md`,tags:[`headings`],options:[{key:`headings`,type:`string-array`,description:`List of headings`,default:[]},{key:`match_case`,type:`boolean`,description:`Match case of headings`,default:!1}]},{id:`MD044`,alias:`proper-names`,aliases:[`proper-names`],name:`Proper names should have the correct capitalization`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md044.md`,tags:[`spelling`],options:[{key:`names`,type:`string-array`,description:`List of proper names`,default:[]},{key:`code_blocks`,type:`boolean`,description:`Include code blocks`,default:!0},{key:`html_elements`,type:`boolean`,description:`Include HTML elements`,default:!0}]},{id:`MD045`,alias:`no-alt-text`,aliases:[`no-alt-text`],name:`Images should have alternate text (alt text)`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md045.md`,tags:[`accessibility`,`images`],options:[]},{id:`MD046`,alias:`code-block-style`,aliases:[`code-block-style`],name:`Code block style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md046.md`,tags:[`code`],options:[{key:`style`,type:`enum`,description:`Block style`,enum:[`consistent`,`fenced`,`indented`],default:`consistent`}]},{id:`MD047`,alias:`single-trailing-newline`,aliases:[`single-trailing-newline`],name:`Files should end with a single newline character`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md047.md`,tags:[`blank_lines`],options:[]},{id:`MD048`,alias:`code-fence-style`,aliases:[`code-fence-style`],name:`Code fence style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md048.md`,tags:[`code`],options:[{key:`style`,type:`enum`,description:`Code fence style`,enum:[`consistent`,`backtick`,`tilde`],default:`consistent`}]},{id:`MD049`,alias:`emphasis-style`,aliases:[`emphasis-style`],name:`Emphasis style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md049.md`,tags:[`emphasis`],options:[{key:`style`,type:`enum`,description:`Emphasis style`,enum:[`consistent`,`asterisk`,`underscore`],default:`consistent`}]},{id:`MD050`,alias:`strong-style`,aliases:[`strong-style`],name:`Strong style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md050.md`,tags:[`emphasis`],options:[{key:`style`,type:`enum`,description:`Strong style`,enum:[`consistent`,`asterisk`,`underscore`],default:`consistent`}]},{id:`MD051`,alias:`link-fragments`,aliases:[`link-fragments`],name:`Link fragments should be valid`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md051.md`,tags:[`links`],options:[{key:`ignore_case`,type:`boolean`,description:`Ignore case of fragments`,default:!1},{key:`ignored_pattern`,type:`string`,description:`Pattern for ignoring additional fragments`,default:``}]},{id:`MD052`,alias:`reference-links-images`,aliases:[`reference-links-images`],name:`Reference links and images should use a label that is defined`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md052.md`,tags:[`links`,`images`],options:[{key:`ignored_labels`,type:`string-array`,description:`Ignored link labels`,default:[`x`]},{key:`shortcut_syntax`,type:`boolean`,description:`Include shortcut syntax`,default:!1}]},{id:`MD053`,alias:`link-image-reference-definitions`,aliases:[`link-image-reference-definitions`],name:`Link and image reference definitions should be needed`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md053.md`,tags:[`links`,`images`],options:[{key:`ignored_definitions`,type:`string-array`,description:`Ignored definitions`,default:[`//`]}]},{id:`MD054`,alias:`link-image-style`,aliases:[`link-image-style`],name:`Link and image style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md054.md`,tags:[`links`,`images`],options:[{key:`autolink`,type:`boolean`,description:`Allow autolinks`,default:!0},{key:`inline`,type:`boolean`,description:`Allow inline links and images`,default:!0},{key:`full`,type:`boolean`,description:`Allow full reference links and images`,default:!0},{key:`collapsed`,type:`boolean`,description:`Allow collapsed reference links and images`,default:!0},{key:`shortcut`,type:`boolean`,description:`Allow shortcut reference links and images`,default:!0},{key:`url_inline`,type:`boolean`,description:`Allow URLs as inline links`,default:!0}]},{id:`MD055`,alias:`table-pipe-style`,aliases:[`table-pipe-style`],name:`Table pipe style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md055.md`,tags:[`table`],options:[{key:`style`,type:`enum`,description:`Table pipe style`,enum:[`consistent`,`leading_only`,`trailing_only`,`leading_and_trailing`,`no_leading_or_trailing`],default:`consistent`}]},{id:`MD056`,alias:`table-column-count`,aliases:[`table-column-count`],name:`Table column count`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md056.md`,tags:[`table`],options:[]},{id:`MD058`,alias:`blanks-around-tables`,aliases:[`blanks-around-tables`],name:`Tables should be surrounded by blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md058.md`,tags:[`table`],options:[]},{id:`MD059`,alias:`descriptive-link-text`,aliases:[`descriptive-link-text`],name:`Link text should be descriptive`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md059.md`,tags:[`links`,`accessibility`],options:[{key:`prohibited_texts`,type:`string-array`,description:`Prohibited link texts`,default:[`click here`,`here`,`link`,`more`]}]},{id:`MD060`,alias:`table-column-style`,aliases:[`table-column-style`],name:`Table column style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md060.md`,tags:[`table`],options:[{key:`style`,type:`enum`,description:`Table column style`,enum:[`any`,`aligned`,`compact`,`tight`],default:`any`},{key:`aligned_delimiter`,type:`boolean`,description:`Aligned delimiter columns`,default:!1}]}];(()=>{let e=new Map;for(let t of Ige){e.set(t.id.toUpperCase(),t.id);for(let n of t.aliases)e.set(n.toUpperCase(),t.id)}return e})();const Lge=new Set([`img`,`video`,`audio`,`mark`,`u`,`ins`]);new Map(NV.flatMap(e=>e.surface===`compat`&&Lge.has(e.rendersAs)?[[e.name,e]]:[])),xpe(`<>`),mO().use(wk).use(lO);const FJ=[{tagName:`Mirror`,attrName:`src`,resolution:`bare-doc-name`},{tagName:`Excalidraw`,attrName:`src`,resolution:`doc-relative`}];for(let e of FJ){let t=NV.find(t=>t.name===e.tagName);if(!t)throw Error(`JSX_SRC_REF_TAGS: no built-in component descriptor named '${e.tagName}' — the rename-rewrite and backlink passes for this entry would silently never match. Fix the tagName to match a descriptor in builtInComponents.`);if(!t.props.some(t=>t.name===e.attrName))throw Error(`JSX_SRC_REF_TAGS: component '${e.tagName}' declares no prop named '${e.attrName}' — the rename-rewrite and backlink passes for this entry would silently never match. Fix the attrName to match one of the descriptor's props.`)}KA(),uA(),dA();function Rge(){return NV.filter(e=>e.surface===`canonical`&&e.name!==`*`)}function zge(){return Rge().filter(e=>{let t=Bge(e);return t!==`fence`&&t!==`html`})}function Bge(e){return e.name===`MermaidFence`?`fence`:e.name===`HtmlAlignBlock`?`html`:e.hasChildren?`jsx-block`:`jsx-void`}B({intents:z(B({satisfierId:F().min(1),desired:U([`present`,`absent`])}).loose()),...tB,summary:nB}).loose();const Vge=B({satisfierId:F(),agentId:F(),piece:F(),scope:F(),kind:F(),pathId:F().optional(),desired:U([`present`,`absent`]),action:U(xa),errorId:F().optional()}).loose(),Hge=B({kind:F(),satisfierIds:z(F()),agentIds:z(F()),pathId:F().optional(),blockedReason:F().optional()}).loose(),Uge=B({state:F(),strictness:z(U(ya)).optional()}).loose(),Wge=B({probes:B({env:U([`desktop`,`local-web`,`remote-web`]),satisfiers:H(F(),Uge)}).loose(),detection:B({detected:z(F()),probed:L()}).loose()}).loose();B({actions:z(Vge),conflicts:z(Hge),withheld:z(F()),snapshot:Wge}).loose(),B({entries:z(B({level:U([`info`,`warn`,`error`]),message:F().max(8192),event:F().optional(),fields:H(F(),R()).optional(),ts:I().optional(),sourceId:F().optional(),lineNumber:I().optional()}).loose()).max(100),droppedSinceLastFlush:I().int().min(0).optional()}).loose(),B({accepted:I().int().min(0)}).loose();const Gge=B({exact:F().min(1),prefix:F(),suffix:F(),start:I().int().nonnegative(),end:I().int().nonnegative()}),Kge=z(V([F(),I().int().nonnegative()])),qge=Wi(`kind`,[B({kind:W(`body`)}),B({kind:W(`property`),key:F().min(1),path:Kge.default([])})]).default({kind:`body`}),Jge=U([`anchored`,`orphaned`,`resolved`]),IJ=B({threadId:F().min(1),docName:F().min(1),target:qge,anchor:Gge.nullable(),state:Jge,queued:L(),latestComment:F(),createdBy:F().min(1),createdAt:I(),updatedAt:I().optional()}),LJ=B({docName:F(),instruction:F(),property:F().nullable(),passage:B({exact:F(),prefix:F(),suffix:F()}).nullable(),anchorLost:L(),passageRepeats:L()}).loose(),RJ=B({threadId:F(),ok:W(!0)}),zJ=B({threadId:F(),ok:W(!1),error:W(`not-found`)});B({threads:z(IJ)}).loose(),B({meta:IJ,orphaned:L()}).loose(),B({threadId:F()}).loose(),B({meta:IJ,payload:LJ}).loose(),B({results:z(V([RJ.extend({meta:IJ,payload:LJ}),zJ]))}).loose(),B({results:z(V([RJ.extend({meta:IJ}),zJ]))}).loose();const Yge=B({status:F().min(1),reason:F()}).loose();B({docName:F().min(1),content:F(),lifecycle:Yge.nullable()}).loose(),B({documents:z(B({kind:U([`document`,`asset`,`folder`,`file`]).default(`document`),docName:F().min(1).optional(),docExt:F().min(1).default(`.md`),size:I().int().nonnegative(),modified:F().min(1),isSymlink:L().default(!1),canonicalDocName:F().nullable().default(null),targetPath:F().nullable().default(null),path:F().min(1).optional(),assetExt:F().min(1).optional(),mediaKind:U([`image`,`video`,`audio`,`pdf`,`text`,`mermaid`,`excalidraw`]).nullable().optional(),referencedBy:z(F().min(1)).optional(),hasChildren:L().optional()}).loose().refine(e=>e.kind===`document`?e.docName!==void 0&&e.path===void 0&&e.assetExt===void 0&&e.mediaKind===void 0&&e.referencedBy===void 0&&e.hasChildren===void 0:e.kind===`folder`?e.docName===void 0&&e.path!==void 0&&e.assetExt===void 0&&e.mediaKind===void 0&&e.referencedBy===void 0:e.kind===`file`?e.path!==void 0&&e.mediaKind===void 0&&e.referencedBy===void 0&&e.hasChildren===void 0:e.path!==void 0&&e.assetExt!==void 0&&e.referencedBy!==void 0&&e.hasChildren===void 0,{message:`document/asset/folder/file kind must match its required fields (document → docName; asset → path+assetExt+referencedBy; folder → path only, no docName; file → path, no mediaKind/referencedBy/hasChildren)`})),truncated:L().optional()}).loose();const Xge=B({source:F().min(1),anchor:F().nullable(),title:F(),snippet:F().nullable()}).loose();B({docName:F().min(1),backlinks:z(Xge)}).loose(),B({counts:H(F().min(1),I().int().nonnegative())}).loose(),B({counts:H(F().min(1),I().int().nonnegative())}).loose();const Zge=Wi(`kind`,[B({kind:W(`doc`),docName:F().min(1),anchor:F().nullable(),title:F(),snippet:F().nullable()}).loose(),B({kind:W(`external`),url:F().min(1),title:F(),snippet:F().nullable()}).loose()]),Qge=B({role:F().min(1),sourceForm:F().min(1),targetKind:F().min(1),href:F(),resolvedTarget:F().nullable(),status:F().min(1),reason:F().nullable(),resolutionMethod:F().min(1),fallbackTarget:F().nullable().default(null),range:B({start:I().int().nonnegative(),end:I().int().nonnegative()}),line:I().int().nonnegative(),column:I().int().nonnegative(),definition:B({label:F(),line:I().int().nonnegative()}).nullable().default(null)}).loose();B({docName:F().min(1),forwardLinks:z(Zge),localTargets:z(Qge).optional()}).loose();const $ge=Wi(`kind`,[B({id:F().min(1),kind:W(`doc`),docName:F().min(1),anchor:F().nullable(),label:F(),cluster:F().nullable(),category:F().nullable(),tags:z(F()).nullable(),managed:L().optional()}).loose(),B({id:F().min(1),kind:W(`external`),url:F().min(1),label:F()}).loose()]),e_e=B({source:F().min(1),target:F().min(1)}).loose();B({nodes:z($ge),links:z(e_e)}).loose();const t_e=B({ts:I().int().min(0),url:F(),method:F(),ua:F().optional(),origin:F().optional(),referer:F().optional(),host:F().optional(),remote:F().optional(),secChUa:F().optional(),secChUaMobile:F().optional(),secChUaPlatform:F().optional(),secFetchSite:F().optional(),secFetchDest:F().optional(),secFetchMode:F().optional(),secFetchUser:F().optional()}).loose(),n_e=B({app:V([W(`cursor`),W(`codex`),W(`claude`),Pi()]),signals_fired:z(F())}).loose();B({entries:z(t_e),count:I().int().min(0),detection:n_e}).loose();const BJ=B({path:F().min(1),code:U([`M`,`A`,`D`,`R`,`C`,`U`,`T`,`?`,`!`,` `]),origPath:F().min(1).optional(),syncScoped:L(),open:Wi(`kind`,[B({kind:W(`doc`),docName:F().min(1)}),B({kind:W(`asset`),path:F().min(1)})]).optional()}).loose();B({branch:F().nullable(),detached:L(),upstream:F().nullable(),staged:z(BJ),notStaged:z(BJ),untracked:z(BJ),incoming:z(BJ),truncated:L(),readable:L().default(!0)}).loose();const r_e=U([`AWAITING_CHECKS`,`LOCKED`,`MERGEABLE`,`QUEUED`,`UNMERGEABLE`]),i_e=U([`BEHIND`,`BLOCKED`,`CLEAN`,`DIRTY`,`DRAFT`,`HAS_HOOKS`,`UNKNOWN`,`UNSTABLE`]),a_e=U([`APPROVED`,`CHANGES_REQUESTED`,`REVIEW_REQUIRED`]),o_e=U([`ERROR`,`EXPECTED`,`FAILURE`,`PENDING`,`SUCCESS`]),s_e=B({mergeQueue:B({position:I().int().nonnegative(),state:r_e.nullable().catch(null)}).nullable().catch(null),autoMerge:L(),mergeState:i_e.nullable().catch(null),reviewDecision:a_e.nullable().catch(null),checks:o_e.nullable().catch(null)}).loose(),c_e=B({kind:U([`pull`,`issue`]),repo:F().min(1),number:I().int().positive(),title:F(),author:F().nullable(),createdAt:F(),lifecycle:U([`open`,`draft`,`merged`,`closed`,`completed`,`not-planned`]),additions:I().int().nonnegative().optional(),deletions:I().int().nonnegative().optional(),status:s_e.optional()}).loose();B({url:F()}).loose(),Wi(`ok`,[B({ok:W(!0),preview:c_e}).loose(),B({ok:W(!1),reason:F()}).loose()]),B({writers:z(B({id:F().min(1),name:F().optional(),email:F().optional()}).loose()).optional(),summary:nB,...tB}).loose(),B({checkpointRef:F().min(1)}).loose();const l_e=B({v:I().int().optional(),id:F().min(1),name:F().min(1),colorSeed:F().optional(),docs:z(F()),summaries:z(F()).optional()}).loose();B({entries:z(B({sha:F().min(1),timestamp:F().min(1),author:F(),authorEmail:F(),type:U([`checkpoint`,`wip`,`upstream`,`park`]),message:F(),contributors:z(l_e),checkpoint:R().nullable(),parentSha:F().nullable().optional()}).loose()),total:I().int().nonnegative().optional(),truncated:L().optional(),hasMore:L().optional()}).loose(),B({sha:F().regex(/^[0-9a-f]{40}$/i),content:F(),timestamp:F(),author:F()}).loose(),B({contentDir:F().min(1),pathSeparator:U([`/`,`\\`]),symlinkResolved:L()}).loose(),z(Wi(`source`,[B({docName:F().min(1),timestamp:F().min(1),size:I().int().nonnegative(),source:W(`flat`)}).loose(),B({docName:F().min(1),timestamp:F().min(1),source:W(`timeline`),sha:F().min(1)}).loose()])).meta({description:"Flat array of rescue buffer entries; discriminated via `source`."});const u_e=B({domain:F().min(1),title:F().optional(),description:F().optional(),siteName:F().optional(),faviconDataUri:F().optional()}).loose();B({url:F()}).loose(),Wi(`ok`,[B({ok:W(!0),metadata:u_e}).loose(),B({ok:W(!1),reason:F()}).loose()]),B({orphans:z(B({docName:F().min(1),title:F()}).loose())}).loose(),B({hubs:z(B({docName:F().min(1),title:F(),count:I().int().nonnegative()}).loose())}).loose();const d_e=B({source:F().min(1),title:F(),snippet:F().nullable()}).loose();B({deadLinks:z(B({target:F().min(1),sources:z(d_e)}).loose())}).loose(),B({target:B({docName:F().min(1),title:F(),aliases:z(F())}).loose(),mentions:z(B({source:F().min(1),excerpt:F(),offset:I().int().nonnegative()}).loose()),truncated:L()}).loose(),B({projectPath:F().min(1)}).loose();const f_e=U([`not-a-git-worktree`,`init-failed`]);Wi(`ok`,[B({ok:W(!0),projectPath:F().min(1)}).loose(),B({ok:W(!1),reason:f_e,message:F().min(1)}).loose()]),B({host:F().min(1).optional()}).loose(),B({host:F().min(1).optional(),token:F().min(1)}).loose(),B({host:F(),login:F()}).loose(),B({key:F().min(1)}).loose(),B({keyPresent:L()}).loose();const p_e=U([`no_key`,`invalid_endpoint`,`rate_limit`,`timeout`,`http_error`,`network`,`dims_mismatch`,`malformed_response`]);Wi(`ok`,[B({ok:W(!0),endpoint:F().min(1),model:F().min(1),dimensions:I().int().positive()}).loose(),B({ok:W(!1),endpoint:F().min(1),model:F().min(1),reason:p_e,status:I().int().optional()}).loose()]),B({name:F().refine(e=>e.trim().length>0,{message:`name must be non-empty`}),email:F().refine(e=>e.trim().length>0,{message:`email must be non-empty`})}).loose(),B({authenticated:L()}).loose(),B({channel:U([`login`,`gh-login`]).default(`login`)}).loose(),B({}).loose();const m_e=B({stackIndex:I().int().min(0),ts:I().int().min(0),additions:I().int().min(0),deletions:I().int().min(0)}).loose(),h_e=B({docName:F().min(1),additionsTotal:I().int().min(0),deletionsTotal:I().int().min(0),lastTs:I().int().min(0),bursts:z(m_e)}).loose(),g_e=B({displayName:F().min(1),color:F().min(1),icon:F().optional(),connectionId:F().min(1)}).loose();B({sessionAlive:L(),agent:g_e.nullable(),files:z(h_e)}).loose(),B({diff:F(),before:F(),after:F(),properties:qz,generatedAt:I().int().min(0)}).loose(),B({}).loose(),B({}).loose(),B({}).loose(),B({}).loose(),B({}).loose(),B({}).loose();const __e=B({displayName:F().min(1),icon:F(),color:F().min(1),currentDoc:F().nullable(),mode:U([`idle`,`writing`]),ts:I().int().min(0)}).loose();B({presence:H(F().min(1),__e)}).loose();const v_e=B({sessionId:F().min(1),agentType:F().min(1),ts:I().int().min(0),insertedChars:I().int().min(0),deletedChars:I().int().min(0)}).loose();B({effects:z(B({"doc.name":F().min(1),entries:z(v_e)}).loose())}).loose(),B({decisions:z(B({ts:I().int().min(0),decision:F().min(1),kind:F().min(1),"doc.name":F().min(1),pathRole:F().min(1)}).loose())}).loose(),H(F().min(1),L()).meta({description:`Flat boolean record keyed by agent-scheme name (claude / codex / cursor). True = installed.`}),B({path:F().min(1,`path must be non-empty`)}).loose(),B({}).loose();const y_e=B({fromDocName:F().min(1),toDocName:F().min(1)}).loose(),b_e=B({fromPath:F().min(1),toPath:F().min(1)}).loose();B({}).loose(),B({path:F().min(1),...tB,summary:nB}).loose(),B({docName:F().min(1)}).loose(),B({path:F().min(1),...tB,summary:nB}).loose(),B({path:F().min(1)}).loose(),B({kind:U([`file`,`folder`]),path:F().min(1),...tB,summary:nB}).loose(),B({kind:U([`file`,`folder`]),path:F().min(1),duplicatedDocNames:z(F().min(1))}).loose(),B({pages:z(B({docName:F().min(1),title:F(),docExt:F().min(1),size:I().int().nonnegative(),modified:F().min(1),icon:F().min(1).max(2048).optional()}).loose())}).loose();const x_e=B({level:I().int().min(1).max(6),text:F(),slug:F()}).loose();B({docName:F().min(1),headings:z(x_e)}).loose();const S_e=B({docName:F().min(1),rewrites:I().int().nonnegative()}).loose();B({kind:U([`file`,`folder`,`asset`]),fromPath:F().min(1),toPath:F().min(1),...tB,summary:nB}).loose(),B({renamed:z(y_e),renamedAssets:z(b_e),rewrittenDocs:z(S_e).optional(),summary:bJ.optional()}).loose(),B({kind:U([`file`,`folder`,`asset`]),path:F().min(1),...tB}).loose(),B({deletedDocNames:z(F().min(1))}).loose(),B({kind:U([`file`,`folder`,`asset`]),path:F().min(1),...tB,summary:nB}).loose(),B({deletedDocNames:z(F().min(1))}).loose(),B({docName:F().min(1),commitSha:F().regex(/^[0-9a-f]{40}$/i,{message:`commitSha must be a 40-char git SHA`}),summary:nB,...tB}).loose(),B({restoredFrom:F().min(1),timestamp:F().min(1),summary:bJ.optional(),warnings:TJ.optional()}).loose();const C_e=/^#[0-9a-fA-F]{6}$/,w_e=B(Object.fromEntries(vl.map(e=>[e,F().regex(C_e,`must be a #rrggbb hex color`)]))),VJ=F().min(1).refine(Cl,{message:`must contain a non-whitespace character`}),HJ=B({name:VJ,author:VJ.optional(),variant:U([`dark`,`light`]),palette:w_e}).loose();B({name:F().min(1),scheme:HJ,stem:F().min(1).optional(),extension:U([`.yaml`,`.yml`]).optional()}).loose(),B({id:F().min(1),filename:F().min(1)}).loose(),B({id:F().min(1),scheme:HJ}).loose(),B({id:F().min(1),filename:F().min(1)}).loose(),Wi(`existed`,[B({existed:W(!1)}).loose(),B({existed:W(!0),filename:F().min(1),scheme:HJ}).loose()]),B({themes:z(Wi(`ok`,[B({ok:W(!0),id:F().min(1),filename:F().min(1),scheme:HJ}),B({ok:W(!1),filename:F().min(1),id:F().min(1).optional(),code:F().min(1),conflictingFilenames:z(F().min(1)).min(2).optional()})])),truncated:L()}).loose();const UJ=U(pt),T_e=U(mt),E_e=B({alwaysOn:I().int().nonnegative(),onTrigger:I().int().nonnegative(),onDemand:I().int().nonnegative()}).strict();B({tags:z(B({name:F().min(1),count:I().int().nonnegative(),isLeaf:L()}).loose())}).loose();const D_e=B({docName:F().min(1),title:F(),matchingTags:z(F().min(1)),snippet:F().nullable()}).loose();B({name:F().min(1),docs:z(D_e)}).loose(),B({folder:R(),frontmatter_local:H(F(),R()).nullable(),warnings:z(F()).optional().meta({description:"Non-fatal degradations of this response, one per entry; the field each affects is absent, null, or incomplete — the aligned `warningCodes` entry names which field and how."}),warningCodes:z(U([`symlink-refused`,`malformed-yaml`,`unverifiable`,`templates-symlink-refused`,`templates-unverifiable`])).optional().meta({description:"Machine-readable codes aligned 1:1 with `warnings`; switch on these, never on the English. `symlink-refused` / `malformed-yaml` / `unverifiable`: this folder's own `.ok/frontmatter.yml` (a symlink, malformed YAML, or an lstat failure) — `frontmatter_local` is null. `templates-symlink-refused` / `templates-unverifiable`: the `.ok/templates` directory on this folder, or a `.ok` or `.ok/templates` directory on an ancestor it inherits from — a symlink (wherever it points, dangling included), or a non-ENOTDIR `lstat` failure — `folder.templates_available` omits that directory's templates and may still list others. A non-directory `.ok` / `.ok/templates` (ENOTDIR) is treated as empty and yields no `templates-*` code. This folder's own symlinked `.ok` is a 400, never a warning."})}).loose(),B({path:F(),frontmatter:H(F(),R()).optional()}).loose(),B({applied:R()}).loose();const WJ=H(F(),R()).meta({description:`Free-form frontmatter map embedded in template payloads.`});B({template:B({name:F().min(1),folder:F(),scope:U([`local`,`inherited`]),path:F().min(1),frontmatter:WJ,body:F()}).strict()}).strict(),B({templates:z(B({name:F().min(1),title:F().optional(),description:F().optional(),path:F().min(1),source_folder:F()}).strict()),truncated:L()}).strict(),B({folder:F(),name:F(),body:F().optional(),frontmatter:WJ.optional(),...tB,summary:nB}).strict(),B({path:F().min(1),created:L(),warnings:z(F())}).strict(),B({sourcePath:F().min(1),targetFolder:F(),name:F().optional(),title:F().optional(),deleteSource:L().optional(),...tB,summary:nB}).strict(),B({path:F().min(1),created:L(),warnings:z(F())}).strict(),B({existed:L(),path:F().min(1)}).strict(),B({fromFolder:F(),fromName:F(),toFolder:F(),toName:F(),body:F().optional(),frontmatter:WJ.optional(),...tB,summary:nB}).strict(),B({from:F().min(1),to:F().min(1),committed:L()}).strict();const GJ=U(us),O_e=/^[a-z0-9-]+$/,KJ=B({name:F(),description:F(),metadata:B({pack:F()}).strict().optional()}).strict();B({skill:B({name:F().min(1),scope:GJ,path:F().min(1),frontmatter:KJ,body:F(),files:z(B({path:F().min(1),text:F().nullable()})).optional(),managed:L().optional()}).strict()}).strict();const k_e=B({source:F().min(1),publisher:F().optional(),skill:F().optional(),marketplaceUrl:F().optional(),importedAt:F().min(1),autoUpdate:L().optional()}).strict(),A_e=B({name:F().min(1),description:F().optional(),scope:GJ,path:F().min(1),canonicalPath:F().min(1).optional(),filePaths:z(F()).optional(),absolutePath:F().min(1).optional(),installed:L(),hosts:z(F()),hostQualifier:F().optional().meta({description:"Set on a GLOBAL entry that shares its name with a distinct-content bundle in another host dir AND is not the by-name default: the host id whose root holds THIS bundle. Doc-name builders append it (`__skill__/global/<name>@<host>`) so each same-named bundle keeps its own tab and its own write-back path; the default bundle keeps the stable unqualified name."}),driftPaths:z(F()).optional().meta({description:`Recorded locations whose on-disk form (copy vs symlink) no longer matches what OK last wrote there — evidence another tool rewrote the path.`}),hostAliases:H(F(),F()).optional().meta({description:`Host skills roots that are symlink ALIASES of another location (host id → base-relative target root). An aliased folder is a derived view — no menu row, never a write target; the host's icon rides the target root's row.`}),conflictHosts:z(F()).optional().meta({description:`Hosts whose dir holds a DIFFERENT same-name skill (fork/conflict) — occupied, not this skill.`}),symlinkedHosts:z(F()).optional(),installableEditors:z(F()).optional(),hubOffered:L().optional().meta({description:"Whether the vendor-neutral `.agents/skills` hub is a live destination at this scope on THIS machine — server-computed via the same predicate that filters the Folders surface, so the install menu and Settings cannot disagree. True when the project already uses the hub OR a host that reads it is installed (`HUB_READER_EDITORS`)."}),linkMode:L().optional(),customPlacements:z(B({path:F(),mode:U([`copy`,`link`])}).strict()).optional(),plugin:B({name:F().min(1),marketplace:F().min(1),provider:F().min(1),url:F().optional()}).strict().optional(),managed:L().optional(),origin:k_e.optional(),pack:F().optional(),modified:L().optional(),revertable:L().optional(),ignored:L().optional(),size:E_e.optional()}).strict();B({name:F().min(1),scope:GJ,apply:L().optional()}).strict(),B({line:F().min(1),gitignorePath:F().min(1),applied:L(),alreadyTracked:L().optional()}).strict(),B({skills:z(A_e),truncated:L()}).strict(),B({scope:GJ.default(`project`),name:F().meta({description:`Managed skill name to create or update.`}),body:F().optional(),frontmatter:KJ,...tB,summary:nB}).strict();const qJ=[`skill-name-vendor-word`,`skill-body-too-long`],JJ=z(U(qJ)).meta({description:"Machine-readable codes aligned 1:1 with `warnings` (`warnings[i]` is the display text for `warningCodes[i]`)."});B({path:F().min(1),created:L(),warnings:z(F()),warningCodes:JJ}).strict(),B({scope:GJ.default(`project`),name:F(),dryRun:L().optional(),setAutoUpdate:L().optional(),...tB,summary:nB}).strict(),B({name:F().min(1),updated:L(),source:F().min(1),localBody:F().optional(),upstreamBody:F().optional(),gitTracked:L().optional(),warnings:z(F()),warningCodes:JJ}).strict(),B({scope:GJ.default(`project`),name:F(),...tB,summary:nB}).strict(),B({name:F().min(1),baselineRef:F().min(1),restoredFiles:z(F()),warnings:z(F())}).strict();const YJ=`This member also carries the one bookkeeping failure that does not undo the operation: the content change landed, but a state file this server keeps beside it refused to be rewritten because it could not be read, so the install or import records still describe the old state until an operator repairs that file. Absent when there is nothing to report; a server that predates this member omits it, so treat its absence as no warning rather than as an error.`;B({existed:L(),path:F().min(1),warnings:z(F()).optional().meta({description:`Present when this delete removed a directory a retention record ties to a recovery copy an earlier failed move kept, whose source was never verified unchanged — either because this server verified the deleted directory against the copy that record describes, or because it could not read the directory and so could not confirm either way. Each entry says which of the two it is; neither claims more than the check established. ${YJ}`})}).strict(),B({scope:GJ.default(`project`),fromName:F(),toName:F(),body:F().optional(),frontmatter:KJ.optional(),...tB,summary:nB}).strict(),B({from:F().min(1),to:F().min(1),committed:L(),warnings:z(F()).optional().meta({description:`Present when the rename itself completed but something beside it did not. ${YJ}`})}).strict(),B({name:F(),toName:F().optional().meta({description:"Name for the skill at the destination scope; defaults to `name`. The SKILL.md `name` frontmatter is rewritten to match."}),fromScope:GJ,toScope:GJ,...tB,summary:nB}).strict(),B({scope:GJ,path:F().optional(),droppedLocations:z(F()).default([]).meta({description:"Locations the skill occupied at the source that were removed and not re-created at the destination: the `agents` hub and custom roots, which projection does not cover. Entries are install location ids, so they can be passed straight back as an install `add` list with `scope` set to the destination scope; custom roots resolve against that scope's base."}),warnings:z(F()).optional().meta({description:`Present when the move itself completed but something beside it did not. ${YJ}`})}).strict().meta({description:"Scope-move result. Rename paths deliberately do not emit authoring warnings, consistent with same-scope rename and duplicate. Content-authoring and import responses carry those warnings and their codes. The Skills Studio client parses `droppedLocations` off the wire but deliberately does not render it yet; how a human is told what was removed is an open product decision."}),B({scope:GJ,name:F(),toName:F(),...tB,summary:nB}).strict(),B({name:F().min(1)}).strict(),B({name:F(),home:F().min(1)}).strict(),B({docName:F().min(1)}).strict();const XJ=U([`reference`,`script`,`file`]);B({scope:GJ.default(`project`),name:F(),path:F().min(1),content:F(),...tB,summary:nB}).strict(),B({path:F().min(1),created:L(),kind:XJ,content:L()}).strict(),B({scope:GJ.default(`project`),name:F(),from:F().min(1),to:F().min(1),...tB,summary:nB}).strict(),B({from:F().min(1),to:F().min(1),fromDocName:F().optional(),toDocName:F().optional()}).strict(),B({path:F().min(1),kind:XJ,text:F()}).strict(),B({path:F().min(1),existed:L(),kind:XJ}).strict();const ZJ=V([T_e,W(`agents`)]),QJ=F().min(1).refine(e=>!e.startsWith(`/`)&&!e.startsWith(`~`)&&!/^[A-Za-z]:/.test(e),{error:`a custom root is base-relative (e.g. ".tim/skills"), not absolute or ~-prefixed`}).refine(e=>e.split(`/`).every(e=>e!==``&&e!==`.`&&e!==`..`),{error:`a custom root may not contain "..", "." or empty path segments`}).refine(e=>e.includes(`/`),{error:`a custom root is a path (e.g. ".tim/skills") — bare editor names are host ids`}),$J=V([ZJ,QJ]);B({scope:GJ.default(`project`),name:F(),targets:z(ZJ).optional().meta({description:'SET-EXACT install targets (editor ids, plus "agents" for the .agents hub — in-place skills only): the COMPLETE resulting host set. Omit to use project-configured editors; pass [] to uninstall everywhere. Stateless callers should prefer `add`/`remove`.'}),add:z($J).optional().meta({description:`Locations to ADD the skill to (everything else untouched). Editor ids fan out a managed copy/symlink; a custom root path (".tim/skills") places the bundle there.`}),remove:z($J).optional().meta({description:"Locations to REMOVE the skill from (lossless only — a hand-edited fork is refused, never deleted). The source cannot be removed; move it first with `source`."}),mode:U([`copy`,`link`]).optional().meta({description:`"link": one real folder (the source); every other location becomes a symlink to it. "copy": independent real folders, refreshed from the source until hand-edited (a hand-edit forks that copy). Converts existing locations losslessly. Omit to follow the form the skill already uses.`}),source:$J.optional().meta({description:`Move the skill's REAL folder to this location (the old source becomes a symlink to it — never a removal). Sticky across rescans.`}),linkMode:L().optional(),setSource:F().min(1).optional(),place:B({dir:F().min(1).meta({description:`Project-relative directory the bundle dir is created under (e.g. ".windsurf/skills").`}),mode:U([`copy`,`link`])}).strict().optional(),convert:B({target:$J.meta({description:`The installed location to convert — an editor id, "agents", or a recorded custom placement path.`}),mode:U([`copy`,`link`]).meta({description:`"link": replace this location with a symlink to the source. "copy": replace it with an independent real folder.`})}).strict().optional(),unplace:B({path:F().min(1).meta({description:`The recorded placement bundle path (e.g. ".windsurf/skills/my-skill").`})}).strict().optional(),...tB,summary:nB,fork:B({editor:F().min(1),action:U([`align`,`make-source`,`rename`]),toName:F().optional()}).strict().optional()}).strict().refine(e=>e.targets===void 0||e.add===void 0&&e.remove===void 0,{error:"`targets` is set-exact; `add`/`remove` are additive — use one style per call"}).refine(e=>e.fork===void 0||e.targets===void 0&&e.add===void 0&&e.remove===void 0&&e.source===void 0&&e.setSource===void 0,{error:"`fork` is its own operation — run it in a separate call"}).refine(e=>e.fork?.action!==`rename`||e.fork.toName!==void 0,{error:"`fork.rename` requires `toName`"}).refine(e=>e.source===void 0||e.add===void 0&&e.remove===void 0,{error:"a `source` move is its own operation — run it in a separate call from `add`/`remove`"}).refine(e=>[e.targets!==void 0||e.add!==void 0||e.remove!==void 0,e.place!==void 0,e.unplace!==void 0,e.convert!==void 0,e.source!==void 0||e.setSource!==void 0,e.fork!==void 0].filter(Boolean).length<=1,{error:"one operation per call — membership (`targets`/`add`/`remove`), `place`, `unplace`, `convert`, `source`, and `fork` are mutually exclusive"});const eY=[`no-targets`,`scripts-present`,`name-conflict`,`no-description`,`skill-fork-name-unpatched`,`place-path-invalid`,`place-fork-refused`];B({name:F().min(1).meta({description:`Managed skill name installed or uninstalled.`}),hosts:z(F()).meta({description:`Editor ids the skill is projected into after the operation; [] is expected after uninstall.`}),scripts:L().meta({description:`True when the skill ships executable scripts, projected but never run.`}),warnings:z(F()).meta({description:`Non-fatal install/uninstall warnings from target projection.`}),warningCodes:z(U(eY)).meta({description:"Machine-readable warning codes aligned with `warnings`."}),placedAt:F().optional(),sourceMovedTo:F().optional()}).strict(),B({scope:GJ.default(`project`),name:F().meta({description:`Managed skill name to uninstall without deleting source.`})}).strict(),B({name:F().min(1).meta({description:`Managed skill name requested for uninstall.`}),uninstalled:L().meta({description:`True when an install marker existed and was removed; false for an idempotent no-op.`})}).strict(),B({targets:z(UJ),configured:L(),folders:z(B({scope:GJ,host:F(),root:F(),state:U([`own`,`linked`,`linked-parent`,`absent`]),target:F().optional(),drift:W(!0).optional(),expected:F().optional()}).strict()).optional()}).strict();const tY=B({action:W(`link`),scope:GJ,root:F().min(1).meta({description:`The folder to link (e.g. ".codex/skills").`}),target:F().min(1).meta({description:`The root it merges into (e.g. ".agents/skills"). Required.`})}),nY=B({action:W(`unlink`),scope:GJ,root:F().min(1).meta({description:`The linked folder to materialize back.`}),exclude:z(F().min(1)).optional().meta({description:`Skill names to LEAVE OUT when materializing — the folder keeps every other skill it currently sees (as per-skill links) and stops auto-following the target root.`})}).strict(),rY=B({action:W(`add-root`),scope:GJ,root:QJ.meta({description:`New custom skills root to declare (base-relative, e.g. ".team/skills").`})}).strict(),j_e=Wi(`action`,[tY.extend({preview:L().optional().meta({description:`Return the merge plan only (moves, drops, removes, conflicts, strays) — nothing is written.`})}).strict(),nY,rY]);Wi(`action`,[tY.strict(),nY,rY]),B({folderAction:j_e}).strict();const M_e=B({moves:z(F()),drops:z(F()),removes:z(F()),replaces:z(F()),conflicts:z(F()),strays:z(F())}).strict();B({targets:z(UJ),reprojected:z(B({name:F(),hosts:z(F())}).strict()),bundleHosts:z(F()),removedFrom:z(F()),folder:B({moved:z(F()),dropped:z(F()),linked:z(F())}).strict().optional(),preview:M_e.optional()}).strict(),B({scope:GJ.default(`project`),name:F(),version:F().regex(/^[0-9a-f]{40}$/i),...tB,summary:nB}).strict(),B({name:F().min(1),version:F(),restoredFiles:z(F()),warnings:z(F())}).strict(),B({query:F().optional(),intent:U([`autocomplete`,`full_text`,`omnibar`]).optional(),ranking:U([`navigation`,`relevance`]).optional(),scopes:z(U([`page`,`folder`,`content`,`file`])).optional(),scope:F().optional(),limit:I().int().nonnegative().optional(),semantic:L().optional(),source:U([`omnibar`,`mcp`,`http`]).optional()}).loose();const N_e=B({kind:U([`page`,`folder`,`content`,`file`]),path:F().min(1),title:F(),score:I(),signals:H(F(),R()),snippet:F().optional()}).loose(),P_e=U([`applied`,`no_match`,`warming`,`incapable`,`provider_error`,`restart_required`,`query_too_short`]),iY=U([`warm`,`corpus`,`query`,`dimensions`,`configured_dimensions`]),aY=B({capable:L(),applied:L(),outcome:P_e,providerErrorReason:iY.nullable().optional().catch(null),coverage:B({embedded:I().int().nonnegative(),total:I().int().nonnegative()})}).loose();B({enabled:L(),keyPresent:L(),keyNotRequired:L(),keySource:U([`project`,`file`,`env`]).nullable(),keyHint:F().nullable(),ready:L(),capable:L(),providerError:L().optional(),providerErrorReason:iY.nullable().optional().catch(null),embedded:I().int().nonnegative(),total:I().int().nonnegative()}).loose(),B({query:F(),intent:U([`autocomplete`,`full_text`,`omnibar`]),results:z(N_e),elapsedMs:I().nonnegative(),semantic:aY.optional(),truncated:L().optional(),ready:L().optional()}).loose();const F_e=B({version:F().min(1),recordedAt:F().min(1)}).loose();B({currentVersion:F().min(1),targets:H(F(),F_e.nullable())}).loose(),B({scope:GJ.default(`project`),source:F().min(1).meta({description:`External skill source: full skills.sh skill-page URL (https://www.skills.sh/<owner>/<repo>/<skill>, or https://www.skills.sh/site/<hostname>/<skill> for a website catalog), GitHub owner/repo[/subpath], git URL, or local/file path.`}),skill:F().min(1).optional().meta({description:`Specific skill name to import from a multi-skill source.`}),install:L().optional().meta({description:`Pass false to import WITHOUT the default-editor auto-projection (the caller installs explicitly afterwards). Default true.`}),marketplace:L().optional().meta({description:"The source came from a skills.sh listing the user chose (the Explore tab), so the install is reported to skills.sh and counts toward that listing. Off by default: a hand-typed repo must not be announced to skills.sh. Honors the `telemetry.skillInstallReports.enabled` setting and DO_NOT_TRACK."}),...tB,summary:nB}).strict(),B({scope:GJ.default(`project`),source:F().min(1).meta({description:`External skill source: full skills.sh skill-page URL, GitHub owner/repo[/subpath], git URL, or local/file path.`}),skills:z(F().min(1)).min(1).max(100).meta({description:`Skill names to import from the source.`}),install:L().optional().meta({description:`Pass false to import WITHOUT the default-editor auto-projection. Default true.`}),marketplace:L().optional().meta({description:"The source came from a skills.sh listing the user chose (a marketplace plugin bundle), so the import is reported to skills.sh as one batched install event and counts toward that listing. Off by default: a hand-typed repo must not be announced to skills.sh. Honors the `telemetry.skillInstallReports.enabled` setting and DO_NOT_TRACK."}),...tB,summary:nB}).strict(),B({results:z(B({requested:F(),status:U([`imported`,`already-imported`,`not-found`,`failed`]),name:F().optional(),collisionRenamedFrom:F().optional(),warnings:z(F()),warningCodes:JJ,error:F().optional()}).loose()),imported:I(),alreadyImported:I(),failed:I()}).loose(),B({scope:GJ.default(`project`),names:z(F().min(1)).min(1).max(100).meta({description:`Managed skill names to refresh from their recorded upstreams.`}),...tB,summary:nB}).strict(),B({results:z(B({requested:F(),status:U([`updated`,`up-to-date`,`not-found`,`failed`]),source:F().optional(),warnings:z(F()),warningCodes:JJ,error:F().optional()}).loose()),updated:I(),upToDate:I(),failed:I()}).loose();const I_e=B({source:F(),ref:F().optional(),contentHash:F(),publisher:F().optional()}).loose();B({name:F().min(1).meta({description:`Managed skill name created or matched.`}),path:F().min(1).meta({description:`Store-relative path to the imported skill source.`}),created:L().meta({description:`True when this request created new source files.`}),alreadyImported:L().meta({description:`True when identical content was already present and no files changed.`}),collisionRenamedFrom:F().optional().meta({description:`Original source name when collision handling renamed the import.`}),provenance:I_e,warnings:z(F()).meta({description:`Non-fatal import warnings, such as skipped unsupported files.`}),warningCodes:JJ}).loose();const L_e=U([`files`,`backlinks`,`graph`,`sync-status`,`session-activity`,`tags`,`comments`,`lint-config`,`local-targets`]);B({v:W(1),ch:W(`server-info`),seq:I(),serverInstanceId:F().min(1),currentBranch:F().min(1).optional()}).loose(),B({v:W(1),ch:W(`branch-switched`),seq:I(),branch:F().min(1)}).loose(),B({v:W(1),ch:L_e,seq:I()}).loose(),B({v:W(1),ch:W(`disk-ack`),seq:I(),docName:F().min(1),sv:F().min(1)}).loose(),B({v:W(1),ch:W(`config-validation-rejected`),seq:I(),docName:F().min(1),error:Pu}).loose(),B({v:W(1),ch:W(`config-ignore-nested-error`),seq:I(),path:F().min(1),error:F().min(1)}).loose(),(()=>{let e=globalThis.Intl.Segmenter;return e?new e(`en`,{granularity:`word`}):null})();const oY=Symbol.for(`@inkeep/open-knowledge/skill-state-field-registry`),sY=globalThis;sY[oY]===void 0&&(sY[oY]=br());const cY=sY[oY],lY=Vi({version:F().regex(/^\d+\.\d+\.\d+(?:[-+][\w.-]+)?$/,`version must match /^\\d+\\.\\d+\\.\\d+(?:[-+][\\w.-]+)?$/`).register(cY,{description:`Recorded skill version for this target.`}),recordedAt:Vr().register(cY,{description:`ISO 8601 timestamp of the most recent successful write. Updated on every write, including reinstalls of the same version.`}),surface:U([`server-build-and-open`,`electron-build-and-open`,`cli-npx-skills-add`,`desktop-direct`,`cli-start`]).register(cY,{description:`Install-source surface that recorded this entry.`}).optional()}),R_e=Vi({enabled:L().register(cY,{description:`Whether this user-global skill bundle is opted in.`}),decidedAt:Vr().register(cY,{description:`ISO 8601 timestamp of the opt-in / opt-out decision.`})});Vi({schema:W(1).register(cY,{description:`Schema major version. Bumped only on breaking shape changes.`}),targets:Vi({"claude-cowork":lY.optional(),"cli-hosts":lY.optional()}).register(cY,{description:`Per-target install-state entries. Absent target = no recorded install.`}).default({}),bundles:H(F(),R_e).register(cY,{description:`Per-bundle opt-in decisions keyed by install name. Absent key = no recorded decision.`}).optional(),installsReported:z(F()).register(cY,{description:"Skill installs already reported to skills.sh from this machine, as `<owner/repo>#<skill>`. Append-only; presence suppresses a re-report."}).optional()});const z_e=[`auth-error`,`detached-head`,`dirty-tree`,`diverged-local-commits`,`external-changes-pending`,`git-index-locked`,`git-operation-in-progress`,`no-commits-yet`,`no-push-permission`,`non-content-merge-failure`,`protected-branch`,`unsafe-incoming-symlinks`],uY=e=>e*8+4;uY(92),uY(40),Array.from({length:256},(e,t)=>(t+256).toString(16).slice(1));const dY={fileSystem:`File System`,gitUpstream:`Git (upstream)`,service:`OpenKnowledge (service)`,generator:`OpenKnowledge (generated)`};function B_e(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=xu({file:r,source:n,doc:t,path:i});return{path:i,message:e.message,issueCode:e.code,...a===void 0?{}:{source:a}}})}}function fY(e,t,n){let r=`${e}.invalid-${t.replace(/[:.]/g,`-`)}`;try{return D(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 pY(e,t){let n=e;for(let e of t){if(typeof n!=`object`||!n||Array.isArray(n))return;n=Reflect.get(n,e)}return n}function V_e(e){let t=[],n=[[`maxBatchSize`,1,ou],[`maxBatchChars`,1,su],[`docTimeoutMs`,1,cu]];for(let[r,i,a]of n){let n=[`search`,`semantic`,r],o=pY(e.rawConfig,n),s=e.config.search.semantic[r];if(o===void 0||o===s)continue;let c=`Expected an integer between ${i} and ${a}; using default ${s}.`,l=xu({file:e.absPath,source:e.source,doc:e.doc,path:n});t.push({path:n,message:c,...l===void 0?{}:{source:{file:l.file,line:l.line,column:l.column}}})}return t.length>0?[{code:`VALUE_FALLBACK`,issues:t}]:[]}function H_e(e){let t=pY(e.rawConfig,[`git`,`hosts`]);if(t===void 0)return[];let n=zc.safeParse(t);return n.success?[]:[{code:`VALUE_FALLBACK`,issues:n.error.issues.map(t=>{let n=[`git`,`hosts`,...t.path.map(String)],r=xu({file:e.absPath,source:e.source,doc:e.doc,path:n});return{path:n,message:`${t.message}; ignoring this git-host declaration.`,...r===void 0?{}:{source:{file:r.file,line:r.line,column:r.column}}}})}]}function U_e(e){let t=pY(e.rawConfig,[`autolinks`]);if(t===void 0)return[];let n=Jl.safeParse(t);return n.success?[]:[{code:`VALUE_FALLBACK`,issues:n.error.issues.map(t=>{let n=[`autolinks`,...t.path.map(String)],r=xu({file:e.absPath,source:e.source,doc:e.doc,path:n});return{path:n,message:t.path.length===0?`${t.message}; ignoring autolinks.`:`${t.message}; ignoring this autolink entry.`,...r===void 0?{}:{source:{file:r.file,line:r.line,column:r.column}}}})}]}function mY(e){let{absPath:t,sideline:n=!0,timestamp:r=new Date().toISOString()}=e,i=e.warn??(e=>console.warn(e)),a=mu.parse({});if(!g(t))return{valid:!0,value:a,source:void 0,diagnostics:[]};let o;try{o=S(t,`utf-8`)}catch(e){let n=e instanceof Error?e.message:String(e);i(`[config] Could not read ${t}: ${n}. Using schema defaults.`);let r={code:`UNREADABLE`,detail:n};return{valid:!1,value:a,error:r,diagnostics:[{...r}]}}let s=(0,rs.parseDocument)(o);if(s.errors.length>0){let e=s.errors.map(e=>e.message).join(`; `);i(`[config] ${t} contains invalid YAML (${e}). Using schema defaults.`+(n?``:` Pass-through mode: file left in place.`));let o=n?fY(t,r,i):void 0,c={code:`YAML_PARSE`,detail:e};return{valid:!1,value:a,error:c,diagnostics:[{...c}],...o===void 0?{}:{sidelinedTo:o}}}let c=s.toJSON()??{},l=Uu({value:c,file:t,source:o,doc:s}),u=l.length>0?Gu(c):c,d=[...H_e({rawConfig:u,doc:s,source:o,absPath:t}),...U_e({rawConfig:u,doc:s,source:o,absPath:t})];for(let e of d)for(let n of e.issues)i(`[config] ${t} ${n.path.join(`.`)}: ${n.message}`);let f=mu.safeParse(u);if(!f.success){let e=B_e(f,s,o,t),c=mu.shape.git.safeParse(pY(u,[`git`])).data??a.git,p=Object.keys(c.hosts).length>0?`Using schema defaults while preserving valid git-host declarations.`:`Using schema defaults.`;i(`[config] ${t} fails schema validation (${f.error.issues.length} issue(s)). ${p}`+(n?``:` Pass-through mode: file left in place.`));let m=n?fY(t,r,i):void 0,h=[...l,...d,...Fu(e)&&e.code===`SCHEMA_INVALID`?[{...e}]:[]];return{valid:!1,value:{...a,git:c},error:e,diagnostics:h,...m===void 0?{}:{sidelinedTo:m}}}let p=[...l,...d,...V_e({rawConfig:u,config:f.data,doc:s,source:o,absPath:t})];return{valid:!0,value:f.data,source:t,diagnostics:p}}function hY(e=ve()){return A(e,ot().userHomeDirName)}const gY=`.tmp.`,_Y=[8,4,4,4,12];function W_e(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}const G_e=_Y.map(e=>`[0-9a-f]`.repeat(e)).join(`-`),K_e=_Y.map(e=>`[0-9a-f]{${e}}`).join(`-`),q_e=`*${gY}${G_e}`;RegExp(`${W_e(gY)}${K_e}$`);function J_e(e){return`${e}${gY}${je()}`}function Y_e(e){try{let t=O(e),n=`${oe(e)}${gY}`,r=Date.now()-3e4;for(let e of w(t)){if(!e.startsWith(n))continue;let i=A(t,e);try{ne(i).mtimeMs<r&&re(i)}catch{}}}catch{}}function vY(e,t,n={}){Y_e(e);let r=J_e(e);try{ie(r,t,{encoding:`utf-8`,mode:n.mode??420}),D(r,e)}catch(e){try{re(r)}catch{}throw e}}var yY=class extends Error{code=`LOCK_TIMEOUT`;lockPath;timeoutMs;constructor(e,t){super(`Could not acquire file lock at ${e} within ${t}ms`),this.name=`FileLockTimeoutError`,this.lockPath=e,this.timeoutMs=t}};async function X_e(e,t,n={}){let r=n.timeoutMs??5e3,i=n.retryIntervalMs??25,a=r*2,o=Date.now()+r,s=!0;for(;;){if(!s&&Date.now()>=o)throw new yY(e,r);s=!1;let c;try{c=b(e,`wx`,384)}catch(t){if(t.code!==`EEXIST`)throw t;let s;try{let t=ne(e);s=Date.now()-t.mtimeMs}catch{continue}let c=!1;if(s>a){n.onWarn?.(`cleared stale file lock`,{lockPath:e,ageMs:s,staleThresholdMs:a});try{re(e),c=!0}catch{}}if(c)continue;if(Date.now()>=o)throw new yY(e,r);await Zu(i);continue}try{return await t()}finally{try{f(c)}catch{}try{re(e)}catch{}}}}function Z_e(e){let t=Date.now()+e;for(;Date.now()<t;);}function bY(e,t,n={}){let r=n.timeoutMs??5e3,i=n.retryIntervalMs??25,a=r*2,o=Date.now()+r,s=!0;for(;;){if(!s&&Date.now()>=o)throw new yY(e,r);s=!1;let c;try{c=b(e,`wx`,384)}catch(t){if(t.code!==`EEXIST`)throw t;let s;try{let t=ne(e);s=Date.now()-t.mtimeMs}catch{continue}let c=!1;if(s>a){n.onWarn?.(`cleared stale file lock`,{lockPath:e,ageMs:s,staleThresholdMs:a});try{re(e),c=!0}catch{}}if(c)continue;if(Date.now()>=o)throw new yY(e,r);Z_e(i);continue}try{return t()}finally{try{f(c)}catch{}try{re(e)}catch{}}}}const xY=`config.yml`;function SY(e,t,n){if(e===`user`)return M(hY(n??ve()),`global.yml`);let r=k(t)?t:M(t);return e===`project-local`?M(r,`.ok`,to,xY):M(r,`.ok`,xY)}const Q_e=[`LC_ALL`,`LC_MESSAGES`,`LANG`];function CY(e){let t=e.trim().split(`@`)[0].split(`.`)[0];return t===``||t===`C`||t===`POSIX`?null:Yu(t.replaceAll(`_`,`-`))}function $_e(e){for(let t of Q_e){let n=e[t]?.trim();if(n!==void 0&&n!==``)return CY(n)}return null}function eve(e){let t=e.OK_LANG?.trim();if(t!==void 0&&t!==``)return Yu(t)??void 0}function tve(e=process.env){let t=eve(e),n=$_e(e);if(n===null)return{override:t,preferenceList:[]};let r=[],i=e.LANGUAGE;if(i!==void 0)for(let e of i.split(`:`)){let t=CY(e);t!==null&&r.push(t)}return{override:t,preferenceList:[...r,n]}}function wY(){return oo(ro)}function TY(){return ot().keyringService}function EY(e){try{e()}catch{}}var nve=class{backend=`keyring`;onKeychainRead;constructor(e){this.onKeychainRead=e}async get(e){let{Entry:t}=await import(`@napi-rs/keyring`),n;try{n=new t(TY(),e).getPassword()}catch(t){return EY(()=>this.onKeychainRead?.({kind:`read-error`,host:e,error:t instanceof Error?t.name:`unknown`})),null}if(n==null)return EY(()=>this.onKeychainRead?.({kind:`absent`,host:e})),null;try{return JSON.parse(n)}catch{return EY(()=>this.onKeychainRead?.({kind:`corrupt-entry`,host:e,error:`corrupt-entry`})),null}}async set(e,t,n,r){let{Entry:i}=await import(`@napi-rs/keyring`),a=new i(TY(),e),o={login:t,token:n,...r};a.setPassword(JSON.stringify(o))}async clear(e){let{Entry:t}=await import(`@napi-rs/keyring`);try{new t(TY(),e).deletePassword()}catch{}}},DY=class{backend=`file`;authFile;constructor(e){this.authFile=e??A(hY(),`auth.yml`)}read(){if(!g(this.authFile))return{};try{let e=S(this.authFile,`utf-8`);return(0,rs.parse)(e)??{}}catch(e){let t=e instanceof Error?e.message:`unknown error`;return process.stderr.write(`[auth] Failed to parse ${this.authFile}: ${t}. Starting with empty credentials.\n`),{}}}write(e){let t=O(this.authFile);g(t)||v(t,{recursive:!0,mode:448}),vY(this.authFile,(0,rs.stringify)(e),{mode:384})}async get(e){return this.read()[e]??null}async set(e,t,n,r){let i=this.read();i[e]={login:t,token:n,...r},this.write(i)}async clear(e){let t=this.read();delete t[e],this.write(t)}},rve=class{backend=`keyring`;keychain;file;constructor(e,t){this.keychain=e,this.file=t}async get(e){let t=await this.keychain.get(e);if(t!=null)return t;let n=await this.file.get(e);if(n==null)return null;try{await this.keychain.set(e,n.login,n.token,{gitProtocol:n.gitProtocol,name:n.name,email:n.email}),await this.file.clear(e),process.stderr.write(`[auth] migrated ${e} credential from ${wY()} to the OS keychain\n`)}catch{}return n}set(e,t,n,r){return this.keychain.set(e,t,n,r)}async clear(e){await this.keychain.clear(e),await this.file.get(e)!=null&&await this.file.clear(e)}};async function OY(e,t){try{let{Entry:n}=await import(`@napi-rs/keyring`);return new n(TY(),`__probe__`),process.stderr.write(`[auth] token storage: OS keychain
|
|
421
|
+
`?(c+=1,l=1):l+=1;return{line:c,column:l}};for(let e of o.matchAll(hge)){let{index:i}=e;if((a===void 0?o[i-1]:n[a+i-1])===`!`)continue;let s=r&&a!==void 0?{start:u(i),end:u(i+e[0].length)}:void 0;t.message(gge(e[0]),s)}})}),vge=[`index`,`log`],yge=mJ(`reserved-casing`,(e,t)=>{let n=t.data.okfDocName;if(n===void 0)return;let r=hR(n),i=r.toLowerCase();vge.includes(i)&&r!==i&&t.message(`This file is named "${r}", but the Open Knowledge Format only recognizes "${i}". On a case-sensitive filesystem a consumer reads it as an ordinary concept document rather than the reserved file it is meant to be.`)}),vJ=[{id:`no-wiki-links`,rule:_ge},{id:`log-shape`,rule:mge},{id:`index-shape`,rule:uge},{id:`reserved-casing`,rule:yge}],bge=vJ.map(e=>e.rule);function xge(e){return e===void 0?bge:vJ.filter(t=>lJ(e,t.id)).map(e=>e.rule)}const Sge=V([L(),U(_l),H(F(),R())]),Cge={id:`markdownlint`,sliceSchema:B({enabled:L(),rules:H(F(),Sge)}),defaultSlice:{enabled:!1,rules:Fq},async lint(e,t){return oJ(e,Iq(t.rules))},fix(e,t){return aJ(e,Iq(t.rules))}},wge=B({appliesTo:V([F(),z(F())]).optional(),file:F(),enabled:L().optional(),key:F().optional(),schema:H(F(),R()).optional()}),yJ=[Cge,{id:`frontmatter`,sliceSchema:B({enabled:L(),schemas:z(wge)}),defaultSlice:{enabled:!1,schemas:[]},async lint(e,t,n){return iJ(e,zq(t.schemas,n.docName))},frontmatter:{schemasForDoc:(e,t)=>zq(e.schemas,t),narrowSliceToFrontmatter:e=>e,advertisedMappings:e=>e.schemas}},{id:`okf`,sliceSchema:B({enabled:L(),rules:H(F(),L()).optional(),generate:B({index:L().optional()}).optional()}),defaultSlice:{enabled:!1},async lint(e,t,n){return[...cge(e,xge(t.rules),n.docName),...age(e,t.rules,n.docName)]},frontmatter:{schemasForDoc:(e,t)=>pJ(e.rules,t),narrowSliceToFrontmatter:e=>({...e,rules:{...e.rules,...rge}}),advertisedMappings:e=>ige(e.rules)}}];Object.fromEntries(yJ.map(e=>[e.id,e.defaultSlice])),B({docName:$z,summary:nB,content:F().optional(),...tB}).loose(),B({docName:$z,summary:nB,markdown:F(),position:U([`append`,`prepend`,`replace`]).optional(),extension:U(lR).optional(),...tB}).loose(),B({docName:$z,summary:nB,find:F().min(1),replace:F(),offset:I().int().nonnegative().optional(),...tB}).loose(),B({docName:$z,connectionId:F().min(1),scope:U([`last`,`session`,`file`,`count`]).optional(),count:I().int().positive().optional(),...tB}).loose().refine(e=>e.scope!==`count`||e.count!==void 0,{message:`count is required when scope is 'count'`,path:[`count`]});const bJ=B({value:F(),truncatedFrom:I().int().nonnegative().optional(),hint:F().optional()}).loose(),Tge=Wi(`kind`,[B({kind:W(`inline`),content:F()}),B({kind:W(`truncated`),byteLength:I().int().nonnegative(),hint:F()})]),xJ=B({kind:W(`content-divergence`),intendedBytes:I().int().nonnegative(),actualBytes:I().int().nonnegative(),byteDelta:I().int(),divergenceType:F().optional(),currentState:Tge.optional(),hint:F().optional()}).loose(),Ege=B({type:W(`orphan`),parentCandidates:z(F()),message:F()}).loose(),SJ=B({kind:W(`disk-edit-reconciled`),intendedBytes:I().int().nonnegative(),actualBytes:I().int().nonnegative(),byteDelta:I().int(),mergeOutcome:F().optional(),hint:F().optional()}).loose();Wi(`kind`,[xJ,SJ]);const Dge=Object.keys({"content-divergence":!0,"disk-edit-reconciled":!0}),Oge=B({kind:W(`mermaid-parse-error`),fenceIndex:I().int().positive(),fenceFirstLine:F(),message:F(),line:I().int().positive().optional()}).loose(),CJ=B({href:F(),targetKind:F(),role:F(),sourceForm:F(),resolvedTarget:F().nullable(),reason:F(),resolutionMethod:F(),fallbackTarget:F().nullable().optional(),definition:B({line:I().int().nonnegative(),label:F()}).loose().optional()}).loose(),wJ=Wi(`kind`,[xJ,SJ,Oge,B({kind:W(`lint-violation`),source:F(),code:F(),message:F(),severity:U([`error`,`warning`,`info`,`hint`]),line:I().int().positive(),column:I().int().positive(),linkTarget:F().optional(),localTarget:CJ.optional()}).loose()]),TJ=z(wJ).min(1),EJ=B({href:F(),resolvedTo:F().nullable(),reason:U([`no-such-doc`,`no-such-file`,`unresolvable`]),localTarget:CJ.optional()}).loose(),DJ=z(EJ),OJ=B({reason:F().min(1),count:I().int().positive()}).loose();B({timestamp:F().min(1),summary:bJ.optional(),warnings:TJ.optional()}).loose(),B({timestamp:F().min(1),subscriberCount:I().int().nonnegative(),systemSubscriberCount:I().int().nonnegative(),hints:z(Ege).optional(),summary:bJ.optional(),warnings:TJ.optional(),brokenLinks:DJ,brokenLinkSuppression:OJ.optional()}).loose(),B({timestamp:F().min(1),subscriberCount:I().int().nonnegative(),systemSubscriberCount:I().int().nonnegative(),summary:bJ.optional(),warnings:TJ.optional(),brokenLinks:DJ,brokenLinkSuppression:OJ.optional()}).loose(),B({docName:F().min(1),scope:U([`last`,`session`,`count`]),undone:L()}).loose(),B({docs:z(B({docName:eB,markdown:F(),position:U([`append`,`prepend`,`replace`]).optional(),extension:U(lR).optional(),summary:nB}).loose()).min(1).max(100),...tB}).loose();const kge=B({type:kB,title:F(),detail:F().optional()}).loose(),Age=Wi(`status`,[B({status:W(`written`),docName:F().min(1),summary:bJ.optional(),warnings:TJ.optional(),brokenLinks:DJ,brokenLinkSuppression:OJ.optional()}).loose(),B({status:W(`error`),docName:F().min(1),error:kge}).loose()]);B({timestamp:F().min(1),results:z(Age),written:I().int().nonnegative(),failed:I().int().nonnegative()}).loose(),B({docName:$z,patch:H(F(),V([ss,Pi()])),types:H(F(),U(is)).optional(),summary:nB,...tB}).loose(),B({timestamp:F().min(1),subscriberCount:I().int().nonnegative(),systemSubscriberCount:I().int().nonnegative(),appliedKeys:z(F()),summary:bJ.optional(),warnings:TJ.optional(),brokenLinks:DJ,brokenLinkSuppression:OJ.optional()}).loose();const jge=Object.fromEntries(yJ.map(e=>[e.id,e.sliceSchema]));B({effective:B({enabled:L(),plugins:B(jge)}),configFile:F().nullable().optional(),configProblems:z(F()).optional()});const Mge=V([L(),H(F(),R())]),Nge=new Set([`__proto__`]),kJ=F().min(1).max(256).refine(e=>!Nge.has(e),{message:`schema property name cannot be __proto__`});B({ruleId:F().min(1).max(64).regex(/^[A-Za-z][A-Za-z0-9_-]*$/),value:V([Mge,Pi()])}),B({file:F().min(1).max(512),delete:W(!0).optional(),field:kJ.optional(),parentPath:z(V([kJ,B({items:W(!0)}).strict()])).max(8).optional(),removeField:W(!0).optional(),renameTo:kJ.optional(),constraint:B({type:U([`string`,`number`,`boolean`,`array`,`object`]).nullable().optional(),enum:z(V([F(),I(),L()])).nullable().optional(),itemsEnum:z(V([F(),I(),L()])).nullable().optional(),itemsType:U([`string`,`number`,`boolean`,`object`]).nullable().optional(),pattern:F().nullable().optional(),format:F().nullable().optional(),description:F().max(2048).nullable().optional(),required:L().optional()}).optional()}).refine(e=>e.delete===void 0||e.field===void 0&&e.constraint===void 0&&e.removeField===void 0&&e.renameTo===void 0,{message:`delete cannot be combined with a field edit`}).refine(e=>[e.constraint,e.removeField,e.renameTo].filter(e=>e!==void 0).length<=1,{message:`constraint, removeField, and renameTo are mutually exclusive`}).refine(e=>e.removeField===void 0&&e.renameTo===void 0||e.field!==void 0,{message:`removeField and renameTo require field`}).refine(e=>e.parentPath===void 0||e.field!==void 0,{message:`parentPath requires field`}).refine(e=>e.field===void 0?e.constraint===void 0:e.constraint!==void 0||e.removeField!==void 0||e.renameTo!==void 0,{message:`field requires constraint, removeField, or renameTo`}),B({schemas:z(F()),truncated:L()}).strict();const AJ=B({line:I(),character:I()}),jJ=B({start:AJ,end:AJ}),MJ=B({range:jJ,severity:U([`error`,`warning`,`info`,`hint`]),source:F(),code:F(),message:F(),fixes:z(B({range:jJ,newText:F()})).optional(),frontmatterScope:U(ml).optional(),frontmatterProperty:F().optional()}),NJ=z(F()).optional();B({files:z(B({file:F(),diagnostics:z(MJ),ran:NJ,warnings:z(F()).optional()})),fileCount:I(),errorCount:I(),warningCount:I(),warnings:z(F()),ran:NJ});const Pge=MJ.extend({linkTarget:F().optional(),localTarget:CJ.optional()});B({files:z(B({file:F(),diagnostics:z(Pge)})),fileCount:I(),errorCount:I(),warningCount:I(),warnings:z(F()),ran:NJ,brokenLinkSuppression:OJ.optional()});const PJ=B({errorCount:I().int().nonnegative(),warningCount:I().int().nonnegative()});B({files:z(B({file:F(),lint:PJ,links:PJ})),fileCount:I().int().nonnegative(),errorCount:I().int().nonnegative(),warningCount:I().int().nonnegative(),warnings:z(F()),brokenLinkSuppression:OJ.optional()}),B({docName:$z,summary:nB,...tB}).loose();const Fge=B({reason:U([`re-lint-threw`,`source-went-blind`]),message:F().min(1)});B({file:F(),fixedCount:I(),diagnostics:z(MJ),errorCount:I(),warningCount:I(),ran:NJ,warnings:z(F()).optional(),diagnosticsArePreFix:L().optional(),reLintFailure:Fge.optional()});const Ige=[{id:`MD001`,alias:`heading-increment`,aliases:[`heading-increment`],name:`Heading levels should only increment by one level at a time`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md001.md`,tags:[`headings`],options:[{key:`front_matter_title`,type:`string`,description:`RegExp for matching title in front matter`,default:`^\\s*title\\s*[:=]`}]},{id:`MD003`,alias:`heading-style`,aliases:[`heading-style`],name:`Heading style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md003.md`,tags:[`headings`],options:[{key:`style`,type:`enum`,description:`Heading style`,enum:[`consistent`,`atx`,`atx_closed`,`setext`,`setext_with_atx`,`setext_with_atx_closed`],default:`consistent`}]},{id:`MD004`,alias:`ul-style`,aliases:[`ul-style`],name:`Unordered list style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md004.md`,tags:[`bullet`,`ul`],options:[{key:`style`,type:`enum`,description:`List style`,enum:[`consistent`,`asterisk`,`plus`,`dash`,`sublist`],default:`consistent`}]},{id:`MD005`,alias:`list-indent`,aliases:[`list-indent`],name:`Inconsistent indentation for list items at the same level`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md005.md`,tags:[`bullet`,`ul`,`indentation`],options:[]},{id:`MD007`,alias:`ul-indent`,aliases:[`ul-indent`],name:`Unordered list indentation`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md007.md`,tags:[`bullet`,`ul`,`indentation`],options:[{key:`indent`,type:`integer`,description:`Spaces for indent`,default:2,minimum:1},{key:`start_indented`,type:`boolean`,description:`Whether to indent the first level of the list`,default:!1},{key:`start_indent`,type:`integer`,description:`Spaces for first level indent (when start_indented is set)`,default:2,minimum:1}]},{id:`MD009`,alias:`no-trailing-spaces`,aliases:[`no-trailing-spaces`],name:`Trailing spaces`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md009.md`,tags:[`whitespace`],options:[{key:`br_spaces`,type:`integer`,description:`Spaces for line break`,default:2,minimum:0},{key:`code_blocks`,type:`boolean`,description:`Include code blocks`,default:!1},{key:`list_item_empty_lines`,type:`boolean`,description:`Allow spaces for empty lines in list items`,default:!1},{key:`strict`,type:`boolean`,description:`Include unnecessary breaks`,default:!1}]},{id:`MD010`,alias:`no-hard-tabs`,aliases:[`no-hard-tabs`],name:`Hard tabs`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md010.md`,tags:[`whitespace`,`hard_tab`],options:[{key:`code_blocks`,type:`boolean`,description:`Include code blocks`,default:!0},{key:`ignore_code_languages`,type:`string-array`,description:`Fenced code languages to ignore`,default:[]},{key:`spaces_per_tab`,type:`integer`,description:`Number of spaces for each hard tab`,default:1,minimum:0}]},{id:`MD011`,alias:`no-reversed-links`,aliases:[`no-reversed-links`],name:`Reversed link syntax`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md011.md`,tags:[`links`],options:[]},{id:`MD012`,alias:`no-multiple-blanks`,aliases:[`no-multiple-blanks`],name:`Multiple consecutive blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md012.md`,tags:[`whitespace`,`blank_lines`],options:[{key:`maximum`,type:`integer`,description:`Consecutive blank lines`,default:1,minimum:1}]},{id:`MD013`,alias:`line-length`,aliases:[`line-length`],name:`Line length`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md013.md`,tags:[`line_length`],options:[{key:`line_length`,type:`integer`,description:`Number of characters`,default:80,minimum:1},{key:`heading_line_length`,type:`integer`,description:`Number of characters for headings`,default:80,minimum:1},{key:`code_block_line_length`,type:`integer`,description:`Number of characters for code blocks`,default:80,minimum:1},{key:`code_blocks`,type:`boolean`,description:`Include code blocks`,default:!0},{key:`tables`,type:`boolean`,description:`Include tables`,default:!0},{key:`headings`,type:`boolean`,description:`Include headings`,default:!0},{key:`strict`,type:`boolean`,description:`Strict length checking`,default:!1},{key:`stern`,type:`boolean`,description:`Stern length checking`,default:!1}]},{id:`MD014`,alias:`commands-show-output`,aliases:[`commands-show-output`],name:`Dollar signs used before commands without showing output`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md014.md`,tags:[`code`],options:[]},{id:`MD018`,alias:`no-missing-space-atx`,aliases:[`no-missing-space-atx`],name:`No space after hash on atx style heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md018.md`,tags:[`headings`,`atx`,`spaces`],options:[]},{id:`MD019`,alias:`no-multiple-space-atx`,aliases:[`no-multiple-space-atx`],name:`Multiple spaces after hash on atx style heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md019.md`,tags:[`headings`,`atx`,`spaces`],options:[]},{id:`MD020`,alias:`no-missing-space-closed-atx`,aliases:[`no-missing-space-closed-atx`],name:`No space inside hashes on closed atx style heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md020.md`,tags:[`headings`,`spaces`,`atx_closed`],options:[]},{id:`MD021`,alias:`no-multiple-space-closed-atx`,aliases:[`no-multiple-space-closed-atx`],name:`Multiple spaces inside hashes on closed atx style heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md021.md`,tags:[`headings`,`spaces`,`atx_closed`],options:[]},{id:`MD022`,alias:`blanks-around-headings`,aliases:[`blanks-around-headings`],name:`Headings should be surrounded by blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md022.md`,tags:[`headings`,`blank_lines`],options:[{key:`include_front_matter`,type:`boolean`,description:`Include front matter content`,default:!1},{key:`lines_above`,type:`unsupported`,description:`Blank lines above heading`,default:1},{key:`lines_below`,type:`unsupported`,description:`Blank lines below heading`,default:1}]},{id:`MD023`,alias:`heading-start-left`,aliases:[`heading-start-left`],name:`Headings must start at the beginning of the line`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md023.md`,tags:[`headings`,`spaces`],options:[]},{id:`MD024`,alias:`no-duplicate-heading`,aliases:[`no-duplicate-heading`],name:`Multiple headings with the same content`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md024.md`,tags:[`headings`],options:[{key:`siblings_only`,type:`boolean`,description:`Only check sibling headings`,default:!1}]},{id:`MD025`,alias:`single-title`,aliases:[`single-title`,`single-h1`],name:`Multiple top-level headings in the same document`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md025.md`,tags:[`headings`],options:[{key:`front_matter_title`,type:`string`,description:`RegExp for matching title in front matter`,default:`^\\s*title\\s*[:=]`},{key:`level`,type:`integer`,description:`Heading level`,default:1,minimum:1,maximum:6}]},{id:`MD026`,alias:`no-trailing-punctuation`,aliases:[`no-trailing-punctuation`],name:`Trailing punctuation in heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md026.md`,tags:[`headings`],options:[{key:`punctuation`,type:`string`,description:`Punctuation characters`,default:`.,;:!。,;:!`}]},{id:`MD027`,alias:`no-multiple-space-blockquote`,aliases:[`no-multiple-space-blockquote`],name:`Multiple spaces after blockquote symbol`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md027.md`,tags:[`indentation`,`whitespace`,`blockquote`],options:[{key:`list_items`,type:`boolean`,description:`Include list items`,default:!0}]},{id:`MD028`,alias:`no-blanks-blockquote`,aliases:[`no-blanks-blockquote`],name:`Blank line inside blockquote`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md028.md`,tags:[`whitespace`,`blockquote`],options:[]},{id:`MD029`,alias:`ol-prefix`,aliases:[`ol-prefix`],name:`Ordered list item prefix`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md029.md`,tags:[`ol`],options:[{key:`style`,type:`enum`,description:`List style`,enum:[`one`,`ordered`,`one_or_ordered`,`zero`],default:`one_or_ordered`}]},{id:`MD030`,alias:`list-marker-space`,aliases:[`list-marker-space`],name:`Spaces after list markers`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md030.md`,tags:[`ul`,`whitespace`,`ol`],options:[{key:`ul_single`,type:`integer`,description:`Spaces for single-line unordered list items`,default:1,minimum:1},{key:`ol_single`,type:`integer`,description:`Spaces for single-line ordered list items`,default:1,minimum:1},{key:`ul_multi`,type:`integer`,description:`Spaces for multi-line unordered list items`,default:1,minimum:1},{key:`ol_multi`,type:`integer`,description:`Spaces for multi-line ordered list items`,default:1,minimum:1}]},{id:`MD031`,alias:`blanks-around-fences`,aliases:[`blanks-around-fences`],name:`Fenced code blocks should be surrounded by blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md031.md`,tags:[`blank_lines`,`code`],options:[{key:`list_items`,type:`boolean`,description:`Include list items`,default:!0}]},{id:`MD032`,alias:`blanks-around-lists`,aliases:[`blanks-around-lists`],name:`Lists should be surrounded by blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md032.md`,tags:[`bullet`,`ul`,`blank_lines`,`ol`],options:[]},{id:`MD033`,alias:`no-inline-html`,aliases:[`no-inline-html`],name:`Inline HTML`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md033.md`,tags:[`html`],options:[{key:`allowed_elements`,type:`string-array`,description:`Allowed elements`,default:[]},{key:`table_allowed_elements`,type:`string-array`,description:`Allowed elements in tables`,default:[]}]},{id:`MD034`,alias:`no-bare-urls`,aliases:[`no-bare-urls`],name:`Bare URL used`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md034.md`,tags:[`links`,`url`],options:[]},{id:`MD035`,alias:`hr-style`,aliases:[`hr-style`],name:`Horizontal rule style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md035.md`,tags:[`hr`],options:[{key:`style`,type:`string`,description:`Horizontal rule style`,default:`consistent`}]},{id:`MD036`,alias:`no-emphasis-as-heading`,aliases:[`no-emphasis-as-heading`],name:`Emphasis used instead of a heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md036.md`,tags:[`headings`,`emphasis`],options:[{key:`punctuation`,type:`string`,description:`Punctuation characters`,default:`.,;:!?。,;:!?`}]},{id:`MD037`,alias:`no-space-in-emphasis`,aliases:[`no-space-in-emphasis`],name:`Spaces inside emphasis markers`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md037.md`,tags:[`whitespace`,`emphasis`],options:[]},{id:`MD038`,alias:`no-space-in-code`,aliases:[`no-space-in-code`],name:`Spaces inside code span elements`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md038.md`,tags:[`whitespace`,`code`],options:[]},{id:`MD039`,alias:`no-space-in-links`,aliases:[`no-space-in-links`],name:`Spaces inside link text`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md039.md`,tags:[`whitespace`,`links`],options:[]},{id:`MD040`,alias:`fenced-code-language`,aliases:[`fenced-code-language`],name:`Fenced code blocks should have a language specified`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md040.md`,tags:[`code`,`language`],options:[{key:`allowed_languages`,type:`string-array`,description:`List of languages`,default:[]},{key:`language_only`,type:`boolean`,description:`Require language only`,default:!1}]},{id:`MD041`,alias:`first-line-heading`,aliases:[`first-line-heading`,`first-line-h1`],name:`First line in a file should be a top-level heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md041.md`,tags:[`headings`],options:[{key:`allow_preamble`,type:`boolean`,description:`Allow content before first heading`,default:!1},{key:`front_matter_title`,type:`string`,description:`RegExp for matching title in front matter`,default:`^\\s*title\\s*[:=]`},{key:`level`,type:`integer`,description:`Heading level`,default:1,minimum:1,maximum:6}]},{id:`MD042`,alias:`no-empty-links`,aliases:[`no-empty-links`],name:`No empty links`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md042.md`,tags:[`links`],options:[]},{id:`MD043`,alias:`required-headings`,aliases:[`required-headings`],name:`Required heading structure`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md043.md`,tags:[`headings`],options:[{key:`headings`,type:`string-array`,description:`List of headings`,default:[]},{key:`match_case`,type:`boolean`,description:`Match case of headings`,default:!1}]},{id:`MD044`,alias:`proper-names`,aliases:[`proper-names`],name:`Proper names should have the correct capitalization`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md044.md`,tags:[`spelling`],options:[{key:`names`,type:`string-array`,description:`List of proper names`,default:[]},{key:`code_blocks`,type:`boolean`,description:`Include code blocks`,default:!0},{key:`html_elements`,type:`boolean`,description:`Include HTML elements`,default:!0}]},{id:`MD045`,alias:`no-alt-text`,aliases:[`no-alt-text`],name:`Images should have alternate text (alt text)`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md045.md`,tags:[`accessibility`,`images`],options:[]},{id:`MD046`,alias:`code-block-style`,aliases:[`code-block-style`],name:`Code block style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md046.md`,tags:[`code`],options:[{key:`style`,type:`enum`,description:`Block style`,enum:[`consistent`,`fenced`,`indented`],default:`consistent`}]},{id:`MD047`,alias:`single-trailing-newline`,aliases:[`single-trailing-newline`],name:`Files should end with a single newline character`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md047.md`,tags:[`blank_lines`],options:[]},{id:`MD048`,alias:`code-fence-style`,aliases:[`code-fence-style`],name:`Code fence style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md048.md`,tags:[`code`],options:[{key:`style`,type:`enum`,description:`Code fence style`,enum:[`consistent`,`backtick`,`tilde`],default:`consistent`}]},{id:`MD049`,alias:`emphasis-style`,aliases:[`emphasis-style`],name:`Emphasis style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md049.md`,tags:[`emphasis`],options:[{key:`style`,type:`enum`,description:`Emphasis style`,enum:[`consistent`,`asterisk`,`underscore`],default:`consistent`}]},{id:`MD050`,alias:`strong-style`,aliases:[`strong-style`],name:`Strong style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md050.md`,tags:[`emphasis`],options:[{key:`style`,type:`enum`,description:`Strong style`,enum:[`consistent`,`asterisk`,`underscore`],default:`consistent`}]},{id:`MD051`,alias:`link-fragments`,aliases:[`link-fragments`],name:`Link fragments should be valid`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md051.md`,tags:[`links`],options:[{key:`ignore_case`,type:`boolean`,description:`Ignore case of fragments`,default:!1},{key:`ignored_pattern`,type:`string`,description:`Pattern for ignoring additional fragments`,default:``}]},{id:`MD052`,alias:`reference-links-images`,aliases:[`reference-links-images`],name:`Reference links and images should use a label that is defined`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md052.md`,tags:[`links`,`images`],options:[{key:`ignored_labels`,type:`string-array`,description:`Ignored link labels`,default:[`x`]},{key:`shortcut_syntax`,type:`boolean`,description:`Include shortcut syntax`,default:!1}]},{id:`MD053`,alias:`link-image-reference-definitions`,aliases:[`link-image-reference-definitions`],name:`Link and image reference definitions should be needed`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md053.md`,tags:[`links`,`images`],options:[{key:`ignored_definitions`,type:`string-array`,description:`Ignored definitions`,default:[`//`]}]},{id:`MD054`,alias:`link-image-style`,aliases:[`link-image-style`],name:`Link and image style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md054.md`,tags:[`links`,`images`],options:[{key:`autolink`,type:`boolean`,description:`Allow autolinks`,default:!0},{key:`inline`,type:`boolean`,description:`Allow inline links and images`,default:!0},{key:`full`,type:`boolean`,description:`Allow full reference links and images`,default:!0},{key:`collapsed`,type:`boolean`,description:`Allow collapsed reference links and images`,default:!0},{key:`shortcut`,type:`boolean`,description:`Allow shortcut reference links and images`,default:!0},{key:`url_inline`,type:`boolean`,description:`Allow URLs as inline links`,default:!0}]},{id:`MD055`,alias:`table-pipe-style`,aliases:[`table-pipe-style`],name:`Table pipe style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md055.md`,tags:[`table`],options:[{key:`style`,type:`enum`,description:`Table pipe style`,enum:[`consistent`,`leading_only`,`trailing_only`,`leading_and_trailing`,`no_leading_or_trailing`],default:`consistent`}]},{id:`MD056`,alias:`table-column-count`,aliases:[`table-column-count`],name:`Table column count`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md056.md`,tags:[`table`],options:[]},{id:`MD058`,alias:`blanks-around-tables`,aliases:[`blanks-around-tables`],name:`Tables should be surrounded by blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md058.md`,tags:[`table`],options:[]},{id:`MD059`,alias:`descriptive-link-text`,aliases:[`descriptive-link-text`],name:`Link text should be descriptive`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md059.md`,tags:[`links`,`accessibility`],options:[{key:`prohibited_texts`,type:`string-array`,description:`Prohibited link texts`,default:[`click here`,`here`,`link`,`more`]}]},{id:`MD060`,alias:`table-column-style`,aliases:[`table-column-style`],name:`Table column style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md060.md`,tags:[`table`],options:[{key:`style`,type:`enum`,description:`Table column style`,enum:[`any`,`aligned`,`compact`,`tight`],default:`any`},{key:`aligned_delimiter`,type:`boolean`,description:`Aligned delimiter columns`,default:!1}]}];(()=>{let e=new Map;for(let t of Ige){e.set(t.id.toUpperCase(),t.id);for(let n of t.aliases)e.set(n.toUpperCase(),t.id)}return e})();const Lge=new Set([`img`,`video`,`audio`,`mark`,`u`,`ins`]);new Map(NV.flatMap(e=>e.surface===`compat`&&Lge.has(e.rendersAs)?[[e.name,e]]:[])),xpe(`<>`),mO().use(wk).use(lO);const FJ=[{tagName:`Mirror`,attrName:`src`,resolution:`bare-doc-name`},{tagName:`Excalidraw`,attrName:`src`,resolution:`doc-relative`}];for(let e of FJ){let t=NV.find(t=>t.name===e.tagName);if(!t)throw Error(`JSX_SRC_REF_TAGS: no built-in component descriptor named '${e.tagName}' — the rename-rewrite and backlink passes for this entry would silently never match. Fix the tagName to match a descriptor in builtInComponents.`);if(!t.props.some(t=>t.name===e.attrName))throw Error(`JSX_SRC_REF_TAGS: component '${e.tagName}' declares no prop named '${e.attrName}' — the rename-rewrite and backlink passes for this entry would silently never match. Fix the attrName to match one of the descriptor's props.`)}KA(),uA(),dA();function Rge(){return NV.filter(e=>e.surface===`canonical`&&e.name!==`*`)}function zge(){return Rge().filter(e=>{let t=Bge(e);return t!==`fence`&&t!==`html`})}function Bge(e){return e.name===`MermaidFence`?`fence`:e.name===`HtmlAlignBlock`?`html`:e.hasChildren?`jsx-block`:`jsx-void`}B({intents:z(B({satisfierId:F().min(1),desired:U([`present`,`absent`])}).loose()),...tB,summary:nB}).loose();const Vge=B({satisfierId:F(),agentId:F(),piece:F(),scope:F(),kind:F(),pathId:F().optional(),desired:U([`present`,`absent`]),action:U(xa),errorId:F().optional()}).loose(),Hge=B({kind:F(),satisfierIds:z(F()),agentIds:z(F()),pathId:F().optional(),blockedReason:F().optional()}).loose(),Uge=B({state:F(),strictness:z(U(ya)).optional()}).loose(),Wge=B({probes:B({env:U([`desktop`,`local-web`,`remote-web`]),satisfiers:H(F(),Uge)}).loose(),detection:B({detected:z(F()),probed:L()}).loose()}).loose();B({actions:z(Vge),conflicts:z(Hge),withheld:z(F()),snapshot:Wge}).loose(),B({entries:z(B({level:U([`info`,`warn`,`error`]),message:F().max(8192),event:F().optional(),fields:H(F(),R()).optional(),ts:I().optional(),sourceId:F().optional(),lineNumber:I().optional()}).loose()).max(100),droppedSinceLastFlush:I().int().min(0).optional()}).loose(),B({accepted:I().int().min(0)}).loose();const Gge=B({exact:F().min(1),prefix:F(),suffix:F(),start:I().int().nonnegative(),end:I().int().nonnegative()}),Kge=z(V([F(),I().int().nonnegative()])),qge=Wi(`kind`,[B({kind:W(`body`)}),B({kind:W(`property`),key:F().min(1),path:Kge.default([])})]).default({kind:`body`}),Jge=U([`anchored`,`orphaned`,`resolved`]),IJ=B({threadId:F().min(1),docName:F().min(1),target:qge,anchor:Gge.nullable(),state:Jge,queued:L(),latestComment:F(),createdBy:F().min(1),createdAt:I(),updatedAt:I().optional()}),LJ=B({docName:F(),instruction:F(),property:F().nullable(),passage:B({exact:F(),prefix:F(),suffix:F()}).nullable(),anchorLost:L(),passageRepeats:L()}).loose(),RJ=B({threadId:F(),ok:W(!0)}),zJ=B({threadId:F(),ok:W(!1),error:W(`not-found`)});B({threads:z(IJ)}).loose(),B({meta:IJ,orphaned:L()}).loose(),B({threadId:F()}).loose(),B({meta:IJ,payload:LJ}).loose(),B({results:z(V([RJ.extend({meta:IJ,payload:LJ}),zJ]))}).loose(),B({results:z(V([RJ.extend({meta:IJ}),zJ]))}).loose();const Yge=B({status:F().min(1),reason:F()}).loose();B({docName:F().min(1),content:F(),lifecycle:Yge.nullable()}).loose(),B({documents:z(B({kind:U([`document`,`asset`,`folder`,`file`]).default(`document`),docName:F().min(1).optional(),docExt:F().min(1).default(`.md`),size:I().int().nonnegative(),modified:F().min(1),isSymlink:L().default(!1),canonicalDocName:F().nullable().default(null),targetPath:F().nullable().default(null),path:F().min(1).optional(),assetExt:F().min(1).optional(),mediaKind:U([`image`,`video`,`audio`,`pdf`,`text`,`mermaid`,`excalidraw`]).nullable().optional(),referencedBy:z(F().min(1)).optional(),hasChildren:L().optional()}).loose().refine(e=>e.kind===`document`?e.docName!==void 0&&e.path===void 0&&e.assetExt===void 0&&e.mediaKind===void 0&&e.referencedBy===void 0&&e.hasChildren===void 0:e.kind===`folder`?e.docName===void 0&&e.path!==void 0&&e.assetExt===void 0&&e.mediaKind===void 0&&e.referencedBy===void 0:e.kind===`file`?e.path!==void 0&&e.mediaKind===void 0&&e.referencedBy===void 0&&e.hasChildren===void 0:e.path!==void 0&&e.assetExt!==void 0&&e.referencedBy!==void 0&&e.hasChildren===void 0,{message:`document/asset/folder/file kind must match its required fields (document → docName; asset → path+assetExt+referencedBy; folder → path only, no docName; file → path, no mediaKind/referencedBy/hasChildren)`})),truncated:L().optional()}).loose();const Xge=B({source:F().min(1),anchor:F().nullable(),title:F(),snippet:F().nullable()}).loose();B({docName:F().min(1),backlinks:z(Xge)}).loose(),B({counts:H(F().min(1),I().int().nonnegative())}).loose(),B({counts:H(F().min(1),I().int().nonnegative())}).loose();const Zge=Wi(`kind`,[B({kind:W(`doc`),docName:F().min(1),anchor:F().nullable(),title:F(),snippet:F().nullable()}).loose(),B({kind:W(`external`),url:F().min(1),title:F(),snippet:F().nullable()}).loose()]),Qge=B({role:F().min(1),sourceForm:F().min(1),targetKind:F().min(1),href:F(),resolvedTarget:F().nullable(),status:F().min(1),reason:F().nullable(),resolutionMethod:F().min(1),fallbackTarget:F().nullable().default(null),range:B({start:I().int().nonnegative(),end:I().int().nonnegative()}),line:I().int().nonnegative(),column:I().int().nonnegative(),definition:B({label:F(),line:I().int().nonnegative()}).nullable().default(null)}).loose();B({docName:F().min(1),forwardLinks:z(Zge),localTargets:z(Qge).optional()}).loose();const $ge=Wi(`kind`,[B({id:F().min(1),kind:W(`doc`),docName:F().min(1),anchor:F().nullable(),label:F(),cluster:F().nullable(),category:F().nullable(),tags:z(F()).nullable(),managed:L().optional()}).loose(),B({id:F().min(1),kind:W(`external`),url:F().min(1),label:F()}).loose()]),e_e=B({source:F().min(1),target:F().min(1)}).loose();B({nodes:z($ge),links:z(e_e)}).loose();const t_e=B({ts:I().int().min(0),url:F(),method:F(),ua:F().optional(),origin:F().optional(),referer:F().optional(),host:F().optional(),remote:F().optional(),secChUa:F().optional(),secChUaMobile:F().optional(),secChUaPlatform:F().optional(),secFetchSite:F().optional(),secFetchDest:F().optional(),secFetchMode:F().optional(),secFetchUser:F().optional()}).loose(),n_e=B({app:V([W(`cursor`),W(`codex`),W(`claude`),Pi()]),signals_fired:z(F())}).loose();B({entries:z(t_e),count:I().int().min(0),detection:n_e}).loose();const BJ=B({path:F().min(1),code:U([`M`,`A`,`D`,`R`,`C`,`U`,`T`,`?`,`!`,` `]),origPath:F().min(1).optional(),syncScoped:L(),open:Wi(`kind`,[B({kind:W(`doc`),docName:F().min(1)}),B({kind:W(`asset`),path:F().min(1)})]).optional()}).loose();B({branch:F().nullable(),detached:L(),upstream:F().nullable(),staged:z(BJ),notStaged:z(BJ),untracked:z(BJ),incoming:z(BJ),truncated:L(),readable:L().default(!0)}).loose();const r_e=U([`AWAITING_CHECKS`,`LOCKED`,`MERGEABLE`,`QUEUED`,`UNMERGEABLE`]),i_e=U([`BEHIND`,`BLOCKED`,`CLEAN`,`DIRTY`,`DRAFT`,`HAS_HOOKS`,`UNKNOWN`,`UNSTABLE`]),a_e=U([`APPROVED`,`CHANGES_REQUESTED`,`REVIEW_REQUIRED`]),o_e=U([`ERROR`,`EXPECTED`,`FAILURE`,`PENDING`,`SUCCESS`]),s_e=B({mergeQueue:B({position:I().int().nonnegative(),state:r_e.nullable().catch(null)}).nullable().catch(null),autoMerge:L(),mergeState:i_e.nullable().catch(null),reviewDecision:a_e.nullable().catch(null),checks:o_e.nullable().catch(null)}).loose(),c_e=B({kind:U([`pull`,`issue`]),repo:F().min(1),number:I().int().positive(),title:F(),author:F().nullable(),createdAt:F(),lifecycle:U([`open`,`draft`,`merged`,`closed`,`completed`,`not-planned`]),additions:I().int().nonnegative().optional(),deletions:I().int().nonnegative().optional(),status:s_e.optional()}).loose();B({url:F()}).loose(),Wi(`ok`,[B({ok:W(!0),preview:c_e}).loose(),B({ok:W(!1),reason:F()}).loose()]),B({writers:z(B({id:F().min(1),name:F().optional(),email:F().optional()}).loose()).optional(),summary:nB,...tB}).loose(),B({checkpointRef:F().min(1)}).loose();const l_e=B({v:I().int().optional(),id:F().min(1),name:F().min(1),colorSeed:F().optional(),docs:z(F()),summaries:z(F()).optional()}).loose();B({entries:z(B({sha:F().min(1),timestamp:F().min(1),author:F(),authorEmail:F(),type:U([`checkpoint`,`wip`,`upstream`,`park`]),message:F(),contributors:z(l_e),checkpoint:R().nullable(),parentSha:F().nullable().optional()}).loose()),total:I().int().nonnegative().optional(),truncated:L().optional(),hasMore:L().optional()}).loose(),B({sha:F().regex(/^[0-9a-f]{40}$/i),content:F(),timestamp:F(),author:F()}).loose(),B({contentDir:F().min(1),pathSeparator:U([`/`,`\\`]),symlinkResolved:L()}).loose(),z(Wi(`source`,[B({docName:F().min(1),timestamp:F().min(1),size:I().int().nonnegative(),source:W(`flat`)}).loose(),B({docName:F().min(1),timestamp:F().min(1),source:W(`timeline`),sha:F().min(1)}).loose()])).meta({description:"Flat array of rescue buffer entries; discriminated via `source`."});const u_e=B({domain:F().min(1),title:F().optional(),description:F().optional(),siteName:F().optional(),faviconDataUri:F().optional()}).loose();B({url:F()}).loose(),Wi(`ok`,[B({ok:W(!0),metadata:u_e}).loose(),B({ok:W(!1),reason:F()}).loose()]),B({orphans:z(B({docName:F().min(1),title:F()}).loose())}).loose(),B({hubs:z(B({docName:F().min(1),title:F(),count:I().int().nonnegative()}).loose())}).loose();const d_e=B({source:F().min(1),title:F(),snippet:F().nullable()}).loose();B({deadLinks:z(B({target:F().min(1),sources:z(d_e)}).loose())}).loose(),B({target:B({docName:F().min(1),title:F(),aliases:z(F())}).loose(),mentions:z(B({source:F().min(1),excerpt:F(),offset:I().int().nonnegative()}).loose()),truncated:L()}).loose(),B({projectPath:F().min(1)}).loose();const f_e=U([`not-a-git-worktree`,`init-failed`]);Wi(`ok`,[B({ok:W(!0),projectPath:F().min(1)}).loose(),B({ok:W(!1),reason:f_e,message:F().min(1)}).loose()]),B({host:F().min(1).optional()}).loose(),B({host:F().min(1).optional(),token:F().min(1)}).loose(),B({host:F(),login:F()}).loose(),B({key:F().min(1)}).loose(),B({keyPresent:L()}).loose();const p_e=U([`no_key`,`invalid_endpoint`,`rate_limit`,`timeout`,`http_error`,`network`,`dims_mismatch`,`malformed_response`]);Wi(`ok`,[B({ok:W(!0),endpoint:F().min(1),model:F().min(1),dimensions:I().int().positive()}).loose(),B({ok:W(!1),endpoint:F().min(1),model:F().min(1),reason:p_e,status:I().int().optional()}).loose()]),B({name:F().refine(e=>e.trim().length>0,{message:`name must be non-empty`}),email:F().refine(e=>e.trim().length>0,{message:`email must be non-empty`})}).loose(),B({authenticated:L()}).loose(),B({channel:U([`login`,`gh-login`]).default(`login`)}).loose(),B({}).loose();const m_e=B({stackIndex:I().int().min(0),ts:I().int().min(0),additions:I().int().min(0),deletions:I().int().min(0)}).loose(),h_e=B({docName:F().min(1),additionsTotal:I().int().min(0),deletionsTotal:I().int().min(0),lastTs:I().int().min(0),bursts:z(m_e)}).loose(),g_e=B({displayName:F().min(1),color:F().min(1),icon:F().optional(),connectionId:F().min(1)}).loose();B({sessionAlive:L(),agent:g_e.nullable(),files:z(h_e)}).loose(),B({diff:F(),before:F(),after:F(),properties:qz,generatedAt:I().int().min(0)}).loose(),B({}).loose(),B({}).loose(),B({}).loose(),B({}).loose(),B({}).loose(),B({}).loose();const __e=B({displayName:F().min(1),icon:F(),color:F().min(1),currentDoc:F().nullable(),mode:U([`idle`,`writing`]),ts:I().int().min(0)}).loose();B({presence:H(F().min(1),__e)}).loose();const v_e=B({sessionId:F().min(1),agentType:F().min(1),ts:I().int().min(0),insertedChars:I().int().min(0),deletedChars:I().int().min(0)}).loose();B({effects:z(B({"doc.name":F().min(1),entries:z(v_e)}).loose())}).loose(),B({decisions:z(B({ts:I().int().min(0),decision:F().min(1),kind:F().min(1),"doc.name":F().min(1),pathRole:F().min(1)}).loose())}).loose(),H(F().min(1),L()).meta({description:`Flat boolean record keyed by agent-scheme name (claude / codex / cursor). True = installed.`}),B({path:F().min(1,`path must be non-empty`)}).loose(),B({}).loose();const y_e=B({fromDocName:F().min(1),toDocName:F().min(1)}).loose(),b_e=B({fromPath:F().min(1),toPath:F().min(1)}).loose();B({}).loose(),B({path:F().min(1),...tB,summary:nB}).loose(),B({docName:F().min(1)}).loose(),B({path:F().min(1),...tB,summary:nB}).loose(),B({path:F().min(1)}).loose(),B({kind:U([`file`,`folder`]),path:F().min(1),...tB,summary:nB}).loose(),B({kind:U([`file`,`folder`]),path:F().min(1),duplicatedDocNames:z(F().min(1))}).loose(),B({pages:z(B({docName:F().min(1),title:F(),docExt:F().min(1),size:I().int().nonnegative(),modified:F().min(1),icon:F().min(1).max(2048).optional()}).loose())}).loose();const x_e=B({level:I().int().min(1).max(6),text:F(),slug:F()}).loose();B({docName:F().min(1),headings:z(x_e)}).loose();const S_e=B({docName:F().min(1),rewrites:I().int().nonnegative()}).loose();B({kind:U([`file`,`folder`,`asset`]),fromPath:F().min(1),toPath:F().min(1),...tB,summary:nB}).loose(),B({renamed:z(y_e),renamedAssets:z(b_e),rewrittenDocs:z(S_e).optional(),summary:bJ.optional()}).loose(),B({kind:U([`file`,`folder`,`asset`]),path:F().min(1),...tB}).loose(),B({deletedDocNames:z(F().min(1))}).loose(),B({kind:U([`file`,`folder`,`asset`]),path:F().min(1),...tB,summary:nB}).loose(),B({deletedDocNames:z(F().min(1))}).loose(),B({docName:F().min(1),commitSha:F().regex(/^[0-9a-f]{40}$/i,{message:`commitSha must be a 40-char git SHA`}),summary:nB,...tB}).loose(),B({restoredFrom:F().min(1),timestamp:F().min(1),summary:bJ.optional(),warnings:TJ.optional()}).loose();const C_e=/^#[0-9a-fA-F]{6}$/,w_e=B(Object.fromEntries(vl.map(e=>[e,F().regex(C_e,`must be a #rrggbb hex color`)]))),VJ=F().min(1).refine(Cl,{message:`must contain a non-whitespace character`}),HJ=B({name:VJ,author:VJ.optional(),variant:U([`dark`,`light`]),palette:w_e}).loose();B({name:F().min(1),scheme:HJ,stem:F().min(1).optional(),extension:U([`.yaml`,`.yml`]).optional()}).loose(),B({id:F().min(1),filename:F().min(1)}).loose(),B({id:F().min(1),scheme:HJ}).loose(),B({id:F().min(1),filename:F().min(1)}).loose(),Wi(`existed`,[B({existed:W(!1)}).loose(),B({existed:W(!0),filename:F().min(1),scheme:HJ}).loose()]),B({themes:z(Wi(`ok`,[B({ok:W(!0),id:F().min(1),filename:F().min(1),scheme:HJ}),B({ok:W(!1),filename:F().min(1),id:F().min(1).optional(),code:F().min(1),conflictingFilenames:z(F().min(1)).min(2).optional()})])),truncated:L()}).loose();const UJ=U(pt),T_e=U(mt),E_e=B({alwaysOn:I().int().nonnegative(),onTrigger:I().int().nonnegative(),onDemand:I().int().nonnegative()}).strict();B({tags:z(B({name:F().min(1),count:I().int().nonnegative(),isLeaf:L()}).loose())}).loose();const D_e=B({docName:F().min(1),title:F(),matchingTags:z(F().min(1)),snippet:F().nullable()}).loose();B({name:F().min(1),docs:z(D_e)}).loose(),B({folder:R(),frontmatter_local:H(F(),R()).nullable(),warnings:z(F()).optional().meta({description:"Non-fatal degradations of this response, one per entry; the field each affects is absent, null, or incomplete — the aligned `warningCodes` entry names which field and how."}),warningCodes:z(U([`symlink-refused`,`malformed-yaml`,`unverifiable`,`templates-symlink-refused`,`templates-unverifiable`])).optional().meta({description:"Machine-readable codes aligned 1:1 with `warnings`; switch on these, never on the English. `symlink-refused` / `malformed-yaml` / `unverifiable`: this folder's own `.ok/frontmatter.yml` (a symlink, malformed YAML, or an lstat failure) — `frontmatter_local` is null. `templates-symlink-refused` / `templates-unverifiable`: the `.ok/templates` directory on this folder, or a `.ok` or `.ok/templates` directory on an ancestor it inherits from — a symlink (wherever it points, dangling included), or a non-ENOTDIR `lstat` failure — `folder.templates_available` omits that directory's templates and may still list others. A non-directory `.ok` / `.ok/templates` (ENOTDIR) is treated as empty and yields no `templates-*` code. This folder's own symlinked `.ok` is a 400, never a warning."})}).loose(),B({path:F(),frontmatter:H(F(),R()).optional()}).loose(),B({applied:R()}).loose();const WJ=H(F(),R()).meta({description:`Free-form frontmatter map embedded in template payloads.`});B({template:B({name:F().min(1),folder:F(),scope:U([`local`,`inherited`]),path:F().min(1),frontmatter:WJ,body:F()}).strict()}).strict(),B({templates:z(B({name:F().min(1),title:F().optional(),description:F().optional(),path:F().min(1),source_folder:F()}).strict()),truncated:L()}).strict(),B({folder:F(),name:F(),body:F().optional(),frontmatter:WJ.optional(),...tB,summary:nB}).strict(),B({path:F().min(1),created:L(),warnings:z(F())}).strict(),B({sourcePath:F().min(1),targetFolder:F(),name:F().optional(),title:F().optional(),deleteSource:L().optional(),...tB,summary:nB}).strict(),B({path:F().min(1),created:L(),warnings:z(F())}).strict(),B({existed:L(),path:F().min(1)}).strict(),B({fromFolder:F(),fromName:F(),toFolder:F(),toName:F(),body:F().optional(),frontmatter:WJ.optional(),...tB,summary:nB}).strict(),B({from:F().min(1),to:F().min(1),committed:L()}).strict();const GJ=U(us),O_e=/^[a-z0-9-]+$/,KJ=B({name:F(),description:F(),metadata:B({pack:F()}).strict().optional()}).strict();B({skill:B({name:F().min(1),scope:GJ,path:F().min(1),frontmatter:KJ,body:F(),files:z(B({path:F().min(1),text:F().nullable()})).optional(),managed:L().optional()}).strict()}).strict();const k_e=B({source:F().min(1),publisher:F().optional(),skill:F().optional(),marketplaceUrl:F().optional(),importedAt:F().min(1),autoUpdate:L().optional()}).strict(),A_e=B({name:F().min(1),description:F().optional(),scope:GJ,path:F().min(1),canonicalPath:F().min(1).optional(),filePaths:z(F()).optional(),absolutePath:F().min(1).optional(),installed:L(),hosts:z(F()),hostQualifier:F().optional().meta({description:"Set on a GLOBAL entry that shares its name with a distinct-content bundle in another host dir AND is not the by-name default: the host id whose root holds THIS bundle. Doc-name builders append it (`__skill__/global/<name>@<host>`) so each same-named bundle keeps its own tab and its own write-back path; the default bundle keeps the stable unqualified name."}),driftPaths:z(F()).optional().meta({description:`Recorded locations whose on-disk form (copy vs symlink) no longer matches what OK last wrote there — evidence another tool rewrote the path.`}),hostAliases:H(F(),F()).optional().meta({description:`Host skills roots that are symlink ALIASES of another location (host id → base-relative target root). An aliased folder is a derived view — no menu row, never a write target; the host's icon rides the target root's row.`}),conflictHosts:z(F()).optional().meta({description:`Hosts whose dir holds a DIFFERENT same-name skill (fork/conflict) — occupied, not this skill.`}),symlinkedHosts:z(F()).optional(),installableEditors:z(F()).optional(),hubOffered:L().optional().meta({description:"Whether the vendor-neutral `.agents/skills` hub is a live destination at this scope on THIS machine — server-computed via the same predicate that filters the Folders surface, so the install menu and Settings cannot disagree. True when the project already uses the hub OR a host that reads it is installed (`HUB_READER_EDITORS`)."}),linkMode:L().optional(),customPlacements:z(B({path:F(),mode:U([`copy`,`link`])}).strict()).optional(),plugin:B({name:F().min(1),marketplace:F().min(1),provider:F().min(1),url:F().optional()}).strict().optional(),managed:L().optional(),origin:k_e.optional(),pack:F().optional(),modified:L().optional(),revertable:L().optional(),ignored:L().optional(),size:E_e.optional()}).strict();B({name:F().min(1),scope:GJ,apply:L().optional()}).strict(),B({line:F().min(1),gitignorePath:F().min(1),applied:L(),alreadyTracked:L().optional()}).strict(),B({skills:z(A_e),truncated:L()}).strict(),B({scope:GJ.default(`project`),name:F().meta({description:`Managed skill name to create or update.`}),body:F().optional(),frontmatter:KJ,...tB,summary:nB}).strict();const qJ=[`skill-name-vendor-word`,`skill-body-too-long`],JJ=z(U(qJ)).meta({description:"Machine-readable codes aligned 1:1 with `warnings` (`warnings[i]` is the display text for `warningCodes[i]`)."});B({path:F().min(1),created:L(),warnings:z(F()),warningCodes:JJ}).strict(),B({scope:GJ.default(`project`),name:F(),dryRun:L().optional(),setAutoUpdate:L().optional(),...tB,summary:nB}).strict(),B({name:F().min(1),updated:L(),source:F().min(1),localBody:F().optional(),upstreamBody:F().optional(),gitTracked:L().optional(),warnings:z(F()),warningCodes:JJ}).strict(),B({scope:GJ.default(`project`),name:F(),...tB,summary:nB}).strict(),B({name:F().min(1),baselineRef:F().min(1),restoredFiles:z(F()),warnings:z(F())}).strict();const YJ=`This member also carries the one bookkeeping failure that does not undo the operation: the content change landed, but a state file this server keeps beside it refused to be rewritten because it could not be read, so the install or import records still describe the old state until an operator repairs that file. Absent when there is nothing to report; a server that predates this member omits it, so treat its absence as no warning rather than as an error.`;B({existed:L(),path:F().min(1),warnings:z(F()).optional().meta({description:`Present when this delete removed a directory a retention record ties to a recovery copy an earlier failed move kept, whose source was never verified unchanged — either because this server verified the deleted directory against the copy that record describes, or because it could not read the directory and so could not confirm either way. Each entry says which of the two it is; neither claims more than the check established. ${YJ}`})}).strict(),B({scope:GJ.default(`project`),fromName:F(),toName:F(),body:F().optional(),frontmatter:KJ.optional(),...tB,summary:nB}).strict(),B({from:F().min(1),to:F().min(1),committed:L(),warnings:z(F()).optional().meta({description:`Present when the rename itself completed but something beside it did not. ${YJ}`})}).strict(),B({name:F(),toName:F().optional().meta({description:"Name for the skill at the destination scope; defaults to `name`. The SKILL.md `name` frontmatter is rewritten to match."}),fromScope:GJ,toScope:GJ,...tB,summary:nB}).strict(),B({scope:GJ,path:F().optional(),droppedLocations:z(F()).default([]).meta({description:"Locations the skill occupied at the source that were removed and not re-created at the destination: the `agents` hub and custom roots, which projection does not cover. Entries are install location ids, so they can be passed straight back as an install `add` list with `scope` set to the destination scope; custom roots resolve against that scope's base."}),warnings:z(F()).optional().meta({description:`Present when the move itself completed but something beside it did not. ${YJ}`})}).strict().meta({description:"Scope-move result. Rename paths deliberately do not emit authoring warnings, consistent with same-scope rename and duplicate. Content-authoring and import responses carry those warnings and their codes. The Skills Studio client parses `droppedLocations` off the wire but deliberately does not render it yet; how a human is told what was removed is an open product decision."}),B({scope:GJ,name:F(),toName:F(),...tB,summary:nB}).strict(),B({name:F().min(1)}).strict(),B({name:F(),home:F().min(1)}).strict(),B({docName:F().min(1)}).strict();const XJ=U([`reference`,`script`,`file`]);B({scope:GJ.default(`project`),name:F(),path:F().min(1),content:F(),...tB,summary:nB}).strict(),B({path:F().min(1),created:L(),kind:XJ,content:L()}).strict(),B({scope:GJ.default(`project`),name:F(),from:F().min(1),to:F().min(1),...tB,summary:nB}).strict(),B({from:F().min(1),to:F().min(1),fromDocName:F().optional(),toDocName:F().optional()}).strict(),B({path:F().min(1),kind:XJ,text:F()}).strict(),B({path:F().min(1),existed:L(),kind:XJ}).strict();const ZJ=V([T_e,W(`agents`)]),QJ=F().min(1).refine(e=>!e.startsWith(`/`)&&!e.startsWith(`~`)&&!/^[A-Za-z]:/.test(e),{error:`a custom root is base-relative (e.g. ".tim/skills"), not absolute or ~-prefixed`}).refine(e=>e.split(`/`).every(e=>e!==``&&e!==`.`&&e!==`..`),{error:`a custom root may not contain "..", "." or empty path segments`}).refine(e=>e.includes(`/`),{error:`a custom root is a path (e.g. ".tim/skills") — bare editor names are host ids`}),$J=V([ZJ,QJ]);B({scope:GJ.default(`project`),name:F(),targets:z(ZJ).optional().meta({description:'SET-EXACT install targets (editor ids, plus "agents" for the .agents hub — in-place skills only): the COMPLETE resulting host set. Omit to use project-configured editors; pass [] to uninstall everywhere. Stateless callers should prefer `add`/`remove`.'}),add:z($J).optional().meta({description:`Locations to ADD the skill to (everything else untouched). Editor ids fan out a managed copy/symlink; a custom root path (".tim/skills") places the bundle there.`}),remove:z($J).optional().meta({description:"Locations to REMOVE the skill from (lossless only — a hand-edited fork is refused, never deleted). The source cannot be removed; move it first with `source`."}),mode:U([`copy`,`link`]).optional().meta({description:`"link": one real folder (the source); every other location becomes a symlink to it. "copy": independent real folders, refreshed from the source until hand-edited (a hand-edit forks that copy). Converts existing locations losslessly. Omit to follow the form the skill already uses.`}),source:$J.optional().meta({description:`Move the skill's REAL folder to this location (the old source becomes a symlink to it — never a removal). Sticky across rescans.`}),linkMode:L().optional(),setSource:F().min(1).optional(),place:B({dir:F().min(1).meta({description:`Project-relative directory the bundle dir is created under (e.g. ".windsurf/skills").`}),mode:U([`copy`,`link`])}).strict().optional(),convert:B({target:$J.meta({description:`The installed location to convert — an editor id, "agents", or a recorded custom placement path.`}),mode:U([`copy`,`link`]).meta({description:`"link": replace this location with a symlink to the source. "copy": replace it with an independent real folder.`})}).strict().optional(),unplace:B({path:F().min(1).meta({description:`The recorded placement bundle path (e.g. ".windsurf/skills/my-skill").`})}).strict().optional(),...tB,summary:nB,fork:B({editor:F().min(1),action:U([`align`,`make-source`,`rename`]),toName:F().optional()}).strict().optional()}).strict().refine(e=>e.targets===void 0||e.add===void 0&&e.remove===void 0,{error:"`targets` is set-exact; `add`/`remove` are additive — use one style per call"}).refine(e=>e.fork===void 0||e.targets===void 0&&e.add===void 0&&e.remove===void 0&&e.source===void 0&&e.setSource===void 0,{error:"`fork` is its own operation — run it in a separate call"}).refine(e=>e.fork?.action!==`rename`||e.fork.toName!==void 0,{error:"`fork.rename` requires `toName`"}).refine(e=>e.source===void 0||e.add===void 0&&e.remove===void 0,{error:"a `source` move is its own operation — run it in a separate call from `add`/`remove`"}).refine(e=>[e.targets!==void 0||e.add!==void 0||e.remove!==void 0,e.place!==void 0,e.unplace!==void 0,e.convert!==void 0,e.source!==void 0||e.setSource!==void 0,e.fork!==void 0].filter(Boolean).length<=1,{error:"one operation per call — membership (`targets`/`add`/`remove`), `place`, `unplace`, `convert`, `source`, and `fork` are mutually exclusive"});const eY=[`no-targets`,`scripts-present`,`name-conflict`,`no-description`,`skill-fork-name-unpatched`,`place-path-invalid`,`place-fork-refused`,`links-not-permitted`];B({name:F().min(1).meta({description:`Managed skill name installed or uninstalled.`}),hosts:z(F()).meta({description:`Editor ids the skill is projected into after the operation; [] is expected after uninstall.`}),scripts:L().meta({description:`True when the skill ships executable scripts, projected but never run.`}),warnings:z(F()).meta({description:`Non-fatal install/uninstall warnings from target projection.`}),warningCodes:z(U(eY)).meta({description:"Machine-readable warning codes aligned with `warnings`."}),placedAt:F().optional(),sourceMovedTo:F().optional()}).strict(),B({scope:GJ.default(`project`),name:F().meta({description:`Managed skill name to uninstall without deleting source.`})}).strict(),B({name:F().min(1).meta({description:`Managed skill name requested for uninstall.`}),uninstalled:L().meta({description:`True when an install marker existed and was removed; false for an idempotent no-op.`})}).strict(),B({targets:z(UJ),configured:L(),folders:z(B({scope:GJ,host:F(),root:F(),state:U([`own`,`linked`,`linked-parent`,`absent`]),target:F().optional(),drift:W(!0).optional(),expected:F().optional()}).strict()).optional()}).strict();const tY=B({action:W(`link`),scope:GJ,root:F().min(1).meta({description:`The folder to link (e.g. ".codex/skills").`}),target:F().min(1).meta({description:`The root it merges into (e.g. ".agents/skills"). Required.`})}),nY=B({action:W(`unlink`),scope:GJ,root:F().min(1).meta({description:`The linked folder to materialize back.`}),exclude:z(F().min(1)).optional().meta({description:`Skill names to LEAVE OUT when materializing — the folder keeps every other skill it currently sees (as per-skill links) and stops auto-following the target root.`})}).strict(),rY=B({action:W(`add-root`),scope:GJ,root:QJ.meta({description:`New custom skills root to declare (base-relative, e.g. ".team/skills").`})}).strict(),j_e=Wi(`action`,[tY.extend({preview:L().optional().meta({description:`Return the merge plan only (moves, drops, removes, conflicts, strays) — nothing is written.`})}).strict(),nY,rY]);Wi(`action`,[tY.strict(),nY,rY]),B({folderAction:j_e}).strict();const M_e=B({moves:z(F()),drops:z(F()),removes:z(F()),replaces:z(F()),conflicts:z(F()),strays:z(F())}).strict();B({targets:z(UJ),reprojected:z(B({name:F(),hosts:z(F())}).strict()),bundleHosts:z(F()),removedFrom:z(F()),folder:B({moved:z(F()),dropped:z(F()),linked:z(F())}).strict().optional(),preview:M_e.optional()}).strict(),B({scope:GJ.default(`project`),name:F(),version:F().regex(/^[0-9a-f]{40}$/i),...tB,summary:nB}).strict(),B({name:F().min(1),version:F(),restoredFiles:z(F()),warnings:z(F())}).strict(),B({query:F().optional(),intent:U([`autocomplete`,`full_text`,`omnibar`]).optional(),ranking:U([`navigation`,`relevance`]).optional(),scopes:z(U([`page`,`folder`,`content`,`file`])).optional(),scope:F().optional(),limit:I().int().nonnegative().optional(),semantic:L().optional(),source:U([`omnibar`,`mcp`,`http`]).optional()}).loose();const N_e=B({kind:U([`page`,`folder`,`content`,`file`]),path:F().min(1),title:F(),score:I(),signals:H(F(),R()),snippet:F().optional()}).loose(),P_e=U([`applied`,`no_match`,`warming`,`incapable`,`provider_error`,`restart_required`,`query_too_short`]),iY=U([`warm`,`corpus`,`query`,`dimensions`,`configured_dimensions`]),aY=B({capable:L(),applied:L(),outcome:P_e,providerErrorReason:iY.nullable().optional().catch(null),coverage:B({embedded:I().int().nonnegative(),total:I().int().nonnegative()})}).loose();B({enabled:L(),keyPresent:L(),keyNotRequired:L(),keySource:U([`project`,`file`,`env`]).nullable(),keyHint:F().nullable(),ready:L(),capable:L(),providerError:L().optional(),providerErrorReason:iY.nullable().optional().catch(null),embedded:I().int().nonnegative(),total:I().int().nonnegative()}).loose(),B({query:F(),intent:U([`autocomplete`,`full_text`,`omnibar`]),results:z(N_e),elapsedMs:I().nonnegative(),semantic:aY.optional(),truncated:L().optional(),ready:L().optional()}).loose();const F_e=B({version:F().min(1),recordedAt:F().min(1)}).loose();B({currentVersion:F().min(1),targets:H(F(),F_e.nullable())}).loose(),B({scope:GJ.default(`project`),source:F().min(1).meta({description:`External skill source: full skills.sh skill-page URL (https://www.skills.sh/<owner>/<repo>/<skill>, or https://www.skills.sh/site/<hostname>/<skill> for a website catalog), GitHub owner/repo[/subpath], git URL, or local/file path.`}),skill:F().min(1).optional().meta({description:`Specific skill name to import from a multi-skill source.`}),install:L().optional().meta({description:`Pass false to import WITHOUT the default-editor auto-projection (the caller installs explicitly afterwards). Default true.`}),marketplace:L().optional().meta({description:"The source came from a skills.sh listing the user chose (the Explore tab), so the install is reported to skills.sh and counts toward that listing. Off by default: a hand-typed repo must not be announced to skills.sh. Honors the `telemetry.skillInstallReports.enabled` setting and DO_NOT_TRACK."}),...tB,summary:nB}).strict(),B({scope:GJ.default(`project`),source:F().min(1).meta({description:`External skill source: full skills.sh skill-page URL, GitHub owner/repo[/subpath], git URL, or local/file path.`}),skills:z(F().min(1)).min(1).max(100).meta({description:`Skill names to import from the source.`}),install:L().optional().meta({description:`Pass false to import WITHOUT the default-editor auto-projection. Default true.`}),marketplace:L().optional().meta({description:"The source came from a skills.sh listing the user chose (a marketplace plugin bundle), so the import is reported to skills.sh as one batched install event and counts toward that listing. Off by default: a hand-typed repo must not be announced to skills.sh. Honors the `telemetry.skillInstallReports.enabled` setting and DO_NOT_TRACK."}),...tB,summary:nB}).strict(),B({results:z(B({requested:F(),status:U([`imported`,`already-imported`,`not-found`,`failed`]),name:F().optional(),collisionRenamedFrom:F().optional(),warnings:z(F()),warningCodes:JJ,error:F().optional()}).loose()),imported:I(),alreadyImported:I(),failed:I()}).loose(),B({scope:GJ.default(`project`),names:z(F().min(1)).min(1).max(100).meta({description:`Managed skill names to refresh from their recorded upstreams.`}),...tB,summary:nB}).strict(),B({results:z(B({requested:F(),status:U([`updated`,`up-to-date`,`not-found`,`failed`]),source:F().optional(),warnings:z(F()),warningCodes:JJ,error:F().optional()}).loose()),updated:I(),upToDate:I(),failed:I()}).loose();const I_e=B({source:F(),ref:F().optional(),contentHash:F(),publisher:F().optional()}).loose();B({name:F().min(1).meta({description:`Managed skill name created or matched.`}),path:F().min(1).meta({description:`Store-relative path to the imported skill source.`}),created:L().meta({description:`True when this request created new source files.`}),alreadyImported:L().meta({description:`True when identical content was already present and no files changed.`}),collisionRenamedFrom:F().optional().meta({description:`Original source name when collision handling renamed the import.`}),provenance:I_e,warnings:z(F()).meta({description:`Non-fatal import warnings, such as skipped unsupported files.`}),warningCodes:JJ}).loose();const L_e=U([`files`,`backlinks`,`graph`,`sync-status`,`session-activity`,`tags`,`comments`,`lint-config`,`local-targets`]);B({v:W(1),ch:W(`server-info`),seq:I(),serverInstanceId:F().min(1),currentBranch:F().min(1).optional()}).loose(),B({v:W(1),ch:W(`branch-switched`),seq:I(),branch:F().min(1)}).loose(),B({v:W(1),ch:L_e,seq:I()}).loose(),B({v:W(1),ch:W(`disk-ack`),seq:I(),docName:F().min(1),sv:F().min(1)}).loose(),B({v:W(1),ch:W(`config-validation-rejected`),seq:I(),docName:F().min(1),error:Pu}).loose(),B({v:W(1),ch:W(`config-ignore-nested-error`),seq:I(),path:F().min(1),error:F().min(1)}).loose(),(()=>{let e=globalThis.Intl.Segmenter;return e?new e(`en`,{granularity:`word`}):null})();const oY=Symbol.for(`@inkeep/open-knowledge/skill-state-field-registry`),sY=globalThis;sY[oY]===void 0&&(sY[oY]=br());const cY=sY[oY],lY=Vi({version:F().regex(/^\d+\.\d+\.\d+(?:[-+][\w.-]+)?$/,`version must match /^\\d+\\.\\d+\\.\\d+(?:[-+][\\w.-]+)?$/`).register(cY,{description:`Recorded skill version for this target.`}),recordedAt:Vr().register(cY,{description:`ISO 8601 timestamp of the most recent successful write. Updated on every write, including reinstalls of the same version.`}),surface:U([`server-build-and-open`,`electron-build-and-open`,`cli-npx-skills-add`,`desktop-direct`,`cli-start`]).register(cY,{description:`Install-source surface that recorded this entry.`}).optional()}),R_e=Vi({enabled:L().register(cY,{description:`Whether this user-global skill bundle is opted in.`}),decidedAt:Vr().register(cY,{description:`ISO 8601 timestamp of the opt-in / opt-out decision.`})});Vi({schema:W(1).register(cY,{description:`Schema major version. Bumped only on breaking shape changes.`}),targets:Vi({"claude-cowork":lY.optional(),"cli-hosts":lY.optional()}).register(cY,{description:`Per-target install-state entries. Absent target = no recorded install.`}).default({}),bundles:H(F(),R_e).register(cY,{description:`Per-bundle opt-in decisions keyed by install name. Absent key = no recorded decision.`}).optional(),installsReported:z(F()).register(cY,{description:"Skill installs already reported to skills.sh from this machine, as `<owner/repo>#<skill>`. Append-only; presence suppresses a re-report."}).optional()});const z_e=[`auth-error`,`detached-head`,`dirty-tree`,`diverged-local-commits`,`external-changes-pending`,`git-index-locked`,`git-operation-in-progress`,`no-commits-yet`,`no-push-permission`,`non-content-merge-failure`,`protected-branch`,`unsafe-incoming-symlinks`],uY=e=>e*8+4;uY(92),uY(40),Array.from({length:256},(e,t)=>(t+256).toString(16).slice(1));const dY={fileSystem:`File System`,gitUpstream:`Git (upstream)`,service:`OpenKnowledge (service)`,generator:`OpenKnowledge (generated)`};function B_e(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=xu({file:r,source:n,doc:t,path:i});return{path:i,message:e.message,issueCode:e.code,...a===void 0?{}:{source:a}}})}}function fY(e,t,n){let r=`${e}.invalid-${t.replace(/[:.]/g,`-`)}`;try{return D(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 pY(e,t){let n=e;for(let e of t){if(typeof n!=`object`||!n||Array.isArray(n))return;n=Reflect.get(n,e)}return n}function V_e(e){let t=[],n=[[`maxBatchSize`,1,ou],[`maxBatchChars`,1,su],[`docTimeoutMs`,1,cu]];for(let[r,i,a]of n){let n=[`search`,`semantic`,r],o=pY(e.rawConfig,n),s=e.config.search.semantic[r];if(o===void 0||o===s)continue;let c=`Expected an integer between ${i} and ${a}; using default ${s}.`,l=xu({file:e.absPath,source:e.source,doc:e.doc,path:n});t.push({path:n,message:c,...l===void 0?{}:{source:{file:l.file,line:l.line,column:l.column}}})}return t.length>0?[{code:`VALUE_FALLBACK`,issues:t}]:[]}function H_e(e){let t=pY(e.rawConfig,[`git`,`hosts`]);if(t===void 0)return[];let n=zc.safeParse(t);return n.success?[]:[{code:`VALUE_FALLBACK`,issues:n.error.issues.map(t=>{let n=[`git`,`hosts`,...t.path.map(String)],r=xu({file:e.absPath,source:e.source,doc:e.doc,path:n});return{path:n,message:`${t.message}; ignoring this git-host declaration.`,...r===void 0?{}:{source:{file:r.file,line:r.line,column:r.column}}}})}]}function U_e(e){let t=pY(e.rawConfig,[`autolinks`]);if(t===void 0)return[];let n=Jl.safeParse(t);return n.success?[]:[{code:`VALUE_FALLBACK`,issues:n.error.issues.map(t=>{let n=[`autolinks`,...t.path.map(String)],r=xu({file:e.absPath,source:e.source,doc:e.doc,path:n});return{path:n,message:t.path.length===0?`${t.message}; ignoring autolinks.`:`${t.message}; ignoring this autolink entry.`,...r===void 0?{}:{source:{file:r.file,line:r.line,column:r.column}}}})}]}function mY(e){let{absPath:t,sideline:n=!0,timestamp:r=new Date().toISOString()}=e,i=e.warn??(e=>console.warn(e)),a=mu.parse({});if(!g(t))return{valid:!0,value:a,source:void 0,diagnostics:[]};let o;try{o=S(t,`utf-8`)}catch(e){let n=e instanceof Error?e.message:String(e);i(`[config] Could not read ${t}: ${n}. Using schema defaults.`);let r={code:`UNREADABLE`,detail:n};return{valid:!1,value:a,error:r,diagnostics:[{...r}]}}let s=(0,rs.parseDocument)(o);if(s.errors.length>0){let e=s.errors.map(e=>e.message).join(`; `);i(`[config] ${t} contains invalid YAML (${e}). Using schema defaults.`+(n?``:` Pass-through mode: file left in place.`));let o=n?fY(t,r,i):void 0,c={code:`YAML_PARSE`,detail:e};return{valid:!1,value:a,error:c,diagnostics:[{...c}],...o===void 0?{}:{sidelinedTo:o}}}let c=s.toJSON()??{},l=Uu({value:c,file:t,source:o,doc:s}),u=l.length>0?Gu(c):c,d=[...H_e({rawConfig:u,doc:s,source:o,absPath:t}),...U_e({rawConfig:u,doc:s,source:o,absPath:t})];for(let e of d)for(let n of e.issues)i(`[config] ${t} ${n.path.join(`.`)}: ${n.message}`);let f=mu.safeParse(u);if(!f.success){let e=B_e(f,s,o,t),c=mu.shape.git.safeParse(pY(u,[`git`])).data??a.git,p=Object.keys(c.hosts).length>0?`Using schema defaults while preserving valid git-host declarations.`:`Using schema defaults.`;i(`[config] ${t} fails schema validation (${f.error.issues.length} issue(s)). ${p}`+(n?``:` Pass-through mode: file left in place.`));let m=n?fY(t,r,i):void 0,h=[...l,...d,...Fu(e)&&e.code===`SCHEMA_INVALID`?[{...e}]:[]];return{valid:!1,value:{...a,git:c},error:e,diagnostics:h,...m===void 0?{}:{sidelinedTo:m}}}let p=[...l,...d,...V_e({rawConfig:u,config:f.data,doc:s,source:o,absPath:t})];return{valid:!0,value:f.data,source:t,diagnostics:p}}function hY(e=ve()){return A(e,ot().userHomeDirName)}const gY=`.tmp.`,_Y=[8,4,4,4,12];function W_e(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}const G_e=_Y.map(e=>`[0-9a-f]`.repeat(e)).join(`-`),K_e=_Y.map(e=>`[0-9a-f]{${e}}`).join(`-`),q_e=`*${gY}${G_e}`;RegExp(`${W_e(gY)}${K_e}$`);function J_e(e){return`${e}${gY}${je()}`}function Y_e(e){try{let t=O(e),n=`${oe(e)}${gY}`,r=Date.now()-3e4;for(let e of w(t)){if(!e.startsWith(n))continue;let i=A(t,e);try{ne(i).mtimeMs<r&&re(i)}catch{}}}catch{}}function vY(e,t,n={}){Y_e(e);let r=J_e(e);try{ie(r,t,{encoding:`utf-8`,mode:n.mode??420}),D(r,e)}catch(e){try{re(r)}catch{}throw e}}var yY=class extends Error{code=`LOCK_TIMEOUT`;lockPath;timeoutMs;constructor(e,t){super(`Could not acquire file lock at ${e} within ${t}ms`),this.name=`FileLockTimeoutError`,this.lockPath=e,this.timeoutMs=t}};async function X_e(e,t,n={}){let r=n.timeoutMs??5e3,i=n.retryIntervalMs??25,a=r*2,o=Date.now()+r,s=!0;for(;;){if(!s&&Date.now()>=o)throw new yY(e,r);s=!1;let c;try{c=b(e,`wx`,384)}catch(t){if(t.code!==`EEXIST`)throw t;let s;try{let t=ne(e);s=Date.now()-t.mtimeMs}catch{continue}let c=!1;if(s>a){n.onWarn?.(`cleared stale file lock`,{lockPath:e,ageMs:s,staleThresholdMs:a});try{re(e),c=!0}catch{}}if(c)continue;if(Date.now()>=o)throw new yY(e,r);await Zu(i);continue}try{return await t()}finally{try{f(c)}catch{}try{re(e)}catch{}}}}function Z_e(e){let t=Date.now()+e;for(;Date.now()<t;);}function bY(e,t,n={}){let r=n.timeoutMs??5e3,i=n.retryIntervalMs??25,a=r*2,o=Date.now()+r,s=!0;for(;;){if(!s&&Date.now()>=o)throw new yY(e,r);s=!1;let c;try{c=b(e,`wx`,384)}catch(t){if(t.code!==`EEXIST`)throw t;let s;try{let t=ne(e);s=Date.now()-t.mtimeMs}catch{continue}let c=!1;if(s>a){n.onWarn?.(`cleared stale file lock`,{lockPath:e,ageMs:s,staleThresholdMs:a});try{re(e),c=!0}catch{}}if(c)continue;if(Date.now()>=o)throw new yY(e,r);Z_e(i);continue}try{return t()}finally{try{f(c)}catch{}try{re(e)}catch{}}}}const xY=`config.yml`;function SY(e,t,n){if(e===`user`)return M(hY(n??ve()),`global.yml`);let r=k(t)?t:M(t);return e===`project-local`?M(r,`.ok`,to,xY):M(r,`.ok`,xY)}const Q_e=[`LC_ALL`,`LC_MESSAGES`,`LANG`];function CY(e){let t=e.trim().split(`@`)[0].split(`.`)[0];return t===``||t===`C`||t===`POSIX`?null:Yu(t.replaceAll(`_`,`-`))}function $_e(e){for(let t of Q_e){let n=e[t]?.trim();if(n!==void 0&&n!==``)return CY(n)}return null}function eve(e){let t=e.OK_LANG?.trim();if(t!==void 0&&t!==``)return Yu(t)??void 0}function tve(e=process.env){let t=eve(e),n=$_e(e);if(n===null)return{override:t,preferenceList:[]};let r=[],i=e.LANGUAGE;if(i!==void 0)for(let e of i.split(`:`)){let t=CY(e);t!==null&&r.push(t)}return{override:t,preferenceList:[...r,n]}}function wY(){return oo(ro)}function TY(){return ot().keyringService}function EY(e){try{e()}catch{}}var nve=class{backend=`keyring`;onKeychainRead;constructor(e){this.onKeychainRead=e}async get(e){let{Entry:t}=await import(`@napi-rs/keyring`),n;try{n=new t(TY(),e).getPassword()}catch(t){return EY(()=>this.onKeychainRead?.({kind:`read-error`,host:e,error:t instanceof Error?t.name:`unknown`})),null}if(n==null)return EY(()=>this.onKeychainRead?.({kind:`absent`,host:e})),null;try{return JSON.parse(n)}catch{return EY(()=>this.onKeychainRead?.({kind:`corrupt-entry`,host:e,error:`corrupt-entry`})),null}}async set(e,t,n,r){let{Entry:i}=await import(`@napi-rs/keyring`),a=new i(TY(),e),o={login:t,token:n,...r};a.setPassword(JSON.stringify(o))}async clear(e){let{Entry:t}=await import(`@napi-rs/keyring`);try{new t(TY(),e).deletePassword()}catch{}}},DY=class{backend=`file`;authFile;constructor(e){this.authFile=e??A(hY(),`auth.yml`)}read(){if(!g(this.authFile))return{};try{let e=S(this.authFile,`utf-8`);return(0,rs.parse)(e)??{}}catch(e){let t=e instanceof Error?e.message:`unknown error`;return process.stderr.write(`[auth] Failed to parse ${this.authFile}: ${t}. Starting with empty credentials.\n`),{}}}write(e){let t=O(this.authFile);g(t)||v(t,{recursive:!0,mode:448}),vY(this.authFile,(0,rs.stringify)(e),{mode:384})}async get(e){return this.read()[e]??null}async set(e,t,n,r){let i=this.read();i[e]={login:t,token:n,...r},this.write(i)}async clear(e){let t=this.read();delete t[e],this.write(t)}},rve=class{backend=`keyring`;keychain;file;constructor(e,t){this.keychain=e,this.file=t}async get(e){let t=await this.keychain.get(e);if(t!=null)return t;let n=await this.file.get(e);if(n==null)return null;try{await this.keychain.set(e,n.login,n.token,{gitProtocol:n.gitProtocol,name:n.name,email:n.email}),await this.file.clear(e),process.stderr.write(`[auth] migrated ${e} credential from ${wY()} to the OS keychain\n`)}catch{}return n}set(e,t,n,r){return this.keychain.set(e,t,n,r)}async clear(e){await this.keychain.clear(e),await this.file.get(e)!=null&&await this.file.clear(e)}};async function OY(e,t){try{let{Entry:n}=await import(`@napi-rs/keyring`);return new n(TY(),`__probe__`),process.stderr.write(`[auth] token storage: OS keychain
|
|
422
422
|
`),EY(()=>t?.onBackendSelected?.({backend:`keyring`})),new rve(new nve(t?.onKeychainRead),new DY(e))}catch(n){let r=n instanceof Error?`${n.name}: ${n.message}`:String(n);return process.stderr.write(`[auth] token storage: file (${wY()}) — OS keychain unavailable: ${r}\n`),EY(()=>t?.onBackendSelected?.({backend:`file`,reason:r})),new DY(e)}}function ive(e){let t=null;return function(){if(t)return t;let n=2e3;return t=(async()=>{let t=null,r=new Promise(r=>{t=setTimeout(()=>{process.stderr.write(`[auth] token storage: keyring init exceeded ${n}ms; falling back to file (${wY()})\n`),r(new DY(e))},n)});try{return await Promise.race([OY(e),r])}catch{return new DY(e)}finally{t!==null&&clearTimeout(t)}})(),t}}function ave(e){let t=ive(e);return{async get(e){let n=await(await t()).get(e);return n===null?null:{token:n.token,login:n.login}}}}
|
|
423
423
|
/*!
|
|
424
424
|
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
@@ -1116,7 +1116,7 @@ caused by: `+i(o,t)):a},a=e=>i(e,new Set),o=(e,t,i)=>{if(!n(e))return``;let a=i?
|
|
|
1116
1116
|
`),[`Get the full browser URL for this project or a document/folder/skill, or an absolute markdown file outside the project. Opening is demand: auto-starts OK under the normal OK_MCP_AUTOSTART gate and waits briefly for UI; cold calls can take seconds. Other tools return route-only previewUrl paths; use this tool for an openable URL, never guess ports or hunt via ok ps/status.`,`Choose one: document (extension-less), folder (trailing-slash route), skill:{name,scope?} (project default), or file (absolute .md/.mdx in a loose-file/worktree session). file ignores cwd; other targets use current project. Omit targets for UI root.`,`When YOUR host opens URLs, navigate its embedded browser to url; Claude Code Desktop uses preview_start({url}) then navigate({url}). Only a stdio host without a browser tool should open the URL in the system browser. A CLI without a browser can use ok open <doc> for OK Desktop. This tool forces browser access even when Desktop is installed.`,`INSIDE OK's terminal/agent panel, use returned okOpenCommand instead; never paste url in the answer. If no UI is reachable, returns url:null, baseUrl:null, running:false, autoOpen plus state-specific recovery text (autostart disabled, no spawn authority or UI timeout). Follow it.`].join(`
|
|
1117
1117
|
`),F().optional().describe(`Extension-less doc path to resolve a preview URL for (e.g. "specs/foo/SPEC"). Omit to get the UI root URL.`),F().min(1).optional().describe('Folder path to resolve a folder-route preview URL for (e.g. "specs/foo"); returns the `…/#/<folder>/` route. Mutually exclusive with `document`.'),B({name:F().min(1).regex(O_e,`Skill name must be lowercase letters, digits, and hyphens only.`).describe(`Skill name (the bundle-dir identity, wherever the skill lives).`),scope:U(us).optional().describe("Skill scope; defaults to `project`.")}).optional().describe("Skill to resolve an editor preview URL for; returns the `…/#/__skill__/<scope>/<name>` route. Mutually exclusive with `document`/`folder`/`file`."),F().optional().describe("Absolute path to a single markdown file to open, including one OUTSIDE any Open Knowledge project. Resolves to the running single-file (or worktree) session whose content directory contains it and returns that session’s `url`. Mutually exclusive with `document` / `folder` / `skill`. When `file` is set, `cwd` is ignored."),F().optional().describe(C5),T5({url:F().nullable().describe("Browser-reachable URL — the UI base joined with the doc route when `document` is given, else the UI root. `null` when no UI is running."),baseUrl:F().nullable().describe("Browser-reachable origin of the running UI (e.g. `http://localhost:5173`). `null` when no UI is running."),running:L().describe(`Whether a UI is running for the project.`),autoOpen:L().describe("User-scoped preview-auto-open preference (`appearance.preview.autoOpen`). When `true`, the agent should route the preview using capability-based routing (in-app browser if available, system browser as fallback). When `false`, the user is managing their own preview view (OK Desktop window, a browser tab they opened, etc.) — the agent must NOT open or refresh any preview UI, and should surface this URL only on direct user ask. Resolved fresh on every call; defaults to `true`."),okOpenCommand:F().nullable().optional().describe("Machine-readable form of the hosted-agent steer: when the calling agent runs inside an OpenKnowledge surface (the desktop app’s built-in terminal, or its in-app agent panel) AND a doc/folder/skill target was given, the exact `ok open …` command to run to bring it up for the user. Run it INSTEAD of navigating `url`, and do not paste `url` into your reply — the user is already in the app it points at. `null`/absent in every other context (navigate `url` per your host instead).")}),B({version:F().describe("40-char commit SHA for this entry — pass to `restore_version({ document, version })`."),timestamp:F().describe(`ISO timestamp of the entry.`),author:F().describe(`Author display name.`),authorEmail:F().describe(`Author email.`),kind:U([`checkpoint`,`wip`,`upstream`]).describe(`Entry kind: checkpoint / wip / upstream.`),message:F().describe(`Commit subject (the checkpoint summary, when one was set).`),contributors:vke.describe(`Per-contributor records parsed from the commit (writer id, name, docs, summaries).`),checkpoint:R().nullable().describe(`Checkpoint metadata when this entry is a checkpoint, else null.`)}),[`Read version history: pass exactly one document, folder or skill. Requires the Hocuspocus server. Returns shadow-repo entries newest first; version is a 40-char SHA for restore_version({document,version}) or restore_version({skill,version}).`,`document accepts optional .md/.mdx. folder lists attributed template/frontmatter activity; empty string is project root. skill is a project-scope name; global skills are unversioned. Optional branch (current default), limit (50 default, 200 max), offset (0), kind (checkpoint/upstream/wip), author and excludeAuthor (name/email).`].join(`
|
|
1118
1118
|
`),[...qJ,...eY],[`Import an external agentskills.io/skills.sh skill as managed content. Requires the Hocuspocus server. source accepts a full skills.sh page URL (including website catalogs), owner/repo[/subpath], git URL, or local/file:// path. skill picks one from a multi-skill source. scope: project (default, versioned/shared) or global (user-wide, unversioned).`,`Writes the .agents/skills/<name>/ hub with provenance in .ok/skills-lock.json. Scripts are NEVER executed. add selects editor locations; import always places the skill somewhere. Use install later to change placement/form/source. Name collisions use <name>-imported, never overwrite; identical content-hash re-import is a no-op.`].join(`
|
|
1119
|
-
`),new Set(eY),["Manage where a SKILL is available: `{name, add?, remove?, convert?, mode?, source?, scope?}` or `{skillFolders: {...}}` alone. Requires the Hocuspocus server. One real source folder plus managed copies/symlinks; the source still loads with no extra locations. Use delete to remove the skill everywhere.",`name is the bundle identity: lowercase letters/digits/hyphens, ≤64 chars. Locations: claude/cursor/codex/copilot/opencode/pi, agents (.agents/skills), or custom root containing '/' such as .team/skills. Custom roots are project-relative, home-relative at global scope. scope: project (default, shared via git) or global (user-wide).`,`add/remove change membership; omitting both installs to configured editors. remove cannot remove the source; folder aliases unfollow minus this skill and keep others. Differing copies are preserved; editor removal may succeed and leave them in place.`,`mode: link = live symlink for source updates; copy = separate folder, refreshed on watcher/startup sync while unedited. Hand-edited copies fork; differing copies are preserved and cannot be converted. Requires add or convert; affects named locations only, no skill-wide default. Omit mode on add to inherit form. convert requires mode and changes form without membership; name all locations for uniformity.`,`source moves the real folder; its old location becomes a symlink. Run alone, not with add/remove. Source SKILL.md with conflict markers, invalid/missing frontmatter, XML in name/description or reserved open-knowledge* names is refused before projection.`,`skillFolders runs alone without name. link: {action:'link', scope, root, target}; target required, merge then symlink root; equal entries deduplicate, differing skills abort, interrupted merges can rerun. unlink: {action:'unlink', scope, root, exclude?}; makes a real directory of per-skill symlinks, excluding named skills and retaining others. add-root: {action:'add-root', scope, root}; declares a custom root for install/link.`].join(`
|
|
1119
|
+
`),new Set(eY),["Manage where a SKILL is available: `{name, add?, remove?, convert?, mode?, source?, scope?}` or `{skillFolders: {...}}` alone. Requires the Hocuspocus server. One real source folder plus managed copies/symlinks; the source still loads with no extra locations. Use delete to remove the skill everywhere.",`name is the bundle identity: lowercase letters/digits/hyphens, ≤64 chars. Locations: claude/cursor/codex/copilot/opencode/pi, agents (.agents/skills), or custom root containing '/' such as .team/skills. Custom roots are project-relative, home-relative at global scope. scope: project (default, shared via git) or global (user-wide).`,`add/remove change membership; omitting both installs to configured editors. remove cannot remove the source; folder aliases unfollow minus this skill and keep others. Differing copies are preserved; editor removal may succeed and leave them in place.`,`mode: link = live symlink for source updates (copy where the OS refuses symlinks); copy = separate folder, refreshed on watcher/startup sync while unedited. Hand-edited copies fork; differing copies are preserved and cannot be converted. Requires add or convert; affects named locations only, no skill-wide default. Omit mode on add to inherit form. convert requires mode and changes form without membership; name all locations for uniformity.`,`source moves the real folder; its old location becomes a symlink. Run alone, not with add/remove. Source SKILL.md with conflict markers, invalid/missing frontmatter, XML in name/description or reserved open-knowledge* names is refused before projection.`,`skillFolders runs alone without name. link: {action:'link', scope, root, target}; target required, merge then symlink root; equal entries deduplicate, differing skills abort, interrupted merges can rerun. unlink: {action:'unlink', scope, root, exclude?}; makes a real directory of per-skill symlinks, excluding named skills and retaining others. add-root: {action:'add-root', scope, root}; declares a custom root for install/link.`].join(`
|
|
1120
1120
|
`),[`Read the wiki-link graph. Requires the Hocuspocus server. kind is one value or an array; results merge, failures go in errors. Use audit for validation.`,"`backlinks`/`forward`/`suggest` require document. suggest finds unlinked prose mentions; excerpt is normalized context, NOT edit-ready text. Re-read with exec, locate the real text using offset, then edit into a wiki-link.","`dead` lists raw unresolved internal targets; sourceDocuments optionally filters with OR semantics. Includes skill docs and lowercase log.md/log.mdx: inspect deliberately, never use as a repair queue or rewrite existing log entries to clear findings.","`orphans` finds disconnected pages; mode incoming/outgoing/both. `hubs` lists most-linked pages; limit defaults 20."].join(`
|
|
1121
1121
|
`),["Lint markdown and optionally auto-fix. Requires the Hocuspocus server. `document` selects one extension-less doc and overrides path. Otherwise scan all in-scope .md/.mdx; path narrows to file/folder. `fix: true` requires document and applies fixable rules through the live collaborative doc with attribution. Use edit/write for remaining findings; shell ok lint --fix is the unattributed headless/CI path.","ran lists selected `markdownlint`, `frontmatter` and document-level `okf` families. A family absent from `ran` was not checked. Project-tree OKF checks and link validation run only through audit.",`Findings carry source, code, message, 0-based LSP range and severity; only problematic files are listed. Counts reflect the full scan. Project output is capped at 10 files × 10 diagnostics each and project-wide at 10 warnings; omittedWarningCount reports dropped warnings. Narrow path reduces competing files; per-file caps still apply. Follow truncation recovery text.`,`Configure lint in Settings → Plugins and native .markdownlint.* rules.`].join(`
|
|
1122
1122
|
`),[`For .md/.mdx inspection before or after a move in a project with .ok/, use exec; native Read/Grep/Glob omit wiki context.`,"Move/rename a document, folder or asset with `{from, to}`, a template with `{template: {from, to}}`, or a skill with `{skill: {from, to, scope?, toScope?}}`. Choose one form. Requires the Hocuspocus server. Document/folder/asset kind is auto-detected.",`Paths: docs accept optional .md/.mdx; folders are relative with no leading/trailing slash; assets include the extension. Templates use '<folder>/<name>'; inherited templates cannot move (move their local copy or owning folder). Template moves rewrite no inbound links.`,`Links to the moved document keep pointing to it. The old path stops existing; do not leave a redirect or stub.`,`Managed moves preserve wiki-link targets and rewrite supported inline Markdown links; renamed assets are reported.`,`Skills: scope defaults project; global means your home. Within one scope, rename keeps SKILL.md name in sync. A differing toScope moves between project/global: history does not transfer; supported editor locations are re-projected. Other locations are dropped; on SUCCESS only, use droppedLocations and the response to reinstall at the destination.`,`Cross-scope failures can leave partial state. Before retrying or reinstalling, read moveState and recovery text regardless of status. Never remove either copy without comparing source/destination when the outcome is missing or inconsistent.`,`Optional summary: one-line outcome ≤80 chars. If omitted, defaults to "Renamed X → Y". Avoid secrets or PII; persisted to git history. Invalid/excluded paths, missing sources and existing destinations are refused; collisions report colliding[].`].join(`
|
|
@@ -1537,6 +1537,6 @@ GFS4: `),console.error(e)}),r[c]||(d(r,global[c]||[]),r.close=(function(e){funct
|
|
|
1537
1537
|
`);ie(e,o)}function M9(e,t){let n=S(e,`utf-8`);if(n.trim().length!==0)try{let r=A9(JSON.parse(n),t),i=n.endsWith(`
|
|
1538
1538
|
`)?`
|
|
1539
1539
|
`:``;ie(e,`${JSON.stringify(r,null,2)}${i}`)}catch{let r=k9(n,t.contentDir);r!==n&&ie(e,r)}}function N9(e,t){let n=S(e,`utf-8`),r=k9(n,t.contentDir);r!==n&&ie(e,r)}function P9(e){try{return w(e,{withFileTypes:!0}).filter(e=>e.isFile()).map(t=>A(e,t.name))}catch{return[]}}const rMe=new Set([`agent-presence.json`,`agent-effects.json`,`runtime.json`]);function F9(e){return/\.log\.\d+$/.test(e)}function iMe(e){return e.endsWith(`.jsonl`)||e.endsWith(`.log`)||F9(e)}const aMe=[`telemetry`,`logs`,`process`,`diagnostic-reports`];function oMe(e){let t={contentDir:e.contentDir};for(let n of aMe)for(let r of P9(A(e.stagingDir,n)))iMe(r)?j9(r,t):r.endsWith(`.json`)?M9(r,t):N9(r,t);for(let n of P9(A(e.stagingDir,`state`))){let e=oe(n);n.endsWith(`.jsonl`)?j9(n,t):rMe.has(e)?M9(n,t):N9(n,t)}}const I9=[`.ok`,`local`,`telemetry`],L9=[`.ok`,`local`,`logs`],R9=[`.ok`,`local`,`loss-capture`],z9=`spans-current.jsonl`,B9=`spans-prev.jsonl`,V9=`server-current.jsonl`,H9=`server-prev.jsonl`,U9=`loss-current.jsonl`,W9=`loss-prev.jsonl`;function sMe(e){return A(e,...I9,z9)}function cMe(e){return A(e,...I9,B9)}function lMe(e){return A(e,...L9,V9)}function uMe(e){return A(e,...L9,H9)}function dMe(e){return A(e,...R9,U9)}function fMe(e){return A(e,...R9,W9)}const G9=1e3;async function pMe(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/agent-presence`,{signal:AbortSignal.timeout(G9)});return t.ok?await t.text():null}catch{return null}}async function mMe(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/agent-effects`,{signal:AbortSignal.timeout(G9)});return t.ok?await t.text():null}catch{return null}}async function hMe(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/watcher-recent`,{signal:AbortSignal.timeout(G9)});return t.ok?await t.text():null}catch{return null}}function gMe(e){try{let t=JSON.parse(e);if(typeof t!=`object`||!t)return null;let n=t.decisions;return Array.isArray(n)?n.length===0?``:`${n.map(e=>JSON.stringify(e)).join(`
|
|
1540
|
-
`)}\n`:null}catch{return null}}function _Me(e){let t=A(e,`.git`,`ok`);if(!g(t))return null;let n=l(`git`,[`-C`,t,`log`,`--oneline`,`-50`],N8({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function vMe(e){let t=A(e,`.git`,`ok`);if(!g(t))return null;let n=l(`git`,[`-C`,t,`for-each-ref`,`--sort=-creatordate`,`--count=50`,`--format=%(refname)%09%(creatordate:iso-strict)%09%(contents:subject)`,`refs/checkpoints/`],N8({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function K9(){let e=process.env.OK_DESKTOP_VERSION,t=process.env.OK_DESKTOP_PACKAGED,n=process.env.OK_DESKTOP_CHANNEL;return e===void 0||t===void 0||n===void 0?null:{electronVersion:e,packaged:t===`1`||t.toLowerCase()===`true`,channel:n}}function yMe(){return{nodeVersion:process.version,platform:be(),arch:he()}}function bMe(){return process.env.OTEL_SDK_DISABLED===`false`}function q9(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function J9(e){if(!g(e))return{};let t;try{t=(0,rs.parse)(S(e,`utf-8`))}catch(t){return console.warn(`[ok diagnose bundle] failed to parse ${e} for manifest config; manifest will report schema defaults. Reason: ${t instanceof Error?t.message:String(t)}`),{}}if(!q9(t))return{};let n=t.telemetry;if(!q9(n))return{};let r=n.localSink;return q9(r)?r:{}}function Y9(e){return typeof e==`boolean`?e:void 0}function xMe(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:void 0}function X9(e){if(q9(e))return xMe(e.maxBytes)}function SMe(e){let t=J9(SY(`project`,e)),n=J9(SY(`project-local`,e));return{enabled:Y9(n.enabled)??Y9(t.enabled)??!0,spansMaxBytes:X9(n.spans)??X9(t.spans)??52428800,logsMaxBytes:X9(n.logs)??X9(t.logs)??26214400}}function CMe(e){return Ae(`sha256`).update(e).digest(`hex`)}function wMe(e){let t=S(e),n=0;for(let e=0;e<t.length;e++)t[e]===10&&n++;return n}const TMe=[`"doc.name"`,`"docName"`];function EMe(e){let t=S(e,`utf-8`),n=0;for(let e of TMe){let r=t.indexOf(e);for(;r!==-1;)n++,r=t.indexOf(e,r+e.length)}return n}function Z9(e,t){if(!g(e))return!1;try{return v(O(t),{recursive:!0}),e.endsWith(`.ips`)?ie(t,C7(S(e,`utf-8`))):m(e,t),!0}catch{return!1}}function Q9(e){let t=[],n=e=>{let r=w(e,{withFileTypes:!0});for(let i of r){let r=A(e,i.name);i.isDirectory()?n(r):i.isFile()&&t.push(r)}};return n(e),t.sort()}const DMe=new Set([`.jsonl`]);function OMe(e){let t=e.lastIndexOf(`.`);return t!==-1&&DMe.has(e.slice(t))}const kMe=new Set([`.jsonl`,`.json`,`.txt`,`.log`,`.lock`,`.yaml`,`.yml`,`.ips`]);function AMe(e){if(F9(e))return!0;let t=e.lastIndexOf(`.`);return t!==-1&&kMe.has(e.slice(t))}function jMe(e){let t=[];for(let n of Q9(e)){let r=$9(e,n);if(!AMe(r))continue;let{redacted:i,patterns:a,lineCount:o}=RB(S(n,`utf-8`));a.length!==0&&(ie(n,i),t.push({file:r,lineCount:o,patterns:a}))}return{redactions:t,redactedLineCount:t.reduce((e,t)=>e+t.lineCount,0)}}function $9(e,t){return j(e,t).split(ue).join(`/`)}async function MMe(e){let t=M(e.contentDir),n=M(e.projectDir??e.contentDir),r=e.deps??{},i=r.fetchAgentPresence??pMe,a=r.fetchAgentEffects??mMe,o=r.fetchWatcherRecent??hMe,s=r.readShadowHead??_Me,c=r.readCheckpointRefs??vMe,l=r.now??(()=>new Date),u=r.okVersion??(()=>`0.82.0-beta.
|
|
1540
|
+
`)}\n`:null}catch{return null}}function _Me(e){let t=A(e,`.git`,`ok`);if(!g(t))return null;let n=l(`git`,[`-C`,t,`log`,`--oneline`,`-50`],N8({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function vMe(e){let t=A(e,`.git`,`ok`);if(!g(t))return null;let n=l(`git`,[`-C`,t,`for-each-ref`,`--sort=-creatordate`,`--count=50`,`--format=%(refname)%09%(creatordate:iso-strict)%09%(contents:subject)`,`refs/checkpoints/`],N8({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function K9(){let e=process.env.OK_DESKTOP_VERSION,t=process.env.OK_DESKTOP_PACKAGED,n=process.env.OK_DESKTOP_CHANNEL;return e===void 0||t===void 0||n===void 0?null:{electronVersion:e,packaged:t===`1`||t.toLowerCase()===`true`,channel:n}}function yMe(){return{nodeVersion:process.version,platform:be(),arch:he()}}function bMe(){return process.env.OTEL_SDK_DISABLED===`false`}function q9(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function J9(e){if(!g(e))return{};let t;try{t=(0,rs.parse)(S(e,`utf-8`))}catch(t){return console.warn(`[ok diagnose bundle] failed to parse ${e} for manifest config; manifest will report schema defaults. Reason: ${t instanceof Error?t.message:String(t)}`),{}}if(!q9(t))return{};let n=t.telemetry;if(!q9(n))return{};let r=n.localSink;return q9(r)?r:{}}function Y9(e){return typeof e==`boolean`?e:void 0}function xMe(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:void 0}function X9(e){if(q9(e))return xMe(e.maxBytes)}function SMe(e){let t=J9(SY(`project`,e)),n=J9(SY(`project-local`,e));return{enabled:Y9(n.enabled)??Y9(t.enabled)??!0,spansMaxBytes:X9(n.spans)??X9(t.spans)??52428800,logsMaxBytes:X9(n.logs)??X9(t.logs)??26214400}}function CMe(e){return Ae(`sha256`).update(e).digest(`hex`)}function wMe(e){let t=S(e),n=0;for(let e=0;e<t.length;e++)t[e]===10&&n++;return n}const TMe=[`"doc.name"`,`"docName"`];function EMe(e){let t=S(e,`utf-8`),n=0;for(let e of TMe){let r=t.indexOf(e);for(;r!==-1;)n++,r=t.indexOf(e,r+e.length)}return n}function Z9(e,t){if(!g(e))return!1;try{return v(O(t),{recursive:!0}),e.endsWith(`.ips`)?ie(t,C7(S(e,`utf-8`))):m(e,t),!0}catch{return!1}}function Q9(e){let t=[],n=e=>{let r=w(e,{withFileTypes:!0});for(let i of r){let r=A(e,i.name);i.isDirectory()?n(r):i.isFile()&&t.push(r)}};return n(e),t.sort()}const DMe=new Set([`.jsonl`]);function OMe(e){let t=e.lastIndexOf(`.`);return t!==-1&&DMe.has(e.slice(t))}const kMe=new Set([`.jsonl`,`.json`,`.txt`,`.log`,`.lock`,`.yaml`,`.yml`,`.ips`]);function AMe(e){if(F9(e))return!0;let t=e.lastIndexOf(`.`);return t!==-1&&kMe.has(e.slice(t))}function jMe(e){let t=[];for(let n of Q9(e)){let r=$9(e,n);if(!AMe(r))continue;let{redacted:i,patterns:a,lineCount:o}=RB(S(n,`utf-8`));a.length!==0&&(ie(n,i),t.push({file:r,lineCount:o,patterns:a}))}return{redactions:t,redactedLineCount:t.reduce((e,t)=>e+t.lineCount,0)}}function $9(e,t){return j(e,t).split(ue).join(`/`)}async function MMe(e){let t=M(e.contentDir),n=M(e.projectDir??e.contentDir),r=e.deps??{},i=r.fetchAgentPresence??pMe,a=r.fetchAgentEffects??mMe,o=r.fetchWatcherRecent??hMe,s=r.readShadowHead??_Me,c=r.readCheckpointRefs??vMe,l=r.now??(()=>new Date),u=r.okVersion??(()=>`0.82.0-beta.5`),d=r.readDesktopEnv??K9,f=r.readLanguage??O9,p=r.readRuntime??yMe,h=r.isOtlpPushEnabled??bMe,_=y(A(Se(),`ok-bundle-`));try{v(A(_,`telemetry`),{recursive:!0}),v(A(_,`logs`),{recursive:!0}),v(A(_,`state`),{recursive:!0}),Z9(sMe(n),A(_,`telemetry`,z9)),Z9(cMe(n),A(_,`telemetry`,B9)),Z9(lMe(n),A(_,`logs`,V9)),Z9(uMe(n),A(_,`logs`,H9));for(let t of e.userLogFiles??[])Z9(t,A(_,`logs`,oe(t)));for(let t of e.userStateFiles??[])Z9(t,A(_,WL,oe(t)));let y=0;for(let t of e.diagnosticReports?.files??[])Z9(t,A(_,`diagnostic-reports`,oe(t)))&&(y+=1);let b=A(n,`.ok`,`local`),x=A(b,`server.lock`),C=`not-running`,w=`no server.lock`,T=null;if(g(x)){Z9(x,A(_,`state`,`server.lock`));try{let e=S(x,`utf-8`),t=JSON.parse(e);typeof t.port==`number`?T=t.port:w=`lock present but no port`}catch{w=`lock present but unparseable`}}if(T!==null){let e=await i(T);e===null?w=`agent-presence endpoint at :${T} unreachable`:(ie(A(_,`state`,`agent-presence.json`),e),C=`running`,w=``);let t=await a(T);t!==null&&ie(A(_,`state`,`agent-effects.json`),t);let n=await o(T);if(n!==null){let e=gMe(n);e!==null&&ie(A(_,`state`,`watcher-recent.jsonl`),e)}}let E=s(t);E!==null&&ie(A(_,`state`,`shadow-head.txt`),E);let D=c(t);D!==null&&ie(A(_,`state`,`checkpoint-refs.txt`),D),Z9(dMe(n),A(_,`state`,U9)),Z9(fMe(n),A(_,`state`,W9)),Z9(A(b,`last-spawn-error.log`),A(_,`state`,`last-spawn-error.log`)),Z9(A(b,qu),A(_,`state`,qu)),Z9(A(b,Ju),A(_,`state`,Ju)),Z9(A(b,Ku),A(_,`state`,Ku));let te=p(),re=d(),ae=f(),O={ok:{version:u(),nodeVersion:te.nodeVersion,platform:te.platform,arch:te.arch},host:{desktop:re,language:ae}};ie(A(_,`state`,`runtime.json`),`${JSON.stringify(O,null,2)}\n`);let se=C===`running`?`running
|
|
1541
1541
|
`:`not-running (${w})\n`;ie(A(_,`state`,`server-status.txt`),se);let k=e.diagnosticReports===void 0?`not-collected (no collection attempted)`:S7(e.diagnosticReports,y);if(ie(A(_,`state`,`diagnostic-reports-status.txt`),`${k}\n`),e.processDir&&g(e.processDir)){let t=A(_,`process`);v(t,{recursive:!0}),m(e.processDir,t,{recursive:!0})}let ce=e.redact===!0;ce&&oMe({stagingDir:_,contentDir:t}),e.note&&ie(A(_,`note.txt`),e.note);let le=null;e.scrubSecrets===!0&&(le=jMe(_));for(let t of e.extraFiles??[]){let e=t.zipName??oe(t.sourcePath);if(!Z9(t.sourcePath,A(_,`extra`,e))){r.logger?.warn({sourcePath:t.sourcePath},`extra file missing; omitted from bundle`);continue}let n=T7(t,`extra/${e}`);n!==null&&(le??={redactions:[],redactedLineCount:0},le.redactions.push(n),le.redactedLineCount+=n.lineCount)}let j=SMe(n),M=Q9(_),ue=[],de=0,fe=0;for(let e of M){let t=$9(_,e),n=ne(e).size,r=OMe(t)?wMe(e):0;ue.push({path:t,bytes:n,lines:r}),de+=n,(t.startsWith(`telemetry/`)||t.startsWith(`logs/`))&&(fe+=EMe(e))}let pe={applied:ce};le!==null&&(pe.secretScrub=le);let N={schemaVersion:2,createdAt:l().toISOString(),ok:{version:u(),nodeVersion:te.nodeVersion,platform:te.platform,arch:te.arch},host:{desktop:re,language:ae},contentDir:{pathSha256:CMe(t),absolutePath:ce?`<CONTENT_DIR>`:t},telemetry:{localSink:j,otlpPushEnabled:h()},redaction:pe,serverStatus:C,files:ue};ie(A(_,`manifest.json`),`${JSON.stringify(N,null,2)}\n`);let me=M.some(e=>{try{return S(e,`utf-8`).includes(t)}catch{return!1}}),he={stagedDiagnosticReports:y,totalBytes:de,fileCount:ue.length,docNameCount:fe,contentDirVisible:me,redacted:ce},ge=!1;return{stagingDir:_,manifest:N,summary:he,cleanup:()=>{ge||(ge=!0,ee(_,{recursive:!0,force:!0}))}}}catch(e){throw ee(_,{recursive:!0,force:!0}),e}}async function NMe(e){let{collected:t,outputPath:n}=e,r=O(n);if(!g(r))throw Error(`ok diagnose bundle: parent directory does not exist: ${r}. Create it or pass --out with an existing parent.`);let i=new DTe.ZipFile,a=Q9(t.stagingDir);for(let e of a){let n=$9(t.stagingDir,e);i.addFile(e,n)}i.end();let o=h(n);return i.outputStream.pipe(o),await new Promise((e,t)=>{o.on(`close`,e),o.on(`error`,t),i.outputStream.on(`error`,t)}),n}function PMe(e,t){let n=A(e,`.ok`,`config.yml`);if(g(n))try{let t=(0,rs.parse)(S(n,`utf-8`)),r=HY(t)?t.content:void 0,i=HY(r)?r.dir:void 0;if(typeof i==`string`&&i.length>0)return M(e,i)}catch(e){t?.warn({configPath:n,err:e},`bug-report: failed to read .ok/config.yml; falling back to project root as content dir`)}return M(e)}async function FMe(e,t,n,r,i){let a=E7(t,e.logger),o=await MMe({contentDir:PMe(t,e.logger),projectDir:t,redact:e.redact,scrubSecrets:e.redact,note:e.note,extraFiles:e.extraFiles,userLogFiles:[...GAe(a,e.userLogsDir??A(hY(),`logs`)),...O7(e.cachesDir??A(ve(),`Library`,`Caches`))],userStateFiles:k7(e.bugReportsDir??w7()),diagnosticReports:i,deps:{readDesktopEnv:n,readLanguage:r,logger:e.logger}});try{v(O(e.outputPath),{recursive:!0}),await NMe({collected:o,outputPath:e.outputPath});let t=o.manifest.redaction.secretScrub;return{zipPath:e.outputPath,summary:{level:`full`,systemWide:!1,projectSlug:a,files:o.manifest.files.map(e=>e.path),redactions:t?.redactions??[],redactedLineCount:t?.redactedLineCount??0,generatedAt:o.manifest.createdAt}}}finally{o.cleanup()}}async function IMe(e){let{projectDir:t}=e,n=e.readDesktopEnv??K9,r=e.readLanguage??O9,i=()=>BAe(e.diagnosticReportsDir??A(ve(),`Library`,`Logs`,`DiagnosticReports`),new Date);if(e.level===`full`&&t!==void 0)return FMe(e,t,n,r,i());let{zipPath:a,summary:o}=await XAe({projectDir:t,redact:e.redact,revealDocNames:e.level===`full`,outputPath:e.outputPath,userLogsDir:e.userLogsDir,shipItLogFiles:O7(e.cachesDir??A(ve(),`Library`,`Caches`)),bugReportLedgerFiles:k7(e.bugReportsDir??w7()),diagnosticReports:e.level===`full`?i():void 0,logger:e.logger,note:e.note,extraFiles:e.extraFiles,desktop:n(),language:r()});return{zipPath:a,summary:{level:e.level,systemWide:t===void 0,projectSlug:o.projectSlug,files:o.files,redactions:o.redactions,redactedLineCount:o.redactedLineCount,generatedAt:o.generatedAt}}}export{YY as ALL_EDITOR_IDS,XY as EDITOR_LABELS,EX as EDITOR_TARGETS,Pve as HOSTS_WITH_USER_SKILL_DIR,EAe as LAUNCH_CONFIG_NAME,zje as PATH_SHIM_BEGIN,Vje as PATH_SHIM_BLOCK_RE,Bje as PATH_SHIM_END,I5 as ProjectPathSafetyError,iAe as addOkPathsToGitExclude,L5 as assertProjectPathSafe,cX as buildManagedServerEntry,kje as buildMcpConfigDeclineEvent,Aje as buildMcpConfigMigrateEvent,y7 as classifyExistingMcpEntry,IMe as collectReportBundle,Kje as createCliProbeResolver,OY as createTokenStore,HAe as defaultBugReportZipPath,We as detectGh,qe as detectGhAccounts,AAe as detectInstalledEditors,_X as droppedManagedKeys,tye as editorConfigPathDisplay,eye as editorEntryLocator,vje as ensurePiBridge,Z5 as formatTrackedRemediation,sAe as getExcludedOkPaths,Y5 as getInstalledSkillProjectionPaths,Nve as getNativeTomlMcpEditor,J5 as getOkArtifactPaths,oX as isEntryUpToDate,lX as isOwnManagedEntry,Ije as loadConfig,ave as makeLazyProbeTokenStore,w7 as okBugReportsDir,b9 as parseGitHubBlobUrl,Lje as parseGitHubShareUrl,x9 as parseGitHubTreeUrl,y9 as parseGitUrl,Hje as pathInstallMarkerPath,Uke as previewContent,jAe as probeOwnManagedEditorMcpEntry,gje as probePiBridgeState,X5 as probeTrackedOkPaths,_7 as readExistingMcpEntry,oAe as readSharingMode,RB as redactContent,aAe as removeOkPathsFromGitExclude,Tje as removeOwnMcpEntry,eAe as removeProjectSkill,Jje as removeUserGlobalSkillBundle,eMe as removeUserSkill,Jke as resolveProjectRoot,Nje as runStop,h9 as truncatePriorEntry,E9 as userGlobalSkillBundleTargets,$je as userSkillPresentAnywhere,Rje as validateLocalFolderForShare,g7 as writeEditorMcpConfig,Zje as writeProjectAiIntegrations,U5 as writeProjectSkill,kAe as writeUserMcpConfigs,Qje as writeUserSkill};
|
|
1542
1542
|
//# sourceMappingURL=index.mjs.map
|