@inkeep/open-knowledge 0.82.0-beta.4 → 0.82.0-beta.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/dist/cli.mjs +6 -6
  2. package/dist/constants-XnWqV4Vc.mjs +1 -0
  3. package/dist/{dist-DdoZ294B.mjs → dist-BKMK4uhh.mjs} +224 -224
  4. package/dist/{dist-C1WwDYOU.mjs → dist-DX-OB6FC.mjs} +1 -1
  5. package/dist/index.mjs +4 -4
  6. package/dist/{init-vgeY_wHD.mjs → init-B7ME996h.mjs} +2 -2
  7. package/dist/init-CDxbkled.mjs +1 -0
  8. package/dist/{launch-json-removal-D4FuJ2Te.mjs → launch-json-removal-5MtEDUfZ.mjs} +1 -1
  9. package/dist/{loader-DYbtvtxH.mjs → loader-BoqyLvip.mjs} +1 -1
  10. package/dist/loader-BsEpZN_6.mjs +1 -0
  11. package/dist/{md-manager-BGnqyqi1-D77IwxHB.mjs → md-manager-BGnqyqi1-CnT_8Ivp.mjs} +2 -2
  12. package/dist/{open-browser-Dg3gcrHM.mjs → open-browser-CuuJWVs1.mjs} +1 -1
  13. package/dist/parse-worker.mjs +1 -1
  14. package/dist/preview-BGod3sNq.mjs +1 -0
  15. package/dist/{preview-1EGVW00C.mjs → preview-CtiRbnWp.mjs} +1 -1
  16. package/dist/public/assets/{ActivityModeContent-qim4zFx-.js → ActivityModeContent--4Immrhs.js} +1 -1
  17. package/dist/public/assets/{AddPropertiesButton-DKXiB5hC.js → AddPropertiesButton-C_rEwqQD.js} +2 -2
  18. package/dist/public/assets/{AgentDiffPane-BD8yOgrS.js → AgentDiffPane-Dx2W2mAP.js} +1 -1
  19. package/dist/public/assets/{AgentThreadClientBinder-18BD6ihn.js → AgentThreadClientBinder-BeRtMFJl.js} +1 -1
  20. package/dist/public/assets/{BugReportHistory-C2kxTgHh.js → BugReportHistory-B-6LLHxx.js} +1 -1
  21. package/dist/public/assets/{BugReportHistoryDialog-DgtiL-NP.js → BugReportHistoryDialog-CNK92-ge.js} +1 -1
  22. package/dist/public/assets/{CodeMirrorPropInput-D7ODqRwE.js → CodeMirrorPropInput-DN-_F9M9.js} +1 -1
  23. package/dist/public/assets/{ConsentDialogBody-CD7KM28d.js → ConsentDialogBody-c59kzsDd.js} +1 -1
  24. package/dist/public/assets/{DeleteConfirmationDialog-C1zIx9Bd.js → DeleteConfirmationDialog-CW-EDwBk.js} +1 -1
  25. package/dist/public/assets/{DiffViewBoundary-DGNf5H84.js → DiffViewBoundary-BCeCuRF4.js} +1 -1
  26. package/dist/public/assets/{DocumentContext-BHjfklWj.js → DocumentContext-Bcx75Zbc.js} +1 -1
  27. package/dist/public/assets/{EditorModeToggle-XKuoOdJs.js → EditorModeToggle-8NKVUEVY.js} +1 -1
  28. package/dist/public/assets/{ExcalidrawDocEditor-I2eQXX7E.js → ExcalidrawDocEditor-CawlZNgc.js} +1 -1
  29. package/dist/public/assets/FeedbackForm-CMotBE8s.js +1 -0
  30. package/dist/public/assets/{GraphPanel-nDzxbZwr.js → GraphPanel-BCNpJurX.js} +1 -1
  31. package/dist/public/assets/{ImageAttachments-Dob2zdX6.js → ImageAttachments-DaSjleMs.js} +1 -1
  32. package/dist/public/assets/{ImportSkillDialog-CU7KSDgH.js → ImportSkillDialog-DMA2fcte.js} +1 -1
  33. package/dist/public/assets/{LintConfigEditor-81_fDdG_.js → LintConfigEditor-SFkKN91W.js} +1 -1
  34. package/dist/public/assets/ManagedArtifactProperties-9j8Q5DJQ.js +1 -0
  35. package/dist/public/assets/{ManagedArtifactProperties-DTfJaeLZ.js → ManagedArtifactProperties-z2KO98iF.js} +1 -1
  36. package/dist/public/assets/{MermaidDocEditor-Dw5SypSn.js → MermaidDocEditor-xzgpWko3.js} +1 -1
  37. package/dist/public/assets/{OpenInAgentMenuItem-BMo7aLCS.js → OpenInAgentMenuItem-tMDoc20x.js} +1 -1
  38. package/dist/public/assets/{PropertyDisplayRow-Bn0kgK3p.js → PropertyDisplayRow-CmiyL5KF.js} +1 -1
  39. package/dist/public/assets/{RegisteredAgentIcon-DbL9sShX.js → RegisteredAgentIcon-XDCjRE4q.js} +1 -1
  40. package/dist/public/assets/{ReportBugDialogBody-DEETk9Jo.js → ReportBugDialogBody-bsGBQfHH.js} +1 -1
  41. package/dist/public/assets/{ReportBugMenuTrigger-B1WREGjA.js → ReportBugMenuTrigger-BAbnNfBU.js} +1 -1
  42. package/dist/public/assets/{SchemaConfigEditor-BLXTxBGL.js → SchemaConfigEditor-CAjz4zQO.js} +1 -1
  43. package/dist/public/assets/{SessionsHost-DquHUp9T.js → SessionsHost-BA2D_sVk.js} +2 -2
  44. package/dist/public/assets/{SettingsDialogBody-DKEUH63t.js → SettingsDialogBody-C3fYEUNk.js} +1 -1
  45. package/dist/public/assets/{ShareBranchSwitchDialog-BUS2my96.js → ShareBranchSwitchDialog-CPn3XsGL.js} +1 -1
  46. package/dist/public/assets/{ShareReceiveDialog-BKgD7Duc.js → ShareReceiveDialog-CavmNNtc.js} +1 -1
  47. package/dist/public/assets/{ShareReceiveMissDialog-_8dejDWk.js → ShareReceiveMissDialog-B4r0wIU4.js} +1 -1
  48. package/dist/public/assets/{SkillCostValue-CmCcSYjJ.js → SkillCostValue-CxnOdbgc.js} +1 -1
  49. package/dist/public/assets/{SkillEditBanner-DFdS9BhL.js → SkillEditBanner-DFTQUggR.js} +1 -1
  50. package/dist/public/assets/{SkillForkDialog-D5Aha7ke.js → SkillForkDialog-Bl0Maun5.js} +1 -1
  51. package/dist/public/assets/{SkillInstallMenu-Cju9gFSt.js → SkillInstallMenu-CJwxD998.js} +1 -1
  52. package/dist/public/assets/{SkillOriginInline-DPQ0UfdG.js → SkillOriginInline-Bo9-sZlU.js} +1 -1
  53. package/dist/public/assets/{SkillToolbarControls-SRsQowBm.js → SkillToolbarControls-uVyNL_64.js} +1 -1
  54. package/dist/public/assets/{SlidesToolbarControls-8Tu4pV-S.js → SlidesToolbarControls-CDqPA4DN.js} +1 -1
  55. package/dist/public/assets/{SourceEditor-DUhZs5yo.js → SourceEditor-CX49j7Xp.js} +1 -1
  56. package/dist/public/assets/{SyncStatusBadge-B9wP5KjD.js → SyncStatusBadge-DboOgDQ9.js} +1 -1
  57. package/dist/public/assets/{TerminalPanel-Db-Lo-iL.js → TerminalPanel-BAdFCbjj.js} +1 -1
  58. package/dist/public/assets/{TerminalWindowApp-CAjzSiBI.js → TerminalWindowApp-CtvchvoR.js} +1 -1
  59. package/dist/public/assets/{TextDocEditor-C7dpFdVd.js → TextDocEditor-D40u9e2b.js} +1 -1
  60. package/dist/public/assets/{ThreadView-CsZKSzs5.js → ThreadView-BQ7Pdv3D.js} +1 -1
  61. package/dist/public/assets/{TimelineDiffPane-DcChEu2J.js → TimelineDiffPane-0LJjzdxK.js} +1 -1
  62. package/dist/public/assets/{agent-connections-iuaYc-Gk.js → agent-connections-B2xlqiAt.js} +1 -1
  63. package/dist/public/assets/{auth-state-cache-Dz-Yvu70.js → auth-state-cache-D4h7Wtsx.js} +1 -1
  64. package/dist/public/assets/{bug-report-send-manager-0DIkaLj0.js → bug-report-send-manager-Ep6NupAy.js} +1 -1
  65. package/dist/public/assets/client-version-BrG_KLrG.js +1 -0
  66. package/dist/public/assets/{comment-chips-jwrddJ4n.js → comment-chips-CmN44vAB.js} +1 -1
  67. package/dist/public/assets/{config-provider-B4cgjuAt.js → config-provider-DrLzkj1A.js} +1 -1
  68. package/dist/public/assets/{css-color-to-hex-oO6GoCcb.js → css-color-to-hex-B1w0Vq2i.js} +1 -1
  69. package/dist/public/assets/{diagnostic-breadcrumb-DK-Cqae0.js → diagnostic-breadcrumb-YcMRmDMq.js} +1 -1
  70. package/dist/public/assets/{dist-CUgbgEDy.js → dist-DmvVdMAc.js} +2 -2
  71. package/dist/public/assets/{doc-paths-DaHerw67.js → doc-paths-CU5xFEmw.js} +1 -1
  72. package/dist/public/assets/{doc-undo-manager-ZAJ7EhHf.js → doc-undo-manager-_NqmbrIm.js} +1 -1
  73. package/dist/public/assets/{documents-events-AGLgPGQa.js → documents-events-DChefUoE.js} +1 -1
  74. package/dist/public/assets/{file-tree-adapter--GNP_kR2.js → file-tree-adapter-CrwKZd5V.js} +1 -1
  75. package/dist/public/assets/{file-tree-utils-lPpxK5Yq.js → file-tree-utils-B-KHAA0w.js} +1 -1
  76. package/dist/public/assets/{folder-config-api-DDOXhGdo.js → folder-config-api-y_2lDcJg.js} +1 -1
  77. package/dist/public/assets/{globals-Bx4DAP1K.css → globals-B1rEv4ky.css} +1 -1
  78. package/dist/public/assets/{index-BdhkBLck.js → index-DPl-onSV.js} +8 -8
  79. package/dist/public/assets/{lint-config-client-B_xNfTBy.js → lint-config-client-kGMpwF3X.js} +1 -1
  80. package/dist/public/assets/{markdownlint-rule-browser-DzjG_qoM.js → markdownlint-rule-browser-BZlDsCDj.js} +1 -1
  81. package/dist/public/assets/{navigation-targets-DV1dMVAb.js → navigation-targets-BX0D_UPk.js} +1 -1
  82. package/dist/public/assets/{page-list-cache-BaKlIcC-.js → page-list-cache-DRXLxcuB.js} +1 -1
  83. package/dist/public/assets/{pending-receive-nav-store-4xt56kJR.js → pending-receive-nav-store-B-YpJdeR.js} +1 -1
  84. package/dist/public/assets/{preferred-session-events-CeCXvWmc.js → preferred-session-events-B7RLIJvY.js} +1 -1
  85. package/dist/public/assets/{progress-D6YLD7xV.js → progress-CeluR2f2.js} +1 -1
  86. package/dist/public/assets/{project-paths-Cs2SPmYR.js → project-paths-Rt7fORWq.js} +1 -1
  87. package/dist/public/assets/{prop-types-Dv_cZRA5.js → prop-types-B2w_fFJW.js} +1 -1
  88. package/dist/public/assets/{receive-store-CvglCO2B.js → receive-store-VACJKx3F.js} +1 -1
  89. package/dist/public/assets/{selection-context-CDv7YpZ_.js → selection-context-Bf8Q7ytD.js} +1 -1
  90. package/dist/public/assets/{sign-in-terminal-events-BigKQgqQ.js → sign-in-terminal-events-DXTC0inU.js} +1 -1
  91. package/dist/public/assets/{skill-scope-BGcfBWlz.js → skill-scope-DX2Q9lzh.js} +1 -1
  92. package/dist/public/assets/{skills-api-mYKB0zDh.js → skills-api-Cpwwq_FO.js} +1 -1
  93. package/dist/public/assets/{src-xGMvMbEd.js → src-DH3yTixx.js} +1 -1
  94. package/dist/public/assets/{startup-marks-yQqTMBm5.js → startup-marks-CJJqLRKP.js} +1 -1
  95. package/dist/public/assets/{tag-pill-input-BQLv6DZ1.js → tag-pill-input-DLQqKzbN.js} +1 -1
  96. package/dist/public/assets/{target-navigation-intent-BIFEl4OT.js → target-navigation-intent-BwAGdOsi.js} +1 -1
  97. package/dist/public/assets/{telemetry-impl-C6m58fJK.js → telemetry-impl-uxkJeQeP.js} +1 -1
  98. package/dist/public/assets/{telemetry-startup-DyEWsvUO.js → telemetry-startup-DXNUk1VO.js} +1 -1
  99. package/dist/public/assets/{terminal-command-events-CoTkNESn.js → terminal-command-events-CoI7bIgQ.js} +1 -1
  100. package/dist/public/assets/{terminal-launch-events-BBjjknBw.js → terminal-launch-events-BMFqKHQ8.js} +1 -1
  101. package/dist/public/assets/{terminal-telemetry-CGR3Wr8L.js → terminal-telemetry-C0nwSvRH.js} +1 -1
  102. package/dist/public/assets/{thread-client-V2_Sw10t.js → thread-client-2zOGI06i.js} +1 -1
  103. package/dist/public/assets/{typing-burst-detector-Bwb8vXQS.js → typing-burst-detector-DAxjXGUR.js} +1 -1
  104. package/dist/public/assets/{uninstall-BcI5d3jC.js → uninstall-BXBr3BfR.js} +1 -1
  105. package/dist/public/assets/{use-activity-panel-Bm-_7omz.js → use-activity-panel-fiECiEGD.js} +1 -1
  106. package/dist/public/assets/{use-apply-config-language-Bzn7Rbw_.js → use-apply-config-language--jTlcFWU.js} +1 -1
  107. package/dist/public/assets/{use-collab-url-D3j3svaH.js → use-collab-url-Bs4wUHQ8.js} +1 -1
  108. package/dist/public/assets/{use-conflicts-8sSRJ_Uy.js → use-conflicts-Due_s21R.js} +1 -1
  109. package/dist/public/assets/{use-git-sync-status-CBlTkWfK.js → use-git-sync-status-CLv7EZOq.js} +1 -1
  110. package/dist/public/assets/{use-installed-clis-ClKL7RtP.js → use-installed-clis-L2RDjEtc.js} +2 -2
  111. package/dist/public/assets/{use-live-xterm-theme-bJiLIpxd.js → use-live-xterm-theme-XZgq5LKh.js} +1 -1
  112. package/dist/public/assets/{use-open-skill-BpW3ZhuK.js → use-open-skill-VXKhxYI8.js} +1 -1
  113. package/dist/public/assets/{use-settings-route-DL25HSeL.js → use-settings-route-DI6YfB7r.js} +1 -1
  114. package/dist/public/assets/{use-skill-origin-Cts8svd2.js → use-skill-origin-ChIkNH5y.js} +1 -1
  115. package/dist/public/assets/{use-skills-DXlhkRBq.js → use-skills-B1b-aZeu.js} +1 -1
  116. package/dist/public/assets/{use-terminal-enabled-Br80VTvl.js → use-terminal-enabled-i_8mPbBj.js} +1 -1
  117. package/dist/public/assets/{use-timeline-entry-diff-l604pHZz.js → use-timeline-entry-diff-BUIkXCPy.js} +1 -1
  118. package/dist/public/assets/{use-workspace-DtyUPSZ4.js → use-workspace-Byr5yIN5.js} +1 -1
  119. package/dist/public/index.html +61 -61
  120. package/dist/public/uninstall.html +5 -5
  121. package/dist/{registry-probes-BXgdIidc.mjs → registry-probes-D8FcUtB0.mjs} +1 -1
  122. package/dist/{removal-file-path-Ce-oxAGQ.mjs → removal-file-path-BgwXjuvV.mjs} +1 -1
  123. package/dist/{repair-launch-json-CtsInz2s.mjs → repair-launch-json-DtK_c3nF.mjs} +1 -1
  124. package/dist/{repair-mcp-configs-BESnoIPY.mjs → repair-mcp-configs-CHxPLjFw.mjs} +1 -1
  125. package/dist/{src-KNAqsxPK.mjs → src-B-sEWdoC.mjs} +1 -1
  126. package/dist/src-DRExR_k-.mjs +1 -0
  127. package/dist/{start-B8iic9V_.mjs → start-BUCscKWv.mjs} +3 -3
  128. package/dist/start-DtqDBdwI.mjs +1 -0
  129. package/package.json +4 -4
  130. package/dist/constants-W9G4vRvJ.mjs +0 -1
  131. package/dist/init-DaBUbh8G.mjs +0 -1
  132. package/dist/loader-YyyVC5zh.mjs +0 -1
  133. package/dist/preview-BQhr7b8a.mjs +0 -1
  134. package/dist/public/assets/FeedbackForm-BQ8aBBom.js +0 -1
  135. package/dist/public/assets/ManagedArtifactProperties-yEjDaTS8.js +0 -1
  136. package/dist/public/assets/client-version-DJFCNOKL.js +0 -1
  137. package/dist/src-BPwbNxCr.mjs +0 -1
  138. package/dist/start-BXE7aaH4.mjs +0 -1
  139. /package/dist/public/assets/{globals-Cn1sYXH0.js → globals-DfvLF-dy.js} +0 -0
@@ -463,7 +463,7 @@ $2`).split(`
463
463
  </div>`}];function m2(e){return["```html preview",e.html,"```"].join(`
464
464
  `)}const h2=[{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`}];function g2(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);if(n<=0)return t;let r=t.slice(n).toLowerCase();return X0.includes(r)?t.slice(0,n):t}function _2(e){return g2(e)===`log`}const Moe=`127.0.0.1`,v2=`installed-skills.json`,y2=[`.ok`,ys,v2],b2=L(wl),x2=Qa({hosts:F(M()),scope:b2,scripts:P(),installedAt:Qi(),projection:L([`symlink`,`copy`]).optional(),contentHash:M().optional()}),S2=Qa({schema:R(1),skills:io(M(),x2).default({})});function C2(){return{schema:1,skills:{}}}function w2(e){let t;try{t=JSON.parse(e)}catch{return null}let n=S2.safeParse(t);return n.success?n.data:null}const T2=`machine-id`,E2=`skills`,D2=`skill-placements.json`,O2=`skill-move-retained.json`,k2=[T2,E2,nu,`${ys}/${v2}`,`${ys}/${D2}`,`${ys}/${O2}`],A2=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(A2.map(e=>e.value));const j2=Ere.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}}}}),M2=Mre.extend({name:`emphasis`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`*`}}},addInputRules(){return[Aw({find:Qw,type:this.type,getAttributes:{sourceDelimiter:`*`}}),Aw({find:$w,type:this.type,getAttributes:{sourceDelimiter:`_`}})]}}),N2=kre.extend({name:`strong`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`**`}}},addInputRules(){return[Aw({find:Yw,type:this.type,getAttributes:{sourceDelimiter:`**`}}),Aw({find:Xw,type:this.type,getAttributes:{sourceDelimiter:`__`}})]}}),P2=gw.create({name:`escapeMark`,priority:10,excludes:``,inclusive:!1,parseHTML(){return[{tag:`span[data-escape-mark]`}]},renderHTML(){return[`span`,{"data-escape-mark":``},0]}}),F2=Ww.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 I2({node:e}){return``.repeat(e.nodeSize-e.content.size)}const L2=Ww.create({name:`footnoteReference`,marks:`_`,group:`inline`,inline:!0,atom:!0,selectable:!0,draggable:!1,priority:60,renderText:I2,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}})}}}),R2=Nre.extend({marks:`_`,priority:60,addAttributes(){return{...this.parent?.(),hardBreakStyle:{default:`backslash`},sourceRaw:{default:null}}}}),z2=Pre.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}}}}),B2=Ww.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]}}),V2=Ww.create({name:`imageReference`,marks:`_`,group:`inline`,inline:!0,atom:!0,priority:60,renderText:I2,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 H2(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 U2=Ire.extend({marks:`_`,priority:60,renderText:I2,addAttributes(){return{...this.parent?.(),sourceUrl:{default:null,rendered:!1}}},renderHTML({HTMLAttributes:e}){let t=pC(this.options.HTMLAttributes,e);return typeof t.src==`string`&&(t.src=H2(t.src)),[`img`,t]}}),W2=Ww.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}})}}}),G2=Ww.create({name:`jsxInline`,group:`inline`,inline:!0,atom:!1,content:`text*`,isolating:!1,selectable:!0,priority:60,renderText:I2,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]}}),K2=[`https`,`http`,`mailto`,`tel`,`ftp`,`sms`],q2=K2.map(e=>`${e}:`).join(`|`);RegExp(`^(?:${q2}|\\/|#|\\?|\\.\\/|\\.\\.\\/)`,`i`);function J2(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 Y2=new Set(K2.map(e=>`${e}:`));function X2(e){try{let t=new URL(e,`https://placeholder.invalid`);return Y2.has(t.protocol.toLowerCase())}catch{return!1}}const Z2=`LinkFidelity must be derived from the Link extension`,Q2=Wre.extend({priority:60,addOptions(){let e=this.parent?.();if(e===void 0)throw Error(Z2);return{...e,openOnClick:!1,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer`},isAllowedUri:X2,shouldAutoLink:()=>!0}},addAttributes(){let e=this.parent?.();if(e===void 0)throw Error(Z2);return{...e,linkStyle:{default:`inline`,rendered:!1},refLabel:{default:null,rendered:!1},sourceForm:{default:null,rendered:!1},target:{default:null,rendered:!1},anchor:{default:null,rendered:!1},alias:{default:null,rendered:!1},sourceUrlForm:{default:null,rendered:!1},sourceTitleMarker:{default:null,rendered:!1},sourceTarget:{default:null,rendered:!1},sourceAnchor:{default:null,rendered:!1},sourceAlias:{default:null,rendered:!1}}}}),$2=Ww.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 e4(e){return e.type.name===`list`&&!e.attrs.ordered}function t4(e){return e.type.name===`list`&&!!e.attrs.ordered}function n4(e){let t=!1;return e.forEach(e=>{e.type.name===`listItem`&&e.attrs.checked!==null&&(t=!0)}),t}function r4(e,t,n,r,i,a,o){let s=rC(e=>e.type.name===`list`)(e.selection);if(s&&i(s.node)){let{$from:n,$to:i}=e.selection;return n.blockRange(i)?t_(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 Qg(n,a)(e,void 0)?!t||Qg(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 i4(e){return e===`x`||e===`X`}function a4(e){return e===`X`?`X`:null}function o4(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=dh(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 s4=/^\s*([-+*])\s$/,c4=/^\s*(\d+)([.)])\s$/,l4=/^\s*[-*+]\s\[([ xX]?)\]\s$/,u4=/^\s*\[([ xX]?)\]\s$/,d4=Ww.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,pC(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:r4(e,t,n,r,e=>e4(e)&&!n4(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:r4(e,t,n,r,e=>t4(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:r4(e,t,n,r,e=>e4(e)&&n4(e),{ordered:!1},{checked:!1})}}},addInputRules(){return[Nw({find:s4,type:this.type,getAttributes:e=>({ordered:!1,bulletMarker:e[1]}),joinPredicate:(e,t)=>t.attrs.ordered===!1}),Nw({find:c4,type:this.type,getAttributes:e=>({ordered:!0,start:Number(e[1]),listMarkerDelimiter:e[2]}),joinPredicate:(e,t)=>t.attrs.ordered===!0}),new dw({find:l4,handler:({state:e,range:t,match:n})=>o4(e,t,i4(n[1]),a4(n[1]))?void 0:null}),new dw({find:u4,handler:({state:e,range:t,match:n})=>o4(e,t,i4(n[1]),a4(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()}}}),f4=Ww.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`,pC(t),0]:[`li`,pC(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(pC(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}}}}),p4=d4,m4=f4,h4=Ww.create({name:`mathInline`,marks:`_`,group:`inline`,inline:!0,atom:!0,selectable:!0,priority:60,renderText:I2,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}})}}}),g4=Ww.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}}}}),_4=nae.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceMarkerSpacings:{default:null}}}}),v4=aae.extend({excludes:``,addAttributes(){return{...this.parent?.(),sourceFenceChar:{default:"`"},sourceFenceLength:{default:1},sourcePadded:{default:!1,rendered:!1}}}}),y4=Ww.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)}}}),b4=gw.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)}}}),x4=vw.create({name:`docFidelity`,addGlobalAttributes(){return[{types:[`doc`],attributes:{sourceDocBoundary:{default:null,rendered:!1}}}]}});function S4(e){for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return t;return null}function Noe(e){let t=!1;return e.descendants(e=>!t&&(e.type.name===`list`&&(t=!0),!t)),t}function C4(e){let{selection:t}=e;return t instanceof eg?t.$cursor:null}function Poe(e){let t=C4(e);if(t?.parentOffset!==0)return!1;let n=S4(t);if(n===null||t.depth!==n+1||t.index(n)!==0)return!1;let r=t.index(n-1);return r!==0&&Noe(t.node(n-1).child(r-1))}function Foe(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 Ioe(e){let t=C4(e);if(!t||t.parentOffset!==t.parent.content.size)return!1;let n=S4(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=Foe(t,n);return r!==null&&r<n}const Loe=vw.create({name:`listBoundaryMerge`,addKeyboardShortcuts(){let e=()=>{let{editor:e}=this;if(!Poe(e.state))return!1;if(e.commands.undoInputRule())return!0;let{state:t,view:n}=e;return vg(t,n.dispatch,n)},t=()=>{let{editor:e}=this;if(!Ioe(e.state))return!1;let{state:t,view:n}=e;return yg(t,n.dispatch,n)};return{Backspace:e,"Mod-Backspace":e,Delete:t,"Mod-Delete":t}}}),Roe=vw.create({name:`plainTextClipboard`,priority:1e3,addProseMirrorPlugins(){return[new dg({key:new mg(`okPlainTextClipboard`),props:{clipboardTextSerializer:e=>e.content.textBetween(0,e.content.size,`
465
465
 
466
- `)}})]}}),zoe=gw.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 w4(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||Boe(n)===r||K1(e)===t}function Boe(e){return e.replace(/\\([!-/:-@[-`{-~])/g,`$1`)}const Voe=Sae.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`~~`,rendered:!1}}}}),Hoe=iE.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDashCounts:{default:null},sourceOuterPipes:{default:null,rendered:!1},sourceAlignmentPadding:{default:null,rendered:!1}}}}),Uoe=ZT.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),Woe=QT.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),Goe=Ww.create({name:`tag`,marks:`_`,group:`inline`,inline:!0,atom:!0,selectable:!0,priority:60,renderText:I2,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()}}}),Koe=/^(?:---|—-|___\s|\*\*\*\s)$/;function qoe(e){let t=String(e[0]??``).replace(/\s+$/,``);return t===`—-`?`---`:t}const Joe=sae.extend({name:`thematicBreak`,priority:60,addAttributes(){return{...this.parent?.(),sourceRaw:{default:`---`}}},addInputRules(){return[jw({find:Koe,type:this.type,getAttributes:e=>({sourceRaw:qoe(e)})})]}}),Yoe=wae.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceForm:{default:`u`,rendered:!1}}}});function T4(e,t){let{target:n,anchor:r,alias:i}=e;if(!t.separatorCrossed)return e;if(r!==null){let e=O4(r);return{target:n,anchor:e.length>0?e:null,alias:i===null?null:k4(i)}}return{target:O4(n),anchor:null,alias:i===null?null:k4(i)}}function Xoe(e,t,n){let r=e.trim();return r===t?!0:n===`alias`?k4(r)===t:O4(r)===t}function E4(e,t,n){return typeof e==`string`&&Xoe(e,t,n)?e:t}function D4(e){return O4(e.trim())===``}function O4(e){return e.endsWith(`\\`)?e.slice(0,-1):e}function k4(e){return e.replace(/\\\|/g,`|`)}function Zoe(e){let t=``,n=0;for(let r of e)r===`\\`?n++:(r===`|`&&n%2==0&&(t+=`\\`),n=0),t+=r;return t}function Qoe(e){return e.replace(/\|/g,`\\|`)}function A4(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function j4(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}const $oe=Ww.create({name:`wikiLink`,marks:`_`,group:`inline`,inline:!0,atom:!0,priority:60,renderText:I2,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:A4(e.getAttribute(`data-alias`)),anchor:A4(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:A4(e.getAttribute(`data-alias`)),anchor:A4(e.getAttribute(`data-anchor`)),resolved:!1}:!1}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.target??``),r=A4(e.attrs.alias),i=A4(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`},j4({target:n,alias:r,anchor:i})]}});function M4(e){let t=e.split(`/`).pop()??e,n=t.lastIndexOf(`.`);return n<=0||n===t.length-1?``:t.slice(n+1).toLowerCase()}function ese(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}const N4=[W2,g4,G2,h4,$oe,Ww.create({name:`wikiLinkEmbed`,group:`inline`,inline:!0,atom:!0,priority:60,renderText:I2,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:A4(e.getAttribute(`data-alias`)),anchor:A4(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=A4(e.attrs.alias),i=A4(e.attrs.anchor),a=A4(e.attrs.resolvedSrc),o=M4(n);if(Rd.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`},ese({target:n,alias:r,anchor:i})]}}),Goe,p4,m4,M2,N2,Voe,Yoe,v4,j2,_4,z2,Joe,Q2,B2,$2,R2,P2,x4,zoe,Roe,Jae.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}}),Loe,Hoe.configure({resizable:!0}),$T,Woe,Uoe,U2.configure({inline:!0}),V2,qre,b4,y4,L2,F2];function tse(e){let{frontmatter:t}=al(e);if(t===``)return null;let n;try{let e=(0,Yc.parseDocument)(sl(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 nse=/^[a-zA-Z0-9][\w/-]*$/;function rse(e){return e.startsWith(`#`)?e.slice(1):e}function ise(e){return typeof e==`string`?[e]:Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function ase(e){if(!e||e.trim()===``)return[];let{map:t}=ll(e);if(!t)return[];let n=ise(t.tags),r=[];for(let e of n){let t=rse(e);nse.test(t)&&r.push(t)}return r}const ose=I({changes:F(to(`kind`,[I({key:M(),kind:R(`added`),after:$c}).loose(),I({key:M(),kind:R(`removed`),before:$c}).loose(),I({key:M(),kind:R(`changed`),before:$c,after:$c}).loose()])),unparseable:I({before:M(),after:M()}).loose().nullable()}).loose();function P4(e){let{fenced:t}=NQ(e),n=FQ(t);if(n.map===null)return{fenced:t,map:{},keys:[],parseError:n.parseError};let r=ml(n.doc);return{fenced:t,map:n.map,keys:r.length>0?r:Object.keys(n.map),parseError:void 0}}function sse(e,t){let n=P4(e),r=P4(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}rl(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 F4(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 I4(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 cse(e,t){return I4(e,F4(t.platform,t.homeDir),t)}function lse(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 use(e,t){return I4(e,[...F4(t.platform,t.homeDir),...lse(t.platform,t.homeDir)],t)}const L4=`:(literal)`;function R4(e){if(e===``)throw Error(`toPathspec: empty path. ":(literal)" is an empty pattern that matches every tracked path; pass "." if you meant the repo root.`);return`${L4}${e}`}function dse(e){if(e.length===0)throw Error(`pathspecArgs: empty path list. A bare "--" removes the pathspec restriction rather than selecting nothing.`);return[`--`,...e.map(e=>R4(e))]}function fse(e){return e.replaceAll(L4,``)}3072-pse("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 pse(e,t){let n=encodeURIComponent(e);return t===`cursor`?encodeURIComponent(n).length:n.length}function z4(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 mse=new Set([`opencode.json`]),hse=/^\.[A-Za-z0-9_-]+\/skills\/[^/]+\/.+$/;function B4(e){return hse.test(e)}function V4(e){return B4(e)?!1:e.split(`/`).some(e=>e.startsWith(`.`))?!0:mse.has(e.slice(e.lastIndexOf(`/`)+1))}function H4(e,t){let n=z4(e);n.ok||t.addIssue({code:`custom`,message:n.reason})}const U4=M().superRefine(H4).optional(),gse=M().superRefine(H4),W4={agentId:M().optional(),agentName:M().optional(),colorSeed:M().optional(),clientName:M().optional(),clientVersion:M().optional(),label:M().optional()},G4=M().optional(),_se=/^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,K4=F(M().min(1)).max(50),vse=L([`dormant`,`idle`,`fetching`,`pulling`,`pushing`,`conflict`,`offline`,`auth-error`,`disabled`]),yse=I({label:M().min(1),webUrl:ka().nullable()}).loose(),bse=to(`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()]),q4=L([`auth-403`,`auth-401`,`auth-scope-mismatch`,`auth-no-credential`,`auth-not-found-as-identity`,`semantic-protected-branch`]),xse=L(Zu),Sse=L([`succeeded`,`up-to-date`,`conflict`,`refused`,`error`]),Cse=I({state:vse,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:yse.nullable().optional(),pushError:M().optional(),pushErrorCode:q4.optional(),pullError:M().optional(),pullErrorCode:q4.optional(),pausedReason:M().optional(),blockingPaths:F(M().min(1)).optional(),refusedSymlinkPaths:K4.optional(),pushPermission:bse.optional(),syncMode:xse.optional(),lastPullUtc:M().nullable().optional(),lastPullOutcome:Sse.nullable().optional()}).loose(),wse=I({action:L([`commit`]),paths:F(M().min(1)),commitSha:M().optional()}).loose(),Tse=I({action:L([`commit`])}).loose(),Ese=I({op:L([`sync`,`push`,`pull`,`fetch`]).optional()}).loose(),Dse=I({op:L([`sync`,`push`,`pull`,`fetch`])}).loose(),J4=[`merge-native`,`working-tree`,`reconcile`],Y4=L(J4),X4=[`merged-with-markers`,`refused-conflict-markers`,`refused-no-base`,`refused-too-large`,`disk-markers`,`stale-external-write`],Z4=L(X4),Ose=L([`mine`,`theirs`,`content`,`delete`]),kse=I({conflicts:F(I({file:M().min(1),detectedAt:M().min(1),conflict:Y4,reason:Z4.optional().catch(void 0),conflictKind:L([`git`,`stale-external-write`]).optional(),docName:M().nullable(),theirsSha:M().optional(),baseSha:M().optional()}).loose())}).loose(),Ase=I({file:M().min(1),strategy:L([`mine`,`theirs`,`content`,`delete`]),content:M().optional()}).loose().refine(e=>e.strategy!==`content`||e.content!==void 0,{message:`content must be provided when strategy is 'content' (an empty string keeps an empty file)`,path:[`content`]}),jse=I({}).loose(),Mse=I({file:M().min(1),base:M(),ours:M(),theirs:M(),kind:L([`both-modified`,`delete-modify`,`modify-delete`]),conflict:Y4,reason:Z4.optional().catch(void 0),conflictKind:L([`git`,`stale-external-write`]).optional(),resolutionOptions:F(Ose)}).loose(),Nse=I({plan:go(e=>e!==void 0,{message:`plan is required`})}).loose(),Pse=I({plan:go(e=>e!==void 0,{message:`plan is required`})}).loose(),Fse=I({result:go(e=>e!==void 0,{message:`result is required`})}).loose(),Ise=I({packId:M().min(1)}).strict(),Lse=I({installedHosts:F(M()),skills:F(I({name:M().min(1),created:P()}).strict())}).strict(),Rse=I({path:M().min(1),summary:M().min(1)}).loose(),zse=I({files:N().int().nonnegative(),folders:N().int().nonnegative()}).loose(),Bse=I({packs:F(I({id:M().min(1),name:M().min(1),description:M().min(1),defaultSubfolder:M().optional(),folders:F(Rse),entryCounts:zse}).loose())}).loose(),Vse=I({noOpen:P().optional(),out:M().min(1).optional()}).loose(),Hse=I({reason:L([`unsupported-platform`,`spawn-error`]),message:M()}).loose(),Use=to(`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:Hse.optional()}).loose(),I({status:R(`failed`),buildError:M()}).loose(),I({status:R(`skip-current`),skillVersion:M(),recordedAt:M().optional()}).loose()]),Wse=to(`kind`,[I({kind:R(`doc`),docPath:M().min(1)}).loose(),I({kind:R(`folder`),folderPath:M()}).loose()]),Q4=L([`no-remote`,`detached-head`,`branch-not-on-origin`,`non-github-remote`,`invalid-path`,`unsupported-share-url`]),$4=L([`current`,`stale`,`absent`,`empty`]),Gse=to(`ok`,[I({ok:R(!0),shareUrl:M().min(1),sharedUrl:M().min(1),branch:M().min(1),freshness:$4.optional().catch(void 0)}).loose(),I({ok:R(!1),error:Q4,branch:M().min(1).optional()}).loose()]),Kse=L([`user`,`org`]),qse=I({login:M().min(1),kind:Kse,avatarUrl:M().optional()}).loose(),e3=L([`auth-required`,`network`]),Jse=to(`ok`,[I({ok:R(!0),owners:F(qse)}).loose(),I({ok:R(!1),error:e3}).loose()]),Yse=to(`ok`,[I({ok:R(!0),available:P()}).loose(),I({ok:R(!1),error:e3}).loose()]),Xse=L([`public`,`private`]),Zse=I({owner:M().min(1),name:M().min(1),visibility:Xse,description:M().optional()}).loose(),Qse=L([`name-conflict`,`saml-sso`,`auth-required`,`push-failed`,`init-failed`,`network`,`no-project`]),$se=to(`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:Qse}).loose()]);function t3(e){return!(typeof e!=`string`||e.length===0||e.startsWith(`-`)||/[\x00-\x1F\x7F]/.test(e)||/\s/.test(e)||e.includes(`:`)||e.split(`/`).includes(`..`))}const n3=e=>e.refine(t3,`invalid branch name`);function ece(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 tce=[/could not read (username|password)/i,/terminal prompts disabled/i,/user interactivity has been disabled/i,/unable to get password from user/i],nce=[/insufficient scopes/i,/missing.*scope/i,/required scope/i],rce=[/permission denied.*\(publickey\)/i,/host key verification failed/i],r3=/fatal:.*repository.*not found/i,ice=[/\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,r3];function ace(e){if(typeof e!=`object`||!e)return``;let t=e.git;return t==null?``:String(t)}function oce(e){if(e==null)return{kind:`non-auth`};let t=`${e instanceof Error?e.message:String(e)}\n${ace(e)}`;return tce.some(e=>e.test(t))?{kind:`auth`,subclass:`no-credential`}:nce.some(e=>e.test(t))?{kind:`auth`,subclass:`scope-mismatch`}:rce.some(e=>e.test(t))?{kind:`auth`,subclass:`ssh-auth`}:ice.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`}:r3.test(t)?{kind:`auth`,subclass:`not-found-as-identity`}:{kind:`auth`,subclass:`unknown-auth`}:{kind:`non-auth`}}function sce(e){return e.kind===`auth`?e.subclass===`no-credential`||e.subclass===`401`||e.subclass===`unknown-auth`:!1}const i3={shareTargetExists:P(),dirtyConflicts:I({conflicts:P(),files:F(M().min(1))}).loose(),branchIsLocal:P(),shareTargetOnOriginBranch:P().optional()},cce=to(`detached`,[I({detached:R(!1),currentBranch:M().min(1).nullable(),currentHeadSha:qa(),...i3}).loose(),I({detached:R(!0),currentBranch:qa(),currentHeadSha:M().min(1),...i3}).loose()]),lce=I({branch:n3(M().min(1)),principalId:M().optional(),fastForward:P().optional()}).loose(),uce=L([`dirty-conflict`,`branch-not-found`,`fetch-failed`,`checkout-failed`,`branch-in-other-worktree`,`ff-diverged`,`unsafe-symlinks`,`symlink-check-failed`]),dce=to(`ok`,[I({ok:R(!0)}).loose(),I({ok:R(!1),reason:uce,files:F(M().min(1)).optional(),otherWorktreePath:M().min(1).optional(),refusedSymlinkPaths:K4.optional()}).loose()]);L([`on-origin`,`renamed`,`deleted`,`never-on-branch`,`changed-locally`,`unknown`]);const fce=I({branch:n3(M().min(1)),path:M(),kind:L([`doc`,`folder`]),contentRootDepth:N().int().min(1).max(65535).optional()}).loose(),pce=to(`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`}),mce=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()}),hce=I({serverInstanceId:M().min(1),currentBranch:M().min(1).optional(),currentDiskAckSVs:io(M().min(1),M().min(1)).optional(),boot:mce.optional(),collabClients:N().int().nonnegative().optional()}).loose(),gce=I({id:M().min(1),display_name:M().min(1),display_email:M(),source:L([`git-config`,`synthesized`]),created_at:M().min(1)}).loose(),_ce=I({collabUrl:M().nullable(),previewUrl:M().nullable(),port:N(),singleFile:P().default(!1)}).loose(),a3=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:unsupported-media-type.urn:ok:error:payload-too-large.urn:ok:error:request-timeout.urn:ok:error:internal-server-error.urn:ok:error:derived-index-unavailable.urn:ok:error:loopback-required.urn:ok:error:invalid-origin.urn:ok:error:url-not-allowed.urn:ok:error:dir-outside-home.urn:ok:error:concurrent-operation.urn:ok:error:clone-failed.urn:ok:error:clone-timeout.urn:ok:error:server-start-failed.urn:ok:error:reserved-doc-name.urn:ok:error:target-not-found.urn:ok:error:stale-target.urn:ok:error:frontmatter-edit-not-supported.urn:ok:error:invalid-frontmatter-patch.urn:ok:error:frontmatter-malformed.urn:ok:error:no-active-session.urn:ok:error:too-many-agent-sessions.urn:ok:error:disk-divergence.urn:ok:error:stale-external-write.urn:ok:error:store-refused.urn:ok:error:doc-removed.urn:ok:error:doc-not-found.urn:ok:error:doc-already-exists.urn:ok:error:doc-not-open.urn:ok:error:rollback-not-configured.urn:ok:error:doc-not-available.urn:ok:error:backlink-index-not-configured.urn:ok:error:file-rescan-not-configured.urn:ok:error:shadow-not-configured.urn:ok:error:host-not-allowed.urn:ok:error:principal-not-available.urn:ok:error:not-found.urn:ok:error:auth-failed.urn:ok:error:no-project-dir.urn:ok:error:non-github-origin.urn:ok:error:server-open-failed.urn:ok:error:doc-in-conflict.urn:ok:error:concurrent-overwrite-refused.urn:ok:error:unresolved-conflict-markers.urn:ok:error:no-conflict-tracked.urn:ok:error:no-blocking-changes.urn:ok:error:sync-not-active.urn:ok:error:project-repo-not-configured.urn:ok:error:seed-prerequisite-missing.urn:ok:error:seed-invalid-root.urn:ok:error:tag-index-not-configured.urn:ok:error:template-not-found.urn:ok:error:unsupported-asset-type.urn:ok:error:asset-not-found.urn:ok:error:single-file-mode.urn:ok:error:collab-server-not-running.urn:ok:error:gateway-timeout.urn:ok:error:cursor-not-installed.urn:ok:error:cursor-spawn-timeout.urn:ok:error:cursor-spawn-failed.urn:ok:error:handoff-target-not-installed.urn:ok:error:handoff-spawn-timeout.urn:ok:error:handoff-spawn-failed.urn:ok:error:registry-unreachable.urn:ok:error:config-not-writable.urn:ok:error:audit-superseded.urn:ok:error:theme-name-taken.urn:ok:error:theme-name-invalid`.split(`.`));function vce(e){throw Error(`Unexpected ProblemType variant: ${JSON.stringify(e)}`)}const o3=I({type:a3,title:M().min(1),status:N().int().min(400).max(599),instance:M().regex(_se,`instance must be urn:uuid:<uuid>`).optional(),detail:M().optional()}).loose(),yce=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(),bce=I({src:M().min(1),path:M().min(1).optional(),deduped:P().optional()}).loose(),xce=I({url:M().min(1),dir:M().min(1),branch:M().min(1).refine(t3,`invalid branch name`).optional()}).loose(),Sce=I({type:R(`error`),problem:o3}).loose();function s3(e,t){let n=t.map(e=>[Op(e),e]);for(let t of e){let e=Op(t);if(e===null)continue;let r=n.find(([t])=>t===e);if(r!==void 0)return r[1]}}function Cce(e){let{override:t,storedPreference:n,preferenceList:r,supportedLocales:i}=e,a=e.autoDetectableLocales??i;if(t!==void 0){let e=s3([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=s3(r,a);return o===void 0?{locale:`en`,source:`fallback`}:{locale:o,source:`system`}}function c3(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e===45||e===95}function wce(e){if(!e.includes(`eyJ`))return null;let t=[],n=[];for(let r=0;r<e.length;r+=1)if(c3(e.charCodeAt(r))){for(t.push(r);r<e.length&&c3(e.charCodeAt(r));)r+=1;n.push(r)}let r=[];for(let t=e.indexOf(`eyJ`);t!==-1;t=e.indexOf(`eyJ`,t+1))r.push(t);let i=r=>r+1<t.length&&e[n[r]??-1]===`.`&&t[r+1]===(n[r]??-1)+1,a=[],o=0,s=0;for(let c=0;c+2<t.length;c+=1){let l=t[c]??0,u=n[c]??0;for(;s<r.length&&(r[s]??0)<l;)s+=1;if(!i(c)||!i(c+1))continue;let d=t[c+1]??0,f=n[c+1]??0,p=(n[c+2]??0)-(t[c+2]??0);if(!e.startsWith(`eyJ`,d)||f-d<11||p<8)continue;let m=r[s];m===void 0||m>=u||u-m<11||(a.push(e.slice(o,m),`[REDACTED-JWT]`),o=n[c+2]??e.length,c+=2)}return a.length===0?null:(a.push(e.slice(o)),a.join(``))}function l3(e){return RegExp(`(?:\\b|(?<=(?:\\[|\\u009b)[0-?]*[ -/]*[@-~]))${e.source}`,`g`)}const u3=[{name:`github-pat`,regex:/(ghp_|gho_|ghu_|ghs_|ghr_)[A-Za-z0-9]{36,}\b/g,replacement:`[REDACTED-GH-PAT]`},{name:`aws-access-key`,regex:l3(/(AKIA|ASIA|ABIA)[A-Z2-7]{16}\b/),replacement:`[REDACTED-AWS-KEY]`},{name:`anthropic-key`,regex:/sk-ant-api03-[A-Za-z0-9_-]{20,}\b/g,replacement:`[REDACTED-ANTHROPIC]`},{name:`openai-key`,regex:l3(/sk-[A-Za-z0-9]{20,}\b/),replacement:`[REDACTED-OPENAI]`},{name:`bearer-token`,regex:/([Aa]uthorization:\s*[Bb]earer\s+)(?:\\"[^\s"\\]+\\"|"[A-Za-z0-9\-._~+/=]+"|[^\s"\\]+)/g,replacement:`$1[REDACTED]`},{name:`jwt`,redact:wce},{name:`url-credentials`,regex:/:\/\/[^/\s:@"]+:[^/\s:@"]+@/g,replacement:`://[REDACTED]@`},{name:`github-pat-fine-grained`,regex:/github_pat_[0-9A-Za-z_]{20,}/g,replacement:`[REDACTED-GH-PAT]`},{name:`openai-key-modern`,regex:l3(/sk-(?:proj|svcacct|admin|None)-[A-Za-z0-9_-]{20,}/),replacement:`[REDACTED-OPENAI]`},{name:`slack-token`,regex:/xox[a-z]-[A-Za-z0-9-]{10,}/g,replacement:`[REDACTED-SLACK]`},{name:`google-api-key`,regex:/AIza[0-9A-Za-z_-]{35}/g,replacement:`[REDACTED-GOOGLE]`},{name:`stripe-secret-key`,regex:l3(/(?:sk|rk)_live_[0-9A-Za-z]{16,}\b/),replacement:`[REDACTED-STRIPE]`},{name:`gitlab-pat`,regex:/glpat-[0-9A-Za-z_-]{20,}/g,replacement:`[REDACTED-GITLAB]`},{name:`bearer-token-json`,regex:/("[Aa]uthorization"\s*:\s*"[Bb]earer\s+)(?:\\"[^"\\]+\\"|[^"\\]+)/g,replacement:`$1[REDACTED]`},{name:`macos-home-path`,regex:/\/Users\/[^/"\r]*[^/"\r\\]/g,replacement:`~`},{name:`linux-home-path`,regex:/\/home\/[^/"\r]*[^/"\r\\]/g,replacement:`~`},{name:`windows-home-path`,regex:/[A-Za-z]:\\{1,2}Users\\{1,2}(?:(?![A-Za-z]:\\)[^\\"\r])+/gi,replacement:`~`}],Tce=u3.map(e=>e.name);function d3(e){let t=new Set,n=0;return{redacted:e.split(`
466
+ `)}})]}}),zoe=gw.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 w4(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||Boe(n)===r||K1(e)===t}function Boe(e){return e.replace(/\\([!-/:-@[-`{-~])/g,`$1`)}const Voe=Sae.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`~~`,rendered:!1}}}}),Hoe=iE.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDashCounts:{default:null},sourceOuterPipes:{default:null,rendered:!1},sourceAlignmentPadding:{default:null,rendered:!1}}}}),Uoe=ZT.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),Woe=QT.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),Goe=Ww.create({name:`tag`,marks:`_`,group:`inline`,inline:!0,atom:!0,selectable:!0,priority:60,renderText:I2,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()}}}),Koe=/^(?:---|—-|___\s|\*\*\*\s)$/;function qoe(e){let t=String(e[0]??``).replace(/\s+$/,``);return t===`—-`?`---`:t}const Joe=sae.extend({name:`thematicBreak`,priority:60,addAttributes(){return{...this.parent?.(),sourceRaw:{default:`---`}}},addInputRules(){return[jw({find:Koe,type:this.type,getAttributes:e=>({sourceRaw:qoe(e)})})]}}),Yoe=wae.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceForm:{default:`u`,rendered:!1}}}});function T4(e,t){let{target:n,anchor:r,alias:i}=e;if(!t.separatorCrossed)return e;if(r!==null){let e=O4(r);return{target:n,anchor:e.length>0?e:null,alias:i===null?null:k4(i)}}return{target:O4(n),anchor:null,alias:i===null?null:k4(i)}}function Xoe(e,t,n){let r=e.trim();return r===t?!0:n===`alias`?k4(r)===t:O4(r)===t}function E4(e,t,n){return typeof e==`string`&&Xoe(e,t,n)?e:t}function D4(e){return O4(e.trim())===``}function O4(e){return e.endsWith(`\\`)?e.slice(0,-1):e}function k4(e){return e.replace(/\\\|/g,`|`)}function Zoe(e){let t=``,n=0;for(let r of e)r===`\\`?n++:(r===`|`&&n%2==0&&(t+=`\\`),n=0),t+=r;return t}function Qoe(e){return e.replace(/\|/g,`\\|`)}function A4(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function j4(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}const $oe=Ww.create({name:`wikiLink`,marks:`_`,group:`inline`,inline:!0,atom:!0,priority:60,renderText:I2,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:A4(e.getAttribute(`data-alias`)),anchor:A4(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:A4(e.getAttribute(`data-alias`)),anchor:A4(e.getAttribute(`data-anchor`)),resolved:!1}:!1}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.target??``),r=A4(e.attrs.alias),i=A4(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`},j4({target:n,alias:r,anchor:i})]}});function M4(e){let t=e.split(`/`).pop()??e,n=t.lastIndexOf(`.`);return n<=0||n===t.length-1?``:t.slice(n+1).toLowerCase()}function ese(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}const N4=[W2,g4,G2,h4,$oe,Ww.create({name:`wikiLinkEmbed`,group:`inline`,inline:!0,atom:!0,priority:60,renderText:I2,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:A4(e.getAttribute(`data-alias`)),anchor:A4(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=A4(e.attrs.alias),i=A4(e.attrs.anchor),a=A4(e.attrs.resolvedSrc),o=M4(n);if(Rd.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`},ese({target:n,alias:r,anchor:i})]}}),Goe,p4,m4,M2,N2,Voe,Yoe,v4,j2,_4,z2,Joe,Q2,B2,$2,R2,P2,x4,zoe,Roe,Jae.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}}),Loe,Hoe.configure({resizable:!0}),$T,Woe,Uoe,U2.configure({inline:!0}),V2,qre,b4,y4,L2,F2];function tse(e){let{frontmatter:t}=al(e);if(t===``)return null;let n;try{let e=(0,Yc.parseDocument)(sl(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 nse=/^[a-zA-Z0-9][\w/-]*$/;function rse(e){return e.startsWith(`#`)?e.slice(1):e}function ise(e){return typeof e==`string`?[e]:Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function ase(e){if(!e||e.trim()===``)return[];let{map:t}=ll(e);if(!t)return[];let n=ise(t.tags),r=[];for(let e of n){let t=rse(e);nse.test(t)&&r.push(t)}return r}const ose=I({changes:F(to(`kind`,[I({key:M(),kind:R(`added`),after:$c}).loose(),I({key:M(),kind:R(`removed`),before:$c}).loose(),I({key:M(),kind:R(`changed`),before:$c,after:$c}).loose()])),unparseable:I({before:M(),after:M()}).loose().nullable()}).loose();function P4(e){let{fenced:t}=NQ(e),n=FQ(t);if(n.map===null)return{fenced:t,map:{},keys:[],parseError:n.parseError};let r=ml(n.doc);return{fenced:t,map:n.map,keys:r.length>0?r:Object.keys(n.map),parseError:void 0}}function sse(e,t){let n=P4(e),r=P4(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}rl(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 F4(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 I4(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 cse(e,t){return I4(e,F4(t.platform,t.homeDir),t)}function lse(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 use(e,t){return I4(e,[...F4(t.platform,t.homeDir),...lse(t.platform,t.homeDir)],t)}const L4=`:(literal)`;function R4(e){if(e===``)throw Error(`toPathspec: empty path. ":(literal)" is an empty pattern that matches every tracked path; pass "." if you meant the repo root.`);return`${L4}${e}`}function dse(e){if(e.length===0)throw Error(`pathspecArgs: empty path list. A bare "--" removes the pathspec restriction rather than selecting nothing.`);return[`--`,...e.map(e=>R4(e))]}function fse(e){return e.replaceAll(L4,``)}3072-pse("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 pse(e,t){let n=encodeURIComponent(e);return t===`cursor`?encodeURIComponent(n).length:n.length}function z4(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 mse=new Set([`opencode.json`]),hse=/^\.[A-Za-z0-9_-]+\/skills\/[^/]+\/.+$/;function B4(e){return hse.test(e)}function V4(e){return B4(e)?!1:e.split(`/`).some(e=>e.startsWith(`.`))?!0:mse.has(e.slice(e.lastIndexOf(`/`)+1))}function H4(e,t){let n=z4(e);n.ok||t.addIssue({code:`custom`,message:n.reason})}const U4=M().superRefine(H4).optional(),gse=M().superRefine(H4),W4={agentId:M().optional(),agentName:M().optional(),colorSeed:M().optional(),clientName:M().optional(),clientVersion:M().optional(),label:M().optional()},G4=M().optional(),_se=/^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,K4=F(M().min(1)).max(50),vse=L([`dormant`,`idle`,`fetching`,`pulling`,`pushing`,`conflict`,`offline`,`auth-error`,`disabled`]),yse=I({label:M().min(1),webUrl:ka().nullable()}).loose(),bse=to(`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()]),q4=L([`auth-403`,`auth-401`,`auth-scope-mismatch`,`auth-no-credential`,`auth-not-found-as-identity`,`semantic-protected-branch`]),xse=L(Zu),Sse=L([`succeeded`,`up-to-date`,`conflict`,`refused`,`error`]),Cse=I({state:vse,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:yse.nullable().optional(),pushError:M().optional(),pushErrorCode:q4.optional(),pullError:M().optional(),pullErrorCode:q4.optional(),pausedReason:M().optional(),blockingPaths:F(M().min(1)).optional(),refusedSymlinkPaths:K4.optional(),pushPermission:bse.optional(),syncMode:xse.optional(),lastPullUtc:M().nullable().optional(),lastPullOutcome:Sse.nullable().optional()}).loose(),wse=I({action:L([`commit`]),paths:F(M().min(1)),commitSha:M().optional()}).loose(),Tse=I({action:L([`commit`])}).loose(),Ese=I({op:L([`sync`,`push`,`pull`,`fetch`]).optional()}).loose(),Dse=I({op:L([`sync`,`push`,`pull`,`fetch`])}).loose(),J4=[`merge-native`,`working-tree`,`reconcile`],Y4=L(J4),X4=[`merged-with-markers`,`refused-conflict-markers`,`refused-no-base`,`refused-too-large`,`disk-markers`,`stale-external-write`],Z4=L(X4),Ose=L([`mine`,`theirs`,`content`,`delete`]),kse=I({conflicts:F(I({file:M().min(1),detectedAt:M().min(1),conflict:Y4,reason:Z4.optional().catch(void 0),conflictKind:L([`git`,`stale-external-write`]).optional(),docName:M().nullable(),theirsSha:M().optional(),baseSha:M().optional()}).loose())}).loose(),Ase=I({file:M().min(1),strategy:L([`mine`,`theirs`,`content`,`delete`]),content:M().optional()}).loose().refine(e=>e.strategy!==`content`||e.content!==void 0,{message:`content must be provided when strategy is 'content' (an empty string keeps an empty file)`,path:[`content`]}),jse=I({}).loose(),Mse=I({file:M().min(1),base:M(),ours:M(),theirs:M(),kind:L([`both-modified`,`delete-modify`,`modify-delete`]),conflict:Y4,reason:Z4.optional().catch(void 0),conflictKind:L([`git`,`stale-external-write`]).optional(),resolutionOptions:F(Ose)}).loose(),Nse=I({plan:go(e=>e!==void 0,{message:`plan is required`})}).loose(),Pse=I({plan:go(e=>e!==void 0,{message:`plan is required`})}).loose(),Fse=I({result:go(e=>e!==void 0,{message:`result is required`})}).loose(),Ise=I({packId:M().min(1)}).strict(),Lse=I({installedHosts:F(M()),skills:F(I({name:M().min(1),created:P()}).strict())}).strict(),Rse=I({path:M().min(1),summary:M().min(1)}).loose(),zse=I({files:N().int().nonnegative(),folders:N().int().nonnegative()}).loose(),Bse=I({packs:F(I({id:M().min(1),name:M().min(1),description:M().min(1),defaultSubfolder:M().optional(),folders:F(Rse),entryCounts:zse}).loose())}).loose(),Vse=I({noOpen:P().optional(),out:M().min(1).optional()}).loose(),Hse=I({reason:L([`unsupported-platform`,`spawn-error`]),message:M()}).loose(),Use=to(`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:Hse.optional()}).loose(),I({status:R(`failed`),buildError:M()}).loose(),I({status:R(`skip-current`),skillVersion:M(),recordedAt:M().optional()}).loose()]),Wse=to(`kind`,[I({kind:R(`doc`),docPath:M().min(1)}).loose(),I({kind:R(`folder`),folderPath:M()}).loose()]),Q4=L([`no-remote`,`detached-head`,`branch-not-on-origin`,`non-github-remote`,`invalid-path`,`unsupported-share-url`]),$4=L([`current`,`stale`,`absent`,`empty`]),Gse=to(`ok`,[I({ok:R(!0),shareUrl:M().min(1),sharedUrl:M().min(1),branch:M().min(1),freshness:$4.optional().catch(void 0)}).loose(),I({ok:R(!1),error:Q4,branch:M().min(1).optional()}).loose()]),Kse=L([`user`,`org`]),qse=I({login:M().min(1),kind:Kse,avatarUrl:M().optional()}).loose(),e3=L([`auth-required`,`network`]),Jse=to(`ok`,[I({ok:R(!0),owners:F(qse)}).loose(),I({ok:R(!1),error:e3}).loose()]),Yse=to(`ok`,[I({ok:R(!0),available:P()}).loose(),I({ok:R(!1),error:e3}).loose()]),Xse=L([`public`,`private`]),Zse=I({owner:M().min(1),name:M().min(1),visibility:Xse,description:M().optional()}).loose(),Qse=L([`name-conflict`,`saml-sso`,`auth-required`,`push-failed`,`init-failed`,`network`,`no-project`]),$se=to(`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:Qse}).loose()]);function t3(e){return!(typeof e!=`string`||e.length===0||e.startsWith(`-`)||/[\x00-\x1F\x7F]/.test(e)||/\s/.test(e)||e.includes(`:`)||e.split(`/`).includes(`..`))}const n3=e=>e.refine(t3,`invalid branch name`);function ece(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 tce=[/could not read (username|password)/i,/terminal prompts disabled/i,/user interactivity has been disabled/i,/unable to get password from user/i],nce=[/insufficient scopes/i,/missing.*scope/i,/required scope/i],rce=[/permission denied.*\(publickey\)/i,/host key verification failed/i],r3=/fatal:.*repository.*not found/i,ice=[/\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,r3];function ace(e){if(typeof e!=`object`||!e)return``;let t=e.git;return t==null?``:String(t)}function oce(e){if(e==null)return{kind:`non-auth`};let t=`${e instanceof Error?e.message:String(e)}\n${ace(e)}`;return tce.some(e=>e.test(t))?{kind:`auth`,subclass:`no-credential`}:nce.some(e=>e.test(t))?{kind:`auth`,subclass:`scope-mismatch`}:rce.some(e=>e.test(t))?{kind:`auth`,subclass:`ssh-auth`}:ice.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`}:r3.test(t)?{kind:`auth`,subclass:`not-found-as-identity`}:{kind:`auth`,subclass:`unknown-auth`}:{kind:`non-auth`}}function sce(e){return e.kind===`auth`?e.subclass===`no-credential`||e.subclass===`401`||e.subclass===`unknown-auth`:!1}const i3={shareTargetExists:P(),dirtyConflicts:I({conflicts:P(),files:F(M().min(1))}).loose(),branchIsLocal:P(),shareTargetOnOriginBranch:P().optional()},cce=to(`detached`,[I({detached:R(!1),currentBranch:M().min(1).nullable(),currentHeadSha:qa(),...i3}).loose(),I({detached:R(!0),currentBranch:qa(),currentHeadSha:M().min(1),...i3}).loose()]),lce=I({branch:n3(M().min(1)),principalId:M().optional(),fastForward:P().optional()}).loose(),uce=L([`dirty-conflict`,`branch-not-found`,`fetch-failed`,`checkout-failed`,`branch-in-other-worktree`,`ff-diverged`,`unsafe-symlinks`,`symlink-check-failed`]),dce=to(`ok`,[I({ok:R(!0)}).loose(),I({ok:R(!1),reason:uce,files:F(M().min(1)).optional(),otherWorktreePath:M().min(1).optional(),refusedSymlinkPaths:K4.optional()}).loose()]);L([`on-origin`,`renamed`,`deleted`,`never-on-branch`,`changed-locally`,`unknown`]);const fce=I({branch:n3(M().min(1)),path:M(),kind:L([`doc`,`folder`]),contentRootDepth:N().int().min(1).max(65535).optional()}).loose(),pce=to(`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`}),mce=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()}),hce=I({serverInstanceId:M().min(1),currentBranch:M().min(1).optional(),currentDiskAckSVs:io(M().min(1),M().min(1)).optional(),boot:mce.optional(),collabClients:N().int().nonnegative().optional()}).loose(),gce=I({id:M().min(1),display_name:M().min(1),display_email:M(),source:L([`git-config`,`synthesized`]),created_at:M().min(1)}).loose(),_ce=I({collabUrl:M().nullable(),previewUrl:M().nullable(),port:N(),singleFile:P().default(!1)}).loose(),a3=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:links-not-permitted.urn:ok:error:method-not-allowed.urn:ok:error:invalid-request.urn:ok:error:unsupported-media-type.urn:ok:error:payload-too-large.urn:ok:error:request-timeout.urn:ok:error:internal-server-error.urn:ok:error:derived-index-unavailable.urn:ok:error:loopback-required.urn:ok:error:invalid-origin.urn:ok:error:url-not-allowed.urn:ok:error:dir-outside-home.urn:ok:error:concurrent-operation.urn:ok:error:clone-failed.urn:ok:error:clone-timeout.urn:ok:error:server-start-failed.urn:ok:error:reserved-doc-name.urn:ok:error:target-not-found.urn:ok:error:stale-target.urn:ok:error:frontmatter-edit-not-supported.urn:ok:error:invalid-frontmatter-patch.urn:ok:error:frontmatter-malformed.urn:ok:error:no-active-session.urn:ok:error:too-many-agent-sessions.urn:ok:error:disk-divergence.urn:ok:error:stale-external-write.urn:ok:error:store-refused.urn:ok:error:doc-removed.urn:ok:error:doc-not-found.urn:ok:error:doc-already-exists.urn:ok:error:doc-not-open.urn:ok:error:rollback-not-configured.urn:ok:error:doc-not-available.urn:ok:error:backlink-index-not-configured.urn:ok:error:file-rescan-not-configured.urn:ok:error:shadow-not-configured.urn:ok:error:host-not-allowed.urn:ok:error:principal-not-available.urn:ok:error:not-found.urn:ok:error:auth-failed.urn:ok:error:no-project-dir.urn:ok:error:non-github-origin.urn:ok:error:server-open-failed.urn:ok:error:doc-in-conflict.urn:ok:error:concurrent-overwrite-refused.urn:ok:error:unresolved-conflict-markers.urn:ok:error:no-conflict-tracked.urn:ok:error:no-blocking-changes.urn:ok:error:sync-not-active.urn:ok:error:project-repo-not-configured.urn:ok:error:seed-prerequisite-missing.urn:ok:error:seed-invalid-root.urn:ok:error:tag-index-not-configured.urn:ok:error:template-not-found.urn:ok:error:unsupported-asset-type.urn:ok:error:asset-not-found.urn:ok:error:single-file-mode.urn:ok:error:collab-server-not-running.urn:ok:error:gateway-timeout.urn:ok:error:cursor-not-installed.urn:ok:error:cursor-spawn-timeout.urn:ok:error:cursor-spawn-failed.urn:ok:error:handoff-target-not-installed.urn:ok:error:handoff-spawn-timeout.urn:ok:error:handoff-spawn-failed.urn:ok:error:registry-unreachable.urn:ok:error:config-not-writable.urn:ok:error:audit-superseded.urn:ok:error:theme-name-taken.urn:ok:error:theme-name-invalid`.split(`.`));function vce(e){throw Error(`Unexpected ProblemType variant: ${JSON.stringify(e)}`)}const o3=I({type:a3,title:M().min(1),status:N().int().min(400).max(599),instance:M().regex(_se,`instance must be urn:uuid:<uuid>`).optional(),detail:M().optional()}).loose(),yce=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(),bce=I({src:M().min(1),path:M().min(1).optional(),deduped:P().optional()}).loose(),xce=I({url:M().min(1),dir:M().min(1),branch:M().min(1).refine(t3,`invalid branch name`).optional()}).loose(),Sce=I({type:R(`error`),problem:o3}).loose();function s3(e,t){let n=t.map(e=>[Op(e),e]);for(let t of e){let e=Op(t);if(e===null)continue;let r=n.find(([t])=>t===e);if(r!==void 0)return r[1]}}function Cce(e){let{override:t,storedPreference:n,preferenceList:r,supportedLocales:i}=e,a=e.autoDetectableLocales??i;if(t!==void 0){let e=s3([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=s3(r,a);return o===void 0?{locale:`en`,source:`fallback`}:{locale:o,source:`system`}}function c3(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e===45||e===95}function wce(e){if(!e.includes(`eyJ`))return null;let t=[],n=[];for(let r=0;r<e.length;r+=1)if(c3(e.charCodeAt(r))){for(t.push(r);r<e.length&&c3(e.charCodeAt(r));)r+=1;n.push(r)}let r=[];for(let t=e.indexOf(`eyJ`);t!==-1;t=e.indexOf(`eyJ`,t+1))r.push(t);let i=r=>r+1<t.length&&e[n[r]??-1]===`.`&&t[r+1]===(n[r]??-1)+1,a=[],o=0,s=0;for(let c=0;c+2<t.length;c+=1){let l=t[c]??0,u=n[c]??0;for(;s<r.length&&(r[s]??0)<l;)s+=1;if(!i(c)||!i(c+1))continue;let d=t[c+1]??0,f=n[c+1]??0,p=(n[c+2]??0)-(t[c+2]??0);if(!e.startsWith(`eyJ`,d)||f-d<11||p<8)continue;let m=r[s];m===void 0||m>=u||u-m<11||(a.push(e.slice(o,m),`[REDACTED-JWT]`),o=n[c+2]??e.length,c+=2)}return a.length===0?null:(a.push(e.slice(o)),a.join(``))}function l3(e){return RegExp(`(?:\\b|(?<=(?:\\[|\\u009b)[0-?]*[ -/]*[@-~]))${e.source}`,`g`)}const u3=[{name:`github-pat`,regex:/(ghp_|gho_|ghu_|ghs_|ghr_)[A-Za-z0-9]{36,}\b/g,replacement:`[REDACTED-GH-PAT]`},{name:`aws-access-key`,regex:l3(/(AKIA|ASIA|ABIA)[A-Z2-7]{16}\b/),replacement:`[REDACTED-AWS-KEY]`},{name:`anthropic-key`,regex:/sk-ant-api03-[A-Za-z0-9_-]{20,}\b/g,replacement:`[REDACTED-ANTHROPIC]`},{name:`openai-key`,regex:l3(/sk-[A-Za-z0-9]{20,}\b/),replacement:`[REDACTED-OPENAI]`},{name:`bearer-token`,regex:/([Aa]uthorization:\s*[Bb]earer\s+)(?:\\"[^\s"\\]+\\"|"[A-Za-z0-9\-._~+/=]+"|[^\s"\\]+)/g,replacement:`$1[REDACTED]`},{name:`jwt`,redact:wce},{name:`url-credentials`,regex:/:\/\/[^/\s:@"]+:[^/\s:@"]+@/g,replacement:`://[REDACTED]@`},{name:`github-pat-fine-grained`,regex:/github_pat_[0-9A-Za-z_]{20,}/g,replacement:`[REDACTED-GH-PAT]`},{name:`openai-key-modern`,regex:l3(/sk-(?:proj|svcacct|admin|None)-[A-Za-z0-9_-]{20,}/),replacement:`[REDACTED-OPENAI]`},{name:`slack-token`,regex:/xox[a-z]-[A-Za-z0-9-]{10,}/g,replacement:`[REDACTED-SLACK]`},{name:`google-api-key`,regex:/AIza[0-9A-Za-z_-]{35}/g,replacement:`[REDACTED-GOOGLE]`},{name:`stripe-secret-key`,regex:l3(/(?:sk|rk)_live_[0-9A-Za-z]{16,}\b/),replacement:`[REDACTED-STRIPE]`},{name:`gitlab-pat`,regex:/glpat-[0-9A-Za-z_-]{20,}/g,replacement:`[REDACTED-GITLAB]`},{name:`bearer-token-json`,regex:/("[Aa]uthorization"\s*:\s*"[Bb]earer\s+)(?:\\"[^"\\]+\\"|[^"\\]+)/g,replacement:`$1[REDACTED]`},{name:`macos-home-path`,regex:/\/Users\/[^/"\r]*[^/"\r\\]/g,replacement:`~`},{name:`linux-home-path`,regex:/\/home\/[^/"\r]*[^/"\r\\]/g,replacement:`~`},{name:`windows-home-path`,regex:/[A-Za-z]:\\{1,2}Users\\{1,2}(?:(?![A-Za-z]:\\)[^\\"\r])+/gi,replacement:`~`}],Tce=u3.map(e=>e.name);function d3(e){let t=new Set,n=0;return{redacted:e.split(`
467
467
  `).map(e=>{let r=e,i=!1;for(let e of u3){if(`redact`in e){let n=e.redact(r);if(n===null)continue;t.add(e.name),i=!0,r=n;continue}let{name:n,regex:a,replacement:o}=e;a.lastIndex=0,a.test(r)&&(t.add(n),i=!0,a.lastIndex=0,r=r.replace(a,o))}return i&&n++,r}).join(`
468
468
  `),patterns:[...t],lineCount:n}}function Ece(e){return d3(e).redacted}function Dce(e,t,n=3){let r=RegExp(`^ {0,3}(\\${e}+)[ \\t]*$`),i=Math.max(3,n);for(let e of t.split(`
469
469
  `)){let t=r.exec(e);t&&t[1].length>=i&&(i=t[1].length+1)}return i}function Oce(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(`
@@ -542,7 +542,7 @@ $2`).split(`
542
542
  `),i=$fe(t);return n.map(e=>tpe(e,r,epe(e,i)))}function $fe(e){let t=new Map;return Object.entries(e).forEach(([e,n],r)=>{let i=e.toUpperCase();if(i===`DEFAULT`)return;let a=null;if(n===`error`||n===`warning`)a=n;else if(typeof n==`object`&&n&&!Array.isArray(n)){let e=n.severity;(e===`error`||e===`warning`)&&(a=e)}a!==null&&t.set(i,{entryIndex:r,severity:a})}),t}function epe(e,t){let n;for(let r of e.ruleNames){let e=t.get(r.toUpperCase());e!==void 0&&(n===void 0||e.entryIndex>n.entryIndex)&&(n=e)}return n?.severity??`warning`}function tpe(e,t,n){let[r,i]=e.errorRange??[1,null],a=e.lineNumber-1,o=(r??1)-1,s=t[a]?.length??0,c=i==null?s:Math.min(o+i,s),l=e.fixInfo?[npe(e.fixInfo,e.lineNumber,t)]:void 0;return{range:{start:{line:a,character:o},end:{line:a,character:Math.max(c,o)}},severity:n,source:`markdownlint`,code:e.ruleNames[0]??`MD000`,message:e.errorDetail?`${e.ruleDescription}: ${e.errorDetail}`:e.ruleDescription,...l?{fixes:l}:{}}}function npe(e,t,n){let r=e.lineNumber??t,i=r-1;if(e.deleteCount===-1){if(r<n.length)return{range:{start:{line:i,character:0},end:{line:i+1,character:0}},newText:``};if(i>0){let e=n[i-1]?.length??0;return{range:{start:{line:i-1,character:e},end:{line:i,character:n[i]?.length??0}},newText:``}}return{range:{start:{line:0,character:0},end:{line:0,character:n[0]?.length??0}},newText:``}}let a=(e.editColumn??1)-1;return{range:{start:{line:i,character:a},end:{line:i,character:a+Math.max(0,e.deleteCount??0)}},newText:e.insertText??``}}const rpe=[`no-wiki-links`,`log-shape`,`index-shape`,`reserved-casing`,`frontmatter-required`,`frontmatter-recommended`,`frontmatter-provenance`,`frontmatter-computation`,`frontmatter-reserved-index`,`frontmatter-root-index`,`project-no-mdx`];function g5(e,t){return e?.[t]!==!1}const _5=`.ok/okf`;function v5(e){return`${e.replace(/^frontmatter-/,``)}.schema.json`}function y5(e){return`${_5}/${v5(e)}`}const ipe={$schema:`http://json-schema.org/draft-07/schema#`,title:`OKF v0.2 — required frontmatter`,description:"The OKF v0.2 conformance floor. A bundle is conformant when every non-reserved .md file contains a parseable YAML frontmatter block whose `type` is non-empty. This schema is the whole of that floor: a concept carrying only `type` is fully conformant. Section numbers cite OKF v0.2: https://github.com/GoogleCloudPlatform/open-knowledge-format/blob/ad30107c31c06aec8a7d5636e0d1058118604e6f/SPEC.md#11-conformance",type:`object`,required:[`type`],properties:{type:{type:`string`,pattern:`\\S`,description:"REQUIRED, and the only always-required key in OKF. A short string identifying the kind of concept; consumers use it for routing, filtering, and presentation. Type values are not registered centrally — pick something descriptive and self-explanatory (`BigQuery Table`, `BigQuery Dataset`, `API Endpoint`, `Metric`, `Playbook`, `Reference`, `Attested Computation`). Consumers must tolerate unknown types, typically by treating them as generic concepts. The `\\S` pattern is what makes §11 rule 2 mean what it says, and it replaces a `minLength` rather than joining one: a length check alone accepts a whitespace-only value that no consumer can route on, and having both would report one mistake twice. OKF v0.2 §4.1, §11."}}},ape={$schema:`http://json-schema.org/draft-07/schema#`,title:`OKF v0.2 — recommended frontmatter`,description:"Shapes for the OKF v0.2 recommended keys. Every key here is optional, and nothing is constrained beyond the shape OKF states: declaring a key pins its YAML type when present (so `tags` written as a comma-separated string warns) and advertises it to agents at read time. Section numbers cite OKF v0.2: https://github.com/GoogleCloudPlatform/open-knowledge-format/blob/ad30107c31c06aec8a7d5636e0d1058118604e6f/SPEC.md#41-frontmatter",type:`object`,properties:{title:{type:`string`,description:`Human-readable display name. If omitted, consumers MAY derive a title from the filename. OKF v0.2 §4.1.`},description:{type:`string`,description:"A single sentence summarizing the concept. Used by `index.md` generators, search snippets, and previews. OKF v0.2 §4.1."},resource:{type:`string`,format:`uri-reference`,description:"A URI that uniquely identifies the underlying asset the concept describes. Absent for concepts that describe abstract ideas rather than physical resources. Path-valued: an absolute URL, a bundle-relative path beginning with `/`, or an ordinary relative path — hence `uri-reference`, not `uri`, which would reject `/tables/customers.md`. OKF v0.2 §4.1, §6.2."},tags:{type:`array`,items:{type:`string`},description:`A YAML list of short strings for cross-cutting categorization. Tags stay a first-class concept through this field; OKF specifies no separate per-tag file format, so a consumer that wants a tag-browsing view synthesizes one by scanning frontmatter. OKF v0.2 §3.1, §4.1.`},timestamp:{description:"LEGACY (OKF v0.1), superseded by `generated.at` in v0.2 — one of the two deliberate breaking changes. Consumers MAY fall back to it when `generated` is absent; new documents SHOULD write `generated: { by, at }` instead. Documented here so agents are told what it is and what replaced it, but deliberately left unconstrained: v0.2 does not define it as a producer field, so validating its shape would be a rule OKF no longer has. OKF v0.2 §5.2, §13.1."}}},ope={$schema:`http://json-schema.org/draft-07/schema#`,title:`OKF v0.2 — provenance, trust, and lifecycle frontmatter`,description:'The optional OKF v0.2 families that make "where did this come from", "how much should I trust it", and "is it still current" answerable from frontmatter alone. Every key is optional, and absence carries meaning rather than being an error: a concept with no `verified` is unverified, and a consumer must not reject it. Only `sources[].resource` and `generated.by` are required-when-their-parent-is-present, because those are the two fields OKF marks REQUIRED in this family; every other field is described but not mandated, so nothing else is enforced. Section numbers cite OKF v0.2: https://github.com/GoogleCloudPlatform/open-knowledge-format/blob/ad30107c31c06aec8a7d5636e0d1058118604e6f/SPEC.md#5-provenance-trust-and-lifecycle',type:`object`,properties:{sources:{type:`array`,description:"The materials this concept derives from, external or internal to the bundle. Lineage is expressed through links rather than a dedicated field: when an entry's `resource` points at another OKF concept, the derivation edge already exists in the bundle graph, so a consumer may recurse into that source's own `sources`. OKF v0.2 §5.1.",items:{type:`object`,required:[`resource`],properties:{resource:{type:`string`,description:"REQUIRED within an entry. Either a concrete artifact a consumer can follow (an absolute URL, a bundle-relative path, or a path into a `references/` subdirectory) or a population or scope descriptor it cannot, for example `all queries in BigQuery project X`. Deliberately NOT format-constrained: a scope descriptor is prose, so a `uri-reference` check here would warn on conformant documents. OKF v0.2 §5.1, §6.2, §6.3."},id:{type:`string`,description:"Optional. A stable key used to attribute individual claims: a markdown footnote whose label is this id (`[^ga4-schema]`) attributes the claim it follows. SHOULD be present when the body cites the source. Keyed rather than positional because agents constantly rewrite these documents — a positional index misattributes silently the moment the list is reordered. OKF v0.2 §5.1."},title:{type:`string`,description:`Optional. Human-readable label for the source. OKF v0.2 §5.1.`},author:{type:`string`,description:"Optional credibility signal — an authority signal: who or what produced the source. OKF describes this as following the actor convention (§7), but its own examples use a `team:<id>` prefix that the three §7 forms do not cover, so no pattern is enforced. OKF v0.2 §5.1, §7."},usage_count:{type:`integer`,description:"Optional credibility signal — an adoption and liveness signal: how often `resource` was exercised (dashboard views, query executions, page reads) over `usage_window`. For a single artifact it is that artifact's own exercise count; for a scope descriptor it is the number of exercises within the scope that touch the concept. Coarse by design: comparable at the alive-versus-dead and order-of-magnitude level and against a source's own history, but not a precise cross-kind ranking. Read as liveness and trend, not as a score. OKF v0.2 §5.1."},last_modified:{type:`string`,format:`date-time`,description:"Optional credibility signal — a recency signal: when the source itself last changed, as an ISO 8601 datetime with an explicit UTC offset (`2026-06-15T00:00:00Z`). Distinct from `generated.at`, which records when the concept was written. OKF v0.2 §5, §5.1."},usage_window:{type:`object`,description:"Optional per-entry override of the `usage_window` written as a sibling of `sources`. OKF v0.2 §5.1.",properties:{from:{type:`string`,format:`date-time`,description:"Start of the window framing this entry's `usage_count`, as an ISO 8601 datetime with an explicit UTC offset (`2026-06-01T00:00:00Z`). OKF v0.2 §5, §5.1."},to:{type:`string`,format:`date-time`,description:"End of the window framing this entry's `usage_count`, as an ISO 8601 datetime with an explicit UTC offset (`2026-06-30T00:00:00Z`). OKF v0.2 §5, §5.1."}}}}}},usage_window:{type:`object`,description:"Written once as a sibling of `sources`, this frames every `usage_count` in the list with a `{ from, to }` range. A single entry may carry its own `usage_window` to override it. OKF v0.2 §5, §5.1.",properties:{from:{type:`string`,format:`date-time`,description:"Start of the shared usage window, as an ISO 8601 datetime with an explicit UTC offset (`2026-06-01T00:00:00Z`). OKF v0.2 §5, §5.1."},to:{type:`string`,format:`date-time`,description:"End of the shared usage window, as an ISO 8601 datetime with an explicit UTC offset (`2026-06-30T00:00:00Z`). OKF v0.2 §5, §5.1."}}},generated:{type:`object`,required:[`by`],description:"How the current content was produced. Kept distinct from `verified` because who wrote a concept need not be who confirmed it. OKF v0.2 §5.2.",properties:{by:{type:`string`,description:"REQUIRED within `generated`. An actor in the OKF convention: `<producer>/<version>` for agents and tools (`reference_agent/gemini-2.5-pro`), `human:<id>` for a person (`human:ahormati`), or `process:<id>` for an automated process (`process:finance-nightly`). Consumers that classify trust key off the `human:` prefix, so producers MUST use it for hand-authored or human-confirmed content — a rule about which form to pick for which content, which frontmatter alone cannot check, so the three forms are documented here rather than enforced by a pattern. OKF v0.2 §5.2, §7."},at:{type:`string`,format:`date-time`,description:"An ISO 8601 datetime with an explicit UTC offset (`2026-06-30T14:00:00Z`) marking the content's last meaningful change. Consumers use it to tell a recent edit from a stale fact. Supersedes v0.1's top-level `timestamp`. OKF v0.2 §5, §5.2, §13.1."}}},verified:{description:'Who or what has confirmed the content against its sources or `resource` — a list of verification events. Multiple entries capture independent checks, for example a human sign-off plus a nightly process; "how recently" is the latest `at`. Independent of `generated.at`: content can change without re-confirmation, and facts can be re-confirmed without regeneration. A single verifier MAY be written as one bare `{ by, at }` mapping without the list dash, and consumers MUST treat that as a one-element list — hence the two accepted shapes here. Absence means unverified, which is a valid state, never a rejection. OKF v0.2 §5.2, §5.3, §11.',anyOf:[{type:`object`,description:`The bare single-verifier mapping form. OKF v0.2 §5.2.`,properties:{by:{type:`string`,description:"The verifying actor: `<producer>/<version>`, `human:<id>`, or `process:<id>`. A `human:` verifier is what raises the trust tier to human-reviewed; non-human verifiers alone yield machine-confirmed. OKF v0.2 §5.2, §5.3, §7."},at:{type:`string`,format:`date-time`,description:"An ISO 8601 datetime with an explicit UTC offset (`2026-07-01T09:00:00Z`) recording when the verification event happened. OKF v0.2 §5, §5.2."}}},{type:`array`,description:`The list form: one entry per independent verification event. OKF v0.2 §5.2.`,items:{type:`object`,properties:{by:{type:`string`,description:"The verifying actor: `<producer>/<version>`, `human:<id>`, or `process:<id>`. A `human:` verifier is what raises the trust tier to human-reviewed; non-human verifiers alone yield machine-confirmed. OKF v0.2 §5.2, §5.3, §7."},at:{type:`string`,format:`date-time`,description:"An ISO 8601 datetime with an explicit UTC offset (`2026-07-01T09:00:00Z`) recording when the verification event happened. OKF v0.2 §5, §5.2."}}}}]},status:{enum:[`draft`,`stable`,`deprecated`],description:"Lifecycle state. `draft` = not yet reviewed, possibly incomplete. `stable` = ready for consumption. `deprecated` = kept for links and history, no longer current. Absent means `stable`, so the key is only worth writing to say draft or deprecated. These three values are the whole set OKF defines, which is why this is the pack's only enum. OKF v0.2 §5.4."},stale_after:{type:`string`,format:`date-time`,description:"An absolute instant, an ISO 8601 datetime with an explicit UTC offset (`2026-12-31T00:00:00Z`): the concept is stale when `now >= stale_after`. Absolute rather than a relative TTL so staleness stays a plain comparison with no reference to when the concept was read. An instant in the past is a freshness signal for consumers, not a violation. OKF v0.2 §5, §5.5, §10.5."}}},spe={$schema:`http://json-schema.org/draft-07/schema#`,title:`OKF v0.2 — Attested Computation frontmatter`,description:'Shapes for the OKF v0.2 computation keys, which turn a concept into a sanctioned way to compute a value so a consumer can confirm the agent ran the blessed computation instead of improvising its own. Provenance answers "where did this claim come from"; attestation answers "was this number produced the way we said it must be". This file also carries the one value-shaped rule in the pack: `runtime` is the single key OKF marks REQUIRED here, and only when `type` is `Attested Computation`. Ordinary concepts never match that condition and are unaffected, and no other key in the family is mandated. OKF records the computation and the means to check it and executes nothing itself; receipts and verdicts are runtime artifacts that are never stored in the bundle. Section numbers cite OKF v0.2: https://github.com/GoogleCloudPlatform/open-knowledge-format/blob/ad30107c31c06aec8a7d5636e0d1058118604e6f/SPEC.md#10-attested-computations-concept',type:`object`,if:{required:[`type`],properties:{type:{const:`Attested Computation`,description:"The condition, not a constraint: everything in `then` applies only to documents whose `type` is exactly `Attested Computation`. An ordinary concept never matches, so nothing in this schema is ever asked of it. `type` is also required inside the condition so a document with no type at all fails the conformance floor once, rather than also being told it is missing a `runtime` for a type it never claimed."}}},then:{required:[`runtime`]},properties:{runtime:{type:`string`,description:"REQUIRED for `type: Attested Computation`. The single field that says how to run the computation, and therefore how the executor and attester interpret it and what `parameters` mean — a parameter is a SQL bind variable, a dbt var, or a Python argument depending on the runtime. Keeping `runtime` and `parameters` in one frontmatter is what makes the binding semantics self-evident. Example values: `bigquery`, `postgres`, `dbt`, `python`, `Looker`. Not a closed set, so no enum. OKF v0.2 §10.1, §10.2."},parameters:{type:`array`,description:`The typed, named holes the agent may fill. An agent MAY only supply values for these parameters; it MUST NOT author or edit the computation. That parameter-only surface is what makes "did the sanctioned thing run" a mechanical comparison rather than a judgement call. OKF v0.2 §10.2, §10.3.`,items:{type:`object`,properties:{name:{type:`string`,description:"The parameter name the computation binds, for example `year` bound as `@year` in BigQuery SQL or `{{ var('year') }}` in dbt. OKF v0.2 §10.2, §10.3."},type:{type:`string`,description:"The parameter's type, interpreted by `runtime` (`integer`, `string`, and so on). Deliberately not constrained to JSON Schema type names, because the vocabulary belongs to the runtime. OKF v0.2 §10.2."},required:{type:`boolean`,description:`Whether the agent must supply a value for this parameter. OKF v0.2 §10.2.`}}}},computation:{type:`string`,format:`uri-reference`,description:"Optional. A path to a file holding the computation, used instead of an inline body fence — best for a long or generated computation, or one already kept as a real file shared with non-OKF tooling. When absent, the body's `# Computation` fence IS the computation. Path-valued: an absolute URL, a bundle-relative path beginning with `/`, or a relative path. OKF v0.2 §6.2, §10.2, §10.3."},executor:{type:`object`,description:"How the computation is run. A runner — an agent, or deterministic consumer code — follows `resource`, and the run returns a receipt shaped by `receipt`. Binding the computation with the parameter values into the executable artifact is the consumer's job. OKF v0.2 §10.2, §10.5.",properties:{resource:{type:`string`,format:`uri-reference`,description:"Names the run instructions or code. What sits behind it — a Skill, a script, a container — is a packaging choice; OKF fixes the interface, not the packaging. Conventionally points into a `references/` subdirectory, for example `references/skills/run-on-bq.md`. OKF v0.2 §1, §6.2, §6.3, §10.2."},receipt:{type:`array`,items:{type:`string`},description:"Declares the fields a run must return — the evidence the attester inspects, for example `[job_id, executed_sql, result]` for BigQuery or `[run_id, compiled_sql, result]` for dbt. Because the attester compares the expanded, compiled artifact the receipt carries, a rewritten query, a swapped computation file, or a mutated dependency fails the check. The receipt itself is a runtime artifact and is never stored in the bundle. OKF v0.2 §10.2, §10.3, §10.5."}}},attester:{type:`object`,description:"The deterministic check that inspects a receipt and returns a verdict. Meant to run consumer-side. Distinct from `verified`: `verified` confirms the definition still matches policy and is recorded in the bundle, while attestation confirms a single run produced the value the sanctioned way and is not stored. OKF v0.2 §10.2, §10.6.",properties:{resource:{type:`string`,format:`uri-reference`,description:"Names code — no LLM — that takes a receipt and returns a verdict, independently re-deriving the binding of `computation` with the claimed parameter values to compare against what actually ran. Conventionally points into a `references/` subdirectory, for example `references/attesters/sql-equality.py`. OKF v0.2 §6.2, §6.3, §10.2, §10.3."}}}}},cpe={$schema:`http://json-schema.org/draft-07/schema#`,title:`OKF v0.2 — index files carry no frontmatter`,description:"`index.md` is a reserved filename at any level of the hierarchy and must not be used for a concept document. Index files contain no frontmatter, with exactly one exception — a bundle-root `index.md` may carry `okf_version` — which the scope carves out with a `!index` exclusion rather than a keyword here. `maxProperties: 0` is the mechanism rather than the boolean schema `false`, because a document with no frontmatter block validates as `{}` and `false` would reject that too, flagging the very documents that are correct. `log.md` is deliberately NOT covered: §9 constrains a log's date headings, ordering, and prose entries but never its frontmatter, and OKF's own reference bundle ships a `log.md` carrying `type` and `title`. Section numbers cite OKF v0.2: https://github.com/GoogleCloudPlatform/open-knowledge-format/blob/ad30107c31c06aec8a7d5636e0d1058118604e6f/SPEC.md#8-index-files",type:`object`,maxProperties:0},lpe={$schema:`http://json-schema.org/draft-07/schema#`,title:`OKF v0.2 — bundle-root index.md`,description:"The bundle-root `index.md` is the only index file OKF permits frontmatter in, and `okf_version` is the key it names there. OKF states the declaration as a MAY, so it is not required here. Nor is the frontmatter closed to other keys: §8 grants the exception for `okf_version` specifically, but §11 tells consumers not to reject a bundle over unknown additional keys, and that ambiguity is resolved in favor of the looser reading. The one thing pinned is the value's shape, because a YAML float is provably lossy where a version string is not. Section numbers cite OKF v0.2: https://github.com/GoogleCloudPlatform/open-knowledge-format/blob/ad30107c31c06aec8a7d5636e0d1058118604e6f/SPEC.md#12-versioning",type:`object`,properties:{okf_version:{type:`string`,pattern:`^[0-9]+\\.[0-9]+$`,description:'The OKF version this bundle targets, as `<major>.<minor>` — currently `"0.2"`. Quote it: unquoted `0.2` parses as a YAML number, so a consumer comparing version strings sees a float instead, and `0.10` would silently become `0.1`. A minor bump is backward-compatible additions; a major bump may rename required fields or change reserved filenames. Consumers that do not understand the declared version should attempt best-effort consumption rather than refusing the bundle. OKF v0.2 §12.'}}},b5=[`**`,`!**/{index,log}`],x5=[{id:`frontmatter-required`,appliesTo:b5,schema:ipe},{id:`frontmatter-recommended`,appliesTo:b5,schema:ape},{id:`frontmatter-provenance`,appliesTo:b5,schema:ope},{id:`frontmatter-computation`,appliesTo:b5,schema:spe},{id:`frontmatter-reserved-index`,appliesTo:[`**/index`,`!index`],schema:cpe},{id:`frontmatter-root-index`,appliesTo:[`index`],schema:lpe}],upe=Object.fromEntries(rpe.filter(e=>!x5.some(t=>t.id===e)).map(e=>[e,!1]));function S5(e,t){return t===void 0?[]:x5.filter(n=>g5(e,n.id)&&n5([...n.appliesTo]).matches(t))}function dpe(e){return x5.filter(t=>g5(e,t.id)).map(e=>({appliesTo:[...e.appliesTo],file:y5(e.id)}))}function fpe(e,t,n){let r=S5(t,n);return r.length===0?[]:h5(e,r.map(e=>({file:y5(e.id),schema:e.schema,ruleId:e.id})),{source:`okf`})}function C5(e,t){return cq(`okf:${e}`,(n,r)=>{try{t(n,r)}catch(t){console.warn(`[lint] OKF rule "${e}" failed${r.data.okfDocName?` on "${r.data.okfDocName}"`:``}`,t)}})}function w5(e,t,n){let r=n5(t);return C5(e,(e,t)=>{r.matches(t.data.okfDocName)&&n(e,t)})}const T5=e=>({line:e.line-1,character:e.column-1});function ppe(e,t){if(e&&`start`in e)return{start:T5(e.start),end:T5(e.end)};if(e){let n=T5(e);return{start:n,end:{line:n.line,character:t[n.line]?.length??0}}}return{start:{line:0,character:0},end:{line:0,character:t[0]?.length??0}}}function mpe(e,t){return{range:ppe(e.place,t),severity:`warning`,source:`okf`,code:e.ruleId??`okf`,message:e.reason}}function hpe(e,t,n){if(t.length===0)return[];let r=JL().use(Uz).use(zL).use(HR,[`yaml`]);for(let e of t)r.use(e);let i=new yj({value:e});n!==void 0&&(i.data.okfDocName=n);let a=r.parse(i);r.runSync(a,i);let o=e.split(`
543
543
  `);return i.messages.map(e=>mpe(e,o))}function gpe(e){let t=!1;return Jj(e,[`link`,`linkReference`],()=>(t=!0,!1)),t}const _pe=w5(`index-shape`,`**/index`,(e,t)=>{let n=!1;for(let r of e.children){if(r.type===`heading`){n=!0;continue}r.type===`list`&&!n&&t.message(`This index list is not under a section heading, so an Open Knowledge Format consumer reading the file as navigation has no name to file its entries under — an index is one or more heading-led sections of bulleted links.`,r)}Jj(e,`listItem`,e=>{e.children.some(e=>e.type===`list`)||gpe(e)||t.message(`This index entry has no link, so an Open Knowledge Format consumer reading the file as navigation has nowhere to follow it. Every entry in the format's own reference bundles is a link followed by a short description.`,e)})}),vpe=/^\s*(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])(?!\d)/;function ype(e,t,n){let r=new Date(Date.UTC(e,t-1,n));return r.getUTCFullYear()===e&&r.getUTCMonth()===t-1&&r.getUTCDate()===n}const bpe=/^\s*\d{4}[-/.]\d{1,2}[-/.]\d{1,2}/;function E5(e){let t=e.trim();return t.length>60?`${t.slice(0,59)}…`:t}const xpe=w5(`log-shape`,`**/log`,(e,t)=>{let n;Jj(e,`heading`,e=>{if(e.depth!==2)return;let r=Xj(e),i=vpe.exec(r);if(!i){t.message(bpe.test(r)?`Log date heading "${E5(r)}" is not in ISO 8601 YYYY-MM-DD form, the one form an Open Knowledge Format log requires of its date headings.`:`Log entry heading "${E5(r)}" is not a date, so it falls outside the dated-entry format an Open Knowledge Format consumer reads a log as — nothing under it reaches the change-history timeline.`,e);return}let a=`${i[1]}-${i[2]}-${i[3]}`;if(!ype(Number(i[1]),Number(i[2]),Number(i[3]))){t.message(`Log date heading "${a}" is not a real calendar date, so it is not ISO 8601 — the one form an Open Knowledge Format log requires of its date headings.`,e);return}n!==void 0&&a>n&&t.message(`Log date heading "${a}" is newer than the entry above it — an Open Knowledge Format log is a flat list of date-grouped entries, newest first.`,e),n=a})}),Spe=/\[\[[^[\]\n]+\]\]/g;function Cpe(e){let t=`Wiki-link ${e} won't resolve for an external Open Knowledge Format consumer — it renders as literal text and its graph edge is lost.`;return e.includes(`|`)?`${t} The alias "|" also splits a GFM table cell.`:t}const wpe=C5(`no-wiki-links`,(e,t)=>{let n=typeof t.value==`string`?t.value:String(t.value);Jj(e,`text`,e=>{let r=e.position?.start,i=e.position?.end,a=r?.offset,o=a===void 0||i?.offset===void 0?e.value:n.slice(a,i.offset),s=0,c=r?.line??0,l=r?.column??0,u=e=>{for(;s<e;s+=1)o[s]===`
544
544
  `?(c+=1,l=1):l+=1;return{line:c,column:l}};for(let e of o.matchAll(Spe)){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(Cpe(e[0]),s)}})}),Tpe=[`index`,`log`],Epe=C5(`reserved-casing`,(e,t)=>{let n=t.data.okfDocName;if(n===void 0)return;let r=g2(n),i=r.toLowerCase();Tpe.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.`)}),D5=[{id:`no-wiki-links`,rule:wpe},{id:`log-shape`,rule:xpe},{id:`index-shape`,rule:_pe},{id:`reserved-casing`,rule:Epe}],Dpe=D5.map(e=>e.rule);function Ope(e){return e===void 0?Dpe:D5.filter(t=>g5(e,t.id)).map(e=>e.rule)}const kpe=eo([P(),L(Sf),io(M(),Ja())]),Ape={id:`markdownlint`,sliceSchema:I({enabled:P(),rules:io(M(),kpe)}),defaultSlice:{enabled:!1,rules:$8},async lint(e,t){return Qfe(e,e5(t.rules))},fix(e,t){return Zfe(e,e5(t.rules))}},jpe=I({appliesTo:eo([M(),F(M())]).optional(),file:M(),enabled:P().optional(),key:M().optional(),schema:io(M(),Ja()).optional()}),O5=[Ape,{id:`frontmatter`,sliceSchema:I({enabled:P(),schemas:F(jpe)}),defaultSlice:{enabled:!1,schemas:[]},async lint(e,t,n){return h5(e,r5(t.schemas,n.docName))},frontmatter:{schemasForDoc:(e,t)=>r5(e.schemas,t),narrowSliceToFrontmatter:e=>e,advertisedMappings:e=>e.schemas}},{id:`okf`,sliceSchema:I({enabled:P(),rules:io(M(),P()).optional(),generate:I({index:P().optional()}).optional()}),defaultSlice:{enabled:!1},async lint(e,t,n){return[...hpe(e,Ope(t.rules),n.docName),...fpe(e,t.rules,n.docName)]},frontmatter:{schemasForDoc:(e,t)=>S5(e.rules,t),narrowSliceToFrontmatter:e=>({...e,rules:{...e.rules,...upe}}),advertisedMappings:e=>dpe(e.rules)}}],Mpe={enabled:!0,plugins:Object.fromEntries(O5.map(e=>[e.id,e.defaultSlice]))};function k5(e,t){return e.enabled&&e.plugins[t]?.enabled===!0}function Npe(e){if(!e?.enabled)return[];let t=[];for(let n of O5){if(n.frontmatter===void 0)continue;let r=e.plugins[n.id];r?.enabled===!0&&t.push(...n.frontmatter.advertisedMappings(r))}return t}const Ppe=I({docName:U4,summary:G4,content:M().optional(),...W4}).loose(),Fpe=I({docName:U4,summary:G4,markdown:M(),position:L([`append`,`prepend`,`replace`]).optional(),extension:L(X0).optional(),...W4}).loose(),Ipe=I({docName:U4,summary:G4,find:M().min(1),replace:M(),offset:N().int().nonnegative().optional(),...W4}).loose(),Lpe=I({docName:U4,connectionId:M().min(1),scope:L([`last`,`session`,`file`,`count`]).optional(),count:N().int().positive().optional(),...W4}).loose().refine(e=>e.scope!==`count`||e.count!==void 0,{message:`count is required when scope is 'count'`,path:[`count`]}),A5=I({value:M(),truncatedFrom:N().int().nonnegative().optional(),hint:M().optional()}).loose(),Rpe=to(`kind`,[I({kind:R(`inline`),content:M()}),I({kind:R(`truncated`),byteLength:N().int().nonnegative(),hint:M()})]),j5=I({kind:R(`content-divergence`),intendedBytes:N().int().nonnegative(),actualBytes:N().int().nonnegative(),byteDelta:N().int(),divergenceType:M().optional(),currentState:Rpe.optional(),hint:M().optional()}).loose(),zpe=I({type:R(`orphan`),parentCandidates:F(M()),message:M()}).loose(),M5=I({kind:R(`disk-edit-reconciled`),intendedBytes:N().int().nonnegative(),actualBytes:N().int().nonnegative(),byteDelta:N().int(),mergeOutcome:M().optional(),hint:M().optional()}).loose();to(`kind`,[j5,M5]);const N5=Object.keys({"content-divergence":!0,"disk-edit-reconciled":!0});function Bpe(e){return N5.includes(e)}function Vpe(e){throw Error(`Unexpected WriteWarning variant: ${JSON.stringify(e)}`)}const Hpe=I({kind:R(`mermaid-parse-error`),fenceIndex:N().int().positive(),fenceFirstLine:M(),message:M(),line:N().int().positive().optional()}).loose(),P5=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(),F5=to(`kind`,[j5,M5,Hpe,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:P5.optional()}).loose()]),I5=F(F5).min(1),L5=I({href:M(),resolvedTo:M().nullable(),reason:L([`no-such-doc`,`no-such-file`,`unresolvable`]),localTarget:P5.optional()}).loose(),R5=F(L5),Upe=[`reserved-log-policy`],z5=I({reason:M().min(1),count:N().int().positive()}).loose(),Wpe=I({timestamp:M().min(1),summary:A5.optional(),warnings:I5.optional()}).loose(),Gpe=I({timestamp:M().min(1),subscriberCount:N().int().nonnegative(),systemSubscriberCount:N().int().nonnegative(),hints:F(zpe).optional(),summary:A5.optional(),warnings:I5.optional(),brokenLinks:R5,brokenLinkSuppression:z5.optional()}).loose(),Kpe=I({timestamp:M().min(1),subscriberCount:N().int().nonnegative(),systemSubscriberCount:N().int().nonnegative(),summary:A5.optional(),warnings:I5.optional(),brokenLinks:R5,brokenLinkSuppression:z5.optional()}).loose(),qpe=I({docName:M().min(1),scope:L([`last`,`session`,`count`]),undone:P()}).loose(),Jpe=I({docs:F(I({docName:gse,markdown:M(),position:L([`append`,`prepend`,`replace`]).optional(),extension:L(X0).optional(),summary:G4}).loose()).min(1).max(100),...W4}).loose(),Ype=I({type:a3,title:M(),detail:M().optional()}).loose(),Xpe=to(`status`,[I({status:R(`written`),docName:M().min(1),summary:A5.optional(),warnings:I5.optional(),brokenLinks:R5,brokenLinkSuppression:z5.optional()}).loose(),I({status:R(`error`),docName:M().min(1),error:Ype}).loose()]),Zpe=I({timestamp:M().min(1),results:F(Xpe),written:N().int().nonnegative(),failed:N().int().nonnegative()}).loose(),Qpe=I({docName:U4,patch:io(M(),eo([$c,qa()])),types:io(M(),L(Xc)).optional(),summary:G4,...W4}).loose(),$pe=I({timestamp:M().min(1),subscriberCount:N().int().nonnegative(),systemSubscriberCount:N().int().nonnegative(),appliedKeys:F(M()),summary:A5.optional(),warnings:I5.optional(),brokenLinks:R5,brokenLinkSuppression:z5.optional()}).loose();function eme(e){return{enabled:e.enabled??!0,plugins:{markdownlint:{...e.markdownlint,rules:e.markdownlint.rules??$8},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 tme=Object.fromEntries(O5.map(e=>[e.id,e.sliceSchema])),nme=I({effective:I({enabled:P(),plugins:I(tme)}),configFile:M().nullable().optional(),configProblems:F(M()).optional()}),rme=eo([P(),io(M(),Ja())]),ime=new Set([`__proto__`]),B5=M().min(1).max(256).refine(e=>!ime.has(e),{message:`schema property name cannot be __proto__`}),ame=I({ruleId:M().min(1).max(64).regex(/^[A-Za-z][A-Za-z0-9_-]*$/),value:eo([rme,qa()])}),ome=I({file:M().min(1).max(512),delete:R(!0).optional(),field:B5.optional(),parentPath:F(eo([B5,I({items:R(!0)}).strict()])).max(8).optional(),removeField:R(!0).optional(),renameTo:B5.optional(),constraint:I({type:L([`string`,`number`,`boolean`,`array`,`object`]).nullable().optional(),enum:F(eo([M(),N(),P()])).nullable().optional(),itemsEnum:F(eo([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`}),sme=I({schemas:F(M()),truncated:P()}).strict(),V5=I({line:N(),character:N()}),H5=I({start:V5,end:V5}),U5=I({range:H5,severity:L([`error`,`warning`,`info`,`hint`]),source:M(),code:M(),message:M(),fixes:F(I({range:H5,newText:M()})).optional(),frontmatterScope:L(yf).optional(),frontmatterProperty:M().optional()}),W5=F(M()).optional(),G5=I({file:M(),diagnostics:F(U5),ran:W5,warnings:F(M()).optional()}),cme=I({files:F(G5),fileCount:N(),errorCount:N(),warningCount:N(),warnings:F(M()),ran:W5}),lme=U5.extend({linkTarget:M().optional(),localTarget:P5.optional()}),ume=I({files:F(I({file:M(),diagnostics:F(lme)})),fileCount:N(),errorCount:N(),warningCount:N(),warnings:F(M()),ran:W5,brokenLinkSuppression:z5.optional()}),K5=I({errorCount:N().int().nonnegative(),warningCount:N().int().nonnegative()}),dme=I({files:F(I({file:M(),lint:K5,links:K5})),fileCount:N().int().nonnegative(),errorCount:N().int().nonnegative(),warningCount:N().int().nonnegative(),warnings:F(M()),brokenLinkSuppression:z5.optional()}),fme=I({docName:U4,summary:G4,...W4}).loose(),q5=`Re-lint after fix failed: `;function pme(e){return e.startsWith(q5)}const J5=[`re-lint-threw`,`source-went-blind`];function mme(e){return typeof e==`string`&&J5.includes(e)}const Y5=I({reason:L(J5),message:M().min(1)}),hme=I({file:M(),fixedCount:N(),diagnostics:F(U5),errorCount:N(),warningCount:N(),ran:W5,warnings:F(M()).optional(),diagnosticsArePreFix:P().optional(),reLintFailure:Y5.optional()});function X5(){let e=i5[o5];return`${JSON.stringify({$schema:e,type:`object`},null,2)}\n`}function gme(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 _me(e){let t=e.trim().toLowerCase().split(`/`).pop()??``;return t.endsWith(`.schema.json`)&&t.length>12?!0:gme(e)&&t.endsWith(`.json`)}var Z5=class extends Error{};function Q5(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function $5(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 Z5(`field path items does not exist`);let e={type:`object`};r.items=e,r=e;continue}if(!Q5(e))throw new Z5(`field path items is not an object sub-schema`);r=e;continue}let t=t7(r),i=Object.hasOwn(t,e)?t[e]:void 0;if(i===void 0){if(!n)throw new Z5(`field path ${JSON.stringify(e)} does not exist`);let i={type:`object`};r.properties={...t,[e]:i},r=i;continue}if(!Q5(i))throw new Z5(`field path ${JSON.stringify(e)} is not an object property`);r=i}return r}function vme(e,t,n,r=[]){let i;i=e.trim()===``?JSON.parse(X5()):e7(e);let a=$5(i,r,!0),o=t7(a),s=Object.hasOwn(o,t)?o[t]:void 0,c={...Q5(s)?s:{}};for(let e of[`type`,`enum`,`pattern`,`format`,`description`]){if(!(e in n))continue;let t=n[e];t==null?delete c[e]:c[e]=t}if(`itemsEnum`in n||`itemsType`in n){if(c.items!==void 0&&!Q5(c.items))throw new Z5(`field path items is not an object sub-schema`);let e=Q5(c.items)?{...c.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?c.items=e:delete c.items}if(Object.keys(c).length>0)a.properties={...o,[t]:c};else if(Object.hasOwn(o,t)){let{[t]:e,...n}=o;Object.keys(n).length>0?a.properties=n:delete a.properties}if(n.required!==void 0){let e=n7(a),r=e.includes(t);n.required&&!r?a.required=[...e,t]:!n.required&&r&&r7(a,e.filter(e=>e!==t))}return`${JSON.stringify(i,null,2)}\n`}function e7(e){let t;try{t=JSON.parse(e)}catch(e){throw new Z5(`schema is not valid JSON (${e instanceof Error?e.message:String(e)})`)}if(!Q5(t))throw new Z5(`schema is not a JSON object`);return t}function t7(e){return Q5(e.properties)?e.properties:{}}function n7(e){return Array.isArray(e.required)?e.required.filter(e=>typeof e==`string`):[]}function r7(e,t){t.length>0?e.required=t:delete e.required}function yme(e,t,n=[]){let r=e7(e),i=$5(r,n,!1),a=t7(i);if(Object.hasOwn(a,t)){let{[t]:e,...n}=a;Object.keys(n).length>0?i.properties=n:delete i.properties}return r7(i,n7(i).filter(e=>e!==t)),`${JSON.stringify(r,null,2)}\n`}function bme(e,t,n,r=[]){let i=e7(e),a=$5(i,r,!1),o=t7(a);if(!Object.hasOwn(o,t))throw new Z5(`field ${JSON.stringify(t)} does not exist`);if(Object.hasOwn(o,n))throw new Z5(`field ${JSON.stringify(n)} already exists`);return a.properties=Object.fromEntries(Object.entries(o).map(([e,r])=>[e===t?n:e,r])),r7(a,n7(a).map(e=>e===t?n:e)),`${JSON.stringify(i,null,2)}\n`}function xme(){return x5.map(e=>({path:`${_5}/${v5(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 i7(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 Sme(e){let t=new Set(e.filter(e=>i7(e).ext.toLowerCase()===`.md`).map(e=>e.slice(0,e.lastIndexOf(`.`)))),n=[];for(let r of e){if(i7(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 Cme=[{id:`project-no-mdx`,run:Sme}];function wme(e,t){let n=e.filter(e=>X0.some(t=>e.toLowerCase().endsWith(t)));return n.length===0?[]:Cme.filter(e=>g5(t,e.id)).flatMap(e=>e.run(n))}function a7(e){return`source "${e.source}" ${e.phase} failed`}function Tme(e){let t=e.docName===void 0?``:` on "${e.docName}"`;return`${a7(e)}${t}: ${e.message}`}function Eme(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?Tme(e):`${a7(e)} on ${t.size} documents (first: "${e.docName}"): ${e.message}`)}const Dme=[{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}]}],Ome=(()=>{let e=new Map;for(let t of Dme){e.set(t.id.toUpperCase(),t.id);for(let n of t.aliases)e.set(n.toUpperCase(),t.id)}return e})();function o7(e){return Ome.get(e.toUpperCase())??null}function kme(e,t){let n=o7(t);if(n===null)return;let r;for(let[t,i]of Object.entries(e))o7(t)===n&&(r={key:t,value:i});return r}function Ame(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 jme(e,t){let n=O5.filter(t=>k5(e,t.id)).map(e=>e.id);return t.mode===`audit`&&t.linksValidation!==`off`&&n.push(`links`),n}const s7=`No documents were checked: this scope contains no admitted documents.`;function Mme(e){return e===s7}function Nme(e,t){return t===0?e!==void 0&&e.length>0?[`Checks selected: ${e.join(`, `)}; no document checks ran.`]:[`No document checks ran.`]:e===void 0?[]:e.length===0?[`No checks ran.`]:[`Checks run: ${e.join(`, `)}.`]}async function Pme(e,t,n,r){if(!t.enabled)return[];let i=[];for(let a of O5){if(!k5(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:c7(e)})}}return i}function Fme(e,t,n,r){if(!t.enabled)return e;let i=e;for(let e of O5){if(!k5(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:c7(t)})}}return i}function c7(e){let t=l7(e);return t.length>500?`${t.slice(0,500)}… (truncated)`:t}function l7(e,t=0){if(e instanceof Error)return e.cause===void 0||t>=3?e.message:`${e.message} (cause: ${l7(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 Ime=/\p{M}+/gu,Lme=/[^\p{L}\p{N}]+/gu,Rme=/^-+|-+$/g;function u7(e){return e.trim().normalize(`NFKD`).replace(Ime,``).toLowerCase().replace(Lme,`-`).replace(Rme,``)}function zme(e,t){let n=t.get(e)??0;return t.set(e,n+1),n===0?e:`${e}-${n}`}function Bme(e,t){let n=u7(e);return n?zme(n,t):``}const Vme=new Set([`img`,`video`,`audio`,`mark`,`u`,`ins`]);new Map(P3.flatMap(e=>e.surface===`compat`&&Vme.has(e.rendersAs)?[[e.name,e]]:[])),kF(`<>`),JL().use(Uz).use(zL);const d7=[{tagName:`Mirror`,attrName:`src`,resolution:`bare-doc-name`},{tagName:`Excalidraw`,attrName:`src`,resolution:`doc-relative`}];for(let e of d7){let t=P3.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 Hme=dV(),Ume=kB(),Wme=AB();function Gme(){return P3.filter(e=>e.surface===`canonical`&&e.name!==`*`)}function Kme(){return Gme().filter(e=>{let t=f7(e);return t!==`fence`&&t!==`html`})}function f7(e){return e.name===`MermaidFence`?`fence`:e.name===`HtmlAlignBlock`?`html`:e.hasChildren?`jsx-block`:`jsx-void`}function qme(e){return{id:e.name,displayName:e.displayName??e.name,description:e.description??``,kind:f7(e)}}function Jme(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 Yme(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 Xme(e){let t=[];for(let n of e.props){let e=Jme(n);e!==void 0&&Yme(n,e)&&t.push(p3(n.name,e))}return t}function Zme(e){return Lz(e.exampleBody&&e.exampleBody.trim().length>0?e.exampleBody:`Body content here.`,{extensions:[Hme],mdastExtensions:[Ume]}).children}function Qme(e){let t=f7(e),n;if(t===`fence`)n={type:`code`,lang:`mermaid`,meta:null,value:e.exampleBody&&e.exampleBody.trim().length>0?e.exampleBody:`graph LR
545
- A --> B`};else{let r=Xme(e),i=t===`jsx-block`?Zme(e):[];n={type:`mdxJsxFlowElement`,name:e.name,attributes:r,children:i}}return AP({type:`root`,children:[n]},{extensions:[Wme]}).trimEnd()}function $me(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 ehe(e){return{...qme(e),example:Qme(e),params:$me(e)}}const the=I({intents:F(I({satisfierId:M().min(1),desired:L([`present`,`absent`])}).loose()),...W4,summary:G4}).loose(),nhe=I({satisfierId:M(),agentId:M(),piece:M(),scope:M(),kind:M(),pathId:M().optional(),desired:L([`present`,`absent`]),action:L(Co),errorId:M().optional()}).loose(),rhe=I({kind:M(),satisfierIds:F(M()),agentIds:F(M()),pathId:M().optional(),blockedReason:M().optional()}).loose(),ihe=I({state:M(),strictness:F(L(xo)).optional()}).loose(),ahe=I({probes:I({env:L([`desktop`,`local-web`,`remote-web`]),satisfiers:io(M(),ihe)}).loose(),detection:I({detected:F(M()),probed:P()}).loose()}).loose(),ohe=I({actions:F(nhe),conflicts:F(rhe),withheld:F(M()),snapshot:ahe}).loose(),she=I({entries:F(I({level:L([`info`,`warn`,`error`]),message:M().max(8192),event:M().optional(),fields:io(M(),Ja()).optional(),ts:N().optional(),sourceId:M().optional(),lineNumber:N().optional()}).loose()).max(100),droppedSinceLastFlush:N().int().min(0).optional()}).loose(),che=I({accepted:N().int().min(0)}).loose(),lhe=I({exact:M().min(1),prefix:M(),suffix:M(),start:N().int().nonnegative(),end:N().int().nonnegative()}),uhe=F(eo([M(),N().int().nonnegative()])),dhe=to(`kind`,[I({kind:R(`body`)}),I({kind:R(`property`),key:M().min(1),path:uhe.default([])})]).default({kind:`body`}),fhe=L([`anchored`,`orphaned`,`resolved`]),p7=I({threadId:M().min(1),docName:M().min(1),target:dhe,anchor:lhe.nullable(),state:fhe,queued:P(),latestComment:M(),createdBy:M().min(1),createdAt:N(),updatedAt:N().optional()}),m7=I({docName:M(),instruction:M(),property:M().nullable(),passage:I({exact:M(),prefix:M(),suffix:M()}).nullable(),anchorLost:P(),passageRepeats:P()}).loose(),h7=I({threadId:M(),ok:R(!0)}),g7=I({threadId:M(),ok:R(!1),error:R(`not-found`)}),phe=I({threads:F(p7)}).loose(),mhe=I({meta:p7,orphaned:P()}).loose(),hhe=I({threadId:M()}).loose(),ghe=I({meta:p7,payload:m7}).loose(),_he=I({results:F(eo([h7.extend({meta:p7,payload:m7}),g7]))}).loose(),vhe=I({results:F(eo([h7.extend({meta:p7}),g7]))}).loose(),yhe=I({status:M().min(1),reason:M()}).loose(),bhe=I({docName:M().min(1),content:M(),lifecycle:yhe.nullable()}).loose(),xhe=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(),She=I({source:M().min(1),anchor:M().nullable(),title:M(),snippet:M().nullable()}).loose(),Che=I({docName:M().min(1),backlinks:F(She)}).loose(),whe=I({counts:io(M().min(1),N().int().nonnegative())}).loose(),The=I({counts:io(M().min(1),N().int().nonnegative())}).loose(),Ehe=to(`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()]),Dhe=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(),Ohe=I({docName:M().min(1),forwardLinks:F(Ehe),localTargets:F(Dhe).optional()}).loose(),khe=to(`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()]),Ahe=I({source:M().min(1),target:M().min(1)}).loose(),jhe=I({nodes:F(khe),links:F(Ahe)}).loose(),Mhe=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(),Nhe=I({app:eo([R(`cursor`),R(`codex`),R(`claude`),qa()]),signals_fired:F(M())}).loose(),Phe=I({entries:F(Mhe),count:N().int().min(0),detection:Nhe}).loose(),_7=[`M`,`A`,`D`,`R`,`C`,`U`,`T`,`?`,`!`,` `],v7=I({path:M().min(1),code:L(_7),origPath:M().min(1).optional(),syncScoped:P(),open:to(`kind`,[I({kind:R(`doc`),docName:M().min(1)}),I({kind:R(`asset`),path:M().min(1)})]).optional()}).loose(),Fhe=I({branch:M().nullable(),detached:P(),upstream:M().nullable(),staged:F(v7),notStaged:F(v7),untracked:F(v7),incoming:F(v7),truncated:P(),readable:P().default(!0)}).loose(),Ihe=L([`AWAITING_CHECKS`,`LOCKED`,`MERGEABLE`,`QUEUED`,`UNMERGEABLE`]),Lhe=L([`BEHIND`,`BLOCKED`,`CLEAN`,`DIRTY`,`DRAFT`,`HAS_HOOKS`,`UNKNOWN`,`UNSTABLE`]),Rhe=L([`APPROVED`,`CHANGES_REQUESTED`,`REVIEW_REQUIRED`]),zhe=L([`ERROR`,`EXPECTED`,`FAILURE`,`PENDING`,`SUCCESS`]),Bhe=I({mergeQueue:I({position:N().int().nonnegative(),state:Ihe.nullable().catch(null)}).nullable().catch(null),autoMerge:P(),mergeState:Lhe.nullable().catch(null),reviewDecision:Rhe.nullable().catch(null),checks:zhe.nullable().catch(null)}).loose(),y7=I({kind:L([`pull`,`issue`]),repo:M().min(1),number:N().int().positive(),title:M(),author:M().nullable(),createdAt:M(),lifecycle:L([`open`,`draft`,`merged`,`closed`,`completed`,`not-planned`]),additions:N().int().nonnegative().optional(),deletions:N().int().nonnegative().optional(),status:Bhe.optional()}).loose(),Vhe=I({url:M()}).loose(),Hhe=to(`ok`,[I({ok:R(!0),preview:y7}).loose(),I({ok:R(!1),reason:M()}).loose()]),Uhe=I({writers:F(I({id:M().min(1),name:M().optional(),email:M().optional()}).loose()).optional(),summary:G4,...W4}).loose(),Whe=I({checkpointRef:M().min(1)}).loose(),Ghe=I({v:N().int().optional(),id:M().min(1),name:M().min(1),colorSeed:M().optional(),docs:F(M()),summaries:F(M()).optional()}).loose(),Khe=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(Ghe),checkpoint:Ja().nullable(),parentSha:M().nullable().optional()}).loose()),total:N().int().nonnegative().optional(),truncated:P().optional(),hasMore:P().optional()}).loose(),qhe=I({sha:M().regex(/^[0-9a-f]{40}$/i),content:M(),timestamp:M(),author:M()}).loose(),Jhe=I({contentDir:M().min(1),pathSeparator:L([`/`,`\\`]),symlinkResolved:P()}).loose(),Yhe=F(to(`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`."}),b7=I({domain:M().min(1),title:M().optional(),description:M().optional(),siteName:M().optional(),faviconDataUri:M().optional()}).loose(),Xhe=I({url:M()}).loose(),Zhe=to(`ok`,[I({ok:R(!0),metadata:b7}).loose(),I({ok:R(!1),reason:M()}).loose()]),Qhe=I({orphans:F(I({docName:M().min(1),title:M()}).loose())}).loose(),$he=I({hubs:F(I({docName:M().min(1),title:M(),count:N().int().nonnegative()}).loose())}).loose(),ege=I({source:M().min(1),title:M(),snippet:M().nullable()}).loose(),tge=I({deadLinks:F(I({target:M().min(1),sources:F(ege)}).loose())}).loose(),nge=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(),rge=I({projectPath:M().min(1)}).loose(),ige=L([`not-a-git-worktree`,`init-failed`]),age=to(`ok`,[I({ok:R(!0),projectPath:M().min(1)}).loose(),I({ok:R(!1),reason:ige,message:M().min(1)}).loose()]),oge=I({host:M().min(1).optional()}).loose(),sge=I({host:M().min(1).optional(),token:M().min(1)}).loose(),cge=I({host:M(),login:M()}).loose(),lge=I({key:M().min(1)}).loose(),uge=I({keyPresent:P()}).loose(),dge=L([`no_key`,`invalid_endpoint`,`rate_limit`,`timeout`,`http_error`,`network`,`dims_mismatch`,`malformed_response`]),fge=to(`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:dge,status:N().int().optional()}).loose()]),pge=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(),mge=I({authenticated:P()}).loose(),hge=I({channel:L([`login`,`gh-login`]).default(`login`)}).loose(),gge=I({}).loose(),_ge=I({stackIndex:N().int().min(0),ts:N().int().min(0),additions:N().int().min(0),deletions:N().int().min(0)}).loose(),vge=I({docName:M().min(1),additionsTotal:N().int().min(0),deletionsTotal:N().int().min(0),lastTs:N().int().min(0),bursts:F(_ge)}).loose(),yge=I({displayName:M().min(1),color:M().min(1),icon:M().optional(),connectionId:M().min(1)}).loose(),bge=I({sessionAlive:P(),agent:yge.nullable(),files:F(vge)}).loose(),xge=I({diff:M(),before:M(),after:M(),properties:ose,generatedAt:N().int().min(0)}).loose(),Sge=I({}).loose(),Cge=I({}).loose(),wge=I({}).loose(),Tge=I({}).loose(),Ege=I({}).loose(),Dge=I({}).loose(),Oge=I({displayName:M().min(1),icon:M(),color:M().min(1),currentDoc:M().nullable(),mode:L([`idle`,`writing`]),ts:N().int().min(0)}).loose(),kge=I({presence:io(M().min(1),Oge)}).loose(),Age=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(),jge=I({effects:F(I({"doc.name":M().min(1),entries:F(Age)}).loose())}).loose(),Mge=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(),Nge=io(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 Pge=I({}).loose(),Fge=I({fromDocName:M().min(1),toDocName:M().min(1)}).loose(),Ige=I({fromPath:M().min(1),toPath:M().min(1)}).loose(),Lge=I({}).loose(),Rge=I({path:M().min(1),...W4,summary:G4}).loose(),zge=I({docName:M().min(1)}).loose(),Bge=I({path:M().min(1),...W4,summary:G4}).loose(),Vge=I({path:M().min(1)}).loose(),Hge=I({kind:L([`file`,`folder`]),path:M().min(1),...W4,summary:G4}).loose(),Uge=I({kind:L([`file`,`folder`]),path:M().min(1),duplicatedDocNames:F(M().min(1))}).loose(),Wge=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(),Gge=I({level:N().int().min(1).max(6),text:M(),slug:M()}).loose(),Kge=I({docName:M().min(1),headings:F(Gge)}).loose(),qge=I({docName:M().min(1),rewrites:N().int().nonnegative()}).loose(),Jge=I({kind:L([`file`,`folder`,`asset`]),fromPath:M().min(1),toPath:M().min(1),...W4,summary:G4}).loose(),Yge=I({renamed:F(Fge),renamedAssets:F(Ige),rewrittenDocs:F(qge).optional(),summary:A5.optional()}).loose(),Xge=I({kind:L([`file`,`folder`,`asset`]),path:M().min(1),...W4}).loose(),Zge=I({deletedDocNames:F(M().min(1))}).loose(),Qge=I({kind:L([`file`,`folder`,`asset`]),path:M().min(1),...W4,summary:G4}).loose(),$ge=I({deletedDocNames:F(M().min(1))}).loose(),e_e=I({docName:M().min(1),commitSha:M().regex(/^[0-9a-f]{40}$/i,{message:`commitSha must be a 40-char git SHA`}),summary:G4,...W4}).loose(),t_e=I({restoredFrom:M().min(1),timestamp:M().min(1),summary:A5.optional(),warnings:I5.optional()}).loose(),n_e=/^#[0-9a-fA-F]{6}$/,r_e=I(Object.fromEntries(Cf.map(e=>[e,M().regex(n_e,`must be a #rrggbb hex color`)]))),x7=M().min(1).refine(Ef,{message:`must contain a non-whitespace character`}),S7=I({name:x7,author:x7.optional(),variant:L([`dark`,`light`]),palette:r_e}).loose(),i_e=I({name:M().min(1),scheme:S7,stem:M().min(1).optional(),extension:L([`.yaml`,`.yml`]).optional()}).loose(),a_e=I({id:M().min(1),filename:M().min(1)}).loose(),o_e=I({id:M().min(1),scheme:S7}).loose(),s_e=I({id:M().min(1),filename:M().min(1)}).loose(),c_e=to(`existed`,[I({existed:R(!1)}).loose(),I({existed:R(!0),filename:M().min(1),scheme:S7}).loose()]),l_e=I({themes:F(to(`ok`,[I({ok:R(!0),id:M().min(1),filename:M().min(1),scheme:S7}),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(),C7=L(ce),u_e=L(le);function d_e(e){return e===`agents`||le.includes(e)}const f_e=I({alwaysOn:N().int().nonnegative(),onTrigger:N().int().nonnegative(),onDemand:N().int().nonnegative()}).strict(),p_e=[`.md`,`.mdx`,`.txt`];function w7(e){return Math.round(e/4)}function m_e(e){let t=e.lastIndexOf(`.`);return t!==-1&&p_e.includes(e.slice(t).toLowerCase())}function h_e(e){let t=w7((e.name??``).length+(e.description??``).length),n=w7(al(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/`)||m_e(t.relPath)&&(i+=t.content.length));return{alwaysOn:t,onTrigger:n,onDemand:w7(i)}}const g_e=I({tags:F(I({name:M().min(1),count:N().int().nonnegative(),isLeaf:P()}).loose())}).loose(),__e=I({docName:M().min(1),title:M(),matchingTags:F(M().min(1)),snippet:M().nullable()}).loose(),v_e=I({name:M().min(1),docs:F(__e)}).loose(),y_e=I({folder:Ja(),frontmatter_local:io(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(),b_e=I({path:M(),frontmatter:io(M(),Ja()).optional()}).loose(),x_e=I({applied:Ja()}).loose(),T7=io(M(),Ja()).meta({description:`Free-form frontmatter map embedded in template payloads.`}),S_e=I({template:I({name:M().min(1),folder:M(),scope:L([`local`,`inherited`]),path:M().min(1),frontmatter:T7,body:M()}).strict()}).strict(),C_e=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(),w_e=I({folder:M(),name:M(),body:M().optional(),frontmatter:T7.optional(),...W4,summary:G4}).strict(),T_e=I({path:M().min(1),created:P(),warnings:F(M())}).strict(),E_e=I({sourcePath:M().min(1),targetFolder:M(),name:M().optional(),title:M().optional(),deleteSource:P().optional(),...W4,summary:G4}).strict(),D_e=I({path:M().min(1),created:P(),warnings:F(M())}).strict(),O_e=I({existed:P(),path:M().min(1)}).strict(),k_e=I({fromFolder:M(),fromName:M(),toFolder:M(),toName:M(),body:M().optional(),frontmatter:T7.optional(),...W4,summary:G4}).strict(),A_e=I({from:M().min(1),to:M().min(1),committed:P()}).strict(),E7=L(wl),j_e=/^[a-z0-9-]+$/,M_e=/<\/?[A-Za-z][^>]*>/;function N_e(e){return M_e.test(e)}const P_e=/^[A-Za-z0-9_-]+$/,D7=I({name:M(),description:M(),metadata:I({pack:M()}).strict().optional()}).strict(),F_e=I({skill:I({name:M().min(1),scope:E7,path:M().min(1),frontmatter:D7,body:M(),files:F(I({path:M().min(1),text:M().nullable()})).optional(),managed:P().optional()}).strict()}).strict(),I_e=I({source:M().min(1),publisher:M().optional(),skill:M().optional(),marketplaceUrl:M().optional(),importedAt:M().min(1),autoUpdate:P().optional()}).strict(),L_e=I({name:M().min(1),description:M().optional(),scope:E7,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:io(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:I_e.optional(),pack:M().optional(),modified:P().optional(),revertable:P().optional(),ignored:P().optional(),size:f_e.optional()}).strict(),R_e=I({name:M().min(1),scope:E7,apply:P().optional()}).strict(),z_e=I({line:M().min(1),gitignorePath:M().min(1),applied:P(),alreadyTracked:P().optional()}).strict(),B_e=I({skills:F(L_e),truncated:P()}).strict(),V_e=I({scope:E7.default(`project`),name:M().meta({description:`Managed skill name to create or update.`}),body:M().optional(),frontmatter:D7,...W4,summary:G4}).strict(),O7=[`skill-name-vendor-word`,`skill-body-too-long`],k7=F(L(O7)).meta({description:"Machine-readable codes aligned 1:1 with `warnings` (`warnings[i]` is the display text for `warningCodes[i]`)."}),H_e=I({path:M().min(1),created:P(),warnings:F(M()),warningCodes:k7}).strict(),U_e=I({scope:E7.default(`project`),name:M(),dryRun:P().optional(),setAutoUpdate:P().optional(),...W4,summary:G4}).strict(),W_e=I({name:M().min(1),updated:P(),source:M().min(1),localBody:M().optional(),upstreamBody:M().optional(),gitTracked:P().optional(),warnings:F(M()),warningCodes:k7}).strict(),G_e=I({scope:E7.default(`project`),name:M(),...W4,summary:G4}).strict(),K_e=I({name:M().min(1),baselineRef:M().min(1),restoredFiles:F(M()),warnings:F(M())}).strict(),A7=`This member also carries the one bookkeeping failure that does not undo the operation: the content change landed, but a state file this server keeps beside it refused to be rewritten because it could not be read, so the install or import records still describe the old state until an operator repairs that file. Absent when there is nothing to report; a server that predates this member omits it, so treat its absence as no warning rather than as an error.`,q_e=I({existed:P(),path:M().min(1),warnings:F(M()).optional().meta({description:`Present when this delete removed a directory a retention record ties to a recovery copy an earlier failed move kept, whose source was never verified unchanged — either because this server verified the deleted directory against the copy that record describes, or because it could not read the directory and so could not confirm either way. Each entry says which of the two it is; neither claims more than the check established. ${A7}`})}).strict(),J_e=I({scope:E7.default(`project`),fromName:M(),toName:M(),body:M().optional(),frontmatter:D7.optional(),...W4,summary:G4}).strict(),Y_e=I({from:M().min(1),to:M().min(1),committed:P(),warnings:F(M()).optional().meta({description:`Present when the rename itself completed but something beside it did not. ${A7}`})}).strict(),X_e=I({name:M(),toName:M().optional().meta({description:"Name for the skill at the destination scope; defaults to `name`. The SKILL.md `name` frontmatter is rewritten to match."}),fromScope:E7,toScope:E7,...W4,summary:G4}).strict(),j7=[`nothing-written`,`destination-removed`,`destination-stray`,`destination-retained`,`destination-retained-blocking`,`destination-unreadable`,`partially-applied`];function Z_e(e){return typeof e==`string`&&j7.includes(e)}const M7=[`intact`,`lossy`,`unknown`];function N7(e){return typeof e==`string`&&M7.includes(e)}const P7=[`unreadable`,`occupant-unverifiable`];function Q_e(e){return typeof e==`string`&&P7.includes(e)}const $_e={"nothing-written":!1,"destination-removed":!1,"destination-stray":!1,"destination-retained":!0,"destination-retained-blocking":!0,"destination-unreadable":!1,"partially-applied":!1};function eve(e){return $_e[e]}function tve(e){let t=typeof e==`object`&&e?e:{},n=t.moveState,r=t.sourceState,i=t.retentionLedger;if(n===void 0&&r===void 0&&i===void 0)return{kind:`coherent`};let a=Z_e(n)?n:void 0,o=N7(r)?r:void 0,s=Q_e(i)?i:void 0,c={...a===void 0?{}:{moveState:a},...o===void 0?{}:{sourceState:o},...s===void 0?{}:{retentionLedger:s}};return n!==void 0&&a===void 0||r!==void 0&&o===void 0||i!==void 0&&s===void 0||a===void 0?{kind:`unverified`,...c}:(eve(a)?o!==void 0&&s===void 0:a===`nothing-written`?o===void 0:o===void 0&&s===void 0)?{kind:`coherent`,...c}:{kind:`unverified`,...c}}const F7=`The server reported warnings in a shape this build does not recognise; treat this result as unverified.`;function nve(e){if(e===void 0)return[];let t=F7;if(!Array.isArray(e))return[t];let n=e.filter(e=>typeof e==`string`);return n.length===e.length?n:[...n,t]}const rve=I({scope:E7,path:M().optional(),droppedLocations:F(M()).default([]).meta({description:"Locations the skill occupied at the source that were removed and not re-created at the destination: the `agents` hub and custom roots, which projection does not cover. Entries are install location ids, so they can be passed straight back as an install `add` list with `scope` set to the destination scope; custom roots resolve against that scope's base."}),warnings:F(M()).optional().meta({description:`Present when the move itself completed but something beside it did not. ${A7}`})}).strict().meta({description:"Scope-move result. Rename paths deliberately do not emit authoring warnings, consistent with same-scope rename and duplicate. Content-authoring and import responses carry those warnings and their codes. The Skills Studio client parses `droppedLocations` off the wire but deliberately does not render it yet; how a human is told what was removed is an open product decision."}),ive=I({scope:E7,name:M(),toName:M(),...W4,summary:G4}).strict(),ave=I({name:M().min(1)}).strict(),ove=I({name:M(),home:M().min(1)}).strict(),sve=I({docName:M().min(1)}).strict(),I7=L([`reference`,`script`,`file`]),cve=I({scope:E7.default(`project`),name:M(),path:M().min(1),content:M(),...W4,summary:G4}).strict(),lve=I({path:M().min(1),created:P(),kind:I7,content:P()}).strict(),uve=I({scope:E7.default(`project`),name:M(),from:M().min(1),to:M().min(1),...W4,summary:G4}).strict(),dve=I({from:M().min(1),to:M().min(1),fromDocName:M().optional(),toDocName:M().optional()}).strict(),fve=I({path:M().min(1),kind:I7,text:M()}).strict(),pve=I({path:M().min(1),existed:P(),kind:I7}).strict(),L7=eo([u_e,R(`agents`)]),R7=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`}),z7=eo([L7,R7]),mve=I({scope:E7.default(`project`),name:M(),targets:F(L7).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(z7).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(z7).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:z7.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:z7.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(),...W4,summary:G4,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"}),B7=[`no-targets`,`scripts-present`,`name-conflict`,`no-description`,`skill-fork-name-unpatched`,`place-path-invalid`,`place-fork-refused`],hve=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(B7)).meta({description:"Machine-readable warning codes aligned with `warnings`."}),placedAt:M().optional(),sourceMovedTo:M().optional()}).strict(),gve=I({scope:E7.default(`project`),name:M().meta({description:`Managed skill name to uninstall without deleting source.`})}).strict(),_ve=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(),vve=I({targets:F(C7),configured:P(),folders:F(I({scope:E7,host:M(),root:M(),state:L([`own`,`linked`,`linked-parent`,`absent`]),target:M().optional(),drift:R(!0).optional(),expected:M().optional()}).strict()).optional()}).strict(),V7=I({action:R(`link`),scope:E7,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.`})}),H7=I({action:R(`unlink`),scope:E7,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(),U7=I({action:R(`add-root`),scope:E7,root:R7.meta({description:`New custom skills root to declare (base-relative, e.g. ".team/skills").`})}).strict(),yve=to(`action`,[V7.extend({preview:P().optional().meta({description:`Return the merge plan only (moves, drops, removes, conflicts, strays) — nothing is written.`})}).strict(),H7,U7]),bve=to(`action`,[V7.strict(),H7,U7]),xve=I({folderAction:yve}).strict(),Sve=I({moves:F(M()),drops:F(M()),removes:F(M()),replaces:F(M()),conflicts:F(M()),strays:F(M())}).strict(),Cve=I({targets:F(C7),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:Sve.optional()}).strict(),wve=I({scope:E7.default(`project`),name:M(),version:M().regex(/^[0-9a-f]{40}$/i),...W4,summary:G4}).strict(),Tve=I({name:M().min(1),version:M(),restoredFiles:F(M()),warnings:F(M())}).strict(),Eve=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(),Dve=I({kind:L([`page`,`folder`,`content`,`file`]),path:M().min(1),title:M(),score:N(),signals:io(M(),Ja()),snippet:M().optional()}).loose(),W7=L([`applied`,`no_match`,`warming`,`incapable`,`provider_error`,`restart_required`,`query_too_short`]),G7=L([`warm`,`corpus`,`query`,`dimensions`,`configured_dimensions`]);function Ove(e){return e?.providerErrorReason===`dimensions`?`restart_required`:e?.providerErrorReason===`configured_dimensions`?`incapable`:e?.providerError||e?.providerErrorReason?`provider_error`:null}function kve(e){throw Error(`Unhandled SemanticProviderErrorReason variant: ${JSON.stringify(e)}`)}function Ave(e,t){let n=e?.providerErrorReason;switch(n){case null:case void 0:return e?.providerError===!0;case`corpus`:return!1;case`query`:return t===`query`;case`warm`:case`dimensions`:case`configured_dimensions`:return!0;default:return kve(n)}}function jve(e){throw Error(`Unhandled SemanticQueryOutcome variant: ${JSON.stringify(e)}`)}const K7=I({capable:P(),applied:P(),outcome:W7,providerErrorReason:G7.nullable().optional().catch(null),coverage:I({embedded:N().int().nonnegative(),total:N().int().nonnegative()})}).loose(),Mve=I({enabled:P(),keyPresent:P(),keyNotRequired:P(),keySource:L([`project`,`file`,`env`]).nullable(),keyHint:M().nullable(),ready:P(),capable:P(),providerError:P().optional(),providerErrorReason:G7.nullable().optional().catch(null),embedded:N().int().nonnegative(),total:N().int().nonnegative()}).loose();function Nve(e){return!!(e?.enabled&&(e.keyPresent||e.keyNotRequired))}const Pve=I({query:M(),intent:L([`autocomplete`,`full_text`,`omnibar`]),results:F(Dve),elapsedMs:N().nonnegative(),semantic:K7.optional(),truncated:P().optional(),ready:P().optional()}).loose(),Fve=I({version:M().min(1),recordedAt:M().min(1)}).loose(),Ive=I({currentVersion:M().min(1),targets:io(M(),Fve.nullable())}).loose(),Lve=I({scope:E7.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."}),...W4,summary:G4}).strict(),Rve=I({scope:E7.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."}),...W4,summary:G4}).strict(),zve=I({results:F(I({requested:M(),status:L([`imported`,`already-imported`,`not-found`,`failed`]),name:M().optional(),collisionRenamedFrom:M().optional(),warnings:F(M()),warningCodes:k7,error:M().optional()}).loose()),imported:N(),alreadyImported:N(),failed:N()}).loose(),Bve=I({scope:E7.default(`project`),names:F(M().min(1)).min(1).max(100).meta({description:`Managed skill names to refresh from their recorded upstreams.`}),...W4,summary:G4}).strict(),Vve=I({results:F(I({requested:M(),status:L([`updated`,`up-to-date`,`not-found`,`failed`]),source:M().optional(),warnings:F(M()),warningCodes:k7,error:M().optional()}).loose()),updated:N(),upToDate:N(),failed:N()}).loose(),Hve=I({source:M(),ref:M().optional(),contentHash:M(),publisher:M().optional()}).loose(),Uve=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:Hve,warnings:F(M()).meta({description:`Non-fatal import warnings, such as skipped unsupported files.`}),warningCodes:k7}).loose(),q7=`server-info`,J7=`branch-switched`,Y7=`disk-ack`,X7=`config-validation-rejected`,Z7=`config-ignore-nested-error`,Wve=L([`files`,`backlinks`,`graph`,`sync-status`,`session-activity`,`tags`,`comments`,`lint-config`,`local-targets`]),Gve=I({v:R(1),ch:R(q7),seq:N(),serverInstanceId:M().min(1),currentBranch:M().min(1).optional()}).loose(),Kve=I({v:R(1),ch:R(J7),seq:N(),branch:M().min(1)}).loose(),qve=I({v:R(1),ch:Wve,seq:N()}).loose(),Jve=I({v:R(1),ch:R(Y7),seq:N(),docName:M().min(1),sv:M().min(1)}).loose(),Yve=I({v:R(1),ch:R(X7),seq:N(),docName:M().min(1),error:Ine}).loose(),Xve=I({v:R(1),ch:R(Z7),seq:N(),path:M().min(1),error:M().min(1)}).loose(),Zve={id:`string`,kind:`enum`,path:`string`,title:`string`,name:`string`,pathSegments:`string`,content:`string`,modifiedTs:`number`},Q7=new WeakMap;function Qve(e){return e===void 0||!Number.isFinite(e)?20:Math.max(1,Math.min(100,Math.trunc(e)))}function $7(e){return e.trim().toLowerCase()}const $ve=/\.(?:md|mdx)$/;function eye(e,t){if(t!==`page`)return e;let n=e.replace($ve,``);return n.length>0?n:e}function tye(e){let t=e.split(`/`).filter(Boolean);return t[t.length-1]??e}function nye(e){let t=tye(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 e9=/[^\P{L}a-zàèéìòóù]|[^\P{Nd}0-9]|\p{Nl}/iu,t9=(()=>{let e=globalThis.Intl.Segmenter;return e?new e(`en`,{granularity:`word`}):null})();function rye(){let e=VY({language:`english`}),t=e.tokenize.bind(e);return e.tokenize=(e,n,r,i)=>{let a=t(e,n,r,i);if(!t9||typeof e!=`string`||!e9.test(e))return a;let o=new Set(a);for(let{segment:t,isWordLike:n}of t9.segment(e)){if(!n||!e9.test(t))continue;let e=t.toLowerCase();o.has(e)||(o.add(e),a.push(e))}return a},e}function n9(e){let t=tX({schema:Zve,components:{tokenizer:rye()}});return e.length>0&&fX(t,e),t}function r9(e){let t={documents:e};return Q7.set(t,n9(e)),t}function iye(e){let t=Q7.get(e);if(t)return t;let n=n9(e.documents);return Q7.set(e,n),n}const i9=new WeakSet;function aye(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 oye(e,t){let n=e=>({corpus:r9(t),inserted:0,updated:0,removed:0,rebuilt:!0,rebuildReason:e}),r=Q7.get(e);if(!r)return n(`no-index`);if(i9.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?aye(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`);i9.add(e);try{if(a.length>0&&vX(r,a),o.length>0&&fX(r,o),rX(r)!==t.length)throw Error(`Search index count ${rX(r)} diverged from document count ${t.length} after incremental update`)}catch{return n(`mutation-failed`)}let l={documents:t};return Q7.set(l,r),{corpus:l,inserted:o.length-s,updated:s,removed:a.length-s,rebuilt:!1}}function sye(e){return e===`autocomplete`?[`page`]:e===`full_text`?[`page`,`content`,`file`]:[`page`,`folder`,`file`]}function a9(e,t){return t.has(e.kind)?!0:e.kind===`page`&&t.has(`content`)}function cye(e,t){let n=$7(t);if(!n)return 0;let r=eye(n,e.kind),i=$7(e.title),a=$7(e.name),o=$7(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 o9(e,t){let n=cye(e,t);return n<=0?n:V4(e.path)?n*.5:n}function lye(e){return e===`file`?-60:0}function uye(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 s9(e,t,n,r){return e+t*20+n+lye(r)}function c9(e,t,n,r,i,a){return e===`relevance`?s9(t,n,r,i):uye(t,n,r,i,a)}function dye(e,t){return t||(e===`full_text`?`relevance`:`navigation`)}function l9(e,t){let n=0;for(let r of e){let e=t.get(r.id)??0;e>n&&(n=e)}return n}function fye(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 pye(e){return e===`full_text`?[`title`,`name`,`path`,`pathSegments`,`content`]:[`title`,`name`,`path`,`pathSegments`]}function mye(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 hye=/[฀-๿ក-៿ -〿぀-ゟ゠-ヿ㐀-䶿一-鿿\uf900-﫿＀-￯\u1100-\u11ff\u3130-\u318f\ua960-\ua97f\uac00-\ud7ff]/;function gye(e,t){let n=$7(t);return n.length<4||hye.test(n)?0:+(e===`full_text`)}function _ye(e){let{lexical:t,fullText:n}=e.signals;return t>=500?`lexical`:t===450&&n<=0?`pathOnly`:`body`}function vye(e){let t=[],n=[],r=[];for(let i of e){let e=_ye(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 u9(e,t,n){if(t===`relevance`)return e.slice(0,n);let r=vye(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 yye(e,t,n={}){let r=n.intent??`omnibar`,i=dye(r,n.ranking),a=Qve(n.limit),o=new Set(n.scopes??sye(r)),s=e.documents.filter(e=>a9(e,o)),c=$7(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=JX(iye(e),{term:c,properties:pye(r),boost:mye(r),tolerance:gye(r,c),limit:Math.max(a*4,40)}),u=new Map(l.hits.filter(e=>a9(e.document,o)).map(e=>[e.document.id,e.score])),d=fye(s),f=new Map;for(let e of s)o9(e,c)>=0&&f.set(e.id,e);for(let e of l.hits)a9(e.document,o)&&f.set(e.document.id,e.document);if(!n.semantic){let e=l9(f.values(),u);return u9([...f.values()].map(t=>{let n=Math.max(0,o9(t,c)),r=u.get(t.id)??0,a=d.get(t.id)??0;return{document:t,score:c9(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 u9(bye({scopedDocuments:s,candidates:f,fullTextScores:u,recency:d,normalizedQuery:c,ranking:i,semantic:n.semantic}),i,a)}function d9(e){let t=new Map;return e.forEach((e,n)=>{t.set(e,n+1)}),t}function bye(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=l9(n.values(),r),h=[...n.values()].map(e=>{let t=Math.max(0,o9(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?c9(o,t,n,s,e.kind,m):s9(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=d9(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)),_=d9(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 xye(e){return e.created.length>0||e.packSkills?.some(e=>e.pending)===!0||e.requiredPlugins?.some(e=>e.pending)===!0}const Sye=/^[A-Za-z0-9._-]+$/,Cye=/^(?:\d{1,3}\.){3}\d{1,3}$/;var f9=class extends Error{constructor(e){super(e),this.name=`InvalidShareUrlError`}};function wye(e,t=0){if(m9(t,!0),t===0)return Dye(e);if(e.length>2985)throw new f9(`Share URL exceeds the v2 URL size limit`);Eye(p9(e),t);let n=new TextEncoder().encode(e);if(n.length>2985)throw new f9(`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 f9(`Share payload exceeds the v2 size limit`);let i=b9(r);if(i.length>3984)throw new f9(`Share token exceeds the v2 size limit`);return i}function p9(e){if(!e.startsWith(`https://`))throw new f9(`Share URL must use canonical HTTPS spelling`);if(e.includes(`?`)||e.includes(`#`))throw new f9(`Share URL cannot contain a query or fragment`);let t=e.slice(8),n=t.indexOf(`/`);if(n<=0)throw new f9(`Share URL is missing its repository path`);let r=t.slice(0,n);h9(r);let i=t.slice(n+1).split(`/`);if(i.length<4||i.some(e=>e.length===0))throw new f9(`Share URL has an invalid path shape`);let[a,o,s,c,...l]=i;if(s!==`blob`&&s!==`tree`)throw new f9(`Share URL has an unsupported repository path shape`);let u=g9(a,`owner`),d=g9(o,`repository`),f=Oye(c),p=l.map(e=>kye(e,`target`)),m=s===`blob`?`doc`:`folder`;if(m===`doc`&&p.length===0)throw new f9(`Document share URL is missing its target path`);let h={host:r,owner:u,repo:d,branch:f,kind:m,targetSegments:p};if(Tye(h)!==e)throw new f9(`Share URL is not canonically serialized`);return h}function Tye(e){if(h9(e.host),y9(e.owner,`owner`),y9(e.repo,`repository`),!t3(e.branch))throw new f9(`Share URL branch is invalid`);if(e.kind!==`doc`&&e.kind!==`folder`)throw new f9(`Share URL target kind is invalid`);if(e.kind===`doc`&&e.targetSegments.length===0)throw new f9(`Document share URL is missing its target path`);for(let t of e.targetSegments)v9(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 Eye(e,t){if(m9(t,!1),t>e.targetSegments.length)throw new f9(`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 f9(`Document share target cannot be the content root`);return{kind:`doc`,docPath:n}}return{kind:`folder`,folderPath:n}}function Dye(e){let t=new TextEncoder().encode(e),n=new Uint8Array(1+t.length);return n[0]=1,n.set(t,1),b9(n)}function m9(e,t){if(!Number.isInteger(e)||e<+!t||e>65535)throw new f9(`Content root depth is invalid`)}function h9(e){if(e.length===0||e.length>253||e.endsWith(`.`)||e!==e.toLowerCase()||Cye.test(e))throw new f9(`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 f9(`Share URL host is not a DNS name`);if(hd(e)!==e)throw new f9(`Share URL host is not a canonical GitHub host`)}function Oye(e){let t=_9(e,`branch`);if(!t3(t))throw new f9(`Share URL branch is invalid`);return t}function kye(e,t){let n=_9(e,t);return v9(n,t),n}function g9(e,t){let n=_9(e,t);return y9(n,t),n}function _9(e,t){let n;try{n=decodeURIComponent(e)}catch{throw new f9(`Share URL ${t} has malformed percent encoding`)}if(encodeURIComponent(n)!==e)throw new f9(`Share URL ${t} is not canonically encoded`);return n}function v9(e,t){if(e.length===0||e===`.`||e===`..`||e.toLowerCase()===`.git`||e.includes(`/`)||e.includes(`\\`)||Aye(e))throw new f9(`Share URL ${t} component is invalid`)}function y9(e,t){if(v9(e,t),!Sye.test(e)||e.startsWith(`-`))throw new f9(`Share URL ${t} component is invalid`)}function Aye(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n<=31||n===127)return!0}return!1}function b9(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 x9=Symbol.for(`@inkeep/open-knowledge/skill-state-field-registry`),S9=globalThis;S9[x9]===void 0&&(S9[x9]=er());const C9=S9[x9],jye=`skill-state.yml`,Mye=[`claude-cowork`,`cli-hosts`],Nye=[`server-build-and-open`,`electron-build-and-open`,`cli-npx-skills-add`,`desktop-direct`,`cli-start`],w9=/^\d+\.\d+\.\d+(?:[-+][\w.-]+)?$/,T9=Qa({version:M().regex(w9,`version must match /^\\d+\\.\\d+\\.\\d+(?:[-+][\\w.-]+)?$/`).register(C9,{description:`Recorded skill version for this target.`}),recordedAt:Qi().register(C9,{description:`ISO 8601 timestamp of the most recent successful write. Updated on every write, including reinstalls of the same version.`}),surface:L(Nye).register(C9,{description:`Install-source surface that recorded this entry.`}).optional()}),Pye=Qa({enabled:P().register(C9,{description:`Whether this user-global skill bundle is opted in.`}),decidedAt:Qi().register(C9,{description:`ISO 8601 timestamp of the opt-in / opt-out decision.`})}),Fye=Qa({schema:R(1).register(C9,{description:`Schema major version. Bumped only on breaking shape changes.`}),targets:Qa({"claude-cowork":T9.optional(),"cli-hosts":T9.optional()}).register(C9,{description:`Per-target install-state entries. Absent target = no recorded install.`}).default({}),bundles:io(M(),Pye).register(C9,{description:`Per-bundle opt-in decisions keyed by install name. Absent key = no recorded decision.`}).optional(),installsReported:F(M()).register(C9,{description:"Skill installs already reported to skills.sh from this machine, as `<owner/repo>#<skill>`. Append-only; presence suppresses a re-report."}).optional()});function Iye(e,t){return e??t.installedOnDisk}function Lye(){return{schema:1,targets:{}}}const Rye=[`auth-error`,`detached-head`,`dirty-tree`,`diverged-local-commits`,`external-changes-pending`,`git-index-locked`,`git-operation-in-progress`,`no-commits-yet`,`no-push-permission`,`non-content-merge-failure`,`protected-branch`,`unsafe-incoming-symlinks`],E9=`template`;function D9(e){if(e.trim()===``)return{};let t;try{t=(0,Yc.parse)(e)}catch{return{}}return typeof t!=`object`||!t||Array.isArray(t)?{}:t}function O9(e,t){return e.trim()===``?t:`---\n${e}\n---\n${t}`}function zye(e){let{frontmatter:t,body:n}=al(e);return t===``?{docFrontmatterText:``,markdown:e}:{docFrontmatterText:sl(t),markdown:n}}function Bye(e){let t=e.split(`
545
+ A --> B`};else{let r=Xme(e),i=t===`jsx-block`?Zme(e):[];n={type:`mdxJsxFlowElement`,name:e.name,attributes:r,children:i}}return AP({type:`root`,children:[n]},{extensions:[Wme]}).trimEnd()}function $me(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 ehe(e){return{...qme(e),example:Qme(e),params:$me(e)}}const the=I({intents:F(I({satisfierId:M().min(1),desired:L([`present`,`absent`])}).loose()),...W4,summary:G4}).loose(),nhe=I({satisfierId:M(),agentId:M(),piece:M(),scope:M(),kind:M(),pathId:M().optional(),desired:L([`present`,`absent`]),action:L(Co),errorId:M().optional()}).loose(),rhe=I({kind:M(),satisfierIds:F(M()),agentIds:F(M()),pathId:M().optional(),blockedReason:M().optional()}).loose(),ihe=I({state:M(),strictness:F(L(xo)).optional()}).loose(),ahe=I({probes:I({env:L([`desktop`,`local-web`,`remote-web`]),satisfiers:io(M(),ihe)}).loose(),detection:I({detected:F(M()),probed:P()}).loose()}).loose(),ohe=I({actions:F(nhe),conflicts:F(rhe),withheld:F(M()),snapshot:ahe}).loose(),she=I({entries:F(I({level:L([`info`,`warn`,`error`]),message:M().max(8192),event:M().optional(),fields:io(M(),Ja()).optional(),ts:N().optional(),sourceId:M().optional(),lineNumber:N().optional()}).loose()).max(100),droppedSinceLastFlush:N().int().min(0).optional()}).loose(),che=I({accepted:N().int().min(0)}).loose(),lhe=I({exact:M().min(1),prefix:M(),suffix:M(),start:N().int().nonnegative(),end:N().int().nonnegative()}),uhe=F(eo([M(),N().int().nonnegative()])),dhe=to(`kind`,[I({kind:R(`body`)}),I({kind:R(`property`),key:M().min(1),path:uhe.default([])})]).default({kind:`body`}),fhe=L([`anchored`,`orphaned`,`resolved`]),p7=I({threadId:M().min(1),docName:M().min(1),target:dhe,anchor:lhe.nullable(),state:fhe,queued:P(),latestComment:M(),createdBy:M().min(1),createdAt:N(),updatedAt:N().optional()}),m7=I({docName:M(),instruction:M(),property:M().nullable(),passage:I({exact:M(),prefix:M(),suffix:M()}).nullable(),anchorLost:P(),passageRepeats:P()}).loose(),h7=I({threadId:M(),ok:R(!0)}),g7=I({threadId:M(),ok:R(!1),error:R(`not-found`)}),phe=I({threads:F(p7)}).loose(),mhe=I({meta:p7,orphaned:P()}).loose(),hhe=I({threadId:M()}).loose(),ghe=I({meta:p7,payload:m7}).loose(),_he=I({results:F(eo([h7.extend({meta:p7,payload:m7}),g7]))}).loose(),vhe=I({results:F(eo([h7.extend({meta:p7}),g7]))}).loose(),yhe=I({status:M().min(1),reason:M()}).loose(),bhe=I({docName:M().min(1),content:M(),lifecycle:yhe.nullable()}).loose(),xhe=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(),She=I({source:M().min(1),anchor:M().nullable(),title:M(),snippet:M().nullable()}).loose(),Che=I({docName:M().min(1),backlinks:F(She)}).loose(),whe=I({counts:io(M().min(1),N().int().nonnegative())}).loose(),The=I({counts:io(M().min(1),N().int().nonnegative())}).loose(),Ehe=to(`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()]),Dhe=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(),Ohe=I({docName:M().min(1),forwardLinks:F(Ehe),localTargets:F(Dhe).optional()}).loose(),khe=to(`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()]),Ahe=I({source:M().min(1),target:M().min(1)}).loose(),jhe=I({nodes:F(khe),links:F(Ahe)}).loose(),Mhe=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(),Nhe=I({app:eo([R(`cursor`),R(`codex`),R(`claude`),qa()]),signals_fired:F(M())}).loose(),Phe=I({entries:F(Mhe),count:N().int().min(0),detection:Nhe}).loose(),_7=[`M`,`A`,`D`,`R`,`C`,`U`,`T`,`?`,`!`,` `],v7=I({path:M().min(1),code:L(_7),origPath:M().min(1).optional(),syncScoped:P(),open:to(`kind`,[I({kind:R(`doc`),docName:M().min(1)}),I({kind:R(`asset`),path:M().min(1)})]).optional()}).loose(),Fhe=I({branch:M().nullable(),detached:P(),upstream:M().nullable(),staged:F(v7),notStaged:F(v7),untracked:F(v7),incoming:F(v7),truncated:P(),readable:P().default(!0)}).loose(),Ihe=L([`AWAITING_CHECKS`,`LOCKED`,`MERGEABLE`,`QUEUED`,`UNMERGEABLE`]),Lhe=L([`BEHIND`,`BLOCKED`,`CLEAN`,`DIRTY`,`DRAFT`,`HAS_HOOKS`,`UNKNOWN`,`UNSTABLE`]),Rhe=L([`APPROVED`,`CHANGES_REQUESTED`,`REVIEW_REQUIRED`]),zhe=L([`ERROR`,`EXPECTED`,`FAILURE`,`PENDING`,`SUCCESS`]),Bhe=I({mergeQueue:I({position:N().int().nonnegative(),state:Ihe.nullable().catch(null)}).nullable().catch(null),autoMerge:P(),mergeState:Lhe.nullable().catch(null),reviewDecision:Rhe.nullable().catch(null),checks:zhe.nullable().catch(null)}).loose(),y7=I({kind:L([`pull`,`issue`]),repo:M().min(1),number:N().int().positive(),title:M(),author:M().nullable(),createdAt:M(),lifecycle:L([`open`,`draft`,`merged`,`closed`,`completed`,`not-planned`]),additions:N().int().nonnegative().optional(),deletions:N().int().nonnegative().optional(),status:Bhe.optional()}).loose(),Vhe=I({url:M()}).loose(),Hhe=to(`ok`,[I({ok:R(!0),preview:y7}).loose(),I({ok:R(!1),reason:M()}).loose()]),Uhe=I({writers:F(I({id:M().min(1),name:M().optional(),email:M().optional()}).loose()).optional(),summary:G4,...W4}).loose(),Whe=I({checkpointRef:M().min(1)}).loose(),Ghe=I({v:N().int().optional(),id:M().min(1),name:M().min(1),colorSeed:M().optional(),docs:F(M()),summaries:F(M()).optional()}).loose(),Khe=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(Ghe),checkpoint:Ja().nullable(),parentSha:M().nullable().optional()}).loose()),total:N().int().nonnegative().optional(),truncated:P().optional(),hasMore:P().optional()}).loose(),qhe=I({sha:M().regex(/^[0-9a-f]{40}$/i),content:M(),timestamp:M(),author:M()}).loose(),Jhe=I({contentDir:M().min(1),pathSeparator:L([`/`,`\\`]),symlinkResolved:P()}).loose(),Yhe=F(to(`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`."}),b7=I({domain:M().min(1),title:M().optional(),description:M().optional(),siteName:M().optional(),faviconDataUri:M().optional()}).loose(),Xhe=I({url:M()}).loose(),Zhe=to(`ok`,[I({ok:R(!0),metadata:b7}).loose(),I({ok:R(!1),reason:M()}).loose()]),Qhe=I({orphans:F(I({docName:M().min(1),title:M()}).loose())}).loose(),$he=I({hubs:F(I({docName:M().min(1),title:M(),count:N().int().nonnegative()}).loose())}).loose(),ege=I({source:M().min(1),title:M(),snippet:M().nullable()}).loose(),tge=I({deadLinks:F(I({target:M().min(1),sources:F(ege)}).loose())}).loose(),nge=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(),rge=I({projectPath:M().min(1)}).loose(),ige=L([`not-a-git-worktree`,`init-failed`]),age=to(`ok`,[I({ok:R(!0),projectPath:M().min(1)}).loose(),I({ok:R(!1),reason:ige,message:M().min(1)}).loose()]),oge=I({host:M().min(1).optional()}).loose(),sge=I({host:M().min(1).optional(),token:M().min(1)}).loose(),cge=I({host:M(),login:M()}).loose(),lge=I({key:M().min(1)}).loose(),uge=I({keyPresent:P()}).loose(),dge=L([`no_key`,`invalid_endpoint`,`rate_limit`,`timeout`,`http_error`,`network`,`dims_mismatch`,`malformed_response`]),fge=to(`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:dge,status:N().int().optional()}).loose()]),pge=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(),mge=I({authenticated:P()}).loose(),hge=I({channel:L([`login`,`gh-login`]).default(`login`)}).loose(),gge=I({}).loose(),_ge=I({stackIndex:N().int().min(0),ts:N().int().min(0),additions:N().int().min(0),deletions:N().int().min(0)}).loose(),vge=I({docName:M().min(1),additionsTotal:N().int().min(0),deletionsTotal:N().int().min(0),lastTs:N().int().min(0),bursts:F(_ge)}).loose(),yge=I({displayName:M().min(1),color:M().min(1),icon:M().optional(),connectionId:M().min(1)}).loose(),bge=I({sessionAlive:P(),agent:yge.nullable(),files:F(vge)}).loose(),xge=I({diff:M(),before:M(),after:M(),properties:ose,generatedAt:N().int().min(0)}).loose(),Sge=I({}).loose(),Cge=I({}).loose(),wge=I({}).loose(),Tge=I({}).loose(),Ege=I({}).loose(),Dge=I({}).loose(),Oge=I({displayName:M().min(1),icon:M(),color:M().min(1),currentDoc:M().nullable(),mode:L([`idle`,`writing`]),ts:N().int().min(0)}).loose(),kge=I({presence:io(M().min(1),Oge)}).loose(),Age=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(),jge=I({effects:F(I({"doc.name":M().min(1),entries:F(Age)}).loose())}).loose(),Mge=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(),Nge=io(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 Pge=I({}).loose(),Fge=I({fromDocName:M().min(1),toDocName:M().min(1)}).loose(),Ige=I({fromPath:M().min(1),toPath:M().min(1)}).loose(),Lge=I({}).loose(),Rge=I({path:M().min(1),...W4,summary:G4}).loose(),zge=I({docName:M().min(1)}).loose(),Bge=I({path:M().min(1),...W4,summary:G4}).loose(),Vge=I({path:M().min(1)}).loose(),Hge=I({kind:L([`file`,`folder`]),path:M().min(1),...W4,summary:G4}).loose(),Uge=I({kind:L([`file`,`folder`]),path:M().min(1),duplicatedDocNames:F(M().min(1))}).loose(),Wge=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(),Gge=I({level:N().int().min(1).max(6),text:M(),slug:M()}).loose(),Kge=I({docName:M().min(1),headings:F(Gge)}).loose(),qge=I({docName:M().min(1),rewrites:N().int().nonnegative()}).loose(),Jge=I({kind:L([`file`,`folder`,`asset`]),fromPath:M().min(1),toPath:M().min(1),...W4,summary:G4}).loose(),Yge=I({renamed:F(Fge),renamedAssets:F(Ige),rewrittenDocs:F(qge).optional(),summary:A5.optional()}).loose(),Xge=I({kind:L([`file`,`folder`,`asset`]),path:M().min(1),...W4}).loose(),Zge=I({deletedDocNames:F(M().min(1))}).loose(),Qge=I({kind:L([`file`,`folder`,`asset`]),path:M().min(1),...W4,summary:G4}).loose(),$ge=I({deletedDocNames:F(M().min(1))}).loose(),e_e=I({docName:M().min(1),commitSha:M().regex(/^[0-9a-f]{40}$/i,{message:`commitSha must be a 40-char git SHA`}),summary:G4,...W4}).loose(),t_e=I({restoredFrom:M().min(1),timestamp:M().min(1),summary:A5.optional(),warnings:I5.optional()}).loose(),n_e=/^#[0-9a-fA-F]{6}$/,r_e=I(Object.fromEntries(Cf.map(e=>[e,M().regex(n_e,`must be a #rrggbb hex color`)]))),x7=M().min(1).refine(Ef,{message:`must contain a non-whitespace character`}),S7=I({name:x7,author:x7.optional(),variant:L([`dark`,`light`]),palette:r_e}).loose(),i_e=I({name:M().min(1),scheme:S7,stem:M().min(1).optional(),extension:L([`.yaml`,`.yml`]).optional()}).loose(),a_e=I({id:M().min(1),filename:M().min(1)}).loose(),o_e=I({id:M().min(1),scheme:S7}).loose(),s_e=I({id:M().min(1),filename:M().min(1)}).loose(),c_e=to(`existed`,[I({existed:R(!1)}).loose(),I({existed:R(!0),filename:M().min(1),scheme:S7}).loose()]),l_e=I({themes:F(to(`ok`,[I({ok:R(!0),id:M().min(1),filename:M().min(1),scheme:S7}),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(),C7=L(ce),u_e=L(le);function d_e(e){return e===`agents`||le.includes(e)}const f_e=I({alwaysOn:N().int().nonnegative(),onTrigger:N().int().nonnegative(),onDemand:N().int().nonnegative()}).strict(),p_e=[`.md`,`.mdx`,`.txt`];function w7(e){return Math.round(e/4)}function m_e(e){let t=e.lastIndexOf(`.`);return t!==-1&&p_e.includes(e.slice(t).toLowerCase())}function h_e(e){let t=w7((e.name??``).length+(e.description??``).length),n=w7(al(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/`)||m_e(t.relPath)&&(i+=t.content.length));return{alwaysOn:t,onTrigger:n,onDemand:w7(i)}}const g_e=I({tags:F(I({name:M().min(1),count:N().int().nonnegative(),isLeaf:P()}).loose())}).loose(),__e=I({docName:M().min(1),title:M(),matchingTags:F(M().min(1)),snippet:M().nullable()}).loose(),v_e=I({name:M().min(1),docs:F(__e)}).loose(),y_e=I({folder:Ja(),frontmatter_local:io(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(),b_e=I({path:M(),frontmatter:io(M(),Ja()).optional()}).loose(),x_e=I({applied:Ja()}).loose(),T7=io(M(),Ja()).meta({description:`Free-form frontmatter map embedded in template payloads.`}),S_e=I({template:I({name:M().min(1),folder:M(),scope:L([`local`,`inherited`]),path:M().min(1),frontmatter:T7,body:M()}).strict()}).strict(),C_e=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(),w_e=I({folder:M(),name:M(),body:M().optional(),frontmatter:T7.optional(),...W4,summary:G4}).strict(),T_e=I({path:M().min(1),created:P(),warnings:F(M())}).strict(),E_e=I({sourcePath:M().min(1),targetFolder:M(),name:M().optional(),title:M().optional(),deleteSource:P().optional(),...W4,summary:G4}).strict(),D_e=I({path:M().min(1),created:P(),warnings:F(M())}).strict(),O_e=I({existed:P(),path:M().min(1)}).strict(),k_e=I({fromFolder:M(),fromName:M(),toFolder:M(),toName:M(),body:M().optional(),frontmatter:T7.optional(),...W4,summary:G4}).strict(),A_e=I({from:M().min(1),to:M().min(1),committed:P()}).strict(),E7=L(wl),j_e=/^[a-z0-9-]+$/,M_e=/<\/?[A-Za-z][^>]*>/;function N_e(e){return M_e.test(e)}const P_e=/^[A-Za-z0-9_-]+$/,D7=I({name:M(),description:M(),metadata:I({pack:M()}).strict().optional()}).strict(),F_e=I({skill:I({name:M().min(1),scope:E7,path:M().min(1),frontmatter:D7,body:M(),files:F(I({path:M().min(1),text:M().nullable()})).optional(),managed:P().optional()}).strict()}).strict(),I_e=I({source:M().min(1),publisher:M().optional(),skill:M().optional(),marketplaceUrl:M().optional(),importedAt:M().min(1),autoUpdate:P().optional()}).strict(),L_e=I({name:M().min(1),description:M().optional(),scope:E7,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:io(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:I_e.optional(),pack:M().optional(),modified:P().optional(),revertable:P().optional(),ignored:P().optional(),size:f_e.optional()}).strict(),R_e=I({name:M().min(1),scope:E7,apply:P().optional()}).strict(),z_e=I({line:M().min(1),gitignorePath:M().min(1),applied:P(),alreadyTracked:P().optional()}).strict(),B_e=I({skills:F(L_e),truncated:P()}).strict(),V_e=I({scope:E7.default(`project`),name:M().meta({description:`Managed skill name to create or update.`}),body:M().optional(),frontmatter:D7,...W4,summary:G4}).strict(),O7=[`skill-name-vendor-word`,`skill-body-too-long`],k7=F(L(O7)).meta({description:"Machine-readable codes aligned 1:1 with `warnings` (`warnings[i]` is the display text for `warningCodes[i]`)."}),H_e=I({path:M().min(1),created:P(),warnings:F(M()),warningCodes:k7}).strict(),U_e=I({scope:E7.default(`project`),name:M(),dryRun:P().optional(),setAutoUpdate:P().optional(),...W4,summary:G4}).strict(),W_e=I({name:M().min(1),updated:P(),source:M().min(1),localBody:M().optional(),upstreamBody:M().optional(),gitTracked:P().optional(),warnings:F(M()),warningCodes:k7}).strict(),G_e=I({scope:E7.default(`project`),name:M(),...W4,summary:G4}).strict(),K_e=I({name:M().min(1),baselineRef:M().min(1),restoredFiles:F(M()),warnings:F(M())}).strict(),A7=`This member also carries the one bookkeeping failure that does not undo the operation: the content change landed, but a state file this server keeps beside it refused to be rewritten because it could not be read, so the install or import records still describe the old state until an operator repairs that file. Absent when there is nothing to report; a server that predates this member omits it, so treat its absence as no warning rather than as an error.`,q_e=I({existed:P(),path:M().min(1),warnings:F(M()).optional().meta({description:`Present when this delete removed a directory a retention record ties to a recovery copy an earlier failed move kept, whose source was never verified unchanged — either because this server verified the deleted directory against the copy that record describes, or because it could not read the directory and so could not confirm either way. Each entry says which of the two it is; neither claims more than the check established. ${A7}`})}).strict(),J_e=I({scope:E7.default(`project`),fromName:M(),toName:M(),body:M().optional(),frontmatter:D7.optional(),...W4,summary:G4}).strict(),Y_e=I({from:M().min(1),to:M().min(1),committed:P(),warnings:F(M()).optional().meta({description:`Present when the rename itself completed but something beside it did not. ${A7}`})}).strict(),X_e=I({name:M(),toName:M().optional().meta({description:"Name for the skill at the destination scope; defaults to `name`. The SKILL.md `name` frontmatter is rewritten to match."}),fromScope:E7,toScope:E7,...W4,summary:G4}).strict(),j7=[`nothing-written`,`destination-removed`,`destination-stray`,`destination-retained`,`destination-retained-blocking`,`destination-unreadable`,`partially-applied`];function Z_e(e){return typeof e==`string`&&j7.includes(e)}const M7=[`intact`,`lossy`,`unknown`];function N7(e){return typeof e==`string`&&M7.includes(e)}const P7=[`unreadable`,`occupant-unverifiable`];function Q_e(e){return typeof e==`string`&&P7.includes(e)}const $_e={"nothing-written":!1,"destination-removed":!1,"destination-stray":!1,"destination-retained":!0,"destination-retained-blocking":!0,"destination-unreadable":!1,"partially-applied":!1};function eve(e){return $_e[e]}function tve(e){let t=typeof e==`object`&&e?e:{},n=t.moveState,r=t.sourceState,i=t.retentionLedger;if(n===void 0&&r===void 0&&i===void 0)return{kind:`coherent`};let a=Z_e(n)?n:void 0,o=N7(r)?r:void 0,s=Q_e(i)?i:void 0,c={...a===void 0?{}:{moveState:a},...o===void 0?{}:{sourceState:o},...s===void 0?{}:{retentionLedger:s}};return n!==void 0&&a===void 0||r!==void 0&&o===void 0||i!==void 0&&s===void 0||a===void 0?{kind:`unverified`,...c}:(eve(a)?o!==void 0&&s===void 0:a===`nothing-written`?o===void 0:o===void 0&&s===void 0)?{kind:`coherent`,...c}:{kind:`unverified`,...c}}const F7=`The server reported warnings in a shape this build does not recognise; treat this result as unverified.`;function nve(e){if(e===void 0)return[];let t=F7;if(!Array.isArray(e))return[t];let n=e.filter(e=>typeof e==`string`);return n.length===e.length?n:[...n,t]}const rve=I({scope:E7,path:M().optional(),droppedLocations:F(M()).default([]).meta({description:"Locations the skill occupied at the source that were removed and not re-created at the destination: the `agents` hub and custom roots, which projection does not cover. Entries are install location ids, so they can be passed straight back as an install `add` list with `scope` set to the destination scope; custom roots resolve against that scope's base."}),warnings:F(M()).optional().meta({description:`Present when the move itself completed but something beside it did not. ${A7}`})}).strict().meta({description:"Scope-move result. Rename paths deliberately do not emit authoring warnings, consistent with same-scope rename and duplicate. Content-authoring and import responses carry those warnings and their codes. The Skills Studio client parses `droppedLocations` off the wire but deliberately does not render it yet; how a human is told what was removed is an open product decision."}),ive=I({scope:E7,name:M(),toName:M(),...W4,summary:G4}).strict(),ave=I({name:M().min(1)}).strict(),ove=I({name:M(),home:M().min(1)}).strict(),sve=I({docName:M().min(1)}).strict(),I7=L([`reference`,`script`,`file`]),cve=I({scope:E7.default(`project`),name:M(),path:M().min(1),content:M(),...W4,summary:G4}).strict(),lve=I({path:M().min(1),created:P(),kind:I7,content:P()}).strict(),uve=I({scope:E7.default(`project`),name:M(),from:M().min(1),to:M().min(1),...W4,summary:G4}).strict(),dve=I({from:M().min(1),to:M().min(1),fromDocName:M().optional(),toDocName:M().optional()}).strict(),fve=I({path:M().min(1),kind:I7,text:M()}).strict(),pve=I({path:M().min(1),existed:P(),kind:I7}).strict(),L7=eo([u_e,R(`agents`)]),R7=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`}),z7=eo([L7,R7]),mve=I({scope:E7.default(`project`),name:M(),targets:F(L7).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(z7).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(z7).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:z7.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:z7.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(),...W4,summary:G4,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"}),B7=[`no-targets`,`scripts-present`,`name-conflict`,`no-description`,`skill-fork-name-unpatched`,`place-path-invalid`,`place-fork-refused`,`links-not-permitted`],hve=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(B7)).meta({description:"Machine-readable warning codes aligned with `warnings`."}),placedAt:M().optional(),sourceMovedTo:M().optional()}).strict(),gve=I({scope:E7.default(`project`),name:M().meta({description:`Managed skill name to uninstall without deleting source.`})}).strict(),_ve=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(),vve=I({targets:F(C7),configured:P(),folders:F(I({scope:E7,host:M(),root:M(),state:L([`own`,`linked`,`linked-parent`,`absent`]),target:M().optional(),drift:R(!0).optional(),expected:M().optional()}).strict()).optional()}).strict(),V7=I({action:R(`link`),scope:E7,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.`})}),H7=I({action:R(`unlink`),scope:E7,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(),U7=I({action:R(`add-root`),scope:E7,root:R7.meta({description:`New custom skills root to declare (base-relative, e.g. ".team/skills").`})}).strict(),yve=to(`action`,[V7.extend({preview:P().optional().meta({description:`Return the merge plan only (moves, drops, removes, conflicts, strays) — nothing is written.`})}).strict(),H7,U7]),bve=to(`action`,[V7.strict(),H7,U7]),xve=I({folderAction:yve}).strict(),Sve=I({moves:F(M()),drops:F(M()),removes:F(M()),replaces:F(M()),conflicts:F(M()),strays:F(M())}).strict(),Cve=I({targets:F(C7),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:Sve.optional()}).strict(),wve=I({scope:E7.default(`project`),name:M(),version:M().regex(/^[0-9a-f]{40}$/i),...W4,summary:G4}).strict(),Tve=I({name:M().min(1),version:M(),restoredFiles:F(M()),warnings:F(M())}).strict(),Eve=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(),Dve=I({kind:L([`page`,`folder`,`content`,`file`]),path:M().min(1),title:M(),score:N(),signals:io(M(),Ja()),snippet:M().optional()}).loose(),W7=L([`applied`,`no_match`,`warming`,`incapable`,`provider_error`,`restart_required`,`query_too_short`]),G7=L([`warm`,`corpus`,`query`,`dimensions`,`configured_dimensions`]);function Ove(e){return e?.providerErrorReason===`dimensions`?`restart_required`:e?.providerErrorReason===`configured_dimensions`?`incapable`:e?.providerError||e?.providerErrorReason?`provider_error`:null}function kve(e){throw Error(`Unhandled SemanticProviderErrorReason variant: ${JSON.stringify(e)}`)}function Ave(e,t){let n=e?.providerErrorReason;switch(n){case null:case void 0:return e?.providerError===!0;case`corpus`:return!1;case`query`:return t===`query`;case`warm`:case`dimensions`:case`configured_dimensions`:return!0;default:return kve(n)}}function jve(e){throw Error(`Unhandled SemanticQueryOutcome variant: ${JSON.stringify(e)}`)}const K7=I({capable:P(),applied:P(),outcome:W7,providerErrorReason:G7.nullable().optional().catch(null),coverage:I({embedded:N().int().nonnegative(),total:N().int().nonnegative()})}).loose(),Mve=I({enabled:P(),keyPresent:P(),keyNotRequired:P(),keySource:L([`project`,`file`,`env`]).nullable(),keyHint:M().nullable(),ready:P(),capable:P(),providerError:P().optional(),providerErrorReason:G7.nullable().optional().catch(null),embedded:N().int().nonnegative(),total:N().int().nonnegative()}).loose();function Nve(e){return!!(e?.enabled&&(e.keyPresent||e.keyNotRequired))}const Pve=I({query:M(),intent:L([`autocomplete`,`full_text`,`omnibar`]),results:F(Dve),elapsedMs:N().nonnegative(),semantic:K7.optional(),truncated:P().optional(),ready:P().optional()}).loose(),Fve=I({version:M().min(1),recordedAt:M().min(1)}).loose(),Ive=I({currentVersion:M().min(1),targets:io(M(),Fve.nullable())}).loose(),Lve=I({scope:E7.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."}),...W4,summary:G4}).strict(),Rve=I({scope:E7.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."}),...W4,summary:G4}).strict(),zve=I({results:F(I({requested:M(),status:L([`imported`,`already-imported`,`not-found`,`failed`]),name:M().optional(),collisionRenamedFrom:M().optional(),warnings:F(M()),warningCodes:k7,error:M().optional()}).loose()),imported:N(),alreadyImported:N(),failed:N()}).loose(),Bve=I({scope:E7.default(`project`),names:F(M().min(1)).min(1).max(100).meta({description:`Managed skill names to refresh from their recorded upstreams.`}),...W4,summary:G4}).strict(),Vve=I({results:F(I({requested:M(),status:L([`updated`,`up-to-date`,`not-found`,`failed`]),source:M().optional(),warnings:F(M()),warningCodes:k7,error:M().optional()}).loose()),updated:N(),upToDate:N(),failed:N()}).loose(),Hve=I({source:M(),ref:M().optional(),contentHash:M(),publisher:M().optional()}).loose(),Uve=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:Hve,warnings:F(M()).meta({description:`Non-fatal import warnings, such as skipped unsupported files.`}),warningCodes:k7}).loose(),q7=`server-info`,J7=`branch-switched`,Y7=`disk-ack`,X7=`config-validation-rejected`,Z7=`config-ignore-nested-error`,Wve=L([`files`,`backlinks`,`graph`,`sync-status`,`session-activity`,`tags`,`comments`,`lint-config`,`local-targets`]),Gve=I({v:R(1),ch:R(q7),seq:N(),serverInstanceId:M().min(1),currentBranch:M().min(1).optional()}).loose(),Kve=I({v:R(1),ch:R(J7),seq:N(),branch:M().min(1)}).loose(),qve=I({v:R(1),ch:Wve,seq:N()}).loose(),Jve=I({v:R(1),ch:R(Y7),seq:N(),docName:M().min(1),sv:M().min(1)}).loose(),Yve=I({v:R(1),ch:R(X7),seq:N(),docName:M().min(1),error:Ine}).loose(),Xve=I({v:R(1),ch:R(Z7),seq:N(),path:M().min(1),error:M().min(1)}).loose(),Zve={id:`string`,kind:`enum`,path:`string`,title:`string`,name:`string`,pathSegments:`string`,content:`string`,modifiedTs:`number`},Q7=new WeakMap;function Qve(e){return e===void 0||!Number.isFinite(e)?20:Math.max(1,Math.min(100,Math.trunc(e)))}function $7(e){return e.trim().toLowerCase()}const $ve=/\.(?:md|mdx)$/;function eye(e,t){if(t!==`page`)return e;let n=e.replace($ve,``);return n.length>0?n:e}function tye(e){let t=e.split(`/`).filter(Boolean);return t[t.length-1]??e}function nye(e){let t=tye(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 e9=/[^\P{L}a-zàèéìòóù]|[^\P{Nd}0-9]|\p{Nl}/iu,t9=(()=>{let e=globalThis.Intl.Segmenter;return e?new e(`en`,{granularity:`word`}):null})();function rye(){let e=VY({language:`english`}),t=e.tokenize.bind(e);return e.tokenize=(e,n,r,i)=>{let a=t(e,n,r,i);if(!t9||typeof e!=`string`||!e9.test(e))return a;let o=new Set(a);for(let{segment:t,isWordLike:n}of t9.segment(e)){if(!n||!e9.test(t))continue;let e=t.toLowerCase();o.has(e)||(o.add(e),a.push(e))}return a},e}function n9(e){let t=tX({schema:Zve,components:{tokenizer:rye()}});return e.length>0&&fX(t,e),t}function r9(e){let t={documents:e};return Q7.set(t,n9(e)),t}function iye(e){let t=Q7.get(e);if(t)return t;let n=n9(e.documents);return Q7.set(e,n),n}const i9=new WeakSet;function aye(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 oye(e,t){let n=e=>({corpus:r9(t),inserted:0,updated:0,removed:0,rebuilt:!0,rebuildReason:e}),r=Q7.get(e);if(!r)return n(`no-index`);if(i9.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?aye(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`);i9.add(e);try{if(a.length>0&&vX(r,a),o.length>0&&fX(r,o),rX(r)!==t.length)throw Error(`Search index count ${rX(r)} diverged from document count ${t.length} after incremental update`)}catch{return n(`mutation-failed`)}let l={documents:t};return Q7.set(l,r),{corpus:l,inserted:o.length-s,updated:s,removed:a.length-s,rebuilt:!1}}function sye(e){return e===`autocomplete`?[`page`]:e===`full_text`?[`page`,`content`,`file`]:[`page`,`folder`,`file`]}function a9(e,t){return t.has(e.kind)?!0:e.kind===`page`&&t.has(`content`)}function cye(e,t){let n=$7(t);if(!n)return 0;let r=eye(n,e.kind),i=$7(e.title),a=$7(e.name),o=$7(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 o9(e,t){let n=cye(e,t);return n<=0?n:V4(e.path)?n*.5:n}function lye(e){return e===`file`?-60:0}function uye(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 s9(e,t,n,r){return e+t*20+n+lye(r)}function c9(e,t,n,r,i,a){return e===`relevance`?s9(t,n,r,i):uye(t,n,r,i,a)}function dye(e,t){return t||(e===`full_text`?`relevance`:`navigation`)}function l9(e,t){let n=0;for(let r of e){let e=t.get(r.id)??0;e>n&&(n=e)}return n}function fye(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 pye(e){return e===`full_text`?[`title`,`name`,`path`,`pathSegments`,`content`]:[`title`,`name`,`path`,`pathSegments`]}function mye(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 hye=/[฀-๿ក-៿ -〿぀-ゟ゠-ヿ㐀-䶿一-鿿\uf900-﫿＀-￯\u1100-\u11ff\u3130-\u318f\ua960-\ua97f\uac00-\ud7ff]/;function gye(e,t){let n=$7(t);return n.length<4||hye.test(n)?0:+(e===`full_text`)}function _ye(e){let{lexical:t,fullText:n}=e.signals;return t>=500?`lexical`:t===450&&n<=0?`pathOnly`:`body`}function vye(e){let t=[],n=[],r=[];for(let i of e){let e=_ye(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 u9(e,t,n){if(t===`relevance`)return e.slice(0,n);let r=vye(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 yye(e,t,n={}){let r=n.intent??`omnibar`,i=dye(r,n.ranking),a=Qve(n.limit),o=new Set(n.scopes??sye(r)),s=e.documents.filter(e=>a9(e,o)),c=$7(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=JX(iye(e),{term:c,properties:pye(r),boost:mye(r),tolerance:gye(r,c),limit:Math.max(a*4,40)}),u=new Map(l.hits.filter(e=>a9(e.document,o)).map(e=>[e.document.id,e.score])),d=fye(s),f=new Map;for(let e of s)o9(e,c)>=0&&f.set(e.id,e);for(let e of l.hits)a9(e.document,o)&&f.set(e.document.id,e.document);if(!n.semantic){let e=l9(f.values(),u);return u9([...f.values()].map(t=>{let n=Math.max(0,o9(t,c)),r=u.get(t.id)??0,a=d.get(t.id)??0;return{document:t,score:c9(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 u9(bye({scopedDocuments:s,candidates:f,fullTextScores:u,recency:d,normalizedQuery:c,ranking:i,semantic:n.semantic}),i,a)}function d9(e){let t=new Map;return e.forEach((e,n)=>{t.set(e,n+1)}),t}function bye(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=l9(n.values(),r),h=[...n.values()].map(e=>{let t=Math.max(0,o9(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?c9(o,t,n,s,e.kind,m):s9(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=d9(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)),_=d9(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 xye(e){return e.created.length>0||e.packSkills?.some(e=>e.pending)===!0||e.requiredPlugins?.some(e=>e.pending)===!0}const Sye=/^[A-Za-z0-9._-]+$/,Cye=/^(?:\d{1,3}\.){3}\d{1,3}$/;var f9=class extends Error{constructor(e){super(e),this.name=`InvalidShareUrlError`}};function wye(e,t=0){if(m9(t,!0),t===0)return Dye(e);if(e.length>2985)throw new f9(`Share URL exceeds the v2 URL size limit`);Eye(p9(e),t);let n=new TextEncoder().encode(e);if(n.length>2985)throw new f9(`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 f9(`Share payload exceeds the v2 size limit`);let i=b9(r);if(i.length>3984)throw new f9(`Share token exceeds the v2 size limit`);return i}function p9(e){if(!e.startsWith(`https://`))throw new f9(`Share URL must use canonical HTTPS spelling`);if(e.includes(`?`)||e.includes(`#`))throw new f9(`Share URL cannot contain a query or fragment`);let t=e.slice(8),n=t.indexOf(`/`);if(n<=0)throw new f9(`Share URL is missing its repository path`);let r=t.slice(0,n);h9(r);let i=t.slice(n+1).split(`/`);if(i.length<4||i.some(e=>e.length===0))throw new f9(`Share URL has an invalid path shape`);let[a,o,s,c,...l]=i;if(s!==`blob`&&s!==`tree`)throw new f9(`Share URL has an unsupported repository path shape`);let u=g9(a,`owner`),d=g9(o,`repository`),f=Oye(c),p=l.map(e=>kye(e,`target`)),m=s===`blob`?`doc`:`folder`;if(m===`doc`&&p.length===0)throw new f9(`Document share URL is missing its target path`);let h={host:r,owner:u,repo:d,branch:f,kind:m,targetSegments:p};if(Tye(h)!==e)throw new f9(`Share URL is not canonically serialized`);return h}function Tye(e){if(h9(e.host),y9(e.owner,`owner`),y9(e.repo,`repository`),!t3(e.branch))throw new f9(`Share URL branch is invalid`);if(e.kind!==`doc`&&e.kind!==`folder`)throw new f9(`Share URL target kind is invalid`);if(e.kind===`doc`&&e.targetSegments.length===0)throw new f9(`Document share URL is missing its target path`);for(let t of e.targetSegments)v9(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 Eye(e,t){if(m9(t,!1),t>e.targetSegments.length)throw new f9(`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 f9(`Document share target cannot be the content root`);return{kind:`doc`,docPath:n}}return{kind:`folder`,folderPath:n}}function Dye(e){let t=new TextEncoder().encode(e),n=new Uint8Array(1+t.length);return n[0]=1,n.set(t,1),b9(n)}function m9(e,t){if(!Number.isInteger(e)||e<+!t||e>65535)throw new f9(`Content root depth is invalid`)}function h9(e){if(e.length===0||e.length>253||e.endsWith(`.`)||e!==e.toLowerCase()||Cye.test(e))throw new f9(`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 f9(`Share URL host is not a DNS name`);if(hd(e)!==e)throw new f9(`Share URL host is not a canonical GitHub host`)}function Oye(e){let t=_9(e,`branch`);if(!t3(t))throw new f9(`Share URL branch is invalid`);return t}function kye(e,t){let n=_9(e,t);return v9(n,t),n}function g9(e,t){let n=_9(e,t);return y9(n,t),n}function _9(e,t){let n;try{n=decodeURIComponent(e)}catch{throw new f9(`Share URL ${t} has malformed percent encoding`)}if(encodeURIComponent(n)!==e)throw new f9(`Share URL ${t} is not canonically encoded`);return n}function v9(e,t){if(e.length===0||e===`.`||e===`..`||e.toLowerCase()===`.git`||e.includes(`/`)||e.includes(`\\`)||Aye(e))throw new f9(`Share URL ${t} component is invalid`)}function y9(e,t){if(v9(e,t),!Sye.test(e)||e.startsWith(`-`))throw new f9(`Share URL ${t} component is invalid`)}function Aye(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n<=31||n===127)return!0}return!1}function b9(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 x9=Symbol.for(`@inkeep/open-knowledge/skill-state-field-registry`),S9=globalThis;S9[x9]===void 0&&(S9[x9]=er());const C9=S9[x9],jye=`skill-state.yml`,Mye=[`claude-cowork`,`cli-hosts`],Nye=[`server-build-and-open`,`electron-build-and-open`,`cli-npx-skills-add`,`desktop-direct`,`cli-start`],w9=/^\d+\.\d+\.\d+(?:[-+][\w.-]+)?$/,T9=Qa({version:M().regex(w9,`version must match /^\\d+\\.\\d+\\.\\d+(?:[-+][\\w.-]+)?$/`).register(C9,{description:`Recorded skill version for this target.`}),recordedAt:Qi().register(C9,{description:`ISO 8601 timestamp of the most recent successful write. Updated on every write, including reinstalls of the same version.`}),surface:L(Nye).register(C9,{description:`Install-source surface that recorded this entry.`}).optional()}),Pye=Qa({enabled:P().register(C9,{description:`Whether this user-global skill bundle is opted in.`}),decidedAt:Qi().register(C9,{description:`ISO 8601 timestamp of the opt-in / opt-out decision.`})}),Fye=Qa({schema:R(1).register(C9,{description:`Schema major version. Bumped only on breaking shape changes.`}),targets:Qa({"claude-cowork":T9.optional(),"cli-hosts":T9.optional()}).register(C9,{description:`Per-target install-state entries. Absent target = no recorded install.`}).default({}),bundles:io(M(),Pye).register(C9,{description:`Per-bundle opt-in decisions keyed by install name. Absent key = no recorded decision.`}).optional(),installsReported:F(M()).register(C9,{description:"Skill installs already reported to skills.sh from this machine, as `<owner/repo>#<skill>`. Append-only; presence suppresses a re-report."}).optional()});function Iye(e,t){return e??t.installedOnDisk}function Lye(){return{schema:1,targets:{}}}const Rye=[`auth-error`,`detached-head`,`dirty-tree`,`diverged-local-commits`,`external-changes-pending`,`git-index-locked`,`git-operation-in-progress`,`no-commits-yet`,`no-push-permission`,`non-content-merge-failure`,`protected-branch`,`unsafe-incoming-symlinks`],E9=`template`;function D9(e){if(e.trim()===``)return{};let t;try{t=(0,Yc.parse)(e)}catch{return{}}return typeof t!=`object`||!t||Array.isArray(t)?{}:t}function O9(e,t){return e.trim()===``?t:`---\n${e}\n---\n${t}`}function zye(e){let{frontmatter:t,body:n}=al(e);return t===``?{docFrontmatterText:``,markdown:e}:{docFrontmatterText:sl(t),markdown:n}}function Bye(e){let t=e.split(`
546
546
  `);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=D9(n.join(`
547
547
  `))[E9];return{identity:typeof i==`object`&&i&&!Array.isArray(i)?i:{},docFrontmatterText:t.slice(r).join(`
548
548
  `).replace(/\n+$/,``)}}function k9(e){let t=e.charCodeAt(0)===65279?e.slice(1):e,{frontmatter:n,body:r}=al(t);if(n===``)return{identity:{},starterContent:t};let i=sl(n),a=Bye(i);if(a)return{identity:a.identity,starterContent:O9(a.docFrontmatterText,r)};let{frontmatter:o}=al(r);if(o!==``)return{identity:D9(i),starterContent:r};let s=D9(i);return typeof s.title==`string`?{identity:s,starterContent:r}:{identity:{},starterContent:O9(i,r)}}function Vye(e,t){let{docFrontmatterText:n,markdown:r}=zye(t),i={};for(let[t,n]of Object.entries(e))n!==void 0&&(i[t]=n);let a=(0,Yc.stringify)({[E9]:i});return`---\n${n.trim()===``?a:`${a}${n}\n`}---\n${r}`}function Hye(e){return k9(e).starterContent}const A9=e=>e*8+4;A9(92),A9(40);const Uye=/^(#{1,6})\s+(.+)$/;function Wye(e,t){let n=(e.endsWith(`\r`)?e.slice(0,-1):e).match(Uye);if(!n)return null;let r=n[2].trim(),i=Bme(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 Gye={fileSystem:`File System`,gitUpstream:`Git (upstream)`,service:`OpenKnowledge (service)`,generator:`OpenKnowledge (generated)`},Kye=[`#D97757`,`#1B1912`,`#F9F3E9`,`#7A9DFF`,`#8534F3`,`#9663F0`,`#727CF3`],qye={claude:`#D97757`,cursor:`#1B1912`,windsurf:`#0B100F`,openai:`#7A9DFF`,github:`#8534F3`,cline:`#9663F0`,bot:`#727CF3`};function Jye(e,t=Kye){let n=0;for(let t of e)n=(n<<5)-n+t.charCodeAt(0)|0;return t[Math.abs(n)%t.length]}const Yye={"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 j9(e){return e?Yye[e]||(e.startsWith(`local-agent-mode-`)?`claude`:`bot`):`bot`}const Xye={claude:`Claude`,cursor:`Cursor`,windsurf:`Windsurf`,openai:`Codex`,github:`Copilot`,cline:`Cline`};function Zye(e){let t=e?.trim();return t?Xye[j9(t)]??t:`Agent`}function M9(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 N9(e){return e===`.`||e===`..`?e:encodeURIComponent(e).replace(/[!'()*]/g,e=>`%${e.codePointAt(0)?.toString(16).toUpperCase()}`)}function Qye(e){return e.split(`/`).map(N9).join(`/`)}function P9(e){return e.split(`/`).map(M9).join(`/`)}function F9(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=M9(o.split(`/`).pop()??``).match(/\.([a-z0-9]+)$/i);if(s){let e=`.${(s[1]??``).toLowerCase()}`;if(!X0.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=M9(d[e]??``);if(e===f&&(t=Ol(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 $ye(e){throw Error(`Unhandled ClassifiedLinkTarget variant: ${JSON.stringify(e)}`)}const I9=/^[a-zA-Z][a-zA-Z\d+\-.]*:/;function L9(e){let t=(e.split(/[?#]/)[0]??e).match(/\.([a-z0-9]+)$/i);return t?(t[1]??``).toLowerCase():null}function R9(e){let t=e.trim();return I9.test(t)||t.startsWith(`//`)}function ebe(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(R9(n))return{kind:`external`,url:n};let r=n.indexOf(`#`),i=P9(r<0?n:n.slice(0,r)),a=Nl(i,t);if(a)return{kind:`doc`,docName:a,anchor:r<0?null:n.slice(r+1)};let o=Ml(i,t);if(o)return{kind:`doc`,docName:o,anchor:r<0?null:n.slice(r+1)};let s=F9(n,t);if(s)return{kind:`doc`,docName:s.docName,anchor:s.anchor};let c=L9(i);return c&&c!==`md`&&c!==`mdx`?{kind:`asset`,url:n,ext:c,literal:!1}:null}function z9(e,t){let n=e.trim();if(!n)return null;if(R9(n))return{kind:`external`,url:t?`${n}#${t}`:n};let r=L9(n);return r&&r!==`md`&&r!==`mdx`?{kind:`asset`,url:n,ext:r,literal:!0}:{kind:`doc`,docName:n,anchor:t?.trim()||null}}function tbe(e,t,n){let r=e.trim();if(!r||I9.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:M9(e));return c.length===0?null:c.join(`/`)}function B9(e){let t=e;return t.startsWith(`./`)&&(t=t.slice(2)),t.startsWith(`/`)&&(t=t.slice(1)),t}function V9(e){let t=e.lastIndexOf(`/`);return t===-1?e:e.slice(t+1)}function H9(e){let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)}function U9(e){return e.split(`/`).filter(e=>e!==``)}function nbe(e,t){let n=H9(t);return e===``||n===e||n.startsWith(`${e}/`)}function W9(e,t){let n=H9(t);if(e===n)return 0;let r=e===``?n:n.slice(e.length+1);return r===``?0:U9(r).length}function G9(e,t){let n=U9(e),r=U9(t),i=0;for(;i<n.length&&i<r.length&&n[i]===r[i];)i++;return n.length-i+(r.length-i)}function rbe(){let e=new Map;function t(t){let n=B9(t);if(n===``)return;let r=V9(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=B9(t),r=V9(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=H9(B9(n)),o=[],s=[];for(let e of i)nbe(a,e)?o.push(e):s.push(e);return o.length>0?(e=>{let t=e[0],n=W9(a,t);for(let r=1;r<e.length;r++){let i=e[r],o=W9(a,i);(o<n||o===n&&i<t)&&(t=i,n=o)}return t})(o):(e=>{let t=e[0],n=G9(a,H9(t));for(let r=1;r<e.length;r++){let i=e[r],o=G9(a,H9(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 K9=`unknown`;function ibe(e,t=Date.now()){let n=Date.parse(e);if(!Number.isFinite(n))return K9;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 abe(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 obe(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 q9(e){let t=e?.trim();return t===void 0||t===``?void 0:t}function sbe(e){return e.reason!==void 0||q9(e.note)!==void 0||q9(e.email)!==void 0}function cbe(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 lbe(){return cbe((typeof process>`u`?void 0:q9(process.env?.OK_FEEDBACK_INTAKE_ORIGIN))??`https://openknowledge.ai`)}function ube(e){let t=q9(e);if(t!==void 0)return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)?t:void 0}async function J9(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 dbe(e,t={}){let n=lbe();if(n===null)return{ok:!1,reason:`error`};let r=new URL(`/api/feedback`,n),i=q9(e.note),a=ube(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 J9(r,o,c());let l=await J9(r,{...o,email:a},c());return l.ok||l.reason!==`invalid`||c()<=0?l:J9(r,o,c())}function Y9(e){return`pagesBySlug`in e}function X9(e){return Y9(e)?e.pages:e}function fbe(e,t){return Y9(e)?e.assetPaths??new Set:t??new Set}function pbe(e,t){return Y9(e)?e.filePaths??new Set:t??new Set}function Z9(e,t){return e<t?-1:+(e>t)}function mbe(e,t){let n=new Map;for(let r of e){let e=t(r),i=n.get(e);e&&(i===void 0||Z9(r,i)<0)&&n.set(e,r)}return n}function hbe(e,t){let n=new Map,r=[...e].sort(Z9);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 gbe(e,t){let n=u7(e);if(!n)return;if(Y9(t))return t.pagesBySlug.get(n);let r;for(let e of t)u7(e)===n&&(r===void 0||Z9(e,r)<0)&&(r=e);return r}function _be(e,t){if(e.includes(`/`))return;let n=u7(e);if(!n)return;if(Y9(t))return t.pagesByBasename?.get(n);let r;for(let e of t){let t=e.lastIndexOf(`/`);u7(t===-1?e:e.slice(t+1))===n&&(r===void 0||Z9(e,r)<0)&&(r=e)}return r}function vbe(e){let t=e.trim();if(!t)return[];let n=u7(t);return n.length>0&&n!==t?[n]:[]}function Q9(e,t){let n=e.trim();if(!n)return;if(X9(t).has(n))return n;let r=n.replace(/\.(md|mdx)$/i,``);if(r!==n){let e=$9(r,t);if(e!==void 0)return e}return $9(n,t)}function $9(e,t){let n=e.trim();if(!n)return;let r=X9(t);if(r.has(n))return n;let i=gbe(n,t);if(i)return i;for(let e of vbe(n))if(r.has(e))return e;return ybe(n,r)||_be(n,t)}function ybe(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 bbe(e){let t=((e.trim().split(`#`)[0]??``).trim().split(`?`)[0]??``).trim();return t.startsWith(`/`)?t.slice(1):t}function xbe(e,t,n){let r=bbe(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(Z9)[0]??null}function Sbe(e,t,n){let r=z9(e,t);return r===null||r.kind!==`asset`||xbe(r.url,fbe(n),pbe(n))!==null||Q9(e,n)===void 0?r:{kind:`doc`,docName:e.trim(),anchor:t?.trim()||null}}const Cbe=new Nfe({extensions:N4,deriveStructuralFreshness:!0}),wbe=CC(N4);export{zge as $,c$ as $a,Cp as $c,tee as $d,C_e as $i,_l as $l,M7 as $n,B4 as $o,mve as $r,Ece as $s,oge as $t,cu as $u,Kve as A,hbe as Aa,_f as Ac,go as Ad,b as Af,Sce as Ai,vne as Al,o3 as An,L0 as Ao,Gse as Ar,xye as As,Fhe as At,Fu as Au,q7 as B,B1 as Ba,ld as Bc,io as Bd,Dse as Bi,wne as Bl,Yhe as Bn,Hye as Bo,ave as Br,xme as Bs,d7 as Bt,gu as Bu,Che as C,vce as Ca,tre as Cc,Ga as Cd,se as Cf,_ve as Ci,ip as Cl,h2 as Cn,ase as Co,Nse as Cr,w2 as Cs,Z5 as Ct,pu as Cu,L5 as D,use as Da,nre as Dc,ite as Dd,E as Df,Bve as Di,rp as Dl,_he as Dn,Bfe as Do,hce as Dr,u2 as Ds,y7 as Dt,Tl as Du,D$ as E,tQ as Ea,Qne as Ec,qa as Ed,x as Ef,B_e as Ei,id as El,Wge as En,kme as Eo,W7 as Er,f2 as Es,_7 as Et,Hu as Eu,Gve as F,oce as Fa,Jd as Fc,Qa as Fd,wse as Fi,Wne as Fl,P1 as Fn,rle as Fo,$se as Fr,E4 as Fs,Vse as Ft,Ll as Fu,she as G,jQ as Ga,Ud as Gc,ka as Gd,O_e as Gi,Ku as Gl,E2 as Gn,_me as Go,cve as Gr,F9 as Gs,Zhe as Gt,tu as Gu,J4 as H,C1 as Ha,Gf as Hc,dte as Hd,P_e as Hi,Ju as Hl,t_e as Hn,Mme as Ho,sve as Hr,tbe as Hs,jhe as Ht,Al as Hu,J7 as I,ebe as Ia,qf as Ic,N as Id,Ase as Ii,Bne as Il,q5 as In,j4 as Io,fce as Ir,IQ as Is,Use as It,Vl as Iu,p7 as J,y0 as Ja,qd as Jc,Xi as Jd,D_e as Ji,Gu as Jl,O2 as Jn,G0 as Jo,dve as Jr,Sbe as Js,G5 as Jt,zu as Ju,che as K,MQ as Ka,Dd as Kc,Da as Kd,S_e as Ki,Xu as Kl,O7 as Kn,V4 as Ko,lve as Kr,Cce as Ks,cme as Kt,ul as Ku,Z7 as L,s2 as La,Xf as Lc,I as Ld,jse as Li,Sd as Ll,Y5 as Ln,sbe as Lo,pce as Lr,d3 as Ls,Nge as Lt,Fl as Lu,Yve as M,qZ as Ma,Vne as Mc,Ka as Md,Mse as Mi,ad as Ml,X4 as Mn,b$ as Mo,Yse as Mr,dbe as Ms,qhe as Mt,uu as Mu,qve as N,o7 as Na,Pne as Nc,no as Nd,kse as Ni,Xne as Nl,K9 as Nn,Kfe as No,Jse as Nr,m2 as Ns,$he as Nt,Dl as Nu,z5 as O,cse as Oa,Une as Oc,F as Od,ee as Of,Vve as Oi,fd as Ol,ghe as On,Fme as Oo,Q4 as Or,dse as Os,Vhe as Ot,Wl as Ou,Jve as P,Y0 as Pa,ap as Pc,R as Pd,Tse as Pi,Kne as Pl,L1 as Pn,Kme as Po,Zse as Pr,ehe as Ps,y2 as Pt,ll as Pu,Rge as Q,t8 as Qa,Zf as Qc,eee as Qd,T_e as Qi,bl as Ql,P7 as Qn,a1 as Qo,Uve as Qr,Wye as Qs,gge as Qt,sl as Qu,X7 as R,Ove as Ra,Yf as Rc,co as Rd,Cse as Ri,kd as Rl,Jge as Rn,j9 as Ro,q_e as Rr,yme as Rs,S2 as Rt,su as Ru,whe as S,$ye as Sa,Zne as Sc,jte as Sd,pe as Sf,gve as Si,uf as Sl,p2 as Sn,abe as So,Bse as Sr,tse as Ss,$pe as St,eu as Su,UQ as T,Vpe as Ta,$ne as Tc,L as Td,S as Tf,zve as Ti,mf as Tl,Kge as Tn,j$ as To,G7 as Tr,d2 as Ts,sme as Tt,nl as Tu,lce as U,n5 as Ua,Wf as Uc,eo as Ud,v_e as Ui,qu as Ul,Tce as Un,ece as Uo,pve as Ur,Iye as Us,b7 as Ut,Nl as Uu,z1 as V,Jye as Va,xf as Vc,M as Vd,E9 as Vi,Tne as Vl,e_e as Vn,tve as Vo,ove as Vr,K0 as Vs,Z0 as Vt,ol as Vu,dce as W,Vye as Wa,Uf as Wc,Ja as Wd,g_e as Wi,Uu as Wl,k2 as Wn,R9 as Wo,fve as Wr,P0 as Ws,Xhe as Wt,du as Wu,Bge as X,Ame as Xa,$f as Xc,Ln as Xd,A_e as Xi,gl as Xl,j_e as Xn,g5 as Xo,F_e as Xr,b0 as Xs,hme as Xt,al as Xu,vhe as Y,v0 as Ya,pf as Yc,wr as Yd,k_e as Yi,Ul as Yl,j7 as Yn,Gde as Yo,bve as Yr,Q9 as Ys,fme as Yt,Vu as Yu,Vge as Z,rbe as Za,Qf as Zc,Qt as Zd,w_e as Zi,xl as Zl,D2 as Zn,t2 as Zo,Lve as Zr,wme as Zs,hge as Zt,Hl as Zu,Gpe as _,M0 as _a,Nme as _c,Pte as _d,ge as _f,vve as _i,Nd as _l,x5 as _n,Qye as _o,Pve as _r,K8 as _s,y_e as _t,Su as _u,F5 as a,Qge as aa,p$ as ac,Ss as ad,j as af,rve as ai,hf as al,uge as an,jme as ao,Rye as ar,N7 as as,tge as at,Cl as au,_ce as b,yQ as ba,mg as bc,Nte as bd,he as bf,R_e as bi,bp as bl,Qhe as bn,h_e as bo,Ise as br,v$ as bs,Ohe as bt,ou as bu,the as c,A2 as ca,kZ as cc,Ts as cd,te as cf,H_e as ci,Yne as cl,rge as cn,NQ as co,Whe as cr,Bpe as cs,hhe as ct,ql as cu,Kpe as d,yce as da,eme as dc,bs as dd,ie as df,wve as di,md as dl,ame as dn,h$ as do,a_e as dr,a8 as ds,Hge as dt,hu as du,Tge as ea,yye as ec,pl as ed,ht as ef,Ive as ei,Kd as el,sge as en,Q6 as eo,jye as er,pme as es,Mpe as et,yl as eu,Lpe as f,dme as fa,R4 as fc,As as fd,de as ff,Tve as fi,Bf as fl,jge as fn,YQ as fo,o_e as fr,a2 as fs,Uge as ft,hl as fu,Fpe as g,X$ as ga,z4 as gc,ns as gd,D as gf,Fye as gi,Rne as gl,Mge as gn,Lye as go,K7 as gr,J$ as gs,x0 as gt,Eu as gu,Zpe as h,Jhe as ha,oye as hc,ls as hd,ue as hf,E7 as hi,Gne as hl,Ege as hn,lZ as ho,Eve as hr,nve as hs,Lge as ht,Au as hu,s7 as i,phe as ia,i8 as ic,Ds as id,Ae as if,X_e as ii,Hne as il,xce as in,E1 as io,a5 as ir,d_e as is,Q0 as it,Sl as iu,Xve as j,mbe as ja,yne as jc,to as jd,T as jf,nge as ji,cd as jl,mhe as jn,ibe as jo,$4 as jr,VZ as js,Khe as jt,Bu as ju,i5 as k,DZ as ka,Wd as kc,P as kd,y as kf,Pge as ki,rne as kl,gce as kn,q8 as ko,Wse as kr,x$ as ks,Hhe as kt,Yl as ku,ohe as l,F7 as la,obe as lc,ws as ld,ne as lf,U_e as li,nne as ll,age as ln,sse as lo,c_e as lr,Pme as ls,xhe as lt,ru as lu,Jpe as m,N5 as ma,T$ as mc,us as md,ce as mf,K_e as mi,zne as ml,Dge as mn,C2 as mo,l_e as mr,C$ as ms,Phe as mt,Tu as mu,wbe as n,wge as na,Ave as nc,ys as nd,dt as nf,z7 as ni,Jne as nl,pge as nn,nye as no,w9 as nr,_2 as ns,o5 as nt,$c as nu,bge as o,$ge as oa,fse as oc,vs as od,A as of,Y_e as oi,Ene as ol,lge as on,Z$ as oo,Gye as or,Hfe as os,Xge as ot,wl as ou,qpe as p,ume as pa,u7 as pc,ds as pd,ae as pf,G_e as pi,_ne as pl,kge as pn,X5 as po,s_e as pr,R0 as ps,uZ as pt,wu as pu,The as q,N_e as qa,tp as qc,Qi as qd,E_e as qi,Yu as ql,B7 as qn,sce as qo,uve as qr,J0 as qs,nme as qt,Rl as qu,qye as r,Sge as ra,JQ as rc,ks as rd,He as rf,J_e as ri,qne as rl,mge as rn,P9 as ro,X0 as rr,Nve as rs,Moe as rt,kl as ru,xge as s,$0 as sa,Eme as sc,Cs as sd,ve as sf,V_e as si,xd as sl,fge as sn,I0 as so,Uhe as sr,t3 as ss,Zge as st,Jl as su,Cbe as t,Cge as ta,Npe as tc,Jc as td,_t as tf,hve as ti,Gd as tl,cge as tn,r9 as to,Mye as tr,mme as ts,$8 as tt,vl as tu,Ipe as u,bce as ua,HQ as uc,xs as ud,re as uf,W_e as ui,Cne as ul,T2 as un,Zye as uo,i_e as ur,QQ as us,bhe as ut,mu as uu,Ppe as v,bQ as va,oU as vc,fs as vd,le as vf,xve as vi,ff as vl,_5 as vn,N9 as vo,Pse as vr,q6 as vs,b_e as vt,Cu as vu,cce as w,jve as wa,ere as wc,so as wd,v as wf,Rve as wi,up as wl,R1 as wn,m0 as wo,Mve as wr,k9 as ws,ome as wt,Pu as wu,Upe as x,VQ as xa,V as xc,Jte as xd,k as xf,z_e as xi,np as xl,$$ as xn,iZ as xo,Lse as xr,p9 as xs,Qpe as xt,El as xu,Wpe as y,vme as ya,TH as yc,_s as yd,fe as yf,Cve as yi,pd as yl,e2 as yn,wye as yo,Fse as yr,T4 as ys,x_e as yt,Mu as yu,Y7 as z,z9 as za,Jf as zc,_o as zd,Ese as zi,kne as zl,Yge as zn,q0 as zo,ive as zr,bme as zs,f9 as zt,Ru as zu};