@inkeep/open-knowledge 0.71.0-beta.5 → 0.71.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 (130) hide show
  1. package/dist/cli.mjs +6 -6
  2. package/dist/constants-PI7Uk_9U.mjs +1 -0
  3. package/dist/{dist-CfbmVdxm.mjs → dist-Cu24mffC.mjs} +1 -1
  4. package/dist/{dist-Dez6tzlv.mjs → dist-WGEb77w6.mjs} +474 -474
  5. package/dist/index.mjs +69 -69
  6. package/dist/init-Cxs22dc-.mjs +1 -0
  7. package/dist/{init-e0orSKOt.mjs → init-DJozyAP4.mjs} +2 -2
  8. package/dist/{launch-json-removal-D6suEZDI.mjs → launch-json-removal-CLXqZ8FV.mjs} +1 -1
  9. package/dist/{loader-CLwkrqY9.mjs → loader-OHqd0KW8.mjs} +1 -1
  10. package/dist/loader-yEu9PpEQ.mjs +1 -0
  11. package/dist/{md-manager-BGnqyqi1-3pT0cZWk.mjs → md-manager-BGnqyqi1-BnHkV2Y4.mjs} +2 -2
  12. package/dist/{open-browser-1dLsj63B.mjs → open-browser-BD03Xcs2.mjs} +1 -1
  13. package/dist/parse-worker.mjs +1 -1
  14. package/dist/preview-DPw19SOR.mjs +1 -0
  15. package/dist/{preview-CV8_KQED.mjs → preview-Dnpx-15V.mjs} +1 -1
  16. package/dist/public/assets/{ActivityModeContent-DbclQMZK.js → ActivityModeContent-BJdaznjT.js} +1 -1
  17. package/dist/public/assets/{AddPropertiesButton-CMf-KkCT.js → AddPropertiesButton-CWXtIJBB.js} +2 -2
  18. package/dist/public/assets/{AgentDiffPane-qfjnh5w9.js → AgentDiffPane-Bgb-TqdH.js} +1 -1
  19. package/dist/public/assets/{AgentThreadClientBinder-Dv_ylFJd.js → AgentThreadClientBinder-DpyzkD9R.js} +1 -1
  20. package/dist/public/assets/{BugReportHistory-CKNSwMPv.js → BugReportHistory-NoOgL4e-.js} +1 -1
  21. package/dist/public/assets/{BugReportHistoryDialog-ByuUF0Vk.js → BugReportHistoryDialog-DYkbQ_VP.js} +1 -1
  22. package/dist/public/assets/{CodeMirrorPropInput-Bg2M0VGj.js → CodeMirrorPropInput-Btu3mHtw.js} +1 -1
  23. package/dist/public/assets/{ConsentDialogBody-Cma1nkJp.js → ConsentDialogBody-Co7zxbd1.js} +1 -1
  24. package/dist/public/assets/{DiffViewBoundary-B0fcLuH6.js → DiffViewBoundary-CjYhHYXW.js} +1 -1
  25. package/dist/public/assets/{DocumentContext-pm__5kxG.js → DocumentContext-Ds-fn6hr.js} +1 -1
  26. package/dist/public/assets/{EditorModeToggle-DU9-rkBI.js → EditorModeToggle-dclY5DGp.js} +1 -1
  27. package/dist/public/assets/{EnableSyncConfirmDialog-BIWQIL1r.js → EnableSyncConfirmDialog-CY7bePze.js} +1 -1
  28. package/dist/public/assets/{ExcalidrawDocEditor-Dmw0ahkY.js → ExcalidrawDocEditor-7BkV5yaY.js} +1 -1
  29. package/dist/public/assets/FeedbackForm-D6x1Kme5.js +1 -0
  30. package/dist/public/assets/{GraphPanel-vXJr8WRj.js → GraphPanel-CAy7iK1-.js} +1 -1
  31. package/dist/public/assets/{ImageAttachments-DXKklhex.js → ImageAttachments-CckZxudE.js} +1 -1
  32. package/dist/public/assets/{ImportSkillDialog-CCFX_M_a.js → ImportSkillDialog-CM7GHBVC.js} +1 -1
  33. package/dist/public/assets/{LintConfigEditor-CkrB6zf0.js → LintConfigEditor-D2adiJ_F.js} +1 -1
  34. package/dist/public/assets/ManagedArtifactProperties-BjI35KVX.js +1 -0
  35. package/dist/public/assets/{ManagedArtifactProperties-DzX_JRWB.js → ManagedArtifactProperties-biGQX3ij.js} +1 -1
  36. package/dist/public/assets/{MermaidDocEditor-DRgpS3_p.js → MermaidDocEditor-BUTIxTnE.js} +1 -1
  37. package/dist/public/assets/{PropertyDisplayRow-floO6hTm.js → PropertyDisplayRow-fM_A-_6U.js} +1 -1
  38. package/dist/public/assets/{RegisteredAgentIcon-BniGAp0H.js → RegisteredAgentIcon-Bm7qna_x.js} +1 -1
  39. package/dist/public/assets/{ReportBugDialogBody-4TLEormO.js → ReportBugDialogBody-Bv7pQbuO.js} +1 -1
  40. package/dist/public/assets/{ReportBugMenuTrigger-DvYN3NQJ.js → ReportBugMenuTrigger-0PV_UPMP.js} +2 -2
  41. package/dist/public/assets/{SchemaConfigEditor-Dx9HRjqA.js → SchemaConfigEditor-VAFLWTdf.js} +1 -1
  42. package/dist/public/assets/{SessionsHost-B3gqMSx7.js → SessionsHost-ChTej8aQ.js} +2 -2
  43. package/dist/public/assets/{SettingsDialogBody-DgTajMvc.js → SettingsDialogBody-BwNmDXzH.js} +1 -1
  44. package/dist/public/assets/{ShareBranchSwitchDialog-byzfWIrx.js → ShareBranchSwitchDialog-DVGxVZvK.js} +1 -1
  45. package/dist/public/assets/{ShareReceiveDialog-DXGKc-eg.js → ShareReceiveDialog-D4hyoVKV.js} +1 -1
  46. package/dist/public/assets/{ShareReceiveMissDialog-BMpWu47L.js → ShareReceiveMissDialog-AD5BnGhc.js} +1 -1
  47. package/dist/public/assets/{SkillCostValue-kClc0fwb.js → SkillCostValue-DMXVUaE7.js} +1 -1
  48. package/dist/public/assets/{SkillEditBanner-DH_4HoeL.js → SkillEditBanner-D9FB_lST.js} +1 -1
  49. package/dist/public/assets/{SkillForkDialog-D2CyMo9S.js → SkillForkDialog-DtSVNYK4.js} +1 -1
  50. package/dist/public/assets/{SkillInstallMenu-CLaCoUbU.js → SkillInstallMenu-BuFRSp_z.js} +1 -1
  51. package/dist/public/assets/{SkillOriginInline-L0ltzBVq.js → SkillOriginInline-BW_RoHYE.js} +1 -1
  52. package/dist/public/assets/{SkillToolbarControls-BaRzHksM.js → SkillToolbarControls-BKD6xxHt.js} +1 -1
  53. package/dist/public/assets/{SlidesToolbarControls-C5L1N2yM.js → SlidesToolbarControls-8odjAztJ.js} +1 -1
  54. package/dist/public/assets/{SourceEditor-D9SpDdL3.js → SourceEditor-C7uucUJz.js} +1 -1
  55. package/dist/public/assets/{TerminalPanel-CClWTYgq.js → TerminalPanel-CfiR68PD.js} +1 -1
  56. package/dist/public/assets/{TerminalWindowApp-CqCSI-z9.js → TerminalWindowApp-CmC7nqwp.js} +1 -1
  57. package/dist/public/assets/{TextDocEditor-FD-4OL4a.js → TextDocEditor-eGnW8YYf.js} +1 -1
  58. package/dist/public/assets/{ThreadView-Y55Ic9ZL.js → ThreadView-Bzyz7WGW.js} +1 -1
  59. package/dist/public/assets/{TimelineDiffPane-BLuu7rmg.js → TimelineDiffPane-BrwPPIS_.js} +1 -1
  60. package/dist/public/assets/{agent-diff-store-BHRY1k05.js → agent-diff-store-D-0KFcBI.js} +1 -1
  61. package/dist/public/assets/{auth-state-cache-CBn2RxRK.js → auth-state-cache-DI1ZZBIU.js} +1 -1
  62. package/dist/public/assets/{bug-report-send-manager-B4I09buF.js → bug-report-send-manager-B5xbQpHt.js} +1 -1
  63. package/dist/public/assets/client-version-9_WlPld6.js +1 -0
  64. package/dist/public/assets/{comment-chips-CFaS-ywE.js → comment-chips-Ckz0ppef.js} +1 -1
  65. package/dist/public/assets/{config-provider-Dl4a9LPU.js → config-provider-C1jgKj52.js} +1 -1
  66. package/dist/public/assets/{dist-OWwYTCbv.js → dist-DbRnfSz4.js} +2 -2
  67. package/dist/public/assets/{doc-hash-ocGRCVP7.js → doc-hash-xMWnMdX4.js} +1 -1
  68. package/dist/public/assets/{doc-undo-manager-eJ7exf62.js → doc-undo-manager-Ch4SaORf.js} +1 -1
  69. package/dist/public/assets/{documents-events-BzV0avF9.js → documents-events-CgeDb9QZ.js} +1 -1
  70. package/dist/public/assets/{file-tree-adapter-KU9w2isp.js → file-tree-adapter-B41-ZDHD.js} +1 -1
  71. package/dist/public/assets/{file-tree-utils-CBDlYx9T.js → file-tree-utils-DzFH_0CO.js} +1 -1
  72. package/dist/public/assets/{folder-config-api-D7qs-oGb.js → folder-config-api-gItnLltV.js} +1 -1
  73. package/dist/public/assets/i18n-Ca-WWW0i.js +1 -0
  74. package/dist/public/assets/{index-C4_OEpze.js → index-BD5kzJoS.js} +8 -8
  75. package/dist/public/assets/{launcher-selection-D1cxSoBy.js → launcher-selection-CnKhsntZ.js} +1 -1
  76. package/dist/public/assets/{lint-config-client-BdEFVYXo.js → lint-config-client-B2LNzQAQ.js} +1 -1
  77. package/dist/public/assets/{markdownlint-rule-browser-BYoM62zI.js → markdownlint-rule-browser-D1aD4zPr.js} +1 -1
  78. package/dist/public/assets/{page-list-cache-HBCOlbcl.js → page-list-cache-CjTFJKo7.js} +1 -1
  79. package/dist/public/assets/{pending-receive-nav-store-bHuKF2gs.js → pending-receive-nav-store-B95_ZpJ4.js} +1 -1
  80. package/dist/public/assets/{progress-CJNEXykR.js → progress-ByyPqwYa.js} +1 -1
  81. package/dist/public/assets/{project-paths-CFeW8DJd.js → project-paths-OL9RkD5R.js} +1 -1
  82. package/dist/public/assets/{prop-types-BBCouFfv.js → prop-types-CHZ5GpmQ.js} +1 -1
  83. package/dist/public/assets/{receive-store-Bf27vET3.js → receive-store-C6AmiC1-.js} +1 -1
  84. package/dist/public/assets/{selection-context-BepuwbkP.js → selection-context-DXlbV8vJ.js} +1 -1
  85. package/dist/public/assets/{skill-scope-_ny0Srcd.js → skill-scope-BgVsrS6b.js} +1 -1
  86. package/dist/public/assets/{skills-api-BXrK2gM-.js → skills-api-Dk5al98n.js} +1 -1
  87. package/dist/public/assets/{src-D4m5d2fp.js → src-BFdtDZAW.js} +1 -1
  88. package/dist/public/assets/{startup-marks-BfQIYKQG.js → startup-marks-DxOAcnz5.js} +1 -1
  89. package/dist/public/assets/{tag-pill-input-q39U7R1C.js → tag-pill-input-CQfRLAYz.js} +1 -1
  90. package/dist/public/assets/{target-navigation-intent-tHqI_gAU.js → target-navigation-intent-BS7YXP0N.js} +1 -1
  91. package/dist/public/assets/{telemetry-impl-DrMfLmRK.js → telemetry-impl-Bi_SKDTr.js} +1 -1
  92. package/dist/public/assets/{telemetry-startup-mvU41EW9.js → telemetry-startup-DiFIuo5_.js} +1 -1
  93. package/dist/public/assets/{terminal-cli-display-ZEkmxBZM.js → terminal-cli-display-DiFJCQCx.js} +1 -1
  94. package/dist/public/assets/{terminal-command-events-Ihszb2Wb.js → terminal-command-events-Vv4PGtMR.js} +1 -1
  95. package/dist/public/assets/{terminal-telemetry-CAg03OOB.js → terminal-telemetry-BAc42SWB.js} +1 -1
  96. package/dist/public/assets/{typing-burst-detector-5DjdP85Y.js → typing-burst-detector-7NR-qtpk.js} +1 -1
  97. package/dist/public/assets/{uninstall-Bola0Evi.js → uninstall-BqrgrhoX.js} +1 -1
  98. package/dist/public/assets/{use-activity-panel-3vruosY4.js → use-activity-panel-C8_6jEhu.js} +1 -1
  99. package/dist/public/assets/{use-apply-config-color-theme-Nvs2nvyH.js → use-apply-config-color-theme-DkdH-hj1.js} +1 -1
  100. package/dist/public/assets/{use-collab-url-CtNYA00S.js → use-collab-url-m1hL6d8r.js} +1 -1
  101. package/dist/public/assets/{use-conflicts-BMrcvblP.js → use-conflicts-Bn99xsOZ.js} +1 -1
  102. package/dist/public/assets/{use-live-xterm-theme-DapcugRd.js → use-live-xterm-theme-DskS89_F.js} +1 -1
  103. package/dist/public/assets/{use-open-skill-DV7nGrSo.js → use-open-skill-CH8ZramM.js} +1 -1
  104. package/dist/public/assets/{use-settings-route-CxCnZeGY.js → use-settings-route-Dn37NV_v.js} +1 -1
  105. package/dist/public/assets/{use-skill-origin-yFmvknKx.js → use-skill-origin-Ck9TjCRI.js} +1 -1
  106. package/dist/public/assets/{use-skills-DVmDBd0L.js → use-skills-Cb2xrAj_.js} +1 -1
  107. package/dist/public/assets/{use-terminal-enabled-dTpPN8gM.js → use-terminal-enabled-CgDjbKYK.js} +1 -1
  108. package/dist/public/assets/{use-timeline-entry-diff-C8Oz7k1I.js → use-timeline-entry-diff-Ddrq1TdM.js} +1 -1
  109. package/dist/public/assets/{use-workspace-CJEyhPmI.js → use-workspace-BmKjRyd0.js} +1 -1
  110. package/dist/public/index.html +52 -52
  111. package/dist/public/uninstall.html +3 -3
  112. package/dist/{registry-probes-DQdPgGgg.mjs → registry-probes-5hlj224V.mjs} +1 -1
  113. package/dist/{removal-file-path-p6SaF6iP.mjs → removal-file-path-Bov8OpTu.mjs} +1 -1
  114. package/dist/{repair-launch-json-BxyNLbd_.mjs → repair-launch-json-D0ZDjWKk.mjs} +1 -1
  115. package/dist/{repair-mcp-configs-DM3Sp75S.mjs → repair-mcp-configs-BHLHBbhv.mjs} +1 -1
  116. package/dist/src-BC24Oo35.mjs +1 -0
  117. package/dist/{src-C_d4wyW4.mjs → src-DR9TaQqK.mjs} +1 -1
  118. package/dist/start-B_atGdZj.mjs +1 -0
  119. package/dist/{start-DA9y-WNl.mjs → start-M8sUGkJO.mjs} +3 -3
  120. package/package.json +4 -4
  121. package/dist/constants-BSVpG0DI.mjs +0 -1
  122. package/dist/init-B_h_0x9S.mjs +0 -1
  123. package/dist/loader-PP6AQ9M7.mjs +0 -1
  124. package/dist/preview-CVamRVqJ.mjs +0 -1
  125. package/dist/public/assets/FeedbackForm-62ikbOa4.js +0 -1
  126. package/dist/public/assets/ManagedArtifactProperties-f5EA7YCu.js +0 -1
  127. package/dist/public/assets/client-version-D4vjhPCi.js +0 -1
  128. package/dist/public/assets/i18n-Cvt7OPah.js +0 -1
  129. package/dist/src-Dzp5-ges.mjs +0 -1
  130. package/dist/start-CvBVFsGH.mjs +0 -1
@@ -463,7 +463,7 @@ $2`).split(`
463
463
  </div>`}];function U0(e){return["```html preview",e.html,"```"].join(`
464
464
  `)}const W0=[{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`}],G0=`127.0.0.1`,K0=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(K0.map(e=>e.value));const q0=Aw.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}}}}),J0=Uw.extend({name:`emphasis`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`*`}}},addInputRules(){return[cw({find:Rw,type:this.type,getAttributes:{sourceDelimiter:`*`}}),cw({find:Bw,type:this.type,getAttributes:{sourceDelimiter:`_`}})]}}),Y0=Lw.extend({name:`strong`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`**`}}},addInputRules(){return[cw({find:Mw,type:this.type,getAttributes:{sourceDelimiter:`**`}}),cw({find:Pw,type:this.type,getAttributes:{sourceDelimiter:`__`}})]}}),X0=JC.create({name:`escapeMark`,priority:10,excludes:``,inclusive:!1,parseHTML(){return[{tag:`span[data-escape-mark]`}]},renderHTML(){return[`span`,{"data-escape-mark":``},0]}}),Z0=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 Q0({node:e}){return``.repeat(e.nodeSize-e.content.size)}const $0=ww.create({name:`footnoteReference`,marks:`_`,group:`inline`,inline:!0,atom:!0,selectable:!0,draggable:!1,priority:60,renderText:Q0,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}})}}}),e2=Gw.extend({marks:`_`,priority:60,addAttributes(){return{...this.parent?.(),hardBreakStyle:{default:`backslash`},sourceRaw:{default:null}}}}),t2=qw.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}}}}),n2=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]}}),r2=ww.create({name:`imageReference`,marks:`_`,group:`inline`,inline:!0,atom:!0,priority:60,renderText:Q0,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 i2(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 a2=Yw.extend({marks:`_`,priority:60,renderText:Q0,addAttributes(){return{...this.parent?.(),sourceUrl:{default:null,rendered:!1}}},renderHTML({HTMLAttributes:e}){let t=GS(this.options.HTMLAttributes,e);return typeof t.src==`string`&&(t.src=i2(t.src)),[`img`,t]}}),o2=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}})}}}),s2=ww.create({name:`jsxInline`,group:`inline`,inline:!0,atom:!1,content:`text*`,isolating:!1,selectable:!0,priority:60,renderText:Q0,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]}}),c2=[`https`,`http`,`mailto`,`tel`,`ftp`,`sms`],l2=c2.map(e=>`${e}:`).join(`|`);RegExp(`^(?:${l2}|\\/|#|\\?|\\.\\/|\\.\\.\\/)`,`i`);function u2(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 d2=new Set(c2.map(e=>`${e}:`));function f2(e){try{let t=new URL(e,`https://placeholder.invalid`);return d2.has(t.protocol.toLowerCase())}catch{return!1}}const p2=`LinkFidelity must be derived from the Link extension`,m2=sT.extend({priority:60,addOptions(){let e=this.parent?.();if(e===void 0)throw Error(p2);return{...e,openOnClick:!1,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer`},isAllowedUri:f2,shouldAutoLink:()=>!0}},addAttributes(){let e=this.parent?.();if(e===void 0)throw Error(p2);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}}}}),h2=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 g2(e){return e.type.name===`list`&&!e.attrs.ordered}function _2(e){return e.type.name===`list`&&!!e.attrs.ordered}function v2(e){let t=!1;return e.forEach(e=>{e.type.name===`listItem`&&e.attrs.checked!==null&&(t=!0)}),t}function y2(e,t,n,r,i,a,o){let s=FS(e=>e.type.name===`list`)(e.selection);if(s&&i(s.node)){let{$from:n,$to:i}=e.selection;return n.blockRange(i)?Ng(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 Ag(n,a)(e,void 0)?!t||Ag(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 b2(e){return e===`x`||e===`X`}function x2(e){return e===`X`?`X`:null}function S2(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=Um(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 C2=/^\s*([-+*])\s$/,w2=/^\s*(\d+)([.)])\s$/,T2=/^\s*[-*+]\s\[([ xX]?)\]\s$/,E2=/^\s*\[([ xX]?)\]\s$/,D2=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,GS(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:y2(e,t,n,r,e=>g2(e)&&!v2(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:y2(e,t,n,r,e=>_2(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:y2(e,t,n,r,e=>g2(e)&&v2(e),{ordered:!1},{checked:!1})}}},addInputRules(){return[dw({find:C2,type:this.type,getAttributes:e=>({ordered:!1,bulletMarker:e[1]}),joinPredicate:(e,t)=>t.attrs.ordered===!1}),dw({find:w2,type:this.type,getAttributes:e=>({ordered:!0,start:Number(e[1]),listMarkerDelimiter:e[2]}),joinPredicate:(e,t)=>t.attrs.ordered===!0}),new UC({find:T2,handler:({state:e,range:t,match:n})=>S2(e,t,b2(n[1]),x2(n[1]))?void 0:null}),new UC({find:E2,handler:({state:e,range:t,match:n})=>S2(e,t,b2(n[1]),x2(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()}}}),O2=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`,GS(t),0]:[`li`,GS(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(GS(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}}}}),k2=D2,A2=O2,j2=ww.create({name:`mathInline`,marks:`_`,group:`inline`,inline:!0,atom:!0,selectable:!0,priority:60,renderText:Q0,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}})}}}),M2=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}}}}),N2=Sre.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceMarkerSpacings:{default:null}}}}),P2=Tre.extend({excludes:``,addAttributes(){return{...this.parent?.(),sourceFenceChar:{default:"`"},sourceFenceLength:{default:1},sourcePadded:{default:!1,rendered:!1}}}}),F2=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)}}}),I2=JC.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)}}}),L2=XC.create({name:`docFidelity`,addGlobalAttributes(){return[{types:[`doc`],attributes:{sourceDocBoundary:{default:null,rendered:!1}}}]}});function R2(e){for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return t;return null}function z2(e){let t=!1;return e.descendants(e=>!t&&(e.type.name===`list`&&(t=!0),!t)),t}function B2(e){let{selection:t}=e;return t instanceof Mh?t.$cursor:null}function V2(e){let t=B2(e);if(t?.parentOffset!==0)return!1;let n=R2(t);if(n===null||t.depth!==n+1||t.index(n)!==0)return!1;let r=t.index(n-1);return r!==0&&z2(t.node(n-1).child(r-1))}function H2(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 U2(e){let t=B2(e);if(!t||t.parentOffset!==t.parent.content.size)return!1;let n=R2(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=H2(t,n);return r!==null&&r<n}const W2=XC.create({name:`listBoundaryMerge`,addKeyboardShortcuts(){let e=()=>{let{editor:e}=this;if(!V2(e.state))return!1;if(e.commands.undoInputRule())return!0;let{state:t,view:n}=e;return Xh(t,n.dispatch,n)},t=()=>{let{editor:e}=this;if(!U2(e.state))return!1;let{state:t,view:n}=e;return Zh(t,n.dispatch,n)};return{Backspace:e,"Mod-Backspace":e,Delete:t,"Mod-Delete":t}}}),G2=XC.create({name:`plainTextClipboard`,priority:1e3,addProseMirrorPlugins(){return[new Uh({key:new Kh(`okPlainTextClipboard`),props:{clipboardTextSerializer:e=>e.content.textBetween(0,e.content.size,`
465
465
 
466
- `)}})]}}),K2=JC.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 q2(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||J2(n)===r||w1(e)===t}function J2(e){return e.replace(/\\([!-/:-@[-`{-~])/g,`$1`)}const Y2=Hre.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`~~`,rendered:!1}}}}),X2=hE.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDashCounts:{default:null},sourceOuterPipes:{default:null,rendered:!1},sourceAlignmentPadding:{default:null,rendered:!1}}}}),Z2=cE.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),Q2=lE.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),$2=ww.create({name:`tag`,marks:`_`,group:`inline`,inline:!0,atom:!0,selectable:!0,priority:60,renderText:Q0,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()}}}),e4=/^(?:---|—-|___\s|\*\*\*\s)$/;function t4(e){let t=String(e[0]??``).replace(/\s+$/,``);return t===`—-`?`---`:t}const n4=Dre.extend({name:`thematicBreak`,priority:60,addAttributes(){return{...this.parent?.(),sourceRaw:{default:`---`}}},addInputRules(){return[lw({find:e4,type:this.type,getAttributes:e=>({sourceRaw:t4(e)})})]}}),r4=Wre.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceForm:{default:`u`,rendered:!1}}}});function i4(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function a4(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}const o4=ww.create({name:`wikiLink`,marks:`_`,group:`inline`,inline:!0,atom:!0,priority:60,renderText:Q0,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:i4(e.getAttribute(`data-alias`)),anchor:i4(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:i4(e.getAttribute(`data-alias`)),anchor:i4(e.getAttribute(`data-anchor`)),resolved:!1}:!1}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.target??``),r=i4(e.attrs.alias),i=i4(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`},a4({target:n,alias:r,anchor:i})]}});function s4(e){let t=e.split(`/`).pop()??e,n=t.lastIndexOf(`.`);return n<=0||n===t.length-1?``:t.slice(n+1).toLowerCase()}function c4(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}const l4=[o2,M2,s2,j2,o4,ww.create({name:`wikiLinkEmbed`,group:`inline`,inline:!0,atom:!0,priority:60,renderText:Q0,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:i4(e.getAttribute(`data-alias`)),anchor:i4(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=i4(e.attrs.alias),i=i4(e.attrs.anchor),a=i4(e.attrs.resolvedSrc),o=s4(n);if(qu.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`},c4({target:n,alias:r,anchor:i})]}}),$2,k2,A2,J0,Y0,Y2,r4,P2,q0,N2,t2,n4,m2,n2,h2,e2,X0,L2,K2,G2,mie.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}}),W2,X2.configure({resizable:!0}),uE,Q2,Z2,a2.configure({inline:!0}),r2,uT,I2,F2,$0,Z0];function u4(e){let{frontmatter:t}=Jc(e);if(t===``)return null;let n;try{let e=(0,Rc.parseDocument)(Xc(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 d4=/^[a-zA-Z0-9][\w/-]*$/;function f4(e){return e.startsWith(`#`)?e.slice(1):e}function p4(e){return typeof e==`string`?[e]:Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function m4(e){if(!e||e.trim()===``)return[];let{map:t}=Qc(e);if(!t)return[];let n=p4(t.tags),r=[];for(let e of n){let t=f4(e);d4.test(t)&&r.push(t)}return r}const h4=I({changes:F(ro(`kind`,[I({key:M(),kind:R(`added`),after:Hc}).loose(),I({key:M(),kind:R(`removed`),before:Hc}).loose(),I({key:M(),kind:R(`changed`),before:Hc,after:Hc}).loose()])),unparseable:I({before:M(),after:M()}).loose().nullable()}).loose();function g4(e){let{fenced:t}=dQ(e),n=pQ(t);if(n.map===null)return{fenced:t,map:{},keys:[],parseError:n.parseError};let r=rl(n.doc);return{fenced:t,map:n.map,keys:r.length>0?r:Object.keys(n.map),parseError:void 0}}function _4(e,t){let n=g4(e),r=g4(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}Kc(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 v4(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 y4(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 b4(e,t){return y4(e,v4(t.platform,t.homeDir),t)}function x4(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 S4(e,t){return y4(e,[...v4(t.platform,t.homeDir),...x4(t.platform,t.homeDir)],t)}3072-C4("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 C4(e,t){let n=encodeURIComponent(e);return t===`cursor`?encodeURIComponent(n).length:n.length}function w4(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 T4=new Set([`opencode.json`]),E4=/^\.[A-Za-z0-9_-]+\/skills\/[^/]+\/.+$/;function D4(e){return E4.test(e)}function O4(e){return D4(e)?!1:e.split(`/`).some(e=>e.startsWith(`.`))?!0:T4.has(e.slice(e.lastIndexOf(`/`)+1))}function k4(e,t){let n=w4(e);n.ok||t.addIssue({code:`custom`,message:n.reason})}const A4=M().superRefine(k4).optional(),j4=M().superRefine(k4),M4={agentId:M().optional(),agentName:M().optional(),colorSeed:M().optional(),clientName:M().optional(),clientVersion:M().optional(),label:M().optional()},N4=M().optional(),P4=/^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,F4=ro(`kind`,[I({kind:R(`doc`),docPath:M().min(1)}).loose(),I({kind:R(`folder`),folderPath:M()}).loose()]),I4=L([`no-remote`,`detached-head`,`branch-not-on-origin`,`non-github-remote`,`invalid-path`,`unsupported-share-url`]),L4=L([`current`,`stale`,`absent`,`empty`]),R4=ro(`ok`,[I({ok:R(!0),shareUrl:M().min(1),sharedUrl:M().min(1),branch:M().min(1),freshness:L4.optional().catch(void 0)}).loose(),I({ok:R(!1),error:I4,branch:M().min(1).optional()}).loose()]),z4=L([`user`,`org`]),B4=I({login:M().min(1),kind:z4,avatarUrl:M().optional()}).loose(),V4=L([`auth-required`,`network`]),H4=ro(`ok`,[I({ok:R(!0),owners:F(B4)}).loose(),I({ok:R(!1),error:V4}).loose()]),U4=ro(`ok`,[I({ok:R(!0),available:P()}).loose(),I({ok:R(!1),error:V4}).loose()]),W4=L([`public`,`private`]),G4=I({owner:M().min(1),name:M().min(1),visibility:W4,description:M().optional()}).loose(),K4=L([`name-conflict`,`saml-sso`,`auth-required`,`push-failed`,`init-failed`,`network`,`no-project`]),q4=ro(`ok`,[I({ok:R(!0),ownerLogin:M().min(1),repoName:M().min(1),cloneUrl:M().min(1),defaultBranch:M().min(1)}).loose(),I({ok:R(!1),error:K4}).loose()]);function J4(e){return!(typeof e!=`string`||e.length===0||e.startsWith(`-`)||/[\x00-\x1F\x7F]/.test(e)||/\s/.test(e)||e.includes(`:`)||e.split(`/`).includes(`..`))}const Y4=e=>e.refine(J4,`invalid branch name`);function X4(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 Z4=[/could not read (username|password)/i,/terminal prompts disabled/i,/user interactivity has been disabled/i,/unable to get password from user/i],Q4=[/insufficient scopes/i,/missing.*scope/i,/required scope/i],$4=[/permission denied.*\(publickey\)/i,/host key verification failed/i],e3=/fatal:.*repository.*not found/i,t3=[/\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,e3];function n3(e){if(typeof e!=`object`||!e)return``;let t=e.git;return t==null?``:String(t)}function r3(e){if(e==null)return{kind:`non-auth`};let t=`${e instanceof Error?e.message:String(e)}\n${n3(e)}`;return Z4.some(e=>e.test(t))?{kind:`auth`,subclass:`no-credential`}:Q4.some(e=>e.test(t))?{kind:`auth`,subclass:`scope-mismatch`}:$4.some(e=>e.test(t))?{kind:`auth`,subclass:`ssh-auth`}:t3.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`}:e3.test(t)?{kind:`auth`,subclass:`not-found-as-identity`}:{kind:`auth`,subclass:`unknown-auth`}:{kind:`non-auth`}}function i3(e){return e.kind===`auth`?e.subclass===`no-credential`||e.subclass===`401`||e.subclass===`unknown-auth`:!1}const a3={shareTargetExists:P(),dirtyConflicts:I({conflicts:P(),files:F(M().min(1))}).loose(),branchIsLocal:P(),shareTargetOnOriginBranch:P().optional()},o3=ro(`detached`,[I({detached:R(!1),currentBranch:M().min(1).nullable(),currentHeadSha:Ua(),...a3}).loose(),I({detached:R(!0),currentBranch:Ua(),currentHeadSha:M().min(1),...a3}).loose()]),s3=I({branch:Y4(M().min(1)),principalId:M().optional(),fastForward:P().optional()}).loose(),c3=L([`dirty-conflict`,`branch-not-found`,`fetch-failed`,`checkout-failed`,`branch-in-other-worktree`,`ff-diverged`]),l3=ro(`ok`,[I({ok:R(!0)}).loose(),I({ok:R(!1),reason:c3,files:F(M().min(1)).optional(),otherWorktreePath:M().min(1).optional()}).loose()]);L([`on-origin`,`renamed`,`deleted`,`never-on-branch`,`changed-locally`,`unknown`]);const u3=I({branch:Y4(M().min(1)),path:M(),kind:L([`doc`,`folder`]),contentRootDepth:N().int().min(1).max(65535).optional()}).loose(),d3=ro(`verdict`,[I({verdict:R(`on-origin`)}).loose(),I({verdict:R(`renamed`),renamedTo:M().min(1)}).loose(),I({verdict:R(`deleted`)}).loose(),I({verdict:R(`never-on-branch`)}).loose(),I({verdict:R(`changed-locally`)}).loose(),I({verdict:R(`unknown`)}).loose()]).catch({verdict:`unknown`}),f3=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()}),p3=I({serverInstanceId:M().min(1),currentBranch:M().min(1).optional(),currentDiskAckSVs:so(M().min(1),M().min(1)).optional(),boot:f3.optional(),collabClients:N().int().nonnegative().optional()}).loose(),m3=I({id:M().min(1),display_name:M().min(1),display_email:M(),source:L([`git-config`,`synthesized`]),created_at:M().min(1)}).loose(),h3=I({collabUrl:M().nullable(),previewUrl:M().nullable(),port:N(),singleFile:P().default(!1)}).loose(),g3=L(`urn:ok:error:malformed-upload.urn:ok:error:collision-exhaustion.urn:ok:error:storage-full.urn:ok:error:storage-readonly.urn:ok:error:storage-error.urn:ok:error:no-file-received.urn:ok:error:path-escape.urn:ok:error:method-not-allowed.urn:ok:error:invalid-request.urn:ok:error:payload-too-large.urn:ok:error:request-timeout.urn:ok:error:internal-server-error.urn:ok:error:derived-index-unavailable.urn:ok:error:loopback-required.urn:ok:error:invalid-origin.urn:ok:error:url-not-allowed.urn:ok:error:dir-outside-home.urn:ok:error:concurrent-operation.urn:ok:error:clone-failed.urn:ok:error:clone-timeout.urn:ok:error:server-start-failed.urn:ok:error:reserved-doc-name.urn:ok:error:target-not-found.urn:ok:error:stale-target.urn:ok:error:frontmatter-edit-not-supported.urn:ok:error:invalid-frontmatter-patch.urn:ok:error:frontmatter-malformed.urn:ok:error:no-active-session.urn:ok:error:too-many-agent-sessions.urn:ok:error:disk-divergence.urn:ok:error:stale-external-write.urn:ok:error:doc-not-found.urn:ok:error:doc-already-exists.urn:ok:error:doc-not-open.urn:ok:error:rollback-not-configured.urn:ok:error:doc-not-available.urn:ok:error:backlink-index-not-configured.urn:ok:error:file-rescan-not-configured.urn:ok:error:shadow-not-configured.urn:ok:error:host-not-allowed.urn:ok:error:principal-not-available.urn:ok:error:not-found.urn:ok:error:auth-failed.urn:ok:error:no-project-dir.urn:ok:error:server-open-failed.urn:ok:error:doc-in-conflict.urn:ok:error:unresolved-conflict-markers.urn:ok:error:no-conflict-tracked.urn:ok:error:no-blocking-changes.urn:ok:error:sync-not-active.urn:ok:error:project-repo-not-configured.urn:ok:error:seed-prerequisite-missing.urn:ok:error:seed-invalid-root.urn:ok:error:tag-index-not-configured.urn:ok:error:template-not-found.urn:ok:error:unsupported-asset-type.urn:ok:error:asset-not-found.urn:ok:error:single-file-mode.urn:ok:error:collab-server-not-running.urn:ok:error:gateway-timeout.urn:ok:error:cursor-not-installed.urn:ok:error:cursor-spawn-timeout.urn:ok:error:cursor-spawn-failed.urn:ok:error:handoff-target-not-installed.urn:ok:error:handoff-spawn-timeout.urn:ok:error:handoff-spawn-failed.urn:ok:error:registry-unreachable.urn:ok:error:config-not-writable.urn:ok:error:audit-superseded.urn:ok:error:theme-name-taken.urn:ok:error:theme-name-invalid`.split(`.`));function _3(e){throw Error(`Unexpected ProblemType variant: ${JSON.stringify(e)}`)}const v3=I({type:g3,title:M().min(1),status:N().int().min(400).max(599),instance:M().regex(P4,`instance must be urn:uuid:<uuid>`).optional(),detail:M().optional()}).loose(),y3=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(),b3=I({src:M().min(1),path:M().min(1).optional(),deduped:P().optional()}).loose(),x3=I({url:M().min(1),dir:M().min(1),branch:M().min(1).refine(J4,`invalid branch name`).optional()}).loose(),S3=I({type:R(`error`),problem:v3}).loose();function C3(e,t){let n=t.map(e=>[mp(e),e]);for(let t of e){let e=mp(t);if(e===null)continue;let r=n.find(([t])=>t===e);if(r!==void 0)return r[1]}}function w3(e){let{override:t,storedPreference:n,preferenceList:r,supportedLocales:i}=e,a=e.autoDetectableLocales??i;if(t!==void 0){let e=C3([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=C3(r,a);return o===void 0?{locale:`en`,source:`fallback`}:{locale:o,source:`system`}}const Aae=[`.ok`,`local`,`installed-skills.json`],jae=L(pl),Mae=$a({hosts:F(M()),scope:jae,scripts:P(),installedAt:Gi(),projection:L([`symlink`,`copy`]).optional(),contentHash:M().optional()}),T3=$a({schema:R(1),skills:so(M(),Mae).default({})});function Nae(){return{schema:1,skills:{}}}function Pae(e){let t;try{t=JSON.parse(e)}catch{return null}let n=T3.safeParse(t);return n.success?n.data:null}const E3=[{name:`github-pat`,regex:/\b(ghp_|gho_|ghu_|ghs_|ghr_)[A-Za-z0-9]{36,}\b/g,replacement:`[REDACTED-GH-PAT]`},{name:`aws-access-key`,regex:/\b(AKIA|ASIA|ABIA)[A-Z2-7]{16}\b/g,replacement:`[REDACTED-AWS-KEY]`},{name:`anthropic-key`,regex:/\bsk-ant-api03-[A-Za-z0-9_-]{20,}\b/g,replacement:`[REDACTED-ANTHROPIC]`},{name:`openai-key`,regex:/\bsk-[A-Za-z0-9]{20,}\b/g,replacement:`[REDACTED-OPENAI]`},{name:`bearer-token`,regex:/([Aa]uthorization:\s*[Bb]earer\s+)(?:\\"[^\s"\\]+\\"|"[A-Za-z0-9\-._~+/=]+"|[^\s"\\]+)/g,replacement:`$1[REDACTED]`},{name:`jwt`,regex:/eyJ[A-Za-z0-9_-]{8,}\.eyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}/g,replacement:`[REDACTED-JWT]`},{name:`url-credentials`,regex:/:\/\/[^/\s:@"]+:[^/\s:@"]+@/g,replacement:`://[REDACTED]@`},{name:`github-pat-fine-grained`,regex:/\bgithub_pat_[0-9A-Za-z_]{20,}/g,replacement:`[REDACTED-GH-PAT]`},{name:`openai-key-modern`,regex:/\bsk-(?:proj|svcacct|admin|None)-[A-Za-z0-9_-]{20,}/g,replacement:`[REDACTED-OPENAI]`},{name:`slack-token`,regex:/\bxox[a-z]-[A-Za-z0-9-]{10,}/g,replacement:`[REDACTED-SLACK]`},{name:`google-api-key`,regex:/\bAIza[0-9A-Za-z_-]{35}/g,replacement:`[REDACTED-GOOGLE]`},{name:`stripe-secret-key`,regex:/\b(?:sk|rk)_live_[0-9A-Za-z]{16,}\b/g,replacement:`[REDACTED-STRIPE]`},{name:`gitlab-pat`,regex:/\bglpat-[0-9A-Za-z_-]{20,}/g,replacement:`[REDACTED-GITLAB]`},{name:`bearer-token-json`,regex:/("[Aa]uthorization"\s*:\s*"[Bb]earer\s+)(?:\\"[^"\\]+\\"|[^"\\]+)/g,replacement:`$1[REDACTED]`},{name:`macos-home-path`,regex:/\/Users\/[^/"\r]*[^/"\r\\]/g,replacement:`~`},{name:`linux-home-path`,regex:/\/home\/[^/"\r]*[^/"\r\\]/g,replacement:`~`},{name:`windows-home-path`,regex:/[A-Za-z]:\\{1,2}Users\\{1,2}(?:(?![A-Za-z]:\\)[^\\"\r])+/gi,replacement:`~`}],Fae=E3.map(e=>e.name);function Iae(e){let t=new Set,n=0;return{redacted:e.split(`
466
+ `)}})]}}),K2=JC.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 q2(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||J2(n)===r||w1(e)===t}function J2(e){return e.replace(/\\([!-/:-@[-`{-~])/g,`$1`)}const Y2=Hre.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`~~`,rendered:!1}}}}),X2=hE.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDashCounts:{default:null},sourceOuterPipes:{default:null,rendered:!1},sourceAlignmentPadding:{default:null,rendered:!1}}}}),Z2=cE.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),Q2=lE.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),$2=ww.create({name:`tag`,marks:`_`,group:`inline`,inline:!0,atom:!0,selectable:!0,priority:60,renderText:Q0,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()}}}),e4=/^(?:---|—-|___\s|\*\*\*\s)$/;function t4(e){let t=String(e[0]??``).replace(/\s+$/,``);return t===`—-`?`---`:t}const n4=Dre.extend({name:`thematicBreak`,priority:60,addAttributes(){return{...this.parent?.(),sourceRaw:{default:`---`}}},addInputRules(){return[lw({find:e4,type:this.type,getAttributes:e=>({sourceRaw:t4(e)})})]}}),r4=Wre.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceForm:{default:`u`,rendered:!1}}}});function i4(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function a4(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}const o4=ww.create({name:`wikiLink`,marks:`_`,group:`inline`,inline:!0,atom:!0,priority:60,renderText:Q0,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:i4(e.getAttribute(`data-alias`)),anchor:i4(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:i4(e.getAttribute(`data-alias`)),anchor:i4(e.getAttribute(`data-anchor`)),resolved:!1}:!1}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.target??``),r=i4(e.attrs.alias),i=i4(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`},a4({target:n,alias:r,anchor:i})]}});function s4(e){let t=e.split(`/`).pop()??e,n=t.lastIndexOf(`.`);return n<=0||n===t.length-1?``:t.slice(n+1).toLowerCase()}function c4(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}const l4=[o2,M2,s2,j2,o4,ww.create({name:`wikiLinkEmbed`,group:`inline`,inline:!0,atom:!0,priority:60,renderText:Q0,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:i4(e.getAttribute(`data-alias`)),anchor:i4(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=i4(e.attrs.alias),i=i4(e.attrs.anchor),a=i4(e.attrs.resolvedSrc),o=s4(n);if(qu.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`},c4({target:n,alias:r,anchor:i})]}}),$2,k2,A2,J0,Y0,Y2,r4,P2,q0,N2,t2,n4,m2,n2,h2,e2,X0,L2,K2,G2,mie.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}}),W2,X2.configure({resizable:!0}),uE,Q2,Z2,a2.configure({inline:!0}),r2,uT,I2,F2,$0,Z0];function u4(e){let{frontmatter:t}=Jc(e);if(t===``)return null;let n;try{let e=(0,Rc.parseDocument)(Xc(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 d4=/^[a-zA-Z0-9][\w/-]*$/;function f4(e){return e.startsWith(`#`)?e.slice(1):e}function p4(e){return typeof e==`string`?[e]:Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function m4(e){if(!e||e.trim()===``)return[];let{map:t}=Qc(e);if(!t)return[];let n=p4(t.tags),r=[];for(let e of n){let t=f4(e);d4.test(t)&&r.push(t)}return r}const h4=I({changes:F(ro(`kind`,[I({key:M(),kind:R(`added`),after:Hc}).loose(),I({key:M(),kind:R(`removed`),before:Hc}).loose(),I({key:M(),kind:R(`changed`),before:Hc,after:Hc}).loose()])),unparseable:I({before:M(),after:M()}).loose().nullable()}).loose();function g4(e){let{fenced:t}=dQ(e),n=pQ(t);if(n.map===null)return{fenced:t,map:{},keys:[],parseError:n.parseError};let r=rl(n.doc);return{fenced:t,map:n.map,keys:r.length>0?r:Object.keys(n.map),parseError:void 0}}function _4(e,t){let n=g4(e),r=g4(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}Kc(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 v4(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 y4(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 b4(e,t){return y4(e,v4(t.platform,t.homeDir),t)}function x4(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 S4(e,t){return y4(e,[...v4(t.platform,t.homeDir),...x4(t.platform,t.homeDir)],t)}3072-C4("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 C4(e,t){let n=encodeURIComponent(e);return t===`cursor`?encodeURIComponent(n).length:n.length}function w4(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 T4=new Set([`opencode.json`]),E4=/^\.[A-Za-z0-9_-]+\/skills\/[^/]+\/.+$/;function D4(e){return E4.test(e)}function O4(e){return D4(e)?!1:e.split(`/`).some(e=>e.startsWith(`.`))?!0:T4.has(e.slice(e.lastIndexOf(`/`)+1))}function k4(e,t){let n=w4(e);n.ok||t.addIssue({code:`custom`,message:n.reason})}const A4=M().superRefine(k4).optional(),j4=M().superRefine(k4),M4={agentId:M().optional(),agentName:M().optional(),colorSeed:M().optional(),clientName:M().optional(),clientVersion:M().optional(),label:M().optional()},N4=M().optional(),P4=/^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,F4=ro(`kind`,[I({kind:R(`doc`),docPath:M().min(1)}).loose(),I({kind:R(`folder`),folderPath:M()}).loose()]),I4=L([`no-remote`,`detached-head`,`branch-not-on-origin`,`non-github-remote`,`invalid-path`,`unsupported-share-url`]),L4=L([`current`,`stale`,`absent`,`empty`]),R4=ro(`ok`,[I({ok:R(!0),shareUrl:M().min(1),sharedUrl:M().min(1),branch:M().min(1),freshness:L4.optional().catch(void 0)}).loose(),I({ok:R(!1),error:I4,branch:M().min(1).optional()}).loose()]),z4=L([`user`,`org`]),B4=I({login:M().min(1),kind:z4,avatarUrl:M().optional()}).loose(),V4=L([`auth-required`,`network`]),H4=ro(`ok`,[I({ok:R(!0),owners:F(B4)}).loose(),I({ok:R(!1),error:V4}).loose()]),U4=ro(`ok`,[I({ok:R(!0),available:P()}).loose(),I({ok:R(!1),error:V4}).loose()]),W4=L([`public`,`private`]),G4=I({owner:M().min(1),name:M().min(1),visibility:W4,description:M().optional()}).loose(),K4=L([`name-conflict`,`saml-sso`,`auth-required`,`push-failed`,`init-failed`,`network`,`no-project`]),q4=ro(`ok`,[I({ok:R(!0),ownerLogin:M().min(1),repoName:M().min(1),cloneUrl:M().min(1),defaultBranch:M().min(1)}).loose(),I({ok:R(!1),error:K4}).loose()]);function J4(e){return!(typeof e!=`string`||e.length===0||e.startsWith(`-`)||/[\x00-\x1F\x7F]/.test(e)||/\s/.test(e)||e.includes(`:`)||e.split(`/`).includes(`..`))}const Y4=e=>e.refine(J4,`invalid branch name`);function X4(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 Z4=[/could not read (username|password)/i,/terminal prompts disabled/i,/user interactivity has been disabled/i,/unable to get password from user/i],Q4=[/insufficient scopes/i,/missing.*scope/i,/required scope/i],$4=[/permission denied.*\(publickey\)/i,/host key verification failed/i],e3=/fatal:.*repository.*not found/i,t3=[/\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,e3];function n3(e){if(typeof e!=`object`||!e)return``;let t=e.git;return t==null?``:String(t)}function r3(e){if(e==null)return{kind:`non-auth`};let t=`${e instanceof Error?e.message:String(e)}\n${n3(e)}`;return Z4.some(e=>e.test(t))?{kind:`auth`,subclass:`no-credential`}:Q4.some(e=>e.test(t))?{kind:`auth`,subclass:`scope-mismatch`}:$4.some(e=>e.test(t))?{kind:`auth`,subclass:`ssh-auth`}:t3.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`}:e3.test(t)?{kind:`auth`,subclass:`not-found-as-identity`}:{kind:`auth`,subclass:`unknown-auth`}:{kind:`non-auth`}}function i3(e){return e.kind===`auth`?e.subclass===`no-credential`||e.subclass===`401`||e.subclass===`unknown-auth`:!1}const a3={shareTargetExists:P(),dirtyConflicts:I({conflicts:P(),files:F(M().min(1))}).loose(),branchIsLocal:P(),shareTargetOnOriginBranch:P().optional()},o3=ro(`detached`,[I({detached:R(!1),currentBranch:M().min(1).nullable(),currentHeadSha:Ua(),...a3}).loose(),I({detached:R(!0),currentBranch:Ua(),currentHeadSha:M().min(1),...a3}).loose()]),s3=I({branch:Y4(M().min(1)),principalId:M().optional(),fastForward:P().optional()}).loose(),c3=L([`dirty-conflict`,`branch-not-found`,`fetch-failed`,`checkout-failed`,`branch-in-other-worktree`,`ff-diverged`]),l3=ro(`ok`,[I({ok:R(!0)}).loose(),I({ok:R(!1),reason:c3,files:F(M().min(1)).optional(),otherWorktreePath:M().min(1).optional()}).loose()]);L([`on-origin`,`renamed`,`deleted`,`never-on-branch`,`changed-locally`,`unknown`]);const u3=I({branch:Y4(M().min(1)),path:M(),kind:L([`doc`,`folder`]),contentRootDepth:N().int().min(1).max(65535).optional()}).loose(),d3=ro(`verdict`,[I({verdict:R(`on-origin`)}).loose(),I({verdict:R(`renamed`),renamedTo:M().min(1)}).loose(),I({verdict:R(`deleted`)}).loose(),I({verdict:R(`never-on-branch`)}).loose(),I({verdict:R(`changed-locally`)}).loose(),I({verdict:R(`unknown`)}).loose()]).catch({verdict:`unknown`}),f3=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()}),p3=I({serverInstanceId:M().min(1),currentBranch:M().min(1).optional(),currentDiskAckSVs:so(M().min(1),M().min(1)).optional(),boot:f3.optional(),collabClients:N().int().nonnegative().optional()}).loose(),m3=I({id:M().min(1),display_name:M().min(1),display_email:M(),source:L([`git-config`,`synthesized`]),created_at:M().min(1)}).loose(),h3=I({collabUrl:M().nullable(),previewUrl:M().nullable(),port:N(),singleFile:P().default(!1)}).loose(),g3=L(`urn:ok:error:malformed-upload.urn:ok:error:collision-exhaustion.urn:ok:error:storage-full.urn:ok:error:storage-readonly.urn:ok:error:storage-error.urn:ok:error:no-file-received.urn:ok:error:path-escape.urn:ok:error:symlink-refused.urn:ok:error:method-not-allowed.urn:ok:error:invalid-request.urn:ok:error:payload-too-large.urn:ok:error:request-timeout.urn:ok:error:internal-server-error.urn:ok:error:derived-index-unavailable.urn:ok:error:loopback-required.urn:ok:error:invalid-origin.urn:ok:error:url-not-allowed.urn:ok:error:dir-outside-home.urn:ok:error:concurrent-operation.urn:ok:error:clone-failed.urn:ok:error:clone-timeout.urn:ok:error:server-start-failed.urn:ok:error:reserved-doc-name.urn:ok:error:target-not-found.urn:ok:error:stale-target.urn:ok:error:frontmatter-edit-not-supported.urn:ok:error:invalid-frontmatter-patch.urn:ok:error:frontmatter-malformed.urn:ok:error:no-active-session.urn:ok:error:too-many-agent-sessions.urn:ok:error:disk-divergence.urn:ok:error:stale-external-write.urn:ok:error:doc-not-found.urn:ok:error:doc-already-exists.urn:ok:error:doc-not-open.urn:ok:error:rollback-not-configured.urn:ok:error:doc-not-available.urn:ok:error:backlink-index-not-configured.urn:ok:error:file-rescan-not-configured.urn:ok:error:shadow-not-configured.urn:ok:error:host-not-allowed.urn:ok:error:principal-not-available.urn:ok:error:not-found.urn:ok:error:auth-failed.urn:ok:error:no-project-dir.urn:ok:error:server-open-failed.urn:ok:error:doc-in-conflict.urn:ok:error:unresolved-conflict-markers.urn:ok:error:no-conflict-tracked.urn:ok:error:no-blocking-changes.urn:ok:error:sync-not-active.urn:ok:error:project-repo-not-configured.urn:ok:error:seed-prerequisite-missing.urn:ok:error:seed-invalid-root.urn:ok:error:tag-index-not-configured.urn:ok:error:template-not-found.urn:ok:error:unsupported-asset-type.urn:ok:error:asset-not-found.urn:ok:error:single-file-mode.urn:ok:error:collab-server-not-running.urn:ok:error:gateway-timeout.urn:ok:error:cursor-not-installed.urn:ok:error:cursor-spawn-timeout.urn:ok:error:cursor-spawn-failed.urn:ok:error:handoff-target-not-installed.urn:ok:error:handoff-spawn-timeout.urn:ok:error:handoff-spawn-failed.urn:ok:error:registry-unreachable.urn:ok:error:config-not-writable.urn:ok:error:audit-superseded.urn:ok:error:theme-name-taken.urn:ok:error:theme-name-invalid`.split(`.`));function _3(e){throw Error(`Unexpected ProblemType variant: ${JSON.stringify(e)}`)}const v3=I({type:g3,title:M().min(1),status:N().int().min(400).max(599),instance:M().regex(P4,`instance must be urn:uuid:<uuid>`).optional(),detail:M().optional()}).loose(),y3=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(),b3=I({src:M().min(1),path:M().min(1).optional(),deduped:P().optional()}).loose(),x3=I({url:M().min(1),dir:M().min(1),branch:M().min(1).refine(J4,`invalid branch name`).optional()}).loose(),S3=I({type:R(`error`),problem:v3}).loose();function C3(e,t){let n=t.map(e=>[mp(e),e]);for(let t of e){let e=mp(t);if(e===null)continue;let r=n.find(([t])=>t===e);if(r!==void 0)return r[1]}}function w3(e){let{override:t,storedPreference:n,preferenceList:r,supportedLocales:i}=e,a=e.autoDetectableLocales??i;if(t!==void 0){let e=C3([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=C3(r,a);return o===void 0?{locale:`en`,source:`fallback`}:{locale:o,source:`system`}}const Aae=[`.ok`,`local`,`installed-skills.json`],jae=L(pl),Mae=$a({hosts:F(M()),scope:jae,scripts:P(),installedAt:Gi(),projection:L([`symlink`,`copy`]).optional(),contentHash:M().optional()}),T3=$a({schema:R(1),skills:so(M(),Mae).default({})});function Nae(){return{schema:1,skills:{}}}function Pae(e){let t;try{t=JSON.parse(e)}catch{return null}let n=T3.safeParse(t);return n.success?n.data:null}const E3=[{name:`github-pat`,regex:/\b(ghp_|gho_|ghu_|ghs_|ghr_)[A-Za-z0-9]{36,}\b/g,replacement:`[REDACTED-GH-PAT]`},{name:`aws-access-key`,regex:/\b(AKIA|ASIA|ABIA)[A-Z2-7]{16}\b/g,replacement:`[REDACTED-AWS-KEY]`},{name:`anthropic-key`,regex:/\bsk-ant-api03-[A-Za-z0-9_-]{20,}\b/g,replacement:`[REDACTED-ANTHROPIC]`},{name:`openai-key`,regex:/\bsk-[A-Za-z0-9]{20,}\b/g,replacement:`[REDACTED-OPENAI]`},{name:`bearer-token`,regex:/([Aa]uthorization:\s*[Bb]earer\s+)(?:\\"[^\s"\\]+\\"|"[A-Za-z0-9\-._~+/=]+"|[^\s"\\]+)/g,replacement:`$1[REDACTED]`},{name:`jwt`,regex:/eyJ[A-Za-z0-9_-]{8,}\.eyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}/g,replacement:`[REDACTED-JWT]`},{name:`url-credentials`,regex:/:\/\/[^/\s:@"]+:[^/\s:@"]+@/g,replacement:`://[REDACTED]@`},{name:`github-pat-fine-grained`,regex:/\bgithub_pat_[0-9A-Za-z_]{20,}/g,replacement:`[REDACTED-GH-PAT]`},{name:`openai-key-modern`,regex:/\bsk-(?:proj|svcacct|admin|None)-[A-Za-z0-9_-]{20,}/g,replacement:`[REDACTED-OPENAI]`},{name:`slack-token`,regex:/\bxox[a-z]-[A-Za-z0-9-]{10,}/g,replacement:`[REDACTED-SLACK]`},{name:`google-api-key`,regex:/\bAIza[0-9A-Za-z_-]{35}/g,replacement:`[REDACTED-GOOGLE]`},{name:`stripe-secret-key`,regex:/\b(?:sk|rk)_live_[0-9A-Za-z]{16,}\b/g,replacement:`[REDACTED-STRIPE]`},{name:`gitlab-pat`,regex:/\bglpat-[0-9A-Za-z_-]{20,}/g,replacement:`[REDACTED-GITLAB]`},{name:`bearer-token-json`,regex:/("[Aa]uthorization"\s*:\s*"[Bb]earer\s+)(?:\\"[^"\\]+\\"|[^"\\]+)/g,replacement:`$1[REDACTED]`},{name:`macos-home-path`,regex:/\/Users\/[^/"\r]*[^/"\r\\]/g,replacement:`~`},{name:`linux-home-path`,regex:/\/home\/[^/"\r]*[^/"\r\\]/g,replacement:`~`},{name:`windows-home-path`,regex:/[A-Za-z]:\\{1,2}Users\\{1,2}(?:(?![A-Za-z]:\\)[^\\"\r])+/gi,replacement:`~`}],Fae=E3.map(e=>e.name);function Iae(e){let t=new Set,n=0;return{redacted:e.split(`
467
467
  `).map(e=>{let r=e,i=!1;for(let{name:e,regex:n,replacement:a}of E3)n.lastIndex=0,n.test(r)&&(t.add(e),i=!0,n.lastIndex=0,r=r.replace(n,a));return i&&n++,r}).join(`
468
468
  `),patterns:[...t],lineCount:n}}function Lae(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 Rae(e){let t=HO(`## ${e.replace(/\s+/g,` `).trim()}`).children[0];return t===void 0||t.type!==`heading`?``:cD(t,{includeHtml:!1}).replace(/\s+/g,` `).trim().normalize(`NFC`)}function zae(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(`
@@ -541,7 +541,7 @@ $2`).split(`
541
541
  `?(c+=1,l=1):l+=1;return{line:c,column:l}};for(let e of o.matchAll(pue)){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(mue(e[0]),s)}})}),gue=[`index`,`log`];function _ue(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);if(n<=0)return t;let r=t.slice(n).toLowerCase();return O0.includes(r)?t.slice(0,n):t}const vue=P5(`reserved-casing`,(e,t)=>{let n=t.data.okfDocName;if(n===void 0)return;let r=_ue(n),i=r.toLowerCase();gue.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.`)}),R5=[{id:`no-wiki-links`,rule:hue},{id:`log-shape`,rule:fue},{id:`index-shape`,rule:cue},{id:`reserved-casing`,rule:vue}],yue=R5.map(e=>e.rule);function bue(e){return e===void 0?yue:R5.filter(t=>D5(e,t.id)).map(e=>e.rule)}const xue=to([P(),L(Ad),so(M(),qa())]),Sue={id:`markdownlint`,sliceSchema:I({enabled:P(),rules:so(M(),xue)}),defaultSlice:{enabled:!1,rules:u5},async lint(e,t){return Ule(e,d5(t.rules))},fix(e,t){return Hle(e,d5(t.rules))}},Cue=I({appliesTo:to([M(),F(M())]).optional(),file:M(),enabled:P().optional(),key:M().optional(),schema:so(M(),qa()).optional()}),z5=[Sue,{id:`frontmatter`,sliceSchema:I({enabled:P(),schemas:F(Cue)}),defaultSlice:{enabled:!1,schemas:[]},async lint(e,t,n){return E5(e,m5(t.schemas,n.docName))},frontmatter:{schemasForDoc:(e,t)=>m5(e.schemas,t),narrowSliceToFrontmatter:e=>e,advertisedMappings:e=>e.schemas}},{id:`okf`,sliceSchema:I({enabled:P(),rules:so(M(),P()).optional(),generate:I({index:P().optional()}).optional()}),defaultSlice:{enabled:!1},async lint(e,t,n){return[...oue(e,bue(t.rules),n.docName),...rue(e,t.rules,n.docName)]},frontmatter:{schemasForDoc:(e,t)=>N5(e.rules,t),narrowSliceToFrontmatter:e=>({...e,rules:{...e.rules,...tue}}),advertisedMappings:e=>nue(e.rules)}}],wue={enabled:!0,plugins:Object.fromEntries(z5.map(e=>[e.id,e.defaultSlice]))};function B5(e,t){return e.enabled&&e.plugins[t]?.enabled===!0}function Tue(e){if(!e?.enabled)return[];let t=[];for(let n of z5){if(n.frontmatter===void 0)continue;let r=e.plugins[n.id];r?.enabled===!0&&t.push(...n.frontmatter.advertisedMappings(r))}return t}const Eue=I({docName:A4,summary:N4,content:M().optional(),...M4}).loose(),Due=I({docName:A4,summary:N4,markdown:M(),position:L([`append`,`prepend`,`replace`]).optional(),extension:L(O0).optional(),...M4}).loose(),Oue=I({docName:A4,summary:N4,find:M().min(1),replace:M(),offset:N().int().nonnegative().optional(),...M4}).loose(),kue=I({docName:A4,connectionId:M().min(1),scope:L([`last`,`session`,`file`,`count`]).optional(),count:N().int().positive().optional(),...M4}).loose().refine(e=>e.scope!==`count`||e.count!==void 0,{message:`count is required when scope is 'count'`,path:[`count`]}),V5=I({value:M(),truncatedFrom:N().int().nonnegative().optional(),hint:M().optional()}).loose(),Aue=ro(`kind`,[I({kind:R(`inline`),content:M()}),I({kind:R(`truncated`),byteLength:N().int().nonnegative(),hint:M()})]),H5=I({kind:R(`content-divergence`),intendedBytes:N().int().nonnegative(),actualBytes:N().int().nonnegative(),byteDelta:N().int(),divergenceType:M().optional(),currentState:Aue.optional(),hint:M().optional()}).loose(),jue=I({type:R(`orphan`),parentCandidates:F(M()),message:M()}).loose(),U5=I({kind:R(`disk-edit-reconciled`),intendedBytes:N().int().nonnegative(),actualBytes:N().int().nonnegative(),byteDelta:N().int(),mergeOutcome:M().optional(),hint:M().optional()}).loose();ro(`kind`,[H5,U5]);const W5=Object.keys({"content-divergence":!0,"disk-edit-reconciled":!0});function Mue(e){return W5.includes(e)}function Nue(e){throw Error(`Unexpected WriteWarning variant: ${JSON.stringify(e)}`)}const Pue=I({kind:R(`mermaid-parse-error`),fenceIndex:N().int().positive(),fenceFirstLine:M(),message:M(),line:N().int().positive().optional()}).loose(),G5=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(),K5=ro(`kind`,[H5,U5,Pue,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:G5.optional()}).loose()]),q5=F(K5).min(1),J5=I({href:M(),resolvedTo:M().nullable(),reason:L([`no-such-doc`,`no-such-file`,`unresolvable`]),localTarget:G5.optional()}).loose(),Y5=F(J5),Fue=I({timestamp:M().min(1),summary:V5.optional(),warnings:q5.optional()}).loose(),Iue=I({timestamp:M().min(1),subscriberCount:N().int().nonnegative(),systemSubscriberCount:N().int().nonnegative(),hints:F(jue).optional(),summary:V5.optional(),warnings:q5.optional(),brokenLinks:Y5}).loose(),Lue=I({timestamp:M().min(1),subscriberCount:N().int().nonnegative(),systemSubscriberCount:N().int().nonnegative(),summary:V5.optional(),warnings:q5.optional(),brokenLinks:Y5}).loose(),Rue=I({docName:M().min(1),scope:L([`last`,`session`,`count`]),undone:P()}).loose(),zue=I({docs:F(I({docName:j4,markdown:M(),position:L([`append`,`prepend`,`replace`]).optional(),extension:L(O0).optional(),summary:N4}).loose()).min(1).max(100),...M4}).loose(),Bue=I({type:g3,title:M(),detail:M().optional()}).loose(),Vue=ro(`status`,[I({status:R(`written`),docName:M().min(1),summary:V5.optional(),warnings:q5.optional(),brokenLinks:Y5}).loose(),I({status:R(`error`),docName:M().min(1),error:Bue}).loose()]),Hue=I({timestamp:M().min(1),results:F(Vue),written:N().int().nonnegative(),failed:N().int().nonnegative()}).loose(),Uue=I({docName:A4,patch:so(M(),to([Hc,Ua()])),types:so(M(),L(zc)).optional(),summary:N4,...M4}).loose(),Wue=I({timestamp:M().min(1),subscriberCount:N().int().nonnegative(),systemSubscriberCount:N().int().nonnegative(),appliedKeys:F(M()),summary:V5.optional(),warnings:q5.optional(),brokenLinks:Y5}).loose();function Gue(e){return{enabled:e.enabled??!0,plugins:{markdownlint:{...e.markdownlint,rules:e.markdownlint.rules??u5},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 Kue=Object.fromEntries(z5.map(e=>[e.id,e.sliceSchema])),que=I({effective:I({enabled:P(),plugins:I(Kue)}),configFile:M().nullable().optional(),configProblems:F(M()).optional()}),Jue=to([P(),so(M(),qa())]),Yue=I({ruleId:M().min(1).max(64).regex(/^[A-Za-z][A-Za-z0-9_-]*$/),value:to([Jue,Ua()])}),Xue=I({file:M().min(1).max(512),delete:R(!0).optional(),field:M().min(1).max(256).optional(),parentPath:F(to([M().min(1).max(256),I({items:R(!0)}).strict()])).max(8).optional(),removeField:R(!0).optional(),renameTo:M().min(1).max(256).optional(),constraint:I({type:L([`string`,`number`,`boolean`,`array`,`object`]).nullable().optional(),enum:F(to([M(),N(),P()])).nullable().optional(),itemsEnum:F(to([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`}),Zue=I({schemas:F(M()),truncated:P()}).strict(),X5=I({line:N(),character:N()}),Z5=I({start:X5,end:X5}),Q5=I({range:Z5,severity:L([`error`,`warning`,`info`,`hint`]),source:M(),code:M(),message:M(),fixes:F(I({range:Z5,newText:M()})).optional(),frontmatterScope:L(Dd).optional(),frontmatterProperty:M().optional()}),$5=F(M()).optional(),e7=I({file:M(),diagnostics:F(Q5),ran:$5,warnings:F(M()).optional()}),Que=I({files:F(e7),fileCount:N(),errorCount:N(),warningCount:N(),warnings:F(M()),ran:$5}),$ue=Q5.extend({linkTarget:M().optional(),localTarget:G5.optional()}),ede=I({files:F(I({file:M(),diagnostics:F($ue)})),fileCount:N(),errorCount:N(),warningCount:N(),warnings:F(M()),ran:$5}),t7=I({errorCount:N().int().nonnegative(),warningCount:N().int().nonnegative()}),tde=I({files:F(I({file:M(),lint:t7,links:t7})),fileCount:N().int().nonnegative(),errorCount:N().int().nonnegative(),warningCount:N().int().nonnegative(),warnings:F(M())}),nde=I({docName:A4,summary:N4,...M4}).loose(),n7=`Re-lint after fix failed: `;function rde(e){return e.startsWith(n7)}const r7=[`re-lint-threw`,`source-went-blind`];function ide(e){return typeof e==`string`&&r7.includes(e)}const i7=I({reason:L(r7),message:M().min(1)}),ade=I({file:M(),fixedCount:N(),diagnostics:F(Q5),errorCount:N(),warningCount:N(),ran:$5,warnings:F(M()).optional(),diagnosticsArePreFix:P().optional(),reLintFailure:i7.optional()});function a7(){let e=h5[_5];return`${JSON.stringify({$schema:e,type:`object`},null,2)}\n`}function ode(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 sde(e){let t=e.trim().toLowerCase().split(`/`).pop()??``;return t.endsWith(`.schema.json`)&&t.length>12?!0:ode(e)&&t.endsWith(`.json`)}var o7=class extends Error{};function s7(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function c7(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 o7(`field path items does not exist`);let e={type:`object`};r.items=e,r=e;continue}if(!s7(e))throw new o7(`field path items is not an object sub-schema`);r=e;continue}let t=u7(r),i=t[e];if(i===void 0){if(!n)throw new o7(`field path ${JSON.stringify(e)} does not exist`);let i={type:`object`};r.properties={...t,[e]:i},r=i;continue}if(!s7(i))throw new o7(`field path ${JSON.stringify(e)} is not an object property`);r=i}return r}function cde(e,t,n,r=[]){let i;i=e.trim()===``?JSON.parse(a7()):l7(e);let a=c7(i,r,!0),o=u7(a),s={...s7(o[t])?o[t]:{}};for(let e of[`type`,`enum`,`pattern`,`format`,`description`]){if(!(e in n))continue;let t=n[e];t==null?delete s[e]:s[e]=t}if(`itemsEnum`in n||`itemsType`in n){if(s.items!==void 0&&!s7(s.items))throw new o7(`field path items is not an object sub-schema`);let e=s7(s.items)?{...s.items}:{};`itemsEnum`in n&&(n.itemsEnum===null||n.itemsEnum===void 0?delete e.enum:e.enum=n.itemsEnum),`itemsType`in n&&(n.itemsType===null||n.itemsType===void 0?delete e.type:e.type=n.itemsType),Object.keys(e).length>0?s.items=e:delete s.items}if(Object.keys(s).length>0)a.properties={...o,[t]:s};else if(t in o){let{[t]:e,...n}=o;Object.keys(n).length>0?a.properties=n:delete a.properties}if(n.required!==void 0){let e=d7(a),r=e.includes(t);n.required&&!r?a.required=[...e,t]:!n.required&&r&&f7(a,e.filter(e=>e!==t))}return`${JSON.stringify(i,null,2)}\n`}function l7(e){let t;try{t=JSON.parse(e)}catch(e){throw new o7(`schema is not valid JSON (${e instanceof Error?e.message:String(e)})`)}if(!s7(t))throw new o7(`schema is not a JSON object`);return t}function u7(e){return s7(e.properties)?e.properties:{}}function d7(e){return Array.isArray(e.required)?e.required.filter(e=>typeof e==`string`):[]}function f7(e,t){t.length>0?e.required=t:delete e.required}function lde(e,t,n=[]){let r=l7(e),i=c7(r,n,!1),a=u7(i);if(t in a){let{[t]:e,...n}=a;Object.keys(n).length>0?i.properties=n:delete i.properties}return f7(i,d7(i).filter(e=>e!==t)),`${JSON.stringify(r,null,2)}\n`}function ude(e,t,n,r=[]){let i=l7(e),a=c7(i,r,!1),o=u7(a);if(!(t in o))throw new o7(`field ${JSON.stringify(t)} does not exist`);if(n in o)throw new o7(`field ${JSON.stringify(n)} already exists`);let s={};for(let[e,r]of Object.entries(o))s[e===t?n:e]=r;return a.properties=s,f7(a,d7(a).map(e=>e===t?n:e)),`${JSON.stringify(i,null,2)}\n`}function dde(){return M5.map(e=>({path:`${O5}/${k5(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 p7(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 fde(e){let t=new Set(e.filter(e=>p7(e).ext.toLowerCase()===`.md`).map(e=>e.slice(0,e.lastIndexOf(`.`)))),n=[];for(let r of e){if(p7(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 pde=[{id:`project-no-mdx`,run:fde}];function mde(e,t){let n=e.filter(e=>O0.some(t=>e.toLowerCase().endsWith(t)));return n.length===0?[]:pde.filter(e=>D5(t,e.id)).flatMap(e=>e.run(n))}function m7(e){return`source "${e.source}" ${e.phase} failed`}function hde(e){let t=e.docName===void 0?``:` on "${e.docName}"`;return`${m7(e)}${t}: ${e.message}`}function gde(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?hde(e):`${m7(e)} on ${t.size} documents (first: "${e.docName}"): ${e.message}`)}const _de=[{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}]}],vde=(()=>{let e=new Map;for(let t of _de){e.set(t.id.toUpperCase(),t.id);for(let n of t.aliases)e.set(n.toUpperCase(),t.id)}return e})();function h7(e){return vde.get(e.toUpperCase())??null}function yde(e,t){let n=h7(t);if(n===null)return;let r;for(let[t,i]of Object.entries(e))h7(t)===n&&(r={key:t,value:i});return r}function bde(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 xde(e,t){let n=z5.filter(t=>B5(e,t.id)).map(e=>e.id);return t.mode===`audit`&&t.linksValidation!==`off`&&n.push(`links`),n}function Sde(e){return e===void 0?[]:e.length===0?[`No checks ran.`]:[`Checks run: ${e.join(`, `)}.`]}async function Cde(e,t,n,r){if(!t.enabled)return[];let i=[];for(let a of z5){if(!B5(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:g7(e)})}}return i}function wde(e,t,n,r){if(!t.enabled)return e;let i=e;for(let e of z5){if(!B5(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:g7(t)})}}return i}function g7(e){let t=_7(e);return t.length>500?`${t.slice(0,500)}… (truncated)`:t}function _7(e,t=0){if(e instanceof Error)return e.cause===void 0||t>=3?e.message:`${e.message} (cause: ${_7(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 Tde=/\p{M}+/gu,Ede=/[^\p{L}\p{N}]+/gu,Dde=/^-+|-+$/g;function v7(e){return e.trim().normalize(`NFKD`).replace(Tde,``).toLowerCase().replace(Ede,`-`).replace(Dde,``)}function Ode(e,t){let n=t.get(e)??0;return t.set(e,n+1),n===0?e:`${e}-${n}`}function kde(e,t){let n=v7(e);return n?Ode(n,t):``}const Ade=new Set([`img`,`video`,`audio`,`mark`,`u`,`ins`]);new Map(Y3.flatMap(e=>e.surface===`compat`&&Ade.has(e.rendersAs)?[[e.name,e]]:[])),Cie(`<>`);const y7=[{tagName:`Mirror`,attrName:`src`,resolution:`bare-doc-name`},{tagName:`Excalidraw`,attrName:`src`,resolution:`doc-relative`}];for(let e of y7){let t=Y3.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 jde=WB(),Mde=cB(),Nde=lB();function Pde(){return Y3.filter(e=>e.surface===`canonical`&&e.name!==`*`)}function b7(){return Pde().filter(e=>{let t=x7(e);return t!==`fence`&&t!==`html`})}function x7(e){return e.name===`MermaidFence`?`fence`:e.name===`HtmlAlignBlock`?`html`:e.hasChildren?`jsx-block`:`jsx-void`}function S7(e){return{id:e.name,displayName:e.displayName??e.name,description:e.description??``,kind:x7(e)}}function Fde(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 Ide(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 Lde(e){let t=[];for(let n of e.props){let e=Fde(n);e!==void 0&&Ide(n,e)&&t.push(O3(n.name,e))}return t}function Rde(e){return HO(e.exampleBody&&e.exampleBody.trim().length>0?e.exampleBody:`Body content here.`,{extensions:[jde],mdastExtensions:[Mde]}).children}function zde(e){let t=x7(e),n;if(t===`fence`)n={type:`code`,lang:`mermaid`,meta:null,value:e.exampleBody&&e.exampleBody.trim().length>0?e.exampleBody:`graph LR
542
542
  A --> B`};else{let r=Lde(e),i=t===`jsx-block`?Rde(e):[];n={type:`mdxJsxFlowElement`,name:e.name,attributes:r,children:i}}return RI({type:`root`,children:[n]},{extensions:[Nde]}).trimEnd()}function Bde(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 Vde(e){return{...S7(e),example:zde(e),params:Bde(e)}}function C7(){return[``,"**Custom canonical components.** OK `.md` / `.mdx` supports the JSX components below. For source syntax + parameter schemas, call `palette({ components: [ids] })`. Arbitrary `<TagName>` JSX falls through as raw MDX when no canonical fits.",``,...b7().map(S7).map(e=>`- \`${e.id}\` (${e.kind}) — ${e.description}`)].join(`
543
543
  `)}function Hde(){return[C7(),``,"Fenced code blocks render naturally and don't need a fetch — including ` ```mermaid ` for diagrams (mermaid label text has sharp edges — `palette({ components: [\"Mermaid\"] })` lists them; parse failures come back as `warnings` entries on write/edit) and ` ```html preview ` for interactive HTML/JS/CSS pages (the fence info-string `preview` token renders the block as a live iframe; works for `html` / `htm` / `xml`; optional `h=` / `w=` tokens set size, e.g. ` ```html preview h=400px `). Use ` ```html preview ` whenever you want anything interactive or JS-powered (charts, demos, calculators, animations) — just author the standalone HTML page in the fence. Call `palette` for the markdown-native component forms (write `> [!NOTE]`, not `<Callout>`), copy-ready themed `html preview` starters, and the theme tokens (`var(--chart-1)`, `var(--foreground)`, …) an embed should reference so it tracks the reader's light/dark theme."].join(`
544
- `)}const Ude=I({intents:F(I({satisfierId:M().min(1),desired:L([`present`,`absent`])}).loose()),...M4,summary:N4}).loose(),Wde=I({satisfierId:M(),agentId:M(),piece:M(),scope:M(),kind:M(),pathId:M().optional(),desired:L([`present`,`absent`]),action:L(Oo),errorId:M().optional()}).loose(),Gde=I({kind:M(),satisfierIds:F(M()),agentIds:F(M()),pathId:M().optional(),blockedReason:M().optional()}).loose(),Kde=I({state:M(),strictness:F(L(Eo)).optional()}).loose(),qde=I({probes:I({env:L([`desktop`,`local-web`,`remote-web`]),satisfiers:so(M(),Kde)}).loose(),detection:I({detected:F(M()),probed:P()}).loose()}).loose(),Jde=I({actions:F(Wde),conflicts:F(Gde),withheld:F(M()),snapshot:qde}).loose(),Yde=I({entries:F(I({level:L([`info`,`warn`,`error`]),message:M().max(8192),event:M().optional(),fields:so(M(),qa()).optional(),ts:N().optional(),sourceId:M().optional(),lineNumber:N().optional()}).loose()).max(100),droppedSinceLastFlush:N().int().min(0).optional()}).loose(),Xde=I({accepted:N().int().min(0)}).loose(),Zde=I({exact:M().min(1),prefix:M(),suffix:M(),start:N().int().nonnegative(),end:N().int().nonnegative()}),Qde=F(to([M(),N().int().nonnegative()])),$de=ro(`kind`,[I({kind:R(`body`)}),I({kind:R(`property`),key:M().min(1),path:Qde.default([])})]).default({kind:`body`}),efe=L([`anchored`,`orphaned`,`resolved`]),w7=I({threadId:M().min(1),docName:M().min(1),target:$de,anchor:Zde.nullable(),state:efe,queued:P(),latestComment:M(),createdBy:M().min(1),createdAt:N(),updatedAt:N().optional()}),T7=I({docName:M(),instruction:M(),property:M().nullable(),passage:I({exact:M(),prefix:M(),suffix:M()}).nullable(),anchorLost:P(),passageRepeats:P()}).loose(),E7=I({threadId:M(),ok:R(!0)}),D7=I({threadId:M(),ok:R(!1),error:R(`not-found`)}),tfe=I({threads:F(w7)}).loose(),nfe=I({meta:w7,orphaned:P()}).loose(),rfe=I({threadId:M()}).loose(),ife=I({meta:w7,payload:T7}).loose(),afe=I({results:F(to([E7.extend({meta:w7,payload:T7}),D7]))}).loose(),ofe=I({results:F(to([E7.extend({meta:w7}),D7]))}).loose(),sfe=I({status:M().min(1),reason:M()}).loose(),cfe=I({docName:M().min(1),content:M(),lifecycle:sfe.nullable()}).loose(),lfe=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(),ufe=I({source:M().min(1),anchor:M().nullable(),title:M(),snippet:M().nullable()}).loose(),dfe=I({docName:M().min(1),backlinks:F(ufe)}).loose(),ffe=I({counts:so(M().min(1),N().int().nonnegative())}).loose(),pfe=I({counts:so(M().min(1),N().int().nonnegative())}).loose(),mfe=ro(`kind`,[I({kind:R(`doc`),docName:M().min(1),anchor:M().nullable(),title:M(),snippet:M().nullable()}).loose(),I({kind:R(`external`),url:M().min(1),title:M(),snippet:M().nullable()}).loose()]),hfe=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(),gfe=I({docName:M().min(1),forwardLinks:F(mfe),localTargets:F(hfe).optional()}).loose(),_fe=ro(`kind`,[I({id:M().min(1),kind:R(`doc`),docName:M().min(1),anchor:M().nullable(),label:M(),cluster:M().nullable(),category:M().nullable(),tags:F(M()).nullable(),managed:P().optional()}).loose(),I({id:M().min(1),kind:R(`external`),url:M().min(1),label:M()}).loose()]),vfe=I({source:M().min(1),target:M().min(1)}).loose(),yfe=I({nodes:F(_fe),links:F(vfe)}).loose(),bfe=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(),xfe=I({app:to([R(`cursor`),R(`codex`),R(`claude`),Ua()]),signals_fired:F(M())}).loose(),Sfe=I({entries:F(bfe),count:N().int().min(0),detection:xfe}).loose(),O7=[`M`,`A`,`D`,`R`,`C`,`U`,`T`,`?`,`!`,` `],k7=I({path:M().min(1),code:L(O7),origPath:M().min(1).optional(),syncScoped:P(),open:ro(`kind`,[I({kind:R(`doc`),docName:M().min(1)}),I({kind:R(`asset`),path:M().min(1)})]).optional()}).loose(),Cfe=I({branch:M().nullable(),detached:P(),upstream:M().nullable(),staged:F(k7),notStaged:F(k7),untracked:F(k7),incoming:F(k7),truncated:P(),readable:P().default(!0)}).loose(),wfe=I({writers:F(I({id:M().min(1),name:M().optional(),email:M().optional()}).loose()).optional(),summary:N4,...M4}).loose(),Tfe=I({checkpointRef:M().min(1)}).loose(),Efe=I({v:N().int().optional(),id:M().min(1),name:M().min(1),colorSeed:M().optional(),docs:F(M()),summaries:F(M()).optional()}).loose(),Dfe=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(Efe),checkpoint:qa().nullable(),parentSha:M().nullable().optional()}).loose()),total:N().int().nonnegative().optional(),truncated:P().optional(),hasMore:P().optional()}).loose(),Ofe=I({sha:M().regex(/^[0-9a-f]{40}$/i),content:M(),timestamp:M(),author:M()}).loose(),kfe=I({contentDir:M().min(1),pathSeparator:L([`/`,`\\`]),symlinkResolved:P()}).loose(),Afe=F(ro(`source`,[I({docName:M().min(1),timestamp:M().min(1),size:N().int().nonnegative(),source:R(`flat`)}).loose(),I({docName:M().min(1),timestamp:M().min(1),source:R(`timeline`),sha:M().min(1)}).loose()])).meta({description:"Flat array of rescue buffer entries; discriminated via `source`."}),A7=I({domain:M().min(1),title:M().optional(),description:M().optional(),siteName:M().optional(),faviconDataUri:M().optional()}).loose(),jfe=I({url:M()}).loose(),Mfe=ro(`ok`,[I({ok:R(!0),metadata:A7}).loose(),I({ok:R(!1),reason:M()}).loose()]),Nfe=I({orphans:F(I({docName:M().min(1),title:M()}).loose())}).loose(),Pfe=I({hubs:F(I({docName:M().min(1),title:M(),count:N().int().nonnegative()}).loose())}).loose(),Ffe=I({source:M().min(1),title:M(),snippet:M().nullable()}).loose(),Ife=I({deadLinks:F(I({target:M().min(1),sources:F(Ffe)}).loose())}).loose(),Lfe=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(),Rfe=I({projectPath:M().min(1)}).loose(),zfe=L([`not-a-git-worktree`,`init-failed`]),Bfe=ro(`ok`,[I({ok:R(!0),projectPath:M().min(1)}).loose(),I({ok:R(!1),reason:zfe,message:M().min(1)}).loose()]),Vfe=I({host:M().min(1).optional()}).loose(),Hfe=I({host:M().min(1).optional(),token:M().min(1)}).loose(),Ufe=I({host:M(),login:M()}).loose(),Wfe=I({key:M().min(1)}).loose(),Gfe=I({keyPresent:P()}).loose(),Kfe=L([`no_key`,`invalid_endpoint`,`rate_limit`,`timeout`,`http_error`,`network`,`dims_mismatch`,`malformed_response`]),qfe=ro(`ok`,[I({ok:R(!0),endpoint:M().min(1),model:M().min(1),dimensions:N().int().positive()}).loose(),I({ok:R(!1),endpoint:M().min(1),model:M().min(1),reason:Kfe,status:N().int().optional()}).loose()]),Jfe=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(),Yfe=I({authenticated:P()}).loose(),Xfe=I({channel:L([`login`,`gh-login`]).default(`login`)}).loose(),Zfe=I({}).loose(),Qfe=I({stackIndex:N().int().min(0),ts:N().int().min(0),additions:N().int().min(0),deletions:N().int().min(0)}).loose(),$fe=I({docName:M().min(1),additionsTotal:N().int().min(0),deletionsTotal:N().int().min(0),lastTs:N().int().min(0),bursts:F(Qfe)}).loose(),epe=I({displayName:M().min(1),color:M().min(1),icon:M().optional(),connectionId:M().min(1)}).loose(),tpe=I({sessionAlive:P(),agent:epe.nullable(),files:F($fe)}).loose(),npe=I({diff:M(),before:M(),after:M(),properties:h4,generatedAt:N().int().min(0)}).loose(),rpe=I({}).loose(),ipe=I({}).loose(),ape=I({}).loose(),ope=I({}).loose(),spe=I({}).loose(),cpe=I({}).loose(),lpe=I({displayName:M().min(1),icon:M(),color:M().min(1),currentDoc:M().nullable(),mode:L([`idle`,`writing`]),ts:N().int().min(0)}).loose(),upe=I({presence:so(M().min(1),lpe)}).loose(),dpe=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(),fpe=I({effects:F(I({"doc.name":M().min(1),entries:F(dpe)}).loose())}).loose(),ppe=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(),mpe=so(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 hpe=I({}).loose(),gpe=I({fromDocName:M().min(1),toDocName:M().min(1)}).loose(),_pe=I({fromPath:M().min(1),toPath:M().min(1)}).loose(),vpe=I({}).loose(),ype=I({path:M().min(1),...M4,summary:N4}).loose(),bpe=I({docName:M().min(1)}).loose(),xpe=I({path:M().min(1),...M4,summary:N4}).loose(),Spe=I({path:M().min(1)}).loose(),Cpe=I({kind:L([`file`,`folder`]),path:M().min(1),...M4,summary:N4}).loose(),wpe=I({kind:L([`file`,`folder`]),path:M().min(1),duplicatedDocNames:F(M().min(1))}).loose(),Tpe=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(),Epe=I({level:N().int().min(1).max(6),text:M(),slug:M()}).loose(),Dpe=I({docName:M().min(1),headings:F(Epe)}).loose(),Ope=I({docName:M().min(1),rewrites:N().int().nonnegative()}).loose(),kpe=I({kind:L([`file`,`folder`,`asset`]),fromPath:M().min(1),toPath:M().min(1),...M4,summary:N4}).loose(),Ape=I({renamed:F(gpe),renamedAssets:F(_pe),rewrittenDocs:F(Ope).optional(),summary:V5.optional()}).loose(),jpe=I({kind:L([`file`,`folder`,`asset`]),path:M().min(1),...M4}).loose(),Mpe=I({deletedDocNames:F(M().min(1))}).loose(),Npe=I({kind:L([`file`,`folder`,`asset`]),path:M().min(1),...M4,summary:N4}).loose(),Ppe=I({deletedDocNames:F(M().min(1))}).loose(),Fpe=I({docName:M().min(1),commitSha:M().regex(/^[0-9a-f]{40}$/i,{message:`commitSha must be a 40-char git SHA`}),summary:N4,...M4}).loose(),Ipe=I({restoredFrom:M().min(1),timestamp:M().min(1),summary:V5.optional(),warnings:q5.optional()}).loose(),Lpe=/^#[0-9a-fA-F]{6}$/,Rpe=I(Object.fromEntries(jd.map(e=>[e,M().regex(Lpe,`must be a #rrggbb hex color`)]))),j7=M().min(1).refine(Fd,{message:`must contain a non-whitespace character`}),M7=I({name:j7,author:j7.optional(),variant:L([`dark`,`light`]),palette:Rpe}).loose(),zpe=I({name:M().min(1),scheme:M7,stem:M().min(1).optional(),extension:L([`.yaml`,`.yml`]).optional()}).loose(),Bpe=I({id:M().min(1),filename:M().min(1)}).loose(),Vpe=I({id:M().min(1),scheme:M7}).loose(),Hpe=I({id:M().min(1),filename:M().min(1)}).loose(),Upe=ro(`existed`,[I({existed:R(!1)}).loose(),I({existed:R(!0),filename:M().min(1),scheme:M7}).loose()]),Wpe=I({themes:F(ro(`ok`,[I({ok:R(!0),id:M().min(1),filename:M().min(1),scheme:M7}),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(),Gpe=L([`dormant`,`idle`,`fetching`,`pulling`,`pushing`,`conflict`,`offline`,`auth-error`,`disabled`]),Kpe=I({label:M().min(1),webUrl:Sa().nullable()}).loose(),qpe=ro(`checkStatus`,[I({checkStatus:R(`allowed`)}).loose(),I({checkStatus:R(`denied`),deniedReason:L([`no-collaborator`,`private-no-access`,`repo-not-found`,`not-authenticated`]),resolvedLogin:M().optional(),declaredLogin:M().optional(),declaredSource:M().optional()}).loose(),I({checkStatus:R(`unknown`),unknownError:L([`network`,`timeout`,`rate-limit`,`token-invalid`,`malformed-response`,`ssh-unverified`]).optional()}).loose()]),N7=L([`auth-403`,`auth-401`,`auth-scope-mismatch`,`auth-no-credential`,`auth-not-found-as-identity`,`semantic-protected-branch`]),Jpe=L(Du),Ype=L([`succeeded`,`up-to-date`,`conflict`,`refused`,`error`]),Xpe=I({state:Gpe,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:Kpe.nullable().optional(),pushError:M().optional(),pushErrorCode:N7.optional(),pullError:M().optional(),pullErrorCode:N7.optional(),pausedReason:M().optional(),blockingPaths:F(M().min(1)).optional(),pushPermission:qpe.optional(),syncMode:Jpe.optional(),lastPullUtc:M().nullable().optional(),lastPullOutcome:Ype.nullable().optional()}).loose(),Zpe=I({action:L([`commit`]),paths:F(M().min(1)),commitSha:M().optional()}).loose(),Qpe=I({action:L([`commit`])}).loose(),$pe=I({op:L([`sync`,`push`,`pull`,`fetch`]).optional()}).loose(),eme=I({op:L([`sync`,`push`,`pull`,`fetch`])}).loose(),P7=I({file:M().min(1),detectedAt:M().min(1),conflictKind:L([`git`,`stale-external-write`]).optional().catch(void 0),variant:R(`working-tree`).optional().catch(void 0),oursSha:M().optional(),theirsSha:M().optional(),baseSha:M().optional()}).loose(),tme=I({conflicts:F(P7)}).loose(),nme=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`]}),rme=I({}).loose(),ime=I({file:M().min(1),base:M(),ours:M(),theirs:M(),kind:L([`both-modified`,`delete-modify`,`modify-delete`]),lifecycleStatus:M().nullable(),conflictKind:L([`git`,`stale-external-write`]).optional()}).loose(),ame=I({plan:yo(e=>e!==void 0,{message:`plan is required`})}).loose(),ome=I({plan:yo(e=>e!==void 0,{message:`plan is required`})}).loose(),sme=I({result:yo(e=>e!==void 0,{message:`result is required`})}).loose(),F7=I({packId:M().min(1)}).strict(),cme=I({installedHosts:F(M()),skills:F(I({name:M().min(1),created:P()}).strict())}).strict(),lme=I({path:M().min(1),summary:M().min(1)}).loose(),ume=I({files:N().int().nonnegative(),folders:N().int().nonnegative()}).loose(),dme=I({packs:F(I({id:M().min(1),name:M().min(1),description:M().min(1),defaultSubfolder:M().optional(),folders:F(lme),entryCounts:ume}).loose())}).loose(),fme=I({noOpen:P().optional(),out:M().min(1).optional()}).loose(),pme=I({reason:L([`unsupported-platform`,`spawn-error`]),message:M()}).loose(),mme=ro(`status`,[I({status:R(`installed`),outputPath:M(),size:N().int().nonnegative(),sha256:M(),skillVersion:M()}).loose(),I({status:R(`built`),outputPath:M(),size:N().int().nonnegative(),sha256:M(),skillVersion:M(),handoffError:pme.optional()}).loose(),I({status:R(`failed`),buildError:M()}).loose(),I({status:R(`skip-current`),skillVersion:M(),recordedAt:M().optional()}).loose()]),I7=L(T),hme=L(E);function gme(e){return e===`agents`||E.includes(e)}const _me=I({alwaysOn:N().int().nonnegative(),onTrigger:N().int().nonnegative(),onDemand:N().int().nonnegative()}).strict(),vme=[`.md`,`.mdx`,`.txt`];function L7(e){return Math.round(e/4)}function yme(e){let t=e.lastIndexOf(`.`);return t!==-1&&vme.includes(e.slice(t).toLowerCase())}function bme(e){let t=L7((e.name??``).length+(e.description??``).length),n=L7(Jc(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/`)||yme(t.relPath)&&(i+=t.content.length));return{alwaysOn:t,onTrigger:n,onDemand:L7(i)}}const xme=I({tags:F(I({name:M().min(1),count:N().int().nonnegative(),isLeaf:P()}).loose())}).loose(),Sme=I({docName:M().min(1),title:M(),matchingTags:F(M().min(1)),snippet:M().nullable()}).loose(),Cme=I({name:M().min(1),docs:F(Sme)}).loose(),wme=I({folder:qa(),frontmatter_local:so(M(),qa()).nullable()}).loose(),Tme=I({path:M(),frontmatter:so(M(),qa()).optional()}).loose(),Eme=I({applied:qa()}).loose(),R7=so(M(),qa()).meta({description:`Free-form frontmatter map embedded in template payloads.`}),Dme=I({template:I({name:M().min(1),folder:M(),scope:L([`local`,`inherited`]),path:M().min(1),frontmatter:R7,body:M()}).strict()}).strict(),Ome=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(),kme=I({folder:M(),name:M(),body:M().optional(),frontmatter:R7.optional(),...M4,summary:N4}).strict(),Ame=I({path:M().min(1),created:P(),warnings:F(M())}).strict(),jme=I({sourcePath:M().min(1),targetFolder:M(),name:M().optional(),title:M().optional(),deleteSource:P().optional(),...M4,summary:N4}).strict(),Mme=I({path:M().min(1),created:P(),warnings:F(M())}).strict(),Nme=I({existed:P(),path:M().min(1)}).strict(),Pme=I({fromFolder:M(),fromName:M(),toFolder:M(),toName:M(),body:M().optional(),frontmatter:R7.optional(),...M4,summary:N4}).strict(),Fme=I({from:M().min(1),to:M().min(1),committed:P()}).strict(),z7=L(pl),Ime=/^[a-z0-9-]+$/,Lme=/<\/?[A-Za-z][^>]*>/;function Rme(e){return Lme.test(e)}const zme=/^[A-Za-z0-9_-]+$/,B7=I({name:M(),description:M(),metadata:I({pack:M()}).strict().optional()}).strict(),Bme=I({skill:I({name:M().min(1),scope:z7,path:M().min(1),frontmatter:B7,body:M(),files:F(I({path:M().min(1),text:M().nullable()})).optional(),managed:P().optional()}).strict()}).strict(),Vme=I({source:M().min(1),publisher:M().optional(),skill:M().optional(),marketplaceUrl:M().optional(),importedAt:M().min(1),autoUpdate:P().optional()}).strict(),Hme=I({name:M().min(1),description:M().optional(),scope:z7,path:M().min(1),canonicalPath:M().min(1).optional(),filePaths:F(M()).optional(),absolutePath:M().min(1).optional(),installed:P(),hosts:F(M()),hostQualifier:M().optional().meta({description:"Set on a GLOBAL entry that shares its name with a distinct-content bundle in another host dir AND is not the by-name default: the host id whose root holds THIS bundle. Doc-name builders append it (`__skill__/global/<name>@<host>`) so each same-named bundle keeps its own tab and its own write-back path; the default bundle keeps the stable unqualified name."}),driftPaths:F(M()).optional().meta({description:`Recorded locations whose on-disk form (copy vs symlink) no longer matches what OK last wrote there — evidence another tool rewrote the path.`}),hostAliases:so(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:Vme.optional(),pack:M().optional(),modified:P().optional(),revertable:P().optional(),ignored:P().optional(),size:_me.optional()}).strict(),Ume=I({name:M().min(1),scope:z7,apply:P().optional()}).strict(),Wme=I({line:M().min(1),gitignorePath:M().min(1),applied:P(),alreadyTracked:P().optional()}).strict(),Gme=I({skills:F(Hme),truncated:P()}).strict(),Kme=I({scope:z7.default(`project`),name:M().meta({description:`Managed skill name to create or update.`}),body:M().optional(),frontmatter:B7,...M4,summary:N4}).strict(),qme=I({path:M().min(1),created:P(),warnings:F(M())}).strict(),Jme=I({scope:z7.default(`project`),name:M(),dryRun:P().optional(),setAutoUpdate:P().optional(),...M4,summary:N4}).strict(),Yme=I({name:M().min(1),updated:P(),source:M().min(1),localBody:M().optional(),upstreamBody:M().optional(),gitTracked:P().optional(),warnings:F(M())}).strict(),Xme=I({scope:z7.default(`project`),name:M(),...M4,summary:N4}).strict(),Zme=I({name:M().min(1),baselineRef:M().min(1),restoredFiles:F(M()),warnings:F(M())}).strict(),Qme=I({existed:P(),path:M().min(1)}).strict(),$me=I({scope:z7.default(`project`),fromName:M(),toName:M(),body:M().optional(),frontmatter:B7.optional(),...M4,summary:N4}).strict(),ehe=I({from:M().min(1),to:M().min(1),committed:P()}).strict(),the=I({name:M(),fromScope:z7,toScope:z7,...M4,summary:N4}).strict(),nhe=I({scope:z7,path:M().optional()}).strict(),rhe=I({scope:z7,name:M(),toName:M(),...M4,summary:N4}).strict(),ihe=I({name:M().min(1)}).strict(),ahe=I({name:M(),home:M().min(1)}).strict(),ohe=I({docName:M().min(1)}).strict(),V7=L([`reference`,`script`,`file`]),she=I({scope:z7.default(`project`),name:M(),path:M().min(1),content:M(),...M4,summary:N4}).strict(),che=I({path:M().min(1),created:P(),kind:V7,content:P()}).strict(),lhe=I({scope:z7.default(`project`),name:M(),from:M().min(1),to:M().min(1),...M4,summary:N4}).strict(),uhe=I({from:M().min(1),to:M().min(1),fromDocName:M().optional(),toDocName:M().optional()}).strict(),dhe=I({path:M().min(1),kind:V7,text:M()}).strict(),fhe=I({path:M().min(1),existed:P(),kind:V7}).strict(),H7=to([hme,R(`agents`)]),U7=M().min(1).refine(e=>!e.startsWith(`/`)&&!e.startsWith(`~`)&&!/^[A-Za-z]:/.test(e),{error:`a custom root is base-relative (e.g. ".tim/skills"), not absolute or ~-prefixed`}).refine(e=>e.split(`/`).every(e=>e!==``&&e!==`.`&&e!==`..`),{error:`a custom root may not contain "..", "." or empty path segments`}).refine(e=>e.includes(`/`),{error:`a custom root is a path (e.g. ".tim/skills") — bare editor names are host ids`}),W7=to([H7,U7]),phe=I({scope:z7.default(`project`),name:M(),targets:F(H7).optional().meta({description:'SET-EXACT install targets (editor ids, plus "agents" for the .agents hub — in-place skills only): the COMPLETE resulting host set. Omit to use project-configured editors; pass [] to uninstall everywhere. Stateless callers should prefer `add`/`remove`.'}),add:F(W7).optional().meta({description:`Locations to ADD the skill to (everything else untouched). Editor ids fan out a managed copy/symlink; a custom root path (".tim/skills") places the bundle there.`}),remove:F(W7).optional().meta({description:"Locations to REMOVE the skill from (lossless only — a hand-edited fork is refused, never deleted). The source cannot be removed; move it first with `source`."}),mode:L([`copy`,`link`]).optional().meta({description:`"link": one real folder (the source); every other location becomes a symlink to it. "copy": independent real folders, refreshed from the source until hand-edited (a hand-edit forks that copy). Converts existing locations losslessly. Omit to follow the form the skill already uses.`}),source:W7.optional().meta({description:`Move the skill's REAL folder to this location (the old source becomes a symlink to it — never a removal). Sticky across rescans.`}),linkMode:P().optional(),setSource:M().min(1).optional(),place:I({dir:M().min(1).meta({description:`Project-relative directory the bundle dir is created under (e.g. ".windsurf/skills").`}),mode:L([`copy`,`link`])}).strict().optional(),convert:I({target:W7.meta({description:`The installed location to convert — an editor id, "agents", or a recorded custom placement path.`}),mode:L([`copy`,`link`]).meta({description:`"link": replace this location with a symlink to the source. "copy": replace it with an independent real folder.`})}).strict().optional(),unplace:I({path:M().min(1).meta({description:`The recorded placement bundle path (e.g. ".windsurf/skills/my-skill").`})}).strict().optional(),...M4,summary:N4,fork:I({editor:M().min(1),action:L([`align`,`make-source`,`rename`]),toName:M().optional()}).strict().optional()}).strict().refine(e=>e.targets===void 0||e.add===void 0&&e.remove===void 0,{error:"`targets` is set-exact; `add`/`remove` are additive — use one style per call"}).refine(e=>e.fork===void 0||e.targets===void 0&&e.add===void 0&&e.remove===void 0&&e.source===void 0&&e.setSource===void 0,{error:"`fork` is its own operation — run it in a separate call"}).refine(e=>e.fork?.action!==`rename`||e.fork.toName!==void 0,{error:"`fork.rename` requires `toName`"}).refine(e=>e.source===void 0||e.add===void 0&&e.remove===void 0,{error:"a `source` move is its own operation — run it in a separate call from `add`/`remove`"}).refine(e=>[e.targets!==void 0||e.add!==void 0||e.remove!==void 0,e.place!==void 0,e.unplace!==void 0,e.convert!==void 0,e.source!==void 0||e.setSource!==void 0,e.fork!==void 0].filter(Boolean).length<=1,{error:"one operation per call — membership (`targets`/`add`/`remove`), `place`, `unplace`, `convert`, `source`, and `fork` are mutually exclusive"}),G7=[`no-targets`,`scripts-present`,`name-conflict`,`no-description`,`skill-fork-name-unpatched`,`place-path-invalid`,`place-fork-refused`],mhe=I({name:M().min(1).meta({description:`Managed skill name installed or uninstalled.`}),hosts:F(M()).meta({description:`Editor ids the skill is projected into after the operation; [] is expected after uninstall.`}),scripts:P().meta({description:`True when the skill ships executable scripts, projected but never run.`}),warnings:F(M()).meta({description:`Non-fatal install/uninstall warnings from target projection.`}),warningCodes:F(L(G7)).meta({description:"Machine-readable warning codes aligned with `warnings`."}),placedAt:M().optional(),sourceMovedTo:M().optional()}).strict(),hhe=I({scope:z7.default(`project`),name:M().meta({description:`Managed skill name to uninstall without deleting source.`})}).strict(),ghe=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(),_he=I({targets:F(I7),configured:P(),folders:F(I({scope:z7,host:M(),root:M(),state:L([`own`,`linked`,`linked-parent`,`absent`]),target:M().optional(),drift:R(!0).optional(),expected:M().optional()}).strict()).optional()}).strict(),K7=I({action:R(`link`),scope:z7,root:M().min(1).meta({description:`The folder to link (e.g. ".codex/skills").`}),target:M().min(1).meta({description:`The root it merges into (e.g. ".agents/skills"). Required.`})}),q7=I({action:R(`unlink`),scope:z7,root:M().min(1).meta({description:`The linked folder to materialize back.`}),exclude:F(M().min(1)).optional().meta({description:`Skill names to LEAVE OUT when materializing — the folder keeps every other skill it currently sees (as per-skill links) and stops auto-following the target root.`})}).strict(),J7=I({action:R(`add-root`),scope:z7,root:U7.meta({description:`New custom skills root to declare (base-relative, e.g. ".team/skills").`})}).strict(),vhe=ro(`action`,[K7.extend({preview:P().optional().meta({description:`Return the merge plan only (moves, drops, removes, conflicts, strays) — nothing is written.`})}).strict(),q7,J7]),yhe=ro(`action`,[K7.strict(),q7,J7]),bhe=I({folderAction:vhe}).strict(),xhe=I({moves:F(M()),drops:F(M()),removes:F(M()),replaces:F(M()),conflicts:F(M()),strays:F(M())}).strict(),She=I({targets:F(I7),reprojected:F(I({name:M(),hosts:F(M())}).strict()),bundleHosts:F(M()),removedFrom:F(M()),folder:I({moved:F(M()),dropped:F(M()),linked:F(M())}).strict().optional(),preview:xhe.optional()}).strict(),Che=I({scope:z7.default(`project`),name:M(),version:M().regex(/^[0-9a-f]{40}$/i),...M4,summary:N4}).strict(),whe=I({name:M().min(1),version:M(),restoredFiles:F(M()),warnings:F(M())}).strict(),The=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(),Ehe=I({kind:L([`page`,`folder`,`content`,`file`]),path:M().min(1),title:M(),score:N(),signals:so(M(),qa()),snippet:M().optional()}).loose(),Dhe=I({capable:P(),applied:P(),coverage:I({embedded:N().int().nonnegative(),total:N().int().nonnegative()})}).loose(),Ohe=I({enabled:P(),keyPresent:P(),keyNotRequired:P(),keySource:L([`project`,`file`,`env`]).nullable(),keyHint:M().nullable(),ready:P(),capable:P(),embedded:N().int().nonnegative(),total:N().int().nonnegative()}).loose(),khe=I({query:M(),intent:L([`autocomplete`,`full_text`,`omnibar`]),results:F(Ehe),elapsedMs:N().nonnegative(),semantic:Dhe.optional(),truncated:P().optional(),ready:P().optional()}).loose(),Ahe=I({version:M().min(1),recordedAt:M().min(1)}).loose(),jhe=I({currentVersion:M().min(1),targets:so(M(),Ahe.nullable())}).loose(),Mhe=I({scope:z7.default(`project`),source:M().min(1).meta({description:`External skill source: full skills.sh skill-page URL (https://www.skills.sh/<owner>/<repo>/<skill>, or https://www.skills.sh/site/<hostname>/<skill> for a website catalog), GitHub owner/repo[/subpath], git URL, or local/file path.`}),skill:M().min(1).optional().meta({description:`Specific skill name to import from a multi-skill source.`}),install:P().optional().meta({description:`Pass false to import WITHOUT the default-editor auto-projection (the caller installs explicitly afterwards). Default true.`}),marketplace:P().optional().meta({description:"The source came from a skills.sh listing the user chose (the Explore tab), so the install is reported to skills.sh and counts toward that listing. Off by default: a hand-typed repo must not be announced to skills.sh. Honors the `telemetry.skillInstallReports.enabled` setting and DO_NOT_TRACK."}),...M4,summary:N4}).strict(),Nhe=I({scope:z7.default(`project`),source:M().min(1).meta({description:`External skill source: full skills.sh skill-page URL, GitHub owner/repo[/subpath], git URL, or local/file path.`}),skills:F(M().min(1)).min(1).max(100).meta({description:`Skill names to import from the source.`}),install:P().optional().meta({description:`Pass false to import WITHOUT the default-editor auto-projection. Default true.`}),marketplace:P().optional().meta({description:"The source came from a skills.sh listing the user chose (a marketplace plugin bundle), so the import is reported to skills.sh as one batched install event and counts toward that listing. Off by default: a hand-typed repo must not be announced to skills.sh. Honors the `telemetry.skillInstallReports.enabled` setting and DO_NOT_TRACK."}),...M4,summary:N4}).strict(),Phe=I({results:F(I({requested:M(),status:L([`imported`,`already-imported`,`not-found`,`failed`]),name:M().optional(),collisionRenamedFrom:M().optional(),warnings:F(M()),error:M().optional()}).loose()),imported:N(),alreadyImported:N(),failed:N()}).loose(),Fhe=I({scope:z7.default(`project`),names:F(M().min(1)).min(1).max(100).meta({description:`Managed skill names to refresh from their recorded upstreams.`}),...M4,summary:N4}).strict(),Ihe=I({results:F(I({requested:M(),status:L([`updated`,`up-to-date`,`not-found`,`failed`]),source:M().optional(),warnings:F(M()),error:M().optional()}).loose()),updated:N(),upToDate:N(),failed:N()}).loose(),Lhe=I({source:M(),ref:M().optional(),contentHash:M(),publisher:M().optional()}).loose(),Rhe=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:Lhe,warnings:F(M()).meta({description:`Non-fatal import warnings, such as skipped unsupported files.`})}).loose(),Y7=`server-info`,X7=`branch-switched`,Z7=`disk-ack`,Q7=`config-validation-rejected`,$7=`config-ignore-nested-error`,zhe=L([`files`,`backlinks`,`graph`,`sync-status`,`session-activity`,`tags`,`comments`,`lint-config`,`local-targets`]),Bhe=I({v:R(1),ch:R(Y7),seq:N(),serverInstanceId:M().min(1),currentBranch:M().min(1).optional()}).loose(),Vhe=I({v:R(1),ch:R(X7),seq:N(),branch:M().min(1)}).loose(),Hhe=I({v:R(1),ch:zhe,seq:N()}).loose(),Uhe=I({v:R(1),ch:R(Z7),seq:N(),docName:M().min(1),sv:M().min(1)}).loose(),Whe=I({v:R(1),ch:R(Q7),seq:N(),docName:M().min(1),error:Fte}).loose(),Ghe=I({v:R(1),ch:R($7),seq:N(),path:M().min(1),error:M().min(1)}).loose(),Khe={id:`string`,kind:`enum`,path:`string`,title:`string`,name:`string`,pathSegments:`string`,content:`string`,modifiedTs:`number`},e9=new WeakMap;function qhe(e){return e===void 0||!Number.isFinite(e)?20:Math.max(1,Math.min(100,Math.trunc(e)))}function t9(e){return e.trim().toLowerCase()}const Jhe=/\.(?:md|mdx)$/;function Yhe(e,t){if(t!==`page`)return e;let n=e.replace(Jhe,``);return n.length>0?n:e}function Xhe(e){let t=e.split(`/`).filter(Boolean);return t[t.length-1]??e}function Zhe(e){let t=Xhe(e.path),n=e.title?.trim()||t,r=e.modifiedTs??0,i=e.path.split(`/`).filter(Boolean),a=new Set(i),o=[...new Set((e.aliases??[]).flatMap(e=>e.split(`/`).filter(Boolean)).filter(e=>!a.has(e)))];return{id:`${e.kind}:${e.path}`,kind:e.kind,path:e.path,title:n,name:t,pathSegments:[...i,...o].join(` `),content:e.content??``,modifiedTs:Number.isFinite(r)?r:0}}const n9=/[^\P{L}a-zàèéìòóù]|[^\P{Nd}0-9]|\p{Nl}/iu,r9=(()=>{let e=globalThis.Intl.Segmenter;return e?new e(`en`,{granularity:`word`}):null})();function Qhe(){let e=yY({language:`english`}),t=e.tokenize.bind(e);return e.tokenize=(e,n,r,i)=>{let a=t(e,n,r,i);if(!r9||typeof e!=`string`||!n9.test(e))return a;let o=new Set(a);for(let{segment:t,isWordLike:n}of r9.segment(e)){if(!n||!n9.test(t))continue;let e=t.toLowerCase();o.has(e)||(o.add(e),a.push(e))}return a},e}function i9(e){let t=NY({schema:Khe,components:{tokenizer:Qhe()}});return e.length>0&&WY(t,e),t}function a9(e){let t={documents:e};return e9.set(t,i9(e)),t}function $he(e){let t=e9.get(e);if(t)return t;let n=i9(e.documents);return e9.set(e,n),n}const o9=new WeakSet;function ege(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 tge(e,t){let n=e=>({corpus:a9(t),inserted:0,updated:0,removed:0,rebuilt:!0,rebuildReason:e}),r=e9.get(e);if(!r)return n(`no-index`);if(o9.has(e))return n(`stale-base`);let i=new Map(t.map(e=>[e.id,e]));if(i.size!==t.length)return n(`duplicate-id`);let a=[],o=[],s=0;for(let t of e.documents){let e=i.get(t.id);e?ege(t,e)||(a.push(t.id),o.push(e),s+=1):a.push(t.id)}let c=new Set(e.documents.map(e=>e.id));for(let e of t)c.has(e.id)||o.push(e);if(a.length+o.length>t.length)return n(`bulk-change`);o9.add(e);try{if(a.length>0&&XY(r,a),o.length>0&&WY(r,o),FY(r)!==t.length)throw Error(`Search index count ${FY(r)} diverged from document count ${t.length} after incremental update`)}catch{return n(`mutation-failed`)}let l={documents:t};return e9.set(l,r),{corpus:l,inserted:o.length-s,updated:s,removed:a.length-s,rebuilt:!1}}function nge(e){return e===`autocomplete`?[`page`]:e===`full_text`?[`page`,`content`,`file`]:[`page`,`folder`,`file`]}function s9(e,t){return t.has(e.kind)?!0:e.kind===`page`&&t.has(`content`)}function rge(e,t){let n=t9(t);if(!n)return 0;let r=Yhe(n,e.kind),i=t9(e.title),a=t9(e.name),o=t9(e.path),s=o.split(`/`);return i===r||a===r?700:o===r?650:i.startsWith(r)||a.startsWith(r)?600:s.some(e=>e.startsWith(r))?550:i.includes(r)||a.includes(r)?500:o.includes(r)?450:-1}function c9(e,t){let n=rge(e,t);return n<=0?n:O4(e.path)?n*.5:n}function ige(e){return e===`file`?-60:0}function age(e,t,n,r,i){let a=i>0?t/i:0,o=n/50,s=r===`file`?-.001:0,c=1*a+1*o+s;return e*1e3+c}function l9(e,t,n,r){return e+t*20+n+ige(r)}function u9(e,t,n,r,i,a){return e===`relevance`?l9(t,n,r,i):age(t,n,r,i,a)}function oge(e,t){return t||(e===`full_text`?`relevance`:`navigation`)}function d9(e,t){let n=0;for(let r of e){let e=t.get(r.id)??0;e>n&&(n=e)}return n}function sge(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 cge(e){return e===`full_text`?[`title`,`name`,`path`,`pathSegments`,`content`]:[`title`,`name`,`path`,`pathSegments`]}function lge(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 uge=/[฀-๿ក-៿ -〿぀-ゟ゠-ヿ㐀-䶿一-鿿\uf900-﫿＀-￯\u1100-\u11ff\u3130-\u318f\ua960-\ua97f\uac00-\ud7ff]/;function dge(e,t){let n=t9(t);return n.length<4||uge.test(n)?0:+(e===`full_text`)}function fge(e){let{lexical:t,fullText:n}=e.signals;return t>=500?`lexical`:t===450&&n<=0?`pathOnly`:`body`}function pge(e){let t=[],n=[],r=[];for(let i of e){let e=fge(i);e===`lexical`?t.length<100&&t.push(i):e===`body`?n.length<6&&n.push(i):r.length<4&&r.push(i)}return[...t,...n,...r]}function f9(e,t,n){if(t===`relevance`)return e.slice(0,n);let r=pge(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 mge(e,t,n={}){let r=n.intent??`omnibar`,i=oge(r,n.ranking),a=qhe(n.limit),o=new Set(n.scopes??nge(r)),s=e.documents.filter(e=>s9(e,o)),c=t9(t);if(!c)return s.slice().sort((e,t)=>e.path.localeCompare(t.path)).slice(0,a).map(e=>({document:e,score:0,signals:{lexical:0,fullText:0,recency:0}}));let l=EX($he(e),{term:c,properties:cge(r),boost:lge(r),tolerance:dge(r,c),limit:Math.max(a*4,40)}),u=new Map(l.hits.filter(e=>s9(e.document,o)).map(e=>[e.document.id,e.score])),d=sge(s),f=new Map;for(let e of s)c9(e,c)>=0&&f.set(e.id,e);for(let e of l.hits)s9(e.document,o)&&f.set(e.document.id,e.document);if(!n.semantic){let e=d9(f.values(),u);return f9([...f.values()].map(t=>{let n=Math.max(0,c9(t,c)),r=u.get(t.id)??0,a=d.get(t.id)??0;return{document:t,score:u9(i,n,r,a,t.kind,e),signals:{lexical:n,fullText:r,recency:a}}}).sort((e,t)=>e.score===t.score?e.document.path.localeCompare(t.document.path):t.score-e.score),i,a)}return f9(hge({scopedDocuments:s,candidates:f,fullTextScores:u,recency:d,normalizedQuery:c,ranking:i,semantic:n.semantic}),i,a)}function p9(e){let t=new Map;return e.forEach((e,n)=>{t.set(e,n+1)}),t}function hge(e){let{scopedDocuments:t,candidates:n,fullTextScores:r,recency:i,normalizedQuery:a,ranking:o,semantic:s}=e,c=s.rrfK??60,l=s.candidateLimit??64,u=s.similarityFloor??0,d=s.scores,f=new Map(t.map(e=>[e.id,e])),p=[...d.entries()].filter(([e,t])=>t>=u&&f.has(e)).sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0])).slice(0,l);for(let[e]of p)if(!n.has(e)){let t=f.get(e);t&&n.set(e,t)}let m=d9(n.values(),r),h=[...n.values()].map(e=>{let t=Math.max(0,c9(e,a)),n=r.get(e.id)??0,s=i.get(e.id)??0,c=d.get(e.id),l=c!==void 0&&c>=u;return{document:e,score:t>0?u9(o,t,n,s,e.kind,m):l9(t,n,s,e.kind),signals:l?{lexical:t,fullText:n,recency:s,vector:c}:{lexical:t,fullText:n,recency:s},lexical:t,fullText:n,recency:s,cosine:c}}),g=p9(h.filter(e=>e.fullText>0).sort((e,t)=>t.fullText-e.fullText||e.document.path.localeCompare(t.document.path)).map(e=>e.document.id)),_=p9(h.filter(e=>e.cosine!==void 0&&e.cosine>=u).sort((e,t)=>t.cosine-e.cosine||e.document.path.localeCompare(t.document.path)).map(e=>e.document.id)),v=e=>{let t=0,n=g.get(e);n!==void 0&&(t+=1/(c+n));let r=_.get(e);return r!==void 0&&(t+=1/(c+r)),t};return h.sort((e,t)=>{let n=+(e.lexical>0),r=+(t.lexical>0);if(n!==r)return r-n;if(n===1)return e.score===t.score?e.document.path.localeCompare(t.document.path):t.score-e.score;let i=v(e.document.id),a=v(t.document.id);return i===a?e.recency===t.recency?e.document.path.localeCompare(t.document.path):t.recency-e.recency:a-i}).map(({document:e,score:t,signals:n})=>({document:e,score:t,signals:n}))}function gge(e){return e.created.length>0||e.packSkills?.some(e=>e.pending)===!0||e.requiredPlugins?.some(e=>e.pending)===!0}const _ge=/^[A-Za-z0-9._-]+$/,vge=/^(?:\d{1,3}\.){3}\d{1,3}$/;var m9=class extends Error{constructor(e){super(e),this.name=`InvalidShareUrlError`}};function yge(e,t=0){if(g9(t,!0),t===0)return Sge(e);if(e.length>2985)throw new m9(`Share URL exceeds the v2 URL size limit`);xge(h9(e),t);let n=new TextEncoder().encode(e);if(n.length>2985)throw new m9(`Share URL exceeds the v2 URL size limit`);let r=new Uint8Array(3+n.length);if(r[0]=2,r[1]=t>>>8,r[2]=t&255,r.set(n,3),r.length>2988)throw new m9(`Share payload exceeds the v2 size limit`);let i=S9(r);if(i.length>3984)throw new m9(`Share token exceeds the v2 size limit`);return i}function h9(e){if(!e.startsWith(`https://`))throw new m9(`Share URL must use canonical HTTPS spelling`);if(e.includes(`?`)||e.includes(`#`))throw new m9(`Share URL cannot contain a query or fragment`);let t=e.slice(8),n=t.indexOf(`/`);if(n<=0)throw new m9(`Share URL is missing its repository path`);let r=t.slice(0,n);_9(r);let i=t.slice(n+1).split(`/`);if(i.length<4||i.some(e=>e.length===0))throw new m9(`Share URL has an invalid path shape`);let[a,o,s,c,...l]=i;if(s!==`blob`&&s!==`tree`)throw new m9(`Share URL has an unsupported repository path shape`);let u=v9(a,`owner`),d=v9(o,`repository`),f=Cge(c),p=l.map(e=>wge(e,`target`)),m=s===`blob`?`doc`:`folder`;if(m===`doc`&&p.length===0)throw new m9(`Document share URL is missing its target path`);let h={host:r,owner:u,repo:d,branch:f,kind:m,targetSegments:p};if(bge(h)!==e)throw new m9(`Share URL is not canonically serialized`);return h}function bge(e){if(_9(e.host),x9(e.owner,`owner`),x9(e.repo,`repository`),!J4(e.branch))throw new m9(`Share URL branch is invalid`);if(e.kind!==`doc`&&e.kind!==`folder`)throw new m9(`Share URL target kind is invalid`);if(e.kind===`doc`&&e.targetSegments.length===0)throw new m9(`Document share URL is missing its target path`);for(let t of e.targetSegments)b9(t,`target`);let t=e.kind===`doc`?`blob`:`tree`,n=[encodeURIComponent(e.owner),encodeURIComponent(e.repo),t,encodeURIComponent(e.branch),...e.targetSegments.map(e=>encodeURIComponent(e))];return`https://${e.host}/${n.join(`/`)}`}function xge(e,t){if(g9(t,!1),t>e.targetSegments.length)throw new m9(`Content root depth exceeds the repository target path`);let n=e.targetSegments.slice(t).join(`/`);if(e.kind===`doc`){if(n.length===0)throw new m9(`Document share target cannot be the content root`);return{kind:`doc`,docPath:n}}return{kind:`folder`,folderPath:n}}function Sge(e){let t=new TextEncoder().encode(e),n=new Uint8Array(1+t.length);return n[0]=1,n.set(t,1),S9(n)}function g9(e,t){if(!Number.isInteger(e)||e<+!t||e>65535)throw new m9(`Content root depth is invalid`)}function _9(e){if(e.length===0||e.length>253||e.endsWith(`.`)||e!==e.toLowerCase()||vge.test(e))throw new m9(`Share URL host is not canonical`);if(e.split(`.`).some(e=>e.length===0||e.length>63||!/^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/.test(e)))throw new m9(`Share URL host is not a DNS name`);if(P0(e)!==e)throw new m9(`Share URL host is not a canonical GitHub host`)}function Cge(e){let t=y9(e,`branch`);if(!J4(t))throw new m9(`Share URL branch is invalid`);return t}function wge(e,t){let n=y9(e,t);return b9(n,t),n}function v9(e,t){let n=y9(e,t);return x9(n,t),n}function y9(e,t){let n;try{n=decodeURIComponent(e)}catch{throw new m9(`Share URL ${t} has malformed percent encoding`)}if(encodeURIComponent(n)!==e)throw new m9(`Share URL ${t} is not canonically encoded`);return n}function b9(e,t){if(e.length===0||e===`.`||e===`..`||e.toLowerCase()===`.git`||e.includes(`/`)||e.includes(`\\`)||Tge(e))throw new m9(`Share URL ${t} component is invalid`)}function x9(e,t){if(b9(e,t),!_ge.test(e)||e.startsWith(`-`))throw new m9(`Share URL ${t} component is invalid`)}function Tge(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n<=31||n===127)return!0}return!1}function S9(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}const C9=Symbol.for(`@inkeep/open-knowledge/skill-state-field-registry`),w9=globalThis;w9[C9]===void 0&&(w9[C9]=ar());const T9=w9[C9],Ege=[`.ok`,`skill-state.yml`],Dge=[`claude-cowork`,`cli-hosts`],Oge=[`server-build-and-open`,`electron-build-and-open`,`cli-npx-skills-add`,`desktop-direct`,`cli-start`],E9=/^\d+\.\d+\.\d+(?:[-+][\w.-]+)?$/,D9=$a({version:M().regex(E9,`version must match /^\\d+\\.\\d+\\.\\d+(?:[-+][\\w.-]+)?$/`).register(T9,{description:`Recorded skill version for this target.`}),recordedAt:Gi().register(T9,{description:`ISO 8601 timestamp of the most recent successful write. Updated on every write, including reinstalls of the same version.`}),surface:L(Oge).register(T9,{description:`Install-source surface that recorded this entry.`}).optional()}),kge=$a({enabled:P().register(T9,{description:`Whether this user-global skill bundle is opted in.`}),decidedAt:Gi().register(T9,{description:`ISO 8601 timestamp of the opt-in / opt-out decision.`})}),Age=$a({schema:R(1).register(T9,{description:`Schema major version. Bumped only on breaking shape changes.`}),targets:$a({"claude-cowork":D9.optional(),"cli-hosts":D9.optional()}).register(T9,{description:`Per-target install-state entries. Absent target = no recorded install.`}).default({}),bundles:so(M(),kge).register(T9,{description:`Per-bundle opt-in decisions keyed by install name. Absent key = no recorded decision.`}).optional(),installsReported:F(M()).register(T9,{description:"Skill installs already reported to skills.sh from this machine, as `<owner/repo>#<skill>`. Append-only; presence suppresses a re-report."}).optional()});function jge(e,t){return e??t.installedOnDisk}function Mge(){return{schema:1,targets:{}}}const O9=`template`;function k9(e){if(e.trim()===``)return{};let t;try{t=(0,Rc.parse)(e)}catch{return{}}return typeof t!=`object`||!t||Array.isArray(t)?{}:t}function A9(e,t){return e.trim()===``?t:`---\n${e}\n---\n${t}`}function Nge(e){let{frontmatter:t,body:n}=Jc(e);return t===``?{docFrontmatterText:``,markdown:e}:{docFrontmatterText:Xc(t),markdown:n}}function Pge(e){let t=e.split(`
544
+ `)}const Ude=I({intents:F(I({satisfierId:M().min(1),desired:L([`present`,`absent`])}).loose()),...M4,summary:N4}).loose(),Wde=I({satisfierId:M(),agentId:M(),piece:M(),scope:M(),kind:M(),pathId:M().optional(),desired:L([`present`,`absent`]),action:L(Oo),errorId:M().optional()}).loose(),Gde=I({kind:M(),satisfierIds:F(M()),agentIds:F(M()),pathId:M().optional(),blockedReason:M().optional()}).loose(),Kde=I({state:M(),strictness:F(L(Eo)).optional()}).loose(),qde=I({probes:I({env:L([`desktop`,`local-web`,`remote-web`]),satisfiers:so(M(),Kde)}).loose(),detection:I({detected:F(M()),probed:P()}).loose()}).loose(),Jde=I({actions:F(Wde),conflicts:F(Gde),withheld:F(M()),snapshot:qde}).loose(),Yde=I({entries:F(I({level:L([`info`,`warn`,`error`]),message:M().max(8192),event:M().optional(),fields:so(M(),qa()).optional(),ts:N().optional(),sourceId:M().optional(),lineNumber:N().optional()}).loose()).max(100),droppedSinceLastFlush:N().int().min(0).optional()}).loose(),Xde=I({accepted:N().int().min(0)}).loose(),Zde=I({exact:M().min(1),prefix:M(),suffix:M(),start:N().int().nonnegative(),end:N().int().nonnegative()}),Qde=F(to([M(),N().int().nonnegative()])),$de=ro(`kind`,[I({kind:R(`body`)}),I({kind:R(`property`),key:M().min(1),path:Qde.default([])})]).default({kind:`body`}),efe=L([`anchored`,`orphaned`,`resolved`]),w7=I({threadId:M().min(1),docName:M().min(1),target:$de,anchor:Zde.nullable(),state:efe,queued:P(),latestComment:M(),createdBy:M().min(1),createdAt:N(),updatedAt:N().optional()}),T7=I({docName:M(),instruction:M(),property:M().nullable(),passage:I({exact:M(),prefix:M(),suffix:M()}).nullable(),anchorLost:P(),passageRepeats:P()}).loose(),E7=I({threadId:M(),ok:R(!0)}),D7=I({threadId:M(),ok:R(!1),error:R(`not-found`)}),tfe=I({threads:F(w7)}).loose(),nfe=I({meta:w7,orphaned:P()}).loose(),rfe=I({threadId:M()}).loose(),ife=I({meta:w7,payload:T7}).loose(),afe=I({results:F(to([E7.extend({meta:w7,payload:T7}),D7]))}).loose(),ofe=I({results:F(to([E7.extend({meta:w7}),D7]))}).loose(),sfe=I({status:M().min(1),reason:M()}).loose(),cfe=I({docName:M().min(1),content:M(),lifecycle:sfe.nullable()}).loose(),lfe=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(),ufe=I({source:M().min(1),anchor:M().nullable(),title:M(),snippet:M().nullable()}).loose(),dfe=I({docName:M().min(1),backlinks:F(ufe)}).loose(),ffe=I({counts:so(M().min(1),N().int().nonnegative())}).loose(),pfe=I({counts:so(M().min(1),N().int().nonnegative())}).loose(),mfe=ro(`kind`,[I({kind:R(`doc`),docName:M().min(1),anchor:M().nullable(),title:M(),snippet:M().nullable()}).loose(),I({kind:R(`external`),url:M().min(1),title:M(),snippet:M().nullable()}).loose()]),hfe=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(),gfe=I({docName:M().min(1),forwardLinks:F(mfe),localTargets:F(hfe).optional()}).loose(),_fe=ro(`kind`,[I({id:M().min(1),kind:R(`doc`),docName:M().min(1),anchor:M().nullable(),label:M(),cluster:M().nullable(),category:M().nullable(),tags:F(M()).nullable(),managed:P().optional()}).loose(),I({id:M().min(1),kind:R(`external`),url:M().min(1),label:M()}).loose()]),vfe=I({source:M().min(1),target:M().min(1)}).loose(),yfe=I({nodes:F(_fe),links:F(vfe)}).loose(),bfe=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(),xfe=I({app:to([R(`cursor`),R(`codex`),R(`claude`),Ua()]),signals_fired:F(M())}).loose(),Sfe=I({entries:F(bfe),count:N().int().min(0),detection:xfe}).loose(),O7=[`M`,`A`,`D`,`R`,`C`,`U`,`T`,`?`,`!`,` `],k7=I({path:M().min(1),code:L(O7),origPath:M().min(1).optional(),syncScoped:P(),open:ro(`kind`,[I({kind:R(`doc`),docName:M().min(1)}),I({kind:R(`asset`),path:M().min(1)})]).optional()}).loose(),Cfe=I({branch:M().nullable(),detached:P(),upstream:M().nullable(),staged:F(k7),notStaged:F(k7),untracked:F(k7),incoming:F(k7),truncated:P(),readable:P().default(!0)}).loose(),wfe=I({writers:F(I({id:M().min(1),name:M().optional(),email:M().optional()}).loose()).optional(),summary:N4,...M4}).loose(),Tfe=I({checkpointRef:M().min(1)}).loose(),Efe=I({v:N().int().optional(),id:M().min(1),name:M().min(1),colorSeed:M().optional(),docs:F(M()),summaries:F(M()).optional()}).loose(),Dfe=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(Efe),checkpoint:qa().nullable(),parentSha:M().nullable().optional()}).loose()),total:N().int().nonnegative().optional(),truncated:P().optional(),hasMore:P().optional()}).loose(),Ofe=I({sha:M().regex(/^[0-9a-f]{40}$/i),content:M(),timestamp:M(),author:M()}).loose(),kfe=I({contentDir:M().min(1),pathSeparator:L([`/`,`\\`]),symlinkResolved:P()}).loose(),Afe=F(ro(`source`,[I({docName:M().min(1),timestamp:M().min(1),size:N().int().nonnegative(),source:R(`flat`)}).loose(),I({docName:M().min(1),timestamp:M().min(1),source:R(`timeline`),sha:M().min(1)}).loose()])).meta({description:"Flat array of rescue buffer entries; discriminated via `source`."}),A7=I({domain:M().min(1),title:M().optional(),description:M().optional(),siteName:M().optional(),faviconDataUri:M().optional()}).loose(),jfe=I({url:M()}).loose(),Mfe=ro(`ok`,[I({ok:R(!0),metadata:A7}).loose(),I({ok:R(!1),reason:M()}).loose()]),Nfe=I({orphans:F(I({docName:M().min(1),title:M()}).loose())}).loose(),Pfe=I({hubs:F(I({docName:M().min(1),title:M(),count:N().int().nonnegative()}).loose())}).loose(),Ffe=I({source:M().min(1),title:M(),snippet:M().nullable()}).loose(),Ife=I({deadLinks:F(I({target:M().min(1),sources:F(Ffe)}).loose())}).loose(),Lfe=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(),Rfe=I({projectPath:M().min(1)}).loose(),zfe=L([`not-a-git-worktree`,`init-failed`]),Bfe=ro(`ok`,[I({ok:R(!0),projectPath:M().min(1)}).loose(),I({ok:R(!1),reason:zfe,message:M().min(1)}).loose()]),Vfe=I({host:M().min(1).optional()}).loose(),Hfe=I({host:M().min(1).optional(),token:M().min(1)}).loose(),Ufe=I({host:M(),login:M()}).loose(),Wfe=I({key:M().min(1)}).loose(),Gfe=I({keyPresent:P()}).loose(),Kfe=L([`no_key`,`invalid_endpoint`,`rate_limit`,`timeout`,`http_error`,`network`,`dims_mismatch`,`malformed_response`]),qfe=ro(`ok`,[I({ok:R(!0),endpoint:M().min(1),model:M().min(1),dimensions:N().int().positive()}).loose(),I({ok:R(!1),endpoint:M().min(1),model:M().min(1),reason:Kfe,status:N().int().optional()}).loose()]),Jfe=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(),Yfe=I({authenticated:P()}).loose(),Xfe=I({channel:L([`login`,`gh-login`]).default(`login`)}).loose(),Zfe=I({}).loose(),Qfe=I({stackIndex:N().int().min(0),ts:N().int().min(0),additions:N().int().min(0),deletions:N().int().min(0)}).loose(),$fe=I({docName:M().min(1),additionsTotal:N().int().min(0),deletionsTotal:N().int().min(0),lastTs:N().int().min(0),bursts:F(Qfe)}).loose(),epe=I({displayName:M().min(1),color:M().min(1),icon:M().optional(),connectionId:M().min(1)}).loose(),tpe=I({sessionAlive:P(),agent:epe.nullable(),files:F($fe)}).loose(),npe=I({diff:M(),before:M(),after:M(),properties:h4,generatedAt:N().int().min(0)}).loose(),rpe=I({}).loose(),ipe=I({}).loose(),ape=I({}).loose(),ope=I({}).loose(),spe=I({}).loose(),cpe=I({}).loose(),lpe=I({displayName:M().min(1),icon:M(),color:M().min(1),currentDoc:M().nullable(),mode:L([`idle`,`writing`]),ts:N().int().min(0)}).loose(),upe=I({presence:so(M().min(1),lpe)}).loose(),dpe=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(),fpe=I({effects:F(I({"doc.name":M().min(1),entries:F(dpe)}).loose())}).loose(),ppe=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(),mpe=so(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 hpe=I({}).loose(),gpe=I({fromDocName:M().min(1),toDocName:M().min(1)}).loose(),_pe=I({fromPath:M().min(1),toPath:M().min(1)}).loose(),vpe=I({}).loose(),ype=I({path:M().min(1),...M4,summary:N4}).loose(),bpe=I({docName:M().min(1)}).loose(),xpe=I({path:M().min(1),...M4,summary:N4}).loose(),Spe=I({path:M().min(1)}).loose(),Cpe=I({kind:L([`file`,`folder`]),path:M().min(1),...M4,summary:N4}).loose(),wpe=I({kind:L([`file`,`folder`]),path:M().min(1),duplicatedDocNames:F(M().min(1))}).loose(),Tpe=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(),Epe=I({level:N().int().min(1).max(6),text:M(),slug:M()}).loose(),Dpe=I({docName:M().min(1),headings:F(Epe)}).loose(),Ope=I({docName:M().min(1),rewrites:N().int().nonnegative()}).loose(),kpe=I({kind:L([`file`,`folder`,`asset`]),fromPath:M().min(1),toPath:M().min(1),...M4,summary:N4}).loose(),Ape=I({renamed:F(gpe),renamedAssets:F(_pe),rewrittenDocs:F(Ope).optional(),summary:V5.optional()}).loose(),jpe=I({kind:L([`file`,`folder`,`asset`]),path:M().min(1),...M4}).loose(),Mpe=I({deletedDocNames:F(M().min(1))}).loose(),Npe=I({kind:L([`file`,`folder`,`asset`]),path:M().min(1),...M4,summary:N4}).loose(),Ppe=I({deletedDocNames:F(M().min(1))}).loose(),Fpe=I({docName:M().min(1),commitSha:M().regex(/^[0-9a-f]{40}$/i,{message:`commitSha must be a 40-char git SHA`}),summary:N4,...M4}).loose(),Ipe=I({restoredFrom:M().min(1),timestamp:M().min(1),summary:V5.optional(),warnings:q5.optional()}).loose(),Lpe=/^#[0-9a-fA-F]{6}$/,Rpe=I(Object.fromEntries(jd.map(e=>[e,M().regex(Lpe,`must be a #rrggbb hex color`)]))),j7=M().min(1).refine(Fd,{message:`must contain a non-whitespace character`}),M7=I({name:j7,author:j7.optional(),variant:L([`dark`,`light`]),palette:Rpe}).loose(),zpe=I({name:M().min(1),scheme:M7,stem:M().min(1).optional(),extension:L([`.yaml`,`.yml`]).optional()}).loose(),Bpe=I({id:M().min(1),filename:M().min(1)}).loose(),Vpe=I({id:M().min(1),scheme:M7}).loose(),Hpe=I({id:M().min(1),filename:M().min(1)}).loose(),Upe=ro(`existed`,[I({existed:R(!1)}).loose(),I({existed:R(!0),filename:M().min(1),scheme:M7}).loose()]),Wpe=I({themes:F(ro(`ok`,[I({ok:R(!0),id:M().min(1),filename:M().min(1),scheme:M7}),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(),Gpe=L([`dormant`,`idle`,`fetching`,`pulling`,`pushing`,`conflict`,`offline`,`auth-error`,`disabled`]),Kpe=I({label:M().min(1),webUrl:Sa().nullable()}).loose(),qpe=ro(`checkStatus`,[I({checkStatus:R(`allowed`)}).loose(),I({checkStatus:R(`denied`),deniedReason:L([`no-collaborator`,`private-no-access`,`repo-not-found`,`not-authenticated`]),resolvedLogin:M().optional(),declaredLogin:M().optional(),declaredSource:M().optional()}).loose(),I({checkStatus:R(`unknown`),unknownError:L([`network`,`timeout`,`rate-limit`,`token-invalid`,`malformed-response`,`ssh-unverified`]).optional()}).loose()]),N7=L([`auth-403`,`auth-401`,`auth-scope-mismatch`,`auth-no-credential`,`auth-not-found-as-identity`,`semantic-protected-branch`]),Jpe=L(Du),Ype=L([`succeeded`,`up-to-date`,`conflict`,`refused`,`error`]),Xpe=I({state:Gpe,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:Kpe.nullable().optional(),pushError:M().optional(),pushErrorCode:N7.optional(),pullError:M().optional(),pullErrorCode:N7.optional(),pausedReason:M().optional(),blockingPaths:F(M().min(1)).optional(),pushPermission:qpe.optional(),syncMode:Jpe.optional(),lastPullUtc:M().nullable().optional(),lastPullOutcome:Ype.nullable().optional()}).loose(),Zpe=I({action:L([`commit`]),paths:F(M().min(1)),commitSha:M().optional()}).loose(),Qpe=I({action:L([`commit`])}).loose(),$pe=I({op:L([`sync`,`push`,`pull`,`fetch`]).optional()}).loose(),eme=I({op:L([`sync`,`push`,`pull`,`fetch`])}).loose(),P7=I({file:M().min(1),detectedAt:M().min(1),conflictKind:L([`git`,`stale-external-write`]).optional().catch(void 0),variant:R(`working-tree`).optional().catch(void 0),oursSha:M().optional(),theirsSha:M().optional(),baseSha:M().optional()}).loose(),tme=I({conflicts:F(P7)}).loose(),nme=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`]}),rme=I({}).loose(),ime=I({file:M().min(1),base:M(),ours:M(),theirs:M(),kind:L([`both-modified`,`delete-modify`,`modify-delete`]),lifecycleStatus:M().nullable(),conflictKind:L([`git`,`stale-external-write`]).optional()}).loose(),ame=I({plan:yo(e=>e!==void 0,{message:`plan is required`})}).loose(),ome=I({plan:yo(e=>e!==void 0,{message:`plan is required`})}).loose(),sme=I({result:yo(e=>e!==void 0,{message:`result is required`})}).loose(),F7=I({packId:M().min(1)}).strict(),cme=I({installedHosts:F(M()),skills:F(I({name:M().min(1),created:P()}).strict())}).strict(),lme=I({path:M().min(1),summary:M().min(1)}).loose(),ume=I({files:N().int().nonnegative(),folders:N().int().nonnegative()}).loose(),dme=I({packs:F(I({id:M().min(1),name:M().min(1),description:M().min(1),defaultSubfolder:M().optional(),folders:F(lme),entryCounts:ume}).loose())}).loose(),fme=I({noOpen:P().optional(),out:M().min(1).optional()}).loose(),pme=I({reason:L([`unsupported-platform`,`spawn-error`]),message:M()}).loose(),mme=ro(`status`,[I({status:R(`installed`),outputPath:M(),size:N().int().nonnegative(),sha256:M(),skillVersion:M()}).loose(),I({status:R(`built`),outputPath:M(),size:N().int().nonnegative(),sha256:M(),skillVersion:M(),handoffError:pme.optional()}).loose(),I({status:R(`failed`),buildError:M()}).loose(),I({status:R(`skip-current`),skillVersion:M(),recordedAt:M().optional()}).loose()]),I7=L(T),hme=L(E);function gme(e){return e===`agents`||E.includes(e)}const _me=I({alwaysOn:N().int().nonnegative(),onTrigger:N().int().nonnegative(),onDemand:N().int().nonnegative()}).strict(),vme=[`.md`,`.mdx`,`.txt`];function L7(e){return Math.round(e/4)}function yme(e){let t=e.lastIndexOf(`.`);return t!==-1&&vme.includes(e.slice(t).toLowerCase())}function bme(e){let t=L7((e.name??``).length+(e.description??``).length),n=L7(Jc(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/`)||yme(t.relPath)&&(i+=t.content.length));return{alwaysOn:t,onTrigger:n,onDemand:L7(i)}}const xme=I({tags:F(I({name:M().min(1),count:N().int().nonnegative(),isLeaf:P()}).loose())}).loose(),Sme=I({docName:M().min(1),title:M(),matchingTags:F(M().min(1)),snippet:M().nullable()}).loose(),Cme=I({name:M().min(1),docs:F(Sme)}).loose(),wme=I({folder:qa(),frontmatter_local:so(M(),qa()).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(),Tme=I({path:M(),frontmatter:so(M(),qa()).optional()}).loose(),Eme=I({applied:qa()}).loose(),R7=so(M(),qa()).meta({description:`Free-form frontmatter map embedded in template payloads.`}),Dme=I({template:I({name:M().min(1),folder:M(),scope:L([`local`,`inherited`]),path:M().min(1),frontmatter:R7,body:M()}).strict()}).strict(),Ome=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(),kme=I({folder:M(),name:M(),body:M().optional(),frontmatter:R7.optional(),...M4,summary:N4}).strict(),Ame=I({path:M().min(1),created:P(),warnings:F(M())}).strict(),jme=I({sourcePath:M().min(1),targetFolder:M(),name:M().optional(),title:M().optional(),deleteSource:P().optional(),...M4,summary:N4}).strict(),Mme=I({path:M().min(1),created:P(),warnings:F(M())}).strict(),Nme=I({existed:P(),path:M().min(1)}).strict(),Pme=I({fromFolder:M(),fromName:M(),toFolder:M(),toName:M(),body:M().optional(),frontmatter:R7.optional(),...M4,summary:N4}).strict(),Fme=I({from:M().min(1),to:M().min(1),committed:P()}).strict(),z7=L(pl),Ime=/^[a-z0-9-]+$/,Lme=/<\/?[A-Za-z][^>]*>/;function Rme(e){return Lme.test(e)}const zme=/^[A-Za-z0-9_-]+$/,B7=I({name:M(),description:M(),metadata:I({pack:M()}).strict().optional()}).strict(),Bme=I({skill:I({name:M().min(1),scope:z7,path:M().min(1),frontmatter:B7,body:M(),files:F(I({path:M().min(1),text:M().nullable()})).optional(),managed:P().optional()}).strict()}).strict(),Vme=I({source:M().min(1),publisher:M().optional(),skill:M().optional(),marketplaceUrl:M().optional(),importedAt:M().min(1),autoUpdate:P().optional()}).strict(),Hme=I({name:M().min(1),description:M().optional(),scope:z7,path:M().min(1),canonicalPath:M().min(1).optional(),filePaths:F(M()).optional(),absolutePath:M().min(1).optional(),installed:P(),hosts:F(M()),hostQualifier:M().optional().meta({description:"Set on a GLOBAL entry that shares its name with a distinct-content bundle in another host dir AND is not the by-name default: the host id whose root holds THIS bundle. Doc-name builders append it (`__skill__/global/<name>@<host>`) so each same-named bundle keeps its own tab and its own write-back path; the default bundle keeps the stable unqualified name."}),driftPaths:F(M()).optional().meta({description:`Recorded locations whose on-disk form (copy vs symlink) no longer matches what OK last wrote there — evidence another tool rewrote the path.`}),hostAliases:so(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:Vme.optional(),pack:M().optional(),modified:P().optional(),revertable:P().optional(),ignored:P().optional(),size:_me.optional()}).strict(),Ume=I({name:M().min(1),scope:z7,apply:P().optional()}).strict(),Wme=I({line:M().min(1),gitignorePath:M().min(1),applied:P(),alreadyTracked:P().optional()}).strict(),Gme=I({skills:F(Hme),truncated:P()}).strict(),Kme=I({scope:z7.default(`project`),name:M().meta({description:`Managed skill name to create or update.`}),body:M().optional(),frontmatter:B7,...M4,summary:N4}).strict(),qme=I({path:M().min(1),created:P(),warnings:F(M())}).strict(),Jme=I({scope:z7.default(`project`),name:M(),dryRun:P().optional(),setAutoUpdate:P().optional(),...M4,summary:N4}).strict(),Yme=I({name:M().min(1),updated:P(),source:M().min(1),localBody:M().optional(),upstreamBody:M().optional(),gitTracked:P().optional(),warnings:F(M())}).strict(),Xme=I({scope:z7.default(`project`),name:M(),...M4,summary:N4}).strict(),Zme=I({name:M().min(1),baselineRef:M().min(1),restoredFiles:F(M()),warnings:F(M())}).strict(),Qme=I({existed:P(),path:M().min(1)}).strict(),$me=I({scope:z7.default(`project`),fromName:M(),toName:M(),body:M().optional(),frontmatter:B7.optional(),...M4,summary:N4}).strict(),ehe=I({from:M().min(1),to:M().min(1),committed:P()}).strict(),the=I({name:M(),fromScope:z7,toScope:z7,...M4,summary:N4}).strict(),nhe=I({scope:z7,path:M().optional()}).strict(),rhe=I({scope:z7,name:M(),toName:M(),...M4,summary:N4}).strict(),ihe=I({name:M().min(1)}).strict(),ahe=I({name:M(),home:M().min(1)}).strict(),ohe=I({docName:M().min(1)}).strict(),V7=L([`reference`,`script`,`file`]),she=I({scope:z7.default(`project`),name:M(),path:M().min(1),content:M(),...M4,summary:N4}).strict(),che=I({path:M().min(1),created:P(),kind:V7,content:P()}).strict(),lhe=I({scope:z7.default(`project`),name:M(),from:M().min(1),to:M().min(1),...M4,summary:N4}).strict(),uhe=I({from:M().min(1),to:M().min(1),fromDocName:M().optional(),toDocName:M().optional()}).strict(),dhe=I({path:M().min(1),kind:V7,text:M()}).strict(),fhe=I({path:M().min(1),existed:P(),kind:V7}).strict(),H7=to([hme,R(`agents`)]),U7=M().min(1).refine(e=>!e.startsWith(`/`)&&!e.startsWith(`~`)&&!/^[A-Za-z]:/.test(e),{error:`a custom root is base-relative (e.g. ".tim/skills"), not absolute or ~-prefixed`}).refine(e=>e.split(`/`).every(e=>e!==``&&e!==`.`&&e!==`..`),{error:`a custom root may not contain "..", "." or empty path segments`}).refine(e=>e.includes(`/`),{error:`a custom root is a path (e.g. ".tim/skills") — bare editor names are host ids`}),W7=to([H7,U7]),phe=I({scope:z7.default(`project`),name:M(),targets:F(H7).optional().meta({description:'SET-EXACT install targets (editor ids, plus "agents" for the .agents hub — in-place skills only): the COMPLETE resulting host set. Omit to use project-configured editors; pass [] to uninstall everywhere. Stateless callers should prefer `add`/`remove`.'}),add:F(W7).optional().meta({description:`Locations to ADD the skill to (everything else untouched). Editor ids fan out a managed copy/symlink; a custom root path (".tim/skills") places the bundle there.`}),remove:F(W7).optional().meta({description:"Locations to REMOVE the skill from (lossless only — a hand-edited fork is refused, never deleted). The source cannot be removed; move it first with `source`."}),mode:L([`copy`,`link`]).optional().meta({description:`"link": one real folder (the source); every other location becomes a symlink to it. "copy": independent real folders, refreshed from the source until hand-edited (a hand-edit forks that copy). Converts existing locations losslessly. Omit to follow the form the skill already uses.`}),source:W7.optional().meta({description:`Move the skill's REAL folder to this location (the old source becomes a symlink to it — never a removal). Sticky across rescans.`}),linkMode:P().optional(),setSource:M().min(1).optional(),place:I({dir:M().min(1).meta({description:`Project-relative directory the bundle dir is created under (e.g. ".windsurf/skills").`}),mode:L([`copy`,`link`])}).strict().optional(),convert:I({target:W7.meta({description:`The installed location to convert — an editor id, "agents", or a recorded custom placement path.`}),mode:L([`copy`,`link`]).meta({description:`"link": replace this location with a symlink to the source. "copy": replace it with an independent real folder.`})}).strict().optional(),unplace:I({path:M().min(1).meta({description:`The recorded placement bundle path (e.g. ".windsurf/skills/my-skill").`})}).strict().optional(),...M4,summary:N4,fork:I({editor:M().min(1),action:L([`align`,`make-source`,`rename`]),toName:M().optional()}).strict().optional()}).strict().refine(e=>e.targets===void 0||e.add===void 0&&e.remove===void 0,{error:"`targets` is set-exact; `add`/`remove` are additive — use one style per call"}).refine(e=>e.fork===void 0||e.targets===void 0&&e.add===void 0&&e.remove===void 0&&e.source===void 0&&e.setSource===void 0,{error:"`fork` is its own operation — run it in a separate call"}).refine(e=>e.fork?.action!==`rename`||e.fork.toName!==void 0,{error:"`fork.rename` requires `toName`"}).refine(e=>e.source===void 0||e.add===void 0&&e.remove===void 0,{error:"a `source` move is its own operation — run it in a separate call from `add`/`remove`"}).refine(e=>[e.targets!==void 0||e.add!==void 0||e.remove!==void 0,e.place!==void 0,e.unplace!==void 0,e.convert!==void 0,e.source!==void 0||e.setSource!==void 0,e.fork!==void 0].filter(Boolean).length<=1,{error:"one operation per call — membership (`targets`/`add`/`remove`), `place`, `unplace`, `convert`, `source`, and `fork` are mutually exclusive"}),G7=[`no-targets`,`scripts-present`,`name-conflict`,`no-description`,`skill-fork-name-unpatched`,`place-path-invalid`,`place-fork-refused`],mhe=I({name:M().min(1).meta({description:`Managed skill name installed or uninstalled.`}),hosts:F(M()).meta({description:`Editor ids the skill is projected into after the operation; [] is expected after uninstall.`}),scripts:P().meta({description:`True when the skill ships executable scripts, projected but never run.`}),warnings:F(M()).meta({description:`Non-fatal install/uninstall warnings from target projection.`}),warningCodes:F(L(G7)).meta({description:"Machine-readable warning codes aligned with `warnings`."}),placedAt:M().optional(),sourceMovedTo:M().optional()}).strict(),hhe=I({scope:z7.default(`project`),name:M().meta({description:`Managed skill name to uninstall without deleting source.`})}).strict(),ghe=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(),_he=I({targets:F(I7),configured:P(),folders:F(I({scope:z7,host:M(),root:M(),state:L([`own`,`linked`,`linked-parent`,`absent`]),target:M().optional(),drift:R(!0).optional(),expected:M().optional()}).strict()).optional()}).strict(),K7=I({action:R(`link`),scope:z7,root:M().min(1).meta({description:`The folder to link (e.g. ".codex/skills").`}),target:M().min(1).meta({description:`The root it merges into (e.g. ".agents/skills"). Required.`})}),q7=I({action:R(`unlink`),scope:z7,root:M().min(1).meta({description:`The linked folder to materialize back.`}),exclude:F(M().min(1)).optional().meta({description:`Skill names to LEAVE OUT when materializing — the folder keeps every other skill it currently sees (as per-skill links) and stops auto-following the target root.`})}).strict(),J7=I({action:R(`add-root`),scope:z7,root:U7.meta({description:`New custom skills root to declare (base-relative, e.g. ".team/skills").`})}).strict(),vhe=ro(`action`,[K7.extend({preview:P().optional().meta({description:`Return the merge plan only (moves, drops, removes, conflicts, strays) — nothing is written.`})}).strict(),q7,J7]),yhe=ro(`action`,[K7.strict(),q7,J7]),bhe=I({folderAction:vhe}).strict(),xhe=I({moves:F(M()),drops:F(M()),removes:F(M()),replaces:F(M()),conflicts:F(M()),strays:F(M())}).strict(),She=I({targets:F(I7),reprojected:F(I({name:M(),hosts:F(M())}).strict()),bundleHosts:F(M()),removedFrom:F(M()),folder:I({moved:F(M()),dropped:F(M()),linked:F(M())}).strict().optional(),preview:xhe.optional()}).strict(),Che=I({scope:z7.default(`project`),name:M(),version:M().regex(/^[0-9a-f]{40}$/i),...M4,summary:N4}).strict(),whe=I({name:M().min(1),version:M(),restoredFiles:F(M()),warnings:F(M())}).strict(),The=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(),Ehe=I({kind:L([`page`,`folder`,`content`,`file`]),path:M().min(1),title:M(),score:N(),signals:so(M(),qa()),snippet:M().optional()}).loose(),Dhe=I({capable:P(),applied:P(),coverage:I({embedded:N().int().nonnegative(),total:N().int().nonnegative()})}).loose(),Ohe=I({enabled:P(),keyPresent:P(),keyNotRequired:P(),keySource:L([`project`,`file`,`env`]).nullable(),keyHint:M().nullable(),ready:P(),capable:P(),embedded:N().int().nonnegative(),total:N().int().nonnegative()}).loose(),khe=I({query:M(),intent:L([`autocomplete`,`full_text`,`omnibar`]),results:F(Ehe),elapsedMs:N().nonnegative(),semantic:Dhe.optional(),truncated:P().optional(),ready:P().optional()}).loose(),Ahe=I({version:M().min(1),recordedAt:M().min(1)}).loose(),jhe=I({currentVersion:M().min(1),targets:so(M(),Ahe.nullable())}).loose(),Mhe=I({scope:z7.default(`project`),source:M().min(1).meta({description:`External skill source: full skills.sh skill-page URL (https://www.skills.sh/<owner>/<repo>/<skill>, or https://www.skills.sh/site/<hostname>/<skill> for a website catalog), GitHub owner/repo[/subpath], git URL, or local/file path.`}),skill:M().min(1).optional().meta({description:`Specific skill name to import from a multi-skill source.`}),install:P().optional().meta({description:`Pass false to import WITHOUT the default-editor auto-projection (the caller installs explicitly afterwards). Default true.`}),marketplace:P().optional().meta({description:"The source came from a skills.sh listing the user chose (the Explore tab), so the install is reported to skills.sh and counts toward that listing. Off by default: a hand-typed repo must not be announced to skills.sh. Honors the `telemetry.skillInstallReports.enabled` setting and DO_NOT_TRACK."}),...M4,summary:N4}).strict(),Nhe=I({scope:z7.default(`project`),source:M().min(1).meta({description:`External skill source: full skills.sh skill-page URL, GitHub owner/repo[/subpath], git URL, or local/file path.`}),skills:F(M().min(1)).min(1).max(100).meta({description:`Skill names to import from the source.`}),install:P().optional().meta({description:`Pass false to import WITHOUT the default-editor auto-projection. Default true.`}),marketplace:P().optional().meta({description:"The source came from a skills.sh listing the user chose (a marketplace plugin bundle), so the import is reported to skills.sh as one batched install event and counts toward that listing. Off by default: a hand-typed repo must not be announced to skills.sh. Honors the `telemetry.skillInstallReports.enabled` setting and DO_NOT_TRACK."}),...M4,summary:N4}).strict(),Phe=I({results:F(I({requested:M(),status:L([`imported`,`already-imported`,`not-found`,`failed`]),name:M().optional(),collisionRenamedFrom:M().optional(),warnings:F(M()),error:M().optional()}).loose()),imported:N(),alreadyImported:N(),failed:N()}).loose(),Fhe=I({scope:z7.default(`project`),names:F(M().min(1)).min(1).max(100).meta({description:`Managed skill names to refresh from their recorded upstreams.`}),...M4,summary:N4}).strict(),Ihe=I({results:F(I({requested:M(),status:L([`updated`,`up-to-date`,`not-found`,`failed`]),source:M().optional(),warnings:F(M()),error:M().optional()}).loose()),updated:N(),upToDate:N(),failed:N()}).loose(),Lhe=I({source:M(),ref:M().optional(),contentHash:M(),publisher:M().optional()}).loose(),Rhe=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:Lhe,warnings:F(M()).meta({description:`Non-fatal import warnings, such as skipped unsupported files.`})}).loose(),Y7=`server-info`,X7=`branch-switched`,Z7=`disk-ack`,Q7=`config-validation-rejected`,$7=`config-ignore-nested-error`,zhe=L([`files`,`backlinks`,`graph`,`sync-status`,`session-activity`,`tags`,`comments`,`lint-config`,`local-targets`]),Bhe=I({v:R(1),ch:R(Y7),seq:N(),serverInstanceId:M().min(1),currentBranch:M().min(1).optional()}).loose(),Vhe=I({v:R(1),ch:R(X7),seq:N(),branch:M().min(1)}).loose(),Hhe=I({v:R(1),ch:zhe,seq:N()}).loose(),Uhe=I({v:R(1),ch:R(Z7),seq:N(),docName:M().min(1),sv:M().min(1)}).loose(),Whe=I({v:R(1),ch:R(Q7),seq:N(),docName:M().min(1),error:Fte}).loose(),Ghe=I({v:R(1),ch:R($7),seq:N(),path:M().min(1),error:M().min(1)}).loose(),Khe={id:`string`,kind:`enum`,path:`string`,title:`string`,name:`string`,pathSegments:`string`,content:`string`,modifiedTs:`number`},e9=new WeakMap;function qhe(e){return e===void 0||!Number.isFinite(e)?20:Math.max(1,Math.min(100,Math.trunc(e)))}function t9(e){return e.trim().toLowerCase()}const Jhe=/\.(?:md|mdx)$/;function Yhe(e,t){if(t!==`page`)return e;let n=e.replace(Jhe,``);return n.length>0?n:e}function Xhe(e){let t=e.split(`/`).filter(Boolean);return t[t.length-1]??e}function Zhe(e){let t=Xhe(e.path),n=e.title?.trim()||t,r=e.modifiedTs??0,i=e.path.split(`/`).filter(Boolean),a=new Set(i),o=[...new Set((e.aliases??[]).flatMap(e=>e.split(`/`).filter(Boolean)).filter(e=>!a.has(e)))];return{id:`${e.kind}:${e.path}`,kind:e.kind,path:e.path,title:n,name:t,pathSegments:[...i,...o].join(` `),content:e.content??``,modifiedTs:Number.isFinite(r)?r:0}}const n9=/[^\P{L}a-zàèéìòóù]|[^\P{Nd}0-9]|\p{Nl}/iu,r9=(()=>{let e=globalThis.Intl.Segmenter;return e?new e(`en`,{granularity:`word`}):null})();function Qhe(){let e=yY({language:`english`}),t=e.tokenize.bind(e);return e.tokenize=(e,n,r,i)=>{let a=t(e,n,r,i);if(!r9||typeof e!=`string`||!n9.test(e))return a;let o=new Set(a);for(let{segment:t,isWordLike:n}of r9.segment(e)){if(!n||!n9.test(t))continue;let e=t.toLowerCase();o.has(e)||(o.add(e),a.push(e))}return a},e}function i9(e){let t=NY({schema:Khe,components:{tokenizer:Qhe()}});return e.length>0&&WY(t,e),t}function a9(e){let t={documents:e};return e9.set(t,i9(e)),t}function $he(e){let t=e9.get(e);if(t)return t;let n=i9(e.documents);return e9.set(e,n),n}const o9=new WeakSet;function ege(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 tge(e,t){let n=e=>({corpus:a9(t),inserted:0,updated:0,removed:0,rebuilt:!0,rebuildReason:e}),r=e9.get(e);if(!r)return n(`no-index`);if(o9.has(e))return n(`stale-base`);let i=new Map(t.map(e=>[e.id,e]));if(i.size!==t.length)return n(`duplicate-id`);let a=[],o=[],s=0;for(let t of e.documents){let e=i.get(t.id);e?ege(t,e)||(a.push(t.id),o.push(e),s+=1):a.push(t.id)}let c=new Set(e.documents.map(e=>e.id));for(let e of t)c.has(e.id)||o.push(e);if(a.length+o.length>t.length)return n(`bulk-change`);o9.add(e);try{if(a.length>0&&XY(r,a),o.length>0&&WY(r,o),FY(r)!==t.length)throw Error(`Search index count ${FY(r)} diverged from document count ${t.length} after incremental update`)}catch{return n(`mutation-failed`)}let l={documents:t};return e9.set(l,r),{corpus:l,inserted:o.length-s,updated:s,removed:a.length-s,rebuilt:!1}}function nge(e){return e===`autocomplete`?[`page`]:e===`full_text`?[`page`,`content`,`file`]:[`page`,`folder`,`file`]}function s9(e,t){return t.has(e.kind)?!0:e.kind===`page`&&t.has(`content`)}function rge(e,t){let n=t9(t);if(!n)return 0;let r=Yhe(n,e.kind),i=t9(e.title),a=t9(e.name),o=t9(e.path),s=o.split(`/`);return i===r||a===r?700:o===r?650:i.startsWith(r)||a.startsWith(r)?600:s.some(e=>e.startsWith(r))?550:i.includes(r)||a.includes(r)?500:o.includes(r)?450:-1}function c9(e,t){let n=rge(e,t);return n<=0?n:O4(e.path)?n*.5:n}function ige(e){return e===`file`?-60:0}function age(e,t,n,r,i){let a=i>0?t/i:0,o=n/50,s=r===`file`?-.001:0,c=1*a+1*o+s;return e*1e3+c}function l9(e,t,n,r){return e+t*20+n+ige(r)}function u9(e,t,n,r,i,a){return e===`relevance`?l9(t,n,r,i):age(t,n,r,i,a)}function oge(e,t){return t||(e===`full_text`?`relevance`:`navigation`)}function d9(e,t){let n=0;for(let r of e){let e=t.get(r.id)??0;e>n&&(n=e)}return n}function sge(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 cge(e){return e===`full_text`?[`title`,`name`,`path`,`pathSegments`,`content`]:[`title`,`name`,`path`,`pathSegments`]}function lge(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 uge=/[฀-๿ក-៿ -〿぀-ゟ゠-ヿ㐀-䶿一-鿿\uf900-﫿＀-￯\u1100-\u11ff\u3130-\u318f\ua960-\ua97f\uac00-\ud7ff]/;function dge(e,t){let n=t9(t);return n.length<4||uge.test(n)?0:+(e===`full_text`)}function fge(e){let{lexical:t,fullText:n}=e.signals;return t>=500?`lexical`:t===450&&n<=0?`pathOnly`:`body`}function pge(e){let t=[],n=[],r=[];for(let i of e){let e=fge(i);e===`lexical`?t.length<100&&t.push(i):e===`body`?n.length<6&&n.push(i):r.length<4&&r.push(i)}return[...t,...n,...r]}function f9(e,t,n){if(t===`relevance`)return e.slice(0,n);let r=pge(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 mge(e,t,n={}){let r=n.intent??`omnibar`,i=oge(r,n.ranking),a=qhe(n.limit),o=new Set(n.scopes??nge(r)),s=e.documents.filter(e=>s9(e,o)),c=t9(t);if(!c)return s.slice().sort((e,t)=>e.path.localeCompare(t.path)).slice(0,a).map(e=>({document:e,score:0,signals:{lexical:0,fullText:0,recency:0}}));let l=EX($he(e),{term:c,properties:cge(r),boost:lge(r),tolerance:dge(r,c),limit:Math.max(a*4,40)}),u=new Map(l.hits.filter(e=>s9(e.document,o)).map(e=>[e.document.id,e.score])),d=sge(s),f=new Map;for(let e of s)c9(e,c)>=0&&f.set(e.id,e);for(let e of l.hits)s9(e.document,o)&&f.set(e.document.id,e.document);if(!n.semantic){let e=d9(f.values(),u);return f9([...f.values()].map(t=>{let n=Math.max(0,c9(t,c)),r=u.get(t.id)??0,a=d.get(t.id)??0;return{document:t,score:u9(i,n,r,a,t.kind,e),signals:{lexical:n,fullText:r,recency:a}}}).sort((e,t)=>e.score===t.score?e.document.path.localeCompare(t.document.path):t.score-e.score),i,a)}return f9(hge({scopedDocuments:s,candidates:f,fullTextScores:u,recency:d,normalizedQuery:c,ranking:i,semantic:n.semantic}),i,a)}function p9(e){let t=new Map;return e.forEach((e,n)=>{t.set(e,n+1)}),t}function hge(e){let{scopedDocuments:t,candidates:n,fullTextScores:r,recency:i,normalizedQuery:a,ranking:o,semantic:s}=e,c=s.rrfK??60,l=s.candidateLimit??64,u=s.similarityFloor??0,d=s.scores,f=new Map(t.map(e=>[e.id,e])),p=[...d.entries()].filter(([e,t])=>t>=u&&f.has(e)).sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0])).slice(0,l);for(let[e]of p)if(!n.has(e)){let t=f.get(e);t&&n.set(e,t)}let m=d9(n.values(),r),h=[...n.values()].map(e=>{let t=Math.max(0,c9(e,a)),n=r.get(e.id)??0,s=i.get(e.id)??0,c=d.get(e.id),l=c!==void 0&&c>=u;return{document:e,score:t>0?u9(o,t,n,s,e.kind,m):l9(t,n,s,e.kind),signals:l?{lexical:t,fullText:n,recency:s,vector:c}:{lexical:t,fullText:n,recency:s},lexical:t,fullText:n,recency:s,cosine:c}}),g=p9(h.filter(e=>e.fullText>0).sort((e,t)=>t.fullText-e.fullText||e.document.path.localeCompare(t.document.path)).map(e=>e.document.id)),_=p9(h.filter(e=>e.cosine!==void 0&&e.cosine>=u).sort((e,t)=>t.cosine-e.cosine||e.document.path.localeCompare(t.document.path)).map(e=>e.document.id)),v=e=>{let t=0,n=g.get(e);n!==void 0&&(t+=1/(c+n));let r=_.get(e);return r!==void 0&&(t+=1/(c+r)),t};return h.sort((e,t)=>{let n=+(e.lexical>0),r=+(t.lexical>0);if(n!==r)return r-n;if(n===1)return e.score===t.score?e.document.path.localeCompare(t.document.path):t.score-e.score;let i=v(e.document.id),a=v(t.document.id);return i===a?e.recency===t.recency?e.document.path.localeCompare(t.document.path):t.recency-e.recency:a-i}).map(({document:e,score:t,signals:n})=>({document:e,score:t,signals:n}))}function gge(e){return e.created.length>0||e.packSkills?.some(e=>e.pending)===!0||e.requiredPlugins?.some(e=>e.pending)===!0}const _ge=/^[A-Za-z0-9._-]+$/,vge=/^(?:\d{1,3}\.){3}\d{1,3}$/;var m9=class extends Error{constructor(e){super(e),this.name=`InvalidShareUrlError`}};function yge(e,t=0){if(g9(t,!0),t===0)return Sge(e);if(e.length>2985)throw new m9(`Share URL exceeds the v2 URL size limit`);xge(h9(e),t);let n=new TextEncoder().encode(e);if(n.length>2985)throw new m9(`Share URL exceeds the v2 URL size limit`);let r=new Uint8Array(3+n.length);if(r[0]=2,r[1]=t>>>8,r[2]=t&255,r.set(n,3),r.length>2988)throw new m9(`Share payload exceeds the v2 size limit`);let i=S9(r);if(i.length>3984)throw new m9(`Share token exceeds the v2 size limit`);return i}function h9(e){if(!e.startsWith(`https://`))throw new m9(`Share URL must use canonical HTTPS spelling`);if(e.includes(`?`)||e.includes(`#`))throw new m9(`Share URL cannot contain a query or fragment`);let t=e.slice(8),n=t.indexOf(`/`);if(n<=0)throw new m9(`Share URL is missing its repository path`);let r=t.slice(0,n);_9(r);let i=t.slice(n+1).split(`/`);if(i.length<4||i.some(e=>e.length===0))throw new m9(`Share URL has an invalid path shape`);let[a,o,s,c,...l]=i;if(s!==`blob`&&s!==`tree`)throw new m9(`Share URL has an unsupported repository path shape`);let u=v9(a,`owner`),d=v9(o,`repository`),f=Cge(c),p=l.map(e=>wge(e,`target`)),m=s===`blob`?`doc`:`folder`;if(m===`doc`&&p.length===0)throw new m9(`Document share URL is missing its target path`);let h={host:r,owner:u,repo:d,branch:f,kind:m,targetSegments:p};if(bge(h)!==e)throw new m9(`Share URL is not canonically serialized`);return h}function bge(e){if(_9(e.host),x9(e.owner,`owner`),x9(e.repo,`repository`),!J4(e.branch))throw new m9(`Share URL branch is invalid`);if(e.kind!==`doc`&&e.kind!==`folder`)throw new m9(`Share URL target kind is invalid`);if(e.kind===`doc`&&e.targetSegments.length===0)throw new m9(`Document share URL is missing its target path`);for(let t of e.targetSegments)b9(t,`target`);let t=e.kind===`doc`?`blob`:`tree`,n=[encodeURIComponent(e.owner),encodeURIComponent(e.repo),t,encodeURIComponent(e.branch),...e.targetSegments.map(e=>encodeURIComponent(e))];return`https://${e.host}/${n.join(`/`)}`}function xge(e,t){if(g9(t,!1),t>e.targetSegments.length)throw new m9(`Content root depth exceeds the repository target path`);let n=e.targetSegments.slice(t).join(`/`);if(e.kind===`doc`){if(n.length===0)throw new m9(`Document share target cannot be the content root`);return{kind:`doc`,docPath:n}}return{kind:`folder`,folderPath:n}}function Sge(e){let t=new TextEncoder().encode(e),n=new Uint8Array(1+t.length);return n[0]=1,n.set(t,1),S9(n)}function g9(e,t){if(!Number.isInteger(e)||e<+!t||e>65535)throw new m9(`Content root depth is invalid`)}function _9(e){if(e.length===0||e.length>253||e.endsWith(`.`)||e!==e.toLowerCase()||vge.test(e))throw new m9(`Share URL host is not canonical`);if(e.split(`.`).some(e=>e.length===0||e.length>63||!/^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/.test(e)))throw new m9(`Share URL host is not a DNS name`);if(P0(e)!==e)throw new m9(`Share URL host is not a canonical GitHub host`)}function Cge(e){let t=y9(e,`branch`);if(!J4(t))throw new m9(`Share URL branch is invalid`);return t}function wge(e,t){let n=y9(e,t);return b9(n,t),n}function v9(e,t){let n=y9(e,t);return x9(n,t),n}function y9(e,t){let n;try{n=decodeURIComponent(e)}catch{throw new m9(`Share URL ${t} has malformed percent encoding`)}if(encodeURIComponent(n)!==e)throw new m9(`Share URL ${t} is not canonically encoded`);return n}function b9(e,t){if(e.length===0||e===`.`||e===`..`||e.toLowerCase()===`.git`||e.includes(`/`)||e.includes(`\\`)||Tge(e))throw new m9(`Share URL ${t} component is invalid`)}function x9(e,t){if(b9(e,t),!_ge.test(e)||e.startsWith(`-`))throw new m9(`Share URL ${t} component is invalid`)}function Tge(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n<=31||n===127)return!0}return!1}function S9(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}const C9=Symbol.for(`@inkeep/open-knowledge/skill-state-field-registry`),w9=globalThis;w9[C9]===void 0&&(w9[C9]=ar());const T9=w9[C9],Ege=[`.ok`,`skill-state.yml`],Dge=[`claude-cowork`,`cli-hosts`],Oge=[`server-build-and-open`,`electron-build-and-open`,`cli-npx-skills-add`,`desktop-direct`,`cli-start`],E9=/^\d+\.\d+\.\d+(?:[-+][\w.-]+)?$/,D9=$a({version:M().regex(E9,`version must match /^\\d+\\.\\d+\\.\\d+(?:[-+][\\w.-]+)?$/`).register(T9,{description:`Recorded skill version for this target.`}),recordedAt:Gi().register(T9,{description:`ISO 8601 timestamp of the most recent successful write. Updated on every write, including reinstalls of the same version.`}),surface:L(Oge).register(T9,{description:`Install-source surface that recorded this entry.`}).optional()}),kge=$a({enabled:P().register(T9,{description:`Whether this user-global skill bundle is opted in.`}),decidedAt:Gi().register(T9,{description:`ISO 8601 timestamp of the opt-in / opt-out decision.`})}),Age=$a({schema:R(1).register(T9,{description:`Schema major version. Bumped only on breaking shape changes.`}),targets:$a({"claude-cowork":D9.optional(),"cli-hosts":D9.optional()}).register(T9,{description:`Per-target install-state entries. Absent target = no recorded install.`}).default({}),bundles:so(M(),kge).register(T9,{description:`Per-bundle opt-in decisions keyed by install name. Absent key = no recorded decision.`}).optional(),installsReported:F(M()).register(T9,{description:"Skill installs already reported to skills.sh from this machine, as `<owner/repo>#<skill>`. Append-only; presence suppresses a re-report."}).optional()});function jge(e,t){return e??t.installedOnDisk}function Mge(){return{schema:1,targets:{}}}const O9=`template`;function k9(e){if(e.trim()===``)return{};let t;try{t=(0,Rc.parse)(e)}catch{return{}}return typeof t!=`object`||!t||Array.isArray(t)?{}:t}function A9(e,t){return e.trim()===``?t:`---\n${e}\n---\n${t}`}function Nge(e){let{frontmatter:t,body:n}=Jc(e);return t===``?{docFrontmatterText:``,markdown:e}:{docFrontmatterText:Xc(t),markdown:n}}function Pge(e){let t=e.split(`
545
545
  `);if(!(t[0]??``).startsWith(`template:`))return null;let n=[t[0]??``],r=1;for(;r<t.length;){let e=t[r]??``;if(/^[ \t]/.test(e)){n.push(e),r++;continue}if(e.trim()===``){let i=r+1;for(;i<t.length&&(t[i]??``).trim()===``;)i++;if(i<t.length&&/^[ \t]/.test(t[i]??``)){n.push(e),r++;continue}}break}let i=k9(n.join(`
546
546
  `))[O9];return{identity:typeof i==`object`&&i&&!Array.isArray(i)?i:{},docFrontmatterText:t.slice(r).join(`
547
547
  `).replace(/\n+$/,``)}}function j9(e){let t=e.charCodeAt(0)===65279?e.slice(1):e,{frontmatter:n,body:r}=Jc(t);if(n===``)return{identity:{},starterContent:t};let i=Xc(n),a=Pge(i);if(a)return{identity:a.identity,starterContent:A9(a.docFrontmatterText,r)};let{frontmatter:o}=Jc(r);if(o!==``)return{identity:k9(i),starterContent:r};let s=k9(i);return typeof s.title==`string`?{identity:s,starterContent:r}:{identity:{},starterContent:A9(i,r)}}function Fge(e,t){let{docFrontmatterText:n,markdown:r}=Nge(t),i={};for(let[t,n]of Object.entries(e))n!==void 0&&(i[t]=n);let a=(0,Rc.stringify)({[O9]:i});return`---\n${n.trim()===``?a:`${a}${n}\n`}---\n${r}`}function Ige(e){return j9(e).starterContent}const M9=e=>e*8+4;M9(92),M9(40);const Lge=/^(#{1,6})\s+(.+)$/;function Rge(e,t){let n=(e.endsWith(`\r`)?e.slice(0,-1):e).match(Lge);if(!n)return null;let r=n[2].trim(),i=kde(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 zge={fileSystem:`File System`,gitUpstream:`Git (upstream)`,service:`OpenKnowledge (service)`,generator:`OpenKnowledge (generated)`},Bge=[`#D97757`,`#1B1912`,`#F9F3E9`,`#7A9DFF`,`#8534F3`,`#9663F0`,`#727CF3`],Vge={claude:`#D97757`,cursor:`#1B1912`,windsurf:`#0B100F`,openai:`#7A9DFF`,github:`#8534F3`,cline:`#9663F0`,bot:`#727CF3`};function Hge(e,t=Bge){let n=0;for(let t of e)n=(n<<5)-n+t.charCodeAt(0)|0;return t[Math.abs(n)%t.length]}const Uge={"claude-code":`claude`,"claude-ai":`claude`,cursor:`cursor`,"cursor-vscode":`cursor`,cascade:`windsurf`,codex:`openai`,"codex-mcp-client":`openai`,copilot:`github`,cline:`cline`,"claude-acp":`claude`,"codex-acp":`openai`,"github-copilot-cli":`github`};function N9(e){return e?Uge[e]||(e.startsWith(`local-agent-mode-`)?`claude`:`bot`):`bot`}const Wge={claude:`Claude`,cursor:`Cursor`,windsurf:`Windsurf`,openai:`Codex`,github:`Copilot`,cline:`Cline`};function Gge(e){let t=e?.trim();return t?Wge[N9(t)]??t:`Agent`}function P9(e){if(!e.includes(`%`))return e;let t;try{t=decodeURIComponent(e)}catch{return e}return t===`.`||t===`..`||t.includes(`/`)||t.includes(`\\`)||t.includes(`\0`)?e:t}function F9(e){return e===`.`||e===`..`?e:encodeURIComponent(e).replace(/[!'()*]/g,e=>`%${e.codePointAt(0)?.toString(16).toUpperCase()}`)}function Kge(e){return e.split(`/`).map(F9).join(`/`)}function I9(e){return e.split(`/`).map(P9).join(`/`)}function L9(e,t){let n=e.trim();if(!n||/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n)||n.startsWith(`//`)||n.startsWith(`#`))return null;let r=n.indexOf(`#`),i=r>=0?n.slice(0,r):n,a=r>=0?n.slice(r+1):null,o=(i.split(`?`)[0]??``).trim();if(!o)return null;let s=P9(o.split(`/`).pop()??``).match(/\.([a-z0-9]+)$/i);if(s){let e=`.${(s[1]??``).toLowerCase()}`;if(!O0.includes(e))return null}let c=o.startsWith(`/`),l=c?o.slice(1):o,u=c?[]:t.includes(`/`)?t.split(`/`).slice(0,-1):[],d=l.split(`/`),f=d.length-1;for(let e=0;e<d.length;e++){let t=P9(d[e]??``);if(e===f&&(t=_l(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 qge(e){throw Error(`Unhandled ClassifiedLinkTarget variant: ${JSON.stringify(e)}`)}const R9=/^[a-zA-Z][a-zA-Z\d+\-.]*:/;function z9(e){let t=(e.split(/[?#]/)[0]??e).match(/\.([a-z0-9]+)$/i);return t?(t[1]??``).toLowerCase():null}function B9(e){let t=e.trim();return R9.test(t)||t.startsWith(`//`)}function Jge(e,t){let n=e.trim();if(!n)return null;if(n.startsWith(`#`)){let e=n.slice(1).trim();return e?{kind:`anchor`,anchor:e}:null}if(B9(n))return{kind:`external`,url:n};let r=n.indexOf(`#`),i=I9(r<0?n:n.slice(0,r)),a=Sl(i,t);if(a)return{kind:`doc`,docName:a,anchor:r<0?null:n.slice(r+1)};let o=xl(i,t);if(o)return{kind:`doc`,docName:o,anchor:r<0?null:n.slice(r+1)};let s=L9(n,t);if(s)return{kind:`doc`,docName:s.docName,anchor:s.anchor};let c=z9(i);return c&&c!==`md`&&c!==`mdx`?{kind:`asset`,url:n,ext:c,literal:!1}:null}function V9(e,t){let n=e.trim();if(!n)return null;if(B9(n))return{kind:`external`,url:t?`${n}#${t}`:n};let r=z9(n);return r&&r!==`md`&&r!==`mdx`?{kind:`asset`,url:n,ext:r,literal:!0}:{kind:`doc`,docName:n,anchor:t?.trim()||null}}function Yge(e,t,n){let r=e.trim();if(!r||R9.test(r)||r.startsWith(`//`)||r.startsWith(`#`))return null;let i=r.indexOf(`#`),a=((i>=0?r.slice(0,i):r).split(`?`)[0]??``).trim();if(!a)return null;let o=a.startsWith(`/`),s=o?a.slice(1):a,c=o?[]:t.includes(`/`)?t.split(`/`).slice(0,-1):[];for(let e of s.split(`/`))if(e===`..`){if(c.length===0)return null;c.pop()}else e!==`.`&&e!==``&&c.push(n.literal?e:P9(e));return c.length===0?null:c.join(`/`)}function H9(e){let t=e;return t.startsWith(`./`)&&(t=t.slice(2)),t.startsWith(`/`)&&(t=t.slice(1)),t}function U9(e){let t=e.lastIndexOf(`/`);return t===-1?e:e.slice(t+1)}function W9(e){let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)}function G9(e){return e.split(`/`).filter(e=>e!==``)}function Xge(e,t){let n=W9(t);return e===``||n===e||n.startsWith(`${e}/`)}function K9(e,t){let n=W9(t);if(e===n)return 0;let r=e===``?n:n.slice(e.length+1);return r===``?0:G9(r).length}function q9(e,t){let n=G9(e),r=G9(t),i=0;for(;i<n.length&&i<r.length&&n[i]===r[i];)i++;return n.length-i+(r.length-i)}function Zge(){let e=new Map;function t(t){let n=H9(t);if(n===``)return;let r=U9(n);if(r===``)return;let i=r.toLowerCase(),a=e.get(i);if(!a){e.set(i,[n]);return}a.includes(n)||a.push(n)}function n(t){let n=H9(t),r=U9(n).toLowerCase(),i=e.get(r);if(!i)return;let a=i.indexOf(n);a!==-1&&(i.splice(a,1),i.length===0&&e.delete(r))}function r(e,r){n(e),t(r)}function i(t,n){let r=t.toLowerCase(),i=e.get(r);if(!i||i.length===0)return null;if(i.length===1)return i[0];let a=W9(H9(n)),o=[],s=[];for(let e of i)Xge(a,e)?o.push(e):s.push(e);return o.length>0?(e=>{let t=e[0],n=K9(a,t);for(let r=1;r<e.length;r++){let i=e[r],o=K9(a,i);(o<n||o===n&&i<t)&&(t=i,n=o)}return t})(o):(e=>{let t=e[0],n=q9(a,W9(t));for(let r=1;r<e.length;r++){let i=e[r],o=q9(a,W9(i));(o<n||o===n&&i<t)&&(t=i,n=o)}return t})(s)}function a(){let t=new Map;for(let[n,r]of e)t.set(n,[...r]);return t}function o(){e.clear()}return{add:t,remove:n,rename:r,resolveEmbed:i,clear:o,snapshot:a,size:()=>e.size}}const J9=`unknown`;function Qge(e,t=Date.now()){let n=Date.parse(e);if(!Number.isFinite(n))return J9;let r=Math.floor(Math.max(0,t-n)/1e3);if(r<60)return`${r}s ago`;let i=Math.floor(r/60);if(i<60)return`${i}m ago`;let a=Math.floor(i/60);return a<24?`${a}h ago`:`${Math.floor(a/24)}d ago`}function $ge(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 e_e(e,t){if(e.size===0)return new Set;if(t===``)return new Set(e);let n=new Set,r=`${t}/`;for(let i of e)(i===t||i.startsWith(r))&&n.add(i);return n}function Y9(e){let t=e?.trim();return t===void 0||t===``?void 0:t}function t_e(e){return e.reason!==void 0||Y9(e.note)!==void 0||Y9(e.email)!==void 0}function n_e(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 r_e(){return n_e((typeof process>`u`?void 0:Y9(process.env?.OK_FEEDBACK_INTAKE_ORIGIN))??`https://openknowledge.ai`)}function i_e(e){let t=Y9(e);if(t!==void 0)return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)?t:void 0}async function X9(e,t,n){try{let r=await fetch(e,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t),signal:AbortSignal.timeout(n)});if(r.ok){let e=await r.json().catch(()=>null);return{ok:!0,reference:typeof e?.reference==`string`?e.reference:``}}return r.status===400||r.status===413?{ok:!1,reason:`invalid`}:r.status===503?{ok:!1,reason:`unavailable`}:{ok:!1,reason:`error`}}catch(e){return{ok:!1,reason:e instanceof Error&&(e.name===`TimeoutError`||e.name===`AbortError`)?`timeout`:`error`}}}async function a_e(e,t={}){let n=r_e();if(n===null)return{ok:!1,reason:`error`};let r=new URL(`/api/feedback`,n),i=Y9(e.note),a=i_e(e.email),o={kind:`uninstall`,reasons:e.reason===void 0?[]:[e.reason],...i===void 0?{}:{message:i},appVersion:e.appVersion,platform:e.platform,source:e.source},s=Date.now()+(t.timeoutMs??4e3),c=()=>s-Date.now();if(a===void 0)return X9(r,o,c());let l=await X9(r,{...o,email:a},c());return l.ok||l.reason!==`invalid`||c()<=0?l:X9(r,o,c())}function Z9(e){return`pagesBySlug`in e}function o_e(e){return Z9(e)?e.pages:e}function s_e(e,t){return Z9(e)?e.assetPaths??new Set:t??new Set}function c_e(e,t){return Z9(e)?e.filePaths??new Set:t??new Set}function Q9(e,t){return e<t?-1:+(e>t)}function l_e(e,t){let n=new Map;for(let r of e){let e=t(r);e&&!n.has(e)&&n.set(e,r)}return n}function u_e(e,t){let n=new Map,r=[...e].sort(Q9);for(let e of r){let r=e.lastIndexOf(`/`),i=t(r===-1?e:e.slice(r+1));i&&!n.has(i)&&n.set(i,e)}return n}function d_e(e,t){let n=v7(e);if(n){if(Z9(t))return t.pagesBySlug.get(n);for(let e of t)if(v7(e)===n)return e}}function f_e(e,t){if(e.includes(`/`))return;let n=v7(e);if(!n)return;if(Z9(t))return t.pagesByBasename?.get(n);let r;for(let e of t){let t=e.lastIndexOf(`/`);v7(t===-1?e:e.slice(t+1))===n&&(r===void 0||Q9(e,r)<0)&&(r=e)}return r}function p_e(e){let t=e.trim();if(!t)return[];let n=v7(t);return n.length>0&&n!==t?[n]:[]}function $9(e,t){let n=e.trim();if(!n)return;let r=o_e(t);if(r.has(n))return n;let i=d_e(n,t);if(i)return i;for(let e of p_e(n))if(r.has(e))return e;return m_e(n,r)||f_e(n,t)}function m_e(e,t){let n=`${e}/index`;if(t.has(n))return n;let r=e.lastIndexOf(`/`),i=r===-1?e:e.slice(r+1),a=i?`${e}/${i}`:null;if(a&&t.has(a))return a}function h_e(e){let t=((e.trim().split(`#`)[0]??``).trim().split(`?`)[0]??``).trim();return t.startsWith(`/`)?t.slice(1):t}function g_e(e,t,n){let r=h_e(e);if(!r)return null;let i=r.toLowerCase(),a=n?[t,n]:[t];for(let e of a){if(e.has(r))return r;for(let t of e)if(t.toLowerCase()===i)return t}if(r.includes(`/`))return null;let o=[];for(let e of a)for(let t of e){let e=t.lastIndexOf(`/`);(e===-1?t:t.slice(e+1)).toLowerCase()===i&&o.push(t)}return o.length===0?null:o.sort(Q9)[0]??null}function __e(e,t,n){let r=V9(e,t);return r===null||r.kind!==`asset`||g_e(r.url,s_e(n),c_e(n))!==null||$9(e,n)===void 0?r:{kind:`doc`,docName:e.trim(),anchor:t?.trim()||null}}const v_e=new wle({extensions:l4,deriveStructuralFreshness:!0}),y_e=tC(l4);export{u5 as $,bme as $a,Ml as $c,QZ as $i,fs as $l,Wpe as $n,a_e as $o,_he as $r,bf as $s,Yfe as $t,S as $u,Hhe as A,Zge as Aa,Xf as Ac,Mme as Ai,fu as Al,n7 as An,D4 as Ao,uhe as Ar,Gue as As,fme as At,Sa as Au,l3 as B,m0 as Ba,Hte as Bc,tfe as Bi,yl as Bl,Ege as Bn,g0 as Bo,the as Br,$u as Bs,jfe as Bt,ot as Bu,xQ as C,Fge as Ca,Lte as Cc,O9 as Ci,hl as Cl,ife as Cn,sde as Co,ahe as Cr,EQ as Cs,Zue as Ct,I as Cu,Vhe as D,Z1 as Da,Pf as Dc,Nme as Di,ml as Dl,J9 as Dn,D5 as Do,she as Dr,sZ as Ds,Ofe as Dt,M as Du,h5 as E,Rme as Ea,op as Ec,xme as Ei,Gc as El,nfe as En,C0 as Eo,dhe as Er,gde as Es,Dfe as Et,so as Eu,Q7 as F,Zhe as Fa,ff as Fc,Ome as Fi,Al as Fl,Fpe as Fn,J4 as Fo,phe as Fr,Sde as Fs,y7 as Ft,zn as Fu,ofe as G,DQ as Ga,Vf as Gc,b3 as Gi,gu as Gl,zge as Gn,XQ as Go,Jme as Gr,rd as Gs,nde as Gt,D as Gu,Xde as H,_4 as Ha,Ote as Hc,Ppe as Hi,Wl as Hl,E9 as Hn,E$ as Ho,ehe as Hr,Bte as Hs,Que as Ht,ke as Hu,Z7 as I,I9 as Ia,Ru as Ic,ope as Ii,wl as Il,Ipe as In,Mue as Io,jhe as Ir,zH as Is,N0 as It,Zt as Iu,Spe as J,VX as Ja,yu as Jc,ede as Ji,jl as Jl,Upe as Jn,Pae as Jo,whe as Jr,Ef as Js,Zfe as Jt,y as Ju,P7 as K,a7 as Ka,wu as Kc,y3 as Ki,vu as Kl,wfe as Kn,h9 as Ko,Yme as Kr,wf as Ks,ade as Kt,ce as Ku,Y7 as L,i1 as La,Fu as Lc,ipe as Li,hu as Ll,Fae as Ln,Cde as Lo,mhe as Lr,iH as Ls,k0 as Lt,et as Lu,Bhe as M,BQ as Ma,Pu as Mc,Fme as Mi,gl as Ml,kpe as Mn,ide as Mo,Bme as Mr,r$ as Ms,mpe as Mt,Gi as Mu,X7 as N,p8 as Na,If as Nc,kme as Ni,Qc as Nl,Ape as Nn,gme as No,Mhe as Nr,tge as Ns,T3 as Nt,Ui as Nu,Ghe as O,X1 as Oa,vd as Oc,Dme as Oi,Nl as Ol,h1 as On,I0 as Oo,che as Or,e_e as Os,Pfe as Ot,to as Ou,$7 as P,a9 as Pa,Wd as Pc,Ame as Pi,El as Pl,Afe as Pn,Nle as Po,Rhe as Pr,w4 as Ps,m9 as Pt,_r as Pu,wue as Q,yge as Qa,xu as Qc,u0 as Qi,ps as Ql,Hpe as Qn,yZ as Qo,Age as Qr,xf as Qs,Jfe as Qt,ne as Qu,_1 as R,xde as Ra,Jte as Rc,ape as Ri,ql as Rl,G7 as Rn,AQ as Ro,W7 as Rr,Kh as Rs,yfe as Rt,nt as Ru,o3 as S,p5 as Sa,Ute as Sc,eme as Si,lu as Sl,afe as Sn,B9 as So,ihe as Sr,Tue as Ss,Xue as St,N as Su,J5 as T,uQ as Ta,bd as Tc,Cme as Ti,du as Tl,v3 as Tn,i3 as To,fhe as Tr,GQ as Ts,Cfe as Tt,bo as Tu,pfe as U,Gge as Ua,qf as Uc,j0 as Ui,$c as Ul,O0 as Un,q8 as Uo,Kme as Ur,Nte as Us,que as Ut,_e as Uu,Yde as V,dQ as Va,zte as Vc,Npe as Vi,Sl as Vl,Dge as Vn,t$ as Vo,nhe as Vr,Td as Vs,Mfe as Vt,Qe as Vu,w7 as W,qQ as Wa,Bf as Wc,K0 as Wi,Dl as Wl,g5 as Wn,c8 as Wo,qme as Wr,Rf as Ws,e7 as Wt,j as Wu,bpe as X,Kge as Xa,Eu as Xc,kfe as Xi,nl as Xl,Bpe as Xn,$Q as Xo,Zme as Xr,kd as Xs,Hfe as Xt,b as Xu,ype as Y,Mge as Ya,Su as Yc,W5 as Yi,Xc as Yl,zpe as Yn,j9 as Yo,Xme as Yr,Tf as Ys,Vfe as Yt,ae as Yu,M0 as Z,F9 as Za,Tu as Zc,O$ as Zi,Lc as Zl,Vpe as Zn,gge as Zo,z7 as Zr,Sf as Zs,Ufe as Zt,x as Zu,Eue as _,V0 as _a,Ud as _c,Zpe as _i,nu as _l,H0 as _n,Rae as _o,q4 as _r,$9 as _s,Eme as _t,ro as _u,tpe as a,Nue as aa,kf as ac,re as ad,ghe as ai,sl as al,Bfe as an,yde as ao,cme as ar,ude as as,Mpe as at,ys as au,ffe as b,Hge as ba,uf as bc,Xpe as bi,$l as bl,Dpe as bn,Ige as bo,Qme as br,Rge as bs,Wue as bt,R as bu,Jde as c,b4 as ca,td as cc,Gme as ci,dl as cl,upe as cn,i5 as co,Ohe as cr,dde as cs,cfe as ct,So as cu,kue as d,l_e as da,Gte as dc,hpe as di,Ll as dl,ppe as dn,QQ as do,F4 as dr,jge as ds,HX as dt,L as du,cde as ea,Qu as ec,T as ed,bhe as ei,al as el,x3 as en,IX as eo,The as er,U0 as es,_5 as et,ds as eu,Rue as f,TZ as fa,Vte as fc,S3 as fi,Il as fl,M5 as fn,Lle as fo,R4 as fr,f0 as fs,Sfe as ft,Ua as fu,Iue as g,Jge as ga,qte as gc,Qpe as gi,tu as gl,j$ as gn,t_e as go,G4 as gr,__e as gs,Tme as gt,yo as gu,Due as h,r3 as ha,Dte as hc,tme as hi,il as hl,Nfe as hn,a4 as ho,H4 as hr,E0 as hs,wme as ht,P as hu,K5 as i,_3 as ia,Af as ic,E as id,hhe as ii,cl as il,Rfe as in,l$ as io,F7 as ir,lde as is,jpe as it,ms as iu,Uhe as j,g8 as ja,Sd as jc,Pme as ji,_u as jl,i7 as jn,rde as jo,yhe as jr,v7 as js,mme as jt,ba as ju,Whe as k,bde as ka,Lf as kc,jme as ki,Rl as kl,f1 as kn,L$ as ko,lhe as kr,bQ as ks,Aae as kt,qa as ku,Oue as l,aZ as la,ed as lc,Fhe as li,fl as ll,cpe as ln,h0 as lo,p3 as lr,w0 as ls,Cpe as lt,Ra as lu,Hue as m,D0 as ma,Hf as mc,ime as mi,Kl as ml,F0 as mn,moe as mo,U4 as mr,w3 as ms,$1 as mt,F as mu,y_e as n,yQ as na,nd as nc,ee as nd,Ume as ni,ll as nl,Wfe as nn,m4 as no,ome as nr,mQ as ns,A0 as nt,xo as nu,npe as o,NZ as oa,Of as oc,w as od,Nhe as oi,Hc as ol,Yue as on,jle as oo,dme as or,Hde as os,rfe as ot,Cte as ou,zue as p,h7 as pa,Cd as pc,Lfe as pi,Gl as pl,O5 as pn,b7 as po,L4 as pr,L9 as ps,vpe as pt,Ga as pu,xpe as q,Nae as qa,Cu as qc,tde as qi,Jc as ql,Tfe as qn,u4 as qo,Che as qr,Df as qs,Xfe as qt,v as qu,Vge as r,qge as ra,xd as rc,oe as rd,Wme as ri,ol as rl,qfe as rn,K1 as ro,sme as rr,Iae as rs,Ife as rt,lte as ru,Ude as s,S4 as sa,lp as sc,Phe as si,vl as sl,fpe as sn,wde as so,ame as sr,C7 as ss,lfe as st,ute as su,v_e as t,ZZ as ta,Mf as tc,te as td,She as ti,ul as tl,Gfe as tn,$ge as to,khe as tr,Vde as ts,G0 as tt,is as tu,Lue as u,u_e as ua,Kte as uc,Ihe as ui,pl as ul,spe as un,Qge as uo,I4 as ur,Yge as us,wpe as ut,uo as uu,Fue as v,V9 as va,Ff as vc,nme as vi,su as vl,W0 as vn,N9 as vo,u3 as vr,Q1 as vs,gfe as vt,Ba as vu,a$ as w,lQ as wa,Hu as wc,zme as wi,Ul as wl,m3 as wn,O4 as wo,ohe as wr,y8 as ws,O7 as wt,fo as wu,dfe as x,t1 as xa,Rte as xc,$pe as xi,eu as xl,Tpe as xn,X4 as xo,rhe as xr,mge as xs,o7 as xt,$a as xu,h3 as y,v1 as ya,df as yc,rme as yi,ru as yl,g1 as yn,T0 as yo,d3 as yr,mde as ys,Uue as yt,ao as yu,s3 as z,k$ as za,Wte as zc,rpe as zi,Yc as zl,Ime as zn,b8 as zo,$me as zr,B as zs,A7 as zt,it as zu};
@@ -1 +1 @@
1
- import{Za as e}from"./dist-Dez6tzlv.mjs";import{execFile as t}from"node:child_process";const n=new Set([`http:`,`https:`]),r=/[\u0000-\u0020\u007F-\u009F"'`\\&|<>^()$;{}[\]*?!~]/;function i(e,t){console.warn(`Could not auto-open browser (${t}); visit ${e} manually`)}function a(a){let o;try{o=new URL(a)}catch{i(a,`invalid URL`);return}if(!n.has(o.protocol)){i(a,`unsupported scheme '${o.protocol}'`);return}if(r.test(a)){i(a,`URL contains unsafe characters`);return}let s=process.platform===`darwin`?`open`:process.platform===`win32`?`cmd`:`xdg-open`,c=process.platform===`win32`?[`/c`,`start`,``,a]:[a];t(s,c,e({}),e=>{e&&console.warn(`Could not auto-open browser (${e.message}); visit ${a} manually`)})}export{a as openBrowser};
1
+ import{Za as e}from"./dist-WGEb77w6.mjs";import{execFile as t}from"node:child_process";const n=new Set([`http:`,`https:`]),r=/[\u0000-\u0020\u007F-\u009F"'`\\&|<>^()$;{}[\]*?!~]/;function i(e,t){console.warn(`Could not auto-open browser (${t}); visit ${e} manually`)}function a(a){let o;try{o=new URL(a)}catch{i(a,`invalid URL`);return}if(!n.has(o.protocol)){i(a,`unsupported scheme '${o.protocol}'`);return}if(r.test(a)){i(a,`URL contains unsafe characters`);return}let s=process.platform===`darwin`?`open`:process.platform===`win32`?`cmd`:`xdg-open`,c=process.platform===`win32`?[`/c`,`start`,``,a]:[a];t(s,c,e({}),e=>{e&&console.warn(`Could not auto-open browser (${e.message}); visit ${a} manually`)})}export{a as openBrowser};
@@ -1 +1 @@
1
- import{t as e}from"./md-manager-BGnqyqi1-3pT0cZWk.mjs";import{parentPort as t}from"node:worker_threads";function n(t){try{let n,r;if(t.embedTable!==void 0&&t.sourcePath!==void 0){let e=t.embedTable;r={sourcePath:t.sourcePath,resolveEmbed:t=>e[t]?.path??null,...t.wantSizes?{resolveSize:t=>e[t]?.size??null}:{}}}else if(t.recordEmbeds&&t.sourcePath!==void 0){let e=new Set;n=e,r={sourcePath:t.sourcePath,resolveEmbed:t=>(e.add(t),null),...t.wantSizes?{resolveSize:t=>(e.add(t),null)}:{}}}let i=e.parseWithFallback(t.body,r);return n!==void 0&&n.size>0?{id:t.id,ok:!0,parsedJson:i,requestedTargets:[...n]}:{id:t.id,ok:!0,parsedJson:i}}catch(e){return{id:t.id,ok:!1,message:e instanceof Error?e.message.slice(0,500):String(e).slice(0,500)}}}t?.on(`message`,e=>{t?.postMessage(n(e))});export{};
1
+ import{t as e}from"./md-manager-BGnqyqi1-BnHkV2Y4.mjs";import{parentPort as t}from"node:worker_threads";function n(t){try{let n,r;if(t.embedTable!==void 0&&t.sourcePath!==void 0){let e=t.embedTable;r={sourcePath:t.sourcePath,resolveEmbed:t=>e[t]?.path??null,...t.wantSizes?{resolveSize:t=>e[t]?.size??null}:{}}}else if(t.recordEmbeds&&t.sourcePath!==void 0){let e=new Set;n=e,r={sourcePath:t.sourcePath,resolveEmbed:t=>(e.add(t),null),...t.wantSizes?{resolveSize:t=>(e.add(t),null)}:{}}}let i=e.parseWithFallback(t.body,r);return n!==void 0&&n.size>0?{id:t.id,ok:!0,parsedJson:i,requestedTargets:[...n]}:{id:t.id,ok:!0,parsedJson:i}}catch(e){return{id:t.id,ok:!1,message:e instanceof Error?e.message.slice(0,500):String(e).slice(0,500)}}}t?.on(`message`,e=>{t?.postMessage(n(e))});export{};
@@ -0,0 +1 @@
1
+ import{n as e,t}from"./preview-Dnpx-15V.mjs";export{t as formatPreviewBlock,e as previewContent};
@@ -1,2 +1,2 @@
1
- import{gn as e}from"./dist-Dez6tzlv.mjs";import"./constants-BSVpG0DI.mjs";import{join as t,relative as n}from"node:path";import{existsSync as r,lstatSync as i,readdirSync as a,realpathSync as o,statSync as s}from"node:fs";function c(r){let{projectDir:c,contentDir:l,sampleCap:u=5}=r,d=[],f=[];try{i(l)}catch(e){return{totalCount:0,sample:[],contentDir:l,warnings:[`cannot access content directory ${l}: ${e instanceof Error?e.message:String(e)}`]}}let p;try{p=e({projectDir:c,contentDir:l})}catch(e){return{totalCount:0,sample:[],contentDir:l,warnings:[e instanceof Error?e.message:String(e)]}}function m(e){let r;try{r=a(e,{withFileTypes:!0})}catch(t){let r=t instanceof Error?t.message:String(t);d.push(`could not read directory ${n(l,e)||`.`}: ${r}`);return}for(let i of r){let r=t(e,i.name);if(i.isSymbolicLink()){let e;try{e=o(r)}catch(e){let t=e.code;t===`ENOENT`||t===`ELOOP`?d.push(`broken or cyclic symlink: ${n(l,r)}`):d.push(`cannot resolve symlink ${n(l,r)}: ${t??`unknown error`}`);continue}let t;try{t=s(e)}catch{continue}if(t.isDirectory()){let e=n(l,r);if(p.isDirExcluded(e))continue;m(r)}else if(t.isFile()){let e=n(l,r);if(p.isExcluded(e))continue;f.push(e)}}else if(i.isDirectory()){let e=n(l,r);if(p.isDirExcluded(e))continue;m(r)}else if(i.isFile()){let e=n(l,r);if(p.isExcluded(e))continue;f.push(e)}}}return m(l),{totalCount:f.length,sample:f.slice(0,u),contentDir:l,warnings:d}}function l(e,i){let a=[],o=n(i,e.contentDir),s=o===``?`./`:`./${o}`;if(a.push(`Content:`),a.push(` Found ${e.totalCount} markdown files in ${s}`),e.sample.length>0){let t=e.sample.join(`, `),n=e.totalCount>e.sample.length?`, …`:``;a.push(` Sample: ${t}${n}`)}if(e.warnings.length>0)for(let t of e.warnings)a.push(` Warning: ${t}`);a.push(``);let c=t(i,`.ok`,`config.yml`);return r(c)?(a.push(` To adjust scope, add patterns to .okignore at the project root.`),a.push(` To change the content root, edit .ok/config.yml → content.dir.`)):a.push(" Run `open-knowledge init` to scaffold config + .okignore."),a.push(``),a.push(` Re-check anytime: open-knowledge preview`),a.join(`
1
+ import{gn as e}from"./dist-WGEb77w6.mjs";import"./constants-PI7Uk_9U.mjs";import{join as t,relative as n}from"node:path";import{existsSync as r,lstatSync as i,readdirSync as a,realpathSync as o,statSync as s}from"node:fs";function c(r){let{projectDir:c,contentDir:l,sampleCap:u=5}=r,d=[],f=[];try{i(l)}catch(e){return{totalCount:0,sample:[],contentDir:l,warnings:[`cannot access content directory ${l}: ${e instanceof Error?e.message:String(e)}`]}}let p;try{p=e({projectDir:c,contentDir:l})}catch(e){return{totalCount:0,sample:[],contentDir:l,warnings:[e instanceof Error?e.message:String(e)]}}function m(e){let r;try{r=a(e,{withFileTypes:!0})}catch(t){let r=t instanceof Error?t.message:String(t);d.push(`could not read directory ${n(l,e)||`.`}: ${r}`);return}for(let i of r){let r=t(e,i.name);if(i.isSymbolicLink()){let e;try{e=o(r)}catch(e){let t=e.code;t===`ENOENT`||t===`ELOOP`?d.push(`broken or cyclic symlink: ${n(l,r)}`):d.push(`cannot resolve symlink ${n(l,r)}: ${t??`unknown error`}`);continue}let t;try{t=s(e)}catch{continue}if(t.isDirectory()){let e=n(l,r);if(p.isDirExcluded(e))continue;m(r)}else if(t.isFile()){let e=n(l,r);if(p.isExcluded(e))continue;f.push(e)}}else if(i.isDirectory()){let e=n(l,r);if(p.isDirExcluded(e))continue;m(r)}else if(i.isFile()){let e=n(l,r);if(p.isExcluded(e))continue;f.push(e)}}}return m(l),{totalCount:f.length,sample:f.slice(0,u),contentDir:l,warnings:d}}function l(e,i){let a=[],o=n(i,e.contentDir),s=o===``?`./`:`./${o}`;if(a.push(`Content:`),a.push(` Found ${e.totalCount} markdown files in ${s}`),e.sample.length>0){let t=e.sample.join(`, `),n=e.totalCount>e.sample.length?`, …`:``;a.push(` Sample: ${t}${n}`)}if(e.warnings.length>0)for(let t of e.warnings)a.push(` Warning: ${t}`);a.push(``);let c=t(i,`.ok`,`config.yml`);return r(c)?(a.push(` To adjust scope, add patterns to .okignore at the project root.`),a.push(` To change the content root, edit .ok/config.yml → content.dir.`)):a.push(" Run `open-knowledge init` to scaffold config + .okignore."),a.push(``),a.push(` Re-check anytime: open-knowledge preview`),a.join(`
2
2
  `)}export{c as n,l as t};