@inkeep/open-knowledge 0.70.3 → 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-Dl36o0mH.mjs → init-CtwvSCyQ.mjs} +2 -2
- package/dist/init-DJa55PQU.mjs +1 -0
- package/dist/{launch-json-removal-3O2NwIMf.mjs → launch-json-removal-BE8E1vIW.mjs} +1 -1
- package/dist/loader-BzFUiCkF.mjs +1 -0
- package/dist/{loader-CvpazbE1.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-B_eP6zkI.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-DbzstoJN.mjs → registry-probes-C133eEg2.mjs} +1 -1
- package/dist/{repair-launch-json-BwywFZwu.mjs → repair-launch-json-Dg1iNDUl.mjs} +1 -1
- package/dist/{repair-mcp-configs-Da0GMl66.mjs → repair-mcp-configs-CFC8Q6rq.mjs} +1 -1
- package/dist/src-CAD7Jq9J.mjs +1 -0
- package/dist/{src-DmZyPc_9.mjs → src-CeTbcYYR.mjs} +1 -1
- package/dist/start-Cd7v3ush.mjs +1 -0
- package/dist/{start-C5pItnpl.mjs → start-DVCuq0UU.mjs} +3 -3
- package/package.json +4 -4
- package/dist/constants-B4vbt8P8.mjs +0 -1
- package/dist/init-B7RQoXca.mjs +0 -1
- package/dist/loader-CM2IcuJ7.mjs +0 -1
- package/dist/preview-CcbUoPA2.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-DctWmLGG.mjs +0 -1
- package/dist/start-DgzU4y4u.mjs +0 -1
|
@@ -462,7 +462,7 @@ $2`).split(`
|
|
|
462
462
|
</div>`}];function z0(e){return["```html preview",e.html,"```"].join(`
|
|
463
463
|
`)}const B0=[{name:`--chart-1`,light:`oklch(0.62 0.19 259)`,dark:`oklch(0.72 0.14 259)`},{name:`--chart-2`,light:`oklch(0.58 0.14 145)`,dark:`oklch(0.73 0.13 145)`},{name:`--chart-3`,light:`oklch(0.62 0.15 70)`,dark:`oklch(0.77 0.14 70)`},{name:`--chart-4`,light:`oklch(0.55 0.18 290)`,dark:`oklch(0.72 0.16 290)`},{name:`--chart-5`,light:`oklch(0.58 0.21 25)`,dark:`oklch(0.72 0.2 25)`},{name:`--primary`,light:`oklch(0.5621 0.1983 259.59)`,dark:`#69a3ff`},{name:`--primary-foreground`,light:`oklch(0.985 0 0)`,dark:`oklch(0.205 0 0)`},{name:`--foreground`,light:`oklch(0.145 0 0)`,dark:`oklch(0.985 0 0)`},{name:`--background`,light:`oklch(1 0 0)`,dark:`oklch(0.145 0 0)`},{name:`--card`,light:`oklch(1 0 0)`,dark:`oklch(0.205 0 0)`},{name:`--card-foreground`,light:`oklch(0.145 0 0)`,dark:`oklch(0.985 0 0)`},{name:`--muted-foreground`,light:`oklch(0.556 0 0)`,dark:`oklch(0.708 0 0)`},{name:`--border`,light:`oklch(0.922 0 0)`,dark:`oklch(1 0 0 / 10%)`},{name:`--destructive`,light:`oklch(0.577 0.245 27.325)`,dark:`oklch(0.704 0.191 22.216)`},{name:`--radius`,light:`0.625rem`,dark:`0.625rem`}],V0=`127.0.0.1`,H0=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(H0.map(e=>e.value));const U0=Tw.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}}}}),W0=Rw.extend({name:`emphasis`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`*`}}},addInputRules(){return[rw({find:Nw,type:this.type,getAttributes:{sourceDelimiter:`*`}}),rw({find:Fw,type:this.type,getAttributes:{sourceDelimiter:`_`}})]}}),G0=Mw.extend({name:`strong`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`**`}}},addInputRules(){return[rw({find:Dw,type:this.type,getAttributes:{sourceDelimiter:`**`}}),rw({find:kw,type:this.type,getAttributes:{sourceDelimiter:`__`}})]}}),K0=UC.create({name:`escapeMark`,priority:10,excludes:``,inclusive:!1,parseHTML(){return[{tag:`span[data-escape-mark]`}]},renderHTML(){return[`span`,{"data-escape-mark":``},0]}}),q0=yw.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 J0({node:e}){return``.repeat(e.nodeSize-e.content.size)}const Y0=yw.create({name:`footnoteReference`,marks:`_`,group:`inline`,inline:!0,atom:!0,selectable:!0,draggable:!1,priority:60,renderText:J0,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}})}}}),X0=Bw.extend({marks:`_`,priority:60,addAttributes(){return{...this.parent?.(),hardBreakStyle:{default:`backslash`},sourceRaw:{default:null}}}}),Z0=Hw.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}}}}),Q0=yw.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]}}),$0=yw.create({name:`imageReference`,marks:`_`,group:`inline`,inline:!0,atom:!0,priority:60,renderText:J0,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 e2(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 t2=Ww.extend({marks:`_`,priority:60,renderText:J0,addAttributes(){return{...this.parent?.(),sourceUrl:{default:null,rendered:!1}}},renderHTML({HTMLAttributes:e}){let t=BS(this.options.HTMLAttributes,e);return typeof t.src==`string`&&(t.src=e2(t.src)),[`img`,t]}}),n2=yw.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}})}}}),r2=yw.create({name:`jsxInline`,group:`inline`,inline:!0,atom:!1,content:`text*`,isolating:!1,selectable:!0,priority:60,renderText:J0,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]}}),i2=[`https`,`http`,`mailto`,`tel`,`ftp`,`sms`],a2=i2.map(e=>`${e}:`).join(`|`);RegExp(`^(?:${a2}|\\/|#|\\?|\\.\\/|\\.\\.\\/)`,`i`);function o2(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 s2=new Set(i2.map(e=>`${e}:`));function c2(e){try{let t=new URL(e,`https://placeholder.invalid`);return s2.has(t.protocol.toLowerCase())}catch{return!1}}const l2=`LinkFidelity must be derived from the Link extension`,u2=nT.extend({priority:60,addOptions(){let e=this.parent?.();if(e===void 0)throw Error(l2);return{...e,openOnClick:!1,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer`},isAllowedUri:c2,shouldAutoLink:()=>!0}},addAttributes(){let e=this.parent?.();if(e===void 0)throw Error(l2);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}}}}),d2=yw.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 f2(e){return e.type.name===`list`&&!e.attrs.ordered}function p2(e){return e.type.name===`list`&&!!e.attrs.ordered}function m2(e){let t=!1;return e.forEach(e=>{e.type.name===`listItem`&&e.attrs.checked!==null&&(t=!0)}),t}function h2(e,t,n,r,i,a,o){let s=AS(e=>e.type.name===`list`)(e.selection);if(s&&i(s.node)){let{$from:n,$to:i}=e.selection;return n.blockRange(i)?Og(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 Tg(n,a)(e,void 0)?!t||Tg(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 g2(e){return e===`x`||e===`X`}function _2(e){return e===`X`?`X`:null}function v2(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=Rm(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 y2=/^\s*([-+*])\s$/,b2=/^\s*(\d+)([.)])\s$/,x2=/^\s*[-*+]\s\[([ xX]?)\]\s$/,S2=/^\s*\[([ xX]?)\]\s$/,C2=yw.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,BS(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:h2(e,t,n,r,e=>f2(e)&&!m2(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:h2(e,t,n,r,e=>p2(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:h2(e,t,n,r,e=>f2(e)&&m2(e),{ordered:!1},{checked:!1})}}},addInputRules(){return[ow({find:y2,type:this.type,getAttributes:e=>({ordered:!1,bulletMarker:e[1]}),joinPredicate:(e,t)=>t.attrs.ordered===!1}),ow({find:b2,type:this.type,getAttributes:e=>({ordered:!0,start:Number(e[1]),listMarkerDelimiter:e[2]}),joinPredicate:(e,t)=>t.attrs.ordered===!0}),new RC({find:x2,handler:({state:e,range:t,match:n})=>v2(e,t,g2(n[1]),_2(n[1]))?void 0:null}),new RC({find:S2,handler:({state:e,range:t,match:n})=>v2(e,t,g2(n[1]),_2(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()}}}),w2=yw.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`,BS(t),0]:[`li`,BS(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(BS(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}}}}),T2=C2,E2=w2,D2=yw.create({name:`mathInline`,marks:`_`,group:`inline`,inline:!0,atom:!0,selectable:!0,priority:60,renderText:J0,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}})}}}),O2=yw.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}}}}),k2=yre.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceMarkerSpacings:{default:null}}}}),A2=Sre.extend({excludes:``,addAttributes(){return{...this.parent?.(),sourceFenceChar:{default:"`"},sourceFenceLength:{default:1},sourcePadded:{default:!1,rendered:!1}}}}),j2=yw.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)}}}),M2=UC.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)}}}),N2=GC.create({name:`docFidelity`,addGlobalAttributes(){return[{types:[`doc`],attributes:{sourceDocBoundary:{default:null,rendered:!1}}}]}});function P2(e){for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return t;return null}function F2(e){let t=!1;return e.descendants(e=>!t&&(e.type.name===`list`&&(t=!0),!t)),t}function I2(e){let{selection:t}=e;return t instanceof Dh?t.$cursor:null}function L2(e){let t=I2(e);if(t?.parentOffset!==0)return!1;let n=P2(t);if(n===null||t.depth!==n+1||t.index(n)!==0)return!1;let r=t.index(n-1);return r!==0&&F2(t.node(n-1).child(r-1))}function R2(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 z2(e){let t=I2(e);if(!t||t.parentOffset!==t.parent.content.size)return!1;let n=P2(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=R2(t,n);return r!==null&&r<n}const B2=GC.create({name:`listBoundaryMerge`,addKeyboardShortcuts(){let e=()=>{let{editor:e}=this;if(!L2(e.state))return!1;if(e.commands.undoInputRule())return!0;let{state:t,view:n}=e;return Gh(t,n.dispatch,n)},t=()=>{let{editor:e}=this;if(!z2(e.state))return!1;let{state:t,view:n}=e;return Kh(t,n.dispatch,n)};return{Backspace:e,"Mod-Backspace":e,Delete:t,"Mod-Delete":t}}}),V2=GC.create({name:`plainTextClipboard`,priority:1e3,addProseMirrorPlugins(){return[new Rh({key:new Vh(`okPlainTextClipboard`),props:{clipboardTextSerializer:e=>e.content.textBetween(0,e.content.size,`
|
|
464
464
|
|
|
465
|
-
`)}})]}}),H2=UC.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 U2(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||W2(n)===r||x1(e)===t}function W2(e){return e.replace(/\\([!-/:-@[-`{-~])/g,`$1`)}const G2=zre.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`~~`,rendered:!1}}}}),K2=dE.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDashCounts:{default:null},sourceOuterPipes:{default:null,rendered:!1},sourceAlignmentPadding:{default:null,rendered:!1}}}}),q2=iE.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),J2=aE.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),Y2=yw.create({name:`tag`,marks:`_`,group:`inline`,inline:!0,atom:!0,selectable:!0,priority:60,renderText:J0,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()}}}),X2=/^(?:---|—-|___\s|\*\*\*\s)$/;function Z2(e){let t=String(e[0]??``).replace(/\s+$/,``);return t===`—-`?`---`:t}const Q2=wre.extend({name:`thematicBreak`,priority:60,addAttributes(){return{...this.parent?.(),sourceRaw:{default:`---`}}},addInputRules(){return[iw({find:X2,type:this.type,getAttributes:e=>({sourceRaw:Z2(e)})})]}}),$2=Vre.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceForm:{default:`u`,rendered:!1}}}});function e4(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function t4(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}const n4=yw.create({name:`wikiLink`,marks:`_`,group:`inline`,inline:!0,atom:!0,priority:60,renderText:J0,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:e4(e.getAttribute(`data-alias`)),anchor:e4(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:e4(e.getAttribute(`data-alias`)),anchor:e4(e.getAttribute(`data-anchor`)),resolved:!1}:!1}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.target??``),r=e4(e.attrs.alias),i=e4(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`},t4({target:n,alias:r,anchor:i})]}});function r4(e){let t=e.split(`/`).pop()??e,n=t.lastIndexOf(`.`);return n<=0||n===t.length-1?``:t.slice(n+1).toLowerCase()}function i4(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}const a4=[n2,O2,r2,D2,n4,yw.create({name:`wikiLinkEmbed`,group:`inline`,inline:!0,atom:!0,priority:60,renderText:J0,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:e4(e.getAttribute(`data-alias`)),anchor:e4(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=e4(e.attrs.alias),i=e4(e.attrs.anchor),a=e4(e.attrs.resolvedSrc),o=r4(n);if(Yu.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`},i4({target:n,alias:r,anchor:i})]}}),Y2,T2,E2,W0,G0,G2,$2,A2,U0,k2,Z0,Q2,u2,Q0,d2,X0,K0,N2,H2,V2,die.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}}),B2,K2.configure({resizable:!0}),oE,J2,q2,t2.configure({inline:!0}),$0,aT,M2,j2,Y0,q0];function o4(e){let{frontmatter:t}=Xc(e);if(t===``)return null;let n;try{let e=(0,Bc.parseDocument)(Qc(t));if(e.errors.length>0)return null;n=e.toJS()}catch{return null}return typeof n!=`object`||!n||Array.isArray(n)?null:n}const s4=/^[a-zA-Z0-9][\w/-]*$/;function c4(e){return e.startsWith(`#`)?e.slice(1):e}function l4(e){return typeof e==`string`?[e]:Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function u4(e){if(!e||e.trim()===``)return[];let{map:t}=el(e);if(!t)return[];let n=l4(t.tags),r=[];for(let e of n){let t=c4(e);s4.test(t)&&r.push(t)}return r}const d4=I({changes:F(ro(`kind`,[I({key:M(),kind:R(`added`),after:Wc}).loose(),I({key:M(),kind:R(`removed`),before:Wc}).loose(),I({key:M(),kind:R(`changed`),before:Wc,after:Wc}).loose()])),unparseable:I({before:M(),after:M()}).loose().nullable()}).loose();function f4(e){let{fenced:t}=cQ(e),n=uQ(t);if(n.map===null)return{fenced:t,map:{},keys:[],parseError:n.parseError};let r=al(n.doc);return{fenced:t,map:n.map,keys:r.length>0?r:Object.keys(n.map),parseError:void 0}}function p4(e,t){let n=f4(e),r=f4(t);if(n.parseError!==void 0||r.parseError!==void 0)return{changes:[],unparseable:{before:n.fenced,after:r.fenced}};let i=[],a=new Set;for(let e of r.keys){if(a.has(e))continue;a.add(e);let t=r.map[e];if(t===void 0)continue;let o=n.map[e];if(o===void 0){i.push({key:e,kind:`added`,after:t});continue}Jc(o,t)||i.push({key:e,kind:`changed`,before:o,after:t})}for(let e of n.keys){if(a.has(e))continue;a.add(e);let t=n.map[e];t!==void 0&&i.push({key:e,kind:`removed`,before:t})}return{changes:i,unparseable:null}}function m4(e,t){switch(e){case`darwin`:return[`/opt/homebrew/bin`,`/usr/local/bin`,`/opt/local/bin`,`${t}/.local/bin`,`${t}/.asdf/shims`,`${t}/.local/share/mise/shims`];case`win32`:return[];default:return[`/usr/local/bin`,`/home/linuxbrew/.linuxbrew/bin`,`${t}/.local/bin`,`${t}/.asdf/shims`,`${t}/.local/share/mise/shims`]}}function h4(e,t,n){let r=n.delimiter,i=(e??``).split(r).filter(e=>e.length>0),a=new Set(i),o=[];for(let e of t)!a.has(e)&&n.isDir(e)&&(a.add(e),o.push(e));return[...i,...o].join(r)}function g4(e,t){return h4(e,m4(t.platform,t.homeDir),t)}function _4(e,t){switch(e){case`darwin`:return[`${t}/Library/pnpm`,`${t}/.bun/bin`,`${t}/.volta/bin`,`${t}/.yarn/bin`,`${t}/.npm-global/bin`];case`win32`:return[];default:return[`${t}/.local/share/pnpm`,`${t}/.bun/bin`,`${t}/.volta/bin`,`${t}/.yarn/bin`,`${t}/.npm-global/bin`]}}function v4(e,t){return h4(e,[...m4(t.platform,t.homeDir),..._4(t.platform,t.homeDir)],t)}3072-y4("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 y4(e,t){let n=encodeURIComponent(e);return t===`cursor`?encodeURIComponent(n).length:n.length}function b4(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}}const x4=new Set([`opencode.json`]),S4=/^\.[A-Za-z0-9_-]+\/skills\/[^/]+\/.+$/;function C4(e){return S4.test(e)}function w4(e){return C4(e)?!1:e.split(`/`).some(e=>e.startsWith(`.`))?!0:x4.has(e.slice(e.lastIndexOf(`/`)+1))}function T4(e,t){let n=b4(e);n.ok||t.addIssue({code:`custom`,message:n.reason})}const E4=M().superRefine(T4).optional(),D4=M().superRefine(T4),O4={agentId:M().optional(),agentName:M().optional(),colorSeed:M().optional(),clientName:M().optional(),clientVersion:M().optional(),label:M().optional()},k4=M().optional(),A4=/^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,j4=ro(`kind`,[I({kind:R(`doc`),docPath:M().min(1)}).loose(),I({kind:R(`folder`),folderPath:M()}).loose()]),M4=L([`no-remote`,`detached-head`,`branch-not-on-origin`,`non-github-remote`,`invalid-path`,`unsupported-share-url`]),N4=L([`current`,`stale`,`absent`,`empty`]),P4=ro(`ok`,[I({ok:R(!0),shareUrl:M().min(1),sharedUrl:M().min(1),branch:M().min(1),freshness:N4.optional().catch(void 0)}).loose(),I({ok:R(!1),error:M4,branch:M().min(1).optional()}).loose()]),F4=L([`user`,`org`]),I4=I({login:M().min(1),kind:F4,avatarUrl:M().optional()}).loose(),L4=L([`auth-required`,`network`]),R4=ro(`ok`,[I({ok:R(!0),owners:F(I4)}).loose(),I({ok:R(!1),error:L4}).loose()]),z4=ro(`ok`,[I({ok:R(!0),available:P()}).loose(),I({ok:R(!1),error:L4}).loose()]),B4=L([`public`,`private`]),V4=I({owner:M().min(1),name:M().min(1),visibility:B4,description:M().optional()}).loose(),H4=L([`name-conflict`,`saml-sso`,`auth-required`,`push-failed`,`init-failed`,`network`,`no-project`]),U4=ro(`ok`,[I({ok:R(!0),ownerLogin:M().min(1),repoName:M().min(1),cloneUrl:M().min(1),defaultBranch:M().min(1)}).loose(),I({ok:R(!1),error:H4}).loose()]);function W4(e){return!(typeof e!=`string`||e.length===0||e.startsWith(`-`)||/[\x00-\x1F\x7F]/.test(e)||/\s/.test(e)||e.includes(`:`)||e.split(`/`).includes(`..`))}const G4=e=>e.refine(W4,`invalid branch name`);function K4(e){if(e==null)return!1;let t=e instanceof Error?e.message:String(e);return/couldn'?t find remote ref|Remote branch .+ not found/i.test(t)}const q4=[/could not read (username|password)/i,/terminal prompts disabled/i,/user interactivity has been disabled/i,/unable to get password from user/i],J4=[/insufficient scopes/i,/missing.*scope/i,/required scope/i],Y4=[/permission denied.*\(publickey\)/i,/host key verification failed/i],X4=/fatal:.*repository.*not found/i,Z4=[/\b(401|403)\b/,/authentication failed/i,/authorization failed/i,/invalid credentials/i,/credential helper/i,/bad credentials/i,/token.*expired/i,/expired.*token/i,X4];function Q4(e){if(typeof e!=`object`||!e)return``;let t=e.git;return t==null?``:String(t)}function $4(e){if(e==null)return{kind:`non-auth`};let t=`${e instanceof Error?e.message:String(e)}\n${Q4(e)}`;return q4.some(e=>e.test(t))?{kind:`auth`,subclass:`no-credential`}:J4.some(e=>e.test(t))?{kind:`auth`,subclass:`scope-mismatch`}:Y4.some(e=>e.test(t))?{kind:`auth`,subclass:`ssh-auth`}:Z4.some(e=>e.test(t))?/\b401\b/.test(t)||/token.*expired/i.test(t)?{kind:`auth`,subclass:`401`}:/\b403\b/.test(t)?{kind:`auth`,subclass:`403`}:X4.test(t)?{kind:`auth`,subclass:`not-found-as-identity`}:{kind:`auth`,subclass:`unknown-auth`}:{kind:`non-auth`}}function e3(e){return e.kind===`auth`?e.subclass===`no-credential`||e.subclass===`401`||e.subclass===`unknown-auth`:!1}const t3={shareTargetExists:P(),dirtyConflicts:I({conflicts:P(),files:F(M().min(1))}).loose(),branchIsLocal:P(),shareTargetOnOriginBranch:P().optional()},n3=ro(`detached`,[I({detached:R(!1),currentBranch:M().min(1).nullable(),currentHeadSha:Wa(),...t3}).loose(),I({detached:R(!0),currentBranch:Wa(),currentHeadSha:M().min(1),...t3}).loose()]),r3=I({branch:G4(M().min(1)),principalId:M().optional(),fastForward:P().optional()}).loose(),i3=L([`dirty-conflict`,`branch-not-found`,`fetch-failed`,`checkout-failed`,`branch-in-other-worktree`,`ff-diverged`]),a3=ro(`ok`,[I({ok:R(!0)}).loose(),I({ok:R(!1),reason:i3,files:F(M().min(1)).optional(),otherWorktreePath:M().min(1).optional()}).loose()]);L([`on-origin`,`renamed`,`deleted`,`never-on-branch`,`changed-locally`,`unknown`]);const o3=I({branch:G4(M().min(1)),path:M(),kind:L([`doc`,`folder`]),contentRootDepth:N().int().min(1).max(65535).optional()}).loose(),s3=ro(`verdict`,[I({verdict:R(`on-origin`)}).loose(),I({verdict:R(`renamed`),renamedTo:M().min(1)}).loose(),I({verdict:R(`deleted`)}).loose(),I({verdict:R(`never-on-branch`)}).loose(),I({verdict:R(`changed-locally`)}).loose(),I({verdict:R(`unknown`)}).loose()]).catch({verdict:`unknown`}),c3=I({startedAt:M().min(1),httpListenMs:N().nonnegative().optional(),seedWalkMs:N().nonnegative().optional(),indexesMs:N().nonnegative().optional(),readyMs:N().nonnegative().optional(),fileCount:N().nonnegative().optional()}),l3=I({serverInstanceId:M().min(1),currentBranch:M().min(1).optional(),currentDiskAckSVs:oo(M().min(1),M().min(1)).optional(),boot:c3.optional(),collabClients:N().int().nonnegative().optional()}).loose(),u3=I({id:M().min(1),display_name:M().min(1),display_email:M(),source:L([`git-config`,`synthesized`]),created_at:M().min(1)}).loose(),d3=I({collabUrl:M().nullable(),previewUrl:M().nullable(),port:N(),singleFile:P().default(!1)}).loose(),f3=L(`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(`.`));function p3(e){throw Error(`Unexpected ProblemType variant: ${JSON.stringify(e)}`)}const m3=I({type:f3,title:M().min(1),status:N().int().min(400).max(599),instance:M().regex(A4,`instance must be urn:uuid:<uuid>`).optional(),detail:M().optional()}).loose(),h3=I({parentDocName:M().min(1),placement:L([`configured-attachments`,`parent-dir`]).default(`configured-attachments`),agentId:M().min(1).optional(),agentName:M().min(1).optional()}).loose(),g3=I({src:M().min(1),path:M().min(1).optional(),deduped:P().optional()}).loose(),_3=I({url:M().min(1),dir:M().min(1),branch:M().min(1).refine(W4,`invalid branch name`).optional()}).loose(),v3=I({type:R(`error`),problem:m3}).loose();function y3(e,t){let n=t.map(e=>[lp(e),e]);for(let t of e){let e=lp(t);if(e===null)continue;let r=n.find(([t])=>t===e);if(r!==void 0)return r[1]}}function b3(e){let{override:t,storedPreference:n,preferenceList:r,supportedLocales:i}=e,a=e.autoDetectableLocales??i;if(t!==void 0){let e=y3([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=y3(r,a);return o===void 0?{locale:`en`,source:`fallback`}:{locale:o,source:`system`}}const x3=[`.ok`,`local`,`installed-skills.json`],S3=L(hl),C3=eo({hosts:F(M()),scope:S3,scripts:P(),installedAt:Ki(),projection:L([`symlink`,`copy`]).optional(),contentHash:M().optional()}),w3=eo({schema:R(1),skills:oo(M(),C3).default({})});function T3(){return{schema:1,skills:{}}}function E3(e){let t;try{t=JSON.parse(e)}catch{return null}let n=w3.safeParse(t);return n.success?n.data:null}const D3=[{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:`~`}],Dae=D3.map(e=>e.name);function Oae(e){let t=new Set,n=0;return{redacted:e.split(`
|
|
465
|
+
`)}})]}}),H2=UC.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 U2(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||W2(n)===r||x1(e)===t}function W2(e){return e.replace(/\\([!-/:-@[-`{-~])/g,`$1`)}const G2=zre.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`~~`,rendered:!1}}}}),K2=dE.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDashCounts:{default:null},sourceOuterPipes:{default:null,rendered:!1},sourceAlignmentPadding:{default:null,rendered:!1}}}}),q2=iE.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),J2=aE.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),Y2=yw.create({name:`tag`,marks:`_`,group:`inline`,inline:!0,atom:!0,selectable:!0,priority:60,renderText:J0,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()}}}),X2=/^(?:---|—-|___\s|\*\*\*\s)$/;function Z2(e){let t=String(e[0]??``).replace(/\s+$/,``);return t===`—-`?`---`:t}const Q2=wre.extend({name:`thematicBreak`,priority:60,addAttributes(){return{...this.parent?.(),sourceRaw:{default:`---`}}},addInputRules(){return[iw({find:X2,type:this.type,getAttributes:e=>({sourceRaw:Z2(e)})})]}}),$2=Vre.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceForm:{default:`u`,rendered:!1}}}});function e4(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function t4(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}const n4=yw.create({name:`wikiLink`,marks:`_`,group:`inline`,inline:!0,atom:!0,priority:60,renderText:J0,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:e4(e.getAttribute(`data-alias`)),anchor:e4(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:e4(e.getAttribute(`data-alias`)),anchor:e4(e.getAttribute(`data-anchor`)),resolved:!1}:!1}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.target??``),r=e4(e.attrs.alias),i=e4(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`},t4({target:n,alias:r,anchor:i})]}});function r4(e){let t=e.split(`/`).pop()??e,n=t.lastIndexOf(`.`);return n<=0||n===t.length-1?``:t.slice(n+1).toLowerCase()}function i4(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}const a4=[n2,O2,r2,D2,n4,yw.create({name:`wikiLinkEmbed`,group:`inline`,inline:!0,atom:!0,priority:60,renderText:J0,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:e4(e.getAttribute(`data-alias`)),anchor:e4(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=e4(e.attrs.alias),i=e4(e.attrs.anchor),a=e4(e.attrs.resolvedSrc),o=r4(n);if(Yu.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`},i4({target:n,alias:r,anchor:i})]}}),Y2,T2,E2,W0,G0,G2,$2,A2,U0,k2,Z0,Q2,u2,Q0,d2,X0,K0,N2,H2,V2,die.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}}),B2,K2.configure({resizable:!0}),oE,J2,q2,t2.configure({inline:!0}),$0,aT,M2,j2,Y0,q0];function o4(e){let{frontmatter:t}=Xc(e);if(t===``)return null;let n;try{let e=(0,Bc.parseDocument)(Qc(t));if(e.errors.length>0)return null;n=e.toJS()}catch{return null}return typeof n!=`object`||!n||Array.isArray(n)?null:n}const s4=/^[a-zA-Z0-9][\w/-]*$/;function c4(e){return e.startsWith(`#`)?e.slice(1):e}function l4(e){return typeof e==`string`?[e]:Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function u4(e){if(!e||e.trim()===``)return[];let{map:t}=el(e);if(!t)return[];let n=l4(t.tags),r=[];for(let e of n){let t=c4(e);s4.test(t)&&r.push(t)}return r}const d4=I({changes:F(ro(`kind`,[I({key:M(),kind:R(`added`),after:Wc}).loose(),I({key:M(),kind:R(`removed`),before:Wc}).loose(),I({key:M(),kind:R(`changed`),before:Wc,after:Wc}).loose()])),unparseable:I({before:M(),after:M()}).loose().nullable()}).loose();function f4(e){let{fenced:t}=cQ(e),n=uQ(t);if(n.map===null)return{fenced:t,map:{},keys:[],parseError:n.parseError};let r=al(n.doc);return{fenced:t,map:n.map,keys:r.length>0?r:Object.keys(n.map),parseError:void 0}}function p4(e,t){let n=f4(e),r=f4(t);if(n.parseError!==void 0||r.parseError!==void 0)return{changes:[],unparseable:{before:n.fenced,after:r.fenced}};let i=[],a=new Set;for(let e of r.keys){if(a.has(e))continue;a.add(e);let t=r.map[e];if(t===void 0)continue;let o=n.map[e];if(o===void 0){i.push({key:e,kind:`added`,after:t});continue}Jc(o,t)||i.push({key:e,kind:`changed`,before:o,after:t})}for(let e of n.keys){if(a.has(e))continue;a.add(e);let t=n.map[e];t!==void 0&&i.push({key:e,kind:`removed`,before:t})}return{changes:i,unparseable:null}}function m4(e,t){switch(e){case`darwin`:return[`/opt/homebrew/bin`,`/usr/local/bin`,`/opt/local/bin`,`${t}/.local/bin`,`${t}/.asdf/shims`,`${t}/.local/share/mise/shims`];case`win32`:return[];default:return[`/usr/local/bin`,`/home/linuxbrew/.linuxbrew/bin`,`${t}/.local/bin`,`${t}/.asdf/shims`,`${t}/.local/share/mise/shims`]}}function h4(e,t,n){let r=n.delimiter,i=(e??``).split(r).filter(e=>e.length>0),a=new Set(i),o=[];for(let e of t)!a.has(e)&&n.isDir(e)&&(a.add(e),o.push(e));return[...i,...o].join(r)}function g4(e,t){return h4(e,m4(t.platform,t.homeDir),t)}function _4(e,t){switch(e){case`darwin`:return[`${t}/Library/pnpm`,`${t}/.bun/bin`,`${t}/.volta/bin`,`${t}/.yarn/bin`,`${t}/.npm-global/bin`];case`win32`:return[];default:return[`${t}/.local/share/pnpm`,`${t}/.bun/bin`,`${t}/.volta/bin`,`${t}/.yarn/bin`,`${t}/.npm-global/bin`]}}function v4(e,t){return h4(e,[...m4(t.platform,t.homeDir),..._4(t.platform,t.homeDir)],t)}3072-y4("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 y4(e,t){let n=encodeURIComponent(e);return t===`cursor`?encodeURIComponent(n).length:n.length}function b4(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}}const x4=new Set([`opencode.json`]),S4=/^\.[A-Za-z0-9_-]+\/skills\/[^/]+\/.+$/;function C4(e){return S4.test(e)}function w4(e){return C4(e)?!1:e.split(`/`).some(e=>e.startsWith(`.`))?!0:x4.has(e.slice(e.lastIndexOf(`/`)+1))}function T4(e,t){let n=b4(e);n.ok||t.addIssue({code:`custom`,message:n.reason})}const E4=M().superRefine(T4).optional(),D4=M().superRefine(T4),O4={agentId:M().optional(),agentName:M().optional(),colorSeed:M().optional(),clientName:M().optional(),clientVersion:M().optional(),label:M().optional()},k4=M().optional(),A4=/^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,j4=ro(`kind`,[I({kind:R(`doc`),docPath:M().min(1)}).loose(),I({kind:R(`folder`),folderPath:M()}).loose()]),M4=L([`no-remote`,`detached-head`,`branch-not-on-origin`,`non-github-remote`,`invalid-path`,`unsupported-share-url`]),N4=L([`current`,`stale`,`absent`,`empty`]),P4=ro(`ok`,[I({ok:R(!0),shareUrl:M().min(1),sharedUrl:M().min(1),branch:M().min(1),freshness:N4.optional().catch(void 0)}).loose(),I({ok:R(!1),error:M4,branch:M().min(1).optional()}).loose()]),F4=L([`user`,`org`]),I4=I({login:M().min(1),kind:F4,avatarUrl:M().optional()}).loose(),L4=L([`auth-required`,`network`]),R4=ro(`ok`,[I({ok:R(!0),owners:F(I4)}).loose(),I({ok:R(!1),error:L4}).loose()]),z4=ro(`ok`,[I({ok:R(!0),available:P()}).loose(),I({ok:R(!1),error:L4}).loose()]),B4=L([`public`,`private`]),V4=I({owner:M().min(1),name:M().min(1),visibility:B4,description:M().optional()}).loose(),H4=L([`name-conflict`,`saml-sso`,`auth-required`,`push-failed`,`init-failed`,`network`,`no-project`]),U4=ro(`ok`,[I({ok:R(!0),ownerLogin:M().min(1),repoName:M().min(1),cloneUrl:M().min(1),defaultBranch:M().min(1)}).loose(),I({ok:R(!1),error:H4}).loose()]);function W4(e){return!(typeof e!=`string`||e.length===0||e.startsWith(`-`)||/[\x00-\x1F\x7F]/.test(e)||/\s/.test(e)||e.includes(`:`)||e.split(`/`).includes(`..`))}const G4=e=>e.refine(W4,`invalid branch name`);function K4(e){if(e==null)return!1;let t=e instanceof Error?e.message:String(e);return/couldn'?t find remote ref|Remote branch .+ not found/i.test(t)}const q4=[/could not read (username|password)/i,/terminal prompts disabled/i,/user interactivity has been disabled/i,/unable to get password from user/i],J4=[/insufficient scopes/i,/missing.*scope/i,/required scope/i],Y4=[/permission denied.*\(publickey\)/i,/host key verification failed/i],X4=/fatal:.*repository.*not found/i,Z4=[/\b(401|403)\b/,/authentication failed/i,/authorization failed/i,/invalid credentials/i,/credential helper/i,/bad credentials/i,/token.*expired/i,/expired.*token/i,X4];function Q4(e){if(typeof e!=`object`||!e)return``;let t=e.git;return t==null?``:String(t)}function $4(e){if(e==null)return{kind:`non-auth`};let t=`${e instanceof Error?e.message:String(e)}\n${Q4(e)}`;return q4.some(e=>e.test(t))?{kind:`auth`,subclass:`no-credential`}:J4.some(e=>e.test(t))?{kind:`auth`,subclass:`scope-mismatch`}:Y4.some(e=>e.test(t))?{kind:`auth`,subclass:`ssh-auth`}:Z4.some(e=>e.test(t))?/\b401\b/.test(t)||/token.*expired/i.test(t)?{kind:`auth`,subclass:`401`}:/\b403\b/.test(t)?{kind:`auth`,subclass:`403`}:X4.test(t)?{kind:`auth`,subclass:`not-found-as-identity`}:{kind:`auth`,subclass:`unknown-auth`}:{kind:`non-auth`}}function e3(e){return e.kind===`auth`?e.subclass===`no-credential`||e.subclass===`401`||e.subclass===`unknown-auth`:!1}const t3={shareTargetExists:P(),dirtyConflicts:I({conflicts:P(),files:F(M().min(1))}).loose(),branchIsLocal:P(),shareTargetOnOriginBranch:P().optional()},n3=ro(`detached`,[I({detached:R(!1),currentBranch:M().min(1).nullable(),currentHeadSha:Wa(),...t3}).loose(),I({detached:R(!0),currentBranch:Wa(),currentHeadSha:M().min(1),...t3}).loose()]),r3=I({branch:G4(M().min(1)),principalId:M().optional(),fastForward:P().optional()}).loose(),i3=L([`dirty-conflict`,`branch-not-found`,`fetch-failed`,`checkout-failed`,`branch-in-other-worktree`,`ff-diverged`]),a3=ro(`ok`,[I({ok:R(!0)}).loose(),I({ok:R(!1),reason:i3,files:F(M().min(1)).optional(),otherWorktreePath:M().min(1).optional()}).loose()]);L([`on-origin`,`renamed`,`deleted`,`never-on-branch`,`changed-locally`,`unknown`]);const o3=I({branch:G4(M().min(1)),path:M(),kind:L([`doc`,`folder`]),contentRootDepth:N().int().min(1).max(65535).optional()}).loose(),s3=ro(`verdict`,[I({verdict:R(`on-origin`)}).loose(),I({verdict:R(`renamed`),renamedTo:M().min(1)}).loose(),I({verdict:R(`deleted`)}).loose(),I({verdict:R(`never-on-branch`)}).loose(),I({verdict:R(`changed-locally`)}).loose(),I({verdict:R(`unknown`)}).loose()]).catch({verdict:`unknown`}),c3=I({startedAt:M().min(1),httpListenMs:N().nonnegative().optional(),seedWalkMs:N().nonnegative().optional(),indexesMs:N().nonnegative().optional(),readyMs:N().nonnegative().optional(),fileCount:N().nonnegative().optional()}),l3=I({serverInstanceId:M().min(1),currentBranch:M().min(1).optional(),currentDiskAckSVs:oo(M().min(1),M().min(1)).optional(),boot:c3.optional(),collabClients:N().int().nonnegative().optional()}).loose(),u3=I({id:M().min(1),display_name:M().min(1),display_email:M(),source:L([`git-config`,`synthesized`]),created_at:M().min(1)}).loose(),d3=I({collabUrl:M().nullable(),previewUrl:M().nullable(),port:N(),singleFile:P().default(!1)}).loose(),f3=L(`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(`.`));function p3(e){throw Error(`Unexpected ProblemType variant: ${JSON.stringify(e)}`)}const m3=I({type:f3,title:M().min(1),status:N().int().min(400).max(599),instance:M().regex(A4,`instance must be urn:uuid:<uuid>`).optional(),detail:M().optional()}).loose(),h3=I({parentDocName:M().min(1),placement:L([`configured-attachments`,`parent-dir`]).default(`configured-attachments`),agentId:M().min(1).optional(),agentName:M().min(1).optional()}).loose(),g3=I({src:M().min(1),path:M().min(1).optional(),deduped:P().optional()}).loose(),_3=I({url:M().min(1),dir:M().min(1),branch:M().min(1).refine(W4,`invalid branch name`).optional()}).loose(),v3=I({type:R(`error`),problem:m3}).loose();function y3(e,t){let n=t.map(e=>[lp(e),e]);for(let t of e){let e=lp(t);if(e===null)continue;let r=n.find(([t])=>t===e);if(r!==void 0)return r[1]}}function b3(e){let{override:t,storedPreference:n,preferenceList:r,supportedLocales:i}=e,a=e.autoDetectableLocales??i;if(t!==void 0){let e=y3([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=y3(r,a);return o===void 0?{locale:`en`,source:`fallback`}:{locale:o,source:`system`}}const x3=[`.ok`,`local`,`installed-skills.json`],S3=L(hl),C3=eo({hosts:F(M()),scope:S3,scripts:P(),installedAt:Ki(),projection:L([`symlink`,`copy`]).optional(),contentHash:M().optional()}),w3=eo({schema:R(1),skills:oo(M(),C3).default({})});function T3(){return{schema:1,skills:{}}}function E3(e){let t;try{t=JSON.parse(e)}catch{return null}let n=w3.safeParse(t);return n.success?n.data:null}const D3=[{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:`~`}],Dae=D3.map(e=>e.name);function Oae(e){let t=new Set,n=0;return{redacted:e.split(`
|
|
466
466
|
`).map(e=>{let r=e,i=!1;for(let{name:e,regex:n,replacement:a}of D3)n.lastIndex=0,n.test(r)&&(t.add(e),i=!0,n.lastIndex=0,r=r.replace(n,a));return i&&n++,r}).join(`
|
|
467
467
|
`),patterns:[...t],lineCount:n}}function kae(e,t,n=3){let r=RegExp(`^ {0,3}(\\${e}+)[ \\t]*$`),i=Math.max(3,n);for(let e of t.split(`
|
|
468
468
|
`)){let t=r.exec(e);t&&t[1].length>=i&&(i=t[1].length+1)}return i}function Aae(e){let t=zO(`## ${e.replace(/\s+/g,` `).trim()}`).children[0];return t===void 0||t.type!==`heading`?``:iD(t,{includeHtml:!1}).replace(/\s+/g,` `).trim().normalize(`NFC`)}function jae(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(`
|
|
@@ -540,7 +540,7 @@ $2`).split(`
|
|
|
540
540
|
`?(c+=1,l=1):l+=1;return{line:c,column:l}};for(let e of o.matchAll(aue)){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(oue(e[0]),s)}})}),cue=[`index`,`log`];function lue(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);if(n<=0)return t;let r=t.slice(n).toLowerCase();return w0.includes(r)?t.slice(0,n):t}const uue=F5(`reserved-casing`,(e,t)=>{let n=t.data.okfDocName;if(n===void 0)return;let r=lue(n),i=r.toLowerCase();cue.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.`)}),z5=[{id:`no-wiki-links`,rule:sue},{id:`log-shape`,rule:iue},{id:`index-shape`,rule:eue},{id:`reserved-casing`,rule:uue}],due=z5.map(e=>e.rule);function fue(e){return e===void 0?due:z5.filter(t=>O5(e,t.id)).map(e=>e.rule)}const pue=no([P(),L(Md),oo(M(),Ja())]),mue={id:`markdownlint`,sliceSchema:I({enabled:P(),rules:oo(M(),pue)}),defaultSlice:{enabled:!1,rules:d5},async lint(e,t){return Fle(e,f5(t.rules))},fix(e,t){return Ple(e,f5(t.rules))}},hue=I({appliesTo:no([M(),F(M())]).optional(),file:M(),enabled:P().optional(),key:M().optional(),schema:oo(M(),Ja()).optional()}),B5=[mue,{id:`frontmatter`,sliceSchema:I({enabled:P(),schemas:F(hue)}),defaultSlice:{enabled:!1,schemas:[]},async lint(e,t,n){return D5(e,h5(t.schemas,n.docName))},frontmatter:{schemasForDoc:(e,t)=>h5(e.schemas,t),narrowSliceToFrontmatter:e=>e,advertisedMappings:e=>e.schemas}},{id:`okf`,sliceSchema:I({enabled:P(),rules:oo(M(),P()).optional(),generate:I({index:P().optional()}).optional()}),defaultSlice:{enabled:!1},async lint(e,t,n){return[...Qle(e,fue(t.rules),n.docName),...Yle(e,t.rules,n.docName)]},frontmatter:{schemasForDoc:(e,t)=>P5(e.rules,t),narrowSliceToFrontmatter:e=>({...e,rules:{...e.rules,...qle}}),advertisedMappings:e=>Jle(e.rules)}}],gue={enabled:!0,plugins:Object.fromEntries(B5.map(e=>[e.id,e.defaultSlice]))};function V5(e,t){return e.enabled&&e.plugins[t]?.enabled===!0}function _ue(e){if(!e?.enabled)return[];let t=[];for(let n of B5){if(n.frontmatter===void 0)continue;let r=e.plugins[n.id];r?.enabled===!0&&t.push(...n.frontmatter.advertisedMappings(r))}return t}const vue=I({docName:E4,summary:k4,content:M().optional(),...O4}).loose(),yue=I({docName:E4,summary:k4,markdown:M(),position:L([`append`,`prepend`,`replace`]).optional(),extension:L(w0).optional(),...O4}).loose(),bue=I({docName:E4,summary:k4,find:M().min(1),replace:M(),offset:N().int().nonnegative().optional(),...O4}).loose(),xue=I({docName:E4,connectionId:M().min(1),scope:L([`last`,`session`,`file`,`count`]).optional(),count:N().int().positive().optional(),...O4}).loose().refine(e=>e.scope!==`count`||e.count!==void 0,{message:`count is required when scope is 'count'`,path:[`count`]}),H5=I({value:M(),truncatedFrom:N().int().nonnegative().optional(),hint:M().optional()}).loose(),Sue=ro(`kind`,[I({kind:R(`inline`),content:M()}),I({kind:R(`truncated`),byteLength:N().int().nonnegative(),hint:M()})]),U5=I({kind:R(`content-divergence`),intendedBytes:N().int().nonnegative(),actualBytes:N().int().nonnegative(),byteDelta:N().int(),divergenceType:M().optional(),currentState:Sue.optional(),hint:M().optional()}).loose(),Cue=I({type:R(`orphan`),parentCandidates:F(M()),message:M()}).loose(),W5=I({kind:R(`disk-edit-reconciled`),intendedBytes:N().int().nonnegative(),actualBytes:N().int().nonnegative(),byteDelta:N().int(),mergeOutcome:M().optional(),hint:M().optional()}).loose();ro(`kind`,[U5,W5]);const G5=Object.keys({"content-divergence":!0,"disk-edit-reconciled":!0});function wue(e){return G5.includes(e)}function Tue(e){throw Error(`Unexpected WriteWarning variant: ${JSON.stringify(e)}`)}const Eue=I({kind:R(`mermaid-parse-error`),fenceIndex:N().int().positive(),fenceFirstLine:M(),message:M(),line:N().int().positive().optional()}).loose(),K5=I({href:M(),targetKind:M(),role:M(),sourceForm:M(),resolvedTarget:M().nullable(),reason:M(),resolutionMethod:M(),fallbackTarget:M().nullable().optional(),definition:I({line:N().int().nonnegative(),label:M()}).loose().optional()}).loose(),q5=ro(`kind`,[U5,W5,Eue,I({kind:R(`lint-violation`),source:M(),code:M(),message:M(),severity:L([`error`,`warning`,`info`,`hint`]),line:N().int().positive(),column:N().int().positive(),linkTarget:M().optional(),localTarget:K5.optional()}).loose()]),J5=F(q5).min(1),Y5=I({href:M(),resolvedTo:M().nullable(),reason:L([`no-such-doc`,`no-such-file`,`unresolvable`]),localTarget:K5.optional()}).loose(),X5=F(Y5),Due=I({timestamp:M().min(1),summary:H5.optional(),warnings:J5.optional()}).loose(),Oue=I({timestamp:M().min(1),subscriberCount:N().int().nonnegative(),systemSubscriberCount:N().int().nonnegative(),hints:F(Cue).optional(),summary:H5.optional(),warnings:J5.optional(),brokenLinks:X5}).loose(),kue=I({timestamp:M().min(1),subscriberCount:N().int().nonnegative(),systemSubscriberCount:N().int().nonnegative(),summary:H5.optional(),warnings:J5.optional(),brokenLinks:X5}).loose(),Aue=I({docName:M().min(1),scope:L([`last`,`session`,`count`]),undone:P()}).loose(),jue=I({docs:F(I({docName:D4,markdown:M(),position:L([`append`,`prepend`,`replace`]).optional(),extension:L(w0).optional(),summary:k4}).loose()).min(1).max(100),...O4}).loose(),Mue=I({type:f3,title:M(),detail:M().optional()}).loose(),Nue=ro(`status`,[I({status:R(`written`),docName:M().min(1),summary:H5.optional(),warnings:J5.optional(),brokenLinks:X5}).loose(),I({status:R(`error`),docName:M().min(1),error:Mue}).loose()]),Pue=I({timestamp:M().min(1),results:F(Nue),written:N().int().nonnegative(),failed:N().int().nonnegative()}).loose(),Fue=I({docName:E4,patch:oo(M(),no([Wc,Wa()])),types:oo(M(),L(Vc)).optional(),summary:k4,...O4}).loose(),Iue=I({timestamp:M().min(1),subscriberCount:N().int().nonnegative(),systemSubscriberCount:N().int().nonnegative(),appliedKeys:F(M()),summary:H5.optional(),warnings:J5.optional(),brokenLinks:X5}).loose();function Lue(e){return{enabled:e.enabled??!0,plugins:{markdownlint:{...e.markdownlint,rules:e.markdownlint.rules??d5},frontmatter:{enabled:e.frontmatter?.enabled??!1,schemas:e.frontmatter?.schemas??[]},okf:{enabled:e.okf?.enabled??!1,...e.okf?.rules===void 0?{}:{rules:e.okf.rules},generate:{index:e.okf?.generate?.index??!1}}}}}const Rue=Object.fromEntries(B5.map(e=>[e.id,e.sliceSchema])),zue=I({effective:I({enabled:P(),plugins:I(Rue)}),configFile:M().nullable().optional(),configProblems:F(M()).optional()}),Bue=no([P(),oo(M(),Ja())]),Vue=I({ruleId:M().min(1).max(64).regex(/^[A-Za-z][A-Za-z0-9_-]*$/),value:no([Bue,Wa()])}),Hue=I({file:M().min(1).max(512),delete:R(!0).optional(),field:M().min(1).max(256).optional(),parentPath:F(no([M().min(1).max(256),I({items:R(!0)}).strict()])).max(8).optional(),removeField:R(!0).optional(),renameTo:M().min(1).max(256).optional(),constraint:I({type:L([`string`,`number`,`boolean`,`array`,`object`]).nullable().optional(),enum:F(no([M(),N(),P()])).nullable().optional(),itemsEnum:F(no([M(),N(),P()])).nullable().optional(),itemsType:L([`string`,`number`,`boolean`,`object`]).nullable().optional(),pattern:M().nullable().optional(),format:M().nullable().optional(),description:M().max(2048).nullable().optional(),required:P().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`}),Uue=I({schemas:F(M()),truncated:P()}).strict(),Z5=I({line:N(),character:N()}),Q5=I({start:Z5,end:Z5}),$5=I({range:Q5,severity:L([`error`,`warning`,`info`,`hint`]),source:M(),code:M(),message:M(),fixes:F(I({range:Q5,newText:M()})).optional(),frontmatterScope:L(kd).optional(),frontmatterProperty:M().optional()}),e7=F(M()).optional(),t7=I({file:M(),diagnostics:F($5),ran:e7,warnings:F(M()).optional()}),Wue=I({files:F(t7),fileCount:N(),errorCount:N(),warningCount:N(),warnings:F(M()),ran:e7}),Gue=$5.extend({linkTarget:M().optional(),localTarget:K5.optional()}),Kue=I({files:F(I({file:M(),diagnostics:F(Gue)})),fileCount:N(),errorCount:N(),warningCount:N(),warnings:F(M()),ran:e7}),n7=I({errorCount:N().int().nonnegative(),warningCount:N().int().nonnegative()}),que=I({files:F(I({file:M(),lint:n7,links:n7})),fileCount:N().int().nonnegative(),errorCount:N().int().nonnegative(),warningCount:N().int().nonnegative(),warnings:F(M())}),Jue=I({docName:E4,summary:k4,...O4}).loose(),r7=`Re-lint after fix failed: `;function Yue(e){return e.startsWith(r7)}const i7=[`re-lint-threw`,`source-went-blind`];function Xue(e){return typeof e==`string`&&i7.includes(e)}const a7=I({reason:L(i7),message:M().min(1)}),Zue=I({file:M(),fixedCount:N(),diagnostics:F($5),errorCount:N(),warningCount:N(),ran:e7,warnings:F(M()).optional(),diagnosticsArePreFix:P().optional(),reLintFailure:a7.optional()});function o7(){let e=g5[v5];return`${JSON.stringify({$schema:e,type:`object`},null,2)}\n`}function Que(e){let t=e.trim().replace(/^\.\//,``);if(!t.startsWith(`.ok/schemas/`))return!1;let n=t.slice(12);return n.length>0&&!n.includes(`/`)&&!n.includes(`\\`)&&n!==`.`&&n!==`..`}function $ue(e){let t=e.trim().toLowerCase().split(`/`).pop()??``;return t.endsWith(`.schema.json`)&&t.length>12?!0:Que(e)&&t.endsWith(`.json`)}var s7=class extends Error{};function c7(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function l7(e,t,n){let r=e;for(let e of t){if(typeof e!=`string`){let e=r.items;if(e===void 0){if(!n)throw new s7(`field path items does not exist`);let e={type:`object`};r.items=e,r=e;continue}if(!c7(e))throw new s7(`field path items is not an object sub-schema`);r=e;continue}let t=d7(r),i=t[e];if(i===void 0){if(!n)throw new s7(`field path ${JSON.stringify(e)} does not exist`);let i={type:`object`};r.properties={...t,[e]:i},r=i;continue}if(!c7(i))throw new s7(`field path ${JSON.stringify(e)} is not an object property`);r=i}return r}function ede(e,t,n,r=[]){let i;i=e.trim()===``?JSON.parse(o7()):u7(e);let a=l7(i,r,!0),o=d7(a),s={...c7(o[t])?o[t]:{}};for(let e of[`type`,`enum`,`pattern`,`format`,`description`]){if(!(e in n))continue;let t=n[e];t==null?delete s[e]:s[e]=t}if(`itemsEnum`in n||`itemsType`in n){if(s.items!==void 0&&!c7(s.items))throw new s7(`field path items is not an object sub-schema`);let e=c7(s.items)?{...s.items}:{};`itemsEnum`in n&&(n.itemsEnum===null||n.itemsEnum===void 0?delete e.enum:e.enum=n.itemsEnum),`itemsType`in n&&(n.itemsType===null||n.itemsType===void 0?delete e.type:e.type=n.itemsType),Object.keys(e).length>0?s.items=e:delete s.items}if(Object.keys(s).length>0)a.properties={...o,[t]:s};else if(t in o){let{[t]:e,...n}=o;Object.keys(n).length>0?a.properties=n:delete a.properties}if(n.required!==void 0){let e=f7(a),r=e.includes(t);n.required&&!r?a.required=[...e,t]:!n.required&&r&&p7(a,e.filter(e=>e!==t))}return`${JSON.stringify(i,null,2)}\n`}function u7(e){let t;try{t=JSON.parse(e)}catch(e){throw new s7(`schema is not valid JSON (${e instanceof Error?e.message:String(e)})`)}if(!c7(t))throw new s7(`schema is not a JSON object`);return t}function d7(e){return c7(e.properties)?e.properties:{}}function f7(e){return Array.isArray(e.required)?e.required.filter(e=>typeof e==`string`):[]}function p7(e,t){t.length>0?e.required=t:delete e.required}function tde(e,t,n=[]){let r=u7(e),i=l7(r,n,!1),a=d7(i);if(t in a){let{[t]:e,...n}=a;Object.keys(n).length>0?i.properties=n:delete i.properties}return p7(i,f7(i).filter(e=>e!==t)),`${JSON.stringify(r,null,2)}\n`}function nde(e,t,n,r=[]){let i=u7(e),a=l7(i,r,!1),o=d7(a);if(!(t in o))throw new s7(`field ${JSON.stringify(t)} does not exist`);if(n in o)throw new s7(`field ${JSON.stringify(n)} already exists`);let s={};for(let[e,r]of Object.entries(o))s[e===t?n:e]=r;return a.properties=s,p7(a,f7(a).map(e=>e===t?n:e)),`${JSON.stringify(i,null,2)}\n`}function rde(){return N5.map(e=>({path:`${k5}/${A5(e.id)}`,ruleId:e.id,contents:`${JSON.stringify({$comment:"Generated by the OpenKnowledge `okf` lint plugin — do not edit. The plugin validates from its own compiled copy and never reads this file, so changes here have no effect and are overwritten when the server restarts. This describes an external format (Google’s Open Knowledge Format); to change what is enforced, change the rule toggles under Settings → this project → Plugins → OKF.",...e.schema},null,2)}\n`}))}function m7(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);return n<=0?{stem:t,ext:``}:{stem:t.slice(0,n),ext:t.slice(n)}}function ide(e){let t=new Set(e.filter(e=>m7(e).ext.toLowerCase()===`.md`).map(e=>e.slice(0,e.lastIndexOf(`.`)))),n=[];for(let r of e){if(m7(r).ext.toLowerCase()!==`.mdx`)continue;let e=r.slice(0,r.lastIndexOf(`.`)),i=`"${r}" won't be picked up by an Open Knowledge Format consumer — the format is .md-only, and nothing scanning for .md files will open an .mdx.`;n.push({file:r,code:`project-no-mdx`,message:t.has(e)?`${i} It is also shadowed by "${e}.md", so a consumer reads that file instead and gets different content than this project shows you.`:i})}return n}const ade=[{id:`project-no-mdx`,run:ide}];function ode(e,t){let n=e.filter(e=>w0.some(t=>e.toLowerCase().endsWith(t)));return n.length===0?[]:ade.filter(e=>O5(t,e.id)).flatMap(e=>e.run(n))}function h7(e){return`source "${e.source}" ${e.phase} failed`}function sde(e){let t=e.docName===void 0?``:` on "${e.docName}"`;return`${h7(e)}${t}: ${e.message}`}function cde(e){let t=new Map;for(let n of e){let e=[n.source,n.phase,n.message].join(`\0`),r=t.get(e)??{first:n,docNames:new Set};n.docName!==void 0&&r.docNames.add(n.docName),t.set(e,r)}return[...t.values()].map(({first:e,docNames:t})=>t.size<=1?sde(e):`${h7(e)} on ${t.size} documents (first: "${e.docName}"): ${e.message}`)}const lde=[{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}]}],ude=(()=>{let e=new Map;for(let t of lde){e.set(t.id.toUpperCase(),t.id);for(let n of t.aliases)e.set(n.toUpperCase(),t.id)}return e})();function g7(e){return ude.get(e.toUpperCase())??null}function dde(e,t){let n=g7(t);if(n===null)return;let r;for(let[t,i]of Object.entries(e))g7(t)===n&&(r={key:t,value:i});return r}function fde(e){let t={lint:{errorCount:0,warningCount:0},links:{errorCount:0,warningCount:0}};for(let n of e){let e=n.source===`links`?t.links:t.lint;n.severity===`error`?e.errorCount+=1:e.warningCount+=1}return t}function pde(e,t){let n=B5.filter(t=>V5(e,t.id)).map(e=>e.id);return t.mode===`audit`&&t.linksValidation!==`off`&&n.push(`links`),n}function mde(e){return e===void 0?[]:e.length===0?[`No checks ran.`]:[`Checks run: ${e.join(`, `)}.`]}async function hde(e,t,n,r){if(!t.enabled)return[];let i=[];for(let a of B5){if(!V5(t,a.id))continue;let o=t.plugins[a.id];try{i.push(...await a.lint(e,o,{docName:n}))}catch(e){console.warn(`[lint] plugin "${a.id}" failed${n?` on "${n}"`:``}`,e),r?.({source:a.id,phase:`lint`,...n===void 0?{}:{docName:n},message:_7(e)})}}return i}function gde(e,t,n,r){if(!t.enabled)return e;let i=e;for(let e of B5){if(!V5(t,e.id)||!e.fix)continue;let a=t.plugins[e.id];try{i=e.fix(i,a)}catch(t){console.warn(`[lint] plugin "${e.id}" fix failed${n?` on "${n}"`:``}`,t),r?.({source:e.id,phase:`fix`,...n===void 0?{}:{docName:n},message:_7(t)})}}return i}function _7(e){let t=v7(e);return t.length>500?`${t.slice(0,500)}… (truncated)`:t}function v7(e,t=0){if(e instanceof Error)return e.cause===void 0||t>=3?e.message:`${e.message} (cause: ${v7(e.cause,t+1)})`;if(typeof e==`object`&&e)try{let t=JSON.stringify(e);if(t!==void 0)return t}catch{}return String(e)}const _de=/\p{M}+/gu,vde=/[^\p{L}\p{N}]+/gu,yde=/^-+|-+$/g;function y7(e){return e.trim().normalize(`NFKD`).replace(_de,``).toLowerCase().replace(vde,`-`).replace(yde,``)}function bde(e,t){let n=t.get(e)??0;return t.set(e,n+1),n===0?e:`${e}-${n}`}function xde(e,t){let n=y7(e);return n?bde(n,t):``}const Sde=new Set([`img`,`video`,`audio`,`mark`,`u`,`ins`]);new Map(X3.flatMap(e=>e.surface===`compat`&&Sde.has(e.rendersAs)?[[e.name,e]]:[])),bie(`<>`);const b7=[{tagName:`Mirror`,attrName:`src`,resolution:`bare-doc-name`},{tagName:`Excalidraw`,attrName:`src`,resolution:`doc-relative`}];for(let e of b7){let t=X3.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.`)}const Cde=VB(),wde=aB(),Tde=oB();function Ede(){return X3.filter(e=>e.surface===`canonical`&&e.name!==`*`)}function x7(){return Ede().filter(e=>{let t=S7(e);return t!==`fence`&&t!==`html`})}function S7(e){return e.name===`MermaidFence`?`fence`:e.name===`HtmlAlignBlock`?`html`:e.hasChildren?`jsx-block`:`jsx-void`}function C7(e){return{id:e.name,displayName:e.displayName??e.name,description:e.description??``,kind:S7(e)}}function Dde(e){if(e.hidden!==!0&&e.type!==`reactnode`){if(`defaultValue`in e&&e.defaultValue!==void 0)return e.defaultValue;if(e.type===`enum`)return e.enumValues[0];if(e.type===`string`)return``;if(e.type===`number`)return 0;if(e.type===`boolean`)return!1}}function Ode(e,t){return!(e.omitOnDefault===!0&&`defaultValue`in e&&Object.is(e.defaultValue,t)||e.type===`string`&&e.required===!1&&e.defaultValue===void 0&&t===``)}function kde(e){let t=[];for(let n of e.props){let e=Dde(n);e!==void 0&&Ode(n,e)&&t.push(k3(n.name,e))}return t}function Ade(e){return zO(e.exampleBody&&e.exampleBody.trim().length>0?e.exampleBody:`Body content here.`,{extensions:[Cde],mdastExtensions:[wde]}).children}function jde(e){let t=S7(e),n;if(t===`fence`)n={type:`code`,lang:`mermaid`,meta:null,value:e.exampleBody&&e.exampleBody.trim().length>0?e.exampleBody:`graph LR
|
|
541
541
|
A --> B`};else{let r=kde(e),i=t===`jsx-block`?Ade(e):[];n={type:`mdxJsxFlowElement`,name:e.name,attributes:r,children:i}}return FI({type:`root`,children:[n]},{extensions:[Tde]}).trimEnd()}function Mde(e){let t=[];for(let n of e.props){if(n.hidden===!0)continue;let e={name:n.name,type:n.type,required:n.required};n.description!==void 0&&(e.description=n.description),n.advanced===!0&&(e.advanced=!0),n.omitOnDefault===!0&&(e.omitOnDefault=!0),n.type===`enum`&&(e.values=n.enumValues,n.defaultValue!==void 0&&(e.defaultValue=n.defaultValue)),n.type===`string`&&(n.defaultValue!==void 0&&(e.defaultValue=n.defaultValue),n.language!==void 0&&(e.language=n.language),n.accept!==void 0&&(e.accept=n.accept)),n.type===`boolean`&&n.defaultValue!==void 0&&(e.defaultValue=n.defaultValue),n.type===`number`&&n.defaultValue!==void 0&&(e.defaultValue=n.defaultValue),t.push(e)}return t}function Nde(e){return{...C7(e),example:jde(e),params:Mde(e)}}function w7(){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.",``,...x7().map(C7).map(e=>`- \`${e.id}\` (${e.kind}) — ${e.description}`)].join(`
|
|
542
542
|
`)}function Pde(){return[w7(),``,"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(`
|
|
543
|
-
`)}const Fde=I({intents:F(I({satisfierId:M().min(1),desired:L([`present`,`absent`])}).loose()),...O4,summary:k4}).loose(),Ide=I({satisfierId:M(),agentId:M(),piece:M(),scope:M(),kind:M(),pathId:M().optional(),desired:L([`present`,`absent`]),action:L(Do),errorId:M().optional()}).loose(),Lde=I({kind:M(),satisfierIds:F(M()),agentIds:F(M()),pathId:M().optional(),blockedReason:M().optional()}).loose(),Rde=I({state:M(),strictness:F(L(To)).optional()}).loose(),zde=I({probes:I({env:L([`desktop`,`local-web`,`remote-web`]),satisfiers:oo(M(),Rde)}).loose(),detection:I({detected:F(M()),probed:P()}).loose()}).loose(),Bde=I({actions:F(Ide),conflicts:F(Lde),withheld:F(M()),snapshot:zde}).loose(),Vde=I({entries:F(I({level:L([`info`,`warn`,`error`]),message:M().max(8192),event:M().optional(),fields:oo(M(),Ja()).optional(),ts:N().optional(),sourceId:M().optional(),lineNumber:N().optional()}).loose()).max(100),droppedSinceLastFlush:N().int().min(0).optional()}).loose(),Hde=I({accepted:N().int().min(0)}).loose(),Ude=I({exact:M().min(1),prefix:M(),suffix:M(),start:N().int().nonnegative(),end:N().int().nonnegative()}),Wde=F(no([M(),N().int().nonnegative()])),Gde=ro(`kind`,[I({kind:R(`body`)}),I({kind:R(`property`),key:M().min(1),path:Wde.default([])})]).default({kind:`body`}),Kde=L([`anchored`,`orphaned`,`resolved`]),T7=I({threadId:M().min(1),docName:M().min(1),target:Gde,anchor:Ude.nullable(),state:Kde,queued:P(),latestComment:M(),createdBy:M().min(1),createdAt:N(),updatedAt:N().optional()}),E7=I({docName:M(),instruction:M(),property:M().nullable(),passage:I({exact:M(),prefix:M(),suffix:M()}).nullable(),anchorLost:P(),passageRepeats:P()}).loose(),D7=I({threadId:M(),ok:R(!0)}),O7=I({threadId:M(),ok:R(!1),error:R(`not-found`)}),qde=I({threads:F(T7)}).loose(),Jde=I({meta:T7,orphaned:P()}).loose(),Yde=I({threadId:M()}).loose(),Xde=I({meta:T7,payload:E7}).loose(),Zde=I({results:F(no([D7.extend({meta:T7,payload:E7}),O7]))}).loose(),Qde=I({results:F(no([D7.extend({meta:T7}),O7]))}).loose(),$de=I({status:M().min(1),reason:M()}).loose(),efe=I({docName:M().min(1),content:M(),lifecycle:$de.nullable()}).loose(),tfe=I({documents:F(I({kind:L([`document`,`asset`,`folder`,`file`]).default(`document`),docName:M().min(1).optional(),docExt:M().min(1).default(`.md`),size:N().int().nonnegative(),modified:M().min(1),isSymlink:P().default(!1),canonicalDocName:M().nullable().default(null),targetPath:M().nullable().default(null),path:M().min(1).optional(),assetExt:M().min(1).optional(),mediaKind:L([`image`,`video`,`audio`,`pdf`,`text`,`mermaid`,`excalidraw`]).nullable().optional(),referencedBy:F(M().min(1)).optional(),hasChildren:P().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:P().optional()}).loose(),nfe=I({source:M().min(1),anchor:M().nullable(),title:M(),snippet:M().nullable()}).loose(),rfe=I({docName:M().min(1),backlinks:F(nfe)}).loose(),ife=I({counts:oo(M().min(1),N().int().nonnegative())}).loose(),afe=I({counts:oo(M().min(1),N().int().nonnegative())}).loose(),ofe=ro(`kind`,[I({kind:R(`doc`),docName:M().min(1),anchor:M().nullable(),title:M(),snippet:M().nullable()}).loose(),I({kind:R(`external`),url:M().min(1),title:M(),snippet:M().nullable()}).loose()]),sfe=I({role:M().min(1),sourceForm:M().min(1),targetKind:M().min(1),href:M(),resolvedTarget:M().nullable(),status:M().min(1),reason:M().nullable(),resolutionMethod:M().min(1),fallbackTarget:M().nullable().default(null),range:I({start:N().int().nonnegative(),end:N().int().nonnegative()}),line:N().int().nonnegative(),column:N().int().nonnegative(),definition:I({label:M(),line:N().int().nonnegative()}).nullable().default(null)}).loose(),cfe=I({docName:M().min(1),forwardLinks:F(ofe),localTargets:F(sfe).optional()}).loose(),lfe=ro(`kind`,[I({id:M().min(1),kind:R(`doc`),docName:M().min(1),anchor:M().nullable(),label:M(),cluster:M().nullable(),category:M().nullable(),tags:F(M()).nullable(),managed:P().optional()}).loose(),I({id:M().min(1),kind:R(`external`),url:M().min(1),label:M()}).loose()]),ufe=I({source:M().min(1),target:M().min(1)}).loose(),dfe=I({nodes:F(lfe),links:F(ufe)}).loose(),ffe=I({ts:N().int().min(0),url:M(),method:M(),ua:M().optional(),origin:M().optional(),referer:M().optional(),host:M().optional(),remote:M().optional(),secChUa:M().optional(),secChUaMobile:M().optional(),secChUaPlatform:M().optional(),secFetchSite:M().optional(),secFetchDest:M().optional(),secFetchMode:M().optional(),secFetchUser:M().optional()}).loose(),pfe=I({app:no([R(`cursor`),R(`codex`),R(`claude`),Wa()]),signals_fired:F(M())}).loose(),mfe=I({entries:F(ffe),count:N().int().min(0),detection:pfe}).loose(),k7=[`M`,`A`,`D`,`R`,`C`,`U`,`T`,`?`,`!`,` `],A7=I({path:M().min(1),code:L(k7),origPath:M().min(1).optional(),syncScoped:P(),open:ro(`kind`,[I({kind:R(`doc`),docName:M().min(1)}),I({kind:R(`asset`),path:M().min(1)})]).optional()}).loose(),hfe=I({branch:M().nullable(),detached:P(),upstream:M().nullable(),staged:F(A7),notStaged:F(A7),untracked:F(A7),incoming:F(A7),truncated:P(),readable:P().default(!0)}).loose(),gfe=I({writers:F(I({id:M().min(1),name:M().optional(),email:M().optional()}).loose()).optional(),summary:k4,...O4}).loose(),_fe=I({checkpointRef:M().min(1)}).loose(),vfe=I({v:N().int().optional(),id:M().min(1),name:M().min(1),colorSeed:M().optional(),docs:F(M()),summaries:F(M()).optional()}).loose(),yfe=I({entries:F(I({sha:M().min(1),timestamp:M().min(1),author:M(),authorEmail:M(),type:L([`checkpoint`,`wip`,`upstream`,`park`]),message:M(),contributors:F(vfe),checkpoint:Ja().nullable(),parentSha:M().nullable().optional()}).loose()),total:N().int().nonnegative().optional(),truncated:P().optional(),hasMore:P().optional()}).loose(),bfe=I({sha:M().regex(/^[0-9a-f]{40}$/i),content:M(),timestamp:M(),author:M()}).loose(),xfe=I({contentDir:M().min(1),pathSeparator:L([`/`,`\\`]),symlinkResolved:P()}).loose(),Sfe=F(ro(`source`,[I({docName:M().min(1),timestamp:M().min(1),size:N().int().nonnegative(),source:R(`flat`)}).loose(),I({docName:M().min(1),timestamp:M().min(1),source:R(`timeline`),sha:M().min(1)}).loose()])).meta({description:"Flat array of rescue buffer entries; discriminated via `source`."}),j7=I({domain:M().min(1),title:M().optional(),description:M().optional(),siteName:M().optional(),faviconDataUri:M().optional()}).loose(),Cfe=I({url:M()}).loose(),wfe=ro(`ok`,[I({ok:R(!0),metadata:j7}).loose(),I({ok:R(!1),reason:M()}).loose()]),Tfe=I({orphans:F(I({docName:M().min(1),title:M()}).loose())}).loose(),Efe=I({hubs:F(I({docName:M().min(1),title:M(),count:N().int().nonnegative()}).loose())}).loose(),Dfe=I({source:M().min(1),title:M(),snippet:M().nullable()}).loose(),Ofe=I({deadLinks:F(I({target:M().min(1),sources:F(Dfe)}).loose())}).loose(),kfe=I({target:I({docName:M().min(1),title:M(),aliases:F(M())}).loose(),mentions:F(I({source:M().min(1),excerpt:M(),offset:N().int().nonnegative()}).loose()),truncated:P()}).loose(),Afe=I({projectPath:M().min(1)}).loose(),jfe=L([`not-a-git-worktree`,`init-failed`]),Mfe=ro(`ok`,[I({ok:R(!0),projectPath:M().min(1)}).loose(),I({ok:R(!1),reason:jfe,message:M().min(1)}).loose()]),Nfe=I({host:M().min(1).optional()}).loose(),Pfe=I({host:M().min(1).optional(),token:M().min(1)}).loose(),Ffe=I({host:M(),login:M()}).loose(),Ife=I({key:M().min(1)}).loose(),Lfe=I({keyPresent:P()}).loose(),Rfe=L([`no_key`,`invalid_endpoint`,`rate_limit`,`timeout`,`http_error`,`network`,`dims_mismatch`,`malformed_response`]),zfe=ro(`ok`,[I({ok:R(!0),endpoint:M().min(1),model:M().min(1),dimensions:N().int().positive()}).loose(),I({ok:R(!1),endpoint:M().min(1),model:M().min(1),reason:Rfe,status:N().int().optional()}).loose()]),Bfe=I({name:M().refine(e=>e.trim().length>0,{message:`name must be non-empty`}),email:M().refine(e=>e.trim().length>0,{message:`email must be non-empty`})}).loose(),Vfe=I({authenticated:P()}).loose(),Hfe=I({channel:L([`login`,`gh-login`]).default(`login`)}).loose(),Ufe=I({}).loose(),Wfe=I({stackIndex:N().int().min(0),ts:N().int().min(0),additions:N().int().min(0),deletions:N().int().min(0)}).loose(),Gfe=I({docName:M().min(1),additionsTotal:N().int().min(0),deletionsTotal:N().int().min(0),lastTs:N().int().min(0),bursts:F(Wfe)}).loose(),Kfe=I({displayName:M().min(1),color:M().min(1),icon:M().optional(),connectionId:M().min(1)}).loose(),qfe=I({sessionAlive:P(),agent:Kfe.nullable(),files:F(Gfe)}).loose(),Jfe=I({diff:M(),before:M(),after:M(),properties:d4,generatedAt:N().int().min(0)}).loose(),Yfe=I({}).loose(),Xfe=I({}).loose(),Zfe=I({}).loose(),Qfe=I({}).loose(),$fe=I({}).loose(),epe=I({}).loose(),tpe=I({displayName:M().min(1),icon:M(),color:M().min(1),currentDoc:M().nullable(),mode:L([`idle`,`writing`]),ts:N().int().min(0)}).loose(),npe=I({presence:oo(M().min(1),tpe)}).loose(),rpe=I({sessionId:M().min(1),agentType:M().min(1),ts:N().int().min(0),insertedChars:N().int().min(0),deletedChars:N().int().min(0)}).loose(),ipe=I({effects:F(I({"doc.name":M().min(1),entries:F(rpe)}).loose())}).loose(),ape=I({decisions:F(I({ts:N().int().min(0),decision:M().min(1),kind:M().min(1),"doc.name":M().min(1),pathRole:M().min(1)}).loose())}).loose(),ope=oo(M().min(1),P()).meta({description:`Flat boolean record keyed by agent-scheme name (claude / codex / cursor). True = installed.`});I({path:M().min(1,`path must be non-empty`)}).loose();const spe=I({}).loose(),cpe=I({fromDocName:M().min(1),toDocName:M().min(1)}).loose(),lpe=I({fromPath:M().min(1),toPath:M().min(1)}).loose(),upe=I({}).loose(),dpe=I({path:M().min(1),...O4,summary:k4}).loose(),fpe=I({docName:M().min(1)}).loose(),ppe=I({path:M().min(1),...O4,summary:k4}).loose(),mpe=I({path:M().min(1)}).loose(),hpe=I({kind:L([`file`,`folder`]),path:M().min(1),...O4,summary:k4}).loose(),gpe=I({kind:L([`file`,`folder`]),path:M().min(1),duplicatedDocNames:F(M().min(1))}).loose(),_pe=I({pages:F(I({docName:M().min(1),title:M(),docExt:M().min(1),size:N().int().nonnegative(),modified:M().min(1),icon:M().min(1).max(2048).optional()}).loose())}).loose(),vpe=I({level:N().int().min(1).max(6),text:M(),slug:M()}).loose(),ype=I({docName:M().min(1),headings:F(vpe)}).loose(),bpe=I({docName:M().min(1),rewrites:N().int().nonnegative()}).loose(),xpe=I({kind:L([`file`,`folder`,`asset`]),fromPath:M().min(1),toPath:M().min(1),...O4,summary:k4}).loose(),Spe=I({renamed:F(cpe),renamedAssets:F(lpe),rewrittenDocs:F(bpe).optional(),summary:H5.optional()}).loose(),Cpe=I({kind:L([`file`,`folder`,`asset`]),path:M().min(1),...O4}).loose(),wpe=I({deletedDocNames:F(M().min(1))}).loose(),Tpe=I({kind:L([`file`,`folder`,`asset`]),path:M().min(1),...O4,summary:k4}).loose(),Epe=I({deletedDocNames:F(M().min(1))}).loose(),Dpe=I({docName:M().min(1),commitSha:M().regex(/^[0-9a-f]{40}$/i,{message:`commitSha must be a 40-char git SHA`}),summary:k4,...O4}).loose(),Ope=I({restoredFrom:M().min(1),timestamp:M().min(1),summary:H5.optional(),warnings:J5.optional()}).loose(),kpe=/^#[0-9a-fA-F]{6}$/,Ape=I(Object.fromEntries(Nd.map(e=>[e,M().regex(kpe,`must be a #rrggbb hex color`)]))),M7=M().min(1).refine(Ld,{message:`must contain a non-whitespace character`}),N7=I({name:M7,author:M7.optional(),variant:L([`dark`,`light`]),palette:Ape}).loose(),jpe=I({name:M().min(1),scheme:N7,stem:M().min(1).optional(),extension:L([`.yaml`,`.yml`]).optional()}).loose(),Mpe=I({id:M().min(1),filename:M().min(1)}).loose(),Npe=I({id:M().min(1),scheme:N7}).loose(),Ppe=I({id:M().min(1),filename:M().min(1)}).loose(),Fpe=ro(`existed`,[I({existed:R(!1)}).loose(),I({existed:R(!0),filename:M().min(1),scheme:N7}).loose()]),Ipe=I({themes:F(ro(`ok`,[I({ok:R(!0),id:M().min(1),filename:M().min(1),scheme:N7}),I({ok:R(!1),filename:M().min(1),id:M().min(1).optional(),code:M().min(1),conflictingFilenames:F(M().min(1)).min(2).optional()})])),truncated:P()}).loose(),Lpe=L([`dormant`,`idle`,`fetching`,`pulling`,`pushing`,`conflict`,`offline`,`auth-error`,`disabled`]),Rpe=I({label:M().min(1),webUrl:Ca().nullable()}).loose(),zpe=ro(`checkStatus`,[I({checkStatus:R(`allowed`)}).loose(),I({checkStatus:R(`denied`),deniedReason:L([`no-collaborator`,`private-no-access`,`repo-not-found`,`not-authenticated`]),resolvedLogin:M().optional(),declaredLogin:M().optional(),declaredSource:M().optional()}).loose(),I({checkStatus:R(`unknown`),unknownError:L([`network`,`timeout`,`rate-limit`,`token-invalid`,`malformed-response`,`ssh-unverified`]).optional()}).loose()]),P7=L([`auth-403`,`auth-401`,`auth-scope-mismatch`,`auth-no-credential`,`auth-not-found-as-identity`,`semantic-protected-branch`]),Bpe=L(ku),Vpe=L([`succeeded`,`up-to-date`,`conflict`,`refused`,`error`]),Hpe=I({state:Lpe,lastSyncUtc:M().nullable(),lastRunUtc:M().nullable().optional(),lastPullOkUtc:M().nullable().optional(),lastPushOkUtc:M().nullable().optional(),lastFetchUtc:M().nullable(),lastPushedSha:M().nullable(),ahead:N().int().min(0),behind:N().int().min(0),consecutiveFailures:N().int().min(0),consecutivePushFailures:N().int().min(0).optional(),conflictCount:N().int().min(0),hasRemote:P(),syncEnabled:P(),identityUnresolved:P(),remote:Rpe.nullable().optional(),pushError:M().optional(),pushErrorCode:P7.optional(),pullError:M().optional(),pullErrorCode:P7.optional(),pausedReason:M().optional(),blockingPaths:F(M().min(1)).optional(),pushPermission:zpe.optional(),syncMode:Bpe.optional(),lastPullUtc:M().nullable().optional(),lastPullOutcome:Vpe.nullable().optional()}).loose(),Upe=I({action:L([`commit`]),paths:F(M().min(1)),commitSha:M().optional()}).loose(),Wpe=I({action:L([`commit`])}).loose(),Gpe=I({op:L([`sync`,`push`,`pull`,`fetch`]).optional()}).loose(),Kpe=I({op:L([`sync`,`push`,`pull`,`fetch`])}).loose(),qpe=I({conflicts:F(I({file:M().min(1),detectedAt:M().min(1),oursSha:M().optional(),theirsSha:M().optional(),baseSha:M().optional()}).loose())}).loose(),Jpe=I({file:M().min(1),strategy:L([`mine`,`theirs`,`content`,`delete`]),content:M().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`]}),Ype=I({}).loose(),Xpe=I({file:M().min(1),base:M(),ours:M(),theirs:M(),kind:L([`both-modified`,`delete-modify`,`modify-delete`]),lifecycleStatus:M().nullable()}).loose(),Zpe=I({plan:vo(e=>e!==void 0,{message:`plan is required`})}).loose(),Qpe=I({plan:vo(e=>e!==void 0,{message:`plan is required`})}).loose(),$pe=I({result:vo(e=>e!==void 0,{message:`result is required`})}).loose(),eme=I({packId:M().min(1)}).strict(),F7=I({installedHosts:F(M()),skills:F(I({name:M().min(1),created:P()}).strict())}).strict(),tme=I({path:M().min(1),summary:M().min(1)}).loose(),nme=I({files:N().int().nonnegative(),folders:N().int().nonnegative()}).loose(),rme=I({packs:F(I({id:M().min(1),name:M().min(1),description:M().min(1),defaultSubfolder:M().optional(),folders:F(tme),entryCounts:nme}).loose())}).loose(),ime=I({noOpen:P().optional(),out:M().min(1).optional()}).loose(),ame=I({reason:L([`unsupported-platform`,`spawn-error`]),message:M()}).loose(),ome=ro(`status`,[I({status:R(`installed`),outputPath:M(),size:N().int().nonnegative(),sha256:M(),skillVersion:M()}).loose(),I({status:R(`built`),outputPath:M(),size:N().int().nonnegative(),sha256:M(),skillVersion:M(),handoffError:ame.optional()}).loose(),I({status:R(`failed`),buildError:M()}).loose(),I({status:R(`skip-current`),skillVersion:M(),recordedAt:M().optional()}).loose()]),I7=L(T),sme=L(E);function cme(e){return e===`agents`||E.includes(e)}const lme=I({alwaysOn:N().int().nonnegative(),onTrigger:N().int().nonnegative(),onDemand:N().int().nonnegative()}).strict(),ume=[`.md`,`.mdx`,`.txt`];function L7(e){return Math.round(e/4)}function dme(e){let t=e.lastIndexOf(`.`);return t!==-1&&ume.includes(e.slice(t).toLowerCase())}function fme(e){let t=L7((e.name??``).length+(e.description??``).length),n=L7(Xc(e.skillMd).body.length),r=e.files.some(e=>e.relPath===`overlay.yaml`),i=0;for(let t of e.files)t.content!==null&&t.relPath!==`SKILL.md`&&(r&&t.relPath.startsWith(`upstream/`)||dme(t.relPath)&&(i+=t.content.length));return{alwaysOn:t,onTrigger:n,onDemand:L7(i)}}const pme=I({tags:F(I({name:M().min(1),count:N().int().nonnegative(),isLeaf:P()}).loose())}).loose(),mme=I({docName:M().min(1),title:M(),matchingTags:F(M().min(1)),snippet:M().nullable()}).loose(),hme=I({name:M().min(1),docs:F(mme)}).loose(),gme=I({folder:Ja(),frontmatter_local:oo(M(),Ja()).nullable()}).loose(),_me=I({path:M(),frontmatter:oo(M(),Ja()).optional()}).loose(),vme=I({applied:Ja()}).loose(),R7=oo(M(),Ja()).meta({description:`Free-form frontmatter map embedded in template payloads.`}),yme=I({template:I({name:M().min(1),folder:M(),scope:L([`local`,`inherited`]),path:M().min(1),frontmatter:R7,body:M()}).strict()}).strict(),bme=I({templates:F(I({name:M().min(1),title:M().optional(),description:M().optional(),path:M().min(1),source_folder:M()}).strict()),truncated:P()}).strict(),xme=I({folder:M(),name:M(),body:M().optional(),frontmatter:R7.optional(),...O4,summary:k4}).strict(),Sme=I({path:M().min(1),created:P(),warnings:F(M())}).strict(),Cme=I({sourcePath:M().min(1),targetFolder:M(),name:M().optional(),title:M().optional(),deleteSource:P().optional(),...O4,summary:k4}).strict(),wme=I({path:M().min(1),created:P(),warnings:F(M())}).strict(),Tme=I({existed:P(),path:M().min(1)}).strict(),Eme=I({fromFolder:M(),fromName:M(),toFolder:M(),toName:M(),body:M().optional(),frontmatter:R7.optional(),...O4,summary:k4}).strict(),Dme=I({from:M().min(1),to:M().min(1),committed:P()}).strict(),z7=L(hl),Ome=/^[a-z0-9-]+$/,kme=/<\/?[A-Za-z][^>]*>/;function Ame(e){return kme.test(e)}const jme=/^[A-Za-z0-9_-]+$/,B7=I({name:M(),description:M(),metadata:I({pack:M()}).strict().optional()}).strict(),Mme=I({skill:I({name:M().min(1),scope:z7,path:M().min(1),frontmatter:B7,body:M(),files:F(I({path:M().min(1),text:M().nullable()})).optional(),managed:P().optional()}).strict()}).strict(),Nme=I({source:M().min(1),publisher:M().optional(),skill:M().optional(),marketplaceUrl:M().optional(),importedAt:M().min(1),autoUpdate:P().optional()}).strict(),Pme=I({name:M().min(1),description:M().optional(),scope:z7,path:M().min(1),canonicalPath:M().min(1).optional(),filePaths:F(M()).optional(),absolutePath:M().min(1).optional(),installed:P(),hosts:F(M()),hostQualifier:M().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:F(M()).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:oo(M(),M()).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:F(M()).optional().meta({description:`Hosts whose dir holds a DIFFERENT same-name skill (fork/conflict) — occupied, not this skill.`}),symlinkedHosts:F(M()).optional(),installableEditors:F(M()).optional(),hubOffered:P().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:P().optional(),customPlacements:F(I({path:M(),mode:L([`copy`,`link`])}).strict()).optional(),plugin:I({name:M().min(1),marketplace:M().min(1),provider:M().min(1),url:M().optional()}).strict().optional(),managed:P().optional(),origin:Nme.optional(),pack:M().optional(),modified:P().optional(),revertable:P().optional(),ignored:P().optional(),size:lme.optional()}).strict(),Fme=I({name:M().min(1),scope:z7,apply:P().optional()}).strict(),Ime=I({line:M().min(1),gitignorePath:M().min(1),applied:P(),alreadyTracked:P().optional()}).strict(),Lme=I({skills:F(Pme),truncated:P()}).strict(),Rme=I({scope:z7.default(`project`),name:M().meta({description:`Managed skill name to create or update.`}),body:M().optional(),frontmatter:B7,...O4,summary:k4}).strict(),zme=I({path:M().min(1),created:P(),warnings:F(M())}).strict(),Bme=I({scope:z7.default(`project`),name:M(),dryRun:P().optional(),setAutoUpdate:P().optional(),...O4,summary:k4}).strict(),Vme=I({name:M().min(1),updated:P(),source:M().min(1),localBody:M().optional(),upstreamBody:M().optional(),gitTracked:P().optional(),warnings:F(M())}).strict(),Hme=I({scope:z7.default(`project`),name:M(),...O4,summary:k4}).strict(),Ume=I({name:M().min(1),baselineRef:M().min(1),restoredFiles:F(M()),warnings:F(M())}).strict(),Wme=I({existed:P(),path:M().min(1)}).strict(),Gme=I({scope:z7.default(`project`),fromName:M(),toName:M(),body:M().optional(),frontmatter:B7.optional(),...O4,summary:k4}).strict(),Kme=I({from:M().min(1),to:M().min(1),committed:P()}).strict(),qme=I({name:M(),fromScope:z7,toScope:z7,...O4,summary:k4}).strict(),Jme=I({scope:z7,path:M().optional()}).strict(),Yme=I({scope:z7,name:M(),toName:M(),...O4,summary:k4}).strict(),Xme=I({name:M().min(1)}).strict(),Zme=I({name:M(),home:M().min(1)}).strict(),Qme=I({docName:M().min(1)}).strict(),V7=L([`reference`,`script`,`file`]),$me=I({scope:z7.default(`project`),name:M(),path:M().min(1),content:M(),...O4,summary:k4}).strict(),ehe=I({path:M().min(1),created:P(),kind:V7,content:P()}).strict(),the=I({scope:z7.default(`project`),name:M(),from:M().min(1),to:M().min(1),...O4,summary:k4}).strict(),nhe=I({from:M().min(1),to:M().min(1),fromDocName:M().optional(),toDocName:M().optional()}).strict(),rhe=I({path:M().min(1),kind:V7,text:M()}).strict(),ihe=I({path:M().min(1),existed:P(),kind:V7}).strict(),H7=no([sme,R(`agents`)]),U7=M().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`}),W7=no([H7,U7]),ahe=I({scope:z7.default(`project`),name:M(),targets:F(H7).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:F(W7).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:F(W7).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:L([`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:W7.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:P().optional(),setSource:M().min(1).optional(),place:I({dir:M().min(1).meta({description:`Project-relative directory the bundle dir is created under (e.g. ".windsurf/skills").`}),mode:L([`copy`,`link`])}).strict().optional(),convert:I({target:W7.meta({description:`The installed location to convert — an editor id, "agents", or a recorded custom placement path.`}),mode:L([`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:I({path:M().min(1).meta({description:`The recorded placement bundle path (e.g. ".windsurf/skills/my-skill").`})}).strict().optional(),...O4,summary:k4,fork:I({editor:M().min(1),action:L([`align`,`make-source`,`rename`]),toName:M().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"}),G7=[`no-targets`,`scripts-present`,`name-conflict`,`no-description`,`skill-fork-name-unpatched`,`place-path-invalid`,`place-fork-refused`],ohe=I({name:M().min(1).meta({description:`Managed skill name installed or uninstalled.`}),hosts:F(M()).meta({description:`Editor ids the skill is projected into after the operation; [] is expected after uninstall.`}),scripts:P().meta({description:`True when the skill ships executable scripts, projected but never run.`}),warnings:F(M()).meta({description:`Non-fatal install/uninstall warnings from target projection.`}),warningCodes:F(L(G7)).meta({description:"Machine-readable warning codes aligned with `warnings`."}),placedAt:M().optional(),sourceMovedTo:M().optional()}).strict(),she=I({scope:z7.default(`project`),name:M().meta({description:`Managed skill name to uninstall without deleting source.`})}).strict(),che=I({name:M().min(1).meta({description:`Managed skill name requested for uninstall.`}),uninstalled:P().meta({description:`True when an install marker existed and was removed; false for an idempotent no-op.`})}).strict(),lhe=I({targets:F(I7),configured:P(),folders:F(I({scope:z7,host:M(),root:M(),state:L([`own`,`linked`,`linked-parent`,`absent`]),target:M().optional(),drift:R(!0).optional(),expected:M().optional()}).strict()).optional()}).strict(),K7=I({action:R(`link`),scope:z7,root:M().min(1).meta({description:`The folder to link (e.g. ".codex/skills").`}),target:M().min(1).meta({description:`The root it merges into (e.g. ".agents/skills"). Required.`})}),q7=I({action:R(`unlink`),scope:z7,root:M().min(1).meta({description:`The linked folder to materialize back.`}),exclude:F(M().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(),J7=I({action:R(`add-root`),scope:z7,root:U7.meta({description:`New custom skills root to declare (base-relative, e.g. ".team/skills").`})}).strict(),uhe=ro(`action`,[K7.extend({preview:P().optional().meta({description:`Return the merge plan only (moves, drops, removes, conflicts, strays) — nothing is written.`})}).strict(),q7,J7]),dhe=ro(`action`,[K7.strict(),q7,J7]),fhe=I({folderAction:uhe}).strict(),phe=I({moves:F(M()),drops:F(M()),removes:F(M()),replaces:F(M()),conflicts:F(M()),strays:F(M())}).strict(),mhe=I({targets:F(I7),reprojected:F(I({name:M(),hosts:F(M())}).strict()),bundleHosts:F(M()),removedFrom:F(M()),folder:I({moved:F(M()),dropped:F(M()),linked:F(M())}).strict().optional(),preview:phe.optional()}).strict(),hhe=I({scope:z7.default(`project`),name:M(),version:M().regex(/^[0-9a-f]{40}$/i),...O4,summary:k4}).strict(),ghe=I({name:M().min(1),version:M(),restoredFiles:F(M()),warnings:F(M())}).strict(),_he=I({query:M().optional(),intent:L([`autocomplete`,`full_text`,`omnibar`]).optional(),ranking:L([`navigation`,`relevance`]).optional(),scopes:F(L([`page`,`folder`,`content`,`file`])).optional(),scope:M().optional(),limit:N().int().nonnegative().optional(),semantic:P().optional(),source:L([`omnibar`,`mcp`,`http`]).optional()}).loose(),vhe=I({kind:L([`page`,`folder`,`content`,`file`]),path:M().min(1),title:M(),score:N(),signals:oo(M(),Ja()),snippet:M().optional()}).loose(),yhe=I({capable:P(),applied:P(),coverage:I({embedded:N().int().nonnegative(),total:N().int().nonnegative()})}).loose(),bhe=I({enabled:P(),keyPresent:P(),keyNotRequired:P(),keySource:L([`project`,`file`,`env`]).nullable(),keyHint:M().nullable(),ready:P(),capable:P(),embedded:N().int().nonnegative(),total:N().int().nonnegative()}).loose(),xhe=I({query:M(),intent:L([`autocomplete`,`full_text`,`omnibar`]),results:F(vhe),elapsedMs:N().nonnegative(),semantic:yhe.optional(),truncated:P().optional(),ready:P().optional()}).loose(),She=I({version:M().min(1),recordedAt:M().min(1)}).loose(),Che=I({currentVersion:M().min(1),targets:oo(M(),She.nullable())}).loose(),whe=I({scope:z7.default(`project`),source:M().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:M().min(1).optional().meta({description:`Specific skill name to import from a multi-skill source.`}),install:P().optional().meta({description:`Pass false to import WITHOUT the default-editor auto-projection (the caller installs explicitly afterwards). Default true.`}),marketplace:P().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."}),...O4,summary:k4}).strict(),The=I({scope:z7.default(`project`),source:M().min(1).meta({description:`External skill source: full skills.sh skill-page URL, GitHub owner/repo[/subpath], git URL, or local/file path.`}),skills:F(M().min(1)).min(1).max(100).meta({description:`Skill names to import from the source.`}),install:P().optional().meta({description:`Pass false to import WITHOUT the default-editor auto-projection. Default true.`}),marketplace:P().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."}),...O4,summary:k4}).strict(),Ehe=I({results:F(I({requested:M(),status:L([`imported`,`already-imported`,`not-found`,`failed`]),name:M().optional(),collisionRenamedFrom:M().optional(),warnings:F(M()),error:M().optional()}).loose()),imported:N(),alreadyImported:N(),failed:N()}).loose(),Dhe=I({scope:z7.default(`project`),names:F(M().min(1)).min(1).max(100).meta({description:`Managed skill names to refresh from their recorded upstreams.`}),...O4,summary:k4}).strict(),Ohe=I({results:F(I({requested:M(),status:L([`updated`,`up-to-date`,`not-found`,`failed`]),source:M().optional(),warnings:F(M()),error:M().optional()}).loose()),updated:N(),upToDate:N(),failed:N()}).loose(),khe=I({source:M(),ref:M().optional(),contentHash:M(),publisher:M().optional()}).loose(),Ahe=I({name:M().min(1).meta({description:`Managed skill name created or matched.`}),path:M().min(1).meta({description:`Store-relative path to the imported skill source.`}),created:P().meta({description:`True when this request created new source files.`}),alreadyImported:P().meta({description:`True when identical content was already present and no files changed.`}),collisionRenamedFrom:M().optional().meta({description:`Original source name when collision handling renamed the import.`}),provenance:khe,warnings:F(M()).meta({description:`Non-fatal import warnings, such as skipped unsupported files.`})}).loose(),Y7=`server-info`,X7=`branch-switched`,Z7=`disk-ack`,Q7=`config-validation-rejected`,$7=`config-ignore-nested-error`,jhe=L([`files`,`backlinks`,`graph`,`sync-status`,`session-activity`,`tags`,`comments`,`lint-config`,`local-targets`]),Mhe=I({v:R(1),ch:R(Y7),seq:N(),serverInstanceId:M().min(1),currentBranch:M().min(1).optional()}).loose(),Nhe=I({v:R(1),ch:R(X7),seq:N(),branch:M().min(1)}).loose(),Phe=I({v:R(1),ch:jhe,seq:N()}).loose(),Fhe=I({v:R(1),ch:R(Z7),seq:N(),docName:M().min(1),sv:M().min(1)}).loose(),Ihe=I({v:R(1),ch:R(Q7),seq:N(),docName:M().min(1),error:Nte}).loose(),Lhe=I({v:R(1),ch:R($7),seq:N(),path:M().min(1),error:M().min(1)}).loose(),Rhe={id:`string`,kind:`enum`,path:`string`,title:`string`,name:`string`,pathSegments:`string`,content:`string`,modifiedTs:`number`},e9=new WeakMap;function zhe(e){return e===void 0||!Number.isFinite(e)?20:Math.max(1,Math.min(100,Math.trunc(e)))}function t9(e){return e.trim().toLowerCase()}const Bhe=/\.(?:md|mdx)$/;function Vhe(e,t){if(t!==`page`)return e;let n=e.replace(Bhe,``);return n.length>0?n:e}function Hhe(e){let t=e.split(`/`).filter(Boolean);return t[t.length-1]??e}function Uhe(e){let t=Hhe(e.path),n=e.title?.trim()||t,r=e.modifiedTs??0,i=e.path.split(`/`).filter(Boolean),a=new Set(i),o=[...new Set((e.aliases??[]).flatMap(e=>e.split(`/`).filter(Boolean)).filter(e=>!a.has(e)))];return{id:`${e.kind}:${e.path}`,kind:e.kind,path:e.path,title:n,name:t,pathSegments:[...i,...o].join(` `),content:e.content??``,modifiedTs:Number.isFinite(r)?r:0}}const n9=/[^\P{L}a-zàèéìòóù]|[^\P{Nd}0-9]|\p{Nl}/iu,r9=(()=>{let e=globalThis.Intl.Segmenter;return e?new e(`en`,{granularity:`word`}):null})();function Whe(){let e=gY({language:`english`}),t=e.tokenize.bind(e);return e.tokenize=(e,n,r,i)=>{let a=t(e,n,r,i);if(!r9||typeof e!=`string`||!n9.test(e))return a;let o=new Set(a);for(let{segment:t,isWordLike:n}of r9.segment(e)){if(!n||!n9.test(t))continue;let e=t.toLowerCase();o.has(e)||(o.add(e),a.push(e))}return a},e}function i9(e){let t=AY({schema:Rhe,components:{tokenizer:Whe()}});return e.length>0&&VY(t,e),t}function a9(e){let t={documents:e};return e9.set(t,i9(e)),t}function Ghe(e){let t=e9.get(e);if(t)return t;let n=i9(e.documents);return e9.set(e,n),n}const o9=new WeakSet;function Khe(e,t){return e===t||e.kind===t.kind&&e.path===t.path&&e.title===t.title&&e.name===t.name&&e.pathSegments===t.pathSegments&&e.modifiedTs===t.modifiedTs&&e.content===t.content}function qhe(e,t){let n=e=>({corpus:a9(t),inserted:0,updated:0,removed:0,rebuilt:!0,rebuildReason:e}),r=e9.get(e);if(!r)return n(`no-index`);if(o9.has(e))return n(`stale-base`);let i=new Map(t.map(e=>[e.id,e]));if(i.size!==t.length)return n(`duplicate-id`);let a=[],o=[],s=0;for(let t of e.documents){let e=i.get(t.id);e?Khe(t,e)||(a.push(t.id),o.push(e),s+=1):a.push(t.id)}let c=new Set(e.documents.map(e=>e.id));for(let e of t)c.has(e.id)||o.push(e);if(a.length+o.length>t.length)return n(`bulk-change`);o9.add(e);try{if(a.length>0&&qY(r,a),o.length>0&&VY(r,o),MY(r)!==t.length)throw Error(`Search index count ${MY(r)} diverged from document count ${t.length} after incremental update`)}catch{return n(`mutation-failed`)}let l={documents:t};return e9.set(l,r),{corpus:l,inserted:o.length-s,updated:s,removed:a.length-s,rebuilt:!1}}function Jhe(e){return e===`autocomplete`?[`page`]:e===`full_text`?[`page`,`content`,`file`]:[`page`,`folder`,`file`]}function s9(e,t){return t.has(e.kind)?!0:e.kind===`page`&&t.has(`content`)}function Yhe(e,t){let n=t9(t);if(!n)return 0;let r=Vhe(n,e.kind),i=t9(e.title),a=t9(e.name),o=t9(e.path),s=o.split(`/`);return i===r||a===r?700:o===r?650:i.startsWith(r)||a.startsWith(r)?600:s.some(e=>e.startsWith(r))?550:i.includes(r)||a.includes(r)?500:o.includes(r)?450:-1}function c9(e,t){let n=Yhe(e,t);return n<=0?n:w4(e.path)?n*.5:n}function Xhe(e){return e===`file`?-60:0}function Zhe(e,t,n,r,i){let a=i>0?t/i:0,o=n/50,s=r===`file`?-.001:0,c=1*a+1*o+s;return e*1e3+c}function l9(e,t,n,r){return e+t*20+n+Xhe(r)}function u9(e,t,n,r,i,a){return e===`relevance`?l9(t,n,r,i):Zhe(t,n,r,i,a)}function Qhe(e,t){return t||(e===`full_text`?`relevance`:`navigation`)}function d9(e,t){let n=0;for(let r of e){let e=t.get(r.id)??0;e>n&&(n=e)}return n}function $he(e){let t=e.map(e=>e.modifiedTs).filter(e=>Number.isFinite(e)&&e>0);if(t.length===0)return new Map;let n=1/0,r=-1/0;for(let e of t)e<n&&(n=e),e>r&&(r=e);let i=Math.max(1,r-n);return new Map(e.map(e=>[e.id,e.modifiedTs>0?(e.modifiedTs-n)/i*50:0]))}function ege(e){return e===`full_text`?[`title`,`name`,`path`,`pathSegments`,`content`]:[`title`,`name`,`path`,`pathSegments`]}function tge(e){return e===`full_text`?{title:8,name:7,path:5,pathSegments:4,content:1}:e===`autocomplete`?{title:10,name:9,path:5,pathSegments:4}:{title:8,name:7,path:5,pathSegments:4}}const nge=/[-ក- -〿-ゟ゠-ヿ㐀-䶿一-鿿\uf900--\u1100-\u11ff\u3130-\u318f\ua960-\ua97f\uac00-\ud7ff]/;function rge(e,t){let n=t9(t);return n.length<4||nge.test(n)?0:+(e===`full_text`)}function ige(e){let{lexical:t,fullText:n}=e.signals;return t>=500?`lexical`:t===450&&n<=0?`pathOnly`:`body`}function age(e){let t=[],n=[],r=[];for(let i of e){let e=ige(i);e===`lexical`?t.length<100&&t.push(i):e===`body`?n.length<6&&n.push(i):r.length<4&&r.push(i)}return[...t,...n,...r]}function f9(e,t,n){if(t===`relevance`)return e.slice(0,n);let r=age(e),i=[],a=0,o=0;for(let e of r){if(e.document.kind===`folder`){if(a>=3)continue;a+=1}else if(e.document.kind===`file`){if(o>=3)continue;o+=1}if(i.push(e),i.length>=n)break}return i}function oge(e,t,n={}){let r=n.intent??`omnibar`,i=Qhe(r,n.ranking),a=zhe(n.limit),o=new Set(n.scopes??Jhe(r)),s=e.documents.filter(e=>s9(e,o)),c=t9(t);if(!c)return s.slice().sort((e,t)=>e.path.localeCompare(t.path)).slice(0,a).map(e=>({document:e,score:0,signals:{lexical:0,fullText:0,recency:0}}));let l=CX(Ghe(e),{term:c,properties:ege(r),boost:tge(r),tolerance:rge(r,c),limit:Math.max(a*4,40)}),u=new Map(l.hits.filter(e=>s9(e.document,o)).map(e=>[e.document.id,e.score])),d=$he(s),f=new Map;for(let e of s)c9(e,c)>=0&&f.set(e.id,e);for(let e of l.hits)s9(e.document,o)&&f.set(e.document.id,e.document);if(!n.semantic){let e=d9(f.values(),u);return f9([...f.values()].map(t=>{let n=Math.max(0,c9(t,c)),r=u.get(t.id)??0,a=d.get(t.id)??0;return{document:t,score:u9(i,n,r,a,t.kind,e),signals:{lexical:n,fullText:r,recency:a}}}).sort((e,t)=>e.score===t.score?e.document.path.localeCompare(t.document.path):t.score-e.score),i,a)}return f9(sge({scopedDocuments:s,candidates:f,fullTextScores:u,recency:d,normalizedQuery:c,ranking:i,semantic:n.semantic}),i,a)}function p9(e){let t=new Map;return e.forEach((e,n)=>{t.set(e,n+1)}),t}function sge(e){let{scopedDocuments:t,candidates:n,fullTextScores:r,recency:i,normalizedQuery:a,ranking:o,semantic:s}=e,c=s.rrfK??60,l=s.candidateLimit??64,u=s.similarityFloor??0,d=s.scores,f=new Map(t.map(e=>[e.id,e])),p=[...d.entries()].filter(([e,t])=>t>=u&&f.has(e)).sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0])).slice(0,l);for(let[e]of p)if(!n.has(e)){let t=f.get(e);t&&n.set(e,t)}let m=d9(n.values(),r),h=[...n.values()].map(e=>{let t=Math.max(0,c9(e,a)),n=r.get(e.id)??0,s=i.get(e.id)??0,c=d.get(e.id),l=c!==void 0&&c>=u;return{document:e,score:t>0?u9(o,t,n,s,e.kind,m):l9(t,n,s,e.kind),signals:l?{lexical:t,fullText:n,recency:s,vector:c}:{lexical:t,fullText:n,recency:s},lexical:t,fullText:n,recency:s,cosine:c}}),g=p9(h.filter(e=>e.fullText>0).sort((e,t)=>t.fullText-e.fullText||e.document.path.localeCompare(t.document.path)).map(e=>e.document.id)),_=p9(h.filter(e=>e.cosine!==void 0&&e.cosine>=u).sort((e,t)=>t.cosine-e.cosine||e.document.path.localeCompare(t.document.path)).map(e=>e.document.id)),v=e=>{let t=0,n=g.get(e);n!==void 0&&(t+=1/(c+n));let r=_.get(e);return r!==void 0&&(t+=1/(c+r)),t};return h.sort((e,t)=>{let n=+(e.lexical>0),r=+(t.lexical>0);if(n!==r)return r-n;if(n===1)return e.score===t.score?e.document.path.localeCompare(t.document.path):t.score-e.score;let i=v(e.document.id),a=v(t.document.id);return i===a?e.recency===t.recency?e.document.path.localeCompare(t.document.path):t.recency-e.recency:a-i}).map(({document:e,score:t,signals:n})=>({document:e,score:t,signals:n}))}function cge(e){return e.created.length>0||e.packSkills?.some(e=>e.pending)===!0||e.requiredPlugins?.some(e=>e.pending)===!0}const lge=/^[A-Za-z0-9._-]+$/,uge=/^(?:\d{1,3}\.){3}\d{1,3}$/;var m9=class extends Error{constructor(e){super(e),this.name=`InvalidShareUrlError`}};function dge(e,t=0){if(g9(t,!0),t===0)return mge(e);if(e.length>2985)throw new m9(`Share URL exceeds the v2 URL size limit`);pge(h9(e),t);let n=new TextEncoder().encode(e);if(n.length>2985)throw new m9(`Share URL exceeds the v2 URL size limit`);let r=new Uint8Array(3+n.length);if(r[0]=2,r[1]=t>>>8,r[2]=t&255,r.set(n,3),r.length>2988)throw new m9(`Share payload exceeds the v2 size limit`);let i=S9(r);if(i.length>3984)throw new m9(`Share token exceeds the v2 size limit`);return i}function h9(e){if(!e.startsWith(`https://`))throw new m9(`Share URL must use canonical HTTPS spelling`);if(e.includes(`?`)||e.includes(`#`))throw new m9(`Share URL cannot contain a query or fragment`);let t=e.slice(8),n=t.indexOf(`/`);if(n<=0)throw new m9(`Share URL is missing its repository path`);let r=t.slice(0,n);_9(r);let i=t.slice(n+1).split(`/`);if(i.length<4||i.some(e=>e.length===0))throw new m9(`Share URL has an invalid path shape`);let[a,o,s,c,...l]=i;if(s!==`blob`&&s!==`tree`)throw new m9(`Share URL has an unsupported repository path shape`);let u=v9(a,`owner`),d=v9(o,`repository`),f=hge(c),p=l.map(e=>gge(e,`target`)),m=s===`blob`?`doc`:`folder`;if(m===`doc`&&p.length===0)throw new m9(`Document share URL is missing its target path`);let h={host:r,owner:u,repo:d,branch:f,kind:m,targetSegments:p};if(fge(h)!==e)throw new m9(`Share URL is not canonically serialized`);return h}function fge(e){if(_9(e.host),x9(e.owner,`owner`),x9(e.repo,`repository`),!W4(e.branch))throw new m9(`Share URL branch is invalid`);if(e.kind!==`doc`&&e.kind!==`folder`)throw new m9(`Share URL target kind is invalid`);if(e.kind===`doc`&&e.targetSegments.length===0)throw new m9(`Document share URL is missing its target path`);for(let t of e.targetSegments)b9(t,`target`);let t=e.kind===`doc`?`blob`:`tree`,n=[encodeURIComponent(e.owner),encodeURIComponent(e.repo),t,encodeURIComponent(e.branch),...e.targetSegments.map(e=>encodeURIComponent(e))];return`https://${e.host}/${n.join(`/`)}`}function pge(e,t){if(g9(t,!1),t>e.targetSegments.length)throw new m9(`Content root depth exceeds the repository target path`);let n=e.targetSegments.slice(t).join(`/`);if(e.kind===`doc`){if(n.length===0)throw new m9(`Document share target cannot be the content root`);return{kind:`doc`,docPath:n}}return{kind:`folder`,folderPath:n}}function mge(e){let t=new TextEncoder().encode(e),n=new Uint8Array(1+t.length);return n[0]=1,n.set(t,1),S9(n)}function g9(e,t){if(!Number.isInteger(e)||e<+!t||e>65535)throw new m9(`Content root depth is invalid`)}function _9(e){if(e.length===0||e.length>253||e.endsWith(`.`)||e!==e.toLowerCase()||uge.test(e))throw new m9(`Share URL host is not canonical`);if(e.split(`.`).some(e=>e.length===0||e.length>63||!/^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/.test(e)))throw new m9(`Share URL host is not a DNS name`);if(A0(e)!==e)throw new m9(`Share URL host is not a canonical GitHub host`)}function hge(e){let t=y9(e,`branch`);if(!W4(t))throw new m9(`Share URL branch is invalid`);return t}function gge(e,t){let n=y9(e,t);return b9(n,t),n}function v9(e,t){let n=y9(e,t);return x9(n,t),n}function y9(e,t){let n;try{n=decodeURIComponent(e)}catch{throw new m9(`Share URL ${t} has malformed percent encoding`)}if(encodeURIComponent(n)!==e)throw new m9(`Share URL ${t} is not canonically encoded`);return n}function b9(e,t){if(e.length===0||e===`.`||e===`..`||e.toLowerCase()===`.git`||e.includes(`/`)||e.includes(`\\`)||_ge(e))throw new m9(`Share URL ${t} component is invalid`)}function x9(e,t){if(b9(e,t),!lge.test(e)||e.startsWith(`-`))throw new m9(`Share URL ${t} component is invalid`)}function _ge(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n<=31||n===127)return!0}return!1}function S9(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}const C9=Symbol.for(`@inkeep/open-knowledge/skill-state-field-registry`),w9=globalThis;w9[C9]===void 0&&(w9[C9]=nr());const T9=w9[C9],vge=[`.ok`,`skill-state.yml`],yge=[`claude-cowork`,`cli-hosts`],bge=[`server-build-and-open`,`electron-build-and-open`,`cli-npx-skills-add`,`desktop-direct`,`cli-start`],E9=/^\d+\.\d+\.\d+(?:[-+][\w.-]+)?$/,D9=eo({version:M().regex(E9,`version must match /^\\d+\\.\\d+\\.\\d+(?:[-+][\\w.-]+)?$/`).register(T9,{description:`Recorded skill version for this target.`}),recordedAt:Ki().register(T9,{description:`ISO 8601 timestamp of the most recent successful write. Updated on every write, including reinstalls of the same version.`}),surface:L(bge).register(T9,{description:`Install-source surface that recorded this entry.`}).optional()}),xge=eo({enabled:P().register(T9,{description:`Whether this user-global skill bundle is opted in.`}),decidedAt:Ki().register(T9,{description:`ISO 8601 timestamp of the opt-in / opt-out decision.`})}),Sge=eo({schema:R(1).register(T9,{description:`Schema major version. Bumped only on breaking shape changes.`}),targets:eo({"claude-cowork":D9.optional(),"cli-hosts":D9.optional()}).register(T9,{description:`Per-target install-state entries. Absent target = no recorded install.`}).default({}),bundles:oo(M(),xge).register(T9,{description:`Per-bundle opt-in decisions keyed by install name. Absent key = no recorded decision.`}).optional(),installsReported:F(M()).register(T9,{description:"Skill installs already reported to skills.sh from this machine, as `<owner/repo>#<skill>`. Append-only; presence suppresses a re-report."}).optional()});function Cge(e,t){return e??t.installedOnDisk}function wge(){return{schema:1,targets:{}}}const O9=`template`;function k9(e){if(e.trim()===``)return{};let t;try{t=(0,Bc.parse)(e)}catch{return{}}return typeof t!=`object`||!t||Array.isArray(t)?{}:t}function A9(e,t){return e.trim()===``?t:`---\n${e}\n---\n${t}`}function Tge(e){let{frontmatter:t,body:n}=Xc(e);return t===``?{docFrontmatterText:``,markdown:e}:{docFrontmatterText:Qc(t),markdown:n}}function Ege(e){let t=e.split(`
|
|
543
|
+
`)}const Fde=I({intents:F(I({satisfierId:M().min(1),desired:L([`present`,`absent`])}).loose()),...O4,summary:k4}).loose(),Ide=I({satisfierId:M(),agentId:M(),piece:M(),scope:M(),kind:M(),pathId:M().optional(),desired:L([`present`,`absent`]),action:L(Do),errorId:M().optional()}).loose(),Lde=I({kind:M(),satisfierIds:F(M()),agentIds:F(M()),pathId:M().optional(),blockedReason:M().optional()}).loose(),Rde=I({state:M(),strictness:F(L(To)).optional()}).loose(),zde=I({probes:I({env:L([`desktop`,`local-web`,`remote-web`]),satisfiers:oo(M(),Rde)}).loose(),detection:I({detected:F(M()),probed:P()}).loose()}).loose(),Bde=I({actions:F(Ide),conflicts:F(Lde),withheld:F(M()),snapshot:zde}).loose(),Vde=I({entries:F(I({level:L([`info`,`warn`,`error`]),message:M().max(8192),event:M().optional(),fields:oo(M(),Ja()).optional(),ts:N().optional(),sourceId:M().optional(),lineNumber:N().optional()}).loose()).max(100),droppedSinceLastFlush:N().int().min(0).optional()}).loose(),Hde=I({accepted:N().int().min(0)}).loose(),Ude=I({exact:M().min(1),prefix:M(),suffix:M(),start:N().int().nonnegative(),end:N().int().nonnegative()}),Wde=F(no([M(),N().int().nonnegative()])),Gde=ro(`kind`,[I({kind:R(`body`)}),I({kind:R(`property`),key:M().min(1),path:Wde.default([])})]).default({kind:`body`}),Kde=L([`anchored`,`orphaned`,`resolved`]),T7=I({threadId:M().min(1),docName:M().min(1),target:Gde,anchor:Ude.nullable(),state:Kde,queued:P(),latestComment:M(),createdBy:M().min(1),createdAt:N(),updatedAt:N().optional()}),E7=I({docName:M(),instruction:M(),property:M().nullable(),passage:I({exact:M(),prefix:M(),suffix:M()}).nullable(),anchorLost:P(),passageRepeats:P()}).loose(),D7=I({threadId:M(),ok:R(!0)}),O7=I({threadId:M(),ok:R(!1),error:R(`not-found`)}),qde=I({threads:F(T7)}).loose(),Jde=I({meta:T7,orphaned:P()}).loose(),Yde=I({threadId:M()}).loose(),Xde=I({meta:T7,payload:E7}).loose(),Zde=I({results:F(no([D7.extend({meta:T7,payload:E7}),O7]))}).loose(),Qde=I({results:F(no([D7.extend({meta:T7}),O7]))}).loose(),$de=I({status:M().min(1),reason:M()}).loose(),efe=I({docName:M().min(1),content:M(),lifecycle:$de.nullable()}).loose(),tfe=I({documents:F(I({kind:L([`document`,`asset`,`folder`,`file`]).default(`document`),docName:M().min(1).optional(),docExt:M().min(1).default(`.md`),size:N().int().nonnegative(),modified:M().min(1),isSymlink:P().default(!1),canonicalDocName:M().nullable().default(null),targetPath:M().nullable().default(null),path:M().min(1).optional(),assetExt:M().min(1).optional(),mediaKind:L([`image`,`video`,`audio`,`pdf`,`text`,`mermaid`,`excalidraw`]).nullable().optional(),referencedBy:F(M().min(1)).optional(),hasChildren:P().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:P().optional()}).loose(),nfe=I({source:M().min(1),anchor:M().nullable(),title:M(),snippet:M().nullable()}).loose(),rfe=I({docName:M().min(1),backlinks:F(nfe)}).loose(),ife=I({counts:oo(M().min(1),N().int().nonnegative())}).loose(),afe=I({counts:oo(M().min(1),N().int().nonnegative())}).loose(),ofe=ro(`kind`,[I({kind:R(`doc`),docName:M().min(1),anchor:M().nullable(),title:M(),snippet:M().nullable()}).loose(),I({kind:R(`external`),url:M().min(1),title:M(),snippet:M().nullable()}).loose()]),sfe=I({role:M().min(1),sourceForm:M().min(1),targetKind:M().min(1),href:M(),resolvedTarget:M().nullable(),status:M().min(1),reason:M().nullable(),resolutionMethod:M().min(1),fallbackTarget:M().nullable().default(null),range:I({start:N().int().nonnegative(),end:N().int().nonnegative()}),line:N().int().nonnegative(),column:N().int().nonnegative(),definition:I({label:M(),line:N().int().nonnegative()}).nullable().default(null)}).loose(),cfe=I({docName:M().min(1),forwardLinks:F(ofe),localTargets:F(sfe).optional()}).loose(),lfe=ro(`kind`,[I({id:M().min(1),kind:R(`doc`),docName:M().min(1),anchor:M().nullable(),label:M(),cluster:M().nullable(),category:M().nullable(),tags:F(M()).nullable(),managed:P().optional()}).loose(),I({id:M().min(1),kind:R(`external`),url:M().min(1),label:M()}).loose()]),ufe=I({source:M().min(1),target:M().min(1)}).loose(),dfe=I({nodes:F(lfe),links:F(ufe)}).loose(),ffe=I({ts:N().int().min(0),url:M(),method:M(),ua:M().optional(),origin:M().optional(),referer:M().optional(),host:M().optional(),remote:M().optional(),secChUa:M().optional(),secChUaMobile:M().optional(),secChUaPlatform:M().optional(),secFetchSite:M().optional(),secFetchDest:M().optional(),secFetchMode:M().optional(),secFetchUser:M().optional()}).loose(),pfe=I({app:no([R(`cursor`),R(`codex`),R(`claude`),Wa()]),signals_fired:F(M())}).loose(),mfe=I({entries:F(ffe),count:N().int().min(0),detection:pfe}).loose(),k7=[`M`,`A`,`D`,`R`,`C`,`U`,`T`,`?`,`!`,` `],A7=I({path:M().min(1),code:L(k7),origPath:M().min(1).optional(),syncScoped:P(),open:ro(`kind`,[I({kind:R(`doc`),docName:M().min(1)}),I({kind:R(`asset`),path:M().min(1)})]).optional()}).loose(),hfe=I({branch:M().nullable(),detached:P(),upstream:M().nullable(),staged:F(A7),notStaged:F(A7),untracked:F(A7),incoming:F(A7),truncated:P(),readable:P().default(!0)}).loose(),gfe=I({writers:F(I({id:M().min(1),name:M().optional(),email:M().optional()}).loose()).optional(),summary:k4,...O4}).loose(),_fe=I({checkpointRef:M().min(1)}).loose(),vfe=I({v:N().int().optional(),id:M().min(1),name:M().min(1),colorSeed:M().optional(),docs:F(M()),summaries:F(M()).optional()}).loose(),yfe=I({entries:F(I({sha:M().min(1),timestamp:M().min(1),author:M(),authorEmail:M(),type:L([`checkpoint`,`wip`,`upstream`,`park`]),message:M(),contributors:F(vfe),checkpoint:Ja().nullable(),parentSha:M().nullable().optional()}).loose()),total:N().int().nonnegative().optional(),truncated:P().optional(),hasMore:P().optional()}).loose(),bfe=I({sha:M().regex(/^[0-9a-f]{40}$/i),content:M(),timestamp:M(),author:M()}).loose(),xfe=I({contentDir:M().min(1),pathSeparator:L([`/`,`\\`]),symlinkResolved:P()}).loose(),Sfe=F(ro(`source`,[I({docName:M().min(1),timestamp:M().min(1),size:N().int().nonnegative(),source:R(`flat`)}).loose(),I({docName:M().min(1),timestamp:M().min(1),source:R(`timeline`),sha:M().min(1)}).loose()])).meta({description:"Flat array of rescue buffer entries; discriminated via `source`."}),j7=I({domain:M().min(1),title:M().optional(),description:M().optional(),siteName:M().optional(),faviconDataUri:M().optional()}).loose(),Cfe=I({url:M()}).loose(),wfe=ro(`ok`,[I({ok:R(!0),metadata:j7}).loose(),I({ok:R(!1),reason:M()}).loose()]),Tfe=I({orphans:F(I({docName:M().min(1),title:M()}).loose())}).loose(),Efe=I({hubs:F(I({docName:M().min(1),title:M(),count:N().int().nonnegative()}).loose())}).loose(),Dfe=I({source:M().min(1),title:M(),snippet:M().nullable()}).loose(),Ofe=I({deadLinks:F(I({target:M().min(1),sources:F(Dfe)}).loose())}).loose(),kfe=I({target:I({docName:M().min(1),title:M(),aliases:F(M())}).loose(),mentions:F(I({source:M().min(1),excerpt:M(),offset:N().int().nonnegative()}).loose()),truncated:P()}).loose(),Afe=I({projectPath:M().min(1)}).loose(),jfe=L([`not-a-git-worktree`,`init-failed`]),Mfe=ro(`ok`,[I({ok:R(!0),projectPath:M().min(1)}).loose(),I({ok:R(!1),reason:jfe,message:M().min(1)}).loose()]),Nfe=I({host:M().min(1).optional()}).loose(),Pfe=I({host:M().min(1).optional(),token:M().min(1)}).loose(),Ffe=I({host:M(),login:M()}).loose(),Ife=I({key:M().min(1)}).loose(),Lfe=I({keyPresent:P()}).loose(),Rfe=L([`no_key`,`invalid_endpoint`,`rate_limit`,`timeout`,`http_error`,`network`,`dims_mismatch`,`malformed_response`]),zfe=ro(`ok`,[I({ok:R(!0),endpoint:M().min(1),model:M().min(1),dimensions:N().int().positive()}).loose(),I({ok:R(!1),endpoint:M().min(1),model:M().min(1),reason:Rfe,status:N().int().optional()}).loose()]),Bfe=I({name:M().refine(e=>e.trim().length>0,{message:`name must be non-empty`}),email:M().refine(e=>e.trim().length>0,{message:`email must be non-empty`})}).loose(),Vfe=I({authenticated:P()}).loose(),Hfe=I({channel:L([`login`,`gh-login`]).default(`login`)}).loose(),Ufe=I({}).loose(),Wfe=I({stackIndex:N().int().min(0),ts:N().int().min(0),additions:N().int().min(0),deletions:N().int().min(0)}).loose(),Gfe=I({docName:M().min(1),additionsTotal:N().int().min(0),deletionsTotal:N().int().min(0),lastTs:N().int().min(0),bursts:F(Wfe)}).loose(),Kfe=I({displayName:M().min(1),color:M().min(1),icon:M().optional(),connectionId:M().min(1)}).loose(),qfe=I({sessionAlive:P(),agent:Kfe.nullable(),files:F(Gfe)}).loose(),Jfe=I({diff:M(),before:M(),after:M(),properties:d4,generatedAt:N().int().min(0)}).loose(),Yfe=I({}).loose(),Xfe=I({}).loose(),Zfe=I({}).loose(),Qfe=I({}).loose(),$fe=I({}).loose(),epe=I({}).loose(),tpe=I({displayName:M().min(1),icon:M(),color:M().min(1),currentDoc:M().nullable(),mode:L([`idle`,`writing`]),ts:N().int().min(0)}).loose(),npe=I({presence:oo(M().min(1),tpe)}).loose(),rpe=I({sessionId:M().min(1),agentType:M().min(1),ts:N().int().min(0),insertedChars:N().int().min(0),deletedChars:N().int().min(0)}).loose(),ipe=I({effects:F(I({"doc.name":M().min(1),entries:F(rpe)}).loose())}).loose(),ape=I({decisions:F(I({ts:N().int().min(0),decision:M().min(1),kind:M().min(1),"doc.name":M().min(1),pathRole:M().min(1)}).loose())}).loose(),ope=oo(M().min(1),P()).meta({description:`Flat boolean record keyed by agent-scheme name (claude / codex / cursor). True = installed.`});I({path:M().min(1,`path must be non-empty`)}).loose();const spe=I({}).loose(),cpe=I({fromDocName:M().min(1),toDocName:M().min(1)}).loose(),lpe=I({fromPath:M().min(1),toPath:M().min(1)}).loose(),upe=I({}).loose(),dpe=I({path:M().min(1),...O4,summary:k4}).loose(),fpe=I({docName:M().min(1)}).loose(),ppe=I({path:M().min(1),...O4,summary:k4}).loose(),mpe=I({path:M().min(1)}).loose(),hpe=I({kind:L([`file`,`folder`]),path:M().min(1),...O4,summary:k4}).loose(),gpe=I({kind:L([`file`,`folder`]),path:M().min(1),duplicatedDocNames:F(M().min(1))}).loose(),_pe=I({pages:F(I({docName:M().min(1),title:M(),docExt:M().min(1),size:N().int().nonnegative(),modified:M().min(1),icon:M().min(1).max(2048).optional()}).loose())}).loose(),vpe=I({level:N().int().min(1).max(6),text:M(),slug:M()}).loose(),ype=I({docName:M().min(1),headings:F(vpe)}).loose(),bpe=I({docName:M().min(1),rewrites:N().int().nonnegative()}).loose(),xpe=I({kind:L([`file`,`folder`,`asset`]),fromPath:M().min(1),toPath:M().min(1),...O4,summary:k4}).loose(),Spe=I({renamed:F(cpe),renamedAssets:F(lpe),rewrittenDocs:F(bpe).optional(),summary:H5.optional()}).loose(),Cpe=I({kind:L([`file`,`folder`,`asset`]),path:M().min(1),...O4}).loose(),wpe=I({deletedDocNames:F(M().min(1))}).loose(),Tpe=I({kind:L([`file`,`folder`,`asset`]),path:M().min(1),...O4,summary:k4}).loose(),Epe=I({deletedDocNames:F(M().min(1))}).loose(),Dpe=I({docName:M().min(1),commitSha:M().regex(/^[0-9a-f]{40}$/i,{message:`commitSha must be a 40-char git SHA`}),summary:k4,...O4}).loose(),Ope=I({restoredFrom:M().min(1),timestamp:M().min(1),summary:H5.optional(),warnings:J5.optional()}).loose(),kpe=/^#[0-9a-fA-F]{6}$/,Ape=I(Object.fromEntries(Nd.map(e=>[e,M().regex(kpe,`must be a #rrggbb hex color`)]))),M7=M().min(1).refine(Ld,{message:`must contain a non-whitespace character`}),N7=I({name:M7,author:M7.optional(),variant:L([`dark`,`light`]),palette:Ape}).loose(),jpe=I({name:M().min(1),scheme:N7,stem:M().min(1).optional(),extension:L([`.yaml`,`.yml`]).optional()}).loose(),Mpe=I({id:M().min(1),filename:M().min(1)}).loose(),Npe=I({id:M().min(1),scheme:N7}).loose(),Ppe=I({id:M().min(1),filename:M().min(1)}).loose(),Fpe=ro(`existed`,[I({existed:R(!1)}).loose(),I({existed:R(!0),filename:M().min(1),scheme:N7}).loose()]),Ipe=I({themes:F(ro(`ok`,[I({ok:R(!0),id:M().min(1),filename:M().min(1),scheme:N7}),I({ok:R(!1),filename:M().min(1),id:M().min(1).optional(),code:M().min(1),conflictingFilenames:F(M().min(1)).min(2).optional()})])),truncated:P()}).loose(),Lpe=L([`dormant`,`idle`,`fetching`,`pulling`,`pushing`,`conflict`,`offline`,`auth-error`,`disabled`]),Rpe=I({label:M().min(1),webUrl:Ca().nullable()}).loose(),zpe=ro(`checkStatus`,[I({checkStatus:R(`allowed`)}).loose(),I({checkStatus:R(`denied`),deniedReason:L([`no-collaborator`,`private-no-access`,`repo-not-found`,`not-authenticated`]),resolvedLogin:M().optional(),declaredLogin:M().optional(),declaredSource:M().optional()}).loose(),I({checkStatus:R(`unknown`),unknownError:L([`network`,`timeout`,`rate-limit`,`token-invalid`,`malformed-response`,`ssh-unverified`]).optional()}).loose()]),P7=L([`auth-403`,`auth-401`,`auth-scope-mismatch`,`auth-no-credential`,`auth-not-found-as-identity`,`semantic-protected-branch`]),Bpe=L(ku),Vpe=L([`succeeded`,`up-to-date`,`conflict`,`refused`,`error`]),Hpe=I({state:Lpe,lastSyncUtc:M().nullable(),lastRunUtc:M().nullable().optional(),lastPullOkUtc:M().nullable().optional(),lastPushOkUtc:M().nullable().optional(),lastFetchUtc:M().nullable(),lastPushedSha:M().nullable(),ahead:N().int().min(0),behind:N().int().min(0),consecutiveFailures:N().int().min(0),consecutivePushFailures:N().int().min(0).optional(),conflictCount:N().int().min(0),hasRemote:P(),syncEnabled:P(),identityUnresolved:P(),remote:Rpe.nullable().optional(),pushError:M().optional(),pushErrorCode:P7.optional(),pullError:M().optional(),pullErrorCode:P7.optional(),pausedReason:M().optional(),blockingPaths:F(M().min(1)).optional(),pushPermission:zpe.optional(),syncMode:Bpe.optional(),lastPullUtc:M().nullable().optional(),lastPullOutcome:Vpe.nullable().optional()}).loose(),Upe=I({action:L([`commit`]),paths:F(M().min(1)),commitSha:M().optional()}).loose(),Wpe=I({action:L([`commit`])}).loose(),Gpe=I({op:L([`sync`,`push`,`pull`,`fetch`]).optional()}).loose(),Kpe=I({op:L([`sync`,`push`,`pull`,`fetch`])}).loose(),qpe=I({conflicts:F(I({file:M().min(1),detectedAt:M().min(1),oursSha:M().optional(),theirsSha:M().optional(),baseSha:M().optional()}).loose())}).loose(),Jpe=I({file:M().min(1),strategy:L([`mine`,`theirs`,`content`,`delete`]),content:M().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`]}),Ype=I({}).loose(),Xpe=I({file:M().min(1),base:M(),ours:M(),theirs:M(),kind:L([`both-modified`,`delete-modify`,`modify-delete`]),lifecycleStatus:M().nullable()}).loose(),Zpe=I({plan:vo(e=>e!==void 0,{message:`plan is required`})}).loose(),Qpe=I({plan:vo(e=>e!==void 0,{message:`plan is required`})}).loose(),$pe=I({result:vo(e=>e!==void 0,{message:`result is required`})}).loose(),eme=I({packId:M().min(1)}).strict(),F7=I({installedHosts:F(M()),skills:F(I({name:M().min(1),created:P()}).strict())}).strict(),tme=I({path:M().min(1),summary:M().min(1)}).loose(),nme=I({files:N().int().nonnegative(),folders:N().int().nonnegative()}).loose(),rme=I({packs:F(I({id:M().min(1),name:M().min(1),description:M().min(1),defaultSubfolder:M().optional(),folders:F(tme),entryCounts:nme}).loose())}).loose(),ime=I({noOpen:P().optional(),out:M().min(1).optional()}).loose(),ame=I({reason:L([`unsupported-platform`,`spawn-error`]),message:M()}).loose(),ome=ro(`status`,[I({status:R(`installed`),outputPath:M(),size:N().int().nonnegative(),sha256:M(),skillVersion:M()}).loose(),I({status:R(`built`),outputPath:M(),size:N().int().nonnegative(),sha256:M(),skillVersion:M(),handoffError:ame.optional()}).loose(),I({status:R(`failed`),buildError:M()}).loose(),I({status:R(`skip-current`),skillVersion:M(),recordedAt:M().optional()}).loose()]),I7=L(T),sme=L(E);function cme(e){return e===`agents`||E.includes(e)}const lme=I({alwaysOn:N().int().nonnegative(),onTrigger:N().int().nonnegative(),onDemand:N().int().nonnegative()}).strict(),ume=[`.md`,`.mdx`,`.txt`];function L7(e){return Math.round(e/4)}function dme(e){let t=e.lastIndexOf(`.`);return t!==-1&&ume.includes(e.slice(t).toLowerCase())}function fme(e){let t=L7((e.name??``).length+(e.description??``).length),n=L7(Xc(e.skillMd).body.length),r=e.files.some(e=>e.relPath===`overlay.yaml`),i=0;for(let t of e.files)t.content!==null&&t.relPath!==`SKILL.md`&&(r&&t.relPath.startsWith(`upstream/`)||dme(t.relPath)&&(i+=t.content.length));return{alwaysOn:t,onTrigger:n,onDemand:L7(i)}}const pme=I({tags:F(I({name:M().min(1),count:N().int().nonnegative(),isLeaf:P()}).loose())}).loose(),mme=I({docName:M().min(1),title:M(),matchingTags:F(M().min(1)),snippet:M().nullable()}).loose(),hme=I({name:M().min(1),docs:F(mme)}).loose(),gme=I({folder:Ja(),frontmatter_local:oo(M(),Ja()).nullable(),warnings:F(M()).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:F(L([`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(),_me=I({path:M(),frontmatter:oo(M(),Ja()).optional()}).loose(),vme=I({applied:Ja()}).loose(),R7=oo(M(),Ja()).meta({description:`Free-form frontmatter map embedded in template payloads.`}),yme=I({template:I({name:M().min(1),folder:M(),scope:L([`local`,`inherited`]),path:M().min(1),frontmatter:R7,body:M()}).strict()}).strict(),bme=I({templates:F(I({name:M().min(1),title:M().optional(),description:M().optional(),path:M().min(1),source_folder:M()}).strict()),truncated:P()}).strict(),xme=I({folder:M(),name:M(),body:M().optional(),frontmatter:R7.optional(),...O4,summary:k4}).strict(),Sme=I({path:M().min(1),created:P(),warnings:F(M())}).strict(),Cme=I({sourcePath:M().min(1),targetFolder:M(),name:M().optional(),title:M().optional(),deleteSource:P().optional(),...O4,summary:k4}).strict(),wme=I({path:M().min(1),created:P(),warnings:F(M())}).strict(),Tme=I({existed:P(),path:M().min(1)}).strict(),Eme=I({fromFolder:M(),fromName:M(),toFolder:M(),toName:M(),body:M().optional(),frontmatter:R7.optional(),...O4,summary:k4}).strict(),Dme=I({from:M().min(1),to:M().min(1),committed:P()}).strict(),z7=L(hl),Ome=/^[a-z0-9-]+$/,kme=/<\/?[A-Za-z][^>]*>/;function Ame(e){return kme.test(e)}const jme=/^[A-Za-z0-9_-]+$/,B7=I({name:M(),description:M(),metadata:I({pack:M()}).strict().optional()}).strict(),Mme=I({skill:I({name:M().min(1),scope:z7,path:M().min(1),frontmatter:B7,body:M(),files:F(I({path:M().min(1),text:M().nullable()})).optional(),managed:P().optional()}).strict()}).strict(),Nme=I({source:M().min(1),publisher:M().optional(),skill:M().optional(),marketplaceUrl:M().optional(),importedAt:M().min(1),autoUpdate:P().optional()}).strict(),Pme=I({name:M().min(1),description:M().optional(),scope:z7,path:M().min(1),canonicalPath:M().min(1).optional(),filePaths:F(M()).optional(),absolutePath:M().min(1).optional(),installed:P(),hosts:F(M()),hostQualifier:M().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:F(M()).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:oo(M(),M()).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:F(M()).optional().meta({description:`Hosts whose dir holds a DIFFERENT same-name skill (fork/conflict) — occupied, not this skill.`}),symlinkedHosts:F(M()).optional(),installableEditors:F(M()).optional(),hubOffered:P().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:P().optional(),customPlacements:F(I({path:M(),mode:L([`copy`,`link`])}).strict()).optional(),plugin:I({name:M().min(1),marketplace:M().min(1),provider:M().min(1),url:M().optional()}).strict().optional(),managed:P().optional(),origin:Nme.optional(),pack:M().optional(),modified:P().optional(),revertable:P().optional(),ignored:P().optional(),size:lme.optional()}).strict(),Fme=I({name:M().min(1),scope:z7,apply:P().optional()}).strict(),Ime=I({line:M().min(1),gitignorePath:M().min(1),applied:P(),alreadyTracked:P().optional()}).strict(),Lme=I({skills:F(Pme),truncated:P()}).strict(),Rme=I({scope:z7.default(`project`),name:M().meta({description:`Managed skill name to create or update.`}),body:M().optional(),frontmatter:B7,...O4,summary:k4}).strict(),zme=I({path:M().min(1),created:P(),warnings:F(M())}).strict(),Bme=I({scope:z7.default(`project`),name:M(),dryRun:P().optional(),setAutoUpdate:P().optional(),...O4,summary:k4}).strict(),Vme=I({name:M().min(1),updated:P(),source:M().min(1),localBody:M().optional(),upstreamBody:M().optional(),gitTracked:P().optional(),warnings:F(M())}).strict(),Hme=I({scope:z7.default(`project`),name:M(),...O4,summary:k4}).strict(),Ume=I({name:M().min(1),baselineRef:M().min(1),restoredFiles:F(M()),warnings:F(M())}).strict(),Wme=I({existed:P(),path:M().min(1)}).strict(),Gme=I({scope:z7.default(`project`),fromName:M(),toName:M(),body:M().optional(),frontmatter:B7.optional(),...O4,summary:k4}).strict(),Kme=I({from:M().min(1),to:M().min(1),committed:P()}).strict(),qme=I({name:M(),fromScope:z7,toScope:z7,...O4,summary:k4}).strict(),Jme=I({scope:z7,path:M().optional()}).strict(),Yme=I({scope:z7,name:M(),toName:M(),...O4,summary:k4}).strict(),Xme=I({name:M().min(1)}).strict(),Zme=I({name:M(),home:M().min(1)}).strict(),Qme=I({docName:M().min(1)}).strict(),V7=L([`reference`,`script`,`file`]),$me=I({scope:z7.default(`project`),name:M(),path:M().min(1),content:M(),...O4,summary:k4}).strict(),ehe=I({path:M().min(1),created:P(),kind:V7,content:P()}).strict(),the=I({scope:z7.default(`project`),name:M(),from:M().min(1),to:M().min(1),...O4,summary:k4}).strict(),nhe=I({from:M().min(1),to:M().min(1),fromDocName:M().optional(),toDocName:M().optional()}).strict(),rhe=I({path:M().min(1),kind:V7,text:M()}).strict(),ihe=I({path:M().min(1),existed:P(),kind:V7}).strict(),H7=no([sme,R(`agents`)]),U7=M().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`}),W7=no([H7,U7]),ahe=I({scope:z7.default(`project`),name:M(),targets:F(H7).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:F(W7).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:F(W7).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:L([`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:W7.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:P().optional(),setSource:M().min(1).optional(),place:I({dir:M().min(1).meta({description:`Project-relative directory the bundle dir is created under (e.g. ".windsurf/skills").`}),mode:L([`copy`,`link`])}).strict().optional(),convert:I({target:W7.meta({description:`The installed location to convert — an editor id, "agents", or a recorded custom placement path.`}),mode:L([`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:I({path:M().min(1).meta({description:`The recorded placement bundle path (e.g. ".windsurf/skills/my-skill").`})}).strict().optional(),...O4,summary:k4,fork:I({editor:M().min(1),action:L([`align`,`make-source`,`rename`]),toName:M().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"}),G7=[`no-targets`,`scripts-present`,`name-conflict`,`no-description`,`skill-fork-name-unpatched`,`place-path-invalid`,`place-fork-refused`],ohe=I({name:M().min(1).meta({description:`Managed skill name installed or uninstalled.`}),hosts:F(M()).meta({description:`Editor ids the skill is projected into after the operation; [] is expected after uninstall.`}),scripts:P().meta({description:`True when the skill ships executable scripts, projected but never run.`}),warnings:F(M()).meta({description:`Non-fatal install/uninstall warnings from target projection.`}),warningCodes:F(L(G7)).meta({description:"Machine-readable warning codes aligned with `warnings`."}),placedAt:M().optional(),sourceMovedTo:M().optional()}).strict(),she=I({scope:z7.default(`project`),name:M().meta({description:`Managed skill name to uninstall without deleting source.`})}).strict(),che=I({name:M().min(1).meta({description:`Managed skill name requested for uninstall.`}),uninstalled:P().meta({description:`True when an install marker existed and was removed; false for an idempotent no-op.`})}).strict(),lhe=I({targets:F(I7),configured:P(),folders:F(I({scope:z7,host:M(),root:M(),state:L([`own`,`linked`,`linked-parent`,`absent`]),target:M().optional(),drift:R(!0).optional(),expected:M().optional()}).strict()).optional()}).strict(),K7=I({action:R(`link`),scope:z7,root:M().min(1).meta({description:`The folder to link (e.g. ".codex/skills").`}),target:M().min(1).meta({description:`The root it merges into (e.g. ".agents/skills"). Required.`})}),q7=I({action:R(`unlink`),scope:z7,root:M().min(1).meta({description:`The linked folder to materialize back.`}),exclude:F(M().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(),J7=I({action:R(`add-root`),scope:z7,root:U7.meta({description:`New custom skills root to declare (base-relative, e.g. ".team/skills").`})}).strict(),uhe=ro(`action`,[K7.extend({preview:P().optional().meta({description:`Return the merge plan only (moves, drops, removes, conflicts, strays) — nothing is written.`})}).strict(),q7,J7]),dhe=ro(`action`,[K7.strict(),q7,J7]),fhe=I({folderAction:uhe}).strict(),phe=I({moves:F(M()),drops:F(M()),removes:F(M()),replaces:F(M()),conflicts:F(M()),strays:F(M())}).strict(),mhe=I({targets:F(I7),reprojected:F(I({name:M(),hosts:F(M())}).strict()),bundleHosts:F(M()),removedFrom:F(M()),folder:I({moved:F(M()),dropped:F(M()),linked:F(M())}).strict().optional(),preview:phe.optional()}).strict(),hhe=I({scope:z7.default(`project`),name:M(),version:M().regex(/^[0-9a-f]{40}$/i),...O4,summary:k4}).strict(),ghe=I({name:M().min(1),version:M(),restoredFiles:F(M()),warnings:F(M())}).strict(),_he=I({query:M().optional(),intent:L([`autocomplete`,`full_text`,`omnibar`]).optional(),ranking:L([`navigation`,`relevance`]).optional(),scopes:F(L([`page`,`folder`,`content`,`file`])).optional(),scope:M().optional(),limit:N().int().nonnegative().optional(),semantic:P().optional(),source:L([`omnibar`,`mcp`,`http`]).optional()}).loose(),vhe=I({kind:L([`page`,`folder`,`content`,`file`]),path:M().min(1),title:M(),score:N(),signals:oo(M(),Ja()),snippet:M().optional()}).loose(),yhe=I({capable:P(),applied:P(),coverage:I({embedded:N().int().nonnegative(),total:N().int().nonnegative()})}).loose(),bhe=I({enabled:P(),keyPresent:P(),keyNotRequired:P(),keySource:L([`project`,`file`,`env`]).nullable(),keyHint:M().nullable(),ready:P(),capable:P(),embedded:N().int().nonnegative(),total:N().int().nonnegative()}).loose(),xhe=I({query:M(),intent:L([`autocomplete`,`full_text`,`omnibar`]),results:F(vhe),elapsedMs:N().nonnegative(),semantic:yhe.optional(),truncated:P().optional(),ready:P().optional()}).loose(),She=I({version:M().min(1),recordedAt:M().min(1)}).loose(),Che=I({currentVersion:M().min(1),targets:oo(M(),She.nullable())}).loose(),whe=I({scope:z7.default(`project`),source:M().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:M().min(1).optional().meta({description:`Specific skill name to import from a multi-skill source.`}),install:P().optional().meta({description:`Pass false to import WITHOUT the default-editor auto-projection (the caller installs explicitly afterwards). Default true.`}),marketplace:P().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."}),...O4,summary:k4}).strict(),The=I({scope:z7.default(`project`),source:M().min(1).meta({description:`External skill source: full skills.sh skill-page URL, GitHub owner/repo[/subpath], git URL, or local/file path.`}),skills:F(M().min(1)).min(1).max(100).meta({description:`Skill names to import from the source.`}),install:P().optional().meta({description:`Pass false to import WITHOUT the default-editor auto-projection. Default true.`}),marketplace:P().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."}),...O4,summary:k4}).strict(),Ehe=I({results:F(I({requested:M(),status:L([`imported`,`already-imported`,`not-found`,`failed`]),name:M().optional(),collisionRenamedFrom:M().optional(),warnings:F(M()),error:M().optional()}).loose()),imported:N(),alreadyImported:N(),failed:N()}).loose(),Dhe=I({scope:z7.default(`project`),names:F(M().min(1)).min(1).max(100).meta({description:`Managed skill names to refresh from their recorded upstreams.`}),...O4,summary:k4}).strict(),Ohe=I({results:F(I({requested:M(),status:L([`updated`,`up-to-date`,`not-found`,`failed`]),source:M().optional(),warnings:F(M()),error:M().optional()}).loose()),updated:N(),upToDate:N(),failed:N()}).loose(),khe=I({source:M(),ref:M().optional(),contentHash:M(),publisher:M().optional()}).loose(),Ahe=I({name:M().min(1).meta({description:`Managed skill name created or matched.`}),path:M().min(1).meta({description:`Store-relative path to the imported skill source.`}),created:P().meta({description:`True when this request created new source files.`}),alreadyImported:P().meta({description:`True when identical content was already present and no files changed.`}),collisionRenamedFrom:M().optional().meta({description:`Original source name when collision handling renamed the import.`}),provenance:khe,warnings:F(M()).meta({description:`Non-fatal import warnings, such as skipped unsupported files.`})}).loose(),Y7=`server-info`,X7=`branch-switched`,Z7=`disk-ack`,Q7=`config-validation-rejected`,$7=`config-ignore-nested-error`,jhe=L([`files`,`backlinks`,`graph`,`sync-status`,`session-activity`,`tags`,`comments`,`lint-config`,`local-targets`]),Mhe=I({v:R(1),ch:R(Y7),seq:N(),serverInstanceId:M().min(1),currentBranch:M().min(1).optional()}).loose(),Nhe=I({v:R(1),ch:R(X7),seq:N(),branch:M().min(1)}).loose(),Phe=I({v:R(1),ch:jhe,seq:N()}).loose(),Fhe=I({v:R(1),ch:R(Z7),seq:N(),docName:M().min(1),sv:M().min(1)}).loose(),Ihe=I({v:R(1),ch:R(Q7),seq:N(),docName:M().min(1),error:Nte}).loose(),Lhe=I({v:R(1),ch:R($7),seq:N(),path:M().min(1),error:M().min(1)}).loose(),Rhe={id:`string`,kind:`enum`,path:`string`,title:`string`,name:`string`,pathSegments:`string`,content:`string`,modifiedTs:`number`},e9=new WeakMap;function zhe(e){return e===void 0||!Number.isFinite(e)?20:Math.max(1,Math.min(100,Math.trunc(e)))}function t9(e){return e.trim().toLowerCase()}const Bhe=/\.(?:md|mdx)$/;function Vhe(e,t){if(t!==`page`)return e;let n=e.replace(Bhe,``);return n.length>0?n:e}function Hhe(e){let t=e.split(`/`).filter(Boolean);return t[t.length-1]??e}function Uhe(e){let t=Hhe(e.path),n=e.title?.trim()||t,r=e.modifiedTs??0,i=e.path.split(`/`).filter(Boolean),a=new Set(i),o=[...new Set((e.aliases??[]).flatMap(e=>e.split(`/`).filter(Boolean)).filter(e=>!a.has(e)))];return{id:`${e.kind}:${e.path}`,kind:e.kind,path:e.path,title:n,name:t,pathSegments:[...i,...o].join(` `),content:e.content??``,modifiedTs:Number.isFinite(r)?r:0}}const n9=/[^\P{L}a-zàèéìòóù]|[^\P{Nd}0-9]|\p{Nl}/iu,r9=(()=>{let e=globalThis.Intl.Segmenter;return e?new e(`en`,{granularity:`word`}):null})();function Whe(){let e=gY({language:`english`}),t=e.tokenize.bind(e);return e.tokenize=(e,n,r,i)=>{let a=t(e,n,r,i);if(!r9||typeof e!=`string`||!n9.test(e))return a;let o=new Set(a);for(let{segment:t,isWordLike:n}of r9.segment(e)){if(!n||!n9.test(t))continue;let e=t.toLowerCase();o.has(e)||(o.add(e),a.push(e))}return a},e}function i9(e){let t=AY({schema:Rhe,components:{tokenizer:Whe()}});return e.length>0&&VY(t,e),t}function a9(e){let t={documents:e};return e9.set(t,i9(e)),t}function Ghe(e){let t=e9.get(e);if(t)return t;let n=i9(e.documents);return e9.set(e,n),n}const o9=new WeakSet;function Khe(e,t){return e===t||e.kind===t.kind&&e.path===t.path&&e.title===t.title&&e.name===t.name&&e.pathSegments===t.pathSegments&&e.modifiedTs===t.modifiedTs&&e.content===t.content}function qhe(e,t){let n=e=>({corpus:a9(t),inserted:0,updated:0,removed:0,rebuilt:!0,rebuildReason:e}),r=e9.get(e);if(!r)return n(`no-index`);if(o9.has(e))return n(`stale-base`);let i=new Map(t.map(e=>[e.id,e]));if(i.size!==t.length)return n(`duplicate-id`);let a=[],o=[],s=0;for(let t of e.documents){let e=i.get(t.id);e?Khe(t,e)||(a.push(t.id),o.push(e),s+=1):a.push(t.id)}let c=new Set(e.documents.map(e=>e.id));for(let e of t)c.has(e.id)||o.push(e);if(a.length+o.length>t.length)return n(`bulk-change`);o9.add(e);try{if(a.length>0&&qY(r,a),o.length>0&&VY(r,o),MY(r)!==t.length)throw Error(`Search index count ${MY(r)} diverged from document count ${t.length} after incremental update`)}catch{return n(`mutation-failed`)}let l={documents:t};return e9.set(l,r),{corpus:l,inserted:o.length-s,updated:s,removed:a.length-s,rebuilt:!1}}function Jhe(e){return e===`autocomplete`?[`page`]:e===`full_text`?[`page`,`content`,`file`]:[`page`,`folder`,`file`]}function s9(e,t){return t.has(e.kind)?!0:e.kind===`page`&&t.has(`content`)}function Yhe(e,t){let n=t9(t);if(!n)return 0;let r=Vhe(n,e.kind),i=t9(e.title),a=t9(e.name),o=t9(e.path),s=o.split(`/`);return i===r||a===r?700:o===r?650:i.startsWith(r)||a.startsWith(r)?600:s.some(e=>e.startsWith(r))?550:i.includes(r)||a.includes(r)?500:o.includes(r)?450:-1}function c9(e,t){let n=Yhe(e,t);return n<=0?n:w4(e.path)?n*.5:n}function Xhe(e){return e===`file`?-60:0}function Zhe(e,t,n,r,i){let a=i>0?t/i:0,o=n/50,s=r===`file`?-.001:0,c=1*a+1*o+s;return e*1e3+c}function l9(e,t,n,r){return e+t*20+n+Xhe(r)}function u9(e,t,n,r,i,a){return e===`relevance`?l9(t,n,r,i):Zhe(t,n,r,i,a)}function Qhe(e,t){return t||(e===`full_text`?`relevance`:`navigation`)}function d9(e,t){let n=0;for(let r of e){let e=t.get(r.id)??0;e>n&&(n=e)}return n}function $he(e){let t=e.map(e=>e.modifiedTs).filter(e=>Number.isFinite(e)&&e>0);if(t.length===0)return new Map;let n=1/0,r=-1/0;for(let e of t)e<n&&(n=e),e>r&&(r=e);let i=Math.max(1,r-n);return new Map(e.map(e=>[e.id,e.modifiedTs>0?(e.modifiedTs-n)/i*50:0]))}function ege(e){return e===`full_text`?[`title`,`name`,`path`,`pathSegments`,`content`]:[`title`,`name`,`path`,`pathSegments`]}function tge(e){return e===`full_text`?{title:8,name:7,path:5,pathSegments:4,content:1}:e===`autocomplete`?{title:10,name:9,path:5,pathSegments:4}:{title:8,name:7,path:5,pathSegments:4}}const nge=/[-ក- -〿-ゟ゠-ヿ㐀-䶿一-鿿\uf900--\u1100-\u11ff\u3130-\u318f\ua960-\ua97f\uac00-\ud7ff]/;function rge(e,t){let n=t9(t);return n.length<4||nge.test(n)?0:+(e===`full_text`)}function ige(e){let{lexical:t,fullText:n}=e.signals;return t>=500?`lexical`:t===450&&n<=0?`pathOnly`:`body`}function age(e){let t=[],n=[],r=[];for(let i of e){let e=ige(i);e===`lexical`?t.length<100&&t.push(i):e===`body`?n.length<6&&n.push(i):r.length<4&&r.push(i)}return[...t,...n,...r]}function f9(e,t,n){if(t===`relevance`)return e.slice(0,n);let r=age(e),i=[],a=0,o=0;for(let e of r){if(e.document.kind===`folder`){if(a>=3)continue;a+=1}else if(e.document.kind===`file`){if(o>=3)continue;o+=1}if(i.push(e),i.length>=n)break}return i}function oge(e,t,n={}){let r=n.intent??`omnibar`,i=Qhe(r,n.ranking),a=zhe(n.limit),o=new Set(n.scopes??Jhe(r)),s=e.documents.filter(e=>s9(e,o)),c=t9(t);if(!c)return s.slice().sort((e,t)=>e.path.localeCompare(t.path)).slice(0,a).map(e=>({document:e,score:0,signals:{lexical:0,fullText:0,recency:0}}));let l=CX(Ghe(e),{term:c,properties:ege(r),boost:tge(r),tolerance:rge(r,c),limit:Math.max(a*4,40)}),u=new Map(l.hits.filter(e=>s9(e.document,o)).map(e=>[e.document.id,e.score])),d=$he(s),f=new Map;for(let e of s)c9(e,c)>=0&&f.set(e.id,e);for(let e of l.hits)s9(e.document,o)&&f.set(e.document.id,e.document);if(!n.semantic){let e=d9(f.values(),u);return f9([...f.values()].map(t=>{let n=Math.max(0,c9(t,c)),r=u.get(t.id)??0,a=d.get(t.id)??0;return{document:t,score:u9(i,n,r,a,t.kind,e),signals:{lexical:n,fullText:r,recency:a}}}).sort((e,t)=>e.score===t.score?e.document.path.localeCompare(t.document.path):t.score-e.score),i,a)}return f9(sge({scopedDocuments:s,candidates:f,fullTextScores:u,recency:d,normalizedQuery:c,ranking:i,semantic:n.semantic}),i,a)}function p9(e){let t=new Map;return e.forEach((e,n)=>{t.set(e,n+1)}),t}function sge(e){let{scopedDocuments:t,candidates:n,fullTextScores:r,recency:i,normalizedQuery:a,ranking:o,semantic:s}=e,c=s.rrfK??60,l=s.candidateLimit??64,u=s.similarityFloor??0,d=s.scores,f=new Map(t.map(e=>[e.id,e])),p=[...d.entries()].filter(([e,t])=>t>=u&&f.has(e)).sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0])).slice(0,l);for(let[e]of p)if(!n.has(e)){let t=f.get(e);t&&n.set(e,t)}let m=d9(n.values(),r),h=[...n.values()].map(e=>{let t=Math.max(0,c9(e,a)),n=r.get(e.id)??0,s=i.get(e.id)??0,c=d.get(e.id),l=c!==void 0&&c>=u;return{document:e,score:t>0?u9(o,t,n,s,e.kind,m):l9(t,n,s,e.kind),signals:l?{lexical:t,fullText:n,recency:s,vector:c}:{lexical:t,fullText:n,recency:s},lexical:t,fullText:n,recency:s,cosine:c}}),g=p9(h.filter(e=>e.fullText>0).sort((e,t)=>t.fullText-e.fullText||e.document.path.localeCompare(t.document.path)).map(e=>e.document.id)),_=p9(h.filter(e=>e.cosine!==void 0&&e.cosine>=u).sort((e,t)=>t.cosine-e.cosine||e.document.path.localeCompare(t.document.path)).map(e=>e.document.id)),v=e=>{let t=0,n=g.get(e);n!==void 0&&(t+=1/(c+n));let r=_.get(e);return r!==void 0&&(t+=1/(c+r)),t};return h.sort((e,t)=>{let n=+(e.lexical>0),r=+(t.lexical>0);if(n!==r)return r-n;if(n===1)return e.score===t.score?e.document.path.localeCompare(t.document.path):t.score-e.score;let i=v(e.document.id),a=v(t.document.id);return i===a?e.recency===t.recency?e.document.path.localeCompare(t.document.path):t.recency-e.recency:a-i}).map(({document:e,score:t,signals:n})=>({document:e,score:t,signals:n}))}function cge(e){return e.created.length>0||e.packSkills?.some(e=>e.pending)===!0||e.requiredPlugins?.some(e=>e.pending)===!0}const lge=/^[A-Za-z0-9._-]+$/,uge=/^(?:\d{1,3}\.){3}\d{1,3}$/;var m9=class extends Error{constructor(e){super(e),this.name=`InvalidShareUrlError`}};function dge(e,t=0){if(g9(t,!0),t===0)return mge(e);if(e.length>2985)throw new m9(`Share URL exceeds the v2 URL size limit`);pge(h9(e),t);let n=new TextEncoder().encode(e);if(n.length>2985)throw new m9(`Share URL exceeds the v2 URL size limit`);let r=new Uint8Array(3+n.length);if(r[0]=2,r[1]=t>>>8,r[2]=t&255,r.set(n,3),r.length>2988)throw new m9(`Share payload exceeds the v2 size limit`);let i=S9(r);if(i.length>3984)throw new m9(`Share token exceeds the v2 size limit`);return i}function h9(e){if(!e.startsWith(`https://`))throw new m9(`Share URL must use canonical HTTPS spelling`);if(e.includes(`?`)||e.includes(`#`))throw new m9(`Share URL cannot contain a query or fragment`);let t=e.slice(8),n=t.indexOf(`/`);if(n<=0)throw new m9(`Share URL is missing its repository path`);let r=t.slice(0,n);_9(r);let i=t.slice(n+1).split(`/`);if(i.length<4||i.some(e=>e.length===0))throw new m9(`Share URL has an invalid path shape`);let[a,o,s,c,...l]=i;if(s!==`blob`&&s!==`tree`)throw new m9(`Share URL has an unsupported repository path shape`);let u=v9(a,`owner`),d=v9(o,`repository`),f=hge(c),p=l.map(e=>gge(e,`target`)),m=s===`blob`?`doc`:`folder`;if(m===`doc`&&p.length===0)throw new m9(`Document share URL is missing its target path`);let h={host:r,owner:u,repo:d,branch:f,kind:m,targetSegments:p};if(fge(h)!==e)throw new m9(`Share URL is not canonically serialized`);return h}function fge(e){if(_9(e.host),x9(e.owner,`owner`),x9(e.repo,`repository`),!W4(e.branch))throw new m9(`Share URL branch is invalid`);if(e.kind!==`doc`&&e.kind!==`folder`)throw new m9(`Share URL target kind is invalid`);if(e.kind===`doc`&&e.targetSegments.length===0)throw new m9(`Document share URL is missing its target path`);for(let t of e.targetSegments)b9(t,`target`);let t=e.kind===`doc`?`blob`:`tree`,n=[encodeURIComponent(e.owner),encodeURIComponent(e.repo),t,encodeURIComponent(e.branch),...e.targetSegments.map(e=>encodeURIComponent(e))];return`https://${e.host}/${n.join(`/`)}`}function pge(e,t){if(g9(t,!1),t>e.targetSegments.length)throw new m9(`Content root depth exceeds the repository target path`);let n=e.targetSegments.slice(t).join(`/`);if(e.kind===`doc`){if(n.length===0)throw new m9(`Document share target cannot be the content root`);return{kind:`doc`,docPath:n}}return{kind:`folder`,folderPath:n}}function mge(e){let t=new TextEncoder().encode(e),n=new Uint8Array(1+t.length);return n[0]=1,n.set(t,1),S9(n)}function g9(e,t){if(!Number.isInteger(e)||e<+!t||e>65535)throw new m9(`Content root depth is invalid`)}function _9(e){if(e.length===0||e.length>253||e.endsWith(`.`)||e!==e.toLowerCase()||uge.test(e))throw new m9(`Share URL host is not canonical`);if(e.split(`.`).some(e=>e.length===0||e.length>63||!/^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/.test(e)))throw new m9(`Share URL host is not a DNS name`);if(A0(e)!==e)throw new m9(`Share URL host is not a canonical GitHub host`)}function hge(e){let t=y9(e,`branch`);if(!W4(t))throw new m9(`Share URL branch is invalid`);return t}function gge(e,t){let n=y9(e,t);return b9(n,t),n}function v9(e,t){let n=y9(e,t);return x9(n,t),n}function y9(e,t){let n;try{n=decodeURIComponent(e)}catch{throw new m9(`Share URL ${t} has malformed percent encoding`)}if(encodeURIComponent(n)!==e)throw new m9(`Share URL ${t} is not canonically encoded`);return n}function b9(e,t){if(e.length===0||e===`.`||e===`..`||e.toLowerCase()===`.git`||e.includes(`/`)||e.includes(`\\`)||_ge(e))throw new m9(`Share URL ${t} component is invalid`)}function x9(e,t){if(b9(e,t),!lge.test(e)||e.startsWith(`-`))throw new m9(`Share URL ${t} component is invalid`)}function _ge(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n<=31||n===127)return!0}return!1}function S9(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}const C9=Symbol.for(`@inkeep/open-knowledge/skill-state-field-registry`),w9=globalThis;w9[C9]===void 0&&(w9[C9]=nr());const T9=w9[C9],vge=[`.ok`,`skill-state.yml`],yge=[`claude-cowork`,`cli-hosts`],bge=[`server-build-and-open`,`electron-build-and-open`,`cli-npx-skills-add`,`desktop-direct`,`cli-start`],E9=/^\d+\.\d+\.\d+(?:[-+][\w.-]+)?$/,D9=eo({version:M().regex(E9,`version must match /^\\d+\\.\\d+\\.\\d+(?:[-+][\\w.-]+)?$/`).register(T9,{description:`Recorded skill version for this target.`}),recordedAt:Ki().register(T9,{description:`ISO 8601 timestamp of the most recent successful write. Updated on every write, including reinstalls of the same version.`}),surface:L(bge).register(T9,{description:`Install-source surface that recorded this entry.`}).optional()}),xge=eo({enabled:P().register(T9,{description:`Whether this user-global skill bundle is opted in.`}),decidedAt:Ki().register(T9,{description:`ISO 8601 timestamp of the opt-in / opt-out decision.`})}),Sge=eo({schema:R(1).register(T9,{description:`Schema major version. Bumped only on breaking shape changes.`}),targets:eo({"claude-cowork":D9.optional(),"cli-hosts":D9.optional()}).register(T9,{description:`Per-target install-state entries. Absent target = no recorded install.`}).default({}),bundles:oo(M(),xge).register(T9,{description:`Per-bundle opt-in decisions keyed by install name. Absent key = no recorded decision.`}).optional(),installsReported:F(M()).register(T9,{description:"Skill installs already reported to skills.sh from this machine, as `<owner/repo>#<skill>`. Append-only; presence suppresses a re-report."}).optional()});function Cge(e,t){return e??t.installedOnDisk}function wge(){return{schema:1,targets:{}}}const O9=`template`;function k9(e){if(e.trim()===``)return{};let t;try{t=(0,Bc.parse)(e)}catch{return{}}return typeof t!=`object`||!t||Array.isArray(t)?{}:t}function A9(e,t){return e.trim()===``?t:`---\n${e}\n---\n${t}`}function Tge(e){let{frontmatter:t,body:n}=Xc(e);return t===``?{docFrontmatterText:``,markdown:e}:{docFrontmatterText:Qc(t),markdown:n}}function Ege(e){let t=e.split(`
|
|
544
544
|
`);if(!(t[0]??``).startsWith(`template:`))return null;let n=[t[0]??``],r=1;for(;r<t.length;){let e=t[r]??``;if(/^[ \t]/.test(e)){n.push(e),r++;continue}if(e.trim()===``){let i=r+1;for(;i<t.length&&(t[i]??``).trim()===``;)i++;if(i<t.length&&/^[ \t]/.test(t[i]??``)){n.push(e),r++;continue}}break}let i=k9(n.join(`
|
|
545
545
|
`))[O9];return{identity:typeof i==`object`&&i&&!Array.isArray(i)?i:{},docFrontmatterText:t.slice(r).join(`
|
|
546
546
|
`).replace(/\n+$/,``)}}function j9(e){let t=e.charCodeAt(0)===65279?e.slice(1):e,{frontmatter:n,body:r}=Xc(t);if(n===``)return{identity:{},starterContent:t};let i=Qc(n),a=Ege(i);if(a)return{identity:a.identity,starterContent:A9(a.docFrontmatterText,r)};let{frontmatter:o}=Xc(r);if(o!==``)return{identity:k9(i),starterContent:r};let s=k9(i);return typeof s.title==`string`?{identity:s,starterContent:r}:{identity:{},starterContent:A9(i,r)}}function Dge(e,t){let{docFrontmatterText:n,markdown:r}=Tge(t),i={};for(let[t,n]of Object.entries(e))n!==void 0&&(i[t]=n);let a=(0,Bc.stringify)({[O9]:i});return`---\n${n.trim()===``?a:`${a}${n}\n`}---\n${r}`}function Oge(e){return j9(e).starterContent}const M9=e=>e*8+4;M9(92),M9(40);const kge=/^(#{1,6})\s+(.+)$/;function Age(e,t){let n=(e.endsWith(`\r`)?e.slice(0,-1):e).match(kge);if(!n)return null;let r=n[2].trim(),i=xde(r,t);return i?{level:n[1].length,text:r,slug:i}:null}Array.from({length:256},(e,t)=>(t+256).toString(16).slice(1));const jge={fileSystem:`File System`,gitUpstream:`Git (upstream)`,service:`OpenKnowledge (service)`,generator:`OpenKnowledge (generated)`},Mge=[`#D97757`,`#1B1912`,`#F9F3E9`,`#7A9DFF`,`#8534F3`,`#9663F0`,`#727CF3`],Nge={claude:`#D97757`,cursor:`#1B1912`,windsurf:`#0B100F`,openai:`#7A9DFF`,github:`#8534F3`,cline:`#9663F0`,bot:`#727CF3`};function Pge(e,t=Mge){let n=0;for(let t of e)n=(n<<5)-n+t.charCodeAt(0)|0;return t[Math.abs(n)%t.length]}const Fge={"claude-code":`claude`,"claude-ai":`claude`,cursor:`cursor`,"cursor-vscode":`cursor`,cascade:`windsurf`,codex:`openai`,"codex-mcp-client":`openai`,copilot:`github`,cline:`cline`,"claude-acp":`claude`,"codex-acp":`openai`,"github-copilot-cli":`github`};function N9(e){return e?Fge[e]||(e.startsWith(`local-agent-mode-`)?`claude`:`bot`):`bot`}const Ige={claude:`Claude`,cursor:`Cursor`,windsurf:`Windsurf`,openai:`Codex`,github:`Copilot`,cline:`Cline`};function Lge(e){let t=e?.trim();return t?Ige[N9(t)]??t:`Agent`}function P9(e){if(!e.includes(`%`))return e;let t;try{t=decodeURIComponent(e)}catch{return e}return t===`.`||t===`..`||t.includes(`/`)||t.includes(`\\`)||t.includes(`\0`)?e:t}function F9(e){return e===`.`||e===`..`?e:encodeURIComponent(e).replace(/[!'()*]/g,e=>`%${e.codePointAt(0)?.toString(16).toUpperCase()}`)}function Rge(e){return e.split(`/`).map(F9).join(`/`)}function I9(e){return e.split(`/`).map(P9).join(`/`)}function L9(e,t){let n=e.trim();if(!n||/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n)||n.startsWith(`//`)||n.startsWith(`#`))return null;let r=n.indexOf(`#`),i=r>=0?n.slice(0,r):n,a=r>=0?n.slice(r+1):null,o=(i.split(`?`)[0]??``).trim();if(!o)return null;let s=P9(o.split(`/`).pop()??``).match(/\.([a-z0-9]+)$/i);if(s){let e=`.${(s[1]??``).toLowerCase()}`;if(!w0.includes(e))return null}let c=o.startsWith(`/`),l=c?o.slice(1):o,u=c?[]:t.includes(`/`)?t.split(`/`).slice(0,-1):[],d=l.split(`/`),f=d.length-1;for(let e=0;e<d.length;e++){let t=P9(d[e]??``);if(e===f&&(t=yl(t)),t===`..`){if(u.length===0)return null;u.pop()}else t!==`.`&&t!==``&&u.push(t)}return u.length===0?null:{docName:u.join(`/`),anchor:a||null}}function zge(e){throw Error(`Unhandled ClassifiedLinkTarget variant: ${JSON.stringify(e)}`)}const R9=/^[a-zA-Z][a-zA-Z\d+\-.]*:/;function z9(e){let t=(e.split(/[?#]/)[0]??e).match(/\.([a-z0-9]+)$/i);return t?(t[1]??``).toLowerCase():null}function B9(e){let t=e.trim();return R9.test(t)||t.startsWith(`//`)}function Bge(e,t){let n=e.trim();if(!n)return null;if(n.startsWith(`#`)){let e=n.slice(1).trim();return e?{kind:`anchor`,anchor:e}:null}if(B9(n))return{kind:`external`,url:n};let r=n.indexOf(`#`),i=I9(r<0?n:n.slice(0,r)),a=wl(i,t);if(a)return{kind:`doc`,docName:a,anchor:r<0?null:n.slice(r+1)};let o=Cl(i,t);if(o)return{kind:`doc`,docName:o,anchor:r<0?null:n.slice(r+1)};let s=L9(n,t);if(s)return{kind:`doc`,docName:s.docName,anchor:s.anchor};let c=z9(i);return c&&c!==`md`&&c!==`mdx`?{kind:`asset`,url:n,ext:c,literal:!1}:null}function V9(e,t){let n=e.trim();if(!n)return null;if(B9(n))return{kind:`external`,url:t?`${n}#${t}`:n};let r=z9(n);return r&&r!==`md`&&r!==`mdx`?{kind:`asset`,url:n,ext:r,literal:!0}:{kind:`doc`,docName:n,anchor:t?.trim()||null}}function Vge(e,t,n){let r=e.trim();if(!r||R9.test(r)||r.startsWith(`//`)||r.startsWith(`#`))return null;let i=r.indexOf(`#`),a=((i>=0?r.slice(0,i):r).split(`?`)[0]??``).trim();if(!a)return null;let o=a.startsWith(`/`),s=o?a.slice(1):a,c=o?[]:t.includes(`/`)?t.split(`/`).slice(0,-1):[];for(let e of s.split(`/`))if(e===`..`){if(c.length===0)return null;c.pop()}else e!==`.`&&e!==``&&c.push(n.literal?e:P9(e));return c.length===0?null:c.join(`/`)}function H9(e){let t=e;return t.startsWith(`./`)&&(t=t.slice(2)),t.startsWith(`/`)&&(t=t.slice(1)),t}function U9(e){let t=e.lastIndexOf(`/`);return t===-1?e:e.slice(t+1)}function W9(e){let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)}function G9(e){return e.split(`/`).filter(e=>e!==``)}function Hge(e,t){let n=W9(t);return e===``||n===e||n.startsWith(`${e}/`)}function K9(e,t){let n=W9(t);if(e===n)return 0;let r=e===``?n:n.slice(e.length+1);return r===``?0:G9(r).length}function q9(e,t){let n=G9(e),r=G9(t),i=0;for(;i<n.length&&i<r.length&&n[i]===r[i];)i++;return n.length-i+(r.length-i)}function Uge(){let e=new Map;function t(t){let n=H9(t);if(n===``)return;let r=U9(n);if(r===``)return;let i=r.toLowerCase(),a=e.get(i);if(!a){e.set(i,[n]);return}a.includes(n)||a.push(n)}function n(t){let n=H9(t),r=U9(n).toLowerCase(),i=e.get(r);if(!i)return;let a=i.indexOf(n);a!==-1&&(i.splice(a,1),i.length===0&&e.delete(r))}function r(e,r){n(e),t(r)}function i(t,n){let r=t.toLowerCase(),i=e.get(r);if(!i||i.length===0)return null;if(i.length===1)return i[0];let a=W9(H9(n)),o=[],s=[];for(let e of i)Hge(a,e)?o.push(e):s.push(e);return o.length>0?(e=>{let t=e[0],n=K9(a,t);for(let r=1;r<e.length;r++){let i=e[r],o=K9(a,i);(o<n||o===n&&i<t)&&(t=i,n=o)}return t})(o):(e=>{let t=e[0],n=q9(a,W9(t));for(let r=1;r<e.length;r++){let i=e[r],o=q9(a,W9(i));(o<n||o===n&&i<t)&&(t=i,n=o)}return t})(s)}function a(){let t=new Map;for(let[n,r]of e)t.set(n,[...r]);return t}function o(){e.clear()}return{add:t,remove:n,rename:r,resolveEmbed:i,clear:o,snapshot:a,size:()=>e.size}}const J9=`unknown`;function Wge(e,t=Date.now()){let n=Date.parse(e);if(!Number.isFinite(n))return J9;let r=Math.floor(Math.max(0,t-n)/1e3);if(r<60)return`${r}s ago`;let i=Math.floor(r/60);if(i<60)return`${i}m ago`;let a=Math.floor(i/60);return a<24?`${a}h ago`:`${Math.floor(a/24)}d ago`}function Gge(e){if(!e)return[];let t=e.split(`/`),n=[],r=``;for(let e of t)r=r?`${r}/${e}`:e,n.push(r);return n}function Kge(e,t){if(e.size===0)return new Set;if(t===``)return new Set(e);let n=new Set,r=`${t}/`;for(let i of e)(i===t||i.startsWith(r))&&n.add(i);return n}function Y9(e){let t=e?.trim();return t===void 0||t===``?void 0:t}function qge(e){return e.reason!==void 0||Y9(e.note)!==void 0||Y9(e.email)!==void 0}function Jge(e){let t;try{t=new URL(e)}catch{return null}if(t.protocol===`https:`)return t;let n=t.hostname===`localhost`||t.hostname===`127.0.0.1`||t.hostname===`[::1]`;return t.protocol===`http:`&&n?t:null}function Yge(){return Jge((typeof process>`u`?void 0:Y9(process.env?.OK_FEEDBACK_INTAKE_ORIGIN))??`https://openknowledge.ai`)}function Xge(e){let t=Y9(e);if(t!==void 0)return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)?t:void 0}async function X9(e,t,n){try{let r=await fetch(e,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t),signal:AbortSignal.timeout(n)});if(r.ok){let e=await r.json().catch(()=>null);return{ok:!0,reference:typeof e?.reference==`string`?e.reference:``}}return r.status===400||r.status===413?{ok:!1,reason:`invalid`}:r.status===503?{ok:!1,reason:`unavailable`}:{ok:!1,reason:`error`}}catch(e){return{ok:!1,reason:e instanceof Error&&(e.name===`TimeoutError`||e.name===`AbortError`)?`timeout`:`error`}}}async function Zge(e,t={}){let n=Yge();if(n===null)return{ok:!1,reason:`error`};let r=new URL(`/api/feedback`,n),i=Y9(e.note),a=Xge(e.email),o={kind:`uninstall`,reasons:e.reason===void 0?[]:[e.reason],...i===void 0?{}:{message:i},appVersion:e.appVersion,platform:e.platform,source:e.source},s=Date.now()+(t.timeoutMs??4e3),c=()=>s-Date.now();if(a===void 0)return X9(r,o,c());let l=await X9(r,{...o,email:a},c());return l.ok||l.reason!==`invalid`||c()<=0?l:X9(r,o,c())}function Z9(e){return`pagesBySlug`in e}function Qge(e){return Z9(e)?e.pages:e}function $ge(e,t){return Z9(e)?e.assetPaths??new Set:t??new Set}function e_e(e,t){return Z9(e)?e.filePaths??new Set:t??new Set}function Q9(e,t){return e<t?-1:+(e>t)}function t_e(e,t){let n=new Map;for(let r of e){let e=t(r);e&&!n.has(e)&&n.set(e,r)}return n}function n_e(e,t){let n=new Map,r=[...e].sort(Q9);for(let e of r){let r=e.lastIndexOf(`/`),i=t(r===-1?e:e.slice(r+1));i&&!n.has(i)&&n.set(i,e)}return n}function r_e(e,t){let n=y7(e);if(n){if(Z9(t))return t.pagesBySlug.get(n);for(let e of t)if(y7(e)===n)return e}}function i_e(e,t){if(e.includes(`/`))return;let n=y7(e);if(!n)return;if(Z9(t))return t.pagesByBasename?.get(n);let r;for(let e of t){let t=e.lastIndexOf(`/`);y7(t===-1?e:e.slice(t+1))===n&&(r===void 0||Q9(e,r)<0)&&(r=e)}return r}function a_e(e){let t=e.trim();if(!t)return[];let n=y7(t);return n.length>0&&n!==t?[n]:[]}function $9(e,t){let n=e.trim();if(!n)return;let r=Qge(t);if(r.has(n))return n;let i=r_e(n,t);if(i)return i;for(let e of a_e(n))if(r.has(e))return e;return o_e(n,r)||i_e(n,t)}function o_e(e,t){let n=`${e}/index`;if(t.has(n))return n;let r=e.lastIndexOf(`/`),i=r===-1?e:e.slice(r+1),a=i?`${e}/${i}`:null;if(a&&t.has(a))return a}function s_e(e){let t=((e.trim().split(`#`)[0]??``).trim().split(`?`)[0]??``).trim();return t.startsWith(`/`)?t.slice(1):t}function c_e(e,t,n){let r=s_e(e);if(!r)return null;let i=r.toLowerCase(),a=n?[t,n]:[t];for(let e of a){if(e.has(r))return r;for(let t of e)if(t.toLowerCase()===i)return t}if(r.includes(`/`))return null;let o=[];for(let e of a)for(let t of e){let e=t.lastIndexOf(`/`);(e===-1?t:t.slice(e+1)).toLowerCase()===i&&o.push(t)}return o.length===0?null:o.sort(Q9)[0]??null}function l_e(e,t,n){let r=V9(e,t);return r===null||r.kind!==`asset`||c_e(r.url,$ge(n),e_e(n))!==null||$9(e,n)===void 0?r:{kind:`doc`,docName:e.trim(),anchor:t?.trim()||null}}const u_e=new gle({extensions:a4,deriveStructuralFreshness:!0}),d_e=XS(a4);export{v5 as $,NX as $a,ll as $c,ede as $i,xs as $l,_he as $n,z0 as $o,fhe as $r,id as $s,_3 as $t,re as $u,Phe as A,_8 as Aa,Bu as Ac,Eme as Ai,El as Al,a7 as An,Yue as Ao,dhe as Ar,y7 as As,ome as At,Zt as Au,a3 as B,cQ as Ba,Eu as Bc,Tpe as Bi,bu as Bl,yge as Bn,QQ as Bo,Jme as Br,Dd as Bs,wfe as Bt,ce as Bu,vQ as C,oQ as Ca,Pf as Cc,jme as Ci,Bl as Cl,u3 as Cn,w4 as Co,Qme as Cr,b8 as Cs,k7 as Ct,Ja as Cu,Nhe as D,q1 as Da,Nf as Dc,yme as Di,el as Dl,f1 as Dn,M0 as Do,ehe as Dr,Kge as Ds,Efe as Dt,Wi as Du,g5 as E,J1 as Ea,Iu as Ec,Tme as Ei,vl as El,J9 as En,O5 as Eo,$me as Er,iZ as Es,bfe as Et,Ki as Eu,Q7 as F,I9 as Fa,Lte as Fc,Qfe as Fi,wl as Fl,Ope as Fn,wue as Fo,Che as Fr,IH as Fs,k0 as Ft,Qe as Fu,Qde as G,o7 as Ga,Du as Gc,h3 as Gi,zc as Gl,gfe as Gn,h9 as Go,Vme as Gr,Ef as Gs,Zue as Gt,x as Gu,Hde as H,Lge as Ha,xu as Hc,D0 as Hi,Nl as Hl,w0 as Hn,J8 as Ho,Rme as Hr,jte as Hs,zue as Ht,y as Hu,Z7 as I,t1 as Ia,Ete as Ic,Xfe as Ii,Kl as Il,Dae as In,hde as Io,ohe as Ir,tH as Is,T0 as It,ke as Iu,dpe as J,wge as Ja,sl as Jc,G5 as Ji,ps as Jl,jpe as Jn,j9 as Jo,Hme as Jr,wf as Js,Nfe as Jt,T as Ju,ppe as K,T3 as Ka,Cu as Kc,que as Ki,hs as Kl,_fe as Kn,o4 as Ko,hhe as Kr,Df as Ks,Hfe as Kt,ne as Ku,Y7 as L,pde as La,Wf as Lc,Zfe as Li,tl as Ll,G7 as Ln,DQ as Lo,W7 as Lr,Vh as Ls,dfe as Lt,_e as Lu,Mhe as M,m8 as Ma,Kte as Mc,xme as Mi,Yl as Ml,Spe as Mn,cme as Mo,whe as Mr,qhe as Ms,w3 as Mt,nt as Mu,X7 as N,a9 as Na,Hte as Nc,Sme as Ni,Zc as Nl,Sfe as Nn,Tle as No,Ahe as Nr,b4 as Ns,m9 as Nt,it as Nu,Lhe as O,fde as Oa,Kd as Oc,Cme as Oi,Ol,l1 as On,P$ as Oo,the as Or,_Q as Os,x3 as Ot,vr as Ou,$7 as P,Uhe as Pa,Bte as Pc,bme as Pi,xl as Pl,Dpe as Pn,W4 as Po,ahe as Pr,mde as Ps,b7 as Pt,ot as Pu,d5 as Q,fme as Qa,ul as Qc,YZ as Qi,gs as Ql,Ipe as Qn,Zge as Qo,lhe as Qr,kf as Qs,Vfe as Qt,E as Qu,m1 as R,E$ as Ra,Lf as Rc,Yfe as Ri,kl as Rl,Ome as Rn,x8 as Ro,Gme as Rr,B as Rs,j7 as Rt,j as Ru,n3 as S,Dge as Sa,bd as Sc,O9 as Si,Fl as Sl,Xde as Sn,$ue as So,Zme as Sr,CQ as Ss,Uue as St,no as Su,Y5 as T,Ame as Ta,wd as Tc,pme as Ti,yu as Tl,Jde as Tn,y0 as To,rhe as Tr,cde as Ts,yfe as Tt,xa as Tu,afe as U,WQ as Ua,wu as Uc,H0 as Ui,Qc as Ul,_5 as Un,l8 as Uo,zme as Ur,Ff as Us,t7 as Ut,ae as Uu,Vde as V,p4 as Va,Tu as Vc,Epe as Vi,Xc as Vl,E9 as Vn,C$ as Vo,Kme as Vr,Rte as Vs,Wue as Vt,v as Vu,T7 as W,wQ as Wa,Ou as Wc,g3 as Wi,il as Wl,jge as Wn,qQ as Wo,Bme as Wr,ad as Ws,Jue as Wt,b as Wu,O0 as X,F9 as Xa,dl as Xc,T$ as Xi,bo as Xl,Npe as Xn,cge as Xo,z7 as Xr,Sf as Xs,Ffe as Xt,ee as Xu,fpe as Y,Rge as Ya,fl as Yc,xfe as Yi,ss as Yl,Mpe as Yn,XQ as Yo,Ume as Yr,Cf as Ys,Pfe as Yt,te as Yu,gue as Z,dge as Za,cl as Zc,o0 as Zi,ute as Zl,Ppe as Zn,gZ as Zo,Sge as Zr,ed as Zs,Bfe as Zt,oe as Zu,vue as _,V9 as _a,Fte as _c,Jpe as _i,_l,B0 as _n,N9 as _o,o3 as _r,Y1 as _s,cfe as _t,I as _u,qfe as a,AZ as aa,Ute as ac,The as ai,zl as al,Vue as an,Cle as ao,rme as ar,Pde as as,Yde as at,L as au,ife as b,Q$ as ba,tp as bc,Gpe as bi,qc as bl,_pe as bn,K4 as bo,Yme as br,oge as bs,s7 as bt,oo as bu,Bde as c,nZ as ca,zf as cc,Dhe as ci,Jl as cl,epe as cn,d0 as co,l3 as cr,b0 as cs,hpe as ct,F as cu,xue as d,SZ as da,Gd as dc,v3 as di,iu as dl,N5 as dn,kle as do,P4 as dr,c0 as ds,mfe as dt,ro as du,JZ as ea,Cd as ec,w as ed,mhe as ei,Wc as el,Lfe as en,Gge as eo,xhe as er,Nde as es,V0 as et,wte as eu,Aue as f,g7 as fa,Mf as fc,kfe as fi,lu as fl,k5 as fn,x7 as fo,N4 as fr,L9 as fs,upe as ft,Va as fu,Oue as g,L0 as ga,Vte as gc,Upe as gi,du as gl,R0 as gn,Aae as go,U4 as gr,$9 as gs,vme as gt,N as gu,yue as h,Bge as ha,Ite as hc,Wpe as hi,nu as hl,O$ as hn,qge as ho,V4 as hr,l_e as hs,_me as ht,eo as hu,q5 as i,Tue as ia,Wte as ic,che as ii,hl as il,Mfe as in,dde as io,F7 as ir,nde as is,wpe as it,lo as iu,Fhe as j,LQ as ja,Lu as jc,Dme as ji,_u as jl,xpe as jn,Xue as jo,Mme as jr,e$ as js,ope as jt,et as ju,Ihe as k,Uge as ka,mf as kc,wme as ki,Ml as kl,r7 as kn,C4 as ko,nhe as kr,Lue as ks,ime as kt,zn as ku,bue as l,n_e as la,Tte as lc,Ohe as li,ol as ll,$fe as ln,Wge as lo,M4 as lr,Vge as ls,gpe as lt,P as lu,Pue as m,$4 as ma,ff as mc,qpe as mi,tu as ml,Tfe as mn,t4 as mo,R4 as mr,S0 as ms,gme as mt,R as mu,d_e as n,zge as na,rd as nc,Ime as ni,pl as nl,zfe as nn,U1 as no,$pe as nr,Oae as ns,Ofe as nt,xo as nu,Jfe as o,v4 as oa,zte as oc,Ehe as oi,Rl as ol,ipe as on,gde as oo,Zpe as or,w7 as os,tfe as ot,Wa as ou,jue as p,C0 as pa,pf as pc,Xpe as pi,au as pl,j0 as pn,ooe as po,z4 as pr,b3 as ps,X1 as pt,io as pu,mpe as q,RX as qa,Pl as qc,Kue as qi,ms as ql,Fpe as qn,E3 as qo,ghe as qr,jd as qs,Ufe as qt,S as qu,Nge as r,p3 as ra,nd as rc,she as ri,ml as rl,Afe as rn,o$ as ro,eme as rr,tde as rs,Cpe as rt,za as ru,Fde as s,g4 as sa,Td as sc,Lme as si,ql as sl,npe as sn,a5 as so,bhe as sr,rde as ss,efe as st,Ka as su,u_e as t,gQ as ta,ip as tc,Fme as ti,bl as tl,Ife as tn,u4 as to,Qpe as tr,dQ as ts,E0 as tt,dte as tu,kue as u,t_e as ua,Gte as uc,spe as ui,ru as ul,ape as un,YQ as uo,j4 as ur,Cge as us,zX as ut,vo as uu,Due as v,h1 as va,Wu as vc,Ype as vi,Gl as vl,p1 as vn,x0 as vo,s3 as vr,ode as vs,Fue as vt,uo as vu,n$ as w,sQ as wa,qf as wc,hme as wi,mu as wl,m3 as wn,e3 as wo,ihe as wr,HQ as ws,hfe as wt,Ca as wu,rfe as x,m5 as xa,jf as xc,Kpe as xi,gl as xl,Zde as xn,B9 as xo,Xme as xr,_ue as xs,Hue as xt,M as xu,d3 as y,Pge as ya,Sd as yc,Hpe as yi,pu as yl,ype as yn,Oge as yo,Wme as yr,Age as ys,Iue as yt,yo as yu,r3 as z,u0 as za,Rf as zc,qde as zi,vu as zl,vge as zn,f0 as zo,qme as zr,td as zs,Cfe as zt,D as zu};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{to as e}from"./dist-
|
|
1
|
+
import{to as e}from"./dist-CmS0s3u8.mjs";import{execFile as t}from"node:child_process";const n=new Set([`http:`,`https:`]),r=/[\u0000-\u0020\u007F-\u009F"'`\\&|<>^()$;{}[\]*?!~]/;function i(e,t){console.warn(`Could not auto-open browser (${t}); visit ${e} manually`)}function a(a){let o;try{o=new URL(a)}catch{i(a,`invalid URL`);return}if(!n.has(o.protocol)){i(a,`unsupported scheme '${o.protocol}'`);return}if(r.test(a)){i(a,`URL contains unsafe characters`);return}let s=process.platform===`darwin`?`open`:process.platform===`win32`?`cmd`:`xdg-open`,c=process.platform===`win32`?[`/c`,`start`,``,a]:[a];t(s,c,e({}),e=>{e&&console.warn(`Could not auto-open browser (${e.message}); visit ${a} manually`)})}export{a as openBrowser};
|
package/dist/parse-worker.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./md-manager-BGnqyqi1-
|
|
1
|
+
import{t as e}from"./md-manager-BGnqyqi1-Dg5Bl9Rs.mjs";import{parentPort as t}from"node:worker_threads";function n(t){try{let n,r;if(t.embedTable!==void 0&&t.sourcePath!==void 0){let e=t.embedTable;r={sourcePath:t.sourcePath,resolveEmbed:t=>e[t]?.path??null,...t.wantSizes?{resolveSize:t=>e[t]?.size??null}:{}}}else if(t.recordEmbeds&&t.sourcePath!==void 0){let e=new Set;n=e,r={sourcePath:t.sourcePath,resolveEmbed:t=>(e.add(t),null),...t.wantSizes?{resolveSize:t=>(e.add(t),null)}:{}}}let i=e.parseWithFallback(t.body,r);return n!==void 0&&n.size>0?{id:t.id,ok:!0,parsedJson:i,requestedTargets:[...n]}:{id:t.id,ok:!0,parsedJson:i}}catch(e){return{id:t.id,ok:!1,message:e instanceof Error?e.message.slice(0,500):String(e).slice(0,500)}}}t?.on(`message`,e=>{t?.postMessage(n(e))});export{};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{yn as e}from"./dist-
|
|
1
|
+
import{yn as e}from"./dist-CmS0s3u8.mjs";import"./constants-Deih7i0K.mjs";import{join as t,relative as n}from"node:path";import{existsSync as r,lstatSync as i,readdirSync as a,realpathSync as o,statSync as s}from"node:fs";function c(r){let{projectDir:c,contentDir:l,sampleCap:u=5}=r,d=[],f=[];try{i(l)}catch(e){return{totalCount:0,sample:[],contentDir:l,warnings:[`cannot access content directory ${l}: ${e instanceof Error?e.message:String(e)}`]}}let p;try{p=e({projectDir:c,contentDir:l})}catch(e){return{totalCount:0,sample:[],contentDir:l,warnings:[e instanceof Error?e.message:String(e)]}}function m(e){let r;try{r=a(e,{withFileTypes:!0})}catch(t){let r=t instanceof Error?t.message:String(t);d.push(`could not read directory ${n(l,e)||`.`}: ${r}`);return}for(let i of r){let r=t(e,i.name);if(i.isSymbolicLink()){let e;try{e=o(r)}catch(e){let t=e.code;t===`ENOENT`||t===`ELOOP`?d.push(`broken or cyclic symlink: ${n(l,r)}`):d.push(`cannot resolve symlink ${n(l,r)}: ${t??`unknown error`}`);continue}let t;try{t=s(e)}catch{continue}if(t.isDirectory()){let e=n(l,r);if(p.isDirExcluded(e))continue;m(r)}else if(t.isFile()){let e=n(l,r);if(p.isExcluded(e))continue;f.push(e)}}else if(i.isDirectory()){let e=n(l,r);if(p.isDirExcluded(e))continue;m(r)}else if(i.isFile()){let e=n(l,r);if(p.isExcluded(e))continue;f.push(e)}}}return m(l),{totalCount:f.length,sample:f.slice(0,u),contentDir:l,warnings:d}}function l(e,i){let a=[],o=n(i,e.contentDir),s=o===``?`./`:`./${o}`;if(a.push(`Content:`),a.push(` Found ${e.totalCount} markdown files in ${s}`),e.sample.length>0){let t=e.sample.join(`, `),n=e.totalCount>e.sample.length?`, …`:``;a.push(` Sample: ${t}${n}`)}if(e.warnings.length>0)for(let t of e.warnings)a.push(` Warning: ${t}`);a.push(``);let c=t(i,`.ok`,`config.yml`);return r(c)?(a.push(` To adjust scope, add patterns to .okignore at the project root.`),a.push(` To change the content root, edit .ok/config.yml → content.dir.`)):a.push(" Run `open-knowledge init` to scaffold config + .okignore."),a.push(``),a.push(` Re-check anytime: open-knowledge preview`),a.join(`
|
|
2
2
|
`)}export{c as n,l as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./preview-BqDHlB4I.mjs";export{t as formatPreviewBlock,e as previewContent};
|