@inkeep/open-knowledge 0.70.2 → 0.70.4
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-Deih7i0K.mjs +1 -0
- package/dist/{dist-Ct3NR8HA.mjs → dist-CSFai4j1.mjs} +1 -1
- package/dist/{dist-BfGPmTI1.mjs → dist-CmS0s3u8.mjs} +477 -477
- package/dist/index.mjs +3 -3
- package/dist/{init-DCm-_TKB.mjs → init-CtwvSCyQ.mjs} +2 -2
- package/dist/init-DJa55PQU.mjs +1 -0
- package/dist/{launch-json-removal-DKupr-jC.mjs → launch-json-removal-BE8E1vIW.mjs} +1 -1
- package/dist/loader-BzFUiCkF.mjs +1 -0
- package/dist/{loader-B2xPGQfd.mjs → loader-DlB4rhjA.mjs} +1 -1
- package/dist/{md-manager-BGnqyqi1-Eez8IlhB.mjs → md-manager-BGnqyqi1-Dg5Bl9Rs.mjs} +2 -2
- package/dist/{open-browser-rcp8z_R5.mjs → open-browser-BexG740O.mjs} +1 -1
- package/dist/parse-worker.mjs +1 -1
- package/dist/{preview-B8ghhW3C.mjs → preview-BqDHlB4I.mjs} +1 -1
- package/dist/preview-f4iVephM.mjs +1 -0
- package/dist/public/assets/{ActivityModeContent-Dzlz-p9w.js → ActivityModeContent-DZWkzSf1.js} +1 -1
- package/dist/public/assets/{AddPropertiesButton-BzvWvVbw.js → AddPropertiesButton-CZ_1FSZ_.js} +2 -2
- package/dist/public/assets/{AgentDiffPane-Badnd0z5.js → AgentDiffPane-Dx88nEFC.js} +1 -1
- package/dist/public/assets/{AgentThreadClientBinder-BDxB-fkd.js → AgentThreadClientBinder-BhZ7g12J.js} +1 -1
- package/dist/public/assets/{BugReportHistory-YsKDA8Wg.js → BugReportHistory-CfFMNT0L.js} +1 -1
- package/dist/public/assets/{BugReportHistoryDialog-Cm-lMz2-.js → BugReportHistoryDialog-CImauBFJ.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-CvenaDDl.js → CodeMirrorPropInput-33E7_d5L.js} +1 -1
- package/dist/public/assets/{ConsentDialogBody-Lw_SJixc.js → ConsentDialogBody-DAiGjncA.js} +1 -1
- package/dist/public/assets/{DiffViewBoundary-DuQPEMcv.js → DiffViewBoundary-DYrAptlH.js} +1 -1
- package/dist/public/assets/{DocumentContext-BWfYIGn-.js → DocumentContext-BEpM29CW.js} +1 -1
- package/dist/public/assets/{EditorModeToggle-B8xOZgYr.js → EditorModeToggle-BQbTgwTb.js} +1 -1
- package/dist/public/assets/{EnableSyncConfirmDialog-7Bq4UalT.js → EnableSyncConfirmDialog-CecCUsv_.js} +1 -1
- package/dist/public/assets/{ExcalidrawDocEditor-qHB2EWCE.js → ExcalidrawDocEditor-C9oVP6iE.js} +1 -1
- package/dist/public/assets/FeedbackForm-CJbAPiPo.js +1 -0
- package/dist/public/assets/{GraphPanel-sNH2eMK2.js → GraphPanel-D9q9_WBi.js} +1 -1
- package/dist/public/assets/{ImageAttachments-Dru1UxQV.js → ImageAttachments-VgESElX7.js} +1 -1
- package/dist/public/assets/{ImportSkillDialog-DNsoaSWE.js → ImportSkillDialog-CawY20dd.js} +1 -1
- package/dist/public/assets/{LintConfigEditor-Eajj_ona.js → LintConfigEditor-XdVzbUuy.js} +1 -1
- package/dist/public/assets/{ManagedArtifactProperties-xmkjmIcU.js → ManagedArtifactProperties-B4l-pO4C.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-BmtGXHjb.js +1 -0
- package/dist/public/assets/{MermaidDocEditor-DbApv8jA.js → MermaidDocEditor-CtxAqoKZ.js} +1 -1
- package/dist/public/assets/{PropertyDisplayRow-BZXUua7I.js → PropertyDisplayRow-C0l21vkw.js} +1 -1
- package/dist/public/assets/{RegisteredAgentIcon-DU5Zkepy.js → RegisteredAgentIcon-URW6mRal.js} +1 -1
- package/dist/public/assets/{ReportBugDialogBody-C275Hr72.js → ReportBugDialogBody-BC_SYWmo.js} +1 -1
- package/dist/public/assets/{ReportBugMenuTrigger-Ilx23iFu.js → ReportBugMenuTrigger-4CdA9Mp-.js} +2 -2
- package/dist/public/assets/{SchemaConfigEditor-DQcwju-H.js → SchemaConfigEditor-ByX85bDx.js} +1 -1
- package/dist/public/assets/{SessionsHost-BxTLJA09.js → SessionsHost-nYZICiDW.js} +2 -2
- package/dist/public/assets/{SettingsDialogBody-CRTA_WKg.js → SettingsDialogBody-VE4R_Wc7.js} +1 -1
- package/dist/public/assets/{ShareBranchSwitchDialog-CaH1eNpE.js → ShareBranchSwitchDialog-x37WR88-.js} +1 -1
- package/dist/public/assets/{ShareReceiveDialog-Fig-8wyz.js → ShareReceiveDialog-BOG4bhi-.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-BNUxcUmo.js → ShareReceiveMissDialog-BSUpUq9X.js} +1 -1
- package/dist/public/assets/{SkillCostValue-09FxLC0z.js → SkillCostValue-CD-UkSgT.js} +1 -1
- package/dist/public/assets/{SkillEditBanner-DxF5MrWn.js → SkillEditBanner-DjIJkNok.js} +1 -1
- package/dist/public/assets/{SkillForkDialog-DIIWYvbn.js → SkillForkDialog-Crpq5lBh.js} +1 -1
- package/dist/public/assets/{SkillInstallMenu-BSeeI8R-.js → SkillInstallMenu-CbSHcW8R.js} +1 -1
- package/dist/public/assets/{SkillOriginInline-B00Qx11t.js → SkillOriginInline-BFZf2JR9.js} +1 -1
- package/dist/public/assets/{SkillToolbarControls-CJLv0nyi.js → SkillToolbarControls-Y7AOB-xP.js} +1 -1
- package/dist/public/assets/{SlidesToolbarControls-CCNjUkub.js → SlidesToolbarControls-CHqriWLu.js} +1 -1
- package/dist/public/assets/{SourceEditor-ByNnsvQe.js → SourceEditor-DC10bZpS.js} +1 -1
- package/dist/public/assets/{TerminalPanel-CzywxJp9.js → TerminalPanel-4st3TySk.js} +1 -1
- package/dist/public/assets/{TerminalWindowApp-DPTNBmQ0.js → TerminalWindowApp-DXNm9dTO.js} +1 -1
- package/dist/public/assets/{TextDocEditor-B7AzPtXW.js → TextDocEditor-DiGZLPsh.js} +1 -1
- package/dist/public/assets/{ThreadView-BG9x4d_s.js → ThreadView-uHciD-Kx.js} +1 -1
- package/dist/public/assets/{TimelineDiffPane-BKQeyrX6.js → TimelineDiffPane-CLs-B1dB.js} +1 -1
- package/dist/public/assets/{agent-diff-store-C92NIPau.js → agent-diff-store-Dg3Bac6C.js} +1 -1
- package/dist/public/assets/{auth-state-cache-CXXOQdcM.js → auth-state-cache-BidOXkoe.js} +1 -1
- package/dist/public/assets/{bug-report-send-manager-BK30wBiV.js → bug-report-send-manager-9LfthUn-.js} +1 -1
- package/dist/public/assets/{client-version-B48BbTkz.js → client-version-seuqi8Cv.js} +1 -1
- package/dist/public/assets/{comment-chips-CdrJy7oX.js → comment-chips-C48UmG4n.js} +1 -1
- package/dist/public/assets/{config-provider-DlzcUiYU.js → config-provider-CuTQvb3e.js} +1 -1
- package/dist/public/assets/{dist-CGNkoXKB.js → dist-BhxUJnt3.js} +2 -2
- package/dist/public/assets/{doc-hash-CH3Kq7TA.js → doc-hash-Kdp6yoV7.js} +1 -1
- package/dist/public/assets/{doc-undo-manager-B2S3p7Kh.js → doc-undo-manager-7SQ4l4Nu.js} +1 -1
- package/dist/public/assets/{documents-events-kUbk4KBT.js → documents-events-Do-YHwQc.js} +1 -1
- package/dist/public/assets/{file-tree-adapter-Co9sJppq.js → file-tree-adapter-lIVLoHBG.js} +1 -1
- package/dist/public/assets/{file-tree-utils-D_wP4Dm1.js → file-tree-utils-CFQU54to.js} +1 -1
- package/dist/public/assets/{folder-config-api-BF554VSQ.js → folder-config-api-CqEs8lkj.js} +1 -1
- package/dist/public/assets/i18n-Bv8eiJWs.js +1 -0
- package/dist/public/assets/{index-DMDo5dFr.js → index-DeWGu3Fz.js} +8 -8
- package/dist/public/assets/{launcher-selection-C9GmEvOn.js → launcher-selection-CYk4BvNH.js} +1 -1
- package/dist/public/assets/{lint-config-client-B61iX5QY.js → lint-config-client-DRJy5ylG.js} +1 -1
- package/dist/public/assets/{markdownlint-rule-browser-CMXE3hvX.js → markdownlint-rule-browser-B2e579Uf.js} +1 -1
- package/dist/public/assets/{page-list-cache-DoLH1XoG.js → page-list-cache-4W3gy-jT.js} +1 -1
- package/dist/public/assets/{pending-receive-nav-store-CJEI5S0U.js → pending-receive-nav-store-DLAyo8mi.js} +1 -1
- package/dist/public/assets/{progress-C3Z1B6MH.js → progress-XpLQWrMN.js} +1 -1
- package/dist/public/assets/{project-paths-Bzd32aJI.js → project-paths-BTELVsG-.js} +1 -1
- package/dist/public/assets/{prop-types-CFuqY6TP.js → prop-types-De82BC_y.js} +1 -1
- package/dist/public/assets/{receive-store-BJw3I9N7.js → receive-store-7U3uc-LJ.js} +1 -1
- package/dist/public/assets/{selection-context-DJ_FIiJx.js → selection-context-soshQLlg.js} +1 -1
- package/dist/public/assets/{skill-scope-B1qEIboE.js → skill-scope-g1lFJ-Ds.js} +1 -1
- package/dist/public/assets/{skills-api-NyR-fZMK.js → skills-api-CRZyzHPE.js} +1 -1
- package/dist/public/assets/{src-BuzwpJZ-.js → src-dvZih_Vh.js} +1 -1
- package/dist/public/assets/{startup-marks-D0gyAKgY.js → startup-marks-DStB--sY.js} +1 -1
- package/dist/public/assets/{tag-pill-input-D1rYfOx4.js → tag-pill-input-CZmZF-XJ.js} +1 -1
- package/dist/public/assets/{target-navigation-intent-Bf41Ns6y.js → target-navigation-intent-BQU5n3Z_.js} +1 -1
- package/dist/public/assets/{telemetry-startup-EsQxKU36.js → telemetry-startup-DwkEBT3y.js} +1 -1
- package/dist/public/assets/{terminal-cli-display-BrLCqbMd.js → terminal-cli-display-Bd0HYJq3.js} +1 -1
- package/dist/public/assets/{terminal-command-events-CloL_dun.js → terminal-command-events-Dl_wyZ8W.js} +1 -1
- package/dist/public/assets/{terminal-telemetry-DBBf7dvq.js → terminal-telemetry-DLqNCiZH.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-CyxGjpoW.js → typing-burst-detector-BwBh8lkh.js} +1 -1
- package/dist/public/assets/{uninstall-BY4ebvpt.js → uninstall-B61_4YZE.js} +1 -1
- package/dist/public/assets/{use-activity-panel-114XoWfq.js → use-activity-panel-Cl6TYK1f.js} +1 -1
- package/dist/public/assets/{use-apply-config-color-theme-sUvEkbPv.js → use-apply-config-color-theme-QpFGIPF6.js} +1 -1
- package/dist/public/assets/{use-collab-url-BMqkaPvt.js → use-collab-url-DW8bwOaN.js} +1 -1
- package/dist/public/assets/{use-conflicts-2jTGKNOt.js → use-conflicts-pcxYwtG3.js} +1 -1
- package/dist/public/assets/{use-live-xterm-theme-BgQOsQLk.js → use-live-xterm-theme-79su-ECS.js} +1 -1
- package/dist/public/assets/{use-open-skill-DhmFoS02.js → use-open-skill-CC-Cxugv.js} +1 -1
- package/dist/public/assets/{use-settings-route-hU5QNNlM.js → use-settings-route-DMGQfb-V.js} +1 -1
- package/dist/public/assets/{use-skill-origin-FAiHzQpH.js → use-skill-origin-DbUW6s6z.js} +1 -1
- package/dist/public/assets/{use-skills-CI07Z3HF.js → use-skills-DQAWS2uW.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-CqCHYTWh.js → use-terminal-enabled-DAAuSBDz.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-BY6jlhQ-.js → use-timeline-entry-diff-D0kEZsvg.js} +1 -1
- package/dist/public/assets/{use-workspace-CfpIXxMZ.js → use-workspace-vRTzA3RL.js} +1 -1
- package/dist/public/index.html +52 -52
- package/dist/public/uninstall.html +3 -3
- package/dist/{registry-probes-DQTcgpB8.mjs → registry-probes-C133eEg2.mjs} +1 -1
- package/dist/{repair-launch-json-znn6W04D.mjs → repair-launch-json-Dg1iNDUl.mjs} +1 -1
- package/dist/{repair-mcp-configs-0aSQr0nM.mjs → repair-mcp-configs-CFC8Q6rq.mjs} +1 -1
- package/dist/src-CAD7Jq9J.mjs +1 -0
- package/dist/{src-DRvpu2Pc.mjs → src-CeTbcYYR.mjs} +1 -1
- package/dist/start-Cd7v3ush.mjs +1 -0
- package/dist/{start-DV546gMf.mjs → start-DVCuq0UU.mjs} +3 -3
- package/package.json +4 -4
- package/dist/constants-BmXRoN_y.mjs +0 -1
- package/dist/init-C-pPC1Zr.mjs +0 -1
- package/dist/loader-By_EKgl-.mjs +0 -1
- package/dist/preview-CHbSwlz5.mjs +0 -1
- package/dist/public/assets/FeedbackForm-Byfm4Jvi.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-yRhiyBSE.js +0 -1
- package/dist/public/assets/i18n-CRmWQMdd.js +0 -1
- package/dist/src-jvL9kWva.mjs +0 -1
- package/dist/start-BDvJdh1m.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}=CL(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 TL(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=xL(i,c),{frontMatterLines:h}=m;i=m.content;let{effectiveConfig:g,enabledRulesPerLineNumber:_,enabledRuleList:v,rulesSeverity:y}=wL(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!==vL.length,C=x?VF(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:ZN,lines:Object.freeze(T),frontMatterLines:Object.freeze(h)};KN({...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{KN()}};!b||d?E(b?(0,tP.requireMarkdownItCjs)().getMarkdownItTokens(a(),w,T):[]):Promise.all([Promise.resolve().then(()=>e(QN(),1)),new Promise(e=>e(a()))]).then(([e,t])=>{let n=e.getMarkdownItTokens(t,w,T);E(n)}).catch(p)}function EL(e,t,n,r,i,a,o,s,c,l,u,d){function f(l,f){return l?d(l):TL(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 DL(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=vL.concat(r),a=bL(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||zN,g=SL(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++,EL(i,g,e,m,l,u,d,f,p,h,t,r);else if(e=c.shift())y++,TL(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 OL(e){let t=null;return DL(e,!0,function(e,n){if(e)throw e;t=n}),t}function kL(e,t=0){return{lineNumber:e.lineNumber||t,editColumn:e.editColumn||1,deleteCount:e.deleteCount||0,insertText:e.insertText||``}}function AL(e,t,n=`
|
|
341
341
|
`){let{editColumn:r,deleteCount:i,insertText:a}=kL(t),o=r-1;return i===-1?null:e.slice(0,o)+a.replace(/\n/g,n)+e.slice(o+i)}function jL(e,t){let n=Q.getPreferredLineEnding(e,BN),r=e.split(Q.newLineRe),i=t.filter(e=>e.fixInfo).map(e=>kL(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]=AL(r[c],e,n)),o=c,s=l}return r.filter(e=>e!==null).join(n)}function ML(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]=NL(o,e),s=n===2;if(n)return function(e,n,c){let l=n.messages.length-1;YO(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 NL(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]}new Set(Ao),[{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`]),No.filter(e=>e!==`session`);const PL={agent:jo},FL={"followup.approve-once":{params:no(PL)},"followup.enable-manually":{params:no(PL)},"followup.trust-gated":{params:no(PL)},"guidance.mcp.user-config":{params:no(PL)},"guidance.mcp.project-config":{params:no(PL)},"guidance.mcp.session-injection":{params:no(PL)},"guidance.mcp.managed-file":{params:no(PL)},"guidance.skill.project":{params:no(PL)},"guidance.skill.user":{params:no(PL)},"guidance.skill.central-store":{params:no(PL)},"troubleshooting.claude.project-entry-not-approved":{params:no(PL)},"troubleshooting.claude-desktop.per-tool-approval":{params:no(PL)},"troubleshooting.cursor.project-entry-not-loaded":{params:no(PL)},"troubleshooting.codex.desktop-project-config":{params:no({...PL,honoredByDesktop:L()})},"troubleshooting.copilot.shared-workspace-config":{params:no({...PL,sourceAgent:jo})},"troubleshooting.openclaw.central-store-missing":{params:no(PL)},"troubleshooting.pi.folder-trust":{params:no(PL)},"troubleshooting.lm-studio.config-path-mismatch":{params:no(PL)}};Object.keys(FL).sort(),cs.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 IL=U(dn),LL=B({kind:U([`source-read`,`measured`,`vendor-doc`,`upstream-issue`,`observation`]),ref:F().min(1),note:F().optional()}),RL=B({version:F().min(1).optional(),observedAt:F().min(1)}),zL=oo(`confidence`,[B({confidence:W(`verified`),evidence:z(LL).min(1),verifiedAgainst:RL.optional()}),B({confidence:W(`assumed`),evidence:z(LL).min(1),verifiedAgainst:RL.optional()}),B({confidence:W(`contested`),evidence:z(LL).min(1),verifiedAgainst:RL})]),BL=B({id:gre,params:H(F(),V([F(),I(),L()])).optional()}),VL=oo(`mode`,[B({mode:W(`probeable`),strictness:z(ko).min(1)}),B({mode:W(`unprobeable`),reason:U([`no-readable-state`,`different-machine`,`no-programmatic-path`,`session-scoped`]),note:F().optional()})]),HL=U([`this-project`,`this-user`,`this-machine`]),UL=U([`installable`,`user-completes`,`not-installable`]),WL=B({id:Fo,agent:jo,piece:Mo,scope:Po,kind:lre,pathId:hre.optional(),sharedWith:z(jo).default([]),prerequisites:z(Fo).default([]),consentClass:ure.default(`none`),probe:VL,attestation:zL,audience:HL,installability:UL.default(`installable`),notInstallableReason:U([`no-non-interactive-verb`,`session-scoped`,`no-surface`]).optional(),preferred:L().default(!1),guidance:BL.optional(),followup:BL.optional(),troubleshooting:BL.optional()}),GL=B({piece:Mo,level:dre,satisfiedByAny:z(Fo)}),KL=B({acpAgentId:F().min(1),featuredOrder:I().int().nonnegative().nullable(),harnessCli:pre.nullable(),harnessReadsEditorConfig:IL.nullable(),harnessReadsEditorConfigAttestation:zL,verifiedPosture:U([`asks`,`self-managed`,`autonomous`]).nullable()}),qL=B({cliId:F().min(1)}),JL=B({targetId:mre,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()}),YL=B({requirements:z(GL),caveats:z(BL).default([])});B({id:jo,setupDocSlug:F().min(1).nullable(),offerOnlyWhenDetected:L().default(!1),offersConnectionRow:L().default(!1),detectionSources:z(F().min(1)).default([]),satisfiers:z(WL),modes:uo(fre,YL),acp:KL.optional(),terminal:qL.optional(),external:JL.optional()}),B({id:F().min(1),requiredStrictness:ko,scope:Po.optional(),piece:Mo,revokedByForeignEntry:L().default(!1),guidance:BL.optional()}),new Uu.default;const XL=B({path:z(V([F(),I()])),message:F(),issueCode:F()});oo(`code`,[B({code:W(`SCHEMA_INVALID`),issues:z(XL)}),B({code:W(`WRITE_ERROR`),detail:F()})]),Object.freeze({source:`local`,skipStoreHooks:!1,context:Object.freeze({origin:`form-write`})});function ZL(e,t){return e>=(t===`leading`?2:1)?e:0}function QL(e,t){let n={line:e,column:1,offset:t};return{type:`paragraph`,children:[],position:{start:n,end:{...n}}}}function $L(e,t){let n=e.children,r=n.length===0||t.leading===void 0?0:ZL(t.leading.length,`leading`),i=n.length===0||t.trailing===void 0?0:ZL(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(QL(1+e,e));if(i>0&&typeof a?.offset==`number`&&typeof a.line==`number`)for(let e=0;e<i;e++)s.push(QL(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 eR=new Uu.default;eR.Match_Threshold=.5;function tR(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 nR=new Set([`sourceRaw`,`sourceDirty`,`position`]),rR=new Set([`jsxComponent`,`table`,`tableRow`,`tableCell`,`tableHeader`,`list`,`listItem`,`blockquote`,`codeBlock`,`heading`]),iR={type:`__br__`},aR=/^<br\s*\/?>$/i;function oR(e){let t=dR(e,oR);return(t.type===`tableCell`||t.type===`tableHeader`)&&t.content?{...t,content:sR(t.content)}:t}function sR(e){let t=[];for(let n of e){let e=cR(n);e.length!==0&&(t.length>0&&t.push(iR),t.push(...e))}return t}function cR(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)?sR(e.content):e.content}function lR(e){return e.type===`hardBreak`||e.type===iR.type||e.text!==void 0&&aR.test(e.text.trim())?iR:dR(e,lR)}const uR=[{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:oR},{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:lR}];function dR(e,t){return e.content?{...e,content:e.content.map(t)}:e}function fR(e,t){let n={};e.type!==void 0&&(n.type=e.type),e.text!==void 0&&(n.text=e.text);let r=pR(e.attrs,t);return r&&(n.attrs=r),e.marks&&e.marks.length>0&&(n.marks=[...e.marks].map(e=>({type:e.type,attrs:pR(e.attrs,t)})).sort((e,t)=>hR(e).localeCompare(hR(t)))),e.content&&e.content.length>0&&(n.content=e.content.map(e=>fR(e,t))),n}function pR(e,t){if(!e)return null;let n={};for(let r of Object.keys(e).sort()){if(nR.has(r)||t?.(r))continue;let i=e[r];i!=null&&(n[r]=t?mR(i,t):i)}return Object.keys(n).length>0?n:null}function mR(e,t){if(Array.isArray(e))return e.map(e=>mR(e,t));if(e&&typeof e==`object`){let n={};for(let[r,i]of Object.entries(e))t(r)||(n[r]=mR(i,t));return n}return e}function hR(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 gR(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 _R(e){let t=[],n=e=>{if(e.type&&rR.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 vR(e){let t=e,n=[];for(let e of uR){let r=hR(t),i=e.canonicalize(t);hR(i)!==r&&n.push(e.label),t=i}return{normalized:t,fired:n}}function yR(e,t,n={}){let r=vR(e),i=vR(t),a=[...new Set([...r.fired,...i.fired])],o=tR(gR(r.normalized),gR(i.normalized)),s=!o&&n.rawSourceSide===`expected`&&tR(gR(r.normalized,!0),gR(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=_R(r.normalized),l=_R(i.normalized);if(hR(c)!==hR(l))return{equivalent:!1,level:`L1`,reason:`structural-shatter`,appliedDegrades:a,detail:`container multiset diverged: [${c.join(`, `)}] vs [${l.join(`, `)}]`};let u=fR(r.normalized,n.ignoreAttrs),d=fR(i.normalized,n.ignoreAttrs);return hR(u)===hR(d)?{equivalent:!0,level:a.length>0?`L2`:`L1`,appliedDegrades:a}:{equivalent:!1,level:`L2`,reason:`structural-divergence`,appliedDegrades:a,detail:bR(u,d)}}function bR(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(hR(a[e])!==hR(o[e]))return bR(a[e],o[e],`${n}>${String(r.type)}[${e}]`);return`${n}(${String(r.type)}): attrs or marks differ`}function xR(e,t,n){return!yR(e,t,{ignoreAttrs:n}).equivalent}const SR=new Set([`src`,`href`,`size`]),CR=new Set([`WikiEmbedImage`,`WikiEmbedVideo`,`WikiEmbedAudio`,`WikiEmbedFile`]);function wR(e){if(Array.isArray(e))return e.map(e=>wR(e));if(e&&typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))SR.has(n)||(t[n]=wR(r));return t}return e}function TR(e){return e.type===`jsxComponent`&&typeof e.attrs?.componentName==`string`&&CR.has(e.attrs.componentName)?wR(e):e.content?{...e,content:e.content.map(TR)}:e}function ER(e){if(Array.isArray(e))return e.map(e=>ER(e));if(e&&typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))n!==`position`&&(t[n]=ER(r));return t}return e}function DR(e){if(e.type===`jsxComponent`)return e;if(e.content)for(let t of e.content){let e=DR(t);if(e)return e}}function OR(e){let t=e.cacheLimit??2048,n=new Map,r=r=>{let i=n.get(r);if(i!==void 0)return i;let a=DR(e.parse(r)),o=a?TR(ER(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?xR(n,TR(ER(e))):!1}}}const kR=`state/bug-reports`,AR=ro({at:F(),transport:F(),outcome:F(),reference:F().optional(),error:F().optional(),errorCode:F().optional()}),jR=ro({reason:F(),at:F(),errorCode:F().optional()});ro({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:jR.optional(),attempts:z(AR).optional(),note:F().optional()}),ro({version:I().int().catch(1),id:F().optional(),sentAt:F().optional(),reference:F().optional()});const MR=new Map([[32,` `],[9,` `],[160,`\xA0`]]);function NR(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 PR(e){let t=NR(e);return t!==null&&MR.has(t)}function FR(e){let t=NR(e);return t===null?null:MR.get(t)??null}const IR=/&#(?:x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);/g;function LR(e){IR.lastIndex=0;let t=e.match(IR);if(t===null||t.join(``)!==e)return null;let n=``;for(let e of t){let t=FR(e);if(t===null)return null;n+=t}return n}const RR=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 zR(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1_$2`).toUpperCase()}function BR(e){return`OK_${(e[0]===`server`?e.slice(1):e).map(zR).join(`_`)}`}function VR(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function HR(e){let{value:t,file:n,source:r,doc:i}=e,a=[],o=(e,t)=>{if(t.length>0){let e=pu(uu,t);if(e!==void 0){if(e.scope===`project-local`){let e=BR(t),o;i!=null&&r!=null&&n!=null&&(o=_u({file:n,source:r,doc:i,path:t})),a.push({path:[...t],...RR.has(e)?{envVar:e}:{},...o===void 0?{}:{source:o}})}return}}if(VR(e))for(let[n,r]of Object.entries(e))o(r,[...t,n])};return o(t,[]),a}function UR(e,t,n){return WR([e,t,n],[])}function WR(e,t){if(t.length>0){let n=pu(uu,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=GR(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=>KR(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]=WR(r.map(t=>t===void 0?void 0:t[e]),[...t,e]);return a}function GR(e){for(let t=e.length-1;t>=0;t--)if(e[t]!==void 0)return e[t]}function KR(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const qR=`(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)`;RegExp(`^127\\.${qR}\\.${qR}\\.${qR}$`);const JR=[`.mdx`,`.md`],YR={cursor:/\bCursor(?:\([^)]+\))?\/\d/,codex:/\bCodex(?:\([^)]+\))?\/\d/,"claude-desktop":/\bClaude(?:\([^)]+\))?\/\d/},XR=new Set([`gitlab.com`,`bitbucket.org`,`codeberg.org`,`gitea.com`,`sr.ht`,`sourcehut.org`]);function ZR(e){let t=e.toLowerCase(),n=t===`www.github.com`?`github.com`:t;return XR.has(n)?null:n}const QR=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(QR.map(e=>e.value));const $R=Pse.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}}}}),ez=Uv.extend({name:`emphasis`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`*`}}},addInputRules(){return[Cv({find:zv,type:this.type,getAttributes:{sourceDelimiter:`*`}}),Cv({find:Bv,type:this.type,getAttributes:{sourceDelimiter:`_`}})]}}),tz=Lse.extend({name:`strong`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`**`}}},addInputRules(){return[Cv({find:Iv,type:this.type,getAttributes:{sourceDelimiter:`**`}}),Cv({find:Lv,type:this.type,getAttributes:{sourceDelimiter:`__`}})]}}),nz=bv.create({name:`escapeMark`,priority:10,excludes:``,inclusive:!1,parseHTML(){return[{tag:`span[data-escape-mark]`}]},renderHTML(){return[`span`,{"data-escape-mark":``},0]}}),rz=jv.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 iz({node:e}){return``.repeat(e.nodeSize-e.content.size)}const az=jv.create({name:`footnoteReference`,marks:`_`,group:`inline`,inline:!0,atom:!0,selectable:!0,draggable:!1,priority:60,renderText:iz,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}})}}}),oz=Gv.extend({marks:`_`,priority:60,addAttributes(){return{...this.parent?.(),hardBreakStyle:{default:`backslash`},sourceRaw:{default:null}}}}),sz=qv.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}}}}),cz=jv.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]}}),lz=jv.create({name:`imageReference`,marks:`_`,group:`inline`,inline:!0,atom:!0,priority:60,renderText:iz,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 uz(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 dz=Yv.extend({marks:`_`,priority:60,renderText:iz,addAttributes(){return{...this.parent?.(),sourceUrl:{default:null,rendered:!1}}},renderHTML({HTMLAttributes:e}){let t=tv(this.options.HTMLAttributes,e);return typeof t.src==`string`&&(t.src=uz(t.src)),[`img`,t]}}),fz=jv.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}})}}}),pz=jv.create({name:`jsxInline`,group:`inline`,inline:!0,atom:!1,content:`text*`,isolating:!1,selectable:!0,priority:60,renderText:iz,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]}}),mz=[`https`,`http`,`mailto`,`tel`,`ftp`,`sms`],hz=mz.map(e=>`${e}:`).join(`|`);RegExp(`^(?:${hz}|\\/|#|\\?|\\.\\/|\\.\\.\\/)`,`i`);function gz(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 _z=new Set(mz.map(e=>`${e}:`));function vz(e){try{let t=new URL(e,`https://placeholder.invalid`);return _z.has(t.protocol.toLowerCase())}catch{return!1}}const yz=`LinkFidelity must be derived from the Link extension`,bz=sy.extend({priority:60,addOptions(){let e=this.parent?.();if(e===void 0)throw Error(yz);return{...e,openOnClick:!1,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer`},isAllowedUri:vz,shouldAutoLink:()=>!0}},addAttributes(){let e=this.parent?.();if(e===void 0)throw Error(yz);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}}}}),xz=jv.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 Sz(e){return e.type.name===`list`&&!e.attrs.ordered}function Cz(e){return e.type.name===`list`&&!!e.attrs.ordered}function wz(e){let t=!1;return e.forEach(e=>{e.type.name===`listItem`&&e.attrs.checked!==null&&(t=!0)}),t}function Tz(e,t,n,r,i,a,o){let s=Y_(e=>e.type.name===`list`)(e.selection);if(s&&i(s.node)){let{$from:n,$to:i}=e.selection;return n.blockRange(i)?xp(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 bp(n,a)(e,void 0)?!t||bp(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 Ez(e){return e===`x`||e===`X`}function Dz(e){return e===`X`?`X`:null}function Oz(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=sf(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 kz=/^\s*([-+*])\s$/,Az=/^\s*(\d+)([.)])\s$/,jz=/^\s*[-*+]\s\[([ xX]?)\]\s$/,Mz=/^\s*\[([ xX]?)\]\s$/,Nz=jv.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,tv(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:Tz(e,t,n,r,e=>Sz(e)&&!wz(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:Tz(e,t,n,r,e=>Cz(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:Tz(e,t,n,r,e=>Sz(e)&&wz(e),{ordered:!1},{checked:!1})}}},addInputRules(){return[Ev({find:kz,type:this.type,getAttributes:e=>({ordered:!1,bulletMarker:e[1]}),joinPredicate:(e,t)=>t.attrs.ordered===!1}),Ev({find:Az,type:this.type,getAttributes:e=>({ordered:!0,start:Number(e[1]),listMarkerDelimiter:e[2]}),joinPredicate:(e,t)=>t.attrs.ordered===!0}),new gv({find:jz,handler:({state:e,range:t,match:n})=>Oz(e,t,Ez(n[1]),Dz(n[1]))?void 0:null}),new gv({find:Mz,handler:({state:e,range:t,match:n})=>Oz(e,t,Ez(n[1]),Dz(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()}}}),Pz=jv.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`,tv(t),0]:[`li`,tv(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(tv(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}}}}),Fz=Nz,Iz=Pz,Lz=jv.create({name:`mathInline`,marks:`_`,group:`inline`,inline:!0,atom:!0,selectable:!0,priority:60,renderText:iz,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}})}}}),Rz=jv.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}}}}),zz=vx.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceMarkerSpacings:{default:null}}}}),Bz=Sx.extend({excludes:``,addAttributes(){return{...this.parent?.(),sourceFenceChar:{default:"`"},sourceFenceLength:{default:1},sourcePadded:{default:!1,rendered:!1}}}}),Vz=jv.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)}}}),Hz=bv.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)}}}),Uz=xv.create({name:`docFidelity`,addGlobalAttributes(){return[{types:[`doc`],attributes:{sourceDocBoundary:{default:null,rendered:!1}}}]}});function Wz(e){for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return t;return null}function Gz(e){let t=!1;return e.descendants(e=>!t&&(e.type.name===`list`&&(t=!0),!t)),t}function Kz(e){let{selection:t}=e;return t instanceof Pf?t.$cursor:null}function qz(e){let t=Kz(e);if(t?.parentOffset!==0)return!1;let n=Wz(t);if(n===null||t.depth!==n+1||t.index(n)!==0)return!1;let r=t.index(n-1);return r!==0&&Gz(t.node(n-1).child(r-1))}function Jz(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 Yz(e){let t=Kz(e);if(!t||t.parentOffset!==t.parent.content.size)return!1;let n=Wz(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=Jz(t,n);return r!==null&&r<n}const Xz=xv.create({name:`listBoundaryMerge`,addKeyboardShortcuts(){let e=()=>{let{editor:e}=this;if(!qz(e.state))return!1;if(e.commands.undoInputRule())return!0;let{state:t,view:n}=e;return Xf(t,n.dispatch,n)},t=()=>{let{editor:e}=this;if(!Yz(e.state))return!1;let{state:t,view:n}=e;return Zf(t,n.dispatch,n)};return{Backspace:e,"Mod-Backspace":e,Delete:t,"Mod-Delete":t}}}),Zz=xv.create({name:`plainTextClipboard`,priority:1e3,addProseMirrorPlugins(){return[new Uf({key:new Kf(`okPlainTextClipboard`),props:{clipboardTextSerializer:e=>e.content.textBetween(0,e.content.size,`
|
|
342
342
|
|
|
343
|
-
`)}})]}}),Qz=bv.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 $z(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||eB(n)===r||LR(e)===t}function eB(e){return e.replace(/\\([!-/:-@[-`{-~])/g,`$1`)}const tB=cS.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`~~`,rendered:!1}}}}),nB=hx.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDashCounts:{default:null},sourceOuterPipes:{default:null,rendered:!1},sourceAlignmentPadding:{default:null,rendered:!1}}}}),rB=ex.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),iB=tx.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),aB=jv.create({name:`tag`,marks:`_`,group:`inline`,inline:!0,atom:!0,selectable:!0,priority:60,renderText:iz,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()}}}),oB=/^(?:---|—-|___\s|\*\*\*\s)$/;function sB(e){let t=String(e[0]??``).replace(/\s+$/,``);return t===`—-`?`---`:t}const cB=Tx.extend({name:`thematicBreak`,priority:60,addAttributes(){return{...this.parent?.(),sourceRaw:{default:`---`}}},addInputRules(){return[wv({find:oB,type:this.type,getAttributes:e=>({sourceRaw:sB(e)})})]}}),lB=dS.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceForm:{default:`u`,rendered:!1}}}});function uB(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function dB(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}const fB=jv.create({name:`wikiLink`,marks:`_`,group:`inline`,inline:!0,atom:!0,priority:60,renderText:iz,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:uB(e.getAttribute(`data-alias`)),anchor:uB(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:uB(e.getAttribute(`data-alias`)),anchor:uB(e.getAttribute(`data-anchor`)),resolved:!1}:!1}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.target??``),r=uB(e.attrs.alias),i=uB(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`},dB({target:n,alias:r,anchor:i})]}});function pB(e){let t=e.split(`/`).pop()??e,n=t.lastIndexOf(`.`);return n<=0||n===t.length-1?``:t.slice(n+1).toLowerCase()}function mB(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}const hB=[fz,Rz,pz,Lz,fB,jv.create({name:`wikiLinkEmbed`,group:`inline`,inline:!0,atom:!0,priority:60,renderText:iz,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:uB(e.getAttribute(`data-alias`)),anchor:uB(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=uB(e.attrs.alias),i=uB(e.attrs.anchor),a=uB(e.attrs.resolvedSrc),o=pB(n);if(el.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`},mB({target:n,alias:r,anchor:i})]}}),aB,Fz,Iz,ez,tz,tB,lB,Bz,$R,zz,sz,cB,bz,cz,xz,oz,nz,Uz,Qz,Zz,tC.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}}),Xz,nB.configure({resizable:!0}),nx,iB,rB,dz.configure({inline:!0}),lz,uy,Hz,Vz,az,rz],gB=B({changes:z(oo(`kind`,[B({key:F(),kind:W(`added`),after:ps}).loose(),B({key:F(),kind:W(`removed`),before:ps}).loose(),B({key:F(),kind:W(`changed`),before:ps,after:ps}).loose()])),unparseable:B({before:F(),after:F()}).loose().nullable()}).loose();3072-_B("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 _B(e,t){let n=encodeURIComponent(e);return t===`cursor`?encodeURIComponent(n).length:n.length}function vB(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 yB(e,t){let n=vB(e);n.ok||t.addIssue({code:`custom`,message:n.reason})}const bB=F().superRefine(yB).optional(),xB=F().superRefine(yB),SB={agentId:F().optional(),agentName:F().optional(),colorSeed:F().optional(),clientName:F().optional(),clientVersion:F().optional(),label:F().optional()},CB=F().optional(),wB=/^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;oo(`kind`,[B({kind:W(`doc`),docPath:F().min(1)}).loose(),B({kind:W(`folder`),folderPath:F()}).loose()]);const TB=U([`no-remote`,`detached-head`,`branch-not-on-origin`,`non-github-remote`,`invalid-path`,`unsupported-share-url`]),EB=U([`current`,`stale`,`absent`,`empty`]);oo(`ok`,[B({ok:W(!0),shareUrl:F().min(1),sharedUrl:F().min(1),branch:F().min(1),freshness:EB.optional().catch(void 0)}).loose(),B({ok:W(!1),error:TB,branch:F().min(1).optional()}).loose()]);const DB=U([`user`,`org`]),OB=B({login:F().min(1),kind:DB,avatarUrl:F().optional()}).loose(),kB=U([`auth-required`,`network`]);oo(`ok`,[B({ok:W(!0),owners:z(OB)}).loose(),B({ok:W(!1),error:kB}).loose()]),oo(`ok`,[B({ok:W(!0),available:L()}).loose(),B({ok:W(!1),error:kB}).loose()]);const AB=U([`public`,`private`]);B({owner:F().min(1),name:F().min(1),visibility:AB,description:F().optional()}).loose();const jB=U([`name-conflict`,`saml-sso`,`auth-required`,`push-failed`,`init-failed`,`network`,`no-project`]);oo(`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:jB}).loose()]);function MB(e){return!(typeof e!=`string`||e.length===0||e.startsWith(`-`)||/[\x00-\x1F\x7F]/.test(e)||/\s/.test(e)||e.includes(`:`)||e.split(`/`).includes(`..`))}const NB=e=>e.refine(MB,`invalid branch name`),PB={shareTargetExists:L(),dirtyConflicts:B({conflicts:L(),files:z(F().min(1))}).loose(),branchIsLocal:L(),shareTargetOnOriginBranch:L().optional()};oo(`detached`,[B({detached:W(!1),currentBranch:F().min(1).nullable(),currentHeadSha:Xa(),...PB}).loose(),B({detached:W(!0),currentBranch:Xa(),currentHeadSha:F().min(1),...PB}).loose()]),B({branch:NB(F().min(1)),principalId:F().optional(),fastForward:L().optional()}).loose();const FB=U([`dirty-conflict`,`branch-not-found`,`fetch-failed`,`checkout-failed`,`branch-in-other-worktree`,`ff-diverged`]);oo(`ok`,[B({ok:W(!0)}).loose(),B({ok:W(!1),reason:FB,files:z(F().min(1)).optional(),otherWorktreePath:F().min(1).optional()}).loose()]),U([`on-origin`,`renamed`,`deleted`,`never-on-branch`,`changed-locally`,`unknown`]),B({branch:NB(F().min(1)),path:F(),kind:U([`doc`,`folder`]),contentRootDepth:I().int().min(1).max(65535).optional()}).loose(),oo(`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 IB=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:IB.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 LB=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:method-not-allowed.urn:ok:error:invalid-request.urn:ok:error:payload-too-large.urn:ok:error:request-timeout.urn:ok:error:internal-server-error.urn:ok:error: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:doc-not-found.urn:ok:error:doc-already-exists.urn:ok:error:doc-not-open.urn:ok:error:rollback-not-configured.urn:ok:error:doc-not-available.urn:ok:error:backlink-index-not-configured.urn:ok:error:file-rescan-not-configured.urn:ok:error:shadow-not-configured.urn:ok:error:host-not-allowed.urn:ok:error:principal-not-available.urn:ok:error:not-found.urn:ok:error:auth-failed.urn:ok:error:no-project-dir.urn:ok:error:server-open-failed.urn:ok:error:doc-in-conflict.urn:ok:error: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(`.`)),RB=B({type:LB,title:F().min(1),status:I().int().min(400).max(599),instance:F().regex(wB,`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(MB,`invalid branch name`).optional()}).loose(),B({type:W(`error`),problem:RB}).loose();function zB(e,t){let n=t.map(e=>[Lu(e),e]);for(let t of e){let e=Lu(t);if(e===null)continue;let r=n.find(([t])=>t===e);if(r!==void 0)return r[1]}}function BB(e){let{override:t,storedPreference:n,preferenceList:r,supportedLocales:i}=e,a=e.autoDetectableLocales??i;if(t!==void 0){let e=zB([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=zB(r,a);return o===void 0?{locale:`en`,source:`fallback`}:{locale:o,source:`system`}}const VB=[`.ok`,`local`,`installed-skills.json`],HB=U(gs),UB=ro({hosts:z(F()),scope:HB,scripts:L(),installedAt:la(),projection:U([`symlink`,`copy`]).optional(),contentHash:F().optional()}),WB=ro({schema:W(1),skills:H(F(),UB).default({})});function GB(e){let t;try{t=JSON.parse(e)}catch{return null}let n=WB.safeParse(t);return n.success?n.data:null}const KB=[{name:`github-pat`,regex:/\b(ghp_|gho_|ghu_|ghs_|ghr_)[A-Za-z0-9]{36,}\b/g,replacement:`[REDACTED-GH-PAT]`},{name:`aws-access-key`,regex:/\b(AKIA|ASIA|ABIA)[A-Z2-7]{16}\b/g,replacement:`[REDACTED-AWS-KEY]`},{name:`anthropic-key`,regex:/\bsk-ant-api03-[A-Za-z0-9_-]{20,}\b/g,replacement:`[REDACTED-ANTHROPIC]`},{name:`openai-key`,regex:/\bsk-[A-Za-z0-9]{20,}\b/g,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`,regex:/eyJ[A-Za-z0-9_-]{8,}\.eyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}/g,replacement:`[REDACTED-JWT]`},{name:`url-credentials`,regex:/:\/\/[^/\s:@"]+:[^/\s:@"]+@/g,replacement:`://[REDACTED]@`},{name:`github-pat-fine-grained`,regex:/\bgithub_pat_[0-9A-Za-z_]{20,}/g,replacement:`[REDACTED-GH-PAT]`},{name:`openai-key-modern`,regex:/\bsk-(?:proj|svcacct|admin|None)-[A-Za-z0-9_-]{20,}/g,replacement:`[REDACTED-OPENAI]`},{name:`slack-token`,regex:/\bxox[a-z]-[A-Za-z0-9-]{10,}/g,replacement:`[REDACTED-SLACK]`},{name:`google-api-key`,regex:/\bAIza[0-9A-Za-z_-]{35}/g,replacement:`[REDACTED-GOOGLE]`},{name:`stripe-secret-key`,regex:/\b(?:sk|rk)_live_[0-9A-Za-z]{16,}\b/g,replacement:`[REDACTED-STRIPE]`},{name:`gitlab-pat`,regex:/\bglpat-[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:`~`}],qB=KB.map(e=>e.name);function JB(e){let t=new Set,n=0;return{redacted:e.split(`
|
|
343
|
+
`)}})]}}),Qz=bv.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 $z(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||eB(n)===r||LR(e)===t}function eB(e){return e.replace(/\\([!-/:-@[-`{-~])/g,`$1`)}const tB=cS.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`~~`,rendered:!1}}}}),nB=hx.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDashCounts:{default:null},sourceOuterPipes:{default:null,rendered:!1},sourceAlignmentPadding:{default:null,rendered:!1}}}}),rB=ex.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),iB=tx.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),aB=jv.create({name:`tag`,marks:`_`,group:`inline`,inline:!0,atom:!0,selectable:!0,priority:60,renderText:iz,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()}}}),oB=/^(?:---|—-|___\s|\*\*\*\s)$/;function sB(e){let t=String(e[0]??``).replace(/\s+$/,``);return t===`—-`?`---`:t}const cB=Tx.extend({name:`thematicBreak`,priority:60,addAttributes(){return{...this.parent?.(),sourceRaw:{default:`---`}}},addInputRules(){return[wv({find:oB,type:this.type,getAttributes:e=>({sourceRaw:sB(e)})})]}}),lB=dS.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceForm:{default:`u`,rendered:!1}}}});function uB(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function dB(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}const fB=jv.create({name:`wikiLink`,marks:`_`,group:`inline`,inline:!0,atom:!0,priority:60,renderText:iz,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:uB(e.getAttribute(`data-alias`)),anchor:uB(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:uB(e.getAttribute(`data-alias`)),anchor:uB(e.getAttribute(`data-anchor`)),resolved:!1}:!1}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.target??``),r=uB(e.attrs.alias),i=uB(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`},dB({target:n,alias:r,anchor:i})]}});function pB(e){let t=e.split(`/`).pop()??e,n=t.lastIndexOf(`.`);return n<=0||n===t.length-1?``:t.slice(n+1).toLowerCase()}function mB(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}const hB=[fz,Rz,pz,Lz,fB,jv.create({name:`wikiLinkEmbed`,group:`inline`,inline:!0,atom:!0,priority:60,renderText:iz,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:uB(e.getAttribute(`data-alias`)),anchor:uB(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=uB(e.attrs.alias),i=uB(e.attrs.anchor),a=uB(e.attrs.resolvedSrc),o=pB(n);if(el.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`},mB({target:n,alias:r,anchor:i})]}}),aB,Fz,Iz,ez,tz,tB,lB,Bz,$R,zz,sz,cB,bz,cz,xz,oz,nz,Uz,Qz,Zz,tC.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}}),Xz,nB.configure({resizable:!0}),nx,iB,rB,dz.configure({inline:!0}),lz,uy,Hz,Vz,az,rz],gB=B({changes:z(oo(`kind`,[B({key:F(),kind:W(`added`),after:ps}).loose(),B({key:F(),kind:W(`removed`),before:ps}).loose(),B({key:F(),kind:W(`changed`),before:ps,after:ps}).loose()])),unparseable:B({before:F(),after:F()}).loose().nullable()}).loose();3072-_B("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 _B(e,t){let n=encodeURIComponent(e);return t===`cursor`?encodeURIComponent(n).length:n.length}function vB(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 yB(e,t){let n=vB(e);n.ok||t.addIssue({code:`custom`,message:n.reason})}const bB=F().superRefine(yB).optional(),xB=F().superRefine(yB),SB={agentId:F().optional(),agentName:F().optional(),colorSeed:F().optional(),clientName:F().optional(),clientVersion:F().optional(),label:F().optional()},CB=F().optional(),wB=/^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;oo(`kind`,[B({kind:W(`doc`),docPath:F().min(1)}).loose(),B({kind:W(`folder`),folderPath:F()}).loose()]);const TB=U([`no-remote`,`detached-head`,`branch-not-on-origin`,`non-github-remote`,`invalid-path`,`unsupported-share-url`]),EB=U([`current`,`stale`,`absent`,`empty`]);oo(`ok`,[B({ok:W(!0),shareUrl:F().min(1),sharedUrl:F().min(1),branch:F().min(1),freshness:EB.optional().catch(void 0)}).loose(),B({ok:W(!1),error:TB,branch:F().min(1).optional()}).loose()]);const DB=U([`user`,`org`]),OB=B({login:F().min(1),kind:DB,avatarUrl:F().optional()}).loose(),kB=U([`auth-required`,`network`]);oo(`ok`,[B({ok:W(!0),owners:z(OB)}).loose(),B({ok:W(!1),error:kB}).loose()]),oo(`ok`,[B({ok:W(!0),available:L()}).loose(),B({ok:W(!1),error:kB}).loose()]);const AB=U([`public`,`private`]);B({owner:F().min(1),name:F().min(1),visibility:AB,description:F().optional()}).loose();const jB=U([`name-conflict`,`saml-sso`,`auth-required`,`push-failed`,`init-failed`,`network`,`no-project`]);oo(`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:jB}).loose()]);function MB(e){return!(typeof e!=`string`||e.length===0||e.startsWith(`-`)||/[\x00-\x1F\x7F]/.test(e)||/\s/.test(e)||e.includes(`:`)||e.split(`/`).includes(`..`))}const NB=e=>e.refine(MB,`invalid branch name`),PB={shareTargetExists:L(),dirtyConflicts:B({conflicts:L(),files:z(F().min(1))}).loose(),branchIsLocal:L(),shareTargetOnOriginBranch:L().optional()};oo(`detached`,[B({detached:W(!1),currentBranch:F().min(1).nullable(),currentHeadSha:Xa(),...PB}).loose(),B({detached:W(!0),currentBranch:Xa(),currentHeadSha:F().min(1),...PB}).loose()]),B({branch:NB(F().min(1)),principalId:F().optional(),fastForward:L().optional()}).loose();const FB=U([`dirty-conflict`,`branch-not-found`,`fetch-failed`,`checkout-failed`,`branch-in-other-worktree`,`ff-diverged`]);oo(`ok`,[B({ok:W(!0)}).loose(),B({ok:W(!1),reason:FB,files:z(F().min(1)).optional(),otherWorktreePath:F().min(1).optional()}).loose()]),U([`on-origin`,`renamed`,`deleted`,`never-on-branch`,`changed-locally`,`unknown`]),B({branch:NB(F().min(1)),path:F(),kind:U([`doc`,`folder`]),contentRootDepth:I().int().min(1).max(65535).optional()}).loose(),oo(`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 IB=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:IB.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 LB=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: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:doc-not-found.urn:ok:error:doc-already-exists.urn:ok:error:doc-not-open.urn:ok:error:rollback-not-configured.urn:ok:error:doc-not-available.urn:ok:error:backlink-index-not-configured.urn:ok:error:file-rescan-not-configured.urn:ok:error:shadow-not-configured.urn:ok:error:host-not-allowed.urn:ok:error:principal-not-available.urn:ok:error:not-found.urn:ok:error:auth-failed.urn:ok:error:no-project-dir.urn:ok:error:server-open-failed.urn:ok:error:doc-in-conflict.urn:ok:error: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(`.`)),RB=B({type:LB,title:F().min(1),status:I().int().min(400).max(599),instance:F().regex(wB,`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(MB,`invalid branch name`).optional()}).loose(),B({type:W(`error`),problem:RB}).loose();function zB(e,t){let n=t.map(e=>[Lu(e),e]);for(let t of e){let e=Lu(t);if(e===null)continue;let r=n.find(([t])=>t===e);if(r!==void 0)return r[1]}}function BB(e){let{override:t,storedPreference:n,preferenceList:r,supportedLocales:i}=e,a=e.autoDetectableLocales??i;if(t!==void 0){let e=zB([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=zB(r,a);return o===void 0?{locale:`en`,source:`fallback`}:{locale:o,source:`system`}}const VB=[`.ok`,`local`,`installed-skills.json`],HB=U(gs),UB=ro({hosts:z(F()),scope:HB,scripts:L(),installedAt:la(),projection:U([`symlink`,`copy`]).optional(),contentHash:F().optional()}),WB=ro({schema:W(1),skills:H(F(),UB).default({})});function GB(e){let t;try{t=JSON.parse(e)}catch{return null}let n=WB.safeParse(t);return n.success?n.data:null}const KB=[{name:`github-pat`,regex:/\b(ghp_|gho_|ghu_|ghs_|ghr_)[A-Za-z0-9]{36,}\b/g,replacement:`[REDACTED-GH-PAT]`},{name:`aws-access-key`,regex:/\b(AKIA|ASIA|ABIA)[A-Z2-7]{16}\b/g,replacement:`[REDACTED-AWS-KEY]`},{name:`anthropic-key`,regex:/\bsk-ant-api03-[A-Za-z0-9_-]{20,}\b/g,replacement:`[REDACTED-ANTHROPIC]`},{name:`openai-key`,regex:/\bsk-[A-Za-z0-9]{20,}\b/g,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`,regex:/eyJ[A-Za-z0-9_-]{8,}\.eyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}/g,replacement:`[REDACTED-JWT]`},{name:`url-credentials`,regex:/:\/\/[^/\s:@"]+:[^/\s:@"]+@/g,replacement:`://[REDACTED]@`},{name:`github-pat-fine-grained`,regex:/\bgithub_pat_[0-9A-Za-z_]{20,}/g,replacement:`[REDACTED-GH-PAT]`},{name:`openai-key-modern`,regex:/\bsk-(?:proj|svcacct|admin|None)-[A-Za-z0-9_-]{20,}/g,replacement:`[REDACTED-OPENAI]`},{name:`slack-token`,regex:/\bxox[a-z]-[A-Za-z0-9-]{10,}/g,replacement:`[REDACTED-SLACK]`},{name:`google-api-key`,regex:/\bAIza[0-9A-Za-z_-]{35}/g,replacement:`[REDACTED-GOOGLE]`},{name:`stripe-secret-key`,regex:/\b(?:sk|rk)_live_[0-9A-Za-z]{16,}\b/g,replacement:`[REDACTED-STRIPE]`},{name:`gitlab-pat`,regex:/\bglpat-[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:`~`}],qB=KB.map(e=>e.name);function JB(e){let t=new Set,n=0;return{redacted:e.split(`
|
|
344
344
|
`).map(e=>{let r=e,i=!1;for(let{name:e,regex:n,replacement:a}of KB)n.lastIndex=0,n.test(r)&&(t.add(e),i=!0,n.lastIndex=0,r=r.replace(n,a));return i&&n++,r}).join(`
|
|
345
345
|
`),patterns:[...t],lineCount:n}}function YB(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 XB(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(`
|
|
@@ -417,7 +417,7 @@ ${t.slice(l+2)}`,d+=1;else break}t.push({indent:l,number:parseInt(s,10),content:
|
|
|
417
417
|
`);return i.messages.map(e=>yJ(e,o))}function xJ(e){let t=!1;return yD(e,[`link`,`linkReference`],()=>(t=!0,!1)),t}const SJ=gJ(`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)}yD(e,`listItem`,e=>{e.children.some(e=>e.type===`list`)||xJ(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)})}),CJ=/^\s*(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])(?!\d)/;function wJ(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 TJ=/^\s*\d{4}[-/.]\d{1,2}[-/.]\d{1,2}/;function EJ(e){let t=e.trim();return t.length>60?`${t.slice(0,59)}…`:t}const DJ=gJ(`log-shape`,`**/log`,(e,t)=>{let n;yD(e,`heading`,e=>{if(e.depth!==2)return;let r=rC(e),i=CJ.exec(r);if(!i){t.message(TJ.test(r)?`Log date heading "${EJ(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 "${EJ(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(!wJ(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})}),OJ=/\[\[[^[\]\n]+\]\]/g;function kJ(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 AJ=hJ(`no-wiki-links`,(e,t)=>{let n=typeof t.value==`string`?t.value:String(t.value);yD(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]===`
|
|
418
418
|
`?(c+=1,l=1):l+=1;return{line:c,column:l}};for(let e of o.matchAll(OJ)){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(kJ(e[0]),s)}})}),jJ=[`index`,`log`];function MJ(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);if(n<=0)return t;let r=t.slice(n).toLowerCase();return JR.includes(r)?t.slice(0,n):t}const NJ=hJ(`reserved-casing`,(e,t)=>{let n=t.data.okfDocName;if(n===void 0)return;let r=MJ(n),i=r.toLowerCase();jJ.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.`)}),PJ=[{id:`no-wiki-links`,rule:AJ},{id:`log-shape`,rule:DJ},{id:`index-shape`,rule:SJ},{id:`reserved-casing`,rule:NJ}],FJ=PJ.map(e=>e.rule);function IJ(e){return e===void 0?FJ:PJ.filter(t=>eJ(e,t.id)).map(e=>e.rule)}const LJ=V([L(),U(Tl),H(F(),R())]),RJ={id:`markdownlint`,sliceSchema:B({enabled:L(),rules:H(F(),LJ)}),defaultSlice:{enabled:!1,rules:Cq},async lint(e,t){return Jq(e,wq(t.rules))},fix(e,t){return qq(e,wq(t.rules))}},zJ=B({appliesTo:V([F(),z(F())]).optional(),file:F(),enabled:L().optional(),key:F().optional(),schema:H(F(),R()).optional()}),BJ=[RJ,{id:`frontmatter`,sliceSchema:B({enabled:L(),schemas:z(zJ)}),defaultSlice:{enabled:!1,schemas:[]},async lint(e,t,n){return Kq(e,Dq(t.schemas,n.docName))},frontmatter:{schemasForDoc:(e,t)=>Dq(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[...bJ(e,IJ(t.rules),n.docName),...mJ(e,t.rules,n.docName)]},frontmatter:{schemasForDoc:(e,t)=>fJ(e.rules,t),narrowSliceToFrontmatter:e=>({...e,rules:{...e.rules,...dJ}}),advertisedMappings:e=>pJ(e.rules)}}];Object.fromEntries(BJ.map(e=>[e.id,e.defaultSlice])),B({docName:bB,summary:CB,content:F().optional(),...SB}).loose(),B({docName:bB,summary:CB,markdown:F(),position:U([`append`,`prepend`,`replace`]).optional(),extension:U(JR).optional(),...SB}).loose(),B({docName:bB,summary:CB,find:F().min(1),replace:F(),offset:I().int().nonnegative().optional(),...SB}).loose(),B({docName:bB,connectionId:F().min(1),scope:U([`last`,`session`,`file`,`count`]).optional(),count:I().int().positive().optional(),...SB}).loose().refine(e=>e.scope!==`count`||e.count!==void 0,{message:`count is required when scope is 'count'`,path:[`count`]});const VJ=B({value:F(),truncatedFrom:I().int().nonnegative().optional(),hint:F().optional()}).loose(),HJ=oo(`kind`,[B({kind:W(`inline`),content:F()}),B({kind:W(`truncated`),byteLength:I().int().nonnegative(),hint:F()})]),UJ=B({kind:W(`content-divergence`),intendedBytes:I().int().nonnegative(),actualBytes:I().int().nonnegative(),byteDelta:I().int(),divergenceType:F().optional(),currentState:HJ.optional(),hint:F().optional()}).loose(),WJ=B({type:W(`orphan`),parentCandidates:z(F()),message:F()}).loose(),GJ=B({kind:W(`disk-edit-reconciled`),intendedBytes:I().int().nonnegative(),actualBytes:I().int().nonnegative(),byteDelta:I().int(),mergeOutcome:F().optional(),hint:F().optional()}).loose();oo(`kind`,[UJ,GJ]);const KJ=Object.keys({"content-divergence":!0,"disk-edit-reconciled":!0}),qJ=B({kind:W(`mermaid-parse-error`),fenceIndex:I().int().positive(),fenceFirstLine:F(),message:F(),line:I().int().positive().optional()}).loose(),JJ=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(),YJ=oo(`kind`,[UJ,GJ,qJ,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:JJ.optional()}).loose()]),XJ=z(YJ).min(1),ZJ=B({href:F(),resolvedTo:F().nullable(),reason:U([`no-such-doc`,`no-such-file`,`unresolvable`]),localTarget:JJ.optional()}).loose(),QJ=z(ZJ);B({timestamp:F().min(1),summary:VJ.optional(),warnings:XJ.optional()}).loose(),B({timestamp:F().min(1),subscriberCount:I().int().nonnegative(),systemSubscriberCount:I().int().nonnegative(),hints:z(WJ).optional(),summary:VJ.optional(),warnings:XJ.optional(),brokenLinks:QJ}).loose(),B({timestamp:F().min(1),subscriberCount:I().int().nonnegative(),systemSubscriberCount:I().int().nonnegative(),summary:VJ.optional(),warnings:XJ.optional(),brokenLinks:QJ}).loose(),B({docName:F().min(1),scope:U([`last`,`session`,`count`]),undone:L()}).loose(),B({docs:z(B({docName:xB,markdown:F(),position:U([`append`,`prepend`,`replace`]).optional(),extension:U(JR).optional(),summary:CB}).loose()).min(1).max(100),...SB}).loose();const $J=B({type:LB,title:F(),detail:F().optional()}).loose(),eY=oo(`status`,[B({status:W(`written`),docName:F().min(1),summary:VJ.optional(),warnings:XJ.optional(),brokenLinks:QJ}).loose(),B({status:W(`error`),docName:F().min(1),error:$J}).loose()]);B({timestamp:F().min(1),results:z(eY),written:I().int().nonnegative(),failed:I().int().nonnegative()}).loose(),B({docName:bB,patch:H(F(),V([ps,Xa()])),types:H(F(),U(ds)).optional(),summary:CB,...SB}).loose(),B({timestamp:F().min(1),subscriberCount:I().int().nonnegative(),systemSubscriberCount:I().int().nonnegative(),appliedKeys:z(F()),summary:VJ.optional(),warnings:XJ.optional(),brokenLinks:QJ}).loose();const tY=Object.fromEntries(BJ.map(e=>[e.id,e.sliceSchema]));B({effective:B({enabled:L(),plugins:B(tY)}),configFile:F().nullable().optional(),configProblems:z(F()).optional()});const nY=V([L(),H(F(),R())]);B({ruleId:F().min(1).max(64).regex(/^[A-Za-z][A-Za-z0-9_-]*$/),value:V([nY,Xa()])}),B({file:F().min(1).max(512),delete:W(!0).optional(),field:F().min(1).max(256).optional(),parentPath:z(V([F().min(1).max(256),B({items:W(!0)}).strict()])).max(8).optional(),removeField:W(!0).optional(),renameTo:F().min(1).max(256).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 rY=B({line:I(),character:I()}),iY=B({start:rY,end:rY}),aY=B({range:iY,severity:U([`error`,`warning`,`info`,`hint`]),source:F(),code:F(),message:F(),fixes:z(B({range:iY,newText:F()})).optional(),frontmatterScope:U(Sl).optional(),frontmatterProperty:F().optional()}),oY=z(F()).optional();B({files:z(B({file:F(),diagnostics:z(aY),ran:oY,warnings:z(F()).optional()})),fileCount:I(),errorCount:I(),warningCount:I(),warnings:z(F()),ran:oY});const sY=aY.extend({linkTarget:F().optional(),localTarget:JJ.optional()});B({files:z(B({file:F(),diagnostics:z(sY)})),fileCount:I(),errorCount:I(),warningCount:I(),warnings:z(F()),ran:oY});const cY=B({errorCount:I().int().nonnegative(),warningCount:I().int().nonnegative()});B({files:z(B({file:F(),lint:cY,links:cY})),fileCount:I().int().nonnegative(),errorCount:I().int().nonnegative(),warningCount:I().int().nonnegative(),warnings:z(F())}),B({docName:bB,summary:CB,...SB}).loose();const lY=B({reason:U([`re-lint-threw`,`source-went-blind`]),message:F().min(1)});B({file:F(),fixedCount:I(),diagnostics:z(aY),errorCount:I(),warningCount:I(),ran:oY,warnings:z(F()).optional(),diagnosticsArePreFix:L().optional(),reLintFailure:lY.optional()});const uY=[{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 uY){e.set(t.id.toUpperCase(),t.id);for(let n of t.aliases)e.set(n.toUpperCase(),t.id)}return e})();const dY=new Set([`img`,`video`,`audio`,`mark`,`u`,`ins`]);new Map(UV.flatMap(e=>e.surface===`compat`&&dY.has(e.rendersAs)?[[e.name,e]]:[])),jC(`<>`);const fY=[{tagName:`Mirror`,attrName:`src`,resolution:`bare-doc-name`},{tagName:`Excalidraw`,attrName:`src`,resolution:`doc-relative`}];for(let e of fY){let t=UV.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.`)}Mj(),XA(),ZA();function pY(){return UV.filter(e=>e.surface===`canonical`&&e.name!==`*`)}function mY(){return pY().filter(e=>{let t=hY(e);return t!==`fence`&&t!==`html`})}function hY(e){return e.name===`MermaidFence`?`fence`:e.name===`HtmlAlignBlock`?`html`:e.hasChildren?`jsx-block`:`jsx-void`}function gY(e){return{id:e.name,displayName:e.displayName??e.name,description:e.description??``,kind:hY(e)}}function _Y(){return[``,"**Custom canonical components.** OK `.md` / `.mdx` supports the JSX components below. For source syntax + parameter schemas, call `palette({ components: [ids] })`. Arbitrary `<TagName>` JSX falls through as raw MDX when no canonical fits.",``,...mY().map(gY).map(e=>`- \`${e.id}\` (${e.kind}) — ${e.description}`)].join(`
|
|
419
419
|
`)}function vY(){return[_Y(),``,"Fenced code blocks render naturally and don't need a fetch — including ` ```mermaid ` for diagrams (mermaid label text has sharp edges — `palette({ components: [\"Mermaid\"] })` lists them; parse failures come back as `warnings` entries on write/edit) and ` ```html preview ` for interactive HTML/JS/CSS pages (the fence info-string `preview` token renders the block as a live iframe; works for `html` / `htm` / `xml`; optional `h=` / `w=` tokens set size, e.g. ` ```html preview h=400px `). Use ` ```html preview ` whenever you want anything interactive or JS-powered (charts, demos, calculators, animations) — just author the standalone HTML page in the fence. Call `palette` for the markdown-native component forms (write `> [!NOTE]`, not `<Callout>`), copy-ready themed `html preview` starters, and the theme tokens (`var(--chart-1)`, `var(--foreground)`, …) an embed should reference so it tracks the reader's light/dark theme."].join(`
|
|
420
|
-
`)}B({intents:z(B({satisfierId:F().min(1),desired:U([`present`,`absent`])}).loose()),...SB,summary:CB}).loose();const yY=B({satisfierId:F(),agentId:F(),piece:F(),scope:F(),kind:F(),pathId:F().optional(),desired:U([`present`,`absent`]),action:U(Ao),errorId:F().optional()}).loose(),bY=B({kind:F(),satisfierIds:z(F()),agentIds:z(F()),pathId:F().optional(),blockedReason:F().optional()}).loose(),xY=B({state:F(),strictness:z(U(Oo)).optional()}).loose(),SY=B({probes:B({env:U([`desktop`,`local-web`,`remote-web`]),satisfiers:H(F(),xY)}).loose(),detection:B({detected:z(F()),probed:L()}).loose()}).loose();B({actions:z(yY),conflicts:z(bY),withheld:z(F()),snapshot:SY}).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 CY=B({exact:F().min(1),prefix:F(),suffix:F(),start:I().int().nonnegative(),end:I().int().nonnegative()}),wY=z(V([F(),I().int().nonnegative()])),TY=oo(`kind`,[B({kind:W(`body`)}),B({kind:W(`property`),key:F().min(1),path:wY.default([])})]).default({kind:`body`}),EY=U([`anchored`,`orphaned`,`resolved`]),DY=B({threadId:F().min(1),docName:F().min(1),target:TY,anchor:CY.nullable(),state:EY,queued:L(),latestComment:F(),createdBy:F().min(1),createdAt:I(),updatedAt:I().optional()}),OY=B({docName:F(),instruction:F(),property:F().nullable(),passage:B({exact:F(),prefix:F(),suffix:F()}).nullable(),anchorLost:L(),passageRepeats:L()}).loose(),kY=B({threadId:F(),ok:W(!0)}),AY=B({threadId:F(),ok:W(!1),error:W(`not-found`)});B({threads:z(DY)}).loose(),B({meta:DY,orphaned:L()}).loose(),B({threadId:F()}).loose(),B({meta:DY,payload:OY}).loose(),B({results:z(V([kY.extend({meta:DY,payload:OY}),AY]))}).loose(),B({results:z(V([kY.extend({meta:DY}),AY]))}).loose();const jY=B({status:F().min(1),reason:F()}).loose();B({docName:F().min(1),content:F(),lifecycle:jY.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 MY=B({source:F().min(1),anchor:F().nullable(),title:F(),snippet:F().nullable()}).loose();B({docName:F().min(1),backlinks:z(MY)}).loose(),B({counts:H(F().min(1),I().int().nonnegative())}).loose(),B({counts:H(F().min(1),I().int().nonnegative())}).loose();const NY=oo(`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()]),PY=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(NY),localTargets:z(PY).optional()}).loose();const FY=oo(`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()]),IY=B({source:F().min(1),target:F().min(1)}).loose();B({nodes:z(FY),links:z(IY)}).loose();const LY=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(),RY=B({app:V([W(`cursor`),W(`codex`),W(`claude`),Xa()]),signals_fired:z(F())}).loose();B({entries:z(LY),count:I().int().min(0),detection:RY}).loose();const zY=B({path:F().min(1),code:U([`M`,`A`,`D`,`R`,`C`,`U`,`T`,`?`,`!`,` `]),origPath:F().min(1).optional(),syncScoped:L(),open:oo(`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(zY),notStaged:z(zY),untracked:z(zY),incoming:z(zY),truncated:L(),readable:L().default(!0)}).loose(),B({writers:z(B({id:F().min(1),name:F().optional(),email:F().optional()}).loose()).optional(),summary:CB,...SB}).loose(),B({checkpointRef:F().min(1)}).loose();const BY=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(BY),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(oo(`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 VY=B({domain:F().min(1),title:F().optional(),description:F().optional(),siteName:F().optional(),faviconDataUri:F().optional()}).loose();B({url:F()}).loose(),oo(`ok`,[B({ok:W(!0),metadata:VY}).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 HY=B({source:F().min(1),title:F(),snippet:F().nullable()}).loose();B({deadLinks:z(B({target:F().min(1),sources:z(HY)}).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 UY=U([`not-a-git-worktree`,`init-failed`]);oo(`ok`,[B({ok:W(!0),projectPath:F().min(1)}).loose(),B({ok:W(!1),reason:UY,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 WY=U([`no_key`,`invalid_endpoint`,`rate_limit`,`timeout`,`http_error`,`network`,`dims_mismatch`,`malformed_response`]);oo(`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:WY,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 GY=B({stackIndex:I().int().min(0),ts:I().int().min(0),additions:I().int().min(0),deletions:I().int().min(0)}).loose(),ume=B({docName:F().min(1),additionsTotal:I().int().min(0),deletionsTotal:I().int().min(0),lastTs:I().int().min(0),bursts:z(GY)}).loose(),dme=B({displayName:F().min(1),color:F().min(1),icon:F().optional(),connectionId:F().min(1)}).loose();B({sessionAlive:L(),agent:dme.nullable(),files:z(ume)}).loose(),B({diff:F(),before:F(),after:F(),properties:gB,generatedAt:I().int().min(0)}).loose(),B({}).loose(),B({}).loose(),B({}).loose(),B({}).loose(),B({}).loose(),B({}).loose();const fme=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),fme)}).loose();const pme=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(pme)}).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 mme=B({fromDocName:F().min(1),toDocName:F().min(1)}).loose(),hme=B({fromPath:F().min(1),toPath:F().min(1)}).loose();B({}).loose(),B({path:F().min(1),...SB,summary:CB}).loose(),B({docName:F().min(1)}).loose(),B({path:F().min(1),...SB,summary:CB}).loose(),B({path:F().min(1)}).loose(),B({kind:U([`file`,`folder`]),path:F().min(1),...SB,summary:CB}).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 gme=B({level:I().int().min(1).max(6),text:F(),slug:F()}).loose();B({docName:F().min(1),headings:z(gme)}).loose();const _me=B({docName:F().min(1),rewrites:I().int().nonnegative()}).loose();B({kind:U([`file`,`folder`,`asset`]),fromPath:F().min(1),toPath:F().min(1),...SB,summary:CB}).loose(),B({renamed:z(mme),renamedAssets:z(hme),rewrittenDocs:z(_me).optional(),summary:VJ.optional()}).loose(),B({kind:U([`file`,`folder`,`asset`]),path:F().min(1),...SB}).loose(),B({deletedDocNames:z(F().min(1))}).loose(),B({kind:U([`file`,`folder`,`asset`]),path:F().min(1),...SB,summary:CB}).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:CB,...SB}).loose(),B({restoredFrom:F().min(1),timestamp:F().min(1),summary:VJ.optional(),warnings:XJ.optional()}).loose();const vme=/^#[0-9a-fA-F]{6}$/,yme=B(Object.fromEntries(El.map(e=>[e,F().regex(vme,`must be a #rrggbb hex color`)]))),KY=F().min(1).refine(kl,{message:`must contain a non-whitespace character`}),qY=B({name:KY,author:KY.optional(),variant:U([`dark`,`light`]),palette:yme}).loose();B({name:F().min(1),scheme:qY,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:qY}).loose(),B({id:F().min(1),filename:F().min(1)}).loose(),oo(`existed`,[B({existed:W(!1)}).loose(),B({existed:W(!0),filename:F().min(1),scheme:qY}).loose()]),B({themes:z(oo(`ok`,[B({ok:W(!0),id:F().min(1),filename:F().min(1),scheme:qY}),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 bme=U([`dormant`,`idle`,`fetching`,`pulling`,`pushing`,`conflict`,`offline`,`auth-error`,`disabled`]),xme=B({label:F().min(1),webUrl:ka().nullable()}).loose(),Sme=oo(`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()]),JY=U([`auth-403`,`auth-401`,`auth-scope-mismatch`,`auth-no-credential`,`auth-not-found-as-identity`,`semantic-protected-branch`]),Cme=U(Uc),wme=U([`succeeded`,`up-to-date`,`conflict`,`refused`,`error`]);B({state:bme,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:xme.nullable().optional(),pushError:F().optional(),pushErrorCode:JY.optional(),pullError:F().optional(),pullErrorCode:JY.optional(),pausedReason:F().optional(),blockingPaths:z(F().min(1)).optional(),pushPermission:Sme.optional(),syncMode:Cme.optional(),lastPullUtc:F().nullable().optional(),lastPullOutcome:wme.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(),B({conflicts:z(B({file:F().min(1),detectedAt:F().min(1),oursSha:F().optional(),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&&e.content!==``,{message:`content must be a non-empty string when strategy is 'content'`,path:[`content`]}),B({}).loose(),B({file:F().min(1),base:F(),ours:F(),theirs:F(),kind:U([`both-modified`,`delete-modify`,`modify-delete`]),lifecycleStatus:F().nullable()}).loose(),B({plan:wo(e=>e!==void 0,{message:`plan is required`})}).loose(),B({plan:wo(e=>e!==void 0,{message:`plan is required`})}).loose(),B({result:wo(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 Tme=B({path:F().min(1),summary:F().min(1)}).loose(),Eme=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(Tme),entryCounts:Eme}).loose())}).loose(),B({noOpen:L().optional(),out:F().min(1).optional()}).loose();const Dme=B({reason:U([`unsupported-platform`,`spawn-error`]),message:F()}).loose();oo(`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:Dme.optional()}).loose(),B({status:W(`failed`),buildError:F()}).loose(),B({status:W(`skip-current`),skillVersion:F(),recordedAt:F().optional()}).loose()]);const YY=U(gn),Ome=U(_n),kme=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 Ame=B({docName:F().min(1),title:F(),matchingTags:z(F().min(1)),snippet:F().nullable()}).loose();B({name:F().min(1),docs:z(Ame)}).loose(),B({folder:R(),frontmatter_local:H(F(),R()).nullable()}).loose(),B({path:F(),frontmatter:H(F(),R()).optional()}).loose(),B({applied:R()}).loose();const XY=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:XY,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:XY.optional(),...SB,summary:CB}).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(),...SB,summary:CB}).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:XY.optional(),...SB,summary:CB}).strict(),B({from:F().min(1),to:F().min(1),committed:L()}).strict();const ZY=U(gs),jme=/^[a-z0-9-]+$/,QY=B({name:F(),description:F(),metadata:B({pack:F()}).strict().optional()}).strict();B({skill:B({name:F().min(1),scope:ZY,path:F().min(1),frontmatter:QY,body:F(),files:z(B({path:F().min(1),text:F().nullable()})).optional(),managed:L().optional()}).strict()}).strict();const Mme=B({source:F().min(1),publisher:F().optional(),skill:F().optional(),marketplaceUrl:F().optional(),importedAt:F().min(1),autoUpdate:L().optional()}).strict(),Nme=B({name:F().min(1),description:F().optional(),scope:ZY,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:Mme.optional(),pack:F().optional(),modified:L().optional(),revertable:L().optional(),ignored:L().optional(),size:kme.optional()}).strict();B({name:F().min(1),scope:ZY,apply:L().optional()}).strict(),B({line:F().min(1),gitignorePath:F().min(1),applied:L(),alreadyTracked:L().optional()}).strict(),B({skills:z(Nme),truncated:L()}).strict(),B({scope:ZY.default(`project`),name:F().meta({description:`Managed skill name to create or update.`}),body:F().optional(),frontmatter:QY,...SB,summary:CB}).strict(),B({path:F().min(1),created:L(),warnings:z(F())}).strict(),B({scope:ZY.default(`project`),name:F(),dryRun:L().optional(),setAutoUpdate:L().optional(),...SB,summary:CB}).strict(),B({name:F().min(1),updated:L(),source:F().min(1),localBody:F().optional(),upstreamBody:F().optional(),gitTracked:L().optional(),warnings:z(F())}).strict(),B({scope:ZY.default(`project`),name:F(),...SB,summary:CB}).strict(),B({name:F().min(1),baselineRef:F().min(1),restoredFiles:z(F()),warnings:z(F())}).strict(),B({existed:L(),path:F().min(1)}).strict(),B({scope:ZY.default(`project`),fromName:F(),toName:F(),body:F().optional(),frontmatter:QY.optional(),...SB,summary:CB}).strict(),B({from:F().min(1),to:F().min(1),committed:L()}).strict(),B({name:F(),fromScope:ZY,toScope:ZY,...SB,summary:CB}).strict(),B({scope:ZY,path:F().optional()}).strict(),B({scope:ZY,name:F(),toName:F(),...SB,summary:CB}).strict(),B({name:F().min(1)}).strict(),B({name:F(),home:F().min(1)}).strict(),B({docName:F().min(1)}).strict();const $Y=U([`reference`,`script`,`file`]);B({scope:ZY.default(`project`),name:F(),path:F().min(1),content:F(),...SB,summary:CB}).strict(),B({path:F().min(1),created:L(),kind:$Y,content:L()}).strict(),B({scope:ZY.default(`project`),name:F(),from:F().min(1),to:F().min(1),...SB,summary:CB}).strict(),B({from:F().min(1),to:F().min(1),fromDocName:F().optional(),toDocName:F().optional()}).strict(),B({path:F().min(1),kind:$Y,text:F()}).strict(),B({path:F().min(1),existed:L(),kind:$Y}).strict();const eX=V([Ome,W(`agents`)]),tX=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`}),nX=V([eX,tX]);B({scope:ZY.default(`project`),name:F(),targets:z(eX).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(nX).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(nX).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:nX.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:nX.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(),...SB,summary:CB,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"}),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([`no-targets`,`scripts-present`,`name-conflict`,`no-description`,`skill-fork-name-unpatched`,`place-path-invalid`,`place-fork-refused`])).meta({description:"Machine-readable warning codes aligned with `warnings`."}),placedAt:F().optional(),sourceMovedTo:F().optional()}).strict(),B({scope:ZY.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(YY),configured:L(),folders:z(B({scope:ZY,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 rX=B({action:W(`link`),scope:ZY,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.`})}),iX=B({action:W(`unlink`),scope:ZY,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(),aX=B({action:W(`add-root`),scope:ZY,root:tX.meta({description:`New custom skills root to declare (base-relative, e.g. ".team/skills").`})}).strict(),Pme=oo(`action`,[rX.extend({preview:L().optional().meta({description:`Return the merge plan only (moves, drops, removes, conflicts, strays) — nothing is written.`})}).strict(),iX,aX]);oo(`action`,[rX.strict(),iX,aX]),B({folderAction:Pme}).strict();const Fme=B({moves:z(F()),drops:z(F()),removes:z(F()),replaces:z(F()),conflicts:z(F()),strays:z(F())}).strict();B({targets:z(YY),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:Fme.optional()}).strict(),B({scope:ZY.default(`project`),name:F(),version:F().regex(/^[0-9a-f]{40}$/i),...SB,summary:CB}).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 Ime=B({kind:U([`page`,`folder`,`content`,`file`]),path:F().min(1),title:F(),score:I(),signals:H(F(),R()),snippet:F().optional()}).loose(),Lme=B({capable:L(),applied:L(),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(),embedded:I().int().nonnegative(),total:I().int().nonnegative()}).loose(),B({query:F(),intent:U([`autocomplete`,`full_text`,`omnibar`]),results:z(Ime),elapsedMs:I().nonnegative(),semantic:Lme.optional(),truncated:L().optional(),ready:L().optional()}).loose();const Rme=B({version:F().min(1),recordedAt:F().min(1)}).loose();B({currentVersion:F().min(1),targets:H(F(),Rme.nullable())}).loose(),B({scope:ZY.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."}),...SB,summary:CB}).strict(),B({scope:ZY.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."}),...SB,summary:CB}).strict(),B({results:z(B({requested:F(),status:U([`imported`,`already-imported`,`not-found`,`failed`]),name:F().optional(),collisionRenamedFrom:F().optional(),warnings:z(F()),error:F().optional()}).loose()),imported:I(),alreadyImported:I(),failed:I()}).loose(),B({scope:ZY.default(`project`),names:z(F().min(1)).min(1).max(100).meta({description:`Managed skill names to refresh from their recorded upstreams.`}),...SB,summary:CB}).strict(),B({results:z(B({requested:F(),status:U([`updated`,`up-to-date`,`not-found`,`failed`]),source:F().optional(),warnings:z(F()),error:F().optional()}).loose()),updated:I(),upToDate:I(),failed:I()}).loose();const zme=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:zme,warnings:z(F()).meta({description:`Non-fatal import warnings, such as skipped unsupported files.`})}).loose();const Bme=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:Bme,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:Vre}).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 oX=Symbol.for(`@inkeep/open-knowledge/skill-state-field-registry`),sX=globalThis;sX[oX]===void 0&&(sX[oX]=Ci());const cX=sX[oX],lX=ro({version:F().regex(/^\d+\.\d+\.\d+(?:[-+][\w.-]+)?$/,`version must match /^\\d+\\.\\d+\\.\\d+(?:[-+][\\w.-]+)?$/`).register(cX,{description:`Recorded skill version for this target.`}),recordedAt:la().register(cX,{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(cX,{description:`Install-source surface that recorded this entry.`}).optional()}),Vme=ro({enabled:L().register(cX,{description:`Whether this user-global skill bundle is opted in.`}),decidedAt:la().register(cX,{description:`ISO 8601 timestamp of the opt-in / opt-out decision.`})});ro({schema:W(1).register(cX,{description:`Schema major version. Bumped only on breaking shape changes.`}),targets:ro({"claude-cowork":lX.optional(),"cli-hosts":lX.optional()}).register(cX,{description:`Per-target install-state entries. Absent target = no recorded install.`}).default({}),bundles:H(F(),Vme).register(cX,{description:`Per-bundle opt-in decisions keyed by install name. Absent key = no recorded decision.`}).optional(),installsReported:z(F()).register(cX,{description:"Skill installs already reported to skills.sh from this machine, as `<owner/repo>#<skill>`. Append-only; presence suppresses a re-report."}).optional()});const uX=e=>e*8+4;uX(92),uX(40),Array.from({length:256},(e,t)=>(t+256).toString(16).slice(1));const dX={fileSystem:`File System`,gitUpstream:`Git (upstream)`,service:`OpenKnowledge (service)`,generator:`OpenKnowledge (generated)`};Hc();var Hme=Object.create,fX=Object.defineProperty,Ume=Object.getOwnPropertyDescriptor,Wme=Object.getOwnPropertyNames,Gme=Object.getPrototypeOf,pX=Object.prototype.hasOwnProperty,mX=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),Kme=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=Wme(t),a=0,o=i.length,s;a<o;a++)s=i[a],!pX.call(e,s)&&s!==n&&fX(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=Ume(t,s))||r.enumerable});return e},hX=(e,t,n)=>(n=e==null?{}:Hme(Gme(e)),Kme(t||!e||!e.__esModule||!pX.call(e,`default`)?fX(n,`default`,{value:e,enumerable:!0}):n,e)),gX=a(import.meta.url),_X=mX(((e,t)=>{let n=e=>e&&typeof e.message==`string`,r=e=>{if(!e)return;let t=e.cause;if(typeof t==`function`){let t=e.cause();return n(t)?t:void 0}return n(t)?t:void 0},i=(e,t)=>{if(!n(e))return``;let a=e.stack||``;if(t.has(e))return a+`
|
|
420
|
+
`)}B({intents:z(B({satisfierId:F().min(1),desired:U([`present`,`absent`])}).loose()),...SB,summary:CB}).loose();const yY=B({satisfierId:F(),agentId:F(),piece:F(),scope:F(),kind:F(),pathId:F().optional(),desired:U([`present`,`absent`]),action:U(Ao),errorId:F().optional()}).loose(),bY=B({kind:F(),satisfierIds:z(F()),agentIds:z(F()),pathId:F().optional(),blockedReason:F().optional()}).loose(),xY=B({state:F(),strictness:z(U(Oo)).optional()}).loose(),SY=B({probes:B({env:U([`desktop`,`local-web`,`remote-web`]),satisfiers:H(F(),xY)}).loose(),detection:B({detected:z(F()),probed:L()}).loose()}).loose();B({actions:z(yY),conflicts:z(bY),withheld:z(F()),snapshot:SY}).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 CY=B({exact:F().min(1),prefix:F(),suffix:F(),start:I().int().nonnegative(),end:I().int().nonnegative()}),wY=z(V([F(),I().int().nonnegative()])),TY=oo(`kind`,[B({kind:W(`body`)}),B({kind:W(`property`),key:F().min(1),path:wY.default([])})]).default({kind:`body`}),EY=U([`anchored`,`orphaned`,`resolved`]),DY=B({threadId:F().min(1),docName:F().min(1),target:TY,anchor:CY.nullable(),state:EY,queued:L(),latestComment:F(),createdBy:F().min(1),createdAt:I(),updatedAt:I().optional()}),OY=B({docName:F(),instruction:F(),property:F().nullable(),passage:B({exact:F(),prefix:F(),suffix:F()}).nullable(),anchorLost:L(),passageRepeats:L()}).loose(),kY=B({threadId:F(),ok:W(!0)}),AY=B({threadId:F(),ok:W(!1),error:W(`not-found`)});B({threads:z(DY)}).loose(),B({meta:DY,orphaned:L()}).loose(),B({threadId:F()}).loose(),B({meta:DY,payload:OY}).loose(),B({results:z(V([kY.extend({meta:DY,payload:OY}),AY]))}).loose(),B({results:z(V([kY.extend({meta:DY}),AY]))}).loose();const jY=B({status:F().min(1),reason:F()}).loose();B({docName:F().min(1),content:F(),lifecycle:jY.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 MY=B({source:F().min(1),anchor:F().nullable(),title:F(),snippet:F().nullable()}).loose();B({docName:F().min(1),backlinks:z(MY)}).loose(),B({counts:H(F().min(1),I().int().nonnegative())}).loose(),B({counts:H(F().min(1),I().int().nonnegative())}).loose();const NY=oo(`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()]),PY=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(NY),localTargets:z(PY).optional()}).loose();const FY=oo(`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()]),IY=B({source:F().min(1),target:F().min(1)}).loose();B({nodes:z(FY),links:z(IY)}).loose();const LY=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(),RY=B({app:V([W(`cursor`),W(`codex`),W(`claude`),Xa()]),signals_fired:z(F())}).loose();B({entries:z(LY),count:I().int().min(0),detection:RY}).loose();const zY=B({path:F().min(1),code:U([`M`,`A`,`D`,`R`,`C`,`U`,`T`,`?`,`!`,` `]),origPath:F().min(1).optional(),syncScoped:L(),open:oo(`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(zY),notStaged:z(zY),untracked:z(zY),incoming:z(zY),truncated:L(),readable:L().default(!0)}).loose(),B({writers:z(B({id:F().min(1),name:F().optional(),email:F().optional()}).loose()).optional(),summary:CB,...SB}).loose(),B({checkpointRef:F().min(1)}).loose();const BY=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(BY),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(oo(`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 VY=B({domain:F().min(1),title:F().optional(),description:F().optional(),siteName:F().optional(),faviconDataUri:F().optional()}).loose();B({url:F()}).loose(),oo(`ok`,[B({ok:W(!0),metadata:VY}).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 HY=B({source:F().min(1),title:F(),snippet:F().nullable()}).loose();B({deadLinks:z(B({target:F().min(1),sources:z(HY)}).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 UY=U([`not-a-git-worktree`,`init-failed`]);oo(`ok`,[B({ok:W(!0),projectPath:F().min(1)}).loose(),B({ok:W(!1),reason:UY,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 WY=U([`no_key`,`invalid_endpoint`,`rate_limit`,`timeout`,`http_error`,`network`,`dims_mismatch`,`malformed_response`]);oo(`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:WY,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 GY=B({stackIndex:I().int().min(0),ts:I().int().min(0),additions:I().int().min(0),deletions:I().int().min(0)}).loose(),ume=B({docName:F().min(1),additionsTotal:I().int().min(0),deletionsTotal:I().int().min(0),lastTs:I().int().min(0),bursts:z(GY)}).loose(),dme=B({displayName:F().min(1),color:F().min(1),icon:F().optional(),connectionId:F().min(1)}).loose();B({sessionAlive:L(),agent:dme.nullable(),files:z(ume)}).loose(),B({diff:F(),before:F(),after:F(),properties:gB,generatedAt:I().int().min(0)}).loose(),B({}).loose(),B({}).loose(),B({}).loose(),B({}).loose(),B({}).loose(),B({}).loose();const fme=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),fme)}).loose();const pme=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(pme)}).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 mme=B({fromDocName:F().min(1),toDocName:F().min(1)}).loose(),hme=B({fromPath:F().min(1),toPath:F().min(1)}).loose();B({}).loose(),B({path:F().min(1),...SB,summary:CB}).loose(),B({docName:F().min(1)}).loose(),B({path:F().min(1),...SB,summary:CB}).loose(),B({path:F().min(1)}).loose(),B({kind:U([`file`,`folder`]),path:F().min(1),...SB,summary:CB}).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 gme=B({level:I().int().min(1).max(6),text:F(),slug:F()}).loose();B({docName:F().min(1),headings:z(gme)}).loose();const _me=B({docName:F().min(1),rewrites:I().int().nonnegative()}).loose();B({kind:U([`file`,`folder`,`asset`]),fromPath:F().min(1),toPath:F().min(1),...SB,summary:CB}).loose(),B({renamed:z(mme),renamedAssets:z(hme),rewrittenDocs:z(_me).optional(),summary:VJ.optional()}).loose(),B({kind:U([`file`,`folder`,`asset`]),path:F().min(1),...SB}).loose(),B({deletedDocNames:z(F().min(1))}).loose(),B({kind:U([`file`,`folder`,`asset`]),path:F().min(1),...SB,summary:CB}).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:CB,...SB}).loose(),B({restoredFrom:F().min(1),timestamp:F().min(1),summary:VJ.optional(),warnings:XJ.optional()}).loose();const vme=/^#[0-9a-fA-F]{6}$/,yme=B(Object.fromEntries(El.map(e=>[e,F().regex(vme,`must be a #rrggbb hex color`)]))),KY=F().min(1).refine(kl,{message:`must contain a non-whitespace character`}),qY=B({name:KY,author:KY.optional(),variant:U([`dark`,`light`]),palette:yme}).loose();B({name:F().min(1),scheme:qY,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:qY}).loose(),B({id:F().min(1),filename:F().min(1)}).loose(),oo(`existed`,[B({existed:W(!1)}).loose(),B({existed:W(!0),filename:F().min(1),scheme:qY}).loose()]),B({themes:z(oo(`ok`,[B({ok:W(!0),id:F().min(1),filename:F().min(1),scheme:qY}),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 bme=U([`dormant`,`idle`,`fetching`,`pulling`,`pushing`,`conflict`,`offline`,`auth-error`,`disabled`]),xme=B({label:F().min(1),webUrl:ka().nullable()}).loose(),Sme=oo(`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()]),JY=U([`auth-403`,`auth-401`,`auth-scope-mismatch`,`auth-no-credential`,`auth-not-found-as-identity`,`semantic-protected-branch`]),Cme=U(Uc),wme=U([`succeeded`,`up-to-date`,`conflict`,`refused`,`error`]);B({state:bme,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:xme.nullable().optional(),pushError:F().optional(),pushErrorCode:JY.optional(),pullError:F().optional(),pullErrorCode:JY.optional(),pausedReason:F().optional(),blockingPaths:z(F().min(1)).optional(),pushPermission:Sme.optional(),syncMode:Cme.optional(),lastPullUtc:F().nullable().optional(),lastPullOutcome:wme.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(),B({conflicts:z(B({file:F().min(1),detectedAt:F().min(1),oursSha:F().optional(),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&&e.content!==``,{message:`content must be a non-empty string when strategy is 'content'`,path:[`content`]}),B({}).loose(),B({file:F().min(1),base:F(),ours:F(),theirs:F(),kind:U([`both-modified`,`delete-modify`,`modify-delete`]),lifecycleStatus:F().nullable()}).loose(),B({plan:wo(e=>e!==void 0,{message:`plan is required`})}).loose(),B({plan:wo(e=>e!==void 0,{message:`plan is required`})}).loose(),B({result:wo(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 Tme=B({path:F().min(1),summary:F().min(1)}).loose(),Eme=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(Tme),entryCounts:Eme}).loose())}).loose(),B({noOpen:L().optional(),out:F().min(1).optional()}).loose();const Dme=B({reason:U([`unsupported-platform`,`spawn-error`]),message:F()}).loose();oo(`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:Dme.optional()}).loose(),B({status:W(`failed`),buildError:F()}).loose(),B({status:W(`skip-current`),skillVersion:F(),recordedAt:F().optional()}).loose()]);const YY=U(gn),Ome=U(_n),kme=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 Ame=B({docName:F().min(1),title:F(),matchingTags:z(F().min(1)),snippet:F().nullable()}).loose();B({name:F().min(1),docs:z(Ame)}).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 XY=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:XY,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:XY.optional(),...SB,summary:CB}).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(),...SB,summary:CB}).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:XY.optional(),...SB,summary:CB}).strict(),B({from:F().min(1),to:F().min(1),committed:L()}).strict();const ZY=U(gs),jme=/^[a-z0-9-]+$/,QY=B({name:F(),description:F(),metadata:B({pack:F()}).strict().optional()}).strict();B({skill:B({name:F().min(1),scope:ZY,path:F().min(1),frontmatter:QY,body:F(),files:z(B({path:F().min(1),text:F().nullable()})).optional(),managed:L().optional()}).strict()}).strict();const Mme=B({source:F().min(1),publisher:F().optional(),skill:F().optional(),marketplaceUrl:F().optional(),importedAt:F().min(1),autoUpdate:L().optional()}).strict(),Nme=B({name:F().min(1),description:F().optional(),scope:ZY,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:Mme.optional(),pack:F().optional(),modified:L().optional(),revertable:L().optional(),ignored:L().optional(),size:kme.optional()}).strict();B({name:F().min(1),scope:ZY,apply:L().optional()}).strict(),B({line:F().min(1),gitignorePath:F().min(1),applied:L(),alreadyTracked:L().optional()}).strict(),B({skills:z(Nme),truncated:L()}).strict(),B({scope:ZY.default(`project`),name:F().meta({description:`Managed skill name to create or update.`}),body:F().optional(),frontmatter:QY,...SB,summary:CB}).strict(),B({path:F().min(1),created:L(),warnings:z(F())}).strict(),B({scope:ZY.default(`project`),name:F(),dryRun:L().optional(),setAutoUpdate:L().optional(),...SB,summary:CB}).strict(),B({name:F().min(1),updated:L(),source:F().min(1),localBody:F().optional(),upstreamBody:F().optional(),gitTracked:L().optional(),warnings:z(F())}).strict(),B({scope:ZY.default(`project`),name:F(),...SB,summary:CB}).strict(),B({name:F().min(1),baselineRef:F().min(1),restoredFiles:z(F()),warnings:z(F())}).strict(),B({existed:L(),path:F().min(1)}).strict(),B({scope:ZY.default(`project`),fromName:F(),toName:F(),body:F().optional(),frontmatter:QY.optional(),...SB,summary:CB}).strict(),B({from:F().min(1),to:F().min(1),committed:L()}).strict(),B({name:F(),fromScope:ZY,toScope:ZY,...SB,summary:CB}).strict(),B({scope:ZY,path:F().optional()}).strict(),B({scope:ZY,name:F(),toName:F(),...SB,summary:CB}).strict(),B({name:F().min(1)}).strict(),B({name:F(),home:F().min(1)}).strict(),B({docName:F().min(1)}).strict();const $Y=U([`reference`,`script`,`file`]);B({scope:ZY.default(`project`),name:F(),path:F().min(1),content:F(),...SB,summary:CB}).strict(),B({path:F().min(1),created:L(),kind:$Y,content:L()}).strict(),B({scope:ZY.default(`project`),name:F(),from:F().min(1),to:F().min(1),...SB,summary:CB}).strict(),B({from:F().min(1),to:F().min(1),fromDocName:F().optional(),toDocName:F().optional()}).strict(),B({path:F().min(1),kind:$Y,text:F()}).strict(),B({path:F().min(1),existed:L(),kind:$Y}).strict();const eX=V([Ome,W(`agents`)]),tX=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`}),nX=V([eX,tX]);B({scope:ZY.default(`project`),name:F(),targets:z(eX).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(nX).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(nX).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:nX.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:nX.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(),...SB,summary:CB,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"}),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([`no-targets`,`scripts-present`,`name-conflict`,`no-description`,`skill-fork-name-unpatched`,`place-path-invalid`,`place-fork-refused`])).meta({description:"Machine-readable warning codes aligned with `warnings`."}),placedAt:F().optional(),sourceMovedTo:F().optional()}).strict(),B({scope:ZY.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(YY),configured:L(),folders:z(B({scope:ZY,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 rX=B({action:W(`link`),scope:ZY,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.`})}),iX=B({action:W(`unlink`),scope:ZY,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(),aX=B({action:W(`add-root`),scope:ZY,root:tX.meta({description:`New custom skills root to declare (base-relative, e.g. ".team/skills").`})}).strict(),Pme=oo(`action`,[rX.extend({preview:L().optional().meta({description:`Return the merge plan only (moves, drops, removes, conflicts, strays) — nothing is written.`})}).strict(),iX,aX]);oo(`action`,[rX.strict(),iX,aX]),B({folderAction:Pme}).strict();const Fme=B({moves:z(F()),drops:z(F()),removes:z(F()),replaces:z(F()),conflicts:z(F()),strays:z(F())}).strict();B({targets:z(YY),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:Fme.optional()}).strict(),B({scope:ZY.default(`project`),name:F(),version:F().regex(/^[0-9a-f]{40}$/i),...SB,summary:CB}).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 Ime=B({kind:U([`page`,`folder`,`content`,`file`]),path:F().min(1),title:F(),score:I(),signals:H(F(),R()),snippet:F().optional()}).loose(),Lme=B({capable:L(),applied:L(),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(),embedded:I().int().nonnegative(),total:I().int().nonnegative()}).loose(),B({query:F(),intent:U([`autocomplete`,`full_text`,`omnibar`]),results:z(Ime),elapsedMs:I().nonnegative(),semantic:Lme.optional(),truncated:L().optional(),ready:L().optional()}).loose();const Rme=B({version:F().min(1),recordedAt:F().min(1)}).loose();B({currentVersion:F().min(1),targets:H(F(),Rme.nullable())}).loose(),B({scope:ZY.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."}),...SB,summary:CB}).strict(),B({scope:ZY.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."}),...SB,summary:CB}).strict(),B({results:z(B({requested:F(),status:U([`imported`,`already-imported`,`not-found`,`failed`]),name:F().optional(),collisionRenamedFrom:F().optional(),warnings:z(F()),error:F().optional()}).loose()),imported:I(),alreadyImported:I(),failed:I()}).loose(),B({scope:ZY.default(`project`),names:z(F().min(1)).min(1).max(100).meta({description:`Managed skill names to refresh from their recorded upstreams.`}),...SB,summary:CB}).strict(),B({results:z(B({requested:F(),status:U([`updated`,`up-to-date`,`not-found`,`failed`]),source:F().optional(),warnings:z(F()),error:F().optional()}).loose()),updated:I(),upToDate:I(),failed:I()}).loose();const zme=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:zme,warnings:z(F()).meta({description:`Non-fatal import warnings, such as skipped unsupported files.`})}).loose();const Bme=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:Bme,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:Vre}).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 oX=Symbol.for(`@inkeep/open-knowledge/skill-state-field-registry`),sX=globalThis;sX[oX]===void 0&&(sX[oX]=Ci());const cX=sX[oX],lX=ro({version:F().regex(/^\d+\.\d+\.\d+(?:[-+][\w.-]+)?$/,`version must match /^\\d+\\.\\d+\\.\\d+(?:[-+][\\w.-]+)?$/`).register(cX,{description:`Recorded skill version for this target.`}),recordedAt:la().register(cX,{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(cX,{description:`Install-source surface that recorded this entry.`}).optional()}),Vme=ro({enabled:L().register(cX,{description:`Whether this user-global skill bundle is opted in.`}),decidedAt:la().register(cX,{description:`ISO 8601 timestamp of the opt-in / opt-out decision.`})});ro({schema:W(1).register(cX,{description:`Schema major version. Bumped only on breaking shape changes.`}),targets:ro({"claude-cowork":lX.optional(),"cli-hosts":lX.optional()}).register(cX,{description:`Per-target install-state entries. Absent target = no recorded install.`}).default({}),bundles:H(F(),Vme).register(cX,{description:`Per-bundle opt-in decisions keyed by install name. Absent key = no recorded decision.`}).optional(),installsReported:z(F()).register(cX,{description:"Skill installs already reported to skills.sh from this machine, as `<owner/repo>#<skill>`. Append-only; presence suppresses a re-report."}).optional()});const uX=e=>e*8+4;uX(92),uX(40),Array.from({length:256},(e,t)=>(t+256).toString(16).slice(1));const dX={fileSystem:`File System`,gitUpstream:`Git (upstream)`,service:`OpenKnowledge (service)`,generator:`OpenKnowledge (generated)`};Hc();var Hme=Object.create,fX=Object.defineProperty,Ume=Object.getOwnPropertyDescriptor,Wme=Object.getOwnPropertyNames,Gme=Object.getPrototypeOf,pX=Object.prototype.hasOwnProperty,mX=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),Kme=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=Wme(t),a=0,o=i.length,s;a<o;a++)s=i[a],!pX.call(e,s)&&s!==n&&fX(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=Ume(t,s))||r.enumerable});return e},hX=(e,t,n)=>(n=e==null?{}:Hme(Gme(e)),Kme(t||!e||!e.__esModule||!pX.call(e,`default`)?fX(n,`default`,{value:e,enumerable:!0}):n,e)),gX=a(import.meta.url),_X=mX(((e,t)=>{let n=e=>e&&typeof e.message==`string`,r=e=>{if(!e)return;let t=e.cause;if(typeof t==`function`){let t=e.cause();return n(t)?t:void 0}return n(t)?t:void 0},i=(e,t)=>{if(!n(e))return``;let a=e.stack||``;if(t.has(e))return a+`
|
|
421
421
|
causes have become circular...`;let o=r(e);return o?(t.add(e),a+`
|
|
422
422
|
caused by: `+i(o,t)):a},a=e=>i(e,new Set),o=(e,t,i)=>{if(!n(e))return``;let a=i?``:e.message||``;if(t.has(e))return a+`: ...`;let s=r(e);if(s){t.add(e);let n=typeof e.cause==`function`;return a+(n?``:`: `)+o(s,t,n)}return a};t.exports={isErrorLike:n,getErrorCause:r,stackWithCauses:a,messageWithCauses:e=>o(e,new Set)}})),vX=mX(((e,t)=>{let n=Symbol(`circular-ref-tag`),r=Symbol(`pino-raw-err-ref`),i=Object.create({},{type:{enumerable:!0,writable:!0,value:void 0},message:{enumerable:!0,writable:!0,value:void 0},stack:{enumerable:!0,writable:!0,value:void 0},aggregateErrors:{enumerable:!0,writable:!0,value:void 0},raw:{enumerable:!1,get:function(){return this[r]},set:function(e){this[r]=e}}});Object.defineProperty(i,r,{writable:!0,value:{}}),t.exports={pinoErrProto:i,pinoErrorSymbols:{seen:n,rawSymbol:r}}})),qme=mX(((e,t)=>{t.exports=l;let{messageWithCauses:n,stackWithCauses:r,isErrorLike:i}=_X(),{pinoErrProto:a,pinoErrorSymbols:o}=vX(),{seen:s}=o,{toString:c}=Object.prototype;function l(e){if(!i(e))return e;e[s]=void 0;let t=Object.create(a);t.type=c.call(e.constructor)===`[object Function]`?e.constructor.name:e.name,t.message=n(e),t.stack=r(e),Array.isArray(e.errors)&&(t.aggregateErrors=e.errors.map(e=>l(e)));for(let n in e)if(t[n]===void 0){let r=e[n];i(r)?n!==`cause`&&!Object.prototype.hasOwnProperty.call(r,s)&&(t[n]=l(r)):t[n]=r}return delete e[s],t.raw=e,t}})),Jme=mX(((e,t)=>{t.exports=s;let{isErrorLike:n}=_X(),{pinoErrProto:r,pinoErrorSymbols:i}=vX(),{seen:a}=i,{toString:o}=Object.prototype;function s(e){if(!n(e))return e;e[a]=void 0;let t=Object.create(r);t.type=o.call(e.constructor)===`[object Function]`?e.constructor.name:e.name,t.message=e.message,t.stack=e.stack,Array.isArray(e.errors)&&(t.aggregateErrors=e.errors.map(e=>s(e))),n(e.cause)&&!Object.prototype.hasOwnProperty.call(e.cause,a)&&(t.cause=s(e.cause));for(let r in e)if(t[r]===void 0){let i=e[r];n(i)?Object.prototype.hasOwnProperty.call(i,a)||(t[r]=s(i)):t[r]=i}return delete e[a],t.raw=e,t}})),Yme=mX(((e,t)=>{t.exports={mapHttpRequest:a,reqSerializer:i};let n=Symbol(`pino-raw-req-ref`),r=Object.create({},{id:{enumerable:!0,writable:!0,value:``},method:{enumerable:!0,writable:!0,value:``},url:{enumerable:!0,writable:!0,value:``},query:{enumerable:!0,writable:!0,value:``},params:{enumerable:!0,writable:!0,value:``},headers:{enumerable:!0,writable:!0,value:{}},remoteAddress:{enumerable:!0,writable:!0,value:``},remotePort:{enumerable:!0,writable:!0,value:``},raw:{enumerable:!1,get:function(){return this[n]},set:function(e){this[n]=e}}});Object.defineProperty(r,n,{writable:!0,value:{}});function i(e){let t=e.info||e.socket,n=Object.create(r);if(n.id=typeof e.id==`function`?e.id():e.id||(e.info?e.info.id:void 0),n.method=e.method,e.originalUrl)n.url=e.originalUrl;else{let t=e.path;n.url=typeof t==`string`?t:e.url?e.url.path||e.url:void 0}return e.query&&(n.query=e.query),e.params&&(n.params=e.params),n.headers=e.headers,n.remoteAddress=t&&t.remoteAddress,n.remotePort=t&&t.remotePort,n.raw=e.raw||e,n}function a(e){return{req:i(e)}}})),yX=mX(((e,t)=>{t.exports={mapHttpResponse:a,resSerializer:i};let n=Symbol(`pino-raw-res-ref`),r=Object.create({},{statusCode:{enumerable:!0,writable:!0,value:0},headers:{enumerable:!0,writable:!0,value:``},raw:{enumerable:!1,get:function(){return this[n]},set:function(e){this[n]=e}}});Object.defineProperty(r,n,{writable:!0,value:{}});function i(e){let t=Object.create(r);return t.statusCode=e.headersSent?e.statusCode:null,t.headers=e.getHeaders?e.getHeaders():e._headers,t.raw=e,t}function a(e){return{res:i(e)}}})),bX=mX(((e,t)=>{let n=qme(),r=Jme(),i=Yme(),a=yX();t.exports={err:n,errWithCause:r,mapHttpRequest:i.mapHttpRequest,mapHttpResponse:a.mapHttpResponse,req:i.reqSerializer,res:a.resSerializer,wrapErrorSerializer:function(e){return e===n?e:function(t){return e(n(t))}},wrapRequestSerializer:function(e){return e===i.reqSerializer?e:function(t){return e(i.reqSerializer(t))}},wrapResponseSerializer:function(e){return e===a.resSerializer?e:function(t){return e(a.resSerializer(t))}}}})),xX=mX(((e,t)=>{function n(e,t){return t}t.exports=function(){let e=Error.prepareStackTrace;Error.prepareStackTrace=n;let t=Error().stack;if(Error.prepareStackTrace=e,!Array.isArray(t))return;let r=t.slice(2),i=[];for(let e of r)e&&i.push(e.getFileName());return i}})),Xme=mX(((e,t)=>{function n(e){if(typeof e!=`object`||!e)return e;if(e instanceof Date)return new Date(e.getTime());if(e instanceof Array){let t=[];for(let r=0;r<e.length;r++)t[r]=n(e[r]);return t}if(typeof e==`object`){let t=Object.create(Object.getPrototypeOf(e));for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=n(e[r]));return t}return e}function r(e){let t=[],n=``,r=!1,i=!1,a=``;for(let o=0;o<e.length;o++){let s=e[o];!r&&s===`.`?n&&=(t.push(n),``):s===`[`?(n&&=(t.push(n),``),r=!0):s===`]`&&r?(t.push(n),n=``,r=!1,i=!1):(s===`"`||s===`'`)&&r?i?s===a?(i=!1,a=``):n+=s:(i=!0,a=s):n+=s}return n&&t.push(n),t}function i(e,t,n){let r=e;for(let e=0;e<t.length-1;e++){let n=t[e];if(typeof r!=`object`||!r||!(n in r)||typeof r[n]!=`object`||r[n]===null)return!1;r=r[n]}let i=t[t.length-1];if(i===`*`){if(Array.isArray(r))for(let e=0;e<r.length;e++)r[e]=n;else if(typeof r==`object`&&r)for(let e in r)Object.prototype.hasOwnProperty.call(r,e)&&(r[e]=n)}else typeof r==`object`&&r&&i in r&&Object.prototype.hasOwnProperty.call(r,i)&&(r[i]=n);return!0}function a(e,t){let n=e;for(let e=0;e<t.length-1;e++){let r=t[e];if(typeof n!=`object`||!n||!(r in n)||typeof n[r]!=`object`||n[r]===null)return!1;n=n[r]}let r=t[t.length-1];if(r===`*`){if(Array.isArray(n))for(let e=0;e<n.length;e++)n[e]=void 0;else if(typeof n==`object`&&n)for(let e in n)Object.prototype.hasOwnProperty.call(n,e)&&delete n[e]}else typeof n==`object`&&n&&r in n&&Object.prototype.hasOwnProperty.call(n,r)&&delete n[r];return!0}let o=Symbol(`PATH_NOT_FOUND`);function s(e,t){let n=e;for(let e of t){if(typeof n!=`object`||!n||!n||!(e in n))return o;n=n[e]}return n}function c(e,t){let n=e;for(let e of t){if(typeof n!=`object`||!n||!n)return;n=n[e]}return n}function l(e,t,n,c=!1){for(let l of t){let t=r(l);if(t.includes(`*`))u(e,t,n,l,c);else if(c)a(e,t);else{let r=s(e,t);if(r===o)continue;i(e,t,typeof n==`function`?n(r,t):n)}}}function u(e,t,n,r,i=!1){let a=t.indexOf(`*`);if(a===t.length-1){let r=t.slice(0,-1),a=e;for(let e of r){if(typeof a!=`object`||!a||!a)return;a=a[e]}if(Array.isArray(a)){if(i)for(let e=0;e<a.length;e++)a[e]=void 0;else for(let e=0;e<a.length;e++){let t=[...r,e.toString()],i=typeof n==`function`?n(a[e],t):n;a[e]=i}}else if(typeof a==`object`&&a){if(i){let e=[];for(let t in a)Object.prototype.hasOwnProperty.call(a,t)&&e.push(t);for(let t of e)delete a[t]}else for(let e in a){let t=[...r,e],i=typeof n==`function`?n(a[e],t):n;a[e]=i}}}else d(e,t,n,a,r,i)}function d(e,t,n,r,o,s=!1){let l=t.slice(0,r),d=t.slice(r+1),f=[];function p(e,t){if(t===l.length){if(Array.isArray(e))for(let n=0;n<e.length;n++)f[t]=n.toString(),p(e[n],t+1);else if(typeof e==`object`&&e)for(let n in e)f[t]=n,p(e[n],t+1)}else if(t<l.length){let n=l[t];e&&typeof e==`object`&&e&&n in e&&(f[t]=n,p(e[n],t+1))}else if(d.includes(`*`))u(e,d,typeof n==`function`?(e,r)=>n(e,[...f.slice(0,t),...r]):n,o,s);else if(s)a(e,d);else{let r=typeof n==`function`?n(c(e,d),[...f.slice(0,t),...d]):n;i(e,d,r)}}if(l.length===0)p(e,0);else{let t=e;for(let e=0;e<l.length;e++){let n=l[e];if(typeof t!=`object`||!t||!t)return;t=t[n],f[e]=n}t!=null&&p(t,l.length)}}function f(e){if(e.length===0)return null;let t=new Map;for(let n of e){let e=r(n),i=t;for(let t=0;t<e.length;t++){let n=e[t];i.has(n)||i.set(n,new Map),i=i.get(n)}}return t}function p(e,t){if(!t)return e;function n(e,t,r=0){if(!t||t.size===0||typeof e!=`object`||!e)return e;if(e instanceof Date)return new Date(e.getTime());if(Array.isArray(e)){let r=[];for(let i=0;i<e.length;i++){let a=i.toString();t.has(a)||t.has(`*`)?r[i]=n(e[i],t.get(a)||t.get(`*`)):r[i]=e[i]}return r}let i=Object.create(Object.getPrototypeOf(e));for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(i[r]=t.has(r)||t.has(`*`)?n(e[r],t.get(r)||t.get(`*`)):e[r]);return i}return n(e,t)}function m(e){if(typeof e!=`string`)throw Error(`Paths must be (non-empty) strings`);if(e===``)throw Error(`Invalid redaction path ()`);if(e.includes(`..`)||e.includes(`,`))throw Error(`Invalid redaction path (${e})`);let t=0,n=!1,r=``;for(let i=0;i<e.length;i++){let a=e[i];if((a===`"`||a===`'`)&&t>0)n?a===r&&(n=!1,r=``):(n=!0,r=a);else if(a===`[`&&!n)t++;else if(a===`]`&&!n&&(t--,t<0))throw Error(`Invalid redaction path (${e})`)}if(t!==0)throw Error(`Invalid redaction path (${e})`)}function h(e){if(!Array.isArray(e))throw TypeError(`paths must be an array`);for(let t of e)m(t)}function g(e={}){let{paths:t=[],censor:r=`[REDACTED]`,serialize:i=JSON.stringify,strict:a=!0,remove:o=!1}=e;h(t);let s=f(t);return function(e){if(a&&(typeof e!=`object`||!e)&&(typeof e!=`object`||!e))return i?i(e):e;let c=p(e,s),u=e,d=r;return typeof r==`function`&&(d=r),l(c,t,d,o),i===!1?(c.restore=function(){return n(u)},c):typeof i==`function`?i(c):JSON.stringify(c)}}t.exports=g})),SX=mX(((e,t)=>{let n=Symbol(`pino.setLevel`),r=Symbol(`pino.getLevel`),i=Symbol(`pino.levelVal`),a=Symbol(`pino.levelComp`),o=Symbol(`pino.useLevelLabels`),s=Symbol(`pino.useOnlyCustomLevels`),c=Symbol(`pino.mixin`),l=Symbol(`pino.lsCache`),u=Symbol(`pino.chindings`),d=Symbol(`pino.asJson`),f=Symbol(`pino.write`),p=Symbol(`pino.redactFmt`),m=Symbol(`pino.time`),h=Symbol(`pino.timeSliceIndex`),g=Symbol(`pino.stream`),_=Symbol(`pino.stringify`),v=Symbol(`pino.stringifySafe`),y=Symbol(`pino.stringifiers`),b=Symbol(`pino.end`),x=Symbol(`pino.formatOpts`),S=Symbol(`pino.messageKey`),C=Symbol(`pino.errorKey`),w=Symbol(`pino.nestedKey`),T=Symbol(`pino.nestedKeyStr`),E=Symbol(`pino.mixinMergeStrategy`),D=Symbol(`pino.msgPrefix`),O=Symbol(`pino.wildcardFirst`),ee=Symbol.for(`pino.serializers`),te=Symbol.for(`pino.formatters`),ne=Symbol.for(`pino.hooks`);t.exports={setLevelSym:n,getLevelSym:r,levelValSym:i,levelCompSym:a,useLevelLabelsSym:o,mixinSym:c,lsCacheSym:l,chindingsSym:u,asJsonSym:d,writeSym:f,serializersSym:ee,redactFmtSym:p,timeSym:m,timeSliceIndexSym:h,streamSym:g,stringifySym:_,stringifySafeSym:v,stringifiersSym:y,endSym:b,formatOptsSym:x,messageKeySym:S,errorKeySym:C,nestedKeySym:w,wildcardFirstSym:O,needsMetadataGsym:Symbol.for(`pino.metadata`),useOnlyCustomLevelsSym:s,formattersSym:te,hooksSym:ne,nestedKeyStrSym:T,mixinMergeStrategySym:E,msgPrefixSym:D}})),CX=mX(((e,t)=>{let n=Xme(),{redactFmtSym:r,wildcardFirstSym:i}=SX(),a=/[^.[\]]+|\[([^[\]]*?)\]/g,o=`[Redacted]`;function s(e,t){let{paths:o,censor:s,remove:l}=c(e),u=o.reduce((e,t)=>{a.lastIndex=0;let n=a.exec(t),r=a.exec(t),o=n[1]===void 0?n[0]:n[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/,`$1`);if(o===`*`&&(o=i),r===null)return e[o]=null,e;if(e[o]===null)return e;let{index:s}=r,c=`${t.substr(s,t.length-1)}`;return e[o]=e[o]||[],o!==i&&e[o].length===0&&e[o].push(...e[i]||[]),o===i&&Object.keys(e).forEach(function(t){e[t]&&e[t].push(c)}),e[o].push(c),e},{}),d={[r]:n({paths:o,censor:s,serialize:t,strict:!1,remove:l})},f=(...e)=>t(typeof s==`function`?s(...e):s);return[...Object.keys(u),...Object.getOwnPropertySymbols(u)].reduce((e,r)=>{if(u[r]===null)e[r]=e=>f(e,[r]);else{let i=typeof s==`function`?(e,t)=>s(e,[r,...t]):s;e[r]=n({paths:u[r],censor:i,serialize:t,strict:!1,remove:l})}return e},d)}function c(e){if(Array.isArray(e))return e={paths:e,censor:o},e;let{paths:t,censor:n=o,remove:r}=e;if(Array.isArray(t)===!1)throw Error(`pino – redact must contain an array of strings`);return r===!0&&(n=void 0),{paths:t,censor:n,remove:r}}t.exports=s})),Zme=mX(((e,t)=>{let n=()=>``,r=()=>`,"time":${Date.now()}`,i=()=>`,"time":${Math.round(Date.now()/1e3)}`,a=()=>`,"time":"${new Date(Date.now()).toISOString()}"`,o=1000000000n,s=BigInt(Date.now())*1000000n,c=process.hrtime.bigint();t.exports={nullTime:n,epochTime:r,unixTime:i,isoTime:a,isoTimeNano:()=>{let e=process.hrtime.bigint()-c,t=s+e,n=t/o,r=t%o,i=Number(n*1000n+r/1000000n),a=new Date(i);return`,"time":"${a.getUTCFullYear()}-${(a.getUTCMonth()+1).toString().padStart(2,`0`)}-${a.getUTCDate().toString().padStart(2,`0`)}T${a.getUTCHours().toString().padStart(2,`0`)}:${a.getUTCMinutes().toString().padStart(2,`0`)}:${a.getUTCSeconds().toString().padStart(2,`0`)}.${r.toString().padStart(9,`0`)}Z"`}}})),Qme=mX(((e,t)=>{function n(e){try{return JSON.stringify(e)}catch{return`"[Circular]"`}}t.exports=r;function r(e,t,r){var i=r&&r.stringify||n,a=1;if(typeof e==`object`&&e){var o=t.length+a;if(o===1)return e;var s=Array(o);s[0]=i(e);for(var c=1;c<o;c++)s[c]=i(t[c]);return s.join(` `)}if(typeof e!=`string`)return e;var l=t.length;if(l===0)return e;for(var u=``,d=1-a,f=-1,p=e&&e.length||0,m=0;m<p;){if(e.charCodeAt(m)===37&&m+1<p){switch(f=f>-1?f:0,e.charCodeAt(m+1)){case 100:case 102:if(d>=l||t[d]==null)break;f<m&&(u+=e.slice(f,m)),u+=Number(t[d]),f=m+2,m++;break;case 105:if(d>=l||t[d]==null)break;f<m&&(u+=e.slice(f,m)),u+=Math.floor(Number(t[d])),f=m+2,m++;break;case 79:case 111:case 106:if(d>=l||t[d]===void 0)break;f<m&&(u+=e.slice(f,m));var h=typeof t[d];if(h===`string`){u+=`'`+t[d]+`'`,f=m+2,m++;break}if(h===`function`){u+=t[d].name||`<anonymous>`,f=m+2,m++;break}u+=i(t[d]),f=m+2,m++;break;case 115:if(d>=l)break;f<m&&(u+=e.slice(f,m)),u+=String(t[d]),f=m+2,m++;break;case 37:f<m&&(u+=e.slice(f,m)),u+=`%`,f=m+2,m++,d--}++d}++m}return f===-1?e:(f<p&&(u+=e.slice(f)),u)}})),wX=mX(((e,t)=>{if(typeof SharedArrayBuffer<`u`&&typeof Atomics<`u`){let e=new Int32Array(new SharedArrayBuffer(4));function n(t){if(!(t>0&&t<1/0))throw typeof t!=`number`&&typeof t!=`bigint`?TypeError(`sleep: ms must be a number`):RangeError(`sleep: ms must be a number that is greater than 0 but less than Infinity`);Atomics.wait(e,0,0,Number(t))}t.exports=n}else{function e(e){if(!(e>0&&e<1/0))throw typeof e!=`number`&&typeof e!=`bigint`?TypeError(`sleep: ms must be a number`):RangeError(`sleep: ms must be a number that is greater than 0 but less than Infinity`);let t=Date.now()+Number(e);for(;t>Date.now(););}t.exports=e}})),TX=mX(((e,t)=>{let n=gX(`fs`),r=gX(`events`),i=gX(`util`).inherits,a=gX(`path`),o=wX(),s=gX(`assert`),c=Buffer.allocUnsafe(0),l=`buffer`,u=`utf8`,[d,f]=(process.versions.node||`0.0`).split(`.`).map(Number),p=d>=22&&f>=7;function m(e,t){t._opening=!0,t._writing=!0,t._asyncDrainScheduled=!1;function r(n,r){if(n){t._reopening=!1,t._writing=!1,t._opening=!1,t.sync?process.nextTick(()=>{t.listenerCount(`error`)>0&&t.emit(`error`,n)}):t.emit(`error`,n);return}let i=t._reopening;t.fd=r,t.file=e,t._reopening=!1,t._opening=!1,t._writing=!1,t.sync?process.nextTick(()=>t.emit(`ready`)):t.emit(`ready`),!t.destroyed&&(!t._writing&&t._len>t.minLength||t._flushPending?t._actualWrite():i&&process.nextTick(()=>t.emit(`drain`)))}let i=t.append?`a`:`w`,o=t.mode;if(t.sync)try{t.mkdir&&n.mkdirSync(a.dirname(e),{recursive:!0}),r(null,n.openSync(e,i,o))}catch(e){throw r(e),e}else t.mkdir?n.mkdir(a.dirname(e),{recursive:!0},t=>{if(t)return r(t);n.open(e,i,o,r)}):n.open(e,i,o,r)}function h(e){if(!(this instanceof h))return new h(e);let{fd:t,dest:r,minLength:i,maxLength:a,maxWrite:s,periodicFlush:d,sync:f,append:p=!0,mkdir:v,retryEAGAIN:x,fsync:ee,contentMode:te,mode:ne}=e||{};t||=r,this._len=0,this.fd=-1,this._bufs=[],this._lens=[],this._writing=!1,this._ending=!1,this._reopening=!1,this._asyncDrainScheduled=!1,this._flushPending=!1,this._hwm=Math.max(i||0,16387),this.file=null,this.destroyed=!1,this.minLength=i||0,this.maxLength=a||0,this.maxWrite=s||16384,this._periodicFlush=d||0,this._periodicFlushTimer=void 0,this.sync=f||!1,this.writable=!0,this._fsync=ee||!1,this.append=p||!1,this.mode=ne,this.retryEAGAIN=x||(()=>!0),this.mkdir=v||!1;let re,ie;if(te===l)this._writingBuf=c,this.write=b,this.flush=C,this.flushSync=T,this._actualWrite=D,re=()=>n.writeSync(this.fd,this._writingBuf),ie=()=>n.write(this.fd,this._writingBuf,this.release);else if(te===void 0||te===u)this._writingBuf=``,this.write=y,this.flush=S,this.flushSync=w,this._actualWrite=E,re=()=>Buffer.isBuffer(this._writingBuf)?n.writeSync(this.fd,this._writingBuf):n.writeSync(this.fd,this._writingBuf,`utf8`),ie=()=>Buffer.isBuffer(this._writingBuf)?n.write(this.fd,this._writingBuf,this.release):n.write(this.fd,this._writingBuf,`utf8`,this.release);else throw Error(`SonicBoom supports "${u}" and "${l}", but passed ${te}`);if(typeof t==`number`)this.fd=t,process.nextTick(()=>this.emit(`ready`));else if(typeof t==`string`)m(t,this);else throw Error(`SonicBoom supports only file descriptors and files`);if(this.minLength>=this.maxWrite)throw Error(`minLength should be smaller than maxWrite (${this.maxWrite})`);this.release=(e,t)=>{if(e){if((e.code===`EAGAIN`||e.code===`EBUSY`)&&this.retryEAGAIN(e,this._writingBuf.length,this._len-this._writingBuf.length)){if(this.sync)try{o(100),this.release(void 0,0)}catch(e){this.release(e)}else setTimeout(ie,100)}else this._writing=!1,this.emit(`error`,e);return}this.emit(`write`,t);let r=g(this._writingBuf,this._len,t);if(this._len=r.len,this._writingBuf=r.writingBuf,this._writingBuf.length){if(!this.sync){ie();return}try{do{let e=re(),t=g(this._writingBuf,this._len,e);this._len=t.len,this._writingBuf=t.writingBuf}while(this._writingBuf.length)}catch(e){this.release(e);return}}this._fsync&&n.fsyncSync(this.fd);let i=this._len;this._reopening?(this._writing=!1,this._reopening=!1,this.reopen()):i>this.minLength?this._actualWrite():this._ending?i>0?this._actualWrite():(this._writing=!1,O(this)):(this._writing=!1,this.sync?this._asyncDrainScheduled||(this._asyncDrainScheduled=!0,process.nextTick(_,this)):this.emit(`drain`))},this.on(`newListener`,function(e){e===`drain`&&(this._asyncDrainScheduled=!1)}),this._periodicFlush!==0&&(this._periodicFlushTimer=setInterval(()=>this.flush(null),this._periodicFlush),this._periodicFlushTimer.unref())}function g(e,t,n){return typeof e==`string`&&(e=Buffer.from(e)),t=Math.max(t-n,0),e=e.subarray(n),{writingBuf:e,len:t}}function _(e){e.listenerCount(`drain`)>0&&(e._asyncDrainScheduled=!1,e.emit(`drain`))}i(h,r);function v(e,t){return e.length===0?c:e.length===1?e[0]:Buffer.concat(e,t)}function y(e){if(this.destroyed)throw Error(`SonicBoom destroyed`);e=``+e;let t=Buffer.byteLength(e),n=this._len+t,r=this._bufs;return this.maxLength&&n>this.maxLength?(this.emit(`drop`,e),this._len<this._hwm):(r.length===0||Buffer.byteLength(r[r.length-1])+t>this.maxWrite?r.push(e):r[r.length-1]+=e,this._len=n,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function b(e){if(this.destroyed)throw Error(`SonicBoom destroyed`);let t=this._len+e.length,n=this._bufs,r=this._lens;return this.maxLength&&t>this.maxLength?(this.emit(`drop`,e),this._len<this._hwm):(n.length===0||r[r.length-1]+e.length>this.maxWrite?(n.push([e]),r.push(e.length)):(n[n.length-1].push(e),r[r.length-1]+=e.length),this._len=t,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function x(e){this._flushPending=!0;let t=()=>{if(this._fsync)this._flushPending=!1,e();else try{n.fsync(this.fd,t=>{this._flushPending=!1,e(t)})}catch(t){e(t)}this.off(`error`,r)},r=n=>{this._flushPending=!1,e(n),this.off(`drain`,t)};this.once(`drain`,t),this.once(`error`,r)}function S(e){if(e!=null&&typeof e!=`function`)throw Error(`flush cb must be a function`);if(this.destroyed){let t=Error(`SonicBoom destroyed`);if(e){e(t);return}throw t}if(this.minLength<=0){e?.();return}e&&x.call(this,e),!this._writing&&(this._bufs.length===0&&this._bufs.push(``),this._actualWrite())}function C(e){if(e!=null&&typeof e!=`function`)throw Error(`flush cb must be a function`);if(this.destroyed){let t=Error(`SonicBoom destroyed`);if(e){e(t);return}throw t}if(this.minLength<=0){e?.();return}e&&x.call(this,e),!this._writing&&(this._bufs.length===0&&(this._bufs.push([]),this._lens.push(0)),this._actualWrite())}h.prototype.reopen=function(e){if(this.destroyed)throw Error(`SonicBoom destroyed`);if(this._opening){this.once(`ready`,()=>{this.reopen(e)});return}if(this._ending)return;if(!this.file)throw Error(`Unable to reopen a file descriptor, you must pass a file to SonicBoom`);if(e&&(this.file=e),this._reopening=!0,this._writing)return;let t=this.fd;this.once(`ready`,()=>{t!==this.fd&&n.close(t,e=>{if(e)return this.emit(`error`,e)})}),m(this.file,this)},h.prototype.end=function(){if(this.destroyed)throw Error(`SonicBoom destroyed`);if(this._opening){this.once(`ready`,()=>{this.end()});return}this._ending||(this._ending=!0,!this._writing&&(this._len>0&&this.fd>=0?this._actualWrite():O(this)))};function w(){if(this.destroyed)throw Error(`SonicBoom destroyed`);if(this.fd<0)throw Error(`sonic boom is not ready yet`);!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift(this._writingBuf),this._writingBuf=``);let e=``;for(;this._bufs.length||e.length;){e.length<=0&&(e=this._bufs[0]);try{let t=Buffer.isBuffer(e)?n.writeSync(this.fd,e):n.writeSync(this.fd,e,`utf8`),r=g(e,this._len,t);e=r.writingBuf,this._len=r.len,e.length<=0&&this._bufs.shift()}catch(t){if((t.code===`EAGAIN`||t.code===`EBUSY`)&&!this.retryEAGAIN(t,e.length,this._len-e.length))throw t;o(100)}}try{n.fsyncSync(this.fd)}catch{}}function T(){if(this.destroyed)throw Error(`SonicBoom destroyed`);if(this.fd<0)throw Error(`sonic boom is not ready yet`);!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift([this._writingBuf]),this._writingBuf=c);let e=c;for(;this._bufs.length||e.length;){e.length<=0&&(e=v(this._bufs[0],this._lens[0]));try{let t=n.writeSync(this.fd,e);e=e.subarray(t),this._len=Math.max(this._len-t,0),e.length<=0&&(this._bufs.shift(),this._lens.shift())}catch(t){if((t.code===`EAGAIN`||t.code===`EBUSY`)&&!this.retryEAGAIN(t,e.length,this._len-e.length))throw t;o(100)}}}h.prototype.destroy=function(){this.destroyed||O(this)};function E(){let e=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:this._bufs.shift()||``,this.sync)try{e(null,Buffer.isBuffer(this._writingBuf)?n.writeSync(this.fd,this._writingBuf):n.writeSync(this.fd,this._writingBuf,`utf8`))}catch(t){e(t)}else n.write(this.fd,this._writingBuf,e)}function D(){let e=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:v(this._bufs.shift(),this._lens.shift()),this.sync)try{e(null,n.writeSync(this.fd,this._writingBuf))}catch(t){e(t)}else p&&(this._writingBuf=Buffer.from(this._writingBuf)),n.write(this.fd,this._writingBuf,e)}function O(e){if(e.fd===-1){e.once(`ready`,O.bind(null,e));return}e._periodicFlushTimer!==void 0&&clearInterval(e._periodicFlushTimer),e.destroyed=!0,e._bufs=[],e._lens=[],s(typeof e.fd==`number`,`sonic.fd must be a number, got ${typeof e.fd}`);try{n.fsync(e.fd,t)}catch{}function t(){e.fd!==1&&e.fd!==2?n.close(e.fd,r):r()}function r(t){if(t){e.emit(`error`,t);return}e._ending&&!e._writing&&e.emit(`finish`),e.emit(`close`)}}h.SonicBoom=h,h.default=h,t.exports=h})),EX=mX(((e,t)=>{let n={exit:[],beforeExit:[]},r={exit:c,beforeExit:l},i;function a(){i===void 0&&(i=new FinalizationRegistry(d))}function o(e){n[e].length>0||process.on(e,r[e])}function s(e){n[e].length>0||(process.removeListener(e,r[e]),n.exit.length===0&&n.beforeExit.length===0&&(i=void 0))}function c(){u(`exit`)}function l(){u(`beforeExit`)}function u(e){for(let t of n[e]){let n=t.deref(),r=t.fn;n!==void 0&&r(n,e)}n[e]=[]}function d(e){for(let t of[`exit`,`beforeExit`]){let r=n[t].indexOf(e);n[t].splice(r,r+1),s(t)}}function f(e,t,r){if(t===void 0)throw Error(`the object can't be undefined`);o(e);let s=new WeakRef(t);s.fn=r,a(),i.register(t,s),n[e].push(s)}function p(e,t){f(`exit`,e,t)}function m(e,t){f(`beforeExit`,e,t)}function h(e){if(i!==void 0){i.unregister(e);for(let t of[`exit`,`beforeExit`])n[t]=n[t].filter(t=>{let n=t.deref();return n&&n!==e}),s(t)}}t.exports={register:p,registerBeforeExit:m,unregister:h}})),$me=mX(((e,t)=>{t.exports={name:`thread-stream`,version:`4.2.0`,description:`A streaming way to send data to a Node.js Worker Thread`,main:`index.js`,types:`index.d.ts`,engines:{node:`>=20`},dependencies:{"real-require":`^1.0.0`},devDependencies:{"@types/node":`^25.0.2`,"@yao-pkg/pkg":`^6.0.0`,borp:`^1.0.0`,desm:`^1.3.0`,eslint:`^9.39.1`,fastbench:`^1.0.1`,neostandard:`^0.13.0`,"pino-elasticsearch":`^9.0.0`,"sonic-boom":`^5.0.0`,"ts-node":`^10.8.0`,typescript:`~5.7.3`},scripts:{build:`tsc --noEmit`,lint:`eslint`,test:`npm run lint && npm run build && npm run transpile && borp --pattern "test/*.test.{js,mjs}"`,"test:ci":`npm run lint && npm run transpile && borp --pattern "test/*.test.{js,mjs}"`,"test:yarn":`npm run transpile && borp --pattern "test/*.test.js"`,transpile:`sh ./test/ts/transpile.sh`},repository:{type:`git`,url:`git+https://github.com/mcollina/thread-stream.git`},keywords:[`worker`,`thread`,`threads`,`stream`],author:`Matteo Collina <hello@matteocollina.com>`,license:`MIT`,bugs:{url:`https://github.com/mcollina/thread-stream/issues`},homepage:`https://github.com/mcollina/thread-stream#readme`}})),ehe=mX(((e,t)=>{let n=1e4;function r(e,t,r,i,a){let o=i===1/0?1/0:Date.now()+i,s=()=>{let i=Atomics.load(e,t);if(i===r){a(null,`ok`);return}if(o!==1/0&&Date.now()>o){a(null,`timed-out`);return}let c=o===1/0?n:Math.min(n,Math.max(1,o-Date.now())),l=Atomics.waitAsync(e,t,i,c);l.async?l.value.then(s):setImmediate(s)};s()}function i(e,t,r,i,a){let o=i===1/0?1/0:Date.now()+i,s=()=>{if(Atomics.load(e,t)!==r){a(null,`ok`);return}if(o!==1/0&&Date.now()>o){a(null,`timed-out`);return}let i=o===1/0?n:Math.min(n,Math.max(1,o-Date.now())),c=Atomics.waitAsync(e,t,r,i);c.async?c.value.then(e=>{if(e===`ok`){a(null,`ok`);return}s()}):setImmediate(s)};s()}t.exports={wait:r,waitDiff:i}})),the=mX(((e,t)=>{t.exports={WRITE_INDEX:4,READ_INDEX:8,SEQ_INDEX:2}})),nhe=mX(((e,t)=>{let{version:n}=$me(),{EventEmitter:r}=gX(`events`),{Worker:i}=gX(`worker_threads`),{join:a}=gX(`path`),{pathToFileURL:o}=gX(`url`),{wait:s}=ehe(),{WRITE_INDEX:c,READ_INDEX:l,SEQ_INDEX:u}=the(),d=gX(`buffer`),f=gX(`assert`),p=Symbol(`kImpl`),m=d.constants.MAX_STRING_LENGTH;function h(){}function g(e,t){Atomics.add(e[p].state,u,1),t(),Atomics.add(e[p].state,u,1),Atomics.notify(e[p].state,u)}function _(e){g(e,()=>{Atomics.store(e[p].state,l,0),Atomics.store(e[p].state,c,0)})}var v=class{constructor(e){this._value=e}deref(){return this._value}},y=class{register(){}unregister(){}};let b=process.env.NODE_V8_COVERAGE?y:global.FinalizationRegistry||y,x=process.env.NODE_V8_COVERAGE?v:global.WeakRef||v,S=new b(e=>{e.exited||e.terminate()});function C(e,t){let{filename:r,workerData:s}=t,c=(`__bundlerPathsOverrides`in globalThis?globalThis.__bundlerPathsOverrides:{})[`thread-stream-worker`]||a(__dirname,`lib`,`worker.js`),l=new i(c,{...t.workerOpts,name:t.workerOpts?.name||`thread-stream`,trackUnmanagedFds:!1,workerData:{filename:r.indexOf(`file://`)===0?r:o(r).href,dataBuf:e[p].dataBuf,stateBuf:e[p].stateBuf,workerData:{$context:{threadStreamVersion:n},...s}}});return l.stream=new v(e),l.on(`message`,E),l.on(`exit`,D),S.register(e,l),l}function w(e){f(!e[p].sync),e[p].needDrain&&(e[p].needDrain=!1,e.emit(`drain`))}function T(e){for(;;){let t=Atomics.load(e[p].state,c),n=e[p].data.length-t;if(n>0){if(e[p].bufLen===0){e[p].flushing=!1,e[p].ending?se(e):e[p].needDrain&&process.nextTick(w,e);return}oe(e,n,h);continue}if(n===0){if(t===0&&e[p].bufLen===0)return;te(e,()=>{e.destroyed||(_(e),T(e))});return}ae(e,Error(`overwritten`));return}}function E(e){let t=this.stream.deref();if(t===void 0){this.exited=!0,this.terminate();return}if(e?.code!=null)switch(e.code){case`READY`:this.stream=new x(t),te(t,()=>{t[p].ready=!0,t.emit(`ready`)});break;case`ERROR`:ae(t,e.err);break;case`EVENT`:Array.isArray(e.args)?t.emit(e.name,...e.args):t.emit(e.name,e.args);break;case`FLUSHED`:{if(e.context!==`thread-stream`){ae(t,Error(`this should not happen: `+e.code));break}let n=t[p].flushCallbacks.get(e.id);n&&(t[p].flushCallbacks.delete(e.id),process.nextTick(n));break}case`WARNING`:process.emitWarning(e.err);break;default:ae(t,Error(`this should not happen: `+e.code))}}function D(e){let t=this.stream.deref();t!==void 0&&(S.unregister(t),t.worker.exited=!0,t.worker.off(`exit`,D),ae(t,e===0?null:Error(`the worker thread exited`)))}var O=class extends r{constructor(e={}){if(super(),e.bufferSize<4)throw Error(`bufferSize must at least fit a 4-byte utf-8 char`);this[p]={},this[p].stateBuf=new SharedArrayBuffer(128),this[p].state=new Int32Array(this[p].stateBuf),this[p].dataBuf=new SharedArrayBuffer(e.bufferSize||4194304),this[p].data=Buffer.from(this[p].dataBuf),this[p].sync=e.sync||!1,this[p].ending=!1,this[p].ended=!1,this[p].needDrain=!1,this[p].destroyed=!1,this[p].flushing=!1,this[p].ready=!1,this[p].finished=!1,this[p].errored=null,this[p].closed=!1,this[p].buf=[],this[p].bufHead=0,this[p].bufLen=0,this[p].flushCallbacks=new Map,this[p].nextFlushId=0,this.worker=C(this,e),this.on(`message`,(e,t)=>{this.worker.postMessage(e,t)})}write(e){let t=Buffer.isBuffer(e)?e:Buffer.from(e);if(this[p].destroyed)return ie(this,Error(`the worker has exited`)),!1;if(this[p].ending)return ie(this,Error(`the worker is ending`)),!1;if(this[p].flushing&&this[p].bufLen+t.length>=m)try{k(this),this[p].flushing=!0}catch(e){return ae(this,e),!1}if(this[p].buf.push(t),this[p].bufLen+=t.length,this[p].sync)try{return k(this),!0}catch(e){return ae(this,e),!1}return this[p].flushing||(this[p].flushing=!0,setImmediate(T,this)),this[p].needDrain=this[p].data.length-this[p].bufLen-Atomics.load(this[p].state,c)<=0,!this[p].needDrain}end(){this[p].destroyed||(this[p].ending=!0,se(this))}flush(e){e=typeof e==`function`?e:h,ee(this,t=>{if(t){process.nextTick(e,t);return}ne(this,e)})}flushSync(){this[p].destroyed||(k(this),ce(this))}unref(){this.worker.unref()}ref(){this.worker.ref()}get ready(){return this[p].ready}get destroyed(){return this[p].destroyed}get closed(){return this[p].closed}get writable(){return!this[p].destroyed&&!this[p].ending}get writableEnded(){return this[p].ending}get writableFinished(){return this[p].finished}get writableNeedDrain(){return this[p].needDrain}get writableObjectMode(){return!1}get writableErrored(){return this[p].errored}};function ee(e,t){if(e[p].destroyed){process.nextTick(t,Error(`the worker has exited`));return}if(!e[p].sync&&(e[p].flushing||e[p].bufLen>0)){setImmediate(ee,e,t);return}te(e,t)}function te(e,t){let n=Atomics.load(e[p].state,c);s(e[p].state,l,n,1/0,(n,r)=>{if(n){ae(e,n),t(n);return}if(r!==`ok`){te(e,t);return}t()})}function ne(e,t){if(e[p].destroyed){process.nextTick(t,Error(`the worker has exited`));return}if(!e[p].ready){let n=()=>{i(),ne(e,t)},r=()=>{i(),process.nextTick(t,Error(`the worker has exited`))},i=()=>{e.off(`ready`,n),e.off(`close`,r)};e.once(`ready`,n),e.once(`close`,r);return}let n=++e[p].nextFlushId;e[p].flushCallbacks.set(n,t);try{e.worker.postMessage({code:`FLUSH`,context:`thread-stream`,id:n})}catch(r){e[p].flushCallbacks.delete(n),ae(e,r),process.nextTick(t,r)}}function re(e,t){let n=e[p].flushCallbacks;if(n.size===0)return;let r=t||Error(`the worker has exited`);for(let e of n.values())process.nextTick(e,r);n.clear()}function ie(e,t){setImmediate(()=>{e.emit(`error`,t)})}function ae(e,t){e[p].destroyed||(e[p].destroyed=!0,re(e,t),t&&(e[p].errored=t,ie(e,t)),e.worker.exited?setImmediate(()=>{e[p].closed=!0,e.emit(`close`)}):e.worker.terminate().catch(()=>{}).then(()=>{e[p].closed=!0,e.emit(`close`)}))}function oe(e,t,n){let r=Atomics.load(e[p].state,c),i=t;for(;i>0&&e[p].bufLen!==0;){let t=e[p].bufHead,n=e[p].buf[t];if(n.length<=i){n.copy(e[p].data,r),r+=n.length,i-=n.length,e[p].bufLen-=n.length,e[p].bufHead=t+1,e[p].bufHead===e[p].buf.length?(e[p].buf.length=0,e[p].bufHead=0):e[p].bufHead>=1024&&e[p].bufHead*2>=e[p].buf.length&&(e[p].buf.splice(0,e[p].bufHead),e[p].bufHead=0);continue}n.copy(e[p].data,r,0,i),e[p].buf[t]=n.subarray(i),e[p].bufLen-=i,r+=i,i=0}return g(e,()=>{Atomics.store(e[p].state,c,r)}),n(),!0}function se(e){if(!(e[p].ended||!e[p].ending||e[p].flushing)){e[p].ended=!0;try{e.flushSync();let t=Atomics.load(e[p].state,l);g(e,()=>{Atomics.store(e[p].state,c,-1)});let n=0;for(;t!==-1;){if(Atomics.wait(e[p].state,l,t,1e3),t=Atomics.load(e[p].state,l),t===-2){ae(e,Error(`end() failed`));return}if(++n===10){ae(e,Error(`end() took too long (10s)`));return}}process.nextTick(()=>{e[p].finished=!0,e.emit(`finish`)})}catch(t){ae(e,t)}}}function k(e){let t=()=>{e[p].ending?se(e):e[p].needDrain&&process.nextTick(w,e)};for(e[p].flushing=!1;e[p].bufLen!==0;){let n=Atomics.load(e[p].state,c),r=e[p].data.length-n;if(r===0){ce(e),_(e);continue}if(r<0)throw Error(`overwritten`);oe(e,r,t)}}function ce(e){if(e[p].flushing)throw Error(`unable to flush while flushing`);let t=Atomics.load(e[p].state,c),n=0;for(;;){let r=Atomics.load(e[p].state,l);if(r===-2)throw Error(`_flushSync failed`);if(r!==t)Atomics.wait(e[p].state,l,r,1e3);else break;if(++n===10)throw Error(`_flushSync took too long (10s)`)}}t.exports=O})),DX=mX(((e,t)=>{let{createRequire:n}=gX(`module`),{existsSync:r}=gX(`node:fs`),i=xX(),{join:a,isAbsolute:o,sep:s}=gX(`node:path`),{fileURLToPath:c}=gX(`node:url`),l=wX(),u=EX(),d=nhe();function f(e){u.register(e,v),u.registerBeforeExit(e,y),e.on(`close`,function(){u.unregister(e)})}function p(){let e=process.execArgv;for(let t=0;t<e.length;t++){let n=e[t];if(n===`--import`||n===`--require`||n===`-r`||n.startsWith(`--import=`)||n.startsWith(`--require=`)||n.startsWith(`-r=`))return!0}return!1}function m(e){let t=e.match(/(?:[^\s"']+|"[^"]*"|'[^']*')+/g);if(!t)return e;let n=[],r=!1;for(let e=0;e<t.length;e++){let i=t[e];if(i===`--require`||i===`-r`||i===`--import`){let a=t[e+1];if(a&&h(a)){r=!0,e++;continue}n.push(i),a&&(n.push(a),e++);continue}if((i.startsWith(`--require=`)||i.startsWith(`-r=`)||i.startsWith(`--import=`))&&h(i.slice(i.indexOf(`=`)+1))){r=!0;continue}n.push(i)}return r?n.join(` `):e}function h(e){let t=g(e);if(!t)return!1;let n=t;if(n.startsWith(`file://`))try{n=c(n)}catch{return!1}return o(n)&&!r(n)}function g(e){let t=e[0],n=e[e.length-1];return t===`"`&&n===`"`||t===`'`&&n===`'`?e.slice(1,-1):e}function _(e,t,n,r,i){if(!n.execArgv&&p()&&gX.main===void 0&&(n={...n,execArgv:[]}),!n.env&&process.env.NODE_OPTIONS){let e=m(process.env.NODE_OPTIONS);e!==process.env.NODE_OPTIONS&&(n={...n,env:{...process.env,NODE_OPTIONS:e}})}n={...n,name:i};let a=new d({filename:e,workerData:t,workerOpts:n,sync:r});a.on(`ready`,o),a.on(`close`,function(){process.removeListener(`exit`,s)}),process.on(`exit`,s);function o(){process.removeListener(`exit`,s),a.unref(),n.autoEnd!==!1&&f(a)}function s(){a.closed||(a.flushSync(),l(100),a.end())}return a}function v(e){e.ref(),e.flushSync(),e.end(),e.once(`close`,function(){e.unref()})}function y(e){e.flushSync()}function b(e){let{pipeline:t,targets:r,levels:c,dedupe:l,worker:u={},caller:d=i(),sync:f=!1}=e,p={...e.options},m=typeof d==`string`?[d]:d,h=typeof globalThis==`object`&&Object.prototype.hasOwnProperty.call(globalThis,`__bundlerPathsOverrides`)&&globalThis.__bundlerPathsOverrides&&typeof globalThis.__bundlerPathsOverrides==`object`?globalThis.__bundlerPathsOverrides:Object.create(null),g=e.target;if(g&&r)throw Error(`only one of target or targets can be specified`);r?(g=h[`pino-worker`]||a(__dirname,`worker.js`),p.targets=r.filter(e=>e.target).map(e=>({...e,target:y(e.target)})),p.pipelines=r.filter(e=>e.pipeline).map(e=>e.pipeline.map(t=>({...t,level:e.level,target:y(t.target)})))):t&&(g=h[`pino-worker`]||a(__dirname,`worker.js`),p.pipelines=[t.map(e=>({...e,target:y(e.target)}))]),c&&(p.levels=c),l&&(p.dedupe=l),p.pinoWillSendConfig=!0;let v=r||t?`pino.transport`:g;return _(y(g),p,u,f,v);function y(e){if(e=h[e]||e,o(e)||e.indexOf(`file://`)===0)return e;if(e===`pino/file`)return a(__dirname,`..`,`file.js`);let t;for(let r of m)try{let i=r===`node:repl`?process.cwd()+s:r;t=n(i).resolve(e);break}catch{continue}if(!t)throw Error(`unable to determine transport target for "${e}"`);return t}}t.exports=b})),OX=mX(((e,t)=>{let n=gX(`node:diagnostics_channel`),r=Qme(),{mapHttpRequest:i,mapHttpResponse:a}=bX(),o=TX(),s=EX(),{lsCacheSym:c,chindingsSym:l,writeSym:u,serializersSym:d,formatOptsSym:f,endSym:p,stringifiersSym:m,stringifySym:h,stringifySafeSym:g,wildcardFirstSym:_,nestedKeySym:v,formattersSym:y,messageKeySym:b,errorKeySym:x,nestedKeyStrSym:S,msgPrefixSym:C}=SX(),{isMainThread:w}=gX(`worker_threads`),T=DX(),[E]=process.versions.node.split(`.`).map(e=>Number(e)),D=n.tracingChannel(`pino_asJson`),O=E>=25?e=>JSON.stringify(e):ne;function ee(){}function te(e,t){if(!t)return n;return function(...r){t.call(this,r,n,e)};function n(t,...n){if(typeof t==`object`){let o=t;t!==null&&(t.method&&t.headers&&t.socket?t=i(t):typeof t.setHeader==`function`&&(t=a(t)));let s;o===null&&n.length===0?s=[null]:(o=n.shift(),s=n),typeof this[C]==`string`&&o!=null&&(o=this[C]+o),this[u](t,r(o,s,this[f]),e)}else{let i=t===void 0?n.shift():t;typeof this[C]==`string`&&i!=null&&(i=this[C]+i),this[u](null,r(i,n,this[f]),e)}}}function ne(e){let t=``,n=0,r=!1,i=255,a=e.length;if(a>100)return JSON.stringify(e);for(var o=0;o<a&&i>=32;o++)i=e.charCodeAt(o),(i===34||i===92)&&(t+=e.slice(n,o)+`\\`,n=o,r=!0);return r?t+=e.slice(n):t=e,i<32?JSON.stringify(e):`"`+t+`"`}function re(e,t,n,r){if(D.hasSubscribers===!1)return ie.call(this,e,t,n,r);let i={instance:this,arguments};return D.traceSync(ie,i,this,e,t,n,r)}function ie(e,t,n,r){let i=this[h],a=this[g],o=this[m],s=this[p],u=this[l],f=this[d],C=this[y],w=this[b],T=this[x],E=this[c][n]+r;E+=u;let D;C.log&&(e=C.log(e));let ee=o[_],te=``;for(let t in e)if(D=e[t],Object.prototype.hasOwnProperty.call(e,t)&&D!==void 0){f[t]?D=f[t](D):t===T&&f.err&&(D=f.err(D));let e=o[t]||ee;switch(typeof D){case`undefined`:case`function`:continue;case`number`:Number.isFinite(D)===!1&&(D=null);case`boolean`:e&&(D=e(D));break;case`string`:D=(e||O)(D);break;default:D=(e||i)(D,a)}if(D===void 0)continue;let n=O(t);te+=`,`+n+`:`+D}let ne=``;if(t!==void 0){D=f[w]?f[w](t):t;let e=o[w]||ee;switch(typeof D){case`function`:break;case`number`:Number.isFinite(D)===!1&&(D=null);case`boolean`:e&&(D=e(D)),ne=`,"`+w+`":`+D;break;case`string`:D=(e||O)(D),ne=`,"`+w+`":`+D;break;default:D=(e||i)(D,a),ne=`,"`+w+`":`+D}}return this[v]&&te?E+this[S]+te.slice(1)+`}`+ne+s:E+te+ne+s}function ae(e,t){let n,r=e[l],i=e[h],a=e[g],o=e[m],s=o[_],c=e[d],u=e[y].bindings;t=u(t);for(let e in t)if(n=t[e],((e.length<5||e!==`level`&&e!==`serializers`&&e!==`formatters`&&e!==`customLevels`)&&t.hasOwnProperty(e)&&n!==void 0)===!0){if(n=c[e]?c[e](n):n,n=(o[e]||s||i)(n,a),n===void 0)continue;r+=`,"`+e+`":`+n}return r}function oe(e){return e.write!==e.constructor.prototype.write}function se(e){let t=new o(e);return t.on(`error`,n),!e.sync&&w&&(s.register(t,k),t.on(`close`,function(){s.unregister(t)})),t;function n(e){if(e.code===`EPIPE`){t.write=ee,t.end=ee,t.flushSync=ee,t.destroy=ee;return}t.removeListener(`error`,n),t.emit(`error`,e)}}function k(e,t){e.destroyed||(t===`beforeExit`?(e.flush(),e.on(`drain`,function(){e.end()})):e.flushSync())}function ce(e){return function(t,n,r={},i){if(typeof r==`string`)i=se({dest:r}),r={};else if(typeof i==`string`){if(r&&r.transport)throw Error(`only one of option.transport or stream can be specified`);i=se({dest:i})}else if(r instanceof o||r.writable||r._writableState)i=r,r={};else if(r.transport){if(r.transport instanceof o||r.transport.writable||r.transport._writableState)throw Error(`option.transport do not allow stream, please pass to option directly. e.g. pino(transport)`);if(r.transport.targets&&r.transport.targets.length&&r.formatters&&typeof r.formatters.level==`function`)throw Error(`option.transport.targets do not allow custom level formatters`);let e;r.customLevels&&(e=r.useOnlyCustomLevels?r.customLevels:Object.assign({},r.levels,r.customLevels)),i=T({caller:n,...r.transport,levels:e})}if(r=Object.assign({},e,r),r.serializers=Object.assign({},e.serializers,r.serializers),r.formatters=Object.assign({},e.formatters,r.formatters),r.prettyPrint)throw Error(`prettyPrint option is no longer supported, see the pino-pretty package (https://github.com/pinojs/pino-pretty)`);let{enabled:a,onChild:s}=r;return a===!1&&(r.level=`silent`),s||(r.onChild=ee),i||=oe(process.stdout)?process.stdout:se({fd:process.stdout.fd||1}),{opts:r,stream:i}}}function le(e,t){try{return JSON.stringify(e)}catch{try{return(t||this[g])(e)}catch{return`"[unable to serialize, circular reference is too complex to analyze]"`}}}function ue(e,t,n){return{level:e,bindings:t,log:n}}function A(e){let t=Number(e);return typeof e==`string`&&Number.isFinite(t)?t:e===void 0?1:e}t.exports={noop:ee,buildSafeSonicBoom:se,asChindings:ae,asJson:re,genLog:te,createArgsNormalizer:ce,stringify:le,buildFormatters:ue,normalizeDestFileDescriptor:A}})),kX=mX(((e,t)=>{t.exports={DEFAULT_LEVELS:{trace:10,debug:20,info:30,warn:40,error:50,fatal:60},SORTING_ORDER:{ASC:`ASC`,DESC:`DESC`}}})),AX=mX(((e,t)=>{let{lsCacheSym:n,levelValSym:r,useOnlyCustomLevelsSym:i,streamSym:a,formattersSym:o,hooksSym:s,levelCompSym:c}=SX(),{noop:l,genLog:u}=OX(),{DEFAULT_LEVELS:d,SORTING_ORDER:f}=kX(),p={fatal:e=>{let t=u(d.fatal,e);return function(...e){let n=this[a];if(t.call(this,...e),typeof n.flushSync==`function`)try{n.flushSync()}catch{}}},error:e=>u(d.error,e),warn:e=>u(d.warn,e),info:e=>u(d.info,e),debug:e=>u(d.debug,e),trace:e=>u(d.trace,e)},m=Object.keys(d).reduce((e,t)=>(e[d[t]]=t,e),{}),h=Object.keys(m).reduce((e,t)=>(e[t]=`{"level":`+Number(t),e),{});function g(e){let t=e[o].level,{labels:r}=e.levels,i={};for(let e in r){let n=t(r[e],Number(e));i[e]=JSON.stringify(n).slice(0,-1)}return e[n]=i,e}function _(e,t){if(t)return!1;switch(e){case`fatal`:case`error`:case`warn`:case`info`:case`debug`:case`trace`:return!0;default:return!1}}function v(e){let{labels:t,values:n}=this.levels;if(typeof e==`number`){if(t[e]===void 0)throw Error(`unknown level value`+e);e=t[e]}if(n[e]===void 0)throw Error(`unknown level `+e);let a=this[r],o=this[r]=n[e],d=this[i],f=this[c],m=this[s].logMethod;for(let e in n){if(f(n[e],o)===!1){this[e]=l;continue}this[e]=_(e,d)?p[e](m):u(n[e],m)}this.emit(`level-change`,e,o,t[a],a,this)}function y(e){let{levels:t,levelVal:n}=this;return t&&t.labels?t.labels[n]:``}function b(e){let{values:t}=this.levels,n=t[e];return n!==void 0&&this[c](n,this[r])}function x(e,t,n){return e===f.DESC?t<=n:t>=n}function S(e){return typeof e==`string`?x.bind(null,e):e}function C(e=null,t=!1){let n=e?Object.keys(e).reduce((t,n)=>(t[e[n]]=n,t),{}):null;return{labels:Object.assign(Object.create(Object.prototype,{Infinity:{value:`silent`}}),t?null:m,n),values:Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),t?null:d,e)}}function w(e,t,n){if(typeof e==`number`){if(![].concat(Object.keys(t||{}).map(e=>t[e]),n?[]:Object.keys(m).map(e=>+e),1/0).includes(e))throw Error(`default level:${e} must be included in custom levels`);return}if(!(e in Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),n?null:d,t)))throw Error(`default level:${e} must be included in custom levels`)}function T(e,t){let{labels:n,values:r}=e;for(let e in t){if(e in r)throw Error(`levels cannot be overridden`);if(t[e]in n)throw Error(`pre-existing level values cannot be used for new levels`)}}function E(e){if(typeof e!=`function`&&!(typeof e==`string`&&Object.values(f).includes(e)))throw Error(`Levels comparison should be one of "ASC", "DESC" or "function" type`)}t.exports={initialLsCache:h,genLsCache:g,levelMethods:p,getLevel:y,setLevel:v,isLevelEnabled:b,mappings:C,assertNoLevelCollisions:T,assertDefaultLevelFound:w,genLevelComparison:S,assertLevelComparison:E}})),jX=mX(((e,t)=>{t.exports={version:`10.3.1`}})),rhe=mX(((e,t)=>{let{EventEmitter:n}=gX(`node:events`),{lsCacheSym:r,levelValSym:i,setLevelSym:a,getLevelSym:o,chindingsSym:s,mixinSym:c,asJsonSym:l,writeSym:u,mixinMergeStrategySym:d,timeSym:f,timeSliceIndexSym:p,streamSym:m,serializersSym:h,formattersSym:g,errorKeySym:_,messageKeySym:v,useOnlyCustomLevelsSym:y,needsMetadataGsym:b,redactFmtSym:x,stringifySym:S,formatOptsSym:C,stringifiersSym:w,msgPrefixSym:T,hooksSym:E}=SX(),{getLevel:D,setLevel:O,isLevelEnabled:ee,mappings:te,initialLsCache:ne,genLsCache:re,assertNoLevelCollisions:ie}=AX(),{asChindings:ae,asJson:oe,buildFormatters:se,stringify:k,noop:ce}=OX(),{version:le}=jX(),ue=CX(),A={constructor:class{},child:de,bindings:fe,setBindings:pe,flush:N,isLevelEnabled:ee,version:le,get level(){return this[o]()},set level(e){this[a](e)},get levelVal(){return this[i]},set levelVal(e){throw Error(`levelVal is read-only`)},get msgPrefix(){return this[T]},get[Symbol.toStringTag](){return`Pino`},[r]:ne,[u]:M,[l]:oe,[o]:D,[a]:O};Object.setPrototypeOf(A,n.prototype),t.exports=function(){return Object.create(A)};let j=e=>e;function de(e,t){if(!e)throw Error(`missing bindings for child Pino`);let n=this[h],r=this[g],i=Object.create(this);if(t==null)return i[g].bindings!==j&&(i[g]=se(r.level,j,r.log)),i[s]=ae(i,e),this.onChild!==ce&&this.onChild(i),i;if(t.hasOwnProperty(`serializers`)===!0){i[h]=Object.create(null);for(let e in n)i[h][e]=n[e];let e=Object.getOwnPropertySymbols(n);for(var o=0;o<e.length;o++){let t=e[o];i[h][t]=n[t]}for(let e in t.serializers)i[h][e]=t.serializers[e];let r=Object.getOwnPropertySymbols(t.serializers);for(var c=0;c<r.length;c++){let e=r[c];i[h][e]=t.serializers[e]}}else i[h]=n;if(t.hasOwnProperty(`formatters`)){let{level:e,bindings:n,log:a}=t.formatters;i[g]=se(e||r.level,n||j,a||r.log)}else i[g]=se(r.level,j,r.log);if(t.hasOwnProperty(`customLevels`)===!0&&(ie(this.levels,t.customLevels),i.levels=te(t.customLevels,i[y]),re(i)),typeof t.redact==`object`&&t.redact!==null||Array.isArray(t.redact)){i.redact=t.redact;let e=ue(i.redact,k),n={stringify:e[x]};i[S]=k,i[w]=e,i[C]=n}if(typeof t.msgPrefix==`string`&&(i[T]=(this[T]||``)+t.msgPrefix),i[s]=ae(i,e),t.level!==void 0&&t.level!==this.level||t.hasOwnProperty(`customLevels`)){let e=t.level||this.level;i[a](e)}return this.onChild(i),i}function fe(){let e=`{${this[s].substr(1)}}`,t=JSON.parse(e);return delete t.pid,delete t.hostname,t}function pe(e){let t=ae(this,e);this[s]=t}function me(e,t){return Object.assign(t,e)}function M(e,t,n){let r=this[f](),i=this[c],a=this[_],o=this[v],s=this[d]||me,u,h=this[E].streamWrite;e==null?u={}:e instanceof Error?(u={[a]:e},t===void 0&&(t=e.message)):(u=e,t===void 0&&e[o]===void 0&&e[a]&&(t=e[a].message)),i&&(u=s(u,i(u,n,this)));let g=this[l](u,t,n,r),y=this[m];y[b]===!0&&(y.lastLevel=n,y.lastObj=u,y.lastMsg=t,y.lastTime=r.slice(this[p]),y.lastLogger=this),y.write(h?h(g):g)}function N(e){if(e!=null&&typeof e!=`function`)throw Error(`callback must be a function`);let t=this[m];typeof t.flush==`function`?t.flush(e||ce):e&&e()}})),ihe=mX(((e,t)=>{let{hasOwnProperty:n}=Object.prototype,r=_();r.configure=_,r.stringify=r,r.default=r,e.stringify=r,e.configure=_,t.exports=r;let i=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function a(e){return e.length<5e3&&!i.test(e)?`"${e}"`:JSON.stringify(e)}function o(e,t){if(e.length>200||t)return e.sort(t);for(let t=1;t<e.length;t++){let n=e[t],r=t;for(;r!==0&&e[r-1]>n;)e[r]=e[r-1],r--;e[r]=n}return e}let s=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function c(e){return s.call(e)!==void 0&&e.length!==0}function l(e,t,n){e.length<n&&(n=e.length);let r=t===`,`?``:` `,i=`"0":${r}${e[0]}`;for(let a=1;a<n;a++)i+=`${t}"${a}":${r}${e[a]}`;return i}function u(e){if(n.call(e,`circularValue`)){let t=e.circularValue;if(typeof t==`string`)return`"${t}"`;if(t==null)return t;if(t===Error||t===TypeError)return{toString(){throw TypeError(`Converting circular structure to JSON`)}};throw TypeError(`The "circularValue" argument must be of type string or the value null or undefined`)}return`"[Circular]"`}function d(e){let t;if(n.call(e,`deterministic`)&&(t=e.deterministic,typeof t!=`boolean`&&typeof t!=`function`))throw TypeError(`The "deterministic" argument must be of type boolean or comparator function`);return t===void 0||t}function f(e,t){let r;if(n.call(e,t)&&(r=e[t],typeof r!=`boolean`))throw TypeError(`The "${t}" argument must be of type boolean`);return r===void 0||r}function p(e,t){let r;if(n.call(e,t)){if(r=e[t],typeof r!=`number`)throw TypeError(`The "${t}" argument must be of type number`);if(!Number.isInteger(r))throw TypeError(`The "${t}" argument must be an integer`);if(r<1)throw RangeError(`The "${t}" argument must be >= 1`)}return r===void 0?1/0:r}function m(e){return e===1?`1 item`:`${e} items`}function h(e){let t=new Set;for(let n of e)(typeof n==`string`||typeof n==`number`)&&t.add(String(n));return t}function g(e){if(n.call(e,`strict`)){let t=e.strict;if(typeof t!=`boolean`)throw TypeError(`The "strict" argument must be of type boolean`);if(t)return e=>{let t=`Object can not safely be stringified. Received type ${typeof e}`;throw typeof e!=`function`&&(t+=` (${e.toString()})`),Error(t)}}}function _(e){e={...e};let t=g(e);t&&(e.bigint===void 0&&(e.bigint=!1),`circularValue`in e||(e.circularValue=Error));let n=u(e),r=f(e,`bigint`),i=d(e),s=typeof i==`function`?i:void 0,_=p(e,`maximumDepth`),v=p(e,`maximumBreadth`);function y(e,l,u,d,f,p){let h=l[e];switch(typeof h==`object`&&h&&typeof h.toJSON==`function`&&(h=h.toJSON(e)),h=d.call(l,e,h),typeof h){case`string`:return a(h);case`object`:{if(h===null)return`null`;if(u.indexOf(h)!==-1)return n;let e=``,t=`,`,r=p;if(Array.isArray(h)){if(h.length===0)return`[]`;if(_<u.length+1)return`"[Array]"`;u.push(h),f!==``&&(p+=f,e+=`\n${p}`,t=`,\n${p}`);let n=Math.min(h.length,v),i=0;for(;i<n-1;i++){let n=y(String(i),h,u,d,f,p);e+=n===void 0?`null`:n,e+=t}let a=y(String(i),h,u,d,f,p);if(e+=a===void 0?`null`:a,h.length-1>v){let n=h.length-v-1;e+=`${t}"... ${m(n)} not stringified"`}return f!==``&&(e+=`\n${r}`),u.pop(),`[${e}]`}let l=Object.keys(h),g=l.length;if(g===0)return`{}`;if(_<u.length+1)return`"[Object]"`;let b=``,x=``;f!==``&&(p+=f,t=`,\n${p}`,b=` `);let S=Math.min(g,v);i&&!c(h)&&(l=o(l,s)),u.push(h);for(let n=0;n<S;n++){let r=l[n],i=y(r,h,u,d,f,p);i!==void 0&&(e+=`${x}${a(r)}:${b}${i}`,x=t)}if(g>v){let n=g-v;e+=`${x}"...":${b}"${m(n)} not stringified"`,x=t}return f!==``&&x.length>1&&(e=`\n${p}${e}\n${r}`),u.pop(),`{${e}}`}case`number`:return isFinite(h)?String(h):t?t(h):`null`;case`boolean`:return h===!0?`true`:`false`;case`undefined`:return;case`bigint`:if(r)return String(h);default:return t?t(h):void 0}}function b(e,i,o,s,c,l){switch(typeof i==`object`&&i&&typeof i.toJSON==`function`&&(i=i.toJSON(e)),typeof i){case`string`:return a(i);case`object`:{if(i===null)return`null`;if(o.indexOf(i)!==-1)return n;let e=l,t=``,r=`,`;if(Array.isArray(i)){if(i.length===0)return`[]`;if(_<o.length+1)return`"[Array]"`;o.push(i),c!==``&&(l+=c,t+=`\n${l}`,r=`,\n${l}`);let n=Math.min(i.length,v),a=0;for(;a<n-1;a++){let e=b(String(a),i[a],o,s,c,l);t+=e===void 0?`null`:e,t+=r}let u=b(String(a),i[a],o,s,c,l);if(t+=u===void 0?`null`:u,i.length-1>v){let e=i.length-v-1;t+=`${r}"... ${m(e)} not stringified"`}return c!==``&&(t+=`\n${e}`),o.pop(),`[${t}]`}o.push(i);let u=``;c!==``&&(l+=c,r=`,\n${l}`,u=` `);let d=``;for(let e of s){let n=b(e,i[e],o,s,c,l);n!==void 0&&(t+=`${d}${a(e)}:${u}${n}`,d=r)}return c!==``&&d.length>1&&(t=`\n${l}${t}\n${e}`),o.pop(),`{${t}}`}case`number`:return isFinite(i)?String(i):t?t(i):`null`;case`boolean`:return i===!0?`true`:`false`;case`undefined`:return;case`bigint`:if(r)return String(i);default:return t?t(i):void 0}}function x(e,u,d,f,p){switch(typeof u){case`string`:return a(u);case`object`:{if(u===null)return`null`;if(typeof u.toJSON==`function`){if(u=u.toJSON(e),typeof u!=`object`)return x(e,u,d,f,p);if(u===null)return`null`}if(d.indexOf(u)!==-1)return n;let t=p;if(Array.isArray(u)){if(u.length===0)return`[]`;if(_<d.length+1)return`"[Array]"`;d.push(u),p+=f;let e=`\n${p}`,n=`,\n${p}`,r=Math.min(u.length,v),i=0;for(;i<r-1;i++){let t=x(String(i),u[i],d,f,p);e+=t===void 0?`null`:t,e+=n}let a=x(String(i),u[i],d,f,p);if(e+=a===void 0?`null`:a,u.length-1>v){let t=u.length-v-1;e+=`${n}"... ${m(t)} not stringified"`}return e+=`\n${t}`,d.pop(),`[${e}]`}let r=Object.keys(u),h=r.length;if(h===0)return`{}`;if(_<d.length+1)return`"[Object]"`;p+=f;let g=`,\n${p}`,y=``,b=``,S=Math.min(h,v);c(u)&&(y+=l(u,g,v),r=r.slice(u.length),S-=u.length,b=g),i&&(r=o(r,s)),d.push(u);for(let e=0;e<S;e++){let t=r[e],n=x(t,u[t],d,f,p);n!==void 0&&(y+=`${b}${a(t)}: ${n}`,b=g)}if(h>v){let e=h-v;y+=`${b}"...": "${m(e)} not stringified"`,b=g}return b!==``&&(y=`\n${p}${y}\n${t}`),d.pop(),`{${y}}`}case`number`:return isFinite(u)?String(u):t?t(u):`null`;case`boolean`:return u===!0?`true`:`false`;case`undefined`:return;case`bigint`:if(r)return String(u);default:return t?t(u):void 0}}function S(e,u,d){switch(typeof u){case`string`:return a(u);case`object`:{if(u===null)return`null`;if(typeof u.toJSON==`function`){if(u=u.toJSON(e),typeof u!=`object`)return S(e,u,d);if(u===null)return`null`}if(d.indexOf(u)!==-1)return n;let t=``,r=u.length!==void 0;if(r&&Array.isArray(u)){if(u.length===0)return`[]`;if(_<d.length+1)return`"[Array]"`;d.push(u);let e=Math.min(u.length,v),n=0;for(;n<e-1;n++){let e=S(String(n),u[n],d);t+=e===void 0?`null`:e,t+=`,`}let r=S(String(n),u[n],d);if(t+=r===void 0?`null`:r,u.length-1>v){let e=u.length-v-1;t+=`,"... ${m(e)} not stringified"`}return d.pop(),`[${t}]`}let f=Object.keys(u),p=f.length;if(p===0)return`{}`;if(_<d.length+1)return`"[Object]"`;let h=``,g=Math.min(p,v);r&&c(u)&&(t+=l(u,`,`,v),f=f.slice(u.length),g-=u.length,h=`,`),i&&(f=o(f,s)),d.push(u);for(let e=0;e<g;e++){let n=f[e],r=S(n,u[n],d);r!==void 0&&(t+=`${h}${a(n)}:${r}`,h=`,`)}if(p>v){let e=p-v;t+=`${h}"...":"${m(e)} not stringified"`}return d.pop(),`{${t}}`}case`number`:return isFinite(u)?String(u):t?t(u):`null`;case`boolean`:return u===!0?`true`:`false`;case`undefined`:return;case`bigint`:if(r)return String(u);default:return t?t(u):void 0}}function C(e,t,n){if(arguments.length>1){let r=``;if(typeof n==`number`?r=` `.repeat(Math.min(n,10)):typeof n==`string`&&(r=n.slice(0,10)),t!=null){if(typeof t==`function`)return y(``,{"":e},[],t,r,``);if(Array.isArray(t))return b(``,e,[],h(t),r,``)}if(r.length!==0)return x(``,e,[],r,``)}return S(``,e,[])}return C}})),ahe=mX(((e,t)=>{let n=Symbol.for(`pino.metadata`),{DEFAULT_LEVELS:r}=kX(),i=r.info;function a(e,t){e||=[],t||={dedupe:!1};let a=Object.create(r);a.silent=1/0,t.levels&&typeof t.levels==`object`&&Object.keys(t.levels).forEach(e=>{a[e]=t.levels[e]});let u={write:d,add:m,remove:h,emit:f,flushSync:p,end:g,minLevel:0,lastId:0,streams:[],clone:_,[n]:!0,streamLevels:a};return Array.isArray(e)?e.forEach(m,u):m.call(u,e),e=null,u;function d(e){let r,i=this.lastLevel,{streams:a}=this,o=0,u;for(let d=s(a.length,t.dedupe);l(d,a.length,t.dedupe);d=c(d,t.dedupe))if(r=a[d],r.level<=i){if(o!==0&&o!==r.level)break;if(u=r.stream,u[n]){let{lastTime:e,lastMsg:t,lastObj:n,lastLogger:r}=this;u.lastLevel=i,u.lastTime=e,u.lastMsg=t,u.lastObj=n,u.lastLogger=r}u.write(e),t.dedupe&&(o=r.level)}else if(!t.dedupe)break}function f(...e){for(let{stream:t}of this.streams)typeof t.emit==`function`&&t.emit(...e)}function p(){for(let{stream:e}of this.streams)typeof e.flushSync==`function`&&e.flushSync()}function m(e){if(!e)return u;let t=typeof e.write==`function`||e.stream,n=e.write?e:e.stream;if(!t)throw Error(`stream object needs to implement either StreamEntry or DestinationStream interface`);let{streams:r,streamLevels:a}=this,s;s=typeof e.levelVal==`number`?e.levelVal:typeof e.level==`string`?a[e.level]:typeof e.level==`number`?e.level:i;let c={stream:n,level:s,levelVal:void 0,id:++u.lastId};return r.unshift(c),r.sort(o),this.minLevel=r[0].level,u}function h(e){let{streams:t}=this,n=t.findIndex(t=>t.id===e);return n>=0&&(t.splice(n,1),t.sort(o),this.minLevel=t.length>0?t[0].level:-1),u}function g(){for(let{stream:e}of this.streams)typeof e.flushSync==`function`&&e.flushSync(),e.end()}function _(e){let t=Array(this.streams.length);for(let n=0;n<t.length;n++)t[n]={level:e,stream:this.streams[n].stream};return{write:d,add:m,remove:h,minLevel:e,streams:t,clone:_,emit:f,flushSync:p,[n]:!0}}}function o(e,t){return e.level-t.level}function s(e,t){return t?e-1:0}function c(e,t){return t?e-1:e+1}function l(e,t,n){return n?e>=0:e<t}t.exports=a})),MX=mX(((e,t)=>{let n=gX(`node:os`),r=bX(),i=xX(),a=CX(),o=Zme(),s=rhe(),c=SX(),{configure:l}=ihe(),{assertDefaultLevelFound:u,mappings:d,genLsCache:f,genLevelComparison:p,assertLevelComparison:m}=AX(),{DEFAULT_LEVELS:h,SORTING_ORDER:g}=kX(),{createArgsNormalizer:_,asChindings:v,buildSafeSonicBoom:y,buildFormatters:b,stringify:x,normalizeDestFileDescriptor:S,noop:C}=OX(),{version:w}=jX(),{chindingsSym:T,redactFmtSym:E,serializersSym:D,timeSym:O,timeSliceIndexSym:ee,streamSym:te,stringifySym:ne,stringifySafeSym:re,stringifiersSym:ie,setLevelSym:ae,endSym:oe,formatOptsSym:se,messageKeySym:k,errorKeySym:ce,nestedKeySym:le,mixinSym:ue,levelCompSym:A,useOnlyCustomLevelsSym:j,formattersSym:de,hooksSym:fe,nestedKeyStrSym:pe,mixinMergeStrategySym:me,msgPrefixSym:M}=c,{epochTime:N,nullTime:he}=o,{pid:ge}=process,_e=n.hostname(),ve=r.err,ye=_({level:`info`,levelComparison:g.ASC,levels:h,messageKey:`msg`,errorKey:`err`,nestedKey:null,enabled:!0,base:{pid:ge,hostname:_e},serializers:Object.assign(Object.create(null),{err:ve}),formatters:Object.assign(Object.create(null),{bindings(e){return e},level(e,t){return{level:t}}}),hooks:{logMethod:void 0,streamWrite:void 0},timestamp:N,name:void 0,redact:null,customLevels:null,useOnlyCustomLevels:!1,depthLimit:5,edgeLimit:100}),be=Object.assign(Object.create(null),r);function xe(...e){let t={},{opts:n,stream:r}=ye(t,i(),...e);n.level&&typeof n.level==`string`&&h[n.level.toLowerCase()]!==void 0&&(n.level=n.level.toLowerCase());let{redact:o,crlf:c,serializers:g,timestamp:_,messageKey:y,errorKey:S,nestedKey:w,base:ge,name:_e,level:ve,customLevels:be,levelComparison:xe,mixin:Se,mixinMergeStrategy:Ce,useOnlyCustomLevels:we,formatters:Te,hooks:Ee,depthLimit:De,edgeLimit:Oe,onChild:ke,msgPrefix:Ae}=n,je=l({maximumDepth:De,maximumBreadth:Oe}),Me=b(Te.level,Te.bindings,Te.log),Ne=x.bind({[re]:je}),Pe=o?a(o,Ne):{},Fe=o?{stringify:Pe[E]}:{stringify:Ne},Ie=`}`+(c?`\r
|
|
423
423
|
`:`
|
|
@@ -1526,6 +1526,6 @@ export default function okBridge(pi: {
|
|
|
1526
1526
|
`);te(e,o)}function M9(e,t){let n=x(e,`utf-8`);if(n.trim().length!==0)try{let r=A9(JSON.parse(n),t),i=n.endsWith(`
|
|
1527
1527
|
`)?`
|
|
1528
1528
|
`:``;te(e,`${JSON.stringify(r,null,2)}${i}`)}catch{let r=k9(n,t.contentDir);r!==n&&te(e,r)}}function N9(e,t){let n=x(e,`utf-8`),r=k9(n,t.contentDir);r!==n&&te(e,r)}function P9(e){try{return C(e,{withFileTypes:!0}).filter(e=>e.isFile()).map(t=>N(e,t.name))}catch{return[]}}const sOe=new Set([`agent-presence.json`,`agent-effects.json`,`runtime.json`]);function F9(e){return/\.log\.\d+$/.test(e)}function cOe(e){return e.endsWith(`.jsonl`)||e.endsWith(`.log`)||F9(e)}const lOe=[`telemetry`,`logs`,`process`,`diagnostic-reports`];function uOe(e){let t={contentDir:e.contentDir};for(let n of lOe)for(let r of P9(N(e.stagingDir,n)))cOe(r)?j9(r,t):r.endsWith(`.json`)?M9(r,t):N9(r,t);for(let n of P9(N(e.stagingDir,`state`))){let e=fe(n);n.endsWith(`.jsonl`)?j9(n,t):sOe.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 dOe(e){return N(e,...I9,z9)}function fOe(e){return N(e,...I9,B9)}function pOe(e){return N(e,...L9,V9)}function mOe(e){return N(e,...L9,H9)}function hOe(e){return N(e,...R9,U9)}function gOe(e){return N(e,...R9,W9)}const G9=1e3;async function _Oe(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 vOe(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 yOe(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 bOe(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(`
|
|
1529
|
-
`)}\n`:null}catch{return null}}function xOe(e){let t=N(e,`.git`,`ok`);if(!h(t))return null;let n=l(`git`,[`-C`,t,`log`,`--oneline`,`-50`],T8({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function SOe(e){let t=N(e,`.git`,`ok`);if(!h(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/`],T8({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 COe(){return{nodeVersion:process.version,platform:k(),arch:re()}}function wOe(){return process.env.OTEL_SDK_DISABLED===`false`}function q9(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function J9(e){if(!h(e))return{};let t;try{t=(0,nn.parse)(x(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 TOe(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:void 0}function X9(e){if(q9(e))return TOe(e.maxBytes)}function EOe(e){let t=J9(b$(`project`,e)),n=J9(b$(`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 DOe(e){return je(`sha256`).update(e).digest(`hex`)}function OOe(e){let t=x(e),n=0;for(let e=0;e<t.length;e++)t[e]===10&&n++;return n}const kOe=[`"doc.name"`,`"docName"`];function AOe(e){let t=x(e,`utf-8`),n=0;for(let e of kOe){let r=t.indexOf(e);for(;r!==-1;)n++,r=t.indexOf(e,r+e.length)}return n}function Z9(e,t){if(!h(e))return!1;try{return _(pe(t),{recursive:!0}),e.endsWith(`.ips`)?te(t,t9(x(e,`utf-8`))):p(e,t),!0}catch{return!1}}function Q9(e){let t=[],n=e=>{let r=C(e,{withFileTypes:!0});for(let i of r){let r=N(e,i.name);i.isDirectory()?n(r):i.isFile()&&t.push(r)}};return n(e),t.sort()}const jOe=new Set([`.jsonl`]);function MOe(e){let t=e.lastIndexOf(`.`);return t!==-1&&jOe.has(e.slice(t))}const NOe=new Set([`.jsonl`,`.json`,`.txt`,`.log`,`.lock`,`.yaml`,`.yml`,`.ips`]);function POe(e){if(F9(e))return!0;let t=e.lastIndexOf(`.`);return t!==-1&&NOe.has(e.slice(t))}function FOe(e){let t=[];for(let n of Q9(e)){let r=$9(e,n);if(!POe(r))continue;let{redacted:i,patterns:a,lineCount:o}=JB(x(n,`utf-8`));a.length!==0&&(te(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 _e(e,t).split(ye).join(`/`)}async function IOe(e){let t=ve(e.contentDir),n=ve(e.projectDir??e.contentDir),r=e.deps??{},i=r.fetchAgentPresence??_Oe,a=r.fetchAgentEffects??vOe,o=r.fetchWatcherRecent??yOe,s=r.readShadowHead??xOe,c=r.readCheckpointRefs??SOe,l=r.now??(()=>new Date),u=r.okVersion??(()=>`0.70.
|
|
1529
|
+
`)}\n`:null}catch{return null}}function xOe(e){let t=N(e,`.git`,`ok`);if(!h(t))return null;let n=l(`git`,[`-C`,t,`log`,`--oneline`,`-50`],T8({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function SOe(e){let t=N(e,`.git`,`ok`);if(!h(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/`],T8({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 COe(){return{nodeVersion:process.version,platform:k(),arch:re()}}function wOe(){return process.env.OTEL_SDK_DISABLED===`false`}function q9(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function J9(e){if(!h(e))return{};let t;try{t=(0,nn.parse)(x(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 TOe(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:void 0}function X9(e){if(q9(e))return TOe(e.maxBytes)}function EOe(e){let t=J9(b$(`project`,e)),n=J9(b$(`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 DOe(e){return je(`sha256`).update(e).digest(`hex`)}function OOe(e){let t=x(e),n=0;for(let e=0;e<t.length;e++)t[e]===10&&n++;return n}const kOe=[`"doc.name"`,`"docName"`];function AOe(e){let t=x(e,`utf-8`),n=0;for(let e of kOe){let r=t.indexOf(e);for(;r!==-1;)n++,r=t.indexOf(e,r+e.length)}return n}function Z9(e,t){if(!h(e))return!1;try{return _(pe(t),{recursive:!0}),e.endsWith(`.ips`)?te(t,t9(x(e,`utf-8`))):p(e,t),!0}catch{return!1}}function Q9(e){let t=[],n=e=>{let r=C(e,{withFileTypes:!0});for(let i of r){let r=N(e,i.name);i.isDirectory()?n(r):i.isFile()&&t.push(r)}};return n(e),t.sort()}const jOe=new Set([`.jsonl`]);function MOe(e){let t=e.lastIndexOf(`.`);return t!==-1&&jOe.has(e.slice(t))}const NOe=new Set([`.jsonl`,`.json`,`.txt`,`.log`,`.lock`,`.yaml`,`.yml`,`.ips`]);function POe(e){if(F9(e))return!0;let t=e.lastIndexOf(`.`);return t!==-1&&NOe.has(e.slice(t))}function FOe(e){let t=[];for(let n of Q9(e)){let r=$9(e,n);if(!POe(r))continue;let{redacted:i,patterns:a,lineCount:o}=JB(x(n,`utf-8`));a.length!==0&&(te(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 _e(e,t).split(ye).join(`/`)}async function IOe(e){let t=ve(e.contentDir),n=ve(e.projectDir??e.contentDir),r=e.deps??{},i=r.fetchAgentPresence??_Oe,a=r.fetchAgentEffects??vOe,o=r.fetchWatcherRecent??yOe,s=r.readShadowHead??xOe,c=r.readCheckpointRefs??SOe,l=r.now??(()=>new Date),u=r.okVersion??(()=>`0.70.4`),d=r.readDesktopEnv??K9,f=r.readLanguage??O9,m=r.readRuntime??COe,g=r.isOtlpPushEnabled??wOe,y=v(N(le(),`ok-bundle-`));try{_(N(y,`telemetry`),{recursive:!0}),_(N(y,`logs`),{recursive:!0}),_(N(y,`state`),{recursive:!0}),Z9(dOe(n),N(y,`telemetry`,z9)),Z9(fOe(n),N(y,`telemetry`,B9)),Z9(pOe(n),N(y,`logs`,V9)),Z9(mOe(n),N(y,`logs`,H9));for(let t of e.userLogFiles??[])Z9(t,N(y,`logs`,fe(t)));for(let t of e.userStateFiles??[])Z9(t,N(y,kR,fe(t)));let v=0;for(let t of e.diagnosticReports?.files??[])Z9(t,N(y,`diagnostic-reports`,fe(t)))&&(v+=1);let b=N(n,`.ok`,`local`),S=N(b,`server.lock`),C=`not-running`,w=`no server.lock`,T=null;if(h(S)){Z9(S,N(y,`state`,`server.lock`));try{let e=x(S,`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`:(te(N(y,`state`,`agent-presence.json`),e),C=`running`,w=``);let t=await a(T);t!==null&&te(N(y,`state`,`agent-effects.json`),t);let n=await o(T);if(n!==null){let e=bOe(n);e!==null&&te(N(y,`state`,`watcher-recent.jsonl`),e)}}let E=s(t);E!==null&&te(N(y,`state`,`shadow-head.txt`),E);let ee=c(t);ee!==null&&te(N(y,`state`,`checkpoint-refs.txt`),ee),Z9(hOe(n),N(y,`state`,U9)),Z9(gOe(n),N(y,`state`,W9)),Z9(N(b,`last-spawn-error.log`),N(y,`state`,`last-spawn-error.log`)),Z9(N(b,Pu),N(y,`state`,Pu)),Z9(N(b,Fu),N(y,`state`,Fu));let ne=m(),re=d(),ie=f(),ae={ok:{version:u(),nodeVersion:ne.nodeVersion,platform:ne.platform,arch:ne.arch},host:{desktop:re,language:ie}};te(N(y,`state`,`runtime.json`),`${JSON.stringify(ae,null,2)}\n`);let oe=C===`running`?`running
|
|
1530
1530
|
`:`not-running (${w})\n`;te(N(y,`state`,`server-status.txt`),oe);let se=e.diagnosticReports===void 0?`not-collected (no collection attempted)`:e9(e.diagnosticReports,v);if(te(N(y,`state`,`diagnostic-reports-status.txt`),`${se}\n`),e.processDir&&h(e.processDir)){let t=N(y,`process`);_(t,{recursive:!0}),p(e.processDir,t,{recursive:!0})}let k=e.redact===!0;k&&uOe({stagingDir:y,contentDir:t}),e.note&&te(N(y,`note.txt`),e.note);let ce=null;e.scrubSecrets===!0&&(ce=FOe(y));for(let t of e.extraFiles??[])Z9(t.sourcePath,N(y,`extra`,t.zipName??fe(t.sourcePath)))||r.logger?.warn({sourcePath:t.sourcePath},`extra file missing; omitted from bundle`);let le=EOe(n),ue=Q9(y),A=[],j=0,de=0;for(let e of ue){let t=$9(y,e),n=O(e).size,r=MOe(t)?OOe(e):0;A.push({path:t,bytes:n,lines:r}),j+=n,(t.startsWith(`telemetry/`)||t.startsWith(`logs/`))&&(de+=AOe(e))}let pe={applied:k};ce!==null&&(pe.secretScrub=ce);let me={schemaVersion:2,createdAt:l().toISOString(),ok:{version:u(),nodeVersion:ne.nodeVersion,platform:ne.platform,arch:ne.arch},host:{desktop:re,language:ie},contentDir:{pathSha256:DOe(t),absolutePath:k?`<CONTENT_DIR>`:t},telemetry:{localSink:le,otlpPushEnabled:g()},redaction:pe,serverStatus:C,files:A};te(N(y,`manifest.json`),`${JSON.stringify(me,null,2)}\n`);let M=ue.some(e=>{try{return x(e,`utf-8`).includes(t)}catch{return!1}}),he={stagedDiagnosticReports:v,totalBytes:j,fileCount:A.length,docNameCount:de,contentDirVisible:M,redacted:k},ge=!1;return{stagingDir:y,manifest:me,summary:he,cleanup:()=>{ge||(ge=!0,D(y,{recursive:!0,force:!0}))}}}catch(e){throw D(y,{recursive:!0,force:!0}),e}}async function LOe(e){let{collected:t,outputPath:n}=e,r=pe(n);if(!h(r))throw Error(`ok diagnose bundle: parent directory does not exist: ${r}. Create it or pass --out with an existing parent.`);let i=new Cxe.ZipFile,a=Q9(t.stagingDir);for(let e of a){let n=$9(t.stagingDir,e);i.addFile(e,n)}i.end();let o=m(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 ROe(e,t){let n=N(e,`.ok`,`config.yml`);if(h(n))try{let t=(0,nn.parse)(x(n,`utf-8`)),r=D5(t)?t.content:void 0,i=D5(r)?r.dir:void 0;if(typeof i==`string`&&i.length>0)return ve(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 ve(e)}async function zOe(e,t,n,r,i){let a=r9(t,e.logger),o=await IOe({contentDir:ROe(t,e.logger),projectDir:t,redact:e.redact,scrubSecrets:e.redact,note:e.note,extraFiles:e.extraFiles,userLogFiles:[...vDe(a,e.userLogsDir??N(oe(),`.ok`,`logs`)),...a9(e.cachesDir??N(oe(),`Library`,`Caches`))],userStateFiles:o9(e.bugReportsDir??n9()),diagnosticReports:i,deps:{readDesktopEnv:n,readLanguage:r,logger:e.logger}});try{_(pe(e.outputPath),{recursive:!0}),await LOe({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 BOe(e){let{projectDir:t}=e,n=e.readDesktopEnv??K9,r=e.readLanguage??O9,i=()=>mDe(e.diagnosticReportsDir??N(oe(),`Library`,`Logs`,`DiagnosticReports`),new Date);if(e.level===`full`&&t!==void 0)return zOe(e,t,n,r,i());let{zipPath:a,summary:o}=await CDe({projectDir:t,redact:e.redact,revealDocNames:e.level===`full`,outputPath:e.outputPath,userLogsDir:e.userLogsDir,shipItLogFiles:a9(e.cachesDir??N(oe(),`Library`,`Caches`)),bugReportLedgerFiles:o9(e.bugReportsDir??n9()),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{P5 as ALL_EDITOR_IDS,F5 as EDITOR_LABELS,d7 as EDITOR_TARGETS,ITe as HOSTS_WITH_USER_SKILL_DIR,eDe as LAUNCH_CONFIG_NAME,UDe as PATH_SHIM_BEGIN,GDe as PATH_SHIM_BLOCK_RE,WDe as PATH_SHIM_END,FEe as addOkPathsToGitExclude,v7 as assertProjectPathSafe,q5 as buildManagedServerEntry,NDe as buildMcpConfigDeclineEvent,PDe as buildMcpConfigMigrateEvent,Z7 as classifyExistingMcpEntry,BOe as collectReportBundle,XDe as createCliProbeResolver,cn as createTokenStore,hDe as defaultBugReportZipPath,Be as detectGh,Ue as detectGhAccounts,iDe as detectInstalledEditors,n7 as droppedManagedKeys,rEe as editorConfigPathDisplay,nEe as editorEntryLocator,TDe as ensurePiBridge,j7 as formatTrackedRemediation,REe as getExcludedOkPaths,k7 as getInstalledSkillProjectionPaths,FTe as getNativeTomlMcpEditor,O7 as getOkArtifactPaths,G5 as isEntryUpToDate,J5 as isOwnManagedEntry,BDe as loadConfig,un as makeLazyProbeTokenStore,n9 as okBugReportsDir,b9 as parseGitHubBlobUrl,VDe as parseGitHubShareUrl,x9 as parseGitHubTreeUrl,y9 as parseGitUrl,KDe as pathInstallMarkerPath,vEe as previewContent,aDe as probeOwnManagedEditorMcpEntry,wDe as probePiBridgeState,A7 as probeTrackedOkPaths,Y7 as readExistingMcpEntry,LEe as readSharingMode,JB as redactContent,IEe as removeOkPathsFromGitExclude,kDe as removeOwnMcpEntry,AEe as removeProjectSkill,QDe as removeUserGlobalSkillBundle,iOe as removeUserSkill,wEe as resolveProjectRoot,LDe as runStop,h9 as truncatePriorEntry,E9 as userGlobalSkillBundleTargets,rOe as userSkillPresentAnywhere,HDe as validateLocalFolderForShare,J7 as writeEditorMcpConfig,tOe as writeProjectAiIntegrations,w7 as writeProjectSkill,rDe as writeUserMcpConfigs,nOe as writeUserSkill};
|
|
1531
1531
|
//# sourceMappingURL=index.mjs.map
|