@inkeep/open-knowledge 0.77.9-beta.0 → 0.77.9-beta.2

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 (162) hide show
  1. package/dist/{chunk-XKWWSDBF-D2uvTQ0O.mjs → chunk-XKWWSDBF-CiyukTrj.mjs} +2 -2
  2. package/dist/cli.mjs +68 -68
  3. package/dist/config-schema.json +1 -1
  4. package/dist/config.user.schema.json +1 -1
  5. package/dist/constants-D7ISUGXs.mjs +1 -0
  6. package/dist/{dist-gqMlO9g5.mjs → dist-CdMoMubk.mjs} +484 -480
  7. package/dist/{dist-DeiwO3MR.mjs → dist-CupHag_I.mjs} +1 -1
  8. package/dist/{flag-coverage-6JEX67RU-DTi4Xp7_.mjs → flag-coverage-6JEX67RU-Byy8DkC9.mjs} +1 -1
  9. package/dist/index.mjs +213 -213
  10. package/dist/init-BnNTdvEi.mjs +1 -0
  11. package/dist/{init-C-24amuv.mjs → init-Co_mDPzI.mjs} +7 -7
  12. package/dist/{js-exec-VXN6TZ7U-CMKRxSof.mjs → js-exec-VXN6TZ7U-D--44jnh.mjs} +3 -3
  13. package/dist/{js-exec-VXN6TZ7U-DW1z0_f3.mjs → js-exec-VXN6TZ7U-Z8_USGOo.mjs} +4 -4
  14. package/dist/{launch-json-removal-DZGXboeh.mjs → launch-json-removal-BAhghBP0.mjs} +1 -1
  15. package/dist/loader-DpmPmZs_.mjs +1 -0
  16. package/dist/{loader-0WU8op48.mjs → loader-RbdwxE-e.mjs} +1 -1
  17. package/dist/{md-manager-BGnqyqi1-DKflYxqj.mjs → md-manager-BGnqyqi1-RmPtbV-6.mjs} +112 -112
  18. package/dist/{open-browser-Dz6ZNMx3.mjs → open-browser-yaMqhpHT.mjs} +1 -1
  19. package/dist/parse-worker.mjs +1 -1
  20. package/dist/{preview-BSLfKB1h.mjs → preview-D4W9ISBt.mjs} +1 -1
  21. package/dist/preview-h82xr4fS.mjs +1 -0
  22. package/dist/public/assets/{ActivityModeContent-BY6wH-wO.js → ActivityModeContent-BATxSUxv.js} +1 -1
  23. package/dist/public/assets/AddPropertiesButton-Bhz5D_tP.js +2 -0
  24. package/dist/public/assets/{AgentDiffPane-imVcQAvw.js → AgentDiffPane-BcLct3Tk.js} +1 -1
  25. package/dist/public/assets/{AgentIconCluster-CX0heJ76.js → AgentIconCluster-DOtER7-F.js} +1 -1
  26. package/dist/public/assets/{AgentThreadClientBinder-CM_Hnzrg.js → AgentThreadClientBinder-DadOvih9.js} +1 -1
  27. package/dist/public/assets/{BugReportHistory-CpWgA9i6.js → BugReportHistory-D_OEmcqh.js} +1 -1
  28. package/dist/public/assets/{BugReportHistoryDialog-Bh3IoStx.js → BugReportHistoryDialog-ZGMDK7sk.js} +1 -1
  29. package/dist/public/assets/{CodeMirrorPropInput-CKTzBmVA.js → CodeMirrorPropInput-Dvk3snLM.js} +1 -1
  30. package/dist/public/assets/{ConsentDialogBody-Crr37Gw8.js → ConsentDialogBody-CDquCfjj.js} +1 -1
  31. package/dist/public/assets/{DeleteConfirmationDialog-BTQgbqfd.js → DeleteConfirmationDialog-DaZfyQd8.js} +1 -1
  32. package/dist/public/assets/{DiffViewBoundary-8RVTpygC.js → DiffViewBoundary-DbhDbXy8.js} +1 -1
  33. package/dist/public/assets/{DocumentContext-C1m9UXHM.js → DocumentContext-MH9fqXuW.js} +11 -11
  34. package/dist/public/assets/{EditorModeToggle-iQ8C1HyA.js → EditorModeToggle-DClfDUEr.js} +1 -1
  35. package/dist/public/assets/{EnableSyncConfirmDialog-ot1ZDxq3.js → EnableSyncConfirmDialog-Cdv3n1kf.js} +1 -1
  36. package/dist/public/assets/{ExcalidrawDocEditor-YCIaO1FB.js → ExcalidrawDocEditor-DngKrGvf.js} +1 -1
  37. package/dist/public/assets/FeedbackForm-XP78idFj.js +1 -0
  38. package/dist/public/assets/{GraphPanel-C3eHn4gW.js → GraphPanel--beNjRT-.js} +1 -1
  39. package/dist/public/assets/{ImageAttachments-DSlR8TcI.js → ImageAttachments-CIihp_JJ.js} +1 -1
  40. package/dist/public/assets/{ImportSkillDialog-CkAJnfOt.js → ImportSkillDialog-DFsIu8AB.js} +1 -1
  41. package/dist/public/assets/{LintConfigEditor-IydG9Wjj.js → LintConfigEditor-OucnKI9n.js} +1 -1
  42. package/dist/public/assets/{ManagedArtifactProperties-BftkuLdv.js → ManagedArtifactProperties-CJpHReke.js} +1 -1
  43. package/dist/public/assets/ManagedArtifactProperties-dVdeWrTE.js +1 -0
  44. package/dist/public/assets/{MermaidDocEditor-BWUuY8HN.js → MermaidDocEditor-DAQKQTIg.js} +1 -1
  45. package/dist/public/assets/{OpenInAgentMenuItem-BAwvIzLB.js → OpenInAgentMenuItem-BzgmEFwX.js} +1 -1
  46. package/dist/public/assets/{PropertyDisplayRow-Uu4HftXO.js → PropertyDisplayRow-CR4LTYHm.js} +1 -1
  47. package/dist/public/assets/{RegisteredAgentIcon-9VM9CSSM.js → RegisteredAgentIcon-2cwevuRg.js} +1 -1
  48. package/dist/public/assets/{ReportBugDialogBody-DpKnchmQ.js → ReportBugDialogBody-B4etLNwK.js} +1 -1
  49. package/dist/public/assets/{ReportBugMenuTrigger-DSs8yLxa.js → ReportBugMenuTrigger-Bc5z0-Fu.js} +2 -2
  50. package/dist/public/assets/{SchemaConfigEditor-59CZ81RK.js → SchemaConfigEditor-DfMcNdGA.js} +1 -1
  51. package/dist/public/assets/{SessionsHost-BGDWcekB.js → SessionsHost-DS7-1kuO.js} +2 -2
  52. package/dist/public/assets/SettingsDialogBody-BFPgfIw-.js +12 -0
  53. package/dist/public/assets/{ShareBranchSwitchDialog-CTDAYuOX.js → ShareBranchSwitchDialog-CGaCBOnF.js} +1 -1
  54. package/dist/public/assets/{ShareReceiveDialog-Cuf5ASDY.js → ShareReceiveDialog-DFRKvuQJ.js} +1 -1
  55. package/dist/public/assets/{ShareReceiveMissDialog-XYo17yEk.js → ShareReceiveMissDialog-BXrtIcx4.js} +1 -1
  56. package/dist/public/assets/{SkillCostValue-BE6EBNfT.js → SkillCostValue-CaXVQav1.js} +1 -1
  57. package/dist/public/assets/{SkillEditBanner-BycfTypX.js → SkillEditBanner-D_7WTsJ7.js} +1 -1
  58. package/dist/public/assets/{SkillForkDialog-SINB-id1.js → SkillForkDialog-DQQGuXv8.js} +1 -1
  59. package/dist/public/assets/{SkillInstallMenu-6CFDq4BF.js → SkillInstallMenu-UGZNOesd.js} +1 -1
  60. package/dist/public/assets/{SkillOriginInline-Cgl8RIR-.js → SkillOriginInline-wHAllLhh.js} +1 -1
  61. package/dist/public/assets/{SkillToolbarControls-BK_AaeoX.js → SkillToolbarControls-dPfL3r5J.js} +1 -1
  62. package/dist/public/assets/{SlidesToolbarControls-60y5ydf2.js → SlidesToolbarControls-C_5MgL5R.js} +1 -1
  63. package/dist/public/assets/{SourceEditor-CBrv7dJo.js → SourceEditor-DgBYiBut.js} +1 -1
  64. package/dist/public/assets/{TerminalPanel-Bkzcs2Nj.js → TerminalPanel-CXjN_98-.js} +3 -3
  65. package/dist/public/assets/{TerminalWindowApp-D0A8V7Nm.js → TerminalWindowApp-CQzuZYuY.js} +1 -1
  66. package/dist/public/assets/{TextDocEditor-C6ucmNYD.js → TextDocEditor-Gj93hBqH.js} +1 -1
  67. package/dist/public/assets/ThreadView-C7sqK0is.js +21 -0
  68. package/dist/public/assets/{TimelineDiffPane-L_Q3Y78K.js → TimelineDiffPane-CRlgrJ2D.js} +1 -1
  69. package/dist/public/assets/{agent-connection-status-BgT1U0id.js → agent-connection-status-DSp5AbZq.js} +1 -1
  70. package/dist/public/assets/{auth-state-cache-NYgkVRT6.js → auth-state-cache-CglXQ28p.js} +1 -1
  71. package/dist/public/assets/{bug-report-send-manager-Bmqwf2M5.js → bug-report-send-manager-IdWBPFHN.js} +1 -1
  72. package/dist/public/assets/{client-version-DR53JJn2.js → client-version-Cfeq3w2f.js} +1 -1
  73. package/dist/public/assets/{comment-chips-DeBWzeAe.js → comment-chips-BDBYUGDo.js} +1 -1
  74. package/dist/public/assets/{config-provider-DiJSKkg8.js → config-provider-CB8Idy6z.js} +1 -1
  75. package/dist/public/assets/{css-color-to-hex-wMBAsSG3.js → css-color-to-hex-CMHRbt5X.js} +1 -1
  76. package/dist/public/assets/{diagnostic-breadcrumb-BjDNQhui.js → diagnostic-breadcrumb-DtVIthxV.js} +1 -1
  77. package/dist/public/assets/{dist-C_owXiVJ.js → dist-DDq2bd0-.js} +11 -11
  78. package/dist/public/assets/{doc-paths-dCv8glmi.js → doc-paths-CWMCOiOb.js} +1 -1
  79. package/dist/public/assets/{doc-undo-manager-CLhUJl8z.js → doc-undo-manager-Dgd_R1wH.js} +1 -1
  80. package/dist/public/assets/{documents-events-ByK-A_Qe.js → documents-events-BNOxHubi.js} +1 -1
  81. package/dist/public/assets/{file-tree-adapter-CrD2Zh_o.js → file-tree-adapter-CQyVXMVG.js} +1 -1
  82. package/dist/public/assets/{file-tree-utils-elC-lbdd.js → file-tree-utils-BgnPOQNb.js} +1 -1
  83. package/dist/public/assets/{folder-config-api-C6_l3om9.js → folder-config-api-CnTUk9rh.js} +1 -1
  84. package/dist/public/assets/{index-MPigSfWz.js → index-C-M9IPeM.js} +18 -18
  85. package/dist/public/assets/{launch-agent-thread-BTIPj2wd.js → launch-agent-thread-CE4umI5d.js} +1 -1
  86. package/dist/public/assets/{lint-config-client-DBFw6OHC.js → lint-config-client-D_KJIdJ0.js} +1 -1
  87. package/dist/public/assets/{markdownlint-rule-browser-BoWbwkTH.js → markdownlint-rule-browser-Dbi_T41A.js} +1 -1
  88. package/dist/public/assets/{messages-Dh8tUASl.js → messages-BBniyOLF.js} +1 -1
  89. package/dist/public/assets/{messages-DFb3Vzg0.js → messages-C-1V9628.js} +1 -1
  90. package/dist/public/assets/{messages-B2R3Y06g.js → messages-C-ujGeuR.js} +1 -1
  91. package/dist/public/assets/{messages-T88bnbcm.js → messages-CK2HIOIp.js} +1 -1
  92. package/dist/public/assets/{messages-BDBEmoWh.js → messages-CNb9VVVF.js} +1 -1
  93. package/dist/public/assets/{messages-Cu3nrgO4.js → messages-CP9Uo9SK.js} +1 -1
  94. package/dist/public/assets/{messages-CN6bx_s-.js → messages-CXQO0cdG.js} +1 -1
  95. package/dist/public/assets/{messages-y3Nv7XrJ.js → messages-CduVnYUK.js} +1 -1
  96. package/dist/public/assets/{messages-hVCpOrm3.js → messages-CzRStuhZ.js} +1 -1
  97. package/dist/public/assets/{messages-CbSNKie_.js → messages-DlYEa7go.js} +1 -1
  98. package/dist/public/assets/{messages-NQv6lBnJ.js → messages-Dmkb0uPj.js} +1 -1
  99. package/dist/public/assets/{messages-WhrJ5T4P.js → messages-G0BZY30Q.js} +1 -1
  100. package/dist/public/assets/{navigation-targets-CvNinRyp.js → navigation-targets-Czs2lfGZ.js} +1 -1
  101. package/dist/public/assets/{page-list-cache-DvhqPgdF.js → page-list-cache-C-TRKOCs.js} +1 -1
  102. package/dist/public/assets/{pending-receive-nav-store-o2g0a-Bn.js → pending-receive-nav-store-DU0fd5HG.js} +1 -1
  103. package/dist/public/assets/{preferred-session-events-K_HaJMAn.js → preferred-session-events-DmNk8hX1.js} +1 -1
  104. package/dist/public/assets/{progress-CkEBTFSF.js → progress-92g2HE0r.js} +3 -3
  105. package/dist/public/assets/{project-paths-BzuFAe-N.js → project-paths-D5u5ETp2.js} +1 -1
  106. package/dist/public/assets/{prop-types-DI-i5R8d.js → prop-types-DrIWG3Gx.js} +1 -1
  107. package/dist/public/assets/{receive-store-Djrqwgcm.js → receive-store-KjyHtK2Z.js} +1 -1
  108. package/dist/public/assets/{selection-context-DzTEr8je.js → selection-context-Dr8Dwtss.js} +1 -1
  109. package/dist/public/assets/{skill-scope-BnHkWlIp.js → skill-scope-PQ-EaBPe.js} +1 -1
  110. package/dist/public/assets/{skills-api-C9lYknem.js → skills-api-Bp10td_R.js} +1 -1
  111. package/dist/public/assets/{src-DWAR0qhq.js → src-D45teqFC.js} +1 -1
  112. package/dist/public/assets/{startup-marks--VxxzHYd.js → startup-marks-CrtY-I8L.js} +1 -1
  113. package/dist/public/assets/{tag-pill-input-L67HH_ro.js → tag-pill-input-ChT0p3uH.js} +1 -1
  114. package/dist/public/assets/{target-navigation-intent-DAHHkidf.js → target-navigation-intent-Dxn3CEpi.js} +1 -1
  115. package/dist/public/assets/{telemetry-startup-DhtP83qd.js → telemetry-startup-CNWCAxA7.js} +1 -1
  116. package/dist/public/assets/{terminal-command-events-DonTra6W.js → terminal-command-events-BtEB1nJF.js} +1 -1
  117. package/dist/public/assets/{terminal-launch-events-C87UeOVG.js → terminal-launch-events-z128lGYy.js} +1 -1
  118. package/dist/public/assets/{terminal-telemetry-rnrKpL-Q.js → terminal-telemetry-DWYzbPMs.js} +1 -1
  119. package/dist/public/assets/thread-client-DWy51KvB.js +3 -0
  120. package/dist/public/assets/{typing-burst-detector-BLuUdN-d.js → typing-burst-detector-C5hbfIC1.js} +1 -1
  121. package/dist/public/assets/{uninstall-Bnt3uUvy.js → uninstall-BJ0ruD6y.js} +1 -1
  122. package/dist/public/assets/{use-activity-panel-DhnfRmuH.js → use-activity-panel-B0hBttlz.js} +1 -1
  123. package/dist/public/assets/{use-apply-config-language-ChGKbbl6.js → use-apply-config-language-B0buol98.js} +2 -2
  124. package/dist/public/assets/{use-collab-url-DnDtI_86.js → use-collab-url-oh5407bM.js} +1 -1
  125. package/dist/public/assets/{use-conflicts-DYvfJWip.js → use-conflicts-DlwnAZby.js} +1 -1
  126. package/dist/public/assets/{use-live-xterm-theme-BDq8DzaU.js → use-live-xterm-theme-kTh86ROJ.js} +1 -1
  127. package/dist/public/assets/{use-open-skill-BK-vnG6-.js → use-open-skill-CfG5l4pa.js} +1 -1
  128. package/dist/public/assets/{use-settings-route-8XQTWK31.js → use-settings-route-kXDIfwuP.js} +1 -1
  129. package/dist/public/assets/{use-skill-origin-B1YmBhKN.js → use-skill-origin-nNSEYBhk.js} +1 -1
  130. package/dist/public/assets/{use-skills-CYMgz3tV.js → use-skills-BjbaVkdM.js} +1 -1
  131. package/dist/public/assets/{use-terminal-enabled-DYkPSupQ.js → use-terminal-enabled-Bz_EEFKW.js} +1 -1
  132. package/dist/public/assets/{use-timeline-entry-diff-CNgx0eFH.js → use-timeline-entry-diff-CxWiRlcf.js} +1 -1
  133. package/dist/public/assets/{use-workspace-TNZRqr22.js → use-workspace-B5fRmw0K.js} +1 -1
  134. package/dist/public/index.html +58 -58
  135. package/dist/public/uninstall.html +4 -4
  136. package/dist/{python3-DNGS4G3E-Dpff_XiH.mjs → python3-DNGS4G3E-CRyO5yp1.mjs} +2 -2
  137. package/dist/{python3-DNGS4G3E-DSWx_2Ia.mjs → python3-DNGS4G3E-CixyRGKv.mjs} +3 -3
  138. package/dist/registry-probes-BjsDFB65.mjs +17 -0
  139. package/dist/{removal-file-path-BXR6pfkp.mjs → removal-file-path-D6OEqNBM.mjs} +1 -1
  140. package/dist/{repair-launch-json-DP6KyVNN.mjs → repair-launch-json-BLnKg19X.mjs} +1 -1
  141. package/dist/{repair-mcp-configs-B4GpHKFe.mjs → repair-mcp-configs-hy238Kt4.mjs} +1 -1
  142. package/dist/schemas/v0/config.user.schema.json +1 -1
  143. package/dist/{sqlite3-TE5AIOTF-ButYCorg.mjs → sqlite3-TE5AIOTF-BK092fD6.mjs} +1 -1
  144. package/dist/{sqlite3-TE5AIOTF-D4yhY7wL.mjs → sqlite3-TE5AIOTF-DVwda1Ow.mjs} +3 -3
  145. package/dist/src-DUyBP196.mjs +1 -0
  146. package/dist/{src-BY955T7w.mjs → src-tuHpjXRh.mjs} +4 -4
  147. package/dist/start-BWVT5n3j.mjs +1 -0
  148. package/dist/{start-YF7-qdEa.mjs → start-DWDyuoi5.mjs} +3 -3
  149. package/package.json +4 -4
  150. package/dist/constants-CdiHNFvt.mjs +0 -1
  151. package/dist/init-BNRf8IKE.mjs +0 -1
  152. package/dist/loader-0rF9tfd3.mjs +0 -1
  153. package/dist/preview-CvKb1PXt.mjs +0 -1
  154. package/dist/public/assets/AddPropertiesButton-C09dSw6a.js +0 -2
  155. package/dist/public/assets/FeedbackForm-CDTuiQCm.js +0 -1
  156. package/dist/public/assets/ManagedArtifactProperties-Biuoihpn.js +0 -1
  157. package/dist/public/assets/SettingsDialogBody-BZT6pxq7.js +0 -12
  158. package/dist/public/assets/ThreadView-BIIMjhFk.js +0 -20
  159. package/dist/public/assets/thread-client-BS0s_MKD.js +0 -4
  160. package/dist/registry-probes-CADyDcpU.mjs +0 -17
  161. package/dist/src-DYZb5r4K.mjs +0 -1
  162. package/dist/start-C-EE421o.mjs +0 -1
@@ -1,7 +1,7 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./markdownit-CugClK-K.js","./chunk-CYidjpOJ.js"])))=>i.map(i=>d[i]);
2
- import{a as e,i as t,n,o as r,r as i,t as a}from"./chunk-CYidjpOJ.js";import{t as o}from"./preload-helper-Chd9yIcd.js";import{n as s,t as c}from"./trace-api-BP9dN1Hz.js";import{A as l,C as u,D as d,E as f,F as p,G as m,H as h,I as g,J as _,K as v,L as y,M as b,N as x,O as S,P as C,R as w,S as ee,T,U as E,V as te,X as ne,Y as re,_ as ie,a as ae,at as oe,b as se,c as ce,d as le,f as D,g as ue,h as de,i as fe,it as O,j as k,k as pe,l as me,m as he,n as ge,o as _e,p as ve,q as ye,s as be,t as xe,tt as Se,u as Ce,v as we,w as Te,x as Ee,y as De}from"./lib-CPkc7nK4.js";import{n as Oe,t as ke}from"./w3c-keyname-C7Rznu6R.js";import{i as Ae,n as je,r as Me}from"./html-void-elements-zEl0KGqf.js";import{n as Ne,r as Pe,t as Fe}from"./lib-DmueaA5E.js";import{n as Ie,t as Le}from"./markdownit-CugClK-K.js";var Re=[`claude`,`claude-desktop`,`cursor`,`codex`,`copilot`,`opencode`,`openclaw`,`pi`,`antigravity`,`lm-studio`,`hermes`],ze={claude:`Claude`,"claude-desktop":`Claude Desktop`,cursor:`Cursor`,codex:`Codex`,copilot:`GitHub Copilot`,opencode:`OpenCode`,openclaw:`OpenClaw`,pi:`Pi`,antigravity:`Antigravity`,"lm-studio":`LM Studio`,hermes:`Hermes`},Be={claude:`.claude/skills`,"claude-desktop":null,cursor:`.cursor/skills`,codex:`.codex/skills`,copilot:`.github/skills`,opencode:`.opencode/skills`,openclaw:null,pi:`.pi/skills`,antigravity:null,"lm-studio":null,hermes:null},Ve={claude:`.claude/skills`,"claude-desktop":null,cursor:`.cursor/skills`,codex:`.codex/skills`,copilot:`.copilot/skills`,opencode:`.opencode/skills`,openclaw:null,pi:`.pi/agent/skills`,antigravity:`.gemini/skills`,"lm-studio":`.lmstudio/skills`,hermes:null},He=Re.filter(e=>Be[e]!==null),Ue=Re.filter(e=>Ve[e]!==null),We=`open-knowledge`;Re.flatMap(e=>{let t=Be[e];return t===null?[]:[`${t}/${We}/`]}),He.filter(e=>e!==`pi`&&e!==`copilot`).map(e=>({hostDir:(Be[e]??``).split(`/`)[0],editorId:e})),Re.flatMap(e=>{let t=Ve[e];if(t===null)return[];let n=t.split(`/`)[0];return n===void 0?[]:[{hostDir:n,skillsRoot:t,editorId:e}]});var Ge={claude:`claude-code`,"claude-desktop":`claude-code`,cursor:`cursor`,codex:`codex`,copilot:`github-copilot-cli`,opencode:`opencode`,openclaw:`openclaw`,pi:`pi`,antigravity:`antigravity`,"lm-studio":`lm-studio`,hermes:`hermes`},Ke={claude:`.mcp.json`,"claude-desktop":null,cursor:`.cursor/mcp.json`,codex:`.codex/config.toml`,copilot:null,opencode:`opencode.json`,openclaw:null,pi:`.pi/extensions/open-knowledge.ts`,antigravity:null,"lm-studio":null,hermes:null},qe=[`copilot`];function Je(e,t){return Ke[e]===null?Be[e]===null?!1:!qe.includes(e)||t.userMcpEntryInstalled:!0}var Ye;function A(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,`_zod`,{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,`name`,{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,`init`,{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,`name`,{value:e}),o}var Xe=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Ze=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Ye=globalThis).__zod_globalConfig??(Ye.__zod_globalConfig={});var Qe=globalThis.__zod_globalConfig;function $e(e){return e&&Object.assign(Qe,e),Qe}function et(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function tt(e,t){return typeof t==`bigint`?t.toString():t}function nt(e){return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}throw Error(`cached value already set`)}}}function rt(e){return e==null}function it(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function at(e,t){let n=e/t,r=Math.round(n),i=2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}var ot=Symbol(`evaluating`);function st(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==ot)return r===void 0&&(r=ot,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function ct(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function lt(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function ut(e){return JSON.stringify(e)}function dt(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var ft=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function pt(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var mt=nt(()=>{if(Qe.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function ht(e){if(pt(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(pt(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function gt(e){return ht(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var _t=new Set([`string`,`number`,`symbol`]);function vt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function yt(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function j(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function bt(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var xt={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function St(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return yt(e,lt(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return ct(this,`shape`,e),e},checks:[]}))}function eee(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return yt(e,lt(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return ct(this,`shape`,r),r},checks:[]}))}function tee(e,t){if(!ht(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return yt(e,lt(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return ct(this,`shape`,n),n}}))}function nee(e,t){if(!ht(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return yt(e,lt(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return ct(this,`shape`,n),n}}))}function ree(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return yt(e,lt(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return ct(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function Ct(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return yt(t,lt(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return ct(this,`shape`,i),i},checks:[]}))}function wt(e,t,n){return yt(t,lt(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return ct(this,`shape`,i),i}}))}function Tt(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Et(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Dt(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Ot(e){return typeof e==`string`?e:e?.message}function kt(e,t,n){let r=e.message?e.message:Ot(e.inst?._zod.def?.error?.(e))??Ot(t?.error?.(e))??Ot(n.customError?.(e))??Ot(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function At(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function jt(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var Mt=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,`_zod`,{value:e._zod,enumerable:!1}),Object.defineProperty(e,`issues`,{value:t,enumerable:!1}),e.message=JSON.stringify(t,tt,2),Object.defineProperty(e,`toString`,{value:()=>e.message,enumerable:!1})},Nt=A(`$ZodError`,Mt),Pt=A(`$ZodError`,Mt,{Parent:Error});function Ft(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function iee(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n}var It=e=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new Xe;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>kt(e,a,$e())));throw ft(t,i?.callee),t}return o.value},aee=It(Pt),Lt=e=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>kt(e,a,$e())));throw ft(t,i?.callee),t}return o.value},oee=Lt(Pt),Rt=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new Xe;return a.issues.length?{success:!1,error:new(e??Nt)(a.issues.map(e=>kt(e,i,$e())))}:{success:!0,data:a.value}},see=Rt(Pt),zt=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>kt(e,i,$e())))}:{success:!0,data:a.value}},cee=zt(Pt),lee=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return It(e)(t,n,i)},uee=e=>(t,n,r)=>It(e)(t,n,r),dee=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Lt(e)(t,n,i)},fee=e=>async(t,n,r)=>Lt(e)(t,n,r),pee=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Rt(e)(t,n,i)},mee=e=>(t,n,r)=>Rt(e)(t,n,r),hee=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return zt(e)(t,n,i)},gee=e=>async(t,n,r)=>zt(e)(t,n,r),_ee=/^[cC][0-9a-z]{6,}$/,vee=/^[0-9a-z]+$/,yee=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,bee=/^[0-9a-vA-V]{20}$/,xee=/^[A-Za-z0-9]{27}$/,See=/^[a-zA-Z0-9_-]{21}$/,Cee=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Bt=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Vt=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Ht=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Ut=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function Wt(){return new RegExp(Ut,`u`)}var Gt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Kt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,qt=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Jt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Yt=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Xt=/^[A-Za-z0-9_-]*$/,Zt=/^https?$/,Qt=/^\+[1-9]\d{6,14}$/,$t=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,en=RegExp(`^${$t}$`);function tn(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function nn(e){return RegExp(`^${tn(e)}$`)}function rn(e){let t=tn({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${$t}T(?:${r})$`)}var an=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},on=/^-?\d+$/,sn=/^-?\d+(?:\.\d+)?$/,cn=/^(?:true|false)$/i,ln=/^null$/i,un=/^[^A-Z]*$/,dn=/^[^a-z]*$/,fn=A(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),pn={number:`number`,bigint:`bigint`,object:`date`},mn=A(`$ZodCheckLessThan`,(e,t)=>{fn.init(e,t);let n=pn[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),hn=A(`$ZodCheckGreaterThan`,(e,t)=>{fn.init(e,t);let n=pn[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),gn=A(`$ZodCheckMultipleOf`,(e,t)=>{fn.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):at(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),_n=A(`$ZodCheckNumberFormat`,(e,t)=>{fn.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=xt[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=on)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),vn=A(`$ZodCheckMaxLength`,(e,t)=>{var n;fn.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!rt(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=At(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),yn=A(`$ZodCheckMinLength`,(e,t)=>{var n;fn.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!rt(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=At(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),bn=A(`$ZodCheckLengthEquals`,(e,t)=>{var n;fn.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!rt(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=At(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),xn=A(`$ZodCheckStringFormat`,(e,t)=>{var n,r;fn.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Sn=A(`$ZodCheckRegex`,(e,t)=>{xn.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Cn=A(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=un,xn.init(e,t)}),wn=A(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=dn,xn.init(e,t)}),Tn=A(`$ZodCheckIncludes`,(e,t)=>{fn.init(e,t);let n=vt(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),En=A(`$ZodCheckStartsWith`,(e,t)=>{fn.init(e,t);let n=RegExp(`^${vt(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Dn=A(`$ZodCheckEndsWith`,(e,t)=>{fn.init(e,t);let n=RegExp(`.*${vt(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),On=A(`$ZodCheckOverwrite`,(e,t)=>{fn.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),kn=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
2
+ import{a as e,i as t,n,o as r,r as i,t as a}from"./chunk-CYidjpOJ.js";import{t as o}from"./preload-helper-Chd9yIcd.js";import{n as s,t as c}from"./trace-api-BP9dN1Hz.js";import{A as l,C as u,D as d,E as f,F as p,G as m,H as h,I as g,J as _,K as v,L as y,M as b,N as x,O as S,P as C,R as w,S as ee,T,U as E,V as te,X as ne,Y as re,_ as ie,a as ae,at as oe,b as se,c as ce,d as le,f as D,g as ue,h as de,i as fe,it as O,j as k,k as pe,l as me,m as he,n as ge,o as _e,p as ve,q as ye,s as be,t as xe,tt as Se,u as Ce,v as we,w as Te,x as Ee,y as De}from"./lib-CPkc7nK4.js";import{n as Oe,t as ke}from"./w3c-keyname-C7Rznu6R.js";import{i as Ae,n as je,r as Me}from"./html-void-elements-zEl0KGqf.js";import{n as Ne,r as Pe,t as Fe}from"./lib-DmueaA5E.js";import{n as Ie,t as Le}from"./markdownit-CugClK-K.js";var Re=[`claude`,`claude-desktop`,`cursor`,`codex`,`copilot`,`opencode`,`openclaw`,`pi`,`antigravity`,`lm-studio`,`hermes`],ze={claude:`Claude`,"claude-desktop":`Claude Desktop`,cursor:`Cursor`,codex:`Codex`,copilot:`GitHub Copilot`,opencode:`OpenCode`,openclaw:`OpenClaw`,pi:`Pi`,antigravity:`Antigravity`,"lm-studio":`LM Studio`,hermes:`Hermes`},Be={claude:`.claude/skills`,"claude-desktop":null,cursor:`.cursor/skills`,codex:`.codex/skills`,copilot:`.github/skills`,opencode:`.opencode/skills`,openclaw:null,pi:`.pi/skills`,antigravity:null,"lm-studio":null,hermes:null},Ve={claude:`.claude/skills`,"claude-desktop":null,cursor:`.cursor/skills`,codex:`.codex/skills`,copilot:`.copilot/skills`,opencode:`.opencode/skills`,openclaw:null,pi:`.pi/agent/skills`,antigravity:`.gemini/skills`,"lm-studio":`.lmstudio/skills`,hermes:null},He=Re.filter(e=>Be[e]!==null),Ue=Re.filter(e=>Ve[e]!==null),We=`open-knowledge`;Re.flatMap(e=>{let t=Be[e];return t===null?[]:[`${t}/${We}/`]}),He.filter(e=>e!==`pi`&&e!==`copilot`).map(e=>({hostDir:(Be[e]??``).split(`/`)[0],editorId:e})),Re.flatMap(e=>{let t=Ve[e];if(t===null)return[];let n=t.split(`/`)[0];return n===void 0?[]:[{hostDir:n,skillsRoot:t,editorId:e}]});var Ge={claude:`claude-code`,"claude-desktop":`claude-code`,cursor:`cursor`,codex:`codex`,copilot:`github-copilot-cli`,opencode:`opencode`,openclaw:`openclaw`,pi:`pi`,antigravity:`antigravity`,"lm-studio":`lm-studio`,hermes:`hermes`},Ke={claude:`.mcp.json`,"claude-desktop":null,cursor:`.cursor/mcp.json`,codex:`.codex/config.toml`,copilot:null,opencode:`opencode.json`,openclaw:null,pi:`.pi/extensions/open-knowledge.ts`,antigravity:null,"lm-studio":null,hermes:null},eee=[`copilot`];function qe(e,t){return Ke[e]===null?Be[e]===null?!1:!eee.includes(e)||t.userMcpEntryInstalled:!0}var Je=`open-knowledge`,tee=`Server unreachable:`,nee=`Server timed out:`,Ye=[`exec`,`search`,`history`,`links`,`skills`,`config`,`palette`,`preview_url`,`share_link`,`lint`,`audit`,`write`,`edit`,`delete`,`move`,`install`,`import`,`checkpoint`,`restore_version`,`conflicts`,`resolve_conflict`],Xe=[`write`,`edit`,`delete`,`move`,`install`,`import`,`checkpoint`,`restore_version`,`resolve_conflict`],Ze;function A(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,`_zod`,{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,`name`,{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,`init`,{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,`name`,{value:e}),o}var Qe=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},$e=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Ze=globalThis).__zod_globalConfig??(Ze.__zod_globalConfig={});var et=globalThis.__zod_globalConfig;function tt(e){return e&&Object.assign(et,e),et}function nt(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function rt(e,t){return typeof t==`bigint`?t.toString():t}function it(e){return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}throw Error(`cached value already set`)}}}function at(e){return e==null}function ot(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function st(e,t){let n=e/t,r=Math.round(n),i=2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}var ct=Symbol(`evaluating`);function lt(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==ct)return r===void 0&&(r=ct,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function ut(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function dt(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function ft(e){return JSON.stringify(e)}function pt(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var mt=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function ht(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var gt=it(()=>{if(et.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function _t(e){if(ht(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(ht(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function vt(e){return _t(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var ree=new Set([`string`,`number`,`symbol`]);function yt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function bt(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function j(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function iee(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var aee={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function oee(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return bt(e,dt(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return ut(this,`shape`,e),e},checks:[]}))}function xt(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return bt(e,dt(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return ut(this,`shape`,r),r},checks:[]}))}function St(e,t){if(!_t(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return bt(e,dt(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return ut(this,`shape`,n),n}}))}function Ct(e,t){if(!_t(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return bt(e,dt(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return ut(this,`shape`,n),n}}))}function wt(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return bt(e,dt(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return ut(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function Tt(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return bt(t,dt(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return ut(this,`shape`,i),i},checks:[]}))}function Et(e,t,n){return bt(t,dt(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return ut(this,`shape`,i),i}}))}function Dt(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Ot(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function kt(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function At(e){return typeof e==`string`?e:e?.message}function jt(e,t,n){let r=e.message?e.message:At(e.inst?._zod.def?.error?.(e))??At(t?.error?.(e))??At(n.customError?.(e))??At(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function Mt(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Nt(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var Pt=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,`_zod`,{value:e._zod,enumerable:!1}),Object.defineProperty(e,`issues`,{value:t,enumerable:!1}),e.message=JSON.stringify(t,rt,2),Object.defineProperty(e,`toString`,{value:()=>e.message,enumerable:!1})},Ft=A(`$ZodError`,Pt),It=A(`$ZodError`,Pt,{Parent:Error});function see(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function cee(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n}var Lt=e=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new Qe;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>jt(e,a,tt())));throw mt(t,i?.callee),t}return o.value},lee=Lt(It),Rt=e=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>jt(e,a,tt())));throw mt(t,i?.callee),t}return o.value},uee=Rt(It),zt=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new Qe;return a.issues.length?{success:!1,error:new(e??Ft)(a.issues.map(e=>jt(e,i,tt())))}:{success:!0,data:a.value}},dee=zt(It),Bt=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>jt(e,i,tt())))}:{success:!0,data:a.value}},fee=Bt(It),pee=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Lt(e)(t,n,i)},mee=e=>(t,n,r)=>Lt(e)(t,n,r),hee=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Rt(e)(t,n,i)},gee=e=>async(t,n,r)=>Rt(e)(t,n,r),_ee=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return zt(e)(t,n,i)},vee=e=>(t,n,r)=>zt(e)(t,n,r),yee=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Bt(e)(t,n,i)},bee=e=>async(t,n,r)=>Bt(e)(t,n,r),xee=/^[cC][0-9a-z]{6,}$/,See=/^[0-9a-z]+$/,Cee=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Vt=/^[0-9a-vA-V]{20}$/,Ht=/^[A-Za-z0-9]{27}$/,Ut=/^[a-zA-Z0-9_-]{21}$/,Wt=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Gt=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Kt=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,qt=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Jt=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function Yt(){return new RegExp(Jt,`u`)}var Xt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Zt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Qt=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,$t=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,en=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,tn=/^[A-Za-z0-9_-]*$/,nn=/^https?$/,rn=/^\+[1-9]\d{6,14}$/,an=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,on=RegExp(`^${an}$`);function sn(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function cn(e){return RegExp(`^${sn(e)}$`)}function ln(e){let t=sn({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${an}T(?:${r})$`)}var un=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},dn=/^-?\d+$/,fn=/^-?\d+(?:\.\d+)?$/,pn=/^(?:true|false)$/i,mn=/^null$/i,hn=/^[^A-Z]*$/,gn=/^[^a-z]*$/,_n=A(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),vn={number:`number`,bigint:`bigint`,object:`date`},yn=A(`$ZodCheckLessThan`,(e,t)=>{_n.init(e,t);let n=vn[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),bn=A(`$ZodCheckGreaterThan`,(e,t)=>{_n.init(e,t);let n=vn[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),xn=A(`$ZodCheckMultipleOf`,(e,t)=>{_n.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):st(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Sn=A(`$ZodCheckNumberFormat`,(e,t)=>{_n.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=aee[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=dn)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),Cn=A(`$ZodCheckMaxLength`,(e,t)=>{var n;_n.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!at(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=Mt(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),wn=A(`$ZodCheckMinLength`,(e,t)=>{var n;_n.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!at(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=Mt(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Tn=A(`$ZodCheckLengthEquals`,(e,t)=>{var n;_n.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!at(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=Mt(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),En=A(`$ZodCheckStringFormat`,(e,t)=>{var n,r;_n.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Dn=A(`$ZodCheckRegex`,(e,t)=>{En.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),On=A(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=hn,En.init(e,t)}),kn=A(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=gn,En.init(e,t)}),An=A(`$ZodCheckIncludes`,(e,t)=>{_n.init(e,t);let n=yt(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),jn=A(`$ZodCheckStartsWith`,(e,t)=>{_n.init(e,t);let n=RegExp(`^${yt(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Mn=A(`$ZodCheckEndsWith`,(e,t)=>{_n.init(e,t);let n=RegExp(`.*${yt(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Nn=A(`$ZodCheckOverwrite`,(e,t)=>{_n.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),Pn=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
3
3
  `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
4
- `))}},An={major:4,minor:4,patch:3},jn=A(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=An;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=Tt(e),i;for(let a of t){if(a._zod.def.when){if(Et(e)||!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new Xe;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=Tt(e,t))});else{if(e.issues.length===t)continue;r||=Tt(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(Tt(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new Xe;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new Xe;return o.then(e=>t(e,r,a))}return t(o,r,a)}}st(e,`~standard`,()=>({validate:t=>{try{let n=see(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return cee(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),Mn=A(`$ZodString`,(e,t)=>{jn.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??an(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),Nn=A(`$ZodStringFormat`,(e,t)=>{xn.init(e,t),Mn.init(e,t)}),Pn=A(`$ZodGUID`,(e,t)=>{t.pattern??=Bt,Nn.init(e,t)}),Fn=A(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=Vt(e)}else t.pattern??=Vt();Nn.init(e,t)}),In=A(`$ZodEmail`,(e,t)=>{t.pattern??=Ht,Nn.init(e,t)}),Ln=A(`$ZodURL`,(e,t)=>{Nn.init(e,t),e._zod.check=n=>{try{let r=n.value.trim();if(!t.normalize&&t.protocol?.source===Zt.source&&!/^https?:\/\//i.test(r)){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}let i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Rn=A(`$ZodEmoji`,(e,t)=>{t.pattern??=Wt(),Nn.init(e,t)}),zn=A(`$ZodNanoID`,(e,t)=>{t.pattern??=See,Nn.init(e,t)}),Bn=A(`$ZodCUID`,(e,t)=>{t.pattern??=_ee,Nn.init(e,t)}),Vn=A(`$ZodCUID2`,(e,t)=>{t.pattern??=vee,Nn.init(e,t)}),Hn=A(`$ZodULID`,(e,t)=>{t.pattern??=yee,Nn.init(e,t)}),Un=A(`$ZodXID`,(e,t)=>{t.pattern??=bee,Nn.init(e,t)}),Wn=A(`$ZodKSUID`,(e,t)=>{t.pattern??=xee,Nn.init(e,t)}),Gn=A(`$ZodISODateTime`,(e,t)=>{t.pattern??=rn(t),Nn.init(e,t)}),Kn=A(`$ZodISODate`,(e,t)=>{t.pattern??=en,Nn.init(e,t)}),qn=A(`$ZodISOTime`,(e,t)=>{t.pattern??=nn(t),Nn.init(e,t)}),wee=A(`$ZodISODuration`,(e,t)=>{t.pattern??=Cee,Nn.init(e,t)}),Tee=A(`$ZodIPv4`,(e,t)=>{t.pattern??=Gt,Nn.init(e,t),e._zod.bag.format=`ipv4`}),Eee=A(`$ZodIPv6`,(e,t)=>{t.pattern??=Kt,Nn.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),Dee=A(`$ZodCIDRv4`,(e,t)=>{t.pattern??=qt,Nn.init(e,t)}),Oee=A(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Jt,Nn.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function Jn(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var kee=A(`$ZodBase64`,(e,t)=>{t.pattern??=Yt,Nn.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{Jn(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function Aee(e){if(!Xt.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Jn(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var jee=A(`$ZodBase64URL`,(e,t)=>{t.pattern??=Xt,Nn.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{Aee(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Mee=A(`$ZodE164`,(e,t)=>{t.pattern??=Qt,Nn.init(e,t)});function Nee(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var Pee=A(`$ZodJWT`,(e,t)=>{Nn.init(e,t),e._zod.check=n=>{Nee(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),Yn=A(`$ZodNumber`,(e,t)=>{jn.init(e,t),e._zod.pattern=e._zod.bag.pattern??sn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),Fee=A(`$ZodNumberFormat`,(e,t)=>{_n.init(e,t),Yn.init(e,t)}),Iee=A(`$ZodBoolean`,(e,t)=>{jn.init(e,t),e._zod.pattern=cn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),Lee=A(`$ZodNull`,(e,t)=>{jn.init(e,t),e._zod.pattern=ln,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),Ree=A(`$ZodUnknown`,(e,t)=>{jn.init(e,t),e._zod.parse=e=>e}),zee=A(`$ZodNever`,(e,t)=>{jn.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function Xn(e,t,n){e.issues.length&&t.issues.push(...Dt(n,e.issues)),t.value[n]=e.value}var Bee=A(`$ZodArray`,(e,t)=>{jn.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>Xn(t,n,e))):Xn(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function Zn(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...Dt(n,e.issues))}if(!o&&!i){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}function Qn(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=bt(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function $n(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin===`optional`,d=c.optout===`optional`;for(let i in t){if(i===`__proto__`||s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>Zn(e,n,i,t,u,d))):Zn(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var Vee=A(`$ZodObject`,(e,t)=>{if(jn.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,`shape`,{get:()=>{let n={...e};return Object.defineProperty(t,`shape`,{value:n}),n}})}let n=nt(()=>Qn(t));st(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=pt,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optin===`optional`,i=n._zod.optout===`optional`,a=n._zod.run({value:s[e],issues:[]},o);a instanceof Promise?c.push(a.then(n=>Zn(n,t,e,s,r,i))):Zn(a,t,e,s,r,i)}return i?$n(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),Hee=A(`$ZodObjectJIT`,(e,t)=>{Vee.init(e,t);let n=e._zod.parse,r=nt(()=>Qn(t)),i=e=>{let t=new kn([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=ut(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=ut(r),s=e[r],c=s?._zod?.optin===`optional`,l=s?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),c&&l?t.write(`
4
+ `))}},Fn={major:4,minor:4,patch:3},In=A(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Fn;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=Dt(e),i;for(let a of t){if(a._zod.def.when){if(Ot(e)||!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new Qe;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=Dt(e,t))});else{if(e.issues.length===t)continue;r||=Dt(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(Dt(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new Qe;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new Qe;return o.then(e=>t(e,r,a))}return t(o,r,a)}}lt(e,`~standard`,()=>({validate:t=>{try{let n=dee(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return fee(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),Ln=A(`$ZodString`,(e,t)=>{In.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??un(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),Rn=A(`$ZodStringFormat`,(e,t)=>{En.init(e,t),Ln.init(e,t)}),zn=A(`$ZodGUID`,(e,t)=>{t.pattern??=Gt,Rn.init(e,t)}),Bn=A(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=Kt(e)}else t.pattern??=Kt();Rn.init(e,t)}),Vn=A(`$ZodEmail`,(e,t)=>{t.pattern??=qt,Rn.init(e,t)}),Hn=A(`$ZodURL`,(e,t)=>{Rn.init(e,t),e._zod.check=n=>{try{let r=n.value.trim();if(!t.normalize&&t.protocol?.source===nn.source&&!/^https?:\/\//i.test(r)){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}let i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Un=A(`$ZodEmoji`,(e,t)=>{t.pattern??=Yt(),Rn.init(e,t)}),Wn=A(`$ZodNanoID`,(e,t)=>{t.pattern??=Ut,Rn.init(e,t)}),Gn=A(`$ZodCUID`,(e,t)=>{t.pattern??=xee,Rn.init(e,t)}),Kn=A(`$ZodCUID2`,(e,t)=>{t.pattern??=See,Rn.init(e,t)}),qn=A(`$ZodULID`,(e,t)=>{t.pattern??=Cee,Rn.init(e,t)}),wee=A(`$ZodXID`,(e,t)=>{t.pattern??=Vt,Rn.init(e,t)}),Tee=A(`$ZodKSUID`,(e,t)=>{t.pattern??=Ht,Rn.init(e,t)}),Eee=A(`$ZodISODateTime`,(e,t)=>{t.pattern??=ln(t),Rn.init(e,t)}),Dee=A(`$ZodISODate`,(e,t)=>{t.pattern??=on,Rn.init(e,t)}),Oee=A(`$ZodISOTime`,(e,t)=>{t.pattern??=cn(t),Rn.init(e,t)}),kee=A(`$ZodISODuration`,(e,t)=>{t.pattern??=Wt,Rn.init(e,t)}),Aee=A(`$ZodIPv4`,(e,t)=>{t.pattern??=Xt,Rn.init(e,t),e._zod.bag.format=`ipv4`}),jee=A(`$ZodIPv6`,(e,t)=>{t.pattern??=Zt,Rn.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),Mee=A(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Qt,Rn.init(e,t)}),Nee=A(`$ZodCIDRv6`,(e,t)=>{t.pattern??=$t,Rn.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function Jn(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var Pee=A(`$ZodBase64`,(e,t)=>{t.pattern??=en,Rn.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{Jn(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function Fee(e){if(!tn.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Jn(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var Iee=A(`$ZodBase64URL`,(e,t)=>{t.pattern??=tn,Rn.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{Fee(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Lee=A(`$ZodE164`,(e,t)=>{t.pattern??=rn,Rn.init(e,t)});function Ree(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var zee=A(`$ZodJWT`,(e,t)=>{Rn.init(e,t),e._zod.check=n=>{Ree(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),Yn=A(`$ZodNumber`,(e,t)=>{In.init(e,t),e._zod.pattern=e._zod.bag.pattern??fn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),Bee=A(`$ZodNumberFormat`,(e,t)=>{Sn.init(e,t),Yn.init(e,t)}),Vee=A(`$ZodBoolean`,(e,t)=>{In.init(e,t),e._zod.pattern=pn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),Hee=A(`$ZodNull`,(e,t)=>{In.init(e,t),e._zod.pattern=mn,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),Uee=A(`$ZodUnknown`,(e,t)=>{In.init(e,t),e._zod.parse=e=>e}),Wee=A(`$ZodNever`,(e,t)=>{In.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function Xn(e,t,n){e.issues.length&&t.issues.push(...kt(n,e.issues)),t.value[n]=e.value}var Gee=A(`$ZodArray`,(e,t)=>{In.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>Xn(t,n,e))):Xn(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function Zn(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...kt(n,e.issues))}if(!o&&!i){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}function Qn(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=iee(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function $n(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin===`optional`,d=c.optout===`optional`;for(let i in t){if(i===`__proto__`||s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>Zn(e,n,i,t,u,d))):Zn(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var Kee=A(`$ZodObject`,(e,t)=>{if(In.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,`shape`,{get:()=>{let n={...e};return Object.defineProperty(t,`shape`,{value:n}),n}})}let n=it(()=>Qn(t));lt(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=ht,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optin===`optional`,i=n._zod.optout===`optional`,a=n._zod.run({value:s[e],issues:[]},o);a instanceof Promise?c.push(a.then(n=>Zn(n,t,e,s,r,i))):Zn(a,t,e,s,r,i)}return i?$n(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),qee=A(`$ZodObjectJIT`,(e,t)=>{Kee.init(e,t);let n=e._zod.parse,r=it(()=>Qn(t)),i=e=>{let t=new Pn([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=ft(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=ft(r),s=e[r],c=s?._zod?.optin===`optional`,l=s?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),c&&l?t.write(`
5
5
  if (${n}.issues.length) {
6
6
  if (${o} in input) {
7
7
  payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
@@ -60,9 +60,9 @@ import{a as e,i as t,n,o as r,r as i,t as a}from"./chunk-CYidjpOJ.js";import{t a
60
60
  }
61
61
  }
62
62
 
63
- `)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=pt,s=!Qe.jitless,c=s&&mt.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?$n([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function er(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!Tt(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>kt(e,r,$e())))}),t)}var tr=A(`$ZodUnion`,(e,t)=>{jn.init(e,t),st(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),st(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),st(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),st(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>it(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>er(t,r,e,i)):er(o,r,e,i)}}),Uee=A(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,tr.init(e,t);let n=e._zod.parse;st(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=nt(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!pt(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()),input:o,path:[t.discriminator],inst:e}),i)}}),Wee=A(`$ZodIntersection`,(e,t)=>{jn.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>rr(e,t,n)):rr(e,i,a)}});function nr(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ht(e)&&ht(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=nr(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=nr(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function rr(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),Tt(e))return e;let o=nr(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var Gee=A(`$ZodRecord`,(e,t)=>{jn.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!ht(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let c of o)if(typeof c==`string`||typeof c==`number`||typeof c==`symbol`){s.add(typeof c==`number`?c.toString():c);let o=t.keyType._zod.run({value:c,issues:[]},r);if(o instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(o.issues.length){n.issues.push({code:`invalid_key`,origin:`record`,issues:o.issues.map(e=>kt(e,r,$e())),input:c,path:[c],inst:e});continue}let l=o.value,u=t.valueType._zod.run({value:i[c],issues:[]},r);u instanceof Promise?a.push(u.then(e=>{e.issues.length&&n.issues.push(...Dt(c,e.issues)),n.value[l]=e.value})):(u.issues.length&&n.issues.push(...Dt(c,u.issues)),n.value[l]=u.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`||!Object.prototype.propertyIsEnumerable.call(i,o))continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof o==`string`&&sn.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>kt(e,r,$e())),input:o,path:[o],inst:e});continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...Dt(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...Dt(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),Kee=A(`$ZodEnum`,(e,t)=>{jn.init(e,t);let n=et(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>_t.has(typeof e)).map(e=>typeof e==`string`?vt(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),qee=A(`$ZodLiteral`,(e,t)=>{if(jn.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?vt(e):e?vt(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),Jee=A(`$ZodTransform`,(e,t)=>{jn.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Ze(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n.fallback=!0,n));if(i instanceof Promise)throw new Xe;return n.value=i,n.fallback=!0,n}});function ir(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var ar=A(`$ZodOptional`,(e,t)=>{jn.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,st(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),st(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${it(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>ir(e,r)):ir(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Yee=A(`$ZodExactOptional`,(e,t)=>{ar.init(e,t),st(e._zod,`values`,()=>t.innerType._zod.values),st(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Xee=A(`$ZodNullable`,(e,t)=>{jn.init(e,t),st(e._zod,`optin`,()=>t.innerType._zod.optin),st(e._zod,`optout`,()=>t.innerType._zod.optout),st(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${it(e.source)}|null)$`):void 0}),st(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Zee=A(`$ZodDefault`,(e,t)=>{jn.init(e,t),e._zod.optin=`optional`,st(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>or(e,t)):or(r,t)}});function or(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Qee=A(`$ZodPrefault`,(e,t)=>{jn.init(e,t),e._zod.optin=`optional`,st(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),$ee=A(`$ZodNonOptional`,(e,t)=>{jn.init(e,t),st(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>sr(t,e)):sr(i,e)}});function sr(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var ete=A(`$ZodCatch`,(e,t)=>{jn.init(e,t),e._zod.optin=`optional`,st(e._zod,`optout`,()=>t.innerType._zod.optout),st(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>kt(e,n,$e()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>kt(e,n,$e()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),cr=A(`$ZodPipe`,(e,t)=>{jn.init(e,t),st(e._zod,`values`,()=>t.in._zod.values),st(e._zod,`optin`,()=>t.in._zod.optin),st(e._zod,`optout`,()=>t.out._zod.optout),st(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>lr(e,t.in,n)):lr(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>lr(e,t.out,n)):lr(r,t.out,n)}});function lr(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}var tte=A(`$ZodPreprocess`,(e,t)=>{cr.init(e,t)}),nte=A(`$ZodReadonly`,(e,t)=>{jn.init(e,t),st(e._zod,`propValues`,()=>t.innerType._zod.propValues),st(e._zod,`values`,()=>t.innerType._zod.values),st(e._zod,`optin`,()=>t.innerType?._zod?.optin),st(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(ur):ur(r)}});function ur(e){return e.value=Object.freeze(e.value),e}var rte=A(`$ZodLazy`,(e,t)=>{jn.init(e,t),st(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),st(e._zod,`pattern`,()=>e._zod.innerType?._zod?.pattern),st(e._zod,`propValues`,()=>e._zod.innerType?._zod?.propValues),st(e._zod,`optin`,()=>e._zod.innerType?._zod?.optin??void 0),st(e._zod,`optout`,()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),ite=A(`$ZodCustom`,(e,t)=>{fn.init(e,t),jn.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>dr(t,n,r,e));dr(i,n,r,e)}});function dr(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(jt(e))}}var fr,ate=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function pr(){return new ate}(fr=globalThis).__zod_globalRegistry??(fr.__zod_globalRegistry=pr());var mr=globalThis.__zod_globalRegistry;function ote(e,t){return new e({type:`string`,...j(t)})}function hr(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...j(t)})}function gr(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...j(t)})}function ste(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...j(t)})}function cte(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...j(t)})}function lte(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...j(t)})}function ute(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...j(t)})}function _r(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...j(t)})}function dte(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...j(t)})}function fte(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...j(t)})}function pte(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...j(t)})}function mte(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...j(t)})}function hte(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...j(t)})}function gte(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...j(t)})}function _te(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...j(t)})}function vte(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...j(t)})}function yte(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...j(t)})}function bte(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...j(t)})}function xte(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...j(t)})}function Ste(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...j(t)})}function vr(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...j(t)})}function yr(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...j(t)})}function br(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...j(t)})}function xr(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...j(t)})}function Sr(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...j(t)})}function Cr(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...j(t)})}function wr(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...j(t)})}function Tr(e,t){return new e({type:`number`,checks:[],...j(t)})}function Er(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...j(t)})}function Dr(e,t){return new e({type:`boolean`,...j(t)})}function Or(e,t){return new e({type:`null`,...j(t)})}function kr(e){return new e({type:`unknown`})}function Ar(e,t){return new e({type:`never`,...j(t)})}function jr(e,t){return new mn({check:`less_than`,...j(t),value:e,inclusive:!1})}function Mr(e,t){return new mn({check:`less_than`,...j(t),value:e,inclusive:!0})}function Nr(e,t){return new hn({check:`greater_than`,...j(t),value:e,inclusive:!1})}function Pr(e,t){return new hn({check:`greater_than`,...j(t),value:e,inclusive:!0})}function Fr(e,t){return new gn({check:`multiple_of`,...j(t),value:e})}function Ir(e,t){return new vn({check:`max_length`,...j(t),maximum:e})}function Lr(e,t){return new yn({check:`min_length`,...j(t),minimum:e})}function Rr(e,t){return new bn({check:`length_equals`,...j(t),length:e})}function zr(e,t){return new Sn({check:`string_format`,format:`regex`,...j(t),pattern:e})}function Br(e){return new Cn({check:`string_format`,format:`lowercase`,...j(e)})}function Vr(e){return new wn({check:`string_format`,format:`uppercase`,...j(e)})}function Hr(e,t){return new Tn({check:`string_format`,format:`includes`,...j(t),includes:e})}function Ur(e,t){return new En({check:`string_format`,format:`starts_with`,...j(t),prefix:e})}function Wr(e,t){return new Dn({check:`string_format`,format:`ends_with`,...j(t),suffix:e})}function Gr(e){return new On({check:`overwrite`,tx:e})}function Kr(e){return Gr(t=>t.normalize(e))}function qr(){return Gr(e=>e.trim())}function Jr(){return Gr(e=>e.toLowerCase())}function Yr(){return Gr(e=>e.toUpperCase())}function Xr(){return Gr(e=>dt(e))}function Zr(e,t,n){return new e({type:`array`,element:t,...j(n)})}function Qr(e,t,n){let r=j(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function $r(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...j(n)})}function ei(e,t){let n=ti(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(jt(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(jt(r))}},e(t.value,t)),t);return n}function ti(e,t){let n=new fn({check:`custom`,...j(t)});return n._zod.check=e,n}function ni(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??mr,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function ri(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,ri(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&oi(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function ii(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
63
+ `)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=ht,s=!et.jitless,c=s&&gt.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?$n([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function er(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!Dt(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>jt(e,r,tt())))}),t)}var tr=A(`$ZodUnion`,(e,t)=>{In.init(e,t),lt(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),lt(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),lt(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),lt(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>ot(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>er(t,r,e,i)):er(o,r,e,i)}}),Jee=A(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,tr.init(e,t);let n=e._zod.parse;lt(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=it(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!ht(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()),input:o,path:[t.discriminator],inst:e}),i)}}),Yee=A(`$ZodIntersection`,(e,t)=>{In.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>rr(e,t,n)):rr(e,i,a)}});function nr(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(_t(e)&&_t(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=nr(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=nr(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function rr(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),Dt(e))return e;let o=nr(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var Xee=A(`$ZodRecord`,(e,t)=>{In.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!_t(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let c of o)if(typeof c==`string`||typeof c==`number`||typeof c==`symbol`){s.add(typeof c==`number`?c.toString():c);let o=t.keyType._zod.run({value:c,issues:[]},r);if(o instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(o.issues.length){n.issues.push({code:`invalid_key`,origin:`record`,issues:o.issues.map(e=>jt(e,r,tt())),input:c,path:[c],inst:e});continue}let l=o.value,u=t.valueType._zod.run({value:i[c],issues:[]},r);u instanceof Promise?a.push(u.then(e=>{e.issues.length&&n.issues.push(...kt(c,e.issues)),n.value[l]=e.value})):(u.issues.length&&n.issues.push(...kt(c,u.issues)),n.value[l]=u.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`||!Object.prototype.propertyIsEnumerable.call(i,o))continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof o==`string`&&fn.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>jt(e,r,tt())),input:o,path:[o],inst:e});continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...kt(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...kt(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),Zee=A(`$ZodEnum`,(e,t)=>{In.init(e,t);let n=nt(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>ree.has(typeof e)).map(e=>typeof e==`string`?yt(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),Qee=A(`$ZodLiteral`,(e,t)=>{if(In.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?yt(e):e?yt(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),$ee=A(`$ZodTransform`,(e,t)=>{In.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new $e(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n.fallback=!0,n));if(i instanceof Promise)throw new Qe;return n.value=i,n.fallback=!0,n}});function ir(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var ar=A(`$ZodOptional`,(e,t)=>{In.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,lt(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),lt(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${ot(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>ir(e,r)):ir(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),ete=A(`$ZodExactOptional`,(e,t)=>{ar.init(e,t),lt(e._zod,`values`,()=>t.innerType._zod.values),lt(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),tte=A(`$ZodNullable`,(e,t)=>{In.init(e,t),lt(e._zod,`optin`,()=>t.innerType._zod.optin),lt(e._zod,`optout`,()=>t.innerType._zod.optout),lt(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${ot(e.source)}|null)$`):void 0}),lt(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),nte=A(`$ZodDefault`,(e,t)=>{In.init(e,t),e._zod.optin=`optional`,lt(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>or(e,t)):or(r,t)}});function or(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var rte=A(`$ZodPrefault`,(e,t)=>{In.init(e,t),e._zod.optin=`optional`,lt(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),ite=A(`$ZodNonOptional`,(e,t)=>{In.init(e,t),lt(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>sr(t,e)):sr(i,e)}});function sr(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var ate=A(`$ZodCatch`,(e,t)=>{In.init(e,t),e._zod.optin=`optional`,lt(e._zod,`optout`,()=>t.innerType._zod.optout),lt(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>jt(e,n,tt()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>jt(e,n,tt()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),cr=A(`$ZodPipe`,(e,t)=>{In.init(e,t),lt(e._zod,`values`,()=>t.in._zod.values),lt(e._zod,`optin`,()=>t.in._zod.optin),lt(e._zod,`optout`,()=>t.out._zod.optout),lt(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>lr(e,t.in,n)):lr(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>lr(e,t.out,n)):lr(r,t.out,n)}});function lr(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}var ote=A(`$ZodPreprocess`,(e,t)=>{cr.init(e,t)}),ste=A(`$ZodReadonly`,(e,t)=>{In.init(e,t),lt(e._zod,`propValues`,()=>t.innerType._zod.propValues),lt(e._zod,`values`,()=>t.innerType._zod.values),lt(e._zod,`optin`,()=>t.innerType?._zod?.optin),lt(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(ur):ur(r)}});function ur(e){return e.value=Object.freeze(e.value),e}var cte=A(`$ZodLazy`,(e,t)=>{In.init(e,t),lt(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),lt(e._zod,`pattern`,()=>e._zod.innerType?._zod?.pattern),lt(e._zod,`propValues`,()=>e._zod.innerType?._zod?.propValues),lt(e._zod,`optin`,()=>e._zod.innerType?._zod?.optin??void 0),lt(e._zod,`optout`,()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),lte=A(`$ZodCustom`,(e,t)=>{_n.init(e,t),In.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>dr(t,n,r,e));dr(i,n,r,e)}});function dr(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(Nt(e))}}var fr,ute=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function pr(){return new ute}(fr=globalThis).__zod_globalRegistry??(fr.__zod_globalRegistry=pr());var mr=globalThis.__zod_globalRegistry;function dte(e,t){return new e({type:`string`,...j(t)})}function hr(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...j(t)})}function gr(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...j(t)})}function fte(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...j(t)})}function pte(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...j(t)})}function mte(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...j(t)})}function hte(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...j(t)})}function _r(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...j(t)})}function gte(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...j(t)})}function _te(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...j(t)})}function vte(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...j(t)})}function yte(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...j(t)})}function bte(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...j(t)})}function xte(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...j(t)})}function Ste(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...j(t)})}function vr(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...j(t)})}function yr(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...j(t)})}function br(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...j(t)})}function xr(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...j(t)})}function Sr(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...j(t)})}function Cr(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...j(t)})}function wr(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...j(t)})}function Tr(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...j(t)})}function Er(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...j(t)})}function Dr(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...j(t)})}function Or(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...j(t)})}function kr(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...j(t)})}function Ar(e,t){return new e({type:`number`,checks:[],...j(t)})}function jr(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...j(t)})}function Mr(e,t){return new e({type:`boolean`,...j(t)})}function Nr(e,t){return new e({type:`null`,...j(t)})}function Pr(e){return new e({type:`unknown`})}function Fr(e,t){return new e({type:`never`,...j(t)})}function Ir(e,t){return new yn({check:`less_than`,...j(t),value:e,inclusive:!1})}function Lr(e,t){return new yn({check:`less_than`,...j(t),value:e,inclusive:!0})}function Rr(e,t){return new bn({check:`greater_than`,...j(t),value:e,inclusive:!1})}function zr(e,t){return new bn({check:`greater_than`,...j(t),value:e,inclusive:!0})}function Br(e,t){return new xn({check:`multiple_of`,...j(t),value:e})}function Vr(e,t){return new Cn({check:`max_length`,...j(t),maximum:e})}function Hr(e,t){return new wn({check:`min_length`,...j(t),minimum:e})}function Ur(e,t){return new Tn({check:`length_equals`,...j(t),length:e})}function Wr(e,t){return new Dn({check:`string_format`,format:`regex`,...j(t),pattern:e})}function Gr(e){return new On({check:`string_format`,format:`lowercase`,...j(e)})}function Kr(e){return new kn({check:`string_format`,format:`uppercase`,...j(e)})}function qr(e,t){return new An({check:`string_format`,format:`includes`,...j(t),includes:e})}function Jr(e,t){return new jn({check:`string_format`,format:`starts_with`,...j(t),prefix:e})}function Yr(e,t){return new Mn({check:`string_format`,format:`ends_with`,...j(t),suffix:e})}function Xr(e){return new Nn({check:`overwrite`,tx:e})}function Zr(e){return Xr(t=>t.normalize(e))}function Qr(){return Xr(e=>e.trim())}function $r(){return Xr(e=>e.toLowerCase())}function ei(){return Xr(e=>e.toUpperCase())}function ti(){return Xr(e=>pt(e))}function ni(e,t,n){return new e({type:`array`,element:t,...j(n)})}function ri(e,t,n){let r=j(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function ii(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...j(n)})}function ai(e,t){let n=oi(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Nt(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(Nt(r))}},e(t.value,t)),t);return n}function oi(e,t){let n=new _n({check:`custom`,...j(t)});return n._zod.check=e,n}function si(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??mr,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function ci(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,ci(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&di(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function li(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
64
64
 
65
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function ai(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,`~standard`,{value:{...t[`~standard`],jsonSchema:{input:ci(t,`input`,e.processors),output:ci(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function oi(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return oi(r.element,n);if(r.type===`set`)return oi(r.valueType,n);if(r.type===`lazy`)return oi(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type===`default`||r.type===`prefault`)return oi(r.innerType,n);if(r.type===`intersection`)return oi(r.left,n)||oi(r.right,n);if(r.type===`record`||r.type===`map`)return oi(r.keyType,n)||oi(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:oi(r.in,n)||oi(r.out,n);if(r.type===`object`){for(let e in r.shape)if(oi(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(oi(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(oi(e,n))return!0;return!!(r.rest&&oi(r.rest,n))}return!1}var si=(e,t={})=>n=>{let r=ni({...n,processors:t});return ri(e,r),ii(r,e),ai(r,e)},ci=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=ni({...i??{},target:a,io:t,processors:n});return ri(e,o),ii(o,e),ai(o,e)},li={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},ui=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=li[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},di=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(i.multipleOf=c)},fi=(e,t,n,r)=>{n.type=`boolean`},pi=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},mi=(e,t,n,r)=>{n.not={}},hi=(e,t,n,r)=>{let i=e._zod.def,a=et(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},gi=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},_i=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},vi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},yi=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=ri(a.element,t,{...r,path:[...r.path,`items`]})},bi=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=ri(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=ri(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},xi=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>ri(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Si=(e,t,n,r)=>{let i=e._zod.def,a=ri(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=ri(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},Ci=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=ri(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else (t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=ri(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=ri(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},wi=(e,t,n,r)=>{let i=e._zod.def,a=ri(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Ti=(e,t,n,r)=>{let i=e._zod.def;ri(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Ei=(e,t,n,r)=>{let i=e._zod.def;ri(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Di=(e,t,n,r)=>{let i=e._zod.def;ri(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Oi=(e,t,n,r)=>{let i=e._zod.def;ri(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},ki=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;ri(o,t,r);let s=t.seen.get(e);s.ref=o},Ai=(e,t,n,r)=>{let i=e._zod.def;ri(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},ji=(e,t,n,r)=>{let i=e._zod.def;ri(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Mi=(e,t,n,r)=>{let i=e._zod.innerType;ri(i,t,r);let a=t.seen.get(e);a.ref=i},Ni=A(`ZodISODateTime`,(e,t)=>{Gn.init(e,t),aa.init(e,t)});function Pi(e){return xr(Ni,e)}var Fi=A(`ZodISODate`,(e,t)=>{Kn.init(e,t),aa.init(e,t)});function Ii(e){return Sr(Fi,e)}var Li=A(`ZodISOTime`,(e,t)=>{qn.init(e,t),aa.init(e,t)});function Ri(e){return Cr(Li,e)}var zi=A(`ZodISODuration`,(e,t)=>{wee.init(e,t),aa.init(e,t)});function Bi(e){return wr(zi,e)}var Vi=A(`ZodError`,(e,t)=>{Nt.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>iee(e,t)},flatten:{value:t=>Ft(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,tt,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,tt,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Hi=It(Vi),Ui=Lt(Vi),Wi=Rt(Vi),Gi=zt(Vi),Ki=lee(Vi),qi=uee(Vi),Ji=dee(Vi),Yi=fee(Vi),Xi=pee(Vi),Zi=mee(Vi),Qi=hee(Vi),$i=gee(Vi),ea=new WeakMap;function ta(e,t,n){let r=Object.getPrototypeOf(e),i=ea.get(r);if(i||(i=new Set,ea.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var na=A(`ZodType`,(e,t)=>(jn.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:ci(e,`input`),output:ci(e,`output`)}}),e.toJSONSchema=si(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,`_def`,{value:t}),e.parse=(t,n)=>Hi(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Wi(e,t,n),e.parseAsync=async(t,n)=>Ui(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Gi(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Ki(e,t,n),e.decode=(t,n)=>qi(e,t,n),e.encodeAsync=async(t,n)=>Ji(e,t,n),e.decodeAsync=async(t,n)=>Yi(e,t,n),e.safeEncode=(t,n)=>Xi(e,t,n),e.safeDecode=(t,n)=>Zi(e,t,n),e.safeEncodeAsync=async(t,n)=>Qi(e,t,n),e.safeDecodeAsync=async(t,n)=>$i(e,t,n),ta(e,`ZodType`,{check(...e){let t=this.def;return this.clone(lt(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return yt(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Co(e,t))},superRefine(e,t){return this.check(wo(e,t))},overwrite(e){return this.check(Gr(e))},optional(){return eo(this)},exactOptional(){return no(this)},nullable(){return io(this)},nullish(){return eo(io(this))},nonoptional(e){return uo(this,e)},array(){return F(this)},or(e){return Va([this,e])},and(e){return Ga(this,e)},transform(e){return ho(this,Qa(e))},default(e){return oo(this,e)},prefault(e){return co(this,e)},catch(e){return po(this,e)},pipe(e){return ho(this,e)},readonly(){return vo(this)},describe(e){let t=this.clone();return mr.add(t,{description:e}),t},meta(...e){if(e.length===0)return mr.get(this);let t=this.clone();return mr.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,`description`,{get(){return mr.get(e)?.description},configurable:!0}),e)),ra=A(`_ZodString`,(e,t)=>{Mn.init(e,t),na.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ui(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,ta(e,`_ZodString`,{regex(...e){return this.check(zr(...e))},includes(...e){return this.check(Hr(...e))},startsWith(...e){return this.check(Ur(...e))},endsWith(...e){return this.check(Wr(...e))},min(...e){return this.check(Lr(...e))},max(...e){return this.check(Ir(...e))},length(...e){return this.check(Rr(...e))},nonempty(...e){return this.check(Lr(1,...e))},lowercase(e){return this.check(Br(e))},uppercase(e){return this.check(Vr(e))},trim(){return this.check(qr())},normalize(...e){return this.check(Kr(...e))},toLowerCase(){return this.check(Jr())},toUpperCase(){return this.check(Yr())},slugify(){return this.check(Xr())}})}),ia=A(`ZodString`,(e,t)=>{Mn.init(e,t),ra.init(e,t),e.email=t=>e.check(hr(oa,t)),e.url=t=>e.check(_r(ua,t)),e.jwt=t=>e.check(br(Ea,t)),e.emoji=t=>e.check(dte(fa,t)),e.guid=t=>e.check(gr(ca,t)),e.uuid=t=>e.check(ste(la,t)),e.uuidv4=t=>e.check(cte(la,t)),e.uuidv6=t=>e.check(lte(la,t)),e.uuidv7=t=>e.check(ute(la,t)),e.nanoid=t=>e.check(fte(pa,t)),e.guid=t=>e.check(gr(ca,t)),e.cuid=t=>e.check(pte(ma,t)),e.cuid2=t=>e.check(mte(ha,t)),e.ulid=t=>e.check(hte(ga,t)),e.base64=t=>e.check(Ste(Ca,t)),e.base64url=t=>e.check(vr(wa,t)),e.xid=t=>e.check(gte(_a,t)),e.ksuid=t=>e.check(_te(va,t)),e.ipv4=t=>e.check(vte(ya,t)),e.ipv6=t=>e.check(yte(ba,t)),e.cidrv4=t=>e.check(bte(xa,t)),e.cidrv6=t=>e.check(xte(Sa,t)),e.e164=t=>e.check(yr(Ta,t)),e.datetime=t=>e.check(Pi(t)),e.date=t=>e.check(Ii(t)),e.time=t=>e.check(Ri(t)),e.duration=t=>e.check(Bi(t))});function M(e){return ote(ia,e)}var aa=A(`ZodStringFormat`,(e,t)=>{Nn.init(e,t),ra.init(e,t)}),oa=A(`ZodEmail`,(e,t)=>{In.init(e,t),aa.init(e,t)});function sa(e){return hr(oa,e)}var ca=A(`ZodGUID`,(e,t)=>{Pn.init(e,t),aa.init(e,t)}),la=A(`ZodUUID`,(e,t)=>{Fn.init(e,t),aa.init(e,t)}),ua=A(`ZodURL`,(e,t)=>{Ln.init(e,t),aa.init(e,t)});function da(e){return _r(ua,e)}var fa=A(`ZodEmoji`,(e,t)=>{Rn.init(e,t),aa.init(e,t)}),pa=A(`ZodNanoID`,(e,t)=>{zn.init(e,t),aa.init(e,t)}),ma=A(`ZodCUID`,(e,t)=>{Bn.init(e,t),aa.init(e,t)}),ha=A(`ZodCUID2`,(e,t)=>{Vn.init(e,t),aa.init(e,t)}),ga=A(`ZodULID`,(e,t)=>{Hn.init(e,t),aa.init(e,t)}),_a=A(`ZodXID`,(e,t)=>{Un.init(e,t),aa.init(e,t)}),va=A(`ZodKSUID`,(e,t)=>{Wn.init(e,t),aa.init(e,t)}),ya=A(`ZodIPv4`,(e,t)=>{Tee.init(e,t),aa.init(e,t)}),ba=A(`ZodIPv6`,(e,t)=>{Eee.init(e,t),aa.init(e,t)}),xa=A(`ZodCIDRv4`,(e,t)=>{Dee.init(e,t),aa.init(e,t)}),Sa=A(`ZodCIDRv6`,(e,t)=>{Oee.init(e,t),aa.init(e,t)}),Ca=A(`ZodBase64`,(e,t)=>{kee.init(e,t),aa.init(e,t)}),wa=A(`ZodBase64URL`,(e,t)=>{jee.init(e,t),aa.init(e,t)}),Ta=A(`ZodE164`,(e,t)=>{Mee.init(e,t),aa.init(e,t)}),Ea=A(`ZodJWT`,(e,t)=>{Pee.init(e,t),aa.init(e,t)}),Da=A(`ZodNumber`,(e,t)=>{Yn.init(e,t),na.init(e,t),e._zod.processJSONSchema=(t,n,r)=>di(e,t,n,r),ta(e,`ZodNumber`,{gt(e,t){return this.check(Nr(e,t))},gte(e,t){return this.check(Pr(e,t))},min(e,t){return this.check(Pr(e,t))},lt(e,t){return this.check(jr(e,t))},lte(e,t){return this.check(Mr(e,t))},max(e,t){return this.check(Mr(e,t))},int(e){return this.check(ka(e))},safe(e){return this.check(ka(e))},positive(e){return this.check(Nr(0,e))},nonnegative(e){return this.check(Pr(0,e))},negative(e){return this.check(jr(0,e))},nonpositive(e){return this.check(Mr(0,e))},multipleOf(e,t){return this.check(Fr(e,t))},step(e,t){return this.check(Fr(e,t))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function N(e){return Tr(Da,e)}var Oa=A(`ZodNumberFormat`,(e,t)=>{Fee.init(e,t),Da.init(e,t)});function ka(e){return Er(Oa,e)}var Aa=A(`ZodBoolean`,(e,t)=>{Iee.init(e,t),na.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fi(e,t,n,r)});function P(e){return Dr(Aa,e)}var ja=A(`ZodNull`,(e,t)=>{Lee.init(e,t),na.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pi(e,t,n,r)});function Ma(e){return Or(ja,e)}var Na=A(`ZodUnknown`,(e,t)=>{Ree.init(e,t),na.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Pa(){return kr(Na)}var Fa=A(`ZodNever`,(e,t)=>{zee.init(e,t),na.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mi(e,t,n,r)});function Ia(e){return Ar(Fa,e)}var La=A(`ZodArray`,(e,t)=>{Bee.init(e,t),na.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yi(e,t,n,r),e.element=t.element,ta(e,`ZodArray`,{min(e,t){return this.check(Lr(e,t))},nonempty(e){return this.check(Lr(1,e))},max(e,t){return this.check(Ir(e,t))},length(e,t){return this.check(Rr(e,t))},unwrap(){return this.element}})});function F(e,t){return Zr(La,e,t)}var Ra=A(`ZodObject`,(e,t)=>{Hee.init(e,t),na.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bi(e,t,n,r),st(e,`shape`,()=>t.shape),ta(e,`ZodObject`,{keyof(){return R(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:Pa()})},loose(){return this.clone({...this._zod.def,catchall:Pa()})},strict(){return this.clone({...this._zod.def,catchall:Ia()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return tee(this,e)},safeExtend(e){return nee(this,e)},merge(e){return ree(this,e)},pick(e){return St(this,e)},omit(e){return eee(this,e)},partial(...e){return Ct($a,this,e[0])},required(...e){return wt(lo,this,e[0])}})});function I(e,t){return new Ra({type:`object`,shape:e??{},...j(t)})}function za(e,t){return new Ra({type:`object`,shape:e,catchall:Ia(),...j(t)})}function L(e,t){return new Ra({type:`object`,shape:e,catchall:Pa(),...j(t)})}var Ba=A(`ZodUnion`,(e,t)=>{tr.init(e,t),na.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xi(e,t,n,r),e.options=t.options});function Va(e,t){return new Ba({type:`union`,options:e,...j(t)})}var Ha=A(`ZodDiscriminatedUnion`,(e,t)=>{Ba.init(e,t),Uee.init(e,t)});function Ua(e,t,n){return new Ha({type:`union`,options:t,discriminator:e,...j(n)})}var Wa=A(`ZodIntersection`,(e,t)=>{Wee.init(e,t),na.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Si(e,t,n,r)});function Ga(e,t){return new Wa({type:`intersection`,left:e,right:t})}var Ka=A(`ZodRecord`,(e,t)=>{Gee.init(e,t),na.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ci(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function qa(e,t,n){return!t||!t._zod?new Ka({type:`record`,keyType:M(),valueType:e,...j(t)}):new Ka({type:`record`,keyType:e,valueType:t,...j(n)})}function Ja(e,t,n){let r=yt(e);return r._zod.values=void 0,new Ka({type:`record`,keyType:r,valueType:t,...j(n)})}var Ya=A(`ZodEnum`,(e,t)=>{Kee.init(e,t),na.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hi(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Ya({...t,checks:[],...j(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Ya({...t,checks:[],...j(r),entries:i})}});function R(e,t){return new Ya({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...j(t)})}var Xa=A(`ZodLiteral`,(e,t)=>{qee.init(e,t),na.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gi(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,`value`,{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function z(e,t){return new Xa({type:`literal`,values:Array.isArray(e)?e:[e],...j(t)})}var Za=A(`ZodTransform`,(e,t)=>{Jee.init(e,t),na.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vi(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Ze(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(jt(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(jt(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function Qa(e){return new Za({type:`transform`,transform:e})}var $a=A(`ZodOptional`,(e,t)=>{ar.init(e,t),na.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ji(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function eo(e){return new $a({type:`optional`,innerType:e})}var to=A(`ZodExactOptional`,(e,t)=>{Yee.init(e,t),na.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ji(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function no(e){return new to({type:`optional`,innerType:e})}var ro=A(`ZodNullable`,(e,t)=>{Xee.init(e,t),na.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function io(e){return new ro({type:`nullable`,innerType:e})}var ao=A(`ZodDefault`,(e,t)=>{Zee.init(e,t),na.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ei(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function oo(e,t){return new ao({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():gt(t)}})}var so=A(`ZodPrefault`,(e,t)=>{Qee.init(e,t),na.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Di(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function co(e,t){return new so({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():gt(t)}})}var lo=A(`ZodNonOptional`,(e,t)=>{$ee.init(e,t),na.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ti(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function uo(e,t){return new lo({type:`nonoptional`,innerType:e,...j(t)})}var fo=A(`ZodCatch`,(e,t)=>{ete.init(e,t),na.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Oi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function po(e,t){return new fo({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var mo=A(`ZodPipe`,(e,t)=>{cr.init(e,t),na.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ki(e,t,n,r),e.in=t.in,e.out=t.out});function ho(e,t){return new mo({type:`pipe`,in:e,out:t})}var go=A(`ZodPreprocess`,(e,t)=>{mo.init(e,t),tte.init(e,t)}),_o=A(`ZodReadonly`,(e,t)=>{nte.init(e,t),na.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ai(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function vo(e){return new _o({type:`readonly`,innerType:e})}var yo=A(`ZodLazy`,(e,t)=>{rte.init(e,t),na.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mi(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function bo(e){return new yo({type:`lazy`,getter:e})}var xo=A(`ZodCustom`,(e,t)=>{ite.init(e,t),na.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_i(e,t,n,r)});function So(e,t){return Qr(xo,e??(()=>!0),t)}function Co(e,t={}){return $r(xo,e,t)}function wo(e,t){return ei(e,t)}function To(e,t={}){let n=new xo({type:`custom`,check:`custom`,fn:t=>t instanceof e,abort:!0,...j(t)});return n._zod.bag.Class=e,n._zod.check=t=>{t.value instanceof e||t.issues.push({code:`invalid_type`,expected:e.name,input:t.value,inst:n,path:[...n._zod.def.path??[]]})},n}function Eo(e,t){return new go({type:`pipe`,in:Qa(e),out:t})}var Do=`open-knowledge`,Oo=`Server unreachable:`,ko=`Server timed out:`,Ao=[`exec`,`search`,`history`,`links`,`skills`,`config`,`palette`,`preview_url`,`share_link`,`lint`,`audit`,`write`,`edit`,`delete`,`move`,`install`,`import`,`checkpoint`,`restore_version`,`conflicts`,`resolve_conflict`],jo=[`write`,`edit`,`delete`,`move`,`install`,`import`,`checkpoint`,`restore_version`,`resolve_conflict`];function Mo(e){return`'${e.replace(/'/g,`'\\''`)}'`}function No(e){return[`--settings`,e]}function Po(e){return`'${e.replace(/'/g,`''`)}'`}function Fo(e,t){return t.length===0||Array.from(t).some(e=>e.charCodeAt(0)<32)?null:e===`powershell`?Po(t):e===`bash`?Mo(t):/["%!]/u.test(t)?null:`"${t}"`}var Io=[`mcp__${Do}`,`Bash(ok open:*)`],Lo=[`delete`,`move`,`share_link`,`install`,`import`].map(e=>`mcp__${Do}__${e}`),Cte=`-c ${Mo(`mcp_servers.${Do}.default_tools_approval_mode="approve"`)}`;function Ro(e){let t={};return e.mcpPreApprove===!0&&(t.enabledMcpjsonServers=[Do]),e.autoApproveOkTools===!0&&(t.permissions={allow:[...Io],ask:[...Lo]}),t.enabledMcpjsonServers===void 0&&t.permissions===void 0?null:JSON.stringify(t)}function wte(e){let t=Ro(e);return t===null?``:`--settings ${Mo(t)}`}var zo=`\x1B`,Tte=`${zo}[200~`,Ete=`${zo}[201~`,Bo=`\x1B[?2004h`,Dte=300,Ote=4e3,kte={submit:`\r`,readyMarker:Bo,settleMs:800,capMs:4e3},Vo={claude:{bin:`claude`,displayName:`Claude`,docsUrl:`https://docs.claude.com/en/docs/claude-code`,handoffTarget:`claude-code`},codex:{bin:`codex`,displayName:`Codex`,docsUrl:`https://developers.openai.com/codex/cli`,handoffTarget:`codex`,autoApproveArg:Cte},copilot:{bin:`copilot`,displayName:`GitHub Copilot`,docsUrl:`https://docs.github.com/en/copilot/how-tos/copilot-cli/cli-getting-started`,handoffTarget:`copilot`,promptFlag:`--interactive`},cursor:{bin:`cursor-agent`,displayName:`Cursor`,docsUrl:`https://cursor.com/docs/cli/overview`,handoffTarget:`cursor`},opencode:{bin:`opencode`,displayName:`OpenCode`,docsUrl:`https://opencode.ai/docs`,handoffTarget:`opencode`,promptFlag:`--prompt`},pi:{bin:`pi`,displayName:`Pi`,docsUrl:`https://pi.dev`,handoffTarget:`pi`},antigravity:{bin:`agy`,displayName:`Antigravity`,docsUrl:`https://antigravity.google/docs/cli-getting-started`,handoffTarget:`antigravity`,promptFlag:`--prompt-interactive`},openclaw:{bin:`openclaw`,subcommand:`chat`,displayName:`OpenClaw`,docsUrl:`https://docs.openclaw.ai/cli/tui`,handoffTarget:`openclaw`,promptFlag:`--message`},hermes:{bin:`hermes`,subcommand:`chat`,displayName:`Hermes`,docsUrl:`https://hermes-agent.nousresearch.com/docs/user-guide/cli`,handoffTarget:`hermes`,startupInjection:{submit:`\r`,readyMarker:Bo,settleMs:Dte,capMs:Ote}}},Ho=[`claude`,`codex`,`opencode`,`cursor`,`copilot`,`pi`,`antigravity`,`openclaw`,`hermes`];function Ate(e,t,n={}){let r=Vo[e];if(e===`claude`){let e=Ro(n);if(e!==null){let t=`.ok/local/terminal/claude-settings-${[n.mcpPreApprove===!0?`mcp`:null,n.autoApproveOkTools===!0?`tools`:null].filter(e=>e!==null).join(`-`)}.json`;return{executable:r.bin,args:[...No(t)],supportFile:{kind:`claude-settings`,relativePath:t,contents:e}}}}return e===`codex`&&n.autoApproveOkTools===!0?{executable:r.bin,args:[`-c`,`mcp_servers.${Do}.default_tools_approval_mode=approve`]}:{executable:r.bin,args:r.subcommand?[r.subcommand]:[]}}function jte(e,t,n={}){let r=Vo[e],i=e===`claude`?wte(n):n.autoApproveOkTools===!0&&r.autoApproveArg?r.autoApproveArg:``,a=i?`${i} `:``,o=r.subcommand?`${r.subcommand} `:``;if(r.startupInjection!=null||t==null||t.length===0)return`${r.bin} ${o}${a}`.trimEnd();let s=r.promptFlag?`${r.promptFlag} `:``;return`${r.bin} ${o}${a}${s}${Mo(t)}`}function Uo(e,t){return Vo[e].startupInjection??(t===`win32`?kte:void 0)}function Mte(e,t,n){let r=Uo(e,n);return r==null||t==null||t.length===0?null:`${Tte}${t.replaceAll(zo,``)}${Ete}${r.submit}`}var Wo=[`config-entry`,`managed-file`,`skill-bundle-copy`,`central-store-copy`,`session-injection`],Nte=R(Wo),Pte=Wo.filter(e=>e!==`session-injection`),Go=[`satisfied`,`present-consent-unknown`,`absent`,`foreign`,`foreign-replaceable`,`drifted`,`excluded`,`structural-na`,`undetected`,`unprobeable`,`unprobed`];Va([R(Go),M()]);function Ko(e){return Go.includes(e)}var qo=[`reclaim-permissive`,`pre-approval-exact`,`injection-functional`],Jo=R(qo),Fte=R([`none`,`approve-once`,`enable-manually`,`trust-gated`]),Ite=[`enable-manually`],Yo=[`written`,`overwritten`,`skipped-unsupported`,`skipped-prerequisite`,`declined`,`failed`,`removed`,`excluded`,`unchanged`,`handed-off`,`skipped-foreign`,`skipped-missing`,`no-op`];R(Yo),R([`info`,`warning`,`error`]);var Lte=R([`required`,`recommended`]),Xo=[...Re,`gemini`],Zo=R(Xo);function Qo(e){return Xo.includes(e)}var Rte=R([`acp`,`terminal`,`external`]),zte=R([...Ho,`gemini`]),Bte=R([`claude-cowork`,`claude-code`,`codex`,`cursor`,`copilot`,`opencode`,`pi`,`antigravity`,`openclaw`,`hermes`]),$o=R([`mcp`,`skill`]),es=[`project`,`user`,`session`],ts=R(es),ns=M().regex(/^[a-z0-9-]+\/[a-z0-9-]+\/[a-z0-9-]+\/[a-z0-9-]+$/).transform(e=>e),Vte=M().min(1).transform(e=>e),Hte=M().min(1).transform(e=>e);function rs(e){return`${e.agent}/${e.piece}/${e.scope}/${e.kind}`}function is(e){return e}function Ute(e){return e}var Wte=[`editor-user-config`,`editor-project-config`,`editor-project-skill-root`,`editor-user-skill-root`],as=is(`central-skill-store`);function ss(e,t){return is(`${e}:${t}`)}function Gte(e){if(e===as)return{kind:`central-skill-store`};let t=e.indexOf(`:`);if(t===-1)return null;let n=e.slice(0,t),r=e.slice(t+1);return!Wte.includes(n)||!Re.includes(r)?null:{kind:n,editor:r}}var Kte=e=>e===void 0?[]:Array.isArray(e)?[...e]:[e];function cs(e){let{sharedWith:t,prerequisites:n,consentClass:r,installability:i,preferred:a,troubleshooting:o,...s}=e;return{...s,troubleshooting:Kte(o),id:rs({agent:e.agent,piece:e.piece,scope:e.scope,kind:e.kind}),sharedWith:t??[],prerequisites:n??[],consentClass:r??`none`,installability:i??`installable`,preferred:a??!1}}function ls(e){let{offerOnlyWhenDetected:t,offersConnectionRow:n,detectionSources:r,modes:i,...a}=e,o={};for(let[e,t]of Object.entries(i))o[e]={requirements:t.requirements,caveats:t.caveats??[]};return{...a,offerOnlyWhenDetected:t??!1,offersConnectionRow:n??!1,detectionSources:r??[],modes:o}}var B=(e,t,n,r)=>rs({agent:e,piece:t,scope:n,kind:r}),us=e=>({piece:`mcp`,level:`required`,satisfiedByAny:e}),ds=e=>({piece:`skill`,level:`recommended`,satisfiedByAny:e}),fs=(...e)=>({mode:`probeable`,strictness:e}),qte=(e,t)=>({mode:`unprobeable`,reason:e,...t===void 0?{}:{note:t}}),ps=(e,t)=>({id:Ute(e),...t===void 0?{}:{params:t}}),Jte=(e,t)=>{let n=Ite.find(t=>t===e);return n===void 0?void 0:ps(`followup.${n}`,{agent:t})},V=(e,t)=>({kind:`source-read`,ref:e,...t===void 0?{}:{note:t}}),ms=(e,t)=>t===void 0?{confidence:`verified`,evidence:e}:{confidence:`verified`,evidence:e,verifiedAgainst:t},Yte=(e,t)=>({confidence:`contested`,evidence:e,verifiedAgainst:t});function hs(e){return{acpAgentId:e.acpAgentId,featuredOrder:e.featuredOrder,harnessCli:e.harnessCli,harnessReadsEditorConfig:e.readsEditorConfig,harnessReadsEditorConfigAttestation:e.readsEditorConfigAttestation,verifiedPosture:e.verifiedPosture}}function gs(e){let{appBrandName:t,tagline:n,...r}=e;return{...r,...t===void 0?{}:{appBrandName:t},...n===void 0?{}:{tagline:n}}}var _s=(e,t)=>({kind:`observation`,ref:e,note:t}),vs={observedAt:`2026-07-02`},H={cliEditors:`packages/cli/src/commands/editors.ts`,coreEditors:`packages/core/src/constants/editors.ts`,acpRegistry:`packages/server/src/acp/registry.ts`,threadManager:`packages/server/src/acp/thread-manager.ts`,writeProjectSkill:`packages/cli/src/integrations/write-project-skill.ts`,repairSkills:`packages/cli/src/commands/repair-skills.ts`,skillInstall:`packages/server/src/skill-install.ts`,presenceProbes:`packages/desktop/src/main/integrations-settings.ts`};function ys(e){return cs({agent:e.agent,piece:`mcp`,scope:`user`,kind:`config-entry`,pathId:ss(`editor-user-config`,e.agent),probe:fs(...e.strictness),attestation:e.attestation,audience:`this-user`,installability:e.installability,notInstallableReason:e.notInstallableReason,guidance:ps(`guidance.mcp.user-config`,{agent:e.agent}),troubleshooting:e.troubleshooting})}function bs(e){return cs({agent:e.agent,piece:`mcp`,scope:`project`,kind:`config-entry`,pathId:ss(`editor-project-config`,e.fileOwner??e.agent),sharedWith:e.sharedWith,consentClass:e.consentClass,probe:fs(...e.strictness),attestation:e.attestation,audience:`this-project`,guidance:ps(`guidance.mcp.project-config`,{agent:e.agent}),followup:Jte(e.consentClass,e.agent),troubleshooting:e.troubleshooting})}function xs(e){return cs({agent:e.agent,piece:`skill`,scope:`project`,kind:`skill-bundle-copy`,pathId:ss(`editor-project-skill-root`,e.agent),prerequisites:e.prerequisites,probe:fs(`reclaim-permissive`),attestation:e.attestation,audience:`this-project`,guidance:ps(`guidance.skill.project`,{agent:e.agent}),troubleshooting:e.troubleshooting})}function Ss(e){return cs({agent:e.agent,piece:`skill`,scope:`user`,kind:`skill-bundle-copy`,pathId:ss(`editor-user-skill-root`,e.agent),probe:fs(`reclaim-permissive`),attestation:e.attestation,audience:`this-user`,guidance:ps(`guidance.skill.user`,{agent:e.agent})})}function Cs(e){return cs({agent:e,piece:`mcp`,scope:`session`,kind:`session-injection`,probe:qte(`session-scoped`),attestation:ms([V(H.threadManager,`the session MCP config the thread manager builds per thread`)]),audience:`this-project`,installability:`not-installable`,notInstallableReason:`session-scoped`,guidance:ps(`guidance.mcp.session-injection`,{agent:e})})}var ws={claude:ls({id:`claude`,setupDocSlug:Ge.claude,offersConnectionRow:!0,detectionSources:[`cli-on-path:claude`,`scheme-handler:claude-code`],satisfiers:[ys({agent:`claude`,strictness:[`reclaim-permissive`,`pre-approval-exact`,`injection-functional`],attestation:ms([V(H.cliEditors,`user-global MCP config target`)])}),bs({agent:`claude`,sharedWith:[`copilot`],consentClass:`approve-once`,strictness:[`reclaim-permissive`,`pre-approval-exact`,`injection-functional`],attestation:ms([V(H.cliEditors),V(H.coreEditors)]),troubleshooting:ps(`troubleshooting.claude.project-entry-not-approved`,{agent:`claude`})}),xs({agent:`claude`,prerequisites:[B(`claude`,`mcp`,`project`,`config-entry`)],attestation:ms([V(H.coreEditors),V(H.repairSkills)])}),Ss({agent:`claude`,attestation:ms([V(H.coreEditors),V(H.skillInstall)])}),Cs(`claude`)],modes:{external:{requirements:[us([B(`claude`,`mcp`,`user`,`config-entry`),B(`claude`,`mcp`,`project`,`config-entry`)]),ds([B(`claude`,`skill`,`project`,`skill-bundle-copy`),B(`claude`,`skill`,`user`,`skill-bundle-copy`)])]},terminal:{requirements:[us([B(`claude`,`mcp`,`user`,`config-entry`),B(`claude`,`mcp`,`project`,`config-entry`)]),ds([B(`claude`,`skill`,`project`,`skill-bundle-copy`),B(`claude`,`skill`,`user`,`skill-bundle-copy`)])]},acp:{requirements:[us([B(`claude`,`mcp`,`session`,`session-injection`),B(`claude`,`mcp`,`user`,`config-entry`),B(`claude`,`mcp`,`project`,`config-entry`)]),ds([B(`claude`,`skill`,`project`,`skill-bundle-copy`),B(`claude`,`skill`,`user`,`skill-bundle-copy`)])]}},acp:hs({acpAgentId:`claude-acp`,featuredOrder:0,harnessCli:`claude`,readsEditorConfig:`claude`,readsEditorConfigAttestation:ms([V(H.threadManager,`the injection-skip probe reads the managed entry for this editor`),_s(`claude-acp adapter`,`The adapter runs Claude Code, which loads the MCP entry OK writes for the Claude editor on its own, so injecting a same-name duplicate would be redundant.`)],vs),verifiedPosture:`asks`}),external:gs({targetId:`claude-code`,knownOrder:1,visible:!0,displayName:`Claude`,appBrandName:`Claude Desktop`,schemes:[`claude:`],installUrl:`https://claude.com/download`,tagline:`Agentic coding in Claude Desktop's Code tab.`})}),"claude-desktop":ls({id:`claude-desktop`,setupDocSlug:Ge[`claude-desktop`],offersConnectionRow:!1,detectionSources:[`scheme-handler:claude-code`],satisfiers:[ys({agent:`claude-desktop`,strictness:[`reclaim-permissive`],attestation:ms([V(H.cliEditors,`user-global config target; its path resolution throws on Linux`)]),troubleshooting:ps(`troubleshooting.claude-desktop.per-tool-approval`,{agent:`claude-desktop`})})],modes:{external:{requirements:[us([B(`claude-desktop`,`mcp`,`user`,`config-entry`)]),ds([])]}},external:gs({targetId:`claude-cowork`,knownOrder:0,visible:!1,displayName:`Claude Cowork`,appBrandName:`Claude Desktop`,schemes:[`claude:`],installUrl:`https://claude.com/download`,tagline:`Conversational pairing in Claude Desktop's Cowork tab.`})}),cursor:ls({id:`cursor`,setupDocSlug:Ge.cursor,offersConnectionRow:!0,detectionSources:[`cli-on-path:cursor`,`scheme-handler:cursor`],satisfiers:[ys({agent:`cursor`,strictness:[`reclaim-permissive`],attestation:ms([V(H.cliEditors)])}),bs({agent:`cursor`,consentClass:`enable-manually`,strictness:[`reclaim-permissive`],attestation:ms([V(H.cliEditors),V(H.coreEditors),{kind:`observation`,ref:`cursor-3.19.19-project-server-default-off`,note:`project .cursor/mcp.json server listed Disabled under Customize → MCPs with no prompt; enabled via the per-source toggle in its Configure dialog; with a same-named user-level entry present, the user entry connected and the disabled project entry did not shadow it`}],{version:`3.19.19`,observedAt:`2026-09-09`}),troubleshooting:ps(`troubleshooting.cursor.project-entry-not-loaded`,{agent:`cursor`})}),xs({agent:`cursor`,prerequisites:[B(`cursor`,`mcp`,`project`,`config-entry`)],attestation:ms([V(H.coreEditors),V(H.repairSkills)])}),Ss({agent:`cursor`,attestation:ms([V(H.coreEditors),V(H.skillInstall)])}),Cs(`cursor`)],modes:{external:{requirements:[us([B(`cursor`,`mcp`,`user`,`config-entry`),B(`cursor`,`mcp`,`project`,`config-entry`)]),ds([B(`cursor`,`skill`,`project`,`skill-bundle-copy`),B(`cursor`,`skill`,`user`,`skill-bundle-copy`)])]},terminal:{requirements:[us([B(`cursor`,`mcp`,`user`,`config-entry`),B(`cursor`,`mcp`,`project`,`config-entry`)]),ds([B(`cursor`,`skill`,`project`,`skill-bundle-copy`),B(`cursor`,`skill`,`user`,`skill-bundle-copy`)])]},acp:{requirements:[us([B(`cursor`,`mcp`,`session`,`session-injection`)]),ds([B(`cursor`,`skill`,`project`,`skill-bundle-copy`),B(`cursor`,`skill`,`user`,`skill-bundle-copy`)])]}},acp:hs({acpAgentId:`cursor`,featuredOrder:3,harnessCli:`cursor`,readsEditorConfig:null,readsEditorConfigAttestation:ms([_s(`cursor-agent mcp list`,`Reports a config-declared entry that has not been approved as "not loaded (needs approval)", so a present entry says nothing about whether the agent will have the tools.`),V(H.threadManager,`the one agent the skip probe never stands down for`)],{observedAt:`2026-08-20`}),verifiedPosture:`self-managed`}),external:gs({targetId:`cursor`,knownOrder:3,visible:!0,displayName:`Cursor`,schemes:[`cursor:`],installUrl:`https://cursor.com/`,tagline:`AI-first VS Code fork with multi-file edits.`})}),codex:ls({id:`codex`,setupDocSlug:Ge.codex,offersConnectionRow:!0,detectionSources:[`cli-on-path:codex`,`scheme-handler:codex`],satisfiers:[ys({agent:`codex`,strictness:[`reclaim-permissive`,`injection-functional`],attestation:ms([V(H.cliEditors,`TOML user-global config target`)])}),bs({agent:`codex`,consentClass:`trust-gated`,strictness:[`reclaim-permissive`,`injection-functional`],attestation:Yte([V(H.cliEditors,`project config path added by analogy with the other editors`),{kind:`upstream-issue`,ref:`openai/codex#13025`,note:`open, reproduced on builds newer than the one OK checked`},{kind:`upstream-issue`,ref:`openai/codex#36960`,note:`requires an explicit trust decision in rust-v0.147.0, reverting #36935's automatic trust from the same release; builds from 0.113 asked but did not reliably persist the answer (#14547); codex exec never asks`},{kind:`vendor-doc`,ref:`OpenAI Codex: Advanced configuration`,note:`project-scoped config loads only for a trusted project`},{kind:`observation`,ref:`codex-desktop-project-config-load`,note:`single non-repro on 26.623.81905; the CLI honors it only for a trusted project`}],{version:`26.707.72221`,observedAt:`2026-07-15`}),troubleshooting:[ps(`troubleshooting.codex.desktop-project-config`,{agent:`codex`,honoredByDesktop:!1}),ps(`troubleshooting.codex.folder-trust`,{agent:`codex`})]}),xs({agent:`codex`,prerequisites:[B(`codex`,`mcp`,`project`,`config-entry`)],attestation:ms([V(H.coreEditors),V(H.repairSkills)]),troubleshooting:ps(`troubleshooting.codex.folder-trust`,{agent:`codex`})}),Ss({agent:`codex`,attestation:ms([V(H.coreEditors),V(H.skillInstall)])}),Cs(`codex`)],modes:{external:{requirements:[us([B(`codex`,`mcp`,`user`,`config-entry`),B(`codex`,`mcp`,`project`,`config-entry`)]),ds([B(`codex`,`skill`,`project`,`skill-bundle-copy`),B(`codex`,`skill`,`user`,`skill-bundle-copy`)])]},terminal:{requirements:[us([B(`codex`,`mcp`,`user`,`config-entry`),B(`codex`,`mcp`,`project`,`config-entry`)]),ds([B(`codex`,`skill`,`project`,`skill-bundle-copy`),B(`codex`,`skill`,`user`,`skill-bundle-copy`)])]},acp:{requirements:[us([B(`codex`,`mcp`,`session`,`session-injection`),B(`codex`,`mcp`,`user`,`config-entry`),B(`codex`,`mcp`,`project`,`config-entry`)]),ds([B(`codex`,`skill`,`project`,`skill-bundle-copy`),B(`codex`,`skill`,`user`,`skill-bundle-copy`)])]}},acp:hs({acpAgentId:`codex-acp`,featuredOrder:1,harnessCli:`codex`,readsEditorConfig:`codex`,readsEditorConfigAttestation:ms([V(H.cliEditors,`the managed MCP entry OK writes into the Codex TOML config`),_s(`codex-acp adapter`,`The adapter runs the Codex CLI, which loads the MCP servers declared in its own config, so the managed entry is already in the session.`)],vs),verifiedPosture:`self-managed`}),external:gs({targetId:`codex`,knownOrder:2,visible:!0,displayName:`ChatGPT`,appBrandName:`ChatGPT Desktop`,schemes:[`codex:`],installUrl:`https://developers.openai.com/codex/app`,tagline:`OpenAI's ChatGPT desktop app, home of the Codex agent.`})}),copilot:ls({id:`copilot`,setupDocSlug:Ge.copilot,offersConnectionRow:!0,detectionSources:[`cli-on-path:copilot`],satisfiers:[ys({agent:`copilot`,strictness:[`reclaim-permissive`],attestation:ms([V(H.cliEditors)])}),bs({agent:`copilot`,fileOwner:`claude`,sharedWith:[`claude`],consentClass:`trust-gated`,strictness:[`reclaim-permissive`],attestation:ms([{kind:`vendor-doc`,ref:`GitHub Copilot CLI — MCP configuration`,note:"reads workspace `.mcp.json` or `.github/mcp.json`"},{kind:`vendor-doc`,ref:`GitHub Docs: Adding MCP servers for Copilot CLI`,note:`project-level servers load only after folder-trust confirmation; skipped silently in untrusted folders; under copilot -p they load only in an already-trusted folder unless GITHUB_COPILOT_PROMPT_MODE_WORKSPACE_MCP=true`},V(H.coreEditors,`OK deliberately writes no second copy for copilot`)],{version:`copilot CLI 1.0.80`,observedAt:`2026-08-20`}),troubleshooting:ps(`troubleshooting.copilot.shared-workspace-config`,{agent:`copilot`,sourceAgent:`claude`})}),xs({agent:`copilot`,prerequisites:[B(`copilot`,`mcp`,`project`,`config-entry`),B(`copilot`,`mcp`,`user`,`config-entry`)],attestation:ms([V(H.coreEditors),V(H.writeProjectSkill)])}),Ss({agent:`copilot`,attestation:ms([V(H.coreEditors),V(H.skillInstall)])}),Cs(`copilot`)],modes:{external:{requirements:[us([B(`copilot`,`mcp`,`user`,`config-entry`),B(`copilot`,`mcp`,`project`,`config-entry`)]),ds([B(`copilot`,`skill`,`project`,`skill-bundle-copy`),B(`copilot`,`skill`,`user`,`skill-bundle-copy`)])]},terminal:{requirements:[us([B(`copilot`,`mcp`,`user`,`config-entry`),B(`copilot`,`mcp`,`project`,`config-entry`)]),ds([B(`copilot`,`skill`,`project`,`skill-bundle-copy`),B(`copilot`,`skill`,`user`,`skill-bundle-copy`)])]},acp:{requirements:[us([B(`copilot`,`mcp`,`session`,`session-injection`)]),ds([B(`copilot`,`skill`,`project`,`skill-bundle-copy`),B(`copilot`,`skill`,`user`,`skill-bundle-copy`)])]}},acp:hs({acpAgentId:`github-copilot-cli`,featuredOrder:4,harnessCli:null,readsEditorConfig:null,readsEditorConfigAttestation:{confidence:`assumed`,evidence:[_s(`copilot CLI 1.0.80`,"The CLI does read a workspace `.mcp.json`, but nobody has observed the ACP adapter loading the managed entry inside a session. Claiming it would stand our injection down on an unverified read and risk a thread with no OK tools, so the claim stays unmade and OK keeps injecting.")],verifiedAgainst:{version:`1.0.80`,observedAt:`2026-08-20`}},verifiedPosture:null}),external:gs({targetId:`copilot`,knownOrder:4,visible:!1,displayName:`GitHub Copilot`,schemes:[],installUrl:`https://docs.github.com/en/copilot/how-tos/copilot-cli/cli-getting-started`,tagline:`GitHub's terminal-native coding agent.`})}),opencode:ls({id:`opencode`,setupDocSlug:Ge.opencode,offersConnectionRow:!0,detectionSources:[`cli-on-path:opencode`],satisfiers:[ys({agent:`opencode`,strictness:[`reclaim-permissive`,`injection-functional`],attestation:ms([V(H.cliEditors,`XDG config dir; the win32 location is by analogy and unverified`)])}),bs({agent:`opencode`,consentClass:`none`,strictness:[`reclaim-permissive`,`injection-functional`],attestation:ms([V(H.cliEditors,`the one project config that is not under a dotdir`)])}),xs({agent:`opencode`,prerequisites:[B(`opencode`,`mcp`,`project`,`config-entry`)],attestation:ms([V(H.coreEditors),V(H.repairSkills)])}),Ss({agent:`opencode`,attestation:ms([V(H.coreEditors),V(H.skillInstall)])}),Cs(`opencode`)],modes:{external:{requirements:[us([B(`opencode`,`mcp`,`user`,`config-entry`),B(`opencode`,`mcp`,`project`,`config-entry`)]),ds([B(`opencode`,`skill`,`project`,`skill-bundle-copy`),B(`opencode`,`skill`,`user`,`skill-bundle-copy`)])]},terminal:{requirements:[us([B(`opencode`,`mcp`,`user`,`config-entry`),B(`opencode`,`mcp`,`project`,`config-entry`)]),ds([B(`opencode`,`skill`,`project`,`skill-bundle-copy`),B(`opencode`,`skill`,`user`,`skill-bundle-copy`)])]},acp:{requirements:[us([B(`opencode`,`mcp`,`session`,`session-injection`),B(`opencode`,`mcp`,`user`,`config-entry`),B(`opencode`,`mcp`,`project`,`config-entry`)]),ds([B(`opencode`,`skill`,`project`,`skill-bundle-copy`),B(`opencode`,`skill`,`user`,`skill-bundle-copy`)])]}},acp:hs({acpAgentId:`opencode`,featuredOrder:5,harnessCli:`opencode`,readsEditorConfig:`opencode`,readsEditorConfigAttestation:ms([V(H.cliEditors,`the managed MCP entry OK writes into the opencode config`),_s(`opencode-acp adapter`,`The adapter runs opencode, which loads its own configured MCP servers, so the managed entry is already in the session.`)],vs),verifiedPosture:null}),external:gs({targetId:`opencode`,knownOrder:5,visible:!1,displayName:`OpenCode`,schemes:[],installUrl:`https://opencode.ai`,tagline:`Open-source terminal coding agent; bring any local model.`})}),openclaw:ls({id:`openclaw`,setupDocSlug:Ge.openclaw,offersConnectionRow:!0,offerOnlyWhenDetected:!0,detectionSources:[`cli-on-path:openclaw`],satisfiers:[ys({agent:`openclaw`,strictness:[`reclaim-permissive`],attestation:ms([V(H.cliEditors,"the one two-level server map, nested under `mcp.servers`")])}),cs({agent:`openclaw`,piece:`skill`,scope:`user`,kind:`central-store-copy`,pathId:as,probe:fs(`reclaim-permissive`),attestation:ms([V(H.coreEditors),V(H.skillInstall,`the hub is written only when it already exists`)]),audience:`this-user`,guidance:ps(`guidance.skill.central-store`,{agent:`openclaw`}),troubleshooting:ps(`troubleshooting.openclaw.central-store-missing`,{agent:`openclaw`})})],modes:{external:{requirements:[us([B(`openclaw`,`mcp`,`user`,`config-entry`)]),ds([B(`openclaw`,`skill`,`user`,`central-store-copy`)])]},terminal:{requirements:[us([B(`openclaw`,`mcp`,`user`,`config-entry`)]),ds([B(`openclaw`,`skill`,`user`,`central-store-copy`)])]}},external:gs({targetId:`openclaw`,knownOrder:8,visible:!1,displayName:`OpenClaw`,schemes:[],installUrl:`https://openclaw.ai`,tagline:`Open-source agent gateway; runs agents against your MCP servers.`})}),pi:ls({id:`pi`,setupDocSlug:Ge.pi,offersConnectionRow:!0,detectionSources:[`cli-on-path:pi`],satisfiers:[cs({agent:`pi`,piece:`mcp`,scope:`project`,kind:`managed-file`,pathId:ss(`editor-project-config`,`pi`),probe:fs(`reclaim-permissive`,`injection-functional`),attestation:ms([V(H.cliEditors,`OK owns the whole file; currency is a first-line sentinel`),V(H.acpRegistry,`the thread provisions this file instead of injecting`)]),audience:`this-project`,guidance:ps(`guidance.mcp.managed-file`,{agent:`pi`}),troubleshooting:ps(`troubleshooting.pi.folder-trust`,{agent:`pi`})}),xs({agent:`pi`,prerequisites:[B(`pi`,`mcp`,`project`,`managed-file`)],attestation:ms([V(H.coreEditors),V(H.writeProjectSkill)]),troubleshooting:ps(`troubleshooting.pi.folder-trust`,{agent:`pi`})}),Ss({agent:`pi`,attestation:ms([V(H.coreEditors,`the agent home nests one level below the dotdir`),V(H.skillInstall)])})],modes:{external:{requirements:[us([B(`pi`,`mcp`,`project`,`managed-file`)]),ds([B(`pi`,`skill`,`project`,`skill-bundle-copy`),B(`pi`,`skill`,`user`,`skill-bundle-copy`)])]},terminal:{requirements:[us([B(`pi`,`mcp`,`project`,`managed-file`)]),ds([B(`pi`,`skill`,`project`,`skill-bundle-copy`),B(`pi`,`skill`,`user`,`skill-bundle-copy`)])]},acp:{requirements:[us([B(`pi`,`mcp`,`project`,`managed-file`)]),ds([B(`pi`,`skill`,`project`,`skill-bundle-copy`),B(`pi`,`skill`,`user`,`skill-bundle-copy`)])]}},acp:hs({acpAgentId:`pi-acp`,featuredOrder:null,harnessCli:`pi`,readsEditorConfig:`pi`,readsEditorConfigAttestation:ms([_s(`pi-acp@0.0.33`,"Pi has no MCP client at all: it accepts `mcpServers` at session/new, stores them write-only and never connects. Its wiring is a managed extension FILE in the project, which OK provisions instead of injecting — the same mapping, a different shape."),V(H.threadManager,`the bridge route that provisions the extension instead of injecting`)],{version:`0.0.33`,observedAt:`2026-08-20`}),verifiedPosture:`autonomous`}),external:gs({targetId:`pi`,knownOrder:6,visible:!1,displayName:`Pi`,schemes:[],installUrl:`https://pi.dev`,tagline:`Minimal open-source terminal coding agent, extensible in TypeScript.`})}),antigravity:ls({id:`antigravity`,setupDocSlug:Ge.antigravity,offersConnectionRow:!0,offerOnlyWhenDetected:!0,detectionSources:[`cli-on-path:antigravity`],satisfiers:[ys({agent:`antigravity`,strictness:[`reclaim-permissive`],attestation:ms([V(H.cliEditors,`one user-global file shared by the IDE, the app and the CLI; per project you can only filter it`)])}),Ss({agent:`antigravity`,attestation:ms([V(H.coreEditors),V(H.skillInstall)])})],modes:{external:{requirements:[us([B(`antigravity`,`mcp`,`user`,`config-entry`)]),ds([B(`antigravity`,`skill`,`user`,`skill-bundle-copy`)])]},terminal:{requirements:[us([B(`antigravity`,`mcp`,`user`,`config-entry`)]),ds([B(`antigravity`,`skill`,`user`,`skill-bundle-copy`)])]}},external:gs({targetId:`antigravity`,knownOrder:7,visible:!1,displayName:`Antigravity`,schemes:[],installUrl:`https://antigravity.google`,tagline:"Google's agentic IDE + `agy` terminal agent."})}),"lm-studio":ls({id:`lm-studio`,setupDocSlug:Ge[`lm-studio`],offersConnectionRow:!0,offerOnlyWhenDetected:!0,detectionSources:[],satisfiers:[ys({agent:`lm-studio`,strictness:[`reclaim-permissive`],installability:`not-installable`,notInstallableReason:`no-non-interactive-verb`,attestation:ms([V(H.cliEditors,`two candidate locations, resolved against what already exists`),{kind:`upstream-issue`,ref:`lmstudio-ai/lmstudio-bug-tracker#1371`,note:`documented config path differs from the one the app reads on macOS`},V(H.presenceProbes,`deliberately absent from the presence probes`)]),troubleshooting:ps(`troubleshooting.lm-studio.config-path-mismatch`,{agent:`lm-studio`})})],modes:{external:{requirements:[us([B(`lm-studio`,`mcp`,`user`,`config-entry`)]),ds([])]}}}),hermes:ls({id:`hermes`,setupDocSlug:Ge.hermes,offersConnectionRow:!0,offerOnlyWhenDetected:!0,detectionSources:[`cli-on-path:hermes`],satisfiers:[ys({agent:`hermes`,strictness:[`reclaim-permissive`],attestation:ms([V(H.cliEditors,`the one YAML target; the whole config is a single user-global file`)])})],modes:{external:{requirements:[us([B(`hermes`,`mcp`,`user`,`config-entry`)]),ds([])]},terminal:{requirements:[us([B(`hermes`,`mcp`,`user`,`config-entry`)]),ds([])]}},external:gs({targetId:`hermes`,knownOrder:9,visible:!1,displayName:`Hermes`,schemes:[],installUrl:`https://hermes-agent.nousresearch.com`,tagline:`Nous Research's terminal coding agent.`})}),gemini:ls({id:`gemini`,setupDocSlug:null,detectionSources:[`harness-bin:gemini`],satisfiers:[Cs(`gemini`)],modes:{acp:{requirements:[us([B(`gemini`,`mcp`,`session`,`session-injection`)]),ds([])]}},acp:hs({acpAgentId:`gemini`,featuredOrder:2,harnessCli:`gemini`,readsEditorConfig:null,readsEditorConfigAttestation:ms([V(H.coreEditors,`gemini reaches OK as an ACP agent only; it has no editor config target`)],vs),verifiedPosture:null})})};function Ts(e){return ws[e]}var Es=Object.values(ws).flatMap(e=>e.satisfiers),Xte=new Map(Es.map(e=>[e.id,e]));function Ds(e){return Xte.get(e)}var Os=Object.values(ws).flatMap(e=>e.acp===void 0?[]:[{record:e,acp:e.acp}]).sort((e,t)=>e.acp.acpAgentId.localeCompare(t.acp.acpAgentId));Os.filter(({acp:e})=>e.featuredOrder!==null).sort((e,t)=>(e.acp.featuredOrder??0)-(t.acp.featuredOrder??0)).map(({acp:e})=>e.acpAgentId);var Zte=Object.fromEntries(Os.flatMap(({acp:e})=>e.harnessCli===null?[]:[[e.acpAgentId,e.harnessCli]]));Object.fromEntries(Os.flatMap(({acp:e})=>e.harnessReadsEditorConfig===null?[]:[[e.acpAgentId,e.harnessReadsEditorConfig]]));var Qte=Object.fromEntries(Os.flatMap(({acp:e})=>e.verifiedPosture===null?[]:[[e.acpAgentId,e.verifiedPosture]])),ks=Object.values(ws).flatMap(e=>e.external===void 0?[]:[e.external]).sort((e,t)=>e.knownOrder-t.knownOrder),As=ks.map(({targetId:e,displayName:t,appBrandName:n,schemes:r,installUrl:i,tagline:a})=>({id:e,displayName:t,...n===void 0?{}:{appBrandName:n},schemes:r,installUrl:i,...a===void 0?{}:{tagline:a}})),$te=new Set(ks.filter(e=>e.visible).map(e=>e.targetId)),ene=As.filter(e=>$te.has(e.id)),tne=Re.filter(e=>ws[e].offersConnectionRow),nne=new Map(Object.values(ws).flatMap(e=>e.external===void 0?[]:[[e.external.targetId,e.id]]));function rne(e){return nne.get(e)}var ine=new Map(Object.values(ws).flatMap(e=>e.modes.terminal===void 0?[]:[[e.id,e.id]]));function ane(e){return ine.get(e)}Object.fromEntries(Object.values(ws).flatMap(e=>{let t=e.satisfiers.find(e=>e.piece===`mcp`&&e.scope===`project`&&e.consentClass!==`none`)?.consentClass;return t===void 0?[]:[[e.id,t]]}));var js=Symbol.for(`yaml.alias`),Ms=Symbol.for(`yaml.document`),Ns=Symbol.for(`yaml.map`),Ps=Symbol.for(`yaml.pair`),Fs=Symbol.for(`yaml.scalar`),Is=Symbol.for(`yaml.seq`),Ls=Symbol.for(`yaml.node.type`),Rs=e=>!!e&&typeof e==`object`&&e[Ls]===js,zs=e=>!!e&&typeof e==`object`&&e[Ls]===Ms,Bs=e=>!!e&&typeof e==`object`&&e[Ls]===Ns,Vs=e=>!!e&&typeof e==`object`&&e[Ls]===Ps,Hs=e=>!!e&&typeof e==`object`&&e[Ls]===Fs,Us=e=>!!e&&typeof e==`object`&&e[Ls]===Is;function Ws(e){if(e&&typeof e==`object`)switch(e[Ls]){case Ns:case Is:return!0}return!1}function Gs(e){if(e&&typeof e==`object`)switch(e[Ls]){case js:case Ns:case Fs:case Is:return!0}return!1}var Ks=e=>(Hs(e)||Ws(e))&&!!e.anchor,qs=Symbol(`break visit`),Js=Symbol(`skip children`),Ys=Symbol(`remove node`);function Xs(e,t){let n=ec(t);zs(e)?Zs(null,e.contents,n,Object.freeze([e]))===Ys&&(e.contents=null):Zs(null,e,n,Object.freeze([]))}Xs.BREAK=qs,Xs.SKIP=Js,Xs.REMOVE=Ys;function Zs(e,t,n,r){let i=tc(e,t,n,r);if(Gs(i)||Vs(i))return nc(e,r,i),Zs(e,i,n,r);if(typeof i!=`symbol`){if(Ws(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=Zs(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===qs)return qs;else i===Ys&&(t.items.splice(e,1),--e)}}else if(Vs(t)){r=Object.freeze(r.concat(t));let e=Zs(`key`,t.key,n,r);if(e===qs)return qs;e===Ys&&(t.key=null);let i=Zs(`value`,t.value,n,r);if(i===qs)return qs;i===Ys&&(t.value=null)}}return i}async function Qs(e,t){let n=ec(t);zs(e)?await $s(null,e.contents,n,Object.freeze([e]))===Ys&&(e.contents=null):await $s(null,e,n,Object.freeze([]))}Qs.BREAK=qs,Qs.SKIP=Js,Qs.REMOVE=Ys;async function $s(e,t,n,r){let i=await tc(e,t,n,r);if(Gs(i)||Vs(i))return nc(e,r,i),$s(e,i,n,r);if(typeof i!=`symbol`){if(Ws(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=await $s(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===qs)return qs;else i===Ys&&(t.items.splice(e,1),--e)}}else if(Vs(t)){r=Object.freeze(r.concat(t));let e=await $s(`key`,t.key,n,r);if(e===qs)return qs;e===Ys&&(t.key=null);let i=await $s(`value`,t.value,n,r);if(i===qs)return qs;i===Ys&&(t.value=null)}}return i}function ec(e){return typeof e==`object`&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function tc(e,t,n,r){if(typeof n==`function`)return n(e,t,r);if(Bs(t))return n.Map?.(e,t,r);if(Us(t))return n.Seq?.(e,t,r);if(Vs(t))return n.Pair?.(e,t,r);if(Hs(t))return n.Scalar?.(e,t,r);if(Rs(t))return n.Alias?.(e,t,r)}function nc(e,t,n){let r=t[t.length-1];if(Ws(r))r.items[e]=n;else if(Vs(r))e===`key`?r.key=n:r.value=n;else if(zs(r))r.contents=n;else{let e=Rs(r)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}var one={"!":`%21`,",":`%2C`,"[":`%5B`,"]":`%5D`,"{":`%7B`,"}":`%7D`},sne=e=>e.replace(/[!,[\]{}]/g,e=>one[e]),rc=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case`1.1`:this.atNextDocument=!0;break;case`1.2`:this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:`1.2`},this.tags=Object.assign({},e.defaultTags);break}return t}add(t,n){this.atNextDocument&&=(this.yaml={explicit:e.defaultYaml.explicit,version:`1.1`},this.tags=Object.assign({},e.defaultTags),!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case`%TAG`:{if(r.length!==2&&(n(0,`%TAG directive should contain exactly two parts`),r.length<2))return!1;let[e,t]=r;return this.tags[e]=t,!0}case`%YAML`:{if(this.yaml.explicit=!0,r.length!==1)return n(0,`%YAML directive should contain exactly one part`),!1;let[e]=r;if(e===`1.1`||e===`1.2`)return this.yaml.version=e,!0;{let t=/^\d+\.\d+$/.test(e);return n(6,`Unsupported YAML version ${e}`,t),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e===`!`)return`!`;if(e[0]!==`!`)return t(`Not a valid tag: ${e}`),null;if(e[1]===`<`){let n=e.slice(2,-1);return n===`!`||n===`!!`?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==`>`&&t(`Verbatim tags must end with a >`),n)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(e){return t(String(e)),null}return n===`!`?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+sne(e.substring(n.length));return e[0]===`!`?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||`1.2`}`]:[],n=Object.entries(this.tags),r;if(e&&n.length>0&&Gs(e.contents)){let t={};Xs(e.contents,(e,n)=>{Gs(n)&&n.tag&&(t[n.tag]=!0)}),r=Object.keys(t)}else r=[];for(let[i,a]of n)i===`!!`&&a===`tag:yaml.org,2002:`||(!e||r.some(e=>e.startsWith(a)))&&t.push(`%TAG ${i} ${a}`);return t.join(`
65
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function ui(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,`~standard`,{value:{...t[`~standard`],jsonSchema:{input:pi(t,`input`,e.processors),output:pi(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function di(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return di(r.element,n);if(r.type===`set`)return di(r.valueType,n);if(r.type===`lazy`)return di(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type===`default`||r.type===`prefault`)return di(r.innerType,n);if(r.type===`intersection`)return di(r.left,n)||di(r.right,n);if(r.type===`record`||r.type===`map`)return di(r.keyType,n)||di(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:di(r.in,n)||di(r.out,n);if(r.type===`object`){for(let e in r.shape)if(di(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(di(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(di(e,n))return!0;return!!(r.rest&&di(r.rest,n))}return!1}var fi=(e,t={})=>n=>{let r=si({...n,processors:t});return ci(e,r),li(r,e),ui(r,e)},pi=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=si({...i??{},target:a,io:t,processors:n});return ci(e,o),li(o,e),ui(o,e)},mi={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},hi=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=mi[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},gi=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(i.multipleOf=c)},_i=(e,t,n,r)=>{n.type=`boolean`},vi=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},yi=(e,t,n,r)=>{n.not={}},bi=(e,t,n,r)=>{let i=e._zod.def,a=nt(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},xi=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},Si=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},Ci=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},wi=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=ci(a.element,t,{...r,path:[...r.path,`items`]})},Ti=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=ci(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=ci(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Ei=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>ci(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Di=(e,t,n,r)=>{let i=e._zod.def,a=ci(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=ci(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},Oi=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=ci(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else (t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=ci(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=ci(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},ki=(e,t,n,r)=>{let i=e._zod.def,a=ci(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Ai=(e,t,n,r)=>{let i=e._zod.def;ci(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},ji=(e,t,n,r)=>{let i=e._zod.def;ci(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Mi=(e,t,n,r)=>{let i=e._zod.def;ci(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Ni=(e,t,n,r)=>{let i=e._zod.def;ci(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},Pi=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;ci(o,t,r);let s=t.seen.get(e);s.ref=o},Fi=(e,t,n,r)=>{let i=e._zod.def;ci(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Ii=(e,t,n,r)=>{let i=e._zod.def;ci(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Li=(e,t,n,r)=>{let i=e._zod.innerType;ci(i,t,r);let a=t.seen.get(e);a.ref=i},Ri=A(`ZodISODateTime`,(e,t)=>{Eee.init(e,t),ua.init(e,t)});function zi(e){return Er(Ri,e)}var Bi=A(`ZodISODate`,(e,t)=>{Dee.init(e,t),ua.init(e,t)});function Vi(e){return Dr(Bi,e)}var Hi=A(`ZodISOTime`,(e,t)=>{Oee.init(e,t),ua.init(e,t)});function Ui(e){return Or(Hi,e)}var Wi=A(`ZodISODuration`,(e,t)=>{kee.init(e,t),ua.init(e,t)});function Gi(e){return kr(Wi,e)}var Ki=A(`ZodError`,(e,t)=>{Ft.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>cee(e,t)},flatten:{value:t=>see(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,rt,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,rt,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),qi=Lt(Ki),Ji=Rt(Ki),Yi=zt(Ki),Xi=Bt(Ki),Zi=pee(Ki),Qi=mee(Ki),$i=hee(Ki),ea=gee(Ki),ta=_ee(Ki),na=vee(Ki),ra=yee(Ki),ia=bee(Ki),aa=new WeakMap;function oa(e,t,n){let r=Object.getPrototypeOf(e),i=aa.get(r);if(i||(i=new Set,aa.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var sa=A(`ZodType`,(e,t)=>(In.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:pi(e,`input`),output:pi(e,`output`)}}),e.toJSONSchema=fi(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,`_def`,{value:t}),e.parse=(t,n)=>qi(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Yi(e,t,n),e.parseAsync=async(t,n)=>Ji(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Xi(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Zi(e,t,n),e.decode=(t,n)=>Qi(e,t,n),e.encodeAsync=async(t,n)=>$i(e,t,n),e.decodeAsync=async(t,n)=>ea(e,t,n),e.safeEncode=(t,n)=>ta(e,t,n),e.safeDecode=(t,n)=>na(e,t,n),e.safeEncodeAsync=async(t,n)=>ra(e,t,n),e.safeDecodeAsync=async(t,n)=>ia(e,t,n),oa(e,`ZodType`,{check(...e){let t=this.def;return this.clone(dt(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return bt(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Oo(e,t))},superRefine(e,t){return this.check(ko(e,t))},overwrite(e){return this.check(Xr(e))},optional(){return ao(this)},exactOptional(){return so(this)},nullable(){return lo(this)},nullish(){return ao(lo(this))},nonoptional(e){return go(this,e)},array(){return F(this)},or(e){return Ka([this,e])},and(e){return Xa(this,e)},transform(e){return bo(this,ro(e))},default(e){return fo(this,e)},prefault(e){return mo(this,e)},catch(e){return vo(this,e)},pipe(e){return bo(this,e)},readonly(){return Co(this)},describe(e){let t=this.clone();return mr.add(t,{description:e}),t},meta(...e){if(e.length===0)return mr.get(this);let t=this.clone();return mr.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,`description`,{get(){return mr.get(e)?.description},configurable:!0}),e)),ca=A(`_ZodString`,(e,t)=>{Ln.init(e,t),sa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hi(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,oa(e,`_ZodString`,{regex(...e){return this.check(Wr(...e))},includes(...e){return this.check(qr(...e))},startsWith(...e){return this.check(Jr(...e))},endsWith(...e){return this.check(Yr(...e))},min(...e){return this.check(Hr(...e))},max(...e){return this.check(Vr(...e))},length(...e){return this.check(Ur(...e))},nonempty(...e){return this.check(Hr(1,...e))},lowercase(e){return this.check(Gr(e))},uppercase(e){return this.check(Kr(e))},trim(){return this.check(Qr())},normalize(...e){return this.check(Zr(...e))},toLowerCase(){return this.check($r())},toUpperCase(){return this.check(ei())},slugify(){return this.check(ti())}})}),la=A(`ZodString`,(e,t)=>{Ln.init(e,t),ca.init(e,t),e.email=t=>e.check(hr(da,t)),e.url=t=>e.check(_r(ha,t)),e.jwt=t=>e.check(Tr(ja,t)),e.emoji=t=>e.check(gte(_a,t)),e.guid=t=>e.check(gr(pa,t)),e.uuid=t=>e.check(fte(ma,t)),e.uuidv4=t=>e.check(pte(ma,t)),e.uuidv6=t=>e.check(mte(ma,t)),e.uuidv7=t=>e.check(hte(ma,t)),e.nanoid=t=>e.check(_te(va,t)),e.guid=t=>e.check(gr(pa,t)),e.cuid=t=>e.check(vte(ya,t)),e.cuid2=t=>e.check(yte(ba,t)),e.ulid=t=>e.check(bte(xa,t)),e.base64=t=>e.check(Sr(Oa,t)),e.base64url=t=>e.check(Cr(ka,t)),e.xid=t=>e.check(xte(Sa,t)),e.ksuid=t=>e.check(Ste(Ca,t)),e.ipv4=t=>e.check(vr(wa,t)),e.ipv6=t=>e.check(yr(Ta,t)),e.cidrv4=t=>e.check(br(Ea,t)),e.cidrv6=t=>e.check(xr(Da,t)),e.e164=t=>e.check(wr(Aa,t)),e.datetime=t=>e.check(zi(t)),e.date=t=>e.check(Vi(t)),e.time=t=>e.check(Ui(t)),e.duration=t=>e.check(Gi(t))});function M(e){return dte(la,e)}var ua=A(`ZodStringFormat`,(e,t)=>{Rn.init(e,t),ca.init(e,t)}),da=A(`ZodEmail`,(e,t)=>{Vn.init(e,t),ua.init(e,t)});function fa(e){return hr(da,e)}var pa=A(`ZodGUID`,(e,t)=>{zn.init(e,t),ua.init(e,t)}),ma=A(`ZodUUID`,(e,t)=>{Bn.init(e,t),ua.init(e,t)}),ha=A(`ZodURL`,(e,t)=>{Hn.init(e,t),ua.init(e,t)});function ga(e){return _r(ha,e)}var _a=A(`ZodEmoji`,(e,t)=>{Un.init(e,t),ua.init(e,t)}),va=A(`ZodNanoID`,(e,t)=>{Wn.init(e,t),ua.init(e,t)}),ya=A(`ZodCUID`,(e,t)=>{Gn.init(e,t),ua.init(e,t)}),ba=A(`ZodCUID2`,(e,t)=>{Kn.init(e,t),ua.init(e,t)}),xa=A(`ZodULID`,(e,t)=>{qn.init(e,t),ua.init(e,t)}),Sa=A(`ZodXID`,(e,t)=>{wee.init(e,t),ua.init(e,t)}),Ca=A(`ZodKSUID`,(e,t)=>{Tee.init(e,t),ua.init(e,t)}),wa=A(`ZodIPv4`,(e,t)=>{Aee.init(e,t),ua.init(e,t)}),Ta=A(`ZodIPv6`,(e,t)=>{jee.init(e,t),ua.init(e,t)}),Ea=A(`ZodCIDRv4`,(e,t)=>{Mee.init(e,t),ua.init(e,t)}),Da=A(`ZodCIDRv6`,(e,t)=>{Nee.init(e,t),ua.init(e,t)}),Oa=A(`ZodBase64`,(e,t)=>{Pee.init(e,t),ua.init(e,t)}),ka=A(`ZodBase64URL`,(e,t)=>{Iee.init(e,t),ua.init(e,t)}),Aa=A(`ZodE164`,(e,t)=>{Lee.init(e,t),ua.init(e,t)}),ja=A(`ZodJWT`,(e,t)=>{zee.init(e,t),ua.init(e,t)}),Ma=A(`ZodNumber`,(e,t)=>{Yn.init(e,t),sa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gi(e,t,n,r),oa(e,`ZodNumber`,{gt(e,t){return this.check(Rr(e,t))},gte(e,t){return this.check(zr(e,t))},min(e,t){return this.check(zr(e,t))},lt(e,t){return this.check(Ir(e,t))},lte(e,t){return this.check(Lr(e,t))},max(e,t){return this.check(Lr(e,t))},int(e){return this.check(Pa(e))},safe(e){return this.check(Pa(e))},positive(e){return this.check(Rr(0,e))},nonnegative(e){return this.check(zr(0,e))},negative(e){return this.check(Ir(0,e))},nonpositive(e){return this.check(Lr(0,e))},multipleOf(e,t){return this.check(Br(e,t))},step(e,t){return this.check(Br(e,t))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function N(e){return Ar(Ma,e)}var Na=A(`ZodNumberFormat`,(e,t)=>{Bee.init(e,t),Ma.init(e,t)});function Pa(e){return jr(Na,e)}var Fa=A(`ZodBoolean`,(e,t)=>{Vee.init(e,t),sa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_i(e,t,n,r)});function P(e){return Mr(Fa,e)}var Ia=A(`ZodNull`,(e,t)=>{Hee.init(e,t),sa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vi(e,t,n,r)});function La(e){return Nr(Ia,e)}var Ra=A(`ZodUnknown`,(e,t)=>{Uee.init(e,t),sa.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function za(){return Pr(Ra)}var Ba=A(`ZodNever`,(e,t)=>{Wee.init(e,t),sa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yi(e,t,n,r)});function Va(e){return Fr(Ba,e)}var Ha=A(`ZodArray`,(e,t)=>{Gee.init(e,t),sa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wi(e,t,n,r),e.element=t.element,oa(e,`ZodArray`,{min(e,t){return this.check(Hr(e,t))},nonempty(e){return this.check(Hr(1,e))},max(e,t){return this.check(Vr(e,t))},length(e,t){return this.check(Ur(e,t))},unwrap(){return this.element}})});function F(e,t){return ni(Ha,e,t)}var Ua=A(`ZodObject`,(e,t)=>{qee.init(e,t),sa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ti(e,t,n,r),lt(e,`shape`,()=>t.shape),oa(e,`ZodObject`,{keyof(){return R(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:za()})},loose(){return this.clone({...this._zod.def,catchall:za()})},strict(){return this.clone({...this._zod.def,catchall:Va()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return St(this,e)},safeExtend(e){return Ct(this,e)},merge(e){return wt(this,e)},pick(e){return oee(this,e)},omit(e){return xt(this,e)},partial(...e){return Tt(io,this,e[0])},required(...e){return Et(ho,this,e[0])}})});function I(e,t){return new Ua({type:`object`,shape:e??{},...j(t)})}function Wa(e,t){return new Ua({type:`object`,shape:e,catchall:Va(),...j(t)})}function L(e,t){return new Ua({type:`object`,shape:e,catchall:za(),...j(t)})}var Ga=A(`ZodUnion`,(e,t)=>{tr.init(e,t),sa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ei(e,t,n,r),e.options=t.options});function Ka(e,t){return new Ga({type:`union`,options:e,...j(t)})}var qa=A(`ZodDiscriminatedUnion`,(e,t)=>{Ga.init(e,t),Jee.init(e,t)});function Ja(e,t,n){return new qa({type:`union`,options:t,discriminator:e,...j(n)})}var Ya=A(`ZodIntersection`,(e,t)=>{Yee.init(e,t),sa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Di(e,t,n,r)});function Xa(e,t){return new Ya({type:`intersection`,left:e,right:t})}var Za=A(`ZodRecord`,(e,t)=>{Xee.init(e,t),sa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Oi(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function Qa(e,t,n){return!t||!t._zod?new Za({type:`record`,keyType:M(),valueType:e,...j(t)}):new Za({type:`record`,keyType:e,valueType:t,...j(n)})}function $a(e,t,n){let r=bt(e);return r._zod.values=void 0,new Za({type:`record`,keyType:r,valueType:t,...j(n)})}var eo=A(`ZodEnum`,(e,t)=>{Zee.init(e,t),sa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bi(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new eo({...t,checks:[],...j(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new eo({...t,checks:[],...j(r),entries:i})}});function R(e,t){return new eo({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...j(t)})}var to=A(`ZodLiteral`,(e,t)=>{Qee.init(e,t),sa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xi(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,`value`,{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function z(e,t){return new to({type:`literal`,values:Array.isArray(e)?e:[e],...j(t)})}var no=A(`ZodTransform`,(e,t)=>{$ee.init(e,t),sa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ci(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new $e(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Nt(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(Nt(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function ro(e){return new no({type:`transform`,transform:e})}var io=A(`ZodOptional`,(e,t)=>{ar.init(e,t),sa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ii(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ao(e){return new io({type:`optional`,innerType:e})}var oo=A(`ZodExactOptional`,(e,t)=>{ete.init(e,t),sa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ii(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function so(e){return new oo({type:`optional`,innerType:e})}var co=A(`ZodNullable`,(e,t)=>{tte.init(e,t),sa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ki(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function lo(e){return new co({type:`nullable`,innerType:e})}var uo=A(`ZodDefault`,(e,t)=>{nte.init(e,t),sa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ji(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function fo(e,t){return new uo({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():vt(t)}})}var po=A(`ZodPrefault`,(e,t)=>{rte.init(e,t),sa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function mo(e,t){return new po({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():vt(t)}})}var ho=A(`ZodNonOptional`,(e,t)=>{ite.init(e,t),sa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ai(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function go(e,t){return new ho({type:`nonoptional`,innerType:e,...j(t)})}var _o=A(`ZodCatch`,(e,t)=>{ate.init(e,t),sa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ni(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function vo(e,t){return new _o({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var yo=A(`ZodPipe`,(e,t)=>{cr.init(e,t),sa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Pi(e,t,n,r),e.in=t.in,e.out=t.out});function bo(e,t){return new yo({type:`pipe`,in:e,out:t})}var xo=A(`ZodPreprocess`,(e,t)=>{yo.init(e,t),ote.init(e,t)}),So=A(`ZodReadonly`,(e,t)=>{ste.init(e,t),sa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Co(e){return new So({type:`readonly`,innerType:e})}var wo=A(`ZodLazy`,(e,t)=>{cte.init(e,t),sa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Li(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function To(e){return new wo({type:`lazy`,getter:e})}var Eo=A(`ZodCustom`,(e,t)=>{lte.init(e,t),sa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Si(e,t,n,r)});function Do(e,t){return ri(Eo,e??(()=>!0),t)}function Oo(e,t={}){return ii(Eo,e,t)}function ko(e,t){return ai(e,t)}function Ao(e,t={}){let n=new Eo({type:`custom`,check:`custom`,fn:t=>t instanceof e,abort:!0,...j(t)});return n._zod.bag.Class=e,n._zod.check=t=>{t.value instanceof e||t.issues.push({code:`invalid_type`,expected:e.name,input:t.value,inst:n,path:[...n._zod.def.path??[]]})},n}function jo(e,t){return new xo({type:`pipe`,in:ro(e),out:t})}function Mo(e){return`'${e.replace(/'/g,`'\\''`)}'`}function No(e){return[`--settings`,e]}function Po(e){return`'${e.replace(/'/g,`''`)}'`}function Fo(e,t){return t.length===0||Array.from(t).some(e=>e.charCodeAt(0)<32)?null:e===`powershell`?Po(t):e===`bash`?Mo(t):/["%!]/u.test(t)?null:`"${t}"`}var Io=[`mcp__${Je}`,`Bash(ok open:*)`],Lo=[`delete`,`move`,`share_link`,`install`,`import`].map(e=>`mcp__${Je}__${e}`),Cte=`-c ${Mo(`mcp_servers.${Je}.default_tools_approval_mode="approve"`)}`;function Ro(e){let t={};return e.mcpPreApprove===!0&&(t.enabledMcpjsonServers=[Je]),e.autoApproveOkTools===!0&&(t.permissions={allow:[...Io],ask:[...Lo]}),t.enabledMcpjsonServers===void 0&&t.permissions===void 0?null:JSON.stringify(t)}function wte(e){let t=Ro(e);return t===null?``:`--settings ${Mo(t)}`}var zo=`\x1B`,Tte=`${zo}[200~`,Ete=`${zo}[201~`,Bo=`\x1B[?2004h`,Dte=300,Ote=4e3,kte={submit:`\r`,readyMarker:Bo,settleMs:800,capMs:4e3},Vo={claude:{bin:`claude`,displayName:`Claude`,docsUrl:`https://docs.claude.com/en/docs/claude-code`,handoffTarget:`claude-code`},codex:{bin:`codex`,displayName:`Codex`,docsUrl:`https://developers.openai.com/codex/cli`,handoffTarget:`codex`,autoApproveArg:Cte},copilot:{bin:`copilot`,displayName:`GitHub Copilot`,docsUrl:`https://docs.github.com/en/copilot/how-tos/copilot-cli/cli-getting-started`,handoffTarget:`copilot`,promptFlag:`--interactive`},cursor:{bin:`cursor-agent`,displayName:`Cursor`,docsUrl:`https://cursor.com/docs/cli/overview`,handoffTarget:`cursor`},opencode:{bin:`opencode`,displayName:`OpenCode`,docsUrl:`https://opencode.ai/docs`,handoffTarget:`opencode`,promptFlag:`--prompt`},pi:{bin:`pi`,displayName:`Pi`,docsUrl:`https://pi.dev`,handoffTarget:`pi`},antigravity:{bin:`agy`,displayName:`Antigravity`,docsUrl:`https://antigravity.google/docs/cli-getting-started`,handoffTarget:`antigravity`,promptFlag:`--prompt-interactive`},openclaw:{bin:`openclaw`,subcommand:`chat`,displayName:`OpenClaw`,docsUrl:`https://docs.openclaw.ai/cli/tui`,handoffTarget:`openclaw`,promptFlag:`--message`},hermes:{bin:`hermes`,subcommand:`chat`,displayName:`Hermes`,docsUrl:`https://hermes-agent.nousresearch.com/docs/user-guide/cli`,handoffTarget:`hermes`,startupInjection:{submit:`\r`,readyMarker:Bo,settleMs:Dte,capMs:Ote}}},Ho=[`claude`,`codex`,`opencode`,`cursor`,`copilot`,`pi`,`antigravity`,`openclaw`,`hermes`];function Ate(e,t,n={}){let r=Vo[e];if(e===`claude`){let e=Ro(n);if(e!==null){let t=`.ok/local/terminal/claude-settings-${[n.mcpPreApprove===!0?`mcp`:null,n.autoApproveOkTools===!0?`tools`:null].filter(e=>e!==null).join(`-`)}.json`;return{executable:r.bin,args:[...No(t)],supportFile:{kind:`claude-settings`,relativePath:t,contents:e}}}}return e===`codex`&&n.autoApproveOkTools===!0?{executable:r.bin,args:[`-c`,`mcp_servers.${Je}.default_tools_approval_mode=approve`]}:{executable:r.bin,args:r.subcommand?[r.subcommand]:[]}}function jte(e,t,n={}){let r=Vo[e],i=e===`claude`?wte(n):n.autoApproveOkTools===!0&&r.autoApproveArg?r.autoApproveArg:``,a=i?`${i} `:``,o=r.subcommand?`${r.subcommand} `:``;if(r.startupInjection!=null||t==null||t.length===0)return`${r.bin} ${o}${a}`.trimEnd();let s=r.promptFlag?`${r.promptFlag} `:``;return`${r.bin} ${o}${a}${s}${Mo(t)}`}function Uo(e,t){return Vo[e].startupInjection??(t===`win32`?kte:void 0)}function Mte(e,t,n){let r=Uo(e,n);return r==null||t==null||t.length===0?null:`${Tte}${t.replaceAll(zo,``)}${Ete}${r.submit}`}var Wo=[`config-entry`,`managed-file`,`skill-bundle-copy`,`central-store-copy`,`session-injection`],Nte=R(Wo),Pte=Wo.filter(e=>e!==`session-injection`),Go=[`satisfied`,`present-consent-unknown`,`absent`,`foreign`,`foreign-replaceable`,`drifted`,`excluded`,`structural-na`,`undetected`,`unprobeable`,`unprobed`];Ka([R(Go),M()]);function Ko(e){return Go.includes(e)}var qo=[`reclaim-permissive`,`pre-approval-exact`,`injection-functional`],Jo=R(qo),Fte=R([`none`,`approve-once`,`enable-manually`,`trust-gated`]),Ite=[`enable-manually`],Yo=[`written`,`overwritten`,`skipped-unsupported`,`skipped-prerequisite`,`declined`,`failed`,`removed`,`excluded`,`unchanged`,`handed-off`,`skipped-foreign`,`skipped-missing`,`no-op`];R(Yo),R([`info`,`warning`,`error`]);var Lte=R([`required`,`recommended`]),Xo=[...Re,`gemini`],Zo=R(Xo);function Qo(e){return Xo.includes(e)}var Rte=R([`acp`,`terminal`,`external`]),zte=R([...Ho,`gemini`]),Bte=R([`claude-cowork`,`claude-code`,`codex`,`cursor`,`copilot`,`opencode`,`pi`,`antigravity`,`openclaw`,`hermes`]),$o=R([`mcp`,`skill`]),es=[`project`,`user`,`session`],ts=R(es),ns=M().regex(/^[a-z0-9-]+\/[a-z0-9-]+\/[a-z0-9-]+\/[a-z0-9-]+$/).transform(e=>e),Vte=M().min(1).transform(e=>e),Hte=M().min(1).transform(e=>e);function rs(e){return`${e.agent}/${e.piece}/${e.scope}/${e.kind}`}function is(e){return e}function Ute(e){return e}var Wte=[`editor-user-config`,`editor-project-config`,`editor-project-skill-root`,`editor-user-skill-root`],as=is(`central-skill-store`);function ss(e,t){return is(`${e}:${t}`)}function Gte(e){if(e===as)return{kind:`central-skill-store`};let t=e.indexOf(`:`);if(t===-1)return null;let n=e.slice(0,t),r=e.slice(t+1);return!Wte.includes(n)||!Re.includes(r)?null:{kind:n,editor:r}}var Kte=e=>e===void 0?[]:Array.isArray(e)?[...e]:[e];function cs(e){let{sharedWith:t,prerequisites:n,consentClass:r,installability:i,preferred:a,troubleshooting:o,...s}=e;return{...s,troubleshooting:Kte(o),id:rs({agent:e.agent,piece:e.piece,scope:e.scope,kind:e.kind}),sharedWith:t??[],prerequisites:n??[],consentClass:r??`none`,installability:i??`installable`,preferred:a??!1}}function ls(e){let{offerOnlyWhenDetected:t,offersConnectionRow:n,detectionSources:r,modes:i,...a}=e,o={};for(let[e,t]of Object.entries(i))o[e]={requirements:t.requirements,caveats:t.caveats??[]};return{...a,offerOnlyWhenDetected:t??!1,offersConnectionRow:n??!1,detectionSources:r??[],modes:o}}var B=(e,t,n,r)=>rs({agent:e,piece:t,scope:n,kind:r}),us=e=>({piece:`mcp`,level:`required`,satisfiedByAny:e}),ds=e=>({piece:`skill`,level:`recommended`,satisfiedByAny:e}),fs=(...e)=>({mode:`probeable`,strictness:e}),qte=(e,t)=>({mode:`unprobeable`,reason:e,...t===void 0?{}:{note:t}}),ps=(e,t)=>({id:Ute(e),...t===void 0?{}:{params:t}}),Jte=(e,t)=>{let n=Ite.find(t=>t===e);return n===void 0?void 0:ps(`followup.${n}`,{agent:t})},V=(e,t)=>({kind:`source-read`,ref:e,...t===void 0?{}:{note:t}}),ms=(e,t)=>t===void 0?{confidence:`verified`,evidence:e}:{confidence:`verified`,evidence:e,verifiedAgainst:t},Yte=(e,t)=>({confidence:`contested`,evidence:e,verifiedAgainst:t});function hs(e){return{acpAgentId:e.acpAgentId,featuredOrder:e.featuredOrder,harnessCli:e.harnessCli,harnessReadsEditorConfig:e.readsEditorConfig,harnessReadsEditorConfigAttestation:e.readsEditorConfigAttestation,verifiedPosture:e.verifiedPosture}}function gs(e){let{appBrandName:t,tagline:n,...r}=e;return{...r,...t===void 0?{}:{appBrandName:t},...n===void 0?{}:{tagline:n}}}var _s=(e,t)=>({kind:`observation`,ref:e,note:t}),vs={observedAt:`2026-07-02`},H={cliEditors:`packages/cli/src/commands/editors.ts`,coreEditors:`packages/core/src/constants/editors.ts`,acpRegistry:`packages/server/src/acp/registry.ts`,threadManager:`packages/server/src/acp/thread-manager.ts`,writeProjectSkill:`packages/cli/src/integrations/write-project-skill.ts`,repairSkills:`packages/cli/src/commands/repair-skills.ts`,skillInstall:`packages/server/src/skill-install.ts`,presenceProbes:`packages/desktop/src/main/integrations-settings.ts`};function ys(e){return cs({agent:e.agent,piece:`mcp`,scope:`user`,kind:`config-entry`,pathId:ss(`editor-user-config`,e.agent),probe:fs(...e.strictness),attestation:e.attestation,audience:`this-user`,installability:e.installability,notInstallableReason:e.notInstallableReason,guidance:ps(`guidance.mcp.user-config`,{agent:e.agent}),troubleshooting:e.troubleshooting})}function bs(e){return cs({agent:e.agent,piece:`mcp`,scope:`project`,kind:`config-entry`,pathId:ss(`editor-project-config`,e.fileOwner??e.agent),sharedWith:e.sharedWith,consentClass:e.consentClass,probe:fs(...e.strictness),attestation:e.attestation,audience:`this-project`,guidance:ps(`guidance.mcp.project-config`,{agent:e.agent}),followup:Jte(e.consentClass,e.agent),troubleshooting:e.troubleshooting})}function xs(e){return cs({agent:e.agent,piece:`skill`,scope:`project`,kind:`skill-bundle-copy`,pathId:ss(`editor-project-skill-root`,e.agent),prerequisites:e.prerequisites,probe:fs(`reclaim-permissive`),attestation:e.attestation,audience:`this-project`,guidance:ps(`guidance.skill.project`,{agent:e.agent}),troubleshooting:e.troubleshooting})}function Ss(e){return cs({agent:e.agent,piece:`skill`,scope:`user`,kind:`skill-bundle-copy`,pathId:ss(`editor-user-skill-root`,e.agent),probe:fs(`reclaim-permissive`),attestation:e.attestation,audience:`this-user`,guidance:ps(`guidance.skill.user`,{agent:e.agent})})}function Cs(e){return cs({agent:e,piece:`mcp`,scope:`session`,kind:`session-injection`,probe:qte(`session-scoped`),attestation:ms([V(H.threadManager,`the session MCP config the thread manager builds per thread`)]),audience:`this-project`,installability:`not-installable`,notInstallableReason:`session-scoped`,guidance:ps(`guidance.mcp.session-injection`,{agent:e})})}var ws={claude:ls({id:`claude`,setupDocSlug:Ge.claude,offersConnectionRow:!0,detectionSources:[`cli-on-path:claude`,`scheme-handler:claude-code`],satisfiers:[ys({agent:`claude`,strictness:[`reclaim-permissive`,`pre-approval-exact`,`injection-functional`],attestation:ms([V(H.cliEditors,`user-global MCP config target`)])}),bs({agent:`claude`,sharedWith:[`copilot`],consentClass:`approve-once`,strictness:[`reclaim-permissive`,`pre-approval-exact`,`injection-functional`],attestation:ms([V(H.cliEditors),V(H.coreEditors)]),troubleshooting:ps(`troubleshooting.claude.project-entry-not-approved`,{agent:`claude`})}),xs({agent:`claude`,prerequisites:[B(`claude`,`mcp`,`project`,`config-entry`)],attestation:ms([V(H.coreEditors),V(H.repairSkills)])}),Ss({agent:`claude`,attestation:ms([V(H.coreEditors),V(H.skillInstall)])}),Cs(`claude`)],modes:{external:{requirements:[us([B(`claude`,`mcp`,`user`,`config-entry`),B(`claude`,`mcp`,`project`,`config-entry`)]),ds([B(`claude`,`skill`,`project`,`skill-bundle-copy`),B(`claude`,`skill`,`user`,`skill-bundle-copy`)])]},terminal:{requirements:[us([B(`claude`,`mcp`,`user`,`config-entry`),B(`claude`,`mcp`,`project`,`config-entry`)]),ds([B(`claude`,`skill`,`project`,`skill-bundle-copy`),B(`claude`,`skill`,`user`,`skill-bundle-copy`)])]},acp:{requirements:[us([B(`claude`,`mcp`,`session`,`session-injection`),B(`claude`,`mcp`,`user`,`config-entry`),B(`claude`,`mcp`,`project`,`config-entry`)]),ds([B(`claude`,`skill`,`project`,`skill-bundle-copy`),B(`claude`,`skill`,`user`,`skill-bundle-copy`)])]}},acp:hs({acpAgentId:`claude-acp`,featuredOrder:0,harnessCli:`claude`,readsEditorConfig:`claude`,readsEditorConfigAttestation:ms([V(H.threadManager,`the injection-skip probe reads the managed entry for this editor`),_s(`claude-acp adapter`,`The adapter runs Claude Code, which loads the MCP entry OK writes for the Claude editor on its own, so injecting a same-name duplicate would be redundant.`)],vs),verifiedPosture:`asks`}),external:gs({targetId:`claude-code`,knownOrder:1,visible:!0,displayName:`Claude`,appBrandName:`Claude Desktop`,schemes:[`claude:`],installUrl:`https://claude.com/download`,tagline:`Agentic coding in Claude Desktop's Code tab.`})}),"claude-desktop":ls({id:`claude-desktop`,setupDocSlug:Ge[`claude-desktop`],offersConnectionRow:!1,detectionSources:[`scheme-handler:claude-code`],satisfiers:[ys({agent:`claude-desktop`,strictness:[`reclaim-permissive`],attestation:ms([V(H.cliEditors,`user-global config target; its path resolution throws on Linux`)]),troubleshooting:ps(`troubleshooting.claude-desktop.per-tool-approval`,{agent:`claude-desktop`})})],modes:{external:{requirements:[us([B(`claude-desktop`,`mcp`,`user`,`config-entry`)]),ds([])]}},external:gs({targetId:`claude-cowork`,knownOrder:0,visible:!1,displayName:`Claude Cowork`,appBrandName:`Claude Desktop`,schemes:[`claude:`],installUrl:`https://claude.com/download`,tagline:`Conversational pairing in Claude Desktop's Cowork tab.`})}),cursor:ls({id:`cursor`,setupDocSlug:Ge.cursor,offersConnectionRow:!0,detectionSources:[`cli-on-path:cursor`,`scheme-handler:cursor`],satisfiers:[ys({agent:`cursor`,strictness:[`reclaim-permissive`],attestation:ms([V(H.cliEditors)])}),bs({agent:`cursor`,consentClass:`enable-manually`,strictness:[`reclaim-permissive`],attestation:ms([V(H.cliEditors),V(H.coreEditors),{kind:`observation`,ref:`cursor-3.19.19-project-server-default-off`,note:`project .cursor/mcp.json server listed Disabled under Customize → MCPs with no prompt; enabled via the per-source toggle in its Configure dialog; with a same-named user-level entry present, the user entry connected and the disabled project entry did not shadow it`}],{version:`3.19.19`,observedAt:`2026-09-09`}),troubleshooting:ps(`troubleshooting.cursor.project-entry-not-loaded`,{agent:`cursor`})}),xs({agent:`cursor`,prerequisites:[B(`cursor`,`mcp`,`project`,`config-entry`)],attestation:ms([V(H.coreEditors),V(H.repairSkills)])}),Ss({agent:`cursor`,attestation:ms([V(H.coreEditors),V(H.skillInstall)])}),Cs(`cursor`)],modes:{external:{requirements:[us([B(`cursor`,`mcp`,`user`,`config-entry`),B(`cursor`,`mcp`,`project`,`config-entry`)]),ds([B(`cursor`,`skill`,`project`,`skill-bundle-copy`),B(`cursor`,`skill`,`user`,`skill-bundle-copy`)])]},terminal:{requirements:[us([B(`cursor`,`mcp`,`user`,`config-entry`),B(`cursor`,`mcp`,`project`,`config-entry`)]),ds([B(`cursor`,`skill`,`project`,`skill-bundle-copy`),B(`cursor`,`skill`,`user`,`skill-bundle-copy`)])]},acp:{requirements:[us([B(`cursor`,`mcp`,`session`,`session-injection`)]),ds([B(`cursor`,`skill`,`project`,`skill-bundle-copy`),B(`cursor`,`skill`,`user`,`skill-bundle-copy`)])]}},acp:hs({acpAgentId:`cursor`,featuredOrder:3,harnessCli:`cursor`,readsEditorConfig:null,readsEditorConfigAttestation:ms([_s(`cursor-agent mcp list`,`Reports a config-declared entry that has not been approved as "not loaded (needs approval)", so a present entry says nothing about whether the agent will have the tools.`),V(H.threadManager,`the one agent the skip probe never stands down for`)],{observedAt:`2026-08-20`}),verifiedPosture:`self-managed`}),external:gs({targetId:`cursor`,knownOrder:3,visible:!0,displayName:`Cursor`,schemes:[`cursor:`],installUrl:`https://cursor.com/`,tagline:`AI-first VS Code fork with multi-file edits.`})}),codex:ls({id:`codex`,setupDocSlug:Ge.codex,offersConnectionRow:!0,detectionSources:[`cli-on-path:codex`,`scheme-handler:codex`],satisfiers:[ys({agent:`codex`,strictness:[`reclaim-permissive`,`injection-functional`],attestation:ms([V(H.cliEditors,`TOML user-global config target`)])}),bs({agent:`codex`,consentClass:`trust-gated`,strictness:[`reclaim-permissive`,`injection-functional`],attestation:Yte([V(H.cliEditors,`project config path added by analogy with the other editors`),{kind:`upstream-issue`,ref:`openai/codex#13025`,note:`open, reproduced on builds newer than the one OK checked`},{kind:`upstream-issue`,ref:`openai/codex#36960`,note:`requires an explicit trust decision in rust-v0.147.0, reverting #36935's automatic trust from the same release; builds from 0.113 asked but did not reliably persist the answer (#14547); codex exec never asks`},{kind:`vendor-doc`,ref:`OpenAI Codex: Advanced configuration`,note:`project-scoped config loads only for a trusted project`},{kind:`observation`,ref:`codex-desktop-project-config-load`,note:`single non-repro on 26.623.81905; the CLI honors it only for a trusted project`}],{version:`26.707.72221`,observedAt:`2026-07-15`}),troubleshooting:[ps(`troubleshooting.codex.desktop-project-config`,{agent:`codex`,honoredByDesktop:!1}),ps(`troubleshooting.codex.folder-trust`,{agent:`codex`})]}),xs({agent:`codex`,prerequisites:[B(`codex`,`mcp`,`project`,`config-entry`)],attestation:ms([V(H.coreEditors),V(H.repairSkills)]),troubleshooting:ps(`troubleshooting.codex.folder-trust`,{agent:`codex`})}),Ss({agent:`codex`,attestation:ms([V(H.coreEditors),V(H.skillInstall)])}),Cs(`codex`)],modes:{external:{requirements:[us([B(`codex`,`mcp`,`user`,`config-entry`),B(`codex`,`mcp`,`project`,`config-entry`)]),ds([B(`codex`,`skill`,`project`,`skill-bundle-copy`),B(`codex`,`skill`,`user`,`skill-bundle-copy`)])]},terminal:{requirements:[us([B(`codex`,`mcp`,`user`,`config-entry`),B(`codex`,`mcp`,`project`,`config-entry`)]),ds([B(`codex`,`skill`,`project`,`skill-bundle-copy`),B(`codex`,`skill`,`user`,`skill-bundle-copy`)])]},acp:{requirements:[us([B(`codex`,`mcp`,`session`,`session-injection`),B(`codex`,`mcp`,`user`,`config-entry`),B(`codex`,`mcp`,`project`,`config-entry`)]),ds([B(`codex`,`skill`,`project`,`skill-bundle-copy`),B(`codex`,`skill`,`user`,`skill-bundle-copy`)])]}},acp:hs({acpAgentId:`codex-acp`,featuredOrder:1,harnessCli:`codex`,readsEditorConfig:`codex`,readsEditorConfigAttestation:ms([V(H.cliEditors,`the managed MCP entry OK writes into the Codex TOML config`),_s(`codex-acp adapter`,`The adapter runs the Codex CLI, which loads the MCP servers declared in its own config, so the managed entry is already in the session.`)],vs),verifiedPosture:`self-managed`}),external:gs({targetId:`codex`,knownOrder:2,visible:!0,displayName:`ChatGPT`,appBrandName:`ChatGPT Desktop`,schemes:[`codex:`],installUrl:`https://developers.openai.com/codex/app`,tagline:`OpenAI's ChatGPT desktop app, home of the Codex agent.`})}),copilot:ls({id:`copilot`,setupDocSlug:Ge.copilot,offersConnectionRow:!0,detectionSources:[`cli-on-path:copilot`],satisfiers:[ys({agent:`copilot`,strictness:[`reclaim-permissive`],attestation:ms([V(H.cliEditors)])}),bs({agent:`copilot`,fileOwner:`claude`,sharedWith:[`claude`],consentClass:`trust-gated`,strictness:[`reclaim-permissive`],attestation:ms([{kind:`vendor-doc`,ref:`GitHub Copilot CLI — MCP configuration`,note:"reads workspace `.mcp.json` or `.github/mcp.json`"},{kind:`vendor-doc`,ref:`GitHub Docs: Adding MCP servers for Copilot CLI`,note:`project-level servers load only after folder-trust confirmation; skipped silently in untrusted folders; under copilot -p they load only in an already-trusted folder unless GITHUB_COPILOT_PROMPT_MODE_WORKSPACE_MCP=true`},V(H.coreEditors,`OK deliberately writes no second copy for copilot`)],{version:`copilot CLI 1.0.80`,observedAt:`2026-08-20`}),troubleshooting:ps(`troubleshooting.copilot.shared-workspace-config`,{agent:`copilot`,sourceAgent:`claude`})}),xs({agent:`copilot`,prerequisites:[B(`copilot`,`mcp`,`project`,`config-entry`),B(`copilot`,`mcp`,`user`,`config-entry`)],attestation:ms([V(H.coreEditors),V(H.writeProjectSkill)])}),Ss({agent:`copilot`,attestation:ms([V(H.coreEditors),V(H.skillInstall)])}),Cs(`copilot`)],modes:{external:{requirements:[us([B(`copilot`,`mcp`,`user`,`config-entry`),B(`copilot`,`mcp`,`project`,`config-entry`)]),ds([B(`copilot`,`skill`,`project`,`skill-bundle-copy`),B(`copilot`,`skill`,`user`,`skill-bundle-copy`)])]},terminal:{requirements:[us([B(`copilot`,`mcp`,`user`,`config-entry`),B(`copilot`,`mcp`,`project`,`config-entry`)]),ds([B(`copilot`,`skill`,`project`,`skill-bundle-copy`),B(`copilot`,`skill`,`user`,`skill-bundle-copy`)])]},acp:{requirements:[us([B(`copilot`,`mcp`,`session`,`session-injection`)]),ds([B(`copilot`,`skill`,`project`,`skill-bundle-copy`),B(`copilot`,`skill`,`user`,`skill-bundle-copy`)])]}},acp:hs({acpAgentId:`github-copilot-cli`,featuredOrder:4,harnessCli:null,readsEditorConfig:null,readsEditorConfigAttestation:{confidence:`assumed`,evidence:[_s(`copilot CLI 1.0.80`,"The CLI does read a workspace `.mcp.json`, but nobody has observed the ACP adapter loading the managed entry inside a session. Claiming it would stand our injection down on an unverified read and risk a thread with no OK tools, so the claim stays unmade and OK keeps injecting.")],verifiedAgainst:{version:`1.0.80`,observedAt:`2026-08-20`}},verifiedPosture:null}),external:gs({targetId:`copilot`,knownOrder:4,visible:!1,displayName:`GitHub Copilot`,schemes:[],installUrl:`https://docs.github.com/en/copilot/how-tos/copilot-cli/cli-getting-started`,tagline:`GitHub's terminal-native coding agent.`})}),opencode:ls({id:`opencode`,setupDocSlug:Ge.opencode,offersConnectionRow:!0,detectionSources:[`cli-on-path:opencode`],satisfiers:[ys({agent:`opencode`,strictness:[`reclaim-permissive`,`injection-functional`],attestation:ms([V(H.cliEditors,`XDG config dir; the win32 location is by analogy and unverified`)])}),bs({agent:`opencode`,consentClass:`none`,strictness:[`reclaim-permissive`,`injection-functional`],attestation:ms([V(H.cliEditors,`the one project config that is not under a dotdir`)])}),xs({agent:`opencode`,prerequisites:[B(`opencode`,`mcp`,`project`,`config-entry`)],attestation:ms([V(H.coreEditors),V(H.repairSkills)])}),Ss({agent:`opencode`,attestation:ms([V(H.coreEditors),V(H.skillInstall)])}),Cs(`opencode`)],modes:{external:{requirements:[us([B(`opencode`,`mcp`,`user`,`config-entry`),B(`opencode`,`mcp`,`project`,`config-entry`)]),ds([B(`opencode`,`skill`,`project`,`skill-bundle-copy`),B(`opencode`,`skill`,`user`,`skill-bundle-copy`)])]},terminal:{requirements:[us([B(`opencode`,`mcp`,`user`,`config-entry`),B(`opencode`,`mcp`,`project`,`config-entry`)]),ds([B(`opencode`,`skill`,`project`,`skill-bundle-copy`),B(`opencode`,`skill`,`user`,`skill-bundle-copy`)])]},acp:{requirements:[us([B(`opencode`,`mcp`,`session`,`session-injection`),B(`opencode`,`mcp`,`user`,`config-entry`),B(`opencode`,`mcp`,`project`,`config-entry`)]),ds([B(`opencode`,`skill`,`project`,`skill-bundle-copy`),B(`opencode`,`skill`,`user`,`skill-bundle-copy`)])]}},acp:hs({acpAgentId:`opencode`,featuredOrder:5,harnessCli:`opencode`,readsEditorConfig:`opencode`,readsEditorConfigAttestation:ms([V(H.cliEditors,`the managed MCP entry OK writes into the opencode config`),_s(`opencode-acp adapter`,`The adapter runs opencode, which loads its own configured MCP servers, so the managed entry is already in the session.`)],vs),verifiedPosture:null}),external:gs({targetId:`opencode`,knownOrder:5,visible:!1,displayName:`OpenCode`,schemes:[],installUrl:`https://opencode.ai`,tagline:`Open-source terminal coding agent; bring any local model.`})}),openclaw:ls({id:`openclaw`,setupDocSlug:Ge.openclaw,offersConnectionRow:!0,offerOnlyWhenDetected:!0,detectionSources:[`cli-on-path:openclaw`],satisfiers:[ys({agent:`openclaw`,strictness:[`reclaim-permissive`],attestation:ms([V(H.cliEditors,"the one two-level server map, nested under `mcp.servers`")])}),cs({agent:`openclaw`,piece:`skill`,scope:`user`,kind:`central-store-copy`,pathId:as,probe:fs(`reclaim-permissive`),attestation:ms([V(H.coreEditors),V(H.skillInstall,`the hub is written only when it already exists`)]),audience:`this-user`,guidance:ps(`guidance.skill.central-store`,{agent:`openclaw`}),troubleshooting:ps(`troubleshooting.openclaw.central-store-missing`,{agent:`openclaw`})})],modes:{external:{requirements:[us([B(`openclaw`,`mcp`,`user`,`config-entry`)]),ds([B(`openclaw`,`skill`,`user`,`central-store-copy`)])]},terminal:{requirements:[us([B(`openclaw`,`mcp`,`user`,`config-entry`)]),ds([B(`openclaw`,`skill`,`user`,`central-store-copy`)])]}},external:gs({targetId:`openclaw`,knownOrder:8,visible:!1,displayName:`OpenClaw`,schemes:[],installUrl:`https://openclaw.ai`,tagline:`Open-source agent gateway; runs agents against your MCP servers.`})}),pi:ls({id:`pi`,setupDocSlug:Ge.pi,offersConnectionRow:!0,detectionSources:[`cli-on-path:pi`],satisfiers:[cs({agent:`pi`,piece:`mcp`,scope:`project`,kind:`managed-file`,pathId:ss(`editor-project-config`,`pi`),probe:fs(`reclaim-permissive`,`injection-functional`),attestation:ms([V(H.cliEditors,`OK owns the whole file; currency is a first-line sentinel`),V(H.acpRegistry,`the thread provisions this file instead of injecting`)]),audience:`this-project`,guidance:ps(`guidance.mcp.managed-file`,{agent:`pi`}),troubleshooting:ps(`troubleshooting.pi.folder-trust`,{agent:`pi`})}),xs({agent:`pi`,prerequisites:[B(`pi`,`mcp`,`project`,`managed-file`)],attestation:ms([V(H.coreEditors),V(H.writeProjectSkill)]),troubleshooting:ps(`troubleshooting.pi.folder-trust`,{agent:`pi`})}),Ss({agent:`pi`,attestation:ms([V(H.coreEditors,`the agent home nests one level below the dotdir`),V(H.skillInstall)])})],modes:{external:{requirements:[us([B(`pi`,`mcp`,`project`,`managed-file`)]),ds([B(`pi`,`skill`,`project`,`skill-bundle-copy`),B(`pi`,`skill`,`user`,`skill-bundle-copy`)])]},terminal:{requirements:[us([B(`pi`,`mcp`,`project`,`managed-file`)]),ds([B(`pi`,`skill`,`project`,`skill-bundle-copy`),B(`pi`,`skill`,`user`,`skill-bundle-copy`)])]},acp:{requirements:[us([B(`pi`,`mcp`,`project`,`managed-file`)]),ds([B(`pi`,`skill`,`project`,`skill-bundle-copy`),B(`pi`,`skill`,`user`,`skill-bundle-copy`)])]}},acp:hs({acpAgentId:`pi-acp`,featuredOrder:null,harnessCli:`pi`,readsEditorConfig:`pi`,readsEditorConfigAttestation:ms([_s(`pi-acp@0.0.33`,"Pi has no MCP client at all: it accepts `mcpServers` at session/new, stores them write-only and never connects. Its wiring is a managed extension FILE in the project, which OK provisions instead of injecting — the same mapping, a different shape."),V(H.threadManager,`the bridge route that provisions the extension instead of injecting`)],{version:`0.0.33`,observedAt:`2026-08-20`}),verifiedPosture:`autonomous`}),external:gs({targetId:`pi`,knownOrder:6,visible:!1,displayName:`Pi`,schemes:[],installUrl:`https://pi.dev`,tagline:`Minimal open-source terminal coding agent, extensible in TypeScript.`})}),antigravity:ls({id:`antigravity`,setupDocSlug:Ge.antigravity,offersConnectionRow:!0,offerOnlyWhenDetected:!0,detectionSources:[`cli-on-path:antigravity`],satisfiers:[ys({agent:`antigravity`,strictness:[`reclaim-permissive`],attestation:ms([V(H.cliEditors,`one user-global file shared by the IDE, the app and the CLI; per project you can only filter it`)])}),Ss({agent:`antigravity`,attestation:ms([V(H.coreEditors),V(H.skillInstall)])})],modes:{external:{requirements:[us([B(`antigravity`,`mcp`,`user`,`config-entry`)]),ds([B(`antigravity`,`skill`,`user`,`skill-bundle-copy`)])]},terminal:{requirements:[us([B(`antigravity`,`mcp`,`user`,`config-entry`)]),ds([B(`antigravity`,`skill`,`user`,`skill-bundle-copy`)])]}},external:gs({targetId:`antigravity`,knownOrder:7,visible:!1,displayName:`Antigravity`,schemes:[],installUrl:`https://antigravity.google`,tagline:"Google's agentic IDE + `agy` terminal agent."})}),"lm-studio":ls({id:`lm-studio`,setupDocSlug:Ge[`lm-studio`],offersConnectionRow:!0,offerOnlyWhenDetected:!0,detectionSources:[],satisfiers:[ys({agent:`lm-studio`,strictness:[`reclaim-permissive`],installability:`not-installable`,notInstallableReason:`no-non-interactive-verb`,attestation:ms([V(H.cliEditors,`two candidate locations, resolved against what already exists`),{kind:`upstream-issue`,ref:`lmstudio-ai/lmstudio-bug-tracker#1371`,note:`documented config path differs from the one the app reads on macOS`},V(H.presenceProbes,`deliberately absent from the presence probes`)]),troubleshooting:ps(`troubleshooting.lm-studio.config-path-mismatch`,{agent:`lm-studio`})})],modes:{external:{requirements:[us([B(`lm-studio`,`mcp`,`user`,`config-entry`)]),ds([])]}}}),hermes:ls({id:`hermes`,setupDocSlug:Ge.hermes,offersConnectionRow:!0,offerOnlyWhenDetected:!0,detectionSources:[`cli-on-path:hermes`],satisfiers:[ys({agent:`hermes`,strictness:[`reclaim-permissive`],attestation:ms([V(H.cliEditors,`the one YAML target; the whole config is a single user-global file`)])})],modes:{external:{requirements:[us([B(`hermes`,`mcp`,`user`,`config-entry`)]),ds([])]},terminal:{requirements:[us([B(`hermes`,`mcp`,`user`,`config-entry`)]),ds([])]}},external:gs({targetId:`hermes`,knownOrder:9,visible:!1,displayName:`Hermes`,schemes:[],installUrl:`https://hermes-agent.nousresearch.com`,tagline:`Nous Research's terminal coding agent.`})}),gemini:ls({id:`gemini`,setupDocSlug:null,detectionSources:[`harness-bin:gemini`],satisfiers:[Cs(`gemini`)],modes:{acp:{requirements:[us([B(`gemini`,`mcp`,`session`,`session-injection`)]),ds([])]}},acp:hs({acpAgentId:`gemini`,featuredOrder:2,harnessCli:`gemini`,readsEditorConfig:null,readsEditorConfigAttestation:ms([V(H.coreEditors,`gemini reaches OK as an ACP agent only; it has no editor config target`)],vs),verifiedPosture:null})})};function Ts(e){return ws[e]}var Es=Object.values(ws).flatMap(e=>e.satisfiers),Xte=new Map(Es.map(e=>[e.id,e]));function Ds(e){return Xte.get(e)}var Os=Object.values(ws).flatMap(e=>e.acp===void 0?[]:[{record:e,acp:e.acp}]).sort((e,t)=>e.acp.acpAgentId.localeCompare(t.acp.acpAgentId));Os.filter(({acp:e})=>e.featuredOrder!==null).sort((e,t)=>(e.acp.featuredOrder??0)-(t.acp.featuredOrder??0)).map(({acp:e})=>e.acpAgentId);var Zte=Object.fromEntries(Os.flatMap(({acp:e})=>e.harnessCli===null?[]:[[e.acpAgentId,e.harnessCli]]));Object.fromEntries(Os.flatMap(({acp:e})=>e.harnessReadsEditorConfig===null?[]:[[e.acpAgentId,e.harnessReadsEditorConfig]]));var Qte=Object.fromEntries(Os.flatMap(({acp:e})=>e.verifiedPosture===null?[]:[[e.acpAgentId,e.verifiedPosture]])),ks=Object.values(ws).flatMap(e=>e.external===void 0?[]:[e.external]).sort((e,t)=>e.knownOrder-t.knownOrder),As=ks.map(({targetId:e,displayName:t,appBrandName:n,schemes:r,installUrl:i,tagline:a})=>({id:e,displayName:t,...n===void 0?{}:{appBrandName:n},schemes:r,installUrl:i,...a===void 0?{}:{tagline:a}})),$te=new Set(ks.filter(e=>e.visible).map(e=>e.targetId)),ene=As.filter(e=>$te.has(e.id)),tne=Re.filter(e=>ws[e].offersConnectionRow),nne=new Map(Object.values(ws).flatMap(e=>e.external===void 0?[]:[[e.external.targetId,e.id]]));function rne(e){return nne.get(e)}var ine=new Map(Object.values(ws).flatMap(e=>e.modes.terminal===void 0?[]:[[e.id,e.id]]));function ane(e){return ine.get(e)}Object.fromEntries(Object.values(ws).flatMap(e=>{let t=e.satisfiers.find(e=>e.piece===`mcp`&&e.scope===`project`&&e.consentClass!==`none`)?.consentClass;return t===void 0?[]:[[e.id,t]]}));var js=Symbol.for(`yaml.alias`),Ms=Symbol.for(`yaml.document`),Ns=Symbol.for(`yaml.map`),Ps=Symbol.for(`yaml.pair`),Fs=Symbol.for(`yaml.scalar`),Is=Symbol.for(`yaml.seq`),Ls=Symbol.for(`yaml.node.type`),Rs=e=>!!e&&typeof e==`object`&&e[Ls]===js,zs=e=>!!e&&typeof e==`object`&&e[Ls]===Ms,Bs=e=>!!e&&typeof e==`object`&&e[Ls]===Ns,Vs=e=>!!e&&typeof e==`object`&&e[Ls]===Ps,Hs=e=>!!e&&typeof e==`object`&&e[Ls]===Fs,Us=e=>!!e&&typeof e==`object`&&e[Ls]===Is;function Ws(e){if(e&&typeof e==`object`)switch(e[Ls]){case Ns:case Is:return!0}return!1}function Gs(e){if(e&&typeof e==`object`)switch(e[Ls]){case js:case Ns:case Fs:case Is:return!0}return!1}var Ks=e=>(Hs(e)||Ws(e))&&!!e.anchor,qs=Symbol(`break visit`),Js=Symbol(`skip children`),Ys=Symbol(`remove node`);function Xs(e,t){let n=ec(t);zs(e)?Zs(null,e.contents,n,Object.freeze([e]))===Ys&&(e.contents=null):Zs(null,e,n,Object.freeze([]))}Xs.BREAK=qs,Xs.SKIP=Js,Xs.REMOVE=Ys;function Zs(e,t,n,r){let i=tc(e,t,n,r);if(Gs(i)||Vs(i))return nc(e,r,i),Zs(e,i,n,r);if(typeof i!=`symbol`){if(Ws(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=Zs(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===qs)return qs;else i===Ys&&(t.items.splice(e,1),--e)}}else if(Vs(t)){r=Object.freeze(r.concat(t));let e=Zs(`key`,t.key,n,r);if(e===qs)return qs;e===Ys&&(t.key=null);let i=Zs(`value`,t.value,n,r);if(i===qs)return qs;i===Ys&&(t.value=null)}}return i}async function Qs(e,t){let n=ec(t);zs(e)?await $s(null,e.contents,n,Object.freeze([e]))===Ys&&(e.contents=null):await $s(null,e,n,Object.freeze([]))}Qs.BREAK=qs,Qs.SKIP=Js,Qs.REMOVE=Ys;async function $s(e,t,n,r){let i=await tc(e,t,n,r);if(Gs(i)||Vs(i))return nc(e,r,i),$s(e,i,n,r);if(typeof i!=`symbol`){if(Ws(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=await $s(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===qs)return qs;else i===Ys&&(t.items.splice(e,1),--e)}}else if(Vs(t)){r=Object.freeze(r.concat(t));let e=await $s(`key`,t.key,n,r);if(e===qs)return qs;e===Ys&&(t.key=null);let i=await $s(`value`,t.value,n,r);if(i===qs)return qs;i===Ys&&(t.value=null)}}return i}function ec(e){return typeof e==`object`&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function tc(e,t,n,r){if(typeof n==`function`)return n(e,t,r);if(Bs(t))return n.Map?.(e,t,r);if(Us(t))return n.Seq?.(e,t,r);if(Vs(t))return n.Pair?.(e,t,r);if(Hs(t))return n.Scalar?.(e,t,r);if(Rs(t))return n.Alias?.(e,t,r)}function nc(e,t,n){let r=t[t.length-1];if(Ws(r))r.items[e]=n;else if(Vs(r))e===`key`?r.key=n:r.value=n;else if(zs(r))r.contents=n;else{let e=Rs(r)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}var one={"!":`%21`,",":`%2C`,"[":`%5B`,"]":`%5D`,"{":`%7B`,"}":`%7D`},sne=e=>e.replace(/[!,[\]{}]/g,e=>one[e]),rc=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case`1.1`:this.atNextDocument=!0;break;case`1.2`:this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:`1.2`},this.tags=Object.assign({},e.defaultTags);break}return t}add(t,n){this.atNextDocument&&=(this.yaml={explicit:e.defaultYaml.explicit,version:`1.1`},this.tags=Object.assign({},e.defaultTags),!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case`%TAG`:{if(r.length!==2&&(n(0,`%TAG directive should contain exactly two parts`),r.length<2))return!1;let[e,t]=r;return this.tags[e]=t,!0}case`%YAML`:{if(this.yaml.explicit=!0,r.length!==1)return n(0,`%YAML directive should contain exactly one part`),!1;let[e]=r;if(e===`1.1`||e===`1.2`)return this.yaml.version=e,!0;{let t=/^\d+\.\d+$/.test(e);return n(6,`Unsupported YAML version ${e}`,t),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e===`!`)return`!`;if(e[0]!==`!`)return t(`Not a valid tag: ${e}`),null;if(e[1]===`<`){let n=e.slice(2,-1);return n===`!`||n===`!!`?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==`>`&&t(`Verbatim tags must end with a >`),n)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(e){return t(String(e)),null}return n===`!`?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+sne(e.substring(n.length));return e[0]===`!`?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||`1.2`}`]:[],n=Object.entries(this.tags),r;if(e&&n.length>0&&Gs(e.contents)){let t={};Xs(e.contents,(e,n)=>{Gs(n)&&n.tag&&(t[n.tag]=!0)}),r=Object.keys(t)}else r=[];for(let[i,a]of n)i===`!!`&&a===`tag:yaml.org,2002:`||(!e||r.some(e=>e.startsWith(a)))&&t.push(`%TAG ${i} ${a}`);return t.join(`
66
66
  `)}};rc.defaultYaml={explicit:!1,version:`1.2`},rc.defaultTags={"!!":`tag:yaml.org,2002:`};function ic(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function ac(e){let t=new Set;return Xs(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function oc(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function sc(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=ac(e);let a=oc(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(Hs(t.node)||Ws(t.node)))t.node.anchor=t.anchor;else{let t=Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:r}}function cc(e,t,n,r){if(r&&typeof r==`object`)if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=cc(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=cc(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=cc(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=cc(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}return e.call(t,n,r)}function lc(e,t,n){if(Array.isArray(e))return e.map((e,t)=>lc(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!Ks(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var uc=class{constructor(e){Object.defineProperty(this,Ls,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!zs(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=lc(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?cc(i,{"":o},``,o):o}},dc=class extends uc{constructor(e){super(js),this.source=e,Object.defineProperty(this,`tag`,{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError(`Alias resolution is disabled`);let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],Xs(e,{Node:(e,t)=>{(Rs(t)||Ks(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}return r}toJSON(e,t){if(!t)return{source:this.source};let{anchors:n,doc:r,maxAliasCount:i}=t,a=this.resolve(r,t);if(!a){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}let o=n.get(a);if(o||=(lc(a,null,t),n.get(a)),o?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(o.count+=1,o.aliasCount===0&&(o.aliasCount=fc(r,a,n)),o.count*o.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`);return o.res}toString(e,t,n){let r=`*${this.source}`;if(e){if(ic(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function fc(e,t,n){if(Rs(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(Ws(t)){let r=0;for(let i of t.items){let t=fc(e,i,n);t>r&&(r=t)}return r}else if(Vs(t)){let r=fc(e,t.key,n),i=fc(e,t.value,n);return Math.max(r,i)}return 1}var pc=e=>!e||typeof e!=`function`&&typeof e!=`object`,mc=class extends uc{constructor(e){super(Fs),this.value=e}toJSON(e,t){return t?.keep?this.value:lc(this.value,e,t)}toString(){return String(this.value)}};mc.BLOCK_FOLDED=`BLOCK_FOLDED`,mc.BLOCK_LITERAL=`BLOCK_LITERAL`,mc.PLAIN=`PLAIN`,mc.QUOTE_DOUBLE=`QUOTE_DOUBLE`,mc.QUOTE_SINGLE=`QUOTE_SINGLE`;var hc=`tag:yaml.org,2002:`;function gc(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function _c(e,t,n){if(zs(e)&&(e=e.contents),Gs(e))return e;if(Vs(e)){let t=n.schema[Ns].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??=i(e),new dc(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=hc+t.slice(2));let l=gc(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new mc(e);return c&&(c.node=t),t}l=e instanceof Map?o[Ns]:Symbol.iterator in Object(e)?o[Is]:o[Ns]}a&&(a(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,e,n):typeof l?.nodeClass?.from==`function`?l.nodeClass.from(n.schema,e,n):new mc(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}function vc(e,t,n){let r=n;for(let e=t.length-1;e>=0;--e){let n=t[e];if(typeof n==`number`&&Number.isInteger(n)&&n>=0){let e=[];e[n]=r,r=e}else r=new Map([[n,r]])}return _c(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:new Map})}var yc=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done,bc=class extends uc{constructor(e,t){super(e),Object.defineProperty(this,`schema`,{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>Gs(t)||Vs(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(yc(e))this.add(t);else{let[n,...r]=e,i=this.get(n,!0);if(Ws(i))i.addIn(r,t);else if(i===void 0&&this.schema)this.set(n,vc(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let r=this.get(t,!0);if(Ws(r))return r.deleteIn(n);throw Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...r]=e,i=this.get(n,!0);return r.length===0?!t&&Hs(i)?i.value:i:Ws(i)?i.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!Vs(t))return!1;let n=t.value;return n==null||e&&Hs(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let r=this.get(t,!0);return Ws(r)?r.hasIn(n):!1}setIn(e,t){let[n,...r]=e;if(r.length===0)this.set(n,t);else{let e=this.get(n,!0);if(Ws(e))e.setIn(r,t);else if(e===void 0&&this.schema)this.set(n,vc(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}},xc=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function Sc(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var Cc=(e,t,n)=>e.endsWith(`
67
67
  `)?Sc(n,t):n.includes(`
68
68
  `)?`
@@ -168,13 +168,13 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\
168
168
  `)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
169
169
  `,e)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(this.onKeyLine=!1,t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){gd(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,r=n&&(t.sep||t.explicitKey)&&this.type!==`seq-item-ind`,i=[];if(r&&t.sep&&!t.value){let n=[];for(let r=0;r<t.sep.length;++r){let i=t.sep[r];switch(i.type){case`newline`:n.push(r);break;case`space`:break;case`comment`:i.indent>e.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(i=t.sep.splice(n[1]))}switch(this.type){case`anchor`:case`tag`:r||t.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`explicit-key-ind`:!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case`map-value-ind`:if(t.explicitKey)if(!t.sep)if(dd(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=hd(t.start);this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}else if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(dd(t.sep,`map-value-ind`))this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(pd(t.key)&&!dd(t.sep,`newline`)){let e=hd(t.start),n=t.key,r=t.sep;r.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:n,sep:r}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken);else t.sep?t.value||r?e.items.push({start:i,key:null,sep:[this.sourceToken]}):dd(t.sep,`map-value-ind`)?this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);r||t.value?(e.items.push({start:i,key:n,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=!0);return}default:{let r=this.startBlockValue(e);if(r){if(r.type===`block-seq`){if(!t.explicitKey&&t.sep&&!dd(t.sep,`newline`)){yield*this.pop({type:`error`,offset:this.offset,message:`Unexpected block-seq-ind on same line with key`,source:this.source});return}}else n&&e.items.push({start:i});this.stack.push(r);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){gd(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case`anchor`:case`tag`:if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case`seq-item-ind`:if(this.indent!==e.indent)break;t.value||dd(t.start,`seq-item-ind`)?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let t=this.startBlockValue(e);if(t){this.stack.push(t);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type===`flow-error-end`){let e;do yield*this.pop(),e=this.peek(1);while(e?.type===`flow-collection`)}else if(e.end.length===0){switch(this.type){case`comma`:case`explicit-key-ind`:!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case`map-value-ind`:!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case`space`:case`comment`:case`newline`:case`anchor`:case`tag`:!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:n,sep:[]}):t.sep?this.stack.push(n):Object.assign(t,{key:n,sep:[]});return}case`flow-map-end`:case`flow-seq-end`:e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let t=this.peek(2);if(t.type===`block-map`&&(this.type===`map-value-ind`&&t.indent===e.indent||this.type===`newline`&&!t.items[t.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type===`map-value-ind`&&t.type!==`flow-collection`){let n=hd(md(t));_d(e);let r=e.end.splice(1,e.end.length);r.push(this.sourceToken);let i={type:`block-map`,offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf(`
170
170
  `)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
171
- `,e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return this.flowScalar(this.type);case`block-scalar-header`:return{type:`block-scalar`,offset:this.offset,indent:this.indent,props:[this.sourceToken],source:``};case`flow-map-start`:case`flow-seq-start`:return{type:`flow-collection`,offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case`seq-item-ind`:return{type:`block-seq`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case`explicit-key-ind`:{this.onKeyLine=!0;let t=hd(md(e));return t.push(this.sourceToken),{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case`map-value-ind`:{this.onKeyLine=!0;let t=hd(md(e));return{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!==`comment`||this.indent<=t?!1:e.every(e=>e.type===`newline`||e.type===`space`)}*documentEnd(e){this.type!==`doc-mode`&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case`comma`:case`doc-start`:case`doc-end`:case`flow-seq-end`:case`flow-map-end`:case`map-value-ind`:yield*this.pop(),yield*this.step();break;case`newline`:this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}};function yd(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new ud||null,prettyErrors:t}}function bd(e,t={}){let{lineCounter:n,prettyErrors:r}=yd(t),i=new vd(n?.addNewLine),a=new Xu(t),o=null;for(let t of a.compose(i.parse(e),!0,e.length))if(!o)o=t;else if(o.options.logLevel!==`silent`){o.errors.push(new fu(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(mu(e,n)),o.warnings.forEach(mu(e,n))),o}function xd(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let i=bd(e,n);if(!i)return null;if(i.warnings.forEach(e=>Wc(i.options.logLevel,e)),i.errors.length>0){if(i.options.logLevel!==`silent`)throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}var Sd=`frontmatter`,Cd=[`text`,`number`,`boolean`,`date`,`list`,`object`];R(Cd);var wd=Va([M(),N(),P()]),Td=bo(()=>Va([wd.transform(e=>String(e)),qa(M(),Ed),F(Td)])),Ed=bo(()=>Va([M(),N(),P(),F(Td),qa(M(),Ed)])),Dd=/^\d{4}-\d{2}-\d{2}$/;function Od(e){return typeof e==`string`&&Dd.test(e)}function kd(e){return Array.isArray(e)?`list`:typeof e==`object`&&e?`object`:typeof e==`boolean`?`boolean`:typeof e==`number`?`number`:Od(e)?`date`:`text`}function Ad(e){if(Array.isArray(e)){let t=[];for(let n of e)n!==null&&t.push(Ad(n));return t}if(typeof e==`object`&&e){let t={};for(let[n,r]of Object.entries(e))t[n]=r===null?``:Ad(r);return t}return e}var jd=Eo(Ad,qa(M(),Ed)),Md=qa(M(),Va([Ed,Ma()]));function Nd(e){return!!(e===null||typeof e==`string`&&e===``||Array.isArray(e)&&e.length===0)}function Pd(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Pd(e[n],t[n]))return!1;return!0}if(e!==null&&t!==null&&typeof e==`object`&&typeof t==`object`&&!Array.isArray(e)&&!Array.isArray(t)){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.hasOwn(t,r)||!Pd(e[r],t[r]))return!1;return!0}return!1}var Fd=/^---[ \t]*\r?\n([\s\S]*?\r?\n)?---[ \t]*(\r?\n|$)/,Id=/^---[ \t]*$/;function Ld(e){let t=e.match(Fd);return t?{frontmatter:t[0],body:e.slice(t[0].length)}:{frontmatter:``,body:e}}function Rd(e,t){return e?t===``||/\r?\n$/.test(e)?e+t:e+(e.includes(`\r
171
+ `,e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return this.flowScalar(this.type);case`block-scalar-header`:return{type:`block-scalar`,offset:this.offset,indent:this.indent,props:[this.sourceToken],source:``};case`flow-map-start`:case`flow-seq-start`:return{type:`flow-collection`,offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case`seq-item-ind`:return{type:`block-seq`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case`explicit-key-ind`:{this.onKeyLine=!0;let t=hd(md(e));return t.push(this.sourceToken),{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case`map-value-ind`:{this.onKeyLine=!0;let t=hd(md(e));return{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!==`comment`||this.indent<=t?!1:e.every(e=>e.type===`newline`||e.type===`space`)}*documentEnd(e){this.type!==`doc-mode`&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case`comma`:case`doc-start`:case`doc-end`:case`flow-seq-end`:case`flow-map-end`:case`map-value-ind`:yield*this.pop(),yield*this.step();break;case`newline`:this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}};function yd(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new ud||null,prettyErrors:t}}function bd(e,t={}){let{lineCounter:n,prettyErrors:r}=yd(t),i=new vd(n?.addNewLine),a=new Xu(t),o=null;for(let t of a.compose(i.parse(e),!0,e.length))if(!o)o=t;else if(o.options.logLevel!==`silent`){o.errors.push(new fu(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(mu(e,n)),o.warnings.forEach(mu(e,n))),o}function xd(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let i=bd(e,n);if(!i)return null;if(i.warnings.forEach(e=>Wc(i.options.logLevel,e)),i.errors.length>0){if(i.options.logLevel!==`silent`)throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}var Sd=`frontmatter`,Cd=[`text`,`number`,`boolean`,`date`,`list`,`object`];R(Cd);var wd=Ka([M(),N(),P()]),Td=To(()=>Ka([wd.transform(e=>String(e)),Qa(M(),Ed),F(Td)])),Ed=To(()=>Ka([M(),N(),P(),F(Td),Qa(M(),Ed)])),Dd=/^\d{4}-\d{2}-\d{2}$/;function Od(e){return typeof e==`string`&&Dd.test(e)}function kd(e){return Array.isArray(e)?`list`:typeof e==`object`&&e?`object`:typeof e==`boolean`?`boolean`:typeof e==`number`?`number`:Od(e)?`date`:`text`}function Ad(e){if(Array.isArray(e)){let t=[];for(let n of e)n!==null&&t.push(Ad(n));return t}if(typeof e==`object`&&e){let t={};for(let[n,r]of Object.entries(e))t[n]=r===null?``:Ad(r);return t}return e}var jd=jo(Ad,Qa(M(),Ed)),Md=Qa(M(),Ka([Ed,La()]));function Nd(e){return!!(e===null||typeof e==`string`&&e===``||Array.isArray(e)&&e.length===0)}function Pd(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Pd(e[n],t[n]))return!1;return!0}if(e!==null&&t!==null&&typeof e==`object`&&typeof t==`object`&&!Array.isArray(e)&&!Array.isArray(t)){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.hasOwn(t,r)||!Pd(e[r],t[r]))return!1;return!0}return!1}var Fd=/^---[ \t]*\r?\n([\s\S]*?\r?\n)?---[ \t]*(\r?\n|$)/,Id=/^---[ \t]*$/;function Ld(e){let t=e.match(Fd);return t?{frontmatter:t[0],body:e.slice(t[0].length)}:{frontmatter:``,body:e}}function Rd(e,t){return e?t===``||/\r?\n$/.test(e)?e+t:e+(e.includes(`\r
172
172
  `)?`\r
173
173
  `:`
174
174
  `)+t:t}function zd(e){if(e===``)return``;let t=e.match(Fd);return t?(t[1]??``).replace(/\r?\n$/,``):e}var Bd={defaultKeyType:`PLAIN`,defaultStringType:`PLAIN`,lineWidth:0};function Vd(e){if(e.trim()===``)return{doc:new lu({}),map:{}};let t;try{t=bd(e)}catch(e){let t=e instanceof Error?e.message:String(e);return{doc:new lu({}),map:null,parseError:`parse threw: ${t}`}}if(t.errors.length>0)return{doc:t,map:null,parseError:t.errors[0]?.message??`yaml parse errors`};let n;try{n=t.toJS()}catch(e){let n=e instanceof Error?e.message:String(e);return{doc:t,map:null,parseError:`toJS threw: ${n}`}}if(typeof n!=`object`||!n||Array.isArray(n))return{doc:t,map:null,parseError:`top-level value is not a mapping`};let r=jd.safeParse(n);if(!r.success){let e=r.error.issues[0],n=e&&Array.isArray(e.path)?e.path.join(`.`):``,i=e?.message??`unknown`;return{doc:t,map:null,parseError:n?`value at "${n}" failed schema: ${i}`:`schema validation failed: ${i}`}}return{doc:t,map:r.data}}function Hd(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Ud(e,t,n){if(Array.isArray(n)){let r=e.createNode(n),i=Us(t)?t.flow:void 0;return i!==void 0&&(r.flow=i),r}if(Hd(n)){let r=e.createNode(n),i=Bs(t)?t.flow:void 0;return i!==void 0&&(r.flow=i),r}return n}function Wd(e){return e===``?``:`---\n${e.endsWith(`
175
175
  `)?e.slice(0,-1):e}\n---\n`}function Gd(e){let t=e.contents;return typeof t!=`object`||!t||!(`items`in t)?[]:t.items.map(e=>{let t=e.key;return typeof t==`string`?t:t&&typeof t==`object`&&`value`in t&&typeof t.value==`string`?t.value:null}).filter(e=>e!==null)}var Kd=`__system__`,qd=`__config__/project`,Jd=`__user__/config.yml`,Yd=`__local__/project`,Xd=`__config__/okignore`,Zd=Object.freeze([qd,Yd,Jd,Xd]),Qd=`__skill__/`,$d=`__extskill__/`,ef=[`project`,`global`];function tf(e){return e.startsWith(`__skill__/`)||e.startsWith(`__template__/`)||e.startsWith(`__extskill__/`)}function nf(e){return`${$d}${e}`}function rf(e,t){return`${$d}${e}/${sf(t)}`}function af(e){return e.startsWith($d)}function of(e){if(!e.startsWith(`__extskill__/`))return null;let t=e.slice(13),n=t.indexOf(`/`),r=n<0?t:t.slice(0,n),i=n<0?null:t.slice(n+1);return/^[a-z0-9-]+$/.test(r)?{name:r,rel:i&&i.length>0?i:null}:null}function sf(e){return e.replace(/\.mdx?$/i,``)}var cf=`.ok/skills`;function lf(e){return`${cf}/${e}/SKILL`}var uf=[`references`,`scripts`];function df(e,t){let n=e.trim();if(!n.startsWith(`/`))return null;let r=n.slice(1);if(r===``||r.includes(`/`))return null;let i=/^(\.[A-Za-z0-9_-]+\/skills)\/[^/]+\/(?:SKILL|references\/.+)$/.exec(t);return i?`${i[1]}/${r}/SKILL`:/^__skill__\/(global)\/[^/]+(?:\/references\/.+)?$/.exec(t)?_f(`global`,r):null}function ff(e,t){let n=/^(\.[A-Za-z0-9_-]+\/skills\/[^/]+)\/(?:SKILL|references\/.+)$/.exec(t)??/^(__skill__\/global\/[^/]+)(?:\/references\/.+)?$/.exec(t)??/^(__extskill__\/[^/]+)(?:\/.+)?$/.exec(t);if(!n)return null;let r=n[1],i=sf(e.trim()).split(`/`).filter(e=>e!==``&&e!==`.`),[a]=i;return!a||!uf.includes(a)||i.includes(`..`)||i.length<2?null:`${r}/${i.join(`/`)}`}var pf=/^\.[A-Za-z0-9_-]+\/skills\/([^/]+)\/(SKILL|references\/.+)$/;function mf(e){let t=pf.exec(e);if(!t)return null;let n=t[1],r=t[2];return r===`SKILL`?{name:n,kind:`skill`,rel:null}:{name:n,kind:`reference`,rel:r.slice(11)}}var hf=/^__skill__\/global\/([^/]+)(?:\/(references\/.+))?$/;function gf(e){let t=hf.exec(e);if(!t)return null;let{name:n,host:r}=vf(t[1]),i=t[2];return i===void 0?{name:n,kind:`skill`,rel:null,host:r}:{name:n,kind:`reference`,rel:i.slice(11),host:r}}function _f(e,t,n){return e===`project`?lf(t):`${Qd}${e}/${t}${n?`@${n}`:``}`}function vf(e){let t=e.indexOf(`@`);if(t<0)return{name:e,host:null};let n=e.slice(t+1);return{name:e.slice(0,t),host:n===``?null:n}}function yf(e,t,n,r){let i=sf(n);return e===`project`?`${cf}/${t}/${i}`:`${Qd}${e}/${t}${r?`@${r}`:``}/${i}`}function bf(e){if(e===``)return``;try{return e.split(`/`).map(e=>decodeURIComponent(e)).join(`/`)}catch{return e}}function xf(e){if(e.startsWith(`__skill__/`)){let t=e.slice(10),n=t.indexOf(`/`);if(n<0)return null;let r=t.slice(0,n);if(r!==`global`&&r!==`project`)return null;let i=t.slice(n+1);if(!i)return null;let a=bf(i),o=a.indexOf(`/`),s=o<0?a:a.slice(0,o);if(!s)return null;let c=o<0?null:a.slice(o+1),{name:l,host:u}=vf(s);return l?{kind:`skill`,scope:r,name:l,host:u,rel:c}:null}return null}var Sf=/^(?:(.+)\/)?\.ok\/templates\/([^/]+?)(?:\.md)?$/;function Cf(e,t){let n=e.replace(/^\/+|\/+$/g,``);return n?`${n}/.ok/templates/${t}`:`.ok/templates/${t}`}function wf(e){let t=Sf.exec(e);return t?{folder:(t[1]??``).replace(/^\/+|\/+$/g,``),name:t[2]}:null}function Tf(e){if(!e.startsWith(`__template__/`))return null;let t=e.slice(13);if(!t)return null;let n=t.lastIndexOf(`/`),r=n<0?t:t.slice(n+1);return r?{folder:bf(n<0?``:t.slice(0,n)),name:bf(r)}:null}var Ef=`.agents/skills`,Df=`open-knowledge-pack-`,Of=`inkeep/open-knowledge-skills`,kf=/(^|[\s([])\/([a-z0-9][a-z0-9-]{1,63})(?=$|[\s.,;:!?)\]])/g,Af=new Set([`tmp`,`usr`,`etc`,`var`,`dev`,`opt`,`bin`,`api`,`home`,`root`]);function jf(e){return!Af.has(e)}var Mf=L({name:M(),description:M(),files:L({skillMd:M(),scripts:F(M()),references:F(M())})}),Nf=L({pluginProvider:M().optional(),plugin:M().optional(),marketplace:M().optional(),repositoryUrl:M().optional(),version:M().optional(),gitCommitSha:M().optional(),scope:M().optional(),projectPath:M().optional()}),Pf=L({commands:P(),hooks:P(),mcp:P()}),Ff=L({...Mf.shape,sourceHarness:M(),sourceHarnesses:F(M()),home:M(),provenance:Nf,inert:Pf,outsideProject:P().optional()}),If=L({schema:z(1),name:M(),version:M(),description:M().optional(),author:L({name:M()}).optional(),skills:F(M()),hostCompatibility:F(M()).optional(),capabilities:L({scripts:M(),network:M(),inert:F(M())}).optional(),provenance:L({source:M(),ref:M(),contentHash:M()}).optional()});I({skills:F(Ff),packs:F(If)}).loose(),I({results:F(I({id:M().min(1),name:M().min(1),source:M().min(1),description:M(),installs:N().int().nonnegative().nullable(),publisher:M().nullable()}).loose()),backend:R([`skills.sh`,`github-fallback`]),degraded:P()}).loose(),I({title:M(),description:M(),image:M().nullable(),skillsUrl:M().nullable(),sourceKind:R([`github`,`site`]),sourceUrl:M()}).loose(),I({skills:F(I({name:M(),description:M().nullable()}).loose())}).loose(),I({kind:R([`local`,`import`,`none`]),scope:R(ef).optional(),name:M().optional(),dir:M().optional(),source:M().optional(),ref:M().optional(),via:R([`source`,`publisher`]).optional()}).loose();var Lf=I({relPath:M(),content:M().nullable()}).loose(),Rf=I({provider:M(),plugin:M(),version:M().optional(),marketplace:M().optional(),repositoryUrl:M().optional()}).loose(),zf=I({provider:M(),plugin:M(),version:M().optional(),description:M().optional(),repositoryUrl:M().optional(),bundledSkills:F(M()),capabilities:I({commands:P(),hooks:P(),mcp:P(),agents:P()}),setupSupported:P()}).loose();I({name:M(),description:M().nullable(),skillMd:M(),files:F(Lf),plugin:Rf.optional(),pluginBundle:zf.optional()}).loose();var Bf=new Set([`project`,`local`]);function Vf(e){return e!==void 0&&Bf.has(e)?`project`:`global`}var Hf=/^([\w.-]+)\/([\w.-]+)$/,Uf=/^(?=.{1,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/i;function Wf(e){let t=Hf.exec(e);if(t){let[,e,n]=t;if(e&&n)return{kind:`github`,owner:e,repo:n}}return Uf.test(e)?{kind:`site`,hostname:e}:null}function Gf(e,t){let n=Wf(e),r=t.trim();if(!n||!r)return null;let i=encodeURIComponent(r);if(n.kind===`github`){let e=encodeURIComponent(n.owner),t=encodeURIComponent(n.repo);return{sourceKind:`github`,skillsUrl:`https://www.skills.sh/${e}/${t}/${i}`,sourceUrl:`https://github.com/${e}/${t}`}}return{sourceKind:`site`,skillsUrl:`https://www.skills.sh/site/${encodeURIComponent(n.hostname)}/${i}`,sourceUrl:`https://${n.hostname}`}}function Kf(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(16).padStart(8,`0`)}var qf={"bridge-merge-loss":{visibility:`surfaced`,gcBucket:`bridge-merge-loss`,bundleExposure:`subject-only`,chainAnchor:!1},"producer-guard-loss":{visibility:`surfaced`,gcBucket:`producer-guard-loss`,bundleExposure:`metadata`,chainAnchor:!1},"observer-a-duplication":{visibility:`surfaced`,gcBucket:`observer-a-duplication`,bundleExposure:`metadata`,chainAnchor:!1},"external-change-rescue":{visibility:`surfaced`,gcBucket:`external-change-rescue`,bundleExposure:`metadata`,chainAnchor:!1},"external-change-rescue-disk-update":{visibility:`surfaced`,gcBucket:`external-change-rescue-disk-update`,bundleExposure:`metadata`,chainAnchor:!1},"defer-exhaustion-loss":{visibility:`surfaced`,gcBucket:`defer-exhaustion-loss`,bundleExposure:`metadata`,chainAnchor:!1},"observer-a-apply-loss":{visibility:`surfaced`,gcBucket:`observer-a-apply-loss`,bundleExposure:`subject-only`,chainAnchor:!1},"bridge-derive-loss":{visibility:`surfaced`,gcBucket:`bridge-derive-loss`,bundleExposure:`subject-only`,chainAnchor:!1},"bridge-backstop-trip":{visibility:`surfaced`,gcBucket:`bridge-backstop-trip`,bundleExposure:`metadata`,chainAnchor:!1},"persistence-reconcile-loss":{visibility:`surfaced`,gcBucket:`persistence-reconcile-loss`,bundleExposure:`metadata`,chainAnchor:!1},"persistence-duplication-reset":{visibility:`surfaced`,gcBucket:`persistence-duplication-reset`,bundleExposure:`metadata`,chainAnchor:!1},"persistence-divergence-realign":{visibility:`surfaced`,gcBucket:`persistence-divergence-realign`,bundleExposure:`metadata`,chainAnchor:!1},"managed-artifact-reconcile":{visibility:`surfaced`,gcBucket:`managed-artifact-reconcile`,bundleExposure:`metadata`,chainAnchor:!1},"auto-consolidation":{visibility:`hidden`,gcBucket:`auto-consolidation`,bundleExposure:`none`,chainAnchor:!0}};function Jf(e){return e==null?!0:qf[e].visibility===`surfaced`}var Yf=[`off`,`follow`,`full`],Xf=`pull`,Zf=[`off`,`follow`,`full`,Xf],Qf=[`follow`,`full`,Xf];function $f(e){return e===Xf?`follow`:ep(e)?e:null}function ep(e){return typeof e==`string`&&Yf.includes(e)}function tp(e){return e===!0?`full`:e===!1?`off`:null}function np(e){return e===!0?`full`:e===!1?`off`:$f(e)}function rp(e){let t=$f(e?.mode);return t===null?tp(e?.enabled):t}var ip=3600,ap=[30,60,300,900,3600];function op(e,t){return typeof e!=`number`||!Number.isFinite(e)?t:Math.min(ip,Math.max(30,Math.round(e)))}function sp(e){return{pullIntervalSeconds:op(e?.pullIntervalSeconds,30),pushIntervalSeconds:op(e?.pushIntervalSeconds,60)}}var cp={sh:`bash`,zsh:`bash`,bash:`bash`,c:`c`,cc:`cpp`,cpp:`cpp`,cxx:`cpp`,"c++":`cpp`,h:`c`,hh:`cpp`,hpp:`cpp`,cs:`csharp`,css:`css`,less:`less`,scss:`scss`,sass:`scss`,diff:`diff`,patch:`diff`,feature:`gherkin`,go:`go`,gql:`graphql`,graphql:`graphql`,ini:`ini`,cfg:`ini`,conf:`ini`,properties:`ini`,java:`java`,js:`javascript`,jsx:`javascript`,mjs:`javascript`,cjs:`javascript`,json:`json`,jsonc:`json`,kt:`kotlin`,kts:`kotlin`,lua:`lua`,makefile:`makefile`,md:`markdown`,mdx:`markdown`,m:`objectivec`,mm:`objectivec`,pl:`perl`,pm:`perl`,php:`php`,phtml:`php`,py:`python`,pyi:`python`,pyx:`python`,r:`r`,rb:`ruby`,rs:`rust`,sql:`sql`,swift:`swift`,ts:`typescript`,tsx:`typescript`,xml:`xml`,yaml:`yaml`,yml:`yaml`},lp=new Set(Object.keys(cp));function up(e){return cp[e.toLowerCase().replace(/^\./,``)]??null}var dp=new Set([`md`,`mdx`,`mmd`,`mermaid`]),fp=new Set([...lp,`txt`,`text`,`csv`,`tsv`,`log`,`toml`,`html`,`htm`,`svg`,`vue`,`svelte`,`astro`,`lock`].filter(e=>!dp.has(e))),pp={html:`html`,htm:`html`,svg:`xml`,vue:`html`,svelte:`html`,astro:`html`,lock:`yaml`};function mp(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);return n<=0?!1:fp.has(t.slice(n+1).toLowerCase())}var hp=[`image/jpeg`,`image/png`,`image/gif`,`image/webp`,`image/svg+xml`],gp=[`video/mp4`,`video/webm`,`video/ogg`],_p=[`audio/mpeg`,`audio/wav`,`audio/ogg`],vp=[`application/pdf`],yp=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`avif`,`svg`]),bp=new Set([`mp4`,`webm`,`mov`,`m4v`,`mkv`]),xp=new Set([`pdf`]),Sp=new Set([`mp3`,`wav`,`ogg`,`m4a`,`flac`,`aac`,`opus`]),Cp=new Set(`pdf.docx.xlsx.pptx.doc.xls.ppt.zip.7z.tar.gz.rar.csv.tsv.rtf.json.yaml.yml.xml.txt.pages.numbers.key.odt.ods.odp.epub.mobi`.split(`.`)),wp=new Set(`png.jpg.jpeg.gif.webp.avif.svg.apng.heic.heif.tiff.bmp.ico.pdf.mp4.webm.mov.m4v.mkv.avi.flv.wmv.mpeg.mpg.mp3.wav.ogg.m4a.flac.aac.opus.zip.7z.tar.gz.rar.woff.woff2.ttf.otf.eot.docx.xlsx.pptx.doc.xls.ppt.odt.ods.odp.pages.numbers.key.epub.mobi.csv.tsv.txt.rtf.json.yaml.yml.xml.toml.lock.gpx.html.htm`.split(`.`)),Tp=new Set(`png.jpg.jpeg.gif.webp.avif.apng.heic.heif.tiff.bmp.ico.svg.pdf.mp4.webm.mov.m4v.mkv.mp3.wav.ogg.m4a.flac.aac.opus.json.toml.lock`.split(`.`)),Ep=`wikiembed`,Dp=`toast`,Op=new Set(`png.jpg.jpeg.gif.webp.avif.svg.pdf.mp4.webm.mov.m4v.mkv.mp3.wav.ogg.m4a.flac.aac.opus.docx.xlsx.pptx.doc.xls.ppt.zip.7z.tar.gz.rar.csv.tsv.rtf.json.yaml.yml.xml.txt.pages.numbers.key.odt.ods.odp.epub.mobi`.split(`.`)),kp=[`png`,`jpg`,`jpeg`,`gif`,`webp`,`avif`],Ap=[`mp4`,`webm`,`mov`,`m4v`],jp=[`mp3`,`wav`,`ogg`,`m4a`,`flac`,`aac`,`opus`],Mp=[`pdf`],Np=[`json`,`toml`,`lock`];function Pp(e,t,n){for(let r of t)if(!n.has(r))throw Error(`${e}: ${r} is not present in canonical upload constants`)}Pp(`SIDEBAR_IMAGE_ASSET_EXTENSIONS`,kp,yp),Pp(`SIDEBAR_VIDEO_ASSET_EXTENSIONS`,Ap,bp),Pp(`SIDEBAR_AUDIO_ASSET_EXTENSIONS`,jp,Sp),Pp(`SIDEBAR_PDF_ASSET_EXTENSIONS`,Mp,xp),Pp(`FILE_ATTACHMENT_EXTENSIONS`,[...Cp],Op),Pp(`WIKI_EMBED_EXTENSIONS`,[...Op],wp);var Fp=new Set(kp),Ip=new Set(Ap),Lp=new Set(jp),Rp=new Set(Mp),zp=new Set(Np);Pp(`SIDEBAR_RENDERABLE_ASSET_EXTENSIONS`,[...new Set([...kp,...Ap,...jp,...Mp,...Np])],Tp);var Bp=new Set([`base`,`canvas`]),Vp=new Set([`mmd`,`mermaid`]);function Hp(e){let t=e.lastIndexOf(`.`);return t<0?!1:Vp.has(e.slice(t+1).toLowerCase())}var Up=new Set([`excalidraw`]);function Wp(e){let t=e.lastIndexOf(`.`);return t<0?!1:Up.has(e.slice(t+1).toLowerCase())}function Gp(e){return!Hp(e)&&!Wp(e)&&!mp(e)}[...wp,...Bp,...Vp,...Up];function Kp(e){let t=e.toLowerCase().replace(/^\./,``);return Fp.has(t)?`image`:Ip.has(t)?`video`:Lp.has(t)?`audio`:Rp.has(t)?`pdf`:zp.has(t)||Bp.has(t)?`text`:Vp.has(t)?`mermaid`:Up.has(t)?`excalidraw`:lp.has(t)?`text`:null}var qp=[`en`,`zh-Hans`,`zh-Hant`,`hi`,`es`,`ar`,`fr`,`bn`,`pt-BR`,`id`,`ur`,`ko`],Jp=[`en`,`zh-Hans`,`zh-Hant`,`hi`,`es`,`fr`,`bn`,`pt-BR`,`id`,`ko`],Yp=new Set([`ar`,`ur`]),Xp=qp.filter(e=>!Yp.has(e)),Zp=[`markdownlint`,`frontmatter`,`okf`],Qp=[`missing`,`invalid`];function $p(e){return e.frontmatterScope!==void 0}[...Zp];var em=[`off`,`warning`,`error`],tm=`warning`,nm=[`error`,`warning`],rm=[`base00`,`base01`,`base02`,`base03`,`base04`,`base05`,`base06`,`base07`,`base08`,`base09`,`base0A`,`base0B`,`base0C`,`base0D`,`base0E`,`base0F`],im={base00:`default background`,base01:`alt background — cards, popovers, sidebar`,base02:`selection background, borders`,base03:`comments, invisibles`,base04:`secondary text`,base05:`default foreground`,base06:`light foreground`,base07:`lightest foreground`,base08:`red — variables, tags, diff deleted`,base09:`orange — numbers, constants`,base0A:`yellow — classes, search highlight`,base0B:`green — strings, diff inserted`,base0C:`cyan — support, escapes, quotes`,base0D:`blue — functions, headings, accent`,base0E:`magenta — keywords, storage`,base0F:`deprecated markers, embedded tags`},am=/^#[0-9a-fA-F]{6}$/,om=/\P{White_Space}/u,sm={graphical:3,text:4.5};function cm(e){return om.test(e)}function lm(e){return typeof e==`string`&&am.test(e)}function um(e,t){let n=wm(e),r=wm(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function dm(e,t){return t.reduce((t,n)=>um(e,n)>um(e,t)?n:t)}function fm(e,t){let n=dm(e,t);return um(e,n)>=sm.text?n:dm(e,[`#000000`,`#ffffff`])}function pm(e,t,n){if(um(e,t)>=n)return t;let r=dm(e,[`#000000`,`#ffffff`]);for(let i=1;i<=255;i+=1){let a=Cm(t,r,i/255);if(um(e,a)>=n)return a}return console.warn(`[base16] No foreground reaches a ${n}:1 contrast ratio against ${e}; using the highest-contrast endpoint`),r}function mm(e){let t=e.palette,n=Cm(t.base02,e.variant===`dark`?`#ffffff`:`#000000`,.04);return{background:t.base00,foreground:t.base05,card:t.base01,"card-foreground":t.base05,popover:t.base01,"popover-foreground":t.base05,primary:t.base0D,"primary-foreground":t.base00,secondary:t.base01,"secondary-foreground":t.base05,muted:t.base01,"muted-foreground":t.base04,accent:t.base02,"accent-foreground":t.base05,destructive:t.base08,border:t.base02,input:t.base02,ring:t.base0D,"selection-soft":t.base02,"chart-1":t.base0D,"chart-2":t.base0B,"chart-3":t.base0A,"chart-4":t.base0E,"chart-5":t.base08,sidebar:t.base01,"sidebar-foreground":t.base05,"sidebar-primary":t.base0D,"sidebar-primary-foreground":t.base00,"sidebar-accent":t.base02,"sidebar-accent-foreground":t.base0D,"sidebar-hover":t.base02,"sidebar-hover-foreground":fm(t.base02,[t.base00,t.base05,t.base07]),"sidebar-hover-muted-foreground":pm(t.base02,t.base04,sm.text),"sidebar-hover-destructive-foreground":pm(t.base02,t.base08,sm.graphical),"sidebar-selected":n,"sidebar-selected-foreground":fm(n,[t.base00,t.base05,t.base07]),"sidebar-selected-muted-foreground":pm(n,t.base04,sm.text),"sidebar-selected-destructive-foreground":pm(n,t.base08,sm.graphical),"sidebar-border":t.base02,"sidebar-ring":t.base0D,"syntax-keyword":t.base0E,"syntax-tag":t.base08,"syntax-attr":t.base0D,"syntax-string":t.base0B,"syntax-number":t.base09,"syntax-atom":t.base0C,"syntax-comment":t.base03,"syntax-func":t.base0D,"syntax-var":t.base08,"syntax-type":t.base0A,"syntax-operator":t.base05,"syntax-meta":t.base0F,"syntax-bg":t.base01,"link-color":t.base0D,"broken-link-color":t.base08,"lint-warning-color":t.base0A,"lint-error-color":t.base08,"diff-added":t.base0B,"diff-removed":t.base08,"diff-modified":t.base0D,"callout-note-color":t.base0D,"callout-info-color":t.base0D,"callout-todo-color":t.base0D,"callout-abstract-color":t.base0C,"callout-tip-color":t.base0B,"callout-success-color":t.base0B,"callout-important-color":t.base0E,"callout-example-color":t.base0E,"callout-question-color":t.base0E,"callout-warning-color":t.base0A,"callout-caution-color":t.base09,"callout-danger-color":t.base09,"callout-failure-color":t.base08,"callout-bug-color":t.base08,"callout-quote-color":t.base03,..._m(t)}}var hm={black:`base00`,red:`base08`,green:`base0B`,yellow:`base0A`,blue:`base0D`,magenta:`base0E`,cyan:`base0C`,white:`base05`,brightBlack:`base03`,brightRed:`base08`,brightGreen:`base0B`,brightYellow:`base0A`,brightBlue:`base0D`,brightMagenta:`base0E`,brightCyan:`base0C`,brightWhite:`base07`},gm=Object.keys(hm);function _m(e){let t={};for(let n of gm)t[`ansi-${vm(n)}`]=e[hm[n]];return t}function vm(e){return e.replace(/([a-z])([A-Z])/g,`$1-$2`).toLowerCase()}function ym(e){return JSON.stringify(e).replace(/[\u007f-\u009f\u2028\u2029\ufffe\uffff]/g,e=>`\\u${e.charCodeAt(0).toString(16).padStart(4,`0`)}`)}function bm(e){return`${[`system: "base16"`,`name: ${ym(e.name)}`,...e.author?[`author: ${ym(e.author)}`]:[],`variant: ${ym(e.variant)}`,`palette:`,...rm.map(t=>` ${t}: ${ym(e.palette[t])}`)].join(`
176
176
  `)}\n`}function xm(e){let t;try{t=xd(e,{schema:`failsafe`})}catch(e){let t=e?.linePos;return{ok:!1,error:{kind:`unparseable`,line:typeof t?.[0]?.line==`number`?t[0].line:void 0}}}if(!t||typeof t!=`object`||Array.isArray(t))return{ok:!1,error:{kind:`not-a-scheme`}};let n=t,r=n.palette,i=r&&typeof r==`object`&&!Array.isArray(r)?r:n,a={},o=[],s=[];for(let e of rm){let t=i[e]??i[e.toLowerCase()];if(t==null){o.push(e);continue}let n=Sm(t);if(!n){s.push(e);continue}a[e]=n}return o.length?{ok:!1,error:{kind:`missing-slots`,slots:o}}:s.length?{ok:!1,error:{kind:`bad-hex`,slots:s}}:typeof n.name==`string`&&!cm(n.name)||typeof n.author==`string`&&!cm(n.author)?{ok:!1,error:{kind:`not-a-scheme`}}:{ok:!0,scheme:{name:typeof n.name==`string`?n.name:`Imported`,author:typeof n.author==`string`?n.author:void 0,variant:n.variant===`light`||n.variant===`dark`?n.variant:Tm(a),palette:a}}}function Sm(e){if(typeof e!=`string`)return null;let t=e.trim();return t.startsWith(`#`)||(t=`#${t}`),/^#[0-9a-fA-F]{3}$/.test(t)&&(t=`#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}`),am.test(t)?t.toLowerCase():null}function Cm(e,t,n){let r=lm(e)?e:`#000000`,i=lm(t)?t:`#000000`,a=Math.min(1,Math.max(0,n)),o=`#`;for(let e=0;e<3;e++){let t=Number.parseInt(r.slice(1+e*2,3+e*2),16),n=Number.parseInt(i.slice(1+e*2,3+e*2),16);o+=Math.round(t+(n-t)*a).toString(16).padStart(2,`0`)}return o}function wm(e){let t=lm(e)?e:`#000000`,n=e=>{let n=Number.parseInt(t.slice(1+e*2,3+e*2),16)/255;return n<=.03928?n/12.92:((n+.055)/1.055)**2.4};return .2126*n(0)+.7152*n(1)+.0722*n(2)}function Tm(e){return wm(e.base00)<wm(e.base05)?`dark`:`light`}var cne={name:`Dracula`,author:`clach04 (https://github.com/clach04)`,variant:`dark`,palette:{base00:`#282a36`,base01:`#21222c`,base02:`#44475a`,base03:`#6272a4`,base04:`#9ea8c7`,base05:`#f8f8f2`,base06:`#f8f8f2`,base07:`#ffffff`,base08:`#ff5555`,base09:`#ffb86c`,base0A:`#f1fa8c`,base0B:`#50fa7b`,base0C:`#8be9fd`,base0D:`#bd93f9`,base0E:`#ff79c6`,base0F:`#993333`}},lne={name:`Catppuccin Frappé`,author:`https://github.com/catppuccin/catppuccin`,variant:`dark`,palette:{base00:`#303446`,base01:`#292c3c`,base02:`#414559`,base03:`#51576d`,base04:`#626880`,base05:`#c6d0f5`,base06:`#f2d5cf`,base07:`#babbf1`,base08:`#e78284`,base09:`#ef9f76`,base0A:`#e5c890`,base0B:`#a6d189`,base0C:`#81c8be`,base0D:`#8caaee`,base0E:`#ca9ee6`,base0F:`#eebebe`}},une={name:`Catppuccin Latte`,author:`https://github.com/catppuccin/catppuccin`,variant:`light`,palette:{base00:`#eff1f5`,base01:`#e6e9ef`,base02:`#ccd0da`,base03:`#bcc0cc`,base04:`#acb0be`,base05:`#4c4f69`,base06:`#dc8a78`,base07:`#7287fd`,base08:`#d20f39`,base09:`#fe640b`,base0A:`#df8e1d`,base0B:`#40a02b`,base0C:`#179299`,base0D:`#1d62ec`,base0E:`#8839ef`,base0F:`#dd7878`}},dne={name:`Monokai`,author:`Wimer Hazenberg (http://www.monokai.nl)`,variant:`dark`,palette:{base00:`#272822`,base01:`#383830`,base02:`#49483e`,base03:`#75715e`,base04:`#a59f85`,base05:`#f8f8f2`,base06:`#f5f4f1`,base07:`#f9f8f5`,base08:`#f92672`,base09:`#fd971f`,base0A:`#f4bf75`,base0B:`#a6e22e`,base0C:`#a1efe4`,base0D:`#66d9ef`,base0E:`#ae81ff`,base0F:`#cc6633`}},fne={name:`Gruvbox dark, medium`,author:`Dawid Kurek, morhetz (https://github.com/morhetz/gruvbox)`,variant:`dark`,palette:{base00:`#282828`,base01:`#3c3836`,base02:`#504945`,base03:`#665c54`,base04:`#bdae93`,base05:`#d5c4a1`,base06:`#ebdbb2`,base07:`#fbf1c7`,base08:`#fb4934`,base09:`#fe8019`,base0A:`#fabd2f`,base0B:`#b8bb26`,base0C:`#8ec07c`,base0D:`#83a598`,base0E:`#d3869b`,base0F:`#d65d0e`}},pne={name:`Solarized Dark`,author:`Ethan Schoonover (modified by aramisgithub)`,variant:`dark`,palette:{base00:`#002b36`,base01:`#073642`,base02:`#586e75`,base03:`#657b83`,base04:`#839496`,base05:`#93a1a1`,base06:`#eee8d5`,base07:`#fdf6e3`,base08:`#dc322f`,base09:`#cb4b16`,base0A:`#b58900`,base0B:`#859900`,base0C:`#2aa198`,base0D:`#2995e1`,base0E:`#6c71c4`,base0F:`#d33682`}};function Em(e,t,n){return{id:e,label:t,kind:n.variant,scheme:n,toTokens:()=>mm(n)}}function Dm(e,t){return{id:e,label:t,kind:`system`}}var Om=[Dm(`default`,`Default`),Em(`dracula`,`Dracula`,cne),Em(`catppuccin-frappe`,`Catppuccin Frappé`,lne),Em(`catppuccin-latte`,`Catppuccin Latte`,une),Em(`monokai`,`Monokai`,dne),Em(`gruvbox`,`Gruvbox`,fne),Em(`solarized`,`Solarized`,pne),Dm(`custom`,`Custom`)],mne=Om.map(e=>e.id),km=/^[a-z0-9-]{1,32}$/,hne=`saved-`,Am=26,gne=/\p{M}+/gu,_ne=/['\u2019\u02bc]+/gu,vne=/[^a-z0-9]+/g;function yne(e){let t=2166136261;for(let n of e)t^=n.codePointAt(0)??0,t=Math.imul(t,16777619);return(t>>>0).toString(16).padStart(8,`0`)}function bne(e){let t=e.trim();if(t.length===0)return{ok:!1,code:`empty`};let n=t.normalize(`NFKD`).replace(gne,``).toLowerCase().replace(_ne,``).replace(vne,`-`).replace(/^-+|-+$/g,``),r=yne(t),i=n.length===0?`theme-${r}`:n.length<=Am?n:`${n.slice(0,Am-r.length-1).replace(/-+$/g,``)}-${r}`,a=xne(i);if(!a.ok)throw Error(`Saved theme name derivation produced an invalid id`);return{ok:!0,name:t,stem:i,id:a.id}}function xne(e){if(e.length===0)return{ok:!1,code:`empty`};let t=hne+e;return km.test(t)?{ok:!0,id:t}:{ok:!1,code:/^[a-z0-9-]+$/.test(t)?`too-long`:`invalid-chars`}}function Sne(e){if(!km.test(e)||!e.startsWith(`saved-`))return{ok:!1};let t=e.slice(6);return t.length===0?{ok:!1}:{ok:!0,stem:t}}var Cne=new Map(Om.map(e=>[e.id,e]));function wne(e){return e&&Cne.get(e)||Om[0]}function Tne(e,t=Om){let n=new Set(t.map(e=>e.id)),r=e?.colorTheme,i=r&&n.has(r)?r:Om[0].id,a=e=>e===void 0?i:n.has(e)?e:Om[0].id;return{light:a(e?.colorThemeLight),dark:a(e?.colorThemeDark)}}function Ene(e,t){return e===`light`||e===`dark`?e:t?`dark`:`light`}function Dne(e,t,n){return`${e} {\n color-scheme: ${t};\n${Object.entries(n).map(([e,t])=>` --${e}: ${t};`).join(`
177
- `)}\n}`}var jm=Symbol.for(`@inkeep/open-knowledge/field-registry`),Mm=globalThis;Mm[jm]===void 0&&(Mm[jm]=pr());var U=Mm[jm];function Nm(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=One(t)?U.get(t):void 0;if(e!==void 0)return e;let n=t._zod?.def?.innerType;if(n===void 0)return;t=n}}function One(e){return typeof e==`object`&&!!e&&`_zod`in e&&`parse`in e}function kne(){return Object.fromEntries(rm.map(e=>[e,M().register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Custom theme: base16 ${e} — ${im[e]}, as a #rrggbb hex string.`}).optional()]))}function Pm(){return mne.filter(e=>e!==`default`&&e!==`custom`).map(e=>`'${e}'`).join(`, `)}var Fm=Object.freeze([`authorization`,`auth.token`,`auth.bearer`,`cookie`,`set-cookie`,`x-api-key`,`password`,`secret`]),Im=52428800,Lm=26214400,Rm=12582912,zm=`https://api.openai.com/v1`,Bm=`text-embedding-3-small`,Vm=96e3,Hm=3e4,Um=2048,Wm=16384e3,Gm=6e5,Km=Object.freeze([`127.0.0.1`]),Ane=/^[1-9]\d*(s|m|h)$/,jne=/^https?:\/\//,Mne=24550;function Nne(e){let t;try{t=new URL(e)}catch{return!1}let n=t.hostname.toLowerCase();return n===`localhost`||n===`127.0.0.1`||n===`[::1]`}function Pne(e){let t;try{t=new URL(e)}catch{return`invalid-url`}return t.protocol===`https:`||t.protocol===`http:`&&Nne(e)?null:`insecure-scheme`}function qm(e){let t=e.trim();return t===``?`./`:t}function Fne(e){let t=qm(e);return t.includes(`\0`)||t.includes(`\\`)?!1:t===`/`?!0:!(t.startsWith(`/`)||/^[A-Za-z]:/.test(t)||t.split(`/`).some(e=>e===`..`))}var Jm=L({content:L({dir:M().register(U,{scope:`project`,agentSettable:!1,reload:`boot`,defaultScope:`project`,description:`Folder OpenKnowledge reads and writes documents under, relative to the project root (the folder that contains .ok/). Defaults to the project root. Exclude paths with .okignore. Read at server start; changing it requires a restart.`}).default(`.`),attachmentFolderPath:M().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Where pasted and dropped assets are stored, relative to the content root. './' colocates beside the current document (default); '/' targets the content root; './subdir' targets a subfolder under the current document folder; 'folder' targets a fixed folder under the content root. Whitespace-only values are treated as './'.`}).refine(Fne,{message:`Invalid attachment folder path: must not contain '..' segments, NUL bytes, backslashes, or OS absolute paths (use '/' for the content root).`}).default(`./`)}).default({dir:`.`,attachmentFolderPath:`./`}),appearance:L({theme:R([`light`,`dark`,`system`]).register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Editor color theme: 'light', 'dark', or 'system' (follow the OS). A personal preference (user scope) — not shared with the project.`}).optional(),language:R([`system`,...qp]).register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Interface language. 'system' follows the operating system. A personal preference (user scope) — not shared with the project, and never applied to document content.`}).optional(),colorThemeLight:M().register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`IDE color palette applied in light mode: 'default' (no palette), 'custom' (your own colors from appearance.customTheme), one of ${Pm()}, or the id of a saved theme. A short id of lowercase letters, digits, and hyphens (max 32 characters); an id no palette matches falls back to 'default' for this mode only, leaving the rest of your config untouched. A personal preference (user scope) — not shared with the project.`}).regex(km,{message:`Theme id must be lowercase letters, digits, and hyphens, 1–32 characters (e.g. 'dracula', 'custom', or a saved theme id).`}).optional(),colorThemeDark:M().register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`IDE color palette applied in dark mode: 'default' (no palette), 'custom' (your own colors from appearance.customTheme), one of ${Pm()}, or the id of a saved theme. A short id of lowercase letters, digits, and hyphens (max 32 characters); an id no palette matches falls back to 'default' for this mode only, leaving the rest of your config untouched. A personal preference (user scope) — not shared with the project.`}).regex(km,{message:`Theme id must be lowercase letters, digits, and hyphens, 1–32 characters (e.g. 'dracula', 'custom', or a saved theme id).`}).optional(),colorTheme:M().register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Superseded by appearance.colorThemeLight / appearance.colorThemeDark. Read as the palette for both modes while neither of those is set. A short theme id (lowercase letters, digits, and hyphens; max 32 characters); an id no palette matches falls back to 'default'. A personal preference (user scope) — not shared with the project.`}).regex(km,{message:`Theme id must be lowercase letters, digits, and hyphens, 1–32 characters (e.g. 'dracula', 'custom', or a saved theme id).`}).optional(),colorThemeEnabled:P().register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Whether the Themes plugin appears in Settings → Plugins. A personal preference (user scope). Default on.`}).optional(),customTheme:L({name:M().register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Custom theme: the scheme's display name.`}).optional(),author:M().register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Custom theme: the scheme's author credit, carried through from an imported base16 scheme.`}).optional(),variant:R([`dark`,`light`]).register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Custom theme: whether the scheme is 'dark' or 'light'. Auto-detected from the palette when omitted.`}).optional(),...kne()}).optional(),preview:L({autoOpen:P().register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`When on, the agent opens or refreshes the live preview after each edit. Turn off if you manage your own preview window. A personal preference (user scope).`}).default(!0)}).default({autoOpen:!0}),sidebar:L({showHiddenFiles:P().register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Show dot-prefixed entries (e.g. .ok/, .okignore) in the file tree. Per-machine (project-local) — not shared with collaborators.`}).default(!1),showOnlyMarkdownFiles:P().register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Show only markdown documents (.md/.mdx) and folders in the file tree, hiding other file types from view. View-only: hidden files stay on disk and remain reachable via links and search. Per-machine (project-local) — not shared with collaborators.`}).default(!1),showSkillsSection:P().register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Show the Skills section in the sidebar. Skill documents remain reachable via links and search while the section is hidden. Per-machine (project-local) — not shared with collaborators.`}).default(!0),showOkFolders:P().register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Show .ok folders (skills, templates, and other OpenKnowledge-managed state) in the file tree as read-only entries. .ok/worktrees and .ok/local never appear. Per-machine (project-local) — not shared with collaborators.`}).default(!1),showSkillGroups:P().register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Group skills in the sidebar by where they came from — the publisher they were imported from, or the plugin that ships them. Skills you authored stay ungrouped at the top of their scope. Per-machine (project-local) — not shared with collaborators.`}).default(!0),pinnedProjectSkills:F(M()).register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Project-scope skills pinned to the top of the Skills sidebar, by name. A pinned skill also keeps its normal row, so a provenance group still lists everything from its source. Per-machine (project-local) — not shared with collaborators.`}).default([]),pinnedGlobalSkills:F(M()).register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Global-scope skills pinned to the top of the Skills sidebar, by name. Stored per USER rather than per project, so a pinned global skill follows you into every project.`}).default([])}).optional()}).default({preview:{autoOpen:!0}}),editor:L({wordWrap:P().register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Soft-wrap long lines in the source (CodeMirror) editor. A personal preference (user scope).`}).default(!0),previewTabs:P().register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Reuse one tab when clicking through the Files and Skills sidebars, the way an editor preview tab works. Turn off to open every click in its own tab. Pinned tabs keep their own tab either way. A personal preference (user scope).`}).default(!0)}).default({wordWrap:!0,previewTabs:!0}),agents:L({autoApproveOkTools:P().register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:"Auto-approve OpenKnowledge's own tools (and `ok open` on Claude) for agents launched from the built-in terminal. Destructive tools (delete/move/share/install) still prompt. Per-machine personal preference (user scope)."}).default(!0)}).default({autoApproveOkTools:!0}),autoSync:L({mode:R(Zf).register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`What this machine syncs on a schedule for this project: 'off' (Manual — nothing scheduled; the manual pull/push actions still work), 'follow' (Auto, pull only — scheduled pulls, never a scheduled push; 'pull' is accepted as a legacy alias), or 'full' (Auto, pull and push — bidirectional). Explicit user-triggered pushes work in every mode. null = not chosen yet (onboarding asks). Per-machine (project-local) — not shared. Supersedes the legacy autoSync.enabled boolean.`}).nullable().default(null),enabled:P().register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Legacy per-machine sync toggle, superseded by autoSync.mode. Read only when mode is absent (true = full, false = off). null = not chosen yet. Per-machine (project-local) — not shared.`}).nullable().default(null),resumeMode:R(Qf).register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`When sync is paused (autoSync.mode 'off') after having been enabled, the active mode to resume into ('follow' | 'full'). Per-machine UI memory; ignored while a mode is active. Not shared.`}).optional(),pullIntervalSeconds:N().int().min(30).max(ip).register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Seconds between scheduled pulls while autoSync.mode is follow or full (default 30). An unauthenticated follower is additionally floored to the anonymous poll minimum, so a lower value there has no effect. Per-machine (project-local) — not shared.`}).optional().catch(void 0),pushIntervalSeconds:N().int().min(30).max(ip).register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Seconds between scheduled pushes while autoSync.mode is full (default 60). Ignored in every other mode, which never pushes on a schedule. Each cycle with pending edits authors a commit, so a shorter interval means more, smaller commits in the repo's shared history. Per-machine (project-local) — not shared.`}).optional().catch(void 0),default:Va([P(),R(Zf)]).register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Committed project default for a machine's sync mode on first open: 'off' | 'follow' | 'full', or the legacy boolean (true = full, false = off). null = ask (show the onboarding prompt). Shared via git. A per-machine autoSync.mode choice overrides it.`}).nullable().default(null)}).default({mode:null,enabled:null,default:null}),terminal:L({enabled:P().register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Opt-out for the in-app terminal (a real OS shell at full user privilege). The terminal is on by default; set false to disable it for this project on this machine. Per-machine (project-local) — never shared via git, clone, or sync.`}).nullable().default(null),shell:M().register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Absolute Windows shell executable override for the in-app terminal. PowerShell, cmd.exe, and Git Bash support OpenKnowledge-managed launches (agent chat tabs and fixed commands such as Resolve in terminal or Install Slidev) and dropped-file path insertion. A different existing executable remains usable for plain terminal tabs and shows a capability notice; requested agent and command launches open only the plain shell without running the agent or command, and dropped-file paths are refused. Empty values use automatic shell discovery. Per-machine (project-local), human-managed, and never shared via git, clone, or sync.`}).optional()}).default({enabled:null}),slides:L({enabled:P().register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:"Whether the Slides plugin appears in Settings → Plugins. When on, a document whose frontmatter has `slides: true` offers an action that opens the deck in a dedicated window (desktop only, requires a resolvable slidev). A personal preference (user scope). Default off."}).default(!1)}).default({enabled:!1}),telemetry:L({localSink:L({enabled:P().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:"Write local diagnostic spans + logs under .ok/local/ for `ok diagnose bundle`. Local-only — never leaves the machine until you run bundle. Set false for sensitive workspaces. Shared across collaborators."}).default(!0),spans:L({maxBytes:N().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Maximum size, in bytes, of the local diagnostic spans file before it rotates (default ~50 MB).`}).default(Im)}).default({maxBytes:Im}),logs:L({maxBytes:N().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Maximum size, in bytes, of the local diagnostic logs file before it rotates (default ~25 MB).`}).default(Lm)}).default({maxBytes:Lm}),attributeDenylist:F(M()).register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Telemetry attribute keys whose values are redacted before any local span/log is written (credential / secret guard). Extends the built-in denylist.`}).default([...Fm])}).default({enabled:!0,spans:{maxBytes:Im},logs:{maxBytes:Lm},attributeDenylist:[...Fm]}),skillInstallReports:L({enabled:P().register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Report skill installs to skills.sh so a published skill shows an accurate install count. Sends the skill name, its source repo, and which agent tools it was installed for — never file contents, and never for a private or local source. One report per skill per machine. Default on; the DO_NOT_TRACK and DISABLE_TELEMETRY environment variables also turn it off.`}).default(!0)}).default({enabled:!0})}).default({localSink:{enabled:!0,spans:{maxBytes:Im},logs:{maxBytes:Lm},attributeDenylist:[...Fm]},skillInstallReports:{enabled:!0}}),lossCapture:L({enabled:P().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:"Record bridge loss-class events (content-free) under .ok/local/loss-capture/ for `ok diagnose bundle`. Local-only — never leaves the machine until you run bundle. Set false for sensitive workspaces. Shared across collaborators."}).default(!0),maxBytes:N().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Maximum size, in bytes, of the local loss-capture file before it rotates (default ~12 MB).`}).default(Rm)}).default({enabled:!0,maxBytes:Rm}),bridge:L({backgroundThrottle:L({enabled:P().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Keep the desktop window's timers running at full rate while it holds unsynced work, so backgrounding the app never starves sync or recovery; when the window is idle the OS-default background throttling is restored (battery). Honored by the desktop app. Default ON — disable only to isolate a suspected regression.`}).default(!0)}).default({enabled:!0}),deferGuard:L({enabled:P().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Defer a drain-shaped Observer B re-derive when the WYSIWYG fragment holds an un-propagated keystroke Y.Text lacks, so the keystroke survives instead of being stomped. Default ON — disable only to isolate a suspected regression.`}).default(!0)}).default({enabled:!0}),lossDetector:L({enabled:P().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Detect content the bridge silently dropped at its reconciliation boundary (an Observer-A apply arm or a paired agent-undo derive) and write a recovery checkpoint plus a content-free loss event. Detection only — never blocks a write. Default ON — disable only to isolate a suspected regression.`}).default(!0)}).default({enabled:!0}),fixedPoint:L({enabled:P().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Bound the Y.Text→WYSIWYG re-derive loop with a drain-count backstop: a run of re-derive drains that never reaches a raw-byte fixed point freezes the re-derive loop and writes a recovery checkpoint plus a content-free loss event, instead of churning unbounded. Default ON — disable only to isolate a suspected regression.`}).default(!0)}).default({enabled:!0}),preDrain:L({enabled:P().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Before an agent write or undo rebuilds the WYSIWYG fragment, flush an un-propagated keystroke that provably does not overlap the operation into Y.Text so the keystroke survives instead of needing recovery; overlapping or unmodellable cases fall back to the checkpoint floor. Scope: appending writes and single-frame undos — a write that replaces the whole body (replace / edit) overwrites the keystroke either way, so those always take the checkpoint floor. Default ON — disable only to isolate a suspected regression.`}).default(!0)}).default({enabled:!0}),flushOnHide:L({enabled:P().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`On tab hide/unload, force-send each doc's unsynced work to the server and commit its local cache, and re-sync on return to foreground, so a backgrounded tab never strands edits that IndexedDB alone would lose on recycle. Honored client-side. Default ON — disable only to isolate a suspected regression.`}).default(!0)}).default({enabled:!0})}).default({backgroundThrottle:{enabled:!0},deferGuard:{enabled:!0},lossDetector:{enabled:!0},fixedPoint:{enabled:!0},preDrain:{enabled:!0},flushOnHide:{enabled:!0}}),search:L({semantic:L({enabled:P().register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:"Add semantic (embeddings) ranking to the MCP search tool, fused with the lexical engine so conceptually-related pages surface even with no shared keywords. When ON and an API key is set (`ok embeddings set-key`), the search query and matching document content are sent to the configured embeddings provider — content egress. Default OFF. Per-machine (project-local) — not shared with collaborators."}).default(!1),baseUrl:M().register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:"Base URL of the OpenAI-compatible embeddings API (default https://api.openai.com/v1). Override to point at a self-hosted server (Ollama / vLLM / LM Studio) or another provider. The API key is NOT stored here — set it with `ok embeddings set-key` (`~/.ok/secrets.yml`); it is sent to whichever endpoint this names."}).default(zm),model:M().register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Embeddings model id (default text-embedding-3-small). Must be served by the provider at baseUrl. Changing it re-embeds the corpus (the cache is keyed by provider + model + dimensions).`}).default(Bm),dimensions:N().int().positive().register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Optional output vector dimensions. Omit (recommended) to detect the model's native size from its first response — that is what lets a non-OpenAI model work without knowing its size up front. Set a smaller value (text-embedding-3 supports e.g. 512 / 1024) to shrink the on-disk cache, trading a little retrieval quality; a server that ignores the request param then fails loudly instead of silently. Changing it re-embeds the corpus.`}).optional(),similarityFloor:N().min(0).max(1).register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Optional hard cutoff: drop any "by meaning" match whose cosine similarity is below this value. Off by default (0) because retrieval is rank-based (the closest pages are returned regardless of absolute score) and the right cutoff is model-specific. Set it only to suppress weak matches for a specific provider/model whose cosine scale you know. Most setups should leave it unset and rely on the result-count cap.`}).optional(),maxBatchSize:N().int().min(1).max(Um).register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Maximum number of text chunks sent in one indexing request (1–2048, default 96). The ceiling follows OpenAI's input-array limit; other providers may impose different limits. Larger requests may still be split by the character budget. Changing it preserves cached vectors and document chunking; it applies to the next indexing pass. Invalid values use the default and are reported by ok config validate and server logs.`}).default(96).catch(96),maxBatchChars:N().int().min(1).max(Wm).register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Approximate cumulative character budget per indexing request (1–16384000, default 96000). A single chunk can exceed this budget. OpenAI separately caps total input at 300000 tokens per request; this character budget does not enforce that limit, and high values can produce rejected requests. Other providers have their own limits. Changing it preserves cached vectors and document chunking; it applies to the next indexing pass. Invalid values use the default and are reported by ok config validate and server logs.`}).default(Vm).catch(Vm),docTimeoutMs:N().int().min(1).max(Gm).register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Timeout in milliseconds for each indexing request attempt (1–600000, default 30000). A request can retry four times, and a failed grouped request can trigger individual-document requests. There is no total indexing-pass deadline: large timeouts can delay newly queued work for hours. The query timeout remains 8 seconds per attempt. Changing it preserves cached vectors and applies to the next indexing pass; an in-progress pass keeps its current timeout. Invalid values use the default and are reported by ok config validate and server logs.`}).default(Hm).catch(Hm)}).default({enabled:!1,baseUrl:zm,model:Bm,maxBatchSize:96,maxBatchChars:Vm,docTimeoutMs:Hm})}).default({semantic:{enabled:!1,baseUrl:zm,model:Bm,maxBatchSize:96,maxBatchChars:Vm,docTimeoutMs:Hm}}),contentRules:L({markdownlint:I({enabled:P().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Whether the markdownlint plugin (body rules) contributes diagnostics.`}).default(!1)}).default({enabled:!1}),frontmatter:I({enabled:P().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Whether the frontmatter plugin (JSON-Schema validation of document frontmatter) contributes diagnostics.`}).default(!1),schemas:F(I({appliesTo:Va([M(),F(M())]).optional(),file:M(),enabled:P().optional()})).register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Frontmatter schema mappings: which docs (appliesTo globs) validate against which JSON Schema file (project-root-relative path).`}).default([])}).default({enabled:!1,schemas:[]}),okf:I({enabled:P().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Whether the OKF plugin (Open Knowledge Format portability + conformance rules) contributes diagnostics. Advisory warnings; never blocks a write.`}).default(!1),rules:qa(M(),P()).register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Per-rule opt-outs for the OKF plugin, keyed by rule id (e.g. no-wiki-links). Omit a rule to leave it enabled; set false to silence it while keeping the plugin on.`}).optional(),generate:I({index:P().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Whether OK generates and maintains a navigation index.md in every folder that contains Markdown, each listing the documents in that folder grouped by frontmatter type and linking to its subfolders. OK owns these files: edits to them are replaced on the next rebuild.`}).default(!1)}).default({index:!1})}).default({enabled:!1,generate:{index:!1}})}).default({markdownlint:{enabled:!1},frontmatter:{enabled:!1,schemas:[]},okf:{enabled:!1,generate:{index:!1}}}),validation:L({links:R(em).register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`How broken internal links are reported on the validation plane: 'off' hides them, 'warning' (default) or 'error' sets their severity.`}).default(tm),fileTreeIndicators:P().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Whether the file tree tints and badges files that have validation problems.`}).default(!0),suppressLogLinkAdvisories:P().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Whether unresolved links in the reserved change-history documents (lowercase-stemmed log.md / log.mdx at any depth, where the extension's case does not matter and the stem's does) are omitted from broken-link advisories: the Problems panel, file-tree indicators, source diagnostics, audits, and agent write/edit results. Default true. Raw link views still show them, and LOG.md, Log.md, and every other stem spelling are ordinary documents.`}).default(!0)}).default({links:tm,fileTreeIndicators:!0,suppressLogLinkAdvisories:!0}),linkPreviews:L({enabled:P().register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Show a rich preview card (site name, page title, description, favicon) when you hover an external link in the editor. When ON, hovering an external link sends that link's URL to the destination site to fetch its preview metadata — outbound egress, one request per previewed link. Default ON; set to false to turn external previews off. Per-machine (project-local) — not shared with collaborators. Previews of links to other documents in this project are read from the local index with no network request and are always on.`}).default(!0)}).default({enabled:!0}),server:L({port:N().int().min(1).max(65535).register(U,{scope:`project`,agentSettable:!1,reload:`boot`,defaultScope:`project`,description:`TCP port the server listens on. Unset by default: a local start picks a free port dynamically, and deployment platforms inject the PORT environment variable instead. Read at server start; changing it requires a restart.`}).optional(),bind:F(M().min(1)).min(1).register(U,{scope:`project-local`,agentSettable:!1,reload:`boot`,defaultScope:`project-local`,description:`Addresses the server binds, e.g. [127.0.0.1] or [0.0.0.0]. Default loopback-only ([127.0.0.1]): nothing off this machine can connect. A non-loopback bind additionally requires the server.allowExternal consent interlock. Per-machine (project-local): a value committed to .ok/config.yml is ignored, so one machine exposing the server can never break local clones for the rest of the team — the exposing host sets it via OK_BIND, --bind, or .ok/local/config.yml. Lists replace, never merge. Read at server start; changing it requires a restart.`}).default([...Km]),externalUrl:da({protocol:/^https?$/}).regex(jne).register(U,{scope:`project`,agentSettable:!1,reload:`boot`,defaultScope:`project`,description:`Canonical external origin the server is reached at, e.g. https://kb.example.com — its host joins the Host/Origin allowlists (external-Host + CORS admission). Unset by default: the server admits only loopback Hosts. Setting it declares external exposure, which additionally requires the server.allowExternal consent interlock. Read at server start; changing it requires a restart.`}).optional(),allowExternal:P().register(U,{scope:`project-local`,agentSettable:!1,reload:`boot`,defaultScope:`project-local`,description:`Exposure consent interlock. A non-loopback server.bind without allowExternal: true is refused at boot with a one-line fix; a server.externalUrl without it boots (a committed externalUrl never arms exposure on clones — but it is project-scoped, so its host still joins the Host/Origin allowlists there), but requests carrying forwarding headers (X-Forwarded-For etc.) are refused until consent is given — proxy tolerance requires both keys. Default off. The server has no authentication of its own, so only consent behind an authenticating edge. Per-machine (project-local) — consent never travels via git, clone, or share; containers consent via the environment instead.`}).default(!1),openBrowser:P().register(U,{scope:`project-local`,agentSettable:!1,reload:`boot`,defaultScope:`project-local`,description:`Open the UI in a browser when the server starts. Default derived: true when every bind address is loopback (a laptop start pops the UI), false otherwise (a container or exposed bind is headless and must never try). Acts once at start. Per-machine (project-local) — not shared.`}).optional(),idleShutdown:Va([z(`off`),M().regex(Ane)]).register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Shut the server down after this long with no activity: a duration like '30m' (positive integer with unit s, m, or h), or 'off'. Default derived: '30m' for a loopback-only, unexposed server; 'off' otherwise — a non-loopback bind, or a loopback bind declared externally reachable (server.allowExternal + server.externalUrl), stays up, because a remote agent keeps it busy over /mcp, which the idle timer does not count. Residual case the derivation cannot see: a loopback server reached by remote agents with no server.externalUrl (e.g. behind a same-box reverse proxy) still idles at 30m — set 'off' by hand. Reloadable — a valid change applies without a restart. Per-machine (project-local) — not shared.`}).optional()}).default({bind:[...Km],allowExternal:!1})}),Ine=`open-knowledge-config`;function Ym(e,t,n){let r=c.getTracer(Ine),i=t?{attributes:t}:{};return r.startActiveSpan(e,i,e=>{try{return n(e)}catch(t){throw e.recordException(t),e.setStatus({code:s.ERROR,message:t instanceof Error?t.message:String(t)}),t}finally{e.end()}})}function Xm(e,t){let n=c.getActiveSpan();n&&n.addEvent(e,t)}function Lne(e){let t=e;for(let e=0;e<16;e++){if(t==null||t?._zod?.def?.shape!==void 0)return t;let e=t?._zod?.def?.innerType;if(e===void 0)return t;t=e}return t}function Zm(e,t){let n=e;for(let e of t){n=Lne(n);let t=n?._zod?.def?.shape;if(!t||(n=t[String(e)],n===void 0))return}return n}function Qm(e,t){let n=Zm(e,t);if(n!==void 0)return Nm(n)}function Rne(e,t){return e===`either`?!0:e===t}function zne(e,t){let n=null;function r(e,i){if(n!==null||e===void 0)return;if(typeof e==`object`&&e&&!Array.isArray(e)){for(let[t,a]of Object.entries(e))if(r(a,[...i,t]),n!==null)return;return}let a=Qm(Jm,i);a?.scope!==void 0&&(Rne(a.scope,t)||(n={code:`SCOPE_VIOLATION`,path:i,expectedScope:a.scope,actualScope:t}))}for(let[t,i]of Object.entries(e))if(r(i,[t]),n!==null)break;return n}function $m(e,t){for(let n=1;n<t.length;n++){let r=t.slice(0,n);e.hasIn(r)&&(Ws(e.getIn(r,!0))||e.deleteIn(r))}}function Bne(e,t){let n=[];function r(t,i){if(t!==void 0){if(t===null){e.deleteIn(i),n.push(i.join(`.`));return}if(Array.isArray(t)){$m(e,i),e.setIn(i,t),n.push(i.join(`.`));return}if(typeof t==`object`){for(let[e,n]of Object.entries(t))r(n,[...i,e]);return}$m(e,i),e.setIn(i,t),n.push(i.join(`.`))}}for(let[e,n]of Object.entries(t))r(n,[e]);return n}function Vne(e){return{path:e.path.map(e=>typeof e==`symbol`?String(e):e),message:e.message,issueCode:e.code}}var eh=I({file:M(),line:N().int().min(1),column:N().int().min(1),snippet:M().optional()}),Hne=I({path:F(Va([M(),N()])),message:M(),issueCode:M(),params:qa(M(),Pa()).optional(),source:eh.optional()}),Une=R([`user`,`project`,`project-local`,`either`]),th=R([`user`,`project`,`project-local`]),nh=I({code:z(`YAML_PARSE`),detail:M()}),rh=I({code:z(`UNREADABLE`),detail:M()}),ih=I({code:z(`SCHEMA_INVALID`),issues:F(Hne)}),ah=I({code:z(`REMOVED_KEY`),path:F(M()),redirect:M(),source:eh.optional()}),oh=I({path:F(M()),message:M(),source:eh.omit({snippet:!0}).optional()}),sh=I({code:z(`VALUE_FALLBACK`),issues:F(oh)}),ch=Ua(`code`,[nh,ih,rh,I({code:z(`SCOPE_VIOLATION`),path:F(M()),expectedScope:Une,actualScope:th}),I({code:z(`NOT_AGENT_SETTABLE`),path:F(M())}),I({code:z(`MIXED_SCOPE`),paths:F(I({path:F(M()),scope:th}))}),ah,I({code:z(`NOT_SYNCED`),detail:M()}),I({code:z(`WRITE_ERROR`),detail:M()}),I({code:z(`OKIGNORE_INVALID`),detail:M(),lineNumber:N().int().min(1).optional()}),I({code:z(`UNKNOWN`),message:M().optional()})]);Ua(`code`,[ah,sh,nh,ih,rh]),I({diagnostics:F(Ua(`code`,[I({code:z(`VALUE_FALLBACK`),scope:th,file:M(),issues:F(oh.omit({source:!0}).extend({line:eh.shape.line.optional(),column:eh.shape.column.optional()}))}),I({code:z(`REMOVED_KEY`),scope:th,file:M(),path:F(M()),redirect:M()}),I({code:z(`YAML_PARSE`),scope:th,file:M()}),I({code:z(`SCHEMA_INVALID`),scope:th,file:M()}),I({code:z(`UNREADABLE`),scope:th,file:M()})]))});var Wne=new Set(ch.options.map(e=>e.shape.code.value)),Gne=Va([ch,L({code:M(),message:M().optional()})]);function lh(e){return Wne.has(e.code)}function uh(e){switch(e){case`user`:return`~/.ok/global.yml`;case`project`:return`.ok/config.yml`;case`project-local`:return`.ok/local/config.yml`;case`either`:return`.ok/config.yml or ~/.ok/global.yml`}}function Kne(e){switch(e){case`user`:return`personal to you, across all projects`;case`project`:return`shared with your team via git`;case`project-local`:return`this machine only, not shared`;case`either`:return`user or project`}}function qne(e){if(e.code===`VALUE_FALLBACK`){let t=sh.safeParse(e);if(t.success){if(t.data.issues.length===0)return`Configuration loaded with defaults for invalid settings.`;let e=[`Configuration loaded with defaults for invalid settings:`];for(let n of t.data.issues)n.source&&e.push(` ${n.source.file}:${n.source.line}:${n.source.column}`),e.push(` ${n.path.join(`.`)}: ${n.message}`);return e.join(`
177
+ `)}\n}`}var jm=Symbol.for(`@inkeep/open-knowledge/field-registry`),Mm=globalThis;Mm[jm]===void 0&&(Mm[jm]=pr());var U=Mm[jm];function Nm(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=One(t)?U.get(t):void 0;if(e!==void 0)return e;let n=t._zod?.def?.innerType;if(n===void 0)return;t=n}}function One(e){return typeof e==`object`&&!!e&&`_zod`in e&&`parse`in e}function kne(){return Object.fromEntries(rm.map(e=>[e,M().register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Custom theme: base16 ${e} — ${im[e]}, as a #rrggbb hex string.`}).optional()]))}function Pm(){return mne.filter(e=>e!==`default`&&e!==`custom`).map(e=>`'${e}'`).join(`, `)}var Fm=Object.freeze([`authorization`,`auth.token`,`auth.bearer`,`cookie`,`set-cookie`,`x-api-key`,`password`,`secret`]),Im=52428800,Lm=26214400,Rm=12582912,zm=`https://api.openai.com/v1`,Bm=`text-embedding-3-small`,Vm=96e3,Hm=3e4,Um=2048,Wm=16384e3,Gm=6e5,Km=Object.freeze([`127.0.0.1`]),Ane=/^[1-9]\d*(s|m|h)$/,jne=/^https?:\/\//,Mne=24550;function Nne(e){let t;try{t=new URL(e)}catch{return!1}let n=t.hostname.toLowerCase();return n===`localhost`||n===`127.0.0.1`||n===`[::1]`}function Pne(e){let t;try{t=new URL(e)}catch{return`invalid-url`}return t.protocol===`https:`||t.protocol===`http:`&&Nne(e)?null:`insecure-scheme`}function qm(e){let t=e.trim();return t===``?`./`:t}function Fne(e){let t=qm(e);return t.includes(`\0`)||t.includes(`\\`)?!1:t===`/`?!0:!(t.startsWith(`/`)||/^[A-Za-z]:/.test(t)||t.split(`/`).some(e=>e===`..`))}var Jm=L({content:L({dir:M().register(U,{scope:`project`,agentSettable:!1,reload:`boot`,defaultScope:`project`,description:`Folder OpenKnowledge reads and writes documents under, relative to the project root (the folder that contains .ok/). Defaults to the project root. Exclude paths with .okignore. Read at server start; changing it requires a restart.`}).default(`.`),attachmentFolderPath:M().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Where pasted and dropped assets are stored, relative to the content root. './' colocates beside the current document (default); '/' targets the content root; './subdir' targets a subfolder under the current document folder; 'folder' targets a fixed folder under the content root. Whitespace-only values are treated as './'.`}).refine(Fne,{message:`Invalid attachment folder path: must not contain '..' segments, NUL bytes, backslashes, or OS absolute paths (use '/' for the content root).`}).default(`./`)}).default({dir:`.`,attachmentFolderPath:`./`}),appearance:L({theme:R([`light`,`dark`,`system`]).register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Editor color theme: 'light', 'dark', or 'system' (follow the OS). A personal preference (user scope) — not shared with the project.`}).optional(),language:R([`system`,...qp]).register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Interface language. 'system' follows the operating system. A personal preference (user scope) — not shared with the project, and never applied to document content.`}).optional(),colorThemeLight:M().register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`IDE color palette applied in light mode: 'default' (no palette), 'custom' (your own colors from appearance.customTheme), one of ${Pm()}, or the id of a saved theme. A short id of lowercase letters, digits, and hyphens (max 32 characters); an id no palette matches falls back to 'default' for this mode only, leaving the rest of your config untouched. A personal preference (user scope) — not shared with the project.`}).regex(km,{message:`Theme id must be lowercase letters, digits, and hyphens, 1–32 characters (e.g. 'dracula', 'custom', or a saved theme id).`}).optional(),colorThemeDark:M().register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`IDE color palette applied in dark mode: 'default' (no palette), 'custom' (your own colors from appearance.customTheme), one of ${Pm()}, or the id of a saved theme. A short id of lowercase letters, digits, and hyphens (max 32 characters); an id no palette matches falls back to 'default' for this mode only, leaving the rest of your config untouched. A personal preference (user scope) — not shared with the project.`}).regex(km,{message:`Theme id must be lowercase letters, digits, and hyphens, 1–32 characters (e.g. 'dracula', 'custom', or a saved theme id).`}).optional(),colorTheme:M().register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Superseded by appearance.colorThemeLight / appearance.colorThemeDark. Read as the palette for both modes while neither of those is set. A short theme id (lowercase letters, digits, and hyphens; max 32 characters); an id no palette matches falls back to 'default'. A personal preference (user scope) — not shared with the project.`}).regex(km,{message:`Theme id must be lowercase letters, digits, and hyphens, 1–32 characters (e.g. 'dracula', 'custom', or a saved theme id).`}).optional(),colorThemeEnabled:P().register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Whether the Themes plugin appears in Settings → Plugins. A personal preference (user scope). Default on.`}).optional(),customTheme:L({name:M().register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Custom theme: the scheme's display name.`}).optional(),author:M().register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Custom theme: the scheme's author credit, carried through from an imported base16 scheme.`}).optional(),variant:R([`dark`,`light`]).register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Custom theme: whether the scheme is 'dark' or 'light'. Auto-detected from the palette when omitted.`}).optional(),...kne()}).optional(),preview:L({autoOpen:P().register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`When on, the agent opens or refreshes the live preview after each edit. Turn off if you manage your own preview window. A personal preference (user scope).`}).default(!0)}).default({autoOpen:!0}),sidebar:L({showHiddenFiles:P().register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Show dot-prefixed entries (e.g. .ok/, .okignore) in the file tree. Per-machine (project-local) — not shared with collaborators.`}).default(!1),showOnlyMarkdownFiles:P().register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Show only markdown documents (.md/.mdx) and folders in the file tree, hiding other file types from view. View-only: hidden files stay on disk and remain reachable via links and search. Per-machine (project-local) — not shared with collaborators.`}).default(!1),showSkillsSection:P().register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Show the Skills section in the sidebar. Skill documents remain reachable via links and search while the section is hidden. Per-machine (project-local) — not shared with collaborators.`}).default(!0),showOkFolders:P().register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Show .ok folders (skills, templates, and other OpenKnowledge-managed state) in the file tree as read-only entries. .ok/worktrees and .ok/local never appear. Per-machine (project-local) — not shared with collaborators.`}).default(!1),showSkillGroups:P().register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Group skills in the sidebar by where they came from — the publisher they were imported from, or the plugin that ships them. Skills you authored stay ungrouped at the top of their scope. Per-machine (project-local) — not shared with collaborators.`}).default(!0),pinnedProjectSkills:F(M()).register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Project-scope skills pinned to the top of the Skills sidebar, by name. A pinned skill also keeps its normal row, so a provenance group still lists everything from its source. Per-machine (project-local) — not shared with collaborators.`}).default([]),pinnedGlobalSkills:F(M()).register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Global-scope skills pinned to the top of the Skills sidebar, by name. Stored per USER rather than per project, so a pinned global skill follows you into every project.`}).default([])}).optional()}).default({preview:{autoOpen:!0}}),editor:L({wordWrap:P().register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Soft-wrap long lines in the source (CodeMirror) editor. A personal preference (user scope).`}).default(!0),previewTabs:P().register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Reuse one tab when clicking through the Files and Skills sidebars, the way an editor preview tab works. Turn off to open every click in its own tab. Pinned tabs keep their own tab either way. A personal preference (user scope).`}).default(!0)}).default({wordWrap:!0,previewTabs:!0}),agents:L({autoApproveOkTools:P().register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:"Auto-approve OpenKnowledge's own tools for agents launched from the built-in terminal (plus `ok open` on Claude) and for in-app Agents-panel chats with any ACP agent. Destructive tools (delete/move/share/install/import) still prompt. Per-machine personal preference (user scope)."}).default(!0)}).default({autoApproveOkTools:!0}),autoSync:L({mode:R(Zf).register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`What this machine syncs on a schedule for this project: 'off' (Manual — nothing scheduled; the manual pull/push actions still work), 'follow' (Auto, pull only — scheduled pulls, never a scheduled push; 'pull' is accepted as a legacy alias), or 'full' (Auto, pull and push — bidirectional). Explicit user-triggered pushes work in every mode. null = not chosen yet (onboarding asks). Per-machine (project-local) — not shared. Supersedes the legacy autoSync.enabled boolean.`}).nullable().default(null),enabled:P().register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Legacy per-machine sync toggle, superseded by autoSync.mode. Read only when mode is absent (true = full, false = off). null = not chosen yet. Per-machine (project-local) — not shared.`}).nullable().default(null),resumeMode:R(Qf).register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`When sync is paused (autoSync.mode 'off') after having been enabled, the active mode to resume into ('follow' | 'full'). Per-machine UI memory; ignored while a mode is active. Not shared.`}).optional(),pullIntervalSeconds:N().int().min(30).max(ip).register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Seconds between scheduled pulls while autoSync.mode is follow or full (default 30). An unauthenticated follower is additionally floored to the anonymous poll minimum, so a lower value there has no effect. Per-machine (project-local) — not shared.`}).optional().catch(void 0),pushIntervalSeconds:N().int().min(30).max(ip).register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Seconds between scheduled pushes while autoSync.mode is full (default 60). Ignored in every other mode, which never pushes on a schedule. Each cycle with pending edits authors a commit, so a shorter interval means more, smaller commits in the repo's shared history. Per-machine (project-local) — not shared.`}).optional().catch(void 0),default:Ka([P(),R(Zf)]).register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Committed project default for a machine's sync mode on first open: 'off' | 'follow' | 'full', or the legacy boolean (true = full, false = off). null = ask (show the onboarding prompt). Shared via git. A per-machine autoSync.mode choice overrides it.`}).nullable().default(null)}).default({mode:null,enabled:null,default:null}),terminal:L({enabled:P().register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Opt-out for the in-app terminal (a real OS shell at full user privilege). The terminal is on by default; set false to disable it for this project on this machine. Per-machine (project-local) — never shared via git, clone, or sync.`}).nullable().default(null),shell:M().register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Absolute Windows shell executable override for the in-app terminal. PowerShell, cmd.exe, and Git Bash support OpenKnowledge-managed launches (agent chat tabs and fixed commands such as Resolve in terminal or Install Slidev) and dropped-file path insertion. A different existing executable remains usable for plain terminal tabs and shows a capability notice; requested agent and command launches open only the plain shell without running the agent or command, and dropped-file paths are refused. Empty values use automatic shell discovery. Per-machine (project-local), human-managed, and never shared via git, clone, or sync.`}).optional()}).default({enabled:null}),slides:L({enabled:P().register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:"Whether the Slides plugin appears in Settings → Plugins. When on, a document whose frontmatter has `slides: true` offers an action that opens the deck in a dedicated window (desktop only, requires a resolvable slidev). A personal preference (user scope). Default off."}).default(!1)}).default({enabled:!1}),telemetry:L({localSink:L({enabled:P().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:"Write local diagnostic spans + logs under .ok/local/ for `ok diagnose bundle`. Local-only — never leaves the machine until you run bundle. Set false for sensitive workspaces. Shared across collaborators."}).default(!0),spans:L({maxBytes:N().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Maximum size, in bytes, of the local diagnostic spans file before it rotates (default ~50 MB).`}).default(Im)}).default({maxBytes:Im}),logs:L({maxBytes:N().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Maximum size, in bytes, of the local diagnostic logs file before it rotates (default ~25 MB).`}).default(Lm)}).default({maxBytes:Lm}),attributeDenylist:F(M()).register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Telemetry attribute keys whose values are redacted before any local span/log is written (credential / secret guard). Extends the built-in denylist.`}).default([...Fm])}).default({enabled:!0,spans:{maxBytes:Im},logs:{maxBytes:Lm},attributeDenylist:[...Fm]}),skillInstallReports:L({enabled:P().register(U,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Report skill installs to skills.sh so a published skill shows an accurate install count. Sends the skill name, its source repo, and which agent tools it was installed for — never file contents, and never for a private or local source. One report per skill per machine. Default on; the DO_NOT_TRACK and DISABLE_TELEMETRY environment variables also turn it off.`}).default(!0)}).default({enabled:!0})}).default({localSink:{enabled:!0,spans:{maxBytes:Im},logs:{maxBytes:Lm},attributeDenylist:[...Fm]},skillInstallReports:{enabled:!0}}),lossCapture:L({enabled:P().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:"Record bridge loss-class events (content-free) under .ok/local/loss-capture/ for `ok diagnose bundle`. Local-only — never leaves the machine until you run bundle. Set false for sensitive workspaces. Shared across collaborators."}).default(!0),maxBytes:N().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Maximum size, in bytes, of the local loss-capture file before it rotates (default ~12 MB).`}).default(Rm)}).default({enabled:!0,maxBytes:Rm}),bridge:L({backgroundThrottle:L({enabled:P().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Keep the desktop window's timers running at full rate while it holds unsynced work, so backgrounding the app never starves sync or recovery; when the window is idle the OS-default background throttling is restored (battery). Honored by the desktop app. Default ON — disable only to isolate a suspected regression.`}).default(!0)}).default({enabled:!0}),deferGuard:L({enabled:P().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Defer a drain-shaped Observer B re-derive when the WYSIWYG fragment holds an un-propagated keystroke Y.Text lacks, so the keystroke survives instead of being stomped. Default ON — disable only to isolate a suspected regression.`}).default(!0)}).default({enabled:!0}),lossDetector:L({enabled:P().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Detect content the bridge silently dropped at its reconciliation boundary (an Observer-A apply arm or a paired agent-undo derive) and write a recovery checkpoint plus a content-free loss event. Detection only — never blocks a write. Default ON — disable only to isolate a suspected regression.`}).default(!0)}).default({enabled:!0}),fixedPoint:L({enabled:P().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Bound the Y.Text→WYSIWYG re-derive loop with a drain-count backstop: a run of re-derive drains that never reaches a raw-byte fixed point freezes the re-derive loop and writes a recovery checkpoint plus a content-free loss event, instead of churning unbounded. Default ON — disable only to isolate a suspected regression.`}).default(!0)}).default({enabled:!0}),preDrain:L({enabled:P().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Before an agent write or undo rebuilds the WYSIWYG fragment, flush an un-propagated keystroke that provably does not overlap the operation into Y.Text so the keystroke survives instead of needing recovery; overlapping or unmodellable cases fall back to the checkpoint floor. Scope: appending writes and single-frame undos — a write that replaces the whole body (replace / edit) overwrites the keystroke either way, so those always take the checkpoint floor. Default ON — disable only to isolate a suspected regression.`}).default(!0)}).default({enabled:!0}),flushOnHide:L({enabled:P().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`On tab hide/unload, force-send each doc's unsynced work to the server and commit its local cache, and re-sync on return to foreground, so a backgrounded tab never strands edits that IndexedDB alone would lose on recycle. Honored client-side. Default ON — disable only to isolate a suspected regression.`}).default(!0)}).default({enabled:!0})}).default({backgroundThrottle:{enabled:!0},deferGuard:{enabled:!0},lossDetector:{enabled:!0},fixedPoint:{enabled:!0},preDrain:{enabled:!0},flushOnHide:{enabled:!0}}),search:L({semantic:L({enabled:P().register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:"Add semantic (embeddings) ranking to the MCP search tool, fused with the lexical engine so conceptually-related pages surface even with no shared keywords. When ON and an API key is set (`ok embeddings set-key`), the search query and matching document content are sent to the configured embeddings provider — content egress. Default OFF. Per-machine (project-local) — not shared with collaborators."}).default(!1),baseUrl:M().register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:"Base URL of the OpenAI-compatible embeddings API (default https://api.openai.com/v1). Override to point at a self-hosted server (Ollama / vLLM / LM Studio) or another provider. The API key is NOT stored here — set it with `ok embeddings set-key` (`~/.ok/secrets.yml`); it is sent to whichever endpoint this names."}).default(zm),model:M().register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Embeddings model id (default text-embedding-3-small). Must be served by the provider at baseUrl. Changing it re-embeds the corpus (the cache is keyed by provider + model + dimensions).`}).default(Bm),dimensions:N().int().positive().register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Optional output vector dimensions. Omit (recommended) to detect the model's native size from its first response — that is what lets a non-OpenAI model work without knowing its size up front. Set a smaller value (text-embedding-3 supports e.g. 512 / 1024) to shrink the on-disk cache, trading a little retrieval quality; a server that ignores the request param then fails loudly instead of silently. Changing it re-embeds the corpus.`}).optional(),similarityFloor:N().min(0).max(1).register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Optional hard cutoff: drop any "by meaning" match whose cosine similarity is below this value. Off by default (0) because retrieval is rank-based (the closest pages are returned regardless of absolute score) and the right cutoff is model-specific. Set it only to suppress weak matches for a specific provider/model whose cosine scale you know. Most setups should leave it unset and rely on the result-count cap.`}).optional(),maxBatchSize:N().int().min(1).max(Um).register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Maximum number of text chunks sent in one indexing request (1–2048, default 96). The ceiling follows OpenAI's input-array limit; other providers may impose different limits. Larger requests may still be split by the character budget. Changing it preserves cached vectors and document chunking; it applies to the next indexing pass. Invalid values use the default and are reported by ok config validate and server logs.`}).default(96).catch(96),maxBatchChars:N().int().min(1).max(Wm).register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Approximate cumulative character budget per indexing request (1–16384000, default 96000). A single chunk can exceed this budget. OpenAI separately caps total input at 300000 tokens per request; this character budget does not enforce that limit, and high values can produce rejected requests. Other providers have their own limits. Changing it preserves cached vectors and document chunking; it applies to the next indexing pass. Invalid values use the default and are reported by ok config validate and server logs.`}).default(Vm).catch(Vm),docTimeoutMs:N().int().min(1).max(Gm).register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Timeout in milliseconds for each indexing request attempt (1–600000, default 30000). A request can retry four times, and a failed grouped request can trigger individual-document requests. There is no total indexing-pass deadline: large timeouts can delay newly queued work for hours. The query timeout remains 8 seconds per attempt. Changing it preserves cached vectors and applies to the next indexing pass; an in-progress pass keeps its current timeout. Invalid values use the default and are reported by ok config validate and server logs.`}).default(Hm).catch(Hm)}).default({enabled:!1,baseUrl:zm,model:Bm,maxBatchSize:96,maxBatchChars:Vm,docTimeoutMs:Hm})}).default({semantic:{enabled:!1,baseUrl:zm,model:Bm,maxBatchSize:96,maxBatchChars:Vm,docTimeoutMs:Hm}}),contentRules:L({markdownlint:I({enabled:P().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Whether the markdownlint plugin (body rules) contributes diagnostics.`}).default(!1)}).default({enabled:!1}),frontmatter:I({enabled:P().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Whether the frontmatter plugin (JSON-Schema validation of document frontmatter) contributes diagnostics.`}).default(!1),schemas:F(I({appliesTo:Ka([M(),F(M())]).optional(),file:M(),enabled:P().optional()})).register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Frontmatter schema mappings: which docs (appliesTo globs) validate against which JSON Schema file (project-root-relative path).`}).default([])}).default({enabled:!1,schemas:[]}),okf:I({enabled:P().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Whether the OKF plugin (Open Knowledge Format portability + conformance rules) contributes diagnostics. Advisory warnings; never blocks a write.`}).default(!1),rules:Qa(M(),P()).register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Per-rule opt-outs for the OKF plugin, keyed by rule id (e.g. no-wiki-links). Omit a rule to leave it enabled; set false to silence it while keeping the plugin on.`}).optional(),generate:I({index:P().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Whether OK generates and maintains a navigation index.md in every folder that contains Markdown, each listing the documents in that folder grouped by frontmatter type and linking to its subfolders. OK owns these files: edits to them are replaced on the next rebuild.`}).default(!1)}).default({index:!1})}).default({enabled:!1,generate:{index:!1}})}).default({markdownlint:{enabled:!1},frontmatter:{enabled:!1,schemas:[]},okf:{enabled:!1,generate:{index:!1}}}),validation:L({links:R(em).register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`How broken internal links are reported on the validation plane: 'off' hides them, 'warning' (default) or 'error' sets their severity.`}).default(tm),fileTreeIndicators:P().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Whether the file tree tints and badges files that have validation problems.`}).default(!0),suppressLogLinkAdvisories:P().register(U,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Whether unresolved links in the reserved change-history documents (lowercase-stemmed log.md / log.mdx at any depth, where the extension's case does not matter and the stem's does) are omitted from broken-link advisories: the Problems panel, file-tree indicators, source diagnostics, audits, and agent write/edit results. Default true. Raw link views still show them, and LOG.md, Log.md, and every other stem spelling are ordinary documents.`}).default(!0)}).default({links:tm,fileTreeIndicators:!0,suppressLogLinkAdvisories:!0}),linkPreviews:L({enabled:P().register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Show a rich preview card (site name, page title, description, favicon) when you hover an external link in the editor. When ON, hovering an external link sends that link's URL to the destination site to fetch its preview metadata — outbound egress, one request per previewed link. Default ON; set to false to turn external previews off. Per-machine (project-local) — not shared with collaborators. Previews of links to other documents in this project are read from the local index with no network request and are always on.`}).default(!0)}).default({enabled:!0}),server:L({port:N().int().min(1).max(65535).register(U,{scope:`project`,agentSettable:!1,reload:`boot`,defaultScope:`project`,description:`TCP port the server listens on. Unset by default: a local start picks a free port dynamically, and deployment platforms inject the PORT environment variable instead. Read at server start; changing it requires a restart.`}).optional(),bind:F(M().min(1)).min(1).register(U,{scope:`project-local`,agentSettable:!1,reload:`boot`,defaultScope:`project-local`,description:`Addresses the server binds, e.g. [127.0.0.1] or [0.0.0.0]. Default loopback-only ([127.0.0.1]): nothing off this machine can connect. A non-loopback bind additionally requires the server.allowExternal consent interlock. Per-machine (project-local): a value committed to .ok/config.yml is ignored, so one machine exposing the server can never break local clones for the rest of the team — the exposing host sets it via OK_BIND, --bind, or .ok/local/config.yml. Lists replace, never merge. Read at server start; changing it requires a restart.`}).default([...Km]),externalUrl:ga({protocol:/^https?$/}).regex(jne).register(U,{scope:`project`,agentSettable:!1,reload:`boot`,defaultScope:`project`,description:`Canonical external origin the server is reached at, e.g. https://kb.example.com — its host joins the Host/Origin allowlists (external-Host + CORS admission). Unset by default: the server admits only loopback Hosts. Setting it declares external exposure, which additionally requires the server.allowExternal consent interlock. Read at server start; changing it requires a restart.`}).optional(),allowExternal:P().register(U,{scope:`project-local`,agentSettable:!1,reload:`boot`,defaultScope:`project-local`,description:`Exposure consent interlock. A non-loopback server.bind without allowExternal: true is refused at boot with a one-line fix; a server.externalUrl without it boots (a committed externalUrl never arms exposure on clones — but it is project-scoped, so its host still joins the Host/Origin allowlists there), but requests carrying forwarding headers (X-Forwarded-For etc.) are refused until consent is given — proxy tolerance requires both keys. Default off. The server has no authentication of its own, so only consent behind an authenticating edge. Per-machine (project-local) — consent never travels via git, clone, or share; containers consent via the environment instead.`}).default(!1),openBrowser:P().register(U,{scope:`project-local`,agentSettable:!1,reload:`boot`,defaultScope:`project-local`,description:`Open the UI in a browser when the server starts. Default derived: true when every bind address is loopback (a laptop start pops the UI), false otherwise (a container or exposed bind is headless and must never try). Acts once at start. Per-machine (project-local) — not shared.`}).optional(),idleShutdown:Ka([z(`off`),M().regex(Ane)]).register(U,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Shut the server down after this long with no activity: a duration like '30m' (positive integer with unit s, m, or h), or 'off'. Default derived: '30m' for a loopback-only, unexposed server; 'off' otherwise — a non-loopback bind, or a loopback bind declared externally reachable (server.allowExternal + server.externalUrl), stays up, because a remote agent keeps it busy over /mcp, which the idle timer does not count. Residual case the derivation cannot see: a loopback server reached by remote agents with no server.externalUrl (e.g. behind a same-box reverse proxy) still idles at 30m — set 'off' by hand. Reloadable — a valid change applies without a restart. Per-machine (project-local) — not shared.`}).optional()}).default({bind:[...Km],allowExternal:!1})}),Ine=`open-knowledge-config`;function Ym(e,t,n){let r=c.getTracer(Ine),i=t?{attributes:t}:{};return r.startActiveSpan(e,i,e=>{try{return n(e)}catch(t){throw e.recordException(t),e.setStatus({code:s.ERROR,message:t instanceof Error?t.message:String(t)}),t}finally{e.end()}})}function Xm(e,t){let n=c.getActiveSpan();n&&n.addEvent(e,t)}function Lne(e){let t=e;for(let e=0;e<16;e++){if(t==null||t?._zod?.def?.shape!==void 0)return t;let e=t?._zod?.def?.innerType;if(e===void 0)return t;t=e}return t}function Zm(e,t){let n=e;for(let e of t){n=Lne(n);let t=n?._zod?.def?.shape;if(!t||(n=t[String(e)],n===void 0))return}return n}function Qm(e,t){let n=Zm(e,t);if(n!==void 0)return Nm(n)}function Rne(e,t){return e===`either`?!0:e===t}function zne(e,t){let n=null;function r(e,i){if(n!==null||e===void 0)return;if(typeof e==`object`&&e&&!Array.isArray(e)){for(let[t,a]of Object.entries(e))if(r(a,[...i,t]),n!==null)return;return}let a=Qm(Jm,i);a?.scope!==void 0&&(Rne(a.scope,t)||(n={code:`SCOPE_VIOLATION`,path:i,expectedScope:a.scope,actualScope:t}))}for(let[t,i]of Object.entries(e))if(r(i,[t]),n!==null)break;return n}function $m(e,t){for(let n=1;n<t.length;n++){let r=t.slice(0,n);e.hasIn(r)&&(Ws(e.getIn(r,!0))||e.deleteIn(r))}}function Bne(e,t){let n=[];function r(t,i){if(t!==void 0){if(t===null){e.deleteIn(i),n.push(i.join(`.`));return}if(Array.isArray(t)){$m(e,i),e.setIn(i,t),n.push(i.join(`.`));return}if(typeof t==`object`){for(let[e,n]of Object.entries(t))r(n,[...i,e]);return}$m(e,i),e.setIn(i,t),n.push(i.join(`.`))}}for(let[e,n]of Object.entries(t))r(n,[e]);return n}function Vne(e){return{path:e.path.map(e=>typeof e==`symbol`?String(e):e),message:e.message,issueCode:e.code}}var eh=I({file:M(),line:N().int().min(1),column:N().int().min(1),snippet:M().optional()}),Hne=I({path:F(Ka([M(),N()])),message:M(),issueCode:M(),params:Qa(M(),za()).optional(),source:eh.optional()}),Une=R([`user`,`project`,`project-local`,`either`]),th=R([`user`,`project`,`project-local`]),nh=I({code:z(`YAML_PARSE`),detail:M()}),rh=I({code:z(`UNREADABLE`),detail:M()}),ih=I({code:z(`SCHEMA_INVALID`),issues:F(Hne)}),ah=I({code:z(`REMOVED_KEY`),path:F(M()),redirect:M(),source:eh.optional()}),oh=I({path:F(M()),message:M(),source:eh.omit({snippet:!0}).optional()}),sh=I({code:z(`VALUE_FALLBACK`),issues:F(oh)}),ch=Ja(`code`,[nh,ih,rh,I({code:z(`SCOPE_VIOLATION`),path:F(M()),expectedScope:Une,actualScope:th}),I({code:z(`NOT_AGENT_SETTABLE`),path:F(M())}),I({code:z(`MIXED_SCOPE`),paths:F(I({path:F(M()),scope:th}))}),ah,I({code:z(`NOT_SYNCED`),detail:M()}),I({code:z(`WRITE_ERROR`),detail:M()}),I({code:z(`OKIGNORE_INVALID`),detail:M(),lineNumber:N().int().min(1).optional()}),I({code:z(`UNKNOWN`),message:M().optional()})]);Ja(`code`,[ah,sh,nh,ih,rh]),I({diagnostics:F(Ja(`code`,[I({code:z(`VALUE_FALLBACK`),scope:th,file:M(),issues:F(oh.omit({source:!0}).extend({line:eh.shape.line.optional(),column:eh.shape.column.optional()}))}),I({code:z(`REMOVED_KEY`),scope:th,file:M(),path:F(M()),redirect:M()}),I({code:z(`YAML_PARSE`),scope:th,file:M()}),I({code:z(`SCHEMA_INVALID`),scope:th,file:M()}),I({code:z(`UNREADABLE`),scope:th,file:M()})]))});var Wne=new Set(ch.options.map(e=>e.shape.code.value)),Gne=Ka([ch,L({code:M(),message:M().optional()})]);function lh(e){return Wne.has(e.code)}function uh(e){switch(e){case`user`:return`~/.ok/global.yml`;case`project`:return`.ok/config.yml`;case`project-local`:return`.ok/local/config.yml`;case`either`:return`.ok/config.yml or ~/.ok/global.yml`}}function Kne(e){switch(e){case`user`:return`personal to you, across all projects`;case`project`:return`shared with your team via git`;case`project-local`:return`this machine only, not shared`;case`either`:return`user or project`}}function qne(e){if(e.code===`VALUE_FALLBACK`){let t=sh.safeParse(e);if(t.success){if(t.data.issues.length===0)return`Configuration loaded with defaults for invalid settings.`;let e=[`Configuration loaded with defaults for invalid settings:`];for(let n of t.data.issues)n.source&&e.push(` ${n.source.file}:${n.source.line}:${n.source.column}`),e.push(` ${n.path.join(`.`)}: ${n.message}`);return e.join(`
178
178
  `)}}if(!lh(e))return e.message??`Unknown error (${e.code}).`;switch(e.code){case`YAML_PARSE`:return`Failed to parse YAML: ${e.detail}`;case`UNREADABLE`:return`Could not read the file: ${e.detail}`;case`SCHEMA_INVALID`:{if(e.issues.length===0)return`Invalid configuration.`;let t=new Map;for(let n of e.issues){let e=n.source?.file??`<no source>`,r=t.get(e)??[];r.push(n),t.set(e,r)}let n=[];for(let[e,r]of t){e===`<no source>`?n.push(`Invalid configuration:`):n.push(`Invalid configuration at ${e}:`);for(let t of r){let r=t.path.length===0?`<root>`:t.path.join(`.`);if(t.source){if(n.push(` ${e}:${t.source.line}:${t.source.column}`),n.push(` ${r}: ${t.message}`),t.source.snippet&&t.source.snippet.length>0)for(let e of t.source.snippet.split(`
179
179
  `))n.push(` ${e}`)}else n.push(` ${r}: ${t.message}`)}}return n.join(`
180
180
  `)}case`SCOPE_VIOLATION`:return[`Setting ${e.path.join(`.`)} belongs in your ${e.expectedScope} config`,`(${uh(e.expectedScope)} — ${Kne(e.expectedScope)}),`,`but it was set in the ${e.actualScope} config (${uh(e.actualScope)}).`,`Move it to ${uh(e.expectedScope)}.`].join(` `);case`NOT_AGENT_SETTABLE`:return[`Setting ${e.path.join(`.`)} is human-only and can't be changed by an agent.`,`Change it in the Settings pane, or edit the config.yml by hand.`].join(` `);case`MIXED_SCOPE`:return[`This change touches settings that live in different config files. Apply them one file at a time:`,e.paths.map(({path:e,scope:t})=>` ${e.join(`.`)} → ${uh(t)} (${t})`).join(`
@@ -397,7 +397,7 @@ Read more at https://docs.orama.com/docs/orama-js/plugins/plugin-secure-proxy#pl
397
397
  `,PLUGIN_SECURE_PROXY_MISSING_CHAT_MODEL:`Could not find a chat model defined in the secure proxy plugin configuration.
398
398
  Please provide a chat model before proceeding with creating an answer session.
399
399
  Read more at https://docs.orama.com/docs/orama-js/plugins/plugin-secure-proxy#plugin-secure-proxy
400
- `,ANSWER_SESSION_LAST_MESSAGE_IS_NOT_ASSISTANT:`The last message in the session is not an assistant message. Cannot regenerate non-assistant messages.`,PLUGIN_COMPONENT_CONFLICT:`The component "%s" is already defined. The plugin "%s" is trying to redefine it.`};function rK(e,...t){let n=Error(PG(nK[e]??`Unsupported Orama Error code: ${e}`,...t));return n.code=e,`captureStackTrace`in Error.prototype&&Error.captureStackTrace(n),n}function iK(e){return{raw:Number(e),formatted:RG(e)}}function aK(e){if(e.id){if(typeof e.id!=`string`)throw rK(`DOCUMENT_ID_MUST_BE_STRING`,typeof e.id);return e.id}return BG()}function oK(e,t){for(let[n,r]of Object.entries(t)){let t=e[n];if(t!==void 0&&!(r===`geopoint`&&typeof t==`object`&&typeof t.lon==`number`&&typeof t.lat==`number`)&&!(r===`enum`&&(typeof t==`string`||typeof t==`number`))){if(r===`enum[]`&&Array.isArray(t)){let e=t.length;for(let r=0;r<e;r++)if(typeof t[r]!=`string`&&typeof t[r]!=`number`)return n+`.`+r;continue}if(uK(r)){let e=pK(r);if(!Array.isArray(t)||t.length!==e)throw rK(`INVALID_INPUT_VECTOR`,n,e,t.length);continue}if(dK(r)){if(!Array.isArray(t))return n;let e=fK(r),i=t.length;for(let r=0;r<i;r++)if(typeof t[r]!==e)return n+`.`+r;continue}if(typeof r==`object`){if(!t||typeof t!=`object`)return n;let e=oK(t,r);if(e)return n+`.`+e;continue}if(typeof t!==r)return n}}}var sK={string:!1,number:!1,boolean:!1,enum:!1,geopoint:!1,"string[]":!0,"number[]":!0,"boolean[]":!0,"enum[]":!0},cK={"string[]":`string`,"number[]":`number`,"boolean[]":`boolean`,"enum[]":`enum`};function lK(e){return e===`geopoint`}function uK(e){return typeof e==`string`&&/^vector\[\d+\]$/.test(e)}function dK(e){return typeof e==`string`&&sK[e]}function fK(e){return cK[e]}function pK(e){let t=Number(e.slice(7,-1));switch(!0){case isNaN(t):throw rK(`INVALID_VECTOR_VALUE`,e);case t<=0:throw rK(`INVALID_VECTOR_SIZE`,e);default:return t}}function mK(){return{idToInternalId:new Map,internalIdToId:[],save:hK,load:gK}}function hK(e){return{internalIdToId:e.internalIdToId}}function gK(e,t){let{internalIdToId:n}=t;e.internalDocumentIDStore.idToInternalId.clear(),e.internalDocumentIDStore.internalIdToId=[];let r=n.length;for(let t=0;t<r;t++){let r=n[t];e.internalDocumentIDStore.idToInternalId.set(r,t+1),e.internalDocumentIDStore.internalIdToId.push(r)}}function _K(e,t){if(typeof t==`string`){let n=e.idToInternalId.get(t);if(n)return n;let r=e.idToInternalId.size+1;return e.idToInternalId.set(t,r),e.internalIdToId.push(t),r}return t>e.internalIdToId.length?_K(e,t.toString()):t}function vK(e,t){if(e.internalIdToId.length<t)throw Error(`Invalid internalId ${t}`);return e.internalIdToId[t-1]}function yK(e,t){return{sharedInternalDocumentStore:t,docs:{},count:0}}function bK(e,t){let n=_K(e.sharedInternalDocumentStore,t);return e.docs[n]}function xK(e,t){let n=t.length,r=Array.from({length:n});for(let i=0;i<n;i++){let n=_K(e.sharedInternalDocumentStore,t[i]);r[i]=e.docs[n]}return r}function SK(e){return e.docs}function CK(e,t,n,r){return e.docs[n]===void 0?(e.docs[n]=r,e.count++,!0):!1}function wK(e,t){let n=_K(e.sharedInternalDocumentStore,t);return e.docs[n]===void 0?!1:(delete e.docs[n],e.count--,!0)}function TK(e){return e.count}function EK(e,t){let n=t;return{docs:n.docs,count:n.count,sharedInternalDocumentStore:e}}function DK(e){return{docs:e.docs,count:e.count}}function OK(){return{create:yK,get:bK,getMultiple:xK,getAll:SK,store:CK,remove:wK,count:TK,load:EK,save:DK}}var kK=[`beforeInsert`,`afterInsert`,`beforeRemove`,`afterRemove`,`beforeUpdate`,`afterUpdate`,`beforeUpsert`,`afterUpsert`,`beforeSearch`,`afterSearch`,`beforeInsertMultiple`,`afterInsertMultiple`,`beforeRemoveMultiple`,`afterRemoveMultiple`,`beforeUpdateMultiple`,`afterUpdateMultiple`,`beforeUpsertMultiple`,`afterUpsertMultiple`,`beforeLoad`,`afterLoad`,`afterCreate`];function AK(e,t){let n=[],r=e.plugins?.length;if(!r)return n;for(let i=0;i<r;i++)try{let r=e.plugins[i];typeof r[t]==`function`&&n.push(r[t])}catch(e){throw console.error(`Caught error in getAllPluginsByHook:`,e),rK(`PLUGIN_CRASHED`)}return n}var jK=[`tokenizer`,`index`,`documentsStore`,`sorter`,`pinning`],MK=[`validateSchema`,`getDocumentIndexId`,`getDocumentProperties`,`formatElapsedTime`];function NK(e,t,n,r){if(e.some(YG))return(async()=>{for(let i of e)await i(t,n,r)})();for(let i of e)i(t,n,r)}function PK(e,t,n){if(e.some(YG))return(async()=>{for(let r of e)await r(t,n)})();for(let r of e)r(t,n)}function FK(e,t,n,r,i){if(e.some(YG))return(async()=>{for(let a of e)await a(t,n,r,i)})();for(let a of e)a(t,n,r,i)}function IK(e,t,n,r){if(e.some(YG))return(async()=>{for(let i of e)await i(t,n,r)})();for(let i of e)i(t,n,r)}function LK(e,t){if(e.some(YG))return(async()=>{for(let n of e)await n(t)})();for(let n of e)n(t)}var RK=class e{k;v;l=null;r=null;h=1;constructor(e,t){this.k=e,this.v=new Set(t)}updateHeight(){this.h=Math.max(e.getHeight(this.l),e.getHeight(this.r))+1}static getHeight(e){return e?e.h:0}getBalanceFactor(){return e.getHeight(this.l)-e.getHeight(this.r)}rotateLeft(){let e=this.r;return this.r=e.l,e.l=this,this.updateHeight(),e.updateHeight(),e}rotateRight(){let e=this.l;return this.l=e.r,e.r=this,this.updateHeight(),e.updateHeight(),e}toJSON(){return{k:this.k,v:Array.from(this.v),l:this.l?this.l.toJSON():null,r:this.r?this.r.toJSON():null,h:this.h}}static fromJSON(t){let n=new e(t.k,t.v);return n.l=t.l?e.fromJSON(t.l):null,n.r=t.r?e.fromJSON(t.r):null,n.h=t.h,n}},zK=class e{root=null;insertCount=0;constructor(e,t){e!==void 0&&t!==void 0&&(this.root=new RK(e,t))}insert(e,t,n=1e3){this.root=this.insertNode(this.root,e,t,n)}insertMultiple(e,t,n=1e3){for(let r of t)this.insert(e,r,n)}rebalance(){this.root&&=this.rebalanceNode(this.root)}toJSON(){return{root:this.root?this.root.toJSON():null,insertCount:this.insertCount}}static fromJSON(t){let n=new e;return n.root=t.root?RK.fromJSON(t.root):null,n.insertCount=t.insertCount||0,n}insertNode(e,t,n,r){if(e===null)return new RK(t,[n]);let i=[],a=e,o=null;for(;a!==null;)if(i.push({parent:o,node:a}),t<a.k)if(a.l===null){a.l=new RK(t,[n]),i.push({parent:a,node:a.l});break}else o=a,a=a.l;else if(t>a.k)if(a.r===null){a.r=new RK(t,[n]),i.push({parent:a,node:a.r});break}else o=a,a=a.r;else return a.v.add(n),e;let s=!1;this.insertCount++%r===0&&(s=!0);for(let t=i.length-1;t>=0;t--){let{parent:n,node:r}=i[t];if(r.updateHeight(),s){let t=this.rebalanceNode(r);n?n.l===r?n.l=t:n.r===r&&(n.r=t):e=t}}return e}rebalanceNode(e){let t=e.getBalanceFactor();if(t>1){if(e.l&&e.l.getBalanceFactor()>=0)return e.rotateRight();if(e.l)return e.l=e.l.rotateLeft(),e.rotateRight()}if(t<-1){if(e.r&&e.r.getBalanceFactor()<=0)return e.rotateLeft();if(e.r)return e.r=e.r.rotateRight(),e.rotateLeft()}return e}find(e){let t=this.findNodeByKey(e);return t?t.v:null}contains(e){return this.find(e)!==null}getSize(){let e=0,t=[],n=this.root;for(;n||t.length>0;){for(;n;)t.push(n),n=n.l;n=t.pop(),e++,n=n.r}return e}isBalanced(){if(!this.root)return!0;let e=[this.root];for(;e.length>0;){let t=e.pop(),n=t.getBalanceFactor();if(Math.abs(n)>1)return!1;t.l&&e.push(t.l),t.r&&e.push(t.r)}return!0}remove(e){this.root=this.removeNode(this.root,e)}removeDocument(e,t){let n=this.findNodeByKey(e);n&&(n.v.size===1?this.root=this.removeNode(this.root,e):n.v=new Set([...n.v.values()].filter(e=>e!==t)))}findNodeByKey(e){let t=this.root;for(;t;)if(e<t.k)t=t.l;else if(e>t.k)t=t.r;else return t;return null}removeNode(e,t){if(e===null)return null;let n=[],r=e;for(;r!==null&&r.k!==t;)n.push(r),r=t<r.k?r.l:r.r;if(r===null)return e;if(r.l===null||r.r===null){let t=r.l?r.l:r.r;if(n.length===0)e=t;else{let e=n[n.length-1];e.l===r?e.l=t:e.r=t}}else{let e=r,t=r.r;for(;t.l!==null;)e=t,t=t.l;r.k=t.k,r.v=t.v,e.l===t?e.l=t.r:e.r=t.r,r=e}n.push(r);for(let t=n.length-1;t>=0;t--){let r=n[t];r.updateHeight();let i=this.rebalanceNode(r);if(t>0){let e=n[t-1];e.l===r?e.l=i:e.r===r&&(e.r=i)}else e=i}return e}rangeSearch(e,t){let n=new Set,r=[],i=this.root;for(;i||r.length>0;){for(;i;)r.push(i),i=i.l;if(i=r.pop(),i.k>=e&&i.k<=t)for(let e of i.v)n.add(e);if(i.k>t)break;i=i.r}return n}greaterThan(e,t=!1){let n=new Set,r=[],i=this.root;for(;i||r.length>0;){for(;i;)r.push(i),i=i.r;if(i=r.pop(),t&&i.k>=e||!t&&i.k>e)for(let e of i.v)n.add(e);else if(i.k<=e)break;i=i.l}return n}lessThan(e,t=!1){let n=new Set,r=[],i=this.root;for(;i||r.length>0;){for(;i;)r.push(i),i=i.l;if(i=r.pop(),t&&i.k<=e||!t&&i.k<e)for(let e of i.v)n.add(e);else if(i.k>e)break;i=i.r}return n}},BK=class e{numberToDocumentId;constructor(){this.numberToDocumentId=new Map}insert(e,t){this.numberToDocumentId.has(e)?this.numberToDocumentId.get(e).add(t):this.numberToDocumentId.set(e,new Set([t]))}find(e){let t=this.numberToDocumentId.get(e);return t?Array.from(t):null}remove(e){this.numberToDocumentId.delete(e)}removeDocument(e,t){let n=this.numberToDocumentId.get(t);n&&(n.delete(e),n.size===0&&this.numberToDocumentId.delete(t))}contains(e){return this.numberToDocumentId.has(e)}getSize(){let e=0;for(let t of this.numberToDocumentId.values())e+=t.size;return e}filter(e){let t=Object.keys(e);if(t.length!==1)throw Error(`Invalid operation`);let n=t[0];switch(n){case`eq`:{let t=e[n],r=this.numberToDocumentId.get(t);return r?Array.from(r):[]}case`in`:{let t=e[n],r=new Set;for(let e of t){let t=this.numberToDocumentId.get(e);if(t)for(let e of t)r.add(e)}return Array.from(r)}case`nin`:{let t=new Set(e[n]),r=new Set;for(let[e,n]of this.numberToDocumentId.entries())if(!t.has(e))for(let e of n)r.add(e);return Array.from(r)}default:throw Error(`Invalid operation`)}}filterArr(e){let t=Object.keys(e);if(t.length!==1)throw Error(`Invalid operation`);let n=t[0];switch(n){case`containsAll`:{let t=e[n].map(e=>this.numberToDocumentId.get(e)??new Set);if(t.length===0)return[];let r=t.reduce((e,t)=>new Set([...e].filter(e=>t.has(e))));return Array.from(r)}case`containsAny`:{let t=e[n].map(e=>this.numberToDocumentId.get(e)??new Set);if(t.length===0)return[];let r=t.reduce((e,t)=>new Set([...e,...t]));return Array.from(r)}default:throw Error(`Invalid operation`)}}static fromJSON(t){if(!t.numberToDocumentId)throw Error(`Invalid Flat Tree JSON`);let n=new e;for(let[e,r]of t.numberToDocumentId)n.numberToDocumentId.set(e,new Set(r));return n}toJSON(){return{numberToDocumentId:Array.from(this.numberToDocumentId.entries()).map(([e,t])=>[e,Array.from(t)])}}};function VK(e,t,n){if(n<0)return-1;if(e===t)return 0;let r=e.length,i=t.length;if(r===0)return i<=n?i:-1;if(i===0)return r<=n?r:-1;let a=Math.abs(r-i);if(e.startsWith(t))return a<=n?a:-1;if(t.startsWith(e))return 0;if(a>n)return-1;let o=[];for(let e=0;e<=r;e++){o[e]=[e];for(let t=1;t<=i;t++)o[e][t]=e===0?t:0}for(let a=1;a<=r;a++){let r=1/0;for(let n=1;n<=i;n++)e[a-1]===t[n-1]?o[a][n]=o[a-1][n-1]:o[a][n]=Math.min(o[a-1][n]+1,o[a][n-1]+1,o[a-1][n-1]+1),r=Math.min(r,o[a][n]);if(r>n)return-1}return o[r][i]<=n?o[r][i]:-1}function HK(e,t,n){let r=VK(e,t,n);return{distance:r,isBounded:r>=0}}var UK=class e{k;s;c=new Map;d=new Set;e;w=``;constructor(e,t,n){this.k=e,this.s=t,this.e=n}updateParent(e){this.w=e.w+this.s}addDocument(e){this.d.add(e)}removeDocument(e){return this.d.delete(e)}findAllWords(e,t,n,r){let i=[this];for(;i.length>0;){let a=i.pop();if(a.e){let{w:i,d:o}=a;if(n&&i!==t)continue;if(VG(e,i)!==null)if(r)if(Math.abs(t.length-i.length)<=r&&HK(t,i,r).isBounded)e[i]=[];else continue;else e[i]=[];if(VG(e,i)!=null&&o.size>0){let t=e[i];for(let e of o)t.includes(e)||t.push(e)}}a.c.size>0&&i.push(...a.c.values())}return e}insert(t,n){let r=this,i=0,a=t.length;for(;i<a;){let o=t[i],s=r.c.get(o);if(s){let o=s.s,c=o.length,l=0;for(;l<c&&i+l<a&&o[l]===t[i+l];)l++;if(l===c){if(r=s,i+=l,i===a){s.e||=!0,s.addDocument(n);return}continue}let u=o.slice(0,l),d=o.slice(l),f=t.slice(i+l),p=new e(u[0],u,!1);if(r.c.set(u[0],p),p.updateParent(r),s.s=d,s.k=d[0],p.c.set(d[0],s),s.updateParent(p),f){let t=new e(f[0],f,!0);t.addDocument(n),p.c.set(f[0],t),t.updateParent(p)}else p.e=!0,p.addDocument(n);return}else{let a=new e(o,t.slice(i),!0);a.addDocument(n),r.c.set(o,a),a.updateParent(r);return}}r.e||=!0,r.addDocument(n)}_findLevenshtein(e,t,n,r,i){let a=[{node:this,index:t,tolerance:n}];for(;a.length>0;){let{node:t,index:n,tolerance:o}=a.pop();if(t.w.startsWith(e)){t.findAllWords(i,e,!1,0);continue}if(o<0)continue;if(t.e){let{w:n,d:a}=t;if(n&&(HK(e,n,r).isBounded&&(i[n]=[]),VG(i,n)!==void 0&&a.size>0)){let e=new Set(i[n]);for(let t of a)e.add(t);i[n]=Array.from(e)}}if(n>=e.length)continue;let s=e[n];if(t.c.has(s)){let e=t.c.get(s);a.push({node:e,index:n+1,tolerance:o})}a.push({node:t,index:n+1,tolerance:o-1});for(let[e,r]of t.c)a.push({node:r,index:n,tolerance:o-1}),e!==s&&a.push({node:r,index:n+1,tolerance:o-1})}}find(e){let{term:t,exact:n,tolerance:r}=e;if(r&&!n){let e={};return this._findLevenshtein(t,0,r,r,e),e}else{let e=this,i=0,a=t.length;for(;i<a;){let o=t[i],s=e.c.get(o);if(s){let o=s.s,c=o.length,l=0;for(;l<c&&i+l<a&&o[l]===t[i+l];)l++;if(l===c)e=s,i+=l;else if(i+l===a)if(l===a-i){if(n)return{};{let e={};return s.findAllWords(e,t,n,r),e}}else return{};else return{}}else return{}}let o={};return e.findAllWords(o,t,n,r),o}}contains(e){let t=this,n=0,r=e.length;for(;n<r;){let i=e[n],a=t.c.get(i);if(a){let i=a.s,o=i.length,s=0;for(;s<o&&n+s<r&&i[s]===e[n+s];)s++;if(s<o)return!1;n+=o,t=a}else return!1}return!0}removeWord(e){if(!e)return!1;let t=this,n=e.length,r=[];for(let i=0;i<n;i++){let n=e[i];if(t.c.has(n)){let e=t.c.get(n);r.push({parent:t,character:n}),i+=e.s.length-1,t=e}else return!1}for(t.d.clear(),t.e=!1;r.length>0&&t.c.size===0&&!t.e&&t.d.size===0;){let{parent:e,character:n}=r.pop();e.c.delete(n),t=e}return!0}removeDocumentByWord(e,t,n=!0){if(!e)return!0;let r=this,i=e.length;for(let a=0;a<i;a++){let i=e[a];if(r.c.has(i)){let o=r.c.get(i);a+=o.s.length-1,r=o,n&&r.w!==e||r.removeDocument(t)}else return!1}return!0}static getCommonPrefix(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e.charCodeAt(r)===t.charCodeAt(r);)r++;return e.slice(0,r)}toJSON(){return{w:this.w,s:this.s,e:this.e,k:this.k,d:Array.from(this.d),c:Array.from(this.c?.entries())?.map(([e,t])=>[e,t.toJSON()])}}static fromJSON(t){let n=new e(t.k,t.s,t.e);return n.w=t.w,n.d=new Set(t.d),n.c=new Map(t?.c?.map(([t,n])=>[t,e.fromJSON(n)])||[]),n}},WK=class e extends UK{constructor(){super(``,``,!1)}static fromJSON(t){let n=new e;return n.w=t.w,n.s=t.s,n.e=t.e,n.k=t.k,n.d=new Set(t.d),n.c=new Map(t?.c?.map(([e,t])=>[e,UK.fromJSON(t)])||[]),n}toJSON(){return super.toJSON()}},GK=2,KK=6371e3,qK=class e{point;docIDs;left;right;parent;constructor(e,t){this.point=e,this.docIDs=new Set(t),this.left=null,this.right=null,this.parent=null}toJSON(){return{point:this.point,docIDs:Array.from(this.docIDs),left:this.left?this.left.toJSON():null,right:this.right?this.right.toJSON():null}}static fromJSON(t,n=null){let r=new e(t.point,t.docIDs);return r.parent=n,t.left&&(r.left=e.fromJSON(t.left,r)),t.right&&(r.right=e.fromJSON(t.right,r)),r}},JK=class e{root;nodeMap;constructor(){this.root=null,this.nodeMap=new Map}getPointKey(e){return`${e.lon},${e.lat}`}insert(e,t){let n=this.getPointKey(e),r=this.nodeMap.get(n);if(r){t.forEach(e=>r.docIDs.add(e));return}let i=new qK(e,t);if(this.nodeMap.set(n,i),this.root==null){this.root=i;return}let a=this.root,o=0;for(;;){if(o%GK===0)if(e.lon<a.point.lon){if(a.left==null){a.left=i,i.parent=a;return}a=a.left}else{if(a.right==null){a.right=i,i.parent=a;return}a=a.right}else if(e.lat<a.point.lat){if(a.left==null){a.left=i,i.parent=a;return}a=a.left}else{if(a.right==null){a.right=i,i.parent=a;return}a=a.right}o++}}contains(e){let t=this.getPointKey(e);return this.nodeMap.has(t)}getDocIDsByCoordinates(e){let t=this.getPointKey(e),n=this.nodeMap.get(t);return n?Array.from(n.docIDs):null}removeDocByID(e,t){let n=this.getPointKey(e),r=this.nodeMap.get(n);r&&(r.docIDs.delete(t),r.docIDs.size===0&&(this.nodeMap.delete(n),this.deleteNode(r)))}deleteNode(e){let t=e.parent,n=e.left?e.left:e.right;n&&(n.parent=t),t?t.left===e?t.left=n:t.right===e&&(t.right=n):(this.root=n,this.root&&(this.root.parent=null))}searchByRadius(t,n,r=!0,i=`asc`,a=!1){let o=a?e.vincentyDistance:e.haversineDistance,s=[{node:this.root,depth:0}],c=[];for(;s.length>0;){let{node:e,depth:i}=s.pop();if(e==null)continue;let a=o(t,e.point);(r?a<=n:a>n)&&c.push({point:e.point,docIDs:Array.from(e.docIDs)}),e.left!=null&&s.push({node:e.left,depth:i+1}),e.right!=null&&s.push({node:e.right,depth:i+1})}return i&&c.sort((e,n)=>{let r=o(t,e.point),a=o(t,n.point);return i.toLowerCase()===`asc`?r-a:a-r}),c}searchByPolygon(t,n=!0,r=null,i=!1){let a=[{node:this.root,depth:0}],o=[];for(;a.length>0;){let{node:r,depth:i}=a.pop();if(r==null)continue;r.left!=null&&a.push({node:r.left,depth:i+1}),r.right!=null&&a.push({node:r.right,depth:i+1});let s=e.isPointInPolygon(t,r.point);(s&&n||!s&&!n)&&o.push({point:r.point,docIDs:Array.from(r.docIDs)})}let s=e.calculatePolygonCentroid(t);if(r){let t=i?e.vincentyDistance:e.haversineDistance;o.sort((e,n)=>{let i=t(s,e.point),a=t(s,n.point);return r.toLowerCase()===`asc`?i-a:a-i})}return o}toJSON(){return{root:this.root?this.root.toJSON():null}}static fromJSON(t){let n=new e;return t.root&&(n.root=qK.fromJSON(t.root),n.buildNodeMap(n.root)),n}buildNodeMap(e){if(e==null)return;let t=this.getPointKey(e.point);this.nodeMap.set(t,e),e.left&&this.buildNodeMap(e.left),e.right&&this.buildNodeMap(e.right)}static calculatePolygonCentroid(e){let t=0,n=0,r=0,i=e.length;for(let a=0,o=i-1;a<i;o=a++){let i=e[a].lon,s=e[a].lat,c=e[o].lon,l=e[o].lat,u=i*l-c*s;t+=u,n+=(i+c)*u,r+=(s+l)*u}t/=2;let a=6*t;return n/=a,r/=a,{lon:n,lat:r}}static isPointInPolygon(e,t){let n=!1,r=t.lon,i=t.lat,a=e.length;for(let t=0,o=a-1;t<a;o=t++){let a=e[t].lon,s=e[t].lat,c=e[o].lon,l=e[o].lat;s>i!=l>i&&r<(c-a)*(i-s)/(l-s)+a&&(n=!n)}return n}static haversineDistance(e,t){let n=Math.PI/180,r=e.lat*n,i=t.lat*n,a=(t.lat-e.lat)*n,o=(t.lon-e.lon)*n,s=Math.sin(a/2)*Math.sin(a/2)+Math.cos(r)*Math.cos(i)*Math.sin(o/2)*Math.sin(o/2);return KK*(2*Math.atan2(Math.sqrt(s),Math.sqrt(1-s)))}static vincentyDistance(e,t){let n=6378137,r=1/298.257223563,i=(1-r)*n,a=Math.PI/180,o=e.lat*a,s=t.lat*a,c=(t.lon-e.lon)*a,l=Math.atan((1-r)*Math.tan(o)),u=Math.atan((1-r)*Math.tan(s)),d=Math.sin(l),f=Math.cos(l),p=Math.sin(u),m=Math.cos(u),h=c,g,_=1e3,v,y,b,x,S,C;do{let e=Math.sin(h),t=Math.cos(h);if(v=Math.sqrt(m*e*(m*e)+(f*p-d*m*t)*(f*p-d*m*t)),v===0)return 0;y=d*p+f*m*t,b=Math.atan2(v,y),x=f*m*e/v,S=1-x*x,C=y-2*d*p/S,isNaN(C)&&(C=0);let n=r/16*S*(4+r*(4-3*S));g=h,h=c+(1-n)*r*x*(b+n*v*(C+n*y*(-1+2*C*C)))}while(Math.abs(h-g)>1e-12&&--_>0);if(_===0)return NaN;let w=S*(n*n-i*i)/(i*i),ee=1+w/16384*(4096+w*(-768+w*(320-175*w))),T=w/1024*(256+w*(-128+w*(74-47*w))),E=T*v*(C+T/4*(y*(-1+2*C*C)-T/6*C*(-3+4*v*v)*(-3+4*C*C)));return i*ee*(b-E)}},YK=class e{true;false;constructor(){this.true=new Set,this.false=new Set}insert(e,t){t?this.true.add(e):this.false.add(e)}delete(e,t){t?this.true.delete(e):this.false.delete(e)}getSize(){return this.true.size+this.false.size}toJSON(){return{true:Array.from(this.true),false:Array.from(this.false)}}static fromJSON(t){let n=new e;return n.true=new Set(t.true),n.false=new Set(t.false),n}};function XK(e,t,n,r,i,{k:a,b:o,d:s}){return Math.log(1+(n-t+.5)/(t+.5))*(s+e*(a+1))/(e+a*(1-o+o*r/i))}var ZK=class e{size;vectors=new Map;constructor(e){this.size=e}add(e,t){t instanceof Float32Array||(t=new Float32Array(t));let n=QK(t,this.size);this.vectors.set(e,[n,t])}remove(e){this.vectors.delete(e)}find(e,t,n){return e instanceof Float32Array||(e=new Float32Array(e)),$K(e,n,this.vectors,this.size,t)}toJSON(){let e=[];for(let[t,[n,r]]of this.vectors)e.push([t,[n,Array.from(r)]]);return{size:this.size,vectors:e}}static fromJSON(t){let n=t,r=new e(n.size);for(let[e,[t,i]]of n.vectors)r.vectors.set(e,[t,new Float32Array(i)]);return r}};function QK(e,t){let n=0;for(let r=0;r<t;r++)n+=e[r]*e[r];return Math.sqrt(n)}function $K(e,t,n,r,i){let a=QK(e,r),o=[],s=t||n.keys();for(let t of s){let s=n.get(t);if(!s)continue;let c=s[0],l=s[1],u=0;for(let t=0;t<r;t++)u+=e[t]*l[t];let d=u/(a*c);d>=i&&o.push([t,d])}return o}function eq(e,t,n,r,i){let a=_K(e.sharedInternalDocumentStore,n);e.avgFieldLength[t]=((e.avgFieldLength[t]??0)*(i-1)+r.length)/i,e.fieldLengths[t][a]=r.length,e.frequencies[t][a]={}}function tq(e,t,n,r,i){let a=0;for(let e of r)e===i&&a++;let o=_K(e.sharedInternalDocumentStore,n),s=a/r.length;e.frequencies[t][o][i]=s,i in e.tokenOccurrences[t]||(e.tokenOccurrences[t][i]=0),e.tokenOccurrences[t][i]=(e.tokenOccurrences[t][i]??0)+1}function nq(e,t,n,r){let i=_K(e.sharedInternalDocumentStore,n);r>1?e.avgFieldLength[t]=(e.avgFieldLength[t]*r-e.fieldLengths[t][i])/(r-1):e.avgFieldLength[t]=void 0,e.fieldLengths[t][i]=void 0,e.frequencies[t][i]=void 0}function rq(e,t,n){e.tokenOccurrences[t][n]--}function iq(e,t,n,r,i=``){r||={sharedInternalDocumentStore:t,indexes:{},vectorIndexes:{},searchableProperties:[],searchablePropertiesWithTypes:{},frequencies:{},tokenOccurrences:{},avgFieldLength:{},fieldLengths:{}};for(let[a,o]of Object.entries(n)){let n=`${i}${i?`.`:``}${a}`;if(typeof o==`object`&&!Array.isArray(o)){iq(e,t,o,r,n);continue}if(uK(o))r.searchableProperties.push(n),r.searchablePropertiesWithTypes[n]=o,r.vectorIndexes[n]={type:`Vector`,node:new ZK(pK(o)),isArray:!1};else{let e=/\[/.test(o);switch(o){case`boolean`:case`boolean[]`:r.indexes[n]={type:`Bool`,node:new YK,isArray:e};break;case`number`:case`number[]`:r.indexes[n]={type:`AVL`,node:new zK(0,[]),isArray:e};break;case`string`:case`string[]`:r.indexes[n]={type:`Radix`,node:new WK,isArray:e},r.avgFieldLength[n]=0,r.frequencies[n]={},r.tokenOccurrences[n]={},r.fieldLengths[n]={};break;case`enum`:case`enum[]`:r.indexes[n]={type:`Flat`,node:new BK,isArray:e};break;case`geopoint`:r.indexes[n]={type:`BKD`,node:new JK,isArray:e};break;default:throw rK(`INVALID_SCHEMA_TYPE`,Array.isArray(o)?`array`:o,n)}r.searchableProperties.push(n),r.searchablePropertiesWithTypes[n]=o}}return r}function aq(e,t,n,r,i,a,o,s){return c=>{let{type:l,node:u}=t.indexes[n];switch(l){case`Bool`:u[c?`true`:`false`].add(r);break;case`AVL`:{let e=s?.avlRebalanceThreshold??1;u.insert(c,r,e);break}case`Radix`:{let s=a.tokenize(c,i,n,!1);e.insertDocumentScoreParameters(t,n,r,s,o);for(let i of s)e.insertTokenScoreParameters(t,n,r,s,i),u.insert(i,r);break}case`Flat`:u.insert(c,r);break;case`BKD`:u.insert(c,[r]);break}}}function oq(e,t,n,r,i,a,o,s,c,l,u){if(uK(o))return sq(t,n,a,r,i);let d=aq(e,t,n,i,s,c,l,u);if(!dK(o))return d(a);let f=a,p=f.length;for(let e=0;e<p;e++)d(f[e])}function sq(e,t,n,r,i){e.vectorIndexes[t].node.add(i,n)}function cq(e,t,n,r,i,a,o,s,c,l){if(uK(o))return t.vectorIndexes[n].node.remove(i),!0;let{type:u,node:d}=t.indexes[n];switch(u){case`AVL`:return d.removeDocument(a,i),!0;case`Bool`:return d[a?`true`:`false`].delete(i),!0;case`Radix`:{let o=c.tokenize(a,s,n);e.removeDocumentScoreParameters(t,n,r,l);for(let r of o)e.removeTokenScoreParameters(t,n,r),d.removeDocumentByWord(r,i);return!0}case`Flat`:return d.removeDocument(i,a),!0;case`BKD`:return d.removeDocByID(a,i),!1}}function lq(e,t,n,r,i,a,o,s,c,l){if(!dK(o))return cq(e,t,n,r,i,a,o,s,c,l);let u=fK(o),d=a,f=d.length;for(let a=0;a<f;a++)cq(e,t,n,r,i,d[a],u,s,c,l);return!0}function uq(e,t,n,r,i,a,o,s,c,l){let u=Array.from(r),d=e.avgFieldLength[t],f=e.fieldLengths[t],p=e.tokenOccurrences[t],m=e.frequencies[t],h=typeof p[n]==`number`?p[n]??0:0,g=u.length;for(let e=0;e<g;e++){let r=u[e];if(c&&!c.has(r))continue;l.has(r)||l.set(r,new Map);let p=l.get(r);p.set(t,(p.get(t)||0)+1);let g=XK(m?.[r]?.[n]??0,h,i,f[r],d,a);o.has(r)?o.set(r,o.get(r)+g*s):o.set(r,g*s)}}function dq(e,t,n,r,i,a,o,s,c,l,u,d=0){let f=n.tokenize(t,r),p=f.length||1,m=new Map,h=new Map,g=new Map;for(let n of i){if(!(n in e.indexes))continue;let r=e.indexes[n],{type:i}=r;if(i!==`Radix`)throw rK(`WRONG_SEARCH_PROPERTY_TYPE`,n);let d=s[n]??1;if(d<=0)throw rK(`INVALID_BOOST_VALUE`,d);f.length===0&&!t&&f.push(``);let p=f.length;for(let t=0;t<p;t++){let i=f[t],s=r.node.find({term:i,exact:a,tolerance:o}),p=Object.keys(s);p.length>0&&h.set(i,!0);let _=p.length;for(let t=0;t<_;t++){let r=p[t],i=s[r];uq(e,n,r,i,l,c,g,d,u,m)}}}let _=Array.from(g.entries()).map(([e,t])=>[e,t]).sort((e,t)=>t[1]-e[1]);if(_.length===0)return[];if(d===1)return _;if(d===0){if(p===1)return _;for(let e of f)if(!h.get(e))return[];return _.filter(([e])=>{let t=m.get(e);return t?Array.from(t.values()).some(e=>e===p):!1})}let v=_.filter(([e])=>{let t=m.get(e);return t?Array.from(t.values()).some(e=>e===p):!1});if(v.length>0){let e=_.filter(([e])=>!v.some(([t])=>t===e)),t=Math.ceil(e.length*d);return[...v,...e.slice(0,t)]}return _}function fq(e,t,n,r){if(`and`in n&&n.and&&Array.isArray(n.and)){let i=n.and;return i.length===0?new Set:ZG(...i.map(n=>fq(e,t,n,r)))}if(`or`in n&&n.or&&Array.isArray(n.or)){let i=n.or;return i.length===0?new Set:i.map(n=>fq(e,t,n,r)).reduce((e,t)=>$G(e,t),new Set)}if(`not`in n&&n.not){let i=n.not,a=new Set,o=e.sharedInternalDocumentStore;for(let e=1;e<=o.internalIdToId.length;e++)a.add(e);return eK(a,fq(e,t,i,r))}let i=Object.keys(n),a=i.reduce((e,t)=>({[t]:new Set,...e}),{});for(let o of i){let i=n[o];if(e.indexes[o]===void 0)throw rK(`UNKNOWN_FILTER_PROPERTY`,o);let{node:s,type:c,isArray:l}=e.indexes[o];if(c===`Bool`){let e=s,t=i?e.true:e.false;a[o]=$G(a[o],t);continue}if(c===`BKD`){let e;if(`radius`in i)e=`radius`;else if(`polygon`in i)e=`polygon`;else throw Error(`Invalid operation ${i}`);if(e===`radius`){let{value:t,coordinates:n,unit:r=`m`,inside:c=!0,highPrecision:l=!1}=i[e],u=qG(t,r),d=s.searchByRadius(n,u,c,void 0,l);a[o]=vq(a[o],d)}else{let{coordinates:t,inside:n=!0,highPrecision:r=!1}=i[e],c=s.searchByPolygon(t,n,void 0,r);a[o]=vq(a[o],c)}continue}if(c===`Radix`&&(typeof i==`string`||Array.isArray(i))){for(let e of[i].flat()){let n=t.tokenize(e,r,o);for(let e of n){let t=s.find({term:e,exact:!0});a[o]=Sq(a[o],t)}}continue}let u=Object.keys(i);if(u.length>1)throw rK(`INVALID_FILTER_OPERATION`,u.length);if(c===`Flat`){let e=new Set(l?s.filterArr(i):s.filter(i));a[o]=$G(a[o],e);continue}if(c===`AVL`){let e=u[0],t=i[e],n;switch(e){case`gt`:n=s.greaterThan(t,!1);break;case`gte`:n=s.greaterThan(t,!0);break;case`lt`:n=s.lessThan(t,!1);break;case`lte`:n=s.lessThan(t,!0);break;case`eq`:n=s.find(t)??new Set;break;case`between`:{let[e,r]=t;n=s.rangeSearch(e,r);break}default:throw rK(`INVALID_FILTER_OPERATION`,e)}a[o]=$G(a[o],n)}}return ZG(...Object.values(a))}function pq(e){return e.searchableProperties}function mq(e){return e.searchablePropertiesWithTypes}function hq(e,t){let{indexes:n,vectorIndexes:r,searchableProperties:i,searchablePropertiesWithTypes:a,frequencies:o,tokenOccurrences:s,avgFieldLength:c,fieldLengths:l}=t,u={},d={};for(let e of Object.keys(n)){let{node:t,type:r,isArray:i}=n[e];switch(r){case`Radix`:u[e]={type:`Radix`,node:WK.fromJSON(t),isArray:i};break;case`Flat`:u[e]={type:`Flat`,node:BK.fromJSON(t),isArray:i};break;case`AVL`:u[e]={type:`AVL`,node:zK.fromJSON(t),isArray:i};break;case`BKD`:u[e]={type:`BKD`,node:JK.fromJSON(t),isArray:i};break;case`Bool`:u[e]={type:`Bool`,node:YK.fromJSON(t),isArray:i};break;default:u[e]=n[e]}}for(let e of Object.keys(r))d[e]={type:`Vector`,isArray:!1,node:ZK.fromJSON(r[e])};return{sharedInternalDocumentStore:e,indexes:u,vectorIndexes:d,searchableProperties:i,searchablePropertiesWithTypes:a,frequencies:o,tokenOccurrences:s,avgFieldLength:c,fieldLengths:l}}function gq(e){let{indexes:t,vectorIndexes:n,searchableProperties:r,searchablePropertiesWithTypes:i,frequencies:a,tokenOccurrences:o,avgFieldLength:s,fieldLengths:c}=e,l={};for(let e of Object.keys(n))l[e]=n[e].node.toJSON();let u={};for(let e of Object.keys(t)){let{type:n,node:r,isArray:i}=t[e];n===`Flat`||n===`Radix`||n===`AVL`||n===`BKD`||n===`Bool`?u[e]={type:n,node:r.toJSON(),isArray:i}:(u[e]=t[e],u[e].node=u[e].node.toJSON())}return{indexes:u,vectorIndexes:l,searchableProperties:r,searchablePropertiesWithTypes:i,frequencies:a,tokenOccurrences:o,avgFieldLength:s,fieldLengths:c}}function _q(){return{create:iq,insert:oq,remove:lq,insertDocumentScoreParameters:eq,insertTokenScoreParameters:tq,removeDocumentScoreParameters:nq,removeTokenScoreParameters:rq,calculateResultScores:uq,search:dq,searchByWhereClause:fq,getSearchableProperties:pq,getSearchablePropertiesWithTypes:mq,load:hq,save:gq}}function vq(e,t){e||=new Set;let n=t.length;for(let r=0;r<n;r++){let n=t[r].docIDs,i=n.length;for(let t=0;t<i;t++)e.add(n[t])}return e}function yq(e,t,n=!1){let r=n?JK.vincentyDistance:JK.haversineDistance,i=[],a=[];for(let{point:n}of e)a.push(r(t,n));let o=Math.max(...a),s=0;for(let{docIDs:t}of e){let e=o-a[s]+1;for(let n of t)i.push([n,e]);s++}return i.sort((e,t)=>t[1]-e[1]),i}function bq(e,t){let n=Object.keys(e);if(n.length!==1)return{isGeoOnly:!1};let r=n[0],i=e[r];if(t.indexes[r]===void 0)return{isGeoOnly:!1};let{type:a}=t.indexes[r];return a===`BKD`&&i&&(`radius`in i||`polygon`in i)?{isGeoOnly:!0,geoProperty:r,geoOperation:i}:{isGeoOnly:!1}}function xq(e,t){let n=e,r=bq(t,n);if(!r.isGeoOnly||!r.geoProperty||!r.geoOperation)return null;let{node:i}=n.indexes[r.geoProperty],a=r.geoOperation,o=i,s;if(`radius`in a){let{value:e,coordinates:t,unit:n=`m`,inside:r=!0,highPrecision:i=!1}=a.radius,c=t,l=qG(e,n);return s=o.searchByRadius(c,l,r,`asc`,i),yq(s,c,i)}else if(`polygon`in a){let{coordinates:e,inside:t=!0,highPrecision:n=!1}=a.polygon;s=o.searchByPolygon(e,t,`asc`,n);let r=JK.calculatePolygonCentroid(e);return yq(s,r,n)}return null}function Sq(e,t){e||=new Set;let n=Object.keys(t),r=n.length;for(let i=0;i<r;i++){let r=t[n[i]],a=r.length;for(let t=0;t<a;t++)e.add(r[t])}return e}function Cq(e,t,n,r,i){let a={language:e.tokenizer.language,sharedInternalDocumentStore:t,enabled:!0,isSorted:!0,sortableProperties:[],sortablePropertiesWithTypes:{},sorts:{}};for(let[o,s]of Object.entries(n)){let n=`${i}${i?`.`:``}${o}`;if(!r.includes(n)){if(typeof s==`object`&&!Array.isArray(s)){let i=Cq(e,t,s,r,n);NG(a.sortableProperties,i.sortableProperties),a.sorts={...a.sorts,...i.sorts},a.sortablePropertiesWithTypes={...a.sortablePropertiesWithTypes,...i.sortablePropertiesWithTypes};continue}if(!uK(s))switch(s){case`boolean`:case`number`:case`string`:a.sortableProperties.push(n),a.sortablePropertiesWithTypes[n]=s,a.sorts[n]={docs:new Map,orderedDocsToRemove:new Map,orderedDocs:[],type:s};break;case`geopoint`:case`enum`:continue;case`enum[]`:case`boolean[]`:case`number[]`:case`string[]`:continue;default:throw rK(`INVALID_SORT_SCHEMA_TYPE`,Array.isArray(s)?`array`:s,n)}}}return a}function wq(e,t,n,r){return r?.enabled===!1?{disabled:!0}:Cq(e,t,n,(r||{}).unsortableProperties||[],``)}function Tq(e,t,n,r){if(!e.enabled)return;e.isSorted=!1;let i=_K(e.sharedInternalDocumentStore,n),a=e.sorts[t];a.orderedDocsToRemove.has(i)&&Mq(e,t),a.docs.set(i,a.orderedDocs.length),a.orderedDocs.push([i,r])}function Eq(e){if(e.isSorted||!e.enabled)return;let t=Object.keys(e.sorts);for(let n of t)Aq(e,n);e.isSorted=!0}function Dq(e,t,n){return t[1].localeCompare(n[1],EG(e))}function Oq(e,t){return e[1]-t[1]}function kq(e,t){return t[1]?-1:1}function Aq(e,t){let n=e.sorts[t],r;switch(n.type){case`string`:r=Dq.bind(null,e.language);break;case`number`:r=Oq.bind(null);break;case`boolean`:r=kq.bind(null);break}n.orderedDocs.sort(r);let i=n.orderedDocs.length;for(let e=0;e<i;e++){let t=n.orderedDocs[e][0];n.docs.set(t,e)}}function jq(e){let t=Object.keys(e.sorts);for(let n of t)Mq(e,n)}function Mq(e,t){let n=e.sorts[t];n.orderedDocsToRemove.size&&(n.orderedDocs=n.orderedDocs.filter(e=>!n.orderedDocsToRemove.has(e[0])),n.orderedDocsToRemove.clear())}function Nq(e,t,n){if(!e.enabled)return;let r=e.sorts[t],i=_K(e.sharedInternalDocumentStore,n);r.docs.get(i)&&(r.docs.delete(i),r.orderedDocsToRemove.set(i,!0))}function Pq(e,t,n){if(!e.enabled)throw rK(`SORT_DISABLED`);let r=n.property,i=n.order===`DESC`,a=e.sorts[r];if(!a)throw rK(`UNABLE_TO_SORT_ON_UNKNOWN_FIELD`,r,e.sortableProperties.join(`, `));return Mq(e,r),Eq(e),t.sort((t,n)=>{let r=a.docs.get(_K(e.sharedInternalDocumentStore,t[0])),o=a.docs.get(_K(e.sharedInternalDocumentStore,n[0])),s=r!==void 0,c=o!==void 0;return!s&&!c?0:s?c?i?o-r:r-o:-1:1}),t}function Fq(e){return e.enabled?e.sortableProperties:[]}function Iq(e){return e.enabled?e.sortablePropertiesWithTypes:{}}function Lq(e,t){let n=t;if(!n.enabled)return{enabled:!1};let r=Object.keys(n.sorts).reduce((e,t)=>{let{docs:r,orderedDocs:i,type:a}=n.sorts[t];return e[t]={docs:new Map(Object.entries(r).map(([e,t])=>[+e,t])),orderedDocsToRemove:new Map,orderedDocs:i,type:a},e},{});return{sharedInternalDocumentStore:e,language:n.language,sortableProperties:n.sortableProperties,sortablePropertiesWithTypes:n.sortablePropertiesWithTypes,sorts:r,enabled:!0,isSorted:n.isSorted}}function Rq(e){if(!e.enabled)return{enabled:!1};jq(e),Eq(e);let t=Object.keys(e.sorts).reduce((t,n)=>{let{docs:r,orderedDocs:i,type:a}=e.sorts[n];return t[n]={docs:Object.fromEntries(r.entries()),orderedDocs:i,type:a},t},{});return{language:e.language,sortableProperties:e.sortableProperties,sortablePropertiesWithTypes:e.sortablePropertiesWithTypes,sorts:t,enabled:e.enabled,isSorted:e.isSorted}}function zq(){return{create:wq,insert:Tq,remove:Nq,save:Rq,load:Lq,sortBy:Pq,getSortableProperties:Fq,getSortablePropertiesWithTypes:Iq}}var Bq=192,Vq=383,Hq=[65,65,65,65,65,65,65,67,69,69,69,69,73,73,73,73,69,78,79,79,79,79,79,null,79,85,85,85,85,89,80,115,97,97,97,97,97,97,97,99,101,101,101,101,105,105,105,105,101,110,111,111,111,111,111,null,111,117,117,117,117,121,112,121,65,97,65,97,65,97,67,99,67,99,67,99,67,99,68,100,68,100,69,101,69,101,69,101,69,101,69,101,71,103,71,103,71,103,71,103,72,104,72,104,73,105,73,105,73,105,73,105,73,105,73,105,74,106,75,107,107,76,108,76,108,76,108,76,108,76,108,78,110,78,110,78,110,110,78,110,79,111,79,111,79,111,79,111,82,114,82,114,82,114,83,115,83,115,83,115,83,115,84,116,84,116,84,116,85,117,85,117,85,117,85,117,85,117,85,117,87,119,89,121,89,90,122,90,122,90,122,115];function Uq(e){return e<Bq||e>Vq?e:Hq[e-Bq]||e}function Wq(e){let t=[];for(let n=0;n<e.length;n++)t[n]=Uq(e.charCodeAt(n));return String.fromCharCode(...t)}var Gq={ational:`ate`,tional:`tion`,enci:`ence`,anci:`ance`,izer:`ize`,bli:`ble`,alli:`al`,entli:`ent`,eli:`e`,ousli:`ous`,ization:`ize`,ation:`ate`,ator:`ate`,alism:`al`,iveness:`ive`,fulness:`ful`,ousness:`ous`,aliti:`al`,iviti:`ive`,biliti:`ble`,logi:`log`},Kq={icate:`ic`,ative:``,alize:`al`,iciti:`ic`,ical:`ic`,ful:``,ness:``},qq=`[^aeiou]`,Jq=`[aeiouy]`,Yq=qq+`[^aeiouy]*`;Jq+``;var Xq=`^(`+Yq+`)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*`,Zq=`^(`+Yq+`)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*([aeiouy][aeiou]*)?$`,Qq=`^(`+Yq+`)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*[aeiouy][aeiou]*[^aeiou][^aeiouy]*`,$q=`^(`+Yq+`)?[aeiouy]`;function eJ(e){let t,n,r,i,a,o;if(e.length<3)return e;let s=e.substring(0,1);if(s==`y`&&(e=s.toUpperCase()+e.substring(1)),r=/^(.+?)(ss|i)es$/,i=/^(.+?)([^s])s$/,r.test(e)?e=e.replace(r,`$1$2`):i.test(e)&&(e=e.replace(i,`$1$2`)),r=/^(.+?)eed$/,i=/^(.+?)(ed|ing)$/,r.test(e)){let t=r.exec(e);r=new RegExp(Xq),r.test(t[1])&&(r=/.$/,e=e.replace(r,``))}else i.test(e)&&(t=i.exec(e)[1],i=new RegExp($q),i.test(t)&&(e=t,i=/(at|bl|iz)$/,a=RegExp(`([^aeiouylsz])\\1$`),o=RegExp(`^`+Yq+Jq+`[^aeiouwxy]$`),i.test(e)?e+=`e`:a.test(e)?(r=/.$/,e=e.replace(r,``)):o.test(e)&&(e+=`e`)));if(r=/^(.+?)y$/,r.test(e)&&(t=r.exec(e)?.[1],r=new RegExp($q),t&&r.test(t)&&(e=t+`i`)),r=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,r.test(e)){let i=r.exec(e);t=i?.[1],n=i?.[2],r=new RegExp(Xq),t&&r.test(t)&&(e=t+Gq[n])}if(r=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,r.test(e)){let i=r.exec(e);t=i?.[1],n=i?.[2],r=new RegExp(Xq),t&&r.test(t)&&(e=t+Kq[n])}if(r=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,i=/^(.+?)(s|t)(ion)$/,r.test(e))t=r.exec(e)?.[1],r=new RegExp(Qq),t&&r.test(t)&&(e=t);else if(i.test(e)){let n=i.exec(e);t=n?.[1]??``+n?.[2]??``,i=new RegExp(Qq),i.test(t)&&(e=t)}return r=/^(.+?)e$/,r.test(e)&&(t=r.exec(e)?.[1],r=new RegExp(Qq),i=new RegExp(Zq),a=RegExp(`^`+Yq+Jq+`[^aeiouwxy]$`),t&&(r.test(t)||i.test(t)&&!a.test(t))&&(e=t)),r=/ll$/,i=new RegExp(Qq),r.test(e)&&i.test(e)&&(r=/.$/,e=e.replace(r,``)),s==`y`&&(e=s.toLowerCase()+e.substring(1)),e}function tJ(e,t,n=!0){let r=`${this.language}:${e}:${t}`;return n&&this.normalizationCache.has(r)?this.normalizationCache.get(r):this.stopWords?.includes(t)?(n&&this.normalizationCache.set(r,``),``):(this.stemmer&&!this.stemmerSkipProperties.has(e)&&(t=this.stemmer(t)),t=Wq(t),n&&this.normalizationCache.set(r,t),t)}function nJ(e){for(;e[e.length-1]===``;)e.pop();for(;e[0]===``;)e.shift();return e}function rJ(e,t,n,r=!0){if(t&&t!==this.language)throw rK(`LANGUAGE_NOT_SUPPORTED`,t);if(typeof e!=`string`)return[e];let i=this.normalizeToken.bind(this,n??``),a;if(n&&this.tokenizeSkipProperties.has(n))a=[i(e,r)];else{let t=wG[this.language];a=e.toLowerCase().split(t).map(e=>i(e,r)).filter(Boolean)}let o=nJ(a);return this.allowDuplicates?o:Array.from(new Set(o))}function iJ(e={}){if(!e.language)e.language=`english`;else if(!TG.includes(e.language))throw rK(`LANGUAGE_NOT_SUPPORTED`,e.language);let t;if(e.stemming||e.stemmer&&!(`stemming`in e))if(e.stemmer){if(typeof e.stemmer!=`function`)throw rK(`INVALID_STEMMER_FUNCTION_TYPE`);t=e.stemmer}else if(e.language===`english`)t=eJ;else throw rK(`MISSING_STEMMER`,e.language);let n;if(e.stopWords!==!1){if(n=[],Array.isArray(e.stopWords))n=e.stopWords;else if(typeof e.stopWords==`function`)n=e.stopWords(n);else if(e.stopWords)throw rK(`CUSTOM_STOP_WORDS_MUST_BE_FUNCTION_OR_ARRAY`);if(!Array.isArray(n))throw rK(`CUSTOM_STOP_WORDS_MUST_BE_FUNCTION_OR_ARRAY`);for(let e of n)if(typeof e!=`string`)throw rK(`CUSTOM_STOP_WORDS_MUST_BE_FUNCTION_OR_ARRAY`)}let r={tokenize:rJ,language:e.language,stemmer:t,stemmerSkipProperties:new Set(e.stemmerSkipProperties?[e.stemmerSkipProperties].flat():[]),tokenizeSkipProperties:new Set(e.tokenizeSkipProperties?[e.tokenizeSkipProperties].flat():[]),stopWords:n,allowDuplicates:!!e.allowDuplicates,normalizeToken:tJ,normalizationCache:new Map};return r.tokenize=rJ.bind(r),r.normalizeToken=tJ,r}function aJ(e){return{sharedInternalDocumentStore:e,rules:new Map}}function oJ(e,t){if(e.rules.has(t.id))throw Error(`PINNING_RULE_ALREADY_EXISTS: A pinning rule with id "${t.id}" already exists. Use updateRule to modify it.`);e.rules.set(t.id,t)}function sJ(e,t){if(!e.rules.has(t.id))throw Error(`PINNING_RULE_NOT_FOUND: Cannot update pinning rule with id "${t.id}" because it does not exist. Use addRule to create it.`);e.rules.set(t.id,t)}function cJ(e,t){return e.rules.delete(t)}function lJ(e,t){return e.rules.get(t)}function uJ(e){return Array.from(e.rules.values())}function dJ(e,t){let n=e.toLowerCase().trim(),r=t.pattern.toLowerCase().trim();switch(t.anchoring){case`is`:return n===r;case`starts_with`:return n.startsWith(r);case`contains`:return n.includes(r);default:return!1}}function fJ(e,t){return e?t.conditions.every(t=>dJ(e,t)):!1}function pJ(e,t){if(!t)return[];let n=[];for(let r of e.rules.values())fJ(t,r)&&n.push(r);return n}function mJ(e,t){return{sharedInternalDocumentStore:e,rules:new Map(t?.rules??[])}}function hJ(e){return{rules:Array.from(e.rules.entries())}}function gJ(){return{create:aJ,addRule:oJ,updateRule:sJ,removeRule:cJ,getRule:lJ,getAllRules:uJ,getMatchingRules:pJ,load:mJ,save:hJ}}function _J(e){let t={formatElapsedTime:iK,getDocumentIndexId:aK,getDocumentProperties:WG,validateSchema:oK};for(let n of MK){let r=n;if(e[r]){if(typeof e[r]!=`function`)throw rK(`COMPONENT_MUST_BE_FUNCTION`,r)}else e[r]=t[r]}for(let t of Object.keys(e))if(!jK.includes(t)&&!MK.includes(t))throw rK(`UNSUPPORTED_COMPONENT`,t)}function vJ({schema:e,sort:t,language:n,components:r,id:i,plugins:a}){r||={};for(let t of a??[]){if(!(`getComponents`in t)||typeof t.getComponents!=`function`)continue;let n=t.getComponents(e),i=Object.keys(n);for(let e of i)if(r[e])throw rK(`PLUGIN_COMPONENT_CONFLICT`,e,t.name);r={...r,...n}}i||=BG();let o=r.tokenizer,s=r.index,c=r.documentsStore,l=r.sorter,u=r.pinning;if(o=o?o.tokenize?o:iJ(o):iJ({language:n??`english`}),r.tokenizer&&n)throw rK(`NO_LANGUAGE_WITH_CUSTOM_TOKENIZER`);let d=mK();s||=_q(),l||=zq(),c||=OK(),u||=gJ(),_J(r);let{getDocumentProperties:f,getDocumentIndexId:p,validateSchema:m,formatElapsedTime:h}=r,g={data:{},caches:{},schema:e,tokenizer:o,index:s,sorter:l,documentsStore:c,pinning:u,internalDocumentIDStore:d,getDocumentProperties:f,getDocumentIndexId:p,validateSchema:m,beforeInsert:[],afterInsert:[],beforeRemove:[],afterRemove:[],beforeUpdate:[],afterUpdate:[],beforeUpsert:[],afterUpsert:[],beforeSearch:[],afterSearch:[],beforeInsertMultiple:[],afterInsertMultiple:[],beforeRemoveMultiple:[],afterRemoveMultiple:[],beforeUpdateMultiple:[],afterUpdateMultiple:[],beforeUpsertMultiple:[],afterUpsertMultiple:[],afterCreate:[],formatElapsedTime:h,id:i,plugins:a,version:yJ()};g.data={index:g.index.create(g,d,e),docs:g.documentsStore.create(g,d),sorting:g.sorter.create(g,d,e,t),pinning:g.pinning.create(d)};for(let e of kK)g[e]=(g[e]??[]).concat(AK(g,e));let _=g.afterCreate;return _&&LK(_,g),g}function yJ(){return`{{VERSION}}`}function bJ(e){return e.documentsStore.count(e.data.docs)}function xJ(e,t,n,r,i){let a=e.validateSchema(t,e.schema);if(a)throw rK(`SCHEMA_VALIDATION_FAILURE`,a);return YG(e.beforeInsert)||YG(e.afterInsert)||YG(e.index.beforeInsert)||YG(e.index.insert)||YG(e.index.afterInsert)?wJ(e,t,n,r,i):TJ(e,t,n,r,i)}var SJ=new Set([`enum`,`enum[]`]),CJ=new Set([`string`,`number`]);async function wJ(e,t,n,r,i){let{index:a,docs:o}=e.data,s=e.getDocumentIndexId(t);if(typeof s!=`string`)throw rK(`DOCUMENT_ID_MUST_BE_STRING`,typeof s);let c=_K(e.internalDocumentIDStore,s);if(r||await NK(e.beforeInsert,e,s,t),!e.documentsStore.store(o,s,c,t))throw rK(`DOCUMENT_ALREADY_EXISTS`,s);let l=e.documentsStore.count(o),u=e.index.getSearchableProperties(a),d=e.index.getSearchablePropertiesWithTypes(a),f=e.getDocumentProperties(t,u);for(let[e,t]of Object.entries(f)){if(t===void 0)continue;let n=typeof t,r=d[e];EJ(n,r,e,t)}return await DJ(e,s,u,f,l,n,t,i),r||await NK(e.afterInsert,e,s,t),s}function TJ(e,t,n,r,i){let{index:a,docs:o}=e.data,s=e.getDocumentIndexId(t);if(typeof s!=`string`)throw rK(`DOCUMENT_ID_MUST_BE_STRING`,typeof s);let c=_K(e.internalDocumentIDStore,s);if(r||NK(e.beforeInsert,e,s,t),!e.documentsStore.store(o,s,c,t))throw rK(`DOCUMENT_ALREADY_EXISTS`,s);let l=e.documentsStore.count(o),u=e.index.getSearchableProperties(a),d=e.index.getSearchablePropertiesWithTypes(a),f=e.getDocumentProperties(t,u);for(let[e,t]of Object.entries(f)){if(t===void 0)continue;let n=typeof t,r=d[e];EJ(n,r,e,t)}return OJ(e,s,u,f,l,n,t,i),r||NK(e.afterInsert,e,s,t),s}function EJ(e,t,n,r){if(!(lK(t)&&typeof r==`object`&&typeof r.lon==`number`&&typeof r.lat==`number`)&&!(uK(t)&&Array.isArray(r))&&!(dK(t)&&Array.isArray(r))&&!(SJ.has(t)&&CJ.has(e))&&e!==t)throw rK(`INVALID_DOCUMENT_PROPERTY`,n,t,e)}async function DJ(e,t,n,r,i,a,o,s){for(let o of n){let n=r[o];if(n===void 0)continue;let c=e.index.getSearchablePropertiesWithTypes(e.data.index)[o];await e.index.beforeInsert?.(e.data.index,o,t,n,c,a,e.tokenizer,i);let l=e.internalDocumentIDStore.idToInternalId.get(t);await e.index.insert(e.index,e.data.index,o,t,l,n,c,a,e.tokenizer,i,s),await e.index.afterInsert?.(e.data.index,o,t,n,c,a,e.tokenizer,i)}let c=e.sorter.getSortableProperties(e.data.sorting),l=e.getDocumentProperties(o,c);for(let n of c){let r=l[n];if(r===void 0)continue;let i=e.sorter.getSortablePropertiesWithTypes(e.data.sorting)[n];e.sorter.insert(e.data.sorting,n,t,r,i,a)}}function OJ(e,t,n,r,i,a,o,s){for(let o of n){let n=r[o];if(n===void 0)continue;let c=e.index.getSearchablePropertiesWithTypes(e.data.index)[o],l=_K(e.internalDocumentIDStore,t);e.index.beforeInsert?.(e.data.index,o,t,n,c,a,e.tokenizer,i),e.index.insert(e.index,e.data.index,o,t,l,n,c,a,e.tokenizer,i,s),e.index.afterInsert?.(e.data.index,o,t,n,c,a,e.tokenizer,i)}let c=e.sorter.getSortableProperties(e.data.sorting),l=e.getDocumentProperties(o,c);for(let n of c){let r=l[n];if(r===void 0)continue;let i=e.sorter.getSortablePropertiesWithTypes(e.data.sorting)[n];e.sorter.insert(e.data.sorting,n,t,r,i,a)}}function kJ(e,t,n,r,i,a){return YG(e.afterInsertMultiple)||YG(e.beforeInsertMultiple)||YG(e.index.beforeInsert)||YG(e.index.insert)||YG(e.index.afterInsert)?AJ(e,t,n,r,i,a):jJ(e,t,n,r,i,a)}async function AJ(e,t,n=1e3,r,i,a=0){let o=[],s=async a=>{let s=Math.min(a+n,t.length),c=t.slice(a,s);for(let t of c){let n=await xJ(e,t,r,i,{avlRebalanceThreshold:c.length});o.push(n)}return s};return await(async()=>{let e=0;for(;e<t.length;){let t=Date.now();if(e=await s(e),a>0){let e=a-(Date.now()-t);e>0&&tK(e)}}})(),i||await PK(e.afterInsertMultiple,e,t),o}function jJ(e,t,n=1e3,r,i,a=0){let o=[],s=0;function c(){let a=t.slice(s*n,(s+1)*n);if(a.length===0)return!1;for(let t of a){let n=xJ(e,t,r,i,{avlRebalanceThreshold:a.length});o.push(n)}return s++,!0}function l(){let e=Date.now();for(;c();)if(a>0){let t=Date.now()-e;if(t>=a){let e=a-t%a;e>0&&tK(e)}}}return l(),i||PK(e.afterInsertMultiple,e,t),o}function MJ(e,t){return e[1]-t[1]}function NJ(e,t){return t[1]-e[1]}function PJ(e=`desc`){return e.toLowerCase()===`asc`?MJ:NJ}function FJ(e,t,n){let r={},i=t.map(([e])=>e),a=e.documentsStore.getMultiple(e.data.docs,i),o=Object.keys(n),s=e.index.getSearchablePropertiesWithTypes(e.data.index);for(let e of o){let t;if(s[e]===`number`){let{ranges:r}=n[e],i=r.length,a=Array.from({length:i});for(let e=0;e<i;e++){let t=r[e];a[e]=[`${t.from}-${t.to}`,0]}t=Object.fromEntries(a)}r[e]={count:0,values:t??{}}}let c=a.length;for(let e=0;e<c;e++){let t=a[e];for(let e of o){let i=e.includes(`.`)?GG(t,e):t[e],a=s[e],o=r[e].values;switch(a){case`number`:{let t=n[e].ranges;IJ(t,o)(i);break}case`number[]`:{let t=new Set,r=n[e].ranges,a=IJ(r,o,t);for(let e of i)a(e);break}case`boolean`:case`enum`:case`string`:LJ(o,a)(i);break;case`boolean[]`:case`enum[]`:case`string[]`:{let e=LJ(o,a===`boolean[]`?`boolean`:`string`,new Set);for(let t of i)e(t);break}default:throw rK(`FACET_NOT_SUPPORTED`,a)}}}for(let e of o){let t=r[e];if(t.count=Object.keys(t.values).length,s[e]===`string`){let r=n[e],i=PJ(r.sort);t.values=Object.fromEntries(Object.entries(t.values).sort(i).slice(r.offset??0,r.limit??10))}}return r}function IJ(e,t,n){return r=>{for(let i of e){let e=`${i.from}-${i.to}`;n?.has(e)||r>=i.from&&r<=i.to&&(t[e]===void 0?t[e]=1:(t[e]++,n?.add(e)))}}}function LJ(e,t,n){let r=t===`boolean`?`false`:``;return t=>{let i=t?.toString()??r;n?.has(i)||(e[i]=(e[i]??0)+1,n?.add(i))}}var RJ={reducer:(e,t,n,r)=>(t[r]=n,t),getInitialValue:e=>Array.from({length:e})},zJ=[`string`,`number`,`boolean`];function BJ(e,t,n){let r=n.properties,i=r.length,a=e.index.getSearchablePropertiesWithTypes(e.data.index);for(let e=0;e<i;e++){let t=r[e];if(a[t]===void 0)throw rK(`UNKNOWN_GROUP_BY_PROPERTY`,t);if(!zJ.includes(a[t]))throw rK(`INVALID_GROUP_BY_PROPERTY`,t,zJ.join(`, `),a[t])}let o=t.map(([t])=>vK(e.internalDocumentIDStore,t)),s=e.documentsStore.getMultiple(e.data.docs,o),c=s.length,l=n.maxResult||2**53-1,u=[],d={};for(let e=0;e<i;e++){let t=r[e],n={property:t,perValue:{}},i=new Set;for(let e=0;e<c;e++){let r=s[e],a=GG(r,t);if(a===void 0)continue;let o=typeof a==`boolean`?``+a:a,c=n.perValue[o]??{indexes:[],count:0};c.count>=l||(c.indexes.push(e),c.count++,n.perValue[o]=c,i.add(a))}u.push(Array.from(i)),d[t]=n}let f=VJ(u),p=f.length,m=[];for(let e=0;e<p;e++){let t=f[e],n=t.length,i={values:[],indexes:[]},a=[];for(let e=0;e<n;e++){let n=t[e],o=r[e];a.push(d[o].perValue[typeof n==`boolean`?``+n:n].indexes),i.values.push(n)}i.indexes=UG(a).sort((e,t)=>e-t),i.indexes.length!==0&&m.push(i)}let h=m.length,g=Array.from({length:h});for(let e=0;e<h;e++){let r=m[e],i=n.reduce||RJ,a=r.indexes.map(e=>({id:o[e],score:t[e][1],document:s[e]})),c=i.reducer.bind(null,r.values),l=i.getInitialValue(r.indexes.length),u=a.reduce(c,l);g[e]={values:r.values,result:u}}return g}function VJ(e,t=0){if(t+1===e.length)return e[t].map(e=>[e]);let n=e[t],r=VJ(e,t+1),i=[];for(let e of n)for(let t of r){let n=[e];NG(n,t),i.push(n)}return i}function HJ(e,t,n,r){let i=pJ(t,r);if(i.length===0)return n;let a=i.flatMap(e=>e.consequence.promote);a.sort((e,t)=>e.position-t.position);let o=new Set,s=new Map,c=new Set;for(let t of a){let n=_K(e.internalDocumentIDStore,t.doc_id);if(n!==void 0){if(s.has(n)){let e=s.get(n);t.position<e&&s.set(n,t.position);continue}c.has(t.position)||(o.add(n),s.set(n,t.position),c.add(t.position))}}if(s.size===0)return n;let l=n.filter(([e])=>!o.has(e)),u=[];for(let[t,r]of s.entries())n.find(([e])=>e===t)?u.push([t,1e6-r]):e.documentsStore.get(e.data.docs,t)&&u.push([t,0]);u.sort((e,t)=>(s.get(e[0])??1/0)-(s.get(t[0])??1/0));let d=[],f=new Map;for(let e of u){let t=s.get(e[0]);f.set(t,e)}let p=0,m=0;for(;m<l.length+u.length;)if(f.has(m))d.push(f.get(m)),m++;else if(p<l.length)d.push(l[p]),p++,m++;else break;for(let[e,t]of f.entries())e>=d.length&&d.push(t);return d}function UJ(e,t,n){let{term:r,properties:i}=t,a=e.data.index,o=e.caches.propertiesToSearch;if(!o){let t=e.index.getSearchablePropertiesWithTypes(a);o=e.index.getSearchableProperties(a),o=o.filter(e=>t[e].startsWith(`string`)),e.caches.propertiesToSearch=o}if(i&&i!==`*`){for(let e of i)if(!o.includes(e))throw rK(`UNKNOWN_INDEX`,e,o.join(`, `));o=o.filter(e=>i.includes(e))}let s=Object.keys(t.where??{}).length>0,c;s&&(c=e.index.searchByWhereClause(a,e.tokenizer,t.where,n));let l,u=t.threshold!==void 0&&t.threshold!==null?t.threshold:1;if(r||i){let i=bJ(e);if(l=e.index.search(a,r||``,e.tokenizer,n,o,t.exact||!1,t.tolerance||0,t.boost||{},JJ(t.relevance),i,c,u),t.exact&&r){let t=r.trim().split(/\s+/);l=l.filter(([n])=>{let r=e.documentsStore.get(e.data.docs,n);if(!r)return!1;for(let e of o){let n=GJ(r,e);if(typeof n==`string`&&t.every(e=>RegExp(`\\b${WJ(e)}\\b`).test(n)))return!0}return!1})}}else l=s?xq(a,t.where)||(c?Array.from(c):[]).map(e=>[+e,0]):Object.keys(e.documentsStore.getAll(e.data.docs)).map(e=>[+e,0]);return l}function WJ(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function GJ(e,t){let n=t.split(`.`),r=e;for(let e of n)if(r&&typeof r==`object`&&e in r)r=r[e];else return;return r}function KJ(e,t,n){let r=zG();function i(){let i=Object.keys(e.data.index.vectorIndexes),a=t.facets&&Object.keys(t.facets).length>0,{limit:o=10,offset:s=0,distinctOn:c,includeVectors:l=!1}=t,u=t.preflight===!0,d=UJ(e,t,n);if(t.sortBy)if(typeof t.sortBy==`function`){let n=d.map(([e])=>e),r=e.documentsStore.getMultiple(e.data.docs,n).map((e,t)=>[d[t][0],d[t][1],e]);r.sort(t.sortBy),d=r.map(([e,t])=>[e,t])}else d=e.sorter.sortBy(e.data.sorting,d,t.sortBy).map(([t,n])=>[_K(e.internalDocumentIDStore,t),n]);else d=d.sort(HG);d=HJ(e,e.data.pinning,d,t.term);let f;u||(f=c?oY(e,d,s,o,c):sY(e,d,s,o));let p={elapsed:{formatted:``,raw:0},hits:[],count:d.length};return f!==void 0&&(p.hits=f.filter(Boolean),l||JG(p,i)),a&&(p.facets=FJ(e,d,t.facets)),t.groupBy&&(p.groups=BJ(e,d,t.groupBy)),p.elapsed=e.formatElapsedTime(zG()-r),p}async function a(){e.beforeSearch&&await IK(e.beforeSearch,e,t,n);let r=i();return e.afterSearch&&await FK(e.afterSearch,e,t,n,r),r}return e.beforeSearch?.length||e.afterSearch?.length?a():i()}var qJ={k:1.2,b:.75,d:.5};function JJ(e){let t=e??{};return t.k=t.k??qJ.k,t.b=t.b??qJ.b,t.d=t.d??qJ.d,t}function YJ(e,t,n){let r=t.vector;if(r&&(!(`value`in r)||!(`property`in r)))throw rK(`INVALID_VECTOR_INPUT`,Object.keys(r).join(`, `));let i=e.data.index.vectorIndexes[r.property];if(!i)throw rK(`UNKNOWN_VECTOR_PROPERTY`,r.property);let a=i.node.size;if(r?.value.length!==a)throw r?.property===void 0||r?.value.length===void 0?rK(`INVALID_INPUT_VECTOR`,`undefined`,a,`undefined`):rK(`INVALID_INPUT_VECTOR`,r.property,a,r.value.length);let o=e.data.index,s;return Object.keys(t.where??{}).length>0&&(s=e.index.searchByWhereClause(o,e.tokenizer,t.where,n)),i.node.find(r.value,t.similarity??.8,s)}function XJ(e,t,n=`english`){let r=zG();function i(){let i=YJ(e,t,n).sort(HG);i=HJ(e,e.data.pinning,i,void 0);let a=[];t.facets&&Object.keys(t.facets).length>0&&(a=FJ(e,i,t.facets));let o=t.vector.property,s=t.includeVectors??!1,c=t.limit??10,l=t.offset??0,u=Array.from({length:c});for(let t=0;t<c;t++){let n=i[t+l];if(!n)break;let r=e.data.docs.docs[n[0]];r&&(s||(r[o]=null),u[t]={id:vK(e.internalDocumentIDStore,n[0]),score:n[1],document:r})}let d=[];t.groupBy&&(d=BJ(e,i,t.groupBy));let f=zG()-r;return{count:i.length,hits:u.filter(Boolean),elapsed:{raw:Number(f),formatted:RG(f)},...a?{facets:a}:{},...d?{groups:d}:{}}}async function a(){e.beforeSearch&&await IK(e.beforeSearch,e,t,n);let r=i();return e.afterSearch&&await FK(e.afterSearch,e,t,n,r),r}return e.beforeSearch?.length||e.afterSearch?.length?a():i()}function ZJ(e,t,n){let r=eY(UJ(e,t,n)),i=YJ(e,t,n),a=t.hybridWeights;return rY(r,i,t.term??``,a)}function QJ(e,t,n){let r=zG();function i(){let i=ZJ(e,t,n);i=HJ(e,e.data.pinning,i,t.term);let a;t.facets&&Object.keys(t.facets).length>0&&(a=FJ(e,i,t.facets));let o;t.groupBy&&(o=BJ(e,i,t.groupBy));let s=t.offset??0,c=t.limit??10,l=sY(e,i,s,c).filter(Boolean),u=zG(),d={count:i.length,elapsed:{raw:Number(u-r),formatted:RG(u-r)},hits:l,...a?{facets:a}:{},...o?{groups:o}:{}};return(t.includeVectors??!1)||JG(d,Object.keys(e.data.index.vectorIndexes)),d}async function a(){e.beforeSearch&&await IK(e.beforeSearch,e,t,n);let r=i();return e.afterSearch&&await FK(e.afterSearch,e,t,n,r),r}return e.beforeSearch?.length||e.afterSearch?.length?a():i()}function $J(e){return e[1]}function eY(e){let t=Math.max.apply(Math,e.map($J));return e.map(([e,n])=>[e,n/t])}function tY(e,t){return e/t}function nY(e,t){return(n,r)=>n*e+r*t}function rY(e,t,n,r){let i=Math.max.apply(Math,e.map($J)),a=Math.max.apply(Math,t.map($J)),{text:o,vector:s}=r&&r.text&&r.vector?r:iY(n),c=new Map,l=e.length,u=nY(o,s);for(let t=0;t<l;t++){let[n,r]=e[t],a=u(tY(r,i),0);c.set(n,a)}let d=t.length;for(let e=0;e<d;e++){let[n,r]=t[e],i=tY(r,a),o=c.get(n)??0;c.set(n,o+u(0,i))}return[...c].sort((e,t)=>t[1]-e[1])}function iY(e){return{text:.5,vector:.5}}function aY(e,t,n){let r=t.mode??`fulltext`;if(r===`fulltext`)return KJ(e,t,n);if(r===`vector`)return XJ(e,t);if(r===`hybrid`)return QJ(e,t);throw rK(`INVALID_SEARCH_MODE`,r)}function oY(e,t,n,r,i){let a=e.data.docs,o=new Map,s=[],c=new Set,l=t.length,u=0;for(let d=0;d<l;d++){let l=t[d];if(l===void 0)continue;let[f,p]=l;if(c.has(f))continue;let m=e.documentsStore.get(a,f),h=GG(m,i);if(!(h===void 0||o.has(h))&&(o.set(h,!0),u++,!(u<=n)&&(s.push({id:vK(e.internalDocumentIDStore,f),score:p,document:m}),c.add(f),u>=n+r)))break}return s}function sY(e,t,n,r){let i=e.data.docs,a=Array.from({length:r}),o=new Set;for(let s=n;s<r+n;s++){let n=t[s];if(n===void 0)break;let[r,c]=n;if(!o.has(r)){let t=e.documentsStore.get(i,r);a[s]={id:vK(e.internalDocumentIDStore,r),score:c,document:t},o.add(r)}}return a}new Set(Yo);var cY=[{id:`mcp-preapproval`,piece:`mcp`,scope:`project`,requiredStrictness:`pre-approval-exact`,revokedByForeignEntry:!1},{id:`tool-autoapprove`,piece:`mcp`,requiredStrictness:`pre-approval-exact`,revokedByForeignEntry:!0}];cY.map(e=>e.id);var lY={satisfied:{counts:!0,exception:null},"present-consent-unknown":{counts:!0,exception:`info`},absent:{counts:!1,exception:null},foreign:{counts:!1,exception:`warning`},"foreign-replaceable":{counts:!1,exception:`warning`},drifted:{counts:!1,exception:`warning`},excluded:{counts:!1,exception:`info`},"structural-na":{counts:!1,exception:`info`},undetected:{counts:!1,exception:null},unprobeable:{counts:!0,exception:`info`},unprobed:{counts:!1,exception:`info`}};R([`count-unverified`,`not-count`]);var uY={acp:{unprobed:`count-unverified`},terminal:{unprobed:`count-unverified`},external:{unprobed:`not-count`}};R([`acp-catalog-supported`,`harness-cli-on-path`,`os-scheme-handler`]);var dY={acp:{signal:`acp-catalog-supported`,unresolved:`show`,negativeOutranksOverride:!0},terminal:{signal:`harness-cli-on-path`,unresolved:`show`,negativeOutranksOverride:!1},external:{signal:`os-scheme-handler`,unresolved:`hide`,negativeOutranksOverride:!1}};function fY(e){return typeof e==`object`&&!!e}function pY(e,t){if(!fY(e))return;let{satisfiers:n}=e;if(!fY(n))return;let r=n[t];if(!fY(r))return;let{state:i,strictness:a,sharedWith:o}=r;if(typeof i!=`string`||i.length===0)return;let s=Array.isArray(a)?a.filter(e=>typeof e==`string`):void 0,c=Array.isArray(o)?o.filter(e=>typeof e==`string`&&Qo(e)):void 0;return{state:i,...s===void 0?{}:{strictness:s},...c===void 0||c.length===0?{}:{sharedWith:c}}}function mY(e,t){if(!fY(e))return!1;let{detected:n}=e;return Array.isArray(n)&&n.includes(t)}function hY(e,t){return e.probe.mode===`unprobeable`?`unprobeable`:pY(t,e.id)?.state??`unprobed`}function gY(e){return Ko(e)?lY[e]:lY.unprobed}function _Y(e,t){let n=e.filter(e=>{let n=Ds(e);return n===void 0?!0:!gY(hY(n,t)).counts});return n.length===e.length?n:[]}function vY(e){return gY(e).exception===`warning`}function yY(e){return e.state===`foreign`?`foreign`:e.state===`structural-na`?`structural-na`:e.installability===`not-installable`?`not-installable`:e.agentFolded?`agent-undetected`:null}function bY(e,t){let n=t?.probed===!0?mY(t,e.id):null;return{detected:n,folded:e.offerOnlyWhenDetected&&n===!1}}function xY(e,t){return(pY(t,e.id)?.sharedWith??[]).filter(t=>t!==e.agent)}var SY=es.filter(e=>e!==`session`);function CY(e){return Pte.includes(e)}function wY(e,t,n){let r=[];for(let i of e.satisfiers){if(!CY(i.kind))continue;let a=hY(i,t),o=t?.satisfiers?.[i.id]?.path,s=gY(a),c=_Y(i.prerequisites,t),l=yY({state:a,installability:i.installability,agentFolded:n});r.push({satisfierId:i.id,agentId:e.id,piece:i.piece,scope:i.scope,kind:i.kind,...i.pathId===void 0?{}:{pathId:i.pathId},...o===void 0?{}:{resolvedPath:o},audience:i.audience,state:a,checked:s.counts,exception:s.exception,folded:a===`undetected`,enabled:l===null,disabledReason:l,sharedWith:i.sharedWith,sharedFolderWith:xY(i,t),prerequisites:i.prerequisites,unmetPrerequisites:c,consentClass:i.consentClass,installability:i.installability,...i.guidance===void 0?{}:{guidance:i.guidance},...i.followup===void 0?{}:{followup:i.followup},troubleshooting:i.troubleshooting})}return r}function TY(e){let t=[];for(let n of SY){let r=e.filter(e=>e.scope===n);r.length!==0&&t.push({scope:n,cells:r})}return t}function EY(e,t,n){let{detected:r,folded:i}=bY(e,n),a=wY(e,t,i);return{agentId:e.id,detected:r,folded:i,setupDocSlug:e.setupDocSlug,scopes:TY(a)}}function DY(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`&&Qo(e)):Xo}function OY(e={}){let{agentIds:t,probes:n,detection:r}=e;return{rows:DY(t).map(e=>ws[e]).filter(e=>e!==void 0).map(e=>EY(e,n,r))}}var kY={agent:Zo},AY={"followup.enable-manually":{params:za(kY)},"guidance.mcp.user-config":{params:za(kY)},"guidance.mcp.project-config":{params:za(kY)},"guidance.mcp.session-injection":{params:za(kY)},"guidance.mcp.managed-file":{params:za(kY)},"guidance.skill.project":{params:za(kY)},"guidance.skill.user":{params:za(kY)},"guidance.skill.central-store":{params:za(kY)},"troubleshooting.claude.project-entry-not-approved":{params:za(kY)},"troubleshooting.claude-desktop.per-tool-approval":{params:za(kY)},"troubleshooting.cursor.project-entry-not-loaded":{params:za(kY)},"troubleshooting.codex.desktop-project-config":{params:za({...kY,honoredByDesktop:P()})},"troubleshooting.codex.folder-trust":{params:za(kY)},"troubleshooting.copilot.shared-workspace-config":{params:za({...kY,sourceAgent:Zo})},"troubleshooting.openclaw.central-store-missing":{params:za(kY)},"troubleshooting.pi.folder-trust":{params:za(kY)},"troubleshooting.lm-studio.config-path-mismatch":{params:za(kY)}};Object.keys(AY).sort(),Es.flatMap(e=>e.probe.mode===`probeable`?[{satisfierId:e.id,agent:e.agent,piece:e.piece,scope:e.scope,kind:e.kind,pathId:e.pathId??null,strictness:e.probe.strictness}]:[]).map(e=>e.satisfierId);var jY={verified:3,unverifiable:2,unverified:1};function MY(e,t){let n=dY[e],r=typeof t==`boolean`?t:null;return{signal:n.signal,resolved:r,show:r??n.unresolved===`show`}}function NY(e,t,n){let r=Ds(e);if(r===void 0)return{id:e,state:`absent`,counts:!1,confidence:`unverified`,exception:lY.absent.exception,consentClass:`none`,troubleshooting:[]};let i=hY(r,n),a=!Ko(i)||i===`unprobed`,o=uY[t].unprobed===`count-unverified`;return{id:e,state:i,counts:a?o:gY(i).counts,confidence:a?`unverified`:i===`unprobeable`?`unverifiable`:`verified`,exception:gY(i).exception,consentClass:r.consentClass,...r.guidance===void 0?{}:{guidance:r.guidance},...r.followup===void 0?{}:{followup:r.followup},troubleshooting:r.troubleshooting}}function PY(e,t,n){let r=e.satisfiedByAny.map(e=>NY(e,t,n));if(r.length===0)return{piece:e.piece,level:e.level,status:`nothing-required`,confidence:null,satisfiedBy:null,options:r};let i=null;for(let e of r)e.counts&&(i===null||jY[e.confidence]>jY[i.confidence])&&(i=e);return{piece:e.piece,level:e.level,status:i===null?`unmet`:`met`,confidence:i?.confidence??null,satisfiedBy:i?.id??null,options:r}}var FY=[`absent`,`structural-na`];function IY(e,t){let n=[];for(let r of cY){let i=e.satisfiers.filter(e=>e.piece===r.piece&&e.kind!==`session-injection`&&(r.scope===void 0||e.scope===r.scope));r.revokedByForeignEntry&&i.some(e=>FY.includes(hY(e,t))?!1:!LY(pY(t,e.id),r.requiredStrictness))||i.some(e=>e.probe.mode!==`probeable`||!e.probe.strictness.includes(r.requiredStrictness)||!gY(hY(e,t)).counts?!1:LY(pY(t,e.id),r.requiredStrictness))&&n.push(r.id)}return n}function LY(e,t){return e?.strictness?.includes(t)===!0}function RY(e){let{agentId:t,mode:n,probes:r,modeSignal:i}=e,a=Qo(t)?Ts(t):void 0;if(a===void 0)return{agentId:t,mode:n,verdict:`not-registered`,visibility:{...MY(n,i),show:!0},requirements:[],grantedCapabilities:[],modeCaveats:[]};let o=MY(n,i),s=a.modes[n];if(s===void 0)return{agentId:t,mode:n,verdict:`mode-not-available`,visibility:o,requirements:[],grantedCapabilities:[],modeCaveats:[]};let c=s.requirements.map(e=>PY(e,n,r)),l=c.some(e=>e.level===`required`&&e.status===`unmet`),u=c.some(e=>e.status===`unmet`);return{agentId:t,mode:n,verdict:l?`blocked`:u?`ready-with-nudges`:`ready`,visibility:o,requirements:c,grantedCapabilities:IY(a,r),modeCaveats:s.caveats}}var zY=R(Re),BY=I({kind:R([`source-read`,`measured`,`vendor-doc`,`upstream-issue`,`observation`]),ref:M().min(1),note:M().optional()}),VY=I({version:M().min(1).optional(),observedAt:M().min(1)}),HY=Ua(`confidence`,[I({confidence:z(`verified`),evidence:F(BY).min(1),verifiedAgainst:VY.optional()}),I({confidence:z(`assumed`),evidence:F(BY).min(1),verifiedAgainst:VY.optional()}),I({confidence:z(`contested`),evidence:F(BY).min(1),verifiedAgainst:VY})]),UY=I({id:Hte,params:qa(M(),Va([M(),N(),P()])).optional()}),WY=Ua(`mode`,[I({mode:z(`probeable`),strictness:F(Jo).min(1)}),I({mode:z(`unprobeable`),reason:R([`no-readable-state`,`different-machine`,`no-programmatic-path`,`session-scoped`]),note:M().optional()})]),GY=R([`this-project`,`this-user`,`this-machine`]),KY=R([`installable`,`user-completes`,`not-installable`]),qY=I({id:ns,agent:Zo,piece:$o,scope:ts,kind:Nte,pathId:Vte.optional(),sharedWith:F(Zo).default([]),prerequisites:F(ns).default([]),consentClass:Fte.default(`none`),probe:WY,attestation:HY,audience:GY,installability:KY.default(`installable`),notInstallableReason:R([`no-non-interactive-verb`,`session-scoped`,`no-surface`]).optional(),preferred:P().default(!1),guidance:UY.optional(),followup:UY.optional(),troubleshooting:F(UY).default([])}),JY=I({piece:$o,level:Lte,satisfiedByAny:F(ns)}),YY=I({acpAgentId:M().min(1),featuredOrder:N().int().nonnegative().nullable(),harnessCli:zte.nullable(),harnessReadsEditorConfig:zY.nullable(),harnessReadsEditorConfigAttestation:HY,verifiedPosture:R([`asks`,`self-managed`,`autonomous`]).nullable()}),XY=I({cliId:M().min(1)}),ZY=I({targetId:Bte,knownOrder:N().int().nonnegative(),visible:P(),displayName:M().min(1),appBrandName:M().min(1).optional(),schemes:F(M().min(1)),installUrl:M().min(1),tagline:M().min(1).optional()}),QY=I({requirements:F(JY),caveats:F(UY).default([])});I({id:Zo,setupDocSlug:M().min(1).nullable(),offerOnlyWhenDetected:P().default(!1),offersConnectionRow:P().default(!1),detectionSources:F(M().min(1)).default([]),satisfiers:F(qY),modes:Ja(Rte,QY),acp:YY.optional(),terminal:XY.optional(),external:ZY.optional()}),I({id:M().min(1),requiredStrictness:Jo,scope:ts.optional(),piece:$o,revokedByForeignEntry:P().default(!1),guidance:UY.optional()}),new gh.default;var $Y=I({path:F(Va([M(),N()])),message:M(),issueCode:M()});Ua(`code`,[I({code:z(`SCHEMA_INVALID`),issues:F($Y)}),I({code:z(`WRITE_ERROR`),detail:M()})]);function eX(e){return{path:e.path.map(e=>typeof e==`symbol`?String(e):e),message:e.message,issueCode:e.code}}function tX(e){if(e.code!==`SCHEMA_INVALID`)return{};let t={};for(let n of e.issues){let e=n.path[0];typeof e==`string`&&(t[e]=t[e]?`${t[e]}; ${n.message}`:n.message)}return t}var nX=/^---[ \t]*\r?\n---[ \t]*(\r?\n|$)/,rX=/^---([ \t]*)(?=\r?\n|$)/,iX=e=>e.includes(`\r
400
+ `,ANSWER_SESSION_LAST_MESSAGE_IS_NOT_ASSISTANT:`The last message in the session is not an assistant message. Cannot regenerate non-assistant messages.`,PLUGIN_COMPONENT_CONFLICT:`The component "%s" is already defined. The plugin "%s" is trying to redefine it.`};function rK(e,...t){let n=Error(PG(nK[e]??`Unsupported Orama Error code: ${e}`,...t));return n.code=e,`captureStackTrace`in Error.prototype&&Error.captureStackTrace(n),n}function iK(e){return{raw:Number(e),formatted:RG(e)}}function aK(e){if(e.id){if(typeof e.id!=`string`)throw rK(`DOCUMENT_ID_MUST_BE_STRING`,typeof e.id);return e.id}return BG()}function oK(e,t){for(let[n,r]of Object.entries(t)){let t=e[n];if(t!==void 0&&!(r===`geopoint`&&typeof t==`object`&&typeof t.lon==`number`&&typeof t.lat==`number`)&&!(r===`enum`&&(typeof t==`string`||typeof t==`number`))){if(r===`enum[]`&&Array.isArray(t)){let e=t.length;for(let r=0;r<e;r++)if(typeof t[r]!=`string`&&typeof t[r]!=`number`)return n+`.`+r;continue}if(uK(r)){let e=pK(r);if(!Array.isArray(t)||t.length!==e)throw rK(`INVALID_INPUT_VECTOR`,n,e,t.length);continue}if(dK(r)){if(!Array.isArray(t))return n;let e=fK(r),i=t.length;for(let r=0;r<i;r++)if(typeof t[r]!==e)return n+`.`+r;continue}if(typeof r==`object`){if(!t||typeof t!=`object`)return n;let e=oK(t,r);if(e)return n+`.`+e;continue}if(typeof t!==r)return n}}}var sK={string:!1,number:!1,boolean:!1,enum:!1,geopoint:!1,"string[]":!0,"number[]":!0,"boolean[]":!0,"enum[]":!0},cK={"string[]":`string`,"number[]":`number`,"boolean[]":`boolean`,"enum[]":`enum`};function lK(e){return e===`geopoint`}function uK(e){return typeof e==`string`&&/^vector\[\d+\]$/.test(e)}function dK(e){return typeof e==`string`&&sK[e]}function fK(e){return cK[e]}function pK(e){let t=Number(e.slice(7,-1));switch(!0){case isNaN(t):throw rK(`INVALID_VECTOR_VALUE`,e);case t<=0:throw rK(`INVALID_VECTOR_SIZE`,e);default:return t}}function mK(){return{idToInternalId:new Map,internalIdToId:[],save:hK,load:gK}}function hK(e){return{internalIdToId:e.internalIdToId}}function gK(e,t){let{internalIdToId:n}=t;e.internalDocumentIDStore.idToInternalId.clear(),e.internalDocumentIDStore.internalIdToId=[];let r=n.length;for(let t=0;t<r;t++){let r=n[t];e.internalDocumentIDStore.idToInternalId.set(r,t+1),e.internalDocumentIDStore.internalIdToId.push(r)}}function _K(e,t){if(typeof t==`string`){let n=e.idToInternalId.get(t);if(n)return n;let r=e.idToInternalId.size+1;return e.idToInternalId.set(t,r),e.internalIdToId.push(t),r}return t>e.internalIdToId.length?_K(e,t.toString()):t}function vK(e,t){if(e.internalIdToId.length<t)throw Error(`Invalid internalId ${t}`);return e.internalIdToId[t-1]}function yK(e,t){return{sharedInternalDocumentStore:t,docs:{},count:0}}function bK(e,t){let n=_K(e.sharedInternalDocumentStore,t);return e.docs[n]}function xK(e,t){let n=t.length,r=Array.from({length:n});for(let i=0;i<n;i++){let n=_K(e.sharedInternalDocumentStore,t[i]);r[i]=e.docs[n]}return r}function SK(e){return e.docs}function CK(e,t,n,r){return e.docs[n]===void 0?(e.docs[n]=r,e.count++,!0):!1}function wK(e,t){let n=_K(e.sharedInternalDocumentStore,t);return e.docs[n]===void 0?!1:(delete e.docs[n],e.count--,!0)}function TK(e){return e.count}function EK(e,t){let n=t;return{docs:n.docs,count:n.count,sharedInternalDocumentStore:e}}function DK(e){return{docs:e.docs,count:e.count}}function OK(){return{create:yK,get:bK,getMultiple:xK,getAll:SK,store:CK,remove:wK,count:TK,load:EK,save:DK}}var kK=[`beforeInsert`,`afterInsert`,`beforeRemove`,`afterRemove`,`beforeUpdate`,`afterUpdate`,`beforeUpsert`,`afterUpsert`,`beforeSearch`,`afterSearch`,`beforeInsertMultiple`,`afterInsertMultiple`,`beforeRemoveMultiple`,`afterRemoveMultiple`,`beforeUpdateMultiple`,`afterUpdateMultiple`,`beforeUpsertMultiple`,`afterUpsertMultiple`,`beforeLoad`,`afterLoad`,`afterCreate`];function AK(e,t){let n=[],r=e.plugins?.length;if(!r)return n;for(let i=0;i<r;i++)try{let r=e.plugins[i];typeof r[t]==`function`&&n.push(r[t])}catch(e){throw console.error(`Caught error in getAllPluginsByHook:`,e),rK(`PLUGIN_CRASHED`)}return n}var jK=[`tokenizer`,`index`,`documentsStore`,`sorter`,`pinning`],MK=[`validateSchema`,`getDocumentIndexId`,`getDocumentProperties`,`formatElapsedTime`];function NK(e,t,n,r){if(e.some(YG))return(async()=>{for(let i of e)await i(t,n,r)})();for(let i of e)i(t,n,r)}function PK(e,t,n){if(e.some(YG))return(async()=>{for(let r of e)await r(t,n)})();for(let r of e)r(t,n)}function FK(e,t,n,r,i){if(e.some(YG))return(async()=>{for(let a of e)await a(t,n,r,i)})();for(let a of e)a(t,n,r,i)}function IK(e,t,n,r){if(e.some(YG))return(async()=>{for(let i of e)await i(t,n,r)})();for(let i of e)i(t,n,r)}function LK(e,t){if(e.some(YG))return(async()=>{for(let n of e)await n(t)})();for(let n of e)n(t)}var RK=class e{k;v;l=null;r=null;h=1;constructor(e,t){this.k=e,this.v=new Set(t)}updateHeight(){this.h=Math.max(e.getHeight(this.l),e.getHeight(this.r))+1}static getHeight(e){return e?e.h:0}getBalanceFactor(){return e.getHeight(this.l)-e.getHeight(this.r)}rotateLeft(){let e=this.r;return this.r=e.l,e.l=this,this.updateHeight(),e.updateHeight(),e}rotateRight(){let e=this.l;return this.l=e.r,e.r=this,this.updateHeight(),e.updateHeight(),e}toJSON(){return{k:this.k,v:Array.from(this.v),l:this.l?this.l.toJSON():null,r:this.r?this.r.toJSON():null,h:this.h}}static fromJSON(t){let n=new e(t.k,t.v);return n.l=t.l?e.fromJSON(t.l):null,n.r=t.r?e.fromJSON(t.r):null,n.h=t.h,n}},zK=class e{root=null;insertCount=0;constructor(e,t){e!==void 0&&t!==void 0&&(this.root=new RK(e,t))}insert(e,t,n=1e3){this.root=this.insertNode(this.root,e,t,n)}insertMultiple(e,t,n=1e3){for(let r of t)this.insert(e,r,n)}rebalance(){this.root&&=this.rebalanceNode(this.root)}toJSON(){return{root:this.root?this.root.toJSON():null,insertCount:this.insertCount}}static fromJSON(t){let n=new e;return n.root=t.root?RK.fromJSON(t.root):null,n.insertCount=t.insertCount||0,n}insertNode(e,t,n,r){if(e===null)return new RK(t,[n]);let i=[],a=e,o=null;for(;a!==null;)if(i.push({parent:o,node:a}),t<a.k)if(a.l===null){a.l=new RK(t,[n]),i.push({parent:a,node:a.l});break}else o=a,a=a.l;else if(t>a.k)if(a.r===null){a.r=new RK(t,[n]),i.push({parent:a,node:a.r});break}else o=a,a=a.r;else return a.v.add(n),e;let s=!1;this.insertCount++%r===0&&(s=!0);for(let t=i.length-1;t>=0;t--){let{parent:n,node:r}=i[t];if(r.updateHeight(),s){let t=this.rebalanceNode(r);n?n.l===r?n.l=t:n.r===r&&(n.r=t):e=t}}return e}rebalanceNode(e){let t=e.getBalanceFactor();if(t>1){if(e.l&&e.l.getBalanceFactor()>=0)return e.rotateRight();if(e.l)return e.l=e.l.rotateLeft(),e.rotateRight()}if(t<-1){if(e.r&&e.r.getBalanceFactor()<=0)return e.rotateLeft();if(e.r)return e.r=e.r.rotateRight(),e.rotateLeft()}return e}find(e){let t=this.findNodeByKey(e);return t?t.v:null}contains(e){return this.find(e)!==null}getSize(){let e=0,t=[],n=this.root;for(;n||t.length>0;){for(;n;)t.push(n),n=n.l;n=t.pop(),e++,n=n.r}return e}isBalanced(){if(!this.root)return!0;let e=[this.root];for(;e.length>0;){let t=e.pop(),n=t.getBalanceFactor();if(Math.abs(n)>1)return!1;t.l&&e.push(t.l),t.r&&e.push(t.r)}return!0}remove(e){this.root=this.removeNode(this.root,e)}removeDocument(e,t){let n=this.findNodeByKey(e);n&&(n.v.size===1?this.root=this.removeNode(this.root,e):n.v=new Set([...n.v.values()].filter(e=>e!==t)))}findNodeByKey(e){let t=this.root;for(;t;)if(e<t.k)t=t.l;else if(e>t.k)t=t.r;else return t;return null}removeNode(e,t){if(e===null)return null;let n=[],r=e;for(;r!==null&&r.k!==t;)n.push(r),r=t<r.k?r.l:r.r;if(r===null)return e;if(r.l===null||r.r===null){let t=r.l?r.l:r.r;if(n.length===0)e=t;else{let e=n[n.length-1];e.l===r?e.l=t:e.r=t}}else{let e=r,t=r.r;for(;t.l!==null;)e=t,t=t.l;r.k=t.k,r.v=t.v,e.l===t?e.l=t.r:e.r=t.r,r=e}n.push(r);for(let t=n.length-1;t>=0;t--){let r=n[t];r.updateHeight();let i=this.rebalanceNode(r);if(t>0){let e=n[t-1];e.l===r?e.l=i:e.r===r&&(e.r=i)}else e=i}return e}rangeSearch(e,t){let n=new Set,r=[],i=this.root;for(;i||r.length>0;){for(;i;)r.push(i),i=i.l;if(i=r.pop(),i.k>=e&&i.k<=t)for(let e of i.v)n.add(e);if(i.k>t)break;i=i.r}return n}greaterThan(e,t=!1){let n=new Set,r=[],i=this.root;for(;i||r.length>0;){for(;i;)r.push(i),i=i.r;if(i=r.pop(),t&&i.k>=e||!t&&i.k>e)for(let e of i.v)n.add(e);else if(i.k<=e)break;i=i.l}return n}lessThan(e,t=!1){let n=new Set,r=[],i=this.root;for(;i||r.length>0;){for(;i;)r.push(i),i=i.l;if(i=r.pop(),t&&i.k<=e||!t&&i.k<e)for(let e of i.v)n.add(e);else if(i.k>e)break;i=i.r}return n}},BK=class e{numberToDocumentId;constructor(){this.numberToDocumentId=new Map}insert(e,t){this.numberToDocumentId.has(e)?this.numberToDocumentId.get(e).add(t):this.numberToDocumentId.set(e,new Set([t]))}find(e){let t=this.numberToDocumentId.get(e);return t?Array.from(t):null}remove(e){this.numberToDocumentId.delete(e)}removeDocument(e,t){let n=this.numberToDocumentId.get(t);n&&(n.delete(e),n.size===0&&this.numberToDocumentId.delete(t))}contains(e){return this.numberToDocumentId.has(e)}getSize(){let e=0;for(let t of this.numberToDocumentId.values())e+=t.size;return e}filter(e){let t=Object.keys(e);if(t.length!==1)throw Error(`Invalid operation`);let n=t[0];switch(n){case`eq`:{let t=e[n],r=this.numberToDocumentId.get(t);return r?Array.from(r):[]}case`in`:{let t=e[n],r=new Set;for(let e of t){let t=this.numberToDocumentId.get(e);if(t)for(let e of t)r.add(e)}return Array.from(r)}case`nin`:{let t=new Set(e[n]),r=new Set;for(let[e,n]of this.numberToDocumentId.entries())if(!t.has(e))for(let e of n)r.add(e);return Array.from(r)}default:throw Error(`Invalid operation`)}}filterArr(e){let t=Object.keys(e);if(t.length!==1)throw Error(`Invalid operation`);let n=t[0];switch(n){case`containsAll`:{let t=e[n].map(e=>this.numberToDocumentId.get(e)??new Set);if(t.length===0)return[];let r=t.reduce((e,t)=>new Set([...e].filter(e=>t.has(e))));return Array.from(r)}case`containsAny`:{let t=e[n].map(e=>this.numberToDocumentId.get(e)??new Set);if(t.length===0)return[];let r=t.reduce((e,t)=>new Set([...e,...t]));return Array.from(r)}default:throw Error(`Invalid operation`)}}static fromJSON(t){if(!t.numberToDocumentId)throw Error(`Invalid Flat Tree JSON`);let n=new e;for(let[e,r]of t.numberToDocumentId)n.numberToDocumentId.set(e,new Set(r));return n}toJSON(){return{numberToDocumentId:Array.from(this.numberToDocumentId.entries()).map(([e,t])=>[e,Array.from(t)])}}};function VK(e,t,n){if(n<0)return-1;if(e===t)return 0;let r=e.length,i=t.length;if(r===0)return i<=n?i:-1;if(i===0)return r<=n?r:-1;let a=Math.abs(r-i);if(e.startsWith(t))return a<=n?a:-1;if(t.startsWith(e))return 0;if(a>n)return-1;let o=[];for(let e=0;e<=r;e++){o[e]=[e];for(let t=1;t<=i;t++)o[e][t]=e===0?t:0}for(let a=1;a<=r;a++){let r=1/0;for(let n=1;n<=i;n++)e[a-1]===t[n-1]?o[a][n]=o[a-1][n-1]:o[a][n]=Math.min(o[a-1][n]+1,o[a][n-1]+1,o[a-1][n-1]+1),r=Math.min(r,o[a][n]);if(r>n)return-1}return o[r][i]<=n?o[r][i]:-1}function HK(e,t,n){let r=VK(e,t,n);return{distance:r,isBounded:r>=0}}var UK=class e{k;s;c=new Map;d=new Set;e;w=``;constructor(e,t,n){this.k=e,this.s=t,this.e=n}updateParent(e){this.w=e.w+this.s}addDocument(e){this.d.add(e)}removeDocument(e){return this.d.delete(e)}findAllWords(e,t,n,r){let i=[this];for(;i.length>0;){let a=i.pop();if(a.e){let{w:i,d:o}=a;if(n&&i!==t)continue;if(VG(e,i)!==null)if(r)if(Math.abs(t.length-i.length)<=r&&HK(t,i,r).isBounded)e[i]=[];else continue;else e[i]=[];if(VG(e,i)!=null&&o.size>0){let t=e[i];for(let e of o)t.includes(e)||t.push(e)}}a.c.size>0&&i.push(...a.c.values())}return e}insert(t,n){let r=this,i=0,a=t.length;for(;i<a;){let o=t[i],s=r.c.get(o);if(s){let o=s.s,c=o.length,l=0;for(;l<c&&i+l<a&&o[l]===t[i+l];)l++;if(l===c){if(r=s,i+=l,i===a){s.e||=!0,s.addDocument(n);return}continue}let u=o.slice(0,l),d=o.slice(l),f=t.slice(i+l),p=new e(u[0],u,!1);if(r.c.set(u[0],p),p.updateParent(r),s.s=d,s.k=d[0],p.c.set(d[0],s),s.updateParent(p),f){let t=new e(f[0],f,!0);t.addDocument(n),p.c.set(f[0],t),t.updateParent(p)}else p.e=!0,p.addDocument(n);return}else{let a=new e(o,t.slice(i),!0);a.addDocument(n),r.c.set(o,a),a.updateParent(r);return}}r.e||=!0,r.addDocument(n)}_findLevenshtein(e,t,n,r,i){let a=[{node:this,index:t,tolerance:n}];for(;a.length>0;){let{node:t,index:n,tolerance:o}=a.pop();if(t.w.startsWith(e)){t.findAllWords(i,e,!1,0);continue}if(o<0)continue;if(t.e){let{w:n,d:a}=t;if(n&&(HK(e,n,r).isBounded&&(i[n]=[]),VG(i,n)!==void 0&&a.size>0)){let e=new Set(i[n]);for(let t of a)e.add(t);i[n]=Array.from(e)}}if(n>=e.length)continue;let s=e[n];if(t.c.has(s)){let e=t.c.get(s);a.push({node:e,index:n+1,tolerance:o})}a.push({node:t,index:n+1,tolerance:o-1});for(let[e,r]of t.c)a.push({node:r,index:n,tolerance:o-1}),e!==s&&a.push({node:r,index:n+1,tolerance:o-1})}}find(e){let{term:t,exact:n,tolerance:r}=e;if(r&&!n){let e={};return this._findLevenshtein(t,0,r,r,e),e}else{let e=this,i=0,a=t.length;for(;i<a;){let o=t[i],s=e.c.get(o);if(s){let o=s.s,c=o.length,l=0;for(;l<c&&i+l<a&&o[l]===t[i+l];)l++;if(l===c)e=s,i+=l;else if(i+l===a)if(l===a-i){if(n)return{};{let e={};return s.findAllWords(e,t,n,r),e}}else return{};else return{}}else return{}}let o={};return e.findAllWords(o,t,n,r),o}}contains(e){let t=this,n=0,r=e.length;for(;n<r;){let i=e[n],a=t.c.get(i);if(a){let i=a.s,o=i.length,s=0;for(;s<o&&n+s<r&&i[s]===e[n+s];)s++;if(s<o)return!1;n+=o,t=a}else return!1}return!0}removeWord(e){if(!e)return!1;let t=this,n=e.length,r=[];for(let i=0;i<n;i++){let n=e[i];if(t.c.has(n)){let e=t.c.get(n);r.push({parent:t,character:n}),i+=e.s.length-1,t=e}else return!1}for(t.d.clear(),t.e=!1;r.length>0&&t.c.size===0&&!t.e&&t.d.size===0;){let{parent:e,character:n}=r.pop();e.c.delete(n),t=e}return!0}removeDocumentByWord(e,t,n=!0){if(!e)return!0;let r=this,i=e.length;for(let a=0;a<i;a++){let i=e[a];if(r.c.has(i)){let o=r.c.get(i);a+=o.s.length-1,r=o,n&&r.w!==e||r.removeDocument(t)}else return!1}return!0}static getCommonPrefix(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e.charCodeAt(r)===t.charCodeAt(r);)r++;return e.slice(0,r)}toJSON(){return{w:this.w,s:this.s,e:this.e,k:this.k,d:Array.from(this.d),c:Array.from(this.c?.entries())?.map(([e,t])=>[e,t.toJSON()])}}static fromJSON(t){let n=new e(t.k,t.s,t.e);return n.w=t.w,n.d=new Set(t.d),n.c=new Map(t?.c?.map(([t,n])=>[t,e.fromJSON(n)])||[]),n}},WK=class e extends UK{constructor(){super(``,``,!1)}static fromJSON(t){let n=new e;return n.w=t.w,n.s=t.s,n.e=t.e,n.k=t.k,n.d=new Set(t.d),n.c=new Map(t?.c?.map(([e,t])=>[e,UK.fromJSON(t)])||[]),n}toJSON(){return super.toJSON()}},GK=2,KK=6371e3,qK=class e{point;docIDs;left;right;parent;constructor(e,t){this.point=e,this.docIDs=new Set(t),this.left=null,this.right=null,this.parent=null}toJSON(){return{point:this.point,docIDs:Array.from(this.docIDs),left:this.left?this.left.toJSON():null,right:this.right?this.right.toJSON():null}}static fromJSON(t,n=null){let r=new e(t.point,t.docIDs);return r.parent=n,t.left&&(r.left=e.fromJSON(t.left,r)),t.right&&(r.right=e.fromJSON(t.right,r)),r}},JK=class e{root;nodeMap;constructor(){this.root=null,this.nodeMap=new Map}getPointKey(e){return`${e.lon},${e.lat}`}insert(e,t){let n=this.getPointKey(e),r=this.nodeMap.get(n);if(r){t.forEach(e=>r.docIDs.add(e));return}let i=new qK(e,t);if(this.nodeMap.set(n,i),this.root==null){this.root=i;return}let a=this.root,o=0;for(;;){if(o%GK===0)if(e.lon<a.point.lon){if(a.left==null){a.left=i,i.parent=a;return}a=a.left}else{if(a.right==null){a.right=i,i.parent=a;return}a=a.right}else if(e.lat<a.point.lat){if(a.left==null){a.left=i,i.parent=a;return}a=a.left}else{if(a.right==null){a.right=i,i.parent=a;return}a=a.right}o++}}contains(e){let t=this.getPointKey(e);return this.nodeMap.has(t)}getDocIDsByCoordinates(e){let t=this.getPointKey(e),n=this.nodeMap.get(t);return n?Array.from(n.docIDs):null}removeDocByID(e,t){let n=this.getPointKey(e),r=this.nodeMap.get(n);r&&(r.docIDs.delete(t),r.docIDs.size===0&&(this.nodeMap.delete(n),this.deleteNode(r)))}deleteNode(e){let t=e.parent,n=e.left?e.left:e.right;n&&(n.parent=t),t?t.left===e?t.left=n:t.right===e&&(t.right=n):(this.root=n,this.root&&(this.root.parent=null))}searchByRadius(t,n,r=!0,i=`asc`,a=!1){let o=a?e.vincentyDistance:e.haversineDistance,s=[{node:this.root,depth:0}],c=[];for(;s.length>0;){let{node:e,depth:i}=s.pop();if(e==null)continue;let a=o(t,e.point);(r?a<=n:a>n)&&c.push({point:e.point,docIDs:Array.from(e.docIDs)}),e.left!=null&&s.push({node:e.left,depth:i+1}),e.right!=null&&s.push({node:e.right,depth:i+1})}return i&&c.sort((e,n)=>{let r=o(t,e.point),a=o(t,n.point);return i.toLowerCase()===`asc`?r-a:a-r}),c}searchByPolygon(t,n=!0,r=null,i=!1){let a=[{node:this.root,depth:0}],o=[];for(;a.length>0;){let{node:r,depth:i}=a.pop();if(r==null)continue;r.left!=null&&a.push({node:r.left,depth:i+1}),r.right!=null&&a.push({node:r.right,depth:i+1});let s=e.isPointInPolygon(t,r.point);(s&&n||!s&&!n)&&o.push({point:r.point,docIDs:Array.from(r.docIDs)})}let s=e.calculatePolygonCentroid(t);if(r){let t=i?e.vincentyDistance:e.haversineDistance;o.sort((e,n)=>{let i=t(s,e.point),a=t(s,n.point);return r.toLowerCase()===`asc`?i-a:a-i})}return o}toJSON(){return{root:this.root?this.root.toJSON():null}}static fromJSON(t){let n=new e;return t.root&&(n.root=qK.fromJSON(t.root),n.buildNodeMap(n.root)),n}buildNodeMap(e){if(e==null)return;let t=this.getPointKey(e.point);this.nodeMap.set(t,e),e.left&&this.buildNodeMap(e.left),e.right&&this.buildNodeMap(e.right)}static calculatePolygonCentroid(e){let t=0,n=0,r=0,i=e.length;for(let a=0,o=i-1;a<i;o=a++){let i=e[a].lon,s=e[a].lat,c=e[o].lon,l=e[o].lat,u=i*l-c*s;t+=u,n+=(i+c)*u,r+=(s+l)*u}t/=2;let a=6*t;return n/=a,r/=a,{lon:n,lat:r}}static isPointInPolygon(e,t){let n=!1,r=t.lon,i=t.lat,a=e.length;for(let t=0,o=a-1;t<a;o=t++){let a=e[t].lon,s=e[t].lat,c=e[o].lon,l=e[o].lat;s>i!=l>i&&r<(c-a)*(i-s)/(l-s)+a&&(n=!n)}return n}static haversineDistance(e,t){let n=Math.PI/180,r=e.lat*n,i=t.lat*n,a=(t.lat-e.lat)*n,o=(t.lon-e.lon)*n,s=Math.sin(a/2)*Math.sin(a/2)+Math.cos(r)*Math.cos(i)*Math.sin(o/2)*Math.sin(o/2);return KK*(2*Math.atan2(Math.sqrt(s),Math.sqrt(1-s)))}static vincentyDistance(e,t){let n=6378137,r=1/298.257223563,i=(1-r)*n,a=Math.PI/180,o=e.lat*a,s=t.lat*a,c=(t.lon-e.lon)*a,l=Math.atan((1-r)*Math.tan(o)),u=Math.atan((1-r)*Math.tan(s)),d=Math.sin(l),f=Math.cos(l),p=Math.sin(u),m=Math.cos(u),h=c,g,_=1e3,v,y,b,x,S,C;do{let e=Math.sin(h),t=Math.cos(h);if(v=Math.sqrt(m*e*(m*e)+(f*p-d*m*t)*(f*p-d*m*t)),v===0)return 0;y=d*p+f*m*t,b=Math.atan2(v,y),x=f*m*e/v,S=1-x*x,C=y-2*d*p/S,isNaN(C)&&(C=0);let n=r/16*S*(4+r*(4-3*S));g=h,h=c+(1-n)*r*x*(b+n*v*(C+n*y*(-1+2*C*C)))}while(Math.abs(h-g)>1e-12&&--_>0);if(_===0)return NaN;let w=S*(n*n-i*i)/(i*i),ee=1+w/16384*(4096+w*(-768+w*(320-175*w))),T=w/1024*(256+w*(-128+w*(74-47*w))),E=T*v*(C+T/4*(y*(-1+2*C*C)-T/6*C*(-3+4*v*v)*(-3+4*C*C)));return i*ee*(b-E)}},YK=class e{true;false;constructor(){this.true=new Set,this.false=new Set}insert(e,t){t?this.true.add(e):this.false.add(e)}delete(e,t){t?this.true.delete(e):this.false.delete(e)}getSize(){return this.true.size+this.false.size}toJSON(){return{true:Array.from(this.true),false:Array.from(this.false)}}static fromJSON(t){let n=new e;return n.true=new Set(t.true),n.false=new Set(t.false),n}};function XK(e,t,n,r,i,{k:a,b:o,d:s}){return Math.log(1+(n-t+.5)/(t+.5))*(s+e*(a+1))/(e+a*(1-o+o*r/i))}var ZK=class e{size;vectors=new Map;constructor(e){this.size=e}add(e,t){t instanceof Float32Array||(t=new Float32Array(t));let n=QK(t,this.size);this.vectors.set(e,[n,t])}remove(e){this.vectors.delete(e)}find(e,t,n){return e instanceof Float32Array||(e=new Float32Array(e)),$K(e,n,this.vectors,this.size,t)}toJSON(){let e=[];for(let[t,[n,r]]of this.vectors)e.push([t,[n,Array.from(r)]]);return{size:this.size,vectors:e}}static fromJSON(t){let n=t,r=new e(n.size);for(let[e,[t,i]]of n.vectors)r.vectors.set(e,[t,new Float32Array(i)]);return r}};function QK(e,t){let n=0;for(let r=0;r<t;r++)n+=e[r]*e[r];return Math.sqrt(n)}function $K(e,t,n,r,i){let a=QK(e,r),o=[],s=t||n.keys();for(let t of s){let s=n.get(t);if(!s)continue;let c=s[0],l=s[1],u=0;for(let t=0;t<r;t++)u+=e[t]*l[t];let d=u/(a*c);d>=i&&o.push([t,d])}return o}function eq(e,t,n,r,i){let a=_K(e.sharedInternalDocumentStore,n);e.avgFieldLength[t]=((e.avgFieldLength[t]??0)*(i-1)+r.length)/i,e.fieldLengths[t][a]=r.length,e.frequencies[t][a]={}}function tq(e,t,n,r,i){let a=0;for(let e of r)e===i&&a++;let o=_K(e.sharedInternalDocumentStore,n),s=a/r.length;e.frequencies[t][o][i]=s,i in e.tokenOccurrences[t]||(e.tokenOccurrences[t][i]=0),e.tokenOccurrences[t][i]=(e.tokenOccurrences[t][i]??0)+1}function nq(e,t,n,r){let i=_K(e.sharedInternalDocumentStore,n);r>1?e.avgFieldLength[t]=(e.avgFieldLength[t]*r-e.fieldLengths[t][i])/(r-1):e.avgFieldLength[t]=void 0,e.fieldLengths[t][i]=void 0,e.frequencies[t][i]=void 0}function rq(e,t,n){e.tokenOccurrences[t][n]--}function iq(e,t,n,r,i=``){r||={sharedInternalDocumentStore:t,indexes:{},vectorIndexes:{},searchableProperties:[],searchablePropertiesWithTypes:{},frequencies:{},tokenOccurrences:{},avgFieldLength:{},fieldLengths:{}};for(let[a,o]of Object.entries(n)){let n=`${i}${i?`.`:``}${a}`;if(typeof o==`object`&&!Array.isArray(o)){iq(e,t,o,r,n);continue}if(uK(o))r.searchableProperties.push(n),r.searchablePropertiesWithTypes[n]=o,r.vectorIndexes[n]={type:`Vector`,node:new ZK(pK(o)),isArray:!1};else{let e=/\[/.test(o);switch(o){case`boolean`:case`boolean[]`:r.indexes[n]={type:`Bool`,node:new YK,isArray:e};break;case`number`:case`number[]`:r.indexes[n]={type:`AVL`,node:new zK(0,[]),isArray:e};break;case`string`:case`string[]`:r.indexes[n]={type:`Radix`,node:new WK,isArray:e},r.avgFieldLength[n]=0,r.frequencies[n]={},r.tokenOccurrences[n]={},r.fieldLengths[n]={};break;case`enum`:case`enum[]`:r.indexes[n]={type:`Flat`,node:new BK,isArray:e};break;case`geopoint`:r.indexes[n]={type:`BKD`,node:new JK,isArray:e};break;default:throw rK(`INVALID_SCHEMA_TYPE`,Array.isArray(o)?`array`:o,n)}r.searchableProperties.push(n),r.searchablePropertiesWithTypes[n]=o}}return r}function aq(e,t,n,r,i,a,o,s){return c=>{let{type:l,node:u}=t.indexes[n];switch(l){case`Bool`:u[c?`true`:`false`].add(r);break;case`AVL`:{let e=s?.avlRebalanceThreshold??1;u.insert(c,r,e);break}case`Radix`:{let s=a.tokenize(c,i,n,!1);e.insertDocumentScoreParameters(t,n,r,s,o);for(let i of s)e.insertTokenScoreParameters(t,n,r,s,i),u.insert(i,r);break}case`Flat`:u.insert(c,r);break;case`BKD`:u.insert(c,[r]);break}}}function oq(e,t,n,r,i,a,o,s,c,l,u){if(uK(o))return sq(t,n,a,r,i);let d=aq(e,t,n,i,s,c,l,u);if(!dK(o))return d(a);let f=a,p=f.length;for(let e=0;e<p;e++)d(f[e])}function sq(e,t,n,r,i){e.vectorIndexes[t].node.add(i,n)}function cq(e,t,n,r,i,a,o,s,c,l){if(uK(o))return t.vectorIndexes[n].node.remove(i),!0;let{type:u,node:d}=t.indexes[n];switch(u){case`AVL`:return d.removeDocument(a,i),!0;case`Bool`:return d[a?`true`:`false`].delete(i),!0;case`Radix`:{let o=c.tokenize(a,s,n);e.removeDocumentScoreParameters(t,n,r,l);for(let r of o)e.removeTokenScoreParameters(t,n,r),d.removeDocumentByWord(r,i);return!0}case`Flat`:return d.removeDocument(i,a),!0;case`BKD`:return d.removeDocByID(a,i),!1}}function lq(e,t,n,r,i,a,o,s,c,l){if(!dK(o))return cq(e,t,n,r,i,a,o,s,c,l);let u=fK(o),d=a,f=d.length;for(let a=0;a<f;a++)cq(e,t,n,r,i,d[a],u,s,c,l);return!0}function uq(e,t,n,r,i,a,o,s,c,l){let u=Array.from(r),d=e.avgFieldLength[t],f=e.fieldLengths[t],p=e.tokenOccurrences[t],m=e.frequencies[t],h=typeof p[n]==`number`?p[n]??0:0,g=u.length;for(let e=0;e<g;e++){let r=u[e];if(c&&!c.has(r))continue;l.has(r)||l.set(r,new Map);let p=l.get(r);p.set(t,(p.get(t)||0)+1);let g=XK(m?.[r]?.[n]??0,h,i,f[r],d,a);o.has(r)?o.set(r,o.get(r)+g*s):o.set(r,g*s)}}function dq(e,t,n,r,i,a,o,s,c,l,u,d=0){let f=n.tokenize(t,r),p=f.length||1,m=new Map,h=new Map,g=new Map;for(let n of i){if(!(n in e.indexes))continue;let r=e.indexes[n],{type:i}=r;if(i!==`Radix`)throw rK(`WRONG_SEARCH_PROPERTY_TYPE`,n);let d=s[n]??1;if(d<=0)throw rK(`INVALID_BOOST_VALUE`,d);f.length===0&&!t&&f.push(``);let p=f.length;for(let t=0;t<p;t++){let i=f[t],s=r.node.find({term:i,exact:a,tolerance:o}),p=Object.keys(s);p.length>0&&h.set(i,!0);let _=p.length;for(let t=0;t<_;t++){let r=p[t],i=s[r];uq(e,n,r,i,l,c,g,d,u,m)}}}let _=Array.from(g.entries()).map(([e,t])=>[e,t]).sort((e,t)=>t[1]-e[1]);if(_.length===0)return[];if(d===1)return _;if(d===0){if(p===1)return _;for(let e of f)if(!h.get(e))return[];return _.filter(([e])=>{let t=m.get(e);return t?Array.from(t.values()).some(e=>e===p):!1})}let v=_.filter(([e])=>{let t=m.get(e);return t?Array.from(t.values()).some(e=>e===p):!1});if(v.length>0){let e=_.filter(([e])=>!v.some(([t])=>t===e)),t=Math.ceil(e.length*d);return[...v,...e.slice(0,t)]}return _}function fq(e,t,n,r){if(`and`in n&&n.and&&Array.isArray(n.and)){let i=n.and;return i.length===0?new Set:ZG(...i.map(n=>fq(e,t,n,r)))}if(`or`in n&&n.or&&Array.isArray(n.or)){let i=n.or;return i.length===0?new Set:i.map(n=>fq(e,t,n,r)).reduce((e,t)=>$G(e,t),new Set)}if(`not`in n&&n.not){let i=n.not,a=new Set,o=e.sharedInternalDocumentStore;for(let e=1;e<=o.internalIdToId.length;e++)a.add(e);return eK(a,fq(e,t,i,r))}let i=Object.keys(n),a=i.reduce((e,t)=>({[t]:new Set,...e}),{});for(let o of i){let i=n[o];if(e.indexes[o]===void 0)throw rK(`UNKNOWN_FILTER_PROPERTY`,o);let{node:s,type:c,isArray:l}=e.indexes[o];if(c===`Bool`){let e=s,t=i?e.true:e.false;a[o]=$G(a[o],t);continue}if(c===`BKD`){let e;if(`radius`in i)e=`radius`;else if(`polygon`in i)e=`polygon`;else throw Error(`Invalid operation ${i}`);if(e===`radius`){let{value:t,coordinates:n,unit:r=`m`,inside:c=!0,highPrecision:l=!1}=i[e],u=qG(t,r),d=s.searchByRadius(n,u,c,void 0,l);a[o]=vq(a[o],d)}else{let{coordinates:t,inside:n=!0,highPrecision:r=!1}=i[e],c=s.searchByPolygon(t,n,void 0,r);a[o]=vq(a[o],c)}continue}if(c===`Radix`&&(typeof i==`string`||Array.isArray(i))){for(let e of[i].flat()){let n=t.tokenize(e,r,o);for(let e of n){let t=s.find({term:e,exact:!0});a[o]=Sq(a[o],t)}}continue}let u=Object.keys(i);if(u.length>1)throw rK(`INVALID_FILTER_OPERATION`,u.length);if(c===`Flat`){let e=new Set(l?s.filterArr(i):s.filter(i));a[o]=$G(a[o],e);continue}if(c===`AVL`){let e=u[0],t=i[e],n;switch(e){case`gt`:n=s.greaterThan(t,!1);break;case`gte`:n=s.greaterThan(t,!0);break;case`lt`:n=s.lessThan(t,!1);break;case`lte`:n=s.lessThan(t,!0);break;case`eq`:n=s.find(t)??new Set;break;case`between`:{let[e,r]=t;n=s.rangeSearch(e,r);break}default:throw rK(`INVALID_FILTER_OPERATION`,e)}a[o]=$G(a[o],n)}}return ZG(...Object.values(a))}function pq(e){return e.searchableProperties}function mq(e){return e.searchablePropertiesWithTypes}function hq(e,t){let{indexes:n,vectorIndexes:r,searchableProperties:i,searchablePropertiesWithTypes:a,frequencies:o,tokenOccurrences:s,avgFieldLength:c,fieldLengths:l}=t,u={},d={};for(let e of Object.keys(n)){let{node:t,type:r,isArray:i}=n[e];switch(r){case`Radix`:u[e]={type:`Radix`,node:WK.fromJSON(t),isArray:i};break;case`Flat`:u[e]={type:`Flat`,node:BK.fromJSON(t),isArray:i};break;case`AVL`:u[e]={type:`AVL`,node:zK.fromJSON(t),isArray:i};break;case`BKD`:u[e]={type:`BKD`,node:JK.fromJSON(t),isArray:i};break;case`Bool`:u[e]={type:`Bool`,node:YK.fromJSON(t),isArray:i};break;default:u[e]=n[e]}}for(let e of Object.keys(r))d[e]={type:`Vector`,isArray:!1,node:ZK.fromJSON(r[e])};return{sharedInternalDocumentStore:e,indexes:u,vectorIndexes:d,searchableProperties:i,searchablePropertiesWithTypes:a,frequencies:o,tokenOccurrences:s,avgFieldLength:c,fieldLengths:l}}function gq(e){let{indexes:t,vectorIndexes:n,searchableProperties:r,searchablePropertiesWithTypes:i,frequencies:a,tokenOccurrences:o,avgFieldLength:s,fieldLengths:c}=e,l={};for(let e of Object.keys(n))l[e]=n[e].node.toJSON();let u={};for(let e of Object.keys(t)){let{type:n,node:r,isArray:i}=t[e];n===`Flat`||n===`Radix`||n===`AVL`||n===`BKD`||n===`Bool`?u[e]={type:n,node:r.toJSON(),isArray:i}:(u[e]=t[e],u[e].node=u[e].node.toJSON())}return{indexes:u,vectorIndexes:l,searchableProperties:r,searchablePropertiesWithTypes:i,frequencies:a,tokenOccurrences:o,avgFieldLength:s,fieldLengths:c}}function _q(){return{create:iq,insert:oq,remove:lq,insertDocumentScoreParameters:eq,insertTokenScoreParameters:tq,removeDocumentScoreParameters:nq,removeTokenScoreParameters:rq,calculateResultScores:uq,search:dq,searchByWhereClause:fq,getSearchableProperties:pq,getSearchablePropertiesWithTypes:mq,load:hq,save:gq}}function vq(e,t){e||=new Set;let n=t.length;for(let r=0;r<n;r++){let n=t[r].docIDs,i=n.length;for(let t=0;t<i;t++)e.add(n[t])}return e}function yq(e,t,n=!1){let r=n?JK.vincentyDistance:JK.haversineDistance,i=[],a=[];for(let{point:n}of e)a.push(r(t,n));let o=Math.max(...a),s=0;for(let{docIDs:t}of e){let e=o-a[s]+1;for(let n of t)i.push([n,e]);s++}return i.sort((e,t)=>t[1]-e[1]),i}function bq(e,t){let n=Object.keys(e);if(n.length!==1)return{isGeoOnly:!1};let r=n[0],i=e[r];if(t.indexes[r]===void 0)return{isGeoOnly:!1};let{type:a}=t.indexes[r];return a===`BKD`&&i&&(`radius`in i||`polygon`in i)?{isGeoOnly:!0,geoProperty:r,geoOperation:i}:{isGeoOnly:!1}}function xq(e,t){let n=e,r=bq(t,n);if(!r.isGeoOnly||!r.geoProperty||!r.geoOperation)return null;let{node:i}=n.indexes[r.geoProperty],a=r.geoOperation,o=i,s;if(`radius`in a){let{value:e,coordinates:t,unit:n=`m`,inside:r=!0,highPrecision:i=!1}=a.radius,c=t,l=qG(e,n);return s=o.searchByRadius(c,l,r,`asc`,i),yq(s,c,i)}else if(`polygon`in a){let{coordinates:e,inside:t=!0,highPrecision:n=!1}=a.polygon;s=o.searchByPolygon(e,t,`asc`,n);let r=JK.calculatePolygonCentroid(e);return yq(s,r,n)}return null}function Sq(e,t){e||=new Set;let n=Object.keys(t),r=n.length;for(let i=0;i<r;i++){let r=t[n[i]],a=r.length;for(let t=0;t<a;t++)e.add(r[t])}return e}function Cq(e,t,n,r,i){let a={language:e.tokenizer.language,sharedInternalDocumentStore:t,enabled:!0,isSorted:!0,sortableProperties:[],sortablePropertiesWithTypes:{},sorts:{}};for(let[o,s]of Object.entries(n)){let n=`${i}${i?`.`:``}${o}`;if(!r.includes(n)){if(typeof s==`object`&&!Array.isArray(s)){let i=Cq(e,t,s,r,n);NG(a.sortableProperties,i.sortableProperties),a.sorts={...a.sorts,...i.sorts},a.sortablePropertiesWithTypes={...a.sortablePropertiesWithTypes,...i.sortablePropertiesWithTypes};continue}if(!uK(s))switch(s){case`boolean`:case`number`:case`string`:a.sortableProperties.push(n),a.sortablePropertiesWithTypes[n]=s,a.sorts[n]={docs:new Map,orderedDocsToRemove:new Map,orderedDocs:[],type:s};break;case`geopoint`:case`enum`:continue;case`enum[]`:case`boolean[]`:case`number[]`:case`string[]`:continue;default:throw rK(`INVALID_SORT_SCHEMA_TYPE`,Array.isArray(s)?`array`:s,n)}}}return a}function wq(e,t,n,r){return r?.enabled===!1?{disabled:!0}:Cq(e,t,n,(r||{}).unsortableProperties||[],``)}function Tq(e,t,n,r){if(!e.enabled)return;e.isSorted=!1;let i=_K(e.sharedInternalDocumentStore,n),a=e.sorts[t];a.orderedDocsToRemove.has(i)&&Mq(e,t),a.docs.set(i,a.orderedDocs.length),a.orderedDocs.push([i,r])}function Eq(e){if(e.isSorted||!e.enabled)return;let t=Object.keys(e.sorts);for(let n of t)Aq(e,n);e.isSorted=!0}function Dq(e,t,n){return t[1].localeCompare(n[1],EG(e))}function Oq(e,t){return e[1]-t[1]}function kq(e,t){return t[1]?-1:1}function Aq(e,t){let n=e.sorts[t],r;switch(n.type){case`string`:r=Dq.bind(null,e.language);break;case`number`:r=Oq.bind(null);break;case`boolean`:r=kq.bind(null);break}n.orderedDocs.sort(r);let i=n.orderedDocs.length;for(let e=0;e<i;e++){let t=n.orderedDocs[e][0];n.docs.set(t,e)}}function jq(e){let t=Object.keys(e.sorts);for(let n of t)Mq(e,n)}function Mq(e,t){let n=e.sorts[t];n.orderedDocsToRemove.size&&(n.orderedDocs=n.orderedDocs.filter(e=>!n.orderedDocsToRemove.has(e[0])),n.orderedDocsToRemove.clear())}function Nq(e,t,n){if(!e.enabled)return;let r=e.sorts[t],i=_K(e.sharedInternalDocumentStore,n);r.docs.get(i)&&(r.docs.delete(i),r.orderedDocsToRemove.set(i,!0))}function Pq(e,t,n){if(!e.enabled)throw rK(`SORT_DISABLED`);let r=n.property,i=n.order===`DESC`,a=e.sorts[r];if(!a)throw rK(`UNABLE_TO_SORT_ON_UNKNOWN_FIELD`,r,e.sortableProperties.join(`, `));return Mq(e,r),Eq(e),t.sort((t,n)=>{let r=a.docs.get(_K(e.sharedInternalDocumentStore,t[0])),o=a.docs.get(_K(e.sharedInternalDocumentStore,n[0])),s=r!==void 0,c=o!==void 0;return!s&&!c?0:s?c?i?o-r:r-o:-1:1}),t}function Fq(e){return e.enabled?e.sortableProperties:[]}function Iq(e){return e.enabled?e.sortablePropertiesWithTypes:{}}function Lq(e,t){let n=t;if(!n.enabled)return{enabled:!1};let r=Object.keys(n.sorts).reduce((e,t)=>{let{docs:r,orderedDocs:i,type:a}=n.sorts[t];return e[t]={docs:new Map(Object.entries(r).map(([e,t])=>[+e,t])),orderedDocsToRemove:new Map,orderedDocs:i,type:a},e},{});return{sharedInternalDocumentStore:e,language:n.language,sortableProperties:n.sortableProperties,sortablePropertiesWithTypes:n.sortablePropertiesWithTypes,sorts:r,enabled:!0,isSorted:n.isSorted}}function Rq(e){if(!e.enabled)return{enabled:!1};jq(e),Eq(e);let t=Object.keys(e.sorts).reduce((t,n)=>{let{docs:r,orderedDocs:i,type:a}=e.sorts[n];return t[n]={docs:Object.fromEntries(r.entries()),orderedDocs:i,type:a},t},{});return{language:e.language,sortableProperties:e.sortableProperties,sortablePropertiesWithTypes:e.sortablePropertiesWithTypes,sorts:t,enabled:e.enabled,isSorted:e.isSorted}}function zq(){return{create:wq,insert:Tq,remove:Nq,save:Rq,load:Lq,sortBy:Pq,getSortableProperties:Fq,getSortablePropertiesWithTypes:Iq}}var Bq=192,Vq=383,Hq=[65,65,65,65,65,65,65,67,69,69,69,69,73,73,73,73,69,78,79,79,79,79,79,null,79,85,85,85,85,89,80,115,97,97,97,97,97,97,97,99,101,101,101,101,105,105,105,105,101,110,111,111,111,111,111,null,111,117,117,117,117,121,112,121,65,97,65,97,65,97,67,99,67,99,67,99,67,99,68,100,68,100,69,101,69,101,69,101,69,101,69,101,71,103,71,103,71,103,71,103,72,104,72,104,73,105,73,105,73,105,73,105,73,105,73,105,74,106,75,107,107,76,108,76,108,76,108,76,108,76,108,78,110,78,110,78,110,110,78,110,79,111,79,111,79,111,79,111,82,114,82,114,82,114,83,115,83,115,83,115,83,115,84,116,84,116,84,116,85,117,85,117,85,117,85,117,85,117,85,117,87,119,89,121,89,90,122,90,122,90,122,115];function Uq(e){return e<Bq||e>Vq?e:Hq[e-Bq]||e}function Wq(e){let t=[];for(let n=0;n<e.length;n++)t[n]=Uq(e.charCodeAt(n));return String.fromCharCode(...t)}var Gq={ational:`ate`,tional:`tion`,enci:`ence`,anci:`ance`,izer:`ize`,bli:`ble`,alli:`al`,entli:`ent`,eli:`e`,ousli:`ous`,ization:`ize`,ation:`ate`,ator:`ate`,alism:`al`,iveness:`ive`,fulness:`ful`,ousness:`ous`,aliti:`al`,iviti:`ive`,biliti:`ble`,logi:`log`},Kq={icate:`ic`,ative:``,alize:`al`,iciti:`ic`,ical:`ic`,ful:``,ness:``},qq=`[^aeiou]`,Jq=`[aeiouy]`,Yq=qq+`[^aeiouy]*`;Jq+``;var Xq=`^(`+Yq+`)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*`,Zq=`^(`+Yq+`)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*([aeiouy][aeiou]*)?$`,Qq=`^(`+Yq+`)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*[aeiouy][aeiou]*[^aeiou][^aeiouy]*`,$q=`^(`+Yq+`)?[aeiouy]`;function eJ(e){let t,n,r,i,a,o;if(e.length<3)return e;let s=e.substring(0,1);if(s==`y`&&(e=s.toUpperCase()+e.substring(1)),r=/^(.+?)(ss|i)es$/,i=/^(.+?)([^s])s$/,r.test(e)?e=e.replace(r,`$1$2`):i.test(e)&&(e=e.replace(i,`$1$2`)),r=/^(.+?)eed$/,i=/^(.+?)(ed|ing)$/,r.test(e)){let t=r.exec(e);r=new RegExp(Xq),r.test(t[1])&&(r=/.$/,e=e.replace(r,``))}else i.test(e)&&(t=i.exec(e)[1],i=new RegExp($q),i.test(t)&&(e=t,i=/(at|bl|iz)$/,a=RegExp(`([^aeiouylsz])\\1$`),o=RegExp(`^`+Yq+Jq+`[^aeiouwxy]$`),i.test(e)?e+=`e`:a.test(e)?(r=/.$/,e=e.replace(r,``)):o.test(e)&&(e+=`e`)));if(r=/^(.+?)y$/,r.test(e)&&(t=r.exec(e)?.[1],r=new RegExp($q),t&&r.test(t)&&(e=t+`i`)),r=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,r.test(e)){let i=r.exec(e);t=i?.[1],n=i?.[2],r=new RegExp(Xq),t&&r.test(t)&&(e=t+Gq[n])}if(r=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,r.test(e)){let i=r.exec(e);t=i?.[1],n=i?.[2],r=new RegExp(Xq),t&&r.test(t)&&(e=t+Kq[n])}if(r=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,i=/^(.+?)(s|t)(ion)$/,r.test(e))t=r.exec(e)?.[1],r=new RegExp(Qq),t&&r.test(t)&&(e=t);else if(i.test(e)){let n=i.exec(e);t=n?.[1]??``+n?.[2]??``,i=new RegExp(Qq),i.test(t)&&(e=t)}return r=/^(.+?)e$/,r.test(e)&&(t=r.exec(e)?.[1],r=new RegExp(Qq),i=new RegExp(Zq),a=RegExp(`^`+Yq+Jq+`[^aeiouwxy]$`),t&&(r.test(t)||i.test(t)&&!a.test(t))&&(e=t)),r=/ll$/,i=new RegExp(Qq),r.test(e)&&i.test(e)&&(r=/.$/,e=e.replace(r,``)),s==`y`&&(e=s.toLowerCase()+e.substring(1)),e}function tJ(e,t,n=!0){let r=`${this.language}:${e}:${t}`;return n&&this.normalizationCache.has(r)?this.normalizationCache.get(r):this.stopWords?.includes(t)?(n&&this.normalizationCache.set(r,``),``):(this.stemmer&&!this.stemmerSkipProperties.has(e)&&(t=this.stemmer(t)),t=Wq(t),n&&this.normalizationCache.set(r,t),t)}function nJ(e){for(;e[e.length-1]===``;)e.pop();for(;e[0]===``;)e.shift();return e}function rJ(e,t,n,r=!0){if(t&&t!==this.language)throw rK(`LANGUAGE_NOT_SUPPORTED`,t);if(typeof e!=`string`)return[e];let i=this.normalizeToken.bind(this,n??``),a;if(n&&this.tokenizeSkipProperties.has(n))a=[i(e,r)];else{let t=wG[this.language];a=e.toLowerCase().split(t).map(e=>i(e,r)).filter(Boolean)}let o=nJ(a);return this.allowDuplicates?o:Array.from(new Set(o))}function iJ(e={}){if(!e.language)e.language=`english`;else if(!TG.includes(e.language))throw rK(`LANGUAGE_NOT_SUPPORTED`,e.language);let t;if(e.stemming||e.stemmer&&!(`stemming`in e))if(e.stemmer){if(typeof e.stemmer!=`function`)throw rK(`INVALID_STEMMER_FUNCTION_TYPE`);t=e.stemmer}else if(e.language===`english`)t=eJ;else throw rK(`MISSING_STEMMER`,e.language);let n;if(e.stopWords!==!1){if(n=[],Array.isArray(e.stopWords))n=e.stopWords;else if(typeof e.stopWords==`function`)n=e.stopWords(n);else if(e.stopWords)throw rK(`CUSTOM_STOP_WORDS_MUST_BE_FUNCTION_OR_ARRAY`);if(!Array.isArray(n))throw rK(`CUSTOM_STOP_WORDS_MUST_BE_FUNCTION_OR_ARRAY`);for(let e of n)if(typeof e!=`string`)throw rK(`CUSTOM_STOP_WORDS_MUST_BE_FUNCTION_OR_ARRAY`)}let r={tokenize:rJ,language:e.language,stemmer:t,stemmerSkipProperties:new Set(e.stemmerSkipProperties?[e.stemmerSkipProperties].flat():[]),tokenizeSkipProperties:new Set(e.tokenizeSkipProperties?[e.tokenizeSkipProperties].flat():[]),stopWords:n,allowDuplicates:!!e.allowDuplicates,normalizeToken:tJ,normalizationCache:new Map};return r.tokenize=rJ.bind(r),r.normalizeToken=tJ,r}function aJ(e){return{sharedInternalDocumentStore:e,rules:new Map}}function oJ(e,t){if(e.rules.has(t.id))throw Error(`PINNING_RULE_ALREADY_EXISTS: A pinning rule with id "${t.id}" already exists. Use updateRule to modify it.`);e.rules.set(t.id,t)}function sJ(e,t){if(!e.rules.has(t.id))throw Error(`PINNING_RULE_NOT_FOUND: Cannot update pinning rule with id "${t.id}" because it does not exist. Use addRule to create it.`);e.rules.set(t.id,t)}function cJ(e,t){return e.rules.delete(t)}function lJ(e,t){return e.rules.get(t)}function uJ(e){return Array.from(e.rules.values())}function dJ(e,t){let n=e.toLowerCase().trim(),r=t.pattern.toLowerCase().trim();switch(t.anchoring){case`is`:return n===r;case`starts_with`:return n.startsWith(r);case`contains`:return n.includes(r);default:return!1}}function fJ(e,t){return e?t.conditions.every(t=>dJ(e,t)):!1}function pJ(e,t){if(!t)return[];let n=[];for(let r of e.rules.values())fJ(t,r)&&n.push(r);return n}function mJ(e,t){return{sharedInternalDocumentStore:e,rules:new Map(t?.rules??[])}}function hJ(e){return{rules:Array.from(e.rules.entries())}}function gJ(){return{create:aJ,addRule:oJ,updateRule:sJ,removeRule:cJ,getRule:lJ,getAllRules:uJ,getMatchingRules:pJ,load:mJ,save:hJ}}function _J(e){let t={formatElapsedTime:iK,getDocumentIndexId:aK,getDocumentProperties:WG,validateSchema:oK};for(let n of MK){let r=n;if(e[r]){if(typeof e[r]!=`function`)throw rK(`COMPONENT_MUST_BE_FUNCTION`,r)}else e[r]=t[r]}for(let t of Object.keys(e))if(!jK.includes(t)&&!MK.includes(t))throw rK(`UNSUPPORTED_COMPONENT`,t)}function vJ({schema:e,sort:t,language:n,components:r,id:i,plugins:a}){r||={};for(let t of a??[]){if(!(`getComponents`in t)||typeof t.getComponents!=`function`)continue;let n=t.getComponents(e),i=Object.keys(n);for(let e of i)if(r[e])throw rK(`PLUGIN_COMPONENT_CONFLICT`,e,t.name);r={...r,...n}}i||=BG();let o=r.tokenizer,s=r.index,c=r.documentsStore,l=r.sorter,u=r.pinning;if(o=o?o.tokenize?o:iJ(o):iJ({language:n??`english`}),r.tokenizer&&n)throw rK(`NO_LANGUAGE_WITH_CUSTOM_TOKENIZER`);let d=mK();s||=_q(),l||=zq(),c||=OK(),u||=gJ(),_J(r);let{getDocumentProperties:f,getDocumentIndexId:p,validateSchema:m,formatElapsedTime:h}=r,g={data:{},caches:{},schema:e,tokenizer:o,index:s,sorter:l,documentsStore:c,pinning:u,internalDocumentIDStore:d,getDocumentProperties:f,getDocumentIndexId:p,validateSchema:m,beforeInsert:[],afterInsert:[],beforeRemove:[],afterRemove:[],beforeUpdate:[],afterUpdate:[],beforeUpsert:[],afterUpsert:[],beforeSearch:[],afterSearch:[],beforeInsertMultiple:[],afterInsertMultiple:[],beforeRemoveMultiple:[],afterRemoveMultiple:[],beforeUpdateMultiple:[],afterUpdateMultiple:[],beforeUpsertMultiple:[],afterUpsertMultiple:[],afterCreate:[],formatElapsedTime:h,id:i,plugins:a,version:yJ()};g.data={index:g.index.create(g,d,e),docs:g.documentsStore.create(g,d),sorting:g.sorter.create(g,d,e,t),pinning:g.pinning.create(d)};for(let e of kK)g[e]=(g[e]??[]).concat(AK(g,e));let _=g.afterCreate;return _&&LK(_,g),g}function yJ(){return`{{VERSION}}`}function bJ(e){return e.documentsStore.count(e.data.docs)}function xJ(e,t,n,r,i){let a=e.validateSchema(t,e.schema);if(a)throw rK(`SCHEMA_VALIDATION_FAILURE`,a);return YG(e.beforeInsert)||YG(e.afterInsert)||YG(e.index.beforeInsert)||YG(e.index.insert)||YG(e.index.afterInsert)?wJ(e,t,n,r,i):TJ(e,t,n,r,i)}var SJ=new Set([`enum`,`enum[]`]),CJ=new Set([`string`,`number`]);async function wJ(e,t,n,r,i){let{index:a,docs:o}=e.data,s=e.getDocumentIndexId(t);if(typeof s!=`string`)throw rK(`DOCUMENT_ID_MUST_BE_STRING`,typeof s);let c=_K(e.internalDocumentIDStore,s);if(r||await NK(e.beforeInsert,e,s,t),!e.documentsStore.store(o,s,c,t))throw rK(`DOCUMENT_ALREADY_EXISTS`,s);let l=e.documentsStore.count(o),u=e.index.getSearchableProperties(a),d=e.index.getSearchablePropertiesWithTypes(a),f=e.getDocumentProperties(t,u);for(let[e,t]of Object.entries(f)){if(t===void 0)continue;let n=typeof t,r=d[e];EJ(n,r,e,t)}return await DJ(e,s,u,f,l,n,t,i),r||await NK(e.afterInsert,e,s,t),s}function TJ(e,t,n,r,i){let{index:a,docs:o}=e.data,s=e.getDocumentIndexId(t);if(typeof s!=`string`)throw rK(`DOCUMENT_ID_MUST_BE_STRING`,typeof s);let c=_K(e.internalDocumentIDStore,s);if(r||NK(e.beforeInsert,e,s,t),!e.documentsStore.store(o,s,c,t))throw rK(`DOCUMENT_ALREADY_EXISTS`,s);let l=e.documentsStore.count(o),u=e.index.getSearchableProperties(a),d=e.index.getSearchablePropertiesWithTypes(a),f=e.getDocumentProperties(t,u);for(let[e,t]of Object.entries(f)){if(t===void 0)continue;let n=typeof t,r=d[e];EJ(n,r,e,t)}return OJ(e,s,u,f,l,n,t,i),r||NK(e.afterInsert,e,s,t),s}function EJ(e,t,n,r){if(!(lK(t)&&typeof r==`object`&&typeof r.lon==`number`&&typeof r.lat==`number`)&&!(uK(t)&&Array.isArray(r))&&!(dK(t)&&Array.isArray(r))&&!(SJ.has(t)&&CJ.has(e))&&e!==t)throw rK(`INVALID_DOCUMENT_PROPERTY`,n,t,e)}async function DJ(e,t,n,r,i,a,o,s){for(let o of n){let n=r[o];if(n===void 0)continue;let c=e.index.getSearchablePropertiesWithTypes(e.data.index)[o];await e.index.beforeInsert?.(e.data.index,o,t,n,c,a,e.tokenizer,i);let l=e.internalDocumentIDStore.idToInternalId.get(t);await e.index.insert(e.index,e.data.index,o,t,l,n,c,a,e.tokenizer,i,s),await e.index.afterInsert?.(e.data.index,o,t,n,c,a,e.tokenizer,i)}let c=e.sorter.getSortableProperties(e.data.sorting),l=e.getDocumentProperties(o,c);for(let n of c){let r=l[n];if(r===void 0)continue;let i=e.sorter.getSortablePropertiesWithTypes(e.data.sorting)[n];e.sorter.insert(e.data.sorting,n,t,r,i,a)}}function OJ(e,t,n,r,i,a,o,s){for(let o of n){let n=r[o];if(n===void 0)continue;let c=e.index.getSearchablePropertiesWithTypes(e.data.index)[o],l=_K(e.internalDocumentIDStore,t);e.index.beforeInsert?.(e.data.index,o,t,n,c,a,e.tokenizer,i),e.index.insert(e.index,e.data.index,o,t,l,n,c,a,e.tokenizer,i,s),e.index.afterInsert?.(e.data.index,o,t,n,c,a,e.tokenizer,i)}let c=e.sorter.getSortableProperties(e.data.sorting),l=e.getDocumentProperties(o,c);for(let n of c){let r=l[n];if(r===void 0)continue;let i=e.sorter.getSortablePropertiesWithTypes(e.data.sorting)[n];e.sorter.insert(e.data.sorting,n,t,r,i,a)}}function kJ(e,t,n,r,i,a){return YG(e.afterInsertMultiple)||YG(e.beforeInsertMultiple)||YG(e.index.beforeInsert)||YG(e.index.insert)||YG(e.index.afterInsert)?AJ(e,t,n,r,i,a):jJ(e,t,n,r,i,a)}async function AJ(e,t,n=1e3,r,i,a=0){let o=[],s=async a=>{let s=Math.min(a+n,t.length),c=t.slice(a,s);for(let t of c){let n=await xJ(e,t,r,i,{avlRebalanceThreshold:c.length});o.push(n)}return s};return await(async()=>{let e=0;for(;e<t.length;){let t=Date.now();if(e=await s(e),a>0){let e=a-(Date.now()-t);e>0&&tK(e)}}})(),i||await PK(e.afterInsertMultiple,e,t),o}function jJ(e,t,n=1e3,r,i,a=0){let o=[],s=0;function c(){let a=t.slice(s*n,(s+1)*n);if(a.length===0)return!1;for(let t of a){let n=xJ(e,t,r,i,{avlRebalanceThreshold:a.length});o.push(n)}return s++,!0}function l(){let e=Date.now();for(;c();)if(a>0){let t=Date.now()-e;if(t>=a){let e=a-t%a;e>0&&tK(e)}}}return l(),i||PK(e.afterInsertMultiple,e,t),o}function MJ(e,t){return e[1]-t[1]}function NJ(e,t){return t[1]-e[1]}function PJ(e=`desc`){return e.toLowerCase()===`asc`?MJ:NJ}function FJ(e,t,n){let r={},i=t.map(([e])=>e),a=e.documentsStore.getMultiple(e.data.docs,i),o=Object.keys(n),s=e.index.getSearchablePropertiesWithTypes(e.data.index);for(let e of o){let t;if(s[e]===`number`){let{ranges:r}=n[e],i=r.length,a=Array.from({length:i});for(let e=0;e<i;e++){let t=r[e];a[e]=[`${t.from}-${t.to}`,0]}t=Object.fromEntries(a)}r[e]={count:0,values:t??{}}}let c=a.length;for(let e=0;e<c;e++){let t=a[e];for(let e of o){let i=e.includes(`.`)?GG(t,e):t[e],a=s[e],o=r[e].values;switch(a){case`number`:{let t=n[e].ranges;IJ(t,o)(i);break}case`number[]`:{let t=new Set,r=n[e].ranges,a=IJ(r,o,t);for(let e of i)a(e);break}case`boolean`:case`enum`:case`string`:LJ(o,a)(i);break;case`boolean[]`:case`enum[]`:case`string[]`:{let e=LJ(o,a===`boolean[]`?`boolean`:`string`,new Set);for(let t of i)e(t);break}default:throw rK(`FACET_NOT_SUPPORTED`,a)}}}for(let e of o){let t=r[e];if(t.count=Object.keys(t.values).length,s[e]===`string`){let r=n[e],i=PJ(r.sort);t.values=Object.fromEntries(Object.entries(t.values).sort(i).slice(r.offset??0,r.limit??10))}}return r}function IJ(e,t,n){return r=>{for(let i of e){let e=`${i.from}-${i.to}`;n?.has(e)||r>=i.from&&r<=i.to&&(t[e]===void 0?t[e]=1:(t[e]++,n?.add(e)))}}}function LJ(e,t,n){let r=t===`boolean`?`false`:``;return t=>{let i=t?.toString()??r;n?.has(i)||(e[i]=(e[i]??0)+1,n?.add(i))}}var RJ={reducer:(e,t,n,r)=>(t[r]=n,t),getInitialValue:e=>Array.from({length:e})},zJ=[`string`,`number`,`boolean`];function BJ(e,t,n){let r=n.properties,i=r.length,a=e.index.getSearchablePropertiesWithTypes(e.data.index);for(let e=0;e<i;e++){let t=r[e];if(a[t]===void 0)throw rK(`UNKNOWN_GROUP_BY_PROPERTY`,t);if(!zJ.includes(a[t]))throw rK(`INVALID_GROUP_BY_PROPERTY`,t,zJ.join(`, `),a[t])}let o=t.map(([t])=>vK(e.internalDocumentIDStore,t)),s=e.documentsStore.getMultiple(e.data.docs,o),c=s.length,l=n.maxResult||2**53-1,u=[],d={};for(let e=0;e<i;e++){let t=r[e],n={property:t,perValue:{}},i=new Set;for(let e=0;e<c;e++){let r=s[e],a=GG(r,t);if(a===void 0)continue;let o=typeof a==`boolean`?``+a:a,c=n.perValue[o]??{indexes:[],count:0};c.count>=l||(c.indexes.push(e),c.count++,n.perValue[o]=c,i.add(a))}u.push(Array.from(i)),d[t]=n}let f=VJ(u),p=f.length,m=[];for(let e=0;e<p;e++){let t=f[e],n=t.length,i={values:[],indexes:[]},a=[];for(let e=0;e<n;e++){let n=t[e],o=r[e];a.push(d[o].perValue[typeof n==`boolean`?``+n:n].indexes),i.values.push(n)}i.indexes=UG(a).sort((e,t)=>e-t),i.indexes.length!==0&&m.push(i)}let h=m.length,g=Array.from({length:h});for(let e=0;e<h;e++){let r=m[e],i=n.reduce||RJ,a=r.indexes.map(e=>({id:o[e],score:t[e][1],document:s[e]})),c=i.reducer.bind(null,r.values),l=i.getInitialValue(r.indexes.length),u=a.reduce(c,l);g[e]={values:r.values,result:u}}return g}function VJ(e,t=0){if(t+1===e.length)return e[t].map(e=>[e]);let n=e[t],r=VJ(e,t+1),i=[];for(let e of n)for(let t of r){let n=[e];NG(n,t),i.push(n)}return i}function HJ(e,t,n,r){let i=pJ(t,r);if(i.length===0)return n;let a=i.flatMap(e=>e.consequence.promote);a.sort((e,t)=>e.position-t.position);let o=new Set,s=new Map,c=new Set;for(let t of a){let n=_K(e.internalDocumentIDStore,t.doc_id);if(n!==void 0){if(s.has(n)){let e=s.get(n);t.position<e&&s.set(n,t.position);continue}c.has(t.position)||(o.add(n),s.set(n,t.position),c.add(t.position))}}if(s.size===0)return n;let l=n.filter(([e])=>!o.has(e)),u=[];for(let[t,r]of s.entries())n.find(([e])=>e===t)?u.push([t,1e6-r]):e.documentsStore.get(e.data.docs,t)&&u.push([t,0]);u.sort((e,t)=>(s.get(e[0])??1/0)-(s.get(t[0])??1/0));let d=[],f=new Map;for(let e of u){let t=s.get(e[0]);f.set(t,e)}let p=0,m=0;for(;m<l.length+u.length;)if(f.has(m))d.push(f.get(m)),m++;else if(p<l.length)d.push(l[p]),p++,m++;else break;for(let[e,t]of f.entries())e>=d.length&&d.push(t);return d}function UJ(e,t,n){let{term:r,properties:i}=t,a=e.data.index,o=e.caches.propertiesToSearch;if(!o){let t=e.index.getSearchablePropertiesWithTypes(a);o=e.index.getSearchableProperties(a),o=o.filter(e=>t[e].startsWith(`string`)),e.caches.propertiesToSearch=o}if(i&&i!==`*`){for(let e of i)if(!o.includes(e))throw rK(`UNKNOWN_INDEX`,e,o.join(`, `));o=o.filter(e=>i.includes(e))}let s=Object.keys(t.where??{}).length>0,c;s&&(c=e.index.searchByWhereClause(a,e.tokenizer,t.where,n));let l,u=t.threshold!==void 0&&t.threshold!==null?t.threshold:1;if(r||i){let i=bJ(e);if(l=e.index.search(a,r||``,e.tokenizer,n,o,t.exact||!1,t.tolerance||0,t.boost||{},JJ(t.relevance),i,c,u),t.exact&&r){let t=r.trim().split(/\s+/);l=l.filter(([n])=>{let r=e.documentsStore.get(e.data.docs,n);if(!r)return!1;for(let e of o){let n=GJ(r,e);if(typeof n==`string`&&t.every(e=>RegExp(`\\b${WJ(e)}\\b`).test(n)))return!0}return!1})}}else l=s?xq(a,t.where)||(c?Array.from(c):[]).map(e=>[+e,0]):Object.keys(e.documentsStore.getAll(e.data.docs)).map(e=>[+e,0]);return l}function WJ(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function GJ(e,t){let n=t.split(`.`),r=e;for(let e of n)if(r&&typeof r==`object`&&e in r)r=r[e];else return;return r}function KJ(e,t,n){let r=zG();function i(){let i=Object.keys(e.data.index.vectorIndexes),a=t.facets&&Object.keys(t.facets).length>0,{limit:o=10,offset:s=0,distinctOn:c,includeVectors:l=!1}=t,u=t.preflight===!0,d=UJ(e,t,n);if(t.sortBy)if(typeof t.sortBy==`function`){let n=d.map(([e])=>e),r=e.documentsStore.getMultiple(e.data.docs,n).map((e,t)=>[d[t][0],d[t][1],e]);r.sort(t.sortBy),d=r.map(([e,t])=>[e,t])}else d=e.sorter.sortBy(e.data.sorting,d,t.sortBy).map(([t,n])=>[_K(e.internalDocumentIDStore,t),n]);else d=d.sort(HG);d=HJ(e,e.data.pinning,d,t.term);let f;u||(f=c?oY(e,d,s,o,c):sY(e,d,s,o));let p={elapsed:{formatted:``,raw:0},hits:[],count:d.length};return f!==void 0&&(p.hits=f.filter(Boolean),l||JG(p,i)),a&&(p.facets=FJ(e,d,t.facets)),t.groupBy&&(p.groups=BJ(e,d,t.groupBy)),p.elapsed=e.formatElapsedTime(zG()-r),p}async function a(){e.beforeSearch&&await IK(e.beforeSearch,e,t,n);let r=i();return e.afterSearch&&await FK(e.afterSearch,e,t,n,r),r}return e.beforeSearch?.length||e.afterSearch?.length?a():i()}var qJ={k:1.2,b:.75,d:.5};function JJ(e){let t=e??{};return t.k=t.k??qJ.k,t.b=t.b??qJ.b,t.d=t.d??qJ.d,t}function YJ(e,t,n){let r=t.vector;if(r&&(!(`value`in r)||!(`property`in r)))throw rK(`INVALID_VECTOR_INPUT`,Object.keys(r).join(`, `));let i=e.data.index.vectorIndexes[r.property];if(!i)throw rK(`UNKNOWN_VECTOR_PROPERTY`,r.property);let a=i.node.size;if(r?.value.length!==a)throw r?.property===void 0||r?.value.length===void 0?rK(`INVALID_INPUT_VECTOR`,`undefined`,a,`undefined`):rK(`INVALID_INPUT_VECTOR`,r.property,a,r.value.length);let o=e.data.index,s;return Object.keys(t.where??{}).length>0&&(s=e.index.searchByWhereClause(o,e.tokenizer,t.where,n)),i.node.find(r.value,t.similarity??.8,s)}function XJ(e,t,n=`english`){let r=zG();function i(){let i=YJ(e,t,n).sort(HG);i=HJ(e,e.data.pinning,i,void 0);let a=[];t.facets&&Object.keys(t.facets).length>0&&(a=FJ(e,i,t.facets));let o=t.vector.property,s=t.includeVectors??!1,c=t.limit??10,l=t.offset??0,u=Array.from({length:c});for(let t=0;t<c;t++){let n=i[t+l];if(!n)break;let r=e.data.docs.docs[n[0]];r&&(s||(r[o]=null),u[t]={id:vK(e.internalDocumentIDStore,n[0]),score:n[1],document:r})}let d=[];t.groupBy&&(d=BJ(e,i,t.groupBy));let f=zG()-r;return{count:i.length,hits:u.filter(Boolean),elapsed:{raw:Number(f),formatted:RG(f)},...a?{facets:a}:{},...d?{groups:d}:{}}}async function a(){e.beforeSearch&&await IK(e.beforeSearch,e,t,n);let r=i();return e.afterSearch&&await FK(e.afterSearch,e,t,n,r),r}return e.beforeSearch?.length||e.afterSearch?.length?a():i()}function ZJ(e,t,n){let r=eY(UJ(e,t,n)),i=YJ(e,t,n),a=t.hybridWeights;return rY(r,i,t.term??``,a)}function QJ(e,t,n){let r=zG();function i(){let i=ZJ(e,t,n);i=HJ(e,e.data.pinning,i,t.term);let a;t.facets&&Object.keys(t.facets).length>0&&(a=FJ(e,i,t.facets));let o;t.groupBy&&(o=BJ(e,i,t.groupBy));let s=t.offset??0,c=t.limit??10,l=sY(e,i,s,c).filter(Boolean),u=zG(),d={count:i.length,elapsed:{raw:Number(u-r),formatted:RG(u-r)},hits:l,...a?{facets:a}:{},...o?{groups:o}:{}};return(t.includeVectors??!1)||JG(d,Object.keys(e.data.index.vectorIndexes)),d}async function a(){e.beforeSearch&&await IK(e.beforeSearch,e,t,n);let r=i();return e.afterSearch&&await FK(e.afterSearch,e,t,n,r),r}return e.beforeSearch?.length||e.afterSearch?.length?a():i()}function $J(e){return e[1]}function eY(e){let t=Math.max.apply(Math,e.map($J));return e.map(([e,n])=>[e,n/t])}function tY(e,t){return e/t}function nY(e,t){return(n,r)=>n*e+r*t}function rY(e,t,n,r){let i=Math.max.apply(Math,e.map($J)),a=Math.max.apply(Math,t.map($J)),{text:o,vector:s}=r&&r.text&&r.vector?r:iY(n),c=new Map,l=e.length,u=nY(o,s);for(let t=0;t<l;t++){let[n,r]=e[t],a=u(tY(r,i),0);c.set(n,a)}let d=t.length;for(let e=0;e<d;e++){let[n,r]=t[e],i=tY(r,a),o=c.get(n)??0;c.set(n,o+u(0,i))}return[...c].sort((e,t)=>t[1]-e[1])}function iY(e){return{text:.5,vector:.5}}function aY(e,t,n){let r=t.mode??`fulltext`;if(r===`fulltext`)return KJ(e,t,n);if(r===`vector`)return XJ(e,t);if(r===`hybrid`)return QJ(e,t);throw rK(`INVALID_SEARCH_MODE`,r)}function oY(e,t,n,r,i){let a=e.data.docs,o=new Map,s=[],c=new Set,l=t.length,u=0;for(let d=0;d<l;d++){let l=t[d];if(l===void 0)continue;let[f,p]=l;if(c.has(f))continue;let m=e.documentsStore.get(a,f),h=GG(m,i);if(!(h===void 0||o.has(h))&&(o.set(h,!0),u++,!(u<=n)&&(s.push({id:vK(e.internalDocumentIDStore,f),score:p,document:m}),c.add(f),u>=n+r)))break}return s}function sY(e,t,n,r){let i=e.data.docs,a=Array.from({length:r}),o=new Set;for(let s=n;s<r+n;s++){let n=t[s];if(n===void 0)break;let[r,c]=n;if(!o.has(r)){let t=e.documentsStore.get(i,r);a[s]={id:vK(e.internalDocumentIDStore,r),score:c,document:t},o.add(r)}}return a}new Set(Yo);var cY=[{id:`mcp-preapproval`,piece:`mcp`,scope:`project`,requiredStrictness:`pre-approval-exact`,revokedByForeignEntry:!1},{id:`tool-autoapprove`,piece:`mcp`,requiredStrictness:`pre-approval-exact`,revokedByForeignEntry:!0}];cY.map(e=>e.id);var lY={satisfied:{counts:!0,exception:null},"present-consent-unknown":{counts:!0,exception:`info`},absent:{counts:!1,exception:null},foreign:{counts:!1,exception:`warning`},"foreign-replaceable":{counts:!1,exception:`warning`},drifted:{counts:!1,exception:`warning`},excluded:{counts:!1,exception:`info`},"structural-na":{counts:!1,exception:`info`},undetected:{counts:!1,exception:null},unprobeable:{counts:!0,exception:`info`},unprobed:{counts:!1,exception:`info`}};R([`count-unverified`,`not-count`]);var uY={acp:{unprobed:`count-unverified`},terminal:{unprobed:`count-unverified`},external:{unprobed:`not-count`}};R([`acp-catalog-supported`,`harness-cli-on-path`,`os-scheme-handler`]);var dY={acp:{signal:`acp-catalog-supported`,unresolved:`show`,negativeOutranksOverride:!0},terminal:{signal:`harness-cli-on-path`,unresolved:`show`,negativeOutranksOverride:!1},external:{signal:`os-scheme-handler`,unresolved:`hide`,negativeOutranksOverride:!1}};function fY(e){return typeof e==`object`&&!!e}function pY(e,t){if(!fY(e))return;let{satisfiers:n}=e;if(!fY(n))return;let r=n[t];if(!fY(r))return;let{state:i,strictness:a,sharedWith:o}=r;if(typeof i!=`string`||i.length===0)return;let s=Array.isArray(a)?a.filter(e=>typeof e==`string`):void 0,c=Array.isArray(o)?o.filter(e=>typeof e==`string`&&Qo(e)):void 0;return{state:i,...s===void 0?{}:{strictness:s},...c===void 0||c.length===0?{}:{sharedWith:c}}}function mY(e,t){if(!fY(e))return!1;let{detected:n}=e;return Array.isArray(n)&&n.includes(t)}function hY(e,t){return e.probe.mode===`unprobeable`?`unprobeable`:pY(t,e.id)?.state??`unprobed`}function gY(e){return Ko(e)?lY[e]:lY.unprobed}function _Y(e,t){let n=e.filter(e=>{let n=Ds(e);return n===void 0?!0:!gY(hY(n,t)).counts});return n.length===e.length?n:[]}function vY(e){return gY(e).exception===`warning`}function yY(e){return e.state===`foreign`?`foreign`:e.state===`structural-na`?`structural-na`:e.installability===`not-installable`?`not-installable`:e.agentFolded?`agent-undetected`:null}function bY(e,t){let n=t?.probed===!0?mY(t,e.id):null;return{detected:n,folded:e.offerOnlyWhenDetected&&n===!1}}function xY(e,t){return(pY(t,e.id)?.sharedWith??[]).filter(t=>t!==e.agent)}var SY=es.filter(e=>e!==`session`);function CY(e){return Pte.includes(e)}function wY(e,t,n){let r=[];for(let i of e.satisfiers){if(!CY(i.kind))continue;let a=hY(i,t),o=t?.satisfiers?.[i.id]?.path,s=gY(a),c=_Y(i.prerequisites,t),l=yY({state:a,installability:i.installability,agentFolded:n});r.push({satisfierId:i.id,agentId:e.id,piece:i.piece,scope:i.scope,kind:i.kind,...i.pathId===void 0?{}:{pathId:i.pathId},...o===void 0?{}:{resolvedPath:o},audience:i.audience,state:a,checked:s.counts,exception:s.exception,folded:a===`undetected`,enabled:l===null,disabledReason:l,sharedWith:i.sharedWith,sharedFolderWith:xY(i,t),prerequisites:i.prerequisites,unmetPrerequisites:c,consentClass:i.consentClass,installability:i.installability,...i.guidance===void 0?{}:{guidance:i.guidance},...i.followup===void 0?{}:{followup:i.followup},troubleshooting:i.troubleshooting})}return r}function TY(e){let t=[];for(let n of SY){let r=e.filter(e=>e.scope===n);r.length!==0&&t.push({scope:n,cells:r})}return t}function EY(e,t,n){let{detected:r,folded:i}=bY(e,n),a=wY(e,t,i);return{agentId:e.id,detected:r,folded:i,setupDocSlug:e.setupDocSlug,scopes:TY(a)}}function DY(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`&&Qo(e)):Xo}function OY(e={}){let{agentIds:t,probes:n,detection:r}=e;return{rows:DY(t).map(e=>ws[e]).filter(e=>e!==void 0).map(e=>EY(e,n,r))}}var kY={agent:Zo},AY={"followup.enable-manually":{params:Wa(kY)},"guidance.mcp.user-config":{params:Wa(kY)},"guidance.mcp.project-config":{params:Wa(kY)},"guidance.mcp.session-injection":{params:Wa(kY)},"guidance.mcp.managed-file":{params:Wa(kY)},"guidance.skill.project":{params:Wa(kY)},"guidance.skill.user":{params:Wa(kY)},"guidance.skill.central-store":{params:Wa(kY)},"troubleshooting.claude.project-entry-not-approved":{params:Wa(kY)},"troubleshooting.claude-desktop.per-tool-approval":{params:Wa(kY)},"troubleshooting.cursor.project-entry-not-loaded":{params:Wa(kY)},"troubleshooting.codex.desktop-project-config":{params:Wa({...kY,honoredByDesktop:P()})},"troubleshooting.codex.folder-trust":{params:Wa(kY)},"troubleshooting.copilot.shared-workspace-config":{params:Wa({...kY,sourceAgent:Zo})},"troubleshooting.openclaw.central-store-missing":{params:Wa(kY)},"troubleshooting.pi.folder-trust":{params:Wa(kY)},"troubleshooting.lm-studio.config-path-mismatch":{params:Wa(kY)}};Object.keys(AY).sort(),Es.flatMap(e=>e.probe.mode===`probeable`?[{satisfierId:e.id,agent:e.agent,piece:e.piece,scope:e.scope,kind:e.kind,pathId:e.pathId??null,strictness:e.probe.strictness}]:[]).map(e=>e.satisfierId);var jY={verified:3,unverifiable:2,unverified:1};function MY(e,t){let n=dY[e],r=typeof t==`boolean`?t:null;return{signal:n.signal,resolved:r,show:r??n.unresolved===`show`}}function NY(e,t,n){let r=Ds(e);if(r===void 0)return{id:e,state:`absent`,counts:!1,confidence:`unverified`,exception:lY.absent.exception,consentClass:`none`,troubleshooting:[]};let i=hY(r,n),a=!Ko(i)||i===`unprobed`,o=uY[t].unprobed===`count-unverified`;return{id:e,state:i,counts:a?o:gY(i).counts,confidence:a?`unverified`:i===`unprobeable`?`unverifiable`:`verified`,exception:gY(i).exception,consentClass:r.consentClass,...r.guidance===void 0?{}:{guidance:r.guidance},...r.followup===void 0?{}:{followup:r.followup},troubleshooting:r.troubleshooting}}function PY(e,t,n){let r=e.satisfiedByAny.map(e=>NY(e,t,n));if(r.length===0)return{piece:e.piece,level:e.level,status:`nothing-required`,confidence:null,satisfiedBy:null,options:r};let i=null;for(let e of r)e.counts&&(i===null||jY[e.confidence]>jY[i.confidence])&&(i=e);return{piece:e.piece,level:e.level,status:i===null?`unmet`:`met`,confidence:i?.confidence??null,satisfiedBy:i?.id??null,options:r}}var FY=[`absent`,`structural-na`];function IY(e,t){let n=[];for(let r of cY){let i=e.satisfiers.filter(e=>e.piece===r.piece&&e.kind!==`session-injection`&&(r.scope===void 0||e.scope===r.scope));r.revokedByForeignEntry&&i.some(e=>FY.includes(hY(e,t))?!1:!LY(pY(t,e.id),r.requiredStrictness))||i.some(e=>e.probe.mode!==`probeable`||!e.probe.strictness.includes(r.requiredStrictness)||!gY(hY(e,t)).counts?!1:LY(pY(t,e.id),r.requiredStrictness))&&n.push(r.id)}return n}function LY(e,t){return e?.strictness?.includes(t)===!0}function RY(e){let{agentId:t,mode:n,probes:r,modeSignal:i}=e,a=Qo(t)?Ts(t):void 0;if(a===void 0)return{agentId:t,mode:n,verdict:`not-registered`,visibility:{...MY(n,i),show:!0},requirements:[],grantedCapabilities:[],modeCaveats:[]};let o=MY(n,i),s=a.modes[n];if(s===void 0)return{agentId:t,mode:n,verdict:`mode-not-available`,visibility:o,requirements:[],grantedCapabilities:[],modeCaveats:[]};let c=s.requirements.map(e=>PY(e,n,r)),l=c.some(e=>e.level===`required`&&e.status===`unmet`),u=c.some(e=>e.status===`unmet`);return{agentId:t,mode:n,verdict:l?`blocked`:u?`ready-with-nudges`:`ready`,visibility:o,requirements:c,grantedCapabilities:IY(a,r),modeCaveats:s.caveats}}var zY=R(Re),BY=I({kind:R([`source-read`,`measured`,`vendor-doc`,`upstream-issue`,`observation`]),ref:M().min(1),note:M().optional()}),VY=I({version:M().min(1).optional(),observedAt:M().min(1)}),HY=Ja(`confidence`,[I({confidence:z(`verified`),evidence:F(BY).min(1),verifiedAgainst:VY.optional()}),I({confidence:z(`assumed`),evidence:F(BY).min(1),verifiedAgainst:VY.optional()}),I({confidence:z(`contested`),evidence:F(BY).min(1),verifiedAgainst:VY})]),UY=I({id:Hte,params:Qa(M(),Ka([M(),N(),P()])).optional()}),WY=Ja(`mode`,[I({mode:z(`probeable`),strictness:F(Jo).min(1)}),I({mode:z(`unprobeable`),reason:R([`no-readable-state`,`different-machine`,`no-programmatic-path`,`session-scoped`]),note:M().optional()})]),GY=R([`this-project`,`this-user`,`this-machine`]),KY=R([`installable`,`user-completes`,`not-installable`]),qY=I({id:ns,agent:Zo,piece:$o,scope:ts,kind:Nte,pathId:Vte.optional(),sharedWith:F(Zo).default([]),prerequisites:F(ns).default([]),consentClass:Fte.default(`none`),probe:WY,attestation:HY,audience:GY,installability:KY.default(`installable`),notInstallableReason:R([`no-non-interactive-verb`,`session-scoped`,`no-surface`]).optional(),preferred:P().default(!1),guidance:UY.optional(),followup:UY.optional(),troubleshooting:F(UY).default([])}),JY=I({piece:$o,level:Lte,satisfiedByAny:F(ns)}),YY=I({acpAgentId:M().min(1),featuredOrder:N().int().nonnegative().nullable(),harnessCli:zte.nullable(),harnessReadsEditorConfig:zY.nullable(),harnessReadsEditorConfigAttestation:HY,verifiedPosture:R([`asks`,`self-managed`,`autonomous`]).nullable()}),XY=I({cliId:M().min(1)}),ZY=I({targetId:Bte,knownOrder:N().int().nonnegative(),visible:P(),displayName:M().min(1),appBrandName:M().min(1).optional(),schemes:F(M().min(1)),installUrl:M().min(1),tagline:M().min(1).optional()}),QY=I({requirements:F(JY),caveats:F(UY).default([])});I({id:Zo,setupDocSlug:M().min(1).nullable(),offerOnlyWhenDetected:P().default(!1),offersConnectionRow:P().default(!1),detectionSources:F(M().min(1)).default([]),satisfiers:F(qY),modes:$a(Rte,QY),acp:YY.optional(),terminal:XY.optional(),external:ZY.optional()}),I({id:M().min(1),requiredStrictness:Jo,scope:ts.optional(),piece:$o,revokedByForeignEntry:P().default(!1),guidance:UY.optional()}),new gh.default;var $Y=I({path:F(Ka([M(),N()])),message:M(),issueCode:M()});Ja(`code`,[I({code:z(`SCHEMA_INVALID`),issues:F($Y)}),I({code:z(`WRITE_ERROR`),detail:M()})]);function eX(e){return{path:e.path.map(e=>typeof e==`symbol`?String(e):e),message:e.message,issueCode:e.code}}function tX(e){if(e.code!==`SCHEMA_INVALID`)return{};let t={};for(let n of e.issues){let e=n.path[0];typeof e==`string`&&(t[e]=t[e]?`${t[e]}; ${n.message}`:n.message)}return t}var nX=/^---[ \t]*\r?\n---[ \t]*(\r?\n|$)/,rX=/^---([ \t]*)(?=\r?\n|$)/,iX=e=>e.includes(`\r
401
401
  `)?`\r
402
402
  `:`
403
403
  `,aX=e=>e.replace(rX,`***$1`),oX=e=>`---${e}${e}---${e}`;function sX(e,t){let n=Rd(e,t);return{md:n,frontmatter:n.slice(0,n.length-t.length)}}function cX(e,t){let{md:n,frontmatter:r}=sX(e,t),i=Ld(n);return i.frontmatter===r&&i.body===t}function lX(e,t,n,r){let{md:i,frontmatter:a}=sX(t,n);return{md:i,frontmatter:a,body:n,adjusted:r===`none`&&a!==e?`frontmatter`:r}}function uX(e,t){if(cX(e,t))return lX(e,e,t,`none`);let n=aX(t);if(n!==t&&cX(e,n))return lX(e,e,n,`body`);if(nX.test(e)){let n=oX(iX(e));if(cX(n,t))return lX(e,n,t,`frontmatter`)}return lX(e,e,t,`unresolved`)}function dX(e,t){if(cX(e,t))return lX(e,e,t,`none`);let n=oX(iX(e||t));return(e===``||nX.test(e))&&cX(n,t)?lX(e,n,t,`frontmatter`):lX(e,e,t,`unresolved`)}var fX=65536;function pX(e){let t=e.match(Fd);return t?{fenced:t[0],body:e.slice(t[0].length)}:{fenced:``,body:e}}function mX(e){if(e.trim()===``)return{doc:new lu({}),map:{}};let t;try{t=bd(e,{uniqueKeys:!1})}catch(e){let t=e instanceof Error?e.message:String(e);return{doc:new lu({}),map:null,parseError:`parse threw: ${t}`}}if(t.errors.length>0)return{doc:t,map:null,parseError:t.errors[0]?.message??`yaml parse errors`};let n;try{n=t.toJS()}catch(e){let n=e instanceof Error?e.message:String(e);return{doc:t,map:null,parseError:`toJS threw: ${n}`}}if(typeof n!=`object`||!n||Array.isArray(n))return{doc:t,map:null,parseError:`top-level value is not a mapping`};let r=jd.safeParse(n);if(!r.success){let e=r.error.issues[0],n=e&&Array.isArray(e.path)?e.path.join(`.`):``,i=e?.message??`unknown`;return{doc:t,map:null,parseError:n?`value at "${n}" failed schema: ${i}`:`schema validation failed: ${i}`}}return{doc:t,map:r.data}}function hX(e){return e===``?{doc:new lu({}),map:{}}:mX(zd(e))}function gX(e){let{fenced:t}=pX(e),{map:n,parseError:r}=hX(t);return{map:n??{},parseError:r}}function _X(e){let{fenced:t}=pX(e);if(t===``)return[];let{doc:n,map:r}=hX(t);return r===null?[]:xX(n)}function vX(e){return typeof e==`object`&&!!e&&`key`in e}function yX(e){let t=e.key;return typeof t==`string`?t:t&&typeof t==`object`&&`value`in t&&typeof t.value==`string`?t.value:null}function bX(e,t){let n=e.key;if(typeof n==`string`){e.key=t;return}if(n&&typeof n==`object`){n.value=t;return}e.key=t}function xX(e){let t=e.contents;if(!t||!(`items`in t)||!Array.isArray(t.items))return[];let n=[];for(let e of t.items){if(!vX(e))continue;let t=yX(e);t!==null&&n.push(t)}return n}function SX(e){if(e.contents==null||!(`items`in e.contents)){let t=e.createNode({});return e.contents=t,t}return e.contents}function CX(e){let t=e.contents;return!t||!(`items`in t)||(t.items?.length??0)===0?``:Wd(e.toString(Bd))}function wX(e){let t=new TextEncoder().encode(e).byteLength;return t>65536?{kind:`region_too_large`,bytes:t,limit:fX}:null}function TX(e){let t=CX(e),n=wX(t);return n?{ok:!1,error:n}:{ok:!0,nextFenced:t}}function EX(e,t){if(Object.hasOwn(t,`frontmatter`))return{ok:!1,error:{kind:`reserved_key`,key:Sd}};let{doc:n,map:r}=hX(e);if(r===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};try{SX(n);for(let[e,r]of Object.entries(t)){if(r===null){n.delete(e);continue}let t=Ed.safeParse(r);if(!t.success)return{ok:!1,error:{kind:`invalid_value`,key:e,reason:t.error.issues[0]?.message??`invalid value`}};n.set(e,Ud(n,n.get(e,!0),t.data))}return TX(n)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function DX(e,t,n,r={}){if(t===`frontmatter`||n===`frontmatter`)return{ok:!1,error:{kind:`reserved_key`,key:Sd}};let{doc:i,map:a}=hX(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};if(t===n)return{ok:!0,nextFenced:e};let o=i.contents;if(!o||!(`items`in o)||!Array.isArray(o.items))return{ok:!1,error:{kind:`unknown_key`,key:t}};let s=o.items.find(e=>vX(e)&&yX(e)===t);if(!s)return{ok:!1,error:{kind:`unknown_key`,key:t}};if(!r.allowDuplicate&&o.items.some(e=>vX(e)&&e!==s&&yX(e)===n))return{ok:!1,error:{kind:`duplicate_target`,key:n}};try{return bX(s,n),TX(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function OX(e,t){let{doc:n,map:r}=hX(e);if(r===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let i=n.contents;if(!i||!(`items`in i)||!Array.isArray(i.items))return{ok:!0,nextFenced:e};let a=xX(n);if(a.length!==t.length||!kX(a,t))return{ok:!1,error:{kind:`reorder_mismatch`,expected:a,got:[...t]}};try{let e=i.items.filter(vX),r=[];for(let n of t){let i=e.findIndex(e=>yX(e)===n);if(i===-1)return{ok:!1,error:{kind:`reorder_mismatch`,expected:a,got:[...t]}};let[o]=e.splice(i,1);o&&r.push(o)}return i.items=r,TX(n)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function kX(e,t){let n=new Map;for(let t of e)n.set(t,(n.get(t)??0)+1);for(let e of t){let t=(n.get(e)??0)-1;if(t<0)return!1;n.set(e,t)}for(let e of n.values())if(e!==0)return!1;return!0}function AX(e){if(e.length===0)return{kind:`invalid_path`,path:[...e],reason:`path must have at least one segment`};for(let t=0;t<e.length;t++){let n=e[t];if(typeof n!=`string`&&typeof n!=`number`)return{kind:`invalid_path`,path:[...e],reason:`path segment at index ${t} must be string or number`};if(typeof n==`number`&&(!Number.isInteger(n)||n<0))return{kind:`invalid_path`,path:[...e],reason:`numeric path segment at index ${t} must be a non-negative integer`}}return e[0]===`frontmatter`?{kind:`reserved_key`,key:Sd}:null}function jX(e,t,n){let r=AX(t);if(r)return{ok:!1,error:r};let{doc:i,map:a}=hX(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let o=Ed.safeParse(n);if(!o.success)return{ok:!1,error:{kind:`invalid_value`,key:String(t[t.length-1]),reason:o.error.issues[0]?.message??`invalid value`}};try{return SX(i),i.setIn(t,Ud(i,i.getIn(t,!0),o.data)),TX(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function MX(e,t){let n=AX(t);if(n)return{ok:!1,error:n};let{doc:r,map:i}=hX(e);if(i===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};try{return r.getIn(t,!0)===void 0?{ok:!0,nextFenced:e}:(r.deleteIn(t),TX(r))}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function NX(e,t){if(t.length===0){let t=e.contents;return Bs(t)?t:null}let n=e.getIn(t,!0);return Bs(n)?n:null}function PX(e,t,n,r={}){let i=AX(t);if(i)return{ok:!1,error:i};let a=t[t.length-1];if(typeof a!=`string`)return{ok:!1,error:{kind:`invalid_path`,path:[...t],reason:`cannot rename: last path segment must be a string (map key)`}};if(t.length===1&&n===`frontmatter`)return{ok:!1,error:{kind:`reserved_key`,key:Sd}};let{doc:o,map:s}=hX(e);if(s===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};if(a===n)return{ok:!0,nextFenced:e};let c=NX(o,t.slice(0,-1));if(!c)return{ok:!1,error:{kind:`unknown_key`,key:a}};let l=c.items.find(e=>vX(e)&&yX(e)===a);if(!l)return{ok:!1,error:{kind:`unknown_key`,key:a}};if(!r.allowDuplicate&&c.items.some(e=>vX(e)&&e!==l&&yX(e)===n))return{ok:!1,error:{kind:`duplicate_target`,key:n}};try{return bX(l,n),TX(o)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function FX(e,t,n){if(t.length===0)return OX(e,n);let r=AX(t);if(r)return{ok:!1,error:r};let{doc:i,map:a}=hX(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let o=i.getIn(t,!0);if(!Bs(o))return{ok:!1,error:{kind:`invalid_path`,path:[...t],reason:`cannot reorder: target is not a map`}};let s=[];for(let e of o.items){if(!vX(e))continue;let t=yX(e);t!==null&&s.push(t)}if(s.length!==n.length||!kX(s,n))return{ok:!1,error:{kind:`reorder_mismatch`,expected:s,got:[...n]}};try{let e=o.items.filter(vX),t=[];for(let r of n){let i=e.findIndex(e=>yX(e)===r);if(i===-1)return{ok:!1,error:{kind:`reorder_mismatch`,expected:s,got:[...n]}};let[a]=e.splice(i,1);a&&t.push(a)}return o.items=t,TX(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function IX(e,t,n){let r=AX(t);if(r)return{ok:!1,error:r};let{doc:i,map:a}=hX(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let o=i.getIn(t,!0);if(!Us(o))return{ok:!1,error:{kind:`invalid_path`,path:[...t],reason:`cannot reorder: target is not a sequence`}};let s=o,c=s.items.length,l=Array.from({length:c},(e,t)=>t),u=[...n];if(!LX(u,c))return{ok:!1,error:{kind:`reorder_mismatch`,expected:l.map(String),got:u.map(String)}};try{let e=s.items.slice();return s.items=u.map(t=>e[t]),TX(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function LX(e,t){if(e.length!==t)return!1;let n=Array(t).fill(!1);for(let r of e){if(!Number.isInteger(r)||r<0||r>=t||n[r])return!1;n[r]=!0}return!0}var RX=Object.freeze({source:`local`,skipStoreHooks:!1,context:Object.freeze({origin:`form-write`})});function zX(e){return{ok:!1,error:e}}function BX(e){return{ok:!0,...e}}function VX(e){return{ok:!0,...e}}function HX(e){return{ok:!0,...e}}function UX(e){return{ok:!0,...e}}function WX(e){switch(e.kind){case`unknown_key`:return{code:`SCHEMA_INVALID`,issues:[{path:[e.key],message:`unknown key '${e.key}'`,issueCode:`unknown_key`}]};case`duplicate_target`:return{code:`SCHEMA_INVALID`,issues:[{path:[e.key],message:`key '${e.key}' already exists`,issueCode:`duplicate_target`}]};case`invalid_value`:return{code:`SCHEMA_INVALID`,issues:[{path:[e.key],message:e.reason,issueCode:`invalid_value`}]};case`reserved_key`:return{code:`SCHEMA_INVALID`,issues:[{path:[e.key],message:`'${e.key}' is a reserved frontmatter key`,issueCode:`reserved_key`}]};case`reorder_mismatch`:return{code:`WRITE_ERROR`,detail:`reorder list does not match current keys (state changed mid-drag)`};case`region_too_large`:return{code:`SCHEMA_INVALID`,issues:[{path:[],message:`Frontmatter region exceeds ${fX}-byte limit (would be ${e.bytes})`,issueCode:`region_too_large`}]};case`parse_failed`:return{code:`WRITE_ERROR`,detail:`Frontmatter YAML is malformed; fix in source mode to commit (${e.reason})`};case`invalid_path`:return{code:`SCHEMA_INVALID`,issues:[{path:[...e.path],message:e.reason,issueCode:`invalid_path`}]}}}function GX(e,t){if(e.parseError!==t.parseError||e.keys.length!==t.keys.length)return!1;for(let n=0;n<e.keys.length;n++)if(e.keys[n]!==t.keys[n])return!1;for(let n of e.keys)if(!Pd(e.map[n],t.map[n]))return!1;return!0}var KX=5;function qX(e){let t=e.toString();return{snapshot:JX(t),raw:t}}function JX(e){let{map:t,parseError:n}=gX(e);return{map:t,keys:_X(e),parseError:n}}function YX(e){return e.startsWith(`---`)}function XX(e){let t=e.document,n=t.getText(`source`),r=new Set,i=qX(n),a=i.snapshot,o=pX(i.raw).fenced,s=YX(i.raw),c=!1;function l(e=!1){if(c)return;let t,i;try{let e=qX(n);t=e.snapshot,i=e.raw}catch(e){console.warn(`[bindFrontmatterDoc] readSnapshotFromYText threw:`,e);return}if(!e&&GX(a,t)){s=YX(i);return}a=t,o=pX(i).fenced,s=YX(i);for(let e of r)try{e(t)}catch(e){console.warn(`[bindFrontmatterDoc] listener threw:`,e)}}let u=e=>{c||ZX(e,o.length,s)&&l()};n.observe(u),e.on(`synced`,d);function d(){l(!0)}function f(e){let r;return t.transact(()=>{let t=n.toString(),{fenced:i}=pX(t);if(r=e(i),!r.ok||r.nextFenced===i)return;let a=dX(r.nextFenced,t.slice(i.length)).frontmatter;n.delete(0,i.length),a!==``&&n.insert(0,a)},RX),r??{ok:!1,error:{kind:`parse_failed`,reason:`commit transact produced no result`}}}function p(e){if(c)return zX({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});if(Object.hasOwn(e,`frontmatter`))return zX({code:`SCHEMA_INVALID`,issues:[{path:[Sd],message:`'${Sd}' is a reserved frontmatter key`,issueCode:`reserved_key`}]});let t=Md.safeParse(e);if(!t.success)return zX({code:`SCHEMA_INVALID`,issues:t.error.issues.map(eX)});let n=t.data,r=Object.keys(n),i=f(e=>EX(e,n));return i.ok?BX({appliedKeys:r}):zX(WX(i.error))}function m(e,t,n={}){if(c)return zX({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let r=f(r=>DX(r,e,t,n));return r.ok?VX({oldKey:e,newKey:t}):zX(WX(r.error))}function h(e){if(c)return zX({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let t=f(t=>OX(t,e));return t.ok?HX({orderedKeys:[...e]}):zX(WX(t.error))}function g(e,t){if(c)return zX({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let n=f(n=>jX(n,e,t));return n.ok?UX({path:[...e]}):zX(WX(n.error))}function _(e){if(c)return zX({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let t=f(t=>MX(t,e));return t.ok?UX({path:[...e]}):zX(WX(t.error))}function v(e,t,n={}){if(c)return zX({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let r=f(r=>PX(r,e,t,n));return r.ok?UX({path:[...e]}):zX(WX(r.error))}function y(e,t){if(c)return zX({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let n=f(n=>FX(n,e,t));return n.ok?UX({path:[...e]}):zX(WX(n.error))}function b(e,t){if(c)return zX({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let n=f(n=>IX(n,e,t));return n.ok?UX({path:[...e]}):zX(WX(n.error))}return{current(){return qX(n).snapshot},patch(e){return p(e)},rename(e,t,n){return m(e,t,n)},reorder(e){return h(e)},patchPath(e,t){return g(e,t)},deletePath(e){return _(e)},renamePath(e,t,n){return v(e,t,n)},reorderPath(e,t){return y(e,t)},reorderSeqPath(e,t){return b(e,t)},subscribe(e){return r.add(e),()=>{r.delete(e)}},dispose(){c||(c=!0,n.unobserve(u),e.off(`synced`,d),r.clear())}}}function ZX(e,t,n){if(t===0&&n)return!0;let r=t>0?t:KX,i=0;for(let t of e.delta){if(typeof t.retain==`number`){i+=t.retain;continue}if(typeof t.insert==`string`){if(i<r)return!0;i+=t.insert.length;continue}if(t.insert!==void 0){if(i<r)return!0;i+=1;continue}if(typeof t.delete==`number`&&i<r)return!0}return!1}function QX(e,t){return e>=(t===`leading`?2:1)?e:0}function $X(e){let t=e.charCodeAt(0)===65279?e.slice(1):e,n=t.replace(/^\n+/,``);return n.replace(/\n+$/,``).length===0?{leading:0,trailing:0}:{leading:QX(t.length-n.length,`leading`),trailing:QX(n.length-n.replace(/\n+$/,``).length-1,`trailing`)}}function eZ(e,t){let n={line:e,column:1,offset:t};return{type:`paragraph`,children:[],position:{start:n,end:{...n}}}}function tZ(e,t){let n=e.children,r=n.length===0||t.leading===void 0?0:QX(t.leading.length,`leading`),i=n.length===0||t.trailing===void 0?0:QX(t.trailing.length-1,`trailing`);if(r===0&&i===0)return t;let a=n[n.length-1]?.position?.end,o=[],s=[];if(r>0)for(let e=0;e<r;e++)o.push(eZ(1+e,e));if(i>0&&typeof a?.offset==`number`&&typeof a.line==`number`)for(let e=0;e<i;e++)s.push(eZ(a.line+1+e,a.offset+1+e));if(o.length===0&&s.length===0||(e.children=[...o,...n,...s],o.length>0&&delete t.leading,s.length>0&&delete t.trailing,t.bom!==void 0||t.leading!==void 0||t.trailing!==void 0))return t;e.data!==void 0&&delete e.data.sourceDocBoundary}function nZ(e,t){if(e===``)return{slot:``,body:t};let n=t.match(/^\r?\n/);return n?{slot:n[0],body:t.slice(n[0].length)}:{slot:``,body:t}}function rZ(e){let{frontmatter:t,body:n}=Ld(e);if(t===``)return $X(e);let r=nZ(t,n).body;return/^\n*$/.test(r)?$X(e):$X(r)}var iZ=new gh.default;iZ.Match_Threshold=.5;var aZ=/\\([!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~])/g,oZ=/^\s*\|?\s*:?-+:?\s*(\|\s*:?-+:?\s*)+\|?\s*$/,sZ=/^[ \t]+([-+*]|\d+[.)]|[a-zA-Z][.)])\s/,cZ=/^\d+([.)])(?=\s)/,lZ=`1`,uZ=/\*\*\s*(`[^`]+`)\s*\*\*/g,dZ=/^(`{3,}|~{3,})/;function fZ(e){let t=new Set,n=null;for(let r=0;r<e.length;r++){let i=e[r].trimEnd(),a=dZ.exec(i);if(a){let e=a[1][0];if(n===null){n=e;continue}if(n===e){n=null;continue}}if(n!==null||r===0||!oZ.test(i))continue;let o=e[r-1].trimEnd();if(!(!o.startsWith(`|`)||oZ.test(o))){t.add(r-1),t.add(r);for(let n=r+1;n<e.length&&e[n].trimEnd().startsWith(`|`);n++)t.add(n)}}return t}function pZ(e){return e.slice(0,-1).trimEnd()}var mZ=/^(?:#{1,6}[ \t]|>|(?:[-+*]|\d{1,9}[.)])[ \t]|`{3,}|~{3,}|=+[ \t]*$|-+[ \t]*$|(?:\*[ \t]*){3,}$|(?:_[ \t]*){3,}$)/;function hZ(e){let t=new Set,n=null;for(let r=0;r<e.length;r++){let i=e[r]??``,a=/^(`{3,}|~{3,})/.exec(i.trimStart());if(a?.[1]){let e=a[1][0];if(n===null){n=e;continue}if(n===e){n=null;continue}}n!==null&&t.add(r)}return t}var gZ=/^<\/?[A-Z][A-Za-z0-9.]*(?:\s[^>]*)?>$/,_Z=/^<[A-Z][A-Za-z0-9.]*(?:\s[^>]*)?>$/,vZ=/^<\/[A-Z][A-Za-z0-9.]*\s*>$/,yZ=/<\/?[A-Z]/;function bZ(e){let t=!1;for(let n=0;n<e.length;n++)if(yZ.test(e[n]??``)){t=!0;break}if(!t)return e;let n=hZ(e),r=[],i=[],a=0;for(let t=0;t<e.length;t++){let o=e[t]??``,s=o.trim();if(n.has(t)){r.push(!1),i.push(a);continue}let c=a>=1||!/^[ \t]/.test(o);r.push(c&&gZ.test(s));let l=c&&vZ.test(s),u=c&&!l&&_Z.test(s)&&!s.endsWith(`/>`);l?(a=Math.max(0,a-1),i.push(a)):(i.push(a),u&&(a+=1))}let o=Array(e.length);for(let t=0,n=-1;t<e.length;t++)o[t]=n,(e[t]??``).trim()!==``&&(n=t);let s=Array(e.length);for(let t=e.length-1,n=e.length;t>=0;t--)s[t]=n,(e[t]??``).trim()!==``&&(n=t);let c=new Set;for(let t=0;t<e.length;t++){if((e[t]??``).trim()!==``||n.has(t)||(i[t]??0)<1)continue;let a=o[t]??-1,l=s[t]??e.length;(a>=0&&r[a]===!0||l<e.length&&r[l]===!0)&&c.add(t)}let l=[];for(let t=0;t<e.length;t++){if(c.has(t))continue;let n=e[t]??``;l.push(r[t]===!0&&(i[t]??0)>=1?n.replace(/^[ \t]+/,``):n)}return l}function xZ(e){let t=bZ(e.replace(/^/,``).replace(/\r/g,``).replace(aZ,`$1`).replace(uZ,`$1`).replace(/^\n+/,``).replace(/^[*-]{3,}(?=\n|$)/,`---`).replace(/(\n)([#>+-]|\d+[.)]|`{3,}|~{3,})/g,`
@@ -484,9 +484,9 @@ $2`).split(`
484
484
  out.textContent = '$' + Number(amt.value).toLocaleString();
485
485
  });
486
486
  <\/script>
487
- </div>`}],K$=[{name:`--chart-1`,light:`oklch(0.62 0.19 259)`,dark:`oklch(0.72 0.14 259)`},{name:`--chart-2`,light:`oklch(0.58 0.14 145)`,dark:`oklch(0.73 0.13 145)`},{name:`--chart-3`,light:`oklch(0.62 0.15 70)`,dark:`oklch(0.77 0.14 70)`},{name:`--chart-4`,light:`oklch(0.55 0.18 290)`,dark:`oklch(0.72 0.16 290)`},{name:`--chart-5`,light:`oklch(0.58 0.21 25)`,dark:`oklch(0.72 0.2 25)`},{name:`--primary`,light:`oklch(0.5621 0.1983 259.59)`,dark:`#69a3ff`},{name:`--primary-foreground`,light:`oklch(0.985 0 0)`,dark:`oklch(0.205 0 0)`},{name:`--foreground`,light:`oklch(0.145 0 0)`,dark:`oklch(0.985 0 0)`},{name:`--background`,light:`oklch(1 0 0)`,dark:`oklch(0.145 0 0)`},{name:`--card`,light:`oklch(1 0 0)`,dark:`oklch(0.205 0 0)`},{name:`--card-foreground`,light:`oklch(0.145 0 0)`,dark:`oklch(0.985 0 0)`},{name:`--muted-foreground`,light:`oklch(0.556 0 0)`,dark:`oklch(0.708 0 0)`},{name:`--border`,light:`oklch(0.922 0 0)`,dark:`oklch(1 0 0 / 10%)`},{name:`--destructive`,light:`oklch(0.577 0.245 27.325)`,dark:`oklch(0.704 0.191 22.216)`},{name:`--radius`,light:`0.625rem`,dark:`0.625rem`}];function q$(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);if(n<=0)return t;let r=t.slice(n).toLowerCase();return P$.includes(r)?t.slice(0,n):t}var J$=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`}]),Y$=1e4;new Set(J$.map(e=>e.value));var X$=uD.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}}}}),Z$=CD.extend({name:`emphasis`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`*`}}},addInputRules(){return[FE({find:vD,type:this.type,getAttributes:{sourceDelimiter:`*`}}),FE({find:bD,type:this.type,getAttributes:{sourceDelimiter:`_`}})]}}),Q$=_D.extend({name:`strong`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`**`}}},addInputRules(){return[FE({find:fD,type:this.type,getAttributes:{sourceDelimiter:`**`}}),FE({find:mD,type:this.type,getAttributes:{sourceDelimiter:`__`}})]}}),$$=uE.create({name:`escapeMark`,priority:10,excludes:``,inclusive:!1,parseHTML(){return[{tag:`span[data-escape-mark]`}]},renderHTML(){return[`span`,{"data-escape-mark":``},0]}}),e1=rD.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 t1({node:e}){return``.repeat(e.nodeSize-e.content.size)}function n1(e){let t=0;for(let n of e){let e=Number.parseInt(n,10);!Number.isNaN(e)&&e>t&&(t=e)}return String(t+1)}function r1(e){let t=[];return e.descendants(e=>(e.type.name===`footnoteDefinition`&&t.push(String(e.attrs.identifier??``)),!0)),t}function i1(e){let t=null;return e.forEach((e,n)=>{e.type.name===`footnoteDefinition`&&(t=n+e.nodeSize)}),t??e.content.size}var a1=rD.create({name:`footnoteReference`,marks:`_`,group:`inline`,inline:!0,atom:!0,selectable:!0,draggable:!1,priority:60,renderText:t1,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}})}}}),o1=TD.extend({marks:`_`,priority:60,addAttributes(){return{...this.parent?.(),hardBreakStyle:{default:`backslash`},sourceRaw:{default:null}}}}),s1=DD.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}}}}),c1=rD.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]}}),l1=rD.create({name:`imageReference`,marks:`_`,group:`inline`,inline:!0,atom:!0,priority:60,renderText:t1,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 u1(e){if(typeof e!=`string`||!e.startsWith(`/`))return e;let t=globalThis.window?.okDesktop?.config?.apiOrigin;return typeof t==`string`&&t?t+e:e}var d1=kD.extend({marks:`_`,priority:60,renderText:t1,addAttributes(){return{...this.parent?.(),sourceUrl:{default:null,rendered:!1}}},renderHTML({HTMLAttributes:e}){let t=Jw(this.options.HTMLAttributes,e);return typeof t.src==`string`&&(t.src=u1(t.src)),[`img`,t]}}),f1=rD.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`?!1:{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}})}}}),p1=rD.create({name:`jsxInline`,group:`inline`,inline:!0,atom:!1,content:`text*`,isolating:!1,selectable:!0,priority:60,renderText:t1,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`?!1:{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]}}),m1=[`https`,`http`,`mailto`,`tel`,`ftp`,`sms`],h1=m1.map(e=>`${e}:`).join(`|`),g1=RegExp(`^(?:${h1}|\\/|#|\\?|\\.\\/|\\.\\.\\/)`,`i`);function _1(e){let t=e.trim();return t===``?!0:g1.test(t)}function v1(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)}var y1=new Set(m1.map(e=>`${e}:`)),b1=`https://placeholder.invalid`;function x1(e){try{let t=new URL(e,b1);return y1.has(t.protocol.toLowerCase())}catch{return!1}}var S1=`LinkFidelity must be derived from the Link extension`,C1=Xre.extend({priority:60,addOptions(){let e=this.parent?.();if(e===void 0)throw Error(S1);return{...e,openOnClick:!1,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer`},isAllowedUri:x1,shouldAutoLink:()=>!0}},addAttributes(){let e=this.parent?.();if(e===void 0)throw Error(S1);return{...e,linkStyle:{default:`inline`,rendered:!1},refLabel:{default:null,rendered:!1},sourceForm:{default:null,rendered:!1},target:{default:null,rendered:!1},anchor:{default:null,rendered:!1},alias:{default:null,rendered:!1},sourceUrlForm:{default:null,rendered:!1},sourceTitleMarker:{default:null,rendered:!1},sourceTarget:{default:null,rendered:!1},sourceAnchor:{default:null,rendered:!1},sourceAlias:{default:null,rendered:!1}}}}),w1=rD.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 T1(e){return e.type.name===`list`&&!e.attrs.ordered}function E1(e){return e.type.name===`list`&&!!e.attrs.ordered}function D1(e){let t=!1;return e.forEach(e=>{e.type.name===`listItem`&&e.attrs.checked!==null&&(t=!0)}),t}function O1(e,t,n,r,i,a,o){let s=Rw(e=>e.type.name===`list`)(e.selection);if(s&&i(s.node)){let{$from:n,$to:i}=e.selection;return n.blockRange(i)?Lv(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 Pv(n,a)(e,void 0)?t?Pv(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)}):!0:!1}function k1(e){return e===`x`||e===`X`}function A1(e){return e===`X`?`X`:null}function j1(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=Ug(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}var M1=/^\s*([-+*])\s$/,N1=/^\s*(\d+)([.)])\s$/,P1=/^\s*[-*+]\s\[([ xX]?)\]\s$/,F1=/^\s*\[([ xX]?)\]\s$/,I1=rD.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,Jw(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:O1(e,t,n,r,e=>T1(e)&&!D1(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:O1(e,t,n,r,e=>E1(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:O1(e,t,n,r,e=>T1(e)&&D1(e),{ordered:!1},{checked:!1})}}},addInputRules(){return[RE({find:M1,type:this.type,getAttributes:e=>({ordered:!1,bulletMarker:e[1]}),joinPredicate:(e,t)=>t.attrs.ordered===!1}),RE({find:N1,type:this.type,getAttributes:e=>({ordered:!0,start:Number(e[1]),listMarkerDelimiter:e[2]}),joinPredicate:(e,t)=>t.attrs.ordered===!0}),new nE({find:P1,handler:({state:e,range:t,match:n})=>j1(e,t,k1(n[1]),A1(n[1]))?void 0:null}),new nE({find:F1,handler:({state:e,range:t,match:n})=>j1(e,t,k1(n[1]),A1(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()}}}),L1=rD.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`,Jw(t),0]:[`li`,Jw(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(Jw(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}}}}),R1=I1,z1=L1,B1=rD.create({name:`mathInline`,marks:`_`,group:`inline`,inline:!0,atom:!0,selectable:!0,priority:60,renderText:t1,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`?!1:{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}})}}}),V1=rD.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`?!1:{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}}}}),H1=uae.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceMarkerSpacings:{default:null}}}}),U1=pae.extend({excludes:``,addAttributes(){return{...this.parent?.(),sourceFenceChar:{default:"`"},sourceFenceLength:{default:1},sourcePadded:{default:!1,rendered:!1}}}}),W1=rD.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)}}}),G1=uE.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)}}}),K1=yE.create({name:`docFidelity`,addGlobalAttributes(){return[{types:[`doc`],attributes:{sourceDocBoundary:{default:null,rendered:!1}}}]}});function q1(e){for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return t;return null}function J1(e){let t=!1;return e.descendants(e=>t?!1:(e.type.name===`list`&&(t=!0),!t)),t}function Y1(e){let{selection:t}=e;return t instanceof q?t.$cursor:null}function X1(e){let t=Y1(e);if(t?.parentOffset!==0)return!1;let n=q1(t);if(n===null||t.depth!==n+1||t.index(n)!==0)return!1;let r=t.index(n-1);return r===0?!1:J1(t.node(n-1).child(r-1))}function Z1(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 Q1(e){let t=Y1(e);if(!t||t.parentOffset!==t.parent.content.size)return!1;let n=q1(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=Z1(t,n);return r!==null&&r<n}var $1=yE.create({name:`listBoundaryMerge`,addKeyboardShortcuts(){let e=()=>{let{editor:e}=this;if(!X1(e.state))return!1;if(e.commands.undoInputRule())return!0;let{state:t,view:n}=e;return ev(t,n.dispatch,n)},t=()=>{let{editor:e}=this;if(!Q1(e.state))return!1;let{state:t,view:n}=e;return tv(t,n.dispatch,n)};return{Backspace:e,"Mod-Backspace":e,Delete:t,"Mod-Delete":t}}}),e0=yE.create({name:`plainTextClipboard`,priority:1e3,addProseMirrorPlugins(){return[new q_({key:new X_(`okPlainTextClipboard`),props:{clipboardTextSerializer:e=>e.content.textBetween(0,e.content.size,`
487
+ </div>`}],K$=[{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`}];({stable:{appId:`com.inkeep.open-knowledge`,productName:`OpenKnowledge`,packageName:`@inkeep/open-knowledge-desktop`,linuxExecutableName:`openknowledge`,linuxPackageNames:{deb:`openknowledge`,rpm:`OpenKnowledge`}},beta:{appId:`com.inkeep.open-knowledge.beta`,productName:`OpenKnowledge Beta`,packageName:`openknowledge-beta-desktop`,linuxExecutableName:`openknowledge-beta`,linuxPackageNames:{deb:`openknowledge-beta-desktop`,rpm:`openknowledge-beta-desktop`}}}).stable.productName;function q$(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);if(n<=0)return t;let r=t.slice(n).toLowerCase();return P$.includes(r)?t.slice(0,n):t}var J$=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`}]),Y$=1e4;new Set(J$.map(e=>e.value));var X$=uD.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}}}}),Z$=CD.extend({name:`emphasis`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`*`}}},addInputRules(){return[FE({find:vD,type:this.type,getAttributes:{sourceDelimiter:`*`}}),FE({find:bD,type:this.type,getAttributes:{sourceDelimiter:`_`}})]}}),Q$=_D.extend({name:`strong`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`**`}}},addInputRules(){return[FE({find:fD,type:this.type,getAttributes:{sourceDelimiter:`**`}}),FE({find:mD,type:this.type,getAttributes:{sourceDelimiter:`__`}})]}}),$$=uE.create({name:`escapeMark`,priority:10,excludes:``,inclusive:!1,parseHTML(){return[{tag:`span[data-escape-mark]`}]},renderHTML(){return[`span`,{"data-escape-mark":``},0]}}),e1=rD.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 t1({node:e}){return``.repeat(e.nodeSize-e.content.size)}function n1(e){let t=0;for(let n of e){let e=Number.parseInt(n,10);!Number.isNaN(e)&&e>t&&(t=e)}return String(t+1)}function r1(e){let t=[];return e.descendants(e=>(e.type.name===`footnoteDefinition`&&t.push(String(e.attrs.identifier??``)),!0)),t}function i1(e){let t=null;return e.forEach((e,n)=>{e.type.name===`footnoteDefinition`&&(t=n+e.nodeSize)}),t??e.content.size}var a1=rD.create({name:`footnoteReference`,marks:`_`,group:`inline`,inline:!0,atom:!0,selectable:!0,draggable:!1,priority:60,renderText:t1,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}})}}}),o1=TD.extend({marks:`_`,priority:60,addAttributes(){return{...this.parent?.(),hardBreakStyle:{default:`backslash`},sourceRaw:{default:null}}}}),s1=DD.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}}}}),c1=rD.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]}}),l1=rD.create({name:`imageReference`,marks:`_`,group:`inline`,inline:!0,atom:!0,priority:60,renderText:t1,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 u1(e){if(typeof e!=`string`||!e.startsWith(`/`))return e;let t=globalThis.window?.okDesktop?.config?.apiOrigin;return typeof t==`string`&&t?t+e:e}var d1=kD.extend({marks:`_`,priority:60,renderText:t1,addAttributes(){return{...this.parent?.(),sourceUrl:{default:null,rendered:!1}}},renderHTML({HTMLAttributes:e}){let t=Jw(this.options.HTMLAttributes,e);return typeof t.src==`string`&&(t.src=u1(t.src)),[`img`,t]}}),f1=rD.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`?!1:{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}})}}}),p1=rD.create({name:`jsxInline`,group:`inline`,inline:!0,atom:!1,content:`text*`,isolating:!1,selectable:!0,priority:60,renderText:t1,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`?!1:{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]}}),m1=[`https`,`http`,`mailto`,`tel`,`ftp`,`sms`],h1=m1.map(e=>`${e}:`).join(`|`),g1=RegExp(`^(?:${h1}|\\/|#|\\?|\\.\\/|\\.\\.\\/)`,`i`);function _1(e){let t=e.trim();return t===``?!0:g1.test(t)}function v1(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)}var y1=new Set(m1.map(e=>`${e}:`)),b1=`https://placeholder.invalid`;function x1(e){try{let t=new URL(e,b1);return y1.has(t.protocol.toLowerCase())}catch{return!1}}var S1=`LinkFidelity must be derived from the Link extension`,C1=Xre.extend({priority:60,addOptions(){let e=this.parent?.();if(e===void 0)throw Error(S1);return{...e,openOnClick:!1,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer`},isAllowedUri:x1,shouldAutoLink:()=>!0}},addAttributes(){let e=this.parent?.();if(e===void 0)throw Error(S1);return{...e,linkStyle:{default:`inline`,rendered:!1},refLabel:{default:null,rendered:!1},sourceForm:{default:null,rendered:!1},target:{default:null,rendered:!1},anchor:{default:null,rendered:!1},alias:{default:null,rendered:!1},sourceUrlForm:{default:null,rendered:!1},sourceTitleMarker:{default:null,rendered:!1},sourceTarget:{default:null,rendered:!1},sourceAnchor:{default:null,rendered:!1},sourceAlias:{default:null,rendered:!1}}}}),w1=rD.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 T1(e){return e.type.name===`list`&&!e.attrs.ordered}function E1(e){return e.type.name===`list`&&!!e.attrs.ordered}function D1(e){let t=!1;return e.forEach(e=>{e.type.name===`listItem`&&e.attrs.checked!==null&&(t=!0)}),t}function O1(e,t,n,r,i,a,o){let s=Rw(e=>e.type.name===`list`)(e.selection);if(s&&i(s.node)){let{$from:n,$to:i}=e.selection;return n.blockRange(i)?Lv(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 Pv(n,a)(e,void 0)?t?Pv(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)}):!0:!1}function k1(e){return e===`x`||e===`X`}function A1(e){return e===`X`?`X`:null}function j1(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=Ug(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}var M1=/^\s*([-+*])\s$/,N1=/^\s*(\d+)([.)])\s$/,P1=/^\s*[-*+]\s\[([ xX]?)\]\s$/,F1=/^\s*\[([ xX]?)\]\s$/,I1=rD.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,Jw(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:O1(e,t,n,r,e=>T1(e)&&!D1(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:O1(e,t,n,r,e=>E1(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:O1(e,t,n,r,e=>T1(e)&&D1(e),{ordered:!1},{checked:!1})}}},addInputRules(){return[RE({find:M1,type:this.type,getAttributes:e=>({ordered:!1,bulletMarker:e[1]}),joinPredicate:(e,t)=>t.attrs.ordered===!1}),RE({find:N1,type:this.type,getAttributes:e=>({ordered:!0,start:Number(e[1]),listMarkerDelimiter:e[2]}),joinPredicate:(e,t)=>t.attrs.ordered===!0}),new nE({find:P1,handler:({state:e,range:t,match:n})=>j1(e,t,k1(n[1]),A1(n[1]))?void 0:null}),new nE({find:F1,handler:({state:e,range:t,match:n})=>j1(e,t,k1(n[1]),A1(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()}}}),L1=rD.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`,Jw(t),0]:[`li`,Jw(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(Jw(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}}}}),R1=I1,z1=L1,B1=rD.create({name:`mathInline`,marks:`_`,group:`inline`,inline:!0,atom:!0,selectable:!0,priority:60,renderText:t1,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`?!1:{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}})}}}),V1=rD.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`?!1:{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}}}}),H1=uae.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceMarkerSpacings:{default:null}}}}),U1=pae.extend({excludes:``,addAttributes(){return{...this.parent?.(),sourceFenceChar:{default:"`"},sourceFenceLength:{default:1},sourcePadded:{default:!1,rendered:!1}}}}),W1=rD.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)}}}),G1=uE.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)}}}),K1=yE.create({name:`docFidelity`,addGlobalAttributes(){return[{types:[`doc`],attributes:{sourceDocBoundary:{default:null,rendered:!1}}}]}});function q1(e){for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return t;return null}function J1(e){let t=!1;return e.descendants(e=>t?!1:(e.type.name===`list`&&(t=!0),!t)),t}function Y1(e){let{selection:t}=e;return t instanceof q?t.$cursor:null}function X1(e){let t=Y1(e);if(t?.parentOffset!==0)return!1;let n=q1(t);if(n===null||t.depth!==n+1||t.index(n)!==0)return!1;let r=t.index(n-1);return r===0?!1:J1(t.node(n-1).child(r-1))}function Z1(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 Q1(e){let t=Y1(e);if(!t||t.parentOffset!==t.parent.content.size)return!1;let n=q1(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=Z1(t,n);return r!==null&&r<n}var $1=yE.create({name:`listBoundaryMerge`,addKeyboardShortcuts(){let e=()=>{let{editor:e}=this;if(!X1(e.state))return!1;if(e.commands.undoInputRule())return!0;let{state:t,view:n}=e;return ev(t,n.dispatch,n)},t=()=>{let{editor:e}=this;if(!Q1(e.state))return!1;let{state:t,view:n}=e;return tv(t,n.dispatch,n)};return{Backspace:e,"Mod-Backspace":e,Delete:t,"Mod-Delete":t}}}),e0=yE.create({name:`plainTextClipboard`,priority:1e3,addProseMirrorPlugins(){return[new q_({key:new X_(`okPlainTextClipboard`),props:{clipboardTextSerializer:e=>e.content.textBetween(0,e.content.size,`
488
488
 
489
- `)}})]}}),t0=uE.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 n0(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||r0(n)===r?!0:DQ(e)===t}function r0(e){return e.replace(/\\([!-/:-@[-`{-~])/g,`$1`)}var i0=Aae.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`~~`,rendered:!1}}}}),a0=yA.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDashCounts:{default:null},sourceOuterPipes:{default:null,rendered:!1},sourceAlignmentPadding:{default:null,rendered:!1}}}}),o0=fA.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),s0=pA.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),c0=rD.create({name:`tag`,marks:`_`,group:`inline`,inline:!0,atom:!0,selectable:!0,priority:60,renderText:t1,addAttributes(){return{value:{default:``}}},parseHTML(){return[{tag:`a[data-tag]`,getAttrs:e=>typeof e==`string`?!1:{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()}}}),l0=/^(?:---|—-|___\s|\*\*\*\s)$/;function u0(e){let t=String(e[0]??``).replace(/\s+$/,``);return t===`—-`?`---`:t}var d0=hae.extend({name:`thematicBreak`,priority:60,addAttributes(){return{...this.parent?.(),sourceRaw:{default:`---`}}},addInputRules(){return[IE({find:l0,type:this.type,getAttributes:e=>({sourceRaw:u0(e)})})]}}),f0=Mae.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceForm:{default:`u`,rendered:!1}}}});function p0(e,t){let{target:n,anchor:r,alias:i}=e;if(!t.separatorCrossed)return e;if(r!==null){let e=_0(r);return{target:n,anchor:e.length>0?e:null,alias:i===null?null:v0(i)}}return{target:_0(n),anchor:null,alias:i===null?null:v0(i)}}function m0(e,t,n){let r=e.trim();return r===t?!0:n===`alias`?v0(r)===t:_0(r)===t}function h0(e,t,n){return typeof e==`string`&&m0(e,t,n)?e:t}function g0(e){return _0(e.trim())===``}function _0(e){return e.endsWith(`\\`)?e.slice(0,-1):e}function v0(e){return e.replace(/\\\|/g,`|`)}function y0(e){let t=``,n=0;for(let r of e)r===`\\`?n++:(r===`|`&&n%2==0&&(t+=`\\`),n=0),t+=r;return t}function b0(e){return e.replace(/\|/g,`\\|`)}var x0=/^\[\[([^[\]|#]+?)(?:#([^\]|]+?))?(?:\|([^\]]+?))?\]\]/;function S0(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function C0(e){let t=e.match(x0);if(!t)return null;let{target:n,anchor:r,alias:i}=p0({target:t[1]?.trim()??``,anchor:S0(t[2]),alias:S0(t[3])},{separatorCrossed:t[3]!==void 0});return n?{type:`wikilink`,raw:t[0],target:n,anchor:r,alias:i}:null}function w0(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}var T0=rD.create({name:`wikiLink`,marks:`_`,group:`inline`,inline:!0,atom:!0,priority:60,renderText:t1,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`?!1:{target:e.getAttribute(`data-target`)||``,alias:S0(e.getAttribute(`data-alias`)),anchor:S0(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:S0(e.getAttribute(`data-alias`)),anchor:S0(e.getAttribute(`data-anchor`)),resolved:!1}:!1}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.target??``),r=S0(e.attrs.alias),i=S0(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`},w0({target:n,alias:r,anchor:i})]}});function E0(e){let t=e.split(`/`).pop()??e,n=t.lastIndexOf(`.`);return n<=0||n===t.length-1?``:t.slice(n+1).toLowerCase()}function D0(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}var O0=rD.create({name:`wikiLinkEmbed`,group:`inline`,inline:!0,atom:!0,priority:60,renderText:t1,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:S0(e.getAttribute(`data-alias`)),anchor:S0(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=S0(e.attrs.alias),i=S0(e.attrs.anchor),a=S0(e.attrs.resolvedSrc),o=E0(n);if(yp.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`},D0({target:n,alias:r,anchor:i})]}}),k0=[f1,V1,p1,B1,T0,O0,c0,R1,z1,Z$,Q$,i0,f0,U1,X$,H1,s1,d0,C1,c1,w1,o1,$$,K1,t0,e0,_j.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}}),$1,a0.configure({resizable:!0}),mA,s0,o0,d1.configure({inline:!0}),l1,$re,G1,W1,a1,e1],A0=/^[a-zA-Z0-9][\w/-]*$/;function j0(e){if(typeof e!=`string`)return!1;let t=e.startsWith(`#`)?e.slice(1):e;return A0.test(t)}var M0=`Tags must start with a letter or digit and contain only letters, digits, underscores, dashes, and slashes.`;function N0(e){return e.startsWith(`#`)?e.slice(1):e}function P0(e){return typeof e==`string`?[e]:Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function F0(e){if(!e||e.trim()===``)return[];let{map:t}=Vd(e);if(!t)return[];let n=P0(t.tags),r=[];for(let e of n){let t=N0(e);A0.test(t)&&r.push(t)}return r}var I0=I({changes:F(Ua(`kind`,[I({key:M(),kind:z(`added`),after:Ed}).loose(),I({key:M(),kind:z(`removed`),before:Ed}).loose(),I({key:M(),kind:z(`changed`),before:Ed,after:Ed}).loose()])),unparseable:I({before:M(),after:M()}).loose().nullable()}).loose();function L0(e){let{fenced:t}=pX(e),n=hX(t);if(n.map===null)return{fenced:t,map:{},keys:[],parseError:n.parseError};let r=Gd(n.doc);return{fenced:t,map:n.map,keys:r.length>0?r:Object.keys(n.map),parseError:void 0}}function R0(e,t){let n=L0(e),r=L0(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}Pd(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}}`${mh}`;function z0(e){let t=e.indexOf(`/`);return t===-1?e:e.slice(t+1)}function B0(e,t){let n=encodeURIComponent(t.projectDir);if(t.prompt===``)return`claude://${e.mode}/new?folder=${n}`;let r=encodeURIComponent(t.prompt);return`claude://${e.mode}/new?q=${r}&folder=${n}`}function V0(e){let t=encodeURIComponent(e.projectDir);return e.prompt===``?`codex://new?path=${t}`:`codex://new?prompt=${encodeURIComponent(e.prompt)}&path=${t}`}function H0(e){let t=Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`));return t<0?e:e.substring(t+1)}function U0(e){let t=encodeURIComponent(H0(e.projectDir));return e.prompt===``?`cursor://anysphere.cursor-deeplink/prompt?workspace=${t}&mode=agent`:`cursor://anysphere.cursor-deeplink/prompt?text=${encodeURIComponent(encodeURIComponent(e.prompt))}&workspace=${t}&mode=agent`}var W0=RegExp("[\\u0000-\\u001f\\u007f-\\u009f\\u200b-\\u200f\\u2028-\\u202e\\u2060-\\u2069\\ufeff`]+",`g`),G0=RegExp("[ \\u00a0\\u0000-\\u001f\\u007f-\\u009f\\u200b-\\u200f\\u2028-\\u202e\\u2060-\\u2069\\ufeff`]+",`g`);function K0(e){return e.replace(W0,`_`)}function q0(e){return e.replace(G0,`_`)}var J0="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`.";function Y0(e){return`${J0} ${e}`}var X0=`You're running in the terminal of the OpenKnowledge desktop app.`,Z0=`You're an agent working inside OpenKnowledge, with its MCP tools available to you.`;function $ae(e){return`${Z0} ${J0} ${e===null?`Then stop.`:`Read \`${K0(e)}\` via the OpenKnowledge MCP server, then stop.`}`}function Q0(e){return`${X0} ${J0} ${e===null?`Then stop.`:`Read \`${K0(e)}\` via the OpenKnowledge MCP server, then stop.`}`}function $0(e,t,n,r=`url`){let i=`Let's work on \`${K0(e)}\` using OpenKnowledge.`;return S2(t?`${i} Open the OK editor in web view.`:i,n,r)}function e2(e,t,n){let r=`Use your open-knowledge-write-skill skill to author the ${t} Open Knowledge skill \`${K0(e)}\`. Edit it with the Open Knowledge tools.`;return n?`${r} Open the OK editor in web view.`:r}function t2(e,t,n,r=`url`){let i=`Let's work on the \`${K0(e)}\` folder using OpenKnowledge.`;return S2(t?`${i} Open the OK editor in web view.`:i,n,r)}function n2(e,t,n=`url`){let r=`Let's work on this project using OpenKnowledge.`;return S2(e?`${r} Open the OK editor in web view.`:r,t,n)}function r2(e,t,n,r,i=`url`){let a=t?`Open the OK editor in web view.`:``,o=e=>a===``?e:e.includes(`
489
+ `)}})]}}),t0=uE.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 n0(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||r0(n)===r?!0:DQ(e)===t}function r0(e){return e.replace(/\\([!-/:-@[-`{-~])/g,`$1`)}var i0=Aae.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`~~`,rendered:!1}}}}),a0=yA.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDashCounts:{default:null},sourceOuterPipes:{default:null,rendered:!1},sourceAlignmentPadding:{default:null,rendered:!1}}}}),o0=fA.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),s0=pA.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),c0=rD.create({name:`tag`,marks:`_`,group:`inline`,inline:!0,atom:!0,selectable:!0,priority:60,renderText:t1,addAttributes(){return{value:{default:``}}},parseHTML(){return[{tag:`a[data-tag]`,getAttrs:e=>typeof e==`string`?!1:{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()}}}),l0=/^(?:---|—-|___\s|\*\*\*\s)$/;function u0(e){let t=String(e[0]??``).replace(/\s+$/,``);return t===`—-`?`---`:t}var d0=hae.extend({name:`thematicBreak`,priority:60,addAttributes(){return{...this.parent?.(),sourceRaw:{default:`---`}}},addInputRules(){return[IE({find:l0,type:this.type,getAttributes:e=>({sourceRaw:u0(e)})})]}}),f0=Mae.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceForm:{default:`u`,rendered:!1}}}});function p0(e,t){let{target:n,anchor:r,alias:i}=e;if(!t.separatorCrossed)return e;if(r!==null){let e=_0(r);return{target:n,anchor:e.length>0?e:null,alias:i===null?null:v0(i)}}return{target:_0(n),anchor:null,alias:i===null?null:v0(i)}}function m0(e,t,n){let r=e.trim();return r===t?!0:n===`alias`?v0(r)===t:_0(r)===t}function h0(e,t,n){return typeof e==`string`&&m0(e,t,n)?e:t}function g0(e){return _0(e.trim())===``}function _0(e){return e.endsWith(`\\`)?e.slice(0,-1):e}function v0(e){return e.replace(/\\\|/g,`|`)}function y0(e){let t=``,n=0;for(let r of e)r===`\\`?n++:(r===`|`&&n%2==0&&(t+=`\\`),n=0),t+=r;return t}function b0(e){return e.replace(/\|/g,`\\|`)}var x0=/^\[\[([^[\]|#]+?)(?:#([^\]|]+?))?(?:\|([^\]]+?))?\]\]/;function S0(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function C0(e){let t=e.match(x0);if(!t)return null;let{target:n,anchor:r,alias:i}=p0({target:t[1]?.trim()??``,anchor:S0(t[2]),alias:S0(t[3])},{separatorCrossed:t[3]!==void 0});return n?{type:`wikilink`,raw:t[0],target:n,anchor:r,alias:i}:null}function w0(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}var T0=rD.create({name:`wikiLink`,marks:`_`,group:`inline`,inline:!0,atom:!0,priority:60,renderText:t1,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`?!1:{target:e.getAttribute(`data-target`)||``,alias:S0(e.getAttribute(`data-alias`)),anchor:S0(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:S0(e.getAttribute(`data-alias`)),anchor:S0(e.getAttribute(`data-anchor`)),resolved:!1}:!1}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.target??``),r=S0(e.attrs.alias),i=S0(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`},w0({target:n,alias:r,anchor:i})]}});function E0(e){let t=e.split(`/`).pop()??e,n=t.lastIndexOf(`.`);return n<=0||n===t.length-1?``:t.slice(n+1).toLowerCase()}function D0(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}var O0=rD.create({name:`wikiLinkEmbed`,group:`inline`,inline:!0,atom:!0,priority:60,renderText:t1,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:S0(e.getAttribute(`data-alias`)),anchor:S0(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=S0(e.attrs.alias),i=S0(e.attrs.anchor),a=S0(e.attrs.resolvedSrc),o=E0(n);if(yp.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`},D0({target:n,alias:r,anchor:i})]}}),k0=[f1,V1,p1,B1,T0,O0,c0,R1,z1,Z$,Q$,i0,f0,U1,X$,H1,s1,d0,C1,c1,w1,o1,$$,K1,t0,e0,_j.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}}),$1,a0.configure({resizable:!0}),mA,s0,o0,d1.configure({inline:!0}),l1,$re,G1,W1,a1,e1],A0=/^[a-zA-Z0-9][\w/-]*$/;function j0(e){if(typeof e!=`string`)return!1;let t=e.startsWith(`#`)?e.slice(1):e;return A0.test(t)}var M0=`Tags must start with a letter or digit and contain only letters, digits, underscores, dashes, and slashes.`;function N0(e){return e.startsWith(`#`)?e.slice(1):e}function P0(e){return typeof e==`string`?[e]:Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function F0(e){if(!e||e.trim()===``)return[];let{map:t}=Vd(e);if(!t)return[];let n=P0(t.tags),r=[];for(let e of n){let t=N0(e);A0.test(t)&&r.push(t)}return r}var I0=I({changes:F(Ja(`kind`,[I({key:M(),kind:z(`added`),after:Ed}).loose(),I({key:M(),kind:z(`removed`),before:Ed}).loose(),I({key:M(),kind:z(`changed`),before:Ed,after:Ed}).loose()])),unparseable:I({before:M(),after:M()}).loose().nullable()}).loose();function L0(e){let{fenced:t}=pX(e),n=hX(t);if(n.map===null)return{fenced:t,map:{},keys:[],parseError:n.parseError};let r=Gd(n.doc);return{fenced:t,map:n.map,keys:r.length>0?r:Object.keys(n.map),parseError:void 0}}function R0(e,t){let n=L0(e),r=L0(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}Pd(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}}`${mh}`;function z0(e){let t=e.indexOf(`/`);return t===-1?e:e.slice(t+1)}function B0(e,t){let n=encodeURIComponent(t.projectDir);if(t.prompt===``)return`claude://${e.mode}/new?folder=${n}`;let r=encodeURIComponent(t.prompt);return`claude://${e.mode}/new?q=${r}&folder=${n}`}function V0(e){let t=encodeURIComponent(e.projectDir);return e.prompt===``?`codex://new?path=${t}`:`codex://new?prompt=${encodeURIComponent(e.prompt)}&path=${t}`}function H0(e){let t=Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`));return t<0?e:e.substring(t+1)}function U0(e){let t=encodeURIComponent(H0(e.projectDir));return e.prompt===``?`cursor://anysphere.cursor-deeplink/prompt?workspace=${t}&mode=agent`:`cursor://anysphere.cursor-deeplink/prompt?text=${encodeURIComponent(encodeURIComponent(e.prompt))}&workspace=${t}&mode=agent`}var W0=RegExp("[\\u0000-\\u001f\\u007f-\\u009f\\u200b-\\u200f\\u2028-\\u202e\\u2060-\\u2069\\ufeff`]+",`g`),G0=RegExp("[ \\u00a0\\u0000-\\u001f\\u007f-\\u009f\\u200b-\\u200f\\u2028-\\u202e\\u2060-\\u2069\\ufeff`]+",`g`);function K0(e){return e.replace(W0,`_`)}function q0(e){return e.replace(G0,`_`)}var J0="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`.";function Y0(e){return`${J0} ${e}`}var X0=`You're running in the terminal of the OpenKnowledge desktop app.`,Z0=`You're an agent working inside OpenKnowledge, with its MCP tools available to you.`;function $ae(e){return`${Z0} ${J0} ${e===null?`Then stop.`:`Read \`${K0(e)}\` via the OpenKnowledge MCP server, then stop.`}`}function Q0(e){return`${X0} ${J0} ${e===null?`Then stop.`:`Read \`${K0(e)}\` via the OpenKnowledge MCP server, then stop.`}`}function $0(e,t,n,r=`url`){let i=`Let's work on \`${K0(e)}\` using OpenKnowledge.`;return S2(t?`${i} Open the OK editor in web view.`:i,n,r)}function e2(e,t,n){let r=`Use your open-knowledge-write-skill skill to author the ${t} Open Knowledge skill \`${K0(e)}\`. Edit it with the Open Knowledge tools.`;return n?`${r} Open the OK editor in web view.`:r}function t2(e,t,n,r=`url`){let i=`Let's work on the \`${K0(e)}\` folder using OpenKnowledge.`;return S2(t?`${i} Open the OK editor in web view.`:i,n,r)}function n2(e,t,n=`url`){let r=`Let's work on this project using OpenKnowledge.`;return S2(e?`${r} Open the OK editor in web view.`:r,t,n)}function r2(e,t,n,r,i=`url`){let a=t?`Open the OK editor in web view.`:``,o=e=>a===``?e:e.includes(`
490
490
  `)?[e,``,a].join(`
491
491
  `):`${e} ${a}`,s=e=>e.split(`
492
492
  `).map(e=>`> ${e}`).join(`
@@ -515,7 +515,7 @@ $2`).split(`
515
515
  `)}function L2(e,t,n,r,i,a,o){if(e.kind===`lines`)return N2(e.startLine,e.endLine,n);if(e.kind===`anchor`)return M2(e.markdown,n);let s=j2(e.markdown);return c2(I2(t,``,s,r,i),a,o)<=l2(o,i2)?s:M2(e.markdown,n)}function R2(e,t,n,r){let{target:i}=e,a=e.transport??`url`,o=q0(e.docRelativePath),s=`Let's work on @${o} using OpenKnowledge.`,c=L2(t,s,o,n,r,i,a);return I2(s,T2(e.instruction,i,e=>I2(s,e,c,n,r),a),c,n,r)}function z2(e){let{target:t}=e,n=e.autoOpen?k2:``,r=P2(e.mentions);if(e.scope===`doc`&&e.selection!==void 0)return R2(e,e.selection,r,n);let i=F2(e);return I2(i,T2(e.instruction,t,e=>I2(i,e,``,r,n),e.transport??`url`),``,r,n)}function B2(e){let t=q0(e.relativePath),n=e.ruleAlias===void 0?`${e.source}/${e.code}`:`${e.source}/${e.code} (${e.ruleAlias})`,r=[`Fix this lint problem in @${t} using OpenKnowledge.`,``,`Problem: ${n} at line ${e.line}, column ${e.column}:`,``,A2(e.message.trim())],i=e.lineText??``;if(i.trim()!==``){let t=m2(i);r.push(``,`Line ${e.line} reads:`,``,t,i,t)}return r.push(``,`Edit @${t} via the OpenKnowledge MCP server, then re-lint it to confirm the problem is resolved.`),r.join(`
516
516
  `)}function V2(e){if(e===null)return[`Fix every problem across this project's documents using OpenKnowledge.`,``,"Run the `audit` tool for the current list of lint violations and broken links, then work file by file — the `lint` tool with `fix: true` clears one document's mechanically-fixable problems at a time — and re-audit until it reports no problems."].join(`
517
517
  `);let t=q0(e);return[`Fix every problem in @${t} using OpenKnowledge.`,``,`Run the \`audit\` tool scoped to it for the current list of lint violations and broken links, then fix each one — the \`lint\` tool with \`fix: true\` clears the mechanically-fixable ones — and re-audit @${t} until it reports no problems.`].join(`
518
- `)}function H2(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}}var U2=new Set([`opencode.json`]),W2=/^\.[A-Za-z0-9_-]+\/skills\/[^/]+\/.+$/;function G2(e){return W2.test(e)}function K2(e){return G2(e)?!1:e.split(`/`).some(e=>e.startsWith(`.`))?!0:U2.has(e.slice(e.lastIndexOf(`/`)+1))}function q2(e,t){let n=H2(e);n.ok||t.addIssue({code:`custom`,message:n.reason})}var J2=M().superRefine(q2).optional(),Y2=M().superRefine(q2),X2={agentId:M().optional(),agentName:M().optional(),colorSeed:M().optional(),clientName:M().optional(),clientVersion:M().optional(),label:M().optional()},Z2=M().optional(),Q2=/^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;Ua(`kind`,[I({kind:z(`doc`),docPath:M().min(1)}).loose(),I({kind:z(`folder`),folderPath:M()}).loose()]);var $2=R([`no-remote`,`detached-head`,`branch-not-on-origin`,`non-github-remote`,`invalid-path`,`unsupported-share-url`]),e4=R([`current`,`stale`,`absent`,`empty`]),t4=Ua(`ok`,[I({ok:z(!0),shareUrl:M().min(1),sharedUrl:M().min(1),branch:M().min(1),freshness:e4.optional().catch(void 0)}).loose(),I({ok:z(!1),error:$2,branch:M().min(1).optional()}).loose()]),n4=R([`user`,`org`]),r4=I({login:M().min(1),kind:n4,avatarUrl:M().optional()}).loose(),i4=R([`auth-required`,`network`]),a4=Ua(`ok`,[I({ok:z(!0),owners:F(r4)}).loose(),I({ok:z(!1),error:i4}).loose()]),o4=Ua(`ok`,[I({ok:z(!0),available:P()}).loose(),I({ok:z(!1),error:i4}).loose()]),s4=R([`public`,`private`]);I({owner:M().min(1),name:M().min(1),visibility:s4,description:M().optional()}).loose();var c4=R([`name-conflict`,`saml-sso`,`auth-required`,`push-failed`,`init-failed`,`network`,`no-project`]),l4=Ua(`ok`,[I({ok:z(!0),ownerLogin:M().min(1),repoName:M().min(1),cloneUrl:M().min(1),defaultBranch:M().min(1)}).loose(),I({ok:z(!1),error:c4}).loose()]);function u4(e){return!(typeof e!=`string`||e.length===0||e.startsWith(`-`)||/[\x00-\x1F\x7F]/.test(e)||/\s/.test(e)||e.includes(`:`)||e.split(`/`).includes(`..`))}var d4=e=>e.refine(u4,`invalid branch name`),f4={shareTargetExists:P(),dirtyConflicts:I({conflicts:P(),files:F(M().min(1))}).loose(),branchIsLocal:P(),shareTargetOnOriginBranch:P().optional()};Ua(`detached`,[I({detached:z(!1),currentBranch:M().min(1).nullable(),currentHeadSha:Ma(),...f4}).loose(),I({detached:z(!0),currentBranch:Ma(),currentHeadSha:M().min(1),...f4}).loose()]),I({branch:d4(M().min(1)),principalId:M().optional(),fastForward:P().optional()}).loose();var p4=R([`dirty-conflict`,`branch-not-found`,`fetch-failed`,`checkout-failed`,`branch-in-other-worktree`,`ff-diverged`]);Ua(`ok`,[I({ok:z(!0)}).loose(),I({ok:z(!1),reason:p4,files:F(M().min(1)).optional(),otherWorktreePath:M().min(1).optional()}).loose()]),R([`on-origin`,`renamed`,`deleted`,`never-on-branch`,`changed-locally`,`unknown`]),I({branch:d4(M().min(1)),path:M(),kind:R([`doc`,`folder`]),contentRootDepth:N().int().min(1).max(65535).optional()}).loose(),Ua(`verdict`,[I({verdict:z(`on-origin`)}).loose(),I({verdict:z(`renamed`),renamedTo:M().min(1)}).loose(),I({verdict:z(`deleted`)}).loose(),I({verdict:z(`never-on-branch`)}).loose(),I({verdict:z(`changed-locally`)}).loose(),I({verdict:z(`unknown`)}).loose()]).catch({verdict:`unknown`});var m4=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()}),h4=I({serverInstanceId:M().min(1),currentBranch:M().min(1).optional(),currentDiskAckSVs:qa(M().min(1),M().min(1)).optional(),boot:m4.optional(),collabClients:N().int().nonnegative().optional()}).loose(),g4=I({id:M().min(1),display_name:M().min(1),display_email:M(),source:R([`git-config`,`synthesized`]),created_at:M().min(1)}).loose();I({collabUrl:M().nullable(),previewUrl:M().nullable(),port:N(),singleFile:P().default(!1)}).loose();var _4=R(`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:store-refused.urn:ok:error:doc-removed.urn:ok:error:doc-not-found.urn:ok:error:doc-already-exists.urn:ok:error:doc-not-open.urn:ok:error:rollback-not-configured.urn:ok:error:doc-not-available.urn:ok:error:backlink-index-not-configured.urn:ok:error:file-rescan-not-configured.urn:ok:error:shadow-not-configured.urn:ok:error:host-not-allowed.urn:ok:error:principal-not-available.urn:ok:error:not-found.urn:ok:error:auth-failed.urn:ok:error:no-project-dir.urn:ok:error:server-open-failed.urn:ok:error:doc-in-conflict.urn:ok:error:concurrent-overwrite-refused.urn:ok:error:unresolved-conflict-markers.urn:ok:error:no-conflict-tracked.urn:ok:error:no-blocking-changes.urn:ok:error:sync-not-active.urn:ok:error:project-repo-not-configured.urn:ok:error:seed-prerequisite-missing.urn:ok:error:seed-invalid-root.urn:ok:error:tag-index-not-configured.urn:ok:error:template-not-found.urn:ok:error:unsupported-asset-type.urn:ok:error:asset-not-found.urn:ok:error:single-file-mode.urn:ok:error:collab-server-not-running.urn:ok:error:gateway-timeout.urn:ok:error:cursor-not-installed.urn:ok:error:cursor-spawn-timeout.urn:ok:error:cursor-spawn-failed.urn:ok:error:handoff-target-not-installed.urn:ok:error:handoff-spawn-timeout.urn:ok:error:handoff-spawn-failed.urn:ok:error:registry-unreachable.urn:ok:error:config-not-writable.urn:ok:error:audit-superseded.urn:ok:error:theme-name-taken.urn:ok:error:theme-name-invalid`.split(`.`)),v4=I({type:_4,title:M().min(1),status:N().int().min(400).max(599),instance:M().regex(Q2,`instance must be urn:uuid:<uuid>`).optional(),detail:M().optional()}).loose();I({parentDocName:M().min(1),placement:R([`configured-attachments`,`parent-dir`]).default(`configured-attachments`),agentId:M().min(1).optional(),agentName:M().min(1).optional()}).loose();var y4=I({src:M().min(1),path:M().min(1).optional(),deduped:P().optional()}).loose();I({url:M().min(1),dir:M().min(1),branch:M().min(1).refine(u4,`invalid branch name`).optional()}).loose(),I({type:z(`error`),problem:v4}).loose();function b4(e){let t=e??(typeof navigator>`u`?void 0:navigator);return t===void 0?[]:t.languages!==void 0&&t.languages.length>0?fh(t.languages):t.language===void 0?[]:fh([t.language])}var x4={en:`ltr`,"zh-Hans":`ltr`,"zh-Hant":`ltr`,hi:`ltr`,es:`ltr`,ar:`rtl`,fr:`ltr`,bn:`ltr`,"pt-BR":`ltr`,id:`ltr`,ur:`rtl`,ko:`ltr`};function S4(e){let t=new Intl.Locale(e).getTextInfo?.().direction;return t===`rtl`||t===`ltr`?t:x4[e]}function C4(e,t){let n=t.map(e=>[ph(e),e]);for(let t of e){let e=ph(t);if(e===null)continue;let r=n.find(([t])=>t===e);if(r!==void 0)return r[1]}}function w4(e){let{override:t,storedPreference:n,preferenceList:r,supportedLocales:i}=e,a=e.autoDetectableLocales??i;if(t!==void 0){let e=C4([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=C4(r,a);return o===void 0?{locale:`en`,source:`fallback`}:{locale:o,source:`system`}}var T4=R(ef),E4=L({hosts:F(M()),scope:T4,scripts:P(),installedAt:Pi(),projection:R([`symlink`,`copy`]).optional(),contentHash:M().optional()});L({schema:z(1),skills:qa(M(),E4).default({})});var D4=`extra/screenshot.png`,O4=`extra/attachments/`,k4=3145728,A4=[`image/png`,`image/jpeg`,`image/webp`],j4={"image/png":`png`,"image/jpeg":`jpg`,"image/webp":`webp`};function M4(e){return e.startsWith(O4)}var N4=[{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:`~`}];N4.map(e=>e.name);function P4(e){let t=new Set,n=0;return{redacted:e.split(`
518
+ `)}function H2(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}}var U2=new Set([`opencode.json`]),W2=/^\.[A-Za-z0-9_-]+\/skills\/[^/]+\/.+$/;function G2(e){return W2.test(e)}function K2(e){return G2(e)?!1:e.split(`/`).some(e=>e.startsWith(`.`))?!0:U2.has(e.slice(e.lastIndexOf(`/`)+1))}function q2(e,t){let n=H2(e);n.ok||t.addIssue({code:`custom`,message:n.reason})}var J2=M().superRefine(q2).optional(),Y2=M().superRefine(q2),X2={agentId:M().optional(),agentName:M().optional(),colorSeed:M().optional(),clientName:M().optional(),clientVersion:M().optional(),label:M().optional()},Z2=M().optional(),Q2=/^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;Ja(`kind`,[I({kind:z(`doc`),docPath:M().min(1)}).loose(),I({kind:z(`folder`),folderPath:M()}).loose()]);var $2=R([`no-remote`,`detached-head`,`branch-not-on-origin`,`non-github-remote`,`invalid-path`,`unsupported-share-url`]),e4=R([`current`,`stale`,`absent`,`empty`]),t4=Ja(`ok`,[I({ok:z(!0),shareUrl:M().min(1),sharedUrl:M().min(1),branch:M().min(1),freshness:e4.optional().catch(void 0)}).loose(),I({ok:z(!1),error:$2,branch:M().min(1).optional()}).loose()]),n4=R([`user`,`org`]),r4=I({login:M().min(1),kind:n4,avatarUrl:M().optional()}).loose(),i4=R([`auth-required`,`network`]),a4=Ja(`ok`,[I({ok:z(!0),owners:F(r4)}).loose(),I({ok:z(!1),error:i4}).loose()]),o4=Ja(`ok`,[I({ok:z(!0),available:P()}).loose(),I({ok:z(!1),error:i4}).loose()]),s4=R([`public`,`private`]);I({owner:M().min(1),name:M().min(1),visibility:s4,description:M().optional()}).loose();var c4=R([`name-conflict`,`saml-sso`,`auth-required`,`push-failed`,`init-failed`,`network`,`no-project`]),l4=Ja(`ok`,[I({ok:z(!0),ownerLogin:M().min(1),repoName:M().min(1),cloneUrl:M().min(1),defaultBranch:M().min(1)}).loose(),I({ok:z(!1),error:c4}).loose()]);function u4(e){return!(typeof e!=`string`||e.length===0||e.startsWith(`-`)||/[\x00-\x1F\x7F]/.test(e)||/\s/.test(e)||e.includes(`:`)||e.split(`/`).includes(`..`))}var d4=e=>e.refine(u4,`invalid branch name`),f4={shareTargetExists:P(),dirtyConflicts:I({conflicts:P(),files:F(M().min(1))}).loose(),branchIsLocal:P(),shareTargetOnOriginBranch:P().optional()};Ja(`detached`,[I({detached:z(!1),currentBranch:M().min(1).nullable(),currentHeadSha:La(),...f4}).loose(),I({detached:z(!0),currentBranch:La(),currentHeadSha:M().min(1),...f4}).loose()]),I({branch:d4(M().min(1)),principalId:M().optional(),fastForward:P().optional()}).loose();var p4=R([`dirty-conflict`,`branch-not-found`,`fetch-failed`,`checkout-failed`,`branch-in-other-worktree`,`ff-diverged`]);Ja(`ok`,[I({ok:z(!0)}).loose(),I({ok:z(!1),reason:p4,files:F(M().min(1)).optional(),otherWorktreePath:M().min(1).optional()}).loose()]),R([`on-origin`,`renamed`,`deleted`,`never-on-branch`,`changed-locally`,`unknown`]),I({branch:d4(M().min(1)),path:M(),kind:R([`doc`,`folder`]),contentRootDepth:N().int().min(1).max(65535).optional()}).loose(),Ja(`verdict`,[I({verdict:z(`on-origin`)}).loose(),I({verdict:z(`renamed`),renamedTo:M().min(1)}).loose(),I({verdict:z(`deleted`)}).loose(),I({verdict:z(`never-on-branch`)}).loose(),I({verdict:z(`changed-locally`)}).loose(),I({verdict:z(`unknown`)}).loose()]).catch({verdict:`unknown`});var m4=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()}),h4=I({serverInstanceId:M().min(1),currentBranch:M().min(1).optional(),currentDiskAckSVs:Qa(M().min(1),M().min(1)).optional(),boot:m4.optional(),collabClients:N().int().nonnegative().optional()}).loose(),g4=I({id:M().min(1),display_name:M().min(1),display_email:M(),source:R([`git-config`,`synthesized`]),created_at:M().min(1)}).loose();I({collabUrl:M().nullable(),previewUrl:M().nullable(),port:N(),singleFile:P().default(!1)}).loose();var _4=R(`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:store-refused.urn:ok:error:doc-removed.urn:ok:error:doc-not-found.urn:ok:error:doc-already-exists.urn:ok:error:doc-not-open.urn:ok:error:rollback-not-configured.urn:ok:error:doc-not-available.urn:ok:error:backlink-index-not-configured.urn:ok:error:file-rescan-not-configured.urn:ok:error:shadow-not-configured.urn:ok:error:host-not-allowed.urn:ok:error:principal-not-available.urn:ok:error:not-found.urn:ok:error:auth-failed.urn:ok:error:no-project-dir.urn:ok:error:server-open-failed.urn:ok:error:doc-in-conflict.urn:ok:error:concurrent-overwrite-refused.urn:ok:error:unresolved-conflict-markers.urn:ok:error:no-conflict-tracked.urn:ok:error:no-blocking-changes.urn:ok:error:sync-not-active.urn:ok:error:project-repo-not-configured.urn:ok:error:seed-prerequisite-missing.urn:ok:error:seed-invalid-root.urn:ok:error:tag-index-not-configured.urn:ok:error:template-not-found.urn:ok:error:unsupported-asset-type.urn:ok:error:asset-not-found.urn:ok:error:single-file-mode.urn:ok:error:collab-server-not-running.urn:ok:error:gateway-timeout.urn:ok:error:cursor-not-installed.urn:ok:error:cursor-spawn-timeout.urn:ok:error:cursor-spawn-failed.urn:ok:error:handoff-target-not-installed.urn:ok:error:handoff-spawn-timeout.urn:ok:error:handoff-spawn-failed.urn:ok:error:registry-unreachable.urn:ok:error:config-not-writable.urn:ok:error:audit-superseded.urn:ok:error:theme-name-taken.urn:ok:error:theme-name-invalid`.split(`.`)),v4=I({type:_4,title:M().min(1),status:N().int().min(400).max(599),instance:M().regex(Q2,`instance must be urn:uuid:<uuid>`).optional(),detail:M().optional()}).loose();I({parentDocName:M().min(1),placement:R([`configured-attachments`,`parent-dir`]).default(`configured-attachments`),agentId:M().min(1).optional(),agentName:M().min(1).optional()}).loose();var y4=I({src:M().min(1),path:M().min(1).optional(),deduped:P().optional()}).loose();I({url:M().min(1),dir:M().min(1),branch:M().min(1).refine(u4,`invalid branch name`).optional()}).loose(),I({type:z(`error`),problem:v4}).loose();function b4(e){let t=e??(typeof navigator>`u`?void 0:navigator);return t===void 0?[]:t.languages!==void 0&&t.languages.length>0?fh(t.languages):t.language===void 0?[]:fh([t.language])}var x4={en:`ltr`,"zh-Hans":`ltr`,"zh-Hant":`ltr`,hi:`ltr`,es:`ltr`,ar:`rtl`,fr:`ltr`,bn:`ltr`,"pt-BR":`ltr`,id:`ltr`,ur:`rtl`,ko:`ltr`};function S4(e){let t=new Intl.Locale(e).getTextInfo?.().direction;return t===`rtl`||t===`ltr`?t:x4[e]}function C4(e,t){let n=t.map(e=>[ph(e),e]);for(let t of e){let e=ph(t);if(e===null)continue;let r=n.find(([t])=>t===e);if(r!==void 0)return r[1]}}function w4(e){let{override:t,storedPreference:n,preferenceList:r,supportedLocales:i}=e,a=e.autoDetectableLocales??i;if(t!==void 0){let e=C4([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=C4(r,a);return o===void 0?{locale:`en`,source:`fallback`}:{locale:o,source:`system`}}var T4=R(ef),E4=L({hosts:F(M()),scope:T4,scripts:P(),installedAt:zi(),projection:R([`symlink`,`copy`]).optional(),contentHash:M().optional()});L({schema:z(1),skills:Qa(M(),E4).default({})});var D4=`extra/screenshot.png`,O4=`extra/attachments/`,k4=3145728,A4=[`image/png`,`image/jpeg`,`image/webp`],j4={"image/png":`png`,"image/jpeg":`jpg`,"image/webp":`webp`};function M4(e){return e.startsWith(O4)}var N4=[{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:`~`}];N4.map(e=>e.name);function P4(e){let t=new Set,n=0;return{redacted:e.split(`
519
519
  `).map(e=>{let r=e,i=!1;for(let{name:e,regex:n,replacement:a}of N4)n.lastIndex=0,n.test(r)&&(t.add(e),i=!0,n.lastIndex=0,r=r.replace(n,a));return i&&n++,r}).join(`
520
520
  `),patterns:[...t],lineCount:n}}function F4(e){return P4(e).redacted}var I4=8192,L4=32768,R4=`…[truncated]`,z4=[`level`,`time`,`pid`,`hostname`,`msg`,`name`,`runtime`,`subsystem`,`trace_id`,`span_id`,`trace_flags`];function B4(e){let t=F4(e).trim();if(t.length===0||t[0]!==`{`)return null;let n;try{n=JSON.parse(t)}catch{return null}if(typeof n!=`object`||!n||Array.isArray(n))return null;let r=n;for(let e of z4)delete r[e];return{event:typeof r.event==`string`?r.event:void 0,fields:r}}function V4(e){return e.length<=8192?e:`${e.slice(0,8180)}${R4}`}function H4(e){return e.includes("`")?`~`:"`"}function U4(e,t,n=3){let r=RegExp(`^ {0,3}(\\${e}+)[ \\t]*$`),i=Math.max(3,n);for(let e of t.split(`
521
521
  `)){let t=r.exec(e);t&&t[1].length>=i&&(i=t[1].length+1)}return i}var W4=/notionvc:/i,G4=()=>e=>{K4(e)&&(q4(e),J4(e))};function K4(e){if(!(`children`in e)||!Array.isArray(e.children))return!1;for(let t of e.children){if(t.type===`comment`){let e=String(t.value??``);if(W4.test(e))return!0}if(t.type===`element`&&K4(t))return!0}return!1}function q4(e){if(!(`children`in e)||!Array.isArray(e.children))return;for(let t of e.children)t.type===`element`&&q4(t);let t=[];for(let n of e.children){if(n.type!==`text`){t.push(n);continue}let e=String(n.value??``);if(!e.includes(`
@@ -595,4 +595,4 @@ $2`).split(`
595
595
  `),s=e=>({start:{line:e,character:0},end:{line:e,character:o[e]?.length??0}}),c=[];for(let{schema:e,ruleId:n}of t){let t=vde(e);if(t&&!t(i))for(let e of t.errors??[]){let t=e.keyword;if(t===`if`)continue;let o=0,l,u=`invalid`,d;if(t===`maxProperties`&&e.instancePath===``)l=`This document must not have frontmatter`;else if(t===`required`&&e.instancePath===``){let t=String(e.params.missingProperty??``);l=`Frontmatter property "${t}" is required`,u=`missing`,t!==``&&(d=t)}else if(e.instancePath===``)l=`Frontmatter ${e.message??`violates "${t}"`}`;else{let n=xde(e.instancePath);n!==null&&(o=a.get(n)??0);let r=Sde(e.instancePath),s=n!==null&&r===n?i[n]:void 0;if(t===`enum`)l=`Frontmatter property "${r}" must be one of: ${(e.params.allowedValues??[]).map(String).join(`, `)}${R5(s)}`;else if(t===`format`&&L5(e.params)!==void 0){let t=e.params.format;l=`Frontmatter property "${r}" must be ${L5(e.params)} (format "${String(t)}")${R5(s)}`}else l=`Frontmatter property "${r}" ${e.message??`violates "${t}"`}`}c.push({range:s(o),severity:`warning`,source:r,code:n??t,message:l,frontmatterScope:u,...d===void 0?{}:{frontmatterProperty:d}})}}return c}var B5=`doc`;function Cde(e,t){return yG(e,gG({strings:{[B5]:e},config:t})[B5]??[])}function wde(e,t){let n=gG({strings:{[B5]:e},config:t})[B5]??[],r=e.split(`
596
596
  `),i=Tde(t);return n.map(e=>Dde(e,r,Ede(e,i)))}function Tde(e){let t=new Map;return Object.entries(e).forEach(([e,n],r)=>{let i=e.toUpperCase();if(i===`DEFAULT`)return;let a=null;if(n===`error`||n===`warning`)a=n;else if(typeof n==`object`&&n&&!Array.isArray(n)){let e=n.severity;(e===`error`||e===`warning`)&&(a=e)}a!==null&&t.set(i,{entryIndex:r,severity:a})}),t}function Ede(e,t){let n;for(let r of e.ruleNames){let e=t.get(r.toUpperCase());e!==void 0&&(n===void 0||e.entryIndex>n.entryIndex)&&(n=e)}return n?.severity??`warning`}function Dde(e,t,n){let[r,i]=e.errorRange??[1,null],a=e.lineNumber-1,o=(r??1)-1,s=t[a]?.length??0,c=i==null?s:Math.min(o+i,s),l=e.fixInfo?[Ode(e.fixInfo,e.lineNumber,t)]:void 0;return{range:{start:{line:a,character:o},end:{line:a,character:Math.max(c,o)}},severity:n,source:`markdownlint`,code:e.ruleNames[0]??`MD000`,message:e.errorDetail?`${e.ruleDescription}: ${e.errorDetail}`:e.ruleDescription,...l?{fixes:l}:{}}}function Ode(e,t,n){let r=e.lineNumber??t,i=r-1;if(e.deleteCount===-1){if(r<n.length)return{range:{start:{line:i,character:0},end:{line:i+1,character:0}},newText:``};if(i>0){let e=n[i-1]?.length??0;return{range:{start:{line:i-1,character:e},end:{line:i,character:n[i]?.length??0}},newText:``}}return{range:{start:{line:0,character:0},end:{line:0,character:n[0]?.length??0}},newText:``}}let a=(e.editColumn??1)-1;return{range:{start:{line:i,character:a},end:{line:i,character:a+Math.max(0,e.deleteCount??0)}},newText:e.insertText??``}}var V5=[`no-wiki-links`,`log-shape`,`index-shape`,`reserved-casing`,`frontmatter-required`,`frontmatter-recommended`,`frontmatter-provenance`,`frontmatter-computation`,`frontmatter-reserved-index`,`frontmatter-root-index`,`project-no-mdx`];function H5(e,t){return e?.[t]!==!1}var kde=[{id:`structure`,ids:[`no-wiki-links`,`log-shape`,`index-shape`,`reserved-casing`]},{id:`frontmatter`,ids:[`frontmatter-required`,`frontmatter-recommended`,`frontmatter-provenance`,`frontmatter-computation`,`frontmatter-reserved-index`,`frontmatter-root-index`]},{id:`project`,ids:[`project-no-mdx`]}];function Ade(e){throw Error(`Unhandled OkfRuleId variant: ${JSON.stringify(e)}`)}function jde(e){throw Error(`Unhandled OkfRuleGroupId variant: ${JSON.stringify(e)}`)}var Mde=`.ok/okf`;function Nde(e){return`${e.replace(/^frontmatter-/,``)}.schema.json`}function U5(e){return`${Mde}/${Nde(e)}`}var Pde={$schema:`http://json-schema.org/draft-07/schema#`,title:`OKF v0.2 — required frontmatter`,description:"The OKF v0.2 conformance floor. A bundle is conformant when every non-reserved .md file contains a parseable YAML frontmatter block whose `type` is non-empty. This schema is the whole of that floor: a concept carrying only `type` is fully conformant. Section numbers cite OKF v0.2: https://github.com/GoogleCloudPlatform/open-knowledge-format/blob/ad30107c31c06aec8a7d5636e0d1058118604e6f/SPEC.md#11-conformance",type:`object`,required:[`type`],properties:{type:{type:`string`,pattern:`\\S`,description:"REQUIRED, and the only always-required key in OKF. A short string identifying the kind of concept; consumers use it for routing, filtering, and presentation. Type values are not registered centrally — pick something descriptive and self-explanatory (`BigQuery Table`, `BigQuery Dataset`, `API Endpoint`, `Metric`, `Playbook`, `Reference`, `Attested Computation`). Consumers must tolerate unknown types, typically by treating them as generic concepts. The `\\S` pattern is what makes §11 rule 2 mean what it says, and it replaces a `minLength` rather than joining one: a length check alone accepts a whitespace-only value that no consumer can route on, and having both would report one mistake twice. OKF v0.2 §4.1, §11."}}},Fde={$schema:`http://json-schema.org/draft-07/schema#`,title:`OKF v0.2 — recommended frontmatter`,description:"Shapes for the OKF v0.2 recommended keys. Every key here is optional, and nothing is constrained beyond the shape OKF states: declaring a key pins its YAML type when present (so `tags` written as a comma-separated string warns) and advertises it to agents at read time. Section numbers cite OKF v0.2: https://github.com/GoogleCloudPlatform/open-knowledge-format/blob/ad30107c31c06aec8a7d5636e0d1058118604e6f/SPEC.md#41-frontmatter",type:`object`,properties:{title:{type:`string`,description:`Human-readable display name. If omitted, consumers MAY derive a title from the filename. OKF v0.2 §4.1.`},description:{type:`string`,description:"A single sentence summarizing the concept. Used by `index.md` generators, search snippets, and previews. OKF v0.2 §4.1."},resource:{type:`string`,format:`uri-reference`,description:"A URI that uniquely identifies the underlying asset the concept describes. Absent for concepts that describe abstract ideas rather than physical resources. Path-valued: an absolute URL, a bundle-relative path beginning with `/`, or an ordinary relative path — hence `uri-reference`, not `uri`, which would reject `/tables/customers.md`. OKF v0.2 §4.1, §6.2."},tags:{type:`array`,items:{type:`string`},description:`A YAML list of short strings for cross-cutting categorization. Tags stay a first-class concept through this field; OKF specifies no separate per-tag file format, so a consumer that wants a tag-browsing view synthesizes one by scanning frontmatter. OKF v0.2 §3.1, §4.1.`},timestamp:{description:"LEGACY (OKF v0.1), superseded by `generated.at` in v0.2 — one of the two deliberate breaking changes. Consumers MAY fall back to it when `generated` is absent; new documents SHOULD write `generated: { by, at }` instead. Documented here so agents are told what it is and what replaced it, but deliberately left unconstrained: v0.2 does not define it as a producer field, so validating its shape would be a rule OKF no longer has. OKF v0.2 §5.2, §13.1."}}},Ide={$schema:`http://json-schema.org/draft-07/schema#`,title:`OKF v0.2 — provenance, trust, and lifecycle frontmatter`,description:'The optional OKF v0.2 families that make "where did this come from", "how much should I trust it", and "is it still current" answerable from frontmatter alone. Every key is optional, and absence carries meaning rather than being an error: a concept with no `verified` is unverified, and a consumer must not reject it. Only `sources[].resource` and `generated.by` are required-when-their-parent-is-present, because those are the two fields OKF marks REQUIRED in this family; every other field is described but not mandated, so nothing else is enforced. Section numbers cite OKF v0.2: https://github.com/GoogleCloudPlatform/open-knowledge-format/blob/ad30107c31c06aec8a7d5636e0d1058118604e6f/SPEC.md#5-provenance-trust-and-lifecycle',type:`object`,properties:{sources:{type:`array`,description:"The materials this concept derives from, external or internal to the bundle. Lineage is expressed through links rather than a dedicated field: when an entry's `resource` points at another OKF concept, the derivation edge already exists in the bundle graph, so a consumer may recurse into that source's own `sources`. OKF v0.2 §5.1.",items:{type:`object`,required:[`resource`],properties:{resource:{type:`string`,description:"REQUIRED within an entry. Either a concrete artifact a consumer can follow (an absolute URL, a bundle-relative path, or a path into a `references/` subdirectory) or a population or scope descriptor it cannot, for example `all queries in BigQuery project X`. Deliberately NOT format-constrained: a scope descriptor is prose, so a `uri-reference` check here would warn on conformant documents. OKF v0.2 §5.1, §6.2, §6.3."},id:{type:`string`,description:"Optional. A stable key used to attribute individual claims: a markdown footnote whose label is this id (`[^ga4-schema]`) attributes the claim it follows. SHOULD be present when the body cites the source. Keyed rather than positional because agents constantly rewrite these documents — a positional index misattributes silently the moment the list is reordered. OKF v0.2 §5.1."},title:{type:`string`,description:`Optional. Human-readable label for the source. OKF v0.2 §5.1.`},author:{type:`string`,description:"Optional credibility signal — an authority signal: who or what produced the source. OKF describes this as following the actor convention (§7), but its own examples use a `team:<id>` prefix that the three §7 forms do not cover, so no pattern is enforced. OKF v0.2 §5.1, §7."},usage_count:{type:`integer`,description:"Optional credibility signal — an adoption and liveness signal: how often `resource` was exercised (dashboard views, query executions, page reads) over `usage_window`. For a single artifact it is that artifact's own exercise count; for a scope descriptor it is the number of exercises within the scope that touch the concept. Coarse by design: comparable at the alive-versus-dead and order-of-magnitude level and against a source's own history, but not a precise cross-kind ranking. Read as liveness and trend, not as a score. OKF v0.2 §5.1."},last_modified:{type:`string`,format:`date-time`,description:"Optional credibility signal — a recency signal: when the source itself last changed, as an ISO 8601 datetime with an explicit UTC offset (`2026-06-15T00:00:00Z`). Distinct from `generated.at`, which records when the concept was written. OKF v0.2 §5, §5.1."},usage_window:{type:`object`,description:"Optional per-entry override of the `usage_window` written as a sibling of `sources`. OKF v0.2 §5.1.",properties:{from:{type:`string`,format:`date-time`,description:"Start of the window framing this entry's `usage_count`, as an ISO 8601 datetime with an explicit UTC offset (`2026-06-01T00:00:00Z`). OKF v0.2 §5, §5.1."},to:{type:`string`,format:`date-time`,description:"End of the window framing this entry's `usage_count`, as an ISO 8601 datetime with an explicit UTC offset (`2026-06-30T00:00:00Z`). OKF v0.2 §5, §5.1."}}}}}},usage_window:{type:`object`,description:"Written once as a sibling of `sources`, this frames every `usage_count` in the list with a `{ from, to }` range. A single entry may carry its own `usage_window` to override it. OKF v0.2 §5, §5.1.",properties:{from:{type:`string`,format:`date-time`,description:"Start of the shared usage window, as an ISO 8601 datetime with an explicit UTC offset (`2026-06-01T00:00:00Z`). OKF v0.2 §5, §5.1."},to:{type:`string`,format:`date-time`,description:"End of the shared usage window, as an ISO 8601 datetime with an explicit UTC offset (`2026-06-30T00:00:00Z`). OKF v0.2 §5, §5.1."}}},generated:{type:`object`,required:[`by`],description:"How the current content was produced. Kept distinct from `verified` because who wrote a concept need not be who confirmed it. OKF v0.2 §5.2.",properties:{by:{type:`string`,description:"REQUIRED within `generated`. An actor in the OKF convention: `<producer>/<version>` for agents and tools (`reference_agent/gemini-2.5-pro`), `human:<id>` for a person (`human:ahormati`), or `process:<id>` for an automated process (`process:finance-nightly`). Consumers that classify trust key off the `human:` prefix, so producers MUST use it for hand-authored or human-confirmed content — a rule about which form to pick for which content, which frontmatter alone cannot check, so the three forms are documented here rather than enforced by a pattern. OKF v0.2 §5.2, §7."},at:{type:`string`,format:`date-time`,description:"An ISO 8601 datetime with an explicit UTC offset (`2026-06-30T14:00:00Z`) marking the content's last meaningful change. Consumers use it to tell a recent edit from a stale fact. Supersedes v0.1's top-level `timestamp`. OKF v0.2 §5, §5.2, §13.1."}}},verified:{description:'Who or what has confirmed the content against its sources or `resource` — a list of verification events. Multiple entries capture independent checks, for example a human sign-off plus a nightly process; "how recently" is the latest `at`. Independent of `generated.at`: content can change without re-confirmation, and facts can be re-confirmed without regeneration. A single verifier MAY be written as one bare `{ by, at }` mapping without the list dash, and consumers MUST treat that as a one-element list — hence the two accepted shapes here. Absence means unverified, which is a valid state, never a rejection. OKF v0.2 §5.2, §5.3, §11.',anyOf:[{type:`object`,description:`The bare single-verifier mapping form. OKF v0.2 §5.2.`,properties:{by:{type:`string`,description:"The verifying actor: `<producer>/<version>`, `human:<id>`, or `process:<id>`. A `human:` verifier is what raises the trust tier to human-reviewed; non-human verifiers alone yield machine-confirmed. OKF v0.2 §5.2, §5.3, §7."},at:{type:`string`,format:`date-time`,description:"An ISO 8601 datetime with an explicit UTC offset (`2026-07-01T09:00:00Z`) recording when the verification event happened. OKF v0.2 §5, §5.2."}}},{type:`array`,description:`The list form: one entry per independent verification event. OKF v0.2 §5.2.`,items:{type:`object`,properties:{by:{type:`string`,description:"The verifying actor: `<producer>/<version>`, `human:<id>`, or `process:<id>`. A `human:` verifier is what raises the trust tier to human-reviewed; non-human verifiers alone yield machine-confirmed. OKF v0.2 §5.2, §5.3, §7."},at:{type:`string`,format:`date-time`,description:"An ISO 8601 datetime with an explicit UTC offset (`2026-07-01T09:00:00Z`) recording when the verification event happened. OKF v0.2 §5, §5.2."}}}}]},status:{enum:[`draft`,`stable`,`deprecated`],description:"Lifecycle state. `draft` = not yet reviewed, possibly incomplete. `stable` = ready for consumption. `deprecated` = kept for links and history, no longer current. Absent means `stable`, so the key is only worth writing to say draft or deprecated. These three values are the whole set OKF defines, which is why this is the pack's only enum. OKF v0.2 §5.4."},stale_after:{type:`string`,format:`date-time`,description:"An absolute instant, an ISO 8601 datetime with an explicit UTC offset (`2026-12-31T00:00:00Z`): the concept is stale when `now >= stale_after`. Absolute rather than a relative TTL so staleness stays a plain comparison with no reference to when the concept was read. An instant in the past is a freshness signal for consumers, not a violation. OKF v0.2 §5, §5.5, §10.5."}}},Lde={$schema:`http://json-schema.org/draft-07/schema#`,title:`OKF v0.2 — Attested Computation frontmatter`,description:'Shapes for the OKF v0.2 computation keys, which turn a concept into a sanctioned way to compute a value so a consumer can confirm the agent ran the blessed computation instead of improvising its own. Provenance answers "where did this claim come from"; attestation answers "was this number produced the way we said it must be". This file also carries the one value-shaped rule in the pack: `runtime` is the single key OKF marks REQUIRED here, and only when `type` is `Attested Computation`. Ordinary concepts never match that condition and are unaffected, and no other key in the family is mandated. OKF records the computation and the means to check it and executes nothing itself; receipts and verdicts are runtime artifacts that are never stored in the bundle. Section numbers cite OKF v0.2: https://github.com/GoogleCloudPlatform/open-knowledge-format/blob/ad30107c31c06aec8a7d5636e0d1058118604e6f/SPEC.md#10-attested-computations-concept',type:`object`,if:{required:[`type`],properties:{type:{const:`Attested Computation`,description:"The condition, not a constraint: everything in `then` applies only to documents whose `type` is exactly `Attested Computation`. An ordinary concept never matches, so nothing in this schema is ever asked of it. `type` is also required inside the condition so a document with no type at all fails the conformance floor once, rather than also being told it is missing a `runtime` for a type it never claimed."}}},then:{required:[`runtime`]},properties:{runtime:{type:`string`,description:"REQUIRED for `type: Attested Computation`. The single field that says how to run the computation, and therefore how the executor and attester interpret it and what `parameters` mean — a parameter is a SQL bind variable, a dbt var, or a Python argument depending on the runtime. Keeping `runtime` and `parameters` in one frontmatter is what makes the binding semantics self-evident. Example values: `bigquery`, `postgres`, `dbt`, `python`, `Looker`. Not a closed set, so no enum. OKF v0.2 §10.1, §10.2."},parameters:{type:`array`,description:`The typed, named holes the agent may fill. An agent MAY only supply values for these parameters; it MUST NOT author or edit the computation. That parameter-only surface is what makes "did the sanctioned thing run" a mechanical comparison rather than a judgement call. OKF v0.2 §10.2, §10.3.`,items:{type:`object`,properties:{name:{type:`string`,description:"The parameter name the computation binds, for example `year` bound as `@year` in BigQuery SQL or `{{ var('year') }}` in dbt. OKF v0.2 §10.2, §10.3."},type:{type:`string`,description:"The parameter's type, interpreted by `runtime` (`integer`, `string`, and so on). Deliberately not constrained to JSON Schema type names, because the vocabulary belongs to the runtime. OKF v0.2 §10.2."},required:{type:`boolean`,description:`Whether the agent must supply a value for this parameter. OKF v0.2 §10.2.`}}}},computation:{type:`string`,format:`uri-reference`,description:"Optional. A path to a file holding the computation, used instead of an inline body fence — best for a long or generated computation, or one already kept as a real file shared with non-OKF tooling. When absent, the body's `# Computation` fence IS the computation. Path-valued: an absolute URL, a bundle-relative path beginning with `/`, or a relative path. OKF v0.2 §6.2, §10.2, §10.3."},executor:{type:`object`,description:"How the computation is run. A runner — an agent, or deterministic consumer code — follows `resource`, and the run returns a receipt shaped by `receipt`. Binding the computation with the parameter values into the executable artifact is the consumer's job. OKF v0.2 §10.2, §10.5.",properties:{resource:{type:`string`,format:`uri-reference`,description:"Names the run instructions or code. What sits behind it — a Skill, a script, a container — is a packaging choice; OKF fixes the interface, not the packaging. Conventionally points into a `references/` subdirectory, for example `references/skills/run-on-bq.md`. OKF v0.2 §1, §6.2, §6.3, §10.2."},receipt:{type:`array`,items:{type:`string`},description:"Declares the fields a run must return — the evidence the attester inspects, for example `[job_id, executed_sql, result]` for BigQuery or `[run_id, compiled_sql, result]` for dbt. Because the attester compares the expanded, compiled artifact the receipt carries, a rewritten query, a swapped computation file, or a mutated dependency fails the check. The receipt itself is a runtime artifact and is never stored in the bundle. OKF v0.2 §10.2, §10.3, §10.5."}}},attester:{type:`object`,description:"The deterministic check that inspects a receipt and returns a verdict. Meant to run consumer-side. Distinct from `verified`: `verified` confirms the definition still matches policy and is recorded in the bundle, while attestation confirms a single run produced the value the sanctioned way and is not stored. OKF v0.2 §10.2, §10.6.",properties:{resource:{type:`string`,format:`uri-reference`,description:"Names code — no LLM — that takes a receipt and returns a verdict, independently re-deriving the binding of `computation` with the claimed parameter values to compare against what actually ran. Conventionally points into a `references/` subdirectory, for example `references/attesters/sql-equality.py`. OKF v0.2 §6.2, §6.3, §10.2, §10.3."}}}}},Rde={$schema:`http://json-schema.org/draft-07/schema#`,title:`OKF v0.2 — index files carry no frontmatter`,description:"`index.md` is a reserved filename at any level of the hierarchy and must not be used for a concept document. Index files contain no frontmatter, with exactly one exception — a bundle-root `index.md` may carry `okf_version` — which the scope carves out with a `!index` exclusion rather than a keyword here. `maxProperties: 0` is the mechanism rather than the boolean schema `false`, because a document with no frontmatter block validates as `{}` and `false` would reject that too, flagging the very documents that are correct. `log.md` is deliberately NOT covered: §9 constrains a log's date headings, ordering, and prose entries but never its frontmatter, and OKF's own reference bundle ships a `log.md` carrying `type` and `title`. Section numbers cite OKF v0.2: https://github.com/GoogleCloudPlatform/open-knowledge-format/blob/ad30107c31c06aec8a7d5636e0d1058118604e6f/SPEC.md#8-index-files",type:`object`,maxProperties:0},zde={$schema:`http://json-schema.org/draft-07/schema#`,title:`OKF v0.2 — bundle-root index.md`,description:"The bundle-root `index.md` is the only index file OKF permits frontmatter in, and `okf_version` is the key it names there. OKF states the declaration as a MAY, so it is not required here. Nor is the frontmatter closed to other keys: §8 grants the exception for `okf_version` specifically, but §11 tells consumers not to reject a bundle over unknown additional keys, and that ambiguity is resolved in favor of the looser reading. The one thing pinned is the value's shape, because a YAML float is provably lossy where a version string is not. Section numbers cite OKF v0.2: https://github.com/GoogleCloudPlatform/open-knowledge-format/blob/ad30107c31c06aec8a7d5636e0d1058118604e6f/SPEC.md#12-versioning",type:`object`,properties:{okf_version:{type:`string`,pattern:`^[0-9]+\\.[0-9]+$`,description:'The OKF version this bundle targets, as `<major>.<minor>` — currently `"0.2"`. Quote it: unquoted `0.2` parses as a YAML number, so a consumer comparing version strings sees a float instead, and `0.10` would silently become `0.1`. A minor bump is backward-compatible additions; a major bump may rename required fields or change reserved filenames. Consumers that do not understand the declared version should attempt best-effort consumption rather than refusing the bundle. OKF v0.2 §12.'}}},W5=[`**`,`!**/{index,log}`],G5=[{id:`frontmatter-required`,appliesTo:W5,schema:Pde},{id:`frontmatter-recommended`,appliesTo:W5,schema:Fde},{id:`frontmatter-provenance`,appliesTo:W5,schema:Ide},{id:`frontmatter-computation`,appliesTo:W5,schema:Lde},{id:`frontmatter-reserved-index`,appliesTo:[`**/index`,`!index`],schema:Rde},{id:`frontmatter-root-index`,appliesTo:[`index`],schema:zde}],Bde=Object.fromEntries(V5.filter(e=>!G5.some(t=>t.id===e)).map(e=>[e,!1]));function K5(e,t){return t===void 0?[]:G5.filter(n=>H5(e,n.id)&&k5([...n.appliesTo]).matches(t))}function Vde(e){return G5.filter(t=>H5(e,t.id)).map(e=>({appliesTo:[...e.appliesTo],file:U5(e.id)}))}function Hde(e,t,n){let r=K5(t,n);return r.length===0?[]:z5(e,r.map(e=>({file:U5(e.id),schema:e.schema,ruleId:e.id})),{source:`okf`})}function q5(e,t){return bG(`okf:${e}`,(n,r)=>{try{t(n,r)}catch(t){console.warn(`[lint] OKF rule "${e}" failed${r.data.okfDocName?` on "${r.data.okfDocName}"`:``}`,t)}})}function J5(e,t,n){let r=k5(t);return q5(e,(e,t)=>{r.matches(t.data.okfDocName)&&n(e,t)})}var Y5=e=>({line:e.line-1,character:e.column-1});function Ude(e,t){if(e&&`start`in e)return{start:Y5(e.start),end:Y5(e.end)};if(e){let n=Y5(e);return{start:n,end:{line:n.line,character:t[n.line]?.length??0}}}return{start:{line:0,character:0},end:{line:0,character:t[0]?.length??0}}}function Wde(e,t){return{range:Ude(e.place,t),severity:`warning`,source:`okf`,code:e.ruleId??`okf`,message:e.reason}}function Gde(e,t,n){if(t.length===0)return[];let r=Ce().use(ae).use(D).use(iF,[`yaml`]);for(let e of t)r.use(e);let i=new _({value:e});n!==void 0&&(i.data.okfDocName=n);let a=r.parse(i);r.runSync(a,i);let o=e.split(`
597
597
  `);return i.messages.map(e=>Wde(e,o))}var Kde=`**/index`;function qde(e){let t=!1;return h(e,[`link`,`linkReference`],()=>(t=!0,!1)),t}var Jde=J5(`index-shape`,Kde,(e,t)=>{let n=!1;for(let r of e.children){if(r.type===`heading`){n=!0;continue}r.type===`list`&&!n&&t.message(`This index list is not under a section heading, so an Open Knowledge Format consumer reading the file as navigation has no name to file its entries under — an index is one or more heading-led sections of bulleted links.`,r)}h(e,`listItem`,e=>{e.children.some(e=>e.type===`list`)||qde(e)||t.message(`This index entry has no link, so an Open Knowledge Format consumer reading the file as navigation has nowhere to follow it. Every entry in the format's own reference bundles is a link followed by a short description.`,e)})}),Yde=`**/log`,Xde=/^\s*(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])(?!\d)/;function Zde(e,t,n){let r=new Date(Date.UTC(e,t-1,n));return r.getUTCFullYear()===e&&r.getUTCMonth()===t-1&&r.getUTCDate()===n}var Qde=/^\s*\d{4}[-/.]\d{1,2}[-/.]\d{1,2}/;function X5(e){let t=e.trim();return t.length>60?`${t.slice(0,59)}…`:t}var $de=J5(`log-shape`,Yde,(e,t)=>{let n;h(e,`heading`,e=>{if(e.depth!==2)return;let r=w(e),i=Xde.exec(r);if(!i){t.message(Qde.test(r)?`Log date heading "${X5(r)}" is not in ISO 8601 YYYY-MM-DD form, the one form an Open Knowledge Format log requires of its date headings.`:`Log entry heading "${X5(r)}" is not a date, so it falls outside the dated-entry format an Open Knowledge Format consumer reads a log as — nothing under it reaches the change-history timeline.`,e);return}let a=`${i[1]}-${i[2]}-${i[3]}`;if(!Zde(Number(i[1]),Number(i[2]),Number(i[3]))){t.message(`Log date heading "${a}" is not a real calendar date, so it is not ISO 8601 — the one form an Open Knowledge Format log requires of its date headings.`,e);return}n!==void 0&&a>n&&t.message(`Log date heading "${a}" is newer than the entry above it — an Open Knowledge Format log is a flat list of date-grouped entries, newest first.`,e),n=a})}),efe=/\[\[[^[\]\n]+\]\]/g;function tfe(e){let t=`Wiki-link ${e} won't resolve for an external Open Knowledge Format consumer — it renders as literal text and its graph edge is lost.`;return e.includes(`|`)?`${t} The alias "|" also splits a GFM table cell.`:t}var nfe=q5(`no-wiki-links`,(e,t)=>{let n=typeof t.value==`string`?t.value:String(t.value);h(e,`text`,e=>{let r=e.position?.start,i=e.position?.end,a=r?.offset,o=a===void 0||i?.offset===void 0?e.value:n.slice(a,i.offset),s=0,c=r?.line??0,l=r?.column??0,u=e=>{for(;s<e;s+=1)o[s]===`
598
- `?(c+=1,l=1):l+=1;return{line:c,column:l}};for(let e of o.matchAll(efe)){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(tfe(e[0]),s)}})}),rfe=[`index`,`log`],ife=q5(`reserved-casing`,(e,t)=>{let n=t.data.okfDocName;if(n===void 0)return;let r=q$(n),i=r.toLowerCase();rfe.includes(i)&&r!==i&&t.message(`This file is named "${r}", but the Open Knowledge Format only recognizes "${i}". On a case-sensitive filesystem a consumer reads it as an ordinary concept document rather than the reserved file it is meant to be.`)}),Z5=[{id:`no-wiki-links`,rule:nfe},{id:`log-shape`,rule:$de},{id:`index-shape`,rule:Jde},{id:`reserved-casing`,rule:ife}],afe=Z5.map(e=>e.rule);function ofe(e){return e===void 0?afe:Z5.filter(t=>H5(e,t.id)).map(e=>e.rule)}var sfe=Va([P(),R(nm),qa(M(),Pa())]),cfe={id:`markdownlint`,sliceSchema:I({enabled:P(),rules:qa(M(),sfe)}),defaultSlice:{enabled:!1,rules:E5},async lint(e,t){return wde(e,D5(t.rules))},fix(e,t){return Cde(e,D5(t.rules))}},lfe=I({appliesTo:Va([M(),F(M())]).optional(),file:M(),enabled:P().optional(),key:M().optional(),schema:qa(M(),Pa()).optional()}),Q5=[cfe,{id:`frontmatter`,sliceSchema:I({enabled:P(),schemas:F(lfe)}),defaultSlice:{enabled:!1,schemas:[]},async lint(e,t,n){return z5(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:qa(M(),P()).optional(),generate:I({index:P().optional()}).optional()}),defaultSlice:{enabled:!1},async lint(e,t,n){return[...Gde(e,ofe(t.rules),n.docName),...Hde(e,t.rules,n.docName)]},frontmatter:{schemasForDoc:(e,t)=>K5(e.rules,t),narrowSliceToFrontmatter:e=>({...e,rules:{...e.rules,...Bde}}),advertisedMappings:e=>Vde(e.rules)}}],ufe={enabled:!0,plugins:Object.fromEntries(Q5.map(e=>[e.id,e.defaultSlice]))};function dfe(e,t){return e.enabled&&e.plugins[t]?.enabled===!0}function ffe(e,t){if(!e?.enabled||t===void 0||t===``)return[];let n=[];for(let r of Q5){if(r.frontmatter===void 0)continue;let i=e.plugins[r.id];i?.enabled===!0&&n.push(...r.frontmatter.schemasForDoc(i,t))}return n}function pfe(e){let t=Object.fromEntries(Q5.map(t=>{let n=e.plugins[t.id]??t.defaultSlice;return t.frontmatter===void 0?[t.id,{...n,enabled:!1}]:[t.id,t.frontmatter.narrowSliceToFrontmatter(n)]}));return{...e,plugins:t}}var mfe=new Set([`.markdownlint.json`,`.markdownlint.jsonc`]);function hfe(e){return mfe.has(e)}I({docName:J2,summary:Z2,content:M().optional(),...X2}).loose(),I({docName:J2,summary:Z2,markdown:M(),position:R([`append`,`prepend`,`replace`]).optional(),extension:R(P$).optional(),...X2}).loose(),I({docName:J2,summary:Z2,find:M().min(1),replace:M(),offset:N().int().nonnegative().optional(),...X2}).loose(),I({docName:J2,connectionId:M().min(1),scope:R([`last`,`session`,`file`,`count`]).optional(),count:N().int().positive().optional(),...X2}).loose().refine(e=>e.scope!==`count`||e.count!==void 0,{message:`count is required when scope is 'count'`,path:[`count`]});var $5=I({value:M(),truncatedFrom:N().int().nonnegative().optional(),hint:M().optional()}).loose(),gfe=Ua(`kind`,[I({kind:z(`inline`),content:M()}),I({kind:z(`truncated`),byteLength:N().int().nonnegative(),hint:M()})]),e7=I({kind:z(`content-divergence`),intendedBytes:N().int().nonnegative(),actualBytes:N().int().nonnegative(),byteDelta:N().int(),divergenceType:M().optional(),currentState:gfe.optional(),hint:M().optional()}).loose(),_fe=I({type:z(`orphan`),parentCandidates:F(M()),message:M()}).loose(),t7=I({kind:z(`disk-edit-reconciled`),intendedBytes:N().int().nonnegative(),actualBytes:N().int().nonnegative(),byteDelta:N().int(),mergeOutcome:M().optional(),hint:M().optional()}).loose();Ua(`kind`,[e7,t7]);var vfe=I({kind:z(`mermaid-parse-error`),fenceIndex:N().int().positive(),fenceFirstLine:M(),message:M(),line:N().int().positive().optional()}).loose(),n7=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(),r7=F(Ua(`kind`,[e7,t7,vfe,I({kind:z(`lint-violation`),source:M(),code:M(),message:M(),severity:R([`error`,`warning`,`info`,`hint`]),line:N().int().positive(),column:N().int().positive(),linkTarget:M().optional(),localTarget:n7.optional()}).loose()])).min(1),i7=F(I({href:M(),resolvedTo:M().nullable(),reason:R([`no-such-doc`,`no-such-file`,`unresolvable`]),localTarget:n7.optional()}).loose()),a7=I({reason:M().min(1),count:N().int().positive()}).loose();I({timestamp:M().min(1),summary:$5.optional(),warnings:r7.optional()}).loose(),I({timestamp:M().min(1),subscriberCount:N().int().nonnegative(),systemSubscriberCount:N().int().nonnegative(),hints:F(_fe).optional(),summary:$5.optional(),warnings:r7.optional(),brokenLinks:i7,brokenLinkSuppression:a7.optional()}).loose(),I({timestamp:M().min(1),subscriberCount:N().int().nonnegative(),systemSubscriberCount:N().int().nonnegative(),summary:$5.optional(),warnings:r7.optional(),brokenLinks:i7,brokenLinkSuppression:a7.optional()}).loose(),I({docName:M().min(1),scope:R([`last`,`session`,`count`]),undone:P()}).loose(),I({docs:F(I({docName:Y2,markdown:M(),position:R([`append`,`prepend`,`replace`]).optional(),extension:R(P$).optional(),summary:Z2}).loose()).min(1).max(100),...X2}).loose();var yfe=I({type:_4,title:M(),detail:M().optional()}).loose(),bfe=Ua(`status`,[I({status:z(`written`),docName:M().min(1),summary:$5.optional(),warnings:r7.optional(),brokenLinks:i7,brokenLinkSuppression:a7.optional()}).loose(),I({status:z(`error`),docName:M().min(1),error:yfe}).loose()]);I({timestamp:M().min(1),results:F(bfe),written:N().int().nonnegative(),failed:N().int().nonnegative()}).loose(),I({docName:J2,patch:qa(M(),Va([Ed,Ma()])),types:qa(M(),R(Cd)).optional(),summary:Z2,...X2}).loose(),I({timestamp:M().min(1),subscriberCount:N().int().nonnegative(),systemSubscriberCount:N().int().nonnegative(),appliedKeys:F(M()),summary:$5.optional(),warnings:r7.optional(),brokenLinks:i7,brokenLinkSuppression:a7.optional()}).loose();function xfe(e){return{enabled:e.enabled??!0,plugins:{markdownlint:{...e.markdownlint,rules:e.markdownlint.rules??E5},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}}}}}var Sfe=Object.fromEntries(Q5.map(e=>[e.id,e.sliceSchema])),Cfe=I({effective:I({enabled:P(),plugins:I(Sfe)}),configFile:M().nullable().optional(),configProblems:F(M()).optional()}),wfe=Va([P(),qa(M(),Pa())]),Tfe=new Set([`__proto__`]),o7=M().min(1).max(256).refine(e=>!Tfe.has(e),{message:`schema property name cannot be __proto__`});I({ruleId:M().min(1).max(64).regex(/^[A-Za-z][A-Za-z0-9_-]*$/),value:Va([wfe,Ma()])}),I({file:M().min(1).max(512),delete:z(!0).optional(),field:o7.optional(),parentPath:F(Va([o7,I({items:z(!0)}).strict()])).max(8).optional(),removeField:z(!0).optional(),renameTo:o7.optional(),constraint:I({type:R([`string`,`number`,`boolean`,`array`,`object`]).nullable().optional(),enum:F(Va([M(),N(),P()])).nullable().optional(),itemsEnum:F(Va([M(),N(),P()])).nullable().optional(),itemsType:R([`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`});var Efe=I({schemas:F(M()),truncated:P()}).strict(),s7=I({line:N(),character:N()}),c7=I({start:s7,end:s7}),l7=I({range:c7,severity:R([`error`,`warning`,`info`,`hint`]),source:M(),code:M(),message:M(),fixes:F(I({range:c7,newText:M()})).optional(),frontmatterScope:R(Qp).optional(),frontmatterProperty:M().optional()}),u7=F(M()).optional();I({files:F(I({file:M(),diagnostics:F(l7),ran:u7,warnings:F(M()).optional()})),fileCount:N(),errorCount:N(),warningCount:N(),warnings:F(M()),ran:u7});var Dfe=l7.extend({linkTarget:M().optional(),localTarget:n7.optional()}),Ofe=I({files:F(I({file:M(),diagnostics:F(Dfe)})),fileCount:N(),errorCount:N(),warningCount:N(),warnings:F(M()),ran:u7,brokenLinkSuppression:a7.optional()}),d7=I({errorCount:N().int().nonnegative(),warningCount:N().int().nonnegative()}),kfe=I({files:F(I({file:M(),lint:d7,links:d7})),fileCount:N().int().nonnegative(),errorCount:N().int().nonnegative(),warningCount:N().int().nonnegative(),warnings:F(M()),brokenLinkSuppression:a7.optional()});I({docName:J2,summary:Z2,...X2}).loose();var Afe=I({reason:R([`re-lint-threw`,`source-went-blind`]),message:M().min(1)}),jfe=I({file:M(),fixedCount:N(),diagnostics:F(l7),errorCount:N(),warningCount:N(),ran:u7,warnings:F(M()).optional(),diagnosticsArePreFix:P().optional(),reLintFailure:Afe.optional()});function Mfe(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 Nfe(e){let t=e.trim().toLowerCase().split(`/`).pop()??``;return t.endsWith(`.schema.json`)&&t.length>12?!0:Mfe(e)&&t.endsWith(`.json`)}var f7=[{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}]}],Pfe=(()=>{let e=new Map;for(let t of f7){e.set(t.id.toUpperCase(),t.id);for(let n of t.aliases)e.set(n.toUpperCase(),t.id)}return e})();function p7(e){return Pfe.get(e.toUpperCase())??null}function Ffe(e,t){let n=p7(t);if(n===null)return;let r;for(let[t,i]of Object.entries(e))p7(t)===n&&(r={key:t,value:i});return r}var Ife=[`Headings`,`Lists`,`Whitespace`,`Code`,`Links & images`,`Style`],Lfe=[[`headings`,`Headings`],[`bullet`,`Lists`],[`ul`,`Lists`],[`ol`,`Lists`],[`links`,`Links & images`],[`images`,`Links & images`],[`accessibility`,`Links & images`],[`code`,`Code`],[`language`,`Code`],[`emphasis`,`Style`],[`html`,`Style`],[`line_length`,`Whitespace`],[`whitespace`,`Whitespace`],[`hard_tab`,`Whitespace`],[`blank_lines`,`Whitespace`],[`indentation`,`Whitespace`]];function Rfe(e){for(let[t,n]of Lfe)if(e.tags.includes(t))return n;return`Style`}function zfe(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}async function Bfe(e,t,n,r){if(!t.enabled)return[];let i=[];for(let a of Q5){if(!dfe(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:Vfe(e)})}}return i}var m7=500;function Vfe(e){let t=h7(e);return t.length>m7?`${t.slice(0,m7)}… (truncated)`:t}function h7(e,t=0){if(e instanceof Error)return e.cause===void 0||t>=3?e.message:`${e.message} (cause: ${h7(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)}var Hfe=/\p{M}+/gu,Ufe=/[^\p{L}\p{N}]+/gu,Wfe=/^-+|-+$/g;function g7(e){return e.trim().normalize(`NFKD`).replace(Hfe,``).toLowerCase().replace(Ufe,`-`).replace(Wfe,``)}function Gfe(e,t){let n=t.get(e)??0;return t.set(e,n+1),n===0?e:`${e}-${n}`}function _7(e,t){let n=g7(e);return n?Gfe(n,t):``}function v7(e,t){let n=g7(e);return t?`#${n}-${g7(t)}`:`#${n}`}var y7=new Set([`img`,`video`,`audio`,`mark`,`u`,`ins`]),Kfe=new Map(V3.flatMap(e=>e.surface===`compat`&&y7.has(e.rendersAs)?[[e.name,e]]:[]));function b7(e){let t={};for(let n of e.attributes){if(n.type!==`mdxJsxAttribute`)return null;let e=n.name.toLowerCase();if(!(e.length>=3&&e.startsWith(`on`)))if(n.value===null)t[n.name]=!0;else if(typeof n.value==`string`)t[n.name]=n.value;else return null}return t}function x7(e){let t=e.name;if(!t||!y7.has(t))return null;let n=b7(e);return n===null?null:{type:`element`,tagName:t,properties:n,children:[]}}function S7(e){let t=e.name;if(!t)return null;let n=Kfe.get(t);if(!n)return null;let r=b7(e);if(r===null)return null;let i=n.translateProps(r),a={};for(let[e,t]of Object.entries(i))(typeof t==`string`||typeof t==`boolean`)&&(a[e]=t);return{type:`element`,tagName:n.rendersAs,properties:a,children:[]}}var qfe=(e,t)=>{let n=t,{target:r,anchor:i,alias:a}=n.data,o={type:`element`,tagName:`a`,properties:{className:[`wiki-link`],dataTarget:r,dataAnchor:i??``,dataAlias:a??``,href:v7(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},Jfe=(e,t)=>{let n=t,{target:r,anchor:i,alias:a}=n.data,o={type:`element`,tagName:`a`,properties:{className:[`wiki-embed`],dataTarget:r,dataAnchor:i??``,dataAlias:a??``,href:v7(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},Yfe=(e,t)=>{let n=t,r=x7(n);if(r)return n.children.length>0&&(r.children=e.all(n)),e.patch(t,r),e.applyData(t,r);let i=S7(n);if(i){e.patch(t,i);let n=e.applyData(t,i);return n.tagName===`img`?{type:`element`,tagName:`p`,properties:{},children:[n]}:n}let a={type:`element`,tagName:`pre`,properties:{className:[`mdx-component`]},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:``}]}]};return e.patch(t,a),e.applyData(t,a)},Xfe=(e,t)=>{let n=t,r=x7(n);if(r)return n.children.length>0&&(r.children=e.all(n)),e.patch(t,r),e.applyData(t,r);let i=S7(n);if(i)return e.patch(t,i),e.applyData(t,i);let a={type:`element`,tagName:`span`,properties:{className:[`mdx-inline`],dataJsxInline:``},children:[{type:`text`,value:typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:``}]};return e.patch(t,a),e.applyData(t,a)},Zfe=(e,t)=>{let n=t,r=n.data.reason||`unknown`,i=n.value||``,a=r.replace(/--/g,`—`),o={type:`comment`,value:` Parse error: ${a} `},s={type:`element`,tagName:`pre`,properties:{className:[`mdx-fallback`],dataRawMdxFallback:``,dataReason:a},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:i}]}]};return e.patch(t,s),[o,e.applyData(t,s)]},Qfe=(e,t)=>{let n={type:`element`,tagName:`mark`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},$fe=(e,t)=>{let n=t,r={type:`element`,tagName:n.data?.sourceForm===`ins`?`ins`:`u`,properties:{},children:e.all(n)};return e.patch(t,r),e.applyData(t,r)};function C7(e){if(typeof e!=`object`||!e)return``;let t=e;return typeof t.value==`string`?t.value:Array.isArray(t.children)?t.children.map(C7).join(``):``}var w7={wikiLink:qfe,wikiLinkEmbed:Jfe,mdxJsxFlowElement:Yfe,mdxJsxTextElement:Xfe,rawMdxFallback:Zfe,mark:Qfe,underline:$fe,tag:(e,t)=>{let n=t.value,r={type:`element`,tagName:`a`,properties:{className:[`tag`],dataTag:n,href:`#tag/${n}`},children:[{type:`text`,value:`#${n}`}]};return e.patch(t,r),e.applyData(t,r)},comment:(e,t)=>{let n={type:`comment`,value:C7(t).replace(/--/g,`—`)};return e.patch(t,n),e.applyData(t,n)},commentBlock:(e,t)=>{let n={type:`comment`,value:C7(t).replace(/--/g,`—`)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:(e,t)=>{let n=t.identifier,r={type:`element`,tagName:`sup`,properties:{id:`fnref-${n}`,dataFootnoteRef:``,dataFootnoteId:n,className:[`footnote-ref`]},children:[{type:`element`,tagName:`a`,properties:{href:`#fn-${n}`,className:[`footnote-ref-link`]},children:[{type:`text`,value:`[${n}]`}]}]};return e.patch(t,r),e.applyData(t,r)},footnoteDefinition:(e,t)=>{let n=t.identifier,r={type:`element`,tagName:`aside`,properties:{id:`fn-${n}`,dataFootnoteDef:``,dataFootnoteId:n,className:[`footnote-def`]},children:[{type:`element`,tagName:`div`,properties:{className:[`footnote-body`]},children:e.all(t)},{type:`element`,tagName:`a`,properties:{href:`#fnref-${n}`,className:[`footnote-backref`],ariaLabel:`Back to reference`},children:[{type:`text`,value:`↩`}]}]};return e.patch(t,r),e.applyData(t,r)}},epe=/url\s*\(\s*['"]?\s*(?:javascript|vbscript|data)\s*:/i,tpe=/\bexpression\s*\(/i,npe=1e4;function rpe(e){return!(e.length>npe||epe.test(e)||tpe.test(e))}function T7(e){for(let t of e.split(`,`)){let e=t.trim();if(e!==``&&!_1(e.split(/\s+/)[0]??``))return!1}return!0}var ipe={a:[`href`,`title`],img:[`src`,`alt`,`title`],video:[`src`,`title`],audio:[`src`,`title`],code:[`className`]},ape=new Set([`href`,`src`]),ope=we(`<>`),E7=()=>e=>{h(e,`element`,e=>{let t=ipe[e.tagName.toLowerCase()],n=e.properties;if(!(!t||!n))for(let e of t){let t=n[e];if(Array.isArray(t)){let r=t.map(e=>typeof e==`string`?E6(e):e);r.some((e,n)=>e!==t[n])&&(n[e]=r);continue}if(typeof t!=`string`)continue;let r;if(ape.has(e))if(t===`<>`||t===ope)r=``;else{let e=E6(t);r=e===t?t:we(e)}else r=E6(t);r!==t&&(n[e]=r)}})},D7=()=>e=>{h(e,`element`,e=>{let t=e.tagName.toLowerCase(),n=e.properties;if(!n)return;if(t===`a`||t===`area`||t===`link`||t===`base`){let e=n.href;typeof e==`string`&&!_1(e)&&delete n.href}if(t===`img`||t===`iframe`||t===`script`||t===`embed`||t===`source`||t===`audio`||t===`video`||t===`track`){let e=n.src;typeof e==`string`&&!_1(e)&&delete n.src}if(t===`form`){let e=n.action;typeof e==`string`&&!_1(e)&&delete n.action}if(t===`img`||t===`source`){let e=n.srcSet;typeof e==`string`&&!T7(e)&&delete n.srcSet;let t=n.srcset;typeof t==`string`&&!T7(t)&&delete n.srcset}if(t===`video`){let e=n.poster;typeof e==`string`&&!_1(e)&&delete n.poster}let r=n.style;typeof r==`string`&&!rpe(r)&&delete n.style})};function spe(e){let t=Ce().use(xe,{handlers:w7}).use(E7).use(D7).use(SG),n=t.runSync(e);return String(t.stringify(n))}function cpe(e){let t=/\r?\n|\r/g,n=[],r=0,i=t.exec(e);for(;i!==null;)n.push(O7(e.slice(r,i.index),r>0,!0),i[0]),r=i.index+i[0].length,i=t.exec(e);return n.push(O7(e.slice(r),r>0,!1)),n.join(``)}function O7(e,t,n){let r=0,i=e.length,a=e=>e===9||e===32;for(;t&&r<i&&a(e.charCodeAt(r));)r++;for(;n&&i>r&&a(e.charCodeAt(i-1));)i--;return i>r?e.slice(r,i):``}var k7=/\r?\n|\r/,lpe=(e,t)=>{let n=cpe(String(t.value));if(!k7.test(n)){let r={type:`text`,value:n};return e.patch(t,r),e.applyData(t,r)}let r=n.split(k7),i=[];for(let e=0;e<r.length;e++)e>0&&i.push({type:`element`,tagName:`br`,properties:{},children:[]}),r[e].length>0&&i.push({type:`text`,value:r[e]});return i};function upe(e){let t=Ce().use(ae).use(iF,[`yaml`]).use(k8).use(D).use(f5).use(b6).use($8).use(j6).use(xe,{handlers:{...w7,text:lpe}}).use(E7).use(D7).use(SG);return String(t.processSync(v6(A6(e))))}for(let e of[{tagName:`Mirror`,attrName:`src`,resolution:`bare-doc-name`},{tagName:`Excalidraw`,attrName:`src`,resolution:`doc-relative`}]){let t=V3.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.`)}jI(),XF(),ZF(),I({intents:F(I({satisfierId:M().min(1),desired:R([`present`,`absent`])}).loose()),...X2,summary:Z2}).loose();var dpe=I({satisfierId:M(),agentId:M(),piece:M(),scope:M(),kind:M(),pathId:M().optional(),desired:R([`present`,`absent`]),action:R(Yo),errorId:M().optional()}).loose(),fpe=I({kind:M(),satisfierIds:F(M()),agentIds:F(M()),pathId:M().optional(),blockedReason:M().optional()}).loose(),ppe=I({state:M(),strictness:F(R(qo)).optional()}).loose(),mpe=I({probes:I({env:R([`desktop`,`local-web`,`remote-web`]),satisfiers:qa(M(),ppe)}).loose(),detection:I({detected:F(M()),probed:P()}).loose()}).loose(),hpe=I({actions:F(dpe),conflicts:F(fpe),withheld:F(M()),snapshot:mpe}).loose();I({entries:F(I({level:R([`info`,`warn`,`error`]),message:M().max(I4),event:M().optional(),fields:qa(M(),Pa()).optional(),ts:N().optional(),sourceId:M().optional(),lineNumber:N().optional()}).loose()).max(100),droppedSinceLastFlush:N().int().min(0).optional()}).loose(),I({accepted:N().int().min(0)}).loose();var gpe=I({exact:M().min(1),prefix:M(),suffix:M(),start:N().int().nonnegative(),end:N().int().nonnegative()}),_pe=F(Va([M(),N().int().nonnegative()])),vpe=Ua(`kind`,[I({kind:z(`body`)}),I({kind:z(`property`),key:M().min(1),path:_pe.default([])})]).default({kind:`body`}),ype=R([`anchored`,`orphaned`,`resolved`]),A7=I({threadId:M().min(1),docName:M().min(1),target:vpe,anchor:gpe.nullable(),state:ype,queued:P(),latestComment:M(),createdBy:M().min(1),createdAt:N(),updatedAt:N().optional()}),j7=I({docName:M(),instruction:M(),property:M().nullable(),passage:I({exact:M(),prefix:M(),suffix:M()}).nullable(),anchorLost:P(),passageRepeats:P()}).loose(),M7=I({threadId:M(),ok:z(!0)}),N7=I({threadId:M(),ok:z(!1),error:z(`not-found`)});I({threads:F(A7)}).loose();var bpe=I({meta:A7,orphaned:P()}).loose(),xpe=I({threadId:M()}).loose();I({meta:A7,payload:j7}).loose();var Spe=I({results:F(Va([M7.extend({meta:A7,payload:j7}),N7]))}).loose(),Cpe=I({results:F(Va([M7.extend({meta:A7}),N7]))}).loose(),wpe=I({status:M().min(1),reason:M()}).loose(),Tpe=I({docName:M().min(1),content:M(),lifecycle:wpe.nullable()}).loose(),P7=I({kind:R([`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:R([`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)`}),Epe=I({documents:F(P7),truncated:P().optional()}).loose(),Dpe=I({source:M().min(1),anchor:M().nullable(),title:M(),snippet:M().nullable()}).loose(),Ope=I({docName:M().min(1),backlinks:F(Dpe)}).loose(),kpe=I({counts:qa(M().min(1),N().int().nonnegative())}).loose();I({counts:qa(M().min(1),N().int().nonnegative())}).loose();var Ape=Ua(`kind`,[I({kind:z(`doc`),docName:M().min(1),anchor:M().nullable(),title:M(),snippet:M().nullable()}).loose(),I({kind:z(`external`),url:M().min(1),title:M(),snippet:M().nullable()}).loose()]),jpe=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(),Mpe=I({docName:M().min(1),forwardLinks:F(Ape),localTargets:F(jpe).optional()}).loose(),Npe=Ua(`kind`,[I({id:M().min(1),kind:z(`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:z(`external`),url:M().min(1),label:M()}).loose()]),Ppe=I({source:M().min(1),target:M().min(1)}).loose(),Fpe=I({nodes:F(Npe),links:F(Ppe)}).loose(),Ipe=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(),Lpe=I({app:Va([z(`cursor`),z(`codex`),z(`claude`),Ma()]),signals_fired:F(M())}).loose();I({entries:F(Ipe),count:N().int().min(0),detection:Lpe}).loose();var F7=I({path:M().min(1),code:R([`M`,`A`,`D`,`R`,`C`,`U`,`T`,`?`,`!`,` `]),origPath:M().min(1).optional(),syncScoped:P(),open:Ua(`kind`,[I({kind:z(`doc`),docName:M().min(1)}),I({kind:z(`asset`),path:M().min(1)})]).optional()}).loose();I({branch:M().nullable(),detached:P(),upstream:M().nullable(),staged:F(F7),notStaged:F(F7),untracked:F(F7),incoming:F(F7),truncated:P(),readable:P().default(!0)}).loose(),I({writers:F(I({id:M().min(1),name:M().optional(),email:M().optional()}).loose()).optional(),summary:Z2,...X2}).loose(),I({checkpointRef:M().min(1)}).loose();var Rpe=I({v:N().int().optional(),id:M().min(1),name:M().min(1),colorSeed:M().optional(),docs:F(M()),summaries:F(M()).optional()}).loose();I({entries:F(I({sha:M().min(1),timestamp:M().min(1),author:M(),authorEmail:M(),type:R([`checkpoint`,`wip`,`upstream`,`park`]),message:M(),contributors:F(Rpe),checkpoint:Pa().nullable(),parentSha:M().nullable().optional()}).loose()),total:N().int().nonnegative().optional(),truncated:P().optional(),hasMore:P().optional()}).loose(),I({sha:M().regex(/^[0-9a-f]{40}$/i),content:M(),timestamp:M(),author:M()}).loose();var zpe=I({contentDir:M().min(1),pathSeparator:R([`/`,`\\`]),symlinkResolved:P()}).loose();F(Ua(`source`,[I({docName:M().min(1),timestamp:M().min(1),size:N().int().nonnegative(),source:z(`flat`)}).loose(),I({docName:M().min(1),timestamp:M().min(1),source:z(`timeline`),sha:M().min(1)}).loose()])).meta({description:"Flat array of rescue buffer entries; discriminated via `source`."});var I7=I({domain:M().min(1),title:M().optional(),description:M().optional(),siteName:M().optional(),faviconDataUri:M().optional()}).loose();I({url:M()}).loose();var Bpe=Ua(`ok`,[I({ok:z(!0),metadata:I7}).loose(),I({ok:z(!1),reason:M()}).loose()]),Vpe=I({orphans:F(I({docName:M().min(1),title:M()}).loose())}).loose(),Hpe=I({hubs:F(I({docName:M().min(1),title:M(),count:N().int().nonnegative()}).loose())}).loose(),Upe=I({source:M().min(1),title:M(),snippet:M().nullable()}).loose();I({deadLinks:F(I({target:M().min(1),sources:F(Upe)}).loose())}).loose(),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(),I({projectPath:M().min(1)}).loose();var Wpe=R([`not-a-git-worktree`,`init-failed`]);Ua(`ok`,[I({ok:z(!0),projectPath:M().min(1)}).loose(),I({ok:z(!1),reason:Wpe,message:M().min(1)}).loose()]),I({host:M().min(1).optional()}).loose(),I({host:M().min(1).optional(),token:M().min(1)}).loose(),I({host:M(),login:M()}).loose(),I({key:M().min(1)}).loose(),I({keyPresent:P()}).loose();var Gpe=R([`no_key`,`invalid_endpoint`,`rate_limit`,`timeout`,`http_error`,`network`,`dims_mismatch`,`malformed_response`]),Kpe=Ua(`ok`,[I({ok:z(!0),endpoint:M().min(1),model:M().min(1),dimensions:N().int().positive()}).loose(),I({ok:z(!1),endpoint:M().min(1),model:M().min(1),reason:Gpe,status:N().int().optional()}).loose()]);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(),I({authenticated:P()}).loose(),I({channel:R([`login`,`gh-login`]).default(`login`)}).loose(),I({}).loose();var qpe=I({stackIndex:N().int().min(0),ts:N().int().min(0),additions:N().int().min(0),deletions:N().int().min(0)}).loose(),Jpe=I({docName:M().min(1),additionsTotal:N().int().min(0),deletionsTotal:N().int().min(0),lastTs:N().int().min(0),bursts:F(qpe)}).loose(),Ype=I({displayName:M().min(1),color:M().min(1),icon:M().optional(),connectionId:M().min(1)}).loose(),Xpe=I({sessionAlive:P(),agent:Ype.nullable(),files:F(Jpe)}).loose(),Zpe=I({diff:M(),before:M(),after:M(),properties:I0,generatedAt:N().int().min(0)}).loose();I({}).loose(),I({}).loose(),I({}).loose(),I({}).loose(),I({}).loose(),I({}).loose();var Qpe=I({displayName:M().min(1),icon:M(),color:M().min(1),currentDoc:M().nullable(),mode:R([`idle`,`writing`]),ts:N().int().min(0)}).loose();I({presence:qa(M().min(1),Qpe)}).loose();var $pe=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();I({effects:F(I({"doc.name":M().min(1),entries:F($pe)}).loose())}).loose(),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(),qa(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(),I({}).loose();var eme=I({fromDocName:M().min(1),toDocName:M().min(1)}).loose(),tme=I({fromPath:M().min(1),toPath:M().min(1)}).loose();I({}).loose(),I({path:M().min(1),...X2,summary:Z2}).loose();var nme=I({docName:M().min(1)}).loose();I({path:M().min(1),...X2,summary:Z2}).loose();var rme=I({path:M().min(1)}).loose();I({kind:R([`file`,`folder`]),path:M().min(1),...X2,summary:Z2}).loose();var ime=I({kind:R([`file`,`folder`]),path:M().min(1),duplicatedDocNames:F(M().min(1))}).loose(),ame=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(),ome=I({level:N().int().min(1).max(6),text:M(),slug:M()}).loose(),sme=I({docName:M().min(1),headings:F(ome)}).loose(),cme=I({docName:M().min(1),rewrites:N().int().nonnegative()}).loose();I({kind:R([`file`,`folder`,`asset`]),fromPath:M().min(1),toPath:M().min(1),...X2,summary:Z2}).loose();var lme=I({renamed:F(eme),renamedAssets:F(tme),rewrittenDocs:F(cme).optional(),summary:$5.optional()}).loose();I({kind:R([`file`,`folder`,`asset`]),path:M().min(1),...X2}).loose();var ume=I({deletedDocNames:F(M().min(1))}).loose();I({kind:R([`file`,`folder`,`asset`]),path:M().min(1),...X2,summary:Z2}).loose();var dme=I({deletedDocNames:F(M().min(1))}).loose();I({docName:M().min(1),commitSha:M().regex(/^[0-9a-f]{40}$/i,{message:`commitSha must be a 40-char git SHA`}),summary:Z2,...X2}).loose(),I({restoredFrom:M().min(1),timestamp:M().min(1),summary:$5.optional(),warnings:r7.optional()}).loose();var fme=/^#[0-9a-fA-F]{6}$/,pme=I(Object.fromEntries(rm.map(e=>[e,M().regex(fme,`must be a #rrggbb hex color`)]))),L7=M().min(1).refine(cm,{message:`must contain a non-whitespace character`}),R7=I({name:L7,author:L7.optional(),variant:R([`dark`,`light`]),palette:pme}).loose(),mme=I({name:M().min(1),scheme:R7,stem:M().min(1).optional(),extension:R([`.yaml`,`.yml`]).optional()}).loose(),hme=I({id:M().min(1),filename:M().min(1)}).loose(),gme=I({id:M().min(1),scheme:R7}).loose(),_me=I({id:M().min(1),filename:M().min(1)}).loose(),vme=Ua(`existed`,[I({existed:z(!1)}).loose(),I({existed:z(!0),filename:M().min(1),scheme:R7}).loose()]),yme=I({themes:F(Ua(`ok`,[I({ok:z(!0),id:M().min(1),filename:M().min(1),scheme:R7}),I({ok:z(!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(),bme=R([`dormant`,`idle`,`fetching`,`pulling`,`pushing`,`conflict`,`offline`,`auth-error`,`disabled`]),xme=I({label:M().min(1),webUrl:da().nullable()}).loose(),Sme=Ua(`checkStatus`,[I({checkStatus:z(`allowed`)}).loose(),I({checkStatus:z(`denied`),deniedReason:R([`no-collaborator`,`private-no-access`,`repo-not-found`,`not-authenticated`]),resolvedLogin:M().optional(),declaredLogin:M().optional(),declaredSource:M().optional()}).loose(),I({checkStatus:z(`unknown`),unknownError:R([`network`,`timeout`,`rate-limit`,`token-invalid`,`malformed-response`,`ssh-unverified`]).optional()}).loose()]),z7=R([`auth-403`,`auth-401`,`auth-scope-mismatch`,`auth-no-credential`,`auth-not-found-as-identity`,`semantic-protected-branch`]),Cme=R(Yf),wme=R([`succeeded`,`up-to-date`,`conflict`,`refused`,`error`]);I({state:bme,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:xme.nullable().optional(),pushError:M().optional(),pushErrorCode:z7.optional(),pullError:M().optional(),pullErrorCode:z7.optional(),pausedReason:M().optional(),blockingPaths:F(M().min(1)).optional(),pushPermission:Sme.optional(),syncMode:Cme.optional(),lastPullUtc:M().nullable().optional(),lastPullOutcome:wme.nullable().optional()}).loose(),I({action:R([`commit`]),paths:F(M().min(1)),commitSha:M().optional()}).loose(),I({action:R([`commit`])}).loose(),I({op:R([`sync`,`push`,`pull`,`fetch`]).optional()}).loose(),I({op:R([`sync`,`push`,`pull`,`fetch`])}).loose();var B7=R([`merge-native`,`working-tree`,`reconcile`]),V7=R([`merged-with-markers`,`refused-conflict-markers`,`refused-no-base`,`refused-too-large`,`disk-markers`,`stale-external-write`]),Tme=R([`mine`,`theirs`,`content`,`delete`]),Eme=I({conflicts:F(I({file:M().min(1),detectedAt:M().min(1),conflict:B7,reason:V7.optional().catch(void 0),conflictKind:R([`git`,`stale-external-write`]).optional(),docName:M().nullable(),theirsSha:M().optional(),baseSha:M().optional()}).loose())}).loose();I({file:M().min(1),strategy:R([`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`]}),I({}).loose();var Dme=I({file:M().min(1),base:M(),ours:M(),theirs:M(),kind:R([`both-modified`,`delete-modify`,`modify-delete`]),conflict:B7,reason:V7.optional().catch(void 0),conflictKind:R([`git`,`stale-external-write`]).optional(),resolutionOptions:F(Tme)}).loose();I({plan:So(e=>e!==void 0,{message:`plan is required`})}).loose(),I({plan:So(e=>e!==void 0,{message:`plan is required`})}).loose(),I({result:So(e=>e!==void 0,{message:`result is required`})}).loose(),I({packId:M().min(1)}).strict(),I({installedHosts:F(M()),skills:F(I({name:M().min(1),created:P()}).strict())}).strict();var Ome=I({path:M().min(1),summary:M().min(1)}).loose(),kme=I({files:N().int().nonnegative(),folders:N().int().nonnegative()}).loose();I({packs:F(I({id:M().min(1),name:M().min(1),description:M().min(1),defaultSubfolder:M().optional(),folders:F(Ome),entryCounts:kme}).loose())}).loose(),I({noOpen:P().optional(),out:M().min(1).optional()}).loose();var Ame=I({reason:R([`unsupported-platform`,`spawn-error`]),message:M()}).loose();Ua(`status`,[I({status:z(`installed`),outputPath:M(),size:N().int().nonnegative(),sha256:M(),skillVersion:M()}).loose(),I({status:z(`built`),outputPath:M(),size:N().int().nonnegative(),sha256:M(),skillVersion:M(),handoffError:Ame.optional()}).loose(),I({status:z(`failed`),buildError:M()}).loose(),I({status:z(`skip-current`),skillVersion:M(),recordedAt:M().optional()}).loose()]);var H7=R(He),U7=R(Ue);function jme(e){return e===`agents`||Ue.includes(e)}var Mme=I({alwaysOn:N().int().nonnegative(),onTrigger:N().int().nonnegative(),onDemand:N().int().nonnegative()}).strict(),Nme=[`.md`,`.mdx`,`.txt`],Pme=5e3,Fme=4;function W7(e){return Math.round(e/Fme)}function Ime(e){let t=e.lastIndexOf(`.`);return t===-1?!1:Nme.includes(e.slice(t).toLowerCase())}function Lme(e){let t=W7((e.name??``).length+(e.description??``).length),n=W7(Ld(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/`)||Ime(t.relPath)&&(i+=t.content.length));return{alwaysOn:t,onTrigger:n,onDemand:W7(i)}}I({tags:F(I({name:M().min(1),count:N().int().nonnegative(),isLeaf:P()}).loose())}).loose();var Rme=I({docName:M().min(1),title:M(),matchingTags:F(M().min(1)),snippet:M().nullable()}).loose();I({name:M().min(1),docs:F(Rme)}).loose(),I({folder:Pa(),frontmatter_local:qa(M(),Pa()).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(R([`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(),I({path:M(),frontmatter:qa(M(),Pa()).optional()}).loose(),I({applied:Pa()}).loose();var G7=qa(M(),Pa()).meta({description:`Free-form frontmatter map embedded in template payloads.`});I({template:I({name:M().min(1),folder:M(),scope:R([`local`,`inherited`]),path:M().min(1),frontmatter:G7,body:M()}).strict()}).strict();var zme=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();I({folder:M(),name:M(),body:M().optional(),frontmatter:G7.optional(),...X2,summary:Z2}).strict(),I({path:M().min(1),created:P(),warnings:F(M())}).strict(),I({sourcePath:M().min(1),targetFolder:M(),name:M().optional(),title:M().optional(),deleteSource:P().optional(),...X2,summary:Z2}).strict(),I({path:M().min(1),created:P(),warnings:F(M())}).strict(),I({existed:P(),path:M().min(1)}).strict(),I({fromFolder:M(),fromName:M(),toFolder:M(),toName:M(),body:M().optional(),frontmatter:G7.optional(),...X2,summary:Z2}).strict(),I({from:M().min(1),to:M().min(1),committed:P()}).strict();var K7=R(ef),Bme=/^[a-z0-9-]+$/,Vme=/^[A-Za-z0-9_-]+$/,q7=I({name:M(),description:M(),metadata:I({pack:M()}).strict().optional()}).strict();I({skill:I({name:M().min(1),scope:K7,path:M().min(1),frontmatter:q7,body:M(),files:F(I({path:M().min(1),text:M().nullable()})).optional(),managed:P().optional()}).strict()}).strict();var Hme=I({source:M().min(1),publisher:M().optional(),skill:M().optional(),marketplaceUrl:M().optional(),importedAt:M().min(1),autoUpdate:P().optional()}).strict(),Ume=I({name:M().min(1),description:M().optional(),scope:K7,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:qa(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:R([`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:Hme.optional(),pack:M().optional(),modified:P().optional(),revertable:P().optional(),ignored:P().optional(),size:Mme.optional()}).strict();I({name:M().min(1),scope:K7,apply:P().optional()}).strict(),I({line:M().min(1),gitignorePath:M().min(1),applied:P(),alreadyTracked:P().optional()}).strict();var Wme=I({skills:F(Ume),truncated:P()}).strict();I({scope:K7.default(`project`),name:M().meta({description:`Managed skill name to create or update.`}),body:M().optional(),frontmatter:q7,...X2,summary:Z2}).strict();var J7=F(R([`skill-name-vendor-word`,`skill-body-too-long`])).meta({description:"Machine-readable codes aligned 1:1 with `warnings` (`warnings[i]` is the display text for `warningCodes[i]`)."});I({path:M().min(1),created:P(),warnings:F(M()),warningCodes:J7}).strict(),I({scope:K7.default(`project`),name:M(),dryRun:P().optional(),setAutoUpdate:P().optional(),...X2,summary:Z2}).strict(),I({name:M().min(1),updated:P(),source:M().min(1),localBody:M().optional(),upstreamBody:M().optional(),gitTracked:P().optional(),warnings:F(M()),warningCodes:J7}).strict(),I({scope:K7.default(`project`),name:M(),...X2,summary:Z2}).strict(),I({name:M().min(1),baselineRef:M().min(1),restoredFiles:F(M()),warnings:F(M())}).strict();var Y7=`This member also carries the one bookkeeping failure that does not undo the operation: the content change landed, but a state file this server keeps beside it refused to be rewritten because it could not be read, so the install or import records still describe the old state until an operator repairs that file. Absent when there is nothing to report; a server that predates this member omits it, so treat its absence as no warning rather than as an error.`;I({existed:P(),path:M().min(1),warnings:F(M()).optional().meta({description:`Present when this delete removed a directory a retention record ties to a recovery copy an earlier failed move kept, whose source was never verified unchanged — either because this server verified the deleted directory against the copy that record describes, or because it could not read the directory and so could not confirm either way. Each entry says which of the two it is; neither claims more than the check established. ${Y7}`})}).strict(),I({scope:K7.default(`project`),fromName:M(),toName:M(),body:M().optional(),frontmatter:q7.optional(),...X2,summary:Z2}).strict(),I({from:M().min(1),to:M().min(1),committed:P(),warnings:F(M()).optional().meta({description:`Present when the rename itself completed but something beside it did not. ${Y7}`})}).strict(),I({name:M(),toName:M().optional().meta({description:"Name for the skill at the destination scope; defaults to `name`. The SKILL.md `name` frontmatter is rewritten to match."}),fromScope:K7,toScope:K7,...X2,summary:Z2}).strict();var Gme=[`nothing-written`,`destination-removed`,`destination-stray`,`destination-retained`,`destination-retained-blocking`,`destination-unreadable`,`partially-applied`];function Kme(e){return typeof e==`string`&&Gme.includes(e)}var qme=[`intact`,`lossy`,`unknown`];function Jme(e){return typeof e==`string`&&qme.includes(e)}var Yme=[`unreadable`,`occupant-unverifiable`];function Xme(e){return typeof e==`string`&&Yme.includes(e)}var Zme={"nothing-written":!1,"destination-removed":!1,"destination-stray":!1,"destination-retained":!0,"destination-retained-blocking":!0,"destination-unreadable":!1,"partially-applied":!1};function X7(e){return Zme[e]}function Qme(e){let t=typeof e==`object`&&e?e:{},n=t.moveState,r=t.sourceState,i=t.retentionLedger;if(n===void 0&&r===void 0&&i===void 0)return{kind:`coherent`};let a=Kme(n)?n:void 0,o=Jme(r)?r:void 0,s=Xme(i)?i:void 0,c={...a===void 0?{}:{moveState:a},...o===void 0?{}:{sourceState:o},...s===void 0?{}:{retentionLedger:s}};return n!==void 0&&a===void 0||r!==void 0&&o===void 0||i!==void 0&&s===void 0||a===void 0?{kind:`unverified`,...c}:(X7(a)?o!==void 0&&s===void 0:a===`nothing-written`?o===void 0:o===void 0&&s===void 0)?{kind:`coherent`,...c}:{kind:`unverified`,...c}}var $me=`The server reported warnings in a shape this build does not recognise; treat this result as unverified.`;function ehe(e){if(e===void 0)return[];let t=$me;if(!Array.isArray(e))return[t];let n=e.filter(e=>typeof e==`string`);return n.length===e.length?n:[...n,t]}I({scope:K7,path:M().optional(),droppedLocations:F(M()).default([]).meta({description:"Locations the skill occupied at the source that were removed and not re-created at the destination: the `agents` hub and custom roots, which projection does not cover. Entries are install location ids, so they can be passed straight back as an install `add` list with `scope` set to the destination scope; custom roots resolve against that scope's base."}),warnings:F(M()).optional().meta({description:`Present when the move itself completed but something beside it did not. ${Y7}`})}).strict().meta({description:"Scope-move result. Rename paths deliberately do not emit authoring warnings, consistent with same-scope rename and duplicate. Content-authoring and import responses carry those warnings and their codes. The Skills Studio client parses `droppedLocations` off the wire but deliberately does not render it yet; how a human is told what was removed is an open product decision."}),I({scope:K7,name:M(),toName:M(),...X2,summary:Z2}).strict(),I({name:M().min(1)}).strict(),I({name:M(),home:M().min(1)}).strict(),I({docName:M().min(1)}).strict();var Z7=R([`reference`,`script`,`file`]);I({scope:K7.default(`project`),name:M(),path:M().min(1),content:M(),...X2,summary:Z2}).strict(),I({path:M().min(1),created:P(),kind:Z7,content:P()}).strict(),I({scope:K7.default(`project`),name:M(),from:M().min(1),to:M().min(1),...X2,summary:Z2}).strict(),I({from:M().min(1),to:M().min(1),fromDocName:M().optional(),toDocName:M().optional()}).strict(),I({path:M().min(1),kind:Z7,text:M()}).strict(),I({path:M().min(1),existed:P(),kind:Z7}).strict();var Q7=Va([U7,z(`agents`)]),$7=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`}),e9=Va([Q7,$7]);I({scope:K7.default(`project`),name:M(),targets:F(Q7).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(e9).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(e9).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:R([`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:e9.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:R([`copy`,`link`])}).strict().optional(),convert:I({target:e9.meta({description:`The installed location to convert — an editor id, "agents", or a recorded custom placement path.`}),mode:R([`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(),...X2,summary:Z2,fork:I({editor:M().min(1),action:R([`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"}),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(R([`no-targets`,`scripts-present`,`name-conflict`,`no-description`,`skill-fork-name-unpatched`,`place-path-invalid`,`place-fork-refused`])).meta({description:"Machine-readable warning codes aligned with `warnings`."}),placedAt:M().optional(),sourceMovedTo:M().optional()}).strict(),I({scope:K7.default(`project`),name:M().meta({description:`Managed skill name to uninstall without deleting source.`})}).strict(),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();var the=I({targets:F(H7),configured:P(),folders:F(I({scope:K7,host:M(),root:M(),state:R([`own`,`linked`,`linked-parent`,`absent`]),target:M().optional(),drift:z(!0).optional(),expected:M().optional()}).strict()).optional()}).strict(),t9=I({action:z(`link`),scope:K7,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.`})}),n9=I({action:z(`unlink`),scope:K7,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(),r9=I({action:z(`add-root`),scope:K7,root:$7.meta({description:`New custom skills root to declare (base-relative, e.g. ".team/skills").`})}).strict(),nhe=Ua(`action`,[t9.extend({preview:P().optional().meta({description:`Return the merge plan only (moves, drops, removes, conflicts, strays) — nothing is written.`})}).strict(),n9,r9]);Ua(`action`,[t9.strict(),n9,r9]),I({folderAction:nhe}).strict();var i9=I({moves:F(M()),drops:F(M()),removes:F(M()),replaces:F(M()),conflicts:F(M()),strays:F(M())}).strict();I({targets:F(H7),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:i9.optional()}).strict(),I({scope:K7.default(`project`),name:M(),version:M().regex(/^[0-9a-f]{40}$/i),...X2,summary:Z2}).strict(),I({name:M().min(1),version:M(),restoredFiles:F(M()),warnings:F(M())}).strict(),I({query:M().optional(),intent:R([`autocomplete`,`full_text`,`omnibar`]).optional(),ranking:R([`navigation`,`relevance`]).optional(),scopes:F(R([`page`,`folder`,`content`,`file`])).optional(),scope:M().optional(),limit:N().int().nonnegative().optional(),semantic:P().optional(),source:R([`omnibar`,`mcp`,`http`]).optional()}).loose();var rhe=I({kind:R([`page`,`folder`,`content`,`file`]),path:M().min(1),title:M(),score:N(),signals:qa(M(),Pa()),snippet:M().optional()}).loose(),ihe=R([`applied`,`no_match`,`warming`,`incapable`,`provider_error`,`restart_required`,`query_too_short`]),a9=R([`warm`,`corpus`,`query`,`dimensions`,`configured_dimensions`]);function ahe(e){return e?.providerErrorReason===`dimensions`?`restart_required`:e?.providerErrorReason===`configured_dimensions`?`incapable`:e?.providerError||e?.providerErrorReason?`provider_error`:null}function ohe(e){throw Error(`Unhandled SemanticProviderErrorReason variant: ${JSON.stringify(e)}`)}function she(e,t){let n=e?.providerErrorReason;switch(n){case null:case void 0:return e?.providerError===!0;case`corpus`:return!1;case`query`:return t===`query`;case`warm`:case`dimensions`:case`configured_dimensions`:return!0;default:return ohe(n)}}function che(e){throw Error(`Unhandled SemanticQueryOutcome variant: ${JSON.stringify(e)}`)}var o9=I({capable:P(),applied:P(),outcome:ihe,providerErrorReason:a9.nullable().optional().catch(null),coverage:I({embedded:N().int().nonnegative(),total:N().int().nonnegative()})}).loose(),lhe=I({enabled:P(),keyPresent:P(),keyNotRequired:P(),keySource:R([`project`,`file`,`env`]).nullable(),keyHint:M().nullable(),ready:P(),capable:P(),providerError:P().optional(),providerErrorReason:a9.nullable().optional().catch(null),embedded:N().int().nonnegative(),total:N().int().nonnegative()}).loose();function uhe(e){return!!(e?.enabled&&(e.keyPresent||e.keyNotRequired))}I({query:M(),intent:R([`autocomplete`,`full_text`,`omnibar`]),results:F(rhe),elapsedMs:N().nonnegative(),semantic:o9.optional(),truncated:P().optional(),ready:P().optional()}).loose();var dhe=I({version:M().min(1),recordedAt:M().min(1)}).loose();I({currentVersion:M().min(1),targets:qa(M(),dhe.nullable())}).loose(),I({scope:K7.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."}),...X2,summary:Z2}).strict(),I({scope:K7.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."}),...X2,summary:Z2}).strict(),I({results:F(I({requested:M(),status:R([`imported`,`already-imported`,`not-found`,`failed`]),name:M().optional(),collisionRenamedFrom:M().optional(),warnings:F(M()),warningCodes:J7,error:M().optional()}).loose()),imported:N(),alreadyImported:N(),failed:N()}).loose(),I({scope:K7.default(`project`),names:F(M().min(1)).min(1).max(100).meta({description:`Managed skill names to refresh from their recorded upstreams.`}),...X2,summary:Z2}).strict(),I({results:F(I({requested:M(),status:R([`updated`,`up-to-date`,`not-found`,`failed`]),source:M().optional(),warnings:F(M()),warningCodes:J7,error:M().optional()}).loose()),updated:N(),upToDate:N(),failed:N()}).loose();var fhe=I({source:M(),ref:M().optional(),contentHash:M(),publisher:M().optional()}).loose();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:fhe,warnings:F(M()).meta({description:`Non-fatal import warnings, such as skipped unsupported files.`}),warningCodes:J7}).loose();var phe=`server-info`,mhe=`branch-switched`,hhe=`disk-ack`,ghe=`config-validation-rejected`,_he=`config-ignore-nested-error`,s9=R([`files`,`backlinks`,`graph`,`sync-status`,`session-activity`,`tags`,`comments`,`lint-config`,`local-targets`]),vhe=I({v:z(1),ch:z(phe),seq:N(),serverInstanceId:M().min(1),currentBranch:M().min(1).optional()}).loose(),yhe=I({v:z(1),ch:z(mhe),seq:N(),branch:M().min(1)}).loose(),bhe=I({v:z(1),ch:s9,seq:N()}).loose(),xhe=I({v:z(1),ch:z(hhe),seq:N(),docName:M().min(1),sv:M().min(1)}).loose(),She=I({v:z(1),ch:z(ghe),seq:N(),docName:M().min(1),error:Gne}).loose(),Che=I({v:z(1),ch:z(_he),seq:N(),path:M().min(1),error:M().min(1)}).loose(),whe=100,The=500,Ehe=450,Dhe={id:`string`,kind:`enum`,path:`string`,title:`string`,name:`string`,pathSegments:`string`,content:`string`,modifiedTs:`number`},c9=new WeakMap;function Ohe(e){return e===void 0||!Number.isFinite(e)?20:Math.max(1,Math.min(100,Math.trunc(e)))}function l9(e){return e.trim().toLowerCase()}var khe=/\.(?:md|mdx)$/;function Ahe(e,t){if(t!==`page`)return e;let n=e.replace(khe,``);return n.length>0?n:e}function u9(e){let t=e.split(`/`).filter(Boolean);return t[t.length-1]??e}function jhe(e){let t=u9(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}}var d9=/[^\P{L}a-zàèéìòóù]|[^\P{Nd}0-9]|\p{Nl}/iu,f9=(()=>{let e=globalThis.Intl.Segmenter;return e?new e(`en`,{granularity:`word`}):null})();function Mhe(){let e=iJ({language:`english`}),t=e.tokenize.bind(e);return e.tokenize=(e,n,r,i)=>{let a=t(e,n,r,i);if(!f9||typeof e!=`string`||!d9.test(e))return a;let o=new Set(a);for(let{segment:t,isWordLike:n}of f9.segment(e)){if(!n||!d9.test(t))continue;let e=t.toLowerCase();o.has(e)||(o.add(e),a.push(e))}return a},e}function p9(e){let t=vJ({schema:Dhe,components:{tokenizer:Mhe()}});return e.length>0&&kJ(t,e),t}function Nhe(e){let t={documents:e};return c9.set(t,p9(e)),t}function Phe(e){let t=c9.get(e);if(t)return t;let n=p9(e.documents);return c9.set(e,n),n}function Fhe(e){return e===`autocomplete`?[`page`]:e===`full_text`?[`page`,`content`,`file`]:[`page`,`folder`,`file`]}function m9(e,t){return t.has(e.kind)?!0:e.kind===`page`&&t.has(`content`)}function Ihe(e,t){let n=l9(t);if(!n)return 0;let r=Ahe(n,e.kind),i=l9(e.title),a=l9(e.name),o=l9(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}var Lhe=.5;function h9(e,t){let n=Ihe(e,t);return n<=0?n:K2(e.path)?n*Lhe:n}function Rhe(e){return e===`file`?-60:0}var zhe=1e3,Bhe=50,Vhe=1,Hhe=1;function Uhe(e,t,n,r,i){let a=i>0?t/i:0,o=n/Bhe,s=r===`file`?-.001:0,c=Vhe*a+Hhe*o+s;return e*zhe+c}function g9(e,t,n,r){return e+t*20+n+Rhe(r)}function _9(e,t,n,r,i,a){return e===`relevance`?g9(t,n,r,i):Uhe(t,n,r,i,a)}function Whe(e,t){return t||(e===`full_text`?`relevance`:`navigation`)}function v9(e,t){let n=0;for(let r of e){let e=t.get(r.id)??0;e>n&&(n=e)}return n}function Ghe(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 Khe(e){return e===`full_text`?[`title`,`name`,`path`,`pathSegments`,`content`]:[`title`,`name`,`path`,`pathSegments`]}function qhe(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}}var Jhe=/[฀-๿ក-៿ -〿぀-ゟ゠-ヿ㐀-䶿一-鿿\uf900-﫿＀-￯\u1100-\u11ff\u3130-\u318f\ua960-\ua97f\uac00-\ud7ff]/;function Yhe(e,t){let n=l9(t);return n.length<4||Jhe.test(n)?0:+(e===`full_text`)}function Xhe(e){let{lexical:t,fullText:n}=e.signals;return t>=The?`lexical`:t===Ehe&&n<=0?`pathOnly`:`body`}function Zhe(e){let t=[],n=[],r=[];for(let i of e){let e=Xhe(i);e===`lexical`?t.length<whe&&t.push(i):e===`body`?n.length<6&&n.push(i):r.length<4&&r.push(i)}return[...t,...n,...r]}function y9(e,t,n){if(t===`relevance`)return e.slice(0,n);let r=Zhe(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 Qhe(e,t,n={}){let r=n.intent??`omnibar`,i=Whe(r,n.ranking),a=Ohe(n.limit),o=new Set(n.scopes??Fhe(r)),s=e.documents.filter(e=>m9(e,o)),c=l9(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=aY(Phe(e),{term:c,properties:Khe(r),boost:qhe(r),tolerance:Yhe(r,c),limit:Math.max(a*4,40)}),u=new Map(l.hits.filter(e=>m9(e.document,o)).map(e=>[e.document.id,e.score])),d=Ghe(s),f=new Map;for(let e of s)h9(e,c)>=0&&f.set(e.id,e);for(let e of l.hits)m9(e.document,o)&&f.set(e.document.id,e.document);if(!n.semantic){let e=v9(f.values(),u);return y9([...f.values()].map(t=>{let n=Math.max(0,h9(t,c)),r=u.get(t.id)??0,a=d.get(t.id)??0;return{document:t,score:_9(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 y9($he({scopedDocuments:s,candidates:f,fullTextScores:u,recency:d,normalizedQuery:c,ranking:i,semantic:n.semantic}),i,a)}function b9(e){let t=new Map;return e.forEach((e,n)=>{t.set(e,n+1)}),t}function $he(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=v9(n.values(),r),h=[...n.values()].map(e=>{let t=Math.max(0,h9(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?_9(o,t,n,s,e.kind,m):g9(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=b9(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)),_=b9(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 ege(e){return e.created.length>0||e.packSkills?.some(e=>e.pending)===!0||e.requiredPlugins?.some(e=>e.pending)===!0}function tge(e){return`https://${e.host}/${e.owner}/${e.repo}.git`}function nge(e,t){return!e||e.length===0?`true`:t.detached?`detached`:t.currentBranch===null||t.currentBranch===e?`true`:`false`}var x9=Symbol.for(`@inkeep/open-knowledge/skill-state-field-registry`),S9=globalThis;S9[x9]===void 0&&(S9[x9]=pr());var C9=S9[x9],w9=L({version:M().regex(/^\d+\.\d+\.\d+(?:[-+][\w.-]+)?$/,`version must match /^\\d+\\.\\d+\\.\\d+(?:[-+][\\w.-]+)?$/`).register(C9,{description:`Recorded skill version for this target.`}),recordedAt:Pi().register(C9,{description:`ISO 8601 timestamp of the most recent successful write. Updated on every write, including reinstalls of the same version.`}),surface:R([`server-build-and-open`,`electron-build-and-open`,`cli-npx-skills-add`,`desktop-direct`,`cli-start`]).register(C9,{description:`Install-source surface that recorded this entry.`}).optional()}),rge=L({enabled:P().register(C9,{description:`Whether this user-global skill bundle is opted in.`}),decidedAt:Pi().register(C9,{description:`ISO 8601 timestamp of the opt-in / opt-out decision.`})});L({schema:z(1).register(C9,{description:`Schema major version. Bumped only on breaking shape changes.`}),targets:L({"claude-cowork":w9.optional(),"cli-hosts":w9.optional()}).register(C9,{description:`Per-target install-state entries. Absent target = no recorded install.`}).default({}),bundles:qa(M(),rge).register(C9,{description:`Per-bundle opt-in decisions keyed by install name. Absent key = no recorded decision.`}).optional(),installsReported:F(M()).register(C9,{description:"Skill installs already reported to skills.sh from this machine, as `<owner/repo>#<skill>`. Append-only; presence suppresses a re-report."}).optional()});var T9=`bottom`,E9=e=>e*8+4,D9=E9(92),O9=E9(40);function ige(e){return e===`right`||e===`bottom`?e:T9}function age(e){return typeof e!=`number`||!Number.isFinite(e)?D9:Math.max(O9,Math.round(e))}var oge=new Set([`(connected)`,`(agent thread)`]);function sge(e){return e!=null&&oge.has(e)}var cge=6e5,k9=class extends Error{chunksCompleted;totalChunks;bytesWritten;bytesRemaining;cause;constructor(e,t){let n=e instanceof Error?e.message:typeof e==`string`?e:`unknown error`;super(`chunked insert failed after ${t.chunksCompleted}/${t.totalChunks} chunks (${t.bytesWritten} bytes written, ${t.bytesRemaining} bytes lost): ${n}`),this.name=`ChunkedInsertError`,this.chunksCompleted=t.chunksCompleted,this.totalChunks=t.totalChunks,this.bytesWritten=t.bytesWritten,this.bytesRemaining=t.bytesRemaining,this.cause=e}};async function lge(e,t,n,r,i={}){let a=i.thresholdBytes??512e3,o=i.chunkSizeBytes??51200,s=i.origin,c=i.yieldFn??uge,l=i.resolveOffset??(e=>e);if(r.length<=a){e.transact(()=>{t.insert(n,r)},s);return}let u=Math.ceil(r.length/o),d=0,f=n,p=0,m=0;for(;d<r.length;){let n=Math.min(d+o,r.length),i=r.slice(d,n);try{let n=l(f);e.transact(()=>{t.insert(n,i)},s)}catch(e){throw new k9(e,{chunksCompleted:p,totalChunks:u,bytesWritten:m,bytesRemaining:r.length-d})}p++,m+=i.length,f+=i.length,d=n,d<r.length&&await c()}}function uge(){return new Promise(e=>{let t=globalThis;t.document?.hidden!==!0&&typeof t.requestAnimationFrame==`function`?t.requestAnimationFrame(()=>e()):setTimeout(()=>e(),0)})}function dge(e){let t;try{t=new URL(e)}catch{return null}let n=t.pathname.match(/^\/video\/(\d+)/);if(n)return n[1]??null;let r=t.pathname.match(/^\/(\d+)/);return r?r[1]??null:null}function fge(e){if(typeof e!=`string`||e.length===0)return e;let t=w3(e);if(t){let e=t.noCookie?`www.youtube-nocookie.com`:`www.youtube.com`,n=t.startSeconds===null?``:`?start=${t.startSeconds}`;return`https://${e}/embed/${t.id}${n}`}if(S3(e)){let t=dge(e);return t?`https://player.vimeo.com/video/${t}`:e}let n=b3(e);if(n){let e=n.startRaw===null?``:`?t=${n.startRaw}`;return`https://www.loom.com/embed/${n.id}${e}`}return e}var pge=`https://api.github.com/repos/inkeep/open-knowledge`;async function mge(e){let{signal:t,...n}=e??{},r=t?AbortSignal.any([AbortSignal.timeout(5e3),t]):AbortSignal.timeout(5e3);try{let e=await fetch(pge,{headers:{accept:`application/vnd.github+json`,"user-agent":`openknowledge.ai`},...n,signal:r});if(!e.ok)return console.warn(`[github-stars] GitHub API responded ${e.status}`),null;let t=await e.json();return typeof t.stargazers_count==`number`?t.stargazers_count:null}catch(e){return console.warn(`[github-stars] fetch failed: ${e instanceof Error?e.message:String(e)}`),null}}var hge=/^(#{1,6})\s+(.+)$/;function gge(e,t){let n=(e.endsWith(`\r`)?e.slice(0,-1):e).match(hge);if(!n)return null;let r=n[2].trim(),i=_7(r,t);return i?{level:n[1].length,text:r,slug:i}:null}var _ge=Array.from({length:256},(e,t)=>(t+256).toString(16).slice(1));function A9(){let e=globalThis.crypto;if(e&&typeof e.randomUUID==`function`)return e.randomUUID();let t=new Uint8Array(16);if(e&&typeof e.getRandomValues==`function`)e.getRandomValues(t);else for(let e=0;e<16;e++)t[e]=Math.floor(Math.random()*256);t[6]=t[6]&15|64,t[8]=t[8]&63|128;let n=_ge;return`${n[t[0]]}${n[t[1]]}${n[t[2]]}${n[t[3]]}-${n[t[4]]}${n[t[5]]}-${n[t[6]]}${n[t[7]]}-${n[t[8]]}${n[t[9]]}-${n[t[10]]}${n[t[11]]}${n[t[12]]}${n[t[13]]}${n[t[14]]}${n[t[15]]}`}var vge={fileSystem:`File System`,gitUpstream:`Git (upstream)`,service:`OpenKnowledge (service)`,generator:`OpenKnowledge (generated)`},yge=[`#D97757`,`#1B1912`,`#F9F3E9`,`#7A9DFF`,`#8534F3`,`#9663F0`,`#727CF3`],bge={claude:`#D97757`,cursor:`#1B1912`,windsurf:`#0B100F`,openai:`#7A9DFF`,github:`#8534F3`,cline:`#9663F0`,bot:`#727CF3`},xge={cursor:`#FFFFFF`,windsurf:`#FFFFFF`},j9=[`#f0ece3`,`#fff5e1`,`#f9e1db`,`#f5def7`,`#ece2fb`,`#dce8fa`,`#DBF3FB`];function Sge(e,t=yge){let n=0;for(let t of e)n=(n<<5)-n+t.charCodeAt(0)|0;return t[Math.abs(n)%t.length]}function Cge(e){let t=e.trim();if(!t)return`?`;let n=t.split(/[-\s]+/).filter(Boolean);if(!n.length)return`?`;if(n.length>=2)return n.slice(0,2).map(e=>e[0]??``).join(``).toUpperCase();let r=n[0],i=[r[0]];for(let e=1;e<r.length&&i.length<2;e++){let t=r[e-1],n=r[e];t===t.toLowerCase()&&n===n.toUpperCase()&&n!==n.toLowerCase()&&i.push(n)}return i.length>=2?i.join(``).toUpperCase():r.slice(0,2).toUpperCase()}function wge(e){let t=e.trim();if(!t)return e;if(t.includes(` `)||!/[-_]/.test(t))return t;let n=t.split(/[-_]+/).filter(Boolean);return n.length?n.map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(` `):t}var Tge={"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 Ege(e){return e?Tge[e]||(e.startsWith(`local-agent-mode-`)?`claude`:`bot`):`bot`}function Dge(e){let t=parseInt(e.slice(1,3),16)/255,n=parseInt(e.slice(3,5),16)/255,r=parseInt(e.slice(5,7),16)/255,i=Math.max(t,n,r),a=Math.min(t,n,r),o=(i+a)/2;if(i===a)return[0,0,o*100];let s=i-a,c=o>.5?s/(2-i-a):s/(i+a),l;return l=i===t?((n-r)/s+(n<r?6:0))/6:i===n?((r-t)/s+2)/6:((t-n)/s+4)/6,[l*360,c*100,o*100]}function Oge(e,t,n){let r=t/100,i=n/100,a=r*Math.min(i,1-i),o=t=>{let n=(t+e/30)%12,r=i-a*Math.max(Math.min(n-3,9-n,1),-1);return Math.round(255*r).toString(16).padStart(2,`0`)};return`#${o(0)}${o(8)}${o(4)}`}function kge(e){let[t]=Dge(e);return Oge(t,45,32)}var Age=[`Curious`,`Brave`,`Clever`,`Swift`,`Gentle`,`Bright`,`Wise`,`Bold`,`Calm`,`Keen`],jge=[`Bird`,`Cat`,`Dog`,`Fish`,`Mouse`,`Rabbit`,`Shrimp`,`Snail`,`Squirrel`,`Turtle`],M9=`ok-user-name-v3`,N9=`ok-user-color-v3`;function P9(e){return e[Math.floor(Math.random()*e.length)]}function Mge(){return`${P9(Age)} ${P9(jge)}`}function Nge(){return P9(j9)}function F9(e){try{return localStorage.getItem(e)}catch{return null}}function I9(e,t){try{localStorage.setItem(e,t)}catch{}}function Pge(){let e=new URLSearchParams(window.location.search).get(`coeditor`)||`standalone`,t=A9(),n=F9(M9),r=F9(N9);return n||(n=Mge(),I9(M9,n)),r||(r=Nge(),I9(N9,r)),{name:n,color:r,coeditor:e,tabId:t}}function L9(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 Fge(e){return e===`.`||e===`..`?e:encodeURIComponent(e).replace(/[!'()*]/g,e=>`%${e.codePointAt(0)?.toString(16).toUpperCase()}`)}function Ige(e){return e.split(`/`).map(Fge).join(`/`)}function R9(e){return e.split(`/`).map(L9).join(`/`)}function Lge(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=L9(o.split(`/`).pop()??``).match(/\.([a-z0-9]+)$/i);if(s){let e=`.${(s[1]??``).toLowerCase()}`;if(!P$.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=L9(d[e]??``);if(e===f&&(t=sf(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 Rge(e){throw Error(`Unhandled ClassifiedLinkTarget variant: ${JSON.stringify(e)}`)}var z9=/^[a-zA-Z][a-zA-Z\d+\-.]*:/;function B9(e){let t=(e.split(/[?#]/)[0]??e).match(/\.([a-z0-9]+)$/i);return t?(t[1]??``).toLowerCase():null}function V9(e){return e.split(`/`).filter(Boolean)}function H9(e){let t=e.trim();return z9.test(t)||t.startsWith(`//`)}function zge(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(H9(n))return{kind:`external`,url:n};let r=n.indexOf(`#`),i=R9(r<0?n:n.slice(0,r)),a=ff(i,t);if(a)return{kind:`doc`,docName:a,anchor:r<0?null:n.slice(r+1)};let o=df(i,t);if(o)return{kind:`doc`,docName:o,anchor:r<0?null:n.slice(r+1)};let s=Lge(n,t);if(s)return{kind:`doc`,docName:s.docName,anchor:s.anchor};let c=B9(i);return c&&c!==`md`&&c!==`mdx`?{kind:`asset`,url:n,ext:c,literal:!1}:null}function Bge(e,t){let n=e.trim();if(!n)return null;if(H9(n))return{kind:`external`,url:t?`${n}#${t}`:n};let r=B9(n);return r&&r!==`md`&&r!==`mdx`?{kind:`asset`,url:n,ext:r,literal:!0}:{kind:`doc`,docName:n,anchor:t?.trim()||null}}function Vge(e,t,n){let r=e.trim();if(!r||z9.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:L9(e));return c.length===0?null:c.join(`/`)}function Hge(e,t,n=null,r=`.md`){let i=V9(e);i.pop();let a=V9(t),o=0;for(;o<i.length&&o<a.length&&i[o]===a[o];)o+=1;let s=i.slice(o).map(()=>`..`),c=a.slice(o),l=[...s,...c].join(`/`);return l||=a.at(-1)??t,!l.startsWith(`./`)&&!l.startsWith(`../`)&&(l=`./${l}`),`${Ige(l)}${r}${n?`#${n}`:``}`}function Uge(e){if(!e)return{height:null,viewerFragment:``};let t=e.split(`&`).filter(e=>e.length>0),n=null,r=[];for(let e of t){let t=e.indexOf(`=`);if(t===-1){r.push(e);continue}let i=e.slice(0,t),a=e.slice(t+1);if(i===`height`){let e=Number.parseInt(a,10);!Number.isNaN(e)&&e>0&&(n=e);continue}r.push(e)}return{height:n,viewerFragment:r.join(`&`)}}var Wge=`unknown`;function Gge(e,t=Date.now()){let n=Date.parse(e);if(!Number.isFinite(n))return Wge;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 Kge(e){return e.replace(/[/\\:*?"<>|\0]/g,`-`).replace(/\s+/g,` `).replace(/-+/g,`-`).trim().replace(/^[-.\s]+|[-.\s]+$/g,``)}function U9(e){return`pagesBySlug`in e}function W9(e){return U9(e)?e.pages:e}function G9(e,t){return U9(e)?e.assetPaths??new Set:t??new Set}function K9(e,t){return U9(e)?e.filePaths??new Set:t??new Set}function q9(e,t){return e<t?-1:+(e>t)}function qge(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 Jge(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 J9(e,t){let n=g7(e);if(n){if(U9(t))return t.pagesBySlug.get(n);for(let e of t)if(g7(e)===n)return e}}function Y9(e,t){if(e.includes(`/`))return;let n=g7(e);if(!n)return;if(U9(t))return t.pagesByBasename?.get(n);let r;for(let e of t){let t=e.lastIndexOf(`/`);g7(t===-1?e:e.slice(t+1))===n&&(r===void 0||q9(e,r)<0)&&(r=e)}return r}function X9(e){let t=e.trim();if(!t)return[];let n=g7(t);return n.length>0&&n!==t?[n]:[]}function Z9(e,t){let n=e.trim();if(!n)return;let r=W9(t);if(r.has(n))return n;let i=J9(n,t);if(i)return i;for(let e of X9(n))if(r.has(e))return e;return Q9(n,r)||Y9(n,t)}function Q9(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 Yge(e){let t=((e.trim().split(`#`)[0]??``).trim().split(`?`)[0]??``).trim();return t.startsWith(`/`)?t.slice(1):t}function $9(e,t,n){let r=Yge(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 Xge(e,t,n,r){let i=e.trim();if(!i)return!1;if($9(i,G9(t,n),K9(t,r)))return!0;let a=W9(t);return a.has(i)||X9(i).some(e=>a.has(e))||J9(i,t)!==void 0||Q9(i,a)?!0:Y9(i,t)!==void 0}function Zge(e,t,n){let r=Bge(e,t);return r===null||r.kind!==`asset`||$9(r.url,G9(n),K9(n))!==null||Z9(e,n)===void 0?r:{kind:`doc`,docName:e.trim(),anchor:t?.trim()||null}}export{z4 as $,fw as $a,Z9 as $i,V2 as $n,Op as $o,dse as $r,of as $s,H7 as $t,I$ as A,zk as Aa,Ate as Ac,n1 as Ai,V0 as An,Xp as Ao,ade as Ar,Jf as As,I4 as At,A0 as B,tD as Ba,sa as Bc,B4 as Bi,zge as Bn,tm as Bo,Moe as Br,Df as Bs,hme as Bt,X$ as C,pj as Ca,Vo as Cc,Bfe as Ci,Ade as Cn,dg as Co,E0 as Cr,sp as Cs,sme as Ct,nme as D,KA as Da,ane as Dc,spe as Di,XX as Dn,hp as Do,n$ as Dr,Ene as Ds,v4 as Dt,rme as E,lj as Ea,rne as Ec,upe as Ei,g$ as En,G as Eo,tX as Er,rp as Es,g4 as Et,Epe as F,yE as Fa,Uo as Fc,g8 as Fi,Hge as Fn,zm as Fo,_7 as Fr,Yd as Fs,g1 as Ft,Hpe as G,fT as Ga,oee as Gc,b4 as Gi,Sge as Gn,Gm as Go,ose as Gr,rf as Gs,o9 as Gt,Efe as H,HE as Ha,I as Hc,w3 as Hi,fQ as Hn,pp as Ho,gse as Hr,kf as Hs,gme as Ht,Tpe as I,nE as Ia,R as Ic,ige as Ii,tge as In,Hm as Io,Pge as Ir,Jd as Is,Bme as It,d1 as J,iT as Ja,Ke as Jc,vY as Ji,k5 as Jn,Jp as Jo,mse as Jr,kd as Js,t4 as Jt,Tle as K,pT as Ka,Nt as Kc,_X as Ki,bQ as Kn,Wm as Ko,sse as Kr,nf as Ks,lhe as Kt,ime as L,ET as La,To as Lc,age as Li,lge as Ln,Vm as Lo,X9 as Lr,Id as Ls,vge as Lt,xpe as M,Dk as Ma,Gte as Mc,xZ as Mi,U0 as Mn,im as Mo,wge as Mr,Zd as Ms,V1 as Mt,s9 as N,hie as Na,Fo as Nc,y5 as Ni,Jge as Nn,Jm as No,Gge as Nr,Xd as Ns,lme as Nt,ufe as O,Fk as Oa,jte as Oc,Noe as Oi,S$ as On,wp as Oo,i1 as Or,wne as Os,bpe as Ot,P7 as P,PE as Pa,Mo as Pc,S0 as Pi,qge as Pn,Dp as Po,mge as Pr,qd as Ps,m1 as Pt,Q5 as Q,UE as Qa,Je as Qc,Zge as Qi,$0 as Qn,bp as Qo,ase as Qr,jf as Qs,i9 as Qt,O$ as R,rD as Ra,F as Rc,b3 as Ri,sQ as Rn,Bm as Ro,w0 as Rr,ef as Rs,vme as Rt,k9 as S,u9 as Sa,Oo as Sc,S3 as Si,jde as Sn,s_ as So,k$ as Sr,Dne as Ss,K$ as St,Cpe as T,uj as Ta,ene as Tc,oQ as Ti,RY as Tn,Rh as To,F0 as Tr,Zm as Ts,Spe as Tt,j9 as U,Fw as Ua,M as Uc,ege as Ui,pQ as Un,Cp as Uo,cse as Ur,Kd as Us,_me as Ut,Mpe as V,Nw as Va,z as Vc,C0 as Vi,ahe as Vn,Mne as Vo,Ege as Vr,Sd as Vs,R7 as Vt,h3 as W,Iw as Wa,aee as Wc,A9 as Wi,r1 as Wn,yp as Wo,_se as Wr,Vf as Ws,yme as Wt,p1 as X,sT as Xa,Ve as Xc,w4 as Xi,r2 as Xn,ap as Xo,pse as Xr,Nd as Xs,a4 as Xt,f1 as Y,oT as Ya,Be as Yc,Vge as Yi,O2 as Yn,qp as Yo,use as Yr,af as Ys,o4 as Yt,F$ as Z,DT as Za,We as Zc,$9 as Zi,n2 as Zn,Om as Zo,lse as Zr,tf as Zs,l4 as Zt,M$ as _,g7 as _a,tne as _c,_1 as _i,O0 as _n,Tg as _o,B$ as _r,np as _s,W$ as _t,hpe as a,Qhe as aa,wf as ac,L$ as ai,Vme as an,hC as ao,$ae as ar,Nm as as,Kpe as at,hQ as b,v7 as ba,jo as bc,X7 as bi,z2 as bn,Pg as bo,Lme as br,Sne as bs,D9 as bt,D4 as c,ffe as ca,_f as cc,K2 as ci,zme as cn,nC as co,l$ as cr,mp as cs,k4 as ct,yhe as d,aQ as da,sf as dc,H5 as di,J$ as dn,q_ as do,C8 as dr,lh as ds,B1 as dt,u$ as ea,gf as ec,fse as ei,the as en,UC as eo,t2 as er,mm as es,C1 as et,Che as f,z0 as fa,Cf as fc,H$ as fi,cge as fn,X_ as fo,H3 as fr,Gp as fs,kde as ft,vhe as g,xfe as ga,ws as gc,Xge as gi,T0 as gn,Ag as go,kge as gr,Cm as gs,Pme as gt,xhe as h,u1 as ha,Qte as hc,v1 as hi,Ofe as hn,q as ho,R9 as hr,Kp as hs,Z0 as ht,Zpe as i,F4 as ia,Wf as ic,M4 as ii,Eme as in,LE as io,Q0 as ir,bne as is,jfe as it,ume as j,Bk as ja,Ts as jc,ehe as ji,OY as jn,rm as jo,b5 as jr,Ef as js,Ife as jt,T9 as k,wk as ka,Mte as kc,C$ as ki,B0 as kn,Sp as ko,Ffe as kr,Kf as ks,L4 as kt,kpe as l,she as la,Gf as lc,x3 as li,dme as ln,N_ as lo,c$ as lr,Wp as ls,O9 as lt,bhe as m,nQ as ma,Zte as mc,G2 as mi,kfe as mn,O_ as mo,jhe as mr,ep as ms,X0 as mt,xge as n,Kge as na,xf as nc,mY as ni,Wme as nn,kT as no,E2 as nr,Pne as ns,Bpe as nt,A4 as o,H4 as oa,lf as oc,H9 as oi,R$ as on,yS as oo,uX as or,qne as os,U$ as ot,She as p,cde as pa,zd as pc,sge as pi,y4 as pn,K as po,Nhe as pr,Hp as ps,V5 as pt,l1 as q,Yw as qa,ze as qc,gX as qi,xQ as qn,Um as qo,hse as qr,Pd as qs,h4 as qt,Xpe as r,gge as ra,mf as rc,x1 as ri,Dme as rn,eD as ro,e2 as rr,up as rs,Cfe as rt,j4 as s,pfe as sa,yf as sc,Nfe as si,c0 as sn,SS as so,Cge as sr,lm as ss,f7 as st,bge as t,fge as ta,Tf as tc,Qme as ti,U7 as tn,Jw as to,B2 as tr,bm as ts,Fpe as tt,Ope as u,k0 as ua,Ld as uc,hfe as ui,Y$ as un,J as uo,zfe as ur,$p as us,Que as ut,j$ as v,V4 as va,As as vc,uhe as vi,zpe as vn,jg as vo,R0 as vr,qm as vs,V$ as vt,A7 as w,sj as wa,Ho as wc,S4 as wi,che as wn,W as wo,B9 as wr,Tne as ws,ame as wt,N$ as x,Y0 as xa,ko as xc,j0 as xi,Rge as xn,E_ as xo,mQ as xr,wm as xs,G$ as xt,uQ as y,U4 as ya,Ao as yc,jme as yi,CZ as yn,Fg as yo,Rfe as yr,xm as ys,Vpe as yt,M0 as z,iD as za,P as zc,Uge as zi,nge as zn,Ep as zo,A$ as zr,Of as zs,mme as zt};
598
+ `?(c+=1,l=1):l+=1;return{line:c,column:l}};for(let e of o.matchAll(efe)){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(tfe(e[0]),s)}})}),rfe=[`index`,`log`],ife=q5(`reserved-casing`,(e,t)=>{let n=t.data.okfDocName;if(n===void 0)return;let r=q$(n),i=r.toLowerCase();rfe.includes(i)&&r!==i&&t.message(`This file is named "${r}", but the Open Knowledge Format only recognizes "${i}". On a case-sensitive filesystem a consumer reads it as an ordinary concept document rather than the reserved file it is meant to be.`)}),Z5=[{id:`no-wiki-links`,rule:nfe},{id:`log-shape`,rule:$de},{id:`index-shape`,rule:Jde},{id:`reserved-casing`,rule:ife}],afe=Z5.map(e=>e.rule);function ofe(e){return e===void 0?afe:Z5.filter(t=>H5(e,t.id)).map(e=>e.rule)}var sfe=Ka([P(),R(nm),Qa(M(),za())]),cfe={id:`markdownlint`,sliceSchema:I({enabled:P(),rules:Qa(M(),sfe)}),defaultSlice:{enabled:!1,rules:E5},async lint(e,t){return wde(e,D5(t.rules))},fix(e,t){return Cde(e,D5(t.rules))}},lfe=I({appliesTo:Ka([M(),F(M())]).optional(),file:M(),enabled:P().optional(),key:M().optional(),schema:Qa(M(),za()).optional()}),Q5=[cfe,{id:`frontmatter`,sliceSchema:I({enabled:P(),schemas:F(lfe)}),defaultSlice:{enabled:!1,schemas:[]},async lint(e,t,n){return z5(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:Qa(M(),P()).optional(),generate:I({index:P().optional()}).optional()}),defaultSlice:{enabled:!1},async lint(e,t,n){return[...Gde(e,ofe(t.rules),n.docName),...Hde(e,t.rules,n.docName)]},frontmatter:{schemasForDoc:(e,t)=>K5(e.rules,t),narrowSliceToFrontmatter:e=>({...e,rules:{...e.rules,...Bde}}),advertisedMappings:e=>Vde(e.rules)}}],ufe={enabled:!0,plugins:Object.fromEntries(Q5.map(e=>[e.id,e.defaultSlice]))};function dfe(e,t){return e.enabled&&e.plugins[t]?.enabled===!0}function ffe(e,t){if(!e?.enabled||t===void 0||t===``)return[];let n=[];for(let r of Q5){if(r.frontmatter===void 0)continue;let i=e.plugins[r.id];i?.enabled===!0&&n.push(...r.frontmatter.schemasForDoc(i,t))}return n}function pfe(e){let t=Object.fromEntries(Q5.map(t=>{let n=e.plugins[t.id]??t.defaultSlice;return t.frontmatter===void 0?[t.id,{...n,enabled:!1}]:[t.id,t.frontmatter.narrowSliceToFrontmatter(n)]}));return{...e,plugins:t}}var mfe=new Set([`.markdownlint.json`,`.markdownlint.jsonc`]);function hfe(e){return mfe.has(e)}I({docName:J2,summary:Z2,content:M().optional(),...X2}).loose(),I({docName:J2,summary:Z2,markdown:M(),position:R([`append`,`prepend`,`replace`]).optional(),extension:R(P$).optional(),...X2}).loose(),I({docName:J2,summary:Z2,find:M().min(1),replace:M(),offset:N().int().nonnegative().optional(),...X2}).loose(),I({docName:J2,connectionId:M().min(1),scope:R([`last`,`session`,`file`,`count`]).optional(),count:N().int().positive().optional(),...X2}).loose().refine(e=>e.scope!==`count`||e.count!==void 0,{message:`count is required when scope is 'count'`,path:[`count`]});var $5=I({value:M(),truncatedFrom:N().int().nonnegative().optional(),hint:M().optional()}).loose(),gfe=Ja(`kind`,[I({kind:z(`inline`),content:M()}),I({kind:z(`truncated`),byteLength:N().int().nonnegative(),hint:M()})]),e7=I({kind:z(`content-divergence`),intendedBytes:N().int().nonnegative(),actualBytes:N().int().nonnegative(),byteDelta:N().int(),divergenceType:M().optional(),currentState:gfe.optional(),hint:M().optional()}).loose(),_fe=I({type:z(`orphan`),parentCandidates:F(M()),message:M()}).loose(),t7=I({kind:z(`disk-edit-reconciled`),intendedBytes:N().int().nonnegative(),actualBytes:N().int().nonnegative(),byteDelta:N().int(),mergeOutcome:M().optional(),hint:M().optional()}).loose();Ja(`kind`,[e7,t7]);var vfe=I({kind:z(`mermaid-parse-error`),fenceIndex:N().int().positive(),fenceFirstLine:M(),message:M(),line:N().int().positive().optional()}).loose(),n7=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(),r7=F(Ja(`kind`,[e7,t7,vfe,I({kind:z(`lint-violation`),source:M(),code:M(),message:M(),severity:R([`error`,`warning`,`info`,`hint`]),line:N().int().positive(),column:N().int().positive(),linkTarget:M().optional(),localTarget:n7.optional()}).loose()])).min(1),i7=F(I({href:M(),resolvedTo:M().nullable(),reason:R([`no-such-doc`,`no-such-file`,`unresolvable`]),localTarget:n7.optional()}).loose()),a7=I({reason:M().min(1),count:N().int().positive()}).loose();I({timestamp:M().min(1),summary:$5.optional(),warnings:r7.optional()}).loose(),I({timestamp:M().min(1),subscriberCount:N().int().nonnegative(),systemSubscriberCount:N().int().nonnegative(),hints:F(_fe).optional(),summary:$5.optional(),warnings:r7.optional(),brokenLinks:i7,brokenLinkSuppression:a7.optional()}).loose(),I({timestamp:M().min(1),subscriberCount:N().int().nonnegative(),systemSubscriberCount:N().int().nonnegative(),summary:$5.optional(),warnings:r7.optional(),brokenLinks:i7,brokenLinkSuppression:a7.optional()}).loose(),I({docName:M().min(1),scope:R([`last`,`session`,`count`]),undone:P()}).loose(),I({docs:F(I({docName:Y2,markdown:M(),position:R([`append`,`prepend`,`replace`]).optional(),extension:R(P$).optional(),summary:Z2}).loose()).min(1).max(100),...X2}).loose();var yfe=I({type:_4,title:M(),detail:M().optional()}).loose(),bfe=Ja(`status`,[I({status:z(`written`),docName:M().min(1),summary:$5.optional(),warnings:r7.optional(),brokenLinks:i7,brokenLinkSuppression:a7.optional()}).loose(),I({status:z(`error`),docName:M().min(1),error:yfe}).loose()]);I({timestamp:M().min(1),results:F(bfe),written:N().int().nonnegative(),failed:N().int().nonnegative()}).loose(),I({docName:J2,patch:Qa(M(),Ka([Ed,La()])),types:Qa(M(),R(Cd)).optional(),summary:Z2,...X2}).loose(),I({timestamp:M().min(1),subscriberCount:N().int().nonnegative(),systemSubscriberCount:N().int().nonnegative(),appliedKeys:F(M()),summary:$5.optional(),warnings:r7.optional(),brokenLinks:i7,brokenLinkSuppression:a7.optional()}).loose();function xfe(e){return{enabled:e.enabled??!0,plugins:{markdownlint:{...e.markdownlint,rules:e.markdownlint.rules??E5},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}}}}}var Sfe=Object.fromEntries(Q5.map(e=>[e.id,e.sliceSchema])),Cfe=I({effective:I({enabled:P(),plugins:I(Sfe)}),configFile:M().nullable().optional(),configProblems:F(M()).optional()}),wfe=Ka([P(),Qa(M(),za())]),Tfe=new Set([`__proto__`]),o7=M().min(1).max(256).refine(e=>!Tfe.has(e),{message:`schema property name cannot be __proto__`});I({ruleId:M().min(1).max(64).regex(/^[A-Za-z][A-Za-z0-9_-]*$/),value:Ka([wfe,La()])}),I({file:M().min(1).max(512),delete:z(!0).optional(),field:o7.optional(),parentPath:F(Ka([o7,I({items:z(!0)}).strict()])).max(8).optional(),removeField:z(!0).optional(),renameTo:o7.optional(),constraint:I({type:R([`string`,`number`,`boolean`,`array`,`object`]).nullable().optional(),enum:F(Ka([M(),N(),P()])).nullable().optional(),itemsEnum:F(Ka([M(),N(),P()])).nullable().optional(),itemsType:R([`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`});var Efe=I({schemas:F(M()),truncated:P()}).strict(),s7=I({line:N(),character:N()}),c7=I({start:s7,end:s7}),l7=I({range:c7,severity:R([`error`,`warning`,`info`,`hint`]),source:M(),code:M(),message:M(),fixes:F(I({range:c7,newText:M()})).optional(),frontmatterScope:R(Qp).optional(),frontmatterProperty:M().optional()}),u7=F(M()).optional();I({files:F(I({file:M(),diagnostics:F(l7),ran:u7,warnings:F(M()).optional()})),fileCount:N(),errorCount:N(),warningCount:N(),warnings:F(M()),ran:u7});var Dfe=l7.extend({linkTarget:M().optional(),localTarget:n7.optional()}),Ofe=I({files:F(I({file:M(),diagnostics:F(Dfe)})),fileCount:N(),errorCount:N(),warningCount:N(),warnings:F(M()),ran:u7,brokenLinkSuppression:a7.optional()}),d7=I({errorCount:N().int().nonnegative(),warningCount:N().int().nonnegative()}),kfe=I({files:F(I({file:M(),lint:d7,links:d7})),fileCount:N().int().nonnegative(),errorCount:N().int().nonnegative(),warningCount:N().int().nonnegative(),warnings:F(M()),brokenLinkSuppression:a7.optional()});I({docName:J2,summary:Z2,...X2}).loose();var Afe=I({reason:R([`re-lint-threw`,`source-went-blind`]),message:M().min(1)}),jfe=I({file:M(),fixedCount:N(),diagnostics:F(l7),errorCount:N(),warningCount:N(),ran:u7,warnings:F(M()).optional(),diagnosticsArePreFix:P().optional(),reLintFailure:Afe.optional()});function Mfe(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 Nfe(e){let t=e.trim().toLowerCase().split(`/`).pop()??``;return t.endsWith(`.schema.json`)&&t.length>12?!0:Mfe(e)&&t.endsWith(`.json`)}var f7=[{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}]}],Pfe=(()=>{let e=new Map;for(let t of f7){e.set(t.id.toUpperCase(),t.id);for(let n of t.aliases)e.set(n.toUpperCase(),t.id)}return e})();function p7(e){return Pfe.get(e.toUpperCase())??null}function Ffe(e,t){let n=p7(t);if(n===null)return;let r;for(let[t,i]of Object.entries(e))p7(t)===n&&(r={key:t,value:i});return r}var Ife=[`Headings`,`Lists`,`Whitespace`,`Code`,`Links & images`,`Style`],Lfe=[[`headings`,`Headings`],[`bullet`,`Lists`],[`ul`,`Lists`],[`ol`,`Lists`],[`links`,`Links & images`],[`images`,`Links & images`],[`accessibility`,`Links & images`],[`code`,`Code`],[`language`,`Code`],[`emphasis`,`Style`],[`html`,`Style`],[`line_length`,`Whitespace`],[`whitespace`,`Whitespace`],[`hard_tab`,`Whitespace`],[`blank_lines`,`Whitespace`],[`indentation`,`Whitespace`]];function Rfe(e){for(let[t,n]of Lfe)if(e.tags.includes(t))return n;return`Style`}function zfe(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}async function Bfe(e,t,n,r){if(!t.enabled)return[];let i=[];for(let a of Q5){if(!dfe(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:Vfe(e)})}}return i}var m7=500;function Vfe(e){let t=h7(e);return t.length>m7?`${t.slice(0,m7)}… (truncated)`:t}function h7(e,t=0){if(e instanceof Error)return e.cause===void 0||t>=3?e.message:`${e.message} (cause: ${h7(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)}var Hfe=/\p{M}+/gu,Ufe=/[^\p{L}\p{N}]+/gu,Wfe=/^-+|-+$/g;function g7(e){return e.trim().normalize(`NFKD`).replace(Hfe,``).toLowerCase().replace(Ufe,`-`).replace(Wfe,``)}function Gfe(e,t){let n=t.get(e)??0;return t.set(e,n+1),n===0?e:`${e}-${n}`}function _7(e,t){let n=g7(e);return n?Gfe(n,t):``}function v7(e,t){let n=g7(e);return t?`#${n}-${g7(t)}`:`#${n}`}var y7=new Set([`img`,`video`,`audio`,`mark`,`u`,`ins`]),Kfe=new Map(V3.flatMap(e=>e.surface===`compat`&&y7.has(e.rendersAs)?[[e.name,e]]:[]));function b7(e){let t={};for(let n of e.attributes){if(n.type!==`mdxJsxAttribute`)return null;let e=n.name.toLowerCase();if(!(e.length>=3&&e.startsWith(`on`)))if(n.value===null)t[n.name]=!0;else if(typeof n.value==`string`)t[n.name]=n.value;else return null}return t}function x7(e){let t=e.name;if(!t||!y7.has(t))return null;let n=b7(e);return n===null?null:{type:`element`,tagName:t,properties:n,children:[]}}function S7(e){let t=e.name;if(!t)return null;let n=Kfe.get(t);if(!n)return null;let r=b7(e);if(r===null)return null;let i=n.translateProps(r),a={};for(let[e,t]of Object.entries(i))(typeof t==`string`||typeof t==`boolean`)&&(a[e]=t);return{type:`element`,tagName:n.rendersAs,properties:a,children:[]}}var qfe=(e,t)=>{let n=t,{target:r,anchor:i,alias:a}=n.data,o={type:`element`,tagName:`a`,properties:{className:[`wiki-link`],dataTarget:r,dataAnchor:i??``,dataAlias:a??``,href:v7(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},Jfe=(e,t)=>{let n=t,{target:r,anchor:i,alias:a}=n.data,o={type:`element`,tagName:`a`,properties:{className:[`wiki-embed`],dataTarget:r,dataAnchor:i??``,dataAlias:a??``,href:v7(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},Yfe=(e,t)=>{let n=t,r=x7(n);if(r)return n.children.length>0&&(r.children=e.all(n)),e.patch(t,r),e.applyData(t,r);let i=S7(n);if(i){e.patch(t,i);let n=e.applyData(t,i);return n.tagName===`img`?{type:`element`,tagName:`p`,properties:{},children:[n]}:n}let a={type:`element`,tagName:`pre`,properties:{className:[`mdx-component`]},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:``}]}]};return e.patch(t,a),e.applyData(t,a)},Xfe=(e,t)=>{let n=t,r=x7(n);if(r)return n.children.length>0&&(r.children=e.all(n)),e.patch(t,r),e.applyData(t,r);let i=S7(n);if(i)return e.patch(t,i),e.applyData(t,i);let a={type:`element`,tagName:`span`,properties:{className:[`mdx-inline`],dataJsxInline:``},children:[{type:`text`,value:typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:``}]};return e.patch(t,a),e.applyData(t,a)},Zfe=(e,t)=>{let n=t,r=n.data.reason||`unknown`,i=n.value||``,a=r.replace(/--/g,`—`),o={type:`comment`,value:` Parse error: ${a} `},s={type:`element`,tagName:`pre`,properties:{className:[`mdx-fallback`],dataRawMdxFallback:``,dataReason:a},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:i}]}]};return e.patch(t,s),[o,e.applyData(t,s)]},Qfe=(e,t)=>{let n={type:`element`,tagName:`mark`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},$fe=(e,t)=>{let n=t,r={type:`element`,tagName:n.data?.sourceForm===`ins`?`ins`:`u`,properties:{},children:e.all(n)};return e.patch(t,r),e.applyData(t,r)};function C7(e){if(typeof e!=`object`||!e)return``;let t=e;return typeof t.value==`string`?t.value:Array.isArray(t.children)?t.children.map(C7).join(``):``}var w7={wikiLink:qfe,wikiLinkEmbed:Jfe,mdxJsxFlowElement:Yfe,mdxJsxTextElement:Xfe,rawMdxFallback:Zfe,mark:Qfe,underline:$fe,tag:(e,t)=>{let n=t.value,r={type:`element`,tagName:`a`,properties:{className:[`tag`],dataTag:n,href:`#tag/${n}`},children:[{type:`text`,value:`#${n}`}]};return e.patch(t,r),e.applyData(t,r)},comment:(e,t)=>{let n={type:`comment`,value:C7(t).replace(/--/g,`—`)};return e.patch(t,n),e.applyData(t,n)},commentBlock:(e,t)=>{let n={type:`comment`,value:C7(t).replace(/--/g,`—`)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:(e,t)=>{let n=t.identifier,r={type:`element`,tagName:`sup`,properties:{id:`fnref-${n}`,dataFootnoteRef:``,dataFootnoteId:n,className:[`footnote-ref`]},children:[{type:`element`,tagName:`a`,properties:{href:`#fn-${n}`,className:[`footnote-ref-link`]},children:[{type:`text`,value:`[${n}]`}]}]};return e.patch(t,r),e.applyData(t,r)},footnoteDefinition:(e,t)=>{let n=t.identifier,r={type:`element`,tagName:`aside`,properties:{id:`fn-${n}`,dataFootnoteDef:``,dataFootnoteId:n,className:[`footnote-def`]},children:[{type:`element`,tagName:`div`,properties:{className:[`footnote-body`]},children:e.all(t)},{type:`element`,tagName:`a`,properties:{href:`#fnref-${n}`,className:[`footnote-backref`],ariaLabel:`Back to reference`},children:[{type:`text`,value:`↩`}]}]};return e.patch(t,r),e.applyData(t,r)}},epe=/url\s*\(\s*['"]?\s*(?:javascript|vbscript|data)\s*:/i,tpe=/\bexpression\s*\(/i,npe=1e4;function rpe(e){return!(e.length>npe||epe.test(e)||tpe.test(e))}function T7(e){for(let t of e.split(`,`)){let e=t.trim();if(e!==``&&!_1(e.split(/\s+/)[0]??``))return!1}return!0}var ipe={a:[`href`,`title`],img:[`src`,`alt`,`title`],video:[`src`,`title`],audio:[`src`,`title`],code:[`className`]},ape=new Set([`href`,`src`]),ope=we(`<>`),E7=()=>e=>{h(e,`element`,e=>{let t=ipe[e.tagName.toLowerCase()],n=e.properties;if(!(!t||!n))for(let e of t){let t=n[e];if(Array.isArray(t)){let r=t.map(e=>typeof e==`string`?E6(e):e);r.some((e,n)=>e!==t[n])&&(n[e]=r);continue}if(typeof t!=`string`)continue;let r;if(ape.has(e))if(t===`<>`||t===ope)r=``;else{let e=E6(t);r=e===t?t:we(e)}else r=E6(t);r!==t&&(n[e]=r)}})},D7=()=>e=>{h(e,`element`,e=>{let t=e.tagName.toLowerCase(),n=e.properties;if(!n)return;if(t===`a`||t===`area`||t===`link`||t===`base`){let e=n.href;typeof e==`string`&&!_1(e)&&delete n.href}if(t===`img`||t===`iframe`||t===`script`||t===`embed`||t===`source`||t===`audio`||t===`video`||t===`track`){let e=n.src;typeof e==`string`&&!_1(e)&&delete n.src}if(t===`form`){let e=n.action;typeof e==`string`&&!_1(e)&&delete n.action}if(t===`img`||t===`source`){let e=n.srcSet;typeof e==`string`&&!T7(e)&&delete n.srcSet;let t=n.srcset;typeof t==`string`&&!T7(t)&&delete n.srcset}if(t===`video`){let e=n.poster;typeof e==`string`&&!_1(e)&&delete n.poster}let r=n.style;typeof r==`string`&&!rpe(r)&&delete n.style})};function spe(e){let t=Ce().use(xe,{handlers:w7}).use(E7).use(D7).use(SG),n=t.runSync(e);return String(t.stringify(n))}function cpe(e){let t=/\r?\n|\r/g,n=[],r=0,i=t.exec(e);for(;i!==null;)n.push(O7(e.slice(r,i.index),r>0,!0),i[0]),r=i.index+i[0].length,i=t.exec(e);return n.push(O7(e.slice(r),r>0,!1)),n.join(``)}function O7(e,t,n){let r=0,i=e.length,a=e=>e===9||e===32;for(;t&&r<i&&a(e.charCodeAt(r));)r++;for(;n&&i>r&&a(e.charCodeAt(i-1));)i--;return i>r?e.slice(r,i):``}var k7=/\r?\n|\r/,lpe=(e,t)=>{let n=cpe(String(t.value));if(!k7.test(n)){let r={type:`text`,value:n};return e.patch(t,r),e.applyData(t,r)}let r=n.split(k7),i=[];for(let e=0;e<r.length;e++)e>0&&i.push({type:`element`,tagName:`br`,properties:{},children:[]}),r[e].length>0&&i.push({type:`text`,value:r[e]});return i};function upe(e){let t=Ce().use(ae).use(iF,[`yaml`]).use(k8).use(D).use(f5).use(b6).use($8).use(j6).use(xe,{handlers:{...w7,text:lpe}}).use(E7).use(D7).use(SG);return String(t.processSync(v6(A6(e))))}for(let e of[{tagName:`Mirror`,attrName:`src`,resolution:`bare-doc-name`},{tagName:`Excalidraw`,attrName:`src`,resolution:`doc-relative`}]){let t=V3.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.`)}jI(),XF(),ZF(),I({intents:F(I({satisfierId:M().min(1),desired:R([`present`,`absent`])}).loose()),...X2,summary:Z2}).loose();var dpe=I({satisfierId:M(),agentId:M(),piece:M(),scope:M(),kind:M(),pathId:M().optional(),desired:R([`present`,`absent`]),action:R(Yo),errorId:M().optional()}).loose(),fpe=I({kind:M(),satisfierIds:F(M()),agentIds:F(M()),pathId:M().optional(),blockedReason:M().optional()}).loose(),ppe=I({state:M(),strictness:F(R(qo)).optional()}).loose(),mpe=I({probes:I({env:R([`desktop`,`local-web`,`remote-web`]),satisfiers:Qa(M(),ppe)}).loose(),detection:I({detected:F(M()),probed:P()}).loose()}).loose(),hpe=I({actions:F(dpe),conflicts:F(fpe),withheld:F(M()),snapshot:mpe}).loose();I({entries:F(I({level:R([`info`,`warn`,`error`]),message:M().max(I4),event:M().optional(),fields:Qa(M(),za()).optional(),ts:N().optional(),sourceId:M().optional(),lineNumber:N().optional()}).loose()).max(100),droppedSinceLastFlush:N().int().min(0).optional()}).loose(),I({accepted:N().int().min(0)}).loose();var gpe=I({exact:M().min(1),prefix:M(),suffix:M(),start:N().int().nonnegative(),end:N().int().nonnegative()}),_pe=F(Ka([M(),N().int().nonnegative()])),vpe=Ja(`kind`,[I({kind:z(`body`)}),I({kind:z(`property`),key:M().min(1),path:_pe.default([])})]).default({kind:`body`}),ype=R([`anchored`,`orphaned`,`resolved`]),A7=I({threadId:M().min(1),docName:M().min(1),target:vpe,anchor:gpe.nullable(),state:ype,queued:P(),latestComment:M(),createdBy:M().min(1),createdAt:N(),updatedAt:N().optional()}),j7=I({docName:M(),instruction:M(),property:M().nullable(),passage:I({exact:M(),prefix:M(),suffix:M()}).nullable(),anchorLost:P(),passageRepeats:P()}).loose(),M7=I({threadId:M(),ok:z(!0)}),N7=I({threadId:M(),ok:z(!1),error:z(`not-found`)});I({threads:F(A7)}).loose();var bpe=I({meta:A7,orphaned:P()}).loose(),xpe=I({threadId:M()}).loose();I({meta:A7,payload:j7}).loose();var Spe=I({results:F(Ka([M7.extend({meta:A7,payload:j7}),N7]))}).loose(),Cpe=I({results:F(Ka([M7.extend({meta:A7}),N7]))}).loose(),wpe=I({status:M().min(1),reason:M()}).loose(),Tpe=I({docName:M().min(1),content:M(),lifecycle:wpe.nullable()}).loose(),P7=I({kind:R([`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:R([`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)`}),Epe=I({documents:F(P7),truncated:P().optional()}).loose(),Dpe=I({source:M().min(1),anchor:M().nullable(),title:M(),snippet:M().nullable()}).loose(),Ope=I({docName:M().min(1),backlinks:F(Dpe)}).loose(),kpe=I({counts:Qa(M().min(1),N().int().nonnegative())}).loose();I({counts:Qa(M().min(1),N().int().nonnegative())}).loose();var Ape=Ja(`kind`,[I({kind:z(`doc`),docName:M().min(1),anchor:M().nullable(),title:M(),snippet:M().nullable()}).loose(),I({kind:z(`external`),url:M().min(1),title:M(),snippet:M().nullable()}).loose()]),jpe=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(),Mpe=I({docName:M().min(1),forwardLinks:F(Ape),localTargets:F(jpe).optional()}).loose(),Npe=Ja(`kind`,[I({id:M().min(1),kind:z(`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:z(`external`),url:M().min(1),label:M()}).loose()]),Ppe=I({source:M().min(1),target:M().min(1)}).loose(),Fpe=I({nodes:F(Npe),links:F(Ppe)}).loose(),Ipe=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(),Lpe=I({app:Ka([z(`cursor`),z(`codex`),z(`claude`),La()]),signals_fired:F(M())}).loose();I({entries:F(Ipe),count:N().int().min(0),detection:Lpe}).loose();var F7=I({path:M().min(1),code:R([`M`,`A`,`D`,`R`,`C`,`U`,`T`,`?`,`!`,` `]),origPath:M().min(1).optional(),syncScoped:P(),open:Ja(`kind`,[I({kind:z(`doc`),docName:M().min(1)}),I({kind:z(`asset`),path:M().min(1)})]).optional()}).loose();I({branch:M().nullable(),detached:P(),upstream:M().nullable(),staged:F(F7),notStaged:F(F7),untracked:F(F7),incoming:F(F7),truncated:P(),readable:P().default(!0)}).loose(),I({writers:F(I({id:M().min(1),name:M().optional(),email:M().optional()}).loose()).optional(),summary:Z2,...X2}).loose(),I({checkpointRef:M().min(1)}).loose();var Rpe=I({v:N().int().optional(),id:M().min(1),name:M().min(1),colorSeed:M().optional(),docs:F(M()),summaries:F(M()).optional()}).loose();I({entries:F(I({sha:M().min(1),timestamp:M().min(1),author:M(),authorEmail:M(),type:R([`checkpoint`,`wip`,`upstream`,`park`]),message:M(),contributors:F(Rpe),checkpoint:za().nullable(),parentSha:M().nullable().optional()}).loose()),total:N().int().nonnegative().optional(),truncated:P().optional(),hasMore:P().optional()}).loose(),I({sha:M().regex(/^[0-9a-f]{40}$/i),content:M(),timestamp:M(),author:M()}).loose();var zpe=I({contentDir:M().min(1),pathSeparator:R([`/`,`\\`]),symlinkResolved:P()}).loose();F(Ja(`source`,[I({docName:M().min(1),timestamp:M().min(1),size:N().int().nonnegative(),source:z(`flat`)}).loose(),I({docName:M().min(1),timestamp:M().min(1),source:z(`timeline`),sha:M().min(1)}).loose()])).meta({description:"Flat array of rescue buffer entries; discriminated via `source`."});var I7=I({domain:M().min(1),title:M().optional(),description:M().optional(),siteName:M().optional(),faviconDataUri:M().optional()}).loose();I({url:M()}).loose();var Bpe=Ja(`ok`,[I({ok:z(!0),metadata:I7}).loose(),I({ok:z(!1),reason:M()}).loose()]),Vpe=I({orphans:F(I({docName:M().min(1),title:M()}).loose())}).loose(),Hpe=I({hubs:F(I({docName:M().min(1),title:M(),count:N().int().nonnegative()}).loose())}).loose(),Upe=I({source:M().min(1),title:M(),snippet:M().nullable()}).loose();I({deadLinks:F(I({target:M().min(1),sources:F(Upe)}).loose())}).loose(),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(),I({projectPath:M().min(1)}).loose();var Wpe=R([`not-a-git-worktree`,`init-failed`]);Ja(`ok`,[I({ok:z(!0),projectPath:M().min(1)}).loose(),I({ok:z(!1),reason:Wpe,message:M().min(1)}).loose()]),I({host:M().min(1).optional()}).loose(),I({host:M().min(1).optional(),token:M().min(1)}).loose(),I({host:M(),login:M()}).loose(),I({key:M().min(1)}).loose(),I({keyPresent:P()}).loose();var Gpe=R([`no_key`,`invalid_endpoint`,`rate_limit`,`timeout`,`http_error`,`network`,`dims_mismatch`,`malformed_response`]),Kpe=Ja(`ok`,[I({ok:z(!0),endpoint:M().min(1),model:M().min(1),dimensions:N().int().positive()}).loose(),I({ok:z(!1),endpoint:M().min(1),model:M().min(1),reason:Gpe,status:N().int().optional()}).loose()]);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(),I({authenticated:P()}).loose(),I({channel:R([`login`,`gh-login`]).default(`login`)}).loose(),I({}).loose();var qpe=I({stackIndex:N().int().min(0),ts:N().int().min(0),additions:N().int().min(0),deletions:N().int().min(0)}).loose(),Jpe=I({docName:M().min(1),additionsTotal:N().int().min(0),deletionsTotal:N().int().min(0),lastTs:N().int().min(0),bursts:F(qpe)}).loose(),Ype=I({displayName:M().min(1),color:M().min(1),icon:M().optional(),connectionId:M().min(1)}).loose(),Xpe=I({sessionAlive:P(),agent:Ype.nullable(),files:F(Jpe)}).loose(),Zpe=I({diff:M(),before:M(),after:M(),properties:I0,generatedAt:N().int().min(0)}).loose();I({}).loose(),I({}).loose(),I({}).loose(),I({}).loose(),I({}).loose(),I({}).loose();var Qpe=I({displayName:M().min(1),icon:M(),color:M().min(1),currentDoc:M().nullable(),mode:R([`idle`,`writing`]),ts:N().int().min(0)}).loose();I({presence:Qa(M().min(1),Qpe)}).loose();var $pe=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();I({effects:F(I({"doc.name":M().min(1),entries:F($pe)}).loose())}).loose(),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(),Qa(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(),I({}).loose();var eme=I({fromDocName:M().min(1),toDocName:M().min(1)}).loose(),tme=I({fromPath:M().min(1),toPath:M().min(1)}).loose();I({}).loose(),I({path:M().min(1),...X2,summary:Z2}).loose();var nme=I({docName:M().min(1)}).loose();I({path:M().min(1),...X2,summary:Z2}).loose();var rme=I({path:M().min(1)}).loose();I({kind:R([`file`,`folder`]),path:M().min(1),...X2,summary:Z2}).loose();var ime=I({kind:R([`file`,`folder`]),path:M().min(1),duplicatedDocNames:F(M().min(1))}).loose(),ame=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(),ome=I({level:N().int().min(1).max(6),text:M(),slug:M()}).loose(),sme=I({docName:M().min(1),headings:F(ome)}).loose(),cme=I({docName:M().min(1),rewrites:N().int().nonnegative()}).loose();I({kind:R([`file`,`folder`,`asset`]),fromPath:M().min(1),toPath:M().min(1),...X2,summary:Z2}).loose();var lme=I({renamed:F(eme),renamedAssets:F(tme),rewrittenDocs:F(cme).optional(),summary:$5.optional()}).loose();I({kind:R([`file`,`folder`,`asset`]),path:M().min(1),...X2}).loose();var ume=I({deletedDocNames:F(M().min(1))}).loose();I({kind:R([`file`,`folder`,`asset`]),path:M().min(1),...X2,summary:Z2}).loose();var dme=I({deletedDocNames:F(M().min(1))}).loose();I({docName:M().min(1),commitSha:M().regex(/^[0-9a-f]{40}$/i,{message:`commitSha must be a 40-char git SHA`}),summary:Z2,...X2}).loose(),I({restoredFrom:M().min(1),timestamp:M().min(1),summary:$5.optional(),warnings:r7.optional()}).loose();var fme=/^#[0-9a-fA-F]{6}$/,pme=I(Object.fromEntries(rm.map(e=>[e,M().regex(fme,`must be a #rrggbb hex color`)]))),L7=M().min(1).refine(cm,{message:`must contain a non-whitespace character`}),R7=I({name:L7,author:L7.optional(),variant:R([`dark`,`light`]),palette:pme}).loose(),mme=I({name:M().min(1),scheme:R7,stem:M().min(1).optional(),extension:R([`.yaml`,`.yml`]).optional()}).loose(),hme=I({id:M().min(1),filename:M().min(1)}).loose(),gme=I({id:M().min(1),scheme:R7}).loose(),_me=I({id:M().min(1),filename:M().min(1)}).loose(),vme=Ja(`existed`,[I({existed:z(!1)}).loose(),I({existed:z(!0),filename:M().min(1),scheme:R7}).loose()]),yme=I({themes:F(Ja(`ok`,[I({ok:z(!0),id:M().min(1),filename:M().min(1),scheme:R7}),I({ok:z(!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(),bme=R([`dormant`,`idle`,`fetching`,`pulling`,`pushing`,`conflict`,`offline`,`auth-error`,`disabled`]),xme=I({label:M().min(1),webUrl:ga().nullable()}).loose(),Sme=Ja(`checkStatus`,[I({checkStatus:z(`allowed`)}).loose(),I({checkStatus:z(`denied`),deniedReason:R([`no-collaborator`,`private-no-access`,`repo-not-found`,`not-authenticated`]),resolvedLogin:M().optional(),declaredLogin:M().optional(),declaredSource:M().optional()}).loose(),I({checkStatus:z(`unknown`),unknownError:R([`network`,`timeout`,`rate-limit`,`token-invalid`,`malformed-response`,`ssh-unverified`]).optional()}).loose()]),z7=R([`auth-403`,`auth-401`,`auth-scope-mismatch`,`auth-no-credential`,`auth-not-found-as-identity`,`semantic-protected-branch`]),Cme=R(Yf),wme=R([`succeeded`,`up-to-date`,`conflict`,`refused`,`error`]);I({state:bme,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:xme.nullable().optional(),pushError:M().optional(),pushErrorCode:z7.optional(),pullError:M().optional(),pullErrorCode:z7.optional(),pausedReason:M().optional(),blockingPaths:F(M().min(1)).optional(),pushPermission:Sme.optional(),syncMode:Cme.optional(),lastPullUtc:M().nullable().optional(),lastPullOutcome:wme.nullable().optional()}).loose(),I({action:R([`commit`]),paths:F(M().min(1)),commitSha:M().optional()}).loose(),I({action:R([`commit`])}).loose(),I({op:R([`sync`,`push`,`pull`,`fetch`]).optional()}).loose(),I({op:R([`sync`,`push`,`pull`,`fetch`])}).loose();var B7=R([`merge-native`,`working-tree`,`reconcile`]),V7=R([`merged-with-markers`,`refused-conflict-markers`,`refused-no-base`,`refused-too-large`,`disk-markers`,`stale-external-write`]),Tme=R([`mine`,`theirs`,`content`,`delete`]),Eme=I({conflicts:F(I({file:M().min(1),detectedAt:M().min(1),conflict:B7,reason:V7.optional().catch(void 0),conflictKind:R([`git`,`stale-external-write`]).optional(),docName:M().nullable(),theirsSha:M().optional(),baseSha:M().optional()}).loose())}).loose();I({file:M().min(1),strategy:R([`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`]}),I({}).loose();var Dme=I({file:M().min(1),base:M(),ours:M(),theirs:M(),kind:R([`both-modified`,`delete-modify`,`modify-delete`]),conflict:B7,reason:V7.optional().catch(void 0),conflictKind:R([`git`,`stale-external-write`]).optional(),resolutionOptions:F(Tme)}).loose();I({plan:Do(e=>e!==void 0,{message:`plan is required`})}).loose(),I({plan:Do(e=>e!==void 0,{message:`plan is required`})}).loose(),I({result:Do(e=>e!==void 0,{message:`result is required`})}).loose(),I({packId:M().min(1)}).strict(),I({installedHosts:F(M()),skills:F(I({name:M().min(1),created:P()}).strict())}).strict();var Ome=I({path:M().min(1),summary:M().min(1)}).loose(),kme=I({files:N().int().nonnegative(),folders:N().int().nonnegative()}).loose();I({packs:F(I({id:M().min(1),name:M().min(1),description:M().min(1),defaultSubfolder:M().optional(),folders:F(Ome),entryCounts:kme}).loose())}).loose(),I({noOpen:P().optional(),out:M().min(1).optional()}).loose();var Ame=I({reason:R([`unsupported-platform`,`spawn-error`]),message:M()}).loose();Ja(`status`,[I({status:z(`installed`),outputPath:M(),size:N().int().nonnegative(),sha256:M(),skillVersion:M()}).loose(),I({status:z(`built`),outputPath:M(),size:N().int().nonnegative(),sha256:M(),skillVersion:M(),handoffError:Ame.optional()}).loose(),I({status:z(`failed`),buildError:M()}).loose(),I({status:z(`skip-current`),skillVersion:M(),recordedAt:M().optional()}).loose()]);var H7=R(He),U7=R(Ue);function jme(e){return e===`agents`||Ue.includes(e)}var Mme=I({alwaysOn:N().int().nonnegative(),onTrigger:N().int().nonnegative(),onDemand:N().int().nonnegative()}).strict(),Nme=[`.md`,`.mdx`,`.txt`],Pme=5e3,Fme=4;function W7(e){return Math.round(e/Fme)}function Ime(e){let t=e.lastIndexOf(`.`);return t===-1?!1:Nme.includes(e.slice(t).toLowerCase())}function Lme(e){let t=W7((e.name??``).length+(e.description??``).length),n=W7(Ld(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/`)||Ime(t.relPath)&&(i+=t.content.length));return{alwaysOn:t,onTrigger:n,onDemand:W7(i)}}I({tags:F(I({name:M().min(1),count:N().int().nonnegative(),isLeaf:P()}).loose())}).loose();var Rme=I({docName:M().min(1),title:M(),matchingTags:F(M().min(1)),snippet:M().nullable()}).loose();I({name:M().min(1),docs:F(Rme)}).loose(),I({folder:za(),frontmatter_local:Qa(M(),za()).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(R([`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(),I({path:M(),frontmatter:Qa(M(),za()).optional()}).loose(),I({applied:za()}).loose();var G7=Qa(M(),za()).meta({description:`Free-form frontmatter map embedded in template payloads.`});I({template:I({name:M().min(1),folder:M(),scope:R([`local`,`inherited`]),path:M().min(1),frontmatter:G7,body:M()}).strict()}).strict();var zme=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();I({folder:M(),name:M(),body:M().optional(),frontmatter:G7.optional(),...X2,summary:Z2}).strict(),I({path:M().min(1),created:P(),warnings:F(M())}).strict(),I({sourcePath:M().min(1),targetFolder:M(),name:M().optional(),title:M().optional(),deleteSource:P().optional(),...X2,summary:Z2}).strict(),I({path:M().min(1),created:P(),warnings:F(M())}).strict(),I({existed:P(),path:M().min(1)}).strict(),I({fromFolder:M(),fromName:M(),toFolder:M(),toName:M(),body:M().optional(),frontmatter:G7.optional(),...X2,summary:Z2}).strict(),I({from:M().min(1),to:M().min(1),committed:P()}).strict();var K7=R(ef),Bme=/^[a-z0-9-]+$/,Vme=/^[A-Za-z0-9_-]+$/,q7=I({name:M(),description:M(),metadata:I({pack:M()}).strict().optional()}).strict();I({skill:I({name:M().min(1),scope:K7,path:M().min(1),frontmatter:q7,body:M(),files:F(I({path:M().min(1),text:M().nullable()})).optional(),managed:P().optional()}).strict()}).strict();var Hme=I({source:M().min(1),publisher:M().optional(),skill:M().optional(),marketplaceUrl:M().optional(),importedAt:M().min(1),autoUpdate:P().optional()}).strict(),Ume=I({name:M().min(1),description:M().optional(),scope:K7,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:Qa(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:R([`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:Hme.optional(),pack:M().optional(),modified:P().optional(),revertable:P().optional(),ignored:P().optional(),size:Mme.optional()}).strict();I({name:M().min(1),scope:K7,apply:P().optional()}).strict(),I({line:M().min(1),gitignorePath:M().min(1),applied:P(),alreadyTracked:P().optional()}).strict();var Wme=I({skills:F(Ume),truncated:P()}).strict();I({scope:K7.default(`project`),name:M().meta({description:`Managed skill name to create or update.`}),body:M().optional(),frontmatter:q7,...X2,summary:Z2}).strict();var J7=F(R([`skill-name-vendor-word`,`skill-body-too-long`])).meta({description:"Machine-readable codes aligned 1:1 with `warnings` (`warnings[i]` is the display text for `warningCodes[i]`)."});I({path:M().min(1),created:P(),warnings:F(M()),warningCodes:J7}).strict(),I({scope:K7.default(`project`),name:M(),dryRun:P().optional(),setAutoUpdate:P().optional(),...X2,summary:Z2}).strict(),I({name:M().min(1),updated:P(),source:M().min(1),localBody:M().optional(),upstreamBody:M().optional(),gitTracked:P().optional(),warnings:F(M()),warningCodes:J7}).strict(),I({scope:K7.default(`project`),name:M(),...X2,summary:Z2}).strict(),I({name:M().min(1),baselineRef:M().min(1),restoredFiles:F(M()),warnings:F(M())}).strict();var Y7=`This member also carries the one bookkeeping failure that does not undo the operation: the content change landed, but a state file this server keeps beside it refused to be rewritten because it could not be read, so the install or import records still describe the old state until an operator repairs that file. Absent when there is nothing to report; a server that predates this member omits it, so treat its absence as no warning rather than as an error.`;I({existed:P(),path:M().min(1),warnings:F(M()).optional().meta({description:`Present when this delete removed a directory a retention record ties to a recovery copy an earlier failed move kept, whose source was never verified unchanged — either because this server verified the deleted directory against the copy that record describes, or because it could not read the directory and so could not confirm either way. Each entry says which of the two it is; neither claims more than the check established. ${Y7}`})}).strict(),I({scope:K7.default(`project`),fromName:M(),toName:M(),body:M().optional(),frontmatter:q7.optional(),...X2,summary:Z2}).strict(),I({from:M().min(1),to:M().min(1),committed:P(),warnings:F(M()).optional().meta({description:`Present when the rename itself completed but something beside it did not. ${Y7}`})}).strict(),I({name:M(),toName:M().optional().meta({description:"Name for the skill at the destination scope; defaults to `name`. The SKILL.md `name` frontmatter is rewritten to match."}),fromScope:K7,toScope:K7,...X2,summary:Z2}).strict();var Gme=[`nothing-written`,`destination-removed`,`destination-stray`,`destination-retained`,`destination-retained-blocking`,`destination-unreadable`,`partially-applied`];function Kme(e){return typeof e==`string`&&Gme.includes(e)}var qme=[`intact`,`lossy`,`unknown`];function Jme(e){return typeof e==`string`&&qme.includes(e)}var Yme=[`unreadable`,`occupant-unverifiable`];function Xme(e){return typeof e==`string`&&Yme.includes(e)}var Zme={"nothing-written":!1,"destination-removed":!1,"destination-stray":!1,"destination-retained":!0,"destination-retained-blocking":!0,"destination-unreadable":!1,"partially-applied":!1};function X7(e){return Zme[e]}function Qme(e){let t=typeof e==`object`&&e?e:{},n=t.moveState,r=t.sourceState,i=t.retentionLedger;if(n===void 0&&r===void 0&&i===void 0)return{kind:`coherent`};let a=Kme(n)?n:void 0,o=Jme(r)?r:void 0,s=Xme(i)?i:void 0,c={...a===void 0?{}:{moveState:a},...o===void 0?{}:{sourceState:o},...s===void 0?{}:{retentionLedger:s}};return n!==void 0&&a===void 0||r!==void 0&&o===void 0||i!==void 0&&s===void 0||a===void 0?{kind:`unverified`,...c}:(X7(a)?o!==void 0&&s===void 0:a===`nothing-written`?o===void 0:o===void 0&&s===void 0)?{kind:`coherent`,...c}:{kind:`unverified`,...c}}var $me=`The server reported warnings in a shape this build does not recognise; treat this result as unverified.`;function ehe(e){if(e===void 0)return[];let t=$me;if(!Array.isArray(e))return[t];let n=e.filter(e=>typeof e==`string`);return n.length===e.length?n:[...n,t]}I({scope:K7,path:M().optional(),droppedLocations:F(M()).default([]).meta({description:"Locations the skill occupied at the source that were removed and not re-created at the destination: the `agents` hub and custom roots, which projection does not cover. Entries are install location ids, so they can be passed straight back as an install `add` list with `scope` set to the destination scope; custom roots resolve against that scope's base."}),warnings:F(M()).optional().meta({description:`Present when the move itself completed but something beside it did not. ${Y7}`})}).strict().meta({description:"Scope-move result. Rename paths deliberately do not emit authoring warnings, consistent with same-scope rename and duplicate. Content-authoring and import responses carry those warnings and their codes. The Skills Studio client parses `droppedLocations` off the wire but deliberately does not render it yet; how a human is told what was removed is an open product decision."}),I({scope:K7,name:M(),toName:M(),...X2,summary:Z2}).strict(),I({name:M().min(1)}).strict(),I({name:M(),home:M().min(1)}).strict(),I({docName:M().min(1)}).strict();var Z7=R([`reference`,`script`,`file`]);I({scope:K7.default(`project`),name:M(),path:M().min(1),content:M(),...X2,summary:Z2}).strict(),I({path:M().min(1),created:P(),kind:Z7,content:P()}).strict(),I({scope:K7.default(`project`),name:M(),from:M().min(1),to:M().min(1),...X2,summary:Z2}).strict(),I({from:M().min(1),to:M().min(1),fromDocName:M().optional(),toDocName:M().optional()}).strict(),I({path:M().min(1),kind:Z7,text:M()}).strict(),I({path:M().min(1),existed:P(),kind:Z7}).strict();var Q7=Ka([U7,z(`agents`)]),$7=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`}),e9=Ka([Q7,$7]);I({scope:K7.default(`project`),name:M(),targets:F(Q7).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(e9).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(e9).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:R([`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:e9.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:R([`copy`,`link`])}).strict().optional(),convert:I({target:e9.meta({description:`The installed location to convert — an editor id, "agents", or a recorded custom placement path.`}),mode:R([`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(),...X2,summary:Z2,fork:I({editor:M().min(1),action:R([`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"}),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(R([`no-targets`,`scripts-present`,`name-conflict`,`no-description`,`skill-fork-name-unpatched`,`place-path-invalid`,`place-fork-refused`])).meta({description:"Machine-readable warning codes aligned with `warnings`."}),placedAt:M().optional(),sourceMovedTo:M().optional()}).strict(),I({scope:K7.default(`project`),name:M().meta({description:`Managed skill name to uninstall without deleting source.`})}).strict(),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();var the=I({targets:F(H7),configured:P(),folders:F(I({scope:K7,host:M(),root:M(),state:R([`own`,`linked`,`linked-parent`,`absent`]),target:M().optional(),drift:z(!0).optional(),expected:M().optional()}).strict()).optional()}).strict(),t9=I({action:z(`link`),scope:K7,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.`})}),n9=I({action:z(`unlink`),scope:K7,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(),r9=I({action:z(`add-root`),scope:K7,root:$7.meta({description:`New custom skills root to declare (base-relative, e.g. ".team/skills").`})}).strict(),nhe=Ja(`action`,[t9.extend({preview:P().optional().meta({description:`Return the merge plan only (moves, drops, removes, conflicts, strays) — nothing is written.`})}).strict(),n9,r9]);Ja(`action`,[t9.strict(),n9,r9]),I({folderAction:nhe}).strict();var i9=I({moves:F(M()),drops:F(M()),removes:F(M()),replaces:F(M()),conflicts:F(M()),strays:F(M())}).strict();I({targets:F(H7),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:i9.optional()}).strict(),I({scope:K7.default(`project`),name:M(),version:M().regex(/^[0-9a-f]{40}$/i),...X2,summary:Z2}).strict(),I({name:M().min(1),version:M(),restoredFiles:F(M()),warnings:F(M())}).strict(),I({query:M().optional(),intent:R([`autocomplete`,`full_text`,`omnibar`]).optional(),ranking:R([`navigation`,`relevance`]).optional(),scopes:F(R([`page`,`folder`,`content`,`file`])).optional(),scope:M().optional(),limit:N().int().nonnegative().optional(),semantic:P().optional(),source:R([`omnibar`,`mcp`,`http`]).optional()}).loose();var rhe=I({kind:R([`page`,`folder`,`content`,`file`]),path:M().min(1),title:M(),score:N(),signals:Qa(M(),za()),snippet:M().optional()}).loose(),ihe=R([`applied`,`no_match`,`warming`,`incapable`,`provider_error`,`restart_required`,`query_too_short`]),a9=R([`warm`,`corpus`,`query`,`dimensions`,`configured_dimensions`]);function ahe(e){return e?.providerErrorReason===`dimensions`?`restart_required`:e?.providerErrorReason===`configured_dimensions`?`incapable`:e?.providerError||e?.providerErrorReason?`provider_error`:null}function ohe(e){throw Error(`Unhandled SemanticProviderErrorReason variant: ${JSON.stringify(e)}`)}function she(e,t){let n=e?.providerErrorReason;switch(n){case null:case void 0:return e?.providerError===!0;case`corpus`:return!1;case`query`:return t===`query`;case`warm`:case`dimensions`:case`configured_dimensions`:return!0;default:return ohe(n)}}function che(e){throw Error(`Unhandled SemanticQueryOutcome variant: ${JSON.stringify(e)}`)}var o9=I({capable:P(),applied:P(),outcome:ihe,providerErrorReason:a9.nullable().optional().catch(null),coverage:I({embedded:N().int().nonnegative(),total:N().int().nonnegative()})}).loose(),lhe=I({enabled:P(),keyPresent:P(),keyNotRequired:P(),keySource:R([`project`,`file`,`env`]).nullable(),keyHint:M().nullable(),ready:P(),capable:P(),providerError:P().optional(),providerErrorReason:a9.nullable().optional().catch(null),embedded:N().int().nonnegative(),total:N().int().nonnegative()}).loose();function uhe(e){return!!(e?.enabled&&(e.keyPresent||e.keyNotRequired))}I({query:M(),intent:R([`autocomplete`,`full_text`,`omnibar`]),results:F(rhe),elapsedMs:N().nonnegative(),semantic:o9.optional(),truncated:P().optional(),ready:P().optional()}).loose();var dhe=I({version:M().min(1),recordedAt:M().min(1)}).loose();I({currentVersion:M().min(1),targets:Qa(M(),dhe.nullable())}).loose(),I({scope:K7.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."}),...X2,summary:Z2}).strict(),I({scope:K7.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."}),...X2,summary:Z2}).strict(),I({results:F(I({requested:M(),status:R([`imported`,`already-imported`,`not-found`,`failed`]),name:M().optional(),collisionRenamedFrom:M().optional(),warnings:F(M()),warningCodes:J7,error:M().optional()}).loose()),imported:N(),alreadyImported:N(),failed:N()}).loose(),I({scope:K7.default(`project`),names:F(M().min(1)).min(1).max(100).meta({description:`Managed skill names to refresh from their recorded upstreams.`}),...X2,summary:Z2}).strict(),I({results:F(I({requested:M(),status:R([`updated`,`up-to-date`,`not-found`,`failed`]),source:M().optional(),warnings:F(M()),warningCodes:J7,error:M().optional()}).loose()),updated:N(),upToDate:N(),failed:N()}).loose();var fhe=I({source:M(),ref:M().optional(),contentHash:M(),publisher:M().optional()}).loose();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:fhe,warnings:F(M()).meta({description:`Non-fatal import warnings, such as skipped unsupported files.`}),warningCodes:J7}).loose();var phe=`server-info`,mhe=`branch-switched`,hhe=`disk-ack`,ghe=`config-validation-rejected`,_he=`config-ignore-nested-error`,s9=R([`files`,`backlinks`,`graph`,`sync-status`,`session-activity`,`tags`,`comments`,`lint-config`,`local-targets`]),vhe=I({v:z(1),ch:z(phe),seq:N(),serverInstanceId:M().min(1),currentBranch:M().min(1).optional()}).loose(),yhe=I({v:z(1),ch:z(mhe),seq:N(),branch:M().min(1)}).loose(),bhe=I({v:z(1),ch:s9,seq:N()}).loose(),xhe=I({v:z(1),ch:z(hhe),seq:N(),docName:M().min(1),sv:M().min(1)}).loose(),She=I({v:z(1),ch:z(ghe),seq:N(),docName:M().min(1),error:Gne}).loose(),Che=I({v:z(1),ch:z(_he),seq:N(),path:M().min(1),error:M().min(1)}).loose(),whe=100,The=500,Ehe=450,Dhe={id:`string`,kind:`enum`,path:`string`,title:`string`,name:`string`,pathSegments:`string`,content:`string`,modifiedTs:`number`},c9=new WeakMap;function Ohe(e){return e===void 0||!Number.isFinite(e)?20:Math.max(1,Math.min(100,Math.trunc(e)))}function l9(e){return e.trim().toLowerCase()}var khe=/\.(?:md|mdx)$/;function Ahe(e,t){if(t!==`page`)return e;let n=e.replace(khe,``);return n.length>0?n:e}function u9(e){let t=e.split(`/`).filter(Boolean);return t[t.length-1]??e}function jhe(e){let t=u9(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}}var d9=/[^\P{L}a-zàèéìòóù]|[^\P{Nd}0-9]|\p{Nl}/iu,f9=(()=>{let e=globalThis.Intl.Segmenter;return e?new e(`en`,{granularity:`word`}):null})();function Mhe(){let e=iJ({language:`english`}),t=e.tokenize.bind(e);return e.tokenize=(e,n,r,i)=>{let a=t(e,n,r,i);if(!f9||typeof e!=`string`||!d9.test(e))return a;let o=new Set(a);for(let{segment:t,isWordLike:n}of f9.segment(e)){if(!n||!d9.test(t))continue;let e=t.toLowerCase();o.has(e)||(o.add(e),a.push(e))}return a},e}function p9(e){let t=vJ({schema:Dhe,components:{tokenizer:Mhe()}});return e.length>0&&kJ(t,e),t}function Nhe(e){let t={documents:e};return c9.set(t,p9(e)),t}function Phe(e){let t=c9.get(e);if(t)return t;let n=p9(e.documents);return c9.set(e,n),n}function Fhe(e){return e===`autocomplete`?[`page`]:e===`full_text`?[`page`,`content`,`file`]:[`page`,`folder`,`file`]}function m9(e,t){return t.has(e.kind)?!0:e.kind===`page`&&t.has(`content`)}function Ihe(e,t){let n=l9(t);if(!n)return 0;let r=Ahe(n,e.kind),i=l9(e.title),a=l9(e.name),o=l9(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}var Lhe=.5;function h9(e,t){let n=Ihe(e,t);return n<=0?n:K2(e.path)?n*Lhe:n}function Rhe(e){return e===`file`?-60:0}var zhe=1e3,Bhe=50,Vhe=1,Hhe=1;function Uhe(e,t,n,r,i){let a=i>0?t/i:0,o=n/Bhe,s=r===`file`?-.001:0,c=Vhe*a+Hhe*o+s;return e*zhe+c}function g9(e,t,n,r){return e+t*20+n+Rhe(r)}function _9(e,t,n,r,i,a){return e===`relevance`?g9(t,n,r,i):Uhe(t,n,r,i,a)}function Whe(e,t){return t||(e===`full_text`?`relevance`:`navigation`)}function v9(e,t){let n=0;for(let r of e){let e=t.get(r.id)??0;e>n&&(n=e)}return n}function Ghe(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 Khe(e){return e===`full_text`?[`title`,`name`,`path`,`pathSegments`,`content`]:[`title`,`name`,`path`,`pathSegments`]}function qhe(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}}var Jhe=/[฀-๿ក-៿ -〿぀-ゟ゠-ヿ㐀-䶿一-鿿\uf900-﫿＀-￯\u1100-\u11ff\u3130-\u318f\ua960-\ua97f\uac00-\ud7ff]/;function Yhe(e,t){let n=l9(t);return n.length<4||Jhe.test(n)?0:+(e===`full_text`)}function Xhe(e){let{lexical:t,fullText:n}=e.signals;return t>=The?`lexical`:t===Ehe&&n<=0?`pathOnly`:`body`}function Zhe(e){let t=[],n=[],r=[];for(let i of e){let e=Xhe(i);e===`lexical`?t.length<whe&&t.push(i):e===`body`?n.length<6&&n.push(i):r.length<4&&r.push(i)}return[...t,...n,...r]}function y9(e,t,n){if(t===`relevance`)return e.slice(0,n);let r=Zhe(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 Qhe(e,t,n={}){let r=n.intent??`omnibar`,i=Whe(r,n.ranking),a=Ohe(n.limit),o=new Set(n.scopes??Fhe(r)),s=e.documents.filter(e=>m9(e,o)),c=l9(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=aY(Phe(e),{term:c,properties:Khe(r),boost:qhe(r),tolerance:Yhe(r,c),limit:Math.max(a*4,40)}),u=new Map(l.hits.filter(e=>m9(e.document,o)).map(e=>[e.document.id,e.score])),d=Ghe(s),f=new Map;for(let e of s)h9(e,c)>=0&&f.set(e.id,e);for(let e of l.hits)m9(e.document,o)&&f.set(e.document.id,e.document);if(!n.semantic){let e=v9(f.values(),u);return y9([...f.values()].map(t=>{let n=Math.max(0,h9(t,c)),r=u.get(t.id)??0,a=d.get(t.id)??0;return{document:t,score:_9(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 y9($he({scopedDocuments:s,candidates:f,fullTextScores:u,recency:d,normalizedQuery:c,ranking:i,semantic:n.semantic}),i,a)}function b9(e){let t=new Map;return e.forEach((e,n)=>{t.set(e,n+1)}),t}function $he(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=v9(n.values(),r),h=[...n.values()].map(e=>{let t=Math.max(0,h9(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?_9(o,t,n,s,e.kind,m):g9(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=b9(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)),_=b9(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 ege(e){return e.created.length>0||e.packSkills?.some(e=>e.pending)===!0||e.requiredPlugins?.some(e=>e.pending)===!0}function tge(e){return`https://${e.host}/${e.owner}/${e.repo}.git`}function nge(e,t){return!e||e.length===0?`true`:t.detached?`detached`:t.currentBranch===null||t.currentBranch===e?`true`:`false`}var x9=Symbol.for(`@inkeep/open-knowledge/skill-state-field-registry`),S9=globalThis;S9[x9]===void 0&&(S9[x9]=pr());var C9=S9[x9],w9=L({version:M().regex(/^\d+\.\d+\.\d+(?:[-+][\w.-]+)?$/,`version must match /^\\d+\\.\\d+\\.\\d+(?:[-+][\\w.-]+)?$/`).register(C9,{description:`Recorded skill version for this target.`}),recordedAt:zi().register(C9,{description:`ISO 8601 timestamp of the most recent successful write. Updated on every write, including reinstalls of the same version.`}),surface:R([`server-build-and-open`,`electron-build-and-open`,`cli-npx-skills-add`,`desktop-direct`,`cli-start`]).register(C9,{description:`Install-source surface that recorded this entry.`}).optional()}),rge=L({enabled:P().register(C9,{description:`Whether this user-global skill bundle is opted in.`}),decidedAt:zi().register(C9,{description:`ISO 8601 timestamp of the opt-in / opt-out decision.`})});L({schema:z(1).register(C9,{description:`Schema major version. Bumped only on breaking shape changes.`}),targets:L({"claude-cowork":w9.optional(),"cli-hosts":w9.optional()}).register(C9,{description:`Per-target install-state entries. Absent target = no recorded install.`}).default({}),bundles:Qa(M(),rge).register(C9,{description:`Per-bundle opt-in decisions keyed by install name. Absent key = no recorded decision.`}).optional(),installsReported:F(M()).register(C9,{description:"Skill installs already reported to skills.sh from this machine, as `<owner/repo>#<skill>`. Append-only; presence suppresses a re-report."}).optional()});var T9=`bottom`,E9=e=>e*8+4,D9=E9(92),O9=E9(40);function ige(e){return e===`right`||e===`bottom`?e:T9}function age(e){return typeof e!=`number`||!Number.isFinite(e)?D9:Math.max(O9,Math.round(e))}var oge=new Set([`(connected)`,`(agent thread)`]);function sge(e){return e!=null&&oge.has(e)}var cge=6e5,k9=class extends Error{chunksCompleted;totalChunks;bytesWritten;bytesRemaining;cause;constructor(e,t){let n=e instanceof Error?e.message:typeof e==`string`?e:`unknown error`;super(`chunked insert failed after ${t.chunksCompleted}/${t.totalChunks} chunks (${t.bytesWritten} bytes written, ${t.bytesRemaining} bytes lost): ${n}`),this.name=`ChunkedInsertError`,this.chunksCompleted=t.chunksCompleted,this.totalChunks=t.totalChunks,this.bytesWritten=t.bytesWritten,this.bytesRemaining=t.bytesRemaining,this.cause=e}};async function lge(e,t,n,r,i={}){let a=i.thresholdBytes??512e3,o=i.chunkSizeBytes??51200,s=i.origin,c=i.yieldFn??uge,l=i.resolveOffset??(e=>e);if(r.length<=a){e.transact(()=>{t.insert(n,r)},s);return}let u=Math.ceil(r.length/o),d=0,f=n,p=0,m=0;for(;d<r.length;){let n=Math.min(d+o,r.length),i=r.slice(d,n);try{let n=l(f);e.transact(()=>{t.insert(n,i)},s)}catch(e){throw new k9(e,{chunksCompleted:p,totalChunks:u,bytesWritten:m,bytesRemaining:r.length-d})}p++,m+=i.length,f+=i.length,d=n,d<r.length&&await c()}}function uge(){return new Promise(e=>{let t=globalThis;t.document?.hidden!==!0&&typeof t.requestAnimationFrame==`function`?t.requestAnimationFrame(()=>e()):setTimeout(()=>e(),0)})}function dge(e){let t;try{t=new URL(e)}catch{return null}let n=t.pathname.match(/^\/video\/(\d+)/);if(n)return n[1]??null;let r=t.pathname.match(/^\/(\d+)/);return r?r[1]??null:null}function fge(e){if(typeof e!=`string`||e.length===0)return e;let t=w3(e);if(t){let e=t.noCookie?`www.youtube-nocookie.com`:`www.youtube.com`,n=t.startSeconds===null?``:`?start=${t.startSeconds}`;return`https://${e}/embed/${t.id}${n}`}if(S3(e)){let t=dge(e);return t?`https://player.vimeo.com/video/${t}`:e}let n=b3(e);if(n){let e=n.startRaw===null?``:`?t=${n.startRaw}`;return`https://www.loom.com/embed/${n.id}${e}`}return e}var pge=`https://api.github.com/repos/inkeep/open-knowledge`;async function mge(e){let{signal:t,...n}=e??{},r=t?AbortSignal.any([AbortSignal.timeout(5e3),t]):AbortSignal.timeout(5e3);try{let e=await fetch(pge,{headers:{accept:`application/vnd.github+json`,"user-agent":`openknowledge.ai`},...n,signal:r});if(!e.ok)return console.warn(`[github-stars] GitHub API responded ${e.status}`),null;let t=await e.json();return typeof t.stargazers_count==`number`?t.stargazers_count:null}catch(e){return console.warn(`[github-stars] fetch failed: ${e instanceof Error?e.message:String(e)}`),null}}var hge=/^(#{1,6})\s+(.+)$/;function gge(e,t){let n=(e.endsWith(`\r`)?e.slice(0,-1):e).match(hge);if(!n)return null;let r=n[2].trim(),i=_7(r,t);return i?{level:n[1].length,text:r,slug:i}:null}var _ge=Array.from({length:256},(e,t)=>(t+256).toString(16).slice(1));function A9(){let e=globalThis.crypto;if(e&&typeof e.randomUUID==`function`)return e.randomUUID();let t=new Uint8Array(16);if(e&&typeof e.getRandomValues==`function`)e.getRandomValues(t);else for(let e=0;e<16;e++)t[e]=Math.floor(Math.random()*256);t[6]=t[6]&15|64,t[8]=t[8]&63|128;let n=_ge;return`${n[t[0]]}${n[t[1]]}${n[t[2]]}${n[t[3]]}-${n[t[4]]}${n[t[5]]}-${n[t[6]]}${n[t[7]]}-${n[t[8]]}${n[t[9]]}-${n[t[10]]}${n[t[11]]}${n[t[12]]}${n[t[13]]}${n[t[14]]}${n[t[15]]}`}var vge={fileSystem:`File System`,gitUpstream:`Git (upstream)`,service:`OpenKnowledge (service)`,generator:`OpenKnowledge (generated)`},yge=[`#D97757`,`#1B1912`,`#F9F3E9`,`#7A9DFF`,`#8534F3`,`#9663F0`,`#727CF3`],bge={claude:`#D97757`,cursor:`#1B1912`,windsurf:`#0B100F`,openai:`#7A9DFF`,github:`#8534F3`,cline:`#9663F0`,bot:`#727CF3`},xge={cursor:`#FFFFFF`,windsurf:`#FFFFFF`},j9=[`#f0ece3`,`#fff5e1`,`#f9e1db`,`#f5def7`,`#ece2fb`,`#dce8fa`,`#DBF3FB`];function Sge(e,t=yge){let n=0;for(let t of e)n=(n<<5)-n+t.charCodeAt(0)|0;return t[Math.abs(n)%t.length]}function Cge(e){let t=e.trim();if(!t)return`?`;let n=t.split(/[-\s]+/).filter(Boolean);if(!n.length)return`?`;if(n.length>=2)return n.slice(0,2).map(e=>e[0]??``).join(``).toUpperCase();let r=n[0],i=[r[0]];for(let e=1;e<r.length&&i.length<2;e++){let t=r[e-1],n=r[e];t===t.toLowerCase()&&n===n.toUpperCase()&&n!==n.toLowerCase()&&i.push(n)}return i.length>=2?i.join(``).toUpperCase():r.slice(0,2).toUpperCase()}function wge(e){let t=e.trim();if(!t)return e;if(t.includes(` `)||!/[-_]/.test(t))return t;let n=t.split(/[-_]+/).filter(Boolean);return n.length?n.map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(` `):t}var Tge={"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 Ege(e){return e?Tge[e]||(e.startsWith(`local-agent-mode-`)?`claude`:`bot`):`bot`}function Dge(e){let t=parseInt(e.slice(1,3),16)/255,n=parseInt(e.slice(3,5),16)/255,r=parseInt(e.slice(5,7),16)/255,i=Math.max(t,n,r),a=Math.min(t,n,r),o=(i+a)/2;if(i===a)return[0,0,o*100];let s=i-a,c=o>.5?s/(2-i-a):s/(i+a),l;return l=i===t?((n-r)/s+(n<r?6:0))/6:i===n?((r-t)/s+2)/6:((t-n)/s+4)/6,[l*360,c*100,o*100]}function Oge(e,t,n){let r=t/100,i=n/100,a=r*Math.min(i,1-i),o=t=>{let n=(t+e/30)%12,r=i-a*Math.max(Math.min(n-3,9-n,1),-1);return Math.round(255*r).toString(16).padStart(2,`0`)};return`#${o(0)}${o(8)}${o(4)}`}function kge(e){let[t]=Dge(e);return Oge(t,45,32)}var Age=[`Curious`,`Brave`,`Clever`,`Swift`,`Gentle`,`Bright`,`Wise`,`Bold`,`Calm`,`Keen`],jge=[`Bird`,`Cat`,`Dog`,`Fish`,`Mouse`,`Rabbit`,`Shrimp`,`Snail`,`Squirrel`,`Turtle`],M9=`ok-user-name-v3`,N9=`ok-user-color-v3`;function P9(e){return e[Math.floor(Math.random()*e.length)]}function Mge(){return`${P9(Age)} ${P9(jge)}`}function Nge(){return P9(j9)}function F9(e){try{return localStorage.getItem(e)}catch{return null}}function I9(e,t){try{localStorage.setItem(e,t)}catch{}}function Pge(){let e=new URLSearchParams(window.location.search).get(`coeditor`)||`standalone`,t=A9(),n=F9(M9),r=F9(N9);return n||(n=Mge(),I9(M9,n)),r||(r=Nge(),I9(N9,r)),{name:n,color:r,coeditor:e,tabId:t}}function L9(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 Fge(e){return e===`.`||e===`..`?e:encodeURIComponent(e).replace(/[!'()*]/g,e=>`%${e.codePointAt(0)?.toString(16).toUpperCase()}`)}function Ige(e){return e.split(`/`).map(Fge).join(`/`)}function R9(e){return e.split(`/`).map(L9).join(`/`)}function Lge(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=L9(o.split(`/`).pop()??``).match(/\.([a-z0-9]+)$/i);if(s){let e=`.${(s[1]??``).toLowerCase()}`;if(!P$.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=L9(d[e]??``);if(e===f&&(t=sf(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 Rge(e){throw Error(`Unhandled ClassifiedLinkTarget variant: ${JSON.stringify(e)}`)}var z9=/^[a-zA-Z][a-zA-Z\d+\-.]*:/;function B9(e){let t=(e.split(/[?#]/)[0]??e).match(/\.([a-z0-9]+)$/i);return t?(t[1]??``).toLowerCase():null}function V9(e){return e.split(`/`).filter(Boolean)}function H9(e){let t=e.trim();return z9.test(t)||t.startsWith(`//`)}function zge(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(H9(n))return{kind:`external`,url:n};let r=n.indexOf(`#`),i=R9(r<0?n:n.slice(0,r)),a=ff(i,t);if(a)return{kind:`doc`,docName:a,anchor:r<0?null:n.slice(r+1)};let o=df(i,t);if(o)return{kind:`doc`,docName:o,anchor:r<0?null:n.slice(r+1)};let s=Lge(n,t);if(s)return{kind:`doc`,docName:s.docName,anchor:s.anchor};let c=B9(i);return c&&c!==`md`&&c!==`mdx`?{kind:`asset`,url:n,ext:c,literal:!1}:null}function Bge(e,t){let n=e.trim();if(!n)return null;if(H9(n))return{kind:`external`,url:t?`${n}#${t}`:n};let r=B9(n);return r&&r!==`md`&&r!==`mdx`?{kind:`asset`,url:n,ext:r,literal:!0}:{kind:`doc`,docName:n,anchor:t?.trim()||null}}function Vge(e,t,n){let r=e.trim();if(!r||z9.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:L9(e));return c.length===0?null:c.join(`/`)}function Hge(e,t,n=null,r=`.md`){let i=V9(e);i.pop();let a=V9(t),o=0;for(;o<i.length&&o<a.length&&i[o]===a[o];)o+=1;let s=i.slice(o).map(()=>`..`),c=a.slice(o),l=[...s,...c].join(`/`);return l||=a.at(-1)??t,!l.startsWith(`./`)&&!l.startsWith(`../`)&&(l=`./${l}`),`${Ige(l)}${r}${n?`#${n}`:``}`}function Uge(e){if(!e)return{height:null,viewerFragment:``};let t=e.split(`&`).filter(e=>e.length>0),n=null,r=[];for(let e of t){let t=e.indexOf(`=`);if(t===-1){r.push(e);continue}let i=e.slice(0,t),a=e.slice(t+1);if(i===`height`){let e=Number.parseInt(a,10);!Number.isNaN(e)&&e>0&&(n=e);continue}r.push(e)}return{height:n,viewerFragment:r.join(`&`)}}var Wge=`unknown`;function Gge(e,t=Date.now()){let n=Date.parse(e);if(!Number.isFinite(n))return Wge;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 Kge(e){return e.replace(/[/\\:*?"<>|\0]/g,`-`).replace(/\s+/g,` `).replace(/-+/g,`-`).trim().replace(/^[-.\s]+|[-.\s]+$/g,``)}function U9(e){return`pagesBySlug`in e}function W9(e){return U9(e)?e.pages:e}function G9(e,t){return U9(e)?e.assetPaths??new Set:t??new Set}function K9(e,t){return U9(e)?e.filePaths??new Set:t??new Set}function q9(e,t){return e<t?-1:+(e>t)}function qge(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 Jge(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 J9(e,t){let n=g7(e);if(n){if(U9(t))return t.pagesBySlug.get(n);for(let e of t)if(g7(e)===n)return e}}function Y9(e,t){if(e.includes(`/`))return;let n=g7(e);if(!n)return;if(U9(t))return t.pagesByBasename?.get(n);let r;for(let e of t){let t=e.lastIndexOf(`/`);g7(t===-1?e:e.slice(t+1))===n&&(r===void 0||q9(e,r)<0)&&(r=e)}return r}function X9(e){let t=e.trim();if(!t)return[];let n=g7(t);return n.length>0&&n!==t?[n]:[]}function Z9(e,t){let n=e.trim();if(!n)return;let r=W9(t);if(r.has(n))return n;let i=J9(n,t);if(i)return i;for(let e of X9(n))if(r.has(e))return e;return Q9(n,r)||Y9(n,t)}function Q9(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 Yge(e){let t=((e.trim().split(`#`)[0]??``).trim().split(`?`)[0]??``).trim();return t.startsWith(`/`)?t.slice(1):t}function $9(e,t,n){let r=Yge(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 Xge(e,t,n,r){let i=e.trim();if(!i)return!1;if($9(i,G9(t,n),K9(t,r)))return!0;let a=W9(t);return a.has(i)||X9(i).some(e=>a.has(e))||J9(i,t)!==void 0||Q9(i,a)?!0:Y9(i,t)!==void 0}function Zge(e,t,n){let r=Bge(e,t);return r===null||r.kind!==`asset`||$9(r.url,G9(n),K9(n))!==null||Z9(e,n)===void 0?r:{kind:`doc`,docName:e.trim(),anchor:t?.trim()||null}}export{z4 as $,fw as $a,Z9 as $i,V2 as $n,Op as $o,dse as $r,of as $s,H7 as $t,I$ as A,zk as Aa,Mo as Ac,n1 as Ai,V0 as An,Xp as Ao,ade as Ar,Jf as As,I4 as At,A0 as B,tD as Ba,lee as Bc,B4 as Bi,zge as Bn,tm as Bo,Moe as Br,Df as Bs,hme as Bt,X$ as C,pj as Ca,ane as Cc,Bfe as Ci,Ade as Cn,dg as Co,E0 as Cr,sp as Cs,sme as Ct,nme as D,KA as Da,Ts as Dc,spe as Di,XX as Dn,hp as Do,n$ as Dr,Ene as Ds,v4 as Dt,rme as E,lj as Ea,Ate as Ec,upe as Ei,g$ as En,G as Eo,tX as Er,rp as Es,g4 as Et,Epe as F,yE as Fa,P as Fc,g8 as Fi,Hge as Fn,zm as Fo,_7 as Fr,Yd as Fs,g1 as Ft,Hpe as G,fT as Ga,nee as Gc,b4 as Gi,Sge as Gn,Gm as Go,ose as Gr,rf as Gs,o9 as Gt,Efe as H,HE as Ha,Ft as Hc,w3 as Hi,fQ as Hn,pp as Ho,gse as Hr,kf as Hs,gme as Ht,Tpe as I,nE as Ia,fa as Ic,ige as Ii,tge as In,Hm as Io,Pge as Ir,Jd as Is,Bme as It,d1 as J,iT as Ja,Ke as Jc,vY as Ji,k5 as Jn,Jp as Jo,mse as Jr,kd as Js,t4 as Jt,Tle as K,pT as Ka,tee as Kc,_X as Ki,bQ as Kn,Wm as Ko,sse as Kr,nf as Ks,lhe as Kt,ime as L,ET as La,z as Lc,age as Li,lge as Ln,Vm as Lo,X9 as Lr,Id as Ls,vge as Lt,xpe as M,Dk as Ma,R as Mc,xZ as Mi,U0 as Mn,im as Mo,wge as Mr,Zd as Ms,V1 as Mt,s9 as N,hie as Na,Ao as Nc,y5 as Ni,Jge as Nn,Jm as No,Gge as Nr,Xd as Ns,lme as Nt,ufe as O,Fk as Oa,Gte as Oc,Noe as Oi,S$ as On,wp as Oo,i1 as Or,wne as Os,bpe as Ot,P7 as P,PE as Pa,F as Pc,S0 as Pi,qge as Pn,Dp as Po,mge as Pr,qd as Ps,m1 as Pt,Q5 as Q,UE as Qa,qe as Qc,Zge as Qi,$0 as Qn,bp as Qo,ase as Qr,jf as Qs,i9 as Qt,O$ as R,rD as Ra,I as Rc,b3 as Ri,sQ as Rn,Bm as Ro,w0 as Rr,ef as Rs,vme as Rt,k9 as S,u9 as Sa,rne as Sc,S3 as Si,jde as Sn,s_ as So,k$ as Sr,Dne as Ss,K$ as St,Cpe as T,uj as Ta,Mte as Tc,oQ as Ti,RY as Tn,Rh as To,F0 as Tr,Zm as Ts,Spe as Tt,j9 as U,Fw as Ua,Ye as Uc,ege as Ui,pQ as Un,Cp as Uo,cse as Ur,Kd as Us,_me as Ut,Mpe as V,Nw as Va,uee as Vc,C0 as Vi,ahe as Vn,Mne as Vo,Ege as Vr,Sd as Vs,R7 as Vt,h3 as W,Iw as Wa,Xe as Wc,A9 as Wi,r1 as Wn,yp as Wo,_se as Wr,Vf as Ws,yme as Wt,p1 as X,sT as Xa,Ve as Xc,w4 as Xi,r2 as Xn,ap as Xo,pse as Xr,Nd as Xs,a4 as Xt,f1 as Y,oT as Ya,Be as Yc,Vge as Yi,O2 as Yn,qp as Yo,use as Yr,af as Ys,o4 as Yt,F$ as Z,DT as Za,We as Zc,$9 as Zi,n2 as Zn,Om as Zo,lse as Zr,tf as Zs,l4 as Zt,M$ as _,g7 as _a,tne as _c,_1 as _i,O0 as _n,Tg as _o,B$ as _r,np as _s,W$ as _t,hpe as a,Qhe as aa,wf as ac,L$ as ai,Vme as an,hC as ao,$ae as ar,Nm as as,Kpe as at,hQ as b,v7 as ba,Ho as bc,X7 as bi,z2 as bn,Pg as bo,Lme as br,Sne as bs,D9 as bt,D4 as c,ffe as ca,_f as cc,K2 as ci,zme as cn,nC as co,l$ as cr,mp as cs,k4 as ct,yhe as d,aQ as da,sf as dc,H5 as di,J$ as dn,q_ as do,C8 as dr,lh as ds,B1 as dt,u$ as ea,gf as ec,fse as ei,the as en,UC as eo,t2 as er,mm as es,C1 as et,Che as f,z0 as fa,Cf as fc,H$ as fi,cge as fn,X_ as fo,H3 as fr,Gp as fs,kde as ft,vhe as g,xfe as ga,ws as gc,Xge as gi,T0 as gn,Ag as go,kge as gr,Cm as gs,Pme as gt,xhe as h,u1 as ha,Qte as hc,v1 as hi,Ofe as hn,q as ho,R9 as hr,Kp as hs,Z0 as ht,Zpe as i,F4 as ia,Wf as ic,M4 as ii,Eme as in,LE as io,Q0 as ir,bne as is,jfe as it,ume as j,Bk as ja,Uo as jc,ehe as ji,OY as jn,rm as jo,b5 as jr,Ef as js,Ife as jt,T9 as k,wk as ka,Fo as kc,C$ as ki,B0 as kn,Sp as ko,Ffe as kr,Kf as ks,L4 as kt,kpe as l,she as la,Gf as lc,x3 as li,dme as ln,N_ as lo,c$ as lr,Wp as ls,O9 as lt,bhe as m,nQ as ma,Zte as mc,G2 as mi,kfe as mn,O_ as mo,jhe as mr,ep as ms,X0 as mt,xge as n,Kge as na,xf as nc,mY as ni,Wme as nn,kT as no,E2 as nr,Pne as ns,Bpe as nt,A4 as o,H4 as oa,lf as oc,H9 as oi,R$ as on,yS as oo,uX as or,qne as os,U$ as ot,She as p,cde as pa,zd as pc,sge as pi,y4 as pn,K as po,Nhe as pr,Hp as ps,V5 as pt,l1 as q,Yw as qa,ze as qc,gX as qi,xQ as qn,Um as qo,hse as qr,Pd as qs,h4 as qt,Xpe as r,gge as ra,mf as rc,x1 as ri,Dme as rn,eD as ro,e2 as rr,up as rs,Cfe as rt,j4 as s,pfe as sa,yf as sc,Nfe as si,c0 as sn,SS as so,Cge as sr,lm as ss,f7 as st,bge as t,fge as ta,Tf as tc,Qme as ti,U7 as tn,Jw as to,B2 as tr,bm as ts,Fpe as tt,Ope as u,k0 as ua,Ld as uc,hfe as ui,Y$ as un,J as uo,zfe as ur,$p as us,Que as ut,j$ as v,V4 as va,As as vc,uhe as vi,zpe as vn,jg as vo,R0 as vr,qm as vs,V$ as vt,A7 as w,sj as wa,jte as wc,S4 as wi,che as wn,W as wo,B9 as wr,Tne as ws,ame as wt,N$ as x,Y0 as xa,ene as xc,j0 as xi,Rge as xn,E_ as xo,mQ as xr,wm as xs,G$ as xt,uQ as y,U4 as ya,Vo as yc,jme as yi,CZ as yn,Fg as yo,Rfe as yr,xm as ys,Vpe as yt,M0 as z,iD as za,M as zc,Uge as zi,nge as zn,Ep as zo,A$ as zr,Of as zs,mme as zt};