@inkeep/open-knowledge 0.68.8 → 0.68.11-beta.0

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 (156) hide show
  1. package/dist/{acp-harness-probe-moJTQgK2.mjs → acp-harness-probe-DaYXqGxg.mjs} +2 -2
  2. package/dist/cli.mjs +29 -29
  3. package/dist/config-schema.json +1 -1
  4. package/dist/config.project-local.schema.json +1 -1
  5. package/dist/constants-jyYwGmDC.mjs +2 -0
  6. package/dist/{fs-traced-C8gNIaHq.mjs → fs-traced-DgX7lP1u.mjs} +2 -2
  7. package/dist/fs-traced-Q0dJJRAw.mjs +1 -0
  8. package/dist/{git-handle-C9RU-MxT.mjs → git-handle-C0onz3KH.mjs} +2 -2
  9. package/dist/git-handle-GcGVb-Kt.mjs +1 -0
  10. package/dist/index.mjs +14 -14
  11. package/dist/init-CBEFRP85.mjs +1 -0
  12. package/dist/{init-Ba4MR5c4.mjs → init-_7R63fwz.mjs} +34 -34
  13. package/dist/{launch-json-removal-COTaVRNm.mjs → launch-json-removal-B28FsoE2.mjs} +2 -2
  14. package/dist/loader-Bz5cS92c.mjs +1 -0
  15. package/dist/{loader-D7rKGq0a.mjs → loader-C4UW1MW5.mjs} +2 -2
  16. package/dist/md-manager--OJ_B4tb.mjs +2 -0
  17. package/dist/{open-browser-CDpmQINA.mjs → open-browser-H-QKQd10.mjs} +2 -2
  18. package/dist/parse-worker.mjs +1 -1
  19. package/dist/preview-26pLGThq.mjs +1 -0
  20. package/dist/{preview-8z2Ze4V5.mjs → preview-DKtYHQbM.mjs} +2 -2
  21. package/dist/public/assets/{ActivityModeContent-Co1JyqXQ.js → ActivityModeContent-C9Z839EN.js} +1 -1
  22. package/dist/public/assets/{AddPropertiesButton-b5lnEVKK.js → AddPropertiesButton-DSQKtGW9.js} +2 -2
  23. package/dist/public/assets/{AgentDiffPane-DSyEDn_Y.js → AgentDiffPane-Cu3m0Lib.js} +1 -1
  24. package/dist/public/assets/{AgentThreadClientBinder-g9d9BU09.js → AgentThreadClientBinder-D1mSPUsr.js} +1 -1
  25. package/dist/public/assets/{BugReportHistory-BYU251NU.js → BugReportHistory-C2-fO6T3.js} +1 -1
  26. package/dist/public/assets/{BugReportHistoryDialog-wi8j2imF.js → BugReportHistoryDialog-BO92hFGg.js} +1 -1
  27. package/dist/public/assets/{CodeMirrorPropInput-2n_88FNl.js → CodeMirrorPropInput-CRa8tGX-.js} +1 -1
  28. package/dist/public/assets/{ConsentDialogBody-D2QQqLvP.js → ConsentDialogBody-Bu8u9p1a.js} +2 -2
  29. package/dist/public/assets/{DiffViewBoundary-BIjXbCNm.js → DiffViewBoundary-BDQV_30P.js} +1 -1
  30. package/dist/public/assets/{DocumentContext-C1MDqUGQ.js → DocumentContext-BdZiErvh.js} +1 -1
  31. package/dist/public/assets/{EditorModeToggle-PGfji8Z4.js → EditorModeToggle-DYldyVnC.js} +1 -1
  32. package/dist/public/assets/{EnableSyncConfirmDialog-D73cTIc2.js → EnableSyncConfirmDialog-N_l5NwWg.js} +1 -1
  33. package/dist/public/assets/{ExcalidrawDocEditor-DLYL4uLQ.js → ExcalidrawDocEditor-CFg6aGVN.js} +1 -1
  34. package/dist/public/assets/FeedbackForm-CnwouVSg.js +1 -0
  35. package/dist/public/assets/{GraphPanel-DODcHiM6.js → GraphPanel-r8Gqxdvr.js} +1 -1
  36. package/dist/public/assets/{ImportSkillDialog-SFJoXCHy.js → ImportSkillDialog-DOKtVFqO.js} +1 -1
  37. package/dist/public/assets/{LintConfigEditor-cz4oBJkn.js → LintConfigEditor-SzAKIf-P.js} +1 -1
  38. package/dist/public/assets/{ManagedArtifactProperties-DVYEs_-t.js → ManagedArtifactProperties-8E5SQSnI.js} +1 -1
  39. package/dist/public/assets/ManagedArtifactProperties-DyQXtUCs.js +1 -0
  40. package/dist/public/assets/{McpConsentDialogBody-CS-c374d.js → McpConsentDialogBody-D3q7WAev.js} +1 -1
  41. package/dist/public/assets/{Mermaid-mq736Zb_.js → Mermaid-Cw1EnMJu.js} +1 -1
  42. package/dist/public/assets/{MermaidDocEditor-BnbvkIUa.js → MermaidDocEditor-C-qlUZje.js} +1 -1
  43. package/dist/public/assets/{PropertyDisplayRow-DoKlSeCY.js → PropertyDisplayRow-CBiQBnOL.js} +1 -1
  44. package/dist/public/assets/{ReportBugDialogBody-Cn9kuPrd.js → ReportBugDialogBody-B4Ph81pw.js} +2 -2
  45. package/dist/public/assets/{ReportBugMenuTrigger-BWaaWbbQ.js → ReportBugMenuTrigger-D7aC0OiR.js} +2 -2
  46. package/dist/public/assets/{SchemaConfigEditor-BqXzeHB3.js → SchemaConfigEditor-DGBRJY7Q.js} +1 -1
  47. package/dist/public/assets/{SessionsHost-C1OZt5vc.js → SessionsHost-CrnQRViT.js} +2 -2
  48. package/dist/public/assets/{SettingsDialogBody-DQtkh-bL.js → SettingsDialogBody-DnEGrTMq.js} +1 -1
  49. package/dist/public/assets/{ShareBranchSwitchDialog--N1Bd5qo.js → ShareBranchSwitchDialog-Cgkl3a5v.js} +1 -1
  50. package/dist/public/assets/{ShareReceiveDialog-By6mslOj.js → ShareReceiveDialog-6TxrHOIU.js} +1 -1
  51. package/dist/public/assets/{ShareReceiveMissDialog-DrHrN8Zh.js → ShareReceiveMissDialog-BCkm-E10.js} +1 -1
  52. package/dist/public/assets/{SkillCostValue-CkONMU96.js → SkillCostValue-BMSdP6MA.js} +1 -1
  53. package/dist/public/assets/{SkillEditBanner-BkN4Vlyo.js → SkillEditBanner-D_nkf6Qd.js} +1 -1
  54. package/dist/public/assets/{SkillForkDialog-Bkhm9FwF.js → SkillForkDialog-Bhq9zhtY.js} +1 -1
  55. package/dist/public/assets/{SkillInstallMenu-DPBO7ZLl.js → SkillInstallMenu-D3KWfbhA.js} +1 -1
  56. package/dist/public/assets/{SkillOriginInline-DqGgPWeD.js → SkillOriginInline-CaEMp81T.js} +2 -2
  57. package/dist/public/assets/{SkillToolbarControls-kSIovUXj.js → SkillToolbarControls-tpuUyOLu.js} +1 -1
  58. package/dist/public/assets/{SkillUpdateConflictDialog-AerOBYmk.js → SkillUpdateConflictDialog-Cbj5JNXp.js} +1 -1
  59. package/dist/public/assets/{SlidesToolbarControls-CJSUDVcP.js → SlidesToolbarControls-DWqUzkgL.js} +1 -1
  60. package/dist/public/assets/{SourceEditor-DxcW7Ji4.js → SourceEditor-D_IY9GyQ.js} +1 -1
  61. package/dist/public/assets/{TerminalPanel-zXPIa6n_.js → TerminalPanel-MpZfhb9K.js} +1 -1
  62. package/dist/public/assets/{TerminalWindowApp-Cpr1PRtm.js → TerminalWindowApp-CwExuljm.js} +1 -1
  63. package/dist/public/assets/{TextDocEditor-CNvGi20m.js → TextDocEditor-DAcD7hS1.js} +1 -1
  64. package/dist/public/assets/{ThreadView-BdfdaWKJ.js → ThreadView-Dv-MJgLn.js} +1 -1
  65. package/dist/public/assets/{TimelineDiffPane-BIR2lWwH.js → TimelineDiffPane-G1nycx_c.js} +1 -1
  66. package/dist/public/assets/{agent-diff-store-_WIhmrnK.js → agent-diff-store-Bln_lxtD.js} +1 -1
  67. package/dist/public/assets/{alert-dialog-BFfs04J5.js → alert-dialog-DLAYZZMu.js} +2 -2
  68. package/dist/public/assets/{auth-state-cache-BCDkELSW.js → auth-state-cache-BLGrQ86G.js} +4 -4
  69. package/dist/public/assets/{bug-report-send-manager-BhNwFXTM.js → bug-report-send-manager-B4I-UPj9.js} +1 -1
  70. package/dist/public/assets/client-version-CXZnsz8b.js +1 -0
  71. package/dist/public/assets/{comment-chips-SxWcQbb_.js → comment-chips-Bm8WWDT7.js} +1 -1
  72. package/dist/public/assets/{config-provider-CFXUtiwu.js → config-provider-BvIhxk0G.js} +1 -1
  73. package/dist/public/assets/{dialog-CCHt-oLh.js → dialog-_kqu_91M.js} +1 -1
  74. package/dist/public/assets/{dist-CDr44_5B.js → dist-D6JA916i.js} +1 -1
  75. package/dist/public/assets/{doc-hash-CbPdvdAA.js → doc-hash-Dx9hwyex.js} +1 -1
  76. package/dist/public/assets/{documents-events-CRdjzLAr.js → documents-events-DR8HEJoe.js} +1 -1
  77. package/dist/public/assets/{file-tree-adapter-Bg4PgS4F.js → file-tree-adapter-C4gKqxzg.js} +1 -1
  78. package/dist/public/assets/{file-tree-utils-Dt-qVN4W.js → file-tree-utils-DGw50SVS.js} +1 -1
  79. package/dist/public/assets/{folder-config-api-Do2u-Rpg.js → folder-config-api-D4N0ED0-.js} +1 -1
  80. package/dist/public/assets/{globals-ByagJMEb.css → globals-DeOHYo0q.css} +1 -1
  81. package/dist/public/assets/i18n-Bl2radzN.js +1 -0
  82. package/dist/public/assets/{index-DnjxrnEw.js → index-BLB78i4B.js} +9 -9
  83. package/dist/public/assets/{launcher-selection-BtAC_6OE.js → launcher-selection-BZDeoOtN.js} +1 -1
  84. package/dist/public/assets/{lint-config-client-C7Do4K-V.js → lint-config-client-DBF47lRL.js} +1 -1
  85. package/dist/public/assets/{markdownlint-rule-browser-BuLeocmZ.js → markdownlint-rule-browser-CF1tj7Rc.js} +1 -1
  86. package/dist/public/assets/{page-list-cache-VMIjzKn4.js → page-list-cache-DZPKVqeA.js} +1 -1
  87. package/dist/public/assets/{pending-receive-nav-store-DWGtNmXZ.js → pending-receive-nav-store-BtQaH8Ow.js} +1 -1
  88. package/dist/public/assets/{progress-mhZcxRBo.js → progress-DKwbAv_d.js} +1 -1
  89. package/dist/public/assets/{project-paths-BhoLIJti.js → project-paths-BGMK3dxo.js} +1 -1
  90. package/dist/public/assets/{prop-types-CUmrzSW1.js → prop-types-gfjew8MI.js} +1 -1
  91. package/dist/public/assets/{receive-store-D2_q1wUu.js → receive-store-OL80o-sI.js} +1 -1
  92. package/dist/public/assets/{selection-context-EAVqhQEK.js → selection-context-BBTm-UVn.js} +1 -1
  93. package/dist/public/assets/{skill-scope-NCYHirwV.js → skill-scope-D9dg7q4P.js} +1 -1
  94. package/dist/public/assets/{skills-api-Dz_rVA1C.js → skills-api-BU5k9WYz.js} +1 -1
  95. package/dist/public/assets/{src-DuGGvfdD.js → src-BBEwVksN.js} +1 -1
  96. package/dist/public/assets/{startup-marks-BPR5ipj8.js → startup-marks-Ml5LD4ks.js} +1 -1
  97. package/dist/public/assets/{tag-pill-input-CYAsZCew.js → tag-pill-input-vfk8h50K.js} +1 -1
  98. package/dist/public/assets/{target-navigation-intent-CYAnPRok.js → target-navigation-intent-Dpq3EXpz.js} +1 -1
  99. package/dist/public/assets/{telemetry-impl-Cx5oP3TZ.js → telemetry-impl-B_63zFxn.js} +1 -1
  100. package/dist/public/assets/{telemetry-startup-kezMCRHJ.js → telemetry-startup-BMrCBn-y.js} +1 -1
  101. package/dist/public/assets/{terminal-cli-display-jaULlk-O.js → terminal-cli-display-XU6hL6_q.js} +1 -1
  102. package/dist/public/assets/{terminal-command-events-D5gbDNfs.js → terminal-command-events-DBrAYz2u.js} +1 -1
  103. package/dist/public/assets/{typing-burst-detector-Dc6Z0dV2.js → typing-burst-detector-D-RxXAZt.js} +1 -1
  104. package/dist/public/assets/{uninstall-DAcZS1HG.js → uninstall-C645M4Nr.js} +1 -1
  105. package/dist/public/assets/{use-activity-panel-C8rnLWCk.js → use-activity-panel-TaOc5fsr.js} +1 -1
  106. package/dist/public/assets/{use-apply-config-color-theme-C3t6RLOI.js → use-apply-config-color-theme-D-13D2Xt.js} +1 -1
  107. package/dist/public/assets/{use-collab-url-CUI36lWb.js → use-collab-url-CqeAlJNl.js} +1 -1
  108. package/dist/public/assets/{use-conflicts-CBdH6psn.js → use-conflicts-CXDbJNoF.js} +1 -1
  109. package/dist/public/assets/{use-live-xterm-theme-mYE4hguI.js → use-live-xterm-theme-aXDStBRf.js} +1 -1
  110. package/dist/public/assets/{use-open-skill-1xuIk7AK.js → use-open-skill-BfikAHGm.js} +1 -1
  111. package/dist/public/assets/{use-settings-route-C_HC7gny.js → use-settings-route-WFqgyKMc.js} +1 -1
  112. package/dist/public/assets/{use-skill-origin-BKe9dbHW.js → use-skill-origin-M6b5sY_s.js} +1 -1
  113. package/dist/public/assets/{use-skills-BhaOexz2.js → use-skills-dKHpTH68.js} +1 -1
  114. package/dist/public/assets/{use-terminal-enabled-M2ci--Ho.js → use-terminal-enabled-f6uI67oZ.js} +1 -1
  115. package/dist/public/assets/{use-timeline-entry-diff-CIsFdF1_.js → use-timeline-entry-diff-DEsOnT79.js} +1 -1
  116. package/dist/public/assets/{use-workspace-BHq7gCE9.js → use-workspace-DAuqjfCS.js} +1 -1
  117. package/dist/public/index.html +54 -54
  118. package/dist/public/uninstall.html +5 -5
  119. package/dist/{repair-launch-json-CcgD5Q8I.mjs → repair-launch-json-O0pvONvJ.mjs} +2 -2
  120. package/dist/{repair-mcp-configs-CG-Wr3i4.mjs → repair-mcp-configs-BFtKKOXF.mjs} +2 -2
  121. package/dist/repair-skills-BkLHvKTk.mjs +1 -0
  122. package/dist/{repair-skills-BSimb6wa.mjs → repair-skills-zu7vM_05.mjs} +2 -2
  123. package/dist/{resolve-project-root-Bq-TBff8.mjs → resolve-project-root-dt8lYC9W.mjs} +3 -3
  124. package/dist/schemas/v0/config.project-local.schema.json +1 -1
  125. package/dist/server-lock-D-DD35fh.mjs +1 -0
  126. package/dist/{server-lock-CGm9uKLf.mjs → server-lock-DKS1ePB3.mjs} +2 -2
  127. package/dist/{skill-teardown-7aiCD98i.mjs → skill-teardown-DUZd_juy.mjs} +2 -2
  128. package/dist/{sleep-CFk6IVkN.mjs → sleep-zea4v2sB.mjs} +2 -2
  129. package/dist/{src-CIngi0dD.mjs → src-B2bAQ64a.mjs} +2 -2
  130. package/dist/src-CT7Wk-MG.mjs +1 -0
  131. package/dist/src-D5pqfubu.mjs +21 -0
  132. package/dist/src-e2udu2Rw.mjs +2045 -0
  133. package/dist/src-y6vbbp7M.mjs +1 -0
  134. package/dist/start-BoiJ1XmS.mjs +1 -0
  135. package/dist/start-DET7Qj8h.mjs +5 -0
  136. package/package.json +4 -4
  137. package/dist/constants-DObAsBjb.mjs +0 -2
  138. package/dist/fs-traced-CMCYO7L0.mjs +0 -1
  139. package/dist/git-handle-CzN6a5i1.mjs +0 -1
  140. package/dist/init-BIp5JihP.mjs +0 -1
  141. package/dist/loader-Qwm0-JSC.mjs +0 -1
  142. package/dist/md-manager-B0rABilg.mjs +0 -2
  143. package/dist/preview-uPU2tGKj.mjs +0 -1
  144. package/dist/public/assets/FeedbackForm-CeFv-wxn.js +0 -1
  145. package/dist/public/assets/ManagedArtifactProperties-D4in1i0d.js +0 -1
  146. package/dist/public/assets/client-version-DPdchc8q.js +0 -1
  147. package/dist/public/assets/i18n-CApFNCKM.js +0 -1
  148. package/dist/repair-skills-OE0auD8d.mjs +0 -1
  149. package/dist/server-lock-CHQfzAi7.mjs +0 -1
  150. package/dist/src-B2ESrG1g.mjs +0 -1
  151. package/dist/src-BLkJBxuv.mjs +0 -1
  152. package/dist/src-CQ0mDiOq.mjs +0 -21
  153. package/dist/src-xI8ra_S9.mjs +0 -2045
  154. package/dist/start-hJmkelSD.mjs +0 -5
  155. package/dist/start-ppMYmXMM.mjs +0 -1
  156. /package/dist/public/assets/{globals-DIT-uAXH.js → globals--7ibIAoz.js} +0 -0
package/dist/index.mjs CHANGED
@@ -181,7 +181,7 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\
181
181
 
182
182
  `)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=Pn,s=!xn.jitless,c=s&&hee.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?Pr([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function Fr(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=>!Bn(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=>Wn(e,r,Sn())))}),t)}const Ir=P(`$ZodUnion`,(e,t)=>{Er.init(e,t),kn(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),kn(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),kn(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),kn(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=>Dn(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=>Fr(t,r,e,i)):Fr(o,r,e,i)}}),Vte=P(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,Ir.init(e,t);let n=e._zod.parse;kn(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=Tn(()=>{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(!Pn(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)}}),Hte=P(`$ZodIntersection`,(e,t)=>{Er.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 Lr(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Fn(e)&&Fn(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=Lr(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=Lr(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}),Bn(e))return e;let o=Lr(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const Ute=P(`$ZodRecord`,(e,t)=>{Er.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Fn(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=>Wn(e,r,Sn())),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(...Hn(c,e.issues)),n.value[l]=e.value})):(u.issues.length&&n.issues.push(...Hn(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`&&br.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=>Wn(e,r,Sn())),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(...Hn(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...Hn(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),Wte=P(`$ZodEnum`,(e,t)=>{Er.init(e,t);let n=Cn(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>gee.has(typeof e)).map(e=>typeof e==`string`?Ln(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}}),Gte=P(`$ZodLiteral`,(e,t)=>{if(Er.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`?Ln(e):e?Ln(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}}),Kte=P(`$ZodTransform`,(e,t)=>{Er.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new bn(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 yn;return n.value=i,n.fallback=!0,n}});function zr(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const Br=P(`$ZodOptional`,(e,t)=>{Er.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,kn(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),kn(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Dn(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=>zr(e,r)):zr(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),qte=P(`$ZodExactOptional`,(e,t)=>{Br.init(e,t),kn(e._zod,`values`,()=>t.innerType._zod.values),kn(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Jte=P(`$ZodNullable`,(e,t)=>{Er.init(e,t),kn(e._zod,`optin`,()=>t.innerType._zod.optin),kn(e._zod,`optout`,()=>t.innerType._zod.optout),kn(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Dn(e.source)}|null)$`):void 0}),kn(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)}),Yte=P(`$ZodDefault`,(e,t)=>{Er.init(e,t),e._zod.optin=`optional`,kn(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=>Vr(e,t)):Vr(r,t)}});function Vr(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Xte=P(`$ZodPrefault`,(e,t)=>{Er.init(e,t),e._zod.optin=`optional`,kn(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))}),Hr=P(`$ZodNonOptional`,(e,t)=>{Er.init(e,t),kn(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=>Ur(t,e)):Ur(i,e)}});function Ur(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}const Wr=P(`$ZodCatch`,(e,t)=>{Er.init(e,t),e._zod.optin=`optional`,kn(e._zod,`optout`,()=>t.innerType._zod.optout),kn(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=>Wn(e,n,Sn()))},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=>Wn(e,n,Sn()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),Gr=P(`$ZodPipe`,(e,t)=>{Er.init(e,t),kn(e._zod,`values`,()=>t.in._zod.values),kn(e._zod,`optin`,()=>t.in._zod.optin),kn(e._zod,`optout`,()=>t.out._zod.optout),kn(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=>Kr(e,t.in,n)):Kr(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Kr(e,t.out,n)):Kr(r,t.out,n)}});function Kr(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}const qr=P(`$ZodPreprocess`,(e,t)=>{Gr.init(e,t)}),Jr=P(`$ZodReadonly`,(e,t)=>{Er.init(e,t),kn(e._zod,`propValues`,()=>t.innerType._zod.propValues),kn(e._zod,`values`,()=>t.innerType._zod.values),kn(e._zod,`optin`,()=>t.innerType?._zod?.optin),kn(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(Yr):Yr(r)}});function Yr(e){return e.value=Object.freeze(e.value),e}const Xr=P(`$ZodLazy`,(e,t)=>{Er.init(e,t),kn(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),kn(e._zod,`pattern`,()=>e._zod.innerType?._zod?.pattern),kn(e._zod,`propValues`,()=>e._zod.innerType?._zod?.propValues),kn(e._zod,`optin`,()=>e._zod.innerType?._zod?.optin??void 0),kn(e._zod,`optout`,()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),Zr=P(`$ZodCustom`,(e,t)=>{xr.init(e,t),Er.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=>Qr(t,n,r,e));Qr(i,n,r,e)}});function Qr(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(Kn(e))}}var $r,ei=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 ti(){return new ei}($r=globalThis).__zod_globalRegistry??($r.__zod_globalRegistry=ti());const ni=globalThis.__zod_globalRegistry;function ri(e,t){return new e({type:`string`,...zn(t)})}function ii(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...zn(t)})}function ai(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...zn(t)})}function oi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...zn(t)})}function si(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...zn(t)})}function ci(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...zn(t)})}function li(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...zn(t)})}function ui(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...zn(t)})}function di(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...zn(t)})}function fi(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...zn(t)})}function pi(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...zn(t)})}function mi(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...zn(t)})}function hi(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...zn(t)})}function gi(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...zn(t)})}function _i(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...zn(t)})}function vi(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...zn(t)})}function yi(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...zn(t)})}function bi(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...zn(t)})}function xi(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...zn(t)})}function Si(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...zn(t)})}function Ci(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...zn(t)})}function wi(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...zn(t)})}function Ti(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...zn(t)})}function Ei(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...zn(t)})}function Di(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...zn(t)})}function Oi(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...zn(t)})}function ki(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...zn(t)})}function Ai(e,t){return new e({type:`number`,checks:[],...zn(t)})}function ji(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...zn(t)})}function Mi(e,t){return new e({type:`boolean`,...zn(t)})}function Ni(e,t){return new e({type:`null`,...zn(t)})}function Pi(e){return new e({type:`unknown`})}function Fi(e,t){return new e({type:`never`,...zn(t)})}function Ii(e,t){return new Cr({check:`less_than`,...zn(t),value:e,inclusive:!1})}function Li(e,t){return new Cr({check:`less_than`,...zn(t),value:e,inclusive:!0})}function Ri(e,t){return new wr({check:`greater_than`,...zn(t),value:e,inclusive:!1})}function zi(e,t){return new wr({check:`greater_than`,...zn(t),value:e,inclusive:!0})}function Bi(e,t){return new Jee({check:`multiple_of`,...zn(t),value:e})}function Vi(e,t){return new Xee({check:`max_length`,...zn(t),maximum:e})}function Hi(e,t){return new Zee({check:`min_length`,...zn(t),minimum:e})}function Ui(e,t){return new Qee({check:`length_equals`,...zn(t),length:e})}function Wi(e,t){return new $ee({check:`string_format`,format:`regex`,...zn(t),pattern:e})}function Gi(e){return new ete({check:`string_format`,format:`lowercase`,...zn(e)})}function Ki(e){return new tte({check:`string_format`,format:`uppercase`,...zn(e)})}function qi(e,t){return new nte({check:`string_format`,format:`includes`,...zn(t),includes:e})}function Ji(e,t){return new rte({check:`string_format`,format:`starts_with`,...zn(t),prefix:e})}function Yi(e,t){return new ite({check:`string_format`,format:`ends_with`,...zn(t),suffix:e})}function Xi(e){return new ate({check:`overwrite`,tx:e})}function Zi(e){return Xi(t=>t.normalize(e))}function Qi(){return Xi(e=>e.trim())}function $i(){return Xi(e=>e.toLowerCase())}function ea(){return Xi(e=>e.toUpperCase())}function ta(){return Xi(e=>mee(e))}function na(e,t,n){return new e({type:`array`,element:t,...zn(n)})}function ra(e,t,n){let r=zn(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function ia(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...zn(n)})}function aa(e,t){let n=oa(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Kn(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(Kn(r))}},e(t.value,t)),t);return n}function oa(e,t){let n=new xr({check:`custom`,...zn(t)});return n._zod.check=e,n}function sa(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??ni,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 ca(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,ca(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`&&da(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 la(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>
183
183
 
184
- 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 ua(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:pa(t,`input`,e.processors),output:pa(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function da(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 da(r.element,n);if(r.type===`set`)return da(r.valueType,n);if(r.type===`lazy`)return da(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 da(r.innerType,n);if(r.type===`intersection`)return da(r.left,n)||da(r.right,n);if(r.type===`record`||r.type===`map`)return da(r.keyType,n)||da(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:da(r.in,n)||da(r.out,n);if(r.type===`object`){for(let e in r.shape)if(da(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(da(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(da(e,n))return!0;return!!(r.rest&&da(r.rest,n))}return!1}const fa=(e,t={})=>n=>{let r=sa({...n,processors:t});return ca(e,r),la(r,e),ua(r,e)},pa=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=sa({...i??{},target:a,io:t,processors:n});return ca(e,o),la(o,e),ua(o,e)},ma={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},ha=(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=ma[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}))])}},ga=(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)},_a=(e,t,n,r)=>{n.type=`boolean`},va=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},ya=(e,t,n,r)=>{n.not={}},ba=(e,t,n,r)=>{let i=e._zod.def,a=Cn(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},xa=(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},Sa=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},Ca=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},wa=(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=ca(a.element,t,{...r,path:[...r.path,`items`]})},Ta=(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]=ca(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=ca(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Ea=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>ca(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Da=(e,t,n,r)=>{let i=e._zod.def,a=ca(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=ca(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]]},Oa=(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=ca(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=ca(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=ca(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)}},ka=(e,t,n,r)=>{let i=e._zod.def,a=ca(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`}]},Aa=(e,t,n,r)=>{let i=e._zod.def;ca(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},ja=(e,t,n,r)=>{let i=e._zod.def;ca(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Ma=(e,t,n,r)=>{let i=e._zod.def;ca(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)))},Na=(e,t,n,r)=>{let i=e._zod.def;ca(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},Pa=(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;ca(o,t,r);let s=t.seen.get(e);s.ref=o},Fa=(e,t,n,r)=>{let i=e._zod.def;ca(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Ia=(e,t,n,r)=>{let i=e._zod.def;ca(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},La=(e,t,n,r)=>{let i=e._zod.innerType;ca(i,t,r);let a=t.seen.get(e);a.ref=i},Ra=P(`ZodISODateTime`,(e,t)=>{yte.init(e,t),lo.init(e,t)});function za(e){return Ei(Ra,e)}const Ba=P(`ZodISODate`,(e,t)=>{bte.init(e,t),lo.init(e,t)});function Va(e){return Di(Ba,e)}const Ha=P(`ZodISOTime`,(e,t)=>{xte.init(e,t),lo.init(e,t)});function Ua(e){return Oi(Ha,e)}const Wa=P(`ZodISODuration`,(e,t)=>{Ste.init(e,t),lo.init(e,t)});function Ga(e){return ki(Wa,e)}const Ka=P(`ZodError`,(e,t)=>{Jn.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Zn(e,t)},flatten:{value:t=>Xn(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,wn,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,wn,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),qa=Qn(Ka),Ja=$n(Ka),Ya=er(Ka),Xa=nr(Ka),Za=ir(Ka),Qa=ar(Ka),$a=or(Ka),eo=sr(Ka),to=cr(Ka),no=lr(Ka),ro=ur(Ka),io=dr(Ka),ao=new WeakMap;function oo(e,t,n){let r=Object.getPrototypeOf(e),i=ao.get(r);if(i||(i=new Set,ao.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})}})}}}const so=P(`ZodType`,(e,t)=>(Er.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:pa(e,`input`),output:pa(e,`output`)}}),e.toJSONSchema=fa(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,`_def`,{value:t}),e.parse=(t,n)=>qa(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Ya(e,t,n),e.parseAsync=async(t,n)=>Ja(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Xa(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Za(e,t,n),e.decode=(t,n)=>Qa(e,t,n),e.encodeAsync=async(t,n)=>$a(e,t,n),e.decodeAsync=async(t,n)=>eo(e,t,n),e.safeEncode=(t,n)=>to(e,t,n),e.safeDecode=(t,n)=>no(e,t,n),e.safeEncodeAsync=async(t,n)=>ro(e,t,n),e.safeDecodeAsync=async(t,n)=>io(e,t,n),oo(e,`ZodType`,{check(...e){let t=this.def;return this.clone(jn(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 Rn(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Bne(e,t))},superRefine(e,t){return this.check(Vne(e,t))},overwrite(e){return this.check(Xi(e))},optional(){return Oo(this)},exactOptional(){return Dne(this)},nullable(){return ko(this)},nullish(){return Oo(ko(this))},nonoptional(e){return Nne(this,e)},array(){return z(this)},or(e){return xo([this,e])},and(e){return Co(this,e)},transform(e){return Mo(this,Eo(e))},default(e){return Ane(this,e)},prefault(e){return Mne(this,e)},catch(e){return Fne(this,e)},pipe(e){return Mo(this,e)},readonly(){return Rne(this)},describe(e){let t=this.clone();return ni.add(t,{description:e}),t},meta(...e){if(e.length===0)return ni.get(this);let t=this.clone();return ni.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 ni.get(e)?.description},configurable:!0}),e)),co=P(`_ZodString`,(e,t)=>{Dr.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ha(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,oo(e,`_ZodString`,{regex(...e){return this.check(Wi(...e))},includes(...e){return this.check(qi(...e))},startsWith(...e){return this.check(Ji(...e))},endsWith(...e){return this.check(Yi(...e))},min(...e){return this.check(Hi(...e))},max(...e){return this.check(Vi(...e))},length(...e){return this.check(Ui(...e))},nonempty(...e){return this.check(Hi(1,...e))},lowercase(e){return this.check(Gi(e))},uppercase(e){return this.check(Ki(e))},trim(){return this.check(Qi())},normalize(...e){return this.check(Zi(...e))},toLowerCase(){return this.check($i())},toUpperCase(){return this.check(ea())},slugify(){return this.check(ta())}})}),Zte=P(`ZodString`,(e,t)=>{Dr.init(e,t),co.init(e,t),e.email=t=>e.check(ii(Qte,t)),e.url=t=>e.check(ui(po,t)),e.jwt=t=>e.check(Ti(mne,t)),e.emoji=t=>e.check(di(ene,t)),e.guid=t=>e.check(ai(uo,t)),e.uuid=t=>e.check(oi(fo,t)),e.uuidv4=t=>e.check(si(fo,t)),e.uuidv6=t=>e.check(ci(fo,t)),e.uuidv7=t=>e.check(li(fo,t)),e.nanoid=t=>e.check(fi(tne,t)),e.guid=t=>e.check(ai(uo,t)),e.cuid=t=>e.check(pi(nne,t)),e.cuid2=t=>e.check(mi(rne,t)),e.ulid=t=>e.check(hi(ine,t)),e.base64=t=>e.check(Si(dne,t)),e.base64url=t=>e.check(Ci(fne,t)),e.xid=t=>e.check(gi(ane,t)),e.ksuid=t=>e.check(_i(one,t)),e.ipv4=t=>e.check(vi(sne,t)),e.ipv6=t=>e.check(yi(cne,t)),e.cidrv4=t=>e.check(bi(lne,t)),e.cidrv6=t=>e.check(xi(une,t)),e.e164=t=>e.check(wi(pne,t)),e.datetime=t=>e.check(za(t)),e.date=t=>e.check(Va(t)),e.time=t=>e.check(Ua(t)),e.duration=t=>e.check(Ga(t))});function F(e){return ri(Zte,e)}const lo=P(`ZodStringFormat`,(e,t)=>{Or.init(e,t),co.init(e,t)}),Qte=P(`ZodEmail`,(e,t)=>{ute.init(e,t),lo.init(e,t)}),uo=P(`ZodGUID`,(e,t)=>{cte.init(e,t),lo.init(e,t)}),fo=P(`ZodUUID`,(e,t)=>{lte.init(e,t),lo.init(e,t)});function $te(e){return oi(fo,e)}const po=P(`ZodURL`,(e,t)=>{dte.init(e,t),lo.init(e,t)});function mo(e){return ui(po,e)}const ene=P(`ZodEmoji`,(e,t)=>{fte.init(e,t),lo.init(e,t)}),tne=P(`ZodNanoID`,(e,t)=>{pte.init(e,t),lo.init(e,t)}),nne=P(`ZodCUID`,(e,t)=>{mte.init(e,t),lo.init(e,t)}),rne=P(`ZodCUID2`,(e,t)=>{hte.init(e,t),lo.init(e,t)}),ine=P(`ZodULID`,(e,t)=>{gte.init(e,t),lo.init(e,t)}),ane=P(`ZodXID`,(e,t)=>{_te.init(e,t),lo.init(e,t)}),one=P(`ZodKSUID`,(e,t)=>{vte.init(e,t),lo.init(e,t)}),sne=P(`ZodIPv4`,(e,t)=>{Cte.init(e,t),lo.init(e,t)}),cne=P(`ZodIPv6`,(e,t)=>{wte.init(e,t),lo.init(e,t)}),lne=P(`ZodCIDRv4`,(e,t)=>{Tte.init(e,t),lo.init(e,t)}),une=P(`ZodCIDRv6`,(e,t)=>{Ete.init(e,t),lo.init(e,t)}),dne=P(`ZodBase64`,(e,t)=>{Dte.init(e,t),lo.init(e,t)}),fne=P(`ZodBase64URL`,(e,t)=>{kte.init(e,t),lo.init(e,t)}),pne=P(`ZodE164`,(e,t)=>{Ate.init(e,t),lo.init(e,t)}),mne=P(`ZodJWT`,(e,t)=>{Mte.init(e,t),lo.init(e,t)}),ho=P(`ZodNumber`,(e,t)=>{Ar.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ga(e,t,n,r),oo(e,`ZodNumber`,{gt(e,t){return this.check(Ri(e,t))},gte(e,t){return this.check(zi(e,t))},min(e,t){return this.check(zi(e,t))},lt(e,t){return this.check(Ii(e,t))},lte(e,t){return this.check(Li(e,t))},max(e,t){return this.check(Li(e,t))},int(e){return this.check(go(e))},safe(e){return this.check(go(e))},positive(e){return this.check(Ri(0,e))},nonnegative(e){return this.check(zi(0,e))},negative(e){return this.check(Ii(0,e))},nonpositive(e){return this.check(Li(0,e))},multipleOf(e,t){return this.check(Bi(e,t))},step(e,t){return this.check(Bi(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 I(e){return Ai(ho,e)}const hne=P(`ZodNumberFormat`,(e,t)=>{Nte.init(e,t),ho.init(e,t)});function go(e){return ji(hne,e)}const gne=P(`ZodBoolean`,(e,t)=>{Pte.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_a(e,t,n,r)});function L(e){return Mi(gne,e)}const _ne=P(`ZodNull`,(e,t)=>{Fte.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>va(e,t,n,r)});function _o(e){return Ni(_ne,e)}const vne=P(`ZodUnknown`,(e,t)=>{Ite.init(e,t),so.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function R(){return Pi(vne)}const yne=P(`ZodNever`,(e,t)=>{Lte.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ya(e,t,n,r)});function bne(e){return Fi(yne,e)}const xne=P(`ZodArray`,(e,t)=>{Rte.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wa(e,t,n,r),e.element=t.element,oo(e,`ZodArray`,{min(e,t){return this.check(Hi(e,t))},nonempty(e){return this.check(Hi(1,e))},max(e,t){return this.check(Vi(e,t))},length(e,t){return this.check(Ui(e,t))},unwrap(){return this.element}})});function z(e,t){return na(xne,e,t)}const vo=P(`ZodObject`,(e,t)=>{Bte.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ta(e,t,n,r),kn(e,`shape`,()=>t.shape),oo(e,`ZodObject`,{keyof(){return H(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:R()})},loose(){return this.clone({...this._zod.def,catchall:R()})},strict(){return this.clone({...this._zod.def,catchall:bne()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return xee(this,e)},safeExtend(e){return See(this,e)},merge(e){return Cee(this,e)},pick(e){return yee(this,e)},omit(e){return bee(this,e)},partial(...e){return wee(Do,this,e[0])},required(...e){return Tee(Ao,this,e[0])}})});function B(e,t){return new vo({type:`object`,shape:e??{},...zn(t)})}function yo(e,t){return new vo({type:`object`,shape:e,catchall:R(),...zn(t)})}const bo=P(`ZodUnion`,(e,t)=>{Ir.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ea(e,t,n,r),e.options=t.options});function xo(e,t){return new bo({type:`union`,options:e,...zn(t)})}const Sne=P(`ZodDiscriminatedUnion`,(e,t)=>{bo.init(e,t),Vte.init(e,t)});function So(e,t,n){return new Sne({type:`union`,options:t,discriminator:e,...zn(n)})}const Cne=P(`ZodIntersection`,(e,t)=>{Hte.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Da(e,t,n,r)});function Co(e,t){return new Cne({type:`intersection`,left:e,right:t})}const wo=P(`ZodRecord`,(e,t)=>{Ute.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Oa(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function V(e,t,n){return!t||!t._zod?new wo({type:`record`,keyType:F(),valueType:e,...zn(t)}):new wo({type:`record`,keyType:e,valueType:t,...zn(n)})}const To=P(`ZodEnum`,(e,t)=>{Wte.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ba(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 To({...t,checks:[],...zn(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 To({...t,checks:[],...zn(r),entries:i})}});function H(e,t){return new To({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...zn(t)})}const wne=P(`ZodLiteral`,(e,t)=>{Gte.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xa(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 U(e,t){return new wne({type:`literal`,values:Array.isArray(e)?e:[e],...zn(t)})}const Tne=P(`ZodTransform`,(e,t)=>{Kte.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ca(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new bn(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Kn(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(Kn(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 Eo(e){return new Tne({type:`transform`,transform:e})}const Do=P(`ZodOptional`,(e,t)=>{Br.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ia(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Oo(e){return new Do({type:`optional`,innerType:e})}const Ene=P(`ZodExactOptional`,(e,t)=>{qte.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ia(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Dne(e){return new Ene({type:`optional`,innerType:e})}const One=P(`ZodNullable`,(e,t)=>{Jte.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ka(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ko(e){return new One({type:`nullable`,innerType:e})}const kne=P(`ZodDefault`,(e,t)=>{Yte.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ja(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Ane(e,t){return new kne({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():In(t)}})}const jne=P(`ZodPrefault`,(e,t)=>{Xte.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ma(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Mne(e,t){return new jne({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():In(t)}})}const Ao=P(`ZodNonOptional`,(e,t)=>{Hr.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Aa(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Nne(e,t){return new Ao({type:`nonoptional`,innerType:e,...zn(t)})}const Pne=P(`ZodCatch`,(e,t)=>{Wr.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Na(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Fne(e,t){return new Pne({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}const jo=P(`ZodPipe`,(e,t)=>{Gr.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Pa(e,t,n,r),e.in=t.in,e.out=t.out});function Mo(e,t){return new jo({type:`pipe`,in:e,out:t})}const Ine=P(`ZodPreprocess`,(e,t)=>{jo.init(e,t),qr.init(e,t)}),Lne=P(`ZodReadonly`,(e,t)=>{Jr.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fa(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Rne(e){return new Lne({type:`readonly`,innerType:e})}const zne=P(`ZodLazy`,(e,t)=>{Xr.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>La(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function No(e){return new zne({type:`lazy`,getter:e})}const Po=P(`ZodCustom`,(e,t)=>{Zr.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Sa(e,t,n,r)});function Fo(e,t){return ra(Po,e??(()=>!0),t)}function Bne(e,t={}){return ia(Po,e,t)}function Vne(e,t){return aa(e,t)}function Io(e,t){return new Ine({type:`pipe`,in:Eo(e),out:t})}const Hne=B({path:z(xo([F(),I()])),message:F(),issueCode:F()});So(`code`,[B({code:U(`SCHEMA_INVALID`),issues:z(Hne)}),B({code:U(`WRITE_ERROR`),detail:F()})]);const Lo=[`text`,`number`,`boolean`,`date`,`list`,`object`];H(Lo);const Une=xo([F(),I(),L()]),Ro=No(()=>xo([Une.transform(e=>String(e)),V(F(),zo),z(Ro)])),zo=No(()=>xo([F(),I(),L(),z(Ro),V(F(),zo)]));function Bo(e){if(Array.isArray(e)){let t=[];for(let n of e)n!==null&&t.push(Bo(n));return t}if(typeof e==`object`&&e){let t={};for(let[n,r]of Object.entries(e))t[n]=r===null?``:Bo(r);return t}return e}Io(Bo,V(F(),zo)),V(F(),xo([zo,_o()]));const Vo=/^---[ \t]*\r?\n([\s\S]*?\r?\n)?---[ \t]*(\r?\n|$)/;function Wne(e){let t=e.match(Vo);return t?{frontmatter:t[0],body:e.slice(t[0].length)}:{frontmatter:``,body:e}}function Gne(e){if(e===``)return``;let t=e.match(Vo);return t?(t[1]??``).replace(/\r?\n$/,``):e}Object.freeze({source:`local`,skipStoreHooks:!1,context:Object.freeze({origin:`form-write`})});function Ho(e,t){return e>=(t===`leading`?2:1)?e:0}function Uo(e,t){let n={line:e,column:1,offset:t};return{type:`paragraph`,children:[],position:{start:n,end:{...n}}}}function Wo(e,t){let n=e.children,r=n.length===0||t.leading===void 0?0:Ho(t.leading.length,`leading`),i=n.length===0||t.trailing===void 0?0:Ho(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(Uo(1+e,e));if(i>0&&typeof a?.offset==`number`&&typeof a.line==`number`)for(let e=0;e<i;e++)s.push(Uo(a.line+1+e,a.offset+1+e));if(o.length===0&&s.length===0||(e.children=[...o,...n,...s],o.length>0&&delete t.leading,s.length>0&&delete t.trailing,t.bom!==void 0||t.leading!==void 0||t.trailing!==void 0))return t;e.data!==void 0&&delete e.data.sourceDocBoundary}const Kne=new gn.default;Kne.Match_Threshold=.5;function Go(e,t){let n=0;for(let r=0;r<t.length&&n<e.length;r++)e[n]===t[r]&&n++;return n===e.length}const qne=new Set([`sourceRaw`,`sourceDirty`,`position`]),Jne=new Set([`jsxComponent`,`table`,`tableRow`,`tableCell`,`tableHeader`,`list`,`listItem`,`blockquote`,`codeBlock`,`heading`]),Ko={type:`__br__`},Yne=/^<br\s*\/?>$/i;function qo(e){let t=Xo(e,qo);return(t.type===`tableCell`||t.type===`tableHeader`)&&t.content?{...t,content:Jo(t.content)}:t}function Jo(e){let t=[];for(let n of e){let e=Xne(n);e.length!==0&&(t.length>0&&t.push(Ko),t.push(...e))}return t}function Xne(e){return e.text!==void 0||e.type===`hardBreak`||e.type===`jsxInline`?[e]:!e.content||e.content.length===0?[]:e.content.some(e=>e.text===void 0&&e.type!==`hardBreak`&&e.type!==`jsxInline`&&!!e.content)?Jo(e.content):e.content}function Yo(e){return e.type===`hardBreak`||e.type===Ko.type||e.text!==void 0&&Yne.test(e.text.trim())?Ko:Xo(e,Yo)}const Zne=[{label:`table-cell-block-flatten`,severity:`pm-model-caused`,rationale:`GFM table cells have no block spelling; a block placed in a cell is flattened to inline on serialize, so a cell-with-blocks and a cell-with-inline describe the same persisted document.`,proofPointer:`markdown/table-cell-flatten.ts flattenCellBlocks (table-cell-flatten-dropped-block event)`,canonicalize:qo},{label:`void-hardbreak-br`,severity:`serializer-caused`,rationale:`A void hardBreak inside a table cell or heading serializes to a literal <br /> that a fresh parse keeps as text; the node form and the literal form are the same break.`,proofPointer:`markdown/void-br-promoter.ts + markdown/to-markdown-handlers.ts break handler`,canonicalize:Yo}];function Xo(e,t){return e.content?{...e,content:e.content.map(t)}:e}function Zo(e,t){let n={};e.type!==void 0&&(n.type=e.type),e.text!==void 0&&(n.text=e.text);let r=Qo(e.attrs,t);return r&&(n.attrs=r),e.marks&&e.marks.length>0&&(n.marks=[...e.marks].map(e=>({type:e.type,attrs:Qo(e.attrs,t)})).sort((e,t)=>es(e).localeCompare(es(t)))),e.content&&e.content.length>0&&(n.content=e.content.map(e=>Zo(e,t))),n}function Qo(e,t){if(!e)return null;let n={};for(let r of Object.keys(e).sort()){if(qne.has(r)||t?.(r))continue;let i=e[r];i!=null&&(n[r]=t?$o(i,t):i)}return Object.keys(n).length>0?n:null}function $o(e,t){if(Array.isArray(e))return e.map(e=>$o(e,t));if(e&&typeof e==`object`){let n={};for(let[r,i]of Object.entries(e))t(r)||(n[r]=$o(i,t));return n}return e}function es(e){return JSON.stringify(e,(e,t)=>{if(t&&typeof t==`object`&&!Array.isArray(t)){let e={};for(let n of Object.keys(t).sort())e[n]=t[n];return e}return t})}function ts(e,t=!1){let n=``,r=e=>{if(!(t&&e.type===`rawMdxFallback`)&&(e.text!==void 0&&(n+=e.text),e.content))for(let t of e.content)r(t)};return r(e),n.replace(/\s+/g,``)}function ns(e){let t=[],n=e=>{if(e.type&&Jne.has(e.type)){let n=e.type===`jsxComponent`?String(e.attrs?.componentName??``):``;t.push(n?`${e.type}:${n}`:e.type)}if(e.content)for(let t of e.content)n(t)};return n(e),t.sort()}function rs(e){let t=e,n=[];for(let e of Zne){let r=es(t),i=e.canonicalize(t);es(i)!==r&&n.push(e.label),t=i}return{normalized:t,fired:n}}function Qne(e,t,n={}){let r=rs(e),i=rs(t),a=[...new Set([...r.fired,...i.fired])],o=Go(ts(r.normalized),ts(i.normalized)),s=!o&&n.rawSourceSide===`expected`&&Go(ts(r.normalized,!0),ts(i.normalized,!0));if(!o&&!s)return{equivalent:!1,level:`L1`,reason:`content-loss`,appliedDegrades:a,detail:`authored text did not survive the round-trip`};let c=ns(r.normalized),l=ns(i.normalized);if(es(c)!==es(l))return{equivalent:!1,level:`L1`,reason:`structural-shatter`,appliedDegrades:a,detail:`container multiset diverged: [${c.join(`, `)}] vs [${l.join(`, `)}]`};let u=Zo(r.normalized,n.ignoreAttrs),d=Zo(i.normalized,n.ignoreAttrs);return es(u)===es(d)?{equivalent:!0,level:a.length>0?`L2`:`L1`,appliedDegrades:a}:{equivalent:!1,level:`L2`,reason:`structural-divergence`,appliedDegrades:a,detail:is(u,d)}}function is(e,t,n=`doc`){let r=e,i=t;if(!r||!i)return`${n}: node presence differs`;if(r.type!==i.type)return`${n}: type ${String(r.type)} vs ${String(i.type)}`;let a=r.content??[],o=i.content??[];if(a.length!==o.length)return`${n}(${String(r.type)}): child count ${a.length} vs ${o.length}`;for(let e=0;e<a.length;e++)if(es(a[e])!==es(o[e]))return is(a[e],o[e],`${n}>${String(r.type)}[${e}]`);return`${n}(${String(r.type)}): attrs or marks differ`}function $ne(e,t,n){return!Qne(e,t,{ignoreAttrs:n}).equivalent}const ere=new Set([`src`,`href`,`size`]),tre=new Set([`WikiEmbedImage`,`WikiEmbedVideo`,`WikiEmbedAudio`,`WikiEmbedFile`]);function as(e){if(Array.isArray(e))return e.map(e=>as(e));if(e&&typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))ere.has(n)||(t[n]=as(r));return t}return e}function ss(e){return e.type===`jsxComponent`&&typeof e.attrs?.componentName==`string`&&tre.has(e.attrs.componentName)?as(e):e.content?{...e,content:e.content.map(ss)}:e}function cs(e){if(Array.isArray(e))return e.map(e=>cs(e));if(e&&typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))n!==`position`&&(t[n]=cs(r));return t}return e}function ls(e){if(e.type===`jsxComponent`)return e;if(e.content)for(let t of e.content){let e=ls(t);if(e)return e}}function nre(e){let t=e.cacheLimit??2048,n=new Map,r=r=>{let i=n.get(r);if(i!==void 0)return i;let a=ls(e.parse(r)),o=a?ss(cs(a)):null;if(n.size>=t){let e=n.keys().next().value;e!==void 0&&n.delete(e)}return n.set(r,o),o};return{isDiverged(e){if(e.type!==`jsxComponent`||!e.attrs||e.attrs.kind===`expression`)return!1;let t=e.attrs.sourceRaw;if(typeof t!=`string`||t.length===0)return!1;let n=r(t);return n?$ne(n,ss(cs(e))):!1}}}const us=`state/bug-reports`,rre=yo({at:F(),transport:F(),outcome:F(),reference:F().optional(),error:F().optional(),errorCode:F().optional()}),ire=yo({reason:F(),at:F(),errorCode:F().optional()});yo({version:I().int().catch(1),id:F(),createdAt:F(),bundleLevel:F(),zipBytes:I().int().nonnegative().catch(0),zipDeleted:L().optional(),state:F(),systemWide:L().optional(),projectSlug:F().nullable().optional(),reference:F().optional(),lastError:ire.optional(),attempts:z(rre).optional(),note:F().optional()}),yo({version:I().int().catch(1),id:F().optional(),sentAt:F().optional(),reference:F().optional()});const ds=new Map([[32,` `],[9,` `],[160,`\xA0`]]);function fs(e){let t=/^&#(x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);$/.exec(e);if(!t)return null;let n=t[1],r=n[0]===`x`||n[0]===`X`,i=Number.parseInt(r?n.slice(1):n,r?16:10);return Number.isNaN(i)?null:i}function ps(e){let t=fs(e);return t!==null&&ds.has(t)}function are(e){let t=fs(e);return t===null?null:ds.get(t)??null}const ms=/&#(?:x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);/g;function hs(e){ms.lastIndex=0;let t=e.match(ms);if(t===null||t.join(``)!==e)return null;let n=``;for(let e of t){let t=are(e);if(t===null)return null;n+=t}return n}const ore=[`off`,`follow`,`full`],gs=`pull`,_s=[`off`,`follow`,`full`,gs],sre=[`follow`,`full`,gs],vs=3600,cre=new Set(Object.keys({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`})),lre=new Set([`md`,`mdx`,`mmd`,`mermaid`]);new Set([...cre,`txt`,`text`,`csv`,`tsv`,`log`,`toml`,`html`,`htm`,`svg`,`vue`,`svelte`,`astro`,`lock`].filter(e=>!lre.has(e)));const ys=[`image/jpeg`,`image/png`,`image/gif`,`image/webp`,`image/svg+xml`],ure=[`video/mp4`,`video/webm`,`video/ogg`],dre=[`audio/mpeg`,`audio/wav`,`audio/ogg`],fre=[`application/pdf`],bs=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`avif`,`svg`]),xs=new Set([`mp4`,`webm`,`mov`,`m4v`,`mkv`]),pre=new Set([`pdf`]),Ss=new Set([`mp3`,`wav`,`ogg`,`m4a`,`flac`,`aac`,`opus`]),Cs=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(`.`)),ws=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(`.`)),mre=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(`.`)),Ts=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(`.`)),Es=[`png`,`jpg`,`jpeg`,`gif`,`webp`,`avif`],Ds=[`mp4`,`webm`,`mov`,`m4v`],Os=[`mp3`,`wav`,`ogg`,`m4a`,`flac`,`aac`,`opus`],ks=[`pdf`],As=[`json`,`toml`,`lock`];function js(e,t,n){for(let r of t)if(!n.has(r))throw Error(`${e}: ${r} is not present in canonical upload constants`)}js(`SIDEBAR_IMAGE_ASSET_EXTENSIONS`,Es,bs),js(`SIDEBAR_VIDEO_ASSET_EXTENSIONS`,Ds,xs),js(`SIDEBAR_AUDIO_ASSET_EXTENSIONS`,Os,Ss),js(`SIDEBAR_PDF_ASSET_EXTENSIONS`,ks,pre),js(`FILE_ATTACHMENT_EXTENSIONS`,[...Cs],Ts),js(`WIKI_EMBED_EXTENSIONS`,[...Ts],ws),new Set(Es),new Set(Ds),new Set(Os),new Set(ks),new Set(As),js(`SIDEBAR_RENDERABLE_ASSET_EXTENSIONS`,[...new Set([...Es,...Ds,...Os,...ks,...As])],mre);const hre=new Set([`base`,`canvas`]),gre=new Set([`mmd`,`mermaid`]),_re=new Set([`excalidraw`]),Ms=new Set([...ws,...hre,...gre,..._re]),Ns=[`en`,`zh-Hans`,`zh-Hant`,`hi`,`es`,`ar`,`fr`,`bn`,`pt-BR`,`id`,`ur`,`ko`],vre=new Set([`ar`,`ur`]),yre=Ns.filter(e=>!vre.has(e)),bre=[`markdownlint`,`frontmatter`,`okf`],xre=[`missing`,`invalid`];[...bre];const Sre=[`off`,`warning`,`error`],Ps=`warning`,Cre=[`error`,`warning`],Fs=[`base00`,`base01`,`base02`,`base03`,`base04`,`base05`,`base06`,`base07`,`base08`,`base09`,`base0A`,`base0B`,`base0C`,`base0D`,`base0E`,`base0F`],wre={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`},Tre=/\P{White_Space}/u;function Ere(e){return Tre.test(e)}function Dre(e){let t=e.palette;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-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,...kre(t)}}const Is={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`},Ore=Object.keys(Is);function kre(e){let t={};for(let n of Ore)t[`ansi-${Are(n)}`]=e[Is[n]];return t}function Are(e){return e.replace(/([a-z])([A-Z])/g,`$1-$2`).toLowerCase()}const jre={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`}},Mre={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`}},Nre={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`}},Pre={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`}},Fre={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`}},Ire={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 Ls(e,t,n){return{id:e,label:t,kind:n.variant,scheme:n,toTokens:()=>Dre(n)}}function Rs(e,t){return{id:e,label:t,kind:`system`}}const zs=[Rs(`default`,`Default`),Ls(`dracula`,`Dracula`,jre),Ls(`catppuccin-frappe`,`Catppuccin Frappé`,Mre),Ls(`catppuccin-latte`,`Catppuccin Latte`,Nre),Ls(`monokai`,`Monokai`,Pre),Ls(`gruvbox`,`Gruvbox`,Fre),Ls(`solarized`,`Solarized`,Ire),Rs(`custom`,`Custom`)],Lre=zs.map(e=>e.id),Bs=/^[a-z0-9-]{1,32}$/;new Map(zs.map(e=>[e.id,e]));const Vs=Symbol.for(`@inkeep/open-knowledge/field-registry`),Hs=globalThis;Hs[Vs]===void 0&&(Hs[Vs]=ti());const Us=Hs[Vs];function Rre(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=zre(t)?Us.get(t):void 0;if(e!==void 0)return e;let n=t._zod?.def?.innerType;if(n===void 0)return;t=n}}function zre(e){return typeof e==`object`&&!!e&&`_zod`in e&&`parse`in e}function Bre(){return Object.fromEntries(Fs.map(e=>[e,F().register(Us,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Custom theme: base16 ${e} — ${wre[e]}, as a #rrggbb hex string.`}).optional()]))}function Ws(){return Lre.filter(e=>e!==`default`&&e!==`custom`).map(e=>`'${e}'`).join(`, `)}const Gs=Object.freeze([`authorization`,`auth.token`,`auth.bearer`,`cookie`,`set-cookie`,`x-api-key`,`password`,`secret`]),Ks=52428800,qs=26214400,Js=12582912,Ys=`https://api.openai.com/v1`,Xs=`text-embedding-3-small`,Zs=Object.freeze([`127.0.0.1`]),Qs=/^[1-9]\d*(s|m|h)$/,$s=/^https?:\/\//;function ec(e){let t=e.trim();return t===``?`./`:t}function tc(e){let t=ec(e);return t.includes(`\0`)||t.includes(`\\`)?!1:t===`/`?!0:!(t.startsWith(`/`)||/^[A-Za-z]:/.test(t)||t.split(`/`).some(e=>e===`..`))}const nc=yo({content:yo({dir:F().register(Us,{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:F().register(Us,{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(tc,{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:yo({theme:H([`light`,`dark`,`system`]).register(Us,{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:H([`system`,...Ns]).register(Us,{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:F().register(Us,{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 ${Ws()}, 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(Bs,{message:`Theme id must be lowercase letters, digits, and hyphens, 1–32 characters (e.g. 'dracula', 'custom', or a saved theme id).`}).optional(),colorThemeDark:F().register(Us,{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 ${Ws()}, 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(Bs,{message:`Theme id must be lowercase letters, digits, and hyphens, 1–32 characters (e.g. 'dracula', 'custom', or a saved theme id).`}).optional(),colorTheme:F().register(Us,{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(Bs,{message:`Theme id must be lowercase letters, digits, and hyphens, 1–32 characters (e.g. 'dracula', 'custom', or a saved theme id).`}).optional(),colorThemeEnabled:L().register(Us,{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:yo({name:F().register(Us,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Custom theme: the scheme's display name.`}).optional(),author:F().register(Us,{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:H([`dark`,`light`]).register(Us,{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(),...Bre()}).optional(),preview:yo({autoOpen:L().register(Us,{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:yo({showHiddenFiles:L().register(Us,{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:L().register(Us,{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:L().register(Us,{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:L().register(Us,{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:L().register(Us,{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:z(F()).register(Us,{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:z(F()).register(Us,{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:yo({wordWrap:L().register(Us,{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:L().register(Us,{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:yo({autoApproveOkTools:L().register(Us,{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:yo({mode:H(_s).register(Us,{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:L().register(Us,{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:H(sre).register(Us,{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:I().int().min(30).max(vs).register(Us,{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:I().int().min(30).max(vs).register(Us,{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:xo([L(),H(_s)]).register(Us,{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:yo({enabled:L().register(Us,{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:F().register(Us,{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:yo({enabled:L().register(Us,{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:yo({localSink:yo({enabled:L().register(Us,{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:yo({maxBytes:I().register(Us,{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(Ks)}).default({maxBytes:Ks}),logs:yo({maxBytes:I().register(Us,{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(qs)}).default({maxBytes:qs}),attributeDenylist:z(F()).register(Us,{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([...Gs])}).default({enabled:!0,spans:{maxBytes:Ks},logs:{maxBytes:qs},attributeDenylist:[...Gs]}),skillInstallReports:yo({enabled:L().register(Us,{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:Ks},logs:{maxBytes:qs},attributeDenylist:[...Gs]},skillInstallReports:{enabled:!0}}),lossCapture:yo({enabled:L().register(Us,{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:I().register(Us,{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(Js)}).default({enabled:!0,maxBytes:Js}),bridge:yo({backgroundThrottle:yo({enabled:L().register(Us,{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:yo({enabled:L().register(Us,{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:yo({enabled:L().register(Us,{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:yo({enabled:L().register(Us,{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:yo({enabled:L().register(Us,{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:yo({enabled:L().register(Us,{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:yo({semantic:yo({enabled:L().register(Us,{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:F().register(Us,{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(Ys),model:F().register(Us,{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(Xs),dimensions:I().int().positive().register(Us,{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:I().min(0).max(1).register(Us,{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()}).default({enabled:!1,baseUrl:Ys,model:Xs})}).default({semantic:{enabled:!1,baseUrl:Ys,model:Xs}}),contentRules:yo({markdownlint:B({enabled:L().register(Us,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Whether the markdownlint plugin (body rules) contributes diagnostics.`}).default(!1)}).default({enabled:!1}),frontmatter:B({enabled:L().register(Us,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Whether the frontmatter plugin (JSON-Schema validation of document frontmatter) contributes diagnostics.`}).default(!1),schemas:z(B({appliesTo:xo([F(),z(F())]).optional(),file:F(),enabled:L().optional()})).register(Us,{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:B({enabled:L().register(Us,{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:V(F(),L()).register(Us,{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:B({index:L().register(Us,{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:yo({links:H(Sre).register(Us,{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(Ps),fileTreeIndicators:L().register(Us,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Whether the file tree tints and badges files that have validation problems.`}).default(!0)}).default({links:Ps,fileTreeIndicators:!0}),linkPreviews:yo({enabled:L().register(Us,{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:yo({port:I().int().min(1).max(65535).register(Us,{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:z(F().min(1)).min(1).register(Us,{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([...Zs]),externalUrl:mo({protocol:/^https?$/}).regex($s).register(Us,{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:L().register(Us,{scope:`project-local`,agentSettable:!1,reload:`boot`,defaultScope:`project-local`,description:`Exposure consent interlock. Once the unified server boot lands, a non-loopback server.bind or a server.externalUrl without allowExternal: true will be refused at boot with a one-line fix. Default off. Per-machine (project-local) — consent never travels via git, clone, or share; containers consent via the environment instead.`}).default(!1),openBrowser:L().register(Us,{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:xo([U(`off`),F().regex(Qs)]).register(Us,{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:[...Zs],allowExternal:!1})});var rc,ic=n((()=>{rc=`1.9.1`}));function ac(e){let t=new Set([e]),n=new Set,r=e.match(oc);if(!r)return()=>!1;let i={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};if(i.prerelease!=null)return function(t){return t===e};function a(e){return n.add(e),!1}function o(e){return t.add(e),!0}return function(e){if(t.has(e))return!0;if(n.has(e))return!1;let r=e.match(oc);if(!r)return a(e);let s={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};return s.prerelease!=null||i.major!==s.major?a(e):i.major===0?i.minor===s.minor&&i.patch<=s.patch?o(e):a(e):i.minor<=s.minor?o(e):a(e)}}var oc,sc,cc=n((()=>{ic(),oc=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/,sc=ac(rc)}));function lc(e,t,n,r=!1){let i=mc[pc]=mc[pc]??{version:rc};if(!r&&i[e]){let t=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`);return n.error(t.stack||t.message),!1}if(i.version!==`1.9.1`){let t=Error(`@opentelemetry/api: Registration of version v${i.version} for ${e} does not match previously registered API v${rc}`);return n.error(t.stack||t.message),!1}return i[e]=t,n.debug(`@opentelemetry/api: Registered a global for ${e} v${rc}.`),!0}function uc(e){let t=mc[pc]?.version;if(!(!t||!sc(t)))return mc[pc]?.[e]}function dc(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${rc}.`);let n=mc[pc];n&&delete n[e]}var fc,pc,mc,hc=n((()=>{ic(),cc(),fc=rc.split(`.`)[0],pc=Symbol.for(`opentelemetry.js.api.${fc}`),mc=typeof globalThis==`object`?globalThis:typeof self==`object`?self:typeof window==`object`?window:typeof global==`object`?global:{}}));function gc(e,t,n){let r=uc(`diag`);if(r)return r[e](t,...n)}var _c,vc=n((()=>{hc(),_c=class{constructor(e){this._namespace=e.namespace||`DiagComponentLogger`}debug(...e){return gc(`debug`,this._namespace,e)}error(...e){return gc(`error`,this._namespace,e)}info(...e){return gc(`info`,this._namespace,e)}warn(...e){return gc(`warn`,this._namespace,e)}verbose(...e){return gc(`verbose`,this._namespace,e)}}})),yc,bc=n((()=>{(function(e){e[e.NONE=0]=`NONE`,e[e.ERROR=30]=`ERROR`,e[e.WARN=50]=`WARN`,e[e.INFO=60]=`INFO`,e[e.DEBUG=70]=`DEBUG`,e[e.VERBOSE=80]=`VERBOSE`,e[e.ALL=9999]=`ALL`})(yc||={})}));function xc(e,t){e<yc.NONE?e=yc.NONE:e>yc.ALL&&(e=yc.ALL),t||={};function n(n,r){let i=t[n];return typeof i==`function`&&e>=r?i.bind(t):function(){}}return{error:n(`error`,yc.ERROR),warn:n(`warn`,yc.WARN),info:n(`info`,yc.INFO),debug:n(`debug`,yc.DEBUG),verbose:n(`verbose`,yc.VERBOSE)}}var Sc=n((()=>{bc()})),Cc,wc,Tc=n((()=>{vc(),Sc(),bc(),hc(),Cc=`diag`,wc=class e{static instance(){return this._instance||=new e,this._instance}constructor(){function e(e){return function(...t){let n=uc(`diag`);if(n)return n[e](...t)}}let t=this;t.setLogger=(e,n={logLevel:yc.INFO})=>{if(e===t){let e=Error(`Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation`);return t.error(e.stack??e.message),!1}typeof n==`number`&&(n={logLevel:n});let r=uc(`diag`),i=xc(n.logLevel??yc.INFO,e);if(r&&!n.suppressOverrideMessage){let e=Error().stack??`<failed to generate stacktrace>`;r.warn(`Current logger will be overwritten from ${e}`),i.warn(`Current logger will overwrite one already registered from ${e}`)}return lc(`diag`,i,t,!0)},t.disable=()=>{dc(Cc,t)},t.createComponentLogger=e=>new _c(e),t.verbose=e(`verbose`),t.debug=e(`debug`),t.info=e(`info`),t.warn=e(`warn`),t.error=e(`error`)}}}));function Ec(e){return Symbol.for(e)}var Dc,Oc,kc=n((()=>{Dc=class e{constructor(t){let n=this;n._currentContext=t?new Map(t):new Map,n.getValue=e=>n._currentContext.get(e),n.setValue=(t,r)=>{let i=new e(n._currentContext);return i._currentContext.set(t,r),i},n.deleteValue=t=>{let r=new e(n._currentContext);return r._currentContext.delete(t),r}}},Oc=new Dc})),Ac,jc=n((()=>{kc(),Ac=class{active(){return Oc}with(e,t,n,...r){return t.call(n,...r)}bind(e,t){return t}enable(){return this}disable(){return this}}})),Mc,Nc,Pc,Fc=n((()=>{jc(),hc(),Tc(),Mc=`context`,Nc=new Ac,Pc=class e{constructor(){}static getInstance(){return this._instance||=new e,this._instance}setGlobalContextManager(e){return lc(Mc,e,wc.instance())}active(){return this._getContextManager().active()}with(e,t,n,...r){return this._getContextManager().with(e,t,n,...r)}bind(e,t){return this._getContextManager().bind(e,t)}_getContextManager(){return uc(Mc)||Nc}disable(){this._getContextManager().disable(),dc(Mc,wc.instance())}}})),Ic,Lc=n((()=>{(function(e){e[e.NONE=0]=`NONE`,e[e.SAMPLED=1]=`SAMPLED`})(Ic||={})})),Rc,zc,Bc,Vc=n((()=>{Lc(),Rc=`0000000000000000`,zc=`00000000000000000000000000000000`,Bc={traceId:zc,spanId:Rc,traceFlags:Ic.NONE}})),Hc,Uc=n((()=>{Vc(),Hc=class{constructor(e=Bc){this._spanContext=e}spanContext(){return this._spanContext}setAttribute(e,t){return this}setAttributes(e){return this}addEvent(e,t){return this}addLink(e){return this}addLinks(e){return this}setStatus(e){return this}updateName(e){return this}end(e){}isRecording(){return!1}recordException(e,t){}}}));function Wc(e){return e.getValue(Xc)||void 0}function Gc(){return Wc(Pc.getInstance().active())}function Kc(e,t){return e.setValue(Xc,t)}function qc(e){return e.deleteValue(Xc)}function Jc(e,t){return Kc(e,new Hc(t))}function Yc(e){return Wc(e)?.spanContext()}var Xc,Zc=n((()=>{kc(),Uc(),Fc(),Xc=Ec(`OpenTelemetry Context Key SPAN`)}));function Qc(e,t){if(typeof e!=`string`||e.length!==t)return!1;let n=0;for(let t=0;t<e.length;t+=4)n+=(rl[e.charCodeAt(t)]|0)+(rl[e.charCodeAt(t+1)]|0)+(rl[e.charCodeAt(t+2)]|0)+(rl[e.charCodeAt(t+3)]|0);return n===t}function $c(e){return Qc(e,32)&&e!==`00000000000000000000000000000000`}function el(e){return Qc(e,16)&&e!==`0000000000000000`}function tl(e){return $c(e.traceId)&&el(e.spanId)}function nl(e){return new Hc(e)}var rl,il=n((()=>{Vc(),Uc(),rl=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1])}));function al(e){return typeof e==`object`&&!!e&&`spanId`in e&&typeof e.spanId==`string`&&`traceId`in e&&typeof e.traceId==`string`&&`traceFlags`in e&&typeof e.traceFlags==`number`}var ol,sl,cl=n((()=>{Fc(),Zc(),Uc(),il(),ol=Pc.getInstance(),sl=class{startSpan(e,t,n=ol.active()){if(t?.root)return new Hc;let r=n&&Yc(n);return al(r)&&tl(r)?new Hc(r):new Hc}startActiveSpan(e,t,n,r){let i,a,o;if(arguments.length<2)return;arguments.length===2?o=t:arguments.length===3?(i=t,o=n):(i=t,a=n,o=r);let s=a??ol.active(),c=this.startSpan(e,i,s),l=Kc(s,c);return ol.with(l,o,void 0,c)}}})),ll,ul,dl=n((()=>{cl(),ll=new sl,ul=class{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}startSpan(e,t,n){return this._getTracer().startSpan(e,t,n)}startActiveSpan(e,t,n,r){let i=this._getTracer();return Reflect.apply(i.startActiveSpan,i,arguments)}_getTracer(){if(this._delegate)return this._delegate;let e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):ll}}})),fl,pl=n((()=>{cl(),fl=class{getTracer(e,t,n){return new sl}}})),ml,hl,gl=n((()=>{dl(),pl(),ml=new fl,hl=class{getTracer(e,t,n){return this.getDelegateTracer(e,t,n)??new ul(this,e,t,n)}getDelegate(){return this._delegate??ml}setDelegate(e){this._delegate=e}getDelegateTracer(e,t,n){return this._delegate?.getTracer(e,t,n)}}})),_l,vl=n((()=>{(function(e){e[e.UNSET=0]=`UNSET`,e[e.OK=1]=`OK`,e[e.ERROR=2]=`ERROR`})(_l||={})})),yl,bl=n((()=>{Fc(),yl=Pc.getInstance()})),xl,Sl,Cl=n((()=>{hc(),gl(),il(),Zc(),Tc(),xl=`trace`,Sl=class e{constructor(){this._proxyTracerProvider=new hl,this.wrapSpanContext=nl,this.isSpanContextValid=tl,this.deleteSpan=qc,this.getSpan=Wc,this.getActiveSpan=Gc,this.getSpanContext=Yc,this.setSpan=Kc,this.setSpanContext=Jc}static getInstance(){return this._instance||=new e,this._instance}setGlobalTracerProvider(e){let t=lc(xl,this._proxyTracerProvider,wc.instance());return t&&this._proxyTracerProvider.setDelegate(e),t}getTracerProvider(){return uc(xl)||this._proxyTracerProvider}getTracer(e,t){return this.getTracerProvider().getTracer(e,t)}disable(){dc(xl,wc.instance()),this._proxyTracerProvider=new hl}}})),wl,Tl=n((()=>{Cl(),wl=Sl.getInstance()})),El=n((()=>{Tc(),kc(),bc(),dl(),gl(),vl(),Lc(),il(),Vc(),bl(),Tl()}));function Dl(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 Ol(e,t){let n=e;for(let e of t){n=Dl(n);let t=n?._zod?.def?.shape;if(!t||(n=t[String(e)],n===void 0))return}return n}function kl(e,t){let n=Ol(e,t);if(n!==void 0)return Rre(n)}const Al=new Map([[`PORT`,[`server`,`port`]],[`OK_BIND`,[`server`,`bind`]],[`OK_EXTERNAL_URL`,[`server`,`externalUrl`]],[`OK_ALLOW_EXTERNAL`,[`server`,`allowExternal`]],[`OK_OPEN_BROWSER`,[`server`,`openBrowser`]],[`OK_IDLE_SHUTDOWN`,[`server`,`idleShutdown`]]]);function jl(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1_$2`).toUpperCase()}function Ml(e){return`OK_${(e[0]===`server`?e.slice(1):e).map(jl).join(`_`)}`}function Nl(e,t){if(t.length===0)return e.contents??null;let n=e.getIn(t,!0);if((0,on.isNode)(n))return n;for(let n=t.length-1;n>=0;n--){let r=e.getIn(t.slice(0,n),!0);if((0,on.isNode)(r))return r}return e.contents??null}function Pl(e,t){let n=1,r=1,i=Math.min(t,e.length);for(let t=0;t<i;t++)e.charCodeAt(t)===10?(n++,r=1):r++;return{line:n,column:r}}function Fl(e,t,n,r,i){let a=e.split(`
184
+ 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 ua(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:pa(t,`input`,e.processors),output:pa(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function da(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 da(r.element,n);if(r.type===`set`)return da(r.valueType,n);if(r.type===`lazy`)return da(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 da(r.innerType,n);if(r.type===`intersection`)return da(r.left,n)||da(r.right,n);if(r.type===`record`||r.type===`map`)return da(r.keyType,n)||da(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:da(r.in,n)||da(r.out,n);if(r.type===`object`){for(let e in r.shape)if(da(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(da(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(da(e,n))return!0;return!!(r.rest&&da(r.rest,n))}return!1}const fa=(e,t={})=>n=>{let r=sa({...n,processors:t});return ca(e,r),la(r,e),ua(r,e)},pa=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=sa({...i??{},target:a,io:t,processors:n});return ca(e,o),la(o,e),ua(o,e)},ma={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},ha=(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=ma[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}))])}},ga=(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)},_a=(e,t,n,r)=>{n.type=`boolean`},va=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},ya=(e,t,n,r)=>{n.not={}},ba=(e,t,n,r)=>{let i=e._zod.def,a=Cn(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},xa=(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},Sa=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},Ca=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},wa=(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=ca(a.element,t,{...r,path:[...r.path,`items`]})},Ta=(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]=ca(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=ca(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Ea=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>ca(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Da=(e,t,n,r)=>{let i=e._zod.def,a=ca(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=ca(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]]},Oa=(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=ca(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=ca(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=ca(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)}},ka=(e,t,n,r)=>{let i=e._zod.def,a=ca(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`}]},Aa=(e,t,n,r)=>{let i=e._zod.def;ca(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},ja=(e,t,n,r)=>{let i=e._zod.def;ca(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Ma=(e,t,n,r)=>{let i=e._zod.def;ca(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)))},Na=(e,t,n,r)=>{let i=e._zod.def;ca(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},Pa=(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;ca(o,t,r);let s=t.seen.get(e);s.ref=o},Fa=(e,t,n,r)=>{let i=e._zod.def;ca(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Ia=(e,t,n,r)=>{let i=e._zod.def;ca(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},La=(e,t,n,r)=>{let i=e._zod.innerType;ca(i,t,r);let a=t.seen.get(e);a.ref=i},Ra=P(`ZodISODateTime`,(e,t)=>{yte.init(e,t),lo.init(e,t)});function za(e){return Ei(Ra,e)}const Ba=P(`ZodISODate`,(e,t)=>{bte.init(e,t),lo.init(e,t)});function Va(e){return Di(Ba,e)}const Ha=P(`ZodISOTime`,(e,t)=>{xte.init(e,t),lo.init(e,t)});function Ua(e){return Oi(Ha,e)}const Wa=P(`ZodISODuration`,(e,t)=>{Ste.init(e,t),lo.init(e,t)});function Ga(e){return ki(Wa,e)}const Ka=P(`ZodError`,(e,t)=>{Jn.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Zn(e,t)},flatten:{value:t=>Xn(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,wn,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,wn,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),qa=Qn(Ka),Ja=$n(Ka),Ya=er(Ka),Xa=nr(Ka),Za=ir(Ka),Qa=ar(Ka),$a=or(Ka),eo=sr(Ka),to=cr(Ka),no=lr(Ka),ro=ur(Ka),io=dr(Ka),ao=new WeakMap;function oo(e,t,n){let r=Object.getPrototypeOf(e),i=ao.get(r);if(i||(i=new Set,ao.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})}})}}}const so=P(`ZodType`,(e,t)=>(Er.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:pa(e,`input`),output:pa(e,`output`)}}),e.toJSONSchema=fa(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,`_def`,{value:t}),e.parse=(t,n)=>qa(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Ya(e,t,n),e.parseAsync=async(t,n)=>Ja(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Xa(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Za(e,t,n),e.decode=(t,n)=>Qa(e,t,n),e.encodeAsync=async(t,n)=>$a(e,t,n),e.decodeAsync=async(t,n)=>eo(e,t,n),e.safeEncode=(t,n)=>to(e,t,n),e.safeDecode=(t,n)=>no(e,t,n),e.safeEncodeAsync=async(t,n)=>ro(e,t,n),e.safeDecodeAsync=async(t,n)=>io(e,t,n),oo(e,`ZodType`,{check(...e){let t=this.def;return this.clone(jn(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 Rn(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Bne(e,t))},superRefine(e,t){return this.check(Vne(e,t))},overwrite(e){return this.check(Xi(e))},optional(){return Oo(this)},exactOptional(){return Dne(this)},nullable(){return ko(this)},nullish(){return Oo(ko(this))},nonoptional(e){return Nne(this,e)},array(){return z(this)},or(e){return xo([this,e])},and(e){return Co(this,e)},transform(e){return Mo(this,Eo(e))},default(e){return Ane(this,e)},prefault(e){return Mne(this,e)},catch(e){return Fne(this,e)},pipe(e){return Mo(this,e)},readonly(){return Rne(this)},describe(e){let t=this.clone();return ni.add(t,{description:e}),t},meta(...e){if(e.length===0)return ni.get(this);let t=this.clone();return ni.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 ni.get(e)?.description},configurable:!0}),e)),co=P(`_ZodString`,(e,t)=>{Dr.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ha(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,oo(e,`_ZodString`,{regex(...e){return this.check(Wi(...e))},includes(...e){return this.check(qi(...e))},startsWith(...e){return this.check(Ji(...e))},endsWith(...e){return this.check(Yi(...e))},min(...e){return this.check(Hi(...e))},max(...e){return this.check(Vi(...e))},length(...e){return this.check(Ui(...e))},nonempty(...e){return this.check(Hi(1,...e))},lowercase(e){return this.check(Gi(e))},uppercase(e){return this.check(Ki(e))},trim(){return this.check(Qi())},normalize(...e){return this.check(Zi(...e))},toLowerCase(){return this.check($i())},toUpperCase(){return this.check(ea())},slugify(){return this.check(ta())}})}),Zte=P(`ZodString`,(e,t)=>{Dr.init(e,t),co.init(e,t),e.email=t=>e.check(ii(Qte,t)),e.url=t=>e.check(ui(po,t)),e.jwt=t=>e.check(Ti(mne,t)),e.emoji=t=>e.check(di(ene,t)),e.guid=t=>e.check(ai(uo,t)),e.uuid=t=>e.check(oi(fo,t)),e.uuidv4=t=>e.check(si(fo,t)),e.uuidv6=t=>e.check(ci(fo,t)),e.uuidv7=t=>e.check(li(fo,t)),e.nanoid=t=>e.check(fi(tne,t)),e.guid=t=>e.check(ai(uo,t)),e.cuid=t=>e.check(pi(nne,t)),e.cuid2=t=>e.check(mi(rne,t)),e.ulid=t=>e.check(hi(ine,t)),e.base64=t=>e.check(Si(dne,t)),e.base64url=t=>e.check(Ci(fne,t)),e.xid=t=>e.check(gi(ane,t)),e.ksuid=t=>e.check(_i(one,t)),e.ipv4=t=>e.check(vi(sne,t)),e.ipv6=t=>e.check(yi(cne,t)),e.cidrv4=t=>e.check(bi(lne,t)),e.cidrv6=t=>e.check(xi(une,t)),e.e164=t=>e.check(wi(pne,t)),e.datetime=t=>e.check(za(t)),e.date=t=>e.check(Va(t)),e.time=t=>e.check(Ua(t)),e.duration=t=>e.check(Ga(t))});function F(e){return ri(Zte,e)}const lo=P(`ZodStringFormat`,(e,t)=>{Or.init(e,t),co.init(e,t)}),Qte=P(`ZodEmail`,(e,t)=>{ute.init(e,t),lo.init(e,t)}),uo=P(`ZodGUID`,(e,t)=>{cte.init(e,t),lo.init(e,t)}),fo=P(`ZodUUID`,(e,t)=>{lte.init(e,t),lo.init(e,t)});function $te(e){return oi(fo,e)}const po=P(`ZodURL`,(e,t)=>{dte.init(e,t),lo.init(e,t)});function mo(e){return ui(po,e)}const ene=P(`ZodEmoji`,(e,t)=>{fte.init(e,t),lo.init(e,t)}),tne=P(`ZodNanoID`,(e,t)=>{pte.init(e,t),lo.init(e,t)}),nne=P(`ZodCUID`,(e,t)=>{mte.init(e,t),lo.init(e,t)}),rne=P(`ZodCUID2`,(e,t)=>{hte.init(e,t),lo.init(e,t)}),ine=P(`ZodULID`,(e,t)=>{gte.init(e,t),lo.init(e,t)}),ane=P(`ZodXID`,(e,t)=>{_te.init(e,t),lo.init(e,t)}),one=P(`ZodKSUID`,(e,t)=>{vte.init(e,t),lo.init(e,t)}),sne=P(`ZodIPv4`,(e,t)=>{Cte.init(e,t),lo.init(e,t)}),cne=P(`ZodIPv6`,(e,t)=>{wte.init(e,t),lo.init(e,t)}),lne=P(`ZodCIDRv4`,(e,t)=>{Tte.init(e,t),lo.init(e,t)}),une=P(`ZodCIDRv6`,(e,t)=>{Ete.init(e,t),lo.init(e,t)}),dne=P(`ZodBase64`,(e,t)=>{Dte.init(e,t),lo.init(e,t)}),fne=P(`ZodBase64URL`,(e,t)=>{kte.init(e,t),lo.init(e,t)}),pne=P(`ZodE164`,(e,t)=>{Ate.init(e,t),lo.init(e,t)}),mne=P(`ZodJWT`,(e,t)=>{Mte.init(e,t),lo.init(e,t)}),ho=P(`ZodNumber`,(e,t)=>{Ar.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ga(e,t,n,r),oo(e,`ZodNumber`,{gt(e,t){return this.check(Ri(e,t))},gte(e,t){return this.check(zi(e,t))},min(e,t){return this.check(zi(e,t))},lt(e,t){return this.check(Ii(e,t))},lte(e,t){return this.check(Li(e,t))},max(e,t){return this.check(Li(e,t))},int(e){return this.check(go(e))},safe(e){return this.check(go(e))},positive(e){return this.check(Ri(0,e))},nonnegative(e){return this.check(zi(0,e))},negative(e){return this.check(Ii(0,e))},nonpositive(e){return this.check(Li(0,e))},multipleOf(e,t){return this.check(Bi(e,t))},step(e,t){return this.check(Bi(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 I(e){return Ai(ho,e)}const hne=P(`ZodNumberFormat`,(e,t)=>{Nte.init(e,t),ho.init(e,t)});function go(e){return ji(hne,e)}const gne=P(`ZodBoolean`,(e,t)=>{Pte.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_a(e,t,n,r)});function L(e){return Mi(gne,e)}const _ne=P(`ZodNull`,(e,t)=>{Fte.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>va(e,t,n,r)});function _o(e){return Ni(_ne,e)}const vne=P(`ZodUnknown`,(e,t)=>{Ite.init(e,t),so.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function R(){return Pi(vne)}const yne=P(`ZodNever`,(e,t)=>{Lte.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ya(e,t,n,r)});function bne(e){return Fi(yne,e)}const xne=P(`ZodArray`,(e,t)=>{Rte.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wa(e,t,n,r),e.element=t.element,oo(e,`ZodArray`,{min(e,t){return this.check(Hi(e,t))},nonempty(e){return this.check(Hi(1,e))},max(e,t){return this.check(Vi(e,t))},length(e,t){return this.check(Ui(e,t))},unwrap(){return this.element}})});function z(e,t){return na(xne,e,t)}const vo=P(`ZodObject`,(e,t)=>{Bte.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ta(e,t,n,r),kn(e,`shape`,()=>t.shape),oo(e,`ZodObject`,{keyof(){return H(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:R()})},loose(){return this.clone({...this._zod.def,catchall:R()})},strict(){return this.clone({...this._zod.def,catchall:bne()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return xee(this,e)},safeExtend(e){return See(this,e)},merge(e){return Cee(this,e)},pick(e){return yee(this,e)},omit(e){return bee(this,e)},partial(...e){return wee(Do,this,e[0])},required(...e){return Tee(Ao,this,e[0])}})});function B(e,t){return new vo({type:`object`,shape:e??{},...zn(t)})}function yo(e,t){return new vo({type:`object`,shape:e,catchall:R(),...zn(t)})}const bo=P(`ZodUnion`,(e,t)=>{Ir.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ea(e,t,n,r),e.options=t.options});function xo(e,t){return new bo({type:`union`,options:e,...zn(t)})}const Sne=P(`ZodDiscriminatedUnion`,(e,t)=>{bo.init(e,t),Vte.init(e,t)});function So(e,t,n){return new Sne({type:`union`,options:t,discriminator:e,...zn(n)})}const Cne=P(`ZodIntersection`,(e,t)=>{Hte.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Da(e,t,n,r)});function Co(e,t){return new Cne({type:`intersection`,left:e,right:t})}const wo=P(`ZodRecord`,(e,t)=>{Ute.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Oa(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function V(e,t,n){return!t||!t._zod?new wo({type:`record`,keyType:F(),valueType:e,...zn(t)}):new wo({type:`record`,keyType:e,valueType:t,...zn(n)})}const To=P(`ZodEnum`,(e,t)=>{Wte.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ba(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 To({...t,checks:[],...zn(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 To({...t,checks:[],...zn(r),entries:i})}});function H(e,t){return new To({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...zn(t)})}const wne=P(`ZodLiteral`,(e,t)=>{Gte.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xa(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 U(e,t){return new wne({type:`literal`,values:Array.isArray(e)?e:[e],...zn(t)})}const Tne=P(`ZodTransform`,(e,t)=>{Kte.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ca(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new bn(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Kn(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(Kn(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 Eo(e){return new Tne({type:`transform`,transform:e})}const Do=P(`ZodOptional`,(e,t)=>{Br.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ia(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Oo(e){return new Do({type:`optional`,innerType:e})}const Ene=P(`ZodExactOptional`,(e,t)=>{qte.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ia(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Dne(e){return new Ene({type:`optional`,innerType:e})}const One=P(`ZodNullable`,(e,t)=>{Jte.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ka(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ko(e){return new One({type:`nullable`,innerType:e})}const kne=P(`ZodDefault`,(e,t)=>{Yte.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ja(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Ane(e,t){return new kne({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():In(t)}})}const jne=P(`ZodPrefault`,(e,t)=>{Xte.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ma(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Mne(e,t){return new jne({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():In(t)}})}const Ao=P(`ZodNonOptional`,(e,t)=>{Hr.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Aa(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Nne(e,t){return new Ao({type:`nonoptional`,innerType:e,...zn(t)})}const Pne=P(`ZodCatch`,(e,t)=>{Wr.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Na(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Fne(e,t){return new Pne({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}const jo=P(`ZodPipe`,(e,t)=>{Gr.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Pa(e,t,n,r),e.in=t.in,e.out=t.out});function Mo(e,t){return new jo({type:`pipe`,in:e,out:t})}const Ine=P(`ZodPreprocess`,(e,t)=>{jo.init(e,t),qr.init(e,t)}),Lne=P(`ZodReadonly`,(e,t)=>{Jr.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fa(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Rne(e){return new Lne({type:`readonly`,innerType:e})}const zne=P(`ZodLazy`,(e,t)=>{Xr.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>La(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function No(e){return new zne({type:`lazy`,getter:e})}const Po=P(`ZodCustom`,(e,t)=>{Zr.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Sa(e,t,n,r)});function Fo(e,t){return ra(Po,e??(()=>!0),t)}function Bne(e,t={}){return ia(Po,e,t)}function Vne(e,t){return aa(e,t)}function Io(e,t){return new Ine({type:`pipe`,in:Eo(e),out:t})}const Hne=B({path:z(xo([F(),I()])),message:F(),issueCode:F()});So(`code`,[B({code:U(`SCHEMA_INVALID`),issues:z(Hne)}),B({code:U(`WRITE_ERROR`),detail:F()})]);const Lo=[`text`,`number`,`boolean`,`date`,`list`,`object`];H(Lo);const Une=xo([F(),I(),L()]),Ro=No(()=>xo([Une.transform(e=>String(e)),V(F(),zo),z(Ro)])),zo=No(()=>xo([F(),I(),L(),z(Ro),V(F(),zo)]));function Bo(e){if(Array.isArray(e)){let t=[];for(let n of e)n!==null&&t.push(Bo(n));return t}if(typeof e==`object`&&e){let t={};for(let[n,r]of Object.entries(e))t[n]=r===null?``:Bo(r);return t}return e}Io(Bo,V(F(),zo)),V(F(),xo([zo,_o()]));const Vo=/^---[ \t]*\r?\n([\s\S]*?\r?\n)?---[ \t]*(\r?\n|$)/;function Wne(e){let t=e.match(Vo);return t?{frontmatter:t[0],body:e.slice(t[0].length)}:{frontmatter:``,body:e}}function Gne(e){if(e===``)return``;let t=e.match(Vo);return t?(t[1]??``).replace(/\r?\n$/,``):e}Object.freeze({source:`local`,skipStoreHooks:!1,context:Object.freeze({origin:`form-write`})});function Ho(e,t){return e>=(t===`leading`?2:1)?e:0}function Uo(e,t){let n={line:e,column:1,offset:t};return{type:`paragraph`,children:[],position:{start:n,end:{...n}}}}function Wo(e,t){let n=e.children,r=n.length===0||t.leading===void 0?0:Ho(t.leading.length,`leading`),i=n.length===0||t.trailing===void 0?0:Ho(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(Uo(1+e,e));if(i>0&&typeof a?.offset==`number`&&typeof a.line==`number`)for(let e=0;e<i;e++)s.push(Uo(a.line+1+e,a.offset+1+e));if(o.length===0&&s.length===0||(e.children=[...o,...n,...s],o.length>0&&delete t.leading,s.length>0&&delete t.trailing,t.bom!==void 0||t.leading!==void 0||t.trailing!==void 0))return t;e.data!==void 0&&delete e.data.sourceDocBoundary}const Kne=new gn.default;Kne.Match_Threshold=.5;function Go(e,t){let n=0;for(let r=0;r<t.length&&n<e.length;r++)e[n]===t[r]&&n++;return n===e.length}const qne=new Set([`sourceRaw`,`sourceDirty`,`position`]),Jne=new Set([`jsxComponent`,`table`,`tableRow`,`tableCell`,`tableHeader`,`list`,`listItem`,`blockquote`,`codeBlock`,`heading`]),Ko={type:`__br__`},Yne=/^<br\s*\/?>$/i;function qo(e){let t=Xo(e,qo);return(t.type===`tableCell`||t.type===`tableHeader`)&&t.content?{...t,content:Jo(t.content)}:t}function Jo(e){let t=[];for(let n of e){let e=Xne(n);e.length!==0&&(t.length>0&&t.push(Ko),t.push(...e))}return t}function Xne(e){return e.text!==void 0||e.type===`hardBreak`||e.type===`jsxInline`?[e]:!e.content||e.content.length===0?[]:e.content.some(e=>e.text===void 0&&e.type!==`hardBreak`&&e.type!==`jsxInline`&&!!e.content)?Jo(e.content):e.content}function Yo(e){return e.type===`hardBreak`||e.type===Ko.type||e.text!==void 0&&Yne.test(e.text.trim())?Ko:Xo(e,Yo)}const Zne=[{label:`table-cell-block-flatten`,severity:`pm-model-caused`,rationale:`GFM table cells have no block spelling; a block placed in a cell is flattened to inline on serialize, so a cell-with-blocks and a cell-with-inline describe the same persisted document.`,proofPointer:`markdown/table-cell-flatten.ts flattenCellBlocks (table-cell-flatten-dropped-block event)`,canonicalize:qo},{label:`void-hardbreak-br`,severity:`serializer-caused`,rationale:`A void hardBreak inside a table cell or heading serializes to a literal <br /> that a fresh parse keeps as text; the node form and the literal form are the same break.`,proofPointer:`markdown/void-br-promoter.ts + markdown/to-markdown-handlers.ts break handler`,canonicalize:Yo}];function Xo(e,t){return e.content?{...e,content:e.content.map(t)}:e}function Zo(e,t){let n={};e.type!==void 0&&(n.type=e.type),e.text!==void 0&&(n.text=e.text);let r=Qo(e.attrs,t);return r&&(n.attrs=r),e.marks&&e.marks.length>0&&(n.marks=[...e.marks].map(e=>({type:e.type,attrs:Qo(e.attrs,t)})).sort((e,t)=>es(e).localeCompare(es(t)))),e.content&&e.content.length>0&&(n.content=e.content.map(e=>Zo(e,t))),n}function Qo(e,t){if(!e)return null;let n={};for(let r of Object.keys(e).sort()){if(qne.has(r)||t?.(r))continue;let i=e[r];i!=null&&(n[r]=t?$o(i,t):i)}return Object.keys(n).length>0?n:null}function $o(e,t){if(Array.isArray(e))return e.map(e=>$o(e,t));if(e&&typeof e==`object`){let n={};for(let[r,i]of Object.entries(e))t(r)||(n[r]=$o(i,t));return n}return e}function es(e){return JSON.stringify(e,(e,t)=>{if(t&&typeof t==`object`&&!Array.isArray(t)){let e={};for(let n of Object.keys(t).sort())e[n]=t[n];return e}return t})}function ts(e,t=!1){let n=``,r=e=>{if(!(t&&e.type===`rawMdxFallback`)&&(e.text!==void 0&&(n+=e.text),e.content))for(let t of e.content)r(t)};return r(e),n.replace(/\s+/g,``)}function ns(e){let t=[],n=e=>{if(e.type&&Jne.has(e.type)){let n=e.type===`jsxComponent`?String(e.attrs?.componentName??``):``;t.push(n?`${e.type}:${n}`:e.type)}if(e.content)for(let t of e.content)n(t)};return n(e),t.sort()}function rs(e){let t=e,n=[];for(let e of Zne){let r=es(t),i=e.canonicalize(t);es(i)!==r&&n.push(e.label),t=i}return{normalized:t,fired:n}}function Qne(e,t,n={}){let r=rs(e),i=rs(t),a=[...new Set([...r.fired,...i.fired])],o=Go(ts(r.normalized),ts(i.normalized)),s=!o&&n.rawSourceSide===`expected`&&Go(ts(r.normalized,!0),ts(i.normalized,!0));if(!o&&!s)return{equivalent:!1,level:`L1`,reason:`content-loss`,appliedDegrades:a,detail:`authored text did not survive the round-trip`};let c=ns(r.normalized),l=ns(i.normalized);if(es(c)!==es(l))return{equivalent:!1,level:`L1`,reason:`structural-shatter`,appliedDegrades:a,detail:`container multiset diverged: [${c.join(`, `)}] vs [${l.join(`, `)}]`};let u=Zo(r.normalized,n.ignoreAttrs),d=Zo(i.normalized,n.ignoreAttrs);return es(u)===es(d)?{equivalent:!0,level:a.length>0?`L2`:`L1`,appliedDegrades:a}:{equivalent:!1,level:`L2`,reason:`structural-divergence`,appliedDegrades:a,detail:is(u,d)}}function is(e,t,n=`doc`){let r=e,i=t;if(!r||!i)return`${n}: node presence differs`;if(r.type!==i.type)return`${n}: type ${String(r.type)} vs ${String(i.type)}`;let a=r.content??[],o=i.content??[];if(a.length!==o.length)return`${n}(${String(r.type)}): child count ${a.length} vs ${o.length}`;for(let e=0;e<a.length;e++)if(es(a[e])!==es(o[e]))return is(a[e],o[e],`${n}>${String(r.type)}[${e}]`);return`${n}(${String(r.type)}): attrs or marks differ`}function $ne(e,t,n){return!Qne(e,t,{ignoreAttrs:n}).equivalent}const ere=new Set([`src`,`href`,`size`]),tre=new Set([`WikiEmbedImage`,`WikiEmbedVideo`,`WikiEmbedAudio`,`WikiEmbedFile`]);function as(e){if(Array.isArray(e))return e.map(e=>as(e));if(e&&typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))ere.has(n)||(t[n]=as(r));return t}return e}function ss(e){return e.type===`jsxComponent`&&typeof e.attrs?.componentName==`string`&&tre.has(e.attrs.componentName)?as(e):e.content?{...e,content:e.content.map(ss)}:e}function cs(e){if(Array.isArray(e))return e.map(e=>cs(e));if(e&&typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))n!==`position`&&(t[n]=cs(r));return t}return e}function ls(e){if(e.type===`jsxComponent`)return e;if(e.content)for(let t of e.content){let e=ls(t);if(e)return e}}function nre(e){let t=e.cacheLimit??2048,n=new Map,r=r=>{let i=n.get(r);if(i!==void 0)return i;let a=ls(e.parse(r)),o=a?ss(cs(a)):null;if(n.size>=t){let e=n.keys().next().value;e!==void 0&&n.delete(e)}return n.set(r,o),o};return{isDiverged(e){if(e.type!==`jsxComponent`||!e.attrs||e.attrs.kind===`expression`)return!1;let t=e.attrs.sourceRaw;if(typeof t!=`string`||t.length===0)return!1;let n=r(t);return n?$ne(n,ss(cs(e))):!1}}}const us=`state/bug-reports`,rre=yo({at:F(),transport:F(),outcome:F(),reference:F().optional(),error:F().optional(),errorCode:F().optional()}),ire=yo({reason:F(),at:F(),errorCode:F().optional()});yo({version:I().int().catch(1),id:F(),createdAt:F(),bundleLevel:F(),zipBytes:I().int().nonnegative().catch(0),zipDeleted:L().optional(),state:F(),systemWide:L().optional(),projectSlug:F().nullable().optional(),reference:F().optional(),lastError:ire.optional(),attempts:z(rre).optional(),note:F().optional()}),yo({version:I().int().catch(1),id:F().optional(),sentAt:F().optional(),reference:F().optional()});const ds=new Map([[32,` `],[9,` `],[160,`\xA0`]]);function fs(e){let t=/^&#(x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);$/.exec(e);if(!t)return null;let n=t[1],r=n[0]===`x`||n[0]===`X`,i=Number.parseInt(r?n.slice(1):n,r?16:10);return Number.isNaN(i)?null:i}function ps(e){let t=fs(e);return t!==null&&ds.has(t)}function are(e){let t=fs(e);return t===null?null:ds.get(t)??null}const ms=/&#(?:x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);/g;function hs(e){ms.lastIndex=0;let t=e.match(ms);if(t===null||t.join(``)!==e)return null;let n=``;for(let e of t){let t=are(e);if(t===null)return null;n+=t}return n}const ore=[`off`,`follow`,`full`],gs=`pull`,_s=[`off`,`follow`,`full`,gs],sre=[`follow`,`full`,gs],vs=3600,cre=new Set(Object.keys({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`})),lre=new Set([`md`,`mdx`,`mmd`,`mermaid`]);new Set([...cre,`txt`,`text`,`csv`,`tsv`,`log`,`toml`,`html`,`htm`,`svg`,`vue`,`svelte`,`astro`,`lock`].filter(e=>!lre.has(e)));const ys=[`image/jpeg`,`image/png`,`image/gif`,`image/webp`,`image/svg+xml`],ure=[`video/mp4`,`video/webm`,`video/ogg`],dre=[`audio/mpeg`,`audio/wav`,`audio/ogg`],fre=[`application/pdf`],bs=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`avif`,`svg`]),xs=new Set([`mp4`,`webm`,`mov`,`m4v`,`mkv`]),pre=new Set([`pdf`]),Ss=new Set([`mp3`,`wav`,`ogg`,`m4a`,`flac`,`aac`,`opus`]),Cs=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(`.`)),ws=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(`.`)),mre=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(`.`)),Ts=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(`.`)),Es=[`png`,`jpg`,`jpeg`,`gif`,`webp`,`avif`],Ds=[`mp4`,`webm`,`mov`,`m4v`],Os=[`mp3`,`wav`,`ogg`,`m4a`,`flac`,`aac`,`opus`],ks=[`pdf`],As=[`json`,`toml`,`lock`];function js(e,t,n){for(let r of t)if(!n.has(r))throw Error(`${e}: ${r} is not present in canonical upload constants`)}js(`SIDEBAR_IMAGE_ASSET_EXTENSIONS`,Es,bs),js(`SIDEBAR_VIDEO_ASSET_EXTENSIONS`,Ds,xs),js(`SIDEBAR_AUDIO_ASSET_EXTENSIONS`,Os,Ss),js(`SIDEBAR_PDF_ASSET_EXTENSIONS`,ks,pre),js(`FILE_ATTACHMENT_EXTENSIONS`,[...Cs],Ts),js(`WIKI_EMBED_EXTENSIONS`,[...Ts],ws),new Set(Es),new Set(Ds),new Set(Os),new Set(ks),new Set(As),js(`SIDEBAR_RENDERABLE_ASSET_EXTENSIONS`,[...new Set([...Es,...Ds,...Os,...ks,...As])],mre);const hre=new Set([`base`,`canvas`]),gre=new Set([`mmd`,`mermaid`]),_re=new Set([`excalidraw`]),Ms=new Set([...ws,...hre,...gre,..._re]),Ns=[`en`,`zh-Hans`,`zh-Hant`,`hi`,`es`,`ar`,`fr`,`bn`,`pt-BR`,`id`,`ur`,`ko`],vre=new Set([`ar`,`ur`]),yre=Ns.filter(e=>!vre.has(e)),bre=[`markdownlint`,`frontmatter`,`okf`],xre=[`missing`,`invalid`];[...bre];const Sre=[`off`,`warning`,`error`],Ps=`warning`,Cre=[`error`,`warning`],Fs=[`base00`,`base01`,`base02`,`base03`,`base04`,`base05`,`base06`,`base07`,`base08`,`base09`,`base0A`,`base0B`,`base0C`,`base0D`,`base0E`,`base0F`],wre={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`},Tre=/\P{White_Space}/u;function Ere(e){return Tre.test(e)}function Dre(e){let t=e.palette;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-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,...kre(t)}}const Is={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`},Ore=Object.keys(Is);function kre(e){let t={};for(let n of Ore)t[`ansi-${Are(n)}`]=e[Is[n]];return t}function Are(e){return e.replace(/([a-z])([A-Z])/g,`$1-$2`).toLowerCase()}const jre={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`}},Mre={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`}},Nre={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`}},Pre={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`}},Fre={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`}},Ire={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 Ls(e,t,n){return{id:e,label:t,kind:n.variant,scheme:n,toTokens:()=>Dre(n)}}function Rs(e,t){return{id:e,label:t,kind:`system`}}const zs=[Rs(`default`,`Default`),Ls(`dracula`,`Dracula`,jre),Ls(`catppuccin-frappe`,`Catppuccin Frappé`,Mre),Ls(`catppuccin-latte`,`Catppuccin Latte`,Nre),Ls(`monokai`,`Monokai`,Pre),Ls(`gruvbox`,`Gruvbox`,Fre),Ls(`solarized`,`Solarized`,Ire),Rs(`custom`,`Custom`)],Lre=zs.map(e=>e.id),Bs=/^[a-z0-9-]{1,32}$/;new Map(zs.map(e=>[e.id,e]));const Vs=Symbol.for(`@inkeep/open-knowledge/field-registry`),Hs=globalThis;Hs[Vs]===void 0&&(Hs[Vs]=ti());const Us=Hs[Vs];function Rre(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=zre(t)?Us.get(t):void 0;if(e!==void 0)return e;let n=t._zod?.def?.innerType;if(n===void 0)return;t=n}}function zre(e){return typeof e==`object`&&!!e&&`_zod`in e&&`parse`in e}function Bre(){return Object.fromEntries(Fs.map(e=>[e,F().register(Us,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Custom theme: base16 ${e} — ${wre[e]}, as a #rrggbb hex string.`}).optional()]))}function Ws(){return Lre.filter(e=>e!==`default`&&e!==`custom`).map(e=>`'${e}'`).join(`, `)}const Gs=Object.freeze([`authorization`,`auth.token`,`auth.bearer`,`cookie`,`set-cookie`,`x-api-key`,`password`,`secret`]),Ks=52428800,qs=26214400,Js=12582912,Ys=`https://api.openai.com/v1`,Xs=`text-embedding-3-small`,Zs=Object.freeze([`127.0.0.1`]),Qs=/^[1-9]\d*(s|m|h)$/,$s=/^https?:\/\//;function ec(e){let t=e.trim();return t===``?`./`:t}function tc(e){let t=ec(e);return t.includes(`\0`)||t.includes(`\\`)?!1:t===`/`?!0:!(t.startsWith(`/`)||/^[A-Za-z]:/.test(t)||t.split(`/`).some(e=>e===`..`))}const nc=yo({content:yo({dir:F().register(Us,{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:F().register(Us,{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(tc,{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:yo({theme:H([`light`,`dark`,`system`]).register(Us,{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:H([`system`,...Ns]).register(Us,{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:F().register(Us,{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 ${Ws()}, 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(Bs,{message:`Theme id must be lowercase letters, digits, and hyphens, 1–32 characters (e.g. 'dracula', 'custom', or a saved theme id).`}).optional(),colorThemeDark:F().register(Us,{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 ${Ws()}, 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(Bs,{message:`Theme id must be lowercase letters, digits, and hyphens, 1–32 characters (e.g. 'dracula', 'custom', or a saved theme id).`}).optional(),colorTheme:F().register(Us,{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(Bs,{message:`Theme id must be lowercase letters, digits, and hyphens, 1–32 characters (e.g. 'dracula', 'custom', or a saved theme id).`}).optional(),colorThemeEnabled:L().register(Us,{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:yo({name:F().register(Us,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Custom theme: the scheme's display name.`}).optional(),author:F().register(Us,{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:H([`dark`,`light`]).register(Us,{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(),...Bre()}).optional(),preview:yo({autoOpen:L().register(Us,{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:yo({showHiddenFiles:L().register(Us,{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:L().register(Us,{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:L().register(Us,{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:L().register(Us,{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:L().register(Us,{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:z(F()).register(Us,{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:z(F()).register(Us,{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:yo({wordWrap:L().register(Us,{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:L().register(Us,{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:yo({autoApproveOkTools:L().register(Us,{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:yo({mode:H(_s).register(Us,{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:L().register(Us,{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:H(sre).register(Us,{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:I().int().min(30).max(vs).register(Us,{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:I().int().min(30).max(vs).register(Us,{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:xo([L(),H(_s)]).register(Us,{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:yo({enabled:L().register(Us,{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:F().register(Us,{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:yo({enabled:L().register(Us,{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:yo({localSink:yo({enabled:L().register(Us,{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:yo({maxBytes:I().register(Us,{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(Ks)}).default({maxBytes:Ks}),logs:yo({maxBytes:I().register(Us,{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(qs)}).default({maxBytes:qs}),attributeDenylist:z(F()).register(Us,{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([...Gs])}).default({enabled:!0,spans:{maxBytes:Ks},logs:{maxBytes:qs},attributeDenylist:[...Gs]}),skillInstallReports:yo({enabled:L().register(Us,{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:Ks},logs:{maxBytes:qs},attributeDenylist:[...Gs]},skillInstallReports:{enabled:!0}}),lossCapture:yo({enabled:L().register(Us,{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:I().register(Us,{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(Js)}).default({enabled:!0,maxBytes:Js}),bridge:yo({backgroundThrottle:yo({enabled:L().register(Us,{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:yo({enabled:L().register(Us,{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:yo({enabled:L().register(Us,{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:yo({enabled:L().register(Us,{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:yo({enabled:L().register(Us,{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:yo({enabled:L().register(Us,{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:yo({semantic:yo({enabled:L().register(Us,{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:F().register(Us,{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(Ys),model:F().register(Us,{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(Xs),dimensions:I().int().positive().register(Us,{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:I().min(0).max(1).register(Us,{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()}).default({enabled:!1,baseUrl:Ys,model:Xs})}).default({semantic:{enabled:!1,baseUrl:Ys,model:Xs}}),contentRules:yo({markdownlint:B({enabled:L().register(Us,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Whether the markdownlint plugin (body rules) contributes diagnostics.`}).default(!1)}).default({enabled:!1}),frontmatter:B({enabled:L().register(Us,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Whether the frontmatter plugin (JSON-Schema validation of document frontmatter) contributes diagnostics.`}).default(!1),schemas:z(B({appliesTo:xo([F(),z(F())]).optional(),file:F(),enabled:L().optional()})).register(Us,{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:B({enabled:L().register(Us,{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:V(F(),L()).register(Us,{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:B({index:L().register(Us,{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:yo({links:H(Sre).register(Us,{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(Ps),fileTreeIndicators:L().register(Us,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Whether the file tree tints and badges files that have validation problems.`}).default(!0)}).default({links:Ps,fileTreeIndicators:!0}),linkPreviews:yo({enabled:L().register(Us,{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:yo({port:I().int().min(1).max(65535).register(Us,{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:z(F().min(1)).min(1).register(Us,{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([...Zs]),externalUrl:mo({protocol:/^https?$/}).regex($s).register(Us,{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:L().register(Us,{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:L().register(Us,{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:xo([U(`off`),F().regex(Qs)]).register(Us,{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:[...Zs],allowExternal:!1})});var rc,ic=n((()=>{rc=`1.9.1`}));function ac(e){let t=new Set([e]),n=new Set,r=e.match(oc);if(!r)return()=>!1;let i={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};if(i.prerelease!=null)return function(t){return t===e};function a(e){return n.add(e),!1}function o(e){return t.add(e),!0}return function(e){if(t.has(e))return!0;if(n.has(e))return!1;let r=e.match(oc);if(!r)return a(e);let s={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};return s.prerelease!=null||i.major!==s.major?a(e):i.major===0?i.minor===s.minor&&i.patch<=s.patch?o(e):a(e):i.minor<=s.minor?o(e):a(e)}}var oc,sc,cc=n((()=>{ic(),oc=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/,sc=ac(rc)}));function lc(e,t,n,r=!1){let i=mc[pc]=mc[pc]??{version:rc};if(!r&&i[e]){let t=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`);return n.error(t.stack||t.message),!1}if(i.version!==`1.9.1`){let t=Error(`@opentelemetry/api: Registration of version v${i.version} for ${e} does not match previously registered API v${rc}`);return n.error(t.stack||t.message),!1}return i[e]=t,n.debug(`@opentelemetry/api: Registered a global for ${e} v${rc}.`),!0}function uc(e){let t=mc[pc]?.version;if(!(!t||!sc(t)))return mc[pc]?.[e]}function dc(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${rc}.`);let n=mc[pc];n&&delete n[e]}var fc,pc,mc,hc=n((()=>{ic(),cc(),fc=rc.split(`.`)[0],pc=Symbol.for(`opentelemetry.js.api.${fc}`),mc=typeof globalThis==`object`?globalThis:typeof self==`object`?self:typeof window==`object`?window:typeof global==`object`?global:{}}));function gc(e,t,n){let r=uc(`diag`);if(r)return r[e](t,...n)}var _c,vc=n((()=>{hc(),_c=class{constructor(e){this._namespace=e.namespace||`DiagComponentLogger`}debug(...e){return gc(`debug`,this._namespace,e)}error(...e){return gc(`error`,this._namespace,e)}info(...e){return gc(`info`,this._namespace,e)}warn(...e){return gc(`warn`,this._namespace,e)}verbose(...e){return gc(`verbose`,this._namespace,e)}}})),yc,bc=n((()=>{(function(e){e[e.NONE=0]=`NONE`,e[e.ERROR=30]=`ERROR`,e[e.WARN=50]=`WARN`,e[e.INFO=60]=`INFO`,e[e.DEBUG=70]=`DEBUG`,e[e.VERBOSE=80]=`VERBOSE`,e[e.ALL=9999]=`ALL`})(yc||={})}));function xc(e,t){e<yc.NONE?e=yc.NONE:e>yc.ALL&&(e=yc.ALL),t||={};function n(n,r){let i=t[n];return typeof i==`function`&&e>=r?i.bind(t):function(){}}return{error:n(`error`,yc.ERROR),warn:n(`warn`,yc.WARN),info:n(`info`,yc.INFO),debug:n(`debug`,yc.DEBUG),verbose:n(`verbose`,yc.VERBOSE)}}var Sc=n((()=>{bc()})),Cc,wc,Tc=n((()=>{vc(),Sc(),bc(),hc(),Cc=`diag`,wc=class e{static instance(){return this._instance||=new e,this._instance}constructor(){function e(e){return function(...t){let n=uc(`diag`);if(n)return n[e](...t)}}let t=this;t.setLogger=(e,n={logLevel:yc.INFO})=>{if(e===t){let e=Error(`Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation`);return t.error(e.stack??e.message),!1}typeof n==`number`&&(n={logLevel:n});let r=uc(`diag`),i=xc(n.logLevel??yc.INFO,e);if(r&&!n.suppressOverrideMessage){let e=Error().stack??`<failed to generate stacktrace>`;r.warn(`Current logger will be overwritten from ${e}`),i.warn(`Current logger will overwrite one already registered from ${e}`)}return lc(`diag`,i,t,!0)},t.disable=()=>{dc(Cc,t)},t.createComponentLogger=e=>new _c(e),t.verbose=e(`verbose`),t.debug=e(`debug`),t.info=e(`info`),t.warn=e(`warn`),t.error=e(`error`)}}}));function Ec(e){return Symbol.for(e)}var Dc,Oc,kc=n((()=>{Dc=class e{constructor(t){let n=this;n._currentContext=t?new Map(t):new Map,n.getValue=e=>n._currentContext.get(e),n.setValue=(t,r)=>{let i=new e(n._currentContext);return i._currentContext.set(t,r),i},n.deleteValue=t=>{let r=new e(n._currentContext);return r._currentContext.delete(t),r}}},Oc=new Dc})),Ac,jc=n((()=>{kc(),Ac=class{active(){return Oc}with(e,t,n,...r){return t.call(n,...r)}bind(e,t){return t}enable(){return this}disable(){return this}}})),Mc,Nc,Pc,Fc=n((()=>{jc(),hc(),Tc(),Mc=`context`,Nc=new Ac,Pc=class e{constructor(){}static getInstance(){return this._instance||=new e,this._instance}setGlobalContextManager(e){return lc(Mc,e,wc.instance())}active(){return this._getContextManager().active()}with(e,t,n,...r){return this._getContextManager().with(e,t,n,...r)}bind(e,t){return this._getContextManager().bind(e,t)}_getContextManager(){return uc(Mc)||Nc}disable(){this._getContextManager().disable(),dc(Mc,wc.instance())}}})),Ic,Lc=n((()=>{(function(e){e[e.NONE=0]=`NONE`,e[e.SAMPLED=1]=`SAMPLED`})(Ic||={})})),Rc,zc,Bc,Vc=n((()=>{Lc(),Rc=`0000000000000000`,zc=`00000000000000000000000000000000`,Bc={traceId:zc,spanId:Rc,traceFlags:Ic.NONE}})),Hc,Uc=n((()=>{Vc(),Hc=class{constructor(e=Bc){this._spanContext=e}spanContext(){return this._spanContext}setAttribute(e,t){return this}setAttributes(e){return this}addEvent(e,t){return this}addLink(e){return this}addLinks(e){return this}setStatus(e){return this}updateName(e){return this}end(e){}isRecording(){return!1}recordException(e,t){}}}));function Wc(e){return e.getValue(Xc)||void 0}function Gc(){return Wc(Pc.getInstance().active())}function Kc(e,t){return e.setValue(Xc,t)}function qc(e){return e.deleteValue(Xc)}function Jc(e,t){return Kc(e,new Hc(t))}function Yc(e){return Wc(e)?.spanContext()}var Xc,Zc=n((()=>{kc(),Uc(),Fc(),Xc=Ec(`OpenTelemetry Context Key SPAN`)}));function Qc(e,t){if(typeof e!=`string`||e.length!==t)return!1;let n=0;for(let t=0;t<e.length;t+=4)n+=(rl[e.charCodeAt(t)]|0)+(rl[e.charCodeAt(t+1)]|0)+(rl[e.charCodeAt(t+2)]|0)+(rl[e.charCodeAt(t+3)]|0);return n===t}function $c(e){return Qc(e,32)&&e!==`00000000000000000000000000000000`}function el(e){return Qc(e,16)&&e!==`0000000000000000`}function tl(e){return $c(e.traceId)&&el(e.spanId)}function nl(e){return new Hc(e)}var rl,il=n((()=>{Vc(),Uc(),rl=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1])}));function al(e){return typeof e==`object`&&!!e&&`spanId`in e&&typeof e.spanId==`string`&&`traceId`in e&&typeof e.traceId==`string`&&`traceFlags`in e&&typeof e.traceFlags==`number`}var ol,sl,cl=n((()=>{Fc(),Zc(),Uc(),il(),ol=Pc.getInstance(),sl=class{startSpan(e,t,n=ol.active()){if(t?.root)return new Hc;let r=n&&Yc(n);return al(r)&&tl(r)?new Hc(r):new Hc}startActiveSpan(e,t,n,r){let i,a,o;if(arguments.length<2)return;arguments.length===2?o=t:arguments.length===3?(i=t,o=n):(i=t,a=n,o=r);let s=a??ol.active(),c=this.startSpan(e,i,s),l=Kc(s,c);return ol.with(l,o,void 0,c)}}})),ll,ul,dl=n((()=>{cl(),ll=new sl,ul=class{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}startSpan(e,t,n){return this._getTracer().startSpan(e,t,n)}startActiveSpan(e,t,n,r){let i=this._getTracer();return Reflect.apply(i.startActiveSpan,i,arguments)}_getTracer(){if(this._delegate)return this._delegate;let e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):ll}}})),fl,pl=n((()=>{cl(),fl=class{getTracer(e,t,n){return new sl}}})),ml,hl,gl=n((()=>{dl(),pl(),ml=new fl,hl=class{getTracer(e,t,n){return this.getDelegateTracer(e,t,n)??new ul(this,e,t,n)}getDelegate(){return this._delegate??ml}setDelegate(e){this._delegate=e}getDelegateTracer(e,t,n){return this._delegate?.getTracer(e,t,n)}}})),_l,vl=n((()=>{(function(e){e[e.UNSET=0]=`UNSET`,e[e.OK=1]=`OK`,e[e.ERROR=2]=`ERROR`})(_l||={})})),yl,bl=n((()=>{Fc(),yl=Pc.getInstance()})),xl,Sl,Cl=n((()=>{hc(),gl(),il(),Zc(),Tc(),xl=`trace`,Sl=class e{constructor(){this._proxyTracerProvider=new hl,this.wrapSpanContext=nl,this.isSpanContextValid=tl,this.deleteSpan=qc,this.getSpan=Wc,this.getActiveSpan=Gc,this.getSpanContext=Yc,this.setSpan=Kc,this.setSpanContext=Jc}static getInstance(){return this._instance||=new e,this._instance}setGlobalTracerProvider(e){let t=lc(xl,this._proxyTracerProvider,wc.instance());return t&&this._proxyTracerProvider.setDelegate(e),t}getTracerProvider(){return uc(xl)||this._proxyTracerProvider}getTracer(e,t){return this.getTracerProvider().getTracer(e,t)}disable(){dc(xl,wc.instance()),this._proxyTracerProvider=new hl}}})),wl,Tl=n((()=>{Cl(),wl=Sl.getInstance()})),El=n((()=>{Tc(),kc(),bc(),dl(),gl(),vl(),Lc(),il(),Vc(),bl(),Tl()}));function Dl(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 Ol(e,t){let n=e;for(let e of t){n=Dl(n);let t=n?._zod?.def?.shape;if(!t||(n=t[String(e)],n===void 0))return}return n}function kl(e,t){let n=Ol(e,t);if(n!==void 0)return Rre(n)}const Al=new Map([[`PORT`,[`server`,`port`]],[`OK_BIND`,[`server`,`bind`]],[`OK_EXTERNAL_URL`,[`server`,`externalUrl`]],[`OK_ALLOW_EXTERNAL`,[`server`,`allowExternal`]],[`OK_OPEN_BROWSER`,[`server`,`openBrowser`]],[`OK_IDLE_SHUTDOWN`,[`server`,`idleShutdown`]]]);function jl(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1_$2`).toUpperCase()}function Ml(e){return`OK_${(e[0]===`server`?e.slice(1):e).map(jl).join(`_`)}`}function Nl(e,t){if(t.length===0)return e.contents??null;let n=e.getIn(t,!0);if((0,on.isNode)(n))return n;for(let n=t.length-1;n>=0;n--){let r=e.getIn(t.slice(0,n),!0);if((0,on.isNode)(r))return r}return e.contents??null}function Pl(e,t){let n=1,r=1,i=Math.min(t,e.length);for(let t=0;t<i;t++)e.charCodeAt(t)===10?(n++,r=1):r++;return{line:n,column:r}}function Fl(e,t,n,r,i){let a=e.split(`
185
185
  `),o=r-1;if(o<0||o>=a.length)return``;let s=a[o]??``,c=t-(i-1)+s.length,l=Math.max(1,Math.min(n,c)-t),u=[],d=String(o+2).length;for(let e=Math.max(0,o-1);e<=Math.min(a.length-1,o+1);e++){let t=e===o,n=t?`>`:` `,r=String(e+1).padStart(d,` `);if(u.push(`${n} ${r} | ${a[e]??``}`),t){let e=` `.repeat(2+d+3+i-1);u.push(`${e}${`^`.repeat(l)}`)}}return u.join(`
186
186
  `)}function Il(e){let t=Nl(e.doc,e.path);if(!t)return;let n=t.range;if(!n)return;let[r,,i=r]=n,{line:a,column:o}=Pl(e.source,r),s=(0,on.isCollection)(t)?Fl(e.source,r,r+1,a,o):Fl(e.source,r,i,a,o);return{file:e.file,line:a,column:o,snippet:s.length>0?s:void 0}}function Ll(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Rl(e){let{value:t,file:n,source:r,doc:i}=e,a=[],o=(e,t)=>{if(t.length>0){let e=kl(nc,t);if(e!==void 0){if(e.scope===`project-local`){let e=Ml(t),o;i!=null&&r!=null&&n!=null&&(o=Il({file:n,source:r,doc:i,path:t})),a.push({path:[...t],...Al.has(e)?{envVar:e}:{},...o===void 0?{}:{source:o}})}return}}if(Ll(e))for(let[n,r]of Object.entries(e))o(r,[...t,n])};return o(t,[]),a}const zl=B({file:F(),line:I().int().min(1),column:I().int().min(1),snippet:F().optional()}),Bl=B({path:z(xo([F(),I()])),message:F(),issueCode:F(),params:V(F(),R()).optional(),source:zl.optional()}),Vl=H([`user`,`project`,`project-local`,`either`]),Hl=H([`user`,`project`,`project-local`]),Ul=B({code:U(`YAML_PARSE`),detail:F()}),Wl=B({code:U(`UNREADABLE`),detail:F()}),Gl=B({code:U(`SCHEMA_INVALID`),issues:z(Bl)}),Kl=B({code:U(`REMOVED_KEY`),path:z(F()),redirect:F(),source:zl.optional()}),ql=So(`code`,[Ul,Gl,Wl,B({code:U(`SCOPE_VIOLATION`),path:z(F()),expectedScope:Vl,actualScope:Hl}),B({code:U(`NOT_AGENT_SETTABLE`),path:z(F())}),B({code:U(`MIXED_SCOPE`),paths:z(B({path:z(F()),scope:Hl}))}),Kl,B({code:U(`WRITE_ERROR`),detail:F()}),B({code:U(`OKIGNORE_INVALID`),detail:F(),lineNumber:I().int().min(1).optional()}),B({code:U(`UNKNOWN`),message:F().optional()})]);So(`code`,[Kl,Ul,Gl,Wl]),B({diagnostics:z(So(`code`,[B({code:U(`REMOVED_KEY`),scope:Hl,file:F(),path:z(F()),redirect:F()}),B({code:U(`YAML_PARSE`),scope:Hl,file:F()}),B({code:U(`SCHEMA_INVALID`),scope:Hl,file:F()}),B({code:U(`UNREADABLE`),scope:Hl,file:F()})]))});const Jl=new Set(ql.options.map(e=>e.shape.code.value)),Yl=xo([ql,yo({code:F(),message:F().optional()})]);function Xl(e){return Jl.has(e.code)}function Zl(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 Ql(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 $l(e){if(!Xl(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(`
187
187
  `))n.push(` ${e}`)}else n.push(` ${r}: ${t.message}`)}}return n.join(`
@@ -434,29 +434,29 @@ caused by: `+i(o,t)):a},a=e=>i(e,new Set),o=(e,t,i)=>{if(!n(e))return``;let a=i?
434
434
  `){return e.split(n).reduce((e,n)=>{let r=t?n.trim():n;return r&&e.push(r),e},[])}function y1(e,t){return v1(e,!0).map(e=>t(e))}function b1(e){return(0,K$.exists)(e,K$.FOLDER)}function x1(e,t){return Array.isArray(e)?e.includes(t)||e.push(t):e.add(t),t}function Hge(e,t){return Array.isArray(e)&&!e.includes(t)&&e.push(t),e}function S1(e,t){if(Array.isArray(e)){let n=e.indexOf(t);n>=0&&e.splice(n,1)}else e.delete(t);return t}function C1(e){return Array.isArray(e)?e:[e]}function w1(e){return e.replace(/[\s-]+(.)/g,(e,t)=>t.toUpperCase())}function T1(e){return C1(e).map(e=>e instanceof String?e:String(e))}function E1(e,t=0){if(e==null)return t;let n=parseInt(e,10);return Number.isNaN(n)?t:n}function D1(e,t){let n=[];for(let r=0,i=e.length;r<i;r++)n.push(t,e[r]);return n}function O1(e){return(Array.isArray(e)?Buffer.concat(e):e).toString(`utf-8`)}function Uge(e,t){let n={};return t.forEach(t=>{e[t]!==void 0&&(n[t]=e[t])}),n}function Wge(e=0){return new Promise(t=>setTimeout(t,e))}function k1(e){if(e!==!1)return e}var A1,j1,M1,N1=r1({"src/lib/utils/util.ts"(){U1(),A1=`\0`,j1=()=>{},M1=Object.prototype.toString.call.bind(Object.prototype.toString)}});function P1(e,t,n){return t(e)?e:arguments.length>2?n:void 0}function F1(e,t){let n=Y$(e)?`string`:typeof e;return/number|string|boolean/.test(n)&&(!t||!t.includes(n))}function I1(e){return!!e&&M1(e)===`[object Object]`}function L1(e){return typeof e==`function`}var R1,z1,B1,V1,H1,U1=r1({"src/lib/utils/argument-filters.ts"(){N1(),R1=e=>Array.isArray(e),z1=e=>typeof e==`number`,B1=e=>typeof e==`string`||Y$(e),V1=e=>B1(e)||Array.isArray(e)&&e.every(B1),H1=e=>e==null||`number|boolean|function`.includes(typeof e)?!1:typeof e.length==`number`}}),W1,Gge=r1({"src/lib/utils/exit-codes.ts"(){W1=(e=>(e[e.SUCCESS=0]=`SUCCESS`,e[e.ERROR=1]=`ERROR`,e[e.NOT_FOUND=-2]=`NOT_FOUND`,e[e.UNCLEAN=128]=`UNCLEAN`,e))(W1||{})}}),G1,Kge=r1({"src/lib/utils/git-output-streams.ts"(){G1=class e{constructor(e,t){this.stdOut=e,this.stdErr=t}asStrings(){return new e(this.stdOut.toString(`utf8`),this.stdErr.toString(`utf8`))}}}});function qge(){throw Error(`LineParser:useMatches not implemented`)}var K1,q1,Jge=r1({"src/lib/utils/line-parser.ts"(){K1=class{constructor(e,t){this.matches=[],this.useMatches=qge,this.parse=(e,t)=>(this.resetMatches(),this._regExp.every((t,n)=>this.addMatch(t,n,e(n)))?this.useMatches(t,this.prepareMatches())!==!1:!1),this._regExp=Array.isArray(e)?e:[e],t&&(this.useMatches=t)}resetMatches(){this.matches.length=0}prepareMatches(){return this.matches}addMatch(e,t,n){let r=n&&e.exec(n);return r&&this.pushMatch(t,r),!!r}pushMatch(e,t){this.matches.push(...t.slice(1))}},q1=class extends K1{addMatch(e,t,n){return/^remote:\s/.test(String(n))&&super.addMatch(e,t,n)}pushMatch(e,t){(e>0||t.length>1)&&super.pushMatch(e,t)}}}});function Yge(...e){let t=process.cwd(),n=Object.assign({baseDir:t,...J1},...e.filter(e=>typeof e==`object`&&e));return n.baseDir=n.baseDir||t,n.trimmed=n.trimmed===!0,n}var J1,Xge=r1({"src/lib/utils/simple-git-options.ts"(){J1={binary:`git`,maxConcurrentProcesses:5,config:[],trimmed:!1}}});function Y1(e,t=[]){return I1(e)?Object.keys(e).reduce((t,n)=>{let r=e[n];if(Y$(r))t.push(r);else if(F1(r,[`boolean`]))t.push(n+`=`+r);else if(Array.isArray(r))for(let e of r)F1(e,[`string`,`number`])||t.push(n+`=`+e);else t.push(n);return t},t):t}function X1(e,t=0,n=!1){let r=[];for(let n=0,i=t<0?e.length:t;n<i;n++)`string|number`.includes(typeof e[n])&&r.push(String(e[n]));return Y1(Z1(e),r),n||r.push(...Zge(e)),r}function Zge(e){return T1(P1(g1(e,+(typeof g1(e)==`function`)),R1,[]))}function Z1(e){return P1(g1(e,+!!L1(g1(e))),I1)}function Q1(e,t=!0){let n=f1(g1(e));return t||p1(n)?n:void 0}var Qge=r1({"src/lib/utils/task-options.ts"(){U1(),N1()}});function $1(e,t){return e(t.stdOut,t.stdErr)}function e0(e,t,n,r=!0){return C1(n).forEach(n=>{for(let i=v1(n,r),a=0,o=i.length;a<o;a++){let n=(e=0)=>{if(!(a+e>=o))return i[a+e]};t.some(({parse:t})=>t(n,e))}}),e}var $ge=r1({"src/lib/utils/task-parser.ts"(){N1()}}),t0={};i1(t0,{ExitCodes:()=>W1,GitOutputStreams:()=>G1,LineParser:()=>K1,NOOP:()=>j1,NULL:()=>A1,RemoteLineParser:()=>q1,append:()=>x1,appendTaskOptions:()=>Y1,asArray:()=>C1,asCamelCase:()=>w1,asFunction:()=>f1,asNumber:()=>E1,asStringArray:()=>T1,bufferToString:()=>O1,callTaskParser:()=>$1,createInstanceConfig:()=>Yge,delay:()=>Wge,filterArray:()=>R1,filterFunction:()=>L1,filterHasLength:()=>H1,filterNumber:()=>z1,filterPlainObject:()=>I1,filterPrimitives:()=>F1,filterString:()=>B1,filterStringOrStringArray:()=>V1,filterType:()=>P1,first:()=>h1,folderExists:()=>b1,forEachLineWithContent:()=>y1,getTrailingOptions:()=>X1,including:()=>Hge,isUserFunction:()=>p1,last:()=>g1,objectToString:()=>M1,orVoid:()=>k1,parseStringResponse:()=>e0,pick:()=>Uge,prefixedArray:()=>D1,remove:()=>S1,splitOn:()=>m1,toLinesWithContent:()=>v1,trailingFunctionArgument:()=>Q1,trailingOptionsArgument:()=>Z1});var n0=r1({"src/lib/utils/index.ts"(){U1(),Gge(),Kge(),Jge(),Xge(),Qge(),$ge(),N1()}}),r0={};i1(r0,{CheckRepoActions:()=>o0,checkIsBareRepoTask:()=>a0,checkIsRepoRootTask:()=>i0,checkIsRepoTask:()=>e_e});function e_e(e){switch(e){case`bare`:return a0();case`root`:return i0()}return{commands:[`rev-parse`,`--is-inside-work-tree`],format:`utf-8`,onError:s0,parser:c0}}function i0(){return{commands:[`rev-parse`,`--git-dir`],format:`utf-8`,onError:s0,parser(e){return/^\.(git)?$/.test(e.trim())}}}function a0(){return{commands:[`rev-parse`,`--is-bare-repository`],format:`utf-8`,onError:s0,parser:c0}}function t_e(e){return/(Not a git repository|Kein Git-Repository)/i.test(String(e))}var o0,s0,c0,l0=r1({"src/lib/tasks/check-is-repo.ts"(){n0(),o0=(e=>(e.BARE=`bare`,e.IN_TREE=`tree`,e.IS_REPO_ROOT=`root`,e))(o0||{}),s0=({exitCode:e},t,n,r)=>{if(e===128&&t_e(t))return n(Buffer.from(`false`));r(t)},c0=e=>e.trim()===`true`}});function n_e(e,t){let n=new u0(e),r=e?f0:d0;return v1(t).forEach(e=>{let t=e.replace(r,``);n.paths.push(t),(p0.test(t)?n.folders:n.files).push(t)}),n}var u0,d0,f0,p0,r_e=r1({"src/lib/responses/CleanSummary.ts"(){n0(),u0=class{constructor(e){this.dryRun=e,this.paths=[],this.files=[],this.folders=[]}},d0=/^[a-z]+\s*/i,f0=/^[a-z]+\s+[a-z]+\s*/i,p0=/\/$/}}),m0={};i1(m0,{EMPTY_COMMANDS:()=>x0,adhocExecTask:()=>h0,configurationErrorTask:()=>g0,isBufferTask:()=>y0,isEmptyTask:()=>b0,straightThroughBufferTask:()=>v0,straightThroughStringTask:()=>_0});function h0(e){return{commands:x0,format:`empty`,parser:e}}function g0(e){return{commands:x0,format:`empty`,parser(){throw typeof e==`string`?new u1(e):e}}}function _0(e,t=!1){return{commands:e,format:`utf-8`,parser(e){return t?String(e).trim():e}}}function v0(e){return{commands:e,format:`buffer`,parser(e){return e}}}function y0(e){return e.format===`buffer`}function b0(e){return e.format===`empty`||!e.commands.length}var x0,S0=r1({"src/lib/tasks/task.ts"(){d1(),x0=[]}}),C0={};i1(C0,{CONFIG_ERROR_INTERACTIVE_MODE:()=>T0,CONFIG_ERROR_MODE_REQUIRED:()=>E0,CONFIG_ERROR_UNKNOWN_OPTION:()=>D0,CleanOptions:()=>O0,cleanTask:()=>w0,cleanWithOptionsTask:()=>i_e,isCleanOptionsArray:()=>a_e});function i_e(e,t){let{cleanMode:n,options:r,valid:i}=o_e(e);return n?i.options?(r.push(...t),r.some(l_e)?g0(T0):w0(n,r)):g0(D0+JSON.stringify(e)):g0(E0)}function w0(e,t){return{commands:[`clean`,`-${e}`,...t],format:`utf-8`,parser(t){return n_e(e===`n`,t)}}}function a_e(e){return Array.isArray(e)&&e.every(e=>k0.has(e))}function o_e(e){let t,n=[],r={cleanMode:!1,options:!0};return e.replace(/[^a-z]i/g,``).split(``).forEach(e=>{s_e(e)?(t=e,r.cleanMode=!0):r.options=r.options&&c_e(n[n.length]=`-${e}`)}),{cleanMode:t,options:n,valid:r}}function s_e(e){return e===`f`||e===`n`}function c_e(e){return/^-[a-z]$/i.test(e)&&k0.has(e.charAt(1))}function l_e(e){return/^-[^\-]/.test(e)?e.indexOf(`i`)>0:e===`--interactive`}var T0,E0,D0,O0,k0,A0=r1({"src/lib/tasks/clean.ts"(){r_e(),n0(),S0(),T0=`Git clean interactive mode is not supported`,E0=`Git clean mode parameter ("n" or "f") is required`,D0=`Git clean unknown option found in: `,O0=(e=>(e.DRY_RUN=`n`,e.FORCE=`f`,e.IGNORED_INCLUDED=`x`,e.IGNORED_ONLY=`X`,e.EXCLUDING=`e`,e.QUIET=`q`,e.RECURSIVE=`d`,e))(O0||{}),k0=new Set([`i`,...T1(Object.values(O0))])}});function u_e(e){let t=new M0;for(let n of j0(e))t.addValue(n.file,String(n.key),n.value);return t}function d_e(e,t){let n=null,r=[],i=new Map;for(let a of j0(e,t))a.key===t&&(r.push(n=a.value),i.has(a.file)||i.set(a.file,[]),i.get(a.file).push(n));return{key:t,paths:Array.from(i.keys()),scopes:i,value:n,values:r}}function f_e(e){return e.replace(/^(file):/,``)}function*j0(e,t=null){let n=e.split(`\0`);for(let e=0,r=n.length-1;e<r;){let r=f_e(n[e++]),i=n[e++],a=t;if(i.includes(`
435
435
  `)){let e=m1(i,`
436
436
  `);a=e[0],i=e[1]}yield{file:r,key:a,value:i}}}var M0,p_e=r1({"src/lib/responses/ConfigList.ts"(){n0(),M0=class{constructor(){this.files=[],this.values=Object.create(null)}get all(){return this._all||=this.files.reduce((e,t)=>Object.assign(e,this.values[t]),{}),this._all}addFile(e){if(!(e in this.values)){let t=g1(this.files);this.values[e]=t?Object.create(this.values[t]):{},this.files.push(e)}return this.values[e]}addValue(e,t,n){let r=this.addFile(e);Object.hasOwn(r,t)?Array.isArray(r[t])?r[t].push(n):r[t]=[r[t],n]:r[t]=n,this._all=void 0}}}});function N0(e,t){return typeof e==`string`&&Object.hasOwn(P0,e)?e:t}function m_e(e,t,n,r){let i=[`config`,`--${r}`];return n&&i.push(`--add`),i.push(e,t),{commands:i,format:`utf-8`,parser(e){return e}}}function h_e(e,t){let n=[`config`,`--null`,`--show-origin`,`--get-all`,e];return t&&n.splice(1,0,`--${t}`),{commands:n,format:`utf-8`,parser(t){return d_e(t,e)}}}function g_e(e){let t=[`config`,`--list`,`--show-origin`,`--null`];return e&&t.push(`--${e}`),{commands:t,format:`utf-8`,parser(e){return u_e(e)}}}function __e(){return{addConfig(e,t,...n){return this._runTask(m_e(e,t,n[0]===!0,N0(n[1],`local`)),Q1(arguments))},getConfig(e,t){return this._runTask(h_e(e,N0(t,void 0)),Q1(arguments))},listConfig(...e){return this._runTask(g_e(N0(e[0],void 0)),Q1(arguments))}}}var P0,F0=r1({"src/lib/tasks/config.ts"(){p_e(),n0(),P0=(e=>(e.system=`system`,e.global=`global`,e.local=`local`,e.worktree=`worktree`,e))(P0||{})}});function v_e(e){return L0.has(e)}var I0,L0,R0=r1({"src/lib/tasks/diff-name-status.ts"(){I0=(e=>(e.ADDED=`A`,e.COPIED=`C`,e.DELETED=`D`,e.MODIFIED=`M`,e.RENAMED=`R`,e.CHANGED=`T`,e.UNMERGED=`U`,e.UNKNOWN=`X`,e.BROKEN=`B`,e))(I0||{}),L0=new Set(Object.values(I0))}});function y_e(...e){return new H0().param(...e)}function b_e(e){let t=new Set,n={};return y1(e,e=>{let[r,i,a]=e.split(A1);t.add(r),(n[r]=n[r]||[]).push({line:E1(i),path:r,preview:a})}),{paths:t,results:n}}function x_e(){return{grep(e){let t=Q1(arguments),n=X1(arguments);for(let e of z0)if(n.includes(e))return this._runTask(g0(`git.grep: use of "${e}" is not supported.`),t);typeof e==`string`&&(e=y_e().param(e));let r=[`grep`,`--null`,`-n`,`--full-name`,...n,...e];return this._runTask({commands:r,format:`utf-8`,parser(e){return b_e(e)}},t)}}}var z0,B0,V0,H0,U0=r1({"src/lib/tasks/grep.ts"(){n0(),S0(),z0=[`-h`],B0=Symbol(`grepQuery`),H0=class{constructor(){this[V0]=[]}*[(V0=B0,Symbol.iterator)](){for(let e of this[B0])yield e}and(...e){return e.length&&this[B0].push(`--and`,`(`,...D1(e,`-e`),`)`),this}param(...e){return this[B0].push(...D1(e,`-e`)),this}}}}),W0={};i1(W0,{ResetMode:()=>K0,getResetMode:()=>C_e,resetTask:()=>S_e});function S_e(e,t){let n=[`reset`];return G0(e)&&n.push(`--${e}`),n.push(...t),_0(n)}function C_e(e){if(G0(e))return e;switch(typeof e){case`string`:case`undefined`:return`soft`}}function G0(e){return typeof e==`string`&&q0.includes(e)}var K0,q0,J0=r1({"src/lib/tasks/reset.ts"(){n0(),S0(),K0=(e=>(e.MIXED=`mixed`,e.SOFT=`soft`,e.HARD=`hard`,e.MERGE=`merge`,e.KEEP=`keep`,e))(K0||{}),q0=T1(Object.values(K0))}});function w_e(){return(0,X$.default)(`simple-git`)}function Y0(e,t,n){return!t||!String(t).replace(/\s*/,``)?n?(t,...r)=>{e(t,...r),n(t,...r)}:e:(r,...i)=>{e(`%s ${r}`,t,...i),n&&n(r,...i)}}function T_e(e,t,{namespace:n}){if(typeof e==`string`)return e;let r=t&&t.namespace||``;return r.startsWith(n)?r.substr(n.length+1):r||n}function X0(e,t,n,r=w_e()){let i=e&&`[${e}]`||``,a=[],o=typeof t==`string`?r.extend(t):t,s=T_e(P1(t,B1),o,r);return l(n);function c(t,n){return x1(a,X0(e,s.replace(/^[^:]+/,t),n,r))}function l(t){let n=t&&`[${t}]`||``,a=o&&Y0(o,n)||j1,s=Y0(r,`${i} ${n}`,a);return Object.assign(o?a:s,{label:e,sibling:c,info:s,step:l})}}var Z0=r1({"src/lib/git-logger.ts"(){n0(),X$.default.formatters.L=e=>String(H1(e)?e.length:`-`),X$.default.formatters.B=e=>Buffer.isBuffer(e)?e.toString(`utf8`):M1(e)}}),Q0,E_e=r1({"src/lib/runners/tasks-pending-queue.ts"(){s1(),Z0(),Q0=class e{constructor(e=`GitExecutor`){this.logLabel=e,this._queue=new Map}withProgress(e){return this._queue.get(e)}createProgress(t){let n=e.getName(t.commands[0]);return{task:t,logger:X0(this.logLabel,n),name:n}}push(e){let t=this.createProgress(e);return t.logger(`Adding task to the queue, commands = %o`,e.commands),this._queue.set(e,t),t}fatal(e){for(let[t,{logger:n}]of Array.from(this._queue.entries()))t===e.task?(n.info(`Failed %o`,e),n(`Fatal exception, any as-yet un-started tasks run through this executor will not be attempted`)):n.info(`A fatal exception occurred in a previous task, the queue has been purged: %o`,e.message),this.complete(t);if(this._queue.size!==0)throw Error(`Queue size should be zero after fatal: ${this._queue.size}`)}complete(e){this.withProgress(e)&&this._queue.delete(e)}attempt(e){let t=this.withProgress(e);if(!t)throw new o1(void 0,`TasksPendingQueue: attempt called for an unknown task`);return t.logger(`Starting task`),t}static getName(t=`empty`){return`task:${t}:${++e.counter}`}static{this.counter=0}}}});function $0(e,t){return{method:h1(e.commands)||``,commands:t}}function D_e(e,t){return n=>{t(`[ERROR] child process exception %o`,n),e.push(Buffer.from(String(n.stack),`ascii`))}}function e2(e,t,n,r){return i=>{n(`%s received %L bytes`,t,i),r(`%B`,i),e.push(i)}}var t2,O_e=r1({"src/lib/runners/git-executor-chain.ts"(){s1(),S0(),n0(),E_e(),t2=class{constructor(e,t,n){this._executor=e,this._scheduler=t,this._plugins=n,this._chain=Promise.resolve(),this._queue=new Q0}get cwd(){return this._cwd||this._executor.cwd}set cwd(e){this._cwd=e}get env(){return this._executor.env}get outputHandler(){return this._executor.outputHandler}chain(){return this}push(e){return this._queue.push(e),this._chain=this._chain.then(()=>this.attemptTask(e))}async attemptTask(e){let t=await this._scheduler.next(),n=()=>this._queue.complete(e);try{let{logger:t}=this._queue.attempt(e);return await(b0(e)?this.attemptEmptyTask(e,t):this.attemptRemoteTask(e,t))}catch(t){throw this.onFatalException(e,t)}finally{n(),t()}}onFatalException(e,t){let n=t instanceof o1?Object.assign(t,{task:e}):new o1(e,t&&String(t));return this._chain=Promise.resolve(),this._queue.fatal(n),n}async attemptRemoteTask(e,t){let n=this._plugins.exec(`spawn.binary`,``,$0(e,e.commands)),r=this._plugins.exec(`spawn.args`,[...e.commands],{...$0(e,e.commands),env:{...this.env}}),i=await this.gitResponse(e,n,r,this.outputHandler,t.step(`SPAWN`)),a=await this.handleTaskData(e,r,i,t.step(`HANDLE`));return t(`passing response to task's parser as a %s`,e.format),y0(e)?$1(e.parser,a):$1(e.parser,a.asStrings())}async attemptEmptyTask(e,t){return t(`empty task bypassing child process to call to task's parser`),e.parser(this)}handleTaskData(e,t,n,r){let{exitCode:i,rejection:a,stdOut:o,stdErr:s}=n;return new Promise((c,l)=>{r(`Preparing to handle process response exitCode=%d stdOut=`,i);let{error:u}=this._plugins.exec(`task.error`,{error:a},{...$0(e,t),...n});if(u&&e.onError)return r.info(`exitCode=%s handling with custom error handler`),e.onError(n,u,e=>{r.info(`custom error handler treated as success`),r(`custom error returned a %s`,M1(e)),c(new G1(Array.isArray(e)?Buffer.concat(e):e,Buffer.concat(s)))},l);if(u)return r.info(`handling as error: exitCode=%s stdErr=%s rejection=%o`,i,s.length,a),l(u);r.info(`retrieving task output complete`),c(new G1(Buffer.concat(o),Buffer.concat(s)))})}async gitResponse(e,t,n,r,i){let a=i.sibling(`output`),o=this._plugins.exec(`spawn.options`,{cwd:this.cwd,env:this.env,windowsHide:!0},$0(e,e.commands));return new Promise(s=>{let c=[],l=[];i.info(`%s %o`,t,n),i(`%O`,o);let u=this._beforeSpawn(e,n);if(u)return s({stdOut:c,stdErr:l,exitCode:9901,rejection:u});this._plugins.exec(`spawn.before`,void 0,{...$0(e,n),kill(e){u=e||u}});let d=Pe(t,n,o);d.stdout.on(`data`,e2(c,`stdOut`,i,a.step(`stdOut`))),d.stderr.on(`data`,e2(l,`stdErr`,i,a.step(`stdErr`))),d.on(`error`,D_e(l,i)),r&&(i(`Passing child process stdOut/stdErr to custom outputHandler`),r(t,d.stdout,d.stderr,[...n])),this._plugins.exec(`spawn.after`,void 0,{...$0(e,n),spawned:d,close(e,t){s({stdOut:c,stdErr:l,exitCode:e,rejection:u||t})},kill(e){d.killed||(u=e,d.kill(`SIGINT`))}})})}_beforeSpawn(e,t){let n;return this._plugins.exec(`spawn.before`,void 0,{...$0(e,t),kill(e){n=e||n}}),n}}}}),n2={};i1(n2,{GitExecutor:()=>r2});var r2,k_e=r1({"src/lib/runners/git-executor.ts"(){O_e(),r2=class{constructor(e,t,n){this.cwd=e,this._scheduler=t,this._plugins=n,this._chain=new t2(this,this._scheduler,this._plugins)}chain(){return new t2(this,this._scheduler,this._plugins)}push(e){return this._chain.push(e)}}}});function A_e(e,t,n=j1){t.then(e=>{n(null,e)},t=>{t?.task===e&&n(t instanceof c1?j_e(t):t,void 0)})}function j_e(e){let t=e=>{console.warn(`simple-git deprecation notice: accessing GitResponseError.${e} should be GitResponseError.git.${e}, this will no longer be available in version 3`),t=j1};return Object.create(e,Object.getOwnPropertyNames(e.git).reduce(n,{}));function n(n,r){return r in e||(n[r]={enumerable:!1,configurable:!1,get(){return t(r),e.git[r]}}),n}}var M_e=r1({"src/lib/task-callback.ts"(){l1(),n0()}});function i2(e,t){return h0(n=>{if(!b1(e))throw Error(`Git.cwd: cannot change to non-directory "${e}"`);return(t||n).cwd=e})}var N_e=r1({"src/lib/tasks/change-working-directory.ts"(){n0(),S0()}});function a2(e){let t=[`checkout`,...e];return t[1]===`-b`&&t.includes(`-B`)&&(t[1]=S1(t,`-B`)),_0(t)}function P_e(){return{checkout(){return this._runTask(a2(X1(arguments,1)),Q1(arguments))},checkoutBranch(e,t){return this._runTask(a2([`-b`,e,t,...X1(arguments)]),Q1(arguments))},checkoutLocalBranch(e){return this._runTask(a2([`-b`,e,...X1(arguments)]),Q1(arguments))}}}var F_e=r1({"src/lib/tasks/checkout.ts"(){n0(),S0()}});function I_e(){return{count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0}}function L_e(){return{countObjects(){return this._runTask({commands:[`count-objects`,`--verbose`],format:`utf-8`,parser(e){return e0(I_e(),[o2],e)}})}}}var o2,R_e=r1({"src/lib/tasks/count-objects.ts"(){n0(),o2=new K1(/([a-z-]+): (\d+)$/,(e,[t,n])=>{let r=w1(t);Object.hasOwn(e,r)&&(e[r]=E1(n))})}});function z_e(e){return e0({author:null,branch:``,commit:``,root:!1,summary:{changes:0,insertions:0,deletions:0}},s2,e)}var s2,B_e=r1({"src/lib/parsers/parse-commit.ts"(){n0(),s2=[new K1(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/,(e,[t,n,r])=>{e.branch=t,e.commit=r,e.root=!!n}),new K1(/\s*Author:\s(.+)/i,(e,[t])=>{let n=t.split(`<`),r=n.pop();!r||!r.includes(`@`)||(e.author={email:r.substr(0,r.length-1),name:n.join(`<`).trim()})}),new K1(/(\d+)[^,]*(?:,\s*(\d+)[^,]*)(?:,\s*(\d+))/g,(e,[t,n,r])=>{e.summary.changes=parseInt(t,10)||0,e.summary.insertions=parseInt(n,10)||0,e.summary.deletions=parseInt(r,10)||0}),new K1(/^(\d+)[^,]*(?:,\s*(\d+)[^(]+\(([+-]))?/,(e,[t,n,r])=>{e.summary.changes=parseInt(t,10)||0;let i=parseInt(n,10)||0;r===`-`?e.summary.deletions=i:r===`+`&&(e.summary.insertions=i)})]}});function V_e(e,t,n){return{commands:[`-c`,`core.abbrev=40`,`commit`,...D1(e,`-m`),...t,...n],format:`utf-8`,parser:z_e}}function H_e(){return{commit(t,...n){let r=Q1(arguments),i=e(t)||V_e(C1(t),C1(P1(n[0],V1,[])),[...T1(P1(n[1],R1,[])),...X1(arguments,0,!0)]);return this._runTask(i,r)}};function e(e){return!V1(e)&&g0(`git.commit: requires the commit message to be supplied as a string/string[]`)}}var U_e=r1({"src/lib/tasks/commit.ts"(){B_e(),n0(),S0()}});function W_e(){return{firstCommit(){return this._runTask(_0([`rev-list`,`--max-parents=0`,`HEAD`],!0),Q1(arguments))}}}var G_e=r1({"src/lib/tasks/first-commit.ts"(){n0(),S0()}});function K_e(e,t){let n=[`hash-object`,e];return t&&n.push(`-w`),_0(n,!0)}var q_e=r1({"src/lib/tasks/hash-object.ts"(){S0()}});function J_e(e,t,n){let r=String(n).trim(),i;if(i=l2.exec(r))return new c2(e,t,!1,i[1]);if(i=u2.exec(r))return new c2(e,t,!0,i[1]);let a=``,o=r.split(` `);for(;o.length;)if(o.shift()===`in`){a=o.join(` `);break}return new c2(e,t,/^re/i.test(r),a)}var c2,l2,u2,Y_e=r1({"src/lib/responses/InitSummary.ts"(){c2=class{constructor(e,t,n,r){this.bare=e,this.path=t,this.existing=n,this.gitDir=r}},l2=/^Init.+ repository in (.+)$/,u2=/^Rein.+ in (.+)$/}});function X_e(e){return e.includes(d2)}function Z_e(e=!1,t,n){let r=[`init`,...n];return e&&!X_e(r)&&r.splice(1,0,d2),{commands:r,format:`utf-8`,parser(e){return J_e(r.includes(`--bare`),t,e)}}}var d2,Q_e=r1({"src/lib/tasks/init.ts"(){Y_e(),d2=`--bare`}});function f2(e){for(let t=0;t<e.length;t++){let n=p2.exec(e[t]);if(n)return`--${n[1]}`}return``}function $_e(e){return p2.test(e)}var p2,m2=r1({"src/lib/args/log-format.ts"(){p2=/^--(stat|numstat|name-only|name-status)(=|$)/}}),h2,eve=r1({"src/lib/responses/DiffSummary.ts"(){h2=class{constructor(){this.changed=0,this.deletions=0,this.insertions=0,this.files=[]}}}});function g2(e=``){let t=x2[e];return e=>e0(new h2,t,e,!1)}var _2,v2,y2,b2,x2,S2=r1({"src/lib/parsers/parse-diff-summary.ts"(){m2(),eve(),R0(),n0(),_2=[new K1(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,(e,[t,n,r=``])=>{e.files.push({file:t.trim(),changes:E1(n),insertions:r.replace(/[^+]/g,``).length,deletions:r.replace(/[^-]/g,``).length,binary:!1})}),new K1(/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,(e,[t,n,r])=>{e.files.push({file:t.trim(),before:E1(n),after:E1(r),binary:!0})}),new K1(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,(e,[t,n])=>{let r=/(\d+) i/.exec(n),i=/(\d+) d/.exec(n);e.changed=E1(t),e.insertions=E1(r?.[1]),e.deletions=E1(i?.[1])})],v2=[new K1(/(\d+)\t(\d+)\t(.+)$/,(e,[t,n,r])=>{let i=E1(t),a=E1(n);e.changed++,e.insertions+=i,e.deletions+=a,e.files.push({file:r,changes:i+a,insertions:i,deletions:a,binary:!1})}),new K1(/-\t-\t(.+)$/,(e,[t])=>{e.changed++,e.files.push({file:t,after:0,before:0,binary:!0})})],y2=[new K1(/(.+)$/,(e,[t])=>{e.changed++,e.files.push({file:t,changes:0,insertions:0,deletions:0,binary:!1})})],b2=[new K1(/([ACDMRTUXB])([0-9]{0,3})\t(.[^\t]*)(\t(.[^\t]*))?$/,(e,[t,n,r,i,a])=>{e.changed++,e.files.push({file:a??r,changes:0,insertions:0,deletions:0,binary:!1,status:k1(v_e(t)&&t),from:k1(!!a&&r!==a&&r),similarity:E1(n)})})],x2={"":_2,"--stat":_2,"--numstat":v2,"--name-status":b2,"--name-only":y2}}});function tve(e,t){return t.reduce((t,n,r)=>(t[n]=e[r]||``,t),Object.create({diff:null}))}function C2(e=E2,t=D2,n=``){let r=g2(n);return function(n){let i=v1(n.trim(),!1,w2).map(function(n){let i=n.split(T2),a=tve(i[0].split(e),t);return i.length>1&&i[1].trim()&&(a.diff=r(i[1])),a});return{all:i,latest:i.length&&i[0]||null,total:i.length}}}var w2,T2,E2,D2,O2=r1({"src/lib/parsers/parse-list-log-summary.ts"(){n0(),S2(),m2(),w2=`òòòòòò `,T2=` òò`,E2=` ò `,D2=[`hash`,`date`,`message`,`refs`,`author_name`,`author_email`]}}),k2={};i1(k2,{diffSummaryTask:()=>nve,validateLogFormatConfig:()=>A2});function nve(e){let t=f2(e),n=[`diff`];return t===``&&(t=`--stat`,n.push(`--stat=4096`)),n.push(...e),A2(n)||{commands:n,format:`utf-8`,parser:g2(t)}}function A2(e){let t=e.filter($_e);if(t.length>1)return g0(`Summary flags are mutually exclusive - pick one of ${t.join(`,`)}`);if(t.length&&e.includes(`-z`))return g0(`Summary flag ${t} parsing is not compatible with null termination option '-z'`)}var j2=r1({"src/lib/tasks/diff.ts"(){m2(),S2(),S0()}});function rve(e,t){let n=[],r=[];return Object.keys(e).forEach(t=>{n.push(t),r.push(String(e[t]))}),[n,r.join(t)]}function ive(e){return Object.keys(e).reduce((t,n)=>(n in N2||(t[n]=e[n]),t),{})}function M2(e={},t=[]){let n=P1(e.splitter,B1,E2),[r,i]=rve(I1(e.format)?e.format:{hash:`%H`,date:e.strictDate===!1?`%ai`:`%aI`,message:`%s`,refs:`%D`,body:e.multiLine?`%B`:`%b`,author_name:e.mailMap===!1?`%an`:`%aN`,author_email:e.mailMap===!1?`%ae`:`%aE`},n),a=[],o=[`--pretty=format:${w2}${i}${T2}`,...t],s=e.n||e[`max-count`]||e.maxCount;if(s&&o.push(`--max-count=${s}`),e.from||e.to){let t=e.symmetric===!1?`..`:`...`;a.push(`${e.from||``}${t}${e.to||``}`)}return B1(e.file)&&o.push(`--follow`,J$(e.file)),Y1(ive(e),o),{fields:r,splitter:n,commands:[...o,...a]}}function ave(e,t,n){let r=C2(e,t,f2(n));return{commands:[`log`,...n],format:`utf-8`,parser:r}}function ove(){return{log(...n){let r=Q1(arguments),i=M2(Z1(arguments),T1(P1(arguments[0],R1,[]))),a=t(...n)||A2(i.commands)||e(i);return this._runTask(a,r)}};function e(e){return ave(e.splitter,e.fields,e.commands)}function t(e,t){return B1(e)&&B1(t)&&g0(`git.log(string, string) should be replaced with git.log({ from: string, to: string })`)}}var N2,P2=r1({"src/lib/tasks/log.ts"(){m2(),O2(),n0(),S0(),j2(),N2=(e=>(e[e[`--pretty`]=0]=`--pretty`,e[e[`max-count`]=1]=`max-count`,e[e.maxCount=2]=`maxCount`,e[e.n=3]=`n`,e[e.file=4]=`file`,e[e.format=5]=`format`,e[e.from=6]=`from`,e[e.to=7]=`to`,e[e.splitter=8]=`splitter`,e[e.symmetric=9]=`symmetric`,e[e.mailMap=10]=`mailMap`,e[e.multiLine=11]=`multiLine`,e[e.strictDate=12]=`strictDate`,e))(N2||{})}}),F2,I2,sve=r1({"src/lib/responses/MergeSummary.ts"(){F2=class{constructor(e,t=null,n){this.reason=e,this.file=t,this.meta=n}toString(){return`${this.file}:${this.reason}`}},I2=class{constructor(){this.conflicts=[],this.merges=[],this.result=`success`}get failed(){return this.conflicts.length>0}get reason(){return this.result}toString(){return this.conflicts.length?`CONFLICTS: ${this.conflicts.join(`, `)}`:`OK`}}}}),L2,R2,cve=r1({"src/lib/responses/PullSummary.ts"(){L2=class{constructor(){this.remoteMessages={all:[]},this.created=[],this.deleted=[],this.files=[],this.deletions={},this.insertions={},this.summary={changes:0,deletions:0,insertions:0}}},R2=class{constructor(){this.remote=``,this.hash={local:``,remote:``},this.branch={local:``,remote:``},this.message=``}toString(){return this.message}}}});function z2(e){return e.objects=e.objects||{compressing:0,counting:0,enumerating:0,packReused:0,reused:{count:0,delta:0},total:{count:0,delta:0}}}function B2(e){let t=/^\s*(\d+)/.exec(e),n=/delta (\d+)/i.exec(e);return{count:E1(t&&t[1]||`0`),delta:E1(n&&n[1]||`0`)}}var V2,lve=r1({"src/lib/parsers/parse-remote-objects.ts"(){n0(),V2=[new q1(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,(e,[t,n])=>{let r=t.toLowerCase(),i=z2(e.remoteMessages);Object.assign(i,{[r]:E1(n)})}),new q1(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,(e,[t,n])=>{let r=t.toLowerCase(),i=z2(e.remoteMessages);Object.assign(i,{[r]:E1(n)})}),new q1(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,(e,[t,n,r])=>{let i=z2(e.remoteMessages);i.total=B2(t),i.reused=B2(n),i.packReused=E1(r)})]}});function H2(e,t){return e0({remoteMessages:new W2},U2,t)}var U2,W2,G2=r1({"src/lib/parsers/parse-remote-messages.ts"(){n0(),lve(),U2=[new q1(/^remote:\s*(.+)$/,(e,[t])=>(e.remoteMessages.all.push(t.trim()),!1)),...V2,new q1([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],(e,[t])=>{e.remoteMessages.pullRequestUrl=t}),new q1([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],(e,[t,n,r])=>{e.remoteMessages.vulnerabilities={count:E1(t),summary:n,url:r}})],W2=class{constructor(){this.all=[]}}}});function uve(e,t){let n=e0(new R2,X2,[e,t]);return n.message&&n}var K2,q2,J2,Y2,X2,Z2,Q2,$2=r1({"src/lib/parsers/parse-pull.ts"(){cve(),n0(),G2(),K2=/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,q2=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,J2=/^(create|delete) mode \d+ (.+)/,Y2=[new K1(K2,(e,[t,n,r])=>{e.files.push(t),n&&(e.insertions[t]=n.length),r&&(e.deletions[t]=r.length)}),new K1(q2,(e,[t,,n,,r])=>n!==void 0||r!==void 0?(e.summary.changes=+t||0,e.summary.insertions=+n||0,e.summary.deletions=+r||0,!0):!1),new K1(J2,(e,[t,n])=>{x1(e.files,n),x1(t===`create`?e.created:e.deleted,n)})],X2=[new K1(/^from\s(.+)$/i,(e,[t])=>void(e.remote=t)),new K1(/^fatal:\s(.+)$/,(e,[t])=>void(e.message=t)),new K1(/([a-z0-9]+)\.\.([a-z0-9]+)\s+(\S+)\s+->\s+(\S+)$/,(e,[t,n,r,i])=>{e.branch.local=r,e.hash.local=t,e.branch.remote=i,e.hash.remote=n})],Z2=(e,t)=>e0(new L2,Y2,[e,t]),Q2=(e,t)=>Object.assign(new L2,Z2(e,t),H2(e,t))}}),e4,t4,n4,dve=r1({"src/lib/parsers/parse-merge.ts"(){sve(),n0(),$2(),e4=[new K1(/^Auto-merging\s+(.+)$/,(e,[t])=>{e.merges.push(t)}),new K1(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/,(e,[t,n])=>{e.conflicts.push(new F2(t,n))}),new K1(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,(e,[t,n,r])=>{e.conflicts.push(new F2(t,n,{deleteRef:r}))}),new K1(/^CONFLICT\s+\((.+)\):/,(e,[t])=>{e.conflicts.push(new F2(t,null))}),new K1(/^Automatic merge failed;\s+(.+)$/,(e,[t])=>{e.result=t})],t4=(e,t)=>Object.assign(n4(e,t),Q2(e,t)),n4=e=>e0(new I2,e4,e)}});function r4(e){return e.length?{commands:[`merge`,...e],format:`utf-8`,parser(e,t){let n=t4(e,t);if(n.failed)throw new c1(n);return n}}:g0(`Git.merge requires at least one option`)}var fve=r1({"src/lib/tasks/merge.ts"(){l1(),dve(),S0()}});function pve(e,t,n){let r=n.includes(`deleted`),i=n.includes(`tag`)||/^refs\/tags/.test(e),a=!n.includes(`new`);return{deleted:r,tag:i,branch:!i,new:!a,alreadyUpdated:a,local:e,remote:t}}var i4,a4,o4,mve=r1({"src/lib/parsers/parse-push.ts"(){n0(),G2(),i4=[new K1(/^Pushing to (.+)$/,(e,[t])=>{e.repo=t}),new K1(/^updating local tracking ref '(.+)'/,(e,[t])=>{e.ref={...e.ref||{},local:t}}),new K1(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/,(e,[t,n,r])=>{e.pushed.push(pve(t,n,r))}),new K1(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,(e,[t,n,r])=>{e.branch={...e.branch||{},local:t,remote:n,remoteName:r}}),new K1(/^([^:]+):(\S+)\s+([a-z0-9]+)\.\.([a-z0-9]+)$/,(e,[t,n,r,i])=>{e.update={head:{local:t,remote:n},hash:{from:r,to:i}}})],a4=(e,t)=>{let n=o4(e,t),r=H2(e,t);return{...n,...r}},o4=(e,t)=>e0({pushed:[]},i4,[e,t])}}),s4={};i1(s4,{pushTagsTask:()=>hve,pushTask:()=>c4});function hve(e={},t){return x1(t,`--tags`),c4(e,t)}function c4(e={},t){let n=[`push`,...t];return e.branch&&n.splice(1,0,e.branch),e.remote&&n.splice(1,0,e.remote),S1(n,`-v`),x1(n,`--verbose`),x1(n,`--porcelain`),{commands:n,format:`utf-8`,parser:a4}}var l4=r1({"src/lib/tasks/push.ts"(){mve(),n0()}});function gve(){return{showBuffer(){let e=[`show`,...X1(arguments,1)];return e.includes(`--binary`)||e.splice(1,0,`--binary`),this._runTask(v0(e),Q1(arguments))},show(){let e=[`show`,...X1(arguments,1)];return this._runTask(_0(e),Q1(arguments))}}}var _ve=r1({"src/lib/tasks/show.ts"(){n0(),S0()}}),u4,d4,vve=r1({"src/lib/responses/FileStatusSummary.ts"(){u4=/^(.+)\0(.+)$/,d4=class{constructor(e,t,n){if(this.path=e,this.index=t,this.working_dir=n,t===`R`||n===`R`){let t=u4.exec(e)||[null,e,e];this.from=t[2]||``,this.path=t[1]||``}}}}});function f4(e){let[t,n]=e.split(A1);return{from:n||t,to:t}}function p4(e,t,n){return[`${e}${t}`,n]}function m4(e,...t){return t.map(t=>p4(e,t,(e,t)=>e.conflicted.push(t)))}function yve(e,t){let n=t.trim();switch(` `){case n.charAt(2):return r(n.charAt(0),n.charAt(1),n.slice(3));case n.charAt(1):return r(` `,n.charAt(0),n.slice(2));default:return}function r(t,n,r){let i=`${t}${n}`,a=g4.get(i);a&&a(e,r),i!==`##`&&i!==`!!`&&e.files.push(new d4(r,t,n))}}var h4,g4,_4,bve=r1({"src/lib/responses/StatusSummary.ts"(){n0(),vve(),h4=class{constructor(){this.not_added=[],this.conflicted=[],this.created=[],this.deleted=[],this.ignored=void 0,this.modified=[],this.renamed=[],this.files=[],this.staged=[],this.ahead=0,this.behind=0,this.current=null,this.tracking=null,this.detached=!1,this.isClean=()=>!this.files.length}},g4=new Map([p4(` `,`A`,(e,t)=>e.created.push(t)),p4(` `,`D`,(e,t)=>e.deleted.push(t)),p4(` `,`M`,(e,t)=>e.modified.push(t)),p4(`A`,` `,(e,t)=>{e.created.push(t),e.staged.push(t)}),p4(`A`,`M`,(e,t)=>{e.created.push(t),e.staged.push(t),e.modified.push(t)}),p4(`D`,` `,(e,t)=>{e.deleted.push(t),e.staged.push(t)}),p4(`M`,` `,(e,t)=>{e.modified.push(t),e.staged.push(t)}),p4(`M`,`M`,(e,t)=>{e.modified.push(t),e.staged.push(t)}),p4(`R`,` `,(e,t)=>{e.renamed.push(f4(t))}),p4(`R`,`M`,(e,t)=>{let n=f4(t);e.renamed.push(n),e.modified.push(n.to)}),p4(`!`,`!`,(e,t)=>{(e.ignored=e.ignored||[]).push(t)}),p4(`?`,`?`,(e,t)=>e.not_added.push(t)),...m4(`A`,`A`,`U`),...m4(`D`,`D`,`U`),...m4(`U`,`A`,`D`,`U`),[`##`,(e,t)=>{let n=/ahead (\d+)/,r=/behind (\d+)/,i=/^(.+?(?=(?:\.{3}|\s|$)))/,a=/\.{3}(\S*)/,o=/\son\s(\S+?)(?=\.{3}|$)/,s=n.exec(t);e.ahead=s&&+s[1]||0,s=r.exec(t),e.behind=s&&+s[1]||0,s=i.exec(t),e.current=P1(s?.[1],B1,null),s=a.exec(t),e.tracking=P1(s?.[1],B1,null),s=o.exec(t),s&&(e.current=P1(s?.[1],B1,e.current)),e.detached=/\(no branch\)/.test(t)}]]),_4=function(e){let t=e.split(A1),n=new h4;for(let e=0,r=t.length;e<r;){let r=t[e++].trim();r&&(r.charAt(0)===`R`&&(r+=A1+(t[e++]||``)),yve(n,r))}return n}}});function xve(e){return{format:`utf-8`,commands:[`status`,`--porcelain`,`-b`,`-u`,`--null`,...e.filter(e=>!v4.includes(e))],parser(e){return _4(e)}}}var v4,Sve=r1({"src/lib/tasks/status.ts"(){bve(),v4=[`--null`,`-z`]}});function y4(e=0,t=0,n=0,r=``,i=!0){return Object.defineProperty({major:e,minor:t,patch:n,agent:r,installed:i},`toString`,{value(){return`${this.major}.${this.minor}.${this.patch}`},configurable:!1,enumerable:!1})}function Cve(){return y4(0,0,0,``,!1)}function wve(){return{version(){return this._runTask({commands:[`--version`],format:`utf-8`,parser:Tve,onError(e,t,n,r){if(e.exitCode===-2)return n(Buffer.from(b4));r(t)}})}}}function Tve(e){return e===b4?Cve():e0(y4(0,0,0,e),x4,e)}var b4,x4,Eve=r1({"src/lib/tasks/version.ts"(){n0(),b4=`installed=false`,x4=[new K1(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,(e,[t,n,r,i=``])=>{Object.assign(e,y4(E1(t),E1(n),E1(r),i))}),new K1(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,(e,[t,n,r,i=``])=>{Object.assign(e,y4(E1(t),E1(n),r,i))})]}});function S4(e,t,n,...r){return B1(n)?t(n,P1(r[0],B1),X1(arguments)):g0(`git.${e}() requires a string 'repoPath'`)}function Dve(){return{clone(e,...t){return this._runTask(S4(`clone`,C4,P1(e,B1),...t),Q1(arguments))},mirror(e,...t){return this._runTask(S4(`mirror`,w4,P1(e,B1),...t),Q1(arguments))}}}var C4,w4,Ove=r1({"src/lib/tasks/clone.ts"(){S0(),n0(),C4=(e,t,n)=>{let r=[`clone`,...n];return B1(e)&&r.push(J$(e)),B1(t)&&r.push(J$(t)),_0(r)},w4=(e,t,n)=>(x1(n,`--mirror`),C4(e,t,n))}}),T4={};i1(T4,{SimpleGitApi:()=>E4});var E4,kve=r1({"src/lib/simple-git-api.ts"(){M_e(),N_e(),F_e(),R_e(),U_e(),F0(),G_e(),U0(),q_e(),Q_e(),P2(),fve(),l4(),_ve(),Sve(),S0(),Eve(),n0(),Ove(),E4=class{constructor(e){this._executor=e}_runTask(e,t){let n=this._executor.chain(),r=n.push(e);return t&&A_e(e,r,t),Object.create(this,{then:{value:r.then.bind(r)},catch:{value:r.catch.bind(r)},_executor:{value:n}})}add(e){return this._runTask(_0([`add`,...C1(e)]),Q1(arguments))}cwd(e){let t=Q1(arguments);return typeof e==`string`?this._runTask(i2(e,this._executor),t):typeof e?.path==`string`?this._runTask(i2(e.path,e.root&&this._executor||void 0),t):this._runTask(g0(`Git.cwd: workingDirectory must be supplied as a string`),t)}hashObject(e,t){return this._runTask(K_e(e,t===!0),Q1(arguments))}init(e){return this._runTask(Z_e(e===!0,this._executor.cwd,X1(arguments)),Q1(arguments))}merge(){return this._runTask(r4(X1(arguments)),Q1(arguments))}mergeFromTo(e,t){return B1(e)&&B1(t)?this._runTask(r4([e,t,...X1(arguments)]),Q1(arguments,!1)):this._runTask(g0(`Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings`))}outputHandler(e){return this._executor.outputHandler=e,this}push(){let e=c4({remote:P1(arguments[0],B1),branch:P1(arguments[1],B1)},X1(arguments));return this._runTask(e,Q1(arguments))}stash(){return this._runTask(_0([`stash`,...X1(arguments)]),Q1(arguments))}status(){return this._runTask(xve(X1(arguments)),Q1(arguments))}},Object.assign(E4.prototype,P_e(),Dve(),H_e(),__e(),L_e(),W_e(),x_e(),ove(),gve(),wve())}}),D4={};i1(D4,{Scheduler:()=>k4});var O4,k4,Ave=r1({"src/lib/runners/scheduler.ts"(){n0(),Z0(),O4=(()=>{let e=0;return()=>{e++;let{promise:t,done:n}=(0,Z$.createDeferred)();return{promise:t,done:n,id:e}}})(),k4=class{constructor(e=2){this.concurrency=e,this.logger=X0(``,`scheduler`),this.pending=[],this.running=[],this.logger(`Constructed, concurrency=%s`,e)}schedule(){if(!this.pending.length||this.running.length>=this.concurrency){this.logger(`Schedule attempt ignored, pending=%s running=%s concurrency=%s`,this.pending.length,this.running.length,this.concurrency);return}let e=x1(this.running,this.pending.shift());this.logger(`Attempting id=%s`,e.id),e.done(()=>{this.logger(`Completing id=`,e.id),S1(this.running,e),this.schedule()})}next(){let{promise:e,id:t}=x1(this.pending,O4());return this.logger(`Scheduling id=%s`,t),this.schedule(),e}}}}),A4={};i1(A4,{applyPatchTask:()=>jve});function jve(e,t){return _0([`apply`,...t,...e])}var Mve=r1({"src/lib/tasks/apply-patch.ts"(){S0()}});function Nve(e,t){return{branch:e,hash:t,success:!0}}function Pve(e){return{branch:e,hash:null,success:!1}}var j4,Fve=r1({"src/lib/responses/BranchDeleteSummary.ts"(){j4=class{constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}});function M4(e,t){return t===1&&P4.test(e)}var N4,P4,F4,I4,Ive=r1({"src/lib/parsers/parse-branch-delete.ts"(){Fve(),n0(),N4=/(\S+)\s+\(\S+\s([^)]+)\)/,P4=/^error[^']+'([^']+)'/m,F4=[new K1(N4,(e,[t,n])=>{let r=Nve(t,n);e.all.push(r),e.branches[t]=r}),new K1(P4,(e,[t])=>{let n=Pve(t);e.errors.push(n),e.all.push(n),e.branches[t]=n})],I4=(e,t)=>e0(new j4,F4,[e,t])}}),L4,Lve=r1({"src/lib/responses/BranchSummary.ts"(){L4=class{constructor(){this.all=[],this.branches={},this.current=``,this.detached=!1}push(e,t,n,r,i){e===`*`&&(this.detached=t,this.current=n),this.all.push(n),this.branches[n]={current:e===`*`,linkedWorkTree:e===`+`,name:n,commit:r,label:i}}}}});function R4(e){return e?e.charAt(0):``}function z4(e,t=!1){return e0(new L4,t?[V4]:B4,e)}var B4,V4,Rve=r1({"src/lib/parsers/parse-branch.ts"(){Lve(),n0(),B4=[new K1(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,(e,[t,n,r,i])=>{e.push(R4(t),!0,n,r,i)}),new K1(/^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s,(e,[t,n,r,i])=>{e.push(R4(t),!1,n,r,i)})],V4=new K1(/^(\S+)$/s,(e,[t])=>{e.push(`*`,!1,t,``,``)})}}),H4={};i1(H4,{branchLocalTask:()=>Bve,branchTask:()=>zve,containsDeleteBranchCommand:()=>U4,deleteBranchTask:()=>Hve,deleteBranchesTask:()=>Vve});function U4(e){let t=[`-d`,`-D`,`--delete`];return e.some(e=>t.includes(e))}function zve(e){let t=U4(e),n=e.includes(`--show-current`),r=[`branch`,...e];return r.length===1&&r.push(`-a`),r.includes(`-v`)||r.splice(1,0,`-v`),{format:`utf-8`,commands:r,parser(e,r){return t?I4(e,r).all[0]:z4(e,n)}}}function Bve(){return{format:`utf-8`,commands:[`branch`,`-v`],parser(e){return z4(e)}}}function Vve(e,t=!1){return{format:`utf-8`,commands:[`branch`,`-v`,t?`-D`:`-d`,...e],parser(e,t){return I4(e,t)},onError({exitCode:e,stdOut:t},n,r,i){if(!M4(String(n),e))return i(n);r(t)}}}function Hve(e,t=!1){let n={format:`utf-8`,commands:[`branch`,`-v`,t?`-D`:`-d`,e],parser(t,n){return I4(t,n).branches[e]},onError({exitCode:e,stdErr:t,stdOut:r},i,a,o){if(!M4(String(i),e))return o(i);throw new c1(n.parser(O1(r),O1(t)),String(i))}};return n}var Uve=r1({"src/lib/tasks/branch.ts"(){l1(),Ive(),Rve(),n0()}});function Wve(e){let t=e.trim().replace(/^["']|["']$/g,``);return t&&he(t)}var W4,Gve=r1({"src/lib/responses/CheckIgnore.ts"(){W4=e=>e.split(/\n/g).map(Wve).filter(Boolean)}}),G4={};i1(G4,{checkIgnoreTask:()=>Kve});function Kve(e){return{commands:[`check-ignore`,...e],format:`utf-8`,parser:W4}}var qve=r1({"src/lib/tasks/check-ignore.ts"(){Gve()}});function Jve(e,t){return e0({raw:e,remote:null,branches:[],tags:[],updated:[],deleted:[]},K4,[e,t])}var K4,Yve=r1({"src/lib/parsers/parse-fetch.ts"(){n0(),K4=[new K1(/From (.+)$/,(e,[t])=>{e.remote=t}),new K1(/\* \[new branch]\s+(\S+)\s*-> (.+)$/,(e,[t,n])=>{e.branches.push({name:t,tracking:n})}),new K1(/\* \[new tag]\s+(\S+)\s*-> (.+)$/,(e,[t,n])=>{e.tags.push({name:t,tracking:n})}),new K1(/- \[deleted]\s+\S+\s*-> (.+)$/,(e,[t])=>{e.deleted.push({tracking:t})}),new K1(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,(e,[t,n,r,i])=>{e.updated.push({name:r,tracking:i,to:n,from:t})})]}}),q4={};i1(q4,{fetchTask:()=>Zve});function Xve(e){return/^--upload-pack(=|$)/.test(e)}function Zve(e,t,n){let r=[`fetch`,...n];return e&&t&&r.push(e,t),r.find(Xve)?g0(`git.fetch: potential exploit argument blocked.`):{commands:r,format:`utf-8`,parser:Jve}}var Qve=r1({"src/lib/tasks/fetch.ts"(){Yve(),S0()}});function $ve(e){return e0({moves:[]},J4,e)}var J4,eye=r1({"src/lib/parsers/parse-move.ts"(){n0(),J4=[new K1(/^Renaming (.+) to (.+)$/,(e,[t,n])=>{e.moves.push({from:t,to:n})})]}}),Y4={};i1(Y4,{moveTask:()=>tye});function tye(e,t){return{commands:[`mv`,`-v`,...C1(e),t],format:`utf-8`,parser:$ve}}var nye=r1({"src/lib/tasks/move.ts"(){eye(),n0()}}),X4={};i1(X4,{pullTask:()=>rye});function rye(e,t,n){let r=[`pull`,...n];return e&&t&&r.splice(1,0,e,t),{commands:r,format:`utf-8`,parser(e,t){return Q2(e,t)},onError(e,t,n,r){let i=uve(O1(e.stdOut),O1(e.stdErr));if(i)return r(new c1(i));r(t)}}}var iye=r1({"src/lib/tasks/pull.ts"(){l1(),$2(),n0()}});function aye(e){let t={};return Z4(e,([e])=>t[e]={name:e}),Object.values(t)}function oye(e){let t={};return Z4(e,([e,n,r])=>{Object.hasOwn(t,e)||(t[e]={name:e,refs:{fetch:``,push:``}}),r&&n&&(t[e].refs[r.replace(/[^a-z]/g,``)]=n)}),Object.values(t)}function Z4(e,t){y1(e,e=>t(e.split(/\s+/)))}var sye=r1({"src/lib/responses/GetRemoteSummary.ts"(){n0()}}),Q4={};i1(Q4,{addRemoteTask:()=>cye,getRemotesTask:()=>lye,listRemotesTask:()=>uye,remoteTask:()=>dye,removeRemoteTask:()=>fye});function cye(e,t,n){return _0([`remote`,`add`,...n,e,t])}function lye(e){let t=[`remote`];return e&&t.push(`-v`),{commands:t,format:`utf-8`,parser:e?oye:aye}}function uye(e){let t=[...e];return t[0]!==`ls-remote`&&t.unshift(`ls-remote`),_0(t)}function dye(e){let t=[...e];return t[0]!==`remote`&&t.unshift(`remote`),_0(t)}function fye(e){return _0([`remote`,`remove`,e])}var pye=r1({"src/lib/tasks/remote.ts"(){sye(),S0()}}),$4={};i1($4,{stashListTask:()=>mye});function mye(e={},t){let n=M2(e),r=[`stash`,`list`,...n.commands,...t],i=C2(n.splitter,n.fields,f2(r));return A2(r)||{commands:r,format:`utf-8`,parser:i}}var hye=r1({"src/lib/tasks/stash-list.ts"(){m2(),O2(),j2(),P2()}}),e3={};i1(e3,{addSubModuleTask:()=>gye,initSubModuleTask:()=>_ye,subModuleTask:()=>t3,updateSubModuleTask:()=>vye});function gye(e,t){return t3([`add`,e,t])}function _ye(e){return t3([`init`,...e])}function t3(e){let t=[...e];return t[0]!==`submodule`&&t.unshift(`submodule`),_0(t)}function vye(e){return t3([`update`,...e])}var yye=r1({"src/lib/tasks/sub-module.ts"(){S0()}});function bye(e,t){let n=Number.isNaN(e);return n===Number.isNaN(t)?n?n3(e,t):0:n?1:-1}function n3(e,t){return e===t?0:e>t?1:-1}function xye(e){return e.trim()}function r3(e){return typeof e==`string`&&parseInt(e.replace(/^\D+/g,``),10)||0}var i3,a3,Sye=r1({"src/lib/responses/TagList.ts"(){i3=class{constructor(e,t){this.all=e,this.latest=t}},a3=function(e,t=!1){let n=e.split(`
437
- `).map(xye).filter(Boolean);t||n.sort(function(e,t){let n=e.split(`.`),r=t.split(`.`);if(n.length===1||r.length===1)return bye(r3(n[0]),r3(r[0]));for(let e=0,t=Math.max(n.length,r.length);e<t;e++){let t=n3(r3(n[e]),r3(r[e]));if(t)return t}return 0});let r=t?n[0]:[...n].reverse().find(e=>e.indexOf(`.`)>=0);return new i3(n,r)}}}),o3={};i1(o3,{addAnnotatedTagTask:()=>Tye,addTagTask:()=>wye,tagListTask:()=>Cye});function Cye(e=[]){let t=e.some(e=>/^--sort=/.test(e));return{format:`utf-8`,commands:[`tag`,`-l`,...e],parser(e){return a3(e,t)}}}function wye(e){return{format:`utf-8`,commands:[`tag`,e],parser(){return{name:e}}}}function Tye(e,t){return{format:`utf-8`,commands:[`tag`,`-a`,`-m`,t,e],parser(){return{name:e}}}}var Eye=r1({"src/lib/tasks/tag.ts"(){Sye()}}),Dye=Bge({"src/git.js"(e,t){var{GitExecutor:n}=(k_e(),a1(n2)),{SimpleGitApi:r}=(kve(),a1(T4)),{Scheduler:i}=(Ave(),a1(D4)),{adhocExecTask:a,configurationErrorTask:o}=(S0(),a1(m0)),{asArray:s,filterArray:c,filterPrimitives:l,filterString:u,filterStringOrStringArray:d,filterType:f,getTrailingOptions:p,trailingFunctionArgument:m,trailingOptionsArgument:h}=(n0(),a1(t0)),{applyPatchTask:g}=(Mve(),a1(A4)),{branchTask:_,branchLocalTask:v,deleteBranchesTask:y,deleteBranchTask:b}=(Uve(),a1(H4)),{checkIgnoreTask:x}=(qve(),a1(G4)),{checkIsRepoTask:S}=(l0(),a1(r0)),{cleanWithOptionsTask:C,isCleanOptionsArray:w}=(A0(),a1(C0)),{diffSummaryTask:T}=(j2(),a1(k2)),{fetchTask:E}=(Qve(),a1(q4)),{moveTask:D}=(nye(),a1(Y4)),{pullTask:O}=(iye(),a1(X4)),{pushTagsTask:ee}=(l4(),a1(s4)),{addRemoteTask:te,getRemotesTask:ne,listRemotesTask:re,remoteTask:ie,removeRemoteTask:ae}=(pye(),a1(Q4)),{getResetMode:oe,resetTask:se}=(J0(),a1(W0)),{stashListTask:k}=(hye(),a1($4)),{addSubModuleTask:ce,initSubModuleTask:le,subModuleTask:ue,updateSubModuleTask:A}=(yye(),a1(e3)),{addAnnotatedTagTask:j,addTagTask:de,tagListTask:fe}=(Eye(),a1(o3)),{straightThroughBufferTask:pe,straightThroughStringTask:me}=(S0(),a1(m0));function M(e,t){this._plugins=t,this._executor=new n(e.baseDir,new i(e.maxConcurrentProcesses),t),this._trimmed=e.trimmed}(M.prototype=Object.create(r.prototype)).constructor=M,M.prototype.customBinary=function(e){return this._plugins.reconfigure(`binary`,e),this},M.prototype.env=function(e,t){return arguments.length===1&&typeof e==`object`?this._executor.env=e:(this._executor.env=this._executor.env||{})[e]=t,this},M.prototype.stashList=function(e){return this._runTask(k(h(arguments)||{},c(e)&&e||[]),m(arguments))},M.prototype.mv=function(e,t){return this._runTask(D(e,t),m(arguments))},M.prototype.checkoutLatestTag=function(e){var t=this;return this.pull(function(){t.tags(function(n,r){t.checkout(r.latest,e)})})},M.prototype.pull=function(e,t,n,r){return this._runTask(O(f(e,u),f(t,u),p(arguments)),m(arguments))},M.prototype.fetch=function(e,t){return this._runTask(E(f(e,u),f(t,u),p(arguments)),m(arguments))},M.prototype.silent=function(e){return this._runTask(a(()=>console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this method will be removed.")))},M.prototype.tags=function(e,t){return this._runTask(fe(p(arguments)),m(arguments))},M.prototype.rebase=function(){return this._runTask(me([`rebase`,...p(arguments)]),m(arguments))},M.prototype.reset=function(e){return this._runTask(se(oe(e),p(arguments)),m(arguments))},M.prototype.revert=function(e){let t=m(arguments);return typeof e==`string`?this._runTask(me([`revert`,...p(arguments,0,!0),e]),t):this._runTask(o(`Commit must be a string`),t)},M.prototype.addTag=function(e){let t=typeof e==`string`?de(e):o(`Git.addTag requires a tag name`);return this._runTask(t,m(arguments))},M.prototype.addAnnotatedTag=function(e,t){return this._runTask(j(e,t),m(arguments))},M.prototype.deleteLocalBranch=function(e,t,n){return this._runTask(b(e,typeof t==`boolean`?t:!1),m(arguments))},M.prototype.deleteLocalBranches=function(e,t,n){return this._runTask(y(e,typeof t==`boolean`?t:!1),m(arguments))},M.prototype.branch=function(e,t){return this._runTask(_(p(arguments)),m(arguments))},M.prototype.branchLocal=function(e){return this._runTask(v(),m(arguments))},M.prototype.raw=function(e){let t=!Array.isArray(e),n=[].slice.call(t?arguments:e,0);for(let e=0;e<n.length&&t;e++)if(!l(n[e])){n.splice(e,n.length-e);break}n.push(...p(arguments,0,!0));var r=m(arguments);return n.length?this._runTask(me(n,this._trimmed),r):this._runTask(o(`Raw: must supply one or more command to execute`),r)},M.prototype.submoduleAdd=function(e,t,n){return this._runTask(ce(e,t),m(arguments))},M.prototype.submoduleUpdate=function(e,t){return this._runTask(A(p(arguments,!0)),m(arguments))},M.prototype.submoduleInit=function(e,t){return this._runTask(le(p(arguments,!0)),m(arguments))},M.prototype.subModule=function(e,t){return this._runTask(ue(p(arguments)),m(arguments))},M.prototype.listRemote=function(){return this._runTask(re(p(arguments)),m(arguments))},M.prototype.addRemote=function(e,t,n){return this._runTask(te(e,t,p(arguments)),m(arguments))},M.prototype.removeRemote=function(e,t){return this._runTask(ae(e),m(arguments))},M.prototype.getRemotes=function(e,t){return this._runTask(ne(e===!0),m(arguments))},M.prototype.remote=function(e,t){return this._runTask(ie(p(arguments)),m(arguments))},M.prototype.tag=function(e,t){let n=p(arguments);return n[0]!==`tag`&&n.unshift(`tag`),this._runTask(me(n),m(arguments))},M.prototype.updateServerInfo=function(e){return this._runTask(me([`update-server-info`]),m(arguments))},M.prototype.pushTags=function(e,t){let n=ee({remote:f(e,u)},p(arguments));return this._runTask(n,m(arguments))},M.prototype.rm=function(e){return this._runTask(me([`rm`,`-f`,...s(e)]),m(arguments))},M.prototype.rmKeepLocal=function(e){return this._runTask(me([`rm`,`--cached`,...s(e)]),m(arguments))},M.prototype.catFile=function(e,t){return this._catFile(`utf-8`,arguments)},M.prototype.binaryCatFile=function(){return this._catFile(`buffer`,arguments)},M.prototype._catFile=function(e,t){var n=m(t),r=[`cat-file`],i=t[0];if(typeof i==`string`)return this._runTask(o(`Git.catFile: options must be supplied as an array of strings`),n);Array.isArray(i)&&r.push.apply(r,i);let a=e===`buffer`?pe(r):me(r);return this._runTask(a,n)},M.prototype.diff=function(e,t){let n=u(e)?o(`git.diff: supplying options as a single string is no longer supported, switch to an array of strings`):me([`diff`,...p(arguments)]);return this._runTask(n,m(arguments))},M.prototype.diffSummary=function(){return this._runTask(T(p(arguments,1)),m(arguments))},M.prototype.applyPatch=function(e){let t=d(e)?g(s(e),p([].slice.call(arguments,1))):o(`git.applyPatch requires one or more string patches as the first argument`);return this._runTask(t,m(arguments))},M.prototype.revparse=function(){let e=[`rev-parse`,...p(arguments,!0)];return this._runTask(me(e,!0),m(arguments))},M.prototype.clean=function(e,t,n){let r=w(e),i=r&&e.join(``)||f(e,u)||``,a=p([].slice.call(arguments,+!!r));return this._runTask(C(i,a),m(arguments))},M.prototype.exec=function(e){return this._runTask({commands:[],format:`utf-8`,parser(){typeof e==`function`&&e()}})},M.prototype.clearQueue=function(){return this._runTask(a(()=>console.warn(`simple-git deprecation notice: clearQueue() is deprecated and will be removed, switch to using the abortPlugin instead.`)))},M.prototype.checkIgnore=function(e,t){return this._runTask(x(s(f(e,d,[]))),m(arguments))},M.prototype.checkIsRepo=function(e,t){return this._runTask(S(f(e,u)),m(arguments))},t.exports=M}});s1(),s1(),s1(),l1(),d1(),l0(),A0(),F0(),R0(),U0(),J0(),n0(),n0(),(0,Z$.deferred)().promise,n0(),s1(),n0(),n0(),n0(),n0(),Dye(),l1(),H$(`checkpoint-chain`);function s3(e){try{return process.kill(e,0),!0}catch(e){return!!(e&&typeof e==`object`&&`code`in e&&e.code===`EPERM`)}}function Oye(e){return!(typeof e!=`number`||!Number.isInteger(e)||e<2||e>2147483647)}H$(`shadow-lock`),H$(`shadow-op-gate`),H$(`shadow-repo`),(()=>{let e=process.env.OK_GIT_TIMEOUT_MS;if(!e)return 3e4;let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>0?t:3e4})(),(()=>{let e=process.env.OK_SHADOW_MAINTENANCE_GC_TIMEOUT_MS;if(!e)return 6e5;let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>0?t:6e5})(),(()=>{let e=process.env.OK_SHADOW_STAGE_TIMEOUT_MS;if(!e)return 3e5;let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>0?t:3e5})(),jX.fileSystem,jX.gitUpstream,jX.service,jX.generator,H$(`bridge-loss-detector`),H$(`checkpoint`);function c3(e){let t=me(e).toLowerCase();return gu.includes(t)}function kye(e){let t=e.toLowerCase();for(let n of gu)if(t.endsWith(n))return e.slice(0,-n.length);return e}function Aye(e){return e===`__system__`}const jye=new Set(fu);function Mye(e){return jye.has(e)}function Nye(e){return mu(e)}function Pye(e){return Aye(e)||Mye(e)||Nye(e)}H$(`parse-pool`),Math.max(1,Math.min(4,ie()-1)),U$(()=>{}),H$(`bridge-watchdog`),U$(()=>{}),H$(`server-observers`),H$(`server-observers`),H$(`agent-sessions`);function l3(e){return{...e,windowsHide:!0}}function Fye(){try{let e=ve(pe(Se(import.meta.url)),`..`,`package.json`),t=JSON.parse(S(e,`utf-8`));if(typeof t.version==`string`&&t.version.length>0)return t.version}catch{}return`0.0.0-unknown`}Fye(),RegExp(`^(?:${`do you mind.i would like you to.i'd like you to.i want you to.i need you to.i would like to.i'd like to.i want to.i need to.we need to.we want to.we should.go ahead and.take a look at.have a look at.look into.look at.help me with.help me to.help me.can you.could you.would you.will you.can we.could we.should we.let's.lets.try to.please.kindly.hello.alright.actually.anyway.also.okay.hey.hi.yo.ok.so.pls.plz.just.maybe`.split(`.`).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`)})\\b(?:[\\s,:;!.\\-–—]+|$)`,`i`),Fe(s);const Iye=yo({source:F(),pluginProvider:F().optional(),skill:F().optional(),ref:F().optional(),contentHash:F(),files:z(F()).optional(),localHash:F().optional(),baselineRef:F().optional(),publisher:F().optional(),importedAt:za(),autoUpdate:L().optional()});yo({schema:U(1),skills:V(F(),Iye).default({})}),new Set(Object.values(Fu)),new Set([...new Set([`.git`,`node_modules`]),`scripts`,`references`]);const u3=[`agents`,`claude`,`cursor`,`codex`,`opencode`,`pi`,`copilot`];var Lye=i(((e,t)=>{t.exports=n;function n(){this.pending=0,this.max=1/0,this.listeners=[],this.waiting=[],this.error=null}n.prototype.go=function(e){this.pending<this.max?i(this,e):this.waiting.push(e)},n.prototype.wait=function(e){this.pending===0?e(this.error):this.listeners.push(e)},n.prototype.hold=function(){return r(this)};function r(e){e.pending+=1;var t=!1;return n;function n(n){if(t)throw Error(`callback called twice`);if(t=!0,e.error=e.error||n,--e.pending,e.waiting.length>0&&e.pending<e.max)i(e,e.waiting.shift());else if(e.pending===0){var a=e.listeners;e.listeners=[],a.forEach(r)}}function r(t){t(e.error)}}function i(e,t){t(r(e))}})),Rye=i((e=>{var n=t(`fs`),r=t(`util`),i=t(`stream`),a=i.Readable,o=i.PassThrough,s=Lye(),c=t(`events`).EventEmitter;e.BufferSlicer=d,e.FdSlicer=l,r.inherits(l,c);function l(e){c.call(this),this.fd=e,this.pend=new s,this.pend.max=1,this.refCount=0}l.prototype.read=function(e,t,r,i,a){var o=this;o.pend.go(function(s){n.read(o.fd,e,t,r,i,function(e,t,n){s(),a(e,t,n)})})},l.prototype.createReadStream=function(e){return new u(this,e)},l.prototype.ref=function(){this.refCount+=1},l.prototype.unref=function(){var e=this;if(--e.refCount,e.refCount<0)throw Error(`invalid unref`);if(e.refCount>0)return;n.close(e.fd,t);function t(t){t?e.emit(`error`,t):e.emit(`close`)}},r.inherits(u,a);function u(e,t){t||={},a.call(this,t),this.context=e,this.context.ref(),this.start=t.start||0,this.endOffset=t.end,this.pos=this.start}u.prototype._read=function(e){var t=this,r=Math.min(t._readableState.highWaterMark,e);if(t.endOffset!=null&&(r=Math.min(r,t.endOffset-t.pos)),r<=0){t.push(null),this._cleanup();return}t.context.pend.go(function(e){var i=Buffer.allocUnsafe(r);n.read(t.context.fd,i,0,r,t.pos,function(n,r){n?t.destroy(n):r===0?(t.push(null),t._cleanup()):(t.pos+=r,t.push(i.slice(0,r))),e()})})},u.prototype._destroy=function(e,t){this._cleanup(),t(e)},u.prototype._cleanup=function(){this.context!=null&&(this.context.unref(),this.context=null)},r.inherits(d,c);function d(e){c.call(this),this.refCount=0,this.buffer=e}d.prototype.read=function(e,t,n,r,i){if(!(0<=t&&t<=e.length))throw RangeError(`offset outside buffer: 0 <= `+t+` <= `+e.length);if(r<0)throw RangeError(`position is negative: `+r);if(t+n>e.length&&(n=e.length-t),r+n>this.buffer.length&&(n=this.buffer.length-r),n<=0){setImmediate(function(){i(null,0)});return}this.buffer.copy(e,t,r,r+n),setImmediate(function(){i(null,n)})},d.prototype.createReadStream=function(e){e||={};var t=new o(e);t.start=e.start||0,t.endOffset=e.end,t.pos=t.endOffset||this.buffer.length;for(var n=this.buffer.slice(t.start,t.pos),r=65536,i=0;;){var a=i+r;if(a>=n.length){i<n.length&&t.write(n.slice(i,n.length));break}t.write(n.slice(i,a)),i=a}return t.end(),t},d.prototype.ref=function(){this.refCount+=1},d.prototype.unref=function(){if(--this.refCount,this.refCount<0)throw Error(`invalid unref`)}})),zye=i(((e,t)=>{let n=new Int32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117]);function r(e){let t=-1;for(let r of e)t=n[(t^r)&255]^t>>>8;return(t^-1)>>>0}t.exports=r}));i((e=>{t(`fs`);var n=t(`zlib`);Rye();var r=t(`util`),i=t(`events`).EventEmitter,a=t(`stream`).Transform,o=t(`stream`).PassThrough,s=t(`stream`).Writable;let c=typeof n.crc32==`function`?n.crc32:zye();r.inherits(l,i);function l(e,t,n,r,a,o,s,c,l,u){var f=this;i.call(f),f.reader=e,f.reader.on(`error`,function(e){d(f,e)}),f.reader.once(`close`,function(){f.emit(`close`)}),f.readEntryCursor=t,f.fileSize=n,f.entryCount=r,f.comment=a,f.entriesRead=0,f.autoClose=!!o,f.lazyEntries=!!s,f.decodeStrings=!!c,f.validateEntrySizes=!!l,f.strictFileNames=!!u,f.isOpen=!0,f.emittedError=!1,f.hasEachEntryBeenCalled=!1,f.lazyEntries||f._readEntry()}l.prototype.close=function(){this.isOpen&&(this.isOpen=!1,this.reader.unref())};function u(e,t){e.autoClose&&e.close(),d(e,t)}function d(e,t){e.emittedError||(e.emittedError=!0,e.emit(`error`,t))}l.prototype.readEntry=function(){if(!this.lazyEntries)throw Error(`readEntry() called without lazyEntries:true`);this._readEntry()},l.prototype._readEntry=function(){var e=this;if(e.entryCount===e.entriesRead){setImmediate(function(){e.autoClose&&e.close(),!e.emittedError&&e.emit(`end`)});return}if(!e.emittedError){var t=T(46);v(e.reader,t,0,t.length,e.readEntryCursor,function(n){if(n)return u(e,n);if(!e.emittedError){var r=new f,i=t.readUInt32LE(0);if(i!==33639248)return u(e,Error(`invalid central directory file header signature: 0x`+i.toString(16)));if(r.versionMadeBy=t.readUInt16LE(4),r.versionNeededToExtract=t.readUInt16LE(6),r.generalPurposeBitFlag=t.readUInt16LE(8),r.compressionMethod=t.readUInt16LE(10),r.lastModFileTime=t.readUInt16LE(12),r.lastModFileDate=t.readUInt16LE(14),r.crc32=t.readUInt32LE(16),r.compressedSize=t.readUInt32LE(20),r.uncompressedSize=t.readUInt32LE(24),r.fileNameLength=t.readUInt16LE(28),r.extraFieldLength=t.readUInt16LE(30),r.fileCommentLength=t.readUInt16LE(32),r.internalFileAttributes=t.readUInt16LE(36),r.externalFileAttributes=t.readUInt32LE(38),r.relativeOffsetOfLocalHeader=t.readUInt32LE(42),r.generalPurposeBitFlag&64)return u(e,Error(`strong encryption is not supported`));e.readEntryCursor+=46,t=T(r.fileNameLength+r.extraFieldLength+r.fileCommentLength),v(e.reader,t,0,t.length,e.readEntryCursor,function(n){if(n)return u(e,n);if(!e.emittedError){r.fileNameRaw=t.subarray(0,r.fileNameLength);var i=r.fileNameLength+r.extraFieldLength;r.extraFieldRaw=t.subarray(r.fileNameLength,i),r.fileCommentRaw=t.subarray(i,i+r.fileCommentLength);try{r.extraFields=_(r.extraFieldRaw)}catch(t){return u(e,t)}if(e.decodeStrings){var a=(r.generalPurposeBitFlag&2048)!=0;r.fileComment=C(r.fileCommentRaw,a),r.fileName=h(r.generalPurposeBitFlag,r.fileNameRaw,r.extraFields,e.strictFileNames);var o=g(r.fileName);if(o!=null)return u(e,Error(o))}else r.fileComment=r.fileCommentRaw,r.fileName=r.fileNameRaw;r.comment=r.fileComment,e.readEntryCursor+=t.length,e.entriesRead+=1;for(var s=0;s<r.extraFields.length;s++){var c=r.extraFields[s];if(c.id===1){var l=c.data,d=0;if(r.uncompressedSize===4294967295){if(d+8>l.length)return u(e,Error(`zip64 extended information extra field does not include uncompressed size`));r.uncompressedSize=w(l,d),d+=8}if(r.compressedSize===4294967295){if(d+8>l.length)return u(e,Error(`zip64 extended information extra field does not include compressed size`));r.compressedSize=w(l,d),d+=8}if(r.relativeOffsetOfLocalHeader===4294967295){if(d+8>l.length)return u(e,Error(`zip64 extended information extra field does not include relative header offset`));r.relativeOffsetOfLocalHeader=w(l,d),d+=8}break}}if(e.validateEntrySizes&&r.compressionMethod===0){var f=r.uncompressedSize;if(r.isEncrypted()&&(f+=12),r.compressedSize!==f){var p=`compressed/uncompressed size mismatch for stored file: `+r.compressedSize+` != `+r.uncompressedSize;return u(e,Error(p))}}e.emit(`entry`,r),e.lazyEntries||e._readEntry()}})}})}},l.prototype.eachEntry=function(){let e=this;if(!e.lazyEntries)throw Error(`eachEntry() requires lazyEntries: true`);if(e.hasEachEntryBeenCalled)throw Error(`eachEntry() must only be called once per ZipFile`);e.hasEachEntryBeenCalled=!0;let t=null;e.on(`entry`,r),e.on(`end`,i),e.on(`error`,a);function n(){e.removeListener(`entry`,r),e.removeListener(`end`,i),e.removeListener(`error`,a),e.autoClose&&e.close()}function r(e){let{resolve:n}=t;t=null,n({value:e})}function i(){let{resolve:e}=t;t=null,n(),e({done:!0})}function a(e){let{reject:r}=t;t=null,n(),r(e)}return{[Symbol.asyncIterator](){return this},next(){let n=new Promise((e,n)=>{if(t!=null)throw Error(`next() called before previous Promise was resolved.`);t={resolve:e,reject:n}});return e.readEntry(),n},return(e){return n(),Promise.resolve({done:!0,value:e})},throw(e){return n(),Promise.reject(e)}}},l.prototype.openReadStream=function(e,t,n){var r=this,i=0,a=e.compressedSize;if(n??(n=t,t=null),t==null)t={};else{if(t.decodeFileData===!1){if(t.decrypt!=null)throw Error(`cannot use options.decrypt when options.decodeFileData === false`);if(t.decompress!=null)throw Error(`cannot use options.decompress when options.decodeFileData === false`)}else{if(t.decrypt!=null){if(!e.isEncrypted())throw Error(`options.decrypt can only be specified for encrypted entries. See also option decodeFileData.`);if(t.decrypt!==!1)throw Error(`invalid options.decrypt value: `+t.decrypt);if(e.isCompressed()&&t.decompress!==!1)throw Error(`entry is encrypted and compressed, and options.decompress !== false. See also option decodeFileData.`)}if(t.decompress!=null){if(!e.isCompressed())throw Error(`options.decompress can only be specified for compressed entries. See also option decodeFileData.`);if(!(t.decompress===!1||t.decompress===!0))throw Error(`invalid options.decompress value: `+t.decompress);s=t.decompress}}if(t.start!=null){if(i=t.start,i<0)throw Error(`options.start < 0`);if(i>e.compressedSize)throw Error(`options.start > entry.compressedSize`)}if(t.end!=null){if(a=t.end,a<0)throw Error(`options.end < 0`);if(a>e.compressedSize)throw Error(`options.end > entry.compressedSize`);if(a<i)throw Error(`options.end < options.start`)}}var o=t.decodeFileData===!1||(e.compressionMethod===0||e.compressionMethod===8&&t.decompress===!1)&&(!e.isEncrypted()||t.decrypt===!1);if((t.start!=null||t.end!=null)&&!o)throw Error(`start/end range require options.decodeFileData === false for non-trivial encoded entries.`);if(!r.isOpen)return n(Error(`closed`));if(e.isEncrypted()&&!o&&t.decrypt!==!1)return n(Error(`entry is encrypted, and options.decodeFileData !== false`));var s;if(o)s=!1;else if(e.compressionMethod===8)s=t.decodeFileData!==!0;else return n(Error(`unsupported compression method: `+e.compressionMethod));r.readLocalFileHeader(e,{minimal:!0},function(t,o){if(t)return n(t);r.openReadStreamLowLevel(o.fileDataStart,e.compressedSize,i,a,s,e.uncompressedSize,n)})},l.prototype.openReadStreamLowLevel=function(e,t,r,i,a,o,s){var c=this;e+t;var l=c.reader.createReadStream({start:e+r,end:e+i}),u=l;if(a){var d=!1,f=n.createInflateRaw();l.on(`error`,function(e){setImmediate(function(){d||f.emit(`error`,e)})}),l.pipe(f),c.validateEntrySizes?(u=new y(o),f.on(`error`,function(e){setImmediate(function(){d||u.emit(`error`,e)})}),f.pipe(u)):u=f,E(u,function(){d=!0,f!==u&&f.unpipe(u),l.unpipe(f),l.destroy()})}s(null,u)},l.prototype.readLocalFileHeader=function(e,t,n){var r=this;n??(n=t,t=null),t??={},r.reader.ref();var i=T(30);v(r.reader,i,0,i.length,e.relativeOffsetOfLocalHeader,function(a){try{if(a)return n(a);var o=i.readUInt32LE(0);if(o!==67324752)return n(Error(`invalid local file header signature: 0x`+o.toString(16)));var s=i.readUInt16LE(26),c=i.readUInt16LE(28),l=e.relativeOffsetOfLocalHeader+30+s+c;if(l+e.compressedSize>r.fileSize)return n(Error(`file data overflows file bounds: `+l+` + `+e.compressedSize+` > `+r.fileSize));if(t.minimal)return n(null,{fileDataStart:l});var u=new p;u.fileDataStart=l,u.versionNeededToExtract=i.readUInt16LE(4),u.generalPurposeBitFlag=i.readUInt16LE(6),u.compressionMethod=i.readUInt16LE(8),u.lastModFileTime=i.readUInt16LE(10),u.lastModFileDate=i.readUInt16LE(12),u.crc32=i.readUInt32LE(14),u.compressedSize=i.readUInt32LE(18),u.uncompressedSize=i.readUInt32LE(22),u.fileNameLength=s,u.extraFieldLength=c,i=T(s+c),r.reader.ref(),v(r.reader,i,0,i.length,e.relativeOffsetOfLocalHeader+30,function(e){try{return e?n(e):(u.fileName=i.subarray(0,s),u.extraField=i.subarray(s),n(null,u))}finally{r.reader.unref()}})}finally{r.reader.unref()}})},l.prototype.openReadStreamPromise=function(e,t){return new Promise((n,r)=>{this.openReadStream(e,t,function(e,t){if(e)return r(e);n(t)})})},l.prototype.openReadStreamLowLevelPromise=function(e,t,n,r,i,a){return new Promise((o,s)=>{this.openReadStream(e,t,n,r,i,a,function(e,t){if(e)return s(e);o(t)})})},l.prototype.readLocalFileHeaderPromise=function(e,t){return new Promise((n,r)=>{this.readLocalFileHeader(e,t,function(e,t){if(e)return r(e);n(t)})})};function f(){}f.prototype.getLastModDate=function(e){if(e??={},!e.forceDosFormat)for(var t=0;t<this.extraFields.length;t++){var n=this.extraFields[t];if(n.id===21589){var r=n.data;if(r.length<5||!(r[0]&1))continue;var i=r.readInt32LE(1);return new Date(i*1e3)}else if(n.id===10){var r=n.data;if(r.length!==32||r.readUInt16LE(4)!==1||r.readUInt16LE(6)!==24)continue;var a=(r.readUInt32LE(8)+4294967296*r.readInt32LE(12))/1e4-0xa9730b66800;return new Date(a)}}return m(this.lastModFileDate,this.lastModFileTime,e.timezone)},f.prototype.canDecodeFileData=function(){return!this.isEncrypted()&&(this.compressionMethod===0||this.compressionMethod===8)},f.prototype.isEncrypted=function(){return(this.generalPurposeBitFlag&1)!=0},f.prototype.isCompressed=function(){return this.compressionMethod===8};function p(){}function m(e,t,n){var r=e&31,i=(e>>5&15)-1,a=(e>>9&127)+1980,o=0,s=(t&31)*2,c=t>>5&63,l=t>>11&31;if(n==null||n===`local`)return new Date(a,i,r,l,c,s,o);if(n===`UTC`)return new Date(Date.UTC(a,i,r,l,c,s,o));throw Error(`unrecognized options.timezone: `+options.timezone)}function h(e,t,n,r){for(var i=null,a=0;a<n.length;a++){var o=n[a];if(o.id===28789){if(o.data.length<6||o.data.readUInt8(0)!==1)continue;var s=o.data.readUInt32LE(1);if(c(t)!==s)continue;i=C(o.data.subarray(5),!0);break}}return i??=C(t,(e&2048)!=0),r||(i=i.replace(/\\/g,`/`)),i}function g(e){return e.indexOf(`\\`)===-1?/^[a-zA-Z]:/.test(e)||/^\//.test(e)?`absolute path: `+e:e.split(`/`).indexOf(`..`)===-1?null:`invalid relative path: `+e:`invalid characters in fileName: `+e}function _(e){for(var t=[],n=0;n<e.length-3;){var r=e.readUInt16LE(n+0),i=e.readUInt16LE(n+2),a=n+4,o=a+i;if(o>e.length)throw Error(`extra field length exceeds extra field buffer size`);var s=e.subarray(a,o);t.push({id:r,data:s}),n=o}return t}function v(e,t,n,r,i,a){if(r===0)return setImmediate(function(){a(null,T(0))});e.read(t,n,r,i,function(e,t){if(e)return a(e);if(t<r)return a(Error(`unexpected EOF`));a()})}r.inherits(y,a);function y(e){a.call(this),this.actualByteCount=0,this.expectedByteCount=e}y.prototype._transform=function(e,t,n){if(this.actualByteCount+=e.length,this.actualByteCount>this.expectedByteCount){var r=`too many bytes in the stream. expected `+this.expectedByteCount+`. got at least `+this.actualByteCount;return n(Error(r))}n(null,e)},y.prototype._flush=function(e){if(this.actualByteCount<this.expectedByteCount){var t=`not enough bytes in the stream. expected `+this.expectedByteCount+`. got only `+this.actualByteCount;return e(Error(t))}e()},r.inherits(b,i);function b(){i.call(this),this.refCount=0}b.prototype.ref=function(){this.refCount+=1},b.prototype.unref=function(){var e=this;if(--e.refCount,e.refCount>0)return;if(e.refCount<0)throw Error(`invalid unref`);e.close(t);function t(t){if(t)return e.emit(`error`,t);e.emit(`close`)}},b.prototype.createReadStream=function(e){e??={};var t=e.start,n=e.end;if(t===n){var r=new o;return setImmediate(function(){r.end()}),r}var i=this._readStreamForRange(t,n),a=!1,s=new x(this);i.on(`error`,function(e){setImmediate(function(){a||s.emit(`error`,e)})}),E(s,function(){i.unpipe(s),s.unref(),i.destroy()});var c=new y(n-t);return s.on(`error`,function(e){setImmediate(function(){a||c.emit(`error`,e)})}),E(c,function(){a=!0,s.unpipe(c),s.destroy()}),i.pipe(s).pipe(c)},b.prototype._readStreamForRange=function(e,t){throw Error(`not implemented`)},b.prototype.read=function(e,t,n,r,i){var a=this.createReadStream({start:r,end:r+n}),o=new s,c=0;o._write=function(n,r,i){n.copy(e,t+c,0,n.length),c+=n.length,i()},o.on(`finish`,i),a.on(`error`,function(e){i(e)}),a.pipe(o)},b.prototype.close=function(e){setImmediate(e)},r.inherits(x,o);function x(e){o.call(this),this.context=e,this.context.ref(),this.unreffedYet=!1}x.prototype._flush=function(e){this.unref(),e()},x.prototype.unref=function(e){this.unreffedYet||(this.unreffedYet=!0,this.context.unref())};var S=`\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■\xA0`;function C(e,t){if(t)return e.toString(`utf8`);for(var n=``,r=0;r<e.length;r++)n+=S[e[r]];return n}function w(e,t){var n=e.readUInt32LE(t);return e.readUInt32LE(t+4)*4294967296+n}var T=typeof Buffer.allocUnsafe==`function`?function(e){return Buffer.allocUnsafe(e)}:function(e){return new Buffer(e)};function E(e,t){typeof e.destroy==`function`?e._destroy=function(e,n){t(),n?.(e)}:e.destroy=t}}))(),Object.freeze({source:`local`,skipStoreHooks:!0,context:Object.freeze({origin:`effect-capture`,paired:!1})});var Bye=e(a(),1);const d3={discovery:`open-knowledge-discovery`,project:`open-knowledge`,"write-skill":`open-knowledge-write-skill`};new Set(Object.values(d3));const Vye=Object.keys(d3),Hye={discovery:`user`,project:`project`,"write-skill":`user`},f3=Vye.filter(e=>Hye[e]===`user`);new Set(f3.map(e=>d3[e]));const p3=`OpenKnowledge.app/Contents/Resources/cli/dist/assets/skills`;function Uye(e,t={}){let n=t.platform??process.platform,r=t.checkDesktop??!1,i=t.home??oe(),a=[],o=process.env.NODE_ENV===`test`;r&&n===`darwin`&&(o||a.push(N(`/Applications`,p3,e)),(!o||t.home!==void 0)&&a.push(N(i,`Applications`,p3,e))),a.push(Se(new URL(`../dist/assets/skills/${e}`,import.meta.url))),a.push(Se(new URL(`../assets/skills/${e}`,import.meta.url))),a.push(Se(new URL(`./assets/skills/${e}`,import.meta.url)));for(let e of a)if(g(e))return e;throw Error(`Bundled skill asset directory not found for bundle '${e}'. Tried: ${a.join(`, `)}. This usually means the CLI build did not copy packages/server/assets into dist/assets. Run \`cd packages/cli && bun run build\` before publishing.`)}H$(`embeddings`),H$(`embeddings`);function Wye(e){try{let t=new URL(e),n=t.pathname.replace(/\/+$/,``);return`${t.protocol}//${t.host.toLowerCase()}${n}`}catch{return e.trim().replace(/\/+$/,``)}}Wye(Ys),H$(`embeddings`),H$(`embeddings`);function m3(e){return e.replace(/\\/g,`/`)}H$(`installed-skills-marker`),RegExp(`<(${XJ.map(e=>e.tagName).join(`|`)})\\b([^>]*)\\/>`,`y`);const Gye=String.raw`\[\[([^\n#[\]|]+)(?:#([^\n[\]|]+))?(?:\|([^\n[\]]+))?\]\]`,Kye=String.raw`\((<[^>\n]+>|[^)\s\n]+)((?:\s+(?:"[^"\n]*"|'[^'\n]*'|\([^)\n]*\)))?)\)`,h3=String.raw`([^\]\n]*)`,g3=String.raw`([^\]\n]*(?:\][^[\]\n]*)?)`,_3=e=>RegExp(`(!?)${Gye}`,e),v3=(e,t)=>RegExp(`(!?)\\[${e}\\]${Kye}`,t);_3(`y`),_3(`g`),v3(h3,`y`),v3(g3,`y`),v3(h3,`g`),v3(g3,`g`);const qye=String.raw`(!?)\[([^\]\n]*)\](?:\[([^\]\n]*)\])?`;new RegExp(qye,`y`);var y3=e(i(((e,t)=>{function n(e){return Array.isArray(e)?e:[e]}let r=/^\s+$/,i=/(?:[^\\]|^)\\$/,a=/^\\!/,o=/^\\#/,s=/\r?\n/g,c=/^\.*\/|^\.+$/,l=`node-ignore`;typeof Symbol<`u`&&(l=Symbol.for(`node-ignore`));let u=l,d=(e,t,n)=>Object.defineProperty(e,t,{value:n}),f=/([0-z])-([0-z])/g,p=()=>!1,m=e=>e.replace(f,(e,t,n)=>t.charCodeAt(0)<=n.charCodeAt(0)?e:``),h=e=>{let{length:t}=e;return e.slice(0,t-t%2)},g=[[/^\uFEFF/,()=>``],[/((?:\\\\)*?)(\\?\s+)$/,(e,t,n)=>t+(n.indexOf(`\\`)===0?` `:``)],[/(\\+?)\s/g,(e,t)=>{let{length:n}=t;return t.slice(0,n-n%2)+` `}],[/[\\$.|*+(){^]/g,e=>`\\${e}`],[/(?!\\)\?/g,()=>`[^/]`],[/^\//,()=>`^`],[/\//g,()=>`\\/`],[/^\^*\\\*\\\*\\\//,()=>`^(?:.*\\/)?`],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?`^`:`(?:^|\\/)`}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(e,t,n)=>t+6<n.length?`(?:\\/[^\\/]+)*`:`\\/.+`],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(e,t,n)=>t+n.replace(/\\\*/g,`[^\\/]*`)],[/\\\\\\(?=[$.|*+(){^])/g,()=>`\\`],[/\\\\/g,()=>`\\`],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,n,r,i)=>t===`\\`?`\\[${n}${h(r)}${i}`:i===`]`&&r.length%2==0?`[${m(n)}${r}]`:`[]`],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(e,t)=>`${t?`${t}[^/]+`:`[^/]*`}(?=$|\\/$)`]],_=Object.create(null),v=(e,t)=>{let n=_[e];return n||(n=g.reduce((t,[n,r])=>t.replace(n,r.bind(e)),e),_[e]=n),t?new RegExp(n,`i`):new RegExp(n)},y=e=>typeof e==`string`,b=e=>e&&y(e)&&!r.test(e)&&!i.test(e)&&e.indexOf(`#`)!==0,x=e=>e.split(s);var S=class{constructor(e,t,n,r){this.origin=e,this.pattern=t,this.negative=n,this.regex=r}};let C=(e,t)=>{let n=e,r=!1;e.indexOf(`!`)===0&&(r=!0,e=e.substr(1)),e=e.replace(a,`!`).replace(o,`#`);let i=v(e,t);return new S(n,e,r,i)},w=(e,t)=>{throw new t(e)},T=(e,t,n)=>y(e)?e?T.isNotRelative(e)?n(`path should be a \`path.relative()\`d string, but got "${t}"`,RangeError):!0:n(`path must not be empty`,TypeError):n(`path must be a string, but got \`${t}\``,TypeError),E=e=>c.test(e);T.isNotRelative=E,T.convert=e=>e;var D=class{constructor({ignorecase:e=!0,ignoreCase:t=e,allowRelativePaths:n=!1}={}){d(this,u,!0),this._rules=[],this._ignoreCase=t,this._allowRelativePaths=n,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}_addPattern(e){if(e&&e[u]){this._rules=this._rules.concat(e._rules),this._added=!0;return}if(b(e)){let t=C(e,this._ignoreCase);this._added=!0,this._rules.push(t)}}add(e){return this._added=!1,n(y(e)?x(e):e).forEach(this._addPattern,this),this._added&&this._initCache(),this}addPattern(e){return this.add(e)}_testOne(e,t){let n=!1,r=!1;return this._rules.forEach(i=>{let{negative:a}=i;r===a&&n!==r||a&&!n&&!r&&!t||i.regex.test(e)&&(n=!a,r=a)}),{ignored:n,unignored:r}}_test(e,t,n,r){let i=e&&T.convert(e);return T(i,e,this._allowRelativePaths?p:w),this._t(i,t,n,r)}_t(e,t,n,r){if(e in t)return t[e];if(r||=e.split(`/`),r.pop(),!r.length)return t[e]=this._testOne(e,n);let i=this._t(r.join(`/`)+`/`,t,n,r);return t[e]=i.ignored?i:this._testOne(e,n)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return n(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}};let O=e=>new D(e);if(O.isPathValid=e=>T(e&&T.convert(e),e,p),O.default=O,t.exports=O,typeof process<`u`&&(process.env&&process.env.IGNORE_TEST_WIN32||process.platform===`win32`)){T.convert=e=>/^\\\\\?\\/.test(e)||/["<>|\u0000-\u001F]+/u.test(e)?e:e.replace(/\\/g,`/`);let e=/^[a-z]:\//i;T.isNotRelative=t=>e.test(t)||E(t)}}))(),1);function b3(e){try{return O(ve(e,`.ok/config.yml`)).isFile()}catch(e){let t=e?.code;if(t===`ENOENT`||t===`ENOTDIR`)return!1;throw e}}const x3=H$(`content-filter`);Fe(s);const S3=[`.claude`,`.cursor`,`.codex`,`.agents`,`.opencode`,`.pi`],C3=new Set([`node_modules`,`.venv`,`venv`,`env`,`__pycache__`,`vendor`,`dist`,`build`,`out`,`output`,`.next`,`.nuxt`,`.svelte-kit`,`.astro`,`.turbo`,`.cache`,`.parcel-cache`,`coverage`,`.git`,`.ok`,`.open-knowledge`,`.openknowledge`,...S3,`Library`,`Applications`,`.Trash`]),Jye=new Set([`.git`,`node_modules`,`.ok`,`.open-knowledge`,`.openknowledge`,...S3]),w3=new Set([`worktrees`,`local`]);function T3(e){let t=ec(e);if(!tc(t))throw Error(`Invalid attachment folder path`);if(t===`./`)return{kind:`sibling`};if(t===`/`||t===`.`)return{kind:`content-root`};let n=t.startsWith(`./`),r=(n?t.slice(2):t).split(`/`).filter(e=>e!==``&&e!==`.`).join(`/`);return r===``?n?{kind:`sibling`}:{kind:`content-root`}:{kind:n?`doc-relative`:`fixed`,path:r}}function Yye(e){throw Error(`[AttachmentFolderShape] unhandled variant: ${JSON.stringify(e)}`)}function Xye(e,t,n){let r=me(e).slice(1).toLowerCase();if(!Ms.has(r)||t.kind===`sibling`)return!1;let i=e.lastIndexOf(`/`),a=i===-1?``:e.slice(0,i);if(t.kind===`content-root`)return a===``;if(t.kind===`fixed`)return a===t.path||a.startsWith(`${t.path}/`);if(t.kind===`doc-relative`){let e=a===``?[]:a.split(`/`),r=t.path.split(`/`);for(let t=0;t<=e.length-r.length;t++)if(r.every((n,r)=>e[t+r]===n)&&n(e.slice(0,t).join(`/`)))return!0;return!1}return Yye(t)}function E3(e,t){let n=e.split(`/`);for(let e=0;e<n.length;e++){let r=n[e],i=r.toLowerCase()===`.ok`?`.ok`:r;if(Jye.has(i)&&!(t&&i===`.ok`&&!w3.has((n[e+1]??``).toLowerCase())))return!0}return!1}function D3(e){return e.startsWith(`${hu}/`)}function Zye(e){return e===`.ok`||e===`.ok/skills`||e.startsWith(`.ok/skills/`)}const O3=new Set([`.ok`,...S3]),Qye=new Set([...C3].filter(e=>!O3.has(e))),$ye=[`.git`,`node_modules`,`.ok/local`,`.ok/worktrees`].flatMap(e=>[e,`${e}/**`,`**/${e}`,`**/${e}/**`]);function ebe(e){let t=e.replace(/^\/+/,``).replace(/\/+$/,``).split(`/`);return t.includes(`..`)?!1:t.some(e=>Qye.has(e))?!0:t.some((e,n)=>e.toLowerCase()===`.ok`&&w3.has((t[n+1]??``).toLowerCase()))}const tbe=[`.gitignore`,`.ok`,`.ok/config.yml`,`.ok/.gitignore`,`.ok/schemas/frontmatter.json`,`.ok/templates/example.md`,`.ok/skills/example/SKILL.md`,`docs/.ok`,`docs/.ok/frontmatter.yml`,`docs/.ok/templates/example.md`,...S3.flatMap(e=>[e,`${e}/skills/example/SKILL.md`])];function nbe(e){let t=e.trim();if(!t||t.startsWith(`!`)||t.startsWith(`#`))return!1;let n=t.replace(/^\/+/,``).replace(/\/+$/,``).split(`/`);if(n.includes(`..`))return!0;if(ebe(t))return!1;if(n.some(e=>O3.has(e)))return!0;try{let e=(0,y3.default)().add(t);return tbe.some(t=>e.ignores(t))}catch{return!0}}function rbe(e){let t=e.filter(e=>e.length>0&&!e.startsWith(`!`)&&!e.startsWith(`#`)&&!nbe(e));return[...new Set([...t,...$ye])]}function k3(e,t){for(let n=0;n<t;n++)if(C3.has(e[n])||e[n].toLowerCase()===`.ok`)return!0;return!1}function A3(e){let t=e.split(`/`),n=t.length;return n<3||t[n-3]!==`.ok`||t[n-2]!==`templates`||me(t[n-1])!==`.md`?!1:!k3(t,n-3)}function j3(e){let t=e.split(`/`),n=t.length;return t[n-1]===`.ok`?!k3(t,n-1):n>=2&&t[n-1]===`templates`&&t[n-2]===`.ok`?!k3(t,n-2):!1}function ibe(e){let t=e.split(`/`),n=t.length;return t[0]===`.ok`&&(n===2&&(t[1]===`config.yml`||t[1]===`.gitignore`)||n===3&&t[1]===`schemas`&&t[2].toLowerCase().endsWith(`.json`))||A3(e)?!0:n>=2&&t[n-1]===`frontmatter.yml`&&t[n-2]===`.ok`?!k3(t,n-2):!1}function abe(e){return e===`.ok`||e===`.ok/schemas`?!0:j3(e)}function obe(e,t){for(let n of t)if(e===n||e.startsWith(`${n}/`))return!0;return!1}function M3(e,t){if(t.size===0)return!1;for(let n of t)if(e.startsWith(`${n}/`))return!0;return!1}function sbe(e,t){if(t.size===0)return!1;for(let n of t)if(n===e||n.startsWith(`${e}/`)||e.startsWith(`${n}/`))return!0;return!1}const cbe=new Set([`.ds_store`,`.localized`,`thumbs.db`,`desktop.ini`,`.directory`]);function N3(e){return cbe.has(e.slice(e.lastIndexOf(`/`)+1).toLowerCase())}const lbe=new Set([`.ssh`,`.aws`,`.gnupg`,`.kube`,`.docker`]);function P3(e){for(let t of e.split(`/`))if(lbe.has(t.toLowerCase()))return!0;return!1}const ube=new Set([`credentials`,`.netrc`,`.npmrc`,`.pgpass`,`.git-credentials`]),dbe=[`.pem`,`.key`,`.p12`,`.pfx`,`.keystore`,`.jks`,`.ppk`];function F3(e){let t=e.slice(e.lastIndexOf(`/`)+1).toLowerCase();if(t===`.env`||t.startsWith(`.env.`)||ube.has(t)||t.startsWith(`id_rsa`)||t.startsWith(`id_ed25519`)||t.startsWith(`id_ecdsa`)||t.startsWith(`id_dsa`))return!0;for(let e of dbe)if(t.endsWith(e))return!0;return!1}function fbe(e,t){return t===e||t.startsWith(`${e}/`)}function pbe(e,t,n){let r=n===void 0,i=new Map;function a(e){let t=i.get(e);if(t!==void 0)return t;let n;try{n=b3(e)}catch{return!1}return i.set(e,n),n}return{isInside(n,i){if(!r||n===``)return!1;let o=i?.pathBase===`project`?e:t;for(let e of n.split(`/`))if(o=N(o,e),a(o))return!0;return!1},reset(){i.clear()}}}const I3=[`.gitignore`,`.okignore`];function mbe(e,t){let n=hbe(e);if(n===null)return[];let r=[];L3(N(n,`info`,`exclude`),t,r,`info/exclude`);let i=gbe(e);return i&&L3(i,t,r,`global excludesfile`),r}function hbe(e){let t=u(`git`,[`rev-parse`,`--git-common-dir`],l3({cwd:e,encoding:`utf-8`,timeout:5e3}));return t.status!==0||!t.stdout?null:ve(e,t.stdout.trim())}function gbe(e){let t=u(`git`,[`config`,`--get`,`--type=path`,`core.excludesfile`],l3({cwd:e,encoding:`utf-8`,timeout:5e3}));if(t.status===0&&t.stdout){let e=t.stdout.trim();if(e)return e}return _be()}function _be(){let e=process.env.XDG_CONFIG_HOME?.trim();return N(e&&e.length>0?e:N(oe(),`.config`),`git`,`ignore`)}function L3(e,t,n,r){if(g(e))try{let r=S(e,`utf-8`);t.value+=r.length,n.push(...z3(r))}catch(t){x3.warn({path:e,err:t},`Failed to read ${r} at ${e}`)}}function vbe(e){let{projectDir:t,contentDir:n,onAfterRebuild:r,singleDocRelPath:i}=e,a=e.inPlaceSkillDirs??new Set,o=T3(e.attachmentFolderPath??`./`),s=e.skillRootPaths??new Set,c=pbe(t,n,i),l=m3(_e(t,n)),u=l.startsWith(`..`),d,f,p,m,h=0,_=0,v=0;function y(){let e=(0,y3.default)(),r=(0,y3.default)();e.add(`.git`);let i=[],a=0,o=0;for(let n of I3){let o=N(t,n);if(g(o))try{let t=S(o,`utf-8`);a+=t.length;let s=z3(t);i.push(...s),e.add(s),n===`.okignore`&&r.add(s)}catch(e){x3.warn({path:o,err:e},`Failed to read ${n} at ${o}`)}}if(l&&!u)for(let t of I3){let i=N(n,t);if(g(i))try{let n=S(i,`utf-8`);a+=n.length,o++;let s=z3(n).map(e=>B3(e,l));e.add(s),t===`.okignore`&&r.add(s)}catch(e){x3.warn({path:i,err:e},`Failed to read ${t} at ${i}`)}}let s={value:a};o+=V3(n,t,e,r,s),a=s.value;let c=mbe(t,s);a=s.value,c.length>0&&(i.push(...c),e.add(c));let y=rbe(i);return d=e,f=r,p=i,m=y,h=i.length,_=o,v=a,{patternCount:h,nestedFileCount:_,bytes:v}}y();let b=new Map;function x(e,t){if(u&&t?.pathBase!==`project`)return!1;let n=t?.pathBase===`project`||!l?e:`${l}/${e}`;return n.startsWith(`..`)?!1:d.ignores(n)}function C(e,t){return t.pathBase===`project`||!l?e:`${l}/${e}`}function w(e){if(u)return!1;let t=l?`${l}/${e}`:e;return f.ignores(t)}let T=()=>{i===void 0&&R3(n,``,x,b)};T();function E(e){return Pye(kye(e))}function D(e){for(let t of e.split(`/`))if(C3.has(t))return!0;return u?!1:x(e)}let O=null,ee=null;return{isExcluded(e,t){if(E(e)||F3(e)||P3(e)||c.isInside(e,t?.syncScope)||!t?.bypassFilters&&obe(e,s)&&!M3(e,a))return!0;if(!t?.bypassFilters&&(D3(e)||M3(e,a)&&!x(e))){if(i!==void 0)return e!==i;if(c3(e))return!1;let t=me(e).slice(1).toLowerCase();return!Ms.has(t)}if(!t?.bypassFilters&&A3(e)||!t?.bypassFilters&&t?.syncScope!==void 0&&ibe(C(e,t.syncScope))&&!x(e,t.syncScope))return i===void 0?!1:e!==i;if(E3(e,t?.showOk)||N3(e))return!0;if(i!==void 0)return e!==i;if(t?.bypassFilters)return t.respectOkignore===!0&&w(e);if(D(e))return!0;if(c3(e)||Xye(e,o,e=>(b.get(e)??0)>0))return!1;let n=me(e).slice(1).toLowerCase();if(Ms.has(n)){let t=pe(e),n=t===`.`?``:t;if((b.get(n)??0)>0)return!1}return!0},isDirExcluded(e,t){if(P3(e)||c.isInside(e,t?.syncScope))return!0;if(!t?.bypassFilters&&(Zye(e)||j3(e)||t?.syncScope!==void 0&&abe(C(e,t.syncScope))||sbe(e,a)))return!1;if(E3(e,t?.showOk))return!0;if(i!==void 0)return!fbe(e,i);if(t?.bypassFilters)return t.respectOkignore===!0&&(w(e)||w(`${e}/`));for(let t of e.split(`/`))if(C3.has(t))return!0;return u?!1:x(e,t?.syncScope)||x(`${e}/`,t?.syncScope)},isPathIgnored(e,t){return E(e)||F3(e)||P3(e)?!0:D3(e)||M3(e,a)&&!x(e)||A3(e)?!1:E3(e)||N3(e)?!0:t?.bypassFilters?!1:D(e)},getWatcherIgnoreGlobs(){return m},incrementMdDir(e){let t=e===`.`?``:e;b.set(t,(b.get(t)??0)+1)},decrementMdDir(e){let t=e===`.`?``:e,n=b.get(t)??0;n<=1?b.delete(t):b.set(t,n-1)},rebuildDirCount(){let e=new Map(b);b.clear();try{T()}catch(t){for(let[t,n]of e)b.set(t,n);x3.warn({err:t instanceof Error?t:Error(String(t))},`content-filter rebuildDirCount walk failed — retaining previous counts`)}},setAttachmentFolderPath(e){o=T3(e)},refreshInPlaceSkillDirs(){if(e.rescanInPlaceSkillDirs)try{a=e.rescanInPlaceSkillDirs()}catch(e){x3.warn({err:e},`in-place skill re-scan failed — keeping previous allow-list`)}},inPlaceSkillDirsFingerprint(){return[...a].sort().join(`
437
+ `).map(xye).filter(Boolean);t||n.sort(function(e,t){let n=e.split(`.`),r=t.split(`.`);if(n.length===1||r.length===1)return bye(r3(n[0]),r3(r[0]));for(let e=0,t=Math.max(n.length,r.length);e<t;e++){let t=n3(r3(n[e]),r3(r[e]));if(t)return t}return 0});let r=t?n[0]:[...n].reverse().find(e=>e.indexOf(`.`)>=0);return new i3(n,r)}}}),o3={};i1(o3,{addAnnotatedTagTask:()=>Tye,addTagTask:()=>wye,tagListTask:()=>Cye});function Cye(e=[]){let t=e.some(e=>/^--sort=/.test(e));return{format:`utf-8`,commands:[`tag`,`-l`,...e],parser(e){return a3(e,t)}}}function wye(e){return{format:`utf-8`,commands:[`tag`,e],parser(){return{name:e}}}}function Tye(e,t){return{format:`utf-8`,commands:[`tag`,`-a`,`-m`,t,e],parser(){return{name:e}}}}var Eye=r1({"src/lib/tasks/tag.ts"(){Sye()}}),Dye=Bge({"src/git.js"(e,t){var{GitExecutor:n}=(k_e(),a1(n2)),{SimpleGitApi:r}=(kve(),a1(T4)),{Scheduler:i}=(Ave(),a1(D4)),{adhocExecTask:a,configurationErrorTask:o}=(S0(),a1(m0)),{asArray:s,filterArray:c,filterPrimitives:l,filterString:u,filterStringOrStringArray:d,filterType:f,getTrailingOptions:p,trailingFunctionArgument:m,trailingOptionsArgument:h}=(n0(),a1(t0)),{applyPatchTask:g}=(Mve(),a1(A4)),{branchTask:_,branchLocalTask:v,deleteBranchesTask:y,deleteBranchTask:b}=(Uve(),a1(H4)),{checkIgnoreTask:x}=(qve(),a1(G4)),{checkIsRepoTask:S}=(l0(),a1(r0)),{cleanWithOptionsTask:C,isCleanOptionsArray:w}=(A0(),a1(C0)),{diffSummaryTask:T}=(j2(),a1(k2)),{fetchTask:E}=(Qve(),a1(q4)),{moveTask:D}=(nye(),a1(Y4)),{pullTask:O}=(iye(),a1(X4)),{pushTagsTask:ee}=(l4(),a1(s4)),{addRemoteTask:te,getRemotesTask:ne,listRemotesTask:re,remoteTask:ie,removeRemoteTask:ae}=(pye(),a1(Q4)),{getResetMode:oe,resetTask:se}=(J0(),a1(W0)),{stashListTask:k}=(hye(),a1($4)),{addSubModuleTask:ce,initSubModuleTask:le,subModuleTask:ue,updateSubModuleTask:A}=(yye(),a1(e3)),{addAnnotatedTagTask:j,addTagTask:de,tagListTask:fe}=(Eye(),a1(o3)),{straightThroughBufferTask:pe,straightThroughStringTask:me}=(S0(),a1(m0));function M(e,t){this._plugins=t,this._executor=new n(e.baseDir,new i(e.maxConcurrentProcesses),t),this._trimmed=e.trimmed}(M.prototype=Object.create(r.prototype)).constructor=M,M.prototype.customBinary=function(e){return this._plugins.reconfigure(`binary`,e),this},M.prototype.env=function(e,t){return arguments.length===1&&typeof e==`object`?this._executor.env=e:(this._executor.env=this._executor.env||{})[e]=t,this},M.prototype.stashList=function(e){return this._runTask(k(h(arguments)||{},c(e)&&e||[]),m(arguments))},M.prototype.mv=function(e,t){return this._runTask(D(e,t),m(arguments))},M.prototype.checkoutLatestTag=function(e){var t=this;return this.pull(function(){t.tags(function(n,r){t.checkout(r.latest,e)})})},M.prototype.pull=function(e,t,n,r){return this._runTask(O(f(e,u),f(t,u),p(arguments)),m(arguments))},M.prototype.fetch=function(e,t){return this._runTask(E(f(e,u),f(t,u),p(arguments)),m(arguments))},M.prototype.silent=function(e){return this._runTask(a(()=>console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this method will be removed.")))},M.prototype.tags=function(e,t){return this._runTask(fe(p(arguments)),m(arguments))},M.prototype.rebase=function(){return this._runTask(me([`rebase`,...p(arguments)]),m(arguments))},M.prototype.reset=function(e){return this._runTask(se(oe(e),p(arguments)),m(arguments))},M.prototype.revert=function(e){let t=m(arguments);return typeof e==`string`?this._runTask(me([`revert`,...p(arguments,0,!0),e]),t):this._runTask(o(`Commit must be a string`),t)},M.prototype.addTag=function(e){let t=typeof e==`string`?de(e):o(`Git.addTag requires a tag name`);return this._runTask(t,m(arguments))},M.prototype.addAnnotatedTag=function(e,t){return this._runTask(j(e,t),m(arguments))},M.prototype.deleteLocalBranch=function(e,t,n){return this._runTask(b(e,typeof t==`boolean`?t:!1),m(arguments))},M.prototype.deleteLocalBranches=function(e,t,n){return this._runTask(y(e,typeof t==`boolean`?t:!1),m(arguments))},M.prototype.branch=function(e,t){return this._runTask(_(p(arguments)),m(arguments))},M.prototype.branchLocal=function(e){return this._runTask(v(),m(arguments))},M.prototype.raw=function(e){let t=!Array.isArray(e),n=[].slice.call(t?arguments:e,0);for(let e=0;e<n.length&&t;e++)if(!l(n[e])){n.splice(e,n.length-e);break}n.push(...p(arguments,0,!0));var r=m(arguments);return n.length?this._runTask(me(n,this._trimmed),r):this._runTask(o(`Raw: must supply one or more command to execute`),r)},M.prototype.submoduleAdd=function(e,t,n){return this._runTask(ce(e,t),m(arguments))},M.prototype.submoduleUpdate=function(e,t){return this._runTask(A(p(arguments,!0)),m(arguments))},M.prototype.submoduleInit=function(e,t){return this._runTask(le(p(arguments,!0)),m(arguments))},M.prototype.subModule=function(e,t){return this._runTask(ue(p(arguments)),m(arguments))},M.prototype.listRemote=function(){return this._runTask(re(p(arguments)),m(arguments))},M.prototype.addRemote=function(e,t,n){return this._runTask(te(e,t,p(arguments)),m(arguments))},M.prototype.removeRemote=function(e,t){return this._runTask(ae(e),m(arguments))},M.prototype.getRemotes=function(e,t){return this._runTask(ne(e===!0),m(arguments))},M.prototype.remote=function(e,t){return this._runTask(ie(p(arguments)),m(arguments))},M.prototype.tag=function(e,t){let n=p(arguments);return n[0]!==`tag`&&n.unshift(`tag`),this._runTask(me(n),m(arguments))},M.prototype.updateServerInfo=function(e){return this._runTask(me([`update-server-info`]),m(arguments))},M.prototype.pushTags=function(e,t){let n=ee({remote:f(e,u)},p(arguments));return this._runTask(n,m(arguments))},M.prototype.rm=function(e){return this._runTask(me([`rm`,`-f`,...s(e)]),m(arguments))},M.prototype.rmKeepLocal=function(e){return this._runTask(me([`rm`,`--cached`,...s(e)]),m(arguments))},M.prototype.catFile=function(e,t){return this._catFile(`utf-8`,arguments)},M.prototype.binaryCatFile=function(){return this._catFile(`buffer`,arguments)},M.prototype._catFile=function(e,t){var n=m(t),r=[`cat-file`],i=t[0];if(typeof i==`string`)return this._runTask(o(`Git.catFile: options must be supplied as an array of strings`),n);Array.isArray(i)&&r.push.apply(r,i);let a=e===`buffer`?pe(r):me(r);return this._runTask(a,n)},M.prototype.diff=function(e,t){let n=u(e)?o(`git.diff: supplying options as a single string is no longer supported, switch to an array of strings`):me([`diff`,...p(arguments)]);return this._runTask(n,m(arguments))},M.prototype.diffSummary=function(){return this._runTask(T(p(arguments,1)),m(arguments))},M.prototype.applyPatch=function(e){let t=d(e)?g(s(e),p([].slice.call(arguments,1))):o(`git.applyPatch requires one or more string patches as the first argument`);return this._runTask(t,m(arguments))},M.prototype.revparse=function(){let e=[`rev-parse`,...p(arguments,!0)];return this._runTask(me(e,!0),m(arguments))},M.prototype.clean=function(e,t,n){let r=w(e),i=r&&e.join(``)||f(e,u)||``,a=p([].slice.call(arguments,+!!r));return this._runTask(C(i,a),m(arguments))},M.prototype.exec=function(e){return this._runTask({commands:[],format:`utf-8`,parser(){typeof e==`function`&&e()}})},M.prototype.clearQueue=function(){return this._runTask(a(()=>console.warn(`simple-git deprecation notice: clearQueue() is deprecated and will be removed, switch to using the abortPlugin instead.`)))},M.prototype.checkIgnore=function(e,t){return this._runTask(x(s(f(e,d,[]))),m(arguments))},M.prototype.checkIsRepo=function(e,t){return this._runTask(S(f(e,u)),m(arguments))},t.exports=M}});s1(),s1(),s1(),l1(),d1(),l0(),A0(),F0(),R0(),U0(),J0(),n0(),n0(),(0,Z$.deferred)().promise,n0(),s1(),n0(),n0(),n0(),n0(),Dye(),l1(),H$(`checkpoint-chain`);function s3(e){try{return process.kill(e,0),!0}catch(e){return!!(e&&typeof e==`object`&&`code`in e&&e.code===`EPERM`)}}function Oye(e){return!(typeof e!=`number`||!Number.isInteger(e)||e<2||e>2147483647)}H$(`shadow-lock`),H$(`shadow-op-gate`),H$(`shadow-repo`),(()=>{let e=process.env.OK_GIT_TIMEOUT_MS;if(!e)return 3e4;let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>0?t:3e4})(),(()=>{let e=process.env.OK_SHADOW_MAINTENANCE_GC_TIMEOUT_MS;if(!e)return 6e5;let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>0?t:6e5})(),(()=>{let e=process.env.OK_SHADOW_STAGE_TIMEOUT_MS;if(!e)return 3e5;let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>0?t:3e5})(),jX.fileSystem,jX.gitUpstream,jX.service,jX.generator,H$(`bridge-loss-detector`),H$(`checkpoint`);function c3(e){let t=me(e).toLowerCase();return gu.includes(t)}function kye(e){let t=e.toLowerCase();for(let n of gu)if(t.endsWith(n))return e.slice(0,-n.length);return e}function Aye(e){return e===`__system__`}const jye=new Set(fu);function Mye(e){return jye.has(e)}function Nye(e){return mu(e)}function Pye(e){return Aye(e)||Mye(e)||Nye(e)}H$(`parse-pool`),Math.max(1,Math.min(4,ie()-1)),U$(()=>{}),H$(`bridge-watchdog`),U$(()=>{}),H$(`server-observers`),H$(`server-observers`),H$(`agent-sessions`);function l3(e){return{...e,windowsHide:!0}}function Fye(){try{let e=ve(pe(Se(import.meta.url)),`..`,`package.json`),t=JSON.parse(S(e,`utf-8`));if(typeof t.version==`string`&&t.version.length>0)return t.version}catch{}return`0.0.0-unknown`}Fye(),RegExp(`^(?:${`do you mind.i would like you to.i'd like you to.i want you to.i need you to.i would like to.i'd like to.i want to.i need to.we need to.we want to.we should.go ahead and.take a look at.have a look at.look into.look at.help me with.help me to.help me.can you.could you.would you.will you.can we.could we.should we.let's.lets.try to.please.kindly.hello.alright.actually.anyway.also.okay.hey.hi.yo.ok.so.pls.plz.just.maybe`.split(`.`).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`)})\\b(?:[\\s,:;!.\\-–—]+|$)`,`i`),Fe(s);const Iye=yo({source:F(),pluginProvider:F().optional(),skill:F().optional(),ref:F().optional(),contentHash:F(),files:z(F()).optional(),localHash:F().optional(),baselineRef:F().optional(),publisher:F().optional(),importedAt:za(),autoUpdate:L().optional()});yo({schema:U(1),skills:V(F(),Iye).default({})}),new Set(Object.values(Fu)),new Set([...new Set([`.git`,`node_modules`]),`scripts`,`references`]);const u3=[`agents`,`claude`,`cursor`,`codex`,`opencode`,`pi`,`copilot`];var Lye=i(((e,t)=>{t.exports=n;function n(){this.pending=0,this.max=1/0,this.listeners=[],this.waiting=[],this.error=null}n.prototype.go=function(e){this.pending<this.max?i(this,e):this.waiting.push(e)},n.prototype.wait=function(e){this.pending===0?e(this.error):this.listeners.push(e)},n.prototype.hold=function(){return r(this)};function r(e){e.pending+=1;var t=!1;return n;function n(n){if(t)throw Error(`callback called twice`);if(t=!0,e.error=e.error||n,--e.pending,e.waiting.length>0&&e.pending<e.max)i(e,e.waiting.shift());else if(e.pending===0){var a=e.listeners;e.listeners=[],a.forEach(r)}}function r(t){t(e.error)}}function i(e,t){t(r(e))}})),Rye=i((e=>{var n=t(`fs`),r=t(`util`),i=t(`stream`),a=i.Readable,o=i.PassThrough,s=Lye(),c=t(`events`).EventEmitter;e.BufferSlicer=d,e.FdSlicer=l,r.inherits(l,c);function l(e){c.call(this),this.fd=e,this.pend=new s,this.pend.max=1,this.refCount=0}l.prototype.read=function(e,t,r,i,a){var o=this;o.pend.go(function(s){n.read(o.fd,e,t,r,i,function(e,t,n){s(),a(e,t,n)})})},l.prototype.createReadStream=function(e){return new u(this,e)},l.prototype.ref=function(){this.refCount+=1},l.prototype.unref=function(){var e=this;if(--e.refCount,e.refCount<0)throw Error(`invalid unref`);if(e.refCount>0)return;n.close(e.fd,t);function t(t){t?e.emit(`error`,t):e.emit(`close`)}},r.inherits(u,a);function u(e,t){t||={},a.call(this,t),this.context=e,this.context.ref(),this.start=t.start||0,this.endOffset=t.end,this.pos=this.start}u.prototype._read=function(e){var t=this,r=Math.min(t._readableState.highWaterMark,e);if(t.endOffset!=null&&(r=Math.min(r,t.endOffset-t.pos)),r<=0){t.push(null),this._cleanup();return}t.context.pend.go(function(e){var i=Buffer.allocUnsafe(r);n.read(t.context.fd,i,0,r,t.pos,function(n,r){n?t.destroy(n):r===0?(t.push(null),t._cleanup()):(t.pos+=r,t.push(i.slice(0,r))),e()})})},u.prototype._destroy=function(e,t){this._cleanup(),t(e)},u.prototype._cleanup=function(){this.context!=null&&(this.context.unref(),this.context=null)},r.inherits(d,c);function d(e){c.call(this),this.refCount=0,this.buffer=e}d.prototype.read=function(e,t,n,r,i){if(!(0<=t&&t<=e.length))throw RangeError(`offset outside buffer: 0 <= `+t+` <= `+e.length);if(r<0)throw RangeError(`position is negative: `+r);if(t+n>e.length&&(n=e.length-t),r+n>this.buffer.length&&(n=this.buffer.length-r),n<=0){setImmediate(function(){i(null,0)});return}this.buffer.copy(e,t,r,r+n),setImmediate(function(){i(null,n)})},d.prototype.createReadStream=function(e){e||={};var t=new o(e);t.start=e.start||0,t.endOffset=e.end,t.pos=t.endOffset||this.buffer.length;for(var n=this.buffer.slice(t.start,t.pos),r=65536,i=0;;){var a=i+r;if(a>=n.length){i<n.length&&t.write(n.slice(i,n.length));break}t.write(n.slice(i,a)),i=a}return t.end(),t},d.prototype.ref=function(){this.refCount+=1},d.prototype.unref=function(){if(--this.refCount,this.refCount<0)throw Error(`invalid unref`)}})),zye=i(((e,t)=>{let n=new Int32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117]);function r(e){let t=-1;for(let r of e)t=n[(t^r)&255]^t>>>8;return(t^-1)>>>0}t.exports=r}));i((e=>{t(`fs`);var n=t(`zlib`);Rye();var r=t(`util`),i=t(`events`).EventEmitter,a=t(`stream`).Transform,o=t(`stream`).PassThrough,s=t(`stream`).Writable;let c=typeof n.crc32==`function`?n.crc32:zye();r.inherits(l,i);function l(e,t,n,r,a,o,s,c,l,u){var f=this;i.call(f),f.reader=e,f.reader.on(`error`,function(e){d(f,e)}),f.reader.once(`close`,function(){f.emit(`close`)}),f.readEntryCursor=t,f.fileSize=n,f.entryCount=r,f.comment=a,f.entriesRead=0,f.autoClose=!!o,f.lazyEntries=!!s,f.decodeStrings=!!c,f.validateEntrySizes=!!l,f.strictFileNames=!!u,f.isOpen=!0,f.emittedError=!1,f.hasEachEntryBeenCalled=!1,f.lazyEntries||f._readEntry()}l.prototype.close=function(){this.isOpen&&(this.isOpen=!1,this.reader.unref())};function u(e,t){e.autoClose&&e.close(),d(e,t)}function d(e,t){e.emittedError||(e.emittedError=!0,e.emit(`error`,t))}l.prototype.readEntry=function(){if(!this.lazyEntries)throw Error(`readEntry() called without lazyEntries:true`);this._readEntry()},l.prototype._readEntry=function(){var e=this;if(e.entryCount===e.entriesRead){setImmediate(function(){e.autoClose&&e.close(),!e.emittedError&&e.emit(`end`)});return}if(!e.emittedError){var t=T(46);v(e.reader,t,0,t.length,e.readEntryCursor,function(n){if(n)return u(e,n);if(!e.emittedError){var r=new f,i=t.readUInt32LE(0);if(i!==33639248)return u(e,Error(`invalid central directory file header signature: 0x`+i.toString(16)));if(r.versionMadeBy=t.readUInt16LE(4),r.versionNeededToExtract=t.readUInt16LE(6),r.generalPurposeBitFlag=t.readUInt16LE(8),r.compressionMethod=t.readUInt16LE(10),r.lastModFileTime=t.readUInt16LE(12),r.lastModFileDate=t.readUInt16LE(14),r.crc32=t.readUInt32LE(16),r.compressedSize=t.readUInt32LE(20),r.uncompressedSize=t.readUInt32LE(24),r.fileNameLength=t.readUInt16LE(28),r.extraFieldLength=t.readUInt16LE(30),r.fileCommentLength=t.readUInt16LE(32),r.internalFileAttributes=t.readUInt16LE(36),r.externalFileAttributes=t.readUInt32LE(38),r.relativeOffsetOfLocalHeader=t.readUInt32LE(42),r.generalPurposeBitFlag&64)return u(e,Error(`strong encryption is not supported`));e.readEntryCursor+=46,t=T(r.fileNameLength+r.extraFieldLength+r.fileCommentLength),v(e.reader,t,0,t.length,e.readEntryCursor,function(n){if(n)return u(e,n);if(!e.emittedError){r.fileNameRaw=t.subarray(0,r.fileNameLength);var i=r.fileNameLength+r.extraFieldLength;r.extraFieldRaw=t.subarray(r.fileNameLength,i),r.fileCommentRaw=t.subarray(i,i+r.fileCommentLength);try{r.extraFields=_(r.extraFieldRaw)}catch(t){return u(e,t)}if(e.decodeStrings){var a=(r.generalPurposeBitFlag&2048)!=0;r.fileComment=C(r.fileCommentRaw,a),r.fileName=h(r.generalPurposeBitFlag,r.fileNameRaw,r.extraFields,e.strictFileNames);var o=g(r.fileName);if(o!=null)return u(e,Error(o))}else r.fileComment=r.fileCommentRaw,r.fileName=r.fileNameRaw;r.comment=r.fileComment,e.readEntryCursor+=t.length,e.entriesRead+=1;for(var s=0;s<r.extraFields.length;s++){var c=r.extraFields[s];if(c.id===1){var l=c.data,d=0;if(r.uncompressedSize===4294967295){if(d+8>l.length)return u(e,Error(`zip64 extended information extra field does not include uncompressed size`));r.uncompressedSize=w(l,d),d+=8}if(r.compressedSize===4294967295){if(d+8>l.length)return u(e,Error(`zip64 extended information extra field does not include compressed size`));r.compressedSize=w(l,d),d+=8}if(r.relativeOffsetOfLocalHeader===4294967295){if(d+8>l.length)return u(e,Error(`zip64 extended information extra field does not include relative header offset`));r.relativeOffsetOfLocalHeader=w(l,d),d+=8}break}}if(e.validateEntrySizes&&r.compressionMethod===0){var f=r.uncompressedSize;if(r.isEncrypted()&&(f+=12),r.compressedSize!==f){var p=`compressed/uncompressed size mismatch for stored file: `+r.compressedSize+` != `+r.uncompressedSize;return u(e,Error(p))}}e.emit(`entry`,r),e.lazyEntries||e._readEntry()}})}})}},l.prototype.eachEntry=function(){let e=this;if(!e.lazyEntries)throw Error(`eachEntry() requires lazyEntries: true`);if(e.hasEachEntryBeenCalled)throw Error(`eachEntry() must only be called once per ZipFile`);e.hasEachEntryBeenCalled=!0;let t=null;e.on(`entry`,r),e.on(`end`,i),e.on(`error`,a);function n(){e.removeListener(`entry`,r),e.removeListener(`end`,i),e.removeListener(`error`,a),e.autoClose&&e.close()}function r(e){let{resolve:n}=t;t=null,n({value:e})}function i(){let{resolve:e}=t;t=null,n(),e({done:!0})}function a(e){let{reject:r}=t;t=null,n(),r(e)}return{[Symbol.asyncIterator](){return this},next(){let n=new Promise((e,n)=>{if(t!=null)throw Error(`next() called before previous Promise was resolved.`);t={resolve:e,reject:n}});return e.readEntry(),n},return(e){return n(),Promise.resolve({done:!0,value:e})},throw(e){return n(),Promise.reject(e)}}},l.prototype.openReadStream=function(e,t,n){var r=this,i=0,a=e.compressedSize;if(n??(n=t,t=null),t==null)t={};else{if(t.decodeFileData===!1){if(t.decrypt!=null)throw Error(`cannot use options.decrypt when options.decodeFileData === false`);if(t.decompress!=null)throw Error(`cannot use options.decompress when options.decodeFileData === false`)}else{if(t.decrypt!=null){if(!e.isEncrypted())throw Error(`options.decrypt can only be specified for encrypted entries. See also option decodeFileData.`);if(t.decrypt!==!1)throw Error(`invalid options.decrypt value: `+t.decrypt);if(e.isCompressed()&&t.decompress!==!1)throw Error(`entry is encrypted and compressed, and options.decompress !== false. See also option decodeFileData.`)}if(t.decompress!=null){if(!e.isCompressed())throw Error(`options.decompress can only be specified for compressed entries. See also option decodeFileData.`);if(!(t.decompress===!1||t.decompress===!0))throw Error(`invalid options.decompress value: `+t.decompress);s=t.decompress}}if(t.start!=null){if(i=t.start,i<0)throw Error(`options.start < 0`);if(i>e.compressedSize)throw Error(`options.start > entry.compressedSize`)}if(t.end!=null){if(a=t.end,a<0)throw Error(`options.end < 0`);if(a>e.compressedSize)throw Error(`options.end > entry.compressedSize`);if(a<i)throw Error(`options.end < options.start`)}}var o=t.decodeFileData===!1||(e.compressionMethod===0||e.compressionMethod===8&&t.decompress===!1)&&(!e.isEncrypted()||t.decrypt===!1);if((t.start!=null||t.end!=null)&&!o)throw Error(`start/end range require options.decodeFileData === false for non-trivial encoded entries.`);if(!r.isOpen)return n(Error(`closed`));if(e.isEncrypted()&&!o&&t.decrypt!==!1)return n(Error(`entry is encrypted, and options.decodeFileData !== false`));var s;if(o)s=!1;else if(e.compressionMethod===8)s=t.decodeFileData!==!0;else return n(Error(`unsupported compression method: `+e.compressionMethod));r.readLocalFileHeader(e,{minimal:!0},function(t,o){if(t)return n(t);r.openReadStreamLowLevel(o.fileDataStart,e.compressedSize,i,a,s,e.uncompressedSize,n)})},l.prototype.openReadStreamLowLevel=function(e,t,r,i,a,o,s){var c=this;e+t;var l=c.reader.createReadStream({start:e+r,end:e+i}),u=l;if(a){var d=!1,f=n.createInflateRaw();l.on(`error`,function(e){setImmediate(function(){d||f.emit(`error`,e)})}),l.pipe(f),c.validateEntrySizes?(u=new y(o),f.on(`error`,function(e){setImmediate(function(){d||u.emit(`error`,e)})}),f.pipe(u)):u=f,E(u,function(){d=!0,f!==u&&f.unpipe(u),l.unpipe(f),l.destroy()})}s(null,u)},l.prototype.readLocalFileHeader=function(e,t,n){var r=this;n??(n=t,t=null),t??={},r.reader.ref();var i=T(30);v(r.reader,i,0,i.length,e.relativeOffsetOfLocalHeader,function(a){try{if(a)return n(a);var o=i.readUInt32LE(0);if(o!==67324752)return n(Error(`invalid local file header signature: 0x`+o.toString(16)));var s=i.readUInt16LE(26),c=i.readUInt16LE(28),l=e.relativeOffsetOfLocalHeader+30+s+c;if(l+e.compressedSize>r.fileSize)return n(Error(`file data overflows file bounds: `+l+` + `+e.compressedSize+` > `+r.fileSize));if(t.minimal)return n(null,{fileDataStart:l});var u=new p;u.fileDataStart=l,u.versionNeededToExtract=i.readUInt16LE(4),u.generalPurposeBitFlag=i.readUInt16LE(6),u.compressionMethod=i.readUInt16LE(8),u.lastModFileTime=i.readUInt16LE(10),u.lastModFileDate=i.readUInt16LE(12),u.crc32=i.readUInt32LE(14),u.compressedSize=i.readUInt32LE(18),u.uncompressedSize=i.readUInt32LE(22),u.fileNameLength=s,u.extraFieldLength=c,i=T(s+c),r.reader.ref(),v(r.reader,i,0,i.length,e.relativeOffsetOfLocalHeader+30,function(e){try{return e?n(e):(u.fileName=i.subarray(0,s),u.extraField=i.subarray(s),n(null,u))}finally{r.reader.unref()}})}finally{r.reader.unref()}})},l.prototype.openReadStreamPromise=function(e,t){return new Promise((n,r)=>{this.openReadStream(e,t,function(e,t){if(e)return r(e);n(t)})})},l.prototype.openReadStreamLowLevelPromise=function(e,t,n,r,i,a){return new Promise((o,s)=>{this.openReadStream(e,t,n,r,i,a,function(e,t){if(e)return s(e);o(t)})})},l.prototype.readLocalFileHeaderPromise=function(e,t){return new Promise((n,r)=>{this.readLocalFileHeader(e,t,function(e,t){if(e)return r(e);n(t)})})};function f(){}f.prototype.getLastModDate=function(e){if(e??={},!e.forceDosFormat)for(var t=0;t<this.extraFields.length;t++){var n=this.extraFields[t];if(n.id===21589){var r=n.data;if(r.length<5||!(r[0]&1))continue;var i=r.readInt32LE(1);return new Date(i*1e3)}else if(n.id===10){var r=n.data;if(r.length!==32||r.readUInt16LE(4)!==1||r.readUInt16LE(6)!==24)continue;var a=(r.readUInt32LE(8)+4294967296*r.readInt32LE(12))/1e4-0xa9730b66800;return new Date(a)}}return m(this.lastModFileDate,this.lastModFileTime,e.timezone)},f.prototype.canDecodeFileData=function(){return!this.isEncrypted()&&(this.compressionMethod===0||this.compressionMethod===8)},f.prototype.isEncrypted=function(){return(this.generalPurposeBitFlag&1)!=0},f.prototype.isCompressed=function(){return this.compressionMethod===8};function p(){}function m(e,t,n){var r=e&31,i=(e>>5&15)-1,a=(e>>9&127)+1980,o=0,s=(t&31)*2,c=t>>5&63,l=t>>11&31;if(n==null||n===`local`)return new Date(a,i,r,l,c,s,o);if(n===`UTC`)return new Date(Date.UTC(a,i,r,l,c,s,o));throw Error(`unrecognized options.timezone: `+options.timezone)}function h(e,t,n,r){for(var i=null,a=0;a<n.length;a++){var o=n[a];if(o.id===28789){if(o.data.length<6||o.data.readUInt8(0)!==1)continue;var s=o.data.readUInt32LE(1);if(c(t)!==s)continue;i=C(o.data.subarray(5),!0);break}}return i??=C(t,(e&2048)!=0),r||(i=i.replace(/\\/g,`/`)),i}function g(e){return e.indexOf(`\\`)===-1?/^[a-zA-Z]:/.test(e)||/^\//.test(e)?`absolute path: `+e:e.split(`/`).indexOf(`..`)===-1?null:`invalid relative path: `+e:`invalid characters in fileName: `+e}function _(e){for(var t=[],n=0;n<e.length-3;){var r=e.readUInt16LE(n+0),i=e.readUInt16LE(n+2),a=n+4,o=a+i;if(o>e.length)throw Error(`extra field length exceeds extra field buffer size`);var s=e.subarray(a,o);t.push({id:r,data:s}),n=o}return t}function v(e,t,n,r,i,a){if(r===0)return setImmediate(function(){a(null,T(0))});e.read(t,n,r,i,function(e,t){if(e)return a(e);if(t<r)return a(Error(`unexpected EOF`));a()})}r.inherits(y,a);function y(e){a.call(this),this.actualByteCount=0,this.expectedByteCount=e}y.prototype._transform=function(e,t,n){if(this.actualByteCount+=e.length,this.actualByteCount>this.expectedByteCount){var r=`too many bytes in the stream. expected `+this.expectedByteCount+`. got at least `+this.actualByteCount;return n(Error(r))}n(null,e)},y.prototype._flush=function(e){if(this.actualByteCount<this.expectedByteCount){var t=`not enough bytes in the stream. expected `+this.expectedByteCount+`. got only `+this.actualByteCount;return e(Error(t))}e()},r.inherits(b,i);function b(){i.call(this),this.refCount=0}b.prototype.ref=function(){this.refCount+=1},b.prototype.unref=function(){var e=this;if(--e.refCount,e.refCount>0)return;if(e.refCount<0)throw Error(`invalid unref`);e.close(t);function t(t){if(t)return e.emit(`error`,t);e.emit(`close`)}},b.prototype.createReadStream=function(e){e??={};var t=e.start,n=e.end;if(t===n){var r=new o;return setImmediate(function(){r.end()}),r}var i=this._readStreamForRange(t,n),a=!1,s=new x(this);i.on(`error`,function(e){setImmediate(function(){a||s.emit(`error`,e)})}),E(s,function(){i.unpipe(s),s.unref(),i.destroy()});var c=new y(n-t);return s.on(`error`,function(e){setImmediate(function(){a||c.emit(`error`,e)})}),E(c,function(){a=!0,s.unpipe(c),s.destroy()}),i.pipe(s).pipe(c)},b.prototype._readStreamForRange=function(e,t){throw Error(`not implemented`)},b.prototype.read=function(e,t,n,r,i){var a=this.createReadStream({start:r,end:r+n}),o=new s,c=0;o._write=function(n,r,i){n.copy(e,t+c,0,n.length),c+=n.length,i()},o.on(`finish`,i),a.on(`error`,function(e){i(e)}),a.pipe(o)},b.prototype.close=function(e){setImmediate(e)},r.inherits(x,o);function x(e){o.call(this),this.context=e,this.context.ref(),this.unreffedYet=!1}x.prototype._flush=function(e){this.unref(),e()},x.prototype.unref=function(e){this.unreffedYet||(this.unreffedYet=!0,this.context.unref())};var S=`\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■\xA0`;function C(e,t){if(t)return e.toString(`utf8`);for(var n=``,r=0;r<e.length;r++)n+=S[e[r]];return n}function w(e,t){var n=e.readUInt32LE(t);return e.readUInt32LE(t+4)*4294967296+n}var T=typeof Buffer.allocUnsafe==`function`?function(e){return Buffer.allocUnsafe(e)}:function(e){return new Buffer(e)};function E(e,t){typeof e.destroy==`function`?e._destroy=function(e,n){t(),n?.(e)}:e.destroy=t}}))(),Object.freeze({source:`local`,skipStoreHooks:!0,context:Object.freeze({origin:`effect-capture`,paired:!1})});var Bye=e(a(),1);const d3={discovery:`open-knowledge-discovery`,project:`open-knowledge`,"write-skill":`open-knowledge-write-skill`};new Set(Object.values(d3));const Vye=Object.keys(d3),Hye={discovery:`user`,project:`project`,"write-skill":`user`},f3=Vye.filter(e=>Hye[e]===`user`);new Set(f3.map(e=>d3[e]));const p3=`OpenKnowledge.app/Contents/Resources/cli/dist/assets/skills`;function Uye(e,t={}){let n=t.platform??process.platform,r=t.checkDesktop??!1,i=t.home??oe(),a=[],o=process.env.NODE_ENV===`test`;r&&n===`darwin`&&(o||a.push(N(`/Applications`,p3,e)),(!o||t.home!==void 0)&&a.push(N(i,`Applications`,p3,e))),a.push(Se(new URL(`../dist/assets/skills/${e}`,import.meta.url))),a.push(Se(new URL(`../assets/skills/${e}`,import.meta.url))),a.push(Se(new URL(`./assets/skills/${e}`,import.meta.url)));for(let e of a)if(g(e))return e;throw Error(`Bundled skill asset directory not found for bundle '${e}'. Tried: ${a.join(`, `)}. This usually means the CLI build did not copy packages/server/assets into dist/assets. Run \`cd packages/cli && bun run build\` before publishing.`)}function m3(e){return e.replace(/\\/g,`/`)}H$(`installed-skills-marker`),RegExp(`<(${XJ.map(e=>e.tagName).join(`|`)})\\b([^>]*)\\/>`,`y`);const Wye=String.raw`\[\[([^\n#[\]|]+)(?:#([^\n[\]|]+))?(?:\|([^\n[\]]+))?\]\]`,Gye=String.raw`\((<[^>\n]+>|[^)\s\n]+)((?:\s+(?:"[^"\n]*"|'[^'\n]*'|\([^)\n]*\)))?)\)`,h3=String.raw`([^\]\n]*)`,g3=String.raw`([^\]\n]*(?:\][^[\]\n]*)?)`,_3=e=>RegExp(`(!?)${Wye}`,e),v3=(e,t)=>RegExp(`(!?)\\[${e}\\]${Gye}`,t);_3(`y`),_3(`g`),v3(h3,`y`),v3(g3,`y`),v3(h3,`g`),v3(g3,`g`);const Kye=String.raw`(!?)\[([^\]\n]*)\](?:\[([^\]\n]*)\])?`;new RegExp(Kye,`y`);var y3=e(i(((e,t)=>{function n(e){return Array.isArray(e)?e:[e]}let r=/^\s+$/,i=/(?:[^\\]|^)\\$/,a=/^\\!/,o=/^\\#/,s=/\r?\n/g,c=/^\.*\/|^\.+$/,l=`node-ignore`;typeof Symbol<`u`&&(l=Symbol.for(`node-ignore`));let u=l,d=(e,t,n)=>Object.defineProperty(e,t,{value:n}),f=/([0-z])-([0-z])/g,p=()=>!1,m=e=>e.replace(f,(e,t,n)=>t.charCodeAt(0)<=n.charCodeAt(0)?e:``),h=e=>{let{length:t}=e;return e.slice(0,t-t%2)},g=[[/^\uFEFF/,()=>``],[/((?:\\\\)*?)(\\?\s+)$/,(e,t,n)=>t+(n.indexOf(`\\`)===0?` `:``)],[/(\\+?)\s/g,(e,t)=>{let{length:n}=t;return t.slice(0,n-n%2)+` `}],[/[\\$.|*+(){^]/g,e=>`\\${e}`],[/(?!\\)\?/g,()=>`[^/]`],[/^\//,()=>`^`],[/\//g,()=>`\\/`],[/^\^*\\\*\\\*\\\//,()=>`^(?:.*\\/)?`],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?`^`:`(?:^|\\/)`}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(e,t,n)=>t+6<n.length?`(?:\\/[^\\/]+)*`:`\\/.+`],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(e,t,n)=>t+n.replace(/\\\*/g,`[^\\/]*`)],[/\\\\\\(?=[$.|*+(){^])/g,()=>`\\`],[/\\\\/g,()=>`\\`],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,n,r,i)=>t===`\\`?`\\[${n}${h(r)}${i}`:i===`]`&&r.length%2==0?`[${m(n)}${r}]`:`[]`],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(e,t)=>`${t?`${t}[^/]+`:`[^/]*`}(?=$|\\/$)`]],_=Object.create(null),v=(e,t)=>{let n=_[e];return n||(n=g.reduce((t,[n,r])=>t.replace(n,r.bind(e)),e),_[e]=n),t?new RegExp(n,`i`):new RegExp(n)},y=e=>typeof e==`string`,b=e=>e&&y(e)&&!r.test(e)&&!i.test(e)&&e.indexOf(`#`)!==0,x=e=>e.split(s);var S=class{constructor(e,t,n,r){this.origin=e,this.pattern=t,this.negative=n,this.regex=r}};let C=(e,t)=>{let n=e,r=!1;e.indexOf(`!`)===0&&(r=!0,e=e.substr(1)),e=e.replace(a,`!`).replace(o,`#`);let i=v(e,t);return new S(n,e,r,i)},w=(e,t)=>{throw new t(e)},T=(e,t,n)=>y(e)?e?T.isNotRelative(e)?n(`path should be a \`path.relative()\`d string, but got "${t}"`,RangeError):!0:n(`path must not be empty`,TypeError):n(`path must be a string, but got \`${t}\``,TypeError),E=e=>c.test(e);T.isNotRelative=E,T.convert=e=>e;var D=class{constructor({ignorecase:e=!0,ignoreCase:t=e,allowRelativePaths:n=!1}={}){d(this,u,!0),this._rules=[],this._ignoreCase=t,this._allowRelativePaths=n,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}_addPattern(e){if(e&&e[u]){this._rules=this._rules.concat(e._rules),this._added=!0;return}if(b(e)){let t=C(e,this._ignoreCase);this._added=!0,this._rules.push(t)}}add(e){return this._added=!1,n(y(e)?x(e):e).forEach(this._addPattern,this),this._added&&this._initCache(),this}addPattern(e){return this.add(e)}_testOne(e,t){let n=!1,r=!1;return this._rules.forEach(i=>{let{negative:a}=i;r===a&&n!==r||a&&!n&&!r&&!t||i.regex.test(e)&&(n=!a,r=a)}),{ignored:n,unignored:r}}_test(e,t,n,r){let i=e&&T.convert(e);return T(i,e,this._allowRelativePaths?p:w),this._t(i,t,n,r)}_t(e,t,n,r){if(e in t)return t[e];if(r||=e.split(`/`),r.pop(),!r.length)return t[e]=this._testOne(e,n);let i=this._t(r.join(`/`)+`/`,t,n,r);return t[e]=i.ignored?i:this._testOne(e,n)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return n(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}};let O=e=>new D(e);if(O.isPathValid=e=>T(e&&T.convert(e),e,p),O.default=O,t.exports=O,typeof process<`u`&&(process.env&&process.env.IGNORE_TEST_WIN32||process.platform===`win32`)){T.convert=e=>/^\\\\\?\\/.test(e)||/["<>|\u0000-\u001F]+/u.test(e)?e:e.replace(/\\/g,`/`);let e=/^[a-z]:\//i;T.isNotRelative=t=>e.test(t)||E(t)}}))(),1);function b3(e){try{return O(ve(e,`.ok/config.yml`)).isFile()}catch(e){let t=e?.code;if(t===`ENOENT`||t===`ENOTDIR`)return!1;throw e}}const x3=H$(`content-filter`);Fe(s);const S3=[`.claude`,`.cursor`,`.codex`,`.agents`,`.opencode`,`.pi`],C3=new Set([`node_modules`,`.venv`,`venv`,`env`,`__pycache__`,`vendor`,`dist`,`build`,`out`,`output`,`.next`,`.nuxt`,`.svelte-kit`,`.astro`,`.turbo`,`.cache`,`.parcel-cache`,`coverage`,`.git`,`.ok`,`.open-knowledge`,`.openknowledge`,...S3,`Library`,`Applications`,`.Trash`]),qye=new Set([`.git`,`node_modules`,`.ok`,`.open-knowledge`,`.openknowledge`,...S3]),w3=new Set([`worktrees`,`local`]);function T3(e){let t=ec(e);if(!tc(t))throw Error(`Invalid attachment folder path`);if(t===`./`)return{kind:`sibling`};if(t===`/`||t===`.`)return{kind:`content-root`};let n=t.startsWith(`./`),r=(n?t.slice(2):t).split(`/`).filter(e=>e!==``&&e!==`.`).join(`/`);return r===``?n?{kind:`sibling`}:{kind:`content-root`}:{kind:n?`doc-relative`:`fixed`,path:r}}function Jye(e){throw Error(`[AttachmentFolderShape] unhandled variant: ${JSON.stringify(e)}`)}function Yye(e,t,n){let r=me(e).slice(1).toLowerCase();if(!Ms.has(r)||t.kind===`sibling`)return!1;let i=e.lastIndexOf(`/`),a=i===-1?``:e.slice(0,i);if(t.kind===`content-root`)return a===``;if(t.kind===`fixed`)return a===t.path||a.startsWith(`${t.path}/`);if(t.kind===`doc-relative`){let e=a===``?[]:a.split(`/`),r=t.path.split(`/`);for(let t=0;t<=e.length-r.length;t++)if(r.every((n,r)=>e[t+r]===n)&&n(e.slice(0,t).join(`/`)))return!0;return!1}return Jye(t)}function E3(e,t){let n=e.split(`/`);for(let e=0;e<n.length;e++){let r=n[e],i=r.toLowerCase()===`.ok`?`.ok`:r;if(qye.has(i)&&!(t&&i===`.ok`&&!w3.has((n[e+1]??``).toLowerCase())))return!0}return!1}function D3(e){return e.startsWith(`${hu}/`)}function Xye(e){return e===`.ok`||e===`.ok/skills`||e.startsWith(`.ok/skills/`)}const O3=new Set([`.ok`,...S3]),Zye=new Set([...C3].filter(e=>!O3.has(e))),Qye=[`.git`,`node_modules`,`.ok/local`,`.ok/worktrees`].flatMap(e=>[e,`${e}/**`,`**/${e}`,`**/${e}/**`]);function $ye(e){let t=e.replace(/^\/+/,``).replace(/\/+$/,``).split(`/`);return t.includes(`..`)?!1:t.some(e=>Zye.has(e))?!0:t.some((e,n)=>e.toLowerCase()===`.ok`&&w3.has((t[n+1]??``).toLowerCase()))}const ebe=[`.gitignore`,`.ok`,`.ok/config.yml`,`.ok/.gitignore`,`.ok/schemas/frontmatter.json`,`.ok/templates/example.md`,`.ok/skills/example/SKILL.md`,`docs/.ok`,`docs/.ok/frontmatter.yml`,`docs/.ok/templates/example.md`,...S3.flatMap(e=>[e,`${e}/skills/example/SKILL.md`])];function tbe(e){let t=e.trim();if(!t||t.startsWith(`!`)||t.startsWith(`#`))return!1;let n=t.replace(/^\/+/,``).replace(/\/+$/,``).split(`/`);if(n.includes(`..`))return!0;if($ye(t))return!1;if(n.some(e=>O3.has(e)))return!0;try{let e=(0,y3.default)().add(t);return ebe.some(t=>e.ignores(t))}catch{return!0}}function nbe(e){let t=e.filter(e=>e.length>0&&!e.startsWith(`!`)&&!e.startsWith(`#`)&&!tbe(e));return[...new Set([...t,...Qye])]}function k3(e,t){for(let n=0;n<t;n++)if(C3.has(e[n])||e[n].toLowerCase()===`.ok`)return!0;return!1}function A3(e){let t=e.split(`/`),n=t.length;return n<3||t[n-3]!==`.ok`||t[n-2]!==`templates`||me(t[n-1])!==`.md`?!1:!k3(t,n-3)}function j3(e){let t=e.split(`/`),n=t.length;return t[n-1]===`.ok`?!k3(t,n-1):n>=2&&t[n-1]===`templates`&&t[n-2]===`.ok`?!k3(t,n-2):!1}function rbe(e){let t=e.split(`/`),n=t.length;return t[0]===`.ok`&&(n===2&&(t[1]===`config.yml`||t[1]===`.gitignore`)||n===3&&t[1]===`schemas`&&t[2].toLowerCase().endsWith(`.json`))||A3(e)?!0:n>=2&&t[n-1]===`frontmatter.yml`&&t[n-2]===`.ok`?!k3(t,n-2):!1}function ibe(e){return e===`.ok`||e===`.ok/schemas`?!0:j3(e)}function abe(e,t){for(let n of t)if(e===n||e.startsWith(`${n}/`))return!0;return!1}function M3(e,t){if(t.size===0)return!1;for(let n of t)if(e.startsWith(`${n}/`))return!0;return!1}function obe(e,t){if(t.size===0)return!1;for(let n of t)if(n===e||n.startsWith(`${e}/`)||e.startsWith(`${n}/`))return!0;return!1}const sbe=new Set([`.ds_store`,`.localized`,`thumbs.db`,`desktop.ini`,`.directory`]);function N3(e){return sbe.has(e.slice(e.lastIndexOf(`/`)+1).toLowerCase())}const cbe=new Set([`.ssh`,`.aws`,`.gnupg`,`.kube`,`.docker`]);function P3(e){for(let t of e.split(`/`))if(cbe.has(t.toLowerCase()))return!0;return!1}const lbe=new Set([`credentials`,`.netrc`,`.npmrc`,`.pgpass`,`.git-credentials`]),ube=[`.pem`,`.key`,`.p12`,`.pfx`,`.keystore`,`.jks`,`.ppk`];function F3(e){let t=e.slice(e.lastIndexOf(`/`)+1).toLowerCase();if(t===`.env`||t.startsWith(`.env.`)||lbe.has(t)||t.startsWith(`id_rsa`)||t.startsWith(`id_ed25519`)||t.startsWith(`id_ecdsa`)||t.startsWith(`id_dsa`))return!0;for(let e of ube)if(t.endsWith(e))return!0;return!1}function dbe(e,t){return t===e||t.startsWith(`${e}/`)}function fbe(e,t,n){let r=n===void 0,i=new Map;function a(e){let t=i.get(e);if(t!==void 0)return t;let n;try{n=b3(e)}catch{return!1}return i.set(e,n),n}return{isInside(n,i){if(!r||n===``)return!1;let o=i?.pathBase===`project`?e:t;for(let e of n.split(`/`))if(o=N(o,e),a(o))return!0;return!1},reset(){i.clear()}}}const I3=[`.gitignore`,`.okignore`];function pbe(e,t){let n=mbe(e);if(n===null)return[];let r=[];L3(N(n,`info`,`exclude`),t,r,`info/exclude`);let i=hbe(e);return i&&L3(i,t,r,`global excludesfile`),r}function mbe(e){let t=u(`git`,[`rev-parse`,`--git-common-dir`],l3({cwd:e,encoding:`utf-8`,timeout:5e3}));return t.status!==0||!t.stdout?null:ve(e,t.stdout.trim())}function hbe(e){let t=u(`git`,[`config`,`--get`,`--type=path`,`core.excludesfile`],l3({cwd:e,encoding:`utf-8`,timeout:5e3}));if(t.status===0&&t.stdout){let e=t.stdout.trim();if(e)return e}return gbe()}function gbe(){let e=process.env.XDG_CONFIG_HOME?.trim();return N(e&&e.length>0?e:N(oe(),`.config`),`git`,`ignore`)}function L3(e,t,n,r){if(g(e))try{let r=S(e,`utf-8`);t.value+=r.length,n.push(...z3(r))}catch(t){x3.warn({path:e,err:t},`Failed to read ${r} at ${e}`)}}function _be(e){let{projectDir:t,contentDir:n,onAfterRebuild:r,singleDocRelPath:i}=e,a=e.inPlaceSkillDirs??new Set,o=T3(e.attachmentFolderPath??`./`),s=e.skillRootPaths??new Set,c=fbe(t,n,i),l=m3(_e(t,n)),u=l.startsWith(`..`),d,f,p,m,h=0,_=0,v=0;function y(){let e=(0,y3.default)(),r=(0,y3.default)();e.add(`.git`);let i=[],a=0,o=0;for(let n of I3){let o=N(t,n);if(g(o))try{let t=S(o,`utf-8`);a+=t.length;let s=z3(t);i.push(...s),e.add(s),n===`.okignore`&&r.add(s)}catch(e){x3.warn({path:o,err:e},`Failed to read ${n} at ${o}`)}}if(l&&!u)for(let t of I3){let i=N(n,t);if(g(i))try{let n=S(i,`utf-8`);a+=n.length,o++;let s=z3(n).map(e=>B3(e,l));e.add(s),t===`.okignore`&&r.add(s)}catch(e){x3.warn({path:i,err:e},`Failed to read ${t} at ${i}`)}}let s={value:a};o+=V3(n,t,e,r,s),a=s.value;let c=pbe(t,s);a=s.value,c.length>0&&(i.push(...c),e.add(c));let y=nbe(i);return d=e,f=r,p=i,m=y,h=i.length,_=o,v=a,{patternCount:h,nestedFileCount:_,bytes:v}}y();let b=new Map;function x(e,t){if(u&&t?.pathBase!==`project`)return!1;let n=t?.pathBase===`project`||!l?e:`${l}/${e}`;return n.startsWith(`..`)?!1:d.ignores(n)}function C(e,t){return t.pathBase===`project`||!l?e:`${l}/${e}`}function w(e){if(u)return!1;let t=l?`${l}/${e}`:e;return f.ignores(t)}let T=()=>{i===void 0&&R3(n,``,x,b)};T();function E(e){return Pye(kye(e))}function D(e){for(let t of e.split(`/`))if(C3.has(t))return!0;return u?!1:x(e)}let O=null,ee=null;return{isExcluded(e,t){if(E(e)||F3(e)||P3(e)||c.isInside(e,t?.syncScope)||!t?.bypassFilters&&abe(e,s)&&!M3(e,a))return!0;if(!t?.bypassFilters&&(D3(e)||M3(e,a)&&!x(e))){if(i!==void 0)return e!==i;if(c3(e))return!1;let t=me(e).slice(1).toLowerCase();return!Ms.has(t)}if(!t?.bypassFilters&&A3(e)||!t?.bypassFilters&&t?.syncScope!==void 0&&rbe(C(e,t.syncScope))&&!x(e,t.syncScope))return i===void 0?!1:e!==i;if(E3(e,t?.showOk)||N3(e))return!0;if(i!==void 0)return e!==i;if(t?.bypassFilters)return t.respectOkignore===!0&&w(e);if(D(e))return!0;if(c3(e)||Yye(e,o,e=>(b.get(e)??0)>0))return!1;let n=me(e).slice(1).toLowerCase();if(Ms.has(n)){let t=pe(e),n=t===`.`?``:t;if((b.get(n)??0)>0)return!1}return!0},isDirExcluded(e,t){if(P3(e)||c.isInside(e,t?.syncScope))return!0;if(!t?.bypassFilters&&(Xye(e)||j3(e)||t?.syncScope!==void 0&&ibe(C(e,t.syncScope))||obe(e,a)))return!1;if(E3(e,t?.showOk))return!0;if(i!==void 0)return!dbe(e,i);if(t?.bypassFilters)return t.respectOkignore===!0&&(w(e)||w(`${e}/`));for(let t of e.split(`/`))if(C3.has(t))return!0;return u?!1:x(e,t?.syncScope)||x(`${e}/`,t?.syncScope)},isPathIgnored(e,t){return E(e)||F3(e)||P3(e)?!0:D3(e)||M3(e,a)&&!x(e)||A3(e)?!1:E3(e)||N3(e)?!0:t?.bypassFilters?!1:D(e)},getWatcherIgnoreGlobs(){return m},incrementMdDir(e){let t=e===`.`?``:e;b.set(t,(b.get(t)??0)+1)},decrementMdDir(e){let t=e===`.`?``:e,n=b.get(t)??0;n<=1?b.delete(t):b.set(t,n-1)},rebuildDirCount(){let e=new Map(b);b.clear();try{T()}catch(t){for(let[t,n]of e)b.set(t,n);x3.warn({err:t instanceof Error?t:Error(String(t))},`content-filter rebuildDirCount walk failed — retaining previous counts`)}},setAttachmentFolderPath(e){o=T3(e)},refreshInPlaceSkillDirs(){if(e.rescanInPlaceSkillDirs)try{a=e.rescanInPlaceSkillDirs()}catch(e){x3.warn({err:e},`in-place skill re-scan failed — keeping previous allow-list`)}},inPlaceSkillDirsFingerprint(){return[...a].sort().join(`
438
438
  `)},peekFreshInPlaceSkillDirsFingerprint(){if(!e.rescanInPlaceSkillDirs)return[...a].sort().join(`
439
439
  `);try{return[...e.rescanInPlaceSkillDirs()].sort().join(`
440
440
  `)}catch{return[...a].sort().join(`
441
- `)}},async rebuildIgnorePatterns(){let t=e=>(O=e().finally(()=>{O=null}),O),o=async()=>{if(c.reset(),e.rescanInPlaceSkillDirs)try{a=e.rescanInPlaceSkillDirs()}catch(e){x3.warn({err:e},`in-place skill re-scan failed — keeping previous allow-list`)}let t=d,o=f,s=p,l=m,u=h,g=_,S=v,C=Date.now();return Age(`config.ignore.rebuild`,{attributes:{}},async e=>{try{let t=y();b.clear(),i===void 0&&await ybe(n,x,b);let a=Date.now()-C;if(e.setAttributes({"ok.ignore.pattern_count":t.patternCount,"ok.ignore.nested_file_count":t.nestedFileCount,"ok.ignore.bytes":t.bytes}),x3.info({patternCount:t.patternCount,nestedFileCount:t.nestedFileCount,bytes:t.bytes,durationMs:a},`content-filter rebuild succeeded`),r)try{r()}catch(e){x3.warn({err:e instanceof Error?e:Error(String(e))},`content-filter onAfterRebuild callback threw — derived views may be stale`)}return{ok:!0,patternCount:t.patternCount,nestedFileCount:t.nestedFileCount,bytes:t.bytes,durationMs:a}}catch(e){d=t,f=o,p=s,m=l,h=u,_=g,v=S,b.clear();try{T()}catch(e){x3.warn({err:e instanceof Error?e:Error(String(e))},`content-filter rollback dirCount re-walk failed — sibling-asset counts may be stale until next rebuild`)}let n=e instanceof Error?e.message:String(e);return x3.warn({err:e instanceof Error?e:Error(n)},`content-filter rebuild failed — rolled back to previous state`),{ok:!1,error:{message:n}}}})};return O===null?t(o):(ee===null&&(ee=O.catch(()=>null).then(()=>(ee=null,t(o)))),ee)}}}async function ybe(e,t,n){let r=[{dir:e,relPath:``}],i=0;for(;r.length>0;){let{dir:e,relPath:a}=r.pop();i+=1,i>=50&&(i=0,await new Promise(e=>setImmediate(e)));let o;try{o=C(e,{withFileTypes:!0})}catch(t){x3.warn({dir:e,err:t},`Failed to read directory for dir-count: ${e}`);continue}for(let i of o){let o=a?`${a}/${i.name}`:i.name;if(i.isDirectory()){if(C3.has(i.name)||t(o)||t(`${o}/`))continue;r.push({dir:N(e,i.name),relPath:o})}else i.isFile()&&c3(i.name)&&!t(o)&&n.set(a,(n.get(a)??0)+1)}}}function R3(e,t,n,r){let i;try{i=C(e,{withFileTypes:!0})}catch(t){x3.warn({dir:e,err:t},`Failed to read directory for dir-count: ${e}`);return}for(let a of i){let i=t?`${t}/${a.name}`:a.name;if(a.isDirectory()){if(C3.has(a.name)||n(i)||n(`${i}/`))continue;R3(N(e,a.name),i,n,r)}else a.isFile()&&c3(a.name)&&!n(i)&&r.set(t,(r.get(t)??0)+1)}}function z3(e){return e.split(`
441
+ `)}},async rebuildIgnorePatterns(){let t=e=>(O=e().finally(()=>{O=null}),O),o=async()=>{if(c.reset(),e.rescanInPlaceSkillDirs)try{a=e.rescanInPlaceSkillDirs()}catch(e){x3.warn({err:e},`in-place skill re-scan failed — keeping previous allow-list`)}let t=d,o=f,s=p,l=m,u=h,g=_,S=v,C=Date.now();return Age(`config.ignore.rebuild`,{attributes:{}},async e=>{try{let t=y();b.clear(),i===void 0&&await vbe(n,x,b);let a=Date.now()-C;if(e.setAttributes({"ok.ignore.pattern_count":t.patternCount,"ok.ignore.nested_file_count":t.nestedFileCount,"ok.ignore.bytes":t.bytes}),x3.info({patternCount:t.patternCount,nestedFileCount:t.nestedFileCount,bytes:t.bytes,durationMs:a},`content-filter rebuild succeeded`),r)try{r()}catch(e){x3.warn({err:e instanceof Error?e:Error(String(e))},`content-filter onAfterRebuild callback threw — derived views may be stale`)}return{ok:!0,patternCount:t.patternCount,nestedFileCount:t.nestedFileCount,bytes:t.bytes,durationMs:a}}catch(e){d=t,f=o,p=s,m=l,h=u,_=g,v=S,b.clear();try{T()}catch(e){x3.warn({err:e instanceof Error?e:Error(String(e))},`content-filter rollback dirCount re-walk failed — sibling-asset counts may be stale until next rebuild`)}let n=e instanceof Error?e.message:String(e);return x3.warn({err:e instanceof Error?e:Error(n)},`content-filter rebuild failed — rolled back to previous state`),{ok:!1,error:{message:n}}}})};return O===null?t(o):(ee===null&&(ee=O.catch(()=>null).then(()=>(ee=null,t(o)))),ee)}}}async function vbe(e,t,n){let r=[{dir:e,relPath:``}],i=0;for(;r.length>0;){let{dir:e,relPath:a}=r.pop();i+=1,i>=50&&(i=0,await new Promise(e=>setImmediate(e)));let o;try{o=C(e,{withFileTypes:!0})}catch(t){x3.warn({dir:e,err:t},`Failed to read directory for dir-count: ${e}`);continue}for(let i of o){let o=a?`${a}/${i.name}`:i.name;if(i.isDirectory()){if(C3.has(i.name)||t(o)||t(`${o}/`))continue;r.push({dir:N(e,i.name),relPath:o})}else i.isFile()&&c3(i.name)&&!t(o)&&n.set(a,(n.get(a)??0)+1)}}}function R3(e,t,n,r){let i;try{i=C(e,{withFileTypes:!0})}catch(t){x3.warn({dir:e,err:t},`Failed to read directory for dir-count: ${e}`);return}for(let a of i){let i=t?`${t}/${a.name}`:a.name;if(a.isDirectory()){if(C3.has(a.name)||n(i)||n(`${i}/`))continue;R3(N(e,a.name),i,n,r)}else a.isFile()&&c3(a.name)&&!n(i)&&r.set(t,(r.get(t)??0)+1)}}function z3(e){return e.split(`
442
442
  `).map(e=>e.trim()).filter(e=>e.length>0&&!e.startsWith(`#`))}function B3(e,t){let n=e.startsWith(`!`),r=n?e.slice(1):e,i=r.startsWith(`/`)?r.slice(1):r,a=i.endsWith(`/`)?i.slice(0,-1):i,o=r.startsWith(`/`)||a.includes(`/`)?`${t}/${i}`:`${t}/**/${i}`;return n?`!${o}`:o}function V3(e,t,n,r,i){let a;try{a=C(e,{withFileTypes:!0})}catch(t){return x3.warn({dir:e,err:t},`Failed to read directory ${e}`),0}let o=0;for(let s of a){if(!s.isDirectory()||C3.has(s.name))continue;let a=N(e,s.name),c=m3(_e(t,a));if(!c.startsWith(`..`)&&!(n.ignores(c)||n.ignores(`${c}/`))){for(let e of I3){let t=N(a,e);if(g(t))try{let a=S(t,`utf-8`);i.value+=a.length;let s=z3(a).map(e=>B3(e,c));n.add(s),e===`.okignore`&&r.add(s),o++}catch(n){x3.warn({path:t,err:n},`Failed to read nested ${e} at ${t}`)}}o+=V3(a,t,n,r,i)}}return o}function H3(e,t=!1){let n=e.length,r=0,i=``,a=0,o=16,s=0,c=0,l=0,u=0,d=0;function f(t,n){let i=0,a=0;for(;i<t||!n;){let t=e.charCodeAt(r);if(t>=48&&t<=57)a=a*16+t-48;else if(t>=65&&t<=70)a=a*16+t-65+10;else if(t>=97&&t<=102)a=a*16+t-97+10;else break;r++,i++}return i<t&&(a=-1),a}function p(e){r=e,i=``,a=0,o=16,d=0}function m(){let t=r;if(e.charCodeAt(r)===48)r++;else for(r++;r<e.length&&G3(e.charCodeAt(r));)r++;if(r<e.length&&e.charCodeAt(r)===46)if(r++,r<e.length&&G3(e.charCodeAt(r)))for(r++;r<e.length&&G3(e.charCodeAt(r));)r++;else return d=3,e.substring(t,r);let n=r;if(r<e.length&&(e.charCodeAt(r)===69||e.charCodeAt(r)===101))if(r++,(r<e.length&&e.charCodeAt(r)===43||e.charCodeAt(r)===45)&&r++,r<e.length&&G3(e.charCodeAt(r))){for(r++;r<e.length&&G3(e.charCodeAt(r));)r++;n=r}else d=3;return e.substring(t,n)}function h(){let t=``,i=r;for(;;){if(r>=n){t+=e.substring(i,r),d=2;break}let a=e.charCodeAt(r);if(a===34){t+=e.substring(i,r),r++;break}if(a===92){if(t+=e.substring(i,r),r++,r>=n){d=2;break}switch(e.charCodeAt(r++)){case 34:t+=`"`;break;case 92:t+=`\\`;break;case 47:t+=`/`;break;case 98:t+=`\b`;break;case 102:t+=`\f`;break;case 110:t+=`
443
443
  `;break;case 114:t+=`\r`;break;case 116:t+=` `;break;case 117:let e=f(4,!0);e>=0?t+=String.fromCharCode(e):d=4;break;default:d=5}i=r;continue}if(a>=0&&a<=31)if(W3(a)){t+=e.substring(i,r),d=2;break}else d=6;r++}return t}function g(){if(i=``,d=0,a=r,c=s,u=l,r>=n)return a=n,o=17;let t=e.charCodeAt(r);if(U3(t)){do r++,i+=String.fromCharCode(t),t=e.charCodeAt(r);while(U3(t));return o=15}if(W3(t))return r++,i+=String.fromCharCode(t),t===13&&e.charCodeAt(r)===10&&(r++,i+=`
444
- `),s++,l=r,o=14;switch(t){case 123:return r++,o=1;case 125:return r++,o=2;case 91:return r++,o=3;case 93:return r++,o=4;case 58:return r++,o=6;case 44:return r++,o=5;case 34:return r++,i=h(),o=10;case 47:let c=r-1;if(e.charCodeAt(r+1)===47){for(r+=2;r<n&&!W3(e.charCodeAt(r));)r++;return i=e.substring(c,r),o=12}if(e.charCodeAt(r+1)===42){r+=2;let t=n-1,a=!1;for(;r<t;){let t=e.charCodeAt(r);if(t===42&&e.charCodeAt(r+1)===47){r+=2,a=!0;break}r++,W3(t)&&(t===13&&e.charCodeAt(r)===10&&r++,s++,l=r)}return a||(r++,d=1),i=e.substring(c,r),o=13}return i+=String.fromCharCode(t),r++,o=16;case 45:if(i+=String.fromCharCode(t),r++,r===n||!G3(e.charCodeAt(r)))return o=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return i+=m(),o=11;default:for(;r<n&&_(t);)r++,t=e.charCodeAt(r);if(a!==r){switch(i=e.substring(a,r),i){case`true`:return o=8;case`false`:return o=9;case`null`:return o=7}return o=16}return i+=String.fromCharCode(t),r++,o=16}}function _(e){if(U3(e)||W3(e))return!1;switch(e){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function v(){let e;do e=g();while(e>=12&&e<=15);return e}return{setPosition:p,getPosition:()=>r,scan:t?v:g,getToken:()=>o,getTokenValue:()=>i,getTokenOffset:()=>a,getTokenLength:()=>r-a,getTokenStartLine:()=>c,getTokenStartCharacter:()=>a-u,getTokenError:()=>d}}function U3(e){return e===32||e===9}function W3(e){return e===10||e===13}function G3(e){return e>=48&&e<=57}var bbe;(function(e){e[e.lineFeed=10]=`lineFeed`,e[e.carriageReturn=13]=`carriageReturn`,e[e.space=32]=`space`,e[e._0=48]=`_0`,e[e._1=49]=`_1`,e[e._2=50]=`_2`,e[e._3=51]=`_3`,e[e._4=52]=`_4`,e[e._5=53]=`_5`,e[e._6=54]=`_6`,e[e._7=55]=`_7`,e[e._8=56]=`_8`,e[e._9=57]=`_9`,e[e.a=97]=`a`,e[e.b=98]=`b`,e[e.c=99]=`c`,e[e.d=100]=`d`,e[e.e=101]=`e`,e[e.f=102]=`f`,e[e.g=103]=`g`,e[e.h=104]=`h`,e[e.i=105]=`i`,e[e.j=106]=`j`,e[e.k=107]=`k`,e[e.l=108]=`l`,e[e.m=109]=`m`,e[e.n=110]=`n`,e[e.o=111]=`o`,e[e.p=112]=`p`,e[e.q=113]=`q`,e[e.r=114]=`r`,e[e.s=115]=`s`,e[e.t=116]=`t`,e[e.u=117]=`u`,e[e.v=118]=`v`,e[e.w=119]=`w`,e[e.x=120]=`x`,e[e.y=121]=`y`,e[e.z=122]=`z`,e[e.A=65]=`A`,e[e.B=66]=`B`,e[e.C=67]=`C`,e[e.D=68]=`D`,e[e.E=69]=`E`,e[e.F=70]=`F`,e[e.G=71]=`G`,e[e.H=72]=`H`,e[e.I=73]=`I`,e[e.J=74]=`J`,e[e.K=75]=`K`,e[e.L=76]=`L`,e[e.M=77]=`M`,e[e.N=78]=`N`,e[e.O=79]=`O`,e[e.P=80]=`P`,e[e.Q=81]=`Q`,e[e.R=82]=`R`,e[e.S=83]=`S`,e[e.T=84]=`T`,e[e.U=85]=`U`,e[e.V=86]=`V`,e[e.W=87]=`W`,e[e.X=88]=`X`,e[e.Y=89]=`Y`,e[e.Z=90]=`Z`,e[e.asterisk=42]=`asterisk`,e[e.backslash=92]=`backslash`,e[e.closeBrace=125]=`closeBrace`,e[e.closeBracket=93]=`closeBracket`,e[e.colon=58]=`colon`,e[e.comma=44]=`comma`,e[e.dot=46]=`dot`,e[e.doubleQuote=34]=`doubleQuote`,e[e.minus=45]=`minus`,e[e.openBrace=123]=`openBrace`,e[e.openBracket=91]=`openBracket`,e[e.plus=43]=`plus`,e[e.slash=47]=`slash`,e[e.formFeed=12]=`formFeed`,e[e.tab=9]=`tab`})(bbe||={});const K3=Array(20).fill(0).map((e,t)=>` `.repeat(t)),q3={" ":{"\n":Array(200).fill(0).map((e,t)=>`
444
+ `),s++,l=r,o=14;switch(t){case 123:return r++,o=1;case 125:return r++,o=2;case 91:return r++,o=3;case 93:return r++,o=4;case 58:return r++,o=6;case 44:return r++,o=5;case 34:return r++,i=h(),o=10;case 47:let c=r-1;if(e.charCodeAt(r+1)===47){for(r+=2;r<n&&!W3(e.charCodeAt(r));)r++;return i=e.substring(c,r),o=12}if(e.charCodeAt(r+1)===42){r+=2;let t=n-1,a=!1;for(;r<t;){let t=e.charCodeAt(r);if(t===42&&e.charCodeAt(r+1)===47){r+=2,a=!0;break}r++,W3(t)&&(t===13&&e.charCodeAt(r)===10&&r++,s++,l=r)}return a||(r++,d=1),i=e.substring(c,r),o=13}return i+=String.fromCharCode(t),r++,o=16;case 45:if(i+=String.fromCharCode(t),r++,r===n||!G3(e.charCodeAt(r)))return o=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return i+=m(),o=11;default:for(;r<n&&_(t);)r++,t=e.charCodeAt(r);if(a!==r){switch(i=e.substring(a,r),i){case`true`:return o=8;case`false`:return o=9;case`null`:return o=7}return o=16}return i+=String.fromCharCode(t),r++,o=16}}function _(e){if(U3(e)||W3(e))return!1;switch(e){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function v(){let e;do e=g();while(e>=12&&e<=15);return e}return{setPosition:p,getPosition:()=>r,scan:t?v:g,getToken:()=>o,getTokenValue:()=>i,getTokenOffset:()=>a,getTokenLength:()=>r-a,getTokenStartLine:()=>c,getTokenStartCharacter:()=>a-u,getTokenError:()=>d}}function U3(e){return e===32||e===9}function W3(e){return e===10||e===13}function G3(e){return e>=48&&e<=57}var ybe;(function(e){e[e.lineFeed=10]=`lineFeed`,e[e.carriageReturn=13]=`carriageReturn`,e[e.space=32]=`space`,e[e._0=48]=`_0`,e[e._1=49]=`_1`,e[e._2=50]=`_2`,e[e._3=51]=`_3`,e[e._4=52]=`_4`,e[e._5=53]=`_5`,e[e._6=54]=`_6`,e[e._7=55]=`_7`,e[e._8=56]=`_8`,e[e._9=57]=`_9`,e[e.a=97]=`a`,e[e.b=98]=`b`,e[e.c=99]=`c`,e[e.d=100]=`d`,e[e.e=101]=`e`,e[e.f=102]=`f`,e[e.g=103]=`g`,e[e.h=104]=`h`,e[e.i=105]=`i`,e[e.j=106]=`j`,e[e.k=107]=`k`,e[e.l=108]=`l`,e[e.m=109]=`m`,e[e.n=110]=`n`,e[e.o=111]=`o`,e[e.p=112]=`p`,e[e.q=113]=`q`,e[e.r=114]=`r`,e[e.s=115]=`s`,e[e.t=116]=`t`,e[e.u=117]=`u`,e[e.v=118]=`v`,e[e.w=119]=`w`,e[e.x=120]=`x`,e[e.y=121]=`y`,e[e.z=122]=`z`,e[e.A=65]=`A`,e[e.B=66]=`B`,e[e.C=67]=`C`,e[e.D=68]=`D`,e[e.E=69]=`E`,e[e.F=70]=`F`,e[e.G=71]=`G`,e[e.H=72]=`H`,e[e.I=73]=`I`,e[e.J=74]=`J`,e[e.K=75]=`K`,e[e.L=76]=`L`,e[e.M=77]=`M`,e[e.N=78]=`N`,e[e.O=79]=`O`,e[e.P=80]=`P`,e[e.Q=81]=`Q`,e[e.R=82]=`R`,e[e.S=83]=`S`,e[e.T=84]=`T`,e[e.U=85]=`U`,e[e.V=86]=`V`,e[e.W=87]=`W`,e[e.X=88]=`X`,e[e.Y=89]=`Y`,e[e.Z=90]=`Z`,e[e.asterisk=42]=`asterisk`,e[e.backslash=92]=`backslash`,e[e.closeBrace=125]=`closeBrace`,e[e.closeBracket=93]=`closeBracket`,e[e.colon=58]=`colon`,e[e.comma=44]=`comma`,e[e.dot=46]=`dot`,e[e.doubleQuote=34]=`doubleQuote`,e[e.minus=45]=`minus`,e[e.openBrace=123]=`openBrace`,e[e.openBracket=91]=`openBracket`,e[e.plus=43]=`plus`,e[e.slash=47]=`slash`,e[e.formFeed=12]=`formFeed`,e[e.tab=9]=`tab`})(ybe||={});const K3=Array(20).fill(0).map((e,t)=>` `.repeat(t)),q3={" ":{"\n":Array(200).fill(0).map((e,t)=>`
445
445
  `+` `.repeat(t)),"\r":Array(200).fill(0).map((e,t)=>`\r`+` `.repeat(t)),"\r\n":Array(200).fill(0).map((e,t)=>`\r
446
446
  `+` `.repeat(t))}," ":{"\n":Array(200).fill(0).map((e,t)=>`
447
447
  `+` `.repeat(t)),"\r":Array(200).fill(0).map((e,t)=>`\r`+` `.repeat(t)),"\r\n":Array(200).fill(0).map((e,t)=>`\r
448
- `+` `.repeat(t))}},xbe=[`
448
+ `+` `.repeat(t))}},bbe=[`
449
449
  `,`\r`,`\r
450
- `];function Sbe(e,t,n){let r,i,a,o,s;if(t){for(o=t.offset,s=o+t.length,a=o;a>0&&!Y3(e,a-1);)a--;let c=s;for(;c<e.length&&!Y3(e,c);)c++;i=e.substring(a,c),r=Cbe(i,n)}else i=e,r=0,a=0,o=0,s=e.length;let c=wbe(n,e),l=xbe.includes(c),u=0,d=0,f;f=n.insertSpaces?K3[n.tabSize||4]??J3(K3[1],n.tabSize||4):` `;let p=f===` `?` `:` `,m=H3(i,!1),h=!1;function g(){if(u>1)return J3(c,u)+J3(f,r+d);let e=f.length*(r+d);return!l||e>q3[p][c].length?c+J3(f,r+d):e<=0?c:q3[p][c][e]}function _(){let e=m.scan();for(u=0;e===15||e===14;)e===14&&n.keepLines?u+=1:e===14&&(u=1),e=m.scan();return h=e===16||m.getTokenError()!==0,e}let v=[];function y(n,r,i){!h&&(!t||r<s&&i>o)&&e.substring(r,i)!==n&&v.push({offset:r,length:i-r,content:n})}let b=_();if(n.keepLines&&u>0&&y(J3(c,u),0,0),b!==17){let e=m.getTokenOffset()+a;y(f.length*r<20&&n.insertSpaces?K3[f.length*r]:J3(f,r),a,e)}for(;b!==17;){let e=m.getTokenOffset()+m.getTokenLength()+a,t=_(),r=``,i=!1;for(;u===0&&(t===12||t===13);){let n=m.getTokenOffset()+a;y(K3[1],e,n),e=m.getTokenOffset()+m.getTokenLength()+a,i=t===12,r=i?g():``,t=_()}if(t===2)b!==1&&d--,n.keepLines&&u>0||!n.keepLines&&b!==1?r=g():n.keepLines&&(r=K3[1]);else if(t===4)b!==3&&d--,n.keepLines&&u>0||!n.keepLines&&b!==3?r=g():n.keepLines&&(r=K3[1]);else{switch(b){case 3:case 1:d++,r=n.keepLines&&u>0||!n.keepLines?g():K3[1];break;case 5:r=n.keepLines&&u>0||!n.keepLines?g():K3[1];break;case 12:r=g();break;case 13:u>0?r=g():i||(r=K3[1]);break;case 6:n.keepLines&&u>0?r=g():i||(r=K3[1]);break;case 10:n.keepLines&&u>0?r=g():t===6&&!i&&(r=``);break;case 7:case 8:case 9:case 11:case 2:case 4:n.keepLines&&u>0?r=g():(t===12||t===13)&&!i?r=K3[1]:t!==5&&t!==17&&(h=!0);break;case 16:h=!0;break}u>0&&(t===12||t===13)&&(r=g())}t===17&&(r=n.keepLines&&u>0?g():n.insertFinalNewline?c:``);let o=m.getTokenOffset()+a;y(r,e,o),b=t}return v}function J3(e,t){let n=``;for(let r=0;r<t;r++)n+=e;return n}function Cbe(e,t){let n=0,r=0,i=t.tabSize||4;for(;n<e.length;){let t=e.charAt(n);if(t===K3[1])r++;else if(t===` `)r+=i;else break;n++}return Math.floor(r/i)}function wbe(e,t){for(let e=0;e<t.length;e++){let n=t.charAt(e);if(n===`\r`)return e+1<t.length&&t.charAt(e+1)===`
450
+ `];function xbe(e,t,n){let r,i,a,o,s;if(t){for(o=t.offset,s=o+t.length,a=o;a>0&&!Y3(e,a-1);)a--;let c=s;for(;c<e.length&&!Y3(e,c);)c++;i=e.substring(a,c),r=Sbe(i,n)}else i=e,r=0,a=0,o=0,s=e.length;let c=Cbe(n,e),l=bbe.includes(c),u=0,d=0,f;f=n.insertSpaces?K3[n.tabSize||4]??J3(K3[1],n.tabSize||4):` `;let p=f===` `?` `:` `,m=H3(i,!1),h=!1;function g(){if(u>1)return J3(c,u)+J3(f,r+d);let e=f.length*(r+d);return!l||e>q3[p][c].length?c+J3(f,r+d):e<=0?c:q3[p][c][e]}function _(){let e=m.scan();for(u=0;e===15||e===14;)e===14&&n.keepLines?u+=1:e===14&&(u=1),e=m.scan();return h=e===16||m.getTokenError()!==0,e}let v=[];function y(n,r,i){!h&&(!t||r<s&&i>o)&&e.substring(r,i)!==n&&v.push({offset:r,length:i-r,content:n})}let b=_();if(n.keepLines&&u>0&&y(J3(c,u),0,0),b!==17){let e=m.getTokenOffset()+a;y(f.length*r<20&&n.insertSpaces?K3[f.length*r]:J3(f,r),a,e)}for(;b!==17;){let e=m.getTokenOffset()+m.getTokenLength()+a,t=_(),r=``,i=!1;for(;u===0&&(t===12||t===13);){let n=m.getTokenOffset()+a;y(K3[1],e,n),e=m.getTokenOffset()+m.getTokenLength()+a,i=t===12,r=i?g():``,t=_()}if(t===2)b!==1&&d--,n.keepLines&&u>0||!n.keepLines&&b!==1?r=g():n.keepLines&&(r=K3[1]);else if(t===4)b!==3&&d--,n.keepLines&&u>0||!n.keepLines&&b!==3?r=g():n.keepLines&&(r=K3[1]);else{switch(b){case 3:case 1:d++,r=n.keepLines&&u>0||!n.keepLines?g():K3[1];break;case 5:r=n.keepLines&&u>0||!n.keepLines?g():K3[1];break;case 12:r=g();break;case 13:u>0?r=g():i||(r=K3[1]);break;case 6:n.keepLines&&u>0?r=g():i||(r=K3[1]);break;case 10:n.keepLines&&u>0?r=g():t===6&&!i&&(r=``);break;case 7:case 8:case 9:case 11:case 2:case 4:n.keepLines&&u>0?r=g():(t===12||t===13)&&!i?r=K3[1]:t!==5&&t!==17&&(h=!0);break;case 16:h=!0;break}u>0&&(t===12||t===13)&&(r=g())}t===17&&(r=n.keepLines&&u>0?g():n.insertFinalNewline?c:``);let o=m.getTokenOffset()+a;y(r,e,o),b=t}return v}function J3(e,t){let n=``;for(let r=0;r<t;r++)n+=e;return n}function Sbe(e,t){let n=0,r=0,i=t.tabSize||4;for(;n<e.length;){let t=e.charAt(n);if(t===K3[1])r++;else if(t===` `)r+=i;else break;n++}return Math.floor(r/i)}function Cbe(e,t){for(let e=0;e<t.length;e++){let n=t.charAt(e);if(n===`\r`)return e+1<t.length&&t.charAt(e+1)===`
451
451
  `?`\r
452
452
  `:`\r`;if(n===`
453
453
  `)return`
454
454
  `}return e&&e.eol||`
455
455
  `}function Y3(e,t){return`\r
456
- `.indexOf(e.charAt(t))!==-1}var X3;(function(e){e.DEFAULT={allowTrailingComma:!1}})(X3||={});function Tbe(e,t=[],n=X3.DEFAULT){let r=null,i=[],a=[];function o(e){Array.isArray(i)?i.push(e):r!==null&&(i[r]=e)}return e6(e,{onObjectBegin:()=>{let e={};o(e),a.push(i),i=e,r=null},onObjectProperty:e=>{r=e},onObjectEnd:()=>{i=a.pop()},onArrayBegin:()=>{let e=[];o(e),a.push(i),i=e,r=null},onArrayEnd:()=>{i=a.pop()},onLiteralValue:o,onError:(e,n,r)=>{t.push({error:e,offset:n,length:r})}},n),i[0]}function Z3(e,t=[],n=X3.DEFAULT){let r={type:`array`,offset:-1,length:-1,children:[],parent:void 0};function i(e){r.type===`property`&&(r.length=e-r.offset,r=r.parent)}function a(e){return r.children.push(e),e}e6(e,{onObjectBegin:e=>{r=a({type:`object`,offset:e,length:-1,parent:r,children:[]})},onObjectProperty:(e,t,n)=>{r=a({type:`property`,offset:t,length:-1,parent:r,children:[]}),r.children.push({type:`string`,value:e,offset:t,length:n,parent:r})},onObjectEnd:(e,t)=>{i(e+t),r.length=e+t-r.offset,r=r.parent,i(e+t)},onArrayBegin:(e,t)=>{r=a({type:`array`,offset:e,length:-1,parent:r,children:[]})},onArrayEnd:(e,t)=>{r.length=e+t-r.offset,r=r.parent,i(e+t)},onLiteralValue:(e,t,n)=>{a({type:Ebe(e),offset:t,length:n,parent:r,value:e}),i(t+n)},onSeparator:(e,t,n)=>{r.type===`property`&&(e===`:`?r.colonOffset=t:e===`,`&&i(t))},onError:(e,n,r)=>{t.push({error:e,offset:n,length:r})}},n);let o=r.children[0];return o&&delete o.parent,o}function Q3(e,t){if(!e)return;let n=e;for(let e of t)if(typeof e==`string`){if(n.type!==`object`||!Array.isArray(n.children))return;let t=!1;for(let r of n.children)if(Array.isArray(r.children)&&r.children[0].value===e&&r.children.length===2){n=r.children[1],t=!0;break}if(!t)return}else{let t=e;if(n.type!==`array`||t<0||!Array.isArray(n.children)||t>=n.children.length)return;n=n.children[t]}return n}function $3(e){switch(e.type){case`array`:return e.children.map($3);case`object`:let t=Object.create(null);for(let n of e.children){let e=n.children[1];e&&(t[n.children[0].value]=$3(e))}return t;case`null`:case`string`:case`number`:case`boolean`:return e.value;default:return}}function e6(e,t,n=X3.DEFAULT){let r=H3(e,!1),i=[],a=0;function o(e){return e?()=>a===0&&e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}function s(e){return e?t=>a===0&&e(t,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}function c(e){return e?t=>a===0&&e(t,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),()=>i.slice()):()=>!0}function l(e){return e?()=>{a>0?a++:e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),()=>i.slice())===!1&&(a=1)}:()=>!0}function u(e){return e?()=>{a>0&&a--,a===0&&e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter())}:()=>!0}let d=l(t.onObjectBegin),f=c(t.onObjectProperty),p=u(t.onObjectEnd),m=l(t.onArrayBegin),h=u(t.onArrayEnd),g=c(t.onLiteralValue),_=s(t.onSeparator),v=o(t.onComment),y=s(t.onError),b=n&&n.disallowComments,x=n&&n.allowTrailingComma;function S(){for(;;){let e=r.scan();switch(r.getTokenError()){case 4:C(14);break;case 5:C(15);break;case 3:C(13);break;case 1:b||C(11);break;case 2:C(12);break;case 6:C(16);break}switch(e){case 12:case 13:b?C(10):v();break;case 16:C(1);break;case 15:case 14:break;default:return e}}}function C(e,t=[],n=[]){if(y(e),t.length+n.length>0){let e=r.getToken();for(;e!==17;){if(t.indexOf(e)!==-1){S();break}else if(n.indexOf(e)!==-1)break;e=S()}}}function w(e){let t=r.getTokenValue();return e?g(t):(f(t),i.push(t)),S(),!0}function T(){switch(r.getToken()){case 11:let e=r.getTokenValue(),t=Number(e);isNaN(t)&&(C(2),t=0),g(t);break;case 7:g(null);break;case 8:g(!0);break;case 9:g(!1);break;default:return!1}return S(),!0}function E(){return r.getToken()===10?(w(!1),r.getToken()===6?(_(`:`),S(),ee()||C(4,[],[2,5])):C(5,[],[2,5]),i.pop(),!0):(C(3,[],[2,5]),!1)}function D(){d(),S();let e=!1;for(;r.getToken()!==2&&r.getToken()!==17;){if(r.getToken()===5){if(e||C(4,[],[]),_(`,`),S(),r.getToken()===2&&x)break}else e&&C(6,[],[]);E()||C(4,[],[2,5]),e=!0}return p(),r.getToken()===2?S():C(7,[2],[]),!0}function O(){m(),S();let e=!0,t=!1;for(;r.getToken()!==4&&r.getToken()!==17;){if(r.getToken()===5){if(t||C(4,[],[]),_(`,`),S(),r.getToken()===4&&x)break}else t&&C(6,[],[]);e?(i.push(0),e=!1):i[i.length-1]++,ee()||C(4,[],[4,5]),t=!0}return h(),e||i.pop(),r.getToken()===4?S():C(8,[4],[]),!0}function ee(){switch(r.getToken()){case 3:return O();case 1:return D();case 10:return w(!0);default:return T()}}return S(),r.getToken()===17?n.allowEmptyContent?!0:(C(4,[],[]),!1):ee()?(r.getToken()!==17&&C(9,[],[]),!0):(C(4,[],[]),!1)}function Ebe(e){switch(typeof e){case`boolean`:return`boolean`;case`number`:return`number`;case`string`:return`string`;case`object`:return e?Array.isArray(e)?`array`:`object`:`null`;default:return`null`}}function Dbe(e,t,n,r){let i=t.slice(),a=Z3(e,[]),o,s;for(;i.length>0&&(s=i.pop(),o=Q3(a,i),o===void 0&&n!==void 0);)n=typeof s==`string`?{[s]:n}:[n];if(!o){if(n===void 0)throw Error(`Can not delete in empty document`);return t6(e,{offset:a?a.offset:0,length:a?a.length:0,content:JSON.stringify(n)},r)}else if(o.type===`object`&&typeof s==`string`&&Array.isArray(o.children)){let t=Q3(o,[s]);if(t!==void 0)if(n===void 0){if(!t.parent)throw Error(`Malformed AST`);let n=o.children.indexOf(t.parent),i,a=t.parent.offset+t.parent.length;if(n>0){let e=o.children[n-1];i=e.offset+e.length}else i=o.offset+1,o.children.length>1&&(a=o.children[1].offset);return t6(e,{offset:i,length:a-i,content:``},r)}else return t6(e,{offset:t.offset,length:t.length,content:JSON.stringify(n)},r);else{if(n===void 0)return[];let t=`${JSON.stringify(s)}: ${JSON.stringify(n)}`,i=r.getInsertionIndex?r.getInsertionIndex(o.children.map(e=>e.children[0].value)):o.children.length,a;if(i>0){let e=o.children[i-1];a={offset:e.offset+e.length,length:0,content:`,`+t}}else a=o.children.length===0?{offset:o.offset+1,length:0,content:t}:{offset:o.offset+1,length:0,content:t+`,`};return t6(e,a,r)}}else if(o.type===`array`&&typeof s==`number`&&Array.isArray(o.children)){let t=s;if(t===-1){let t=`${JSON.stringify(n)}`,i;if(o.children.length===0)i={offset:o.offset+1,length:0,content:t};else{let e=o.children[o.children.length-1];i={offset:e.offset+e.length,length:0,content:`,`+t}}return t6(e,i,r)}else if(n===void 0&&o.children.length>=0){let t=s,n=o.children[t],i;if(o.children.length===1)i={offset:o.offset+1,length:o.length-2,content:``};else if(o.children.length-1===t){let e=o.children[t-1],n=e.offset+e.length;i={offset:n,length:o.offset+o.length-2-n,content:``}}else i={offset:n.offset,length:o.children[t+1].offset-n.offset,content:``};return t6(e,i,r)}else if(n!==void 0){let t,i=`${JSON.stringify(n)}`;if(!r.isArrayInsertion&&o.children.length>s){let e=o.children[s];t={offset:e.offset,length:e.length,content:i}}else if(o.children.length===0||s===0)t={offset:o.offset+1,length:0,content:o.children.length===0?i:i+`,`};else{let e=s>o.children.length?o.children.length:s,n=o.children[e-1];t={offset:n.offset+n.length,length:0,content:`,`+i}}return t6(e,t,r)}else throw Error(`Can not ${n===void 0?`remove`:r.isArrayInsertion?`insert`:`modify`} Array index ${t} as length is not sufficient`)}else throw Error(`Can not add ${typeof s==`number`?`property`:`index`} to parent of type ${o.type}`)}function t6(e,t,n){if(!n.formattingOptions)return[t];let r=n6(e,t),i=t.offset,a=t.offset+t.content.length;if(t.length===0||t.content.length===0){for(;i>0&&!Y3(r,i-1);)i--;for(;a<r.length&&!Y3(r,a);)a++}let o=Sbe(r,{offset:i,length:a-i},{...n.formattingOptions,keepLines:!1});for(let e=o.length-1;e>=0;e--){let t=o[e];r=n6(r,t),i=Math.min(i,t.offset),a=Math.max(a,t.offset+t.length),a+=t.content.length-t.length}let s=e.length-(r.length-a)-i;return[{offset:i,length:s,content:r.substring(i,a)}]}function n6(e,t){return e.substring(0,t.offset)+t.content+e.substring(t.offset+t.length)}var Obe;(function(e){e[e.None=0]=`None`,e[e.UnexpectedEndOfComment=1]=`UnexpectedEndOfComment`,e[e.UnexpectedEndOfString=2]=`UnexpectedEndOfString`,e[e.UnexpectedEndOfNumber=3]=`UnexpectedEndOfNumber`,e[e.InvalidUnicode=4]=`InvalidUnicode`,e[e.InvalidEscapeCharacter=5]=`InvalidEscapeCharacter`,e[e.InvalidCharacter=6]=`InvalidCharacter`})(Obe||={});var kbe;(function(e){e[e.OpenBraceToken=1]=`OpenBraceToken`,e[e.CloseBraceToken=2]=`CloseBraceToken`,e[e.OpenBracketToken=3]=`OpenBracketToken`,e[e.CloseBracketToken=4]=`CloseBracketToken`,e[e.CommaToken=5]=`CommaToken`,e[e.ColonToken=6]=`ColonToken`,e[e.NullKeyword=7]=`NullKeyword`,e[e.TrueKeyword=8]=`TrueKeyword`,e[e.FalseKeyword=9]=`FalseKeyword`,e[e.StringLiteral=10]=`StringLiteral`,e[e.NumericLiteral=11]=`NumericLiteral`,e[e.LineCommentTrivia=12]=`LineCommentTrivia`,e[e.BlockCommentTrivia=13]=`BlockCommentTrivia`,e[e.LineBreakTrivia=14]=`LineBreakTrivia`,e[e.Trivia=15]=`Trivia`,e[e.Unknown=16]=`Unknown`,e[e.EOF=17]=`EOF`})(kbe||={});const Abe=Tbe,jbe=Z3,r6=$3;var Mbe;(function(e){e[e.InvalidSymbol=1]=`InvalidSymbol`,e[e.InvalidNumberFormat=2]=`InvalidNumberFormat`,e[e.PropertyNameExpected=3]=`PropertyNameExpected`,e[e.ValueExpected=4]=`ValueExpected`,e[e.ColonExpected=5]=`ColonExpected`,e[e.CommaExpected=6]=`CommaExpected`,e[e.CloseBraceExpected=7]=`CloseBraceExpected`,e[e.CloseBracketExpected=8]=`CloseBracketExpected`,e[e.EndOfFileExpected=9]=`EndOfFileExpected`,e[e.InvalidCommentToken=10]=`InvalidCommentToken`,e[e.UnexpectedEndOfComment=11]=`UnexpectedEndOfComment`,e[e.UnexpectedEndOfString=12]=`UnexpectedEndOfString`,e[e.UnexpectedEndOfNumber=13]=`UnexpectedEndOfNumber`,e[e.InvalidUnicode=14]=`InvalidUnicode`,e[e.InvalidEscapeCharacter=15]=`InvalidEscapeCharacter`,e[e.InvalidCharacter=16]=`InvalidCharacter`})(Mbe||={});function i6(e,t,n,r){return Dbe(e,t,n,r)}function a6(e,t){let n=t.slice(0).sort((e,t)=>{let n=e.offset-t.offset;return n===0?e.length-t.length:n}),r=e.length;for(let t=n.length-1;t>=0;t--){let i=n[t];if(i.offset+i.length<=r)e=n6(e,i);else throw Error(`Overlapping edit`);r=i.offset}return e}H$(`mermaid-validator`),H$(`git-context`),Fe(x),[...xu];function o6(e,t){return[...Object.entries(e).filter(e=>e[1]!==null).map(([e,t])=>({editor:e,root:t})),{editor:`agents`,root:t}]}o6(yu,Pu),[...o6(bu,Pu)].sort((e,t)=>{let n=u3.indexOf(e.editor),r=u3.indexOf(t.editor);return(n===-1?u3.length:n)-(r===-1?u3.length:r)||e.editor.localeCompare(t.editor)}),H$(`backlinks`),H$(`tag-index`),H$(`derived-document-index`),H$(`external-change-attribution`),H$(`file-watcher`),new class{_tail=Promise.resolve();enqueue(e){let t=this._tail.then(()=>e());return this._tail=t.catch(()=>void 0),t}},new class{capacity;store;writeIndex=0;filled=!1;constructor(e){if(!Number.isInteger(e)||e<=0)throw RangeError(`RingBuffer capacity must be a positive integer, got ${e}`);this.capacity=e,this.store=Array(e)}push(e){this.store[this.writeIndex]=e,this.writeIndex=(this.writeIndex+1)%this.capacity,this.writeIndex===0&&(this.filled=!0)}read(){let e=[],t=this.filled?this.capacity:this.writeIndex;for(let n=1;n<=t;n++){let t=(this.writeIndex-n+this.capacity)%this.capacity,r=this.store[t];r!==void 0&&e.push(r)}return e}get size(){return this.filled?this.capacity:this.writeIndex}}(256),Du.cursor,Du.codex,Du[`claude-desktop`],U$(()=>{});const s6={start:I().int().nonnegative().optional(),end:I().int().nonnegative().optional(),quote:F().min(1).optional(),prefix:F().max(1e3).optional(),suffix:F().max(1e3).optional()};B({docName:F().min(1),...s6,propertyKey:F().min(1).optional(),propertyPath:z(xo([F(),I().int().nonnegative()])).optional(),body:F(),queue:L().optional(),summary:F().optional()});const c6=$te();So(`action`,[B({action:U(`edit`),id:c6,body:F(),summary:F().optional()}),B({action:U(`resolve`),id:c6,summary:F().optional()}),B({action:U(`reopen`),id:c6,summary:F().optional()}),B({action:U(`replace`),id:c6,...s6,summary:F().optional()}),B({action:U(`queue`),id:c6,summary:F().optional()}),B({action:U(`unqueue`),id:c6,summary:F().optional()}),B({action:U(`dispatch-prepare`),id:c6,summary:F().optional()}),B({action:U(`dispatch-complete`),id:c6,summary:F().optional()}),B({action:U(`dispatch-prepare-batch`),ids:z(c6).min(1).max(200),summary:F().optional()}),B({action:U(`dispatch-complete-batch`),ids:z(c6).min(1).max(200),summary:F().optional()})]);const Nbe=/^[A-Za-z0-9-]{8,64}$/;let l6=null;function Pbe(e){return N(e??oe(),`.ok`,`machine-id`)}function Fbe(e){if(e===void 0&&l6!==null)return l6;let t=Pbe(e),n=null;try{let e=S(t,`utf-8`).trim();Nbe.test(e)&&(n=e)}catch{}if(n===null){n=je();try{v(pe(t),{recursive:!0}),te(t,`${n}\n`,{encoding:`utf-8`,mode:384})}catch(e){H$(`machine-id`).warn({path:t,err:e},`Failed to persist ${t} — using an ephemeral per-process id; lock ownership checks will fail closed (collision) instead of recognizing this machine: ${e instanceof Error?e.message:String(e)}`)}}return e===void 0&&(l6=n),n}H$(`process-lock`);function Ibe(e,t){return ve(e,`${t}.lock`)}function Lbe(e){let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`http:`&&t.protocol!==`https:`)return null;let n=t.hostname;return n===`localhost`||n===`[::1]`||/^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(n)?t.origin:null}function Rbe(e,t){if(typeof e.url==`string`&&e.url.length>0){let t=Lbe(e.url);if(t!==null)return t}if(e.port>0){let n=t?.fallbackHost??`localhost`;return`http://${n===`0.0.0.0`||n===`::`?`localhost`:n.includes(`:`)&&!n.startsWith(`[`)?`[${n}]`:n}:${e.port}`}return null}H$(`asset-references`);var u6=i(((e,t)=>{function n(e){if(e.length===0)return;let t=Object.create(null),n=0;for(;n<e.length;++n){let t=e.charCodeAt(n);if(u[t]!==1){if(t!==47||n===0)return;break}}if(n===e.length)return;let i=e.slice(0,n).toLowerCase(),a=++n;for(;n<e.length;++n)if(u[e.charCodeAt(n)]!==1){if(n===a||r(e,n,t)===void 0)return;break}if(n!==a)return{type:i,subtype:e.slice(a,n).toLowerCase(),params:t}}function r(e,t,n){for(;t<e.length;){for(;t<e.length;++t){let n=e.charCodeAt(t);if(n!==32&&n!==9)break}if(t===e.length)break;if(e.charCodeAt(t++)!==59)return;for(;t<e.length;++t){let n=e.charCodeAt(t);if(n!==32&&n!==9)break}if(t===e.length)return;let r,i=t;for(;t<e.length;++t){let n=e.charCodeAt(t);if(u[n]!==1){if(n!==61)return;break}}if(t===e.length||(r=e.slice(i,t),++t,t===e.length))return;let a=``,o;if(e.charCodeAt(t)===34){o=++t;let n=!1;for(;t<e.length;++t){let r=e.charCodeAt(t);if(r===92){n?(o=t,n=!1):(a+=e.slice(o,t),n=!0);continue}if(r===34){if(n){o=t,n=!1;continue}a+=e.slice(o,t);break}if(n&&=(o=t-1,!1),d[r]!==1)return}if(t===e.length)return;++t}else{for(o=t;t<e.length;++t)if(u[e.charCodeAt(t)]!==1){if(t===o)return;break}a=e.slice(o,t)}r=r.toLowerCase(),n[r]===void 0&&(n[r]=a)}return n}function i(e,t){if(e.length===0)return;let n=Object.create(null),r=0;for(;r<e.length;++r)if(u[e.charCodeAt(r)]!==1){if(a(e,r,n,t)===void 0)return;break}return{type:e.slice(0,r).toLowerCase(),params:n}}function a(e,t,n,r){for(;t<e.length;){for(;t<e.length;++t){let n=e.charCodeAt(t);if(n!==32&&n!==9)break}if(t===e.length)break;if(e.charCodeAt(t++)!==59)return;for(;t<e.length;++t){let n=e.charCodeAt(t);if(n!==32&&n!==9)break}if(t===e.length)return;let i,a=t;for(;t<e.length;++t){let n=e.charCodeAt(t);if(u[n]!==1){if(n===61)break;return}}if(t===e.length)return;let o=``,s,l;if(i=e.slice(a,t),i.charCodeAt(i.length-1)===42){let n=++t;for(;t<e.length;++t){let n=e.charCodeAt(t);if(f[n]!==1){if(n!==39)return;break}}if(t===e.length)return;for(l=e.slice(n,t),++t;t<e.length&&e.charCodeAt(t)!==39;++t);if(t===e.length||(++t,t===e.length))return;s=t;let r=0;for(;t<e.length;++t){let n=e.charCodeAt(t);if(p[n]!==1){if(n===37){let n,i;if(t+2<e.length&&(n=m[e.charCodeAt(t+1)])!==-1&&(i=m[e.charCodeAt(t+2)])!==-1){let a=(n<<4)+i;o+=e.slice(s,t),o+=String.fromCharCode(a),t+=2,s=t+1,a>=128?r=2:r===0&&(r=1);continue}return}break}}if(o+=e.slice(s,t),o=c(o,l,r),o===void 0)return}else{if(++t,t===e.length)return;if(e.charCodeAt(t)===34){s=++t;let n=!1;for(;t<e.length;++t){let r=e.charCodeAt(t);if(r===92){n?(s=t,n=!1):(o+=e.slice(s,t),n=!0);continue}if(r===34){if(n){s=t,n=!1;continue}o+=e.slice(s,t);break}if(n&&=(s=t-1,!1),d[r]!==1)return}if(t===e.length)return;++t}else{for(s=t;t<e.length;++t)if(u[e.charCodeAt(t)]!==1){if(t===s)return;break}o=e.slice(s,t)}if(o=r(o,2),o===void 0)return}i=i.toLowerCase(),n[i]===void 0&&(n[i]=o)}return n}function o(e){let t;for(;;)switch(e){case`utf-8`:case`utf8`:return s.utf8;case`latin1`:case`ascii`:case`us-ascii`:case`iso-8859-1`:case`iso8859-1`:case`iso88591`:case`iso_8859-1`:case`windows-1252`:case`iso_8859-1:1987`:case`cp1252`:case`x-cp1252`:return s.latin1;case`utf16le`:case`utf-16le`:case`ucs2`:case`ucs-2`:return s.utf16le;case`base64`:return s.base64;default:if(t===void 0){t=!0,e=e.toLowerCase();continue}return s.other.bind(e)}}let s={utf8:(e,t)=>{if(e.length===0)return``;if(typeof e==`string`){if(t<2)return e;e=Buffer.from(e,`latin1`)}return e.utf8Slice(0,e.length)},latin1:(e,t)=>e.length===0?``:typeof e==`string`?e:e.latin1Slice(0,e.length),utf16le:(e,t)=>e.length===0?``:(typeof e==`string`&&(e=Buffer.from(e,`latin1`)),e.ucs2Slice(0,e.length)),base64:(e,t)=>e.length===0?``:(typeof e==`string`&&(e=Buffer.from(e,`latin1`)),e.base64Slice(0,e.length)),other:(t,n)=>{if(t.length===0)return``;typeof t==`string`&&(t=Buffer.from(t,`latin1`));try{return new TextDecoder(e).decode(t)}catch{}}};function c(e,t,n){let r=o(t);if(r)return r(e,n)}function l(e){if(typeof e!=`string`)return``;for(let t=e.length-1;t>=0;--t)switch(e.charCodeAt(t)){case 47:case 92:return e=e.slice(t+1),e===`..`||e===`.`?``:e}return e===`..`||e===`.`?``:e}let u=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],d=[0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],f=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,0,0,0,0,1,0,1,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],p=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,1,0,0,0,0,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],m=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,-1,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];t.exports={basename:l,convertToUTF8:c,getDecoder:o,parseContentType:n,parseDisposition:i}})),zbe=i(((e,t)=>{function n(e,t,n,r,i){for(let a=0;a<i;++a)if(e[t+a]!==n[r+a])return!1;return!0}var r=class{constructor(e,t){if(typeof t!=`function`)throw Error(`Missing match callback`);if(typeof e==`string`)e=Buffer.from(e);else if(!Buffer.isBuffer(e))throw Error(`Expected Buffer for needle, got ${typeof e}`);let n=e.length;if(this.maxMatches=1/0,this.matches=0,this._cb=t,this._lookbehindSize=0,this._needle=e,this._bufPos=0,this._lookbehind=Buffer.allocUnsafe(n),this._occ=[n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n],n>1)for(let t=0;t<n-1;++t)this._occ[e[t]]=n-1-t}reset(){this.matches=0,this._lookbehindSize=0,this._bufPos=0}push(e,t){let n;Buffer.isBuffer(e)||(e=Buffer.from(e,`latin1`));let r=e.length;for(this._bufPos=t||0;n!==r&&this.matches<this.maxMatches;)n=i(this,e);return n}destroy(){let e=this._lookbehindSize;e&&this._cb(!1,this._lookbehind,0,e,!1),this.reset()}};function i(e,t){let r=t.length,i=e._needle,o=i.length,s=-e._lookbehindSize,c=o-1,l=i[c],u=r-o,d=e._occ,f=e._lookbehind;if(s<0){for(;s<0&&s<=u;){let n=s+c,r=n<0?f[e._lookbehindSize+n]:t[n];if(r===l&&a(e,t,s,c))return e._lookbehindSize=0,++e.matches,s>-e._lookbehindSize?e._cb(!0,f,0,e._lookbehindSize+s,!1):e._cb(!0,void 0,0,0,!0),e._bufPos=s+o;s+=d[r]}for(;s<0&&!a(e,t,s,r-s);)++s;if(s<0){let n=e._lookbehindSize+s;return n>0&&e._cb(!1,f,0,n,!1),e._lookbehindSize-=n,f.copy(f,0,n,e._lookbehindSize),f.set(t,e._lookbehindSize),e._lookbehindSize+=r,e._bufPos=r,r}e._cb(!1,f,0,e._lookbehindSize,!1),e._lookbehindSize=0}s+=e._bufPos;let p=i[0];for(;s<=u;){let r=t[s+c];if(r===l&&t[s]===p&&n(i,0,t,s,c))return++e.matches,s>0?e._cb(!0,t,e._bufPos,s,!0):e._cb(!0,void 0,0,0,!0),e._bufPos=s+o;s+=d[r]}for(;s<r;){if(t[s]!==p||!n(t,s,i,0,r-s)){++s;continue}t.copy(f,0,s,r),e._lookbehindSize=r-s;break}return s>0&&e._cb(!1,t,e._bufPos,s<r?s:r,!0),e._bufPos=r,r}function a(e,t,n,r){let i=e._lookbehind,a=e._lookbehindSize,o=e._needle;for(let e=0;e<r;++e,++n)if((n<0?i[a+n]:t[n])!==o[e])return!1;return!0}t.exports=r})),Bbe=i(((e,n)=>{let{Readable:r,Writable:i}=t(`stream`),a=zbe(),{basename:o,convertToUTF8:s,getDecoder:c,parseContentType:l,parseDisposition:u}=u6(),d=Buffer.from(`\r
457
- `),f=Buffer.from(`\r`),p=Buffer.from(`-`);function m(){}let h=16*1024;var g=class{constructor(e){this.header=Object.create(null),this.pairCount=0,this.byteCount=0,this.state=0,this.name=``,this.value=``,this.crlf=0,this.cb=e}reset(){this.header=Object.create(null),this.pairCount=0,this.byteCount=0,this.state=0,this.name=``,this.value=``,this.crlf=0}push(e,t,n){let r=t;for(;t<n;)switch(this.state){case 0:{let i=!1;for(;t<n;++t){if(this.byteCount===h)return-1;++this.byteCount;let n=e[t];if(w[n]!==1){if(n!==58||(this.name+=e.latin1Slice(r,t),this.name.length===0))return-1;++t,i=!0,this.state=1;break}}if(!i){this.name+=e.latin1Slice(r,t);break}}case 1:{let i=!1;for(;t<n;++t){if(this.byteCount===h)return-1;++this.byteCount;let n=e[t];if(n!==32&&n!==9){r=t,i=!0,this.state=2;break}}if(!i)break}case 2:switch(this.crlf){case 0:for(;t<n;++t){if(this.byteCount===h)return-1;++this.byteCount;let n=e[t];if(T[n]!==1){if(n!==13)return-1;++this.crlf;break}}this.value+=e.latin1Slice(r,t++);break;case 1:if(this.byteCount===h||(++this.byteCount,e[t++]!==10))return-1;++this.crlf;break;case 2:{if(this.byteCount===h)return-1;++this.byteCount;let n=e[t];n===32||n===9?(r=t,this.crlf=0):(++this.pairCount<2e3&&(this.name=this.name.toLowerCase(),this.header[this.name]===void 0?this.header[this.name]=[this.value]:this.header[this.name].push(this.value)),n===13?(++this.crlf,++t):(r=t,this.crlf=0,this.state=0,this.name=``,this.value=``));break}case 3:{if(this.byteCount===h||(++this.byteCount,e[t++]!==10))return-1;let n=this.header;return this.reset(),this.cb(n),t}}break}return t}},_=class extends r{constructor(e,t){super(e),this.truncated=!1,this._readcb=null,this.once(`end`,()=>{if(this._read(),--t._fileEndsLeft===0&&t._finalcb){let e=t._finalcb;t._finalcb=null,process.nextTick(e)}})}_read(e){let t=this._readcb;t&&(this._readcb=null,t())}};let v={push:(e,t)=>{},destroy:()=>{}};function y(e,t){let n=e._writecb;e._writecb=null,t?e.destroy(t):n&&n()}function b(e,t){return e}var x=class extends i{constructor(e){let t={autoDestroy:!0,emitClose:!0,highWaterMark:typeof e.highWaterMark==`number`?e.highWaterMark:void 0};if(super(t),!e.conType.params||typeof e.conType.params.boundary!=`string`)throw Error(`Multipart: Boundary not found`);let n=e.conType.params.boundary,r=typeof e.defParamCharset==`string`&&e.defParamCharset?c(e.defParamCharset):b,i=e.defCharset||`utf8`,h=e.preservePath,y={autoDestroy:!0,emitClose:!0,highWaterMark:typeof e.fileHwm==`number`?e.fileHwm:void 0},x=e.limits,S=x&&typeof x.fieldSize==`number`?x.fieldSize:1*1024*1024,C=x&&typeof x.fileSize==`number`?x.fileSize:1/0,w=x&&typeof x.files==`number`?x.files:1/0,T=x&&typeof x.fields==`number`?x.fields:1/0,E=x&&typeof x.parts==`number`?x.parts:1/0,D=-1,O=0,ee=0,te=!1;this._fileEndsLeft=0,this._fileStream=void 0,this._complete=!1;let ne=0,re,ie=0,ae,oe,se,k,ce=!1,le=!1,ue=!1;this._hparser=null;let A=new g(e=>{this._hparser=null,te=!1,se=`text/plain`,ae=i,oe=`7bit`,k=void 0,ce=!1;let t;if(!e[`content-disposition`]){te=!0;return}let n=u(e[`content-disposition`][0],r);if(!n||n.type!==`form-data`){te=!0;return}if(n.params&&(n.params.name&&(k=n.params.name),n.params[`filename*`]?t=n.params[`filename*`]:n.params.filename&&(t=n.params.filename),t!==void 0&&!h&&(t=o(t))),e[`content-type`]){let t=l(e[`content-type`][0]);t&&(se=`${t.type}/${t.subtype}`,t.params&&typeof t.params.charset==`string`&&(ae=t.params.charset.toLowerCase()))}if(e[`content-transfer-encoding`]&&(oe=e[`content-transfer-encoding`][0].toLowerCase()),se===`application/octet-stream`||t!==void 0){if(ee===w){le||(le=!0,this.emit(`filesLimit`)),te=!0;return}if(++ee,this.listenerCount(`file`)===0){te=!0;return}ne=0,this._fileStream=new _(y,this),++this._fileEndsLeft,this.emit(`file`,k,this._fileStream,{filename:t,encoding:oe,mimeType:se})}else{if(O===T){ue||(ue=!0,this.emit(`fieldsLimit`)),te=!0;return}if(++O,this.listenerCount(`field`)===0){te=!0;return}re=[],ie=0}}),j=0,de=(e,t,n,r,i)=>{retrydata:for(;t;){if(this._hparser!==null){let e=this._hparser.push(t,n,r);if(e===-1){this._hparser=null,A.reset(),this.emit(`error`,Error(`Malformed part header`));break}n=e}if(n===r)break;if(j!==0){if(j===1){switch(t[n]){case 45:j=2,++n;break;case 13:j=3,++n;break;default:j=0}if(n===r)return}if(j===2){if(j=0,t[n]===45){this._complete=!0,this._bparser=v;return}let e=this._writecb;this._writecb=m,de(!1,p,0,1,!1),this._writecb=e}else if(j===3)if(j=0,t[n]===10){if(++n,D>=E||(this._hparser=A,n===r))break;continue retrydata}else{let e=this._writecb;this._writecb=m,de(!1,f,0,1,!1),this._writecb=e}}if(!te){if(this._fileStream){let e,a=Math.min(r-n,C-ne);i?e=t.slice(n,n+a):(e=Buffer.allocUnsafe(a),t.copy(e,0,n,n+a)),ne+=e.length,ne===C?(e.length>0&&this._fileStream.push(e),this._fileStream.emit(`limit`),this._fileStream.truncated=!0,te=!0):this._fileStream.push(e)||(this._writecb&&(this._fileStream._readcb=this._writecb),this._writecb=null)}else if(re!==void 0){let e,a=Math.min(r-n,S-ie);i?e=t.slice(n,n+a):(e=Buffer.allocUnsafe(a),t.copy(e,0,n,n+a)),ie+=a,re.push(e),ie===S&&(te=!0,ce=!0)}}break}if(e){if(j=1,this._fileStream)this._fileStream.push(null),this._fileStream=null;else if(re!==void 0){let e;switch(re.length){case 0:e=``;break;case 1:e=s(re[0],ae,0);break;default:e=s(Buffer.concat(re,ie),ae,0)}re=void 0,ie=0,this.emit(`field`,k,e,{nameTruncated:!1,valueTruncated:ce,encoding:oe,mimeType:se})}++D===E&&this.emit(`partsLimit`)}};this._bparser=new a(`\r\n--${n}`,de),this._writecb=null,this._finalcb=null,this.write(d)}static detect(e){return e.type===`multipart`&&e.subtype===`form-data`}_write(e,t,n){this._writecb=n,this._bparser.push(e,0),this._writecb&&y(this)}_destroy(e,t){this._hparser=null,this._bparser=v,e||=C(this);let n=this._fileStream;n&&(this._fileStream=null,n.destroy(e)),t(e)}_final(e){if(this._bparser.destroy(),!this._complete)return e(Error(`Unexpected end of form`));this._fileEndsLeft?this._finalcb=S.bind(null,this,e):S(this,e)}};function S(e,t,n){if(n)return t(n);n=C(e),t(n)}function C(e){if(e._hparser)return Error(`Malformed part header`);let t=e._fileStream;if(t&&(e._fileStream=null,t.destroy(Error(`Unexpected end of file`))),!e._complete)return Error(`Unexpected end of form`)}let w=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],T=[0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];n.exports=x})),Vbe=i(((e,n)=>{let{Writable:r}=t(`stream`),{getDecoder:i}=u6();var a=class extends r{constructor(e){let t={autoDestroy:!0,emitClose:!0,highWaterMark:typeof e.highWaterMark==`number`?e.highWaterMark:void 0};super(t);let n=e.defCharset||`utf8`;e.conType.params&&typeof e.conType.params.charset==`string`&&(n=e.conType.params.charset),this.charset=n;let r=e.limits;this.fieldSizeLimit=r&&typeof r.fieldSize==`number`?r.fieldSize:1*1024*1024,this.fieldsLimit=r&&typeof r.fields==`number`?r.fields:1/0,this.fieldNameSizeLimit=r&&typeof r.fieldNameSize==`number`?r.fieldNameSize:100,this._inKey=!0,this._keyTrunc=!1,this._valTrunc=!1,this._bytesKey=0,this._bytesVal=0,this._fields=0,this._key=``,this._val=``,this._byte=-2,this._lastPos=0,this._encode=0,this._decoder=i(n)}static detect(e){return e.type===`application`&&e.subtype===`x-www-form-urlencoded`}_write(e,t,n){if(this._fields>=this.fieldsLimit)return n();let r=0,i=e.length;if(this._lastPos=0,this._byte!==-2){if(r=o(this,e,r,i),r===-1)return n(Error(`Malformed urlencoded form`));if(r>=i)return n();this._inKey?++this._bytesKey:++this._bytesVal}main:for(;r<i;)if(this._inKey){for(r=s(this,e,r,i);r<i;){switch(e[r]){case 61:this._lastPos<r&&(this._key+=e.latin1Slice(this._lastPos,r)),this._lastPos=++r,this._key=this._decoder(this._key,this._encode),this._encode=0,this._inKey=!1;continue main;case 38:if(this._lastPos<r&&(this._key+=e.latin1Slice(this._lastPos,r)),this._lastPos=++r,this._key=this._decoder(this._key,this._encode),this._encode=0,this._bytesKey>0&&this.emit(`field`,this._key,``,{nameTruncated:this._keyTrunc,valueTruncated:!1,encoding:this.charset,mimeType:`text/plain`}),this._key=``,this._val=``,this._keyTrunc=!1,this._valTrunc=!1,this._bytesKey=0,this._bytesVal=0,++this._fields>=this.fieldsLimit)return this.emit(`fieldsLimit`),n();continue;case 43:this._lastPos<r&&(this._key+=e.latin1Slice(this._lastPos,r)),this._key+=` `,this._lastPos=r+1;break;case 37:if(this._encode===0&&(this._encode=1),this._lastPos<r&&(this._key+=e.latin1Slice(this._lastPos,r)),this._lastPos=r+1,this._byte=-1,r=o(this,e,r+1,i),r===-1)return n(Error(`Malformed urlencoded form`));if(r>=i)return n();++this._bytesKey,r=s(this,e,r,i);continue}++r,++this._bytesKey,r=s(this,e,r,i)}this._lastPos<r&&(this._key+=e.latin1Slice(this._lastPos,r))}else{for(r=c(this,e,r,i);r<i;){switch(e[r]){case 38:if(this._lastPos<r&&(this._val+=e.latin1Slice(this._lastPos,r)),this._lastPos=++r,this._inKey=!0,this._val=this._decoder(this._val,this._encode),this._encode=0,(this._bytesKey>0||this._bytesVal>0)&&this.emit(`field`,this._key,this._val,{nameTruncated:this._keyTrunc,valueTruncated:this._valTrunc,encoding:this.charset,mimeType:`text/plain`}),this._key=``,this._val=``,this._keyTrunc=!1,this._valTrunc=!1,this._bytesKey=0,this._bytesVal=0,++this._fields>=this.fieldsLimit)return this.emit(`fieldsLimit`),n();continue main;case 43:this._lastPos<r&&(this._val+=e.latin1Slice(this._lastPos,r)),this._val+=` `,this._lastPos=r+1;break;case 37:if(this._encode===0&&(this._encode=1),this._lastPos<r&&(this._val+=e.latin1Slice(this._lastPos,r)),this._lastPos=r+1,this._byte=-1,r=o(this,e,r+1,i),r===-1)return n(Error(`Malformed urlencoded form`));if(r>=i)return n();++this._bytesVal,r=c(this,e,r,i);continue}++r,++this._bytesVal,r=c(this,e,r,i)}this._lastPos<r&&(this._val+=e.latin1Slice(this._lastPos,r))}n()}_final(e){if(this._byte!==-2)return e(Error(`Malformed urlencoded form`));(!this._inKey||this._bytesKey>0||this._bytesVal>0)&&(this._inKey?this._key=this._decoder(this._key,this._encode):this._val=this._decoder(this._val,this._encode),this.emit(`field`,this._key,this._val,{nameTruncated:this._keyTrunc,valueTruncated:this._valTrunc,encoding:this.charset,mimeType:`text/plain`})),e()}};function o(e,t,n,r){if(n>=r)return r;if(e._byte===-1){let i=l[t[n++]];if(i===-1)return-1;if(i>=8&&(e._encode=2),n<r){let r=l[t[n++]];if(r===-1)return-1;e._inKey?e._key+=String.fromCharCode((i<<4)+r):e._val+=String.fromCharCode((i<<4)+r),e._byte=-2,e._lastPos=n}else e._byte=i}else{let r=l[t[n++]];if(r===-1)return-1;e._inKey?e._key+=String.fromCharCode((e._byte<<4)+r):e._val+=String.fromCharCode((e._byte<<4)+r),e._byte=-2,e._lastPos=n}return n}function s(e,t,n,r){if(e._bytesKey>e.fieldNameSizeLimit){for(e._keyTrunc||e._lastPos<n&&(e._key+=t.latin1Slice(e._lastPos,n-1)),e._keyTrunc=!0;n<r;++n){let r=t[n];if(r===61||r===38)break;++e._bytesKey}e._lastPos=n}return n}function c(e,t,n,r){if(e._bytesVal>e.fieldSizeLimit){for(e._valTrunc||e._lastPos<n&&(e._val+=t.latin1Slice(e._lastPos,n-1)),e._valTrunc=!0;n<r&&t[n]!==38;++n)++e._bytesVal;e._lastPos=n}return n}let l=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,-1,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];n.exports=a}));i(((e,t)=>{let{parseContentType:n}=u6();function r(e){let t=e.headers,r=n(t[`content-type`]);if(!r)throw Error(`Malformed content type`);for(let n of i){if(!n.detect(r))continue;let i={limits:e.limits,headers:t,conType:r,highWaterMark:void 0,fileHwm:void 0,defCharset:void 0,defParamCharset:void 0,preservePath:!1};return e.highWaterMark&&(i.highWaterMark=e.highWaterMark),e.fileHwm&&(i.fileHwm=e.fileHwm),i.defCharset=e.defCharset,i.defParamCharset=e.defParamCharset,i.preservePath=e.preservePath,new n(i)}throw Error(`Unsupported content type: ${t[`content-type`]}`)}let i=[Bbe(),Vbe()].filter(function(e){return typeof e.detect==`function`});t.exports=e=>{if((typeof e!=`object`||!e)&&(e={}),typeof e.headers!=`object`||e.headers===null||typeof e.headers[`content-type`]!=`string`)throw Error(`Missing Content-Type`);return r(e)}}))(),H$(`file-ops`),H$(`upload-streaming`);const d6="Absolute host path inside the target OpenKnowledge project. Required when the MCP server is registered globally (e.g. `npx @inkeep/open-knowledge mcp` once at the host level, routing per call), unless the MCP client advertises exactly one root via the `roots` capability — that single root is then used as the implicit `cwd`. Optional when the server is anchored to a single project (the per-project HTTP MCP server defaults to its configured project root).";F().max(200).optional().describe(`Optional one-line user-outcome description (≤80 chars). Appears as a bullet in the timeline.`),F().length(40).regex(/^[0-9a-f]+$/i).describe("A 40-character commit SHA identifying a saved version. Produced by `checkpoint`, listed by `history` as `entries[].version`, and consumed here — the same `version` field name across all three."),F().nullable().describe("Route-only preview URL (`/#/<doc>`, no host:port), or null when no UI is running."),F().optional().describe(`How the previewUrl was resolved (e.g. the UI lock).`),F().optional().describe(`Route of the prior/removed path, for closing a stale preview tab.`);const Hbe=B({value:F(),truncatedFrom:I().optional(),hint:F().optional()}).describe(`Normalized change-note summary, when one was recorded.`),Ube=z(V(F(),R()));V(F(),R()).optional().describe("Preview-attach hint (`{ action, previewUrl?, message? }`) when relevant."),z(IJ).describe('Outbound internal links in the just-written doc that do not resolve. Always present — `[]` means every link resolves. Each: `{ href (as written), resolvedTo (the docName or content-root file path it pointed at, or null), reason: "no-such-doc" | "no-such-file" | "unresolvable" }`. Report-only — the write landed regardless; fix in a follow-up edit.'),Hbe.optional(),z(PJ).min(1).optional().describe("Advisory entries discriminated by `kind`. Write-integrity kinds — `content-divergence` (converged Y.Text didn't byte-match what you composed) and `disk-edit-reconciled` (an out-of-band disk edit was folded in before your write) — mean re-read the doc. The renderability kind `mermaid-parse-error` means the write landed but that fence will not render — fix it and re-edit."),z(B({name:F(),description:F().optional()})).min(1).optional().describe("Templates the parent folder offers, present only when a create passed no `template`. A nudge — the write already landed; pass `template` next time to match the folder's shape.");const Wbe=F().optional().describe("Auto-duplicated body text. `textPlusStructured` mirrors the visible body here as a Claude / Claude Desktop client-quirk workaround (those clients hide `content[]` when `structuredContent` is present). Internal — programmatic consumers should prefer the `content[0].text` channel.");function f6(e){return{text:Wbe,...e}}H$(`git-checkout`),H$(`git-worktree-status`),H$(`rename-log`),H$(`managed-artifact-persistence`),H$(`timeline`);const Gbe=global.Request;var p6=class extends Gbe{constructor(e,t){if(typeof e==`object`&&x6 in e){let n=t!==void 0&&`body`in t&&t.body!=null;if(e[A6]&&!n)throw TypeError(`Cannot construct a Request with a Request object that has already been used.`);e=e[x6]()}t?.body?.getReader!==void 0&&(t.duplex??=`half`),super(e,t)}};const m6=e=>{let t=[],n=e.rawHeaders;for(let e=0,r=n.length;e<r;e+=2){let r=n[e];r.charCodeAt(0)!==58&&t.push([r,n[e+1]])}return new Headers(t)},Kbe=Symbol(`wrapBodyStream`),qbe=new Set([`latin1`,`binary`,`hex`,`base64`,`base64url`]),Jbe=e=>e===null||qbe.has(e),h6=Symbol(`bodyBufferedBeforeDisconnect`),g6=Symbol(`bodyBufferedLengthBeforeDisconnect`),_6=(e,t)=>Buffer.isBuffer(e)?e:Buffer.from(e,t??`utf8`),v6=e=>!(e instanceof Ie)&&!!e.complete&&!!e.readableAborted&&typeof e.read==`function`&&Jbe(e.readableEncoding),y6=(e,t)=>{if(e.readableDidRead&&!t||!v6(e))return;let n=e;if(n[h6]!==void 0)return n[h6];let r,i=e.errored;if(i&&i.code!==`ECONNRESET`)r=i;else if(n[g6]!==void 0&&e.readableLength!==n[g6])r=N6();else{let n=t??[],i=e.read();i!==null&&n.push(_6(i,e.readableEncoding));let a=n.length===1?n[0]:Buffer.concat(n);r=a;let o=e.headers[`content-length`];if(typeof o==`string`&&/^\d+$/.test(o)){let e=Number(o);Number.isSafeInteger(e)&&a.length!==e&&(r=N6())}}return n[h6]=r,r},b6=(e,t)=>{if(t instanceof Error){e.error(t);return}t.length>0&&e.enqueue(t),e.close()},Ybe=(e,t,n,r,i)=>{let a={method:e,headers:n,signal:i.signal};if(e===`TRACE`){a.method=`GET`;let e=new p6(t,a);return Object.defineProperty(e,`method`,{get(){return`TRACE`}}),e}if(!(e===`GET`||e===`HEAD`))if(`rawBody`in r&&r.rawBody instanceof Buffer)a.body=new ReadableStream({start(e){e.enqueue(r.rawBody),e.close()}});else if(r[Kbe]){let e;a.body=new ReadableStream({async pull(t){try{if(!e){let e=y6(r);if(e!==void 0){b6(t,e);return}}e||=Oe.toWeb(r).getReader();let{done:n,value:i}=await e.read();n?t.close():t.enqueue(i)}catch(e){t.error(e)}}})}else{let e=y6(r);e===void 0?a.body=Oe.toWeb(r):a.body=new ReadableStream({start(t){b6(t,e)}})}return new p6(t,a)},x6=Symbol(`getRequestCache`),S6=Symbol(`requestCache`),C6=Symbol(`incomingKey`),w6=Symbol(`urlKey`),Xbe=Symbol(`methodKey`),T6=Symbol(`headersKey`),E6=Symbol(`abortControllerKey`),D6=Symbol(`getAbortController`),Zbe=Symbol(`abortRequest`),O6=Symbol(`bodyBuffer`),k6=Symbol(`bodyReadPromise`),A6=Symbol(`bodyConsumedDirectly`),j6=Symbol(`bodyLockReader`),M6=Symbol(`abortReason`),N6=()=>TypeError(`Body is unusable`),P6=()=>Promise.reject(N6()),Qbe=new TextDecoder,$be=e=>{if(e[A6])return P6();e[A6]=!0},exe=e=>e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength),txe=e=>(e[T6]||=m6(e[C6])).get(`content-type`)||``,nxe=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,rxe=e=>{if(!nxe.test(e))return TypeError(`'${e}' is not a valid HTTP method.`);let t=e.toUpperCase();if(t===`CONNECT`||t===`TRACK`||t===`TRACE`&&e!==`TRACE`)return TypeError(`'${e}' HTTP method is unsupported.`)},F6=(e,t,n)=>{if(e[A6])return P6();let r=e.method;if(r===`GET`||r===`HEAD`)return e[x6]()[t]();let i=rxe(r);if(i)return Promise.reject(i);if(e[S6]&&r!==`TRACE`)return e[S6][t]();let a=$be(e);if(a)return a;let o=ixe(e);if(o){let t=Promise.resolve(n(o,e));return e[O6]=void 0,t}return axe(e).then(t=>{let r=n(t,e);return e[O6]=void 0,r})},ixe=e=>{let t=e[C6];if(`rawBody`in t&&t.rawBody instanceof Buffer)return t.rawBody},I6=(e,t)=>{if(t.errored)return t.errored;let n=e[M6];return n===void 0?Error(`Client connection prematurely closed.`):n instanceof Error?n:Error(String(n))},axe=e=>{if(e[O6])return Promise.resolve(e[O6]);if(e[k6])return e[k6];let t=e[C6];if(t.readableDidRead)return P6();let n=y6(t);if(n!==void 0)return n instanceof Error?Promise.reject(n):(e[O6]=n,Promise.resolve(n));let r=new Promise((n,r)=>{let i=[],a=!1,o=e=>{a||(a=!0,f(),e())},s=a=>{let s=t.errored??a;return!v6(t)||s&&s.code!==`ECONNRESET`?!1:(o(()=>{let o=y6(t,i);o instanceof Error?r(o):o===void 0?r(a??I6(e,t)):(e[O6]=o,n(o))}),!0)},c=e=>{i.push(_6(e,t.readableEncoding))},l=()=>{o(()=>{let t=i.length===1?i[0]:Buffer.concat(i);e[O6]=t,n(t)})},u=e=>{s(e)||o(()=>{r(e)})},d=()=>{if(t.readableEnded){l();return}s()||o(()=>{r(I6(e,t))})},f=()=>{t.off(`data`,c),t.off(`end`,l),t.off(`error`,u),t.off(`close`,d),e[k6]=void 0};t.on(`data`,c),t.on(`end`,l),t.on(`error`,u),t.on(`close`,d),queueMicrotask(()=>{a||(t.readableEnded?l():t.errored?u(t.errored):t.destroyed&&d())})});return e[k6]=r,r},L6={get method(){return this[Xbe]},get url(){return this[w6]},get headers(){return this[T6]||=m6(this[C6])},[Zbe](e){this[M6]===void 0&&(this[M6]=e);let t=this[E6];t&&!t.signal.aborted&&t.abort(e)},[D6](){return this[E6]||=new AbortController,this[M6]!==void 0&&!this[E6].signal.aborted&&this[E6].abort(this[M6]),this[E6]},[x6](){let e=this[D6]();if(this[S6])return this[S6];let t=this.method;if(this[A6]&&!(t===`GET`||t===`HEAD`)){this[O6]=void 0;let n={method:t===`TRACE`?`GET`:t,headers:this.headers,signal:e.signal};t!==`TRACE`&&(n.body=new ReadableStream({start(e){e.close()}}),n.duplex=`half`);let r=new p6(this[w6],n);return t===`TRACE`&&Object.defineProperty(r,`method`,{get(){return`TRACE`}}),this[S6]=r}return this[S6]=Ybe(this.method,this[w6],this.headers,this[C6],e)},get body(){if(!this[A6])return this[x6]().body;let e=this[x6]();return!this[j6]&&e.body&&(this[j6]=e.body.getReader()),e.body},get bodyUsed(){return this[A6]?!0:this[S6]?this[S6].bodyUsed:!1}};Object.defineProperty(L6,`signal`,{get(){return this[D6]().signal}}),[`cache`,`credentials`,`destination`,`integrity`,`mode`,`redirect`,`referrer`,`referrerPolicy`,`keepalive`].forEach(e=>{Object.defineProperty(L6,e,{get(){return this[x6]()[e]}})}),[`clone`,`formData`].forEach(e=>{Object.defineProperty(L6,e,{value:function(){if(this[A6]){if(e===`clone`)throw N6();return P6()}return this[x6]()[e]()}})}),Object.defineProperty(L6,`text`,{value:function(){return F6(this,`text`,e=>Qbe.decode(e))}}),Object.defineProperty(L6,`arrayBuffer`,{value:function(){return F6(this,`arrayBuffer`,e=>exe(e))}}),Object.defineProperty(L6,`blob`,{value:function(){return F6(this,`blob`,(e,t)=>{let n=txe(t);return new Response(e,n?{headers:{"content-type":n}}:void 0).blob()})}}),Object.defineProperty(L6,`json`,{value:function(){return this[A6]?P6():this.text().then(JSON.parse)}}),Object.defineProperty(L6,Symbol.for(`nodejs.util.inspect.custom`),{value:function(e,t,n){return`Request (lightweight) ${n({method:this.method,url:this.url,headers:this.headers,nativeRequest:this[S6]},{...t,depth:e==null?null:e-1})}`}}),Object.setPrototypeOf(L6,p6.prototype);const R6=Symbol(`responseCache`),z6=Symbol(`getResponseCache`),B6=Symbol(`cache`),V6=global.Response;var H6=class e{#e;#t;[z6](){let e=this[B6],t=e&&e[2]instanceof Headers?e[2]:void 0;return delete this[B6],this[R6]||=new V6(this.#e,t?{status:this.#t?.status,statusText:this.#t?.statusText,headers:t}:this.#t)}constructor(t,n){let r;if(this.#e=t,n instanceof V6){let t=n[R6];if(t){this.#t=t,this[z6]();return}this.#t=n instanceof e?n.#t:n,r=new Headers(n.headers)}else this.#t=n;(t==null||typeof t==`string`||t?.getReader!==void 0||t instanceof Blob||t instanceof Uint8Array)&&(this[B6]=[n?.status||200,t??null,r||n?.headers])}get headers(){let e=this[B6];return e?(e[2]instanceof Headers||(e[2]=new Headers(e[2]||(e[1]===null?void 0:{"content-type":`text/plain; charset=UTF-8`}))),e[2]):this[z6]().headers}get status(){return this[B6]?.[0]??this[z6]().status}get ok(){let e=this.status;return e>=200&&e<300}};[`body`,`bodyUsed`,`redirected`,`statusText`,`trailers`,`type`,`url`].forEach(e=>{Object.defineProperty(H6.prototype,e,{get(){return this[z6]()[e]}})}),[`arrayBuffer`,`blob`,`clone`,`formData`,`json`,`text`].forEach(e=>{Object.defineProperty(H6.prototype,e,{value:function(){return this[z6]()[e]()}})}),Object.defineProperty(H6.prototype,Symbol.for(`nodejs.util.inspect.custom`),{value:function(e,t,n){return`Response (lightweight) ${n({status:this.status,headers:this.headers,ok:this.ok,nativeResponse:this[R6]},{...t,depth:e==null?null:e-1})}`}}),Object.setPrototypeOf(H6,V6),Object.setPrototypeOf(H6.prototype,V6.prototype);const oxe=/^https?:\/\/[!#-;=?-[\]_a-z~A-Z]+$/,sxe=e=>e instanceof URL?e.href:oxe.test(e)?e:new URL(e).href,cxe=new Set([301,302,303,307,308]);Object.defineProperty(H6,`redirect`,{value:function(e,t=302){if(!cxe.has(t))throw RangeError(`Invalid status code`);return new H6(null,{status:t,headers:{location:sxe(e)}})},writable:!0,configurable:!0}),Object.defineProperty(H6,`json`,{value:function(e,t){let n=JSON.stringify(e);if(n===void 0)throw TypeError(`The data is not JSON serializable`);let r=t?.headers,i;return r?(i=new Headers(r),i.has(`content-type`)||i.set(`content-type`,`application/json`)):i={"content-type":`application/json`},new H6(n,{status:t?.status??200,statusText:t?.statusText,headers:i})},writable:!0,configurable:!0}),globalThis.CloseEvent,globalThis.ErrorEvent,new Response(null,{headers:{"x-hono-already-sent":`true`}}),H$(`suggest-links`);function U6(e){try{return T.native(e)}catch{return e}}`${Nu}`,`${Cu.join(`
458
- `)}`,d3.project,Object.fromEntries(Object.entries(Fu).map(([e,t])=>[t,e])),[`These are patterns to adapt to your domain, not a layout to copy verbatim.`,"To build a variant: create your own folders (via `write` or your editor) and reuse only the ideas that fit.","To adopt this pack as-is: re-run without `--dry-run`."].join(`
459
- `),H$(`local-op-security`),H$(`skills-leaderboard`),B({target:H(Object.keys({"claude-cowork":{type:`app-bundle`,appName:`Claude`,urlScheme:`claude:`,probeScheme:`claude`,quitFirst:!1},"claude-code":{type:`app-bundle`,appName:`Claude`,urlScheme:`claude:`,probeScheme:`claude`,quitFirst:!1},codex:{type:`app-bundle`,appName:`Codex`,urlScheme:`codex:`,probeScheme:`codex`,quitFirst:!0},cursor:{type:`cli-binary`,binaryName:`cursor`,urlScheme:`cursor:`}})),url:F().min(1).max(4096),workspacePath:F().optional()}),B({}).loose(),i(((e,t)=>{(function(e){let n=`(0?\\d+|0x[a-f0-9]+)`,r={fourOctet:RegExp(`^${n}\\.${n}\\.${n}\\.${n}$`,`i`),threeOctet:RegExp(`^${n}\\.${n}\\.${n}$`,`i`),twoOctet:RegExp(`^${n}\\.${n}$`,`i`),longValue:RegExp(`^${n}$`,`i`)},i=RegExp(`^0[0-7]+$`,`i`),a=RegExp(`^0x[a-f0-9]+$`,`i`),o=`%[0-9a-z]{1,}`,s=`(?:[0-9a-f]+::?)+`,c={zoneIndex:new RegExp(o,`i`),native:RegExp(`^(::)?(${s})?([0-9a-f]+)?(::)?(${o})?$`,`i`),deprecatedTransitional:RegExp(`^(?:::)(${n}\\.${n}\\.${n}\\.${n}(${o})?)$`,`i`),transitional:RegExp(`^((?:${s})|(?:::)(?:${s})?)${n}\\.${n}\\.${n}\\.${n}(${o})?$`,`i`)};function l(e,t){if(e.indexOf(`::`)!==e.lastIndexOf(`::`))return null;let n=0,r=-1,i=(e.match(c.zoneIndex)||[])[0],a,o;for(i&&(i=i.substring(1),e=e.replace(/%.+$/,``));(r=e.indexOf(`:`,r+1))>=0;)n++;if(e.substr(0,2)===`::`&&n--,e.substr(-2,2)===`::`&&n--,n>t)return null;for(o=t-n,a=`:`;o--;)a+=`0:`;return e=e.replace(`::`,a),e[0]===`:`&&(e=e.slice(1)),e[e.length-1]===`:`&&(e=e.slice(0,-1)),t=(function(){let t=e.split(`:`),n=[];for(let e=0;e<t.length;e++)n.push(parseInt(t[e],16));return n})(),{parts:t,zoneId:i}}function u(e,t,n,r){if(e.length!==t.length)throw Error(`ipaddr: cannot match CIDR for objects with different lengths`);let i=0,a;for(;r>0;){if(a=n-r,a<0&&(a=0),e[i]>>a!==t[i]>>a)return!1;r-=n,i+=1}return!0}function d(e){if(a.test(e))return parseInt(e,16);if(e[0]===`0`&&!isNaN(parseInt(e[1],10))){if(i.test(e))return parseInt(e,8);throw Error(`ipaddr: cannot parse ${e} as octal`)}return parseInt(e,10)}function f(e,t){for(;e.length<t;)e=`0${e}`;return e}let p={};p.IPv4=(function(){function e(e){if(e.length!==4)throw Error(`ipaddr: ipv4 octet count should be 4`);let t,n;for(t=0;t<e.length;t++)if(n=e[t],!(0<=n&&n<=255))throw Error(`ipaddr: ipv4 octet should fit in 8 bits`);this.octets=e}return e.prototype.SpecialRanges={unspecified:[[new e([0,0,0,0]),8]],broadcast:[[new e([255,255,255,255]),32]],multicast:[[new e([224,0,0,0]),4]],linkLocal:[[new e([169,254,0,0]),16]],loopback:[[new e([127,0,0,0]),8]],carrierGradeNat:[[new e([100,64,0,0]),10]],private:[[new e([10,0,0,0]),8],[new e([172,16,0,0]),12],[new e([192,168,0,0]),16]],reserved:[[new e([192,0,0,0]),24],[new e([192,0,2,0]),24],[new e([192,88,99,0]),24],[new e([198,18,0,0]),15],[new e([198,51,100,0]),24],[new e([203,0,113,0]),24],[new e([240,0,0,0]),4]],as112:[[new e([192,175,48,0]),24],[new e([192,31,196,0]),24]],amt:[[new e([192,52,193,0]),24]]},e.prototype.kind=function(){return`ipv4`},e.prototype.match=function(e,t){let n;if(t===void 0&&(n=e,e=n[0],t=n[1]),e.kind()!==`ipv4`)throw Error(`ipaddr: cannot match ipv4 address with non-ipv4 one`);return u(this.octets,e.octets,8,t)},e.prototype.prefixLengthFromSubnetMask=function(){let e=0,t=!1,n={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},r,i,a;for(r=3;r>=0;--r)if(i=this.octets[r],i in n){if(a=n[i],t&&a!==0)return null;a!==8&&(t=!0),e+=a}else return null;return 32-e},e.prototype.range=function(){return p.subnetMatch(this,this.SpecialRanges)},e.prototype.toByteArray=function(){return this.octets.slice(0)},e.prototype.toIPv4MappedAddress=function(){return p.IPv6.parse(`::ffff:${this.toString()}`)},e.prototype.toNormalizedString=function(){return this.toString()},e.prototype.toString=function(){return this.octets.join(`.`)},e})(),p.IPv4.broadcastAddressFromCIDR=function(e){try{let t=this.parseCIDR(e),n=t[0].toByteArray(),r=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),i=[],a=0;for(;a<4;)i.push(parseInt(n[a],10)|parseInt(r[a],10)^255),a++;return new this(i)}catch{throw Error(`ipaddr: the address does not have IPv4 CIDR format`)}},p.IPv4.isIPv4=function(e){return this.parser(e)!==null},p.IPv4.isValid=function(e){try{return new this(this.parser(e)),!0}catch{return!1}},p.IPv4.isValidCIDR=function(e){try{return this.parseCIDR(e),!0}catch{return!1}},p.IPv4.isValidFourPartDecimal=function(e){return!!(p.IPv4.isValid(e)&&e.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},p.IPv4.isValidCIDRFourPartDecimal=function(e){let t=e.match(/^(.+)\/(\d+)$/);return!p.IPv4.isValidCIDR(e)||!t?!1:p.IPv4.isValidFourPartDecimal(t[1])},p.IPv4.networkAddressFromCIDR=function(e){let t,n,r,i,a;try{for(t=this.parseCIDR(e),r=t[0].toByteArray(),a=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),i=[],n=0;n<4;)i.push(parseInt(r[n],10)&parseInt(a[n],10)),n++;return new this(i)}catch{throw Error(`ipaddr: the address does not have IPv4 CIDR format`)}},p.IPv4.parse=function(e){let t=this.parser(e);if(t===null)throw Error(`ipaddr: string is not formatted like an IPv4 Address`);return new this(t)},p.IPv4.parseCIDR=function(e){let t;if(t=e.match(/^(.+)\/(\d+)$/)){let e=parseInt(t[2]);if(e>=0&&e<=32){let n=[this.parse(t[1]),e];return Object.defineProperty(n,`toString`,{value:function(){return this.join(`/`)}}),n}}throw Error(`ipaddr: string is not formatted like an IPv4 CIDR range`)},p.IPv4.parser=function(e){let t,n,i;if(t=e.match(r.fourOctet))return(function(){let e=t.slice(1,6),r=[];for(let t=0;t<e.length;t++)n=e[t],r.push(d(n));return r})();if(t=e.match(r.longValue)){if(i=d(t[1]),i>4294967295||i<0)throw Error(`ipaddr: address outside defined range`);return(function(){let e=[],t;for(t=0;t<=24;t+=8)e.push(i>>t&255);return e})().reverse()}else if(t=e.match(r.twoOctet))return(function(){let e=t.slice(1,4),n=[];if(i=d(e[1]),i>16777215||i<0)throw Error(`ipaddr: address outside defined range`);return n.push(d(e[0])),n.push(i>>16&255),n.push(i>>8&255),n.push(i&255),n})();else if(t=e.match(r.threeOctet))return(function(){let e=t.slice(1,5),n=[];if(i=d(e[2]),i>65535||i<0)throw Error(`ipaddr: address outside defined range`);return n.push(d(e[0])),n.push(d(e[1])),n.push(i>>8&255),n.push(i&255),n})();else return null},p.IPv4.subnetMaskFromPrefixLength=function(e){if(e=parseInt(e),e<0||e>32)throw Error(`ipaddr: invalid IPv4 prefix length`);let t=[0,0,0,0],n=0,r=Math.floor(e/8);for(;n<r;)t[n]=255,n++;return r<4&&(t[r]=2**(e%8)-1<<8-e%8),new this(t)},p.IPv6=(function(){function e(e,t){let n,r;if(e.length===16)for(this.parts=[],n=0;n<=14;n+=2)this.parts.push(e[n]<<8|e[n+1]);else if(e.length===8)this.parts=e;else throw Error(`ipaddr: ipv6 part count should be 8 or 16`);for(n=0;n<this.parts.length;n++)if(r=this.parts[n],!(0<=r&&r<=65535))throw Error(`ipaddr: ipv6 part should fit in 16 bits`);t&&(this.zoneId=t)}return e.prototype.SpecialRanges={unspecified:[new e([0,0,0,0,0,0,0,0]),128],linkLocal:[new e([65152,0,0,0,0,0,0,0]),10],multicast:[new e([65280,0,0,0,0,0,0,0]),8],loopback:[new e([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new e([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new e([0,0,0,0,0,65535,0,0]),96],deprecatedSiteLocal:[new e([65216,0,0,0,0,0,0,0]),10],discard:[new e([256,0,0,0,0,0,0,0]),64],rfc6145:[new e([0,0,0,0,65535,0,0,0]),96],rfc6052:[[new e([100,65435,0,0,0,0,0,0]),96],[new e([100,65435,1,0,0,0,0,0]),48]],"6to4":[new e([8194,0,0,0,0,0,0,0]),16],teredo:[new e([8193,0,0,0,0,0,0,0]),32],benchmarking:[new e([8193,2,0,0,0,0,0,0]),48],amt:[new e([8193,3,0,0,0,0,0,0]),32],as112v6:[[new e([8193,4,274,0,0,0,0,0]),48],[new e([9760,79,32768,0,0,0,0,0]),48]],deprecatedOrchid:[new e([8193,16,0,0,0,0,0,0]),28],orchid2:[new e([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new e([8193,48,0,0,0,0,0,0]),28],segmentRouting:[new e([24320,0,0,0,0,0,0,0]),16],reserved:[[new e([8193,0,0,0,0,0,0,0]),23],[new e([8193,3512,0,0,0,0,0,0]),32],[new e([16383,0,0,0,0,0,0,0]),20]]},e.prototype.isIPv4MappedAddress=function(){return this.range()===`ipv4Mapped`},e.prototype.kind=function(){return`ipv6`},e.prototype.match=function(e,t){let n;if(t===void 0&&(n=e,e=n[0],t=n[1]),e.kind()!==`ipv6`)throw Error(`ipaddr: cannot match ipv6 address with non-ipv6 one`);return u(this.parts,e.parts,16,t)},e.prototype.prefixLengthFromSubnetMask=function(){let e=0,t=!1,n={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},r,i;for(let a=7;a>=0;--a)if(r=this.parts[a],r in n){if(i=n[r],t&&i!==0)return null;i!==16&&(t=!0),e+=i}else return null;return 128-e},e.prototype.range=function(){return p.subnetMatch(this,this.SpecialRanges)},e.prototype.toByteArray=function(){let e,t=[],n=this.parts;for(let r=0;r<n.length;r++)e=n[r],t.push(e>>8),t.push(e&255);return t},e.prototype.toFixedLengthString=function(){let e=(function(){let e=[];for(let t=0;t<this.parts.length;t++)e.push(f(this.parts[t].toString(16),4));return e}).call(this).join(`:`),t=``;return this.zoneId&&(t=`%${this.zoneId}`),e+t},e.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw Error(`ipaddr: trying to convert a generic ipv6 address to ipv4`);let e=this.parts.slice(-2),t=e[0],n=e[1];return new p.IPv4([t>>8,t&255,n>>8,n&255])},e.prototype.toNormalizedString=function(){let e=(function(){let e=[];for(let t=0;t<this.parts.length;t++)e.push(this.parts[t].toString(16));return e}).call(this).join(`:`),t=``;return this.zoneId&&(t=`%${this.zoneId}`),e+t},e.prototype.toRFC5952String=function(){let e=/((^|:)(0(:|$)){2,})/g,t=this.toNormalizedString(),n=0,r=-1,i;for(;i=e.exec(t);)i[0].length>r&&(n=i.index,r=i[0].length);return r<0?t:`${t.substring(0,n)}::${t.substring(n+r)}`},e.prototype.toString=function(){return this.toRFC5952String()},e})(),p.IPv6.broadcastAddressFromCIDR=function(e){try{let t=this.parseCIDR(e),n=t[0].toByteArray(),r=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),i=[],a=0;for(;a<16;)i.push(parseInt(n[a],10)|parseInt(r[a],10)^255),a++;return new this(i)}catch(e){throw Error(`ipaddr: the address does not have IPv6 CIDR format (${e})`)}},p.IPv6.isIPv6=function(e){return this.parser(e)!==null},p.IPv6.isValid=function(e){if(typeof e==`string`&&e.indexOf(`:`)===-1)return!1;try{let t=this.parser(e);return new this(t.parts,t.zoneId),!0}catch{return!1}},p.IPv6.isValidCIDR=function(e){if(typeof e==`string`&&e.indexOf(`:`)===-1)return!1;try{return this.parseCIDR(e),!0}catch{return!1}},p.IPv6.networkAddressFromCIDR=function(e){let t,n,r,i,a;try{for(t=this.parseCIDR(e),r=t[0].toByteArray(),a=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),i=[],n=0;n<16;)i.push(parseInt(r[n],10)&parseInt(a[n],10)),n++;return new this(i)}catch(e){throw Error(`ipaddr: the address does not have IPv6 CIDR format (${e})`)}},p.IPv6.parse=function(e){let t=this.parser(e);if(t.parts===null)throw Error(`ipaddr: string is not formatted like an IPv6 Address`);return new this(t.parts,t.zoneId)},p.IPv6.parseCIDR=function(e){let t,n,r;if((n=e.match(/^(.+)\/(\d+)$/))&&(t=parseInt(n[2]),t>=0&&t<=128))return r=[this.parse(n[1]),t],Object.defineProperty(r,`toString`,{value:function(){return this.join(`/`)}}),r;throw Error(`ipaddr: string is not formatted like an IPv6 CIDR range`)},p.IPv6.parser=function(e){let t,n,r,i,a,o;if(r=e.match(c.deprecatedTransitional))return this.parser(`::ffff:${r[1]}`);if(c.native.test(e))return l(e,8);if((r=e.match(c.transitional))&&(o=r[6]||``,t=r[1],r[1].endsWith(`::`)||(t=t.slice(0,-1)),t=l(t+o,6),t.parts)){for(a=[parseInt(r[2]),parseInt(r[3]),parseInt(r[4]),parseInt(r[5])],n=0;n<a.length;n++)if(i=a[n],!(0<=i&&i<=255))return null;return t.parts.push(a[0]<<8|a[1]),t.parts.push(a[2]<<8|a[3]),{parts:t.parts,zoneId:t.zoneId}}return null},p.IPv6.subnetMaskFromPrefixLength=function(e){if(e=parseInt(e),e<0||e>128)throw Error(`ipaddr: invalid IPv6 prefix length`);let t=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],n=0,r=Math.floor(e/8);for(;n<r;)t[n]=255,n++;return r<16&&(t[r]=2**(e%8)-1<<8-e%8),new this(t)},p.fromByteArray=function(e){let t=e.length;if(t===4)return new p.IPv4(e);if(t===16)return new p.IPv6(e);throw Error(`ipaddr: the binary input is neither an IPv6 nor IPv4 address`)},p.isValid=function(e){return p.IPv6.isValid(e)||p.IPv4.isValid(e)},p.isValidCIDR=function(e){return p.IPv6.isValidCIDR(e)||p.IPv4.isValidCIDR(e)},p.parse=function(e){if(p.IPv6.isValid(e))return p.IPv6.parse(e);if(p.IPv4.isValid(e))return p.IPv4.parse(e);throw Error(`ipaddr: the address has neither IPv6 nor IPv4 format`)},p.parseCIDR=function(e){try{return p.IPv6.parseCIDR(e)}catch{try{return p.IPv4.parseCIDR(e)}catch{throw Error(`ipaddr: the address has neither IPv6 nor IPv4 CIDR format`)}}},p.process=function(e){let t=this.parse(e);return t.kind()===`ipv6`&&t.isIPv4MappedAddress()?t.toIPv4Address():t},p.subnetMatch=function(e,t,n){let r,i,a,o;for(i in n??=`unicast`,t)if(Object.prototype.hasOwnProperty.call(t,i)){for(a=t[i],a[0]&&!(a[0]instanceof Array)&&(a=[a]),r=0;r<a.length;r++)if(o=a[r],e.kind()===o[0].kind()&&e.match.apply(e,o))return i}return n},t!==void 0&&t.exports?t.exports=p:e.ipaddr=p})(e)}))(),H$(`link-preview.guarded-fetch`),H$(`link-preview.cache`),H$(`saved-themes`),B({enabled:L(),active:L(),git:B({state:H([`not-applicable`,`ready`,`missing`,`conflict`,`unavailable`]),ownership:H([`open-knowledge`,`existing`]).optional()}),applied:L().optional(),reason:H([`git-conflict`,`git-unavailable`,`config-write`]).optional()}),B({enabled:L()}).strict(),H$(`clone-flow`),Fe(s),H$(`managed-rename`),Object.assign({"3g2":`video/3gpp2`,"3gp":`video/3gpp`,"3gpp":`video/3gpp`,"3mf":`model/3mf`,aac:`audio/aac`,ac:`application/pkix-attr-cert`,adp:`audio/adpcm`,adts:`audio/aac`,ai:`application/postscript`,aml:`application/automationml-aml+xml`,amlx:`application/automationml-amlx+zip`,amr:`audio/amr`,apng:`image/apng`,appcache:`text/cache-manifest`,appinstaller:`application/appinstaller`,appx:`application/appx`,appxbundle:`application/appxbundle`,asc:`application/pgp-keys`,atom:`application/atom+xml`,atomcat:`application/atomcat+xml`,atomdeleted:`application/atomdeleted+xml`,atomsvc:`application/atomsvc+xml`,au:`audio/basic`,avci:`image/avci`,avcs:`image/avcs`,avif:`image/avif`,aw:`application/applixware`,bdoc:`application/bdoc`,bin:`application/octet-stream`,bmp:`image/bmp`,bpk:`application/octet-stream`,btf:`image/prs.btif`,btif:`image/prs.btif`,buffer:`application/octet-stream`,ccxml:`application/ccxml+xml`,cdfx:`application/cdfx+xml`,cdmia:`application/cdmi-capability`,cdmic:`application/cdmi-container`,cdmid:`application/cdmi-domain`,cdmio:`application/cdmi-object`,cdmiq:`application/cdmi-queue`,cer:`application/pkix-cert`,cgm:`image/cgm`,cjs:`application/node`,class:`application/java-vm`,coffee:`text/coffeescript`,conf:`text/plain`,cpl:`application/cpl+xml`,cpt:`application/mac-compactpro`,crl:`application/pkix-crl`,css:`text/css`,csv:`text/csv`,cu:`application/cu-seeme`,cwl:`application/cwl`,cww:`application/prs.cww`,davmount:`application/davmount+xml`,dbk:`application/docbook+xml`,deb:`application/octet-stream`,def:`text/plain`,deploy:`application/octet-stream`,dib:`image/bmp`,"disposition-notification":`message/disposition-notification`,dist:`application/octet-stream`,distz:`application/octet-stream`,dll:`application/octet-stream`,dmg:`application/octet-stream`,dms:`application/octet-stream`,doc:`application/msword`,dot:`application/msword`,dpx:`image/dpx`,drle:`image/dicom-rle`,dsc:`text/prs.lines.tag`,dssc:`application/dssc+der`,dtd:`application/xml-dtd`,dump:`application/octet-stream`,dwd:`application/atsc-dwd+xml`,ear:`application/java-archive`,ecma:`application/ecmascript`,elc:`application/octet-stream`,emf:`image/emf`,eml:`message/rfc822`,emma:`application/emma+xml`,emotionml:`application/emotionml+xml`,eps:`application/postscript`,epub:`application/epub+zip`,exe:`application/octet-stream`,exi:`application/exi`,exp:`application/express`,exr:`image/aces`,ez:`application/andrew-inset`,fdf:`application/fdf`,fdt:`application/fdt+xml`,fits:`image/fits`,g3:`image/g3fax`,gbr:`application/rpki-ghostbusters`,geojson:`application/geo+json`,gif:`image/gif`,glb:`model/gltf-binary`,gltf:`model/gltf+json`,gml:`application/gml+xml`,gpx:`application/gpx+xml`,gram:`application/srgs`,grxml:`application/srgs+xml`,gxf:`application/gxf`,gz:`application/gzip`,h261:`video/h261`,h263:`video/h263`,h264:`video/h264`,heic:`image/heic`,heics:`image/heic-sequence`,heif:`image/heif`,heifs:`image/heif-sequence`,hej2:`image/hej2k`,held:`application/atsc-held+xml`,hjson:`application/hjson`,hlp:`application/winhlp`,hqx:`application/mac-binhex40`,hsj2:`image/hsj2`,htm:`text/html`,html:`text/html`,ics:`text/calendar`,ief:`image/ief`,ifb:`text/calendar`,iges:`model/iges`,igs:`model/iges`,img:`application/octet-stream`,in:`text/plain`,ini:`text/plain`,ink:`application/inkml+xml`,inkml:`application/inkml+xml`,ipfix:`application/ipfix`,iso:`application/octet-stream`,its:`application/its+xml`,jade:`text/jade`,jar:`application/java-archive`,jhc:`image/jphc`,jls:`image/jls`,jp2:`image/jp2`,jpe:`image/jpeg`,jpeg:`image/jpeg`,jpf:`image/jpx`,jpg:`image/jpeg`,jpg2:`image/jp2`,jpgm:`image/jpm`,jpgv:`video/jpeg`,jph:`image/jph`,jpm:`image/jpm`,jpx:`image/jpx`,js:`text/javascript`,json:`application/json`,json5:`application/json5`,jsonld:`application/ld+json`,jsonml:`application/jsonml+json`,jsx:`text/jsx`,jt:`model/jt`,jxl:`image/jxl`,jxr:`image/jxr`,jxra:`image/jxra`,jxrs:`image/jxrs`,jxs:`image/jxs`,jxsc:`image/jxsc`,jxsi:`image/jxsi`,jxss:`image/jxss`,kar:`audio/midi`,ktx:`image/ktx`,ktx2:`image/ktx2`,less:`text/less`,lgr:`application/lgr+xml`,list:`text/plain`,litcoffee:`text/coffeescript`,log:`text/plain`,lostxml:`application/lost+xml`,lrf:`application/octet-stream`,m1v:`video/mpeg`,m21:`application/mp21`,m2a:`audio/mpeg`,m2t:`video/mp2t`,m2ts:`video/mp2t`,m2v:`video/mpeg`,m3a:`audio/mpeg`,m4a:`audio/mp4`,m4p:`application/mp4`,m4s:`video/iso.segment`,ma:`application/mathematica`,mads:`application/mads+xml`,maei:`application/mmt-aei+xml`,man:`text/troff`,manifest:`text/cache-manifest`,map:`application/json`,mar:`application/octet-stream`,markdown:`text/markdown`,mathml:`application/mathml+xml`,mb:`application/mathematica`,mbox:`application/mbox`,md:`text/markdown`,mdx:`text/mdx`,me:`text/troff`,mesh:`model/mesh`,meta4:`application/metalink4+xml`,metalink:`application/metalink+xml`,mets:`application/mets+xml`,mft:`application/rpki-manifest`,mid:`audio/midi`,midi:`audio/midi`,mime:`message/rfc822`,mj2:`video/mj2`,mjp2:`video/mj2`,mjs:`text/javascript`,mml:`text/mathml`,mods:`application/mods+xml`,mov:`video/quicktime`,mp2:`audio/mpeg`,mp21:`application/mp21`,mp2a:`audio/mpeg`,mp3:`audio/mpeg`,mp4:`video/mp4`,mp4a:`audio/mp4`,mp4s:`application/mp4`,mp4v:`video/mp4`,mpd:`application/dash+xml`,mpe:`video/mpeg`,mpeg:`video/mpeg`,mpf:`application/media-policy-dataset+xml`,mpg:`video/mpeg`,mpg4:`video/mp4`,mpga:`audio/mpeg`,mpp:`application/dash-patch+xml`,mrc:`application/marc`,mrcx:`application/marcxml+xml`,ms:`text/troff`,mscml:`application/mediaservercontrol+xml`,msh:`model/mesh`,msi:`application/octet-stream`,msix:`application/msix`,msixbundle:`application/msixbundle`,msm:`application/octet-stream`,msp:`application/octet-stream`,mtl:`model/mtl`,mts:`video/mp2t`,musd:`application/mmt-usd+xml`,mxf:`application/mxf`,mxmf:`audio/mobile-xmf`,mxml:`application/xv+xml`,n3:`text/n3`,nb:`application/mathematica`,nq:`application/n-quads`,nt:`application/n-triples`,obj:`model/obj`,oda:`application/oda`,oga:`audio/ogg`,ogg:`audio/ogg`,ogv:`video/ogg`,ogx:`application/ogg`,omdoc:`application/omdoc+xml`,onepkg:`application/onenote`,onetmp:`application/onenote`,onetoc:`application/onenote`,onetoc2:`application/onenote`,opf:`application/oebps-package+xml`,opus:`audio/ogg`,otf:`font/otf`,owl:`application/rdf+xml`,oxps:`application/oxps`,p10:`application/pkcs10`,p7c:`application/pkcs7-mime`,p7m:`application/pkcs7-mime`,p7s:`application/pkcs7-signature`,p8:`application/pkcs8`,pdf:`application/pdf`,pfr:`application/font-tdpfr`,pgp:`application/pgp-encrypted`,pkg:`application/octet-stream`,pki:`application/pkixcmp`,pkipath:`application/pkix-pkipath`,pls:`application/pls+xml`,png:`image/png`,prc:`model/prc`,prf:`application/pics-rules`,provx:`application/provenance+xml`,ps:`application/postscript`,pskcxml:`application/pskc+xml`,pti:`image/prs.pti`,qt:`video/quicktime`,raml:`application/raml+yaml`,rapd:`application/route-apd+xml`,rdf:`application/rdf+xml`,relo:`application/p2p-overlay+xml`,rif:`application/reginfo+xml`,rl:`application/resource-lists+xml`,rld:`application/resource-lists-diff+xml`,rmi:`audio/midi`,rnc:`application/relax-ng-compact-syntax`,rng:`application/xml`,roa:`application/rpki-roa`,roff:`text/troff`,rq:`application/sparql-query`,rs:`application/rls-services+xml`,rsat:`application/atsc-rsat+xml`,rsd:`application/rsd+xml`,rsheet:`application/urc-ressheet+xml`,rss:`application/rss+xml`,rtf:`text/rtf`,rtx:`text/richtext`,rusd:`application/route-usd+xml`,s3m:`audio/s3m`,sbml:`application/sbml+xml`,scq:`application/scvp-cv-request`,scs:`application/scvp-cv-response`,sdp:`application/sdp`,senmlx:`application/senml+xml`,sensmlx:`application/sensml+xml`,ser:`application/java-serialized-object`,setpay:`application/set-payment-initiation`,setreg:`application/set-registration-initiation`,sgi:`image/sgi`,sgm:`text/sgml`,sgml:`text/sgml`,shex:`text/shex`,shf:`application/shf+xml`,shtml:`text/html`,sieve:`application/sieve`,sig:`application/pgp-signature`,sil:`audio/silk`,silo:`model/mesh`,siv:`application/sieve`,slim:`text/slim`,slm:`text/slim`,sls:`application/route-s-tsid+xml`,smi:`application/smil+xml`,smil:`application/smil+xml`,snd:`audio/basic`,so:`application/octet-stream`,spdx:`text/spdx`,spp:`application/scvp-vp-response`,spq:`application/scvp-vp-request`,spx:`audio/ogg`,sql:`application/sql`,sru:`application/sru+xml`,srx:`application/sparql-results+xml`,ssdl:`application/ssdl+xml`,ssml:`application/ssml+xml`,stk:`application/hyperstudio`,stl:`model/stl`,stpx:`model/step+xml`,stpxz:`model/step-xml+zip`,stpz:`model/step+zip`,styl:`text/stylus`,stylus:`text/stylus`,svg:`image/svg+xml`,svgz:`image/svg+xml`,swidtag:`application/swid+xml`,t:`text/troff`,t38:`image/t38`,td:`application/urc-targetdesc+xml`,tei:`application/tei+xml`,teicorpus:`application/tei+xml`,text:`text/plain`,tfi:`application/thraud+xml`,tfx:`image/tiff-fx`,tif:`image/tiff`,tiff:`image/tiff`,toml:`application/toml`,tr:`text/troff`,trig:`application/trig`,ts:`video/mp2t`,tsd:`application/timestamped-data`,tsv:`text/tab-separated-values`,ttc:`font/collection`,ttf:`font/ttf`,ttl:`text/turtle`,ttml:`application/ttml+xml`,txt:`text/plain`,u3d:`model/u3d`,u8dsn:`message/global-delivery-status`,u8hdr:`message/global-headers`,u8mdn:`message/global-disposition-notification`,u8msg:`message/global`,ubj:`application/ubjson`,uri:`text/uri-list`,uris:`text/uri-list`,urls:`text/uri-list`,vcard:`text/vcard`,vrml:`model/vrml`,vtt:`text/vtt`,vxml:`application/voicexml+xml`,war:`application/java-archive`,wasm:`application/wasm`,wav:`audio/wav`,weba:`audio/webm`,webm:`video/webm`,webmanifest:`application/manifest+json`,webp:`image/webp`,wgsl:`text/wgsl`,wgt:`application/widget`,wif:`application/watcherinfo+xml`,wmf:`image/wmf`,woff:`font/woff`,woff2:`font/woff2`,wrl:`model/vrml`,wsdl:`application/wsdl+xml`,wspolicy:`application/wspolicy+xml`,x3d:`model/x3d+xml`,x3db:`model/x3d+fastinfoset`,x3dbz:`model/x3d+binary`,x3dv:`model/x3d-vrml`,x3dvz:`model/x3d+vrml`,x3dz:`model/x3d+xml`,xaml:`application/xaml+xml`,xav:`application/xcap-att+xml`,xca:`application/xcap-caps+xml`,xcs:`application/calendar+xml`,xdf:`application/xcap-diff+xml`,xdssc:`application/dssc+xml`,xel:`application/xcap-el+xml`,xenc:`application/xenc+xml`,xer:`application/patch-ops-error+xml`,xfdf:`application/xfdf`,xht:`application/xhtml+xml`,xhtml:`application/xhtml+xml`,xhvml:`application/xv+xml`,xlf:`application/xliff+xml`,xm:`audio/xm`,xml:`text/xml`,xns:`application/xcap-ns+xml`,xop:`application/xop+xml`,xpl:`application/xproc+xml`,xsd:`application/xml`,xsf:`application/prs.xsf+xml`,xsl:`application/xml`,xslt:`application/xml`,xspf:`application/xspf+xml`,xvm:`application/xv+xml`,xvml:`application/xv+xml`,yaml:`text/yaml`,yang:`application/yang`,yin:`application/yin+xml`,yml:`text/yaml`,zip:`application/zip`},{m4v:`video/mp4`,mkv:`video/x-matroska`,flac:`audio/flac`,toml:`application/toml`,lock:`text/plain`,"7z":`application/x-7z-compressed`,tar:`application/x-tar`,rar:`application/vnd.rar`,xls:`application/vnd.ms-excel`,ppt:`application/vnd.ms-powerpoint`,odt:`application/vnd.oasis.opendocument.text`,ods:`application/vnd.oasis.opendocument.spreadsheet`,odp:`application/vnd.oasis.opendocument.presentation`,pages:`application/vnd.apple.pages`,numbers:`application/vnd.apple.numbers`,key:`application/vnd.apple.keynote`,mobi:`application/x-mobipocket-ebook`}),H$(`search`),H$(`skill-import`),H$(`skill-install`),H$(`history`),H$(`api`),B({principalId:F().optional(),tabSessionId:F().optional(),expectedServerInstanceId:F().optional(),expectedBranch:F().optional(),expectedDocLineageEpoch:F().optional(),clientProtocolVersion:I().optional(),clientRuntimeVersion:F().optional(),clientKind:F().optional()}).loose(),H$(`conflict-storage`);const W6=Fo(e=>e!==null&&(typeof e==`object`||typeof e==`function`)),G6=xo([F(),I().int()]),K6=F();yo({ttl:I().optional(),pollInterval:I().optional()});const lxe=B({ttl:I().optional()}),uxe=B({taskId:F()}),q6=yo({progressToken:G6.optional(),"io.modelcontextprotocol/related-task":uxe.optional()}),J6=B({_meta:q6.optional()}),Y6=J6.extend({task:lxe.optional()}),X6=B({method:F(),params:J6.loose().optional()}),Z6=B({_meta:q6.optional()}),Q6=B({method:F(),params:Z6.loose().optional()}),$6=yo({_meta:q6.optional()}),e8=xo([F(),I().int()]),dxe=B({jsonrpc:U(`2.0`),id:e8,...X6.shape}).strict(),fxe=B({jsonrpc:U(`2.0`),...Q6.shape}).strict(),t8=B({jsonrpc:U(`2.0`),id:e8,result:$6}).strict();var pxe;(function(e){e[e.ConnectionClosed=-32e3]=`ConnectionClosed`,e[e.RequestTimeout=-32001]=`RequestTimeout`,e[e.ParseError=-32700]=`ParseError`,e[e.InvalidRequest=-32600]=`InvalidRequest`,e[e.MethodNotFound=-32601]=`MethodNotFound`,e[e.InvalidParams=-32602]=`InvalidParams`,e[e.InternalError=-32603]=`InternalError`,e[e.UrlElicitationRequired=-32042]=`UrlElicitationRequired`})(pxe||={});const n8=B({jsonrpc:U(`2.0`),id:e8.optional(),error:B({code:I().int(),message:F(),data:R().optional()})}).strict();xo([dxe,fxe,t8,n8]),xo([t8,n8]);const r8=$6.strict(),mxe=Z6.extend({requestId:e8.optional(),reason:F().optional()}),i8=Q6.extend({method:U(`notifications/cancelled`),params:mxe}),a8=B({icons:z(B({src:F(),mimeType:F().optional(),sizes:z(F()).optional(),theme:H([`light`,`dark`]).optional()})).optional()}),o8=B({name:F(),title:F().optional()}),s8=o8.extend({...o8.shape,...a8.shape,version:F(),websiteUrl:F().optional(),description:F().optional()}),hxe=Io(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,Co(B({form:Co(B({applyDefaults:L().optional()}),V(F(),R())).optional(),url:W6.optional()}),V(F(),R()).optional())),gxe=yo({list:W6.optional(),cancel:W6.optional(),requests:yo({sampling:yo({createMessage:W6.optional()}).optional(),elicitation:yo({create:W6.optional()}).optional()}).optional()}),_xe=yo({list:W6.optional(),cancel:W6.optional(),requests:yo({tools:yo({call:W6.optional()}).optional()}).optional()}),vxe=B({experimental:V(F(),W6).optional(),sampling:B({context:W6.optional(),tools:W6.optional()}).optional(),elicitation:hxe.optional(),roots:B({listChanged:L().optional()}).optional(),tasks:gxe.optional(),extensions:V(F(),W6).optional()}),yxe=J6.extend({protocolVersion:F(),capabilities:vxe,clientInfo:s8}),bxe=X6.extend({method:U(`initialize`),params:yxe}),xxe=B({experimental:V(F(),W6).optional(),logging:W6.optional(),completions:W6.optional(),prompts:B({listChanged:L().optional()}).optional(),resources:B({subscribe:L().optional(),listChanged:L().optional()}).optional(),tools:B({listChanged:L().optional()}).optional(),tasks:_xe.optional(),extensions:V(F(),W6).optional()}),Sxe=$6.extend({protocolVersion:F(),capabilities:xxe,serverInfo:s8,instructions:F().optional()}),Cxe=Q6.extend({method:U(`notifications/initialized`),params:Z6.optional()}),c8=X6.extend({method:U(`ping`),params:J6.optional()}),wxe=B({progress:I(),total:Oo(I()),message:Oo(F())}),Txe=B({...Z6.shape,...wxe.shape,progressToken:G6}),l8=Q6.extend({method:U(`notifications/progress`),params:Txe}),Exe=J6.extend({cursor:K6.optional()}),u8=X6.extend({params:Exe.optional()}),d8=$6.extend({nextCursor:K6.optional()}),Dxe=H([`working`,`input_required`,`completed`,`failed`,`cancelled`]),f8=B({taskId:F(),status:Dxe,ttl:xo([I(),_o()]),createdAt:F(),lastUpdatedAt:F(),pollInterval:Oo(I()),statusMessage:Oo(F())}),p8=$6.extend({task:f8}),Oxe=Z6.merge(f8),m8=Q6.extend({method:U(`notifications/tasks/status`),params:Oxe}),h8=X6.extend({method:U(`tasks/get`),params:J6.extend({taskId:F()})}),g8=$6.merge(f8),_8=X6.extend({method:U(`tasks/result`),params:J6.extend({taskId:F()})});$6.loose();const v8=u8.extend({method:U(`tasks/list`)}),y8=d8.extend({tasks:z(f8)}),b8=X6.extend({method:U(`tasks/cancel`),params:J6.extend({taskId:F()})});$6.merge(f8);const x8=B({uri:F(),mimeType:Oo(F()),_meta:V(F(),R()).optional()}),S8=x8.extend({text:F()}),C8=F().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),w8=x8.extend({blob:C8}),T8=H([`user`,`assistant`]),E8=B({audience:z(T8).optional(),priority:I().min(0).max(1).optional(),lastModified:za({offset:!0}).optional()}),D8=B({...o8.shape,...a8.shape,uri:F(),description:Oo(F()),mimeType:Oo(F()),size:Oo(I()),annotations:E8.optional(),_meta:Oo(yo({}))}),kxe=B({...o8.shape,...a8.shape,uriTemplate:F(),description:Oo(F()),mimeType:Oo(F()),annotations:E8.optional(),_meta:Oo(yo({}))}),Axe=u8.extend({method:U(`resources/list`)}),jxe=d8.extend({resources:z(D8)}),Mxe=u8.extend({method:U(`resources/templates/list`)}),Nxe=d8.extend({resourceTemplates:z(kxe)}),O8=J6.extend({uri:F()}),Pxe=O8,Fxe=X6.extend({method:U(`resources/read`),params:Pxe}),Ixe=$6.extend({contents:z(xo([S8,w8]))}),Lxe=Q6.extend({method:U(`notifications/resources/list_changed`),params:Z6.optional()}),Rxe=O8,zxe=X6.extend({method:U(`resources/subscribe`),params:Rxe}),Bxe=O8,Vxe=X6.extend({method:U(`resources/unsubscribe`),params:Bxe}),Hxe=Z6.extend({uri:F()}),Uxe=Q6.extend({method:U(`notifications/resources/updated`),params:Hxe}),Wxe=B({name:F(),description:Oo(F()),required:Oo(L())}),Gxe=B({...o8.shape,...a8.shape,description:Oo(F()),arguments:Oo(z(Wxe)),_meta:Oo(yo({}))}),Kxe=u8.extend({method:U(`prompts/list`)}),qxe=d8.extend({prompts:z(Gxe)}),Jxe=J6.extend({name:F(),arguments:V(F(),F()).optional()}),Yxe=X6.extend({method:U(`prompts/get`),params:Jxe}),k8=B({type:U(`text`),text:F(),annotations:E8.optional(),_meta:V(F(),R()).optional()}),A8=B({type:U(`image`),data:C8,mimeType:F(),annotations:E8.optional(),_meta:V(F(),R()).optional()}),j8=B({type:U(`audio`),data:C8,mimeType:F(),annotations:E8.optional(),_meta:V(F(),R()).optional()}),Xxe=B({type:U(`tool_use`),name:F(),id:F(),input:V(F(),R()),_meta:V(F(),R()).optional()}),Zxe=B({type:U(`resource`),resource:xo([S8,w8]),annotations:E8.optional(),_meta:V(F(),R()).optional()}),M8=xo([k8,A8,j8,D8.extend({type:U(`resource_link`)}),Zxe]),Qxe=B({role:T8,content:M8}),$xe=$6.extend({description:F().optional(),messages:z(Qxe)}),eSe=Q6.extend({method:U(`notifications/prompts/list_changed`),params:Z6.optional()}),tSe=B({title:F().optional(),readOnlyHint:L().optional(),destructiveHint:L().optional(),idempotentHint:L().optional(),openWorldHint:L().optional()}),nSe=B({taskSupport:H([`required`,`optional`,`forbidden`]).optional()}),N8=B({...o8.shape,...a8.shape,description:F().optional(),inputSchema:B({type:U(`object`),properties:V(F(),W6).optional(),required:z(F()).optional()}).catchall(R()),outputSchema:B({type:U(`object`),properties:V(F(),W6).optional(),required:z(F()).optional()}).catchall(R()).optional(),annotations:tSe.optional(),execution:nSe.optional(),_meta:V(F(),R()).optional()}),rSe=u8.extend({method:U(`tools/list`)}),iSe=d8.extend({tools:z(N8)}),P8=$6.extend({content:z(M8).default([]),structuredContent:V(F(),R()).optional(),isError:L().optional()});P8.or($6.extend({toolResult:R()}));const aSe=Y6.extend({name:F(),arguments:V(F(),R()).optional()}),oSe=X6.extend({method:U(`tools/call`),params:aSe}),sSe=Q6.extend({method:U(`notifications/tools/list_changed`),params:Z6.optional()});B({autoRefresh:L().default(!0),debounceMs:I().int().nonnegative().default(300)});const F8=H([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),cSe=J6.extend({level:F8}),lSe=X6.extend({method:U(`logging/setLevel`),params:cSe}),uSe=Z6.extend({level:F8,logger:F().optional(),data:R()}),dSe=Q6.extend({method:U(`notifications/message`),params:uSe}),fSe=B({hints:z(B({name:F().optional()})).optional(),costPriority:I().min(0).max(1).optional(),speedPriority:I().min(0).max(1).optional(),intelligencePriority:I().min(0).max(1).optional()}),pSe=B({mode:H([`auto`,`required`,`none`]).optional()}),mSe=B({type:U(`tool_result`),toolUseId:F().describe(`The unique identifier for the corresponding tool call.`),content:z(M8).default([]),structuredContent:B({}).loose().optional(),isError:L().optional(),_meta:V(F(),R()).optional()}),hSe=So(`type`,[k8,A8,j8]),I8=So(`type`,[k8,A8,j8,Xxe,mSe]),gSe=B({role:T8,content:xo([I8,z(I8)]),_meta:V(F(),R()).optional()}),_Se=Y6.extend({messages:z(gSe),modelPreferences:fSe.optional(),systemPrompt:F().optional(),includeContext:H([`none`,`thisServer`,`allServers`]).optional(),temperature:I().optional(),maxTokens:I().int(),stopSequences:z(F()).optional(),metadata:W6.optional(),tools:z(N8).optional(),toolChoice:pSe.optional()}),vSe=X6.extend({method:U(`sampling/createMessage`),params:_Se}),ySe=$6.extend({model:F(),stopReason:Oo(H([`endTurn`,`stopSequence`,`maxTokens`]).or(F())),role:T8,content:hSe}),bSe=$6.extend({model:F(),stopReason:Oo(H([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(F())),role:T8,content:xo([I8,z(I8)])}),xSe=B({type:U(`boolean`),title:F().optional(),description:F().optional(),default:L().optional()}),SSe=B({type:U(`string`),title:F().optional(),description:F().optional(),minLength:I().optional(),maxLength:I().optional(),format:H([`email`,`uri`,`date`,`date-time`]).optional(),default:F().optional()}),CSe=B({type:H([`number`,`integer`]),title:F().optional(),description:F().optional(),minimum:I().optional(),maximum:I().optional(),default:I().optional()}),wSe=B({type:U(`string`),title:F().optional(),description:F().optional(),enum:z(F()),default:F().optional()}),TSe=B({type:U(`string`),title:F().optional(),description:F().optional(),oneOf:z(B({const:F(),title:F()})),default:F().optional()}),ESe=xo([xo([B({type:U(`string`),title:F().optional(),description:F().optional(),enum:z(F()),enumNames:z(F()).optional(),default:F().optional()}),xo([wSe,TSe]),xo([B({type:U(`array`),title:F().optional(),description:F().optional(),minItems:I().optional(),maxItems:I().optional(),items:B({type:U(`string`),enum:z(F())}),default:z(F()).optional()}),B({type:U(`array`),title:F().optional(),description:F().optional(),minItems:I().optional(),maxItems:I().optional(),items:B({anyOf:z(B({const:F(),title:F()}))}),default:z(F()).optional()})])]),xSe,SSe,CSe]),DSe=xo([Y6.extend({mode:U(`form`).optional(),message:F(),requestedSchema:B({type:U(`object`),properties:V(F(),ESe),required:z(F()).optional()})}),Y6.extend({mode:U(`url`),message:F(),elicitationId:F(),url:F().url()})]),OSe=X6.extend({method:U(`elicitation/create`),params:DSe}),kSe=Z6.extend({elicitationId:F()}),ASe=Q6.extend({method:U(`notifications/elicitation/complete`),params:kSe}),jSe=$6.extend({action:H([`accept`,`decline`,`cancel`]),content:Io(e=>e===null?void 0:e,V(F(),xo([F(),I(),L(),z(F())])).optional())}),MSe=B({type:U(`ref/resource`),uri:F()}),NSe=B({type:U(`ref/prompt`),name:F()}),PSe=J6.extend({ref:xo([NSe,MSe]),argument:B({name:F(),value:F()}),context:B({arguments:V(F(),F()).optional()}).optional()}),FSe=X6.extend({method:U(`completion/complete`),params:PSe}),ISe=$6.extend({completion:yo({values:z(F()).max(100),total:Oo(I().int()),hasMore:Oo(L())})}),LSe=B({uri:F().startsWith(`file://`),name:F().optional(),_meta:V(F(),R()).optional()}),RSe=X6.extend({method:U(`roots/list`),params:J6.optional()}),zSe=$6.extend({roots:z(LSe)}),BSe=Q6.extend({method:U(`notifications/roots/list_changed`),params:Z6.optional()});xo([c8,bxe,FSe,lSe,Yxe,Kxe,Axe,Mxe,Fxe,zxe,Vxe,oSe,rSe,h8,_8,v8,b8]),xo([i8,l8,Cxe,BSe,m8]),xo([r8,ySe,bSe,jSe,zSe,g8,y8,p8]),xo([c8,vSe,OSe,RSe,h8,_8,v8,b8]),xo([i8,l8,dSe,Uxe,Lxe,sSe,eSe,m8,ASe]),xo([r8,Sxe,ISe,$xe,qxe,jxe,Nxe,Ixe,P8,iSe,g8,y8,p8]);var VSe;(function(e){e.Completable=`McpCompletable`})(VSe||={});var HSe=global.Request,L8=class extends HSe{constructor(e,t){typeof e==`object`&&R8 in e&&(e=e[R8]()),t?.body?.getReader!==void 0&&(t.duplex??=`half`),super(e,t)}},USe=e=>{let t=[],n=e.rawHeaders;for(let e=0;e<n.length;e+=2){let{[e]:r,[e+1]:i}=n;r.charCodeAt(0)!==58&&t.push([r,i])}return new Headers(t)},WSe=Symbol(`wrapBodyStream`),GSe=(e,t,n,r,i)=>{let a={method:e,headers:n,signal:i.signal};if(e===`TRACE`){a.method=`GET`;let e=new L8(t,a);return Object.defineProperty(e,`method`,{get(){return`TRACE`}}),e}if(!(e===`GET`||e===`HEAD`))if(`rawBody`in r&&r.rawBody instanceof Buffer)a.body=new ReadableStream({start(e){e.enqueue(r.rawBody),e.close()}});else if(r[WSe]){let e;a.body=new ReadableStream({async pull(t){try{e||=Ne.toWeb(r).getReader();let{done:n,value:i}=await e.read();n?t.close():t.enqueue(i)}catch(e){t.error(e)}}})}else a.body=Ne.toWeb(r);return new L8(t,a)},R8=Symbol(`getRequestCache`),z8=Symbol(`requestCache`),B8=Symbol(`incomingKey`),V8=Symbol(`urlKey`),KSe=Symbol(`headersKey`),H8=Symbol(`abortControllerKey`),U8={get method(){return this[B8].method||`GET`},get url(){return this[V8]},get headers(){return this[KSe]||=USe(this[B8])},[Symbol(`getAbortController`)](){return this[R8](),this[H8]},[R8](){return this[H8]||=new AbortController,this[z8]||=GSe(this.method,this[V8],this.headers,this[B8],this[H8])}};[`body`,`bodyUsed`,`cache`,`credentials`,`destination`,`integrity`,`mode`,`redirect`,`referrer`,`referrerPolicy`,`signal`,`keepalive`].forEach(e=>{Object.defineProperty(U8,e,{get(){return this[R8]()[e]}})}),[`arrayBuffer`,`blob`,`clone`,`formData`,`json`,`text`].forEach(e=>{Object.defineProperty(U8,e,{value:function(){return this[R8]()[e]()}})}),Object.defineProperty(U8,Symbol.for(`nodejs.util.inspect.custom`),{value:function(e,t,n){return`Request (lightweight) ${n({method:this.method,url:this.url,headers:this.headers,nativeRequest:this[z8]},{...t,depth:e==null?null:e-1})}`}}),Object.setPrototypeOf(U8,L8.prototype);var W8=Symbol(`responseCache`),G8=Symbol(`getResponseCache`),K8=Symbol(`cache`),q8=global.Response,J8=class e{#e;#t;[G8](){return delete this[K8],this[W8]||=new q8(this.#e,this.#t)}constructor(t,n){let r;if(this.#e=t,n instanceof e){let e=n[W8];if(e){this.#t=e,this[G8]();return}else this.#t=n.#t,r=new Headers(n.#t.headers)}else this.#t=n;(typeof t==`string`||t?.getReader!==void 0||t instanceof Blob||t instanceof Uint8Array)&&(this[K8]=[n?.status||200,t,r||n?.headers])}get headers(){let e=this[K8];return e?(e[2]instanceof Headers||(e[2]=new Headers(e[2]||{"content-type":`text/plain; charset=UTF-8`})),e[2]):this[G8]().headers}get status(){return this[K8]?.[0]??this[G8]().status}get ok(){let e=this.status;return e>=200&&e<300}};[`body`,`bodyUsed`,`redirected`,`statusText`,`trailers`,`type`,`url`].forEach(e=>{Object.defineProperty(J8.prototype,e,{get(){return this[G8]()[e]}})}),[`arrayBuffer`,`blob`,`clone`,`formData`,`json`,`text`].forEach(e=>{Object.defineProperty(J8.prototype,e,{value:function(){return this[G8]()[e]()}})}),Object.defineProperty(J8.prototype,Symbol.for(`nodejs.util.inspect.custom`),{value:function(e,t,n){return`Response (lightweight) ${n({status:this.status,headers:this.headers,ok:this.ok,nativeResponse:this[W8]},{...t,depth:e==null?null:e-1})}`}}),Object.setPrototypeOf(J8,q8),Object.setPrototypeOf(J8.prototype,q8.prototype),global.crypto===void 0&&(global.crypto=Me),new Le,U$(()=>{}),[`[Requires: Hocuspocus server] Unified validation audit: every content problem — markdown-lint violations AND broken internal links — in one read-only call, grouped by the file to fix.`,``,"- No args → audit every in-scope `.md`/`.mdx` doc; pass `path` to scope to a folder or a single file.","- The result reports `ran`, the source families selected for this run. Project audit can report `markdownlint`, `frontmatter`, `okf`, and `links`. A family absent from `ran` was not checked. `okf` covers both document and project-tree OKF checks here.","- A selected family stays in `ran` if it degrades, with the reason in `warnings`. A partial degradation may still have contributed findings.","- To CHECK whether links resolve, use this tool: each broken link is reported under the SOURCE doc that contains it, at the offending line. (The `links` tool is the navigation/graph reader — backlinks, forward links, orphans, hubs — not the validation surface.)",``,"Each diagnostic carries a `source` naming the validator ('markdownlint' rule violations; 'links' broken internal links), a `code` (e.g. MD010, dead-link), `message`, a 0-based LSP `range` (for links: line exact, column approximate), and `severity` ('error' | 'warning' — broken links default to warnings; the project's `validation.links` setting can raise them to errors or hide them). Only files with at least one problem are listed, plus `fileCount`/`errorCount`/`warningCount` totals. Output (text and structured) is capped at 10 files × 10 diagnostics per file and project-wide at 10 warnings, with explicit '… and N more' indicators and `omittedWarningCount` when warnings are dropped; the counts always reflect the full scan — re-run with `path` scoped to a folder or file to see what was omitted.",``,"Read-only: nothing is modified. Auto-fix fixable lint findings with `lint({ document, fix: true })`; broken links need content edits via `edit`/`write`."].join(`
456
+ `.indexOf(e.charAt(t))!==-1}var X3;(function(e){e.DEFAULT={allowTrailingComma:!1}})(X3||={});function wbe(e,t=[],n=X3.DEFAULT){let r=null,i=[],a=[];function o(e){Array.isArray(i)?i.push(e):r!==null&&(i[r]=e)}return e6(e,{onObjectBegin:()=>{let e={};o(e),a.push(i),i=e,r=null},onObjectProperty:e=>{r=e},onObjectEnd:()=>{i=a.pop()},onArrayBegin:()=>{let e=[];o(e),a.push(i),i=e,r=null},onArrayEnd:()=>{i=a.pop()},onLiteralValue:o,onError:(e,n,r)=>{t.push({error:e,offset:n,length:r})}},n),i[0]}function Z3(e,t=[],n=X3.DEFAULT){let r={type:`array`,offset:-1,length:-1,children:[],parent:void 0};function i(e){r.type===`property`&&(r.length=e-r.offset,r=r.parent)}function a(e){return r.children.push(e),e}e6(e,{onObjectBegin:e=>{r=a({type:`object`,offset:e,length:-1,parent:r,children:[]})},onObjectProperty:(e,t,n)=>{r=a({type:`property`,offset:t,length:-1,parent:r,children:[]}),r.children.push({type:`string`,value:e,offset:t,length:n,parent:r})},onObjectEnd:(e,t)=>{i(e+t),r.length=e+t-r.offset,r=r.parent,i(e+t)},onArrayBegin:(e,t)=>{r=a({type:`array`,offset:e,length:-1,parent:r,children:[]})},onArrayEnd:(e,t)=>{r.length=e+t-r.offset,r=r.parent,i(e+t)},onLiteralValue:(e,t,n)=>{a({type:Tbe(e),offset:t,length:n,parent:r,value:e}),i(t+n)},onSeparator:(e,t,n)=>{r.type===`property`&&(e===`:`?r.colonOffset=t:e===`,`&&i(t))},onError:(e,n,r)=>{t.push({error:e,offset:n,length:r})}},n);let o=r.children[0];return o&&delete o.parent,o}function Q3(e,t){if(!e)return;let n=e;for(let e of t)if(typeof e==`string`){if(n.type!==`object`||!Array.isArray(n.children))return;let t=!1;for(let r of n.children)if(Array.isArray(r.children)&&r.children[0].value===e&&r.children.length===2){n=r.children[1],t=!0;break}if(!t)return}else{let t=e;if(n.type!==`array`||t<0||!Array.isArray(n.children)||t>=n.children.length)return;n=n.children[t]}return n}function $3(e){switch(e.type){case`array`:return e.children.map($3);case`object`:let t=Object.create(null);for(let n of e.children){let e=n.children[1];e&&(t[n.children[0].value]=$3(e))}return t;case`null`:case`string`:case`number`:case`boolean`:return e.value;default:return}}function e6(e,t,n=X3.DEFAULT){let r=H3(e,!1),i=[],a=0;function o(e){return e?()=>a===0&&e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}function s(e){return e?t=>a===0&&e(t,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}function c(e){return e?t=>a===0&&e(t,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),()=>i.slice()):()=>!0}function l(e){return e?()=>{a>0?a++:e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),()=>i.slice())===!1&&(a=1)}:()=>!0}function u(e){return e?()=>{a>0&&a--,a===0&&e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter())}:()=>!0}let d=l(t.onObjectBegin),f=c(t.onObjectProperty),p=u(t.onObjectEnd),m=l(t.onArrayBegin),h=u(t.onArrayEnd),g=c(t.onLiteralValue),_=s(t.onSeparator),v=o(t.onComment),y=s(t.onError),b=n&&n.disallowComments,x=n&&n.allowTrailingComma;function S(){for(;;){let e=r.scan();switch(r.getTokenError()){case 4:C(14);break;case 5:C(15);break;case 3:C(13);break;case 1:b||C(11);break;case 2:C(12);break;case 6:C(16);break}switch(e){case 12:case 13:b?C(10):v();break;case 16:C(1);break;case 15:case 14:break;default:return e}}}function C(e,t=[],n=[]){if(y(e),t.length+n.length>0){let e=r.getToken();for(;e!==17;){if(t.indexOf(e)!==-1){S();break}else if(n.indexOf(e)!==-1)break;e=S()}}}function w(e){let t=r.getTokenValue();return e?g(t):(f(t),i.push(t)),S(),!0}function T(){switch(r.getToken()){case 11:let e=r.getTokenValue(),t=Number(e);isNaN(t)&&(C(2),t=0),g(t);break;case 7:g(null);break;case 8:g(!0);break;case 9:g(!1);break;default:return!1}return S(),!0}function E(){return r.getToken()===10?(w(!1),r.getToken()===6?(_(`:`),S(),ee()||C(4,[],[2,5])):C(5,[],[2,5]),i.pop(),!0):(C(3,[],[2,5]),!1)}function D(){d(),S();let e=!1;for(;r.getToken()!==2&&r.getToken()!==17;){if(r.getToken()===5){if(e||C(4,[],[]),_(`,`),S(),r.getToken()===2&&x)break}else e&&C(6,[],[]);E()||C(4,[],[2,5]),e=!0}return p(),r.getToken()===2?S():C(7,[2],[]),!0}function O(){m(),S();let e=!0,t=!1;for(;r.getToken()!==4&&r.getToken()!==17;){if(r.getToken()===5){if(t||C(4,[],[]),_(`,`),S(),r.getToken()===4&&x)break}else t&&C(6,[],[]);e?(i.push(0),e=!1):i[i.length-1]++,ee()||C(4,[],[4,5]),t=!0}return h(),e||i.pop(),r.getToken()===4?S():C(8,[4],[]),!0}function ee(){switch(r.getToken()){case 3:return O();case 1:return D();case 10:return w(!0);default:return T()}}return S(),r.getToken()===17?n.allowEmptyContent?!0:(C(4,[],[]),!1):ee()?(r.getToken()!==17&&C(9,[],[]),!0):(C(4,[],[]),!1)}function Tbe(e){switch(typeof e){case`boolean`:return`boolean`;case`number`:return`number`;case`string`:return`string`;case`object`:return e?Array.isArray(e)?`array`:`object`:`null`;default:return`null`}}function Ebe(e,t,n,r){let i=t.slice(),a=Z3(e,[]),o,s;for(;i.length>0&&(s=i.pop(),o=Q3(a,i),o===void 0&&n!==void 0);)n=typeof s==`string`?{[s]:n}:[n];if(!o){if(n===void 0)throw Error(`Can not delete in empty document`);return t6(e,{offset:a?a.offset:0,length:a?a.length:0,content:JSON.stringify(n)},r)}else if(o.type===`object`&&typeof s==`string`&&Array.isArray(o.children)){let t=Q3(o,[s]);if(t!==void 0)if(n===void 0){if(!t.parent)throw Error(`Malformed AST`);let n=o.children.indexOf(t.parent),i,a=t.parent.offset+t.parent.length;if(n>0){let e=o.children[n-1];i=e.offset+e.length}else i=o.offset+1,o.children.length>1&&(a=o.children[1].offset);return t6(e,{offset:i,length:a-i,content:``},r)}else return t6(e,{offset:t.offset,length:t.length,content:JSON.stringify(n)},r);else{if(n===void 0)return[];let t=`${JSON.stringify(s)}: ${JSON.stringify(n)}`,i=r.getInsertionIndex?r.getInsertionIndex(o.children.map(e=>e.children[0].value)):o.children.length,a;if(i>0){let e=o.children[i-1];a={offset:e.offset+e.length,length:0,content:`,`+t}}else a=o.children.length===0?{offset:o.offset+1,length:0,content:t}:{offset:o.offset+1,length:0,content:t+`,`};return t6(e,a,r)}}else if(o.type===`array`&&typeof s==`number`&&Array.isArray(o.children)){let t=s;if(t===-1){let t=`${JSON.stringify(n)}`,i;if(o.children.length===0)i={offset:o.offset+1,length:0,content:t};else{let e=o.children[o.children.length-1];i={offset:e.offset+e.length,length:0,content:`,`+t}}return t6(e,i,r)}else if(n===void 0&&o.children.length>=0){let t=s,n=o.children[t],i;if(o.children.length===1)i={offset:o.offset+1,length:o.length-2,content:``};else if(o.children.length-1===t){let e=o.children[t-1],n=e.offset+e.length;i={offset:n,length:o.offset+o.length-2-n,content:``}}else i={offset:n.offset,length:o.children[t+1].offset-n.offset,content:``};return t6(e,i,r)}else if(n!==void 0){let t,i=`${JSON.stringify(n)}`;if(!r.isArrayInsertion&&o.children.length>s){let e=o.children[s];t={offset:e.offset,length:e.length,content:i}}else if(o.children.length===0||s===0)t={offset:o.offset+1,length:0,content:o.children.length===0?i:i+`,`};else{let e=s>o.children.length?o.children.length:s,n=o.children[e-1];t={offset:n.offset+n.length,length:0,content:`,`+i}}return t6(e,t,r)}else throw Error(`Can not ${n===void 0?`remove`:r.isArrayInsertion?`insert`:`modify`} Array index ${t} as length is not sufficient`)}else throw Error(`Can not add ${typeof s==`number`?`property`:`index`} to parent of type ${o.type}`)}function t6(e,t,n){if(!n.formattingOptions)return[t];let r=n6(e,t),i=t.offset,a=t.offset+t.content.length;if(t.length===0||t.content.length===0){for(;i>0&&!Y3(r,i-1);)i--;for(;a<r.length&&!Y3(r,a);)a++}let o=xbe(r,{offset:i,length:a-i},{...n.formattingOptions,keepLines:!1});for(let e=o.length-1;e>=0;e--){let t=o[e];r=n6(r,t),i=Math.min(i,t.offset),a=Math.max(a,t.offset+t.length),a+=t.content.length-t.length}let s=e.length-(r.length-a)-i;return[{offset:i,length:s,content:r.substring(i,a)}]}function n6(e,t){return e.substring(0,t.offset)+t.content+e.substring(t.offset+t.length)}var Dbe;(function(e){e[e.None=0]=`None`,e[e.UnexpectedEndOfComment=1]=`UnexpectedEndOfComment`,e[e.UnexpectedEndOfString=2]=`UnexpectedEndOfString`,e[e.UnexpectedEndOfNumber=3]=`UnexpectedEndOfNumber`,e[e.InvalidUnicode=4]=`InvalidUnicode`,e[e.InvalidEscapeCharacter=5]=`InvalidEscapeCharacter`,e[e.InvalidCharacter=6]=`InvalidCharacter`})(Dbe||={});var Obe;(function(e){e[e.OpenBraceToken=1]=`OpenBraceToken`,e[e.CloseBraceToken=2]=`CloseBraceToken`,e[e.OpenBracketToken=3]=`OpenBracketToken`,e[e.CloseBracketToken=4]=`CloseBracketToken`,e[e.CommaToken=5]=`CommaToken`,e[e.ColonToken=6]=`ColonToken`,e[e.NullKeyword=7]=`NullKeyword`,e[e.TrueKeyword=8]=`TrueKeyword`,e[e.FalseKeyword=9]=`FalseKeyword`,e[e.StringLiteral=10]=`StringLiteral`,e[e.NumericLiteral=11]=`NumericLiteral`,e[e.LineCommentTrivia=12]=`LineCommentTrivia`,e[e.BlockCommentTrivia=13]=`BlockCommentTrivia`,e[e.LineBreakTrivia=14]=`LineBreakTrivia`,e[e.Trivia=15]=`Trivia`,e[e.Unknown=16]=`Unknown`,e[e.EOF=17]=`EOF`})(Obe||={});const kbe=wbe,Abe=Z3,r6=$3;var jbe;(function(e){e[e.InvalidSymbol=1]=`InvalidSymbol`,e[e.InvalidNumberFormat=2]=`InvalidNumberFormat`,e[e.PropertyNameExpected=3]=`PropertyNameExpected`,e[e.ValueExpected=4]=`ValueExpected`,e[e.ColonExpected=5]=`ColonExpected`,e[e.CommaExpected=6]=`CommaExpected`,e[e.CloseBraceExpected=7]=`CloseBraceExpected`,e[e.CloseBracketExpected=8]=`CloseBracketExpected`,e[e.EndOfFileExpected=9]=`EndOfFileExpected`,e[e.InvalidCommentToken=10]=`InvalidCommentToken`,e[e.UnexpectedEndOfComment=11]=`UnexpectedEndOfComment`,e[e.UnexpectedEndOfString=12]=`UnexpectedEndOfString`,e[e.UnexpectedEndOfNumber=13]=`UnexpectedEndOfNumber`,e[e.InvalidUnicode=14]=`InvalidUnicode`,e[e.InvalidEscapeCharacter=15]=`InvalidEscapeCharacter`,e[e.InvalidCharacter=16]=`InvalidCharacter`})(jbe||={});function i6(e,t,n,r){return Ebe(e,t,n,r)}function a6(e,t){let n=t.slice(0).sort((e,t)=>{let n=e.offset-t.offset;return n===0?e.length-t.length:n}),r=e.length;for(let t=n.length-1;t>=0;t--){let i=n[t];if(i.offset+i.length<=r)e=n6(e,i);else throw Error(`Overlapping edit`);r=i.offset}return e}H$(`mermaid-validator`),Fe(x),[...xu];function o6(e,t){return[...Object.entries(e).filter(e=>e[1]!==null).map(([e,t])=>({editor:e,root:t})),{editor:`agents`,root:t}]}o6(yu,Pu),[...o6(bu,Pu)].sort((e,t)=>{let n=u3.indexOf(e.editor),r=u3.indexOf(t.editor);return(n===-1?u3.length:n)-(r===-1?u3.length:r)||e.editor.localeCompare(t.editor)}),H$(`backlinks`),H$(`tag-index`),H$(`derived-document-index`),H$(`external-change-attribution`),H$(`file-watcher`),new class{_tail=Promise.resolve();enqueue(e){let t=this._tail.then(()=>e());return this._tail=t.catch(()=>void 0),t}},new class{capacity;store;writeIndex=0;filled=!1;constructor(e){if(!Number.isInteger(e)||e<=0)throw RangeError(`RingBuffer capacity must be a positive integer, got ${e}`);this.capacity=e,this.store=Array(e)}push(e){this.store[this.writeIndex]=e,this.writeIndex=(this.writeIndex+1)%this.capacity,this.writeIndex===0&&(this.filled=!0)}read(){let e=[],t=this.filled?this.capacity:this.writeIndex;for(let n=1;n<=t;n++){let t=(this.writeIndex-n+this.capacity)%this.capacity,r=this.store[t];r!==void 0&&e.push(r)}return e}get size(){return this.filled?this.capacity:this.writeIndex}}(256),Du.cursor,Du.codex,Du[`claude-desktop`],U$(()=>{});const s6={start:I().int().nonnegative().optional(),end:I().int().nonnegative().optional(),quote:F().min(1).optional(),prefix:F().max(1e3).optional(),suffix:F().max(1e3).optional()};B({docName:F().min(1),...s6,propertyKey:F().min(1).optional(),propertyPath:z(xo([F(),I().int().nonnegative()])).optional(),body:F(),queue:L().optional(),summary:F().optional()});const c6=$te();So(`action`,[B({action:U(`edit`),id:c6,body:F(),summary:F().optional()}),B({action:U(`resolve`),id:c6,summary:F().optional()}),B({action:U(`reopen`),id:c6,summary:F().optional()}),B({action:U(`replace`),id:c6,...s6,summary:F().optional()}),B({action:U(`queue`),id:c6,summary:F().optional()}),B({action:U(`unqueue`),id:c6,summary:F().optional()}),B({action:U(`dispatch-prepare`),id:c6,summary:F().optional()}),B({action:U(`dispatch-complete`),id:c6,summary:F().optional()}),B({action:U(`dispatch-prepare-batch`),ids:z(c6).min(1).max(200),summary:F().optional()}),B({action:U(`dispatch-complete-batch`),ids:z(c6).min(1).max(200),summary:F().optional()})]),H$(`embeddings`),H$(`embeddings`);function Mbe(e){try{let t=new URL(e),n=t.pathname.replace(/\/+$/,``);return`${t.protocol}//${t.host.toLowerCase()}${n}`}catch{return e.trim().replace(/\/+$/,``)}}Mbe(Ys),H$(`embeddings`),H$(`embeddings`);const Nbe=/^[A-Za-z0-9-]{8,64}$/;let l6=null;function Pbe(e){return N(e??oe(),`.ok`,`machine-id`)}function Fbe(e){if(e===void 0&&l6!==null)return l6;let t=Pbe(e),n=null;try{let e=S(t,`utf-8`).trim();Nbe.test(e)&&(n=e)}catch{}if(n===null){n=je();try{v(pe(t),{recursive:!0}),te(t,`${n}\n`,{encoding:`utf-8`,mode:384})}catch(e){H$(`machine-id`).warn({path:t,err:e},`Failed to persist ${t} — using an ephemeral per-process id; lock ownership checks will fail closed (collision) instead of recognizing this machine: ${e instanceof Error?e.message:String(e)}`)}}return e===void 0&&(l6=n),n}H$(`process-lock`);function Ibe(e,t){return ve(e,`${t}.lock`)}function Lbe(e){let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`http:`&&t.protocol!==`https:`)return null;let n=t.hostname;return n===`localhost`||n===`[::1]`||/^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(n)?t.origin:null}function Rbe(e,t){if(typeof e.url==`string`&&e.url.length>0){let t=Lbe(e.url);if(t!==null)return t}if(e.port>0){let n=t?.fallbackHost??`localhost`;return`http://${n===`0.0.0.0`||n===`::`?`localhost`:n.includes(`:`)&&!n.startsWith(`[`)?`[${n}]`:n}:${e.port}`}return null}H$(`asset-references`);var u6=i(((e,t)=>{function n(e){if(e.length===0)return;let t=Object.create(null),n=0;for(;n<e.length;++n){let t=e.charCodeAt(n);if(u[t]!==1){if(t!==47||n===0)return;break}}if(n===e.length)return;let i=e.slice(0,n).toLowerCase(),a=++n;for(;n<e.length;++n)if(u[e.charCodeAt(n)]!==1){if(n===a||r(e,n,t)===void 0)return;break}if(n!==a)return{type:i,subtype:e.slice(a,n).toLowerCase(),params:t}}function r(e,t,n){for(;t<e.length;){for(;t<e.length;++t){let n=e.charCodeAt(t);if(n!==32&&n!==9)break}if(t===e.length)break;if(e.charCodeAt(t++)!==59)return;for(;t<e.length;++t){let n=e.charCodeAt(t);if(n!==32&&n!==9)break}if(t===e.length)return;let r,i=t;for(;t<e.length;++t){let n=e.charCodeAt(t);if(u[n]!==1){if(n!==61)return;break}}if(t===e.length||(r=e.slice(i,t),++t,t===e.length))return;let a=``,o;if(e.charCodeAt(t)===34){o=++t;let n=!1;for(;t<e.length;++t){let r=e.charCodeAt(t);if(r===92){n?(o=t,n=!1):(a+=e.slice(o,t),n=!0);continue}if(r===34){if(n){o=t,n=!1;continue}a+=e.slice(o,t);break}if(n&&=(o=t-1,!1),d[r]!==1)return}if(t===e.length)return;++t}else{for(o=t;t<e.length;++t)if(u[e.charCodeAt(t)]!==1){if(t===o)return;break}a=e.slice(o,t)}r=r.toLowerCase(),n[r]===void 0&&(n[r]=a)}return n}function i(e,t){if(e.length===0)return;let n=Object.create(null),r=0;for(;r<e.length;++r)if(u[e.charCodeAt(r)]!==1){if(a(e,r,n,t)===void 0)return;break}return{type:e.slice(0,r).toLowerCase(),params:n}}function a(e,t,n,r){for(;t<e.length;){for(;t<e.length;++t){let n=e.charCodeAt(t);if(n!==32&&n!==9)break}if(t===e.length)break;if(e.charCodeAt(t++)!==59)return;for(;t<e.length;++t){let n=e.charCodeAt(t);if(n!==32&&n!==9)break}if(t===e.length)return;let i,a=t;for(;t<e.length;++t){let n=e.charCodeAt(t);if(u[n]!==1){if(n===61)break;return}}if(t===e.length)return;let o=``,s,l;if(i=e.slice(a,t),i.charCodeAt(i.length-1)===42){let n=++t;for(;t<e.length;++t){let n=e.charCodeAt(t);if(f[n]!==1){if(n!==39)return;break}}if(t===e.length)return;for(l=e.slice(n,t),++t;t<e.length&&e.charCodeAt(t)!==39;++t);if(t===e.length||(++t,t===e.length))return;s=t;let r=0;for(;t<e.length;++t){let n=e.charCodeAt(t);if(p[n]!==1){if(n===37){let n,i;if(t+2<e.length&&(n=m[e.charCodeAt(t+1)])!==-1&&(i=m[e.charCodeAt(t+2)])!==-1){let a=(n<<4)+i;o+=e.slice(s,t),o+=String.fromCharCode(a),t+=2,s=t+1,a>=128?r=2:r===0&&(r=1);continue}return}break}}if(o+=e.slice(s,t),o=c(o,l,r),o===void 0)return}else{if(++t,t===e.length)return;if(e.charCodeAt(t)===34){s=++t;let n=!1;for(;t<e.length;++t){let r=e.charCodeAt(t);if(r===92){n?(s=t,n=!1):(o+=e.slice(s,t),n=!0);continue}if(r===34){if(n){s=t,n=!1;continue}o+=e.slice(s,t);break}if(n&&=(s=t-1,!1),d[r]!==1)return}if(t===e.length)return;++t}else{for(s=t;t<e.length;++t)if(u[e.charCodeAt(t)]!==1){if(t===s)return;break}o=e.slice(s,t)}if(o=r(o,2),o===void 0)return}i=i.toLowerCase(),n[i]===void 0&&(n[i]=o)}return n}function o(e){let t;for(;;)switch(e){case`utf-8`:case`utf8`:return s.utf8;case`latin1`:case`ascii`:case`us-ascii`:case`iso-8859-1`:case`iso8859-1`:case`iso88591`:case`iso_8859-1`:case`windows-1252`:case`iso_8859-1:1987`:case`cp1252`:case`x-cp1252`:return s.latin1;case`utf16le`:case`utf-16le`:case`ucs2`:case`ucs-2`:return s.utf16le;case`base64`:return s.base64;default:if(t===void 0){t=!0,e=e.toLowerCase();continue}return s.other.bind(e)}}let s={utf8:(e,t)=>{if(e.length===0)return``;if(typeof e==`string`){if(t<2)return e;e=Buffer.from(e,`latin1`)}return e.utf8Slice(0,e.length)},latin1:(e,t)=>e.length===0?``:typeof e==`string`?e:e.latin1Slice(0,e.length),utf16le:(e,t)=>e.length===0?``:(typeof e==`string`&&(e=Buffer.from(e,`latin1`)),e.ucs2Slice(0,e.length)),base64:(e,t)=>e.length===0?``:(typeof e==`string`&&(e=Buffer.from(e,`latin1`)),e.base64Slice(0,e.length)),other:(t,n)=>{if(t.length===0)return``;typeof t==`string`&&(t=Buffer.from(t,`latin1`));try{return new TextDecoder(e).decode(t)}catch{}}};function c(e,t,n){let r=o(t);if(r)return r(e,n)}function l(e){if(typeof e!=`string`)return``;for(let t=e.length-1;t>=0;--t)switch(e.charCodeAt(t)){case 47:case 92:return e=e.slice(t+1),e===`..`||e===`.`?``:e}return e===`..`||e===`.`?``:e}let u=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],d=[0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],f=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,0,0,0,0,1,0,1,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],p=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,1,0,0,0,0,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],m=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,-1,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];t.exports={basename:l,convertToUTF8:c,getDecoder:o,parseContentType:n,parseDisposition:i}})),zbe=i(((e,t)=>{function n(e,t,n,r,i){for(let a=0;a<i;++a)if(e[t+a]!==n[r+a])return!1;return!0}var r=class{constructor(e,t){if(typeof t!=`function`)throw Error(`Missing match callback`);if(typeof e==`string`)e=Buffer.from(e);else if(!Buffer.isBuffer(e))throw Error(`Expected Buffer for needle, got ${typeof e}`);let n=e.length;if(this.maxMatches=1/0,this.matches=0,this._cb=t,this._lookbehindSize=0,this._needle=e,this._bufPos=0,this._lookbehind=Buffer.allocUnsafe(n),this._occ=[n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n],n>1)for(let t=0;t<n-1;++t)this._occ[e[t]]=n-1-t}reset(){this.matches=0,this._lookbehindSize=0,this._bufPos=0}push(e,t){let n;Buffer.isBuffer(e)||(e=Buffer.from(e,`latin1`));let r=e.length;for(this._bufPos=t||0;n!==r&&this.matches<this.maxMatches;)n=i(this,e);return n}destroy(){let e=this._lookbehindSize;e&&this._cb(!1,this._lookbehind,0,e,!1),this.reset()}};function i(e,t){let r=t.length,i=e._needle,o=i.length,s=-e._lookbehindSize,c=o-1,l=i[c],u=r-o,d=e._occ,f=e._lookbehind;if(s<0){for(;s<0&&s<=u;){let n=s+c,r=n<0?f[e._lookbehindSize+n]:t[n];if(r===l&&a(e,t,s,c))return e._lookbehindSize=0,++e.matches,s>-e._lookbehindSize?e._cb(!0,f,0,e._lookbehindSize+s,!1):e._cb(!0,void 0,0,0,!0),e._bufPos=s+o;s+=d[r]}for(;s<0&&!a(e,t,s,r-s);)++s;if(s<0){let n=e._lookbehindSize+s;return n>0&&e._cb(!1,f,0,n,!1),e._lookbehindSize-=n,f.copy(f,0,n,e._lookbehindSize),f.set(t,e._lookbehindSize),e._lookbehindSize+=r,e._bufPos=r,r}e._cb(!1,f,0,e._lookbehindSize,!1),e._lookbehindSize=0}s+=e._bufPos;let p=i[0];for(;s<=u;){let r=t[s+c];if(r===l&&t[s]===p&&n(i,0,t,s,c))return++e.matches,s>0?e._cb(!0,t,e._bufPos,s,!0):e._cb(!0,void 0,0,0,!0),e._bufPos=s+o;s+=d[r]}for(;s<r;){if(t[s]!==p||!n(t,s,i,0,r-s)){++s;continue}t.copy(f,0,s,r),e._lookbehindSize=r-s;break}return s>0&&e._cb(!1,t,e._bufPos,s<r?s:r,!0),e._bufPos=r,r}function a(e,t,n,r){let i=e._lookbehind,a=e._lookbehindSize,o=e._needle;for(let e=0;e<r;++e,++n)if((n<0?i[a+n]:t[n])!==o[e])return!1;return!0}t.exports=r})),Bbe=i(((e,n)=>{let{Readable:r,Writable:i}=t(`stream`),a=zbe(),{basename:o,convertToUTF8:s,getDecoder:c,parseContentType:l,parseDisposition:u}=u6(),d=Buffer.from(`\r
457
+ `),f=Buffer.from(`\r`),p=Buffer.from(`-`);function m(){}let h=16*1024;var g=class{constructor(e){this.header=Object.create(null),this.pairCount=0,this.byteCount=0,this.state=0,this.name=``,this.value=``,this.crlf=0,this.cb=e}reset(){this.header=Object.create(null),this.pairCount=0,this.byteCount=0,this.state=0,this.name=``,this.value=``,this.crlf=0}push(e,t,n){let r=t;for(;t<n;)switch(this.state){case 0:{let i=!1;for(;t<n;++t){if(this.byteCount===h)return-1;++this.byteCount;let n=e[t];if(w[n]!==1){if(n!==58||(this.name+=e.latin1Slice(r,t),this.name.length===0))return-1;++t,i=!0,this.state=1;break}}if(!i){this.name+=e.latin1Slice(r,t);break}}case 1:{let i=!1;for(;t<n;++t){if(this.byteCount===h)return-1;++this.byteCount;let n=e[t];if(n!==32&&n!==9){r=t,i=!0,this.state=2;break}}if(!i)break}case 2:switch(this.crlf){case 0:for(;t<n;++t){if(this.byteCount===h)return-1;++this.byteCount;let n=e[t];if(T[n]!==1){if(n!==13)return-1;++this.crlf;break}}this.value+=e.latin1Slice(r,t++);break;case 1:if(this.byteCount===h||(++this.byteCount,e[t++]!==10))return-1;++this.crlf;break;case 2:{if(this.byteCount===h)return-1;++this.byteCount;let n=e[t];n===32||n===9?(r=t,this.crlf=0):(++this.pairCount<2e3&&(this.name=this.name.toLowerCase(),this.header[this.name]===void 0?this.header[this.name]=[this.value]:this.header[this.name].push(this.value)),n===13?(++this.crlf,++t):(r=t,this.crlf=0,this.state=0,this.name=``,this.value=``));break}case 3:{if(this.byteCount===h||(++this.byteCount,e[t++]!==10))return-1;let n=this.header;return this.reset(),this.cb(n),t}}break}return t}},_=class extends r{constructor(e,t){super(e),this.truncated=!1,this._readcb=null,this.once(`end`,()=>{if(this._read(),--t._fileEndsLeft===0&&t._finalcb){let e=t._finalcb;t._finalcb=null,process.nextTick(e)}})}_read(e){let t=this._readcb;t&&(this._readcb=null,t())}};let v={push:(e,t)=>{},destroy:()=>{}};function y(e,t){let n=e._writecb;e._writecb=null,t?e.destroy(t):n&&n()}function b(e,t){return e}var x=class extends i{constructor(e){let t={autoDestroy:!0,emitClose:!0,highWaterMark:typeof e.highWaterMark==`number`?e.highWaterMark:void 0};if(super(t),!e.conType.params||typeof e.conType.params.boundary!=`string`)throw Error(`Multipart: Boundary not found`);let n=e.conType.params.boundary,r=typeof e.defParamCharset==`string`&&e.defParamCharset?c(e.defParamCharset):b,i=e.defCharset||`utf8`,h=e.preservePath,y={autoDestroy:!0,emitClose:!0,highWaterMark:typeof e.fileHwm==`number`?e.fileHwm:void 0},x=e.limits,S=x&&typeof x.fieldSize==`number`?x.fieldSize:1*1024*1024,C=x&&typeof x.fileSize==`number`?x.fileSize:1/0,w=x&&typeof x.files==`number`?x.files:1/0,T=x&&typeof x.fields==`number`?x.fields:1/0,E=x&&typeof x.parts==`number`?x.parts:1/0,D=-1,O=0,ee=0,te=!1;this._fileEndsLeft=0,this._fileStream=void 0,this._complete=!1;let ne=0,re,ie=0,ae,oe,se,k,ce=!1,le=!1,ue=!1;this._hparser=null;let A=new g(e=>{this._hparser=null,te=!1,se=`text/plain`,ae=i,oe=`7bit`,k=void 0,ce=!1;let t;if(!e[`content-disposition`]){te=!0;return}let n=u(e[`content-disposition`][0],r);if(!n||n.type!==`form-data`){te=!0;return}if(n.params&&(n.params.name&&(k=n.params.name),n.params[`filename*`]?t=n.params[`filename*`]:n.params.filename&&(t=n.params.filename),t!==void 0&&!h&&(t=o(t))),e[`content-type`]){let t=l(e[`content-type`][0]);t&&(se=`${t.type}/${t.subtype}`,t.params&&typeof t.params.charset==`string`&&(ae=t.params.charset.toLowerCase()))}if(e[`content-transfer-encoding`]&&(oe=e[`content-transfer-encoding`][0].toLowerCase()),se===`application/octet-stream`||t!==void 0){if(ee===w){le||(le=!0,this.emit(`filesLimit`)),te=!0;return}if(++ee,this.listenerCount(`file`)===0){te=!0;return}ne=0,this._fileStream=new _(y,this),++this._fileEndsLeft,this.emit(`file`,k,this._fileStream,{filename:t,encoding:oe,mimeType:se})}else{if(O===T){ue||(ue=!0,this.emit(`fieldsLimit`)),te=!0;return}if(++O,this.listenerCount(`field`)===0){te=!0;return}re=[],ie=0}}),j=0,de=(e,t,n,r,i)=>{retrydata:for(;t;){if(this._hparser!==null){let e=this._hparser.push(t,n,r);if(e===-1){this._hparser=null,A.reset(),this.emit(`error`,Error(`Malformed part header`));break}n=e}if(n===r)break;if(j!==0){if(j===1){switch(t[n]){case 45:j=2,++n;break;case 13:j=3,++n;break;default:j=0}if(n===r)return}if(j===2){if(j=0,t[n]===45){this._complete=!0,this._bparser=v;return}let e=this._writecb;this._writecb=m,de(!1,p,0,1,!1),this._writecb=e}else if(j===3)if(j=0,t[n]===10){if(++n,D>=E||(this._hparser=A,n===r))break;continue retrydata}else{let e=this._writecb;this._writecb=m,de(!1,f,0,1,!1),this._writecb=e}}if(!te){if(this._fileStream){let e,a=Math.min(r-n,C-ne);i?e=t.slice(n,n+a):(e=Buffer.allocUnsafe(a),t.copy(e,0,n,n+a)),ne+=e.length,ne===C?(e.length>0&&this._fileStream.push(e),this._fileStream.emit(`limit`),this._fileStream.truncated=!0,te=!0):this._fileStream.push(e)||(this._writecb&&(this._fileStream._readcb=this._writecb),this._writecb=null)}else if(re!==void 0){let e,a=Math.min(r-n,S-ie);i?e=t.slice(n,n+a):(e=Buffer.allocUnsafe(a),t.copy(e,0,n,n+a)),ie+=a,re.push(e),ie===S&&(te=!0,ce=!0)}}break}if(e){if(j=1,this._fileStream)this._fileStream.push(null),this._fileStream=null;else if(re!==void 0){let e;switch(re.length){case 0:e=``;break;case 1:e=s(re[0],ae,0);break;default:e=s(Buffer.concat(re,ie),ae,0)}re=void 0,ie=0,this.emit(`field`,k,e,{nameTruncated:!1,valueTruncated:ce,encoding:oe,mimeType:se})}++D===E&&this.emit(`partsLimit`)}};this._bparser=new a(`\r\n--${n}`,de),this._writecb=null,this._finalcb=null,this.write(d)}static detect(e){return e.type===`multipart`&&e.subtype===`form-data`}_write(e,t,n){this._writecb=n,this._bparser.push(e,0),this._writecb&&y(this)}_destroy(e,t){this._hparser=null,this._bparser=v,e||=C(this);let n=this._fileStream;n&&(this._fileStream=null,n.destroy(e)),t(e)}_final(e){if(this._bparser.destroy(),!this._complete)return e(Error(`Unexpected end of form`));this._fileEndsLeft?this._finalcb=S.bind(null,this,e):S(this,e)}};function S(e,t,n){if(n)return t(n);n=C(e),t(n)}function C(e){if(e._hparser)return Error(`Malformed part header`);let t=e._fileStream;if(t&&(e._fileStream=null,t.destroy(Error(`Unexpected end of file`))),!e._complete)return Error(`Unexpected end of form`)}let w=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],T=[0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];n.exports=x})),Vbe=i(((e,n)=>{let{Writable:r}=t(`stream`),{getDecoder:i}=u6();var a=class extends r{constructor(e){let t={autoDestroy:!0,emitClose:!0,highWaterMark:typeof e.highWaterMark==`number`?e.highWaterMark:void 0};super(t);let n=e.defCharset||`utf8`;e.conType.params&&typeof e.conType.params.charset==`string`&&(n=e.conType.params.charset),this.charset=n;let r=e.limits;this.fieldSizeLimit=r&&typeof r.fieldSize==`number`?r.fieldSize:1*1024*1024,this.fieldsLimit=r&&typeof r.fields==`number`?r.fields:1/0,this.fieldNameSizeLimit=r&&typeof r.fieldNameSize==`number`?r.fieldNameSize:100,this._inKey=!0,this._keyTrunc=!1,this._valTrunc=!1,this._bytesKey=0,this._bytesVal=0,this._fields=0,this._key=``,this._val=``,this._byte=-2,this._lastPos=0,this._encode=0,this._decoder=i(n)}static detect(e){return e.type===`application`&&e.subtype===`x-www-form-urlencoded`}_write(e,t,n){if(this._fields>=this.fieldsLimit)return n();let r=0,i=e.length;if(this._lastPos=0,this._byte!==-2){if(r=o(this,e,r,i),r===-1)return n(Error(`Malformed urlencoded form`));if(r>=i)return n();this._inKey?++this._bytesKey:++this._bytesVal}main:for(;r<i;)if(this._inKey){for(r=s(this,e,r,i);r<i;){switch(e[r]){case 61:this._lastPos<r&&(this._key+=e.latin1Slice(this._lastPos,r)),this._lastPos=++r,this._key=this._decoder(this._key,this._encode),this._encode=0,this._inKey=!1;continue main;case 38:if(this._lastPos<r&&(this._key+=e.latin1Slice(this._lastPos,r)),this._lastPos=++r,this._key=this._decoder(this._key,this._encode),this._encode=0,this._bytesKey>0&&this.emit(`field`,this._key,``,{nameTruncated:this._keyTrunc,valueTruncated:!1,encoding:this.charset,mimeType:`text/plain`}),this._key=``,this._val=``,this._keyTrunc=!1,this._valTrunc=!1,this._bytesKey=0,this._bytesVal=0,++this._fields>=this.fieldsLimit)return this.emit(`fieldsLimit`),n();continue;case 43:this._lastPos<r&&(this._key+=e.latin1Slice(this._lastPos,r)),this._key+=` `,this._lastPos=r+1;break;case 37:if(this._encode===0&&(this._encode=1),this._lastPos<r&&(this._key+=e.latin1Slice(this._lastPos,r)),this._lastPos=r+1,this._byte=-1,r=o(this,e,r+1,i),r===-1)return n(Error(`Malformed urlencoded form`));if(r>=i)return n();++this._bytesKey,r=s(this,e,r,i);continue}++r,++this._bytesKey,r=s(this,e,r,i)}this._lastPos<r&&(this._key+=e.latin1Slice(this._lastPos,r))}else{for(r=c(this,e,r,i);r<i;){switch(e[r]){case 38:if(this._lastPos<r&&(this._val+=e.latin1Slice(this._lastPos,r)),this._lastPos=++r,this._inKey=!0,this._val=this._decoder(this._val,this._encode),this._encode=0,(this._bytesKey>0||this._bytesVal>0)&&this.emit(`field`,this._key,this._val,{nameTruncated:this._keyTrunc,valueTruncated:this._valTrunc,encoding:this.charset,mimeType:`text/plain`}),this._key=``,this._val=``,this._keyTrunc=!1,this._valTrunc=!1,this._bytesKey=0,this._bytesVal=0,++this._fields>=this.fieldsLimit)return this.emit(`fieldsLimit`),n();continue main;case 43:this._lastPos<r&&(this._val+=e.latin1Slice(this._lastPos,r)),this._val+=` `,this._lastPos=r+1;break;case 37:if(this._encode===0&&(this._encode=1),this._lastPos<r&&(this._val+=e.latin1Slice(this._lastPos,r)),this._lastPos=r+1,this._byte=-1,r=o(this,e,r+1,i),r===-1)return n(Error(`Malformed urlencoded form`));if(r>=i)return n();++this._bytesVal,r=c(this,e,r,i);continue}++r,++this._bytesVal,r=c(this,e,r,i)}this._lastPos<r&&(this._val+=e.latin1Slice(this._lastPos,r))}n()}_final(e){if(this._byte!==-2)return e(Error(`Malformed urlencoded form`));(!this._inKey||this._bytesKey>0||this._bytesVal>0)&&(this._inKey?this._key=this._decoder(this._key,this._encode):this._val=this._decoder(this._val,this._encode),this.emit(`field`,this._key,this._val,{nameTruncated:this._keyTrunc,valueTruncated:this._valTrunc,encoding:this.charset,mimeType:`text/plain`})),e()}};function o(e,t,n,r){if(n>=r)return r;if(e._byte===-1){let i=l[t[n++]];if(i===-1)return-1;if(i>=8&&(e._encode=2),n<r){let r=l[t[n++]];if(r===-1)return-1;e._inKey?e._key+=String.fromCharCode((i<<4)+r):e._val+=String.fromCharCode((i<<4)+r),e._byte=-2,e._lastPos=n}else e._byte=i}else{let r=l[t[n++]];if(r===-1)return-1;e._inKey?e._key+=String.fromCharCode((e._byte<<4)+r):e._val+=String.fromCharCode((e._byte<<4)+r),e._byte=-2,e._lastPos=n}return n}function s(e,t,n,r){if(e._bytesKey>e.fieldNameSizeLimit){for(e._keyTrunc||e._lastPos<n&&(e._key+=t.latin1Slice(e._lastPos,n-1)),e._keyTrunc=!0;n<r;++n){let r=t[n];if(r===61||r===38)break;++e._bytesKey}e._lastPos=n}return n}function c(e,t,n,r){if(e._bytesVal>e.fieldSizeLimit){for(e._valTrunc||e._lastPos<n&&(e._val+=t.latin1Slice(e._lastPos,n-1)),e._valTrunc=!0;n<r&&t[n]!==38;++n)++e._bytesVal;e._lastPos=n}return n}let l=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,-1,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];n.exports=a}));i(((e,t)=>{let{parseContentType:n}=u6();function r(e){let t=e.headers,r=n(t[`content-type`]);if(!r)throw Error(`Malformed content type`);for(let n of i){if(!n.detect(r))continue;let i={limits:e.limits,headers:t,conType:r,highWaterMark:void 0,fileHwm:void 0,defCharset:void 0,defParamCharset:void 0,preservePath:!1};return e.highWaterMark&&(i.highWaterMark=e.highWaterMark),e.fileHwm&&(i.fileHwm=e.fileHwm),i.defCharset=e.defCharset,i.defParamCharset=e.defParamCharset,i.preservePath=e.preservePath,new n(i)}throw Error(`Unsupported content type: ${t[`content-type`]}`)}let i=[Bbe(),Vbe()].filter(function(e){return typeof e.detect==`function`});t.exports=e=>{if((typeof e!=`object`||!e)&&(e={}),typeof e.headers!=`object`||e.headers===null||typeof e.headers[`content-type`]!=`string`)throw Error(`Missing Content-Type`);return r(e)}}))(),H$(`file-ops`),H$(`upload-streaming`);const d6="Absolute host path inside the target OpenKnowledge project. Required when the MCP server is registered globally (e.g. `npx @inkeep/open-knowledge mcp` once at the host level, routing per call), unless the MCP client advertises exactly one root via the `roots` capability — that single root is then used as the implicit `cwd`. Optional when the server is anchored to a single project (the per-project HTTP MCP server defaults to its configured project root).";F().max(200).optional().describe(`Optional one-line user-outcome description (≤80 chars). Appears as a bullet in the timeline.`),F().length(40).regex(/^[0-9a-f]+$/i).describe("A 40-character commit SHA identifying a saved version. Produced by `checkpoint`, listed by `history` as `entries[].version`, and consumed here — the same `version` field name across all three."),F().nullable().describe("Route-only preview URL (`/#/<doc>`, no host:port), or null when no UI is running."),F().optional().describe(`How the previewUrl was resolved (e.g. the UI lock).`),F().optional().describe(`Route of the prior/removed path, for closing a stale preview tab.`);const Hbe=B({value:F(),truncatedFrom:I().optional(),hint:F().optional()}).describe(`Normalized change-note summary, when one was recorded.`),Ube=z(V(F(),R()));V(F(),R()).optional().describe("Preview-attach hint (`{ action, previewUrl?, message? }`) when relevant."),z(IJ).describe('Outbound internal links in the just-written doc that do not resolve. Always present — `[]` means every link resolves. Each: `{ href (as written), resolvedTo (the docName or content-root file path it pointed at, or null), reason: "no-such-doc" | "no-such-file" | "unresolvable" }`. Report-only — the write landed regardless; fix in a follow-up edit.'),Hbe.optional(),z(PJ).min(1).optional().describe("Advisory entries discriminated by `kind`. Write-integrity kinds — `content-divergence` (converged Y.Text didn't byte-match what you composed) and `disk-edit-reconciled` (an out-of-band disk edit was folded in before your write) — mean re-read the doc. The renderability kind `mermaid-parse-error` means the write landed but that fence will not render — fix it and re-edit."),z(B({name:F(),description:F().optional()})).min(1).optional().describe("Templates the parent folder offers, present only when a create passed no `template`. A nudge — the write already landed; pass `template` next time to match the folder's shape.");const Wbe=F().optional().describe("Auto-duplicated body text. `textPlusStructured` mirrors the visible body here as a Claude / Claude Desktop client-quirk workaround (those clients hide `content[]` when `structuredContent` is present). Internal — programmatic consumers should prefer the `content[0].text` channel.");function f6(e){return{text:Wbe,...e}}H$(`git-checkout`),H$(`git-worktree-status`),H$(`git-context`),H$(`rename-log`),H$(`managed-artifact-persistence`),H$(`timeline`);const Gbe=global.Request;var p6=class extends Gbe{constructor(e,t){if(typeof e==`object`&&x6 in e){let n=t!==void 0&&`body`in t&&t.body!=null;if(e[A6]&&!n)throw TypeError(`Cannot construct a Request with a Request object that has already been used.`);e=e[x6]()}t?.body?.getReader!==void 0&&(t.duplex??=`half`),super(e,t)}};const m6=e=>{let t=[],n=e.rawHeaders;for(let e=0,r=n.length;e<r;e+=2){let r=n[e];r.charCodeAt(0)!==58&&t.push([r,n[e+1]])}return new Headers(t)},Kbe=Symbol(`wrapBodyStream`),qbe=new Set([`latin1`,`binary`,`hex`,`base64`,`base64url`]),Jbe=e=>e===null||qbe.has(e),h6=Symbol(`bodyBufferedBeforeDisconnect`),g6=Symbol(`bodyBufferedLengthBeforeDisconnect`),_6=(e,t)=>Buffer.isBuffer(e)?e:Buffer.from(e,t??`utf8`),v6=e=>!(e instanceof Ie)&&!!e.complete&&!!e.readableAborted&&typeof e.read==`function`&&Jbe(e.readableEncoding),y6=(e,t)=>{if(e.readableDidRead&&!t||!v6(e))return;let n=e;if(n[h6]!==void 0)return n[h6];let r,i=e.errored;if(i&&i.code!==`ECONNRESET`)r=i;else if(n[g6]!==void 0&&e.readableLength!==n[g6])r=N6();else{let n=t??[],i=e.read();i!==null&&n.push(_6(i,e.readableEncoding));let a=n.length===1?n[0]:Buffer.concat(n);r=a;let o=e.headers[`content-length`];if(typeof o==`string`&&/^\d+$/.test(o)){let e=Number(o);Number.isSafeInteger(e)&&a.length!==e&&(r=N6())}}return n[h6]=r,r},b6=(e,t)=>{if(t instanceof Error){e.error(t);return}t.length>0&&e.enqueue(t),e.close()},Ybe=(e,t,n,r,i)=>{let a={method:e,headers:n,signal:i.signal};if(e===`TRACE`){a.method=`GET`;let e=new p6(t,a);return Object.defineProperty(e,`method`,{get(){return`TRACE`}}),e}if(!(e===`GET`||e===`HEAD`))if(`rawBody`in r&&r.rawBody instanceof Buffer)a.body=new ReadableStream({start(e){e.enqueue(r.rawBody),e.close()}});else if(r[Kbe]){let e;a.body=new ReadableStream({async pull(t){try{if(!e){let e=y6(r);if(e!==void 0){b6(t,e);return}}e||=Oe.toWeb(r).getReader();let{done:n,value:i}=await e.read();n?t.close():t.enqueue(i)}catch(e){t.error(e)}}})}else{let e=y6(r);e===void 0?a.body=Oe.toWeb(r):a.body=new ReadableStream({start(t){b6(t,e)}})}return new p6(t,a)},x6=Symbol(`getRequestCache`),S6=Symbol(`requestCache`),C6=Symbol(`incomingKey`),w6=Symbol(`urlKey`),Xbe=Symbol(`methodKey`),T6=Symbol(`headersKey`),E6=Symbol(`abortControllerKey`),D6=Symbol(`getAbortController`),Zbe=Symbol(`abortRequest`),O6=Symbol(`bodyBuffer`),k6=Symbol(`bodyReadPromise`),A6=Symbol(`bodyConsumedDirectly`),j6=Symbol(`bodyLockReader`),M6=Symbol(`abortReason`),N6=()=>TypeError(`Body is unusable`),P6=()=>Promise.reject(N6()),Qbe=new TextDecoder,$be=e=>{if(e[A6])return P6();e[A6]=!0},exe=e=>e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength),txe=e=>(e[T6]||=m6(e[C6])).get(`content-type`)||``,nxe=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,rxe=e=>{if(!nxe.test(e))return TypeError(`'${e}' is not a valid HTTP method.`);let t=e.toUpperCase();if(t===`CONNECT`||t===`TRACK`||t===`TRACE`&&e!==`TRACE`)return TypeError(`'${e}' HTTP method is unsupported.`)},F6=(e,t,n)=>{if(e[A6])return P6();let r=e.method;if(r===`GET`||r===`HEAD`)return e[x6]()[t]();let i=rxe(r);if(i)return Promise.reject(i);if(e[S6]&&r!==`TRACE`)return e[S6][t]();let a=$be(e);if(a)return a;let o=ixe(e);if(o){let t=Promise.resolve(n(o,e));return e[O6]=void 0,t}return axe(e).then(t=>{let r=n(t,e);return e[O6]=void 0,r})},ixe=e=>{let t=e[C6];if(`rawBody`in t&&t.rawBody instanceof Buffer)return t.rawBody},I6=(e,t)=>{if(t.errored)return t.errored;let n=e[M6];return n===void 0?Error(`Client connection prematurely closed.`):n instanceof Error?n:Error(String(n))},axe=e=>{if(e[O6])return Promise.resolve(e[O6]);if(e[k6])return e[k6];let t=e[C6];if(t.readableDidRead)return P6();let n=y6(t);if(n!==void 0)return n instanceof Error?Promise.reject(n):(e[O6]=n,Promise.resolve(n));let r=new Promise((n,r)=>{let i=[],a=!1,o=e=>{a||(a=!0,f(),e())},s=a=>{let s=t.errored??a;return!v6(t)||s&&s.code!==`ECONNRESET`?!1:(o(()=>{let o=y6(t,i);o instanceof Error?r(o):o===void 0?r(a??I6(e,t)):(e[O6]=o,n(o))}),!0)},c=e=>{i.push(_6(e,t.readableEncoding))},l=()=>{o(()=>{let t=i.length===1?i[0]:Buffer.concat(i);e[O6]=t,n(t)})},u=e=>{s(e)||o(()=>{r(e)})},d=()=>{if(t.readableEnded){l();return}s()||o(()=>{r(I6(e,t))})},f=()=>{t.off(`data`,c),t.off(`end`,l),t.off(`error`,u),t.off(`close`,d),e[k6]=void 0};t.on(`data`,c),t.on(`end`,l),t.on(`error`,u),t.on(`close`,d),queueMicrotask(()=>{a||(t.readableEnded?l():t.errored?u(t.errored):t.destroyed&&d())})});return e[k6]=r,r},L6={get method(){return this[Xbe]},get url(){return this[w6]},get headers(){return this[T6]||=m6(this[C6])},[Zbe](e){this[M6]===void 0&&(this[M6]=e);let t=this[E6];t&&!t.signal.aborted&&t.abort(e)},[D6](){return this[E6]||=new AbortController,this[M6]!==void 0&&!this[E6].signal.aborted&&this[E6].abort(this[M6]),this[E6]},[x6](){let e=this[D6]();if(this[S6])return this[S6];let t=this.method;if(this[A6]&&!(t===`GET`||t===`HEAD`)){this[O6]=void 0;let n={method:t===`TRACE`?`GET`:t,headers:this.headers,signal:e.signal};t!==`TRACE`&&(n.body=new ReadableStream({start(e){e.close()}}),n.duplex=`half`);let r=new p6(this[w6],n);return t===`TRACE`&&Object.defineProperty(r,`method`,{get(){return`TRACE`}}),this[S6]=r}return this[S6]=Ybe(this.method,this[w6],this.headers,this[C6],e)},get body(){if(!this[A6])return this[x6]().body;let e=this[x6]();return!this[j6]&&e.body&&(this[j6]=e.body.getReader()),e.body},get bodyUsed(){return this[A6]?!0:this[S6]?this[S6].bodyUsed:!1}};Object.defineProperty(L6,`signal`,{get(){return this[D6]().signal}}),[`cache`,`credentials`,`destination`,`integrity`,`mode`,`redirect`,`referrer`,`referrerPolicy`,`keepalive`].forEach(e=>{Object.defineProperty(L6,e,{get(){return this[x6]()[e]}})}),[`clone`,`formData`].forEach(e=>{Object.defineProperty(L6,e,{value:function(){if(this[A6]){if(e===`clone`)throw N6();return P6()}return this[x6]()[e]()}})}),Object.defineProperty(L6,`text`,{value:function(){return F6(this,`text`,e=>Qbe.decode(e))}}),Object.defineProperty(L6,`arrayBuffer`,{value:function(){return F6(this,`arrayBuffer`,e=>exe(e))}}),Object.defineProperty(L6,`blob`,{value:function(){return F6(this,`blob`,(e,t)=>{let n=txe(t);return new Response(e,n?{headers:{"content-type":n}}:void 0).blob()})}}),Object.defineProperty(L6,`json`,{value:function(){return this[A6]?P6():this.text().then(JSON.parse)}}),Object.defineProperty(L6,Symbol.for(`nodejs.util.inspect.custom`),{value:function(e,t,n){return`Request (lightweight) ${n({method:this.method,url:this.url,headers:this.headers,nativeRequest:this[S6]},{...t,depth:e==null?null:e-1})}`}}),Object.setPrototypeOf(L6,p6.prototype);const R6=Symbol(`responseCache`),z6=Symbol(`getResponseCache`),B6=Symbol(`cache`),V6=global.Response;var H6=class e{#e;#t;[z6](){let e=this[B6],t=e&&e[2]instanceof Headers?e[2]:void 0;return delete this[B6],this[R6]||=new V6(this.#e,t?{status:this.#t?.status,statusText:this.#t?.statusText,headers:t}:this.#t)}constructor(t,n){let r;if(this.#e=t,n instanceof V6){let t=n[R6];if(t){this.#t=t,this[z6]();return}this.#t=n instanceof e?n.#t:n,r=new Headers(n.headers)}else this.#t=n;(t==null||typeof t==`string`||t?.getReader!==void 0||t instanceof Blob||t instanceof Uint8Array)&&(this[B6]=[n?.status||200,t??null,r||n?.headers])}get headers(){let e=this[B6];return e?(e[2]instanceof Headers||(e[2]=new Headers(e[2]||(e[1]===null?void 0:{"content-type":`text/plain; charset=UTF-8`}))),e[2]):this[z6]().headers}get status(){return this[B6]?.[0]??this[z6]().status}get ok(){let e=this.status;return e>=200&&e<300}};[`body`,`bodyUsed`,`redirected`,`statusText`,`trailers`,`type`,`url`].forEach(e=>{Object.defineProperty(H6.prototype,e,{get(){return this[z6]()[e]}})}),[`arrayBuffer`,`blob`,`clone`,`formData`,`json`,`text`].forEach(e=>{Object.defineProperty(H6.prototype,e,{value:function(){return this[z6]()[e]()}})}),Object.defineProperty(H6.prototype,Symbol.for(`nodejs.util.inspect.custom`),{value:function(e,t,n){return`Response (lightweight) ${n({status:this.status,headers:this.headers,ok:this.ok,nativeResponse:this[R6]},{...t,depth:e==null?null:e-1})}`}}),Object.setPrototypeOf(H6,V6),Object.setPrototypeOf(H6.prototype,V6.prototype);const oxe=/^https?:\/\/[!#-;=?-[\]_a-z~A-Z]+$/,sxe=e=>e instanceof URL?e.href:oxe.test(e)?e:new URL(e).href,cxe=new Set([301,302,303,307,308]);Object.defineProperty(H6,`redirect`,{value:function(e,t=302){if(!cxe.has(t))throw RangeError(`Invalid status code`);return new H6(null,{status:t,headers:{location:sxe(e)}})},writable:!0,configurable:!0}),Object.defineProperty(H6,`json`,{value:function(e,t){let n=JSON.stringify(e);if(n===void 0)throw TypeError(`The data is not JSON serializable`);let r=t?.headers,i;return r?(i=new Headers(r),i.has(`content-type`)||i.set(`content-type`,`application/json`)):i={"content-type":`application/json`},new H6(n,{status:t?.status??200,statusText:t?.statusText,headers:i})},writable:!0,configurable:!0}),globalThis.CloseEvent,globalThis.ErrorEvent,new Response(null,{headers:{"x-hono-already-sent":`true`}}),H$(`suggest-links`);function U6(e){try{return T.native(e)}catch{return e}}`${Nu}`,`${Cu.join(`
458
+ `)}`,H$(`local-op-security`),H$(`clone-flow`),Fe(s),d3.project,Object.fromEntries(Object.entries(Fu).map(([e,t])=>[t,e])),[`These are patterns to adapt to your domain, not a layout to copy verbatim.`,"To build a variant: create your own folders (via `write` or your editor) and reuse only the ideas that fit.","To adopt this pack as-is: re-run without `--dry-run`."].join(`
459
+ `),H$(`skills-leaderboard`),B({target:H(Object.keys({"claude-cowork":{type:`app-bundle`,appName:`Claude`,urlScheme:`claude:`,probeScheme:`claude`,quitFirst:!1},"claude-code":{type:`app-bundle`,appName:`Claude`,urlScheme:`claude:`,probeScheme:`claude`,quitFirst:!1},codex:{type:`app-bundle`,appName:`Codex`,urlScheme:`codex:`,probeScheme:`codex`,quitFirst:!0},cursor:{type:`cli-binary`,binaryName:`cursor`,urlScheme:`cursor:`}})),url:F().min(1).max(4096),workspacePath:F().optional()}),B({}).loose(),i(((e,t)=>{(function(e){let n=`(0?\\d+|0x[a-f0-9]+)`,r={fourOctet:RegExp(`^${n}\\.${n}\\.${n}\\.${n}$`,`i`),threeOctet:RegExp(`^${n}\\.${n}\\.${n}$`,`i`),twoOctet:RegExp(`^${n}\\.${n}$`,`i`),longValue:RegExp(`^${n}$`,`i`)},i=RegExp(`^0[0-7]+$`,`i`),a=RegExp(`^0x[a-f0-9]+$`,`i`),o=`%[0-9a-z]{1,}`,s=`(?:[0-9a-f]+::?)+`,c={zoneIndex:new RegExp(o,`i`),native:RegExp(`^(::)?(${s})?([0-9a-f]+)?(::)?(${o})?$`,`i`),deprecatedTransitional:RegExp(`^(?:::)(${n}\\.${n}\\.${n}\\.${n}(${o})?)$`,`i`),transitional:RegExp(`^((?:${s})|(?:::)(?:${s})?)${n}\\.${n}\\.${n}\\.${n}(${o})?$`,`i`)};function l(e,t){if(e.indexOf(`::`)!==e.lastIndexOf(`::`))return null;let n=0,r=-1,i=(e.match(c.zoneIndex)||[])[0],a,o;for(i&&(i=i.substring(1),e=e.replace(/%.+$/,``));(r=e.indexOf(`:`,r+1))>=0;)n++;if(e.substr(0,2)===`::`&&n--,e.substr(-2,2)===`::`&&n--,n>t)return null;for(o=t-n,a=`:`;o--;)a+=`0:`;return e=e.replace(`::`,a),e[0]===`:`&&(e=e.slice(1)),e[e.length-1]===`:`&&(e=e.slice(0,-1)),t=(function(){let t=e.split(`:`),n=[];for(let e=0;e<t.length;e++)n.push(parseInt(t[e],16));return n})(),{parts:t,zoneId:i}}function u(e,t,n,r){if(e.length!==t.length)throw Error(`ipaddr: cannot match CIDR for objects with different lengths`);let i=0,a;for(;r>0;){if(a=n-r,a<0&&(a=0),e[i]>>a!==t[i]>>a)return!1;r-=n,i+=1}return!0}function d(e){if(a.test(e))return parseInt(e,16);if(e[0]===`0`&&!isNaN(parseInt(e[1],10))){if(i.test(e))return parseInt(e,8);throw Error(`ipaddr: cannot parse ${e} as octal`)}return parseInt(e,10)}function f(e,t){for(;e.length<t;)e=`0${e}`;return e}let p={};p.IPv4=(function(){function e(e){if(e.length!==4)throw Error(`ipaddr: ipv4 octet count should be 4`);let t,n;for(t=0;t<e.length;t++)if(n=e[t],!(0<=n&&n<=255))throw Error(`ipaddr: ipv4 octet should fit in 8 bits`);this.octets=e}return e.prototype.SpecialRanges={unspecified:[[new e([0,0,0,0]),8]],broadcast:[[new e([255,255,255,255]),32]],multicast:[[new e([224,0,0,0]),4]],linkLocal:[[new e([169,254,0,0]),16]],loopback:[[new e([127,0,0,0]),8]],carrierGradeNat:[[new e([100,64,0,0]),10]],private:[[new e([10,0,0,0]),8],[new e([172,16,0,0]),12],[new e([192,168,0,0]),16]],reserved:[[new e([192,0,0,0]),24],[new e([192,0,2,0]),24],[new e([192,88,99,0]),24],[new e([198,18,0,0]),15],[new e([198,51,100,0]),24],[new e([203,0,113,0]),24],[new e([240,0,0,0]),4]],as112:[[new e([192,175,48,0]),24],[new e([192,31,196,0]),24]],amt:[[new e([192,52,193,0]),24]]},e.prototype.kind=function(){return`ipv4`},e.prototype.match=function(e,t){let n;if(t===void 0&&(n=e,e=n[0],t=n[1]),e.kind()!==`ipv4`)throw Error(`ipaddr: cannot match ipv4 address with non-ipv4 one`);return u(this.octets,e.octets,8,t)},e.prototype.prefixLengthFromSubnetMask=function(){let e=0,t=!1,n={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},r,i,a;for(r=3;r>=0;--r)if(i=this.octets[r],i in n){if(a=n[i],t&&a!==0)return null;a!==8&&(t=!0),e+=a}else return null;return 32-e},e.prototype.range=function(){return p.subnetMatch(this,this.SpecialRanges)},e.prototype.toByteArray=function(){return this.octets.slice(0)},e.prototype.toIPv4MappedAddress=function(){return p.IPv6.parse(`::ffff:${this.toString()}`)},e.prototype.toNormalizedString=function(){return this.toString()},e.prototype.toString=function(){return this.octets.join(`.`)},e})(),p.IPv4.broadcastAddressFromCIDR=function(e){try{let t=this.parseCIDR(e),n=t[0].toByteArray(),r=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),i=[],a=0;for(;a<4;)i.push(parseInt(n[a],10)|parseInt(r[a],10)^255),a++;return new this(i)}catch{throw Error(`ipaddr: the address does not have IPv4 CIDR format`)}},p.IPv4.isIPv4=function(e){return this.parser(e)!==null},p.IPv4.isValid=function(e){try{return new this(this.parser(e)),!0}catch{return!1}},p.IPv4.isValidCIDR=function(e){try{return this.parseCIDR(e),!0}catch{return!1}},p.IPv4.isValidFourPartDecimal=function(e){return!!(p.IPv4.isValid(e)&&e.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},p.IPv4.isValidCIDRFourPartDecimal=function(e){let t=e.match(/^(.+)\/(\d+)$/);return!p.IPv4.isValidCIDR(e)||!t?!1:p.IPv4.isValidFourPartDecimal(t[1])},p.IPv4.networkAddressFromCIDR=function(e){let t,n,r,i,a;try{for(t=this.parseCIDR(e),r=t[0].toByteArray(),a=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),i=[],n=0;n<4;)i.push(parseInt(r[n],10)&parseInt(a[n],10)),n++;return new this(i)}catch{throw Error(`ipaddr: the address does not have IPv4 CIDR format`)}},p.IPv4.parse=function(e){let t=this.parser(e);if(t===null)throw Error(`ipaddr: string is not formatted like an IPv4 Address`);return new this(t)},p.IPv4.parseCIDR=function(e){let t;if(t=e.match(/^(.+)\/(\d+)$/)){let e=parseInt(t[2]);if(e>=0&&e<=32){let n=[this.parse(t[1]),e];return Object.defineProperty(n,`toString`,{value:function(){return this.join(`/`)}}),n}}throw Error(`ipaddr: string is not formatted like an IPv4 CIDR range`)},p.IPv4.parser=function(e){let t,n,i;if(t=e.match(r.fourOctet))return(function(){let e=t.slice(1,6),r=[];for(let t=0;t<e.length;t++)n=e[t],r.push(d(n));return r})();if(t=e.match(r.longValue)){if(i=d(t[1]),i>4294967295||i<0)throw Error(`ipaddr: address outside defined range`);return(function(){let e=[],t;for(t=0;t<=24;t+=8)e.push(i>>t&255);return e})().reverse()}else if(t=e.match(r.twoOctet))return(function(){let e=t.slice(1,4),n=[];if(i=d(e[1]),i>16777215||i<0)throw Error(`ipaddr: address outside defined range`);return n.push(d(e[0])),n.push(i>>16&255),n.push(i>>8&255),n.push(i&255),n})();else if(t=e.match(r.threeOctet))return(function(){let e=t.slice(1,5),n=[];if(i=d(e[2]),i>65535||i<0)throw Error(`ipaddr: address outside defined range`);return n.push(d(e[0])),n.push(d(e[1])),n.push(i>>8&255),n.push(i&255),n})();else return null},p.IPv4.subnetMaskFromPrefixLength=function(e){if(e=parseInt(e),e<0||e>32)throw Error(`ipaddr: invalid IPv4 prefix length`);let t=[0,0,0,0],n=0,r=Math.floor(e/8);for(;n<r;)t[n]=255,n++;return r<4&&(t[r]=2**(e%8)-1<<8-e%8),new this(t)},p.IPv6=(function(){function e(e,t){let n,r;if(e.length===16)for(this.parts=[],n=0;n<=14;n+=2)this.parts.push(e[n]<<8|e[n+1]);else if(e.length===8)this.parts=e;else throw Error(`ipaddr: ipv6 part count should be 8 or 16`);for(n=0;n<this.parts.length;n++)if(r=this.parts[n],!(0<=r&&r<=65535))throw Error(`ipaddr: ipv6 part should fit in 16 bits`);t&&(this.zoneId=t)}return e.prototype.SpecialRanges={unspecified:[new e([0,0,0,0,0,0,0,0]),128],linkLocal:[new e([65152,0,0,0,0,0,0,0]),10],multicast:[new e([65280,0,0,0,0,0,0,0]),8],loopback:[new e([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new e([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new e([0,0,0,0,0,65535,0,0]),96],deprecatedSiteLocal:[new e([65216,0,0,0,0,0,0,0]),10],discard:[new e([256,0,0,0,0,0,0,0]),64],rfc6145:[new e([0,0,0,0,65535,0,0,0]),96],rfc6052:[[new e([100,65435,0,0,0,0,0,0]),96],[new e([100,65435,1,0,0,0,0,0]),48]],"6to4":[new e([8194,0,0,0,0,0,0,0]),16],teredo:[new e([8193,0,0,0,0,0,0,0]),32],benchmarking:[new e([8193,2,0,0,0,0,0,0]),48],amt:[new e([8193,3,0,0,0,0,0,0]),32],as112v6:[[new e([8193,4,274,0,0,0,0,0]),48],[new e([9760,79,32768,0,0,0,0,0]),48]],deprecatedOrchid:[new e([8193,16,0,0,0,0,0,0]),28],orchid2:[new e([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new e([8193,48,0,0,0,0,0,0]),28],segmentRouting:[new e([24320,0,0,0,0,0,0,0]),16],reserved:[[new e([8193,0,0,0,0,0,0,0]),23],[new e([8193,3512,0,0,0,0,0,0]),32],[new e([16383,0,0,0,0,0,0,0]),20]]},e.prototype.isIPv4MappedAddress=function(){return this.range()===`ipv4Mapped`},e.prototype.kind=function(){return`ipv6`},e.prototype.match=function(e,t){let n;if(t===void 0&&(n=e,e=n[0],t=n[1]),e.kind()!==`ipv6`)throw Error(`ipaddr: cannot match ipv6 address with non-ipv6 one`);return u(this.parts,e.parts,16,t)},e.prototype.prefixLengthFromSubnetMask=function(){let e=0,t=!1,n={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},r,i;for(let a=7;a>=0;--a)if(r=this.parts[a],r in n){if(i=n[r],t&&i!==0)return null;i!==16&&(t=!0),e+=i}else return null;return 128-e},e.prototype.range=function(){return p.subnetMatch(this,this.SpecialRanges)},e.prototype.toByteArray=function(){let e,t=[],n=this.parts;for(let r=0;r<n.length;r++)e=n[r],t.push(e>>8),t.push(e&255);return t},e.prototype.toFixedLengthString=function(){let e=(function(){let e=[];for(let t=0;t<this.parts.length;t++)e.push(f(this.parts[t].toString(16),4));return e}).call(this).join(`:`),t=``;return this.zoneId&&(t=`%${this.zoneId}`),e+t},e.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw Error(`ipaddr: trying to convert a generic ipv6 address to ipv4`);let e=this.parts.slice(-2),t=e[0],n=e[1];return new p.IPv4([t>>8,t&255,n>>8,n&255])},e.prototype.toNormalizedString=function(){let e=(function(){let e=[];for(let t=0;t<this.parts.length;t++)e.push(this.parts[t].toString(16));return e}).call(this).join(`:`),t=``;return this.zoneId&&(t=`%${this.zoneId}`),e+t},e.prototype.toRFC5952String=function(){let e=/((^|:)(0(:|$)){2,})/g,t=this.toNormalizedString(),n=0,r=-1,i;for(;i=e.exec(t);)i[0].length>r&&(n=i.index,r=i[0].length);return r<0?t:`${t.substring(0,n)}::${t.substring(n+r)}`},e.prototype.toString=function(){return this.toRFC5952String()},e})(),p.IPv6.broadcastAddressFromCIDR=function(e){try{let t=this.parseCIDR(e),n=t[0].toByteArray(),r=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),i=[],a=0;for(;a<16;)i.push(parseInt(n[a],10)|parseInt(r[a],10)^255),a++;return new this(i)}catch(e){throw Error(`ipaddr: the address does not have IPv6 CIDR format (${e})`)}},p.IPv6.isIPv6=function(e){return this.parser(e)!==null},p.IPv6.isValid=function(e){if(typeof e==`string`&&e.indexOf(`:`)===-1)return!1;try{let t=this.parser(e);return new this(t.parts,t.zoneId),!0}catch{return!1}},p.IPv6.isValidCIDR=function(e){if(typeof e==`string`&&e.indexOf(`:`)===-1)return!1;try{return this.parseCIDR(e),!0}catch{return!1}},p.IPv6.networkAddressFromCIDR=function(e){let t,n,r,i,a;try{for(t=this.parseCIDR(e),r=t[0].toByteArray(),a=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),i=[],n=0;n<16;)i.push(parseInt(r[n],10)&parseInt(a[n],10)),n++;return new this(i)}catch(e){throw Error(`ipaddr: the address does not have IPv6 CIDR format (${e})`)}},p.IPv6.parse=function(e){let t=this.parser(e);if(t.parts===null)throw Error(`ipaddr: string is not formatted like an IPv6 Address`);return new this(t.parts,t.zoneId)},p.IPv6.parseCIDR=function(e){let t,n,r;if((n=e.match(/^(.+)\/(\d+)$/))&&(t=parseInt(n[2]),t>=0&&t<=128))return r=[this.parse(n[1]),t],Object.defineProperty(r,`toString`,{value:function(){return this.join(`/`)}}),r;throw Error(`ipaddr: string is not formatted like an IPv6 CIDR range`)},p.IPv6.parser=function(e){let t,n,r,i,a,o;if(r=e.match(c.deprecatedTransitional))return this.parser(`::ffff:${r[1]}`);if(c.native.test(e))return l(e,8);if((r=e.match(c.transitional))&&(o=r[6]||``,t=r[1],r[1].endsWith(`::`)||(t=t.slice(0,-1)),t=l(t+o,6),t.parts)){for(a=[parseInt(r[2]),parseInt(r[3]),parseInt(r[4]),parseInt(r[5])],n=0;n<a.length;n++)if(i=a[n],!(0<=i&&i<=255))return null;return t.parts.push(a[0]<<8|a[1]),t.parts.push(a[2]<<8|a[3]),{parts:t.parts,zoneId:t.zoneId}}return null},p.IPv6.subnetMaskFromPrefixLength=function(e){if(e=parseInt(e),e<0||e>128)throw Error(`ipaddr: invalid IPv6 prefix length`);let t=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],n=0,r=Math.floor(e/8);for(;n<r;)t[n]=255,n++;return r<16&&(t[r]=2**(e%8)-1<<8-e%8),new this(t)},p.fromByteArray=function(e){let t=e.length;if(t===4)return new p.IPv4(e);if(t===16)return new p.IPv6(e);throw Error(`ipaddr: the binary input is neither an IPv6 nor IPv4 address`)},p.isValid=function(e){return p.IPv6.isValid(e)||p.IPv4.isValid(e)},p.isValidCIDR=function(e){return p.IPv6.isValidCIDR(e)||p.IPv4.isValidCIDR(e)},p.parse=function(e){if(p.IPv6.isValid(e))return p.IPv6.parse(e);if(p.IPv4.isValid(e))return p.IPv4.parse(e);throw Error(`ipaddr: the address has neither IPv6 nor IPv4 format`)},p.parseCIDR=function(e){try{return p.IPv6.parseCIDR(e)}catch{try{return p.IPv4.parseCIDR(e)}catch{throw Error(`ipaddr: the address has neither IPv6 nor IPv4 CIDR format`)}}},p.process=function(e){let t=this.parse(e);return t.kind()===`ipv6`&&t.isIPv4MappedAddress()?t.toIPv4Address():t},p.subnetMatch=function(e,t,n){let r,i,a,o;for(i in n??=`unicast`,t)if(Object.prototype.hasOwnProperty.call(t,i)){for(a=t[i],a[0]&&!(a[0]instanceof Array)&&(a=[a]),r=0;r<a.length;r++)if(o=a[r],e.kind()===o[0].kind()&&e.match.apply(e,o))return i}return n},t!==void 0&&t.exports?t.exports=p:e.ipaddr=p})(e)}))(),H$(`link-preview.guarded-fetch`),H$(`link-preview.cache`),H$(`saved-themes`),B({enabled:L(),active:L(),git:B({state:H([`not-applicable`,`ready`,`missing`,`conflict`,`unavailable`]),ownership:H([`open-knowledge`,`existing`]).optional()}),applied:L().optional(),reason:H([`git-conflict`,`git-unavailable`,`config-write`]).optional()}),B({enabled:L()}).strict(),H$(`managed-rename`),Object.assign({"3g2":`video/3gpp2`,"3gp":`video/3gpp`,"3gpp":`video/3gpp`,"3mf":`model/3mf`,aac:`audio/aac`,ac:`application/pkix-attr-cert`,adp:`audio/adpcm`,adts:`audio/aac`,ai:`application/postscript`,aml:`application/automationml-aml+xml`,amlx:`application/automationml-amlx+zip`,amr:`audio/amr`,apng:`image/apng`,appcache:`text/cache-manifest`,appinstaller:`application/appinstaller`,appx:`application/appx`,appxbundle:`application/appxbundle`,asc:`application/pgp-keys`,atom:`application/atom+xml`,atomcat:`application/atomcat+xml`,atomdeleted:`application/atomdeleted+xml`,atomsvc:`application/atomsvc+xml`,au:`audio/basic`,avci:`image/avci`,avcs:`image/avcs`,avif:`image/avif`,aw:`application/applixware`,bdoc:`application/bdoc`,bin:`application/octet-stream`,bmp:`image/bmp`,bpk:`application/octet-stream`,btf:`image/prs.btif`,btif:`image/prs.btif`,buffer:`application/octet-stream`,ccxml:`application/ccxml+xml`,cdfx:`application/cdfx+xml`,cdmia:`application/cdmi-capability`,cdmic:`application/cdmi-container`,cdmid:`application/cdmi-domain`,cdmio:`application/cdmi-object`,cdmiq:`application/cdmi-queue`,cer:`application/pkix-cert`,cgm:`image/cgm`,cjs:`application/node`,class:`application/java-vm`,coffee:`text/coffeescript`,conf:`text/plain`,cpl:`application/cpl+xml`,cpt:`application/mac-compactpro`,crl:`application/pkix-crl`,css:`text/css`,csv:`text/csv`,cu:`application/cu-seeme`,cwl:`application/cwl`,cww:`application/prs.cww`,davmount:`application/davmount+xml`,dbk:`application/docbook+xml`,deb:`application/octet-stream`,def:`text/plain`,deploy:`application/octet-stream`,dib:`image/bmp`,"disposition-notification":`message/disposition-notification`,dist:`application/octet-stream`,distz:`application/octet-stream`,dll:`application/octet-stream`,dmg:`application/octet-stream`,dms:`application/octet-stream`,doc:`application/msword`,dot:`application/msword`,dpx:`image/dpx`,drle:`image/dicom-rle`,dsc:`text/prs.lines.tag`,dssc:`application/dssc+der`,dtd:`application/xml-dtd`,dump:`application/octet-stream`,dwd:`application/atsc-dwd+xml`,ear:`application/java-archive`,ecma:`application/ecmascript`,elc:`application/octet-stream`,emf:`image/emf`,eml:`message/rfc822`,emma:`application/emma+xml`,emotionml:`application/emotionml+xml`,eps:`application/postscript`,epub:`application/epub+zip`,exe:`application/octet-stream`,exi:`application/exi`,exp:`application/express`,exr:`image/aces`,ez:`application/andrew-inset`,fdf:`application/fdf`,fdt:`application/fdt+xml`,fits:`image/fits`,g3:`image/g3fax`,gbr:`application/rpki-ghostbusters`,geojson:`application/geo+json`,gif:`image/gif`,glb:`model/gltf-binary`,gltf:`model/gltf+json`,gml:`application/gml+xml`,gpx:`application/gpx+xml`,gram:`application/srgs`,grxml:`application/srgs+xml`,gxf:`application/gxf`,gz:`application/gzip`,h261:`video/h261`,h263:`video/h263`,h264:`video/h264`,heic:`image/heic`,heics:`image/heic-sequence`,heif:`image/heif`,heifs:`image/heif-sequence`,hej2:`image/hej2k`,held:`application/atsc-held+xml`,hjson:`application/hjson`,hlp:`application/winhlp`,hqx:`application/mac-binhex40`,hsj2:`image/hsj2`,htm:`text/html`,html:`text/html`,ics:`text/calendar`,ief:`image/ief`,ifb:`text/calendar`,iges:`model/iges`,igs:`model/iges`,img:`application/octet-stream`,in:`text/plain`,ini:`text/plain`,ink:`application/inkml+xml`,inkml:`application/inkml+xml`,ipfix:`application/ipfix`,iso:`application/octet-stream`,its:`application/its+xml`,jade:`text/jade`,jar:`application/java-archive`,jhc:`image/jphc`,jls:`image/jls`,jp2:`image/jp2`,jpe:`image/jpeg`,jpeg:`image/jpeg`,jpf:`image/jpx`,jpg:`image/jpeg`,jpg2:`image/jp2`,jpgm:`image/jpm`,jpgv:`video/jpeg`,jph:`image/jph`,jpm:`image/jpm`,jpx:`image/jpx`,js:`text/javascript`,json:`application/json`,json5:`application/json5`,jsonld:`application/ld+json`,jsonml:`application/jsonml+json`,jsx:`text/jsx`,jt:`model/jt`,jxl:`image/jxl`,jxr:`image/jxr`,jxra:`image/jxra`,jxrs:`image/jxrs`,jxs:`image/jxs`,jxsc:`image/jxsc`,jxsi:`image/jxsi`,jxss:`image/jxss`,kar:`audio/midi`,ktx:`image/ktx`,ktx2:`image/ktx2`,less:`text/less`,lgr:`application/lgr+xml`,list:`text/plain`,litcoffee:`text/coffeescript`,log:`text/plain`,lostxml:`application/lost+xml`,lrf:`application/octet-stream`,m1v:`video/mpeg`,m21:`application/mp21`,m2a:`audio/mpeg`,m2t:`video/mp2t`,m2ts:`video/mp2t`,m2v:`video/mpeg`,m3a:`audio/mpeg`,m4a:`audio/mp4`,m4p:`application/mp4`,m4s:`video/iso.segment`,ma:`application/mathematica`,mads:`application/mads+xml`,maei:`application/mmt-aei+xml`,man:`text/troff`,manifest:`text/cache-manifest`,map:`application/json`,mar:`application/octet-stream`,markdown:`text/markdown`,mathml:`application/mathml+xml`,mb:`application/mathematica`,mbox:`application/mbox`,md:`text/markdown`,mdx:`text/mdx`,me:`text/troff`,mesh:`model/mesh`,meta4:`application/metalink4+xml`,metalink:`application/metalink+xml`,mets:`application/mets+xml`,mft:`application/rpki-manifest`,mid:`audio/midi`,midi:`audio/midi`,mime:`message/rfc822`,mj2:`video/mj2`,mjp2:`video/mj2`,mjs:`text/javascript`,mml:`text/mathml`,mods:`application/mods+xml`,mov:`video/quicktime`,mp2:`audio/mpeg`,mp21:`application/mp21`,mp2a:`audio/mpeg`,mp3:`audio/mpeg`,mp4:`video/mp4`,mp4a:`audio/mp4`,mp4s:`application/mp4`,mp4v:`video/mp4`,mpd:`application/dash+xml`,mpe:`video/mpeg`,mpeg:`video/mpeg`,mpf:`application/media-policy-dataset+xml`,mpg:`video/mpeg`,mpg4:`video/mp4`,mpga:`audio/mpeg`,mpp:`application/dash-patch+xml`,mrc:`application/marc`,mrcx:`application/marcxml+xml`,ms:`text/troff`,mscml:`application/mediaservercontrol+xml`,msh:`model/mesh`,msi:`application/octet-stream`,msix:`application/msix`,msixbundle:`application/msixbundle`,msm:`application/octet-stream`,msp:`application/octet-stream`,mtl:`model/mtl`,mts:`video/mp2t`,musd:`application/mmt-usd+xml`,mxf:`application/mxf`,mxmf:`audio/mobile-xmf`,mxml:`application/xv+xml`,n3:`text/n3`,nb:`application/mathematica`,nq:`application/n-quads`,nt:`application/n-triples`,obj:`model/obj`,oda:`application/oda`,oga:`audio/ogg`,ogg:`audio/ogg`,ogv:`video/ogg`,ogx:`application/ogg`,omdoc:`application/omdoc+xml`,onepkg:`application/onenote`,onetmp:`application/onenote`,onetoc:`application/onenote`,onetoc2:`application/onenote`,opf:`application/oebps-package+xml`,opus:`audio/ogg`,otf:`font/otf`,owl:`application/rdf+xml`,oxps:`application/oxps`,p10:`application/pkcs10`,p7c:`application/pkcs7-mime`,p7m:`application/pkcs7-mime`,p7s:`application/pkcs7-signature`,p8:`application/pkcs8`,pdf:`application/pdf`,pfr:`application/font-tdpfr`,pgp:`application/pgp-encrypted`,pkg:`application/octet-stream`,pki:`application/pkixcmp`,pkipath:`application/pkix-pkipath`,pls:`application/pls+xml`,png:`image/png`,prc:`model/prc`,prf:`application/pics-rules`,provx:`application/provenance+xml`,ps:`application/postscript`,pskcxml:`application/pskc+xml`,pti:`image/prs.pti`,qt:`video/quicktime`,raml:`application/raml+yaml`,rapd:`application/route-apd+xml`,rdf:`application/rdf+xml`,relo:`application/p2p-overlay+xml`,rif:`application/reginfo+xml`,rl:`application/resource-lists+xml`,rld:`application/resource-lists-diff+xml`,rmi:`audio/midi`,rnc:`application/relax-ng-compact-syntax`,rng:`application/xml`,roa:`application/rpki-roa`,roff:`text/troff`,rq:`application/sparql-query`,rs:`application/rls-services+xml`,rsat:`application/atsc-rsat+xml`,rsd:`application/rsd+xml`,rsheet:`application/urc-ressheet+xml`,rss:`application/rss+xml`,rtf:`text/rtf`,rtx:`text/richtext`,rusd:`application/route-usd+xml`,s3m:`audio/s3m`,sbml:`application/sbml+xml`,scq:`application/scvp-cv-request`,scs:`application/scvp-cv-response`,sdp:`application/sdp`,senmlx:`application/senml+xml`,sensmlx:`application/sensml+xml`,ser:`application/java-serialized-object`,setpay:`application/set-payment-initiation`,setreg:`application/set-registration-initiation`,sgi:`image/sgi`,sgm:`text/sgml`,sgml:`text/sgml`,shex:`text/shex`,shf:`application/shf+xml`,shtml:`text/html`,sieve:`application/sieve`,sig:`application/pgp-signature`,sil:`audio/silk`,silo:`model/mesh`,siv:`application/sieve`,slim:`text/slim`,slm:`text/slim`,sls:`application/route-s-tsid+xml`,smi:`application/smil+xml`,smil:`application/smil+xml`,snd:`audio/basic`,so:`application/octet-stream`,spdx:`text/spdx`,spp:`application/scvp-vp-response`,spq:`application/scvp-vp-request`,spx:`audio/ogg`,sql:`application/sql`,sru:`application/sru+xml`,srx:`application/sparql-results+xml`,ssdl:`application/ssdl+xml`,ssml:`application/ssml+xml`,stk:`application/hyperstudio`,stl:`model/stl`,stpx:`model/step+xml`,stpxz:`model/step-xml+zip`,stpz:`model/step+zip`,styl:`text/stylus`,stylus:`text/stylus`,svg:`image/svg+xml`,svgz:`image/svg+xml`,swidtag:`application/swid+xml`,t:`text/troff`,t38:`image/t38`,td:`application/urc-targetdesc+xml`,tei:`application/tei+xml`,teicorpus:`application/tei+xml`,text:`text/plain`,tfi:`application/thraud+xml`,tfx:`image/tiff-fx`,tif:`image/tiff`,tiff:`image/tiff`,toml:`application/toml`,tr:`text/troff`,trig:`application/trig`,ts:`video/mp2t`,tsd:`application/timestamped-data`,tsv:`text/tab-separated-values`,ttc:`font/collection`,ttf:`font/ttf`,ttl:`text/turtle`,ttml:`application/ttml+xml`,txt:`text/plain`,u3d:`model/u3d`,u8dsn:`message/global-delivery-status`,u8hdr:`message/global-headers`,u8mdn:`message/global-disposition-notification`,u8msg:`message/global`,ubj:`application/ubjson`,uri:`text/uri-list`,uris:`text/uri-list`,urls:`text/uri-list`,vcard:`text/vcard`,vrml:`model/vrml`,vtt:`text/vtt`,vxml:`application/voicexml+xml`,war:`application/java-archive`,wasm:`application/wasm`,wav:`audio/wav`,weba:`audio/webm`,webm:`video/webm`,webmanifest:`application/manifest+json`,webp:`image/webp`,wgsl:`text/wgsl`,wgt:`application/widget`,wif:`application/watcherinfo+xml`,wmf:`image/wmf`,woff:`font/woff`,woff2:`font/woff2`,wrl:`model/vrml`,wsdl:`application/wsdl+xml`,wspolicy:`application/wspolicy+xml`,x3d:`model/x3d+xml`,x3db:`model/x3d+fastinfoset`,x3dbz:`model/x3d+binary`,x3dv:`model/x3d-vrml`,x3dvz:`model/x3d+vrml`,x3dz:`model/x3d+xml`,xaml:`application/xaml+xml`,xav:`application/xcap-att+xml`,xca:`application/xcap-caps+xml`,xcs:`application/calendar+xml`,xdf:`application/xcap-diff+xml`,xdssc:`application/dssc+xml`,xel:`application/xcap-el+xml`,xenc:`application/xenc+xml`,xer:`application/patch-ops-error+xml`,xfdf:`application/xfdf`,xht:`application/xhtml+xml`,xhtml:`application/xhtml+xml`,xhvml:`application/xv+xml`,xlf:`application/xliff+xml`,xm:`audio/xm`,xml:`text/xml`,xns:`application/xcap-ns+xml`,xop:`application/xop+xml`,xpl:`application/xproc+xml`,xsd:`application/xml`,xsf:`application/prs.xsf+xml`,xsl:`application/xml`,xslt:`application/xml`,xspf:`application/xspf+xml`,xvm:`application/xv+xml`,xvml:`application/xv+xml`,yaml:`text/yaml`,yang:`application/yang`,yin:`application/yin+xml`,yml:`text/yaml`,zip:`application/zip`},{m4v:`video/mp4`,mkv:`video/x-matroska`,flac:`audio/flac`,toml:`application/toml`,lock:`text/plain`,"7z":`application/x-7z-compressed`,tar:`application/x-tar`,rar:`application/vnd.rar`,xls:`application/vnd.ms-excel`,ppt:`application/vnd.ms-powerpoint`,odt:`application/vnd.oasis.opendocument.text`,ods:`application/vnd.oasis.opendocument.spreadsheet`,odp:`application/vnd.oasis.opendocument.presentation`,pages:`application/vnd.apple.pages`,numbers:`application/vnd.apple.numbers`,key:`application/vnd.apple.keynote`,mobi:`application/x-mobipocket-ebook`}),H$(`search`),H$(`skill-import`),H$(`skill-install`),H$(`history`),H$(`api`),B({principalId:F().optional(),tabSessionId:F().optional(),expectedServerInstanceId:F().optional(),expectedBranch:F().optional(),expectedDocLineageEpoch:F().optional(),clientProtocolVersion:I().optional(),clientRuntimeVersion:F().optional(),clientKind:F().optional()}).loose(),H$(`conflict-storage`);const W6=Fo(e=>e!==null&&(typeof e==`object`||typeof e==`function`)),G6=xo([F(),I().int()]),K6=F();yo({ttl:I().optional(),pollInterval:I().optional()});const lxe=B({ttl:I().optional()}),uxe=B({taskId:F()}),q6=yo({progressToken:G6.optional(),"io.modelcontextprotocol/related-task":uxe.optional()}),J6=B({_meta:q6.optional()}),Y6=J6.extend({task:lxe.optional()}),X6=B({method:F(),params:J6.loose().optional()}),Z6=B({_meta:q6.optional()}),Q6=B({method:F(),params:Z6.loose().optional()}),$6=yo({_meta:q6.optional()}),e8=xo([F(),I().int()]),dxe=B({jsonrpc:U(`2.0`),id:e8,...X6.shape}).strict(),fxe=B({jsonrpc:U(`2.0`),...Q6.shape}).strict(),t8=B({jsonrpc:U(`2.0`),id:e8,result:$6}).strict();var pxe;(function(e){e[e.ConnectionClosed=-32e3]=`ConnectionClosed`,e[e.RequestTimeout=-32001]=`RequestTimeout`,e[e.ParseError=-32700]=`ParseError`,e[e.InvalidRequest=-32600]=`InvalidRequest`,e[e.MethodNotFound=-32601]=`MethodNotFound`,e[e.InvalidParams=-32602]=`InvalidParams`,e[e.InternalError=-32603]=`InternalError`,e[e.UrlElicitationRequired=-32042]=`UrlElicitationRequired`})(pxe||={});const n8=B({jsonrpc:U(`2.0`),id:e8.optional(),error:B({code:I().int(),message:F(),data:R().optional()})}).strict();xo([dxe,fxe,t8,n8]),xo([t8,n8]);const r8=$6.strict(),mxe=Z6.extend({requestId:e8.optional(),reason:F().optional()}),i8=Q6.extend({method:U(`notifications/cancelled`),params:mxe}),a8=B({icons:z(B({src:F(),mimeType:F().optional(),sizes:z(F()).optional(),theme:H([`light`,`dark`]).optional()})).optional()}),o8=B({name:F(),title:F().optional()}),s8=o8.extend({...o8.shape,...a8.shape,version:F(),websiteUrl:F().optional(),description:F().optional()}),hxe=Io(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,Co(B({form:Co(B({applyDefaults:L().optional()}),V(F(),R())).optional(),url:W6.optional()}),V(F(),R()).optional())),gxe=yo({list:W6.optional(),cancel:W6.optional(),requests:yo({sampling:yo({createMessage:W6.optional()}).optional(),elicitation:yo({create:W6.optional()}).optional()}).optional()}),_xe=yo({list:W6.optional(),cancel:W6.optional(),requests:yo({tools:yo({call:W6.optional()}).optional()}).optional()}),vxe=B({experimental:V(F(),W6).optional(),sampling:B({context:W6.optional(),tools:W6.optional()}).optional(),elicitation:hxe.optional(),roots:B({listChanged:L().optional()}).optional(),tasks:gxe.optional(),extensions:V(F(),W6).optional()}),yxe=J6.extend({protocolVersion:F(),capabilities:vxe,clientInfo:s8}),bxe=X6.extend({method:U(`initialize`),params:yxe}),xxe=B({experimental:V(F(),W6).optional(),logging:W6.optional(),completions:W6.optional(),prompts:B({listChanged:L().optional()}).optional(),resources:B({subscribe:L().optional(),listChanged:L().optional()}).optional(),tools:B({listChanged:L().optional()}).optional(),tasks:_xe.optional(),extensions:V(F(),W6).optional()}),Sxe=$6.extend({protocolVersion:F(),capabilities:xxe,serverInfo:s8,instructions:F().optional()}),Cxe=Q6.extend({method:U(`notifications/initialized`),params:Z6.optional()}),c8=X6.extend({method:U(`ping`),params:J6.optional()}),wxe=B({progress:I(),total:Oo(I()),message:Oo(F())}),Txe=B({...Z6.shape,...wxe.shape,progressToken:G6}),l8=Q6.extend({method:U(`notifications/progress`),params:Txe}),Exe=J6.extend({cursor:K6.optional()}),u8=X6.extend({params:Exe.optional()}),d8=$6.extend({nextCursor:K6.optional()}),Dxe=H([`working`,`input_required`,`completed`,`failed`,`cancelled`]),f8=B({taskId:F(),status:Dxe,ttl:xo([I(),_o()]),createdAt:F(),lastUpdatedAt:F(),pollInterval:Oo(I()),statusMessage:Oo(F())}),p8=$6.extend({task:f8}),Oxe=Z6.merge(f8),m8=Q6.extend({method:U(`notifications/tasks/status`),params:Oxe}),h8=X6.extend({method:U(`tasks/get`),params:J6.extend({taskId:F()})}),g8=$6.merge(f8),_8=X6.extend({method:U(`tasks/result`),params:J6.extend({taskId:F()})});$6.loose();const v8=u8.extend({method:U(`tasks/list`)}),y8=d8.extend({tasks:z(f8)}),b8=X6.extend({method:U(`tasks/cancel`),params:J6.extend({taskId:F()})});$6.merge(f8);const x8=B({uri:F(),mimeType:Oo(F()),_meta:V(F(),R()).optional()}),S8=x8.extend({text:F()}),C8=F().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),w8=x8.extend({blob:C8}),T8=H([`user`,`assistant`]),E8=B({audience:z(T8).optional(),priority:I().min(0).max(1).optional(),lastModified:za({offset:!0}).optional()}),D8=B({...o8.shape,...a8.shape,uri:F(),description:Oo(F()),mimeType:Oo(F()),size:Oo(I()),annotations:E8.optional(),_meta:Oo(yo({}))}),kxe=B({...o8.shape,...a8.shape,uriTemplate:F(),description:Oo(F()),mimeType:Oo(F()),annotations:E8.optional(),_meta:Oo(yo({}))}),Axe=u8.extend({method:U(`resources/list`)}),jxe=d8.extend({resources:z(D8)}),Mxe=u8.extend({method:U(`resources/templates/list`)}),Nxe=d8.extend({resourceTemplates:z(kxe)}),O8=J6.extend({uri:F()}),Pxe=O8,Fxe=X6.extend({method:U(`resources/read`),params:Pxe}),Ixe=$6.extend({contents:z(xo([S8,w8]))}),Lxe=Q6.extend({method:U(`notifications/resources/list_changed`),params:Z6.optional()}),Rxe=O8,zxe=X6.extend({method:U(`resources/subscribe`),params:Rxe}),Bxe=O8,Vxe=X6.extend({method:U(`resources/unsubscribe`),params:Bxe}),Hxe=Z6.extend({uri:F()}),Uxe=Q6.extend({method:U(`notifications/resources/updated`),params:Hxe}),Wxe=B({name:F(),description:Oo(F()),required:Oo(L())}),Gxe=B({...o8.shape,...a8.shape,description:Oo(F()),arguments:Oo(z(Wxe)),_meta:Oo(yo({}))}),Kxe=u8.extend({method:U(`prompts/list`)}),qxe=d8.extend({prompts:z(Gxe)}),Jxe=J6.extend({name:F(),arguments:V(F(),F()).optional()}),Yxe=X6.extend({method:U(`prompts/get`),params:Jxe}),k8=B({type:U(`text`),text:F(),annotations:E8.optional(),_meta:V(F(),R()).optional()}),A8=B({type:U(`image`),data:C8,mimeType:F(),annotations:E8.optional(),_meta:V(F(),R()).optional()}),j8=B({type:U(`audio`),data:C8,mimeType:F(),annotations:E8.optional(),_meta:V(F(),R()).optional()}),Xxe=B({type:U(`tool_use`),name:F(),id:F(),input:V(F(),R()),_meta:V(F(),R()).optional()}),Zxe=B({type:U(`resource`),resource:xo([S8,w8]),annotations:E8.optional(),_meta:V(F(),R()).optional()}),M8=xo([k8,A8,j8,D8.extend({type:U(`resource_link`)}),Zxe]),Qxe=B({role:T8,content:M8}),$xe=$6.extend({description:F().optional(),messages:z(Qxe)}),eSe=Q6.extend({method:U(`notifications/prompts/list_changed`),params:Z6.optional()}),tSe=B({title:F().optional(),readOnlyHint:L().optional(),destructiveHint:L().optional(),idempotentHint:L().optional(),openWorldHint:L().optional()}),nSe=B({taskSupport:H([`required`,`optional`,`forbidden`]).optional()}),N8=B({...o8.shape,...a8.shape,description:F().optional(),inputSchema:B({type:U(`object`),properties:V(F(),W6).optional(),required:z(F()).optional()}).catchall(R()),outputSchema:B({type:U(`object`),properties:V(F(),W6).optional(),required:z(F()).optional()}).catchall(R()).optional(),annotations:tSe.optional(),execution:nSe.optional(),_meta:V(F(),R()).optional()}),rSe=u8.extend({method:U(`tools/list`)}),iSe=d8.extend({tools:z(N8)}),P8=$6.extend({content:z(M8).default([]),structuredContent:V(F(),R()).optional(),isError:L().optional()});P8.or($6.extend({toolResult:R()}));const aSe=Y6.extend({name:F(),arguments:V(F(),R()).optional()}),oSe=X6.extend({method:U(`tools/call`),params:aSe}),sSe=Q6.extend({method:U(`notifications/tools/list_changed`),params:Z6.optional()});B({autoRefresh:L().default(!0),debounceMs:I().int().nonnegative().default(300)});const F8=H([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),cSe=J6.extend({level:F8}),lSe=X6.extend({method:U(`logging/setLevel`),params:cSe}),uSe=Z6.extend({level:F8,logger:F().optional(),data:R()}),dSe=Q6.extend({method:U(`notifications/message`),params:uSe}),fSe=B({hints:z(B({name:F().optional()})).optional(),costPriority:I().min(0).max(1).optional(),speedPriority:I().min(0).max(1).optional(),intelligencePriority:I().min(0).max(1).optional()}),pSe=B({mode:H([`auto`,`required`,`none`]).optional()}),mSe=B({type:U(`tool_result`),toolUseId:F().describe(`The unique identifier for the corresponding tool call.`),content:z(M8).default([]),structuredContent:B({}).loose().optional(),isError:L().optional(),_meta:V(F(),R()).optional()}),hSe=So(`type`,[k8,A8,j8]),I8=So(`type`,[k8,A8,j8,Xxe,mSe]),gSe=B({role:T8,content:xo([I8,z(I8)]),_meta:V(F(),R()).optional()}),_Se=Y6.extend({messages:z(gSe),modelPreferences:fSe.optional(),systemPrompt:F().optional(),includeContext:H([`none`,`thisServer`,`allServers`]).optional(),temperature:I().optional(),maxTokens:I().int(),stopSequences:z(F()).optional(),metadata:W6.optional(),tools:z(N8).optional(),toolChoice:pSe.optional()}),vSe=X6.extend({method:U(`sampling/createMessage`),params:_Se}),ySe=$6.extend({model:F(),stopReason:Oo(H([`endTurn`,`stopSequence`,`maxTokens`]).or(F())),role:T8,content:hSe}),bSe=$6.extend({model:F(),stopReason:Oo(H([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(F())),role:T8,content:xo([I8,z(I8)])}),xSe=B({type:U(`boolean`),title:F().optional(),description:F().optional(),default:L().optional()}),SSe=B({type:U(`string`),title:F().optional(),description:F().optional(),minLength:I().optional(),maxLength:I().optional(),format:H([`email`,`uri`,`date`,`date-time`]).optional(),default:F().optional()}),CSe=B({type:H([`number`,`integer`]),title:F().optional(),description:F().optional(),minimum:I().optional(),maximum:I().optional(),default:I().optional()}),wSe=B({type:U(`string`),title:F().optional(),description:F().optional(),enum:z(F()),default:F().optional()}),TSe=B({type:U(`string`),title:F().optional(),description:F().optional(),oneOf:z(B({const:F(),title:F()})),default:F().optional()}),ESe=xo([xo([B({type:U(`string`),title:F().optional(),description:F().optional(),enum:z(F()),enumNames:z(F()).optional(),default:F().optional()}),xo([wSe,TSe]),xo([B({type:U(`array`),title:F().optional(),description:F().optional(),minItems:I().optional(),maxItems:I().optional(),items:B({type:U(`string`),enum:z(F())}),default:z(F()).optional()}),B({type:U(`array`),title:F().optional(),description:F().optional(),minItems:I().optional(),maxItems:I().optional(),items:B({anyOf:z(B({const:F(),title:F()}))}),default:z(F()).optional()})])]),xSe,SSe,CSe]),DSe=xo([Y6.extend({mode:U(`form`).optional(),message:F(),requestedSchema:B({type:U(`object`),properties:V(F(),ESe),required:z(F()).optional()})}),Y6.extend({mode:U(`url`),message:F(),elicitationId:F(),url:F().url()})]),OSe=X6.extend({method:U(`elicitation/create`),params:DSe}),kSe=Z6.extend({elicitationId:F()}),ASe=Q6.extend({method:U(`notifications/elicitation/complete`),params:kSe}),jSe=$6.extend({action:H([`accept`,`decline`,`cancel`]),content:Io(e=>e===null?void 0:e,V(F(),xo([F(),I(),L(),z(F())])).optional())}),MSe=B({type:U(`ref/resource`),uri:F()}),NSe=B({type:U(`ref/prompt`),name:F()}),PSe=J6.extend({ref:xo([NSe,MSe]),argument:B({name:F(),value:F()}),context:B({arguments:V(F(),F()).optional()}).optional()}),FSe=X6.extend({method:U(`completion/complete`),params:PSe}),ISe=$6.extend({completion:yo({values:z(F()).max(100),total:Oo(I().int()),hasMore:Oo(L())})}),LSe=B({uri:F().startsWith(`file://`),name:F().optional(),_meta:V(F(),R()).optional()}),RSe=X6.extend({method:U(`roots/list`),params:J6.optional()}),zSe=$6.extend({roots:z(LSe)}),BSe=Q6.extend({method:U(`notifications/roots/list_changed`),params:Z6.optional()});xo([c8,bxe,FSe,lSe,Yxe,Kxe,Axe,Mxe,Fxe,zxe,Vxe,oSe,rSe,h8,_8,v8,b8]),xo([i8,l8,Cxe,BSe,m8]),xo([r8,ySe,bSe,jSe,zSe,g8,y8,p8]),xo([c8,vSe,OSe,RSe,h8,_8,v8,b8]),xo([i8,l8,dSe,Uxe,Lxe,sSe,eSe,m8,ASe]),xo([r8,Sxe,ISe,$xe,qxe,jxe,Nxe,Ixe,P8,iSe,g8,y8,p8]);var VSe;(function(e){e.Completable=`McpCompletable`})(VSe||={});var HSe=global.Request,L8=class extends HSe{constructor(e,t){typeof e==`object`&&R8 in e&&(e=e[R8]()),t?.body?.getReader!==void 0&&(t.duplex??=`half`),super(e,t)}},USe=e=>{let t=[],n=e.rawHeaders;for(let e=0;e<n.length;e+=2){let{[e]:r,[e+1]:i}=n;r.charCodeAt(0)!==58&&t.push([r,i])}return new Headers(t)},WSe=Symbol(`wrapBodyStream`),GSe=(e,t,n,r,i)=>{let a={method:e,headers:n,signal:i.signal};if(e===`TRACE`){a.method=`GET`;let e=new L8(t,a);return Object.defineProperty(e,`method`,{get(){return`TRACE`}}),e}if(!(e===`GET`||e===`HEAD`))if(`rawBody`in r&&r.rawBody instanceof Buffer)a.body=new ReadableStream({start(e){e.enqueue(r.rawBody),e.close()}});else if(r[WSe]){let e;a.body=new ReadableStream({async pull(t){try{e||=Ne.toWeb(r).getReader();let{done:n,value:i}=await e.read();n?t.close():t.enqueue(i)}catch(e){t.error(e)}}})}else a.body=Ne.toWeb(r);return new L8(t,a)},R8=Symbol(`getRequestCache`),z8=Symbol(`requestCache`),B8=Symbol(`incomingKey`),V8=Symbol(`urlKey`),KSe=Symbol(`headersKey`),H8=Symbol(`abortControllerKey`),U8={get method(){return this[B8].method||`GET`},get url(){return this[V8]},get headers(){return this[KSe]||=USe(this[B8])},[Symbol(`getAbortController`)](){return this[R8](),this[H8]},[R8](){return this[H8]||=new AbortController,this[z8]||=GSe(this.method,this[V8],this.headers,this[B8],this[H8])}};[`body`,`bodyUsed`,`cache`,`credentials`,`destination`,`integrity`,`mode`,`redirect`,`referrer`,`referrerPolicy`,`signal`,`keepalive`].forEach(e=>{Object.defineProperty(U8,e,{get(){return this[R8]()[e]}})}),[`arrayBuffer`,`blob`,`clone`,`formData`,`json`,`text`].forEach(e=>{Object.defineProperty(U8,e,{value:function(){return this[R8]()[e]()}})}),Object.defineProperty(U8,Symbol.for(`nodejs.util.inspect.custom`),{value:function(e,t,n){return`Request (lightweight) ${n({method:this.method,url:this.url,headers:this.headers,nativeRequest:this[z8]},{...t,depth:e==null?null:e-1})}`}}),Object.setPrototypeOf(U8,L8.prototype);var W8=Symbol(`responseCache`),G8=Symbol(`getResponseCache`),K8=Symbol(`cache`),q8=global.Response,J8=class e{#e;#t;[G8](){return delete this[K8],this[W8]||=new q8(this.#e,this.#t)}constructor(t,n){let r;if(this.#e=t,n instanceof e){let e=n[W8];if(e){this.#t=e,this[G8]();return}else this.#t=n.#t,r=new Headers(n.#t.headers)}else this.#t=n;(typeof t==`string`||t?.getReader!==void 0||t instanceof Blob||t instanceof Uint8Array)&&(this[K8]=[n?.status||200,t,r||n?.headers])}get headers(){let e=this[K8];return e?(e[2]instanceof Headers||(e[2]=new Headers(e[2]||{"content-type":`text/plain; charset=UTF-8`})),e[2]):this[G8]().headers}get status(){return this[K8]?.[0]??this[G8]().status}get ok(){let e=this.status;return e>=200&&e<300}};[`body`,`bodyUsed`,`redirected`,`statusText`,`trailers`,`type`,`url`].forEach(e=>{Object.defineProperty(J8.prototype,e,{get(){return this[G8]()[e]}})}),[`arrayBuffer`,`blob`,`clone`,`formData`,`json`,`text`].forEach(e=>{Object.defineProperty(J8.prototype,e,{value:function(){return this[G8]()[e]()}})}),Object.defineProperty(J8.prototype,Symbol.for(`nodejs.util.inspect.custom`),{value:function(e,t,n){return`Response (lightweight) ${n({status:this.status,headers:this.headers,ok:this.ok,nativeResponse:this[W8]},{...t,depth:e==null?null:e-1})}`}}),Object.setPrototypeOf(J8,q8),Object.setPrototypeOf(J8.prototype,q8.prototype),global.crypto===void 0&&(global.crypto=Me),new Le,U$(()=>{}),[`[Requires: Hocuspocus server] Unified validation audit: every content problem — markdown-lint violations AND broken internal links — in one read-only call, grouped by the file to fix.`,``,"- No args → audit every in-scope `.md`/`.mdx` doc; pass `path` to scope to a folder or a single file.","- The result reports `ran`, the source families selected for this run. Project audit can report `markdownlint`, `frontmatter`, `okf`, and `links`. A family absent from `ran` was not checked. `okf` covers both document and project-tree OKF checks here.","- A selected family stays in `ran` if it degrades, with the reason in `warnings`. A partial degradation may still have contributed findings.","- To CHECK whether links resolve, use this tool: each broken link is reported under the SOURCE doc that contains it, at the offending line. (The `links` tool is the navigation/graph reader — backlinks, forward links, orphans, hubs — not the validation surface.)",``,"Each diagnostic carries a `source` naming the validator ('markdownlint' rule violations; 'links' broken internal links), a `code` (e.g. MD010, dead-link), `message`, a 0-based LSP `range` (for links: line exact, column approximate), and `severity` ('error' | 'warning' — broken links default to warnings; the project's `validation.links` setting can raise them to errors or hide them). Only files with at least one problem are listed, plus `fileCount`/`errorCount`/`warningCount` totals. Output (text and structured) is capped at 10 files × 10 diagnostics per file and project-wide at 10 warnings, with explicit '… and N more' indicators and `omittedWarningCount` when warnings are dropped; the counts always reflect the full scan — re-run with `path` scoped to a folder or file to see what was omitted.",``,"Read-only: nothing is modified. Auto-fix fixable lint findings with `lint({ document, fix: true })`; broken links need content edits via `edit`/`write`."].join(`
460
460
  `),[`[Requires: Hocuspocus server] Save a project-wide checkpoint of every document — a single restore point you can return to.`,``,`**Parameters:**`,'- `summary` — Optional one-line label for the checkpoint (≤80 chars). Defaults to "Checkpoint version". Appears as the checkpoint subject in `history`. Avoid secrets or PII — persisted to git history.',``,"Returns `{ version }` — the 40-char checkpoint SHA. Find checkpoints later via `history`; restore a single doc with `restore_version({ document, version })`."].join(`
461
461
  `),[`[Operates on disk; no running OK server required] Read the effective merged OpenKnowledge config (defaults → user → project).`,``,`Use this when you need to inspect the config mid-session — e.g., after a write that may have changed disk state, or to re-confirm the value of a field before reading it again.`,``,"Read returns the FULL merged config or a sub-tree when `key` is provided. There is no allowlist on reads — every field is readable.",``,"Note: the `server.*`, `mcp.*`, and `github.*` config sub-trees, plus `preview.baseUrl` and `preview.scriptSrc`, were removed; their values are now built-in constants in `@inkeep/open-knowledge-core` (or, for the preview iframe, a fixed open network policy). Reading those keys returns `exists: false`. (`appearance.preview.autoOpen` is still a live key.)",``,"This tool is a pure READ. Folder-level skill topology (link / unlink / add-root) moved to the `install` tool's `skillFolders` argument, so this one keeps its read-only annotation and stays auto-approvable.",``,`**Parameters:**`,'- `key` (optional) — Dotted config key. `"content"` returns the content sub-tree; `"appearance.theme"` returns just that leaf. Omit for full config.',"- `cwd` (optional) — Project root (see `cwd` description below)."].join(`
462
462
  `),F().optional().describe(`Dotted config key (e.g. "appearance.theme"). Omit to return the full merged config.`),F().optional().describe(d6),f6({value:R().describe(`Resolved config value at the requested path (or full config).`),exists:L().optional().describe('Whether the requested path resolved to a value. `false` distinguishes "path absent" from "path explicitly set to null". Always emitted — `true` on a full-config read.'),key:F().optional().describe(`Echo of the requested dotted key (absent when reading the full config).`)}),["[Requires: Hocuspocus server] Read GitHub-sync merge conflicts. Dispatches on `kind`:",``,'- `kind: "list"` — enumerate every doc currently tracked in a merge-conflict state. Returns `{ list: [{ file, detectedAt, ... }] }` (empty when none). The entry point to the resolve flow.','- `kind: "content"` — fetch the three merge stages for one `file`. Returns `{ content: { file, base, ours, theirs, shape, lifecycleStatus } }`. `ours` reflects the live Y.Text (what the human sees) when the doc is loaded server-side.',``,`**Parameters:**`,"- `kind` — `list` | `content`.",'- `file` — Required for `kind: "content"`. Relative path WITH the `.md`/`.mdx` extension (e.g. `notes/sso.md`) — git stages key on the exact path, so do NOT strip the extension.',``,"The `shape` field discriminates the conflict: `both-modified` (both sides edited), `delete-modify` (you deleted, they edited — `ours` empty), or `modify-delete` (you edited, they deleted — `theirs` empty). Use it to pick the `resolve_conflict` strategy."].join(`
@@ -1139,7 +1139,7 @@ let p7=/^[a-z0-9-_]+$/i;function m7(e){let t=typeof e;if(t===`object`){if(Array.
1139
1139
  `)+_7(e,t[c],e,r-1,i)}else a+=s,a+=` = `,a+=g7(t[c],e,r,i),a+=`
1140
1140
  `}}return e&&(a||!o)&&(a=a?`[${e}]\n${a}`:`[${e}]`),a&&o?`${a}\n${o}`:a||o}function cwe(e,{maxDepth:t=1e3,numbersAsFloat:n=!1}={}){if(m7(e)!==`object`)throw TypeError(`stringify can only be called with an object`);let r=_7(0,e,``,t,n);return r[r.length-1]===`
1141
1141
  `?r:r+`
1142
- `}function lwe(e){let{projectDir:t,contentDir:n,sampleCap:r=5}=e,i=[],a=[];try{_(n)}catch(e){return{totalCount:0,sample:[],contentDir:n,warnings:[`cannot access content directory ${n}: ${e instanceof Error?e.message:String(e)}`]}}let o;try{o=vbe({projectDir:t,contentDir:n})}catch(e){return{totalCount:0,sample:[],contentDir:n,warnings:[e instanceof Error?e.message:String(e)]}}function s(e){let t;try{t=C(e,{withFileTypes:!0})}catch(t){let r=t instanceof Error?t.message:String(t);i.push(`could not read directory ${_e(n,e)||`.`}: ${r}`);return}for(let r of t){let t=N(e,r.name);if(r.isSymbolicLink()){let e;try{e=T(t)}catch(e){let r=e.code;r===`ENOENT`||r===`ELOOP`?i.push(`broken or cyclic symlink: ${_e(n,t)}`):i.push(`cannot resolve symlink ${_e(n,t)}: ${r??`unknown error`}`);continue}let r;try{r=O(e)}catch{continue}if(r.isDirectory()){let e=_e(n,t);if(o.isDirExcluded(e))continue;s(t)}else if(r.isFile()){let e=_e(n,t);if(o.isExcluded(e))continue;a.push(e)}}else if(r.isDirectory()){let e=_e(n,t);if(o.isDirExcluded(e))continue;s(t)}else if(r.isFile()){let e=_e(n,t);if(o.isExcluded(e))continue;a.push(e)}}}return s(n),{totalCount:a.length,sample:a.slice(0,r),contentDir:n,warnings:i}}const uwe=`${R5}-dev`;function dwe(e){return e.startsWith(R5)}function v7(e){if(typeof e!=`object`||!e)return!1;let t=e;if(t.command!==`ok-pi-managed-extension`||!Array.isArray(t.args))return!1;let n=t.args[0];return typeof n==`string`&&dwe(n)}function fwe(e){return{command:`ok-pi-managed-extension`,args:[e]}}function y7(e={}){let t=e.mode===`dev`?uwe:z5,n={unix:H5({...e,platformName:`darwin`}),win32:H5({...e,platformName:`win32`})};return`${t}
1142
+ `}function lwe(e){let{projectDir:t,contentDir:n,sampleCap:r=5}=e,i=[],a=[];try{_(n)}catch(e){return{totalCount:0,sample:[],contentDir:n,warnings:[`cannot access content directory ${n}: ${e instanceof Error?e.message:String(e)}`]}}let o;try{o=_be({projectDir:t,contentDir:n})}catch(e){return{totalCount:0,sample:[],contentDir:n,warnings:[e instanceof Error?e.message:String(e)]}}function s(e){let t;try{t=C(e,{withFileTypes:!0})}catch(t){let r=t instanceof Error?t.message:String(t);i.push(`could not read directory ${_e(n,e)||`.`}: ${r}`);return}for(let r of t){let t=N(e,r.name);if(r.isSymbolicLink()){let e;try{e=T(t)}catch(e){let r=e.code;r===`ENOENT`||r===`ELOOP`?i.push(`broken or cyclic symlink: ${_e(n,t)}`):i.push(`cannot resolve symlink ${_e(n,t)}: ${r??`unknown error`}`);continue}let r;try{r=O(e)}catch{continue}if(r.isDirectory()){let e=_e(n,t);if(o.isDirExcluded(e))continue;s(t)}else if(r.isFile()){let e=_e(n,t);if(o.isExcluded(e))continue;a.push(e)}}else if(r.isDirectory()){let e=_e(n,t);if(o.isDirExcluded(e))continue;s(t)}else if(r.isFile()){let e=_e(n,t);if(o.isExcluded(e))continue;a.push(e)}}}return s(n),{totalCount:a.length,sample:a.slice(0,r),contentDir:n,warnings:i}}const uwe=`${R5}-dev`;function dwe(e){return e.startsWith(R5)}function v7(e){if(typeof e!=`object`||!e)return!1;let t=e;if(t.command!==`ok-pi-managed-extension`||!Array.isArray(t.args))return!1;let n=t.args[0];return typeof n==`string`&&dwe(n)}function fwe(e){return{command:`ok-pi-managed-extension`,args:[e]}}function y7(e={}){let t=e.mode===`dev`?uwe:z5,n={unix:H5({...e,platformName:`darwin`}),win32:H5({...e,platformName:`win32`})};return`${t}
1143
1143
  /**
1144
1144
  * Open Knowledge bridge for Pi — MANAGED FILE, written by \`ok init\`.
1145
1145
  * Hand edits are overwritten whenever OK re-syncs this project; remove it
@@ -1482,7 +1482,7 @@ export default function okBridge(pi: {
1482
1482
  }
1483
1483
  });
1484
1484
  }
1485
- `}function pwe(e,t){let n=_e(U6(t),U6(e));return n.length>0&&!n.startsWith(`..`)&&!M(n)}const mwe=e=>{try{let t=c(`git`,[`rev-parse`,`--show-toplevel`],l3({cwd:e,encoding:`utf8`,stdio:[`ignore`,`pipe`,`ignore`]})).trim();return t.length>0?t:null}catch{return null}};function hwe(e,t={}){let n=t.homeDir??oe(),r=t.gitTopLevel??mwe,i=ve(e),a;try{a=T(i)}catch{a=i}let o=a,s=0;for(;s<30&&!(o===n||o===`/`||o===``);){if(b3(o))return{projectRoot:o,defaultContentDir:`.`,ancestorPromoted:o!==a,gitRootPromoted:!1};let e=pe(o);if(e===o)break;o=e,s+=1}let c=r(a);return c!==null&&pwe(c,n)?c===a?{projectRoot:i,defaultContentDir:`.`,ancestorPromoted:!1,gitRootPromoted:!1}:{projectRoot:c,defaultContentDir:`.`,ancestorPromoted:!1,gitRootPromoted:!0}:{projectRoot:i,defaultContentDir:`.`,ancestorPromoted:!1,gitRootPromoted:!1}}function b7(e,t){let n;try{n=_(e)}catch(e){if(e.code!==`ENOENT`)throw e}if(n?.isSymbolicLink())throw Error(`Refusing to write through a symbolic link at ${e}. Remove the symlink and re-run project setup.`);x7(e,t)}function gwe(e,t){x7(e,t)}function x7(e,t){let n;try{n=T(t)}catch{n=ve(t)}let r=pe(e);for(;r.length>1&&r!==ye;){let t;try{t=T(r)}catch(e){if(e.code===`ENOENT`){r=pe(r);continue}throw e}let i=_e(n,t);if(i===``||!i.startsWith(`..`)&&!M(i))return;throw Error(`Refusing to write at ${e}: ancestor ${r} resolves to ${t}, which is outside the project directory ${n}. A symbolic link in the path likely escapes the project. Remove the symlink and re-run project setup.`)}}function S7(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function _we(e,t,n){try{if(O(n).size>10485760)return!1}catch{return!1}let r;try{r=S(n,`utf-8`)}catch{return!1}let i=[],a=Abe(r.charCodeAt(0)===65279?r.slice(1):r,i,{allowTrailingComma:!0,disallowComments:!1});if(i.length>0||!S7(a))return!1;let o=a[e.topLevelKey];if(!S7(o))return!1;let s=e.serverMapSubKey?o[e.serverMapSubKey]:o;return S7(s)?S7(s[e.serverName(t)]):!1}function vwe(e,t,n={}){if(!Eu.includes(e.id))return!0;try{return _we(e,t,e.configPath(t,n.home))}catch{return!1}}function C7(e,t,n={}){let r=e.projectSkillPath?.(t);if(!r)return{editorId:e.id,label:e.label,action:`skipped-unsupported`,path:``};if(!vwe(e,t,n))return{editorId:e.id,label:e.label,action:`skipped-prerequisite`,path:r};try{let n=Uye(`project`,{checkDesktop:!0}),i=pe(r);b7(i,t);let a=g(r)?`overwritten`:`written`;return D(i,{recursive:!0,force:!0}),v(pe(i),{recursive:!0}),m(n,i,{recursive:!0}),{editorId:e.id,label:e.label,action:a,path:r}}catch(t){return{editorId:e.id,label:e.label,action:`failed`,path:r,error:t instanceof Error?t.message:String(t)}}}function ywe(e,t){let n=e.projectSkillPath?.(t);if(!n)return{editorId:e.id,label:e.label,action:`skipped-unsupported`,path:``};try{let r=pe(n);return g(n)?(gwe(r,t),D(r,{recursive:!0,force:!0}),{editorId:e.id,label:e.label,action:`removed`,path:n}):{editorId:e.id,label:e.label,action:`not-present`,path:n}}catch(t){return{editorId:e.id,label:e.label,action:`failed`,path:n,error:t instanceof Error?t.message:String(t)}}}function w7(e){let t=e&&typeof e==`object`&&`code`in e?e.code:void 0;return t===`MODULE_NOT_FOUND`||t===`ERR_MODULE_NOT_FOUND`}function T7(e,t){if(!process.env.OK_DEBUG_NATIVE)return;let n=t instanceof Error?t.message:String(t);process.stderr.write(`[ok] native-config ${e}: ${n}\n`)}const bwe=[`native`,`index.js`];function E7(e={}){let t=e.moduleUrl??import.meta.url,n=e.requireModule??o(t);try{return n(N(pe(Se(t)),...bwe))}catch(e){w7(e)||T7(`bundled loader failed to load`,e)}try{return n(`@inkeep/open-knowledge-native-config`)}catch(e){return w7(e)||T7(`workspace addon failed to load`,e),null}}function xwe(){let e=E7();return e&&typeof e.resolveSymlinkWritePath==`function`?e:null}function Swe(e){let t=e,n=new Set;for(;;){let r;try{r=_(t).isSymbolicLink()}catch(n){return n.code===`ENOENT`?{readPath:t,writePath:t}:{readPath:null,writePath:e}}if(!r)return{readPath:t,writePath:t};if(n.has(t))return{readPath:null,writePath:e};n.add(t);let i;try{i=w(t)}catch(t){return T7(`readlinkSync threw during symlink walk`,t),{readPath:null,writePath:e}}t=M(i)?i:N(pe(t),i)}}let D7;function Cwe(){return D7===void 0&&(D7=xwe()),D7}function wwe(e,t=Cwe){let n=t();if(n)try{let t=n.resolveSymlinkWritePath(e);return{readPath:t.readPath??null,writePath:t.writePath}}catch(e){T7(`resolveSymlinkWritePath threw`,e)}return Swe(e)}function O7(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Twe(){let e=E7();return e&&typeof e.parseTomlToJson==`function`?e:null}function Ewe(e){try{let t=e.parseTomlToJson(`probe = 1`);return typeof t==`string`&&t.includes(`probe`)}catch(e){return T7(`addon loaded but probe failed`,e),!1}}function k7(e){if(!O7(e))throw Error(`TOML root is not a table`);return e}function Dwe(e){return{backend:`native`,parseToObject(t){return k7(JSON.parse(e.parseTomlToJson(t)))},upsertEntry(t,n,r){let i=e.upsertMcpServer(t,n,JSON.stringify(r));return{text:i.text,existed:i.existed}},removeEntry(t,n){let r=e.removeMcpServer(t,n);return{text:r.text,existed:r.existed}}}}function Owe(){return{backend:`fallback`,parseToObject(e){return k7(rwe(e))}}}function kwe(e=Twe){let t=e();return t&&Ewe(t)?Dwe(t):Owe()}let A7=null;function j7(){return A7===null&&(A7=kwe()),A7}function Awe(){let e=j7();return e.backend===`native`?e:void 0}const M7=`**/.ok/*`,N7=`!**/${hu}/`;function P7(e){let t=[`.ok/`,`.okignore`];for(let n of M5){let r=e7[n];r.projectConfigPath&&t.push(Fwe(r.projectConfigPath(e),e))}return t.push(`.claude/launch.json`),Array.from(new Set(t))}function F7(e){let t=N(e,...Yse);if(!g(t))return[];try{let e=$se(S(t,`utf-8`));if(!e)return[];let n=[];for(let[t,r]of Object.entries(e.skills))if(t!==`open-knowledge`)for(let e of r.hosts){let r=yu[e];r&&n.push(`${r}/${t}/`)}return Array.from(new Set(n))}catch{return[]}}function jwe(e,t){let n=I7(e,t).tracked;if(n.length>0)return{kind:`refused-tracked`,tracked:n,remediation:L7(n)};let r=R7(e);if(r.kind!==`ok`)return r.result;let i=g(r.path)?S(r.path,`utf-8`):``,a=new Set(F7(e)),o=[],s=a.size===0?i:i.split(`
1485
+ `}function pwe(e,t){let n=_e(U6(t),U6(e));return n.length>0&&!n.startsWith(`..`)&&!M(n)}const mwe=e=>{try{let t=c(`git`,[`rev-parse`,`--show-toplevel`],l3({cwd:e,encoding:`utf8`,stdio:[`ignore`,`pipe`,`ignore`]})).trim();return t.length>0?t:null}catch{return null}};function hwe(e,t={}){let n=t.homeDir??oe(),r=t.gitTopLevel??mwe,i=ve(e),a;try{a=T(i)}catch{a=i}let o=a,s=0;for(;s<30&&!(o===n||o===`/`||o===``);){if(b3(o))return{projectRoot:o,defaultContentDir:`.`,ancestorPromoted:o!==a,gitRootPromoted:!1};let e=pe(o);if(e===o)break;o=e,s+=1}let c=r(a);return c!==null&&pwe(c,n)?c===a?{projectRoot:i,defaultContentDir:`.`,ancestorPromoted:!1,gitRootPromoted:!1}:{projectRoot:c,defaultContentDir:`.`,ancestorPromoted:!1,gitRootPromoted:!0}:{projectRoot:i,defaultContentDir:`.`,ancestorPromoted:!1,gitRootPromoted:!1}}function b7(e,t){let n;try{n=_(e)}catch(e){if(e.code!==`ENOENT`)throw e}if(n?.isSymbolicLink())throw Error(`Refusing to write through a symbolic link at ${e}. Remove the symlink and re-run project setup.`);x7(e,t)}function gwe(e,t){x7(e,t)}function x7(e,t){let n;try{n=T(t)}catch{n=ve(t)}let r=pe(e);for(;r.length>1&&r!==ye;){let t;try{t=T(r)}catch(e){if(e.code===`ENOENT`){r=pe(r);continue}throw e}let i=_e(n,t);if(i===``||!i.startsWith(`..`)&&!M(i))return;throw Error(`Refusing to write at ${e}: ancestor ${r} resolves to ${t}, which is outside the project directory ${n}. A symbolic link in the path likely escapes the project. Remove the symlink and re-run project setup.`)}}function S7(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function _we(e,t,n){try{if(O(n).size>10485760)return!1}catch{return!1}let r;try{r=S(n,`utf-8`)}catch{return!1}let i=[],a=kbe(r.charCodeAt(0)===65279?r.slice(1):r,i,{allowTrailingComma:!0,disallowComments:!1});if(i.length>0||!S7(a))return!1;let o=a[e.topLevelKey];if(!S7(o))return!1;let s=e.serverMapSubKey?o[e.serverMapSubKey]:o;return S7(s)?S7(s[e.serverName(t)]):!1}function vwe(e,t,n={}){if(!Eu.includes(e.id))return!0;try{return _we(e,t,e.configPath(t,n.home))}catch{return!1}}function C7(e,t,n={}){let r=e.projectSkillPath?.(t);if(!r)return{editorId:e.id,label:e.label,action:`skipped-unsupported`,path:``};if(!vwe(e,t,n))return{editorId:e.id,label:e.label,action:`skipped-prerequisite`,path:r};try{let n=Uye(`project`,{checkDesktop:!0}),i=pe(r);b7(i,t);let a=g(r)?`overwritten`:`written`;return D(i,{recursive:!0,force:!0}),v(pe(i),{recursive:!0}),m(n,i,{recursive:!0}),{editorId:e.id,label:e.label,action:a,path:r}}catch(t){return{editorId:e.id,label:e.label,action:`failed`,path:r,error:t instanceof Error?t.message:String(t)}}}function ywe(e,t){let n=e.projectSkillPath?.(t);if(!n)return{editorId:e.id,label:e.label,action:`skipped-unsupported`,path:``};try{let r=pe(n);return g(n)?(gwe(r,t),D(r,{recursive:!0,force:!0}),{editorId:e.id,label:e.label,action:`removed`,path:n}):{editorId:e.id,label:e.label,action:`not-present`,path:n}}catch(t){return{editorId:e.id,label:e.label,action:`failed`,path:n,error:t instanceof Error?t.message:String(t)}}}function w7(e){let t=e&&typeof e==`object`&&`code`in e?e.code:void 0;return t===`MODULE_NOT_FOUND`||t===`ERR_MODULE_NOT_FOUND`}function T7(e,t){if(!process.env.OK_DEBUG_NATIVE)return;let n=t instanceof Error?t.message:String(t);process.stderr.write(`[ok] native-config ${e}: ${n}\n`)}const bwe=[`native`,`index.js`];function E7(e={}){let t=e.moduleUrl??import.meta.url,n=e.requireModule??o(t);try{return n(N(pe(Se(t)),...bwe))}catch(e){w7(e)||T7(`bundled loader failed to load`,e)}try{return n(`@inkeep/open-knowledge-native-config`)}catch(e){return w7(e)||T7(`workspace addon failed to load`,e),null}}function xwe(){let e=E7();return e&&typeof e.resolveSymlinkWritePath==`function`?e:null}function Swe(e){let t=e,n=new Set;for(;;){let r;try{r=_(t).isSymbolicLink()}catch(n){return n.code===`ENOENT`?{readPath:t,writePath:t}:{readPath:null,writePath:e}}if(!r)return{readPath:t,writePath:t};if(n.has(t))return{readPath:null,writePath:e};n.add(t);let i;try{i=w(t)}catch(t){return T7(`readlinkSync threw during symlink walk`,t),{readPath:null,writePath:e}}t=M(i)?i:N(pe(t),i)}}let D7;function Cwe(){return D7===void 0&&(D7=xwe()),D7}function wwe(e,t=Cwe){let n=t();if(n)try{let t=n.resolveSymlinkWritePath(e);return{readPath:t.readPath??null,writePath:t.writePath}}catch(e){T7(`resolveSymlinkWritePath threw`,e)}return Swe(e)}function O7(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Twe(){let e=E7();return e&&typeof e.parseTomlToJson==`function`?e:null}function Ewe(e){try{let t=e.parseTomlToJson(`probe = 1`);return typeof t==`string`&&t.includes(`probe`)}catch(e){return T7(`addon loaded but probe failed`,e),!1}}function k7(e){if(!O7(e))throw Error(`TOML root is not a table`);return e}function Dwe(e){return{backend:`native`,parseToObject(t){return k7(JSON.parse(e.parseTomlToJson(t)))},upsertEntry(t,n,r){let i=e.upsertMcpServer(t,n,JSON.stringify(r));return{text:i.text,existed:i.existed}},removeEntry(t,n){let r=e.removeMcpServer(t,n);return{text:r.text,existed:r.existed}}}}function Owe(){return{backend:`fallback`,parseToObject(e){return k7(rwe(e))}}}function kwe(e=Twe){let t=e();return t&&Ewe(t)?Dwe(t):Owe()}let A7=null;function j7(){return A7===null&&(A7=kwe()),A7}function Awe(){let e=j7();return e.backend===`native`?e:void 0}const M7=`**/.ok/*`,N7=`!**/${hu}/`;function P7(e){let t=[`.ok/`,`.okignore`];for(let n of M5){let r=e7[n];r.projectConfigPath&&t.push(Fwe(r.projectConfigPath(e),e))}return t.push(`.claude/launch.json`),Array.from(new Set(t))}function F7(e){let t=N(e,...Yse);if(!g(t))return[];try{let e=$se(S(t,`utf-8`));if(!e)return[];let n=[];for(let[t,r]of Object.entries(e.skills))if(t!==`open-knowledge`)for(let e of r.hosts){let r=yu[e];r&&n.push(`${r}/${t}/`)}return Array.from(new Set(n))}catch{return[]}}function jwe(e,t){let n=I7(e,t).tracked;if(n.length>0)return{kind:`refused-tracked`,tracked:n,remediation:L7(n)};let r=R7(e);if(r.kind!==`ok`)return r.result;let i=g(r.path)?S(r.path,`utf-8`):``,a=new Set(F7(e)),o=[],s=a.size===0?i:i.split(`
1486
1486
  `).filter(e=>{let t=e.trim();return a.has(t)?(o.push(t),!1):!0}).join(`
1487
1487
  `),c=V7(s),l=[],u=[];for(let e of t)B7(c,e)?u.push(e):l.push(e);if(l.length===0&&o.length===0)return{kind:`updated`,appended:l,alreadyPresent:u,removed:[]};let d=l.length===0||s.length===0||s.endsWith(`
1488
1488
  `)?``:`
@@ -1495,7 +1495,7 @@ export default function okBridge(pi: {
1495
1495
  `)){let e=t.trimStart();if(!(e.length===0||e.length===t.length))return t.charCodeAt(0)===9?{insertSpaces:!1,tabSize:1}:{insertSpaces:!0,tabSize:t.length-e.length}}return{insertSpaces:!0,tabSize:2}}function H7(e){let t=(e.match(/\r\n/g)??[]).length;return t===0?!1:t>=(e.match(/\n/g)??[]).length-t}function U7(e){try{return O(e).mode&511}catch{return}}function Rwe(e,t){let n=e.charCodeAt(0)===65279,r=n?e.slice(1):e,i=r.includes(`\r
1496
1496
  `)?`\r
1497
1497
  `:`
1498
- `,a=i6(r,t,void 0,{formattingOptions:{...Lwe(r),eol:i}});if(a.length===0)return{text:e,changed:!1};let o=`${n?``:``}${a6(r,a)}`;return{text:o,changed:o!==e}}const zwe={allowTrailingComma:!0,disallowComments:!1};function Bwe(e,t){return e.error===1&&e.offset===0&&t.charCodeAt(0)===65279}function W7(e){let t=[],n=jbe(e,t,zwe);return t.some(t=>!Bwe(t,e))||!n||n.type!==`object`?null:n}function G7(e,t){let n=0;for(let r of e.children??[]){let e=r.children?.[0];e!==void 0&&r6(e)===t&&(n+=1)}return n}function K7(e,t){WQ(e,`${JSON.stringify(t,null,2)}\n`)}function Vwe(e,t){let n=cwe(t);WQ(e,n.endsWith(`
1498
+ `,a=i6(r,t,void 0,{formattingOptions:{...Lwe(r),eol:i}});if(a.length===0)return{text:e,changed:!1};let o=`${n?``:``}${a6(r,a)}`;return{text:o,changed:o!==e}}const zwe={allowTrailingComma:!0,disallowComments:!1};function Bwe(e,t){return e.error===1&&e.offset===0&&t.charCodeAt(0)===65279}function W7(e){let t=[],n=Abe(e,t,zwe);return t.some(t=>!Bwe(t,e))||!n||n.type!==`object`?null:n}function G7(e,t){let n=0;for(let r of e.children??[]){let e=r.children?.[0];e!==void 0&&r6(e)===t&&(n+=1)}return n}function K7(e,t){WQ(e,`${JSON.stringify(t,null,2)}\n`)}function Vwe(e,t){let n=cwe(t);WQ(e,n.endsWith(`
1499
1499
  `)?n:`${n}\n`)}function Hwe(e,t){let n=(0,on.stringify)(t);WQ(e,n.endsWith(`
1500
1500
  `)?n:`${n}\n`)}const q7=10*1024*1024;function J7(e,t){if(e===t)return!0;if(Array.isArray(e)||Array.isArray(t))return!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length?!1:e.every((e,n)=>J7(e,t[n]));if(O7(e)&&O7(t)){let n=Object.keys(e);return n.length===Object.keys(t).length?n.every(n=>Object.hasOwn(t,n)&&J7(e[n],t[n])):!1}return!1}const Uwe=[`command`,`args`],Wwe=[`type`,`command`];function Y7(e){return e.type===`local`&&Array.isArray(e.command)?Wwe:Uwe}function Gwe(e,t,n){return O7(e)&&n.every(n=>J7(e[n],t[n]))}function Kwe(e){for(let t of e.split(`
1501
1501
  `)){let e=t.trimStart();if(!(e.length===0||e.length===t.length))return t.charCodeAt(0)===9?{insertSpaces:!1,tabSize:1}:{insertSpaces:!0,tabSize:t.length-e.length}}return{insertSpaces:!0,tabSize:2}}function X7(e,t,n){return t===void 0?[e,n]:[e,t,n]}function Z7(e,t,n,r){let i={[n]:r};return{[e]:t===void 0?i:{[t]:i}}}function Q7(e,t,n){let r=e[t];return n===void 0?r:O7(r)?r[n]:void 0}function qwe(e,t,n,r,i){if(!g(e))return K7(e,Z7(t,i,n,r)),{kind:`written`};let a;try{a=S(e,`utf-8`)}catch(e){return T7(`json config read failed`,e),{kind:`declined`,reason:`unparseable`}}if(a.trim()===``)return K7(e,Z7(t,i,n,r)),{kind:`written`};if(Buffer.byteLength(a,`utf-8`)>q7)return{kind:`declined`,reason:`oversize`};let o=W7(a);if(!o)return{kind:`declined`,reason:`unparseable`};if(G7(o,t)>1)return{kind:`declined`,reason:`duplicate-container`};let s=Q7(r6(o),t,i),c=O7(s)?s[n]:void 0,l=c!==void 0,u=Y7(r);if(l&&Gwe(c,r,u))return{kind:`overwritten`};let d=a.charCodeAt(0)===65279,f=d?a.slice(1):a,p=f.includes(`\r
@@ -1529,6 +1529,6 @@ export default function okBridge(pi: {
1529
1529
  `))}function M9(e,t){let n=S(e,`utf-8`);if(n.trim().length!==0)try{let r=A9(JSON.parse(n),t),i=n.endsWith(`
1530
1530
  `)?`
1531
1531
  `:``;te(e,`${JSON.stringify(r,null,2)}${i}`)}catch{let r=k9(n,t.contentDir);r!==n&&te(e,r)}}function N9(e,t){let n=S(e,`utf-8`),r=k9(n,t.contentDir);r!==n&&te(e,r)}function P9(e){try{return C(e,{withFileTypes:!0}).filter(e=>e.isFile()).map(t=>N(e,t.name))}catch{return[]}}const ZTe=new Set([`agent-presence.json`,`agent-effects.json`,`runtime.json`]);function F9(e){return/\.log\.\d+$/.test(e)}function QTe(e){return e.endsWith(`.jsonl`)||e.endsWith(`.log`)||F9(e)}const $Te=[`telemetry`,`logs`,`process`,`diagnostic-reports`];function eEe(e){let t={contentDir:e.contentDir};for(let n of $Te)for(let r of P9(N(e.stagingDir,n)))QTe(r)?j9(r,t):r.endsWith(`.json`)?M9(r,t):N9(r,t);for(let n of P9(N(e.stagingDir,`state`))){let e=fe(n);n.endsWith(`.jsonl`)?j9(n,t):ZTe.has(e)?M9(n,t):N9(n,t)}}const I9=[`.ok`,`local`,`telemetry`],L9=[`.ok`,`local`,`logs`],R9=[`.ok`,`local`,`loss-capture`],z9=`spans-current.jsonl`,B9=`spans-prev.jsonl`,V9=`server-current.jsonl`,H9=`server-prev.jsonl`,U9=`loss-current.jsonl`,W9=`loss-prev.jsonl`;function tEe(e){return N(e,...I9,z9)}function nEe(e){return N(e,...I9,B9)}function rEe(e){return N(e,...L9,V9)}function iEe(e){return N(e,...L9,H9)}function aEe(e){return N(e,...R9,U9)}function oEe(e){return N(e,...R9,W9)}const G9=1e3;async function sEe(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/agent-presence`,{signal:AbortSignal.timeout(G9)});return t.ok?await t.text():null}catch{return null}}async function cEe(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/agent-effects`,{signal:AbortSignal.timeout(G9)});return t.ok?await t.text():null}catch{return null}}async function lEe(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/watcher-recent`,{signal:AbortSignal.timeout(G9)});return t.ok?await t.text():null}catch{return null}}function uEe(e){try{let t=JSON.parse(e);if(typeof t!=`object`||!t)return null;let n=t.decisions;return Array.isArray(n)?n.length===0?``:`${n.map(e=>JSON.stringify(e)).join(`
1532
- `)}\n`:null}catch{return null}}function dEe(e){let t=N(e,`.git`,`ok`);if(!g(t))return null;let n=u(`git`,[`-C`,t,`log`,`--oneline`,`-50`],l3({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function fEe(e){let t=N(e,`.git`,`ok`);if(!g(t))return null;let n=u(`git`,[`-C`,t,`for-each-ref`,`--sort=-creatordate`,`--count=50`,`--format=%(refname)%09%(creatordate:iso-strict)%09%(contents:subject)`,`refs/checkpoints/`],l3({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function K9(){let e=process.env.OK_DESKTOP_VERSION,t=process.env.OK_DESKTOP_PACKAGED,n=process.env.OK_DESKTOP_CHANNEL;return e===void 0||t===void 0||n===void 0?null:{electronVersion:e,packaged:t===`1`||t.toLowerCase()===`true`,channel:n}}function pEe(){return{nodeVersion:process.version,platform:k(),arch:re()}}function mEe(){return process.env.OTEL_SDK_DISABLED===`false`}function q9(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function J9(e){if(!g(e))return{};let t;try{t=(0,on.parse)(S(e,`utf-8`))}catch(t){return console.warn(`[ok diagnose bundle] failed to parse ${e} for manifest config; manifest will report schema defaults. Reason: ${t instanceof Error?t.message:String(t)}`),{}}if(!q9(t))return{};let n=t.telemetry;if(!q9(n))return{};let r=n.localSink;return q9(r)?r:{}}function Y9(e){return typeof e==`boolean`?e:void 0}function hEe(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:void 0}function X9(e){if(q9(e))return hEe(e.maxBytes)}function gEe(e){let t=J9(JQ(`project`,e)),n=J9(JQ(`project-local`,e));return{enabled:Y9(n.enabled)??Y9(t.enabled)??!0,spansMaxBytes:X9(n.spans)??X9(t.spans)??52428800,logsMaxBytes:X9(n.logs)??X9(t.logs)??26214400}}function _Ee(e){return Ae(`sha256`).update(e).digest(`hex`)}function vEe(e){let t=S(e),n=0;for(let e=0;e<t.length;e++)t[e]===10&&n++;return n}const yEe=[`"doc.name"`,`"docName"`];function bEe(e){let t=S(e,`utf-8`),n=0;for(let e of yEe){let r=t.indexOf(e);for(;r!==-1;)n++,r=t.indexOf(e,r+e.length)}return n}function Z9(e,t){if(!g(e))return!1;try{return v(pe(t),{recursive:!0}),e.endsWith(`.ips`)?te(t,a9(S(e,`utf-8`))):m(e,t),!0}catch{return!1}}function Q9(e){let t=[],n=e=>{let r=C(e,{withFileTypes:!0});for(let i of r){let r=N(e,i.name);i.isDirectory()?n(r):i.isFile()&&t.push(r)}};return n(e),t.sort()}const xEe=new Set([`.jsonl`]);function SEe(e){let t=e.lastIndexOf(`.`);return t===-1?!1:xEe.has(e.slice(t))}const CEe=new Set([`.jsonl`,`.json`,`.txt`,`.log`,`.lock`,`.yaml`,`.yml`,`.ips`]);function wEe(e){if(F9(e))return!0;let t=e.lastIndexOf(`.`);return t===-1?!1:CEe.has(e.slice(t))}function TEe(e){let t=[];for(let n of Q9(e)){let r=$9(e,n);if(!wEe(r))continue;let{redacted:i,patterns:a,lineCount:o}=Rw(S(n,`utf-8`));a.length!==0&&(te(n,i),t.push({file:r,lineCount:o,patterns:a}))}return{redactions:t,redactedLineCount:t.reduce((e,t)=>e+t.lineCount,0)}}function $9(e,t){return _e(e,t).split(ye).join(`/`)}async function EEe(e){let t=ve(e.contentDir),n=ve(e.projectDir??e.contentDir),r=e.deps??{},i=r.fetchAgentPresence??sEe,a=r.fetchAgentEffects??cEe,o=r.fetchWatcherRecent??lEe,s=r.readShadowHead??dEe,c=r.readCheckpointRefs??fEe,l=r.now??(()=>new Date),u=r.okVersion??(()=>`0.68.8`),d=r.readDesktopEnv??K9,f=r.readLanguage??O9,p=r.readRuntime??pEe,h=r.isOtlpPushEnabled??mEe,_=y(N(le(),`ok-bundle-`));try{v(N(_,`telemetry`),{recursive:!0}),v(N(_,`logs`),{recursive:!0}),v(N(_,`state`),{recursive:!0}),Z9(tEe(n),N(_,`telemetry`,z9)),Z9(nEe(n),N(_,`telemetry`,B9)),Z9(rEe(n),N(_,`logs`,V9)),Z9(iEe(n),N(_,`logs`,H9));for(let t of e.userLogFiles??[])Z9(t,N(_,`logs`,fe(t)));for(let t of e.userStateFiles??[])Z9(t,N(_,us,fe(t)));let y=0;for(let t of e.diagnosticReports?.files??[])Z9(t,N(_,`diagnostic-reports`,fe(t)))&&(y+=1);let b=N(n,`.ok`,`local`),x=N(b,`server.lock`),C=`not-running`,w=`no server.lock`,T=null;if(g(x)){Z9(x,N(_,`state`,`server.lock`));try{let e=S(x,`utf-8`),t=JSON.parse(e);typeof t.port==`number`?T=t.port:w=`lock present but no port`}catch{w=`lock present but unparseable`}}if(T!==null){let e=await i(T);e===null?w=`agent-presence endpoint at :${T} unreachable`:(te(N(_,`state`,`agent-presence.json`),e),C=`running`,w=``);let t=await a(T);t!==null&&te(N(_,`state`,`agent-effects.json`),t);let n=await o(T);if(n!==null){let e=uEe(n);e!==null&&te(N(_,`state`,`watcher-recent.jsonl`),e)}}let E=s(t);E!==null&&te(N(_,`state`,`shadow-head.txt`),E);let ee=c(t);ee!==null&&te(N(_,`state`,`checkpoint-refs.txt`),ee),Z9(aEe(n),N(_,`state`,U9)),Z9(oEe(n),N(_,`state`,W9)),Z9(N(b,`last-spawn-error.log`),N(_,`state`,`last-spawn-error.log`)),Z9(N(b,Au),N(_,`state`,Au)),Z9(N(b,ju),N(_,`state`,ju));let ne=p(),re=d(),ie=f(),ae={ok:{version:u(),nodeVersion:ne.nodeVersion,platform:ne.platform,arch:ne.arch},host:{desktop:re,language:ie}};te(N(_,`state`,`runtime.json`),`${JSON.stringify(ae,null,2)}\n`);let oe=C===`running`?`running
1532
+ `)}\n`:null}catch{return null}}function dEe(e){let t=N(e,`.git`,`ok`);if(!g(t))return null;let n=u(`git`,[`-C`,t,`log`,`--oneline`,`-50`],l3({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function fEe(e){let t=N(e,`.git`,`ok`);if(!g(t))return null;let n=u(`git`,[`-C`,t,`for-each-ref`,`--sort=-creatordate`,`--count=50`,`--format=%(refname)%09%(creatordate:iso-strict)%09%(contents:subject)`,`refs/checkpoints/`],l3({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function K9(){let e=process.env.OK_DESKTOP_VERSION,t=process.env.OK_DESKTOP_PACKAGED,n=process.env.OK_DESKTOP_CHANNEL;return e===void 0||t===void 0||n===void 0?null:{electronVersion:e,packaged:t===`1`||t.toLowerCase()===`true`,channel:n}}function pEe(){return{nodeVersion:process.version,platform:k(),arch:re()}}function mEe(){return process.env.OTEL_SDK_DISABLED===`false`}function q9(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function J9(e){if(!g(e))return{};let t;try{t=(0,on.parse)(S(e,`utf-8`))}catch(t){return console.warn(`[ok diagnose bundle] failed to parse ${e} for manifest config; manifest will report schema defaults. Reason: ${t instanceof Error?t.message:String(t)}`),{}}if(!q9(t))return{};let n=t.telemetry;if(!q9(n))return{};let r=n.localSink;return q9(r)?r:{}}function Y9(e){return typeof e==`boolean`?e:void 0}function hEe(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:void 0}function X9(e){if(q9(e))return hEe(e.maxBytes)}function gEe(e){let t=J9(JQ(`project`,e)),n=J9(JQ(`project-local`,e));return{enabled:Y9(n.enabled)??Y9(t.enabled)??!0,spansMaxBytes:X9(n.spans)??X9(t.spans)??52428800,logsMaxBytes:X9(n.logs)??X9(t.logs)??26214400}}function _Ee(e){return Ae(`sha256`).update(e).digest(`hex`)}function vEe(e){let t=S(e),n=0;for(let e=0;e<t.length;e++)t[e]===10&&n++;return n}const yEe=[`"doc.name"`,`"docName"`];function bEe(e){let t=S(e,`utf-8`),n=0;for(let e of yEe){let r=t.indexOf(e);for(;r!==-1;)n++,r=t.indexOf(e,r+e.length)}return n}function Z9(e,t){if(!g(e))return!1;try{return v(pe(t),{recursive:!0}),e.endsWith(`.ips`)?te(t,a9(S(e,`utf-8`))):m(e,t),!0}catch{return!1}}function Q9(e){let t=[],n=e=>{let r=C(e,{withFileTypes:!0});for(let i of r){let r=N(e,i.name);i.isDirectory()?n(r):i.isFile()&&t.push(r)}};return n(e),t.sort()}const xEe=new Set([`.jsonl`]);function SEe(e){let t=e.lastIndexOf(`.`);return t===-1?!1:xEe.has(e.slice(t))}const CEe=new Set([`.jsonl`,`.json`,`.txt`,`.log`,`.lock`,`.yaml`,`.yml`,`.ips`]);function wEe(e){if(F9(e))return!0;let t=e.lastIndexOf(`.`);return t===-1?!1:CEe.has(e.slice(t))}function TEe(e){let t=[];for(let n of Q9(e)){let r=$9(e,n);if(!wEe(r))continue;let{redacted:i,patterns:a,lineCount:o}=Rw(S(n,`utf-8`));a.length!==0&&(te(n,i),t.push({file:r,lineCount:o,patterns:a}))}return{redactions:t,redactedLineCount:t.reduce((e,t)=>e+t.lineCount,0)}}function $9(e,t){return _e(e,t).split(ye).join(`/`)}async function EEe(e){let t=ve(e.contentDir),n=ve(e.projectDir??e.contentDir),r=e.deps??{},i=r.fetchAgentPresence??sEe,a=r.fetchAgentEffects??cEe,o=r.fetchWatcherRecent??lEe,s=r.readShadowHead??dEe,c=r.readCheckpointRefs??fEe,l=r.now??(()=>new Date),u=r.okVersion??(()=>`0.68.11-beta.0`),d=r.readDesktopEnv??K9,f=r.readLanguage??O9,p=r.readRuntime??pEe,h=r.isOtlpPushEnabled??mEe,_=y(N(le(),`ok-bundle-`));try{v(N(_,`telemetry`),{recursive:!0}),v(N(_,`logs`),{recursive:!0}),v(N(_,`state`),{recursive:!0}),Z9(tEe(n),N(_,`telemetry`,z9)),Z9(nEe(n),N(_,`telemetry`,B9)),Z9(rEe(n),N(_,`logs`,V9)),Z9(iEe(n),N(_,`logs`,H9));for(let t of e.userLogFiles??[])Z9(t,N(_,`logs`,fe(t)));for(let t of e.userStateFiles??[])Z9(t,N(_,us,fe(t)));let y=0;for(let t of e.diagnosticReports?.files??[])Z9(t,N(_,`diagnostic-reports`,fe(t)))&&(y+=1);let b=N(n,`.ok`,`local`),x=N(b,`server.lock`),C=`not-running`,w=`no server.lock`,T=null;if(g(x)){Z9(x,N(_,`state`,`server.lock`));try{let e=S(x,`utf-8`),t=JSON.parse(e);typeof t.port==`number`?T=t.port:w=`lock present but no port`}catch{w=`lock present but unparseable`}}if(T!==null){let e=await i(T);e===null?w=`agent-presence endpoint at :${T} unreachable`:(te(N(_,`state`,`agent-presence.json`),e),C=`running`,w=``);let t=await a(T);t!==null&&te(N(_,`state`,`agent-effects.json`),t);let n=await o(T);if(n!==null){let e=uEe(n);e!==null&&te(N(_,`state`,`watcher-recent.jsonl`),e)}}let E=s(t);E!==null&&te(N(_,`state`,`shadow-head.txt`),E);let ee=c(t);ee!==null&&te(N(_,`state`,`checkpoint-refs.txt`),ee),Z9(aEe(n),N(_,`state`,U9)),Z9(oEe(n),N(_,`state`,W9)),Z9(N(b,`last-spawn-error.log`),N(_,`state`,`last-spawn-error.log`)),Z9(N(b,Au),N(_,`state`,Au)),Z9(N(b,ju),N(_,`state`,ju));let ne=p(),re=d(),ie=f(),ae={ok:{version:u(),nodeVersion:ne.nodeVersion,platform:ne.platform,arch:ne.arch},host:{desktop:re,language:ie}};te(N(_,`state`,`runtime.json`),`${JSON.stringify(ae,null,2)}\n`);let oe=C===`running`?`running
1533
1533
  `:`not-running (${w})\n`;te(N(_,`state`,`server-status.txt`),oe);let se=e.diagnosticReports===void 0?`not-collected (no collection attempted)`:i9(e.diagnosticReports,y);if(te(N(_,`state`,`diagnostic-reports-status.txt`),`${se}\n`),e.processDir&&g(e.processDir)){let t=N(_,`process`);v(t,{recursive:!0}),m(e.processDir,t,{recursive:!0})}let k=e.redact===!0;k&&eEe({stagingDir:_,contentDir:t}),e.note&&te(N(_,`note.txt`),e.note);let ce=null;e.scrubSecrets===!0&&(ce=TEe(_));for(let t of e.extraFiles??[])Z9(t.sourcePath,N(_,`extra`,t.zipName??fe(t.sourcePath)))||r.logger?.warn({sourcePath:t.sourcePath},`extra file missing; omitted from bundle`);let le=gEe(n),ue=Q9(_),A=[],j=0,de=0;for(let e of ue){let t=$9(_,e),n=O(e).size,r=SEe(t)?vEe(e):0;A.push({path:t,bytes:n,lines:r}),j+=n,(t.startsWith(`telemetry/`)||t.startsWith(`logs/`))&&(de+=bEe(e))}let pe={applied:k};ce!==null&&(pe.secretScrub=ce);let me={schemaVersion:2,createdAt:l().toISOString(),ok:{version:u(),nodeVersion:ne.nodeVersion,platform:ne.platform,arch:ne.arch},host:{desktop:re,language:ie},contentDir:{pathSha256:_Ee(t),absolutePath:k?`<CONTENT_DIR>`:t},telemetry:{localSink:le,otlpPushEnabled:h()},redaction:pe,serverStatus:C,files:A};te(N(_,`manifest.json`),`${JSON.stringify(me,null,2)}\n`);let M=ue.some(e=>{try{return S(e,`utf-8`).includes(t)}catch{return!1}}),he={stagedDiagnosticReports:y,totalBytes:j,fileCount:A.length,docNameCount:de,contentDirVisible:M,redacted:k},ge=!1;return{stagingDir:_,manifest:me,summary:he,cleanup:()=>{ge||(ge=!0,D(_,{recursive:!0,force:!0}))}}}catch(e){throw D(_,{recursive:!0,force:!0}),e}}async function DEe(e){let{collected:t,outputPath:n}=e,r=pe(n);if(!g(r))throw Error(`ok diagnose bundle: parent directory does not exist: ${r}. Create it or pass --out with an existing parent.`);let i=new Bye.ZipFile,a=Q9(t.stagingDir);for(let e of a){let n=$9(t.stagingDir,e);i.addFile(e,n)}i.end();let o=h(n);return i.outputStream.pipe(o),await new Promise((e,t)=>{o.on(`close`,e),o.on(`error`,t),i.outputStream.on(`error`,t)}),n}function OEe(e,t){let n=N(e,`.ok`,`config.yml`);if(g(n))try{let t=(0,on.parse)(S(n,`utf-8`)),r=O7(t)?t.content:void 0,i=O7(r)?r.dir:void 0;if(typeof i==`string`&&i.length>0)return ve(e,i)}catch(e){t?.warn({configPath:n,err:e},`bug-report: failed to read .ok/config.yml; falling back to project root as content dir`)}return ve(e)}async function kEe(e,t,n,r,i){let a=s9(t,e.logger),o=await EEe({contentDir:OEe(t,e.logger),projectDir:t,redact:e.redact,scrubSecrets:e.redact,note:e.note,extraFiles:e.extraFiles,userLogFiles:[...hTe(a,e.userLogsDir??N(oe(),`.ok`,`logs`)),...l9(e.cachesDir??N(oe(),`Library`,`Caches`))],userStateFiles:u9(e.bugReportsDir??o9()),diagnosticReports:i,deps:{readDesktopEnv:n,readLanguage:r,logger:e.logger}});try{v(pe(e.outputPath),{recursive:!0}),await DEe({collected:o,outputPath:e.outputPath});let t=o.manifest.redaction.secretScrub;return{zipPath:e.outputPath,summary:{level:`full`,systemWide:!1,projectSlug:a,files:o.manifest.files.map(e=>e.path),redactions:t?.redactions??[],redactedLineCount:t?.redactedLineCount??0,generatedAt:o.manifest.createdAt}}}finally{o.cleanup()}}async function AEe(e){let{projectDir:t}=e,n=e.readDesktopEnv??K9,r=e.readLanguage??O9,i=()=>dTe(e.diagnosticReportsDir??N(oe(),`Library`,`Logs`,`DiagnosticReports`),new Date);if(e.level===`full`&&t!==void 0)return kEe(e,t,n,r,i());let{zipPath:a,summary:o}=await bTe({projectDir:t,redact:e.redact,revealDocNames:e.level===`full`,outputPath:e.outputPath,userLogsDir:e.userLogsDir,shipItLogFiles:l9(e.cachesDir??N(oe(),`Library`,`Caches`)),bugReportLedgerFiles:u9(e.bugReportsDir??o9()),diagnosticReports:e.level===`full`?i():void 0,logger:e.logger,note:e.note,extraFiles:e.extraFiles,desktop:n(),language:r()});return{zipPath:a,summary:{level:e.level,systemWide:t===void 0,projectSlug:o.projectSlug,files:o.files,redactions:o.redactions,redactedLineCount:o.redactedLineCount,generatedAt:o.generatedAt}}}export{M5 as ALL_EDITOR_IDS,N5 as EDITOR_LABELS,e7 as EDITOR_TARGETS,hCe as HOSTS_WITH_USER_SKILL_DIR,Xwe as LAUNCH_CONFIG_NAME,BTe as PATH_SHIM_BEGIN,HTe as PATH_SHIM_BLOCK_RE,VTe as PATH_SHIM_END,jwe as addOkPathsToGitExclude,b7 as assertProjectPathSafe,H5 as buildManagedServerEntry,ATe as buildMcpConfigDeclineEvent,jTe as buildMcpConfigMigrateEvent,r9 as classifyExistingMcpEntry,AEe as collectReportBundle,un as createTokenStore,fTe as defaultBugReportZipPath,Be as detectGh,Ue as detectGhAccounts,tTe as detectInstalledEditors,kCe as editorConfigPathDisplay,OCe as editorEntryLocator,STe as ensurePiBridge,L7 as formatTrackedRemediation,Pwe as getExcludedOkPaths,F7 as getInstalledSkillProjectionPaths,Awe as getNativeTomlMcpEditor,P7 as getOkArtifactPaths,B5 as isEntryUpToDate,U5 as isOwnManagedEntry,LTe as loadConfig,fee as makeLazyProbeTokenStore,o9 as okBugReportsDir,w9 as parseGitHubBlobUrl,RTe as parseGitHubShareUrl,T9 as parseGitHubTreeUrl,C9 as parseGitUrl,UTe as pathInstallMarkerPath,lwe as previewContent,rTe as probeOwnManagedEditorMcpEntry,xTe as probePiBridgeState,I7 as probeTrackedOkPaths,t9 as readExistingMcpEntry,Nwe as readSharingMode,Rw as redactContent,Mwe as removeOkPathsFromGitExclude,ETe as removeOwnMcpEntry,ywe as removeProjectSkill,GTe as removeUserGlobalSkillBundle,hwe as resolveProjectRoot,PTe as runStop,y9 as truncatePriorEntry,D9 as userGlobalSkillBundleTargets,zTe as validateLocalFolderForShare,e9 as writeEditorMcpConfig,JTe as writeProjectAiIntegrations,C7 as writeProjectSkill,eTe as writeUserMcpConfigs};
1534
1534
  //# sourceMappingURL=index.mjs.map