@inkeep/open-knowledge 0.86.0-beta.15 → 0.86.0-beta.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +6 -6
- package/dist/constants-tSID-kT5.mjs +1 -0
- package/dist/{dist-DikfvdOD.mjs → dist-5zDm1fr3.mjs} +1 -1
- package/dist/dist-DUtSOpBB.mjs +2212 -0
- package/dist/index.mjs +5 -5
- package/dist/{init-CWtHKTHv.mjs → init-B3soXeyK.mjs} +2 -2
- package/dist/init-BW-4zw1V.mjs +1 -0
- package/dist/{launch-json-removal-BB-oqIRC.mjs → launch-json-removal-2nQyZjaq.mjs} +1 -1
- package/dist/{loader-CkZGQ9i_.mjs → loader-BWtNORi7.mjs} +1 -1
- package/dist/loader-niePATP1.mjs +1 -0
- package/dist/{md-manager-BGnqyqi1-CMF2qMhD.mjs → md-manager-BGnqyqi1-C80pMLi7.mjs} +1 -1
- package/dist/{open-browser-CsFrf5v1.mjs → open-browser-Buji7DpA.mjs} +1 -1
- package/dist/parse-worker.mjs +1 -1
- package/dist/preview-2dl7HtCm.mjs +1 -0
- package/dist/{preview-DraobKxC.mjs → preview-DoJ3QZhu.mjs} +1 -1
- package/dist/public/assets/{AccountSection-X0gfkEFU.js → AccountSection-C8VrxwD0.js} +1 -1
- package/dist/public/assets/{ActivityModeContent-BHxvvcEZ.js → ActivityModeContent-CG-sT-V6.js} +1 -1
- package/dist/public/assets/{AddPropertiesButton-CbMt9j6h.js → AddPropertiesButton-DtKuaSoE.js} +2 -2
- package/dist/public/assets/{AgentConnectionsSection-C99QFz6Q.js → AgentConnectionsSection-DZe1baEO.js} +1 -1
- package/dist/public/assets/{AgentDiffPane-m_zTMTCy.js → AgentDiffPane-DGDfHO0m.js} +1 -1
- package/dist/public/assets/{AttachmentsSection-BBKp2KZL.js → AttachmentsSection-DZ39jLXo.js} +1 -1
- package/dist/public/assets/{AuthModal-CaYJDCrL.js → AuthModal-CHid1zIl.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-KdXe7bVw.js → CodeMirrorPropInput-CWwqakNd.js} +1 -1
- package/dist/public/assets/{ContentRulesSection-TEbxas-J.js → ContentRulesSection-CQVYRse1.js} +1 -1
- package/dist/public/assets/{DiffViewBoundary-DTwemWjU.js → DiffViewBoundary-L0r4YmEw.js} +1 -1
- package/dist/public/assets/{DocumentContext-DnGK7f-7.js → DocumentContext-BYGgYZ2Z.js} +1 -1
- package/dist/public/assets/{EditorModeToggle-4-oU20Yd.js → EditorModeToggle-C2u2HBDQ.js} +1 -1
- package/dist/public/assets/{ExcalidrawDocEditor-bEBqk79B.js → ExcalidrawDocEditor-3cWFGLDA.js} +1 -1
- package/dist/public/assets/FeedbackForm-DVva0ToF.js +1 -0
- package/dist/public/assets/{GraphPanel-D8IPaKtn.js → GraphPanel-75Gq3M8g.js} +1 -1
- package/dist/public/assets/{ImportSkillDialog-BIlSi8jA.js → ImportSkillDialog-Bmm_A48M.js} +1 -1
- package/dist/public/assets/{LinkPreviewsSection-iivOiJ_A.js → LinkPreviewsSection-D1vvIPmT.js} +1 -1
- package/dist/public/assets/{LintConfigEditor-DHGeIjIC.js → LintConfigEditor-BQisgkvH.js} +1 -1
- package/dist/public/assets/{LintingSection-DtSj5SS_.js → LintingSection-DzEZScQO.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-D66m8JEi.js +1 -0
- package/dist/public/assets/{ManagedArtifactProperties-DCt4z2iG.js → ManagedArtifactProperties-hfYg5-6i.js} +1 -1
- package/dist/public/assets/{MermaidDocEditor-C7FGmTIS.js → MermaidDocEditor-MIv7KZv3.js} +1 -1
- package/dist/public/assets/{NetworkAccessSection-B9a9_24L.js → NetworkAccessSection-BCuxmoVW.js} +1 -1
- package/dist/public/assets/{ProjectTemplatesSection-CVxoKTpG.js → ProjectTemplatesSection-BPIa6vCf.js} +1 -1
- package/dist/public/assets/{PropertyDisplayRow-D56ZpX2V.js → PropertyDisplayRow-985cBoeD.js} +1 -1
- package/dist/public/assets/{PublishToGitHubDialog-NPQKGvMw.js → PublishToGitHubDialog-5rf5f26y.js} +1 -1
- package/dist/public/assets/{RegisteredAgentIcon-CNf09bvo.js → RegisteredAgentIcon-B86I4fPj.js} +1 -1
- package/dist/public/assets/{SchemaConfigEditor-Cyjg356T.js → SchemaConfigEditor-BUucWy8_.js} +1 -1
- package/dist/public/assets/{SearchSection-BMqoHUM4.js → SearchSection-BzFkDyqq.js} +1 -1
- package/dist/public/assets/{SessionsHost-CRgShvSB.js → SessionsHost-B6hl-W6e.js} +2 -2
- package/dist/public/assets/{SettingsDialogBody-BkrW_nE0.js → SettingsDialogBody-B3ybsuOx.js} +2 -2
- package/dist/public/assets/{ShareReceiveMissDialog-Cl--AVvA.js → ShareReceiveMissDialog-B-YOLLM0.js} +1 -1
- package/dist/public/assets/{SkillCostValue-Br3p-1t8.js → SkillCostValue-D7i9jTwb.js} +1 -1
- package/dist/public/assets/{SkillForkDialog-HHZBdD9G.js → SkillForkDialog-BePu5Ab7.js} +1 -1
- package/dist/public/assets/{SkillInstallMenu-CYZkBfwA.js → SkillInstallMenu-ChTMNTo3.js} +1 -1
- package/dist/public/assets/{SkillOriginInline-DaVrUMXJ.js → SkillOriginInline-BIqEXUYx.js} +1 -1
- package/dist/public/assets/{SkillToolbarControls-DaFIqkzD.js → SkillToolbarControls-E4QCWXxQ.js} +1 -1
- package/dist/public/assets/{SkillsManagerSection-D4vdwn-z.js → SkillsManagerSection-CcVBU5-5.js} +1 -1
- package/dist/public/assets/{SlidesPluginSection-CIIOqcY1.js → SlidesPluginSection-DuYQPOmz.js} +1 -1
- package/dist/public/assets/{SlidesToolbarControls-groMA2mx.js → SlidesToolbarControls-PbLGA15n.js} +1 -1
- package/dist/public/assets/{SourceEditor-D9ScUImM.js → SourceEditor-DNYR7CKG.js} +1 -1
- package/dist/public/assets/{SpellingSettings-D5xCXWwh.js → SpellingSettings-Bk20lUSX.js} +1 -1
- package/dist/public/assets/{SyncSection-1f2TKL_Y.js → SyncSection-DAj-Y4pM.js} +1 -1
- package/dist/public/assets/{SyncStatusBadge-CchTDe6B.js → SyncStatusBadge-WyZgmb6D.js} +1 -1
- package/dist/public/assets/{TemplateRow-Z1Yy07aA.js → TemplateRow-BOTg2YrV.js} +1 -1
- package/dist/public/assets/{TerminalLaunchContext-DncO203O.js → TerminalLaunchContext-yYGkG_wD.js} +1 -1
- package/dist/public/assets/{TerminalPanel-D4_fMtJN.js → TerminalPanel-BSqB23c-.js} +1 -1
- package/dist/public/assets/{TerminalSection-RkwpYNK6.js → TerminalSection-P_OJ8LrU.js} +1 -1
- package/dist/public/assets/{TerminalWindowApp-Bizq7T-M.js → TerminalWindowApp-Dq_KzvrR.js} +1 -1
- package/dist/public/assets/{TextDocEditor-oVi7i468.js → TextDocEditor-BjIk7zxI.js} +1 -1
- package/dist/public/assets/{ThemePluginSection-CDwd2bcE.js → ThemePluginSection-m8Juee1X.js} +1 -1
- package/dist/public/assets/{ThreadView-D5-hmsZf.js → ThreadView-E0-pZsPE.js} +1 -1
- package/dist/public/assets/{TimelineDiffPane-Do2sxIBv.js → TimelineDiffPane-BCirg-Ku.js} +1 -1
- package/dist/public/assets/{_envelope-DwyyiIO_-B2czcEJX.js → _envelope-q8XHEv4O-C-Qnl5Tu.js} +1 -1
- package/dist/public/assets/{agent-connections-Dj9-89rY.js → agent-connections-Ceoyy8dY.js} +1 -1
- package/dist/public/assets/{agent-registry-CUdBP9oP.js → agent-registry-BMw1B8Te.js} +1 -1
- package/dist/public/assets/{bridge-D0M08jrS.js → bridge-D7uDalkC.js} +1 -1
- package/dist/public/assets/{card-V6OFaQxm.js → card-BluRJrIS.js} +1 -1
- package/dist/public/assets/{catalog-eC0BYrwO.js → catalog-Cmn9-Gjm.js} +1 -1
- package/dist/public/assets/{client-version-BA6OCZa0.js → client-version-B-y3fQk6.js} +1 -1
- package/dist/public/assets/{comment-chips-DibE8LRk.js → comment-chips-DKKh1Wi2.js} +1 -1
- package/dist/public/assets/{config-provider-CAQzJBPy.js → config-provider-D8_UrWWz.js} +1 -1
- package/dist/public/assets/config-schema-yQrjUXxd.js +1 -0
- package/dist/public/assets/{css-color-to-hex-9GaMLm_g.js → css-color-to-hex-Bzp4vTWU.js} +1 -1
- package/dist/public/assets/{doc-undo-manager-C-PBG9o0.js → doc-undo-manager-DTOg0O1B.js} +1 -1
- package/dist/public/assets/field-controls-Cwx83Wji.js +1 -0
- package/dist/public/assets/{field-controls-DrKhqiB3.js → field-controls-owKYZxR_.js} +1 -1
- package/dist/public/assets/{frontmatter-tags-BEkbJ1mW.js → frontmatter-tags-DRQIboHc.js} +1 -1
- package/dist/public/assets/{globals-DWENDqiP.css → globals-vYef5b1j.css} +1 -1
- package/dist/public/assets/{handoff-Ccrokk1b.js → handoff-Dqe1NvVI.js} +1 -1
- package/dist/public/assets/{index-1of4dc7v.js → index-DLKZwfmM.js} +8 -8
- package/dist/public/assets/{lint-config-client-D-AsWIBw.js → lint-config-client-BjslZut3.js} +1 -1
- package/dist/public/assets/{lint-plugins-ia8X-ZL0.js → lint-plugins-IJ9ueIoq.js} +1 -1
- package/dist/public/assets/{markdown-lint-DQqFORQu.js → markdown-lint-DHBRQg5Y.js} +1 -1
- package/dist/public/assets/{markdownlint-rule-browser-DX9d-HpW.js → markdownlint-rule-browser-Cg9L-VTb.js} +1 -1
- package/dist/public/assets/{pending-receive-nav-store-8PO3ggjr.js → pending-receive-nav-store-Bk339Ry2.js} +1 -1
- package/dist/public/assets/{preferred-session-events-BfQyHO9O.js → preferred-session-events-_-dJd5Q5.js} +1 -1
- package/dist/public/assets/{progress-C_P5sjg5.js → progress-B1YifhRi.js} +1 -1
- package/dist/public/assets/{saved-themes-client-Cu2_CM_R.js → saved-themes-client-DrFMFctS.js} +1 -1
- package/dist/public/assets/{schema-section-BYiWkCRw.js → schema-section-ZwfGVrsG.js} +1 -1
- package/dist/public/assets/{schemas-api-DbKS2FSh.js → schemas-api-CzN0ZSyO.js} +1 -1
- package/dist/public/assets/{selection-context-62-2q0su.js → selection-context-CXnTKou6.js} +1 -1
- package/dist/public/assets/{skills-api-B9YEcMtk.js → skills-api-DZKblPpK.js} +1 -1
- package/dist/public/assets/{src-Fp8fTIEP.js → src-CRjeSyxi.js} +1 -1
- package/dist/public/assets/storage-scope-RkgOxsbY.js +1 -0
- package/dist/public/assets/{tag-pill-input-CMMRt7b4.js → tag-pill-input-C2esRppI.js} +1 -1
- package/dist/public/assets/{telemetry-impl-DI8suaT4.js → telemetry-impl-BGHJxX__.js} +1 -1
- package/dist/public/assets/{telemetry-startup-BXbrCtKM.js → telemetry-startup-CqIGLqf1.js} +1 -1
- package/dist/public/assets/terminal-cli-display-CsSKkkvh.js +1 -0
- package/dist/public/assets/{terminal-command-events-Bi72Lcf-.js → terminal-command-events-gsyNmK4P.js} +1 -1
- package/dist/public/assets/{terminal-launch-events-C_GWUJjY.js → terminal-launch-events-0aq4jWnV.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-B8FrkdJE.js → typing-burst-detector-BXH_c9PZ.js} +1 -1
- package/dist/public/assets/{uninstall-yrbrkUSW.js → uninstall-B-uEWMBM.js} +1 -1
- package/dist/public/assets/{use-activity-panel-DzIIKheA.js → use-activity-panel-BfzIZAB_.js} +1 -1
- package/dist/public/assets/{use-apply-config-color-theme-D0H8BLH0.js → use-apply-config-color-theme-Ddh-kKyn.js} +1 -1
- package/dist/public/assets/{use-conflicts-WBuTv_RW.js → use-conflicts-BMDLXGd4.js} +1 -1
- package/dist/public/assets/{use-live-xterm-theme-B-M8VGC3.js → use-live-xterm-theme-M-20jT-Q.js} +1 -1
- package/dist/public/assets/{use-open-skill-BhVtYf3Z.js → use-open-skill-DvN-m1ye.js} +1 -1
- package/dist/public/assets/{use-semantic-search-status-T5fnhjCX.js → use-semantic-search-status-BkAAt8Ua.js} +1 -1
- package/dist/public/assets/{use-skill-origin-CGXvvIZH.js → use-skill-origin-CKhQalbz.js} +1 -1
- package/dist/public/assets/{use-skill-targets-ED9Nr02L.js → use-skill-targets-6h1qor3V.js} +1 -1
- package/dist/public/assets/{use-skills-NvVxu3-j.js → use-skills-CdEaAQQ2.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-QNCXx6AL.js → use-terminal-enabled-xuYKn-zp.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-CCXFO0cF.js → use-timeline-entry-diff-DhWXFbDg.js} +1 -1
- package/dist/public/assets/{use-workspace-eebQ7TvN.js → use-workspace-DLSxs3j7.js} +1 -1
- package/dist/public/index.html +52 -52
- package/dist/public/uninstall.html +3 -3
- package/dist/{registry-probes-DfYNGpUS.mjs → registry-probes-DJmzCjem.mjs} +1 -1
- package/dist/{removal-file-path-D4yFgvd3.mjs → removal-file-path-D5mxCa9S.mjs} +1 -1
- package/dist/{repair-launch-json-hnw7Vz4K.mjs → repair-launch-json-VFb4aQfh.mjs} +1 -1
- package/dist/{repair-mcp-configs-Bymhl_R4.mjs → repair-mcp-configs-XpRJH2-z.mjs} +1 -1
- package/dist/{src-W8epkuZh.mjs → src-MRx7oPfu.mjs} +1 -1
- package/dist/src-txFqzl0c.mjs +1 -0
- package/dist/start-B2lITndM.mjs +1 -0
- package/dist/{start-BNM-Ewl9.mjs → start-Com2PFXp.mjs} +3 -3
- package/package.json +4 -4
- package/dist/constants-CaFOyprZ.mjs +0 -1
- package/dist/dist-DO09Y6M7.mjs +0 -2212
- package/dist/init-DhRgHqpq.mjs +0 -1
- package/dist/loader-BW4TZHVu.mjs +0 -1
- package/dist/preview-BPuQatlI.mjs +0 -1
- package/dist/public/assets/FeedbackForm-CJFCHJ2Q.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-37I-gX2R.js +0 -1
- package/dist/public/assets/config-schema-BRXEDN1T.js +0 -1
- package/dist/public/assets/field-controls-BXxM4mAl.js +0 -1
- package/dist/public/assets/storage-scope-DTSZLReS.js +0 -1
- package/dist/public/assets/terminal-cli-display-D_usGdw9.js +0 -1
- package/dist/src-BZsowcmP.mjs +0 -1
- package/dist/start-BFgwkKPg.mjs +0 -1
- /package/dist/public/assets/{globals-ChqKDCf_.js → globals-CXjhlGNL.js} +0 -0
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e,i as t,n,r,t as i}from"./rolldown-runtime-DPpTSio4.mjs";import"./libesm-CSMdpGMF.mjs";import"./chunk-B74TABJS-DAm9lxFL.mjs";import"./chunk-R6VWJ2ZL-Cu1kOJ3f.mjs";import"./chunk-CWQS3NFK-Dma10iZG.mjs";import"./chunk-DXB73IDG-MLBj3lvC.mjs";import"./chunk-5QMZ5MUS-B37CnsNb.mjs";import"./chunk-A5O5YHGN-2_dxLAd1.mjs";import"./chunk-24IMIIXA-CZ-UxWg_.mjs";import{createRequire as a}from"node:module";import{execFile as o,execFileSync as s,execSync as c,spawnSync as l}from"node:child_process";import{access as u,accessSync as d,closeSync as f,constants as p,cpSync as m,createWriteStream as h,existsSync as g,lstatSync as _,mkdirSync as v,mkdtempSync as y,openSync as b,readFile as x,readFileSync as S,readSync as C,readdirSync as w,readlinkSync as T,realpathSync as E,renameSync as D,rmSync as O,rmdirSync as ee,statSync as te,unlinkSync as ne,writeFileSync as re}from"node:fs";import ie,{basename as ae,dirname as k,extname as oe,isAbsolute as A,join as j,normalize as se,posix as ce,relative as M,resolve as N,sep as le,win32 as ue}from"node:path";import de from"node:process";import{fileURLToPath as fe,fileURLToPath as P}from"node:url";import{EOL as pe,arch as me,availableParallelism as he,freemem as ge,homedir as _e,hostname as ve,platform as ye,release as be,tmpdir as xe,totalmem as Se,type as Ce,uptime as we}from"node:os";import{mkdir as Te,readFile as Ee,readdir as De,realpath as Oe,rename as ke,stat as Ae,writeFile as je}from"node:fs/promises";import{createHash as Me,randomUUID as Ne}from"node:crypto";import{isDeepStrictEqual as Pe,promisify as Fe}from"node:util";import{Readable as Ie,Writable as Le}from"node:stream";import Re from"crypto";import"node:events";import"node:worker_threads";import"yjs";import{Readable as ze}from"stream";import{spawn as Be}from"child_process";import{setTimeout as Ve}from"node:timers/promises";import
|
|
1
|
+
import{a as e,i as t,n,r,t as i}from"./rolldown-runtime-DPpTSio4.mjs";import"./libesm-CSMdpGMF.mjs";import"./chunk-B74TABJS-DAm9lxFL.mjs";import"./chunk-R6VWJ2ZL-Cu1kOJ3f.mjs";import"./chunk-CWQS3NFK-Dma10iZG.mjs";import"./chunk-DXB73IDG-MLBj3lvC.mjs";import"./chunk-5QMZ5MUS-B37CnsNb.mjs";import"./chunk-A5O5YHGN-2_dxLAd1.mjs";import"./chunk-24IMIIXA-CZ-UxWg_.mjs";import{createRequire as a}from"node:module";import{execFile as o,execFileSync as s,execSync as c,spawnSync as l}from"node:child_process";import{access as u,accessSync as d,closeSync as f,constants as p,cpSync as m,createWriteStream as h,existsSync as g,lstatSync as _,mkdirSync as v,mkdtempSync as y,openSync as b,readFile as x,readFileSync as S,readSync as C,readdirSync as w,readlinkSync as T,realpathSync as E,renameSync as D,rmSync as O,rmdirSync as ee,statSync as te,unlinkSync as ne,writeFileSync as re}from"node:fs";import ie,{basename as ae,dirname as k,extname as oe,isAbsolute as A,join as j,normalize as se,posix as ce,relative as M,resolve as N,sep as le,win32 as ue}from"node:path";import de from"node:process";import{fileURLToPath as fe,fileURLToPath as P}from"node:url";import{EOL as pe,arch as me,availableParallelism as he,freemem as ge,homedir as _e,hostname as ve,platform as ye,release as be,tmpdir as xe,totalmem as Se,type as Ce,uptime as we}from"node:os";import{mkdir as Te,readFile as Ee,readdir as De,realpath as Oe,rename as ke,stat as Ae,writeFile as je}from"node:fs/promises";import{createHash as Me,randomUUID as Ne}from"node:crypto";import{isDeepStrictEqual as Pe,promisify as Fe}from"node:util";import{Readable as Ie,Writable as Le}from"node:stream";import Re from"crypto";import"node:events";import"node:worker_threads";import"yjs";import{Readable as ze}from"stream";import{spawn as Be}from"child_process";import{setTimeout as Ve}from"node:timers/promises";import{AsyncLocalStorage as He}from"node:async_hooks";import"node:stream/promises";import{Http2ServerRequest as Ue}from"node:http2";const We=[`/opt/homebrew/bin/gh`,`/usr/local/bin/gh`,`/opt/local/bin/gh`,`/snap/bin/gh`,`/usr/bin/gh`],Ge={encoding:`utf-8`,stdio:[`ignore`,`pipe`,`pipe`],timeout:5e3,windowsHide:!0};function Ke(e,t={}){let{login:n}=t,r=t._exec??s,i=qe(t._fileExists??g),a=e?[`--hostname`,e]:[];if(n){let e=Je(r,i,[`auth`,`token`,...a,`--user`,n]);if(e)return{available:!0,token:e,resolvedLogin:n,fallback:!1}}let o=Je(r,i,[`auth`,`token`,...a]);return o?n?{available:!0,token:o,fallback:!0}:{available:!0,token:o}:{available:!1}}function qe(e){return[`gh`,...We.filter(e)]}function Je(e,t,n){for(let r of t)try{let t=e(r,n,Ge).toString().trim();if(t.length>0)return t}catch{}}function Ye(e,t={}){let n=t._exec??s,r=qe(t._fileExists??g),i=[`auth`,`status`,...e?[`--hostname`,e]:[]],a=Je(n,r,[...i,`--json`,`hosts`]);if(a!==void 0){let t=Ze(a,e);if(t)return t}let o=Je(n,r,i);if(o!==void 0){let e=nt(o);if(e.length>0)return e}}function Xe(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}function Ze(e,t){let n;try{n=JSON.parse(e)}catch{return}let r=Xe(Xe(n)?.hosts);if(!r||t!==void 0&&r[t]===void 0)return;let i=t===void 0?Object.values(r):[r[t]],a=[];for(let e of i){if(!Array.isArray(e))return;for(let t of e){let e=Xe(t);if(!e)continue;let n=e.login;typeof n==`string`&&n.length!==0&&a.push({login:n,active:e.active===!0})}}return a}const Qe=/Logged in to \S+ account (\S+) \(/,$e=/(?:Failed to log in to|Timeout trying to log in to) \S+/,et=/^\s*-\s*Active account:\s*true\s*$/,tt=/\u001b\[[0-9;]*m/g;function nt(e){let t=[],n;for(let r of e.split(`
|
|
2
2
|
`)){let e=r.replace(tt,``),i=Qe.exec(e)?.[1];if(i){n={login:i,active:!1},t.push(n);continue}if($e.test(e)){n=void 0;continue}n&&et.test(e)&&(n.active=!0)}return t}const rt={stable:{appId:`com.inkeep.open-knowledge`,productName:`OpenKnowledge`,packageName:`@inkeep/open-knowledge-desktop`,linuxExecutableName:`openknowledge`,protocolScheme:`openknowledge`,linuxPackageNames:{deb:`openknowledge`,rpm:`OpenKnowledge`},cliCommandNames:[`ok`,`open-knowledge`],mcpServerName:`open-knowledge`,mcpChainTag:``,npmDistTag:`latest`,userHomeDirName:`.ok`,keyringService:`open-knowledge`},beta:{appId:`com.inkeep.open-knowledge.beta`,productName:`OpenKnowledge Beta`,packageName:`openknowledge-beta-desktop`,linuxExecutableName:`openknowledge-beta`,protocolScheme:`openknowledge-beta`,linuxPackageNames:{deb:`openknowledge-beta-desktop`,rpm:`openknowledge-beta-desktop`},cliCommandNames:[`ok-beta`,`open-knowledge-beta`],mcpServerName:`open-knowledge-beta`,mcpChainTag:`-beta`,npmDistTag:`beta`,userHomeDirName:`.ok-beta`,keyringService:`open-knowledge-beta`}};function it(e){return`${e.productName}.exe`}const at=rt.stable.productName,ot=`OK_CHANNEL`;function st(e){return Object.hasOwn(rt,e)}function ct(e){return e===`stable`?`${at} (Stable)`:st(e)?rt[e].productName:`${at} (${e})`}function eee(e){return(e.split(/[\\/]/).pop()??``).replace(/\.exe$/i,``)}function lt(e=globalThis.process?.env??{},t=globalThis.process?.execPath??``){let n=e[ot]?.trim().toLowerCase();if(n){if(st(n))return n;throw Error(`Unsupported ${ot}=${JSON.stringify(n)}. Expected ${Object.keys(rt).join(` or `)}.`)}let r=eee(t);for(let e of Object.keys(rt)){if(e===`stable`)continue;let t=rt[e];if(r===t.linuxExecutableName||r===t.productName||r.startsWith(`${t.productName} `))return e}return`stable`}function ut(){return rt[lt()]}function dt(){return ut().mcpServerName}const ft=[`claude`,`claude-desktop`,`cursor`,`codex`,`copilot`,`opencode`,`openclaw`,`pi`,`antigravity`,`lm-studio`,`hermes`],tee={claude:`Claude`,"claude-desktop":`Claude Desktop`,cursor:`Cursor`,codex:`Codex`,copilot:`GitHub Copilot`,opencode:`OpenCode`,openclaw:`OpenClaw`,pi:`Pi`,antigravity:`Antigravity`,"lm-studio":`LM Studio`,hermes:`Hermes`},pt={claude:`.claude/skills`,"claude-desktop":null,cursor:`.cursor/skills`,codex:`.codex/skills`,copilot:`.github/skills`,opencode:`.opencode/skills`,openclaw:null,pi:`.pi/skills`,antigravity:null,"lm-studio":null,hermes:null},mt={claude:`.claude/skills`,"claude-desktop":null,cursor:`.cursor/skills`,codex:`.codex/skills`,copilot:`.copilot/skills`,opencode:`.opencode/skills`,openclaw:null,pi:`.pi/agent/skills`,antigravity:`.gemini/skills`,"lm-studio":`.lmstudio/skills`,hermes:null},ht=[{editorId:`lm-studio`,dotDir:`.lmstudio`,scope:`project`},{editorId:`openclaw`,dotDir:`.openclaw`,scope:`global`}],gt=ft.filter(e=>pt[e]!==null),nee=ft.filter(e=>mt[e]!==null),_t=`open-knowledge`;ft.flatMap(e=>{let t=pt[e];return t===null?[]:[`${t}/${_t}/`]});const ree=gt.filter(e=>e!==`pi`&&e!==`copilot`).map(e=>({hostDir:(pt[e]??``).split(`/`)[0],editorId:e})),vt=ft.flatMap(e=>{let t=mt[e];if(t===null)return[];let n=t.split(`/`)[0];return n===void 0?[]:[{hostDir:n,skillsRoot:t,editorId:e}]}),yt={claude:`claude-code`,"claude-desktop":`claude-code`,cursor:`cursor`,codex:`codex`,copilot:`github-copilot-cli`,opencode:`opencode`,openclaw:`openclaw`,pi:`pi`,antigravity:`antigravity`,"lm-studio":`lm-studio`,hermes:`hermes`};function bt(e){return`.pi/extensions/${e.mcpServerName}.ts`}function xt(e){return`ok${e.mcpChainTag}`}bt(rt.stable);const iee=[`copilot`],aee=[`delete`,`move`,`share_link`,`install`,`import`],oee=[`claude`,`codex`,`opencode`,`cursor`,`copilot`,`pi`,`antigravity`,`openclaw`,`hermes`];var St;const Ct=Object.freeze({status:`aborted`});function F(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}var wt=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Tt=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(St=globalThis).__zod_globalConfig??(St.__zod_globalConfig={});const Et=globalThis.__zod_globalConfig;function Dt(e){return e&&Object.assign(Et,e),Et}function Ot(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function kt(e,t){return typeof t==`bigint`?t.toString():t}function At(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function jt(e){return e==null}function Mt(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function see(e,t){let n=e/t,r=Math.round(n),i=2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}const Nt=Symbol(`evaluating`);function Pt(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Nt)return r===void 0&&(r=Nt,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Ft(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function It(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Lt(e){return JSON.stringify(e)}function cee(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}const Rt=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function zt(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const lee=At(()=>{if(Et.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function Bt(e){if(zt(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return zt(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function Vt(e){return Bt(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const uee=new Set([`string`,`number`,`symbol`]);function Ht(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Ut(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function Wt(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function dee(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}const fee={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Gt(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return Ut(e,It(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return Ft(this,`shape`,e),e},checks:[]}))}function Kt(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return Ut(e,It(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return Ft(this,`shape`,r),r},checks:[]}))}function qt(e,t){if(!Bt(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Ut(e,It(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Ft(this,`shape`,n),n}}))}function Jt(e,t){if(!Bt(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Ut(e,It(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Ft(this,`shape`,n),n}}))}function pee(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return Ut(e,It(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return Ft(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function mee(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return Ut(t,It(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return Ft(this,`shape`,i),i},checks:[]}))}function hee(e,t,n){return Ut(t,It(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return Ft(this,`shape`,i),i}}))}function Yt(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function gee(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Xt(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Zt(e){return typeof e==`string`?e:e?.message}function Qt(e,t,n){let r=e.message?e.message:Zt(e.inst?._zod.def?.error?.(e))??Zt(t?.error?.(e))??Zt(n.customError?.(e))??Zt(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function $t(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function en(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}const tn=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,kt,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},nn=F(`$ZodError`,tn),rn=F(`$ZodError`,tn,{Parent:Error});function _ee(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function vee(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n}const an=e=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new wt;if(o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>Qt(e,a,Dt())));throw Rt(t,i?.callee),t}return o.value},on=e=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>Qt(e,a,Dt())));throw Rt(t,i?.callee),t}return o.value},sn=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new wt;return a.issues.length?{success:!1,error:new(e??nn)(a.issues.map(e=>Qt(e,i,Dt())))}:{success:!0,data:a.value}},yee=sn(rn),cn=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>Qt(e,i,Dt())))}:{success:!0,data:a.value}},bee=cn(rn),xee=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return an(e)(t,n,i)},See=e=>(t,n,r)=>an(e)(t,n,r),Cee=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return on(e)(t,n,i)},wee=e=>async(t,n,r)=>on(e)(t,n,r),Tee=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return sn(e)(t,n,i)},Eee=e=>(t,n,r)=>sn(e)(t,n,r),Dee=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return cn(e)(t,n,i)},Oee=e=>async(t,n,r)=>cn(e)(t,n,r),kee=/^[cC][0-9a-z]{6,}$/,Aee=/^[0-9a-z]+$/,jee=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Mee=/^[0-9a-vA-V]{20}$/,Nee=/^[A-Za-z0-9]{27}$/,Pee=/^[a-zA-Z0-9_-]{21}$/,Fee=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ln=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,un=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,dn=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;function fn(){return RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`)}const pn=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,mn=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,hn=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,gn=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,_n=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,vn=/^[A-Za-z0-9_-]*$/,yn=/^https?$/,bn=/^\+[1-9]\d{6,14}$/,xn=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,Sn=RegExp(`^${xn}$`);function Cn(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function wn(e){return RegExp(`^${Cn(e)}$`)}function Tn(e){let t=Cn({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${xn}T(?:${r})$`)}const Iee=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},Lee=/^-?\d+$/,En=/^-?\d+(?:\.\d+)?$/,Ree=/^(?:true|false)$/i,zee=/^null$/i,Bee=/^[^A-Z]*$/,Vee=/^[^a-z]*$/,Dn=F(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),On={number:`number`,bigint:`bigint`,object:`date`},kn=F(`$ZodCheckLessThan`,(e,t)=>{Dn.init(e,t);let n=On[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),An=F(`$ZodCheckGreaterThan`,(e,t)=>{Dn.init(e,t);let n=On[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Hee=F(`$ZodCheckMultipleOf`,(e,t)=>{Dn.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):see(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Uee=F(`$ZodCheckNumberFormat`,(e,t)=>{Dn.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=fee[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=Lee)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),Wee=F(`$ZodCheckMaxLength`,(e,t)=>{var n;Dn.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!jt(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=$t(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Gee=F(`$ZodCheckMinLength`,(e,t)=>{var n;Dn.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!jt(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=$t(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Kee=F(`$ZodCheckLengthEquals`,(e,t)=>{var n;Dn.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!jt(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=$t(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),jn=F(`$ZodCheckStringFormat`,(e,t)=>{var n,r;Dn.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),qee=F(`$ZodCheckRegex`,(e,t)=>{jn.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Jee=F(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Bee,jn.init(e,t)}),Yee=F(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Vee,jn.init(e,t)}),Xee=F(`$ZodCheckIncludes`,(e,t)=>{Dn.init(e,t);let n=Ht(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Zee=F(`$ZodCheckStartsWith`,(e,t)=>{Dn.init(e,t);let n=RegExp(`^${Ht(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Qee=F(`$ZodCheckEndsWith`,(e,t)=>{Dn.init(e,t);let n=RegExp(`.*${Ht(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),$ee=F(`$ZodCheckOverwrite`,(e,t)=>{Dn.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});var ete=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
3
3
|
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
|
|
4
4
|
`))}};const tte={major:4,minor:4,patch:3},Mn=F(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=tte;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=Yt(e),i;for(let a of t){if(a._zod.def.when){if(gee(e)||!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new wt;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=Yt(e,t))});else{if(e.issues.length===t)continue;r||=Yt(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(Yt(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new wt;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new wt;return o.then(e=>t(e,r,a))}return t(o,r,a)}}Pt(e,`~standard`,()=>({validate:t=>{try{let n=yee(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return bee(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),Nn=F(`$ZodString`,(e,t)=>{Mn.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Iee(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),Pn=F(`$ZodStringFormat`,(e,t)=>{jn.init(e,t),Nn.init(e,t)}),nte=F(`$ZodGUID`,(e,t)=>{t.pattern??=ln,Pn.init(e,t)}),rte=F(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=un(e)}else t.pattern??=un();Pn.init(e,t)}),ite=F(`$ZodEmail`,(e,t)=>{t.pattern??=dn,Pn.init(e,t)}),ate=F(`$ZodURL`,(e,t)=>{Pn.init(e,t),e._zod.check=n=>{try{let r=n.value.trim();if(!t.normalize&&t.protocol?.source===yn.source&&!/^https?:\/\//i.test(r)){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}let i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),n.value=t.normalize?i.href:r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),ote=F(`$ZodEmoji`,(e,t)=>{t.pattern??=fn(),Pn.init(e,t)}),ste=F(`$ZodNanoID`,(e,t)=>{t.pattern??=Pee,Pn.init(e,t)}),cte=F(`$ZodCUID`,(e,t)=>{t.pattern??=kee,Pn.init(e,t)}),lte=F(`$ZodCUID2`,(e,t)=>{t.pattern??=Aee,Pn.init(e,t)}),ute=F(`$ZodULID`,(e,t)=>{t.pattern??=jee,Pn.init(e,t)}),dte=F(`$ZodXID`,(e,t)=>{t.pattern??=Mee,Pn.init(e,t)}),fte=F(`$ZodKSUID`,(e,t)=>{t.pattern??=Nee,Pn.init(e,t)}),pte=F(`$ZodISODateTime`,(e,t)=>{t.pattern??=Tn(t),Pn.init(e,t)}),mte=F(`$ZodISODate`,(e,t)=>{t.pattern??=Sn,Pn.init(e,t)}),hte=F(`$ZodISOTime`,(e,t)=>{t.pattern??=wn(t),Pn.init(e,t)}),gte=F(`$ZodISODuration`,(e,t)=>{t.pattern??=Fee,Pn.init(e,t)}),_te=F(`$ZodIPv4`,(e,t)=>{t.pattern??=pn,Pn.init(e,t),e._zod.bag.format=`ipv4`}),vte=F(`$ZodIPv6`,(e,t)=>{t.pattern??=mn,Pn.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),yte=F(`$ZodCIDRv4`,(e,t)=>{t.pattern??=hn,Pn.init(e,t)}),bte=F(`$ZodCIDRv6`,(e,t)=>{t.pattern??=gn,Pn.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function Fn(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const xte=F(`$ZodBase64`,(e,t)=>{t.pattern??=_n,Pn.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{Fn(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function Ste(e){if(!vn.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Fn(t.padEnd(Math.ceil(t.length/4)*4,`=`))}const Cte=F(`$ZodBase64URL`,(e,t)=>{t.pattern??=vn,Pn.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{Ste(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),wte=F(`$ZodE164`,(e,t)=>{t.pattern??=bn,Pn.init(e,t)});function Tte(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}const Ete=F(`$ZodJWT`,(e,t)=>{Pn.init(e,t),e._zod.check=n=>{Tte(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),In=F(`$ZodNumber`,(e,t)=>{Mn.init(e,t),e._zod.pattern=e._zod.bag.pattern??En,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),Dte=F(`$ZodNumberFormat`,(e,t)=>{Uee.init(e,t),In.init(e,t)}),Ote=F(`$ZodBoolean`,(e,t)=>{Mn.init(e,t),e._zod.pattern=Ree,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),kte=F(`$ZodNull`,(e,t)=>{Mn.init(e,t),e._zod.pattern=zee,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),Ate=F(`$ZodUnknown`,(e,t)=>{Mn.init(e,t),e._zod.parse=e=>e}),jte=F(`$ZodNever`,(e,t)=>{Mn.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function Ln(e,t,n){e.issues.length&&t.issues.push(...Xt(n,e.issues)),t.value[n]=e.value}const Mte=F(`$ZodArray`,(e,t)=>{Mn.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>Ln(t,n,e))):Ln(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function Rn(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...Xt(n,e.issues))}if(!o&&!i){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}function zn(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=dee(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Bn(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin===`optional`,d=c.optout===`optional`;for(let i in t){if(i===`__proto__`||s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>Rn(e,n,i,t,u,d))):Rn(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}const Nte=F(`$ZodObject`,(e,t)=>{if(Mn.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}let n=At(()=>zn(t));Pt(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=zt,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optin===`optional`,i=n._zod.optout===`optional`,a=n._zod.run({value:s[e],issues:[]},o);a instanceof Promise?c.push(a.then(n=>Rn(n,t,e,s,r,i))):Rn(a,t,e,s,r,i)}return i?Bn(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),Pte=F(`$ZodObjectJIT`,(e,t)=>{Nte.init(e,t);let n=e._zod.parse,r=At(()=>zn(t)),i=e=>{let t=new ete([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=Lt(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=Lt(r),s=e[r],c=s?._zod?.optin===`optional`,l=s?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),c&&l?t.write(`
|
|
@@ -189,7 +189,7 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\
|
|
|
189
189
|
`)].join(`
|
|
190
190
|
`);case`REMOVED_KEY`:{let t=e.path.join(`.`),n=[`${e.source?`Removed key at ${e.source.file}:${e.source.line}:${e.source.column}`:`Removed key in configuration`}: ${t}`,e.redirect];if(e.source?.snippet&&e.source.snippet.length>0)for(let t of e.source.snippet.split(`
|
|
191
191
|
`))n.push(` ${t}`);return n.join(`
|
|
192
|
-
`)}case`NOT_SYNCED`:return`Settings are still loading. Try again in a moment.`;case`WRITE_ERROR`:return`Failed to write config file: ${e.detail}`;case`OKIGNORE_INVALID`:return e.lineNumber===void 0?`.okignore: ${e.detail}`:`.okignore line ${e.lineNumber}: ${e.detail}`;case`UNKNOWN`:return e.message??`Unknown error.`}}function Zie(e,t,n){return Cd([e,t,n],[])}function Cd(e,t){if(t.length>0){let n=Hl(Vl,t);if(n?.scope===`user`)return e[0];if(n?.scope===`project`)return e[1]??e[0];if(n?.scope===`project-local`)return e[2]??e[0]}let n=Qie(e);if(n===void 0)return;if(n===null)return null;if(Array.isArray(n)||typeof n!=`object`)return n;let r=e.map(e=>$ie(e)?e:void 0),i=new Set;for(let e of r)if(e!==void 0)for(let t of Object.keys(e))i.add(t);let a={};for(let e of i)a[e]=Cd(r.map(t=>t===void 0?void 0:t[e]),[...t,e]);return a}function Qie(e){for(let t=e.length-1;t>=0;t--)if(e[t]!==void 0)return e[t]}function $ie(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const eae=Object.freeze([`__config__/project`,`__local__/project`,`__user__/config.yml`,`__config__/okignore`]),wd=[`project`,`global`];function tae(e){return e.startsWith(`__skill__/`)||e.startsWith(`__template__/`)||e.startsWith(`__extskill__/`)}const Td=[`.mdx`,`.md`],Ed={cursor:/\bCursor(?:\([^)]+\))?\/\d/,codex:/\bCodex(?:\([^)]+\))?\/\d/,"claude-desktop":/\bClaude(?:\([^)]+\))?\/\d/},nae=rt.stable.mcpServerName,rae=[`exec`,`search`,`history`,`links`,`skills`,`config`,`palette`,`preview_url`,`share_link`,`lint`,`audit`,`write`,`edit`,`delete`,`move`,`install`,`import`,`checkpoint`,`restore_version`];function iae(e){if(e.length===0)return{ok:!1,reason:`docName must not be empty`};if(e.trim().length===0)return{ok:!1,reason:`docName must not be blank (whitespace only)`};if(e!==e.trim())return{ok:!1,reason:`docName must not have leading or trailing whitespace`};for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n<32||n===127)return{ok:!1,reason:`docName must not contain control characters`}}if(e.includes(`..`)||e.startsWith(`/`)||e.includes(`\\`))return{ok:!1,reason:`docName must not contain "..", a leading "/", or a backslash`};for(let t of e.split(`/`)){if(t.length===0)return{ok:!1,reason:`docName must not contain empty path segments (no leading, trailing, or doubled "/")`};if(t.startsWith(`.`))return{ok:!1,reason:`docName path segments must not start with "." (hidden files are not addressable)`}}return{ok:!0}}const Dd=B(I().min(1)).max(50),aae=U([`dormant`,`idle`,`fetching`,`pulling`,`pushing`,`conflict`,`offline`,`auth-error`,`disabled`]),oae=V({label:I().min(1),webUrl:Bi().nullable(),transport:U([`https`,`http`,`ssh`,`git`]).optional()}).loose(),sae=Xi(`checkStatus`,[V({checkStatus:W(`allowed`)}).loose(),V({checkStatus:W(`denied`),deniedReason:U([`no-collaborator`,`private-no-access`,`repo-not-found`,`not-authenticated`]),resolvedLogin:I().optional(),declaredLogin:I().optional(),declaredSource:I().optional()}).loose(),V({checkStatus:W(`unknown`),unknownError:U([`network`,`timeout`,`rate-limit`,`token-invalid`,`malformed-response`,`ssh-unverified`]).optional()}).loose()]),Od=U([`auth-403`,`auth-401`,`auth-scope-mismatch`,`auth-no-credential`,`auth-not-found-as-identity`,`semantic-protected-branch`]),cae=U(rc),lae=U([`succeeded`,`up-to-date`,`conflict`,`refused`,`error`]);V({state:aae,lastSyncUtc:I().nullable(),lastRunUtc:I().nullable().optional(),lastPullOkUtc:I().nullable().optional(),lastPushOkUtc:I().nullable().optional(),lastFetchUtc:I().nullable(),lastPushedSha:I().nullable(),ahead:L().int().min(0),behind:L().int().min(0),consecutiveFailures:L().int().min(0),consecutivePushFailures:L().int().min(0).optional(),conflictCount:L().int().min(0),hasRemote:R(),syncEnabled:R(),identityUnresolved:R(),remote:oae.nullable().optional(),pushError:I().optional(),pushErrorCode:Od.optional(),pullError:I().optional(),pullErrorCode:Od.optional(),pausedReason:I().optional(),blockingPaths:B(I().min(1)).optional(),refusedSymlinkPaths:Dd.optional(),pushPermission:sae.optional(),syncMode:cae.optional(),lastPullUtc:I().nullable().optional(),lastPullOutcome:lae.nullable().optional()}).loose(),V({action:U([`commit`]),paths:B(I().min(1)),commitSha:I().optional()}).loose(),V({action:U([`commit`])}).loose(),V({op:U([`sync`,`push`,`pull`,`fetch`]).optional()}).loose(),V({op:U([`sync`,`push`,`pull`,`fetch`])}).loose();const kd=U([`merge-native`,`working-tree`,`reconcile`]),Ad=U([`merged-with-markers`,`refused-conflict-markers`,`refused-no-base`,`refused-too-large`,`disk-markers`,`stale-external-write`]),uae=U([`mine`,`theirs`,`content`,`delete`]);V({conflicts:B(V({file:I().min(1),detectedAt:I().min(1),conflict:kd,reason:Ad.optional().catch(void 0),conflictKind:U([`git`,`stale-external-write`]).optional(),docName:I().nullable(),theirsSha:I().optional(),baseSha:I().optional()}).loose())}).loose(),V({file:I().min(1),strategy:U([`mine`,`theirs`,`content`,`delete`]),content:I().optional()}).loose().refine(e=>e.strategy!==`content`||e.content!==void 0,{message:`content must be provided when strategy is 'content' (an empty string keeps an empty file)`,path:[`content`]}),V({}).loose(),V({file:I().min(1),base:I(),ours:I(),theirs:I(),kind:U([`both-modified`,`delete-modify`,`modify-delete`]),conflict:kd,reason:Ad.optional().catch(void 0),conflictKind:U([`git`,`stale-external-write`]).optional(),resolutionOptions:B(uae)}).loose(),V({plan:la(e=>e!==void 0,{message:`plan is required`})}).loose(),V({plan:la(e=>e!==void 0,{message:`plan is required`})}).loose(),V({result:la(e=>e!==void 0,{message:`result is required`})}).loose(),V({packId:I().min(1)}).strict(),V({installedHosts:B(I()),skills:B(V({name:I().min(1),created:R()}).strict())}).strict();const dae=V({path:I().min(1),summary:I().min(1)}).loose(),fae=V({files:L().int().nonnegative(),folders:L().int().nonnegative()}).loose();V({packs:B(V({id:I().min(1),name:I().min(1),description:I().min(1),defaultSubfolder:I().optional(),folders:B(dae),entryCounts:fae}).loose())}).loose(),V({noOpen:R().optional(),out:I().min(1).optional()}).loose();const pae=V({reason:U([`unsupported-platform`,`spawn-error`]),message:I()}).loose();Xi(`status`,[V({status:W(`installed`),outputPath:I(),size:L().int().nonnegative(),sha256:I(),skillVersion:I()}).loose(),V({status:W(`built`),outputPath:I(),size:L().int().nonnegative(),sha256:I(),skillVersion:I(),handoffError:pae.optional()}).loose(),V({status:W(`failed`),buildError:I()}).loose(),V({status:W(`skip-current`),skillVersion:I(),recordedAt:I().optional()}).loose()]),Xi(`kind`,[V({kind:W(`doc`),docPath:I().min(1)}).loose(),V({kind:W(`folder`),folderPath:I()}).loose()]);const jd=U([`no-remote`,`detached-head`,`branch-not-on-origin`,`non-github-remote`,`invalid-path`,`unsupported-share-url`]),Md=U([`current`,`stale`,`absent`,`empty`]);Xi(`ok`,[V({ok:W(!0),shareUrl:I().min(1),sharedUrl:I().min(1),branch:I().min(1),freshness:Md.optional().catch(void 0)}).loose(),V({ok:W(!1),error:jd,branch:I().min(1).optional()}).loose()]);const mae=U([`user`,`org`]),hae=V({login:I().min(1),kind:mae,avatarUrl:I().optional()}).loose(),Nd=U([`auth-required`,`network`]);Xi(`ok`,[V({ok:W(!0),owners:B(hae)}).loose(),V({ok:W(!1),error:Nd}).loose()]),Xi(`ok`,[V({ok:W(!0),available:R()}).loose(),V({ok:W(!1),error:Nd}).loose()]);const gae=U([`public`,`private`]);V({owner:I().min(1),name:I().min(1),visibility:gae,description:I().optional()}).loose();const _ae=U([`name-conflict`,`saml-sso`,`auth-required`,`push-failed`,`init-failed`,`network`,`no-project`]);Xi(`ok`,[V({ok:W(!0),ownerLogin:I().min(1),repoName:I().min(1),cloneUrl:I().min(1),defaultBranch:I().min(1)}).loose(),V({ok:W(!1),error:_ae}).loose()]);function Pd(e){return!(typeof e!=`string`||e.length===0||e.startsWith(`-`)||/[\x00-\x1F\x7F]/.test(e)||/\s/.test(e)||e.includes(`:`)||e.split(`/`).includes(`..`))}const Fd=e=>e.refine(Pd,`invalid branch name`),Id={shareTargetExists:R(),dirtyConflicts:V({conflicts:R(),files:B(I().min(1))}).loose(),branchIsLocal:R(),shareTargetOnOriginBranch:R().optional()};Xi(`detached`,[V({detached:W(!1),currentBranch:I().min(1).nullable(),currentHeadSha:Ui(),...Id}).loose(),V({detached:W(!0),currentBranch:Ui(),currentHeadSha:I().min(1),...Id}).loose()]),V({branch:Fd(I().min(1)),principalId:I().optional(),fastForward:R().optional()}).loose();const vae=U([`dirty-conflict`,`branch-not-found`,`fetch-failed`,`checkout-failed`,`branch-in-other-worktree`,`ff-diverged`,`unsafe-symlinks`,`symlink-check-failed`]);Xi(`ok`,[V({ok:W(!0)}).loose(),V({ok:W(!1),reason:vae,files:B(I().min(1)).optional(),otherWorktreePath:I().min(1).optional(),refusedSymlinkPaths:Dd.optional()}).loose()]),U([`on-origin`,`renamed`,`deleted`,`never-on-branch`,`changed-locally`,`unknown`]),V({branch:Fd(I().min(1)),path:I(),kind:U([`doc`,`folder`]),contentRootDepth:L().int().min(1).max(65535).optional()}).loose(),Xi(`verdict`,[V({verdict:W(`on-origin`)}).loose(),V({verdict:W(`renamed`),renamedTo:I().min(1)}).loose(),V({verdict:W(`deleted`)}).loose(),V({verdict:W(`never-on-branch`)}).loose(),V({verdict:W(`changed-locally`)}).loose(),V({verdict:W(`unknown`)}).loose()]).catch({verdict:`unknown`});function yae(e){return e>=0&&e<=31&&e!==9&&e!==10&&e!==13}function Ld(e,t,n=[]){for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);if(yae(i)){t.addIssue({code:`custom`,path:n,params:{contentControlAdmission:!0},message:`Disallowed content control U+${i.toString(16).toUpperCase().padStart(4,`0`)} at zero-based UTF-16 offset ${r}. C0 controls allow only TAB, LF and CR. Remove the character or replace it with a printable escape such as \\u0000.`});return}}}const Rd=I().superRefine(Ld);function zd(e,t){let n=iae(e);n.ok||t.addIssue({code:`custom`,message:n.reason})}const Bd=I().superRefine(zd).optional(),bae=I().superRefine(zd),Vd={agentId:I().optional(),agentName:I().optional(),colorSeed:I().optional(),clientName:I().optional(),clientVersion:I().optional(),label:I().optional()},Hd=I().optional(),xae=/^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Sae=V({startedAt:I().min(1),httpListenMs:L().nonnegative().optional(),seedWalkMs:L().nonnegative().optional(),indexesMs:L().nonnegative().optional(),readyMs:L().nonnegative().optional(),fileCount:L().nonnegative().optional()});V({serverInstanceId:I().min(1),currentBranch:I().min(1).optional(),currentDiskAckSVs:H(I().min(1),I().min(1)).optional(),boot:Sae.optional(),collabClients:L().int().nonnegative().optional(),runtimeVersion:I().min(1).optional(),protocolVersion:L().int().positive().optional()}).loose(),V({id:I().min(1),display_name:I().min(1),display_email:I(),source:U([`git-config`,`synthesized`]),created_at:I().min(1)}).loose(),V({collabUrl:I().nullable(),previewUrl:I().nullable(),port:L(),singleFile:R().default(!1)}).loose();const Ud=U(`urn:ok:error:malformed-upload.urn:ok:error:collision-exhaustion.urn:ok:error:storage-full.urn:ok:error:storage-readonly.urn:ok:error:storage-error.urn:ok:error:no-file-received.urn:ok:error:path-escape.urn:ok:error:symlink-refused.urn:ok:error:links-not-permitted.urn:ok:error:method-not-allowed.urn:ok:error:invalid-request.urn:ok:error:unsupported-media-type.urn:ok:error:payload-too-large.urn:ok:error:request-timeout.urn:ok:error:internal-server-error.urn:ok:error:derived-index-unavailable.urn:ok:error:loopback-required.urn:ok:error:invalid-origin.urn:ok:error:url-not-allowed.urn:ok:error:dir-outside-home.urn:ok:error:concurrent-operation.urn:ok:error:clone-failed.urn:ok:error:clone-timeout.urn:ok:error:server-start-failed.urn:ok:error:reserved-doc-name.urn:ok:error:target-not-found.urn:ok:error:stale-target.urn:ok:error:frontmatter-edit-not-supported.urn:ok:error:invalid-frontmatter-patch.urn:ok:error:frontmatter-malformed.urn:ok:error:no-active-session.urn:ok:error:too-many-agent-sessions.urn:ok:error:disk-divergence.urn:ok:error:stale-external-write.urn:ok:error:store-refused.urn:ok:error:doc-removed.urn:ok:error:doc-not-found.urn:ok:error:doc-already-exists.urn:ok:error:doc-not-open.urn:ok:error:rollback-not-configured.urn:ok:error:doc-not-available.urn:ok:error:backlink-index-not-configured.urn:ok:error:file-rescan-not-configured.urn:ok:error:shadow-not-configured.urn:ok:error:host-not-allowed.urn:ok:error:principal-not-available.urn:ok:error:not-found.urn:ok:error:auth-failed.urn:ok:error:no-project-dir.urn:ok:error:non-github-origin.urn:ok:error:server-open-failed.urn:ok:error:doc-in-conflict.urn:ok:error:concurrent-overwrite-refused.urn:ok:error:unresolved-conflict-markers.urn:ok:error:no-conflict-tracked.urn:ok:error:no-blocking-changes.urn:ok:error:sync-not-active.urn:ok:error:project-repo-not-configured.urn:ok:error:seed-prerequisite-missing.urn:ok:error:seed-invalid-root.urn:ok:error:tag-index-not-configured.urn:ok:error:template-not-found.urn:ok:error:unsupported-asset-type.urn:ok:error:asset-not-found.urn:ok:error:single-file-mode.urn:ok:error:collab-server-not-running.urn:ok:error:gateway-timeout.urn:ok:error:cursor-not-installed.urn:ok:error:cursor-spawn-timeout.urn:ok:error:cursor-spawn-failed.urn:ok:error:handoff-target-not-installed.urn:ok:error:handoff-spawn-timeout.urn:ok:error:handoff-spawn-failed.urn:ok:error:registry-unreachable.urn:ok:error:config-not-writable.urn:ok:error:audit-superseded.urn:ok:error:theme-name-taken.urn:ok:error:theme-name-invalid`.split(`.`)),Cae=V({type:Ud,title:I().min(1),status:L().int().min(400).max(599),instance:I().regex(xae,`instance must be urn:uuid:<uuid>`).optional(),detail:I().optional()}).loose();V({parentDocName:I().min(1),placement:U([`configured-attachments`,`parent-dir`]).default(`configured-attachments`),agentId:I().min(1).optional(),agentName:I().min(1).optional()}).loose(),V({src:I().min(1),path:I().min(1).optional(),deduped:R().optional()}).loose(),V({url:I().min(1),dir:I().min(1),branch:I().min(1).refine(Pd,`invalid branch name`).optional()}).loose(),V({type:W(`error`),problem:Cae}).loose(),V({docName:Bd,summary:Hd,content:Rd.optional(),...Vd}).loose(),V({docName:Bd,summary:Hd,markdown:Rd,position:U([`append`,`prepend`,`replace`]).optional(),extension:U(Td).optional(),...Vd}).loose(),V({docName:Bd,summary:Hd,find:I().min(1),replace:Rd,offset:L().int().nonnegative().optional(),...Vd}).loose(),V({docName:Bd,connectionId:I().min(1),scope:U([`last`,`session`,`file`,`count`]).optional(),count:L().int().positive().optional(),...Vd}).loose().refine(e=>e.scope!==`count`||e.count!==void 0,{message:`count is required when scope is 'count'`,path:[`count`]});const Wd=V({value:I(),truncatedFrom:L().int().nonnegative().optional(),hint:I().optional()}).loose(),wae=Xi(`kind`,[V({kind:W(`inline`),content:I()}),V({kind:W(`truncated`),byteLength:L().int().nonnegative(),hint:I()})]),Gd=V({kind:W(`content-divergence`),intendedBytes:L().int().nonnegative(),actualBytes:L().int().nonnegative(),byteDelta:L().int(),divergenceType:I().optional(),currentState:wae.optional(),hint:I().optional()}).loose(),Tae=V({type:W(`orphan`),parentCandidates:B(I()),message:I()}).loose(),Kd=V({kind:W(`disk-edit-reconciled`),intendedBytes:L().int().nonnegative(),actualBytes:L().int().nonnegative(),byteDelta:L().int(),mergeOutcome:I().optional(),hint:I().optional()}).loose();Xi(`kind`,[Gd,Kd]);const Eae=Object.keys({"content-divergence":!0,"disk-edit-reconciled":!0}),Dae=V({kind:W(`mermaid-parse-error`),fenceIndex:L().int().positive(),fenceFirstLine:I(),message:I(),line:L().int().positive().optional()}).loose(),qd=V({href:I(),targetKind:I(),role:I(),sourceForm:I(),resolvedTarget:I().nullable(),reason:I(),resolutionMethod:I(),fallbackTarget:I().nullable().optional(),definition:V({line:L().int().nonnegative(),label:I()}).loose().optional()}).loose(),Jd=Xi(`kind`,[Gd,Kd,Dae,V({kind:W(`lint-violation`),source:I(),code:I(),message:I(),severity:U([`error`,`warning`,`info`,`hint`]),line:L().int().positive(),column:L().int().positive(),linkTarget:I().optional(),localTarget:qd.optional()}).loose(),V({kind:W(`link-check-deferred`),message:I()}).loose()]),Yd=B(Jd).min(1),Xd=V({href:I(),resolvedTo:I().nullable(),reason:U([`no-such-doc`,`no-such-file`,`unresolvable`,`excluded`]),localTarget:qd.optional()}).loose(),Zd=B(Xd),Qd=V({reason:I().min(1),count:L().int().positive()}).loose();V({timestamp:I().min(1),summary:Wd.optional(),warnings:Yd.optional()}).loose(),V({timestamp:I().min(1),subscriberCount:L().int().nonnegative(),systemSubscriberCount:L().int().nonnegative(),hints:B(Tae).optional(),summary:Wd.optional(),warnings:Yd.optional(),brokenLinks:Zd,brokenLinkSuppression:Qd.optional()}).loose(),V({timestamp:I().min(1),subscriberCount:L().int().nonnegative(),systemSubscriberCount:L().int().nonnegative(),summary:Wd.optional(),warnings:Yd.optional(),brokenLinks:Zd,brokenLinkSuppression:Qd.optional()}).loose(),V({docName:I().min(1),scope:U([`last`,`session`,`count`]),undone:R()}).loose(),V({docs:B(V({docName:bae,markdown:Rd,position:U([`append`,`prepend`,`replace`]).optional(),extension:U(Td).optional(),summary:Hd}).loose()).min(1).max(100),...Vd}).loose();const Oae=V({type:Ud,title:I(),detail:I().optional()}).loose(),kae=Xi(`status`,[V({status:W(`written`),docName:I().min(1),summary:Wd.optional(),warnings:Yd.optional(),brokenLinks:Zd,brokenLinkSuppression:Qd.optional()}).loose(),V({status:W(`error`),docName:I().min(1),error:Oae}).loose()]);V({timestamp:I().min(1),results:B(kae),written:L().int().nonnegative(),failed:L().int().nonnegative()}).loose(),V({docName:Bd,patch:H(I(),Yi([no,Ui()])),types:H(I(),U(eo)).optional(),summary:Hd,...Vd}).loose(),V({timestamp:I().min(1),subscriberCount:L().int().nonnegative(),systemSubscriberCount:L().int().nonnegative(),appliedKeys:B(I()),summary:Wd.optional(),warnings:Yd.optional(),brokenLinks:Zd,brokenLinkSuppression:Qd.optional()}).loose();function $d(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}const ef=uf(/[A-Za-z]/),tf=uf(/[\dA-Za-z]/),Aae=uf(/[#-'*+\--9=?A-Z^-~]/);function nf(e){return e!==null&&(e<32||e===127)}const rf=uf(/\d/),jae=uf(/[\dA-Fa-f]/),Mae=uf(/[!-/:-@[-`{-~]/);function af(e){return e!==null&&e<-2}function of(e){return e!==null&&(e<0||e===32)}function sf(e){return e===-2||e===-1||e===32}const cf=uf(/\p{P}|\p{S}/u),lf=uf(/\s/);function uf(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function df(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}const ff=(function(e,t,n,r,i){let a=pf(t);if(n!=null&&(typeof n!=`number`||n<0||n===1/0))throw Error(`Expected positive finite index`);if(r!=null&&(!ff(r)||!r.children))throw Error(`Expected parent node`);if(r==null!=(n==null))throw Error(`Expected both parent and index`);return hf(e)?a.call(i,e,n,r):!1}),pf=(function(e){if(e==null)return Iae;if(typeof e==`function`)return mf(e);if(typeof e==`object`)return Array.isArray(e)?Nae(e):Pae(e);if(typeof e==`string`)return Fae(e);throw Error(`Expected function, string, or object as test`)});function Nae(e){let t=[],n=-1;for(;++n<e.length;)t[n]=pf(e[n]);return mf(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function Pae(e){let t=e;return mf(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function Fae(e){return mf(t);function t(t){return t&&t.type===e}}function mf(e){return t;function t(t,n,r){return!!(hf(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function Iae(){return!0}function hf(e){return typeof e==`object`&&!!e&&`type`in e}function Lae(e){return`\x1B[33m`+e+`\x1B[39m`}const gf=[],_f=`skip`;function vf(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=pf(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+Lae(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=gf,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=Rae(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function Rae(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?gf:[e]}function zae(e,t,n){let r=pf((n||{}).ignore||[]),i=Bae(t),a=-1;for(;++a<i.length;)vf(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function Bae(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([Vae(e[0]),Hae(e[1])])}return t}function Vae(e){return typeof e==`string`?new RegExp(df(e),`g`):e}function Hae(e){return typeof e==`function`?e:function(){return e}}const yf=`phrasing`,bf=[`autolink`,`link`,`image`,`label`];function Uae(){return{transforms:[Xae],enter:{literalAutolink:Gae,literalAutolinkEmail:xf,literalAutolinkHttp:xf,literalAutolinkWww:xf},exit:{literalAutolink:Yae,literalAutolinkEmail:Jae,literalAutolinkHttp:Kae,literalAutolinkWww:qae}}}function Wae(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:yf,notInConstruct:bf},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:yf,notInConstruct:bf},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:yf,notInConstruct:bf}]}}function Gae(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function xf(e){this.config.enter.autolinkProtocol.call(this,e)}function Kae(e){this.config.exit.autolinkProtocol.call(this,e)}function qae(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function Jae(e){this.config.exit.autolinkEmail.call(this,e)}function Yae(e){this.exit(e)}function Xae(e){zae(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Zae],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,Qae]],{ignore:[`link`,`linkReference`]})}function Zae(e,t,n,r,i){let a=``;if(!Sf(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!$ae(n)))return!1;let o=eoe(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function Qae(e,t,n,r){return!Sf(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function $ae(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function eoe(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=$d(e,`(`),a=$d(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function Sf(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||lf(n)||cf(n))&&(!t||n!==47)}function Cf(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}wf.peek=loe;function toe(){this.buffer()}function noe(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function roe(){this.buffer()}function ioe(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function aoe(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Cf(this.sliceSerialize(e)).toLowerCase(),n.label=t}function ooe(e){this.exit(e)}function soe(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Cf(this.sliceSerialize(e)).toLowerCase(),n.label=t}function coe(e){this.exit(e)}function loe(){return`[`}function wf(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function uoe(){return{enter:{gfmFootnoteCallString:toe,gfmFootnoteCall:noe,gfmFootnoteDefinitionLabelString:roe,gfmFootnoteDefinition:ioe},exit:{gfmFootnoteCallString:aoe,gfmFootnoteCall:ooe,gfmFootnoteDefinitionLabelString:soe,gfmFootnoteDefinition:coe}}}function doe(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:wf},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
|
|
192
|
+
`)}case`NOT_SYNCED`:return`Settings are still loading. Try again in a moment.`;case`WRITE_ERROR`:return`Failed to write config file: ${e.detail}`;case`OKIGNORE_INVALID`:return e.lineNumber===void 0?`.okignore: ${e.detail}`:`.okignore line ${e.lineNumber}: ${e.detail}`;case`UNKNOWN`:return e.message??`Unknown error.`}}function Zie(e,t,n){return Cd([e,t,n],[])}function Cd(e,t){if(t.length>0){let n=Hl(Vl,t);if(n?.scope===`user`)return e[0];if(n?.scope===`project`)return e[1]??e[0];if(n?.scope===`project-local`)return e[2]??e[0]}let n=Qie(e);if(n===void 0)return;if(n===null)return null;if(Array.isArray(n)||typeof n!=`object`)return n;let r=e.map(e=>$ie(e)?e:void 0),i=new Set;for(let e of r)if(e!==void 0)for(let t of Object.keys(e))i.add(t);let a={};for(let e of i)a[e]=Cd(r.map(t=>t===void 0?void 0:t[e]),[...t,e]);return a}function Qie(e){for(let t=e.length-1;t>=0;t--)if(e[t]!==void 0)return e[t]}function $ie(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const eae=Object.freeze([`__config__/project`,`__local__/project`,`__user__/config.yml`,`__config__/okignore`]),wd=[`project`,`global`];function tae(e){return e.startsWith(`__skill__/`)||e.startsWith(`__template__/`)||e.startsWith(`__extskill__/`)}const Td=[`.mdx`,`.md`],Ed={cursor:/\bCursor(?:\([^)]+\))?\/\d/,codex:/\bCodex(?:\([^)]+\))?\/\d/,"claude-desktop":/\bClaude(?:\([^)]+\))?\/\d/},nae=rt.stable.mcpServerName,rae=[`exec`,`search`,`history`,`links`,`skills`,`config`,`palette`,`preview_url`,`share_link`,`lint`,`audit`,`write`,`edit`,`delete`,`move`,`install`,`import`,`checkpoint`,`restore_version`];function iae(e){if(e.length===0)return{ok:!1,reason:`docName must not be empty`};if(e.trim().length===0)return{ok:!1,reason:`docName must not be blank (whitespace only)`};if(e!==e.trim())return{ok:!1,reason:`docName must not have leading or trailing whitespace`};for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n<32||n===127)return{ok:!1,reason:`docName must not contain control characters`}}if(e.includes(`..`)||e.startsWith(`/`)||e.includes(`\\`))return{ok:!1,reason:`docName must not contain "..", a leading "/", or a backslash`};for(let t of e.split(`/`)){if(t.length===0)return{ok:!1,reason:`docName must not contain empty path segments (no leading, trailing, or doubled "/")`};if(t.startsWith(`.`))return{ok:!1,reason:`docName path segments must not start with "." (hidden files are not addressable)`}}return{ok:!0}}const Dd=B(I().min(1)).max(50),aae=U([`dormant`,`idle`,`fetching`,`pulling`,`pushing`,`conflict`,`offline`,`auth-error`,`disabled`]),oae=V({label:I().min(1),webUrl:Bi().nullable(),transport:U([`https`,`http`,`ssh`,`git`]).optional()}).loose(),sae=Xi(`checkStatus`,[V({checkStatus:W(`allowed`)}).loose(),V({checkStatus:W(`denied`),deniedReason:U([`no-collaborator`,`private-no-access`,`repo-not-found`,`not-authenticated`]),resolvedLogin:I().optional(),declaredLogin:I().optional(),declaredSource:I().optional()}).loose(),V({checkStatus:W(`unknown`),unknownError:U([`network`,`timeout`,`rate-limit`,`token-invalid`,`malformed-response`,`ssh-unverified`]).optional()}).loose()]),Od=U([`auth-403`,`auth-401`,`auth-scope-mismatch`,`auth-no-credential`,`auth-not-found-as-identity`,`semantic-protected-branch`]),cae=U(rc),lae=U([`succeeded`,`up-to-date`,`conflict`,`refused`,`error`]);V({state:aae,lastSyncUtc:I().nullable(),lastRunUtc:I().nullable().optional(),lastPullOkUtc:I().nullable().optional(),lastPushOkUtc:I().nullable().optional(),lastFetchUtc:I().nullable(),lastPushedSha:I().nullable(),ahead:L().int().min(0),behind:L().int().min(0),consecutiveFailures:L().int().min(0),consecutivePushFailures:L().int().min(0).optional(),conflictCount:L().int().min(0),hasRemote:R(),syncEnabled:R(),identityUnresolved:R(),remote:oae.nullable().optional(),pushError:I().optional(),pushErrorCode:Od.optional(),pullError:I().optional(),pullErrorCode:Od.optional(),pausedReason:I().optional(),blockingPaths:B(I().min(1)).optional(),refusedSymlinkPaths:Dd.optional(),pushPermission:sae.optional(),syncMode:cae.optional(),lastPullUtc:I().nullable().optional(),lastPullOutcome:lae.nullable().optional()}).loose(),V({action:U([`commit`]),paths:B(I().min(1)),commitSha:I().optional()}).loose(),V({action:U([`commit`])}).loose(),V({op:U([`sync`,`push`,`pull`,`fetch`]).optional()}).loose(),V({op:U([`sync`,`push`,`pull`,`fetch`])}).loose();const kd=U([`merge-native`,`working-tree`,`reconcile`]),Ad=U([`merged-with-markers`,`refused-conflict-markers`,`refused-no-base`,`refused-too-large`,`disk-markers`,`stale-external-write`]),uae=U([`mine`,`theirs`,`content`,`delete`]);V({conflicts:B(V({file:I().min(1),detectedAt:I().min(1),conflict:kd,reason:Ad.optional().catch(void 0),conflictKind:U([`git`,`stale-external-write`]).optional(),docName:I().nullable(),theirsSha:I().optional(),baseSha:I().optional()}).loose())}).loose(),V({file:I().min(1),strategy:U([`mine`,`theirs`,`content`,`delete`]),content:I().optional()}).loose().refine(e=>e.strategy!==`content`||e.content!==void 0,{message:`content must be provided when strategy is 'content' (an empty string keeps an empty file)`,path:[`content`]}),V({}).loose(),V({file:I().min(1),base:I(),ours:I(),theirs:I(),kind:U([`both-modified`,`delete-modify`,`modify-delete`]),conflict:kd,reason:Ad.optional().catch(void 0),conflictKind:U([`git`,`stale-external-write`]).optional(),resolutionOptions:B(uae)}).loose(),V({plan:la(e=>e!==void 0,{message:`plan is required`})}).loose(),V({plan:la(e=>e!==void 0,{message:`plan is required`})}).loose(),V({result:la(e=>e!==void 0,{message:`result is required`})}).loose(),V({packId:I().min(1)}).strict(),V({installedHosts:B(I()),skills:B(V({name:I().min(1),created:R()}).strict())}).strict();const dae=V({path:I().min(1),summary:I().min(1)}).loose(),fae=V({files:L().int().nonnegative(),folders:L().int().nonnegative()}).loose();V({packs:B(V({id:I().min(1),name:I().min(1),description:I().min(1),defaultSubfolder:I().optional(),folders:B(dae),entryCounts:fae}).loose())}).loose(),V({noOpen:R().optional(),out:I().min(1).optional()}).loose();const pae=V({reason:U([`unsupported-platform`,`spawn-error`]),message:I()}).loose();Xi(`status`,[V({status:W(`installed`),outputPath:I(),size:L().int().nonnegative(),sha256:I(),skillVersion:I()}).loose(),V({status:W(`built`),outputPath:I(),size:L().int().nonnegative(),sha256:I(),skillVersion:I(),handoffError:pae.optional()}).loose(),V({status:W(`failed`),buildError:I()}).loose(),V({status:W(`skip-current`),skillVersion:I(),recordedAt:I().optional()}).loose()]),Xi(`kind`,[V({kind:W(`doc`),docPath:I().min(1)}).loose(),V({kind:W(`folder`),folderPath:I()}).loose()]);const jd=U([`no-remote`,`detached-head`,`branch-not-on-origin`,`non-github-remote`,`invalid-path`,`unsupported-share-url`]),Md=U([`current`,`stale`,`absent`,`empty`]);Xi(`ok`,[V({ok:W(!0),shareUrl:I().min(1),sharedUrl:I().min(1),branch:I().min(1),freshness:Md.optional().catch(void 0)}).loose(),V({ok:W(!1),error:jd,branch:I().min(1).optional()}).loose()]);const mae=U([`user`,`org`]),hae=V({login:I().min(1),kind:mae,avatarUrl:I().optional()}).loose(),Nd=U([`auth-required`,`network`]);Xi(`ok`,[V({ok:W(!0),owners:B(hae)}).loose(),V({ok:W(!1),error:Nd}).loose()]),Xi(`ok`,[V({ok:W(!0),available:R()}).loose(),V({ok:W(!1),error:Nd}).loose()]);const gae=U([`public`,`private`]);V({owner:I().min(1),name:I().min(1),visibility:gae,description:I().optional()}).loose();const _ae=U([`name-conflict`,`saml-sso`,`auth-required`,`push-failed`,`init-failed`,`network`,`no-project`]);Xi(`ok`,[V({ok:W(!0),ownerLogin:I().min(1),repoName:I().min(1),cloneUrl:I().min(1),defaultBranch:I().min(1)}).loose(),V({ok:W(!1),error:_ae}).loose()]);function Pd(e){return!(typeof e!=`string`||e.length===0||e.startsWith(`-`)||/[\x00-\x1F\x7F]/.test(e)||/\s/.test(e)||e.includes(`:`)||e.split(`/`).includes(`..`))}const Fd=e=>e.refine(Pd,`invalid branch name`),Id={shareTargetExists:R(),dirtyConflicts:V({conflicts:R(),files:B(I().min(1))}).loose(),branchIsLocal:R(),shareTargetOnOriginBranch:R().optional()};Xi(`detached`,[V({detached:W(!1),currentBranch:I().min(1).nullable(),currentHeadSha:Ui(),...Id}).loose(),V({detached:W(!0),currentBranch:Ui(),currentHeadSha:I().min(1),...Id}).loose()]),V({branch:Fd(I().min(1)),principalId:I().optional(),fastForward:R().optional()}).loose();const vae=U([`dirty-conflict`,`branch-not-found`,`fetch-failed`,`checkout-failed`,`branch-in-other-worktree`,`ff-diverged`,`unsafe-symlinks`,`symlink-check-failed`]);Xi(`ok`,[V({ok:W(!0)}).loose(),V({ok:W(!1),reason:vae,files:B(I().min(1)).optional(),otherWorktreePath:I().min(1).optional(),refusedSymlinkPaths:Dd.optional()}).loose()]),U([`on-origin`,`renamed`,`deleted`,`never-on-branch`,`changed-locally`,`unknown`]),V({branch:Fd(I().min(1)),path:I(),kind:U([`doc`,`folder`]),contentRootDepth:L().int().min(1).max(65535).optional()}).loose(),Xi(`verdict`,[V({verdict:W(`on-origin`)}).loose(),V({verdict:W(`renamed`),renamedTo:I().min(1)}).loose(),V({verdict:W(`deleted`)}).loose(),V({verdict:W(`never-on-branch`)}).loose(),V({verdict:W(`changed-locally`)}).loose(),V({verdict:W(`unknown`)}).loose()]).catch({verdict:`unknown`});function yae(e){return e>=0&&e<=31&&e!==9&&e!==10&&e!==13}function Ld(e,t,n=[]){for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);if(yae(i)){t.addIssue({code:`custom`,path:n,params:{contentControlAdmission:!0},message:`Disallowed content control U+${i.toString(16).toUpperCase().padStart(4,`0`)} at zero-based UTF-16 offset ${r}. C0 controls allow only TAB, LF and CR. Remove the character or replace it with a printable escape such as \\u0000.`});return}}}const Rd=I().superRefine(Ld);function zd(e,t){let n=iae(e);n.ok||t.addIssue({code:`custom`,message:n.reason})}const Bd=I().superRefine(zd).optional(),bae=I().superRefine(zd),Vd={agentId:I().optional(),agentName:I().optional(),colorSeed:I().optional(),clientName:I().optional(),clientVersion:I().optional(),label:I().optional()},Hd=I().optional(),xae=/^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Sae=V({startedAt:I().min(1),httpListenMs:L().nonnegative().optional(),seedWalkMs:L().nonnegative().optional(),indexesMs:L().nonnegative().optional(),readyMs:L().nonnegative().optional(),fileCount:L().nonnegative().optional()});V({serverInstanceId:I().min(1),currentBranch:I().min(1).optional(),currentDiskAckSVs:H(I().min(1),I().min(1)).optional(),boot:Sae.optional(),collabClients:L().int().nonnegative().optional(),runtimeVersion:I().min(1).optional(),protocolVersion:L().int().positive().optional()}).loose(),V({id:I().min(1),display_name:I().min(1),display_email:I(),source:U([`git-config`,`synthesized`]),created_at:I().min(1)}).loose(),V({collabUrl:I().nullable(),previewUrl:I().nullable(),port:L(),singleFile:R().default(!1)}).loose();const Ud=U(`urn:ok:error:malformed-upload.urn:ok:error:collision-exhaustion.urn:ok:error:storage-full.urn:ok:error:storage-readonly.urn:ok:error:storage-error.urn:ok:error:no-file-received.urn:ok:error:path-escape.urn:ok:error:symlink-refused.urn:ok:error:links-not-permitted.urn:ok:error:method-not-allowed.urn:ok:error:invalid-request.urn:ok:error:unsupported-media-type.urn:ok:error:payload-too-large.urn:ok:error:request-timeout.urn:ok:error:internal-server-error.urn:ok:error:derived-index-unavailable.urn:ok:error:loopback-required.urn:ok:error:invalid-origin.urn:ok:error:url-not-allowed.urn:ok:error:dir-outside-home.urn:ok:error:concurrent-operation.urn:ok:error:clone-failed.urn:ok:error:clone-timeout.urn:ok:error:server-start-failed.urn:ok:error:reserved-doc-name.urn:ok:error:target-not-found.urn:ok:error:stale-target.urn:ok:error:frontmatter-edit-not-supported.urn:ok:error:invalid-frontmatter-patch.urn:ok:error:frontmatter-malformed.urn:ok:error:no-active-session.urn:ok:error:too-many-agent-sessions.urn:ok:error:disk-divergence.urn:ok:error:stale-external-write.urn:ok:error:store-refused.urn:ok:error:doc-removed.urn:ok:error:branch-switched.urn:ok:error:doc-not-found.urn:ok:error:doc-already-exists.urn:ok:error:doc-not-open.urn:ok:error:rollback-not-configured.urn:ok:error:doc-not-available.urn:ok:error:backlink-index-not-configured.urn:ok:error:file-rescan-not-configured.urn:ok:error:shadow-not-configured.urn:ok:error:host-not-allowed.urn:ok:error:principal-not-available.urn:ok:error:not-found.urn:ok:error:auth-failed.urn:ok:error:no-project-dir.urn:ok:error:non-github-origin.urn:ok:error:server-open-failed.urn:ok:error:doc-in-conflict.urn:ok:error:concurrent-overwrite-refused.urn:ok:error:unresolved-conflict-markers.urn:ok:error:no-conflict-tracked.urn:ok:error:no-blocking-changes.urn:ok:error:sync-not-active.urn:ok:error:project-repo-not-configured.urn:ok:error:seed-prerequisite-missing.urn:ok:error:seed-invalid-root.urn:ok:error:tag-index-not-configured.urn:ok:error:template-not-found.urn:ok:error:unsupported-asset-type.urn:ok:error:asset-not-found.urn:ok:error:single-file-mode.urn:ok:error:collab-server-not-running.urn:ok:error:gateway-timeout.urn:ok:error:cursor-not-installed.urn:ok:error:cursor-spawn-timeout.urn:ok:error:cursor-spawn-failed.urn:ok:error:handoff-target-not-installed.urn:ok:error:handoff-spawn-timeout.urn:ok:error:handoff-spawn-failed.urn:ok:error:registry-unreachable.urn:ok:error:config-not-writable.urn:ok:error:audit-superseded.urn:ok:error:theme-name-taken.urn:ok:error:theme-name-invalid`.split(`.`)),Cae=V({type:Ud,title:I().min(1),status:L().int().min(400).max(599),instance:I().regex(xae,`instance must be urn:uuid:<uuid>`).optional(),detail:I().optional()}).loose();V({parentDocName:I().min(1),placement:U([`configured-attachments`,`parent-dir`]).default(`configured-attachments`),agentId:I().min(1).optional(),agentName:I().min(1).optional()}).loose(),V({src:I().min(1),path:I().min(1).optional(),deduped:R().optional()}).loose(),V({url:I().min(1),dir:I().min(1),branch:I().min(1).refine(Pd,`invalid branch name`).optional()}).loose(),V({type:W(`error`),problem:Cae}).loose(),V({docName:Bd,summary:Hd,content:Rd.optional(),...Vd}).loose(),V({docName:Bd,summary:Hd,markdown:Rd,position:U([`append`,`prepend`,`replace`]).optional(),extension:U(Td).optional(),...Vd}).loose(),V({docName:Bd,summary:Hd,find:I().min(1),replace:Rd,offset:L().int().nonnegative().optional(),...Vd}).loose(),V({docName:Bd,connectionId:I().min(1),scope:U([`last`,`session`,`file`,`count`]).optional(),count:L().int().positive().optional(),...Vd}).loose().refine(e=>e.scope!==`count`||e.count!==void 0,{message:`count is required when scope is 'count'`,path:[`count`]});const Wd=V({value:I(),truncatedFrom:L().int().nonnegative().optional(),hint:I().optional()}).loose(),wae=Xi(`kind`,[V({kind:W(`inline`),content:I()}),V({kind:W(`truncated`),byteLength:L().int().nonnegative(),hint:I()})]),Gd=V({kind:W(`content-divergence`),intendedBytes:L().int().nonnegative(),actualBytes:L().int().nonnegative(),byteDelta:L().int(),divergenceType:I().optional(),currentState:wae.optional(),hint:I().optional()}).loose(),Tae=V({type:W(`orphan`),parentCandidates:B(I()),message:I()}).loose(),Kd=V({kind:W(`disk-edit-reconciled`),intendedBytes:L().int().nonnegative(),actualBytes:L().int().nonnegative(),byteDelta:L().int(),mergeOutcome:I().optional(),hint:I().optional()}).loose();Xi(`kind`,[Gd,Kd]);const Eae=Object.keys({"content-divergence":!0,"disk-edit-reconciled":!0}),Dae=V({kind:W(`mermaid-parse-error`),fenceIndex:L().int().positive(),fenceFirstLine:I(),message:I(),line:L().int().positive().optional()}).loose(),qd=V({href:I(),targetKind:I(),role:I(),sourceForm:I(),resolvedTarget:I().nullable(),reason:I(),resolutionMethod:I(),fallbackTarget:I().nullable().optional(),definition:V({line:L().int().nonnegative(),label:I()}).loose().optional()}).loose(),Jd=Xi(`kind`,[Gd,Kd,Dae,V({kind:W(`lint-violation`),source:I(),code:I(),message:I(),severity:U([`error`,`warning`,`info`,`hint`]),line:L().int().positive(),column:L().int().positive(),linkTarget:I().optional(),localTarget:qd.optional()}).loose(),V({kind:W(`link-check-deferred`),message:I()}).loose()]),Yd=B(Jd).min(1),Xd=V({href:I(),resolvedTo:I().nullable(),reason:U([`no-such-doc`,`no-such-file`,`unresolvable`,`excluded`]),localTarget:qd.optional()}).loose(),Zd=B(Xd),Qd=V({reason:I().min(1),count:L().int().positive()}).loose();V({timestamp:I().min(1),summary:Wd.optional(),warnings:Yd.optional()}).loose(),V({timestamp:I().min(1),subscriberCount:L().int().nonnegative(),systemSubscriberCount:L().int().nonnegative(),hints:B(Tae).optional(),summary:Wd.optional(),warnings:Yd.optional(),brokenLinks:Zd,brokenLinkSuppression:Qd.optional()}).loose(),V({timestamp:I().min(1),subscriberCount:L().int().nonnegative(),systemSubscriberCount:L().int().nonnegative(),summary:Wd.optional(),warnings:Yd.optional(),brokenLinks:Zd,brokenLinkSuppression:Qd.optional()}).loose(),V({docName:I().min(1),scope:U([`last`,`session`,`count`]),undone:R()}).loose(),V({docs:B(V({docName:bae,markdown:Rd,position:U([`append`,`prepend`,`replace`]).optional(),extension:U(Td).optional(),summary:Hd}).loose()).min(1).max(100),...Vd}).loose();const Oae=V({type:Ud,title:I(),detail:I().optional()}).loose(),kae=Xi(`status`,[V({status:W(`written`),docName:I().min(1),summary:Wd.optional(),warnings:Yd.optional(),brokenLinks:Zd,brokenLinkSuppression:Qd.optional()}).loose(),V({status:W(`error`),docName:I().min(1),error:Oae}).loose()]);V({timestamp:I().min(1),results:B(kae),written:L().int().nonnegative(),failed:L().int().nonnegative()}).loose(),V({docName:Bd,patch:H(I(),Yi([no,Ui()])),types:H(I(),U(eo)).optional(),summary:Hd,...Vd}).loose(),V({timestamp:I().min(1),subscriberCount:L().int().nonnegative(),systemSubscriberCount:L().int().nonnegative(),appliedKeys:B(I()),summary:Wd.optional(),warnings:Yd.optional(),brokenLinks:Zd,brokenLinkSuppression:Qd.optional()}).loose();function $d(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}const ef=uf(/[A-Za-z]/),tf=uf(/[\dA-Za-z]/),Aae=uf(/[#-'*+\--9=?A-Z^-~]/);function nf(e){return e!==null&&(e<32||e===127)}const rf=uf(/\d/),jae=uf(/[\dA-Fa-f]/),Mae=uf(/[!-/:-@[-`{-~]/);function af(e){return e!==null&&e<-2}function of(e){return e!==null&&(e<0||e===32)}function sf(e){return e===-2||e===-1||e===32}const cf=uf(/\p{P}|\p{S}/u),lf=uf(/\s/);function uf(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function df(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}const ff=(function(e,t,n,r,i){let a=pf(t);if(n!=null&&(typeof n!=`number`||n<0||n===1/0))throw Error(`Expected positive finite index`);if(r!=null&&(!ff(r)||!r.children))throw Error(`Expected parent node`);if(r==null!=(n==null))throw Error(`Expected both parent and index`);return hf(e)?a.call(i,e,n,r):!1}),pf=(function(e){if(e==null)return Iae;if(typeof e==`function`)return mf(e);if(typeof e==`object`)return Array.isArray(e)?Nae(e):Pae(e);if(typeof e==`string`)return Fae(e);throw Error(`Expected function, string, or object as test`)});function Nae(e){let t=[],n=-1;for(;++n<e.length;)t[n]=pf(e[n]);return mf(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function Pae(e){let t=e;return mf(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function Fae(e){return mf(t);function t(t){return t&&t.type===e}}function mf(e){return t;function t(t,n,r){return!!(hf(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function Iae(){return!0}function hf(e){return typeof e==`object`&&!!e&&`type`in e}function Lae(e){return`\x1B[33m`+e+`\x1B[39m`}const gf=[],_f=`skip`;function vf(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=pf(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+Lae(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=gf,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=Rae(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function Rae(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?gf:[e]}function zae(e,t,n){let r=pf((n||{}).ignore||[]),i=Bae(t),a=-1;for(;++a<i.length;)vf(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function Bae(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([Vae(e[0]),Hae(e[1])])}return t}function Vae(e){return typeof e==`string`?new RegExp(df(e),`g`):e}function Hae(e){return typeof e==`function`?e:function(){return e}}const yf=`phrasing`,bf=[`autolink`,`link`,`image`,`label`];function Uae(){return{transforms:[Xae],enter:{literalAutolink:Gae,literalAutolinkEmail:xf,literalAutolinkHttp:xf,literalAutolinkWww:xf},exit:{literalAutolink:Yae,literalAutolinkEmail:Jae,literalAutolinkHttp:Kae,literalAutolinkWww:qae}}}function Wae(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:yf,notInConstruct:bf},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:yf,notInConstruct:bf},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:yf,notInConstruct:bf}]}}function Gae(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function xf(e){this.config.enter.autolinkProtocol.call(this,e)}function Kae(e){this.config.exit.autolinkProtocol.call(this,e)}function qae(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function Jae(e){this.config.exit.autolinkEmail.call(this,e)}function Yae(e){this.exit(e)}function Xae(e){zae(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Zae],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,Qae]],{ignore:[`link`,`linkReference`]})}function Zae(e,t,n,r,i){let a=``;if(!Sf(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!$ae(n)))return!1;let o=eoe(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function Qae(e,t,n,r){return!Sf(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function $ae(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function eoe(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=$d(e,`(`),a=$d(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function Sf(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||lf(n)||cf(n))&&(!t||n!==47)}function Cf(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}wf.peek=loe;function toe(){this.buffer()}function noe(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function roe(){this.buffer()}function ioe(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function aoe(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Cf(this.sliceSerialize(e)).toLowerCase(),n.label=t}function ooe(e){this.exit(e)}function soe(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Cf(this.sliceSerialize(e)).toLowerCase(),n.label=t}function coe(e){this.exit(e)}function loe(){return`[`}function wf(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function uoe(){return{enter:{gfmFootnoteCallString:toe,gfmFootnoteCall:noe,gfmFootnoteDefinitionLabelString:roe,gfmFootnoteDefinition:ioe},exit:{gfmFootnoteCallString:aoe,gfmFootnoteCall:ooe,gfmFootnoteDefinitionLabelString:soe,gfmFootnoteDefinition:coe}}}function doe(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:wf},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
|
|
193
193
|
`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?Tf:foe))),s(),o}}function foe(e,t,n){return t===0?e:Tf(e,t,n)}function Tf(e,t,n){return(n?``:` `)+e}const poe=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];Ef.peek=voe;function moe(){return{canContainEols:[`delete`],enter:{strikethrough:goe},exit:{strikethrough:_oe}}}function hoe(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:poe}],handlers:{delete:Ef}}}function goe(e){this.enter({type:`delete`,children:[]},e)}function _oe(e){this.exit(e)}function Ef(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function voe(){return`~`}function yoe(e){return e.length}function boe(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||yoe,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=xoe(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=Df(r[d]);else{let e=Df(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&(n.alignDelimiters!==!1||i!==``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
|
|
194
194
|
`)}function xoe(e){return e==null?``:String(e)}function Df(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}const Of={}.hasOwnProperty;function kf(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&Of.call(t,e)){let n=String(t[e]);i=Of.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const Soe={}.hasOwnProperty;function Af(e,t){let n=-1,r;if(t.extensions)for(;++n<t.extensions.length;)Af(e,t.extensions[n]);for(r in t)if(Soe.call(t,r))switch(r){case`extensions`:break;case`unsafe`:jf(e[r],t[r]);break;case`join`:jf(e[r],t[r]);break;case`handlers`:Coe(e[r],t[r]);break;default:e.options[r]=t[r]}return e}function jf(e,t){t&&e.push(...t)}function Coe(e,t){t&&Object.assign(e,t)}function woe(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),Toe);return i(),o}function Toe(e,t,n){return`>`+(n?``:` `)+e}function Mf(e,t){return Nf(e,t.inConstruct,!0)&&!Nf(e,t.notInConstruct,!1)}function Nf(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Pf(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
195
195
|
`&&Mf(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
|
|
@@ -736,7 +736,7 @@ caused by: `+i(o,t)):a},a=e=>i(e,new Set),o=(e,t,i)=>{if(!n(e))return``;let a=i?
|
|
|
736
736
|
`)return`
|
|
737
737
|
`}return e&&e.eol||`
|
|
738
738
|
`}function k4(e,t){return`\r
|
|
739
|
-
`.indexOf(e.charAt(t))!==-1}var A4;(function(e){e.DEFAULT={allowTrailingComma:!1}})(A4||={});function cDe(e,t=[],n=A4.DEFAULT){let r=null,i=[],a=[];function o(e){Array.isArray(i)?i.push(e):r!==null&&(i[r]=e)}return P4(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 j4(e,t=[],n=A4.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}P4(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:lDe(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 M4(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 N4(e){switch(e.type){case`array`:return e.children.map(N4);case`object`:let t=Object.create(null);for(let n of e.children){let e=n.children[1];e&&(t[n.children[0].value]=N4(e))}return t;case`null`:case`string`:case`number`:case`boolean`:return e.value;default:return}}function P4(e,t,n=A4.DEFAULT){let r=S4(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)}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}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 lDe(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 uDe(e,t,n,r){let i=t.slice(),a=j4(e,[]),o,s;for(;i.length>0&&(s=i.pop(),o=M4(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 F4(e,{offset:a?a.offset:0,length:a?a.length:0,content:JSON.stringify(n)},r)}if(o.type===`object`&&typeof s==`string`&&Array.isArray(o.children)){let t=M4(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 F4(e,{offset:i,length:a-i,content:``},r)}return F4(e,{offset:t.offset,length:t.length,content:JSON.stringify(n)},r)}{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 F4(e,a,r)}}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 F4(e,i,r)}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 F4(e,i,r)}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 F4(e,t,r)}throw Error(`Can not ${n===void 0?`remove`:r.isArrayInsertion?`insert`:`modify`} Array index ${t} as length is not sufficient`)}throw Error(`Can not add ${typeof s==`number`?`property`:`index`} to parent of type ${o.type}`)}function F4(e,t,n){if(!n.formattingOptions)return[t];let r=I4(e,t),i=t.offset,a=t.offset+t.content.length;if(t.length===0||t.content.length===0){for(;i>0&&!k4(r,i-1);)i--;for(;a<r.length&&!k4(r,a);)a++}let o=aDe(r,{offset:i,length:a-i},{...n.formattingOptions,keepLines:!1});for(let e=o.length-1;e>=0;e--){let t=o[e];r=I4(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 I4(e,t){return e.substring(0,t.offset)+t.content+e.substring(t.offset+t.length)}var dDe;(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`})(dDe||={});var fDe;(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`})(fDe||={});const pDe=cDe,mDe=j4,L4=N4;var hDe;(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`})(hDe||={});function R4(e,t,n,r){return uDe(e,t,n,r)}function z4(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=I4(e,i);else throw Error(`Overlapping edit`);r=i.offset}return e}const gDe=global.Request;var B4=class extends gDe{constructor(e,t){if(typeof e==`object`&&J4 in e){let n=t!==void 0&&`body`in t&&t.body!=null;if(e[r3]&&!n)throw TypeError(`Cannot construct a Request with a Request object that has already been used.`);e=e[J4]()}t?.body?.getReader!==void 0&&(t.duplex??=`half`),super(e,t)}};const V4=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)},_De=Symbol(`wrapBodyStream`),vDe=new Set([`latin1`,`binary`,`hex`,`base64`,`base64url`]),yDe=e=>e===null||vDe.has(e),H4=Symbol(`bodyBufferedBeforeDisconnect`),U4=Symbol(`bodyBufferedLengthBeforeDisconnect`),W4=(e,t)=>Buffer.isBuffer(e)?e:Buffer.from(e,t??`utf8`),G4=e=>!(e instanceof He)&&!!e.complete&&!!e.readableAborted&&typeof e.read==`function`&&yDe(e.readableEncoding),K4=(e,t)=>{if(e.readableDidRead&&!t||!G4(e))return;let n=e;if(n[H4]!==void 0)return n[H4];let r,i=e.errored;if(i&&i.code!==`ECONNRESET`)r=i;else if(n[U4]!==void 0&&e.readableLength!==n[U4])r=o3();else{let n=t??[],i=e.read();i!==null&&n.push(W4(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=o3())}}return n[H4]=r,r},q4=(e,t)=>{if(t instanceof Error){e.error(t);return}t.length>0&&e.enqueue(t),e.close()},bDe=(e,t,n,r,i)=>{let a={method:e,headers:n,signal:i.signal};if(e===`TRACE`){a.method=`GET`;let e=new B4(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[_De]){let e;a.body=new ReadableStream({async pull(t){try{if(!e){let e=K4(r);if(e!==void 0){q4(t,e);return}}e||=Ie.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=K4(r);a.body=e===void 0?Ie.toWeb(r):new ReadableStream({start(t){q4(t,e)}})}}return new B4(t,a)},J4=Symbol(`getRequestCache`),Y4=Symbol(`requestCache`),X4=Symbol(`incomingKey`),Z4=Symbol(`urlKey`),xDe=Symbol(`methodKey`),Q4=Symbol(`headersKey`),$4=Symbol(`abortControllerKey`),e3=Symbol(`getAbortController`),SDe=Symbol(`abortRequest`),t3=Symbol(`bodyBuffer`),n3=Symbol(`bodyReadPromise`),r3=Symbol(`bodyConsumedDirectly`),i3=Symbol(`bodyLockReader`),a3=Symbol(`abortReason`),o3=()=>TypeError(`Body is unusable`),s3=()=>Promise.reject(o3()),CDe=new TextDecoder,wDe=e=>{if(e[r3])return s3();e[r3]=!0},TDe=e=>e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength),EDe=e=>(e[Q4]||=V4(e[X4])).get(`content-type`)||``,DDe=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,ODe=e=>{if(!DDe.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.`)},c3=(e,t,n)=>{if(e[r3])return s3();let r=e.method;if(r===`GET`||r===`HEAD`)return e[J4]()[t]();let i=ODe(r);if(i)return Promise.reject(i);if(e[Y4]&&r!==`TRACE`)return e[Y4][t]();let a=wDe(e);if(a)return a;let o=kDe(e);if(o){let t=Promise.resolve(n(o,e));return e[t3]=void 0,t}return ADe(e).then(t=>{let r=n(t,e);return e[t3]=void 0,r})},kDe=e=>{let t=e[X4];if(`rawBody`in t&&t.rawBody instanceof Buffer)return t.rawBody},l3=(e,t)=>{if(t.errored)return t.errored;let n=e[a3];return n===void 0?Error(`Client connection prematurely closed.`):n instanceof Error?n:Error(String(n))},ADe=e=>{if(e[t3])return Promise.resolve(e[t3]);if(e[n3])return e[n3];let t=e[X4];if(t.readableDidRead)return s3();let n=K4(t);if(n!==void 0)return n instanceof Error?Promise.reject(n):(e[t3]=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!G4(t)||s&&s.code!==`ECONNRESET`?!1:(o(()=>{let o=K4(t,i);o instanceof Error?r(o):o===void 0?r(a??l3(e,t)):(e[t3]=o,n(o))}),!0)},c=e=>{i.push(W4(e,t.readableEncoding))},l=()=>{o(()=>{let t=i.length===1?i[0]:Buffer.concat(i);e[t3]=t,n(t)})},u=e=>{s(e)||o(()=>{r(e)})},d=()=>{if(t.readableEnded){l();return}s()||o(()=>{r(l3(e,t))})},f=()=>{t.off(`data`,c),t.off(`end`,l),t.off(`error`,u),t.off(`close`,d),e[n3]=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[n3]=r,r},u3={get method(){return this[xDe]},get url(){return this[Z4]},get headers(){return this[Q4]||=V4(this[X4])},[SDe](e){this[a3]===void 0&&(this[a3]=e);let t=this[$4];t&&!t.signal.aborted&&t.abort(e)},[e3](){return this[$4]||=new AbortController,this[a3]!==void 0&&!this[$4].signal.aborted&&this[$4].abort(this[a3]),this[$4]},[J4](){let e=this[e3]();if(this[Y4])return this[Y4];let t=this.method;if(this[r3]&&t!==`GET`&&t!==`HEAD`){this[t3]=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 B4(this[Z4],n);return t===`TRACE`&&Object.defineProperty(r,"method",{get(){return`TRACE`}}),this[Y4]=r}return this[Y4]=bDe(this.method,this[Z4],this.headers,this[X4],e)},get body(){if(!this[r3])return this[J4]().body;let e=this[J4]();return!this[i3]&&e.body&&(this[i3]=e.body.getReader()),e.body},get bodyUsed(){return this[r3]?!0:this[Y4]?this[Y4].bodyUsed:!1}};Object.defineProperty(u3,"signal",{get(){return this[e3]().signal}}),[`cache`,`credentials`,`destination`,`integrity`,`mode`,`redirect`,`referrer`,`referrerPolicy`,`keepalive`].forEach(e=>{Object.defineProperty(u3,e,{get(){return this[J4]()[e]}})}),[`clone`,`formData`].forEach(e=>{Object.defineProperty(u3,e,{value:function(){if(this[r3]){if(e===`clone`)throw o3();return s3()}return this[J4]()[e]()}})}),Object.defineProperty(u3,"text",{value:function(){return c3(this,`text`,e=>CDe.decode(e))}}),Object.defineProperty(u3,"arrayBuffer",{value:function(){return c3(this,`arrayBuffer`,e=>TDe(e))}}),Object.defineProperty(u3,"blob",{value:function(){return c3(this,`blob`,(e,t)=>{let n=EDe(t);return new Response(e,n?{headers:{"content-type":n}}:void 0).blob()})}}),Object.defineProperty(u3,"json",{value:function(){return this[r3]?s3():this.text().then(JSON.parse)}}),Object.defineProperty(u3,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[Y4]},{...t,depth:e==null?null:e-1})}`}}),Object.setPrototypeOf(u3,B4.prototype);const d3=Symbol(`responseCache`),f3=Symbol(`getResponseCache`),p3=Symbol(`cache`),m3=global.Response;var h3=class e{#e;#t;[f3](){let e=this[p3],t=e&&e[2]instanceof Headers?e[2]:void 0;return delete this[p3],this[d3]||=new m3(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 m3){let t=n[d3];if(t){this.#t=t,this[f3]();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[p3]=[n?.status||200,t??null,r||n?.headers])}get headers(){let e=this[p3];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[f3]().headers}get status(){return this[p3]?.[0]??this[f3]().status}get ok(){let e=this.status;return e>=200&&e<300}};[`body`,`bodyUsed`,`redirected`,`statusText`,`trailers`,`type`,`url`].forEach(e=>{Object.defineProperty(h3.prototype,e,{get(){return this[f3]()[e]}})}),[`arrayBuffer`,`blob`,`clone`,`formData`,`json`,`text`].forEach(e=>{Object.defineProperty(h3.prototype,e,{value:function(){return this[f3]()[e]()}})}),Object.defineProperty(h3.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[d3]},{...t,depth:e==null?null:e-1})}`}}),Object.setPrototypeOf(h3,m3),Object.setPrototypeOf(h3.prototype,m3.prototype);const jDe=/^https?:\/\/[!#-;=?-[\]_a-z~A-Z]+$/,MDe=e=>e instanceof URL?e.href:jDe.test(e)?e:new URL(e).href,NDe=new Set([301,302,303,307,308]);Object.defineProperty(h3,"redirect",{value:function(e,t=302){if(!NDe.has(t))throw RangeError(`Invalid status code`);return new h3(null,{status:t,headers:{location:MDe(e)}})},writable:!0,configurable:!0}),Object.defineProperty(h3,"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 h3(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`}});function PDe(e,t){let n;try{n=E(e)}catch{return t.map(({editor:e,root:t})=>({host:e,root:t,state:`absent`}))}let r=e=>{let t=M(n,e);if(!(t===``||t.startsWith(`..`)||A(t)))return t.split(le).join(`/`)};return t.map(({editor:t,root:i})=>{let a=j(e,i),o;try{o=_(a)}catch{return{host:t,root:i,state:`absent`}}let s;try{s=E(a)}catch{return{host:t,root:i,state:`absent`}}if(o.isSymbolicLink()){let e=r(s);return{host:t,root:i,state:`linked`,real:s,...e?{target:e}:{}}}if(s!==j(n,i)){let e=r(s);return{host:t,root:i,state:`linked-parent`,real:s,...e?{target:e}:{}}}return{host:t,root:i,state:`own`,real:s}})}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: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()}return(t=e.match(r.twoOctet))?(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})():(t=e.match(r.threeOctet))?(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})():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)}))();const FDe={"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`},g3=la(e=>e!==null&&(typeof e==`object`||typeof e==`function`)),_3=Yi([I(),L().int()]),v3=I();qi({ttl:L().optional(),pollInterval:L().optional()});const IDe=V({ttl:L().optional()}),LDe=V({taskId:I()}),y3=qi({progressToken:_3.optional(),"io.modelcontextprotocol/related-task":LDe.optional()}),b3=V({_meta:y3.optional()}),x3=b3.extend({task:IDe.optional()}),S3=V({method:I(),params:b3.loose().optional()}),C3=V({_meta:y3.optional()}),w3=V({method:I(),params:C3.loose().optional()}),T3=qi({_meta:y3.optional()}),E3=Yi([I(),L().int()]),RDe=V({jsonrpc:W(`2.0`),id:E3,...S3.shape}).strict(),zDe=V({jsonrpc:W(`2.0`),...w3.shape}).strict(),D3=V({jsonrpc:W(`2.0`),id:E3,result:T3}).strict();var BDe;(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`})(BDe||={});const O3=V({jsonrpc:W(`2.0`),id:E3.optional(),error:V({code:L().int(),message:I(),data:z().optional()})}).strict();Yi([RDe,zDe,D3,O3]),Yi([D3,O3]);const k3=T3.strict(),VDe=C3.extend({requestId:E3.optional(),reason:I().optional()}),A3=w3.extend({method:W(`notifications/cancelled`),params:VDe}),j3=V({icons:B(V({src:I(),mimeType:I().optional(),sizes:B(I()).optional(),theme:U([`light`,`dark`]).optional()})).optional()}),M3=V({name:I(),title:I().optional()}),N3=M3.extend({...M3.shape,...j3.shape,version:I(),websiteUrl:I().optional(),description:I().optional()}),HDe=ua(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,Zi(V({form:Zi(V({applyDefaults:R().optional()}),H(I(),z())).optional(),url:g3.optional()}),H(I(),z()).optional())),UDe=qi({list:g3.optional(),cancel:g3.optional(),requests:qi({sampling:qi({createMessage:g3.optional()}).optional(),elicitation:qi({create:g3.optional()}).optional()}).optional()}),WDe=qi({list:g3.optional(),cancel:g3.optional(),requests:qi({tools:qi({call:g3.optional()}).optional()}).optional()}),GDe=V({experimental:H(I(),g3).optional(),sampling:V({context:g3.optional(),tools:g3.optional()}).optional(),elicitation:HDe.optional(),roots:V({listChanged:R().optional()}).optional(),tasks:UDe.optional(),extensions:H(I(),g3).optional()}),KDe=b3.extend({protocolVersion:I(),capabilities:GDe,clientInfo:N3}),qDe=S3.extend({method:W(`initialize`),params:KDe}),JDe=V({experimental:H(I(),g3).optional(),logging:g3.optional(),completions:g3.optional(),prompts:V({listChanged:R().optional()}).optional(),resources:V({subscribe:R().optional(),listChanged:R().optional()}).optional(),tools:V({listChanged:R().optional()}).optional(),tasks:WDe.optional(),extensions:H(I(),g3).optional()}),YDe=T3.extend({protocolVersion:I(),capabilities:JDe,serverInfo:N3,instructions:I().optional()}),XDe=w3.extend({method:W(`notifications/initialized`),params:C3.optional()}),P3=S3.extend({method:W(`ping`),params:b3.optional()}),ZDe=V({progress:L(),total:na(L()),message:na(I())}),QDe=V({...C3.shape,...ZDe.shape,progressToken:_3}),F3=w3.extend({method:W(`notifications/progress`),params:QDe}),$De=b3.extend({cursor:v3.optional()}),I3=S3.extend({params:$De.optional()}),L3=T3.extend({nextCursor:v3.optional()}),eOe=U([`working`,`input_required`,`completed`,`failed`,`cancelled`]),R3=V({taskId:I(),status:eOe,ttl:Yi([L(),Ui()]),createdAt:I(),lastUpdatedAt:I(),pollInterval:na(L()),statusMessage:na(I())}),z3=T3.extend({task:R3}),tOe=C3.merge(R3),B3=w3.extend({method:W(`notifications/tasks/status`),params:tOe}),V3=S3.extend({method:W(`tasks/get`),params:b3.extend({taskId:I()})}),H3=T3.merge(R3),U3=S3.extend({method:W(`tasks/result`),params:b3.extend({taskId:I()})});T3.loose();const W3=I3.extend({method:W(`tasks/list`)}),G3=L3.extend({tasks:B(R3)}),K3=S3.extend({method:W(`tasks/cancel`),params:b3.extend({taskId:I()})});T3.merge(R3);const q3=V({uri:I(),mimeType:na(I()),_meta:H(I(),z()).optional()}),J3=q3.extend({text:I()}),Y3=I().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),X3=q3.extend({blob:Y3}),Z3=U([`user`,`assistant`]),Q3=V({audience:B(Z3).optional(),priority:L().min(0).max(1).optional(),lastModified:Ci({offset:!0}).optional()}),$3=V({...M3.shape,...j3.shape,uri:I(),description:na(I()),mimeType:na(I()),size:na(L()),annotations:Q3.optional(),_meta:na(qi({}))}),nOe=V({...M3.shape,...j3.shape,uriTemplate:I(),description:na(I()),mimeType:na(I()),annotations:Q3.optional(),_meta:na(qi({}))}),rOe=I3.extend({method:W(`resources/list`)}),iOe=L3.extend({resources:B($3)}),aOe=I3.extend({method:W(`resources/templates/list`)}),oOe=L3.extend({resourceTemplates:B(nOe)}),e6=b3.extend({uri:I()}),sOe=e6,cOe=S3.extend({method:W(`resources/read`),params:sOe}),lOe=T3.extend({contents:B(Yi([J3,X3]))}),uOe=w3.extend({method:W(`notifications/resources/list_changed`),params:C3.optional()}),dOe=e6,fOe=S3.extend({method:W(`resources/subscribe`),params:dOe}),pOe=e6,mOe=S3.extend({method:W(`resources/unsubscribe`),params:pOe}),hOe=C3.extend({uri:I()}),gOe=w3.extend({method:W(`notifications/resources/updated`),params:hOe}),_Oe=V({name:I(),description:na(I()),required:na(R())}),vOe=V({...M3.shape,...j3.shape,description:na(I()),arguments:na(B(_Oe)),_meta:na(qi({}))}),yOe=I3.extend({method:W(`prompts/list`)}),bOe=L3.extend({prompts:B(vOe)}),xOe=b3.extend({name:I(),arguments:H(I(),I()).optional()}),SOe=S3.extend({method:W(`prompts/get`),params:xOe}),t6=V({type:W(`text`),text:I(),annotations:Q3.optional(),_meta:H(I(),z()).optional()}),n6=V({type:W(`image`),data:Y3,mimeType:I(),annotations:Q3.optional(),_meta:H(I(),z()).optional()}),r6=V({type:W(`audio`),data:Y3,mimeType:I(),annotations:Q3.optional(),_meta:H(I(),z()).optional()}),COe=V({type:W(`tool_use`),name:I(),id:I(),input:H(I(),z()),_meta:H(I(),z()).optional()}),wOe=V({type:W(`resource`),resource:Yi([J3,X3]),annotations:Q3.optional(),_meta:H(I(),z()).optional()}),i6=Yi([t6,n6,r6,$3.extend({type:W(`resource_link`)}),wOe]),TOe=V({role:Z3,content:i6}),EOe=T3.extend({description:I().optional(),messages:B(TOe)}),DOe=w3.extend({method:W(`notifications/prompts/list_changed`),params:C3.optional()}),OOe=V({title:I().optional(),readOnlyHint:R().optional(),destructiveHint:R().optional(),idempotentHint:R().optional(),openWorldHint:R().optional()}),kOe=V({taskSupport:U([`required`,`optional`,`forbidden`]).optional()}),a6=V({...M3.shape,...j3.shape,description:I().optional(),inputSchema:V({type:W(`object`),properties:H(I(),g3).optional(),required:B(I()).optional()}).catchall(z()),outputSchema:V({type:W(`object`),properties:H(I(),g3).optional(),required:B(I()).optional()}).catchall(z()).optional(),annotations:OOe.optional(),execution:kOe.optional(),_meta:H(I(),z()).optional()}),AOe=I3.extend({method:W(`tools/list`)}),jOe=L3.extend({tools:B(a6)}),o6=T3.extend({content:B(i6).default([]),structuredContent:H(I(),z()).optional(),isError:R().optional()});o6.or(T3.extend({toolResult:z()}));const MOe=x3.extend({name:I(),arguments:H(I(),z()).optional()}),NOe=S3.extend({method:W(`tools/call`),params:MOe}),POe=w3.extend({method:W(`notifications/tools/list_changed`),params:C3.optional()});V({autoRefresh:R().default(!0),debounceMs:L().int().nonnegative().default(300)});const s6=U([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),FOe=b3.extend({level:s6}),IOe=S3.extend({method:W(`logging/setLevel`),params:FOe}),LOe=C3.extend({level:s6,logger:I().optional(),data:z()}),ROe=w3.extend({method:W(`notifications/message`),params:LOe}),zOe=V({hints:B(V({name:I().optional()})).optional(),costPriority:L().min(0).max(1).optional(),speedPriority:L().min(0).max(1).optional(),intelligencePriority:L().min(0).max(1).optional()}),BOe=V({mode:U([`auto`,`required`,`none`]).optional()}),VOe=V({type:W(`tool_result`),toolUseId:I().describe(`The unique identifier for the corresponding tool call.`),content:B(i6).default([]),structuredContent:V({}).loose().optional(),isError:R().optional(),_meta:H(I(),z()).optional()}),HOe=Xi(`type`,[t6,n6,r6]),c6=Xi(`type`,[t6,n6,r6,COe,VOe]),UOe=V({role:Z3,content:Yi([c6,B(c6)]),_meta:H(I(),z()).optional()}),WOe=x3.extend({messages:B(UOe),modelPreferences:zOe.optional(),systemPrompt:I().optional(),includeContext:U([`none`,`thisServer`,`allServers`]).optional(),temperature:L().optional(),maxTokens:L().int(),stopSequences:B(I()).optional(),metadata:g3.optional(),tools:B(a6).optional(),toolChoice:BOe.optional()}),GOe=S3.extend({method:W(`sampling/createMessage`),params:WOe}),KOe=T3.extend({model:I(),stopReason:na(U([`endTurn`,`stopSequence`,`maxTokens`]).or(I())),role:Z3,content:HOe}),qOe=T3.extend({model:I(),stopReason:na(U([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(I())),role:Z3,content:Yi([c6,B(c6)])}),JOe=V({type:W(`boolean`),title:I().optional(),description:I().optional(),default:R().optional()}),YOe=V({type:W(`string`),title:I().optional(),description:I().optional(),minLength:L().optional(),maxLength:L().optional(),format:U([`email`,`uri`,`date`,`date-time`]).optional(),default:I().optional()}),XOe=V({type:U([`number`,`integer`]),title:I().optional(),description:I().optional(),minimum:L().optional(),maximum:L().optional(),default:L().optional()}),ZOe=V({type:W(`string`),title:I().optional(),description:I().optional(),enum:B(I()),default:I().optional()}),QOe=V({type:W(`string`),title:I().optional(),description:I().optional(),oneOf:B(V({const:I(),title:I()})),default:I().optional()}),$Oe=Yi([Yi([V({type:W(`string`),title:I().optional(),description:I().optional(),enum:B(I()),enumNames:B(I()).optional(),default:I().optional()}),Yi([ZOe,QOe]),Yi([V({type:W(`array`),title:I().optional(),description:I().optional(),minItems:L().optional(),maxItems:L().optional(),items:V({type:W(`string`),enum:B(I())}),default:B(I()).optional()}),V({type:W(`array`),title:I().optional(),description:I().optional(),minItems:L().optional(),maxItems:L().optional(),items:V({anyOf:B(V({const:I(),title:I()}))}),default:B(I()).optional()})])]),JOe,YOe,XOe]),eke=Yi([x3.extend({mode:W(`form`).optional(),message:I(),requestedSchema:V({type:W(`object`),properties:H(I(),$Oe),required:B(I()).optional()})}),x3.extend({mode:W(`url`),message:I(),elicitationId:I(),url:I().url()})]),tke=S3.extend({method:W(`elicitation/create`),params:eke}),nke=C3.extend({elicitationId:I()}),rke=w3.extend({method:W(`notifications/elicitation/complete`),params:nke}),ike=T3.extend({action:U([`accept`,`decline`,`cancel`]),content:ua(e=>e===null?void 0:e,H(I(),Yi([I(),L(),R(),B(I())])).optional())}),ake=V({type:W(`ref/resource`),uri:I()}),oke=V({type:W(`ref/prompt`),name:I()}),ske=b3.extend({ref:Yi([oke,ake]),argument:V({name:I(),value:I()}),context:V({arguments:H(I(),I()).optional()}).optional()}),cke=S3.extend({method:W(`completion/complete`),params:ske}),lke=T3.extend({completion:qi({values:B(I()).max(100),total:na(L().int()),hasMore:na(R())})}),uke=V({uri:I().startsWith(`file://`),name:I().optional(),_meta:H(I(),z()).optional()}),dke=S3.extend({method:W(`roots/list`),params:b3.optional()}),fke=T3.extend({roots:B(uke)}),pke=w3.extend({method:W(`notifications/roots/list_changed`),params:C3.optional()});Yi([P3,qDe,cke,IOe,SOe,yOe,rOe,aOe,cOe,fOe,mOe,NOe,AOe,V3,U3,W3,K3]),Yi([A3,F3,XDe,pke,B3]),Yi([k3,KOe,qOe,ike,fke,H3,G3,z3]),Yi([P3,GOe,tke,dke,V3,U3,W3,K3]),Yi([A3,F3,ROe,gOe,uOe,POe,DOe,B3,rke]),Yi([k3,YDe,lke,EOe,bOe,iOe,oOe,lOe,o6,jOe,H3,G3,z3]);var mke;(function(e){e.Completable=`McpCompletable`})(mke||={});var hke=global.Request,l6=class extends hke{constructor(e,t){typeof e==`object`&&u6 in e&&(e=e[u6]()),t?.body?.getReader!==void 0&&(t.duplex??=`half`),super(e,t)}},gke=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)},_ke=Symbol(`wrapBodyStream`),vke=(e,t,n,r,i)=>{let a={method:e,headers:n,signal:i.signal};if(e===`TRACE`){a.method=`GET`;let e=new l6(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[_ke]){let e;a.body=new ReadableStream({async pull(t){try{e||=ze.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=ze.toWeb(r)}return new l6(t,a)},u6=Symbol(`getRequestCache`),d6=Symbol(`requestCache`),f6=Symbol(`incomingKey`),p6=Symbol(`urlKey`),yke=Symbol(`headersKey`),m6=Symbol(`abortControllerKey`),h6={get method(){return this[f6].method||`GET`},get url(){return this[p6]},get headers(){return this[yke]||=gke(this[f6])},[Symbol(`getAbortController`)](){return this[u6](),this[m6]},[u6](){return this[m6]||=new AbortController,this[d6]||=vke(this.method,this[p6],this.headers,this[f6],this[m6])}};[`body`,`bodyUsed`,`cache`,`credentials`,`destination`,`integrity`,`mode`,`redirect`,`referrer`,`referrerPolicy`,`signal`,`keepalive`].forEach(e=>{Object.defineProperty(h6,e,{get(){return this[u6]()[e]}})}),[`arrayBuffer`,`blob`,`clone`,`formData`,`json`,`text`].forEach(e=>{Object.defineProperty(h6,e,{value:function(){return this[u6]()[e]()}})}),Object.defineProperty(h6,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[d6]},{...t,depth:e==null?null:e-1})}`}}),Object.setPrototypeOf(h6,l6.prototype);var g6=Symbol(`responseCache`),_6=Symbol(`getResponseCache`),v6=Symbol(`cache`),y6=global.Response,b6=class e{#e;#t;[_6](){return delete this[v6],this[g6]||=new y6(this.#e,this.#t)}constructor(t,n){let r;if(this.#e=t,n instanceof e){let e=n[g6];if(e){this.#t=e,this[_6]();return}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[v6]=[n?.status||200,t,r||n?.headers])}get headers(){let e=this[v6];return e?(e[2]instanceof Headers||(e[2]=new Headers(e[2]||{"content-type":`text/plain; charset=UTF-8`})),e[2]):this[_6]().headers}get status(){return this[v6]?.[0]??this[_6]().status}get ok(){let e=this.status;return e>=200&&e<300}};[`body`,`bodyUsed`,`redirected`,`statusText`,`trailers`,`type`,`url`].forEach(e=>{Object.defineProperty(b6.prototype,e,{get(){return this[_6]()[e]}})}),[`arrayBuffer`,`blob`,`clone`,`formData`,`json`,`text`].forEach(e=>{Object.defineProperty(b6.prototype,e,{value:function(){return this[_6]()[e]()}})}),Object.defineProperty(b6.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[g6]},{...t,depth:e==null?null:e-1})}`}}),Object.setPrototypeOf(b6,y6),Object.setPrototypeOf(b6.prototype,y6.prototype),global.crypto===void 0&&(global.crypto=Re);var bke=i(((e,t)=>{var n=[`||`,`&&`,`;;`,`|&`,`<(`,`<<<`,`>>`,`>&`,`<&`,`&`,`;`,`(`,`)`,`|`,`<`,`>`],r=/[\n\r\u2028\u2029]/,i=/[\s#!"$&'():;<=>@\\^`|]/g;t.exports=function(e){return e.map(function(e){if(e===``)return`''`;if(e&&typeof e==`object`){if(`op`in e&&e.op===`glob`){if(typeof e.pattern!=`string`)throw TypeError("glob token requires a string `pattern`");if(r.test(e.pattern))throw TypeError("glob `pattern` must not contain line terminators");return e.pattern.replace(i,`\\$&`)}if(`op`in e&&typeof e.op==`string`){if(n.indexOf(e.op)<0)throw TypeError("invalid `op` value: "+JSON.stringify(e.op));return e.op.replace(/[\s\S]/g,`\\$&`)}if(`comment`in e&&typeof e.comment==`string`){if(r.test(e.comment))throw TypeError("`comment` must not contain line terminators");return`#`+e.comment}throw TypeError(`unrecognized object token shape`)}return/["\s\\]/.test(e)&&!/'/.test(e)?`'`+e.replace(/(['])/g,`\\$1`)+`'`:/["'\s]/.test(e)?`"`+e.replace(/(["\\$`!])/g,`\\$1`)+`"`:String(e).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}~])/g,`$1\\$2`)}).join(` `)}})),xke=i(((e,t)=>{for(var n=`(?:`+[`\\|\\|`,`\\&\\&`,`;;`,`\\|\\&`,`\\<\\(`,`\\<\\<\\<`,`>>`,`>\\&`,`<\\&`,`[&;()|<>]`].join(`|`)+`)`,r=RegExp(`^`+n+`$`),i=`|&;()<> \\t`,a=`'([^']*?)'`,o=`"((\\\\"|[^"])*?)"`,s=/^#$/,c=`'`,l=`"`,u=`$`,d=``,f=4294967296,p=0;p<4;p++)d+=(f*Math.random()).toString(16);var m=RegExp(`^`+d);function h(e,t){for(var n=t.lastIndex,r=[],i;i=t.exec(e);)r[r.length]=i,t.lastIndex===i.index&&(t.lastIndex+=1);return t.lastIndex=n,r}function g(e,t,n){var r=typeof e==`function`?e(n):e[n];return r===void 0&&n!=``?r=``:r===void 0&&(r=`$`),typeof r==`object`?t+d+JSON.stringify(r)+d:t+r}function _(e,t,d){d||={};var f=d.escape||`\\`,p=d.splitUnquoted===!0?`
|
|
739
|
+
`.indexOf(e.charAt(t))!==-1}var A4;(function(e){e.DEFAULT={allowTrailingComma:!1}})(A4||={});function cDe(e,t=[],n=A4.DEFAULT){let r=null,i=[],a=[];function o(e){Array.isArray(i)?i.push(e):r!==null&&(i[r]=e)}return P4(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 j4(e,t=[],n=A4.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}P4(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:lDe(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 M4(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 N4(e){switch(e.type){case`array`:return e.children.map(N4);case`object`:let t=Object.create(null);for(let n of e.children){let e=n.children[1];e&&(t[n.children[0].value]=N4(e))}return t;case`null`:case`string`:case`number`:case`boolean`:return e.value;default:return}}function P4(e,t,n=A4.DEFAULT){let r=S4(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)}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}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 lDe(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 uDe(e,t,n,r){let i=t.slice(),a=j4(e,[]),o,s;for(;i.length>0&&(s=i.pop(),o=M4(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 F4(e,{offset:a?a.offset:0,length:a?a.length:0,content:JSON.stringify(n)},r)}if(o.type===`object`&&typeof s==`string`&&Array.isArray(o.children)){let t=M4(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 F4(e,{offset:i,length:a-i,content:``},r)}return F4(e,{offset:t.offset,length:t.length,content:JSON.stringify(n)},r)}{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 F4(e,a,r)}}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 F4(e,i,r)}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 F4(e,i,r)}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 F4(e,t,r)}throw Error(`Can not ${n===void 0?`remove`:r.isArrayInsertion?`insert`:`modify`} Array index ${t} as length is not sufficient`)}throw Error(`Can not add ${typeof s==`number`?`property`:`index`} to parent of type ${o.type}`)}function F4(e,t,n){if(!n.formattingOptions)return[t];let r=I4(e,t),i=t.offset,a=t.offset+t.content.length;if(t.length===0||t.content.length===0){for(;i>0&&!k4(r,i-1);)i--;for(;a<r.length&&!k4(r,a);)a++}let o=aDe(r,{offset:i,length:a-i},{...n.formattingOptions,keepLines:!1});for(let e=o.length-1;e>=0;e--){let t=o[e];r=I4(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 I4(e,t){return e.substring(0,t.offset)+t.content+e.substring(t.offset+t.length)}var dDe;(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`})(dDe||={});var fDe;(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`})(fDe||={});const pDe=cDe,mDe=j4,L4=N4;var hDe;(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`})(hDe||={});function R4(e,t,n,r){return uDe(e,t,n,r)}function z4(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=I4(e,i);else throw Error(`Overlapping edit`);r=i.offset}return e}const gDe=global.Request;var B4=class extends gDe{constructor(e,t){if(typeof e==`object`&&J4 in e){let n=t!==void 0&&`body`in t&&t.body!=null;if(e[r3]&&!n)throw TypeError(`Cannot construct a Request with a Request object that has already been used.`);e=e[J4]()}t?.body?.getReader!==void 0&&(t.duplex??=`half`),super(e,t)}};const V4=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)},_De=Symbol(`wrapBodyStream`),vDe=new Set([`latin1`,`binary`,`hex`,`base64`,`base64url`]),yDe=e=>e===null||vDe.has(e),H4=Symbol(`bodyBufferedBeforeDisconnect`),U4=Symbol(`bodyBufferedLengthBeforeDisconnect`),W4=(e,t)=>Buffer.isBuffer(e)?e:Buffer.from(e,t??`utf8`),G4=e=>!(e instanceof Ue)&&!!e.complete&&!!e.readableAborted&&typeof e.read==`function`&&yDe(e.readableEncoding),K4=(e,t)=>{if(e.readableDidRead&&!t||!G4(e))return;let n=e;if(n[H4]!==void 0)return n[H4];let r,i=e.errored;if(i&&i.code!==`ECONNRESET`)r=i;else if(n[U4]!==void 0&&e.readableLength!==n[U4])r=o3();else{let n=t??[],i=e.read();i!==null&&n.push(W4(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=o3())}}return n[H4]=r,r},q4=(e,t)=>{if(t instanceof Error){e.error(t);return}t.length>0&&e.enqueue(t),e.close()},bDe=(e,t,n,r,i)=>{let a={method:e,headers:n,signal:i.signal};if(e===`TRACE`){a.method=`GET`;let e=new B4(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[_De]){let e;a.body=new ReadableStream({async pull(t){try{if(!e){let e=K4(r);if(e!==void 0){q4(t,e);return}}e||=Ie.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=K4(r);a.body=e===void 0?Ie.toWeb(r):new ReadableStream({start(t){q4(t,e)}})}}return new B4(t,a)},J4=Symbol(`getRequestCache`),Y4=Symbol(`requestCache`),X4=Symbol(`incomingKey`),Z4=Symbol(`urlKey`),xDe=Symbol(`methodKey`),Q4=Symbol(`headersKey`),$4=Symbol(`abortControllerKey`),e3=Symbol(`getAbortController`),SDe=Symbol(`abortRequest`),t3=Symbol(`bodyBuffer`),n3=Symbol(`bodyReadPromise`),r3=Symbol(`bodyConsumedDirectly`),i3=Symbol(`bodyLockReader`),a3=Symbol(`abortReason`),o3=()=>TypeError(`Body is unusable`),s3=()=>Promise.reject(o3()),CDe=new TextDecoder,wDe=e=>{if(e[r3])return s3();e[r3]=!0},TDe=e=>e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength),EDe=e=>(e[Q4]||=V4(e[X4])).get(`content-type`)||``,DDe=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,ODe=e=>{if(!DDe.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.`)},c3=(e,t,n)=>{if(e[r3])return s3();let r=e.method;if(r===`GET`||r===`HEAD`)return e[J4]()[t]();let i=ODe(r);if(i)return Promise.reject(i);if(e[Y4]&&r!==`TRACE`)return e[Y4][t]();let a=wDe(e);if(a)return a;let o=kDe(e);if(o){let t=Promise.resolve(n(o,e));return e[t3]=void 0,t}return ADe(e).then(t=>{let r=n(t,e);return e[t3]=void 0,r})},kDe=e=>{let t=e[X4];if(`rawBody`in t&&t.rawBody instanceof Buffer)return t.rawBody},l3=(e,t)=>{if(t.errored)return t.errored;let n=e[a3];return n===void 0?Error(`Client connection prematurely closed.`):n instanceof Error?n:Error(String(n))},ADe=e=>{if(e[t3])return Promise.resolve(e[t3]);if(e[n3])return e[n3];let t=e[X4];if(t.readableDidRead)return s3();let n=K4(t);if(n!==void 0)return n instanceof Error?Promise.reject(n):(e[t3]=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!G4(t)||s&&s.code!==`ECONNRESET`?!1:(o(()=>{let o=K4(t,i);o instanceof Error?r(o):o===void 0?r(a??l3(e,t)):(e[t3]=o,n(o))}),!0)},c=e=>{i.push(W4(e,t.readableEncoding))},l=()=>{o(()=>{let t=i.length===1?i[0]:Buffer.concat(i);e[t3]=t,n(t)})},u=e=>{s(e)||o(()=>{r(e)})},d=()=>{if(t.readableEnded){l();return}s()||o(()=>{r(l3(e,t))})},f=()=>{t.off(`data`,c),t.off(`end`,l),t.off(`error`,u),t.off(`close`,d),e[n3]=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[n3]=r,r},u3={get method(){return this[xDe]},get url(){return this[Z4]},get headers(){return this[Q4]||=V4(this[X4])},[SDe](e){this[a3]===void 0&&(this[a3]=e);let t=this[$4];t&&!t.signal.aborted&&t.abort(e)},[e3](){return this[$4]||=new AbortController,this[a3]!==void 0&&!this[$4].signal.aborted&&this[$4].abort(this[a3]),this[$4]},[J4](){let e=this[e3]();if(this[Y4])return this[Y4];let t=this.method;if(this[r3]&&t!==`GET`&&t!==`HEAD`){this[t3]=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 B4(this[Z4],n);return t===`TRACE`&&Object.defineProperty(r,"method",{get(){return`TRACE`}}),this[Y4]=r}return this[Y4]=bDe(this.method,this[Z4],this.headers,this[X4],e)},get body(){if(!this[r3])return this[J4]().body;let e=this[J4]();return!this[i3]&&e.body&&(this[i3]=e.body.getReader()),e.body},get bodyUsed(){return this[r3]?!0:this[Y4]?this[Y4].bodyUsed:!1}};Object.defineProperty(u3,"signal",{get(){return this[e3]().signal}}),[`cache`,`credentials`,`destination`,`integrity`,`mode`,`redirect`,`referrer`,`referrerPolicy`,`keepalive`].forEach(e=>{Object.defineProperty(u3,e,{get(){return this[J4]()[e]}})}),[`clone`,`formData`].forEach(e=>{Object.defineProperty(u3,e,{value:function(){if(this[r3]){if(e===`clone`)throw o3();return s3()}return this[J4]()[e]()}})}),Object.defineProperty(u3,"text",{value:function(){return c3(this,`text`,e=>CDe.decode(e))}}),Object.defineProperty(u3,"arrayBuffer",{value:function(){return c3(this,`arrayBuffer`,e=>TDe(e))}}),Object.defineProperty(u3,"blob",{value:function(){return c3(this,`blob`,(e,t)=>{let n=EDe(t);return new Response(e,n?{headers:{"content-type":n}}:void 0).blob()})}}),Object.defineProperty(u3,"json",{value:function(){return this[r3]?s3():this.text().then(JSON.parse)}}),Object.defineProperty(u3,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[Y4]},{...t,depth:e==null?null:e-1})}`}}),Object.setPrototypeOf(u3,B4.prototype);const d3=Symbol(`responseCache`),f3=Symbol(`getResponseCache`),p3=Symbol(`cache`),m3=global.Response;var h3=class e{#e;#t;[f3](){let e=this[p3],t=e&&e[2]instanceof Headers?e[2]:void 0;return delete this[p3],this[d3]||=new m3(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 m3){let t=n[d3];if(t){this.#t=t,this[f3]();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[p3]=[n?.status||200,t??null,r||n?.headers])}get headers(){let e=this[p3];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[f3]().headers}get status(){return this[p3]?.[0]??this[f3]().status}get ok(){let e=this.status;return e>=200&&e<300}};[`body`,`bodyUsed`,`redirected`,`statusText`,`trailers`,`type`,`url`].forEach(e=>{Object.defineProperty(h3.prototype,e,{get(){return this[f3]()[e]}})}),[`arrayBuffer`,`blob`,`clone`,`formData`,`json`,`text`].forEach(e=>{Object.defineProperty(h3.prototype,e,{value:function(){return this[f3]()[e]()}})}),Object.defineProperty(h3.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[d3]},{...t,depth:e==null?null:e-1})}`}}),Object.setPrototypeOf(h3,m3),Object.setPrototypeOf(h3.prototype,m3.prototype);const jDe=/^https?:\/\/[!#-;=?-[\]_a-z~A-Z]+$/,MDe=e=>e instanceof URL?e.href:jDe.test(e)?e:new URL(e).href,NDe=new Set([301,302,303,307,308]);Object.defineProperty(h3,"redirect",{value:function(e,t=302){if(!NDe.has(t))throw RangeError(`Invalid status code`);return new h3(null,{status:t,headers:{location:MDe(e)}})},writable:!0,configurable:!0}),Object.defineProperty(h3,"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 h3(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`}});function PDe(e,t){let n;try{n=E(e)}catch{return t.map(({editor:e,root:t})=>({host:e,root:t,state:`absent`}))}let r=e=>{let t=M(n,e);if(!(t===``||t.startsWith(`..`)||A(t)))return t.split(le).join(`/`)};return t.map(({editor:t,root:i})=>{let a=j(e,i),o;try{o=_(a)}catch{return{host:t,root:i,state:`absent`}}let s;try{s=E(a)}catch{return{host:t,root:i,state:`absent`}}if(o.isSymbolicLink()){let e=r(s);return{host:t,root:i,state:`linked`,real:s,...e?{target:e}:{}}}if(s!==j(n,i)){let e=r(s);return{host:t,root:i,state:`linked-parent`,real:s,...e?{target:e}:{}}}return{host:t,root:i,state:`own`,real:s}})}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: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()}return(t=e.match(r.twoOctet))?(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})():(t=e.match(r.threeOctet))?(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})():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)}))();const FDe={"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`},g3=la(e=>e!==null&&(typeof e==`object`||typeof e==`function`)),_3=Yi([I(),L().int()]),v3=I();qi({ttl:L().optional(),pollInterval:L().optional()});const IDe=V({ttl:L().optional()}),LDe=V({taskId:I()}),y3=qi({progressToken:_3.optional(),"io.modelcontextprotocol/related-task":LDe.optional()}),b3=V({_meta:y3.optional()}),x3=b3.extend({task:IDe.optional()}),S3=V({method:I(),params:b3.loose().optional()}),C3=V({_meta:y3.optional()}),w3=V({method:I(),params:C3.loose().optional()}),T3=qi({_meta:y3.optional()}),E3=Yi([I(),L().int()]),RDe=V({jsonrpc:W(`2.0`),id:E3,...S3.shape}).strict(),zDe=V({jsonrpc:W(`2.0`),...w3.shape}).strict(),D3=V({jsonrpc:W(`2.0`),id:E3,result:T3}).strict();var BDe;(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`})(BDe||={});const O3=V({jsonrpc:W(`2.0`),id:E3.optional(),error:V({code:L().int(),message:I(),data:z().optional()})}).strict();Yi([RDe,zDe,D3,O3]),Yi([D3,O3]);const k3=T3.strict(),VDe=C3.extend({requestId:E3.optional(),reason:I().optional()}),A3=w3.extend({method:W(`notifications/cancelled`),params:VDe}),j3=V({icons:B(V({src:I(),mimeType:I().optional(),sizes:B(I()).optional(),theme:U([`light`,`dark`]).optional()})).optional()}),M3=V({name:I(),title:I().optional()}),N3=M3.extend({...M3.shape,...j3.shape,version:I(),websiteUrl:I().optional(),description:I().optional()}),HDe=ua(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,Zi(V({form:Zi(V({applyDefaults:R().optional()}),H(I(),z())).optional(),url:g3.optional()}),H(I(),z()).optional())),UDe=qi({list:g3.optional(),cancel:g3.optional(),requests:qi({sampling:qi({createMessage:g3.optional()}).optional(),elicitation:qi({create:g3.optional()}).optional()}).optional()}),WDe=qi({list:g3.optional(),cancel:g3.optional(),requests:qi({tools:qi({call:g3.optional()}).optional()}).optional()}),GDe=V({experimental:H(I(),g3).optional(),sampling:V({context:g3.optional(),tools:g3.optional()}).optional(),elicitation:HDe.optional(),roots:V({listChanged:R().optional()}).optional(),tasks:UDe.optional(),extensions:H(I(),g3).optional()}),KDe=b3.extend({protocolVersion:I(),capabilities:GDe,clientInfo:N3}),qDe=S3.extend({method:W(`initialize`),params:KDe}),JDe=V({experimental:H(I(),g3).optional(),logging:g3.optional(),completions:g3.optional(),prompts:V({listChanged:R().optional()}).optional(),resources:V({subscribe:R().optional(),listChanged:R().optional()}).optional(),tools:V({listChanged:R().optional()}).optional(),tasks:WDe.optional(),extensions:H(I(),g3).optional()}),YDe=T3.extend({protocolVersion:I(),capabilities:JDe,serverInfo:N3,instructions:I().optional()}),XDe=w3.extend({method:W(`notifications/initialized`),params:C3.optional()}),P3=S3.extend({method:W(`ping`),params:b3.optional()}),ZDe=V({progress:L(),total:na(L()),message:na(I())}),QDe=V({...C3.shape,...ZDe.shape,progressToken:_3}),F3=w3.extend({method:W(`notifications/progress`),params:QDe}),$De=b3.extend({cursor:v3.optional()}),I3=S3.extend({params:$De.optional()}),L3=T3.extend({nextCursor:v3.optional()}),eOe=U([`working`,`input_required`,`completed`,`failed`,`cancelled`]),R3=V({taskId:I(),status:eOe,ttl:Yi([L(),Ui()]),createdAt:I(),lastUpdatedAt:I(),pollInterval:na(L()),statusMessage:na(I())}),z3=T3.extend({task:R3}),tOe=C3.merge(R3),B3=w3.extend({method:W(`notifications/tasks/status`),params:tOe}),V3=S3.extend({method:W(`tasks/get`),params:b3.extend({taskId:I()})}),H3=T3.merge(R3),U3=S3.extend({method:W(`tasks/result`),params:b3.extend({taskId:I()})});T3.loose();const W3=I3.extend({method:W(`tasks/list`)}),G3=L3.extend({tasks:B(R3)}),K3=S3.extend({method:W(`tasks/cancel`),params:b3.extend({taskId:I()})});T3.merge(R3);const q3=V({uri:I(),mimeType:na(I()),_meta:H(I(),z()).optional()}),J3=q3.extend({text:I()}),Y3=I().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),X3=q3.extend({blob:Y3}),Z3=U([`user`,`assistant`]),Q3=V({audience:B(Z3).optional(),priority:L().min(0).max(1).optional(),lastModified:Ci({offset:!0}).optional()}),$3=V({...M3.shape,...j3.shape,uri:I(),description:na(I()),mimeType:na(I()),size:na(L()),annotations:Q3.optional(),_meta:na(qi({}))}),nOe=V({...M3.shape,...j3.shape,uriTemplate:I(),description:na(I()),mimeType:na(I()),annotations:Q3.optional(),_meta:na(qi({}))}),rOe=I3.extend({method:W(`resources/list`)}),iOe=L3.extend({resources:B($3)}),aOe=I3.extend({method:W(`resources/templates/list`)}),oOe=L3.extend({resourceTemplates:B(nOe)}),e6=b3.extend({uri:I()}),sOe=e6,cOe=S3.extend({method:W(`resources/read`),params:sOe}),lOe=T3.extend({contents:B(Yi([J3,X3]))}),uOe=w3.extend({method:W(`notifications/resources/list_changed`),params:C3.optional()}),dOe=e6,fOe=S3.extend({method:W(`resources/subscribe`),params:dOe}),pOe=e6,mOe=S3.extend({method:W(`resources/unsubscribe`),params:pOe}),hOe=C3.extend({uri:I()}),gOe=w3.extend({method:W(`notifications/resources/updated`),params:hOe}),_Oe=V({name:I(),description:na(I()),required:na(R())}),vOe=V({...M3.shape,...j3.shape,description:na(I()),arguments:na(B(_Oe)),_meta:na(qi({}))}),yOe=I3.extend({method:W(`prompts/list`)}),bOe=L3.extend({prompts:B(vOe)}),xOe=b3.extend({name:I(),arguments:H(I(),I()).optional()}),SOe=S3.extend({method:W(`prompts/get`),params:xOe}),t6=V({type:W(`text`),text:I(),annotations:Q3.optional(),_meta:H(I(),z()).optional()}),n6=V({type:W(`image`),data:Y3,mimeType:I(),annotations:Q3.optional(),_meta:H(I(),z()).optional()}),r6=V({type:W(`audio`),data:Y3,mimeType:I(),annotations:Q3.optional(),_meta:H(I(),z()).optional()}),COe=V({type:W(`tool_use`),name:I(),id:I(),input:H(I(),z()),_meta:H(I(),z()).optional()}),wOe=V({type:W(`resource`),resource:Yi([J3,X3]),annotations:Q3.optional(),_meta:H(I(),z()).optional()}),i6=Yi([t6,n6,r6,$3.extend({type:W(`resource_link`)}),wOe]),TOe=V({role:Z3,content:i6}),EOe=T3.extend({description:I().optional(),messages:B(TOe)}),DOe=w3.extend({method:W(`notifications/prompts/list_changed`),params:C3.optional()}),OOe=V({title:I().optional(),readOnlyHint:R().optional(),destructiveHint:R().optional(),idempotentHint:R().optional(),openWorldHint:R().optional()}),kOe=V({taskSupport:U([`required`,`optional`,`forbidden`]).optional()}),a6=V({...M3.shape,...j3.shape,description:I().optional(),inputSchema:V({type:W(`object`),properties:H(I(),g3).optional(),required:B(I()).optional()}).catchall(z()),outputSchema:V({type:W(`object`),properties:H(I(),g3).optional(),required:B(I()).optional()}).catchall(z()).optional(),annotations:OOe.optional(),execution:kOe.optional(),_meta:H(I(),z()).optional()}),AOe=I3.extend({method:W(`tools/list`)}),jOe=L3.extend({tools:B(a6)}),o6=T3.extend({content:B(i6).default([]),structuredContent:H(I(),z()).optional(),isError:R().optional()});o6.or(T3.extend({toolResult:z()}));const MOe=x3.extend({name:I(),arguments:H(I(),z()).optional()}),NOe=S3.extend({method:W(`tools/call`),params:MOe}),POe=w3.extend({method:W(`notifications/tools/list_changed`),params:C3.optional()});V({autoRefresh:R().default(!0),debounceMs:L().int().nonnegative().default(300)});const s6=U([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),FOe=b3.extend({level:s6}),IOe=S3.extend({method:W(`logging/setLevel`),params:FOe}),LOe=C3.extend({level:s6,logger:I().optional(),data:z()}),ROe=w3.extend({method:W(`notifications/message`),params:LOe}),zOe=V({hints:B(V({name:I().optional()})).optional(),costPriority:L().min(0).max(1).optional(),speedPriority:L().min(0).max(1).optional(),intelligencePriority:L().min(0).max(1).optional()}),BOe=V({mode:U([`auto`,`required`,`none`]).optional()}),VOe=V({type:W(`tool_result`),toolUseId:I().describe(`The unique identifier for the corresponding tool call.`),content:B(i6).default([]),structuredContent:V({}).loose().optional(),isError:R().optional(),_meta:H(I(),z()).optional()}),HOe=Xi(`type`,[t6,n6,r6]),c6=Xi(`type`,[t6,n6,r6,COe,VOe]),UOe=V({role:Z3,content:Yi([c6,B(c6)]),_meta:H(I(),z()).optional()}),WOe=x3.extend({messages:B(UOe),modelPreferences:zOe.optional(),systemPrompt:I().optional(),includeContext:U([`none`,`thisServer`,`allServers`]).optional(),temperature:L().optional(),maxTokens:L().int(),stopSequences:B(I()).optional(),metadata:g3.optional(),tools:B(a6).optional(),toolChoice:BOe.optional()}),GOe=S3.extend({method:W(`sampling/createMessage`),params:WOe}),KOe=T3.extend({model:I(),stopReason:na(U([`endTurn`,`stopSequence`,`maxTokens`]).or(I())),role:Z3,content:HOe}),qOe=T3.extend({model:I(),stopReason:na(U([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(I())),role:Z3,content:Yi([c6,B(c6)])}),JOe=V({type:W(`boolean`),title:I().optional(),description:I().optional(),default:R().optional()}),YOe=V({type:W(`string`),title:I().optional(),description:I().optional(),minLength:L().optional(),maxLength:L().optional(),format:U([`email`,`uri`,`date`,`date-time`]).optional(),default:I().optional()}),XOe=V({type:U([`number`,`integer`]),title:I().optional(),description:I().optional(),minimum:L().optional(),maximum:L().optional(),default:L().optional()}),ZOe=V({type:W(`string`),title:I().optional(),description:I().optional(),enum:B(I()),default:I().optional()}),QOe=V({type:W(`string`),title:I().optional(),description:I().optional(),oneOf:B(V({const:I(),title:I()})),default:I().optional()}),$Oe=Yi([Yi([V({type:W(`string`),title:I().optional(),description:I().optional(),enum:B(I()),enumNames:B(I()).optional(),default:I().optional()}),Yi([ZOe,QOe]),Yi([V({type:W(`array`),title:I().optional(),description:I().optional(),minItems:L().optional(),maxItems:L().optional(),items:V({type:W(`string`),enum:B(I())}),default:B(I()).optional()}),V({type:W(`array`),title:I().optional(),description:I().optional(),minItems:L().optional(),maxItems:L().optional(),items:V({anyOf:B(V({const:I(),title:I()}))}),default:B(I()).optional()})])]),JOe,YOe,XOe]),eke=Yi([x3.extend({mode:W(`form`).optional(),message:I(),requestedSchema:V({type:W(`object`),properties:H(I(),$Oe),required:B(I()).optional()})}),x3.extend({mode:W(`url`),message:I(),elicitationId:I(),url:I().url()})]),tke=S3.extend({method:W(`elicitation/create`),params:eke}),nke=C3.extend({elicitationId:I()}),rke=w3.extend({method:W(`notifications/elicitation/complete`),params:nke}),ike=T3.extend({action:U([`accept`,`decline`,`cancel`]),content:ua(e=>e===null?void 0:e,H(I(),Yi([I(),L(),R(),B(I())])).optional())}),ake=V({type:W(`ref/resource`),uri:I()}),oke=V({type:W(`ref/prompt`),name:I()}),ske=b3.extend({ref:Yi([oke,ake]),argument:V({name:I(),value:I()}),context:V({arguments:H(I(),I()).optional()}).optional()}),cke=S3.extend({method:W(`completion/complete`),params:ske}),lke=T3.extend({completion:qi({values:B(I()).max(100),total:na(L().int()),hasMore:na(R())})}),uke=V({uri:I().startsWith(`file://`),name:I().optional(),_meta:H(I(),z()).optional()}),dke=S3.extend({method:W(`roots/list`),params:b3.optional()}),fke=T3.extend({roots:B(uke)}),pke=w3.extend({method:W(`notifications/roots/list_changed`),params:C3.optional()});Yi([P3,qDe,cke,IOe,SOe,yOe,rOe,aOe,cOe,fOe,mOe,NOe,AOe,V3,U3,W3,K3]),Yi([A3,F3,XDe,pke,B3]),Yi([k3,KOe,qOe,ike,fke,H3,G3,z3]),Yi([P3,GOe,tke,dke,V3,U3,W3,K3]),Yi([A3,F3,ROe,gOe,uOe,POe,DOe,B3,rke]),Yi([k3,YDe,lke,EOe,bOe,iOe,oOe,lOe,o6,jOe,H3,G3,z3]);var mke;(function(e){e.Completable=`McpCompletable`})(mke||={});var hke=global.Request,l6=class extends hke{constructor(e,t){typeof e==`object`&&u6 in e&&(e=e[u6]()),t?.body?.getReader!==void 0&&(t.duplex??=`half`),super(e,t)}},gke=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)},_ke=Symbol(`wrapBodyStream`),vke=(e,t,n,r,i)=>{let a={method:e,headers:n,signal:i.signal};if(e===`TRACE`){a.method=`GET`;let e=new l6(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[_ke]){let e;a.body=new ReadableStream({async pull(t){try{e||=ze.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=ze.toWeb(r)}return new l6(t,a)},u6=Symbol(`getRequestCache`),d6=Symbol(`requestCache`),f6=Symbol(`incomingKey`),p6=Symbol(`urlKey`),yke=Symbol(`headersKey`),m6=Symbol(`abortControllerKey`),h6={get method(){return this[f6].method||`GET`},get url(){return this[p6]},get headers(){return this[yke]||=gke(this[f6])},[Symbol(`getAbortController`)](){return this[u6](),this[m6]},[u6](){return this[m6]||=new AbortController,this[d6]||=vke(this.method,this[p6],this.headers,this[f6],this[m6])}};[`body`,`bodyUsed`,`cache`,`credentials`,`destination`,`integrity`,`mode`,`redirect`,`referrer`,`referrerPolicy`,`signal`,`keepalive`].forEach(e=>{Object.defineProperty(h6,e,{get(){return this[u6]()[e]}})}),[`arrayBuffer`,`blob`,`clone`,`formData`,`json`,`text`].forEach(e=>{Object.defineProperty(h6,e,{value:function(){return this[u6]()[e]()}})}),Object.defineProperty(h6,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[d6]},{...t,depth:e==null?null:e-1})}`}}),Object.setPrototypeOf(h6,l6.prototype);var g6=Symbol(`responseCache`),_6=Symbol(`getResponseCache`),v6=Symbol(`cache`),y6=global.Response,b6=class e{#e;#t;[_6](){return delete this[v6],this[g6]||=new y6(this.#e,this.#t)}constructor(t,n){let r;if(this.#e=t,n instanceof e){let e=n[g6];if(e){this.#t=e,this[_6]();return}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[v6]=[n?.status||200,t,r||n?.headers])}get headers(){let e=this[v6];return e?(e[2]instanceof Headers||(e[2]=new Headers(e[2]||{"content-type":`text/plain; charset=UTF-8`})),e[2]):this[_6]().headers}get status(){return this[v6]?.[0]??this[_6]().status}get ok(){let e=this.status;return e>=200&&e<300}};[`body`,`bodyUsed`,`redirected`,`statusText`,`trailers`,`type`,`url`].forEach(e=>{Object.defineProperty(b6.prototype,e,{get(){return this[_6]()[e]}})}),[`arrayBuffer`,`blob`,`clone`,`formData`,`json`,`text`].forEach(e=>{Object.defineProperty(b6.prototype,e,{value:function(){return this[_6]()[e]()}})}),Object.defineProperty(b6.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[g6]},{...t,depth:e==null?null:e-1})}`}}),Object.setPrototypeOf(b6,y6),Object.setPrototypeOf(b6.prototype,y6.prototype),global.crypto===void 0&&(global.crypto=Re);var bke=i(((e,t)=>{var n=[`||`,`&&`,`;;`,`|&`,`<(`,`<<<`,`>>`,`>&`,`<&`,`&`,`;`,`(`,`)`,`|`,`<`,`>`],r=/[\n\r\u2028\u2029]/,i=/[\s#!"$&'():;<=>@\\^`|]/g;t.exports=function(e){return e.map(function(e){if(e===``)return`''`;if(e&&typeof e==`object`){if(`op`in e&&e.op===`glob`){if(typeof e.pattern!=`string`)throw TypeError("glob token requires a string `pattern`");if(r.test(e.pattern))throw TypeError("glob `pattern` must not contain line terminators");return e.pattern.replace(i,`\\$&`)}if(`op`in e&&typeof e.op==`string`){if(n.indexOf(e.op)<0)throw TypeError("invalid `op` value: "+JSON.stringify(e.op));return e.op.replace(/[\s\S]/g,`\\$&`)}if(`comment`in e&&typeof e.comment==`string`){if(r.test(e.comment))throw TypeError("`comment` must not contain line terminators");return`#`+e.comment}throw TypeError(`unrecognized object token shape`)}return/["\s\\]/.test(e)&&!/'/.test(e)?`'`+e.replace(/(['])/g,`\\$1`)+`'`:/["'\s]/.test(e)?`"`+e.replace(/(["\\$`!])/g,`\\$1`)+`"`:String(e).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}~])/g,`$1\\$2`)}).join(` `)}})),xke=i(((e,t)=>{for(var n=`(?:`+[`\\|\\|`,`\\&\\&`,`;;`,`\\|\\&`,`\\<\\(`,`\\<\\<\\<`,`>>`,`>\\&`,`<\\&`,`[&;()|<>]`].join(`|`)+`)`,r=RegExp(`^`+n+`$`),i=`|&;()<> \\t`,a=`'([^']*?)'`,o=`"((\\\\"|[^"])*?)"`,s=/^#$/,c=`'`,l=`"`,u=`$`,d=``,f=4294967296,p=0;p<4;p++)d+=(f*Math.random()).toString(16);var m=RegExp(`^`+d);function h(e,t){for(var n=t.lastIndex,r=[],i;i=t.exec(e);)r[r.length]=i,t.lastIndex===i.index&&(t.lastIndex+=1);return t.lastIndex=n,r}function g(e,t,n){var r=typeof e==`function`?e(n):e[n];return r===void 0&&n!=``?r=``:r===void 0&&(r=`$`),typeof r==`object`?t+d+JSON.stringify(r)+d:t+r}function _(e,t,d){d||={};var f=d.escape||`\\`,p=d.splitUnquoted===!0?`
|
|
740
740
|
`:typeof d.splitUnquoted==`string`?d.splitUnquoted:``,m=`(\\`+f+`['"`+i+`]|[^\\s'"`+i+`])+`,_=h(e,new RegExp([`(`+n+`)`,`(`+m+`|`+o+`|`+a+`)+`].join(`|`),`g`));if(_.length===0)return[];t||={};var v=!1;return _.map(function(n){var i=n[0];if(!i||v)return;if(r.test(i))return{op:i};var a=!1,o=!1,d=``,m=[],h=!1,_=null,y=!1,b;function x(){b+=1;var e,n,r=i.charAt(b);if(r===`{`){if(b+=1,i.charAt(b)===`}`)throw Error(`Bad substitution: `+i.slice(b-2,b+1));var a=1;for(e=b;a>0&&e<i.length;)i.charAt(e)===`{`&&i.charAt(e-1)===`$`?a+=1:i.charAt(e)===`}`&&--a,e+=1;if(a!==0)throw Error(`Bad substitution: `+i.slice(b));--e,n=i.slice(b,e),b=e}else if(/[*@#?$!_-]/.test(r))n=r,b+=1;else{var o=i.slice(b);e=o.match(/[^\w\d_]/),e?(n=o.slice(0,e.index),b+=e.index-1):(n=o,b=i.length)}return g(t,``,n)}function S(){if(_!==null){if(_===0)d!==``&&(m[m.length]=d,d=``);else{m[m.length]=d,d=``;for(var e=1;e<_;e+=1)m[m.length]=``}_=null}}for(b=0;b<i.length;b++){var C=i.charAt(b);if(p&&C!==u&&S(),y||=!a&&(C===`*`||C===`?`),o)d+=C,o=!1;else if(a)C===a?a=!1:a==c?d+=C:C===f?(b+=1,C=i.charAt(b),d+=C===l||C===f||C===u?C:f+C):d+=C===u?x():C;else if(C===l||C===c)a=C,h=!0;else if(r.test(C))return{op:i};else if(s.test(C)){v=!0;var w={comment:e.slice(n.index+b+1)};return d.length?[d,w]:[w]}else if(C===f)o=!0;else if(C===u){var T=x();if(!p)d+=T;else for(var E=0;E<T.length;E+=1){var D=T.charAt(E);p.indexOf(D)<0?(S(),d+=D):_===null?_=D===` `||D===` `||D===`
|
|
741
741
|
`?0:1:D!==` `&&D!==` `&&D!==`
|
|
742
742
|
`&&(_+=1)}}else d+=C}if(y)return{op:`glob`,pattern:d};if(p){if(_!==null&&_>0){m[m.length]=d,d=``;for(var O=1;O<_;O+=1)m[m.length]=``}return(d!==``||h&&m.length===0)&&(m[m.length]=d),m}return d}).reduce(function(e,t){return t===void 0||[].concat(t).forEach(function(t){e[e.length]=t}),e},[])}t.exports=function(e,t,n){var r=_(e,t,n);return typeof t==`function`?r.reduce(function(e,t){if(typeof t==`object`)return e[e.length]=t,e;var n=t.split(RegExp(`(`+d+`.*?`+d+`)`,`g`));return n.length===1?(e[e.length]=n[0],e):(n.filter(Boolean).forEach(function(t){e[e.length]=m.test(t)?JSON.parse(t.split(d)[1]):t}),e)},[]):r}}));i((e=>{e.quote=bke(),e.parse=xke()}))();var x6;(function(e){e.EOF=`EOF`,e.NEWLINE=`NEWLINE`,e.SEMICOLON=`SEMICOLON`,e.AMP=`AMP`,e.PIPE=`PIPE`,e.PIPE_AMP=`PIPE_AMP`,e.AND_AND=`AND_AND`,e.OR_OR=`OR_OR`,e.BANG=`BANG`,e.LESS=`LESS`,e.GREAT=`GREAT`,e.DLESS=`DLESS`,e.DGREAT=`DGREAT`,e.LESSAND=`LESSAND`,e.GREATAND=`GREATAND`,e.LESSGREAT=`LESSGREAT`,e.DLESSDASH=`DLESSDASH`,e.CLOBBER=`CLOBBER`,e.TLESS=`TLESS`,e.AND_GREAT=`AND_GREAT`,e.AND_DGREAT=`AND_DGREAT`,e.LPAREN=`LPAREN`,e.RPAREN=`RPAREN`,e.LBRACE=`LBRACE`,e.RBRACE=`RBRACE`,e.DSEMI=`DSEMI`,e.SEMI_AND=`SEMI_AND`,e.SEMI_SEMI_AND=`SEMI_SEMI_AND`,e.DBRACK_START=`DBRACK_START`,e.DBRACK_END=`DBRACK_END`,e.DPAREN_START=`DPAREN_START`,e.DPAREN_END=`DPAREN_END`,e.IF=`IF`,e.THEN=`THEN`,e.ELSE=`ELSE`,e.ELIF=`ELIF`,e.FI=`FI`,e.FOR=`FOR`,e.WHILE=`WHILE`,e.UNTIL=`UNTIL`,e.DO=`DO`,e.DONE=`DONE`,e.CASE=`CASE`,e.ESAC=`ESAC`,e.IN=`IN`,e.FUNCTION=`FUNCTION`,e.SELECT=`SELECT`,e.TIME=`TIME`,e.COPROC=`COPROC`,e.WORD=`WORD`,e.NAME=`NAME`,e.NUMBER=`NUMBER`,e.ASSIGNMENT_WORD=`ASSIGNMENT_WORD`,e.FD_VARIABLE=`FD_VARIABLE`,e.COMMENT=`COMMENT`,e.HEREDOC_CONTENT=`HEREDOC_CONTENT`})(x6||={}),x6.IF,x6.THEN,x6.ELSE,x6.ELIF,x6.FI,x6.FOR,x6.WHILE,x6.UNTIL,x6.DO,x6.DONE,x6.CASE,x6.ESAC,x6.IN,x6.FUNCTION,x6.SELECT,x6.TIME,x6.COPROC,x6.SEMI_SEMI_AND,x6.TLESS,x6.AND_DGREAT,x6.DBRACK_START,x6.DBRACK_END,x6.DPAREN_START,x6.DPAREN_END,x6.AND_AND,x6.OR_OR,x6.DSEMI,x6.SEMI_AND,x6.PIPE_AMP,x6.DGREAT,x6.LESSAND,x6.GREATAND,x6.LESSGREAT,x6.CLOBBER,x6.AND_GREAT,x6.PIPE,x6.AMP,x6.SEMICOLON,x6.LPAREN,x6.RPAREN,x6.LESS,x6.GREAT,x6.LESS,x6.GREAT,x6.DLESS,x6.DGREAT,x6.LESSAND,x6.GREATAND,x6.LESSGREAT,x6.DLESSDASH,x6.CLOBBER,x6.TLESS,x6.AND_GREAT,x6.AND_DGREAT,x6.LESS,x6.GREAT,x6.DLESS,x6.DGREAT,x6.LESSAND,x6.GREATAND,x6.LESSGREAT,x6.DLESSDASH,x6.CLOBBER,x6.TLESS,x6.LESS,x6.GREAT,x6.DLESS,x6.DGREAT,x6.LESSAND,x6.GREATAND,x6.LESSGREAT,x6.DLESSDASH,x6.CLOBBER,x6.TLESS,x6.AND_GREAT,x6.AND_DGREAT,x6.AMP,x6.PIPE,x6.PIPE_AMP,x6.SEMICOLON,x6.AND_AND,x6.OR_OR,x6.DSEMI,x6.SEMI_AND,x6.SEMI_SEMI_AND;var S6=[{name:`echo`,load:async()=>(await import(`./echo-O45JWWI2-DGiwQF55.mjs`)).echoCommand},{name:`cat`,load:async()=>(await import(`./cat-RDUMLXKC-m8-l0dJv.mjs`)).catCommand},{name:`printf`,load:async()=>(await import(`./printf-CX64KX2P-Br1Ug2Ut.mjs`)).printfCommand},{name:`ls`,load:async()=>(await import(`./ls-KSXFZCWH-CDtp05HC.mjs`)).lsCommand},{name:`mkdir`,load:async()=>(await import(`./mkdir-TDEMSB6C-uC_QraB2.mjs`)).mkdirCommand},{name:`rmdir`,load:async()=>(await import(`./rmdir-XTQXT7RK-Cw3ocqh1.mjs`)).rmdirCommand},{name:`touch`,load:async()=>(await import(`./touch-DX2IJOQ4-uq_8eRY4.mjs`)).touchCommand},{name:`rm`,load:async()=>(await import(`./rm-RTZG23RL-BnOWGONG.mjs`)).rmCommand},{name:`cp`,load:async()=>(await import(`./cp-XOYR4ABJ-D42CslL1.mjs`)).cpCommand},{name:`mv`,load:async()=>(await import(`./mv-Z6MORUFL-B9PTkiG2.mjs`)).mvCommand},{name:`ln`,load:async()=>(await import(`./ln-4TRFBYAT-C2NklMBi.mjs`)).lnCommand},{name:`chmod`,load:async()=>(await import(`./chmod-SYMGL4JA-DTlWPHuG.mjs`)).chmodCommand},{name:`pwd`,load:async()=>(await import(`./pwd-D4OZ7N27-P0N9Gpk_.mjs`)).pwdCommand},{name:`readlink`,load:async()=>(await import(`./readlink-MI4GCHJF-wDvdfdV7.mjs`)).readlinkCommand},{name:`head`,load:async()=>(await import(`./head-HT2B6D2J-9R__Yy5p.mjs`)).headCommand},{name:`tail`,load:async()=>(await import(`./tail-S5ULNTJU-CnLzyp7W.mjs`)).tailCommand},{name:`wc`,load:async()=>(await import(`./wc-TQB3VNOX-CKtInFV_.mjs`)).wcCommand},{name:`stat`,load:async()=>(await import(`./stat-BT5A227F-DTts8oaN.mjs`)).statCommand},{name:`grep`,load:async()=>(await import(`./grep-2HUTXO5U-Bvpc71YZ.mjs`)).grepCommand},{name:`fgrep`,load:async()=>(await import(`./grep-2HUTXO5U-Bvpc71YZ.mjs`)).fgrepCommand},{name:`egrep`,load:async()=>(await import(`./grep-2HUTXO5U-Bvpc71YZ.mjs`)).egrepCommand},{name:`rg`,load:async()=>(await import(`./rg-XNF3R3II-DKI4o3y8.mjs`)).rgCommand},{name:`sed`,load:async()=>(await import(`./sed-JAPPVBEU-y4kzwh-U.mjs`)).sedCommand},{name:`awk`,load:async()=>(await import(`./awk2-BBAGSFUB-wDlbOPdF.mjs`)).awkCommand2},{name:`sort`,load:async()=>(await import(`./sort-DCNRDA7U-BRNZXaM9.mjs`)).sortCommand},{name:`uniq`,load:async()=>(await import(`./uniq-SUNANL47-C_dQux5r.mjs`)).uniqCommand},{name:`comm`,load:async()=>(await import(`./comm-5SLSESQG-B160yVYr.mjs`)).commCommand},{name:`cut`,load:async()=>(await import(`./cut-OPC3VAGB-DyTb922x.mjs`)).cutCommand},{name:`paste`,load:async()=>(await import(`./paste-7N6AFSDS-BbuyICrx.mjs`)).pasteCommand},{name:`tr`,load:async()=>(await import(`./tr-2HXZRDSW-BjPZn8n7.mjs`)).trCommand},{name:`rev`,load:async()=>(await import(`./rev-XOSYPP45-DJ7MH0ty.mjs`)).rev},{name:`nl`,load:async()=>(await import(`./nl-U5YJDM32-BioDr4pn.mjs`)).nl},{name:`fold`,load:async()=>(await import(`./fold-LDSORVYE-DzcV-vp8.mjs`)).fold},{name:`expand`,load:async()=>(await import(`./expand-DTNXU4LQ-Bpnv4ghU.mjs`)).expand},{name:`unexpand`,load:async()=>(await import(`./unexpand-RGTMIGZM-kHLFypbk.mjs`)).unexpand},{name:`strings`,load:async()=>(await import(`./strings-7PLOGTPD-DcSwox5x.mjs`)).strings},{name:`split`,load:async()=>(await import(`./split-SITCSYCZ-CXEcy-ww.mjs`)).split},{name:`column`,load:async()=>(await import(`./column-WLPMMSTS-DL3_07Lu.mjs`)).column},{name:`join`,load:async()=>(await import(`./join-GG2LDHE5-B2crRcrv.mjs`)).join},{name:`tee`,load:async()=>(await import(`./tee-O7VXZDCO-CPDtNjnw.mjs`)).teeCommand},{name:`find`,load:async()=>(await import(`./find-DH2ALKQS-CVRGx4iG.mjs`)).findCommand},{name:`basename`,load:async()=>(await import(`./basename-AA2KJYZQ-CZ6ADlYI.mjs`)).basenameCommand},{name:`dirname`,load:async()=>(await import(`./dirname-LEMTZZFS-DuDN0dhi.mjs`)).dirnameCommand},{name:`tree`,load:async()=>(await import(`./tree-LYXBS7DC-CIx1Kfia.mjs`)).treeCommand},{name:`du`,load:async()=>(await import(`./du-WO2ENHXQ-DZrvHJqf.mjs`)).duCommand},{name:`env`,load:async()=>(await import(`./env-5EPCWSXR-Cbpw0Lim.mjs`)).envCommand},{name:`printenv`,load:async()=>(await import(`./env-5EPCWSXR-Cbpw0Lim.mjs`)).printenvCommand},{name:`alias`,load:async()=>(await import(`./alias-JE7RI5QX-DXCJ-qLD.mjs`)).aliasCommand},{name:`unalias`,load:async()=>(await import(`./alias-JE7RI5QX-DXCJ-qLD.mjs`)).unaliasCommand},{name:`history`,load:async()=>(await import(`./history-J4QRNGRO-Co6e9xUo.mjs`)).historyCommand},{name:`xargs`,load:async()=>(await import(`./xargs-I6EZUCYF-BxxszDkV.mjs`)).xargsCommand},{name:`true`,load:async()=>(await import(`./true-WHJNXCHG-w3ayCUR8.mjs`)).trueCommand},{name:`false`,load:async()=>(await import(`./true-WHJNXCHG-w3ayCUR8.mjs`)).falseCommand},{name:`clear`,load:async()=>(await import(`./clear-5CZ5X4YR-BIhQHuOh.mjs`)).clearCommand},{name:`bash`,load:async()=>(await import(`./bash-IJWYRKFO-DcYpwzkU.mjs`)).bashCommand},{name:`sh`,load:async()=>(await import(`./bash-IJWYRKFO-DcYpwzkU.mjs`)).shCommand},{name:`jq`,load:async()=>(await import(`./jq-LYZFFBZB-BMLmD0PS.mjs`)).jqCommand},{name:`base64`,load:async()=>(await import(`./base64-4YMZCVJ5-DWBbgBRj.mjs`)).base64Command},{name:`diff`,load:async()=>(await import(`./diff-HJF2MPDN-DmTjb9f0.mjs`)).diffCommand},{name:`date`,load:async()=>(await import(`./date-DD7FVA2V-BSrLXaCI.mjs`)).dateCommand},{name:`sleep`,load:async()=>(await import(`./sleep-VZFPZFWA-DPmPUpYL.mjs`)).sleepCommand},{name:`timeout`,load:async()=>(await import(`./timeout-VRKMCG72-G3DVszag.mjs`)).timeoutCommand},{name:`time`,load:async()=>(await import(`./time-DEUO3QV2-CdVsJ04Z.mjs`)).timeCommand},{name:`seq`,load:async()=>(await import(`./seq-RN5ZUASB-PVf-rQ-S.mjs`)).seqCommand},{name:`expr`,load:async()=>(await import(`./expr-YYCVMXE3-BDOVRayn.mjs`)).exprCommand},{name:`md5sum`,load:async()=>(await import(`./md5sum-INMIK4DX-CRDOz6nr.mjs`)).md5sumCommand},{name:`sha1sum`,load:async()=>(await import(`./sha1sum-VJPNLNU6-BU98q8gr.mjs`)).sha1sumCommand},{name:`sha256sum`,load:async()=>(await import(`./sha256sum-PI32XWXY-CeL32a6r.mjs`)).sha256sumCommand},{name:`file`,load:async()=>(await import(`./file-IGDTDPLG-CUqZAlKT.mjs`)).fileCommand},{name:`html-to-markdown`,load:async()=>(await import(`./html-to-markdown-TFCECAGV-BDXFAacx.mjs`)).htmlToMarkdownCommand},{name:`help`,load:async()=>(await import(`./help-VVWX7SA5-Defr0Q9g.mjs`)).helpCommand},{name:`which`,load:async()=>(await import(`./which-XZHEH76L-BpfGDIeg.mjs`)).whichCommand},{name:`tac`,load:async()=>(await import(`./tac-SJGXQ4T2-vsCjLe3q.mjs`)).tac},{name:`hostname`,load:async()=>(await import(`./hostname-BK6HG2DE-CL_ll-mo.mjs`)).hostname},{name:`whoami`,load:async()=>(await import(`./whoami-DGKU3D2X-CbRRBIk3.mjs`)).whoami},{name:`od`,load:async()=>(await import(`./od-VJEF2UR5-DcvNzw_D.mjs`)).od},{name:`gzip`,load:async()=>(await import(`./gzip-AQXSGOVS-DkFr6f8Z.mjs`)).gzipCommand},{name:`gunzip`,load:async()=>(await import(`./gzip-AQXSGOVS-DkFr6f8Z.mjs`)).gunzipCommand},{name:`zcat`,load:async()=>(await import(`./gzip-AQXSGOVS-DkFr6f8Z.mjs`)).zcatCommand}];(typeof __BROWSER__>`u`||!__BROWSER__)&&(S6.push({name:`tar`,load:async()=>(await import(`./tar-MZQD7NO4-BRGDcHqv.mjs`)).tarCommand}),S6.push({name:`yq`,load:async()=>(await import(`./yq-OAKYHSXH-KGmxWF1Q.mjs`)).yqCommand}),S6.push({name:`xan`,load:async()=>(await import(`./xan-UD7JYIL2-DmdWvgSg.mjs`)).xanCommand}),S6.push({name:`sqlite3`,load:async()=>(await import(`./sqlite3-TE5AIOTF-DVwda1Ow.mjs`)).sqlite3Command}));var C6=[];(typeof __BROWSER__>`u`||!__BROWSER__)&&(C6.push({name:`python3`,load:async()=>(await import(`./python3-DNGS4G3E-CixyRGKv.mjs`)).python3Command}),C6.push({name:`python`,load:async()=>(await import(`./python3-DNGS4G3E-CixyRGKv.mjs`)).pythonCommand}));var w6=[];(typeof __BROWSER__>`u`||!__BROWSER__)&&(w6.push({name:`js-exec`,load:async()=>(await import(`./js-exec-VXN6TZ7U-Z8_USGOo.mjs`)).jsExecCommand}),w6.push({name:`node`,load:async()=>(await import(`./js-exec-VXN6TZ7U-Z8_USGOo.mjs`)).nodeStubCommand})),new TextEncoder,Object.freeze({stdout:``,stderr:``,exitCode:0}),[...new Map([[`:`,[`: [arguments]`,`Null command.
|
|
@@ -1109,7 +1109,7 @@ caused by: `+i(o,t)):a},a=e=>i(e,new Set),o=(e,t,i)=>{if(!n(e))return``;let a=i?
|
|
|
1109
1109
|
`),process.exit(1));let f=e=>typeof e==`object`&&e&&!Array.isArray(e)?e:null,p=e=>{u.write(`${JSON.stringify(e)}\n`)},m=e=>{process.stdout.write(`${JSON.stringify(e)}\n`)},h=(e,t)=>{process.stderr.write(`ok-browser relay: dropped a ${e} line that ${t}\n`)},g=(e,t,n)=>{if(e.trim()===``)return null;let r;try{r=JSON.parse(e)}catch{return h(t,`is not JSON`),null}let i=f(r);if(i!==null)return i;if(Array.isArray(r))for(let e of r){let t=f(e);t?.method!==void 0&&t.id!==void 0&&n({jsonrpc:`2.0`,id:t.id,error:{code:-32600,message:`Batched messages are not supported`}})}return h(t,`is not a single JSON-RPC message`),null},_=e=>{let t=g(e,`client`,m);if(t===null||t.method===`notifications/roots/list_changed`)return null;let n=f(t.params),r=n?.name;return t.method===`tools/call`&&(typeof r!=`string`||!s.has(r))?(t.id!==void 0&&m({jsonrpc:`2.0`,id:t.id,error:{code:-32602,message:`Tool ${String(r)} is not available`}}),null):(t.method===`initialize`&&n!==null&&(n.capabilities={...f(n.capabilities),roots:{listChanged:!1}}),JSON.stringify(t))},v=e=>{let t=g(e,`server`,p);if(t===null)return null;if(t.method===`roots/list`)return t.id!==void 0&&p({jsonrpc:`2.0`,id:t.id,result:c}),null;let n=f(t.result),r=n?.tools;if(n===null||!Array.isArray(r))return e;let i=r.filter(e=>{let t=f(e)?.name;return typeof t==`string`&&s.has(t)});for(let e of i){let t=f(f(e)?.annotations);t!==null&&(t.readOnlyHint=!1)}return n.tools=i,JSON.stringify(t)},y=(e,t,n,r)=>{let i=``,a=e=>{let r=n(e);r!==null&&t.write(`${r}\n`)};e.setEncoding(`utf8`),e.on(`data`,e=>{i+=String(e);let t=i.indexOf(`
|
|
1110
1110
|
`);for(;t!==-1;)a(i.slice(0,t)),i=i.slice(t+1),t=i.indexOf(`
|
|
1111
1111
|
`)}),e.on(`end`,()=>{i!==``&&a(i),r&&t.end()})};u.on(`error`,()=>{}),y(process.stdin,u,_,!0),y(d,process.stdout,v,!1);for(let e of[`SIGINT`,`SIGTERM`,`SIGHUP`])process.on(e,()=>l.kill());l.on(`error`,e=>{process.stderr.write(`${e.message}\n`),process.exit(1)}),l.on(`close`,e=>{process.exitCode=e??1,process.stdin.destroy()})}const G8=V({name:I(),version:I().regex(/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/)});Yi([B(G8),H(I(),G8).transform(e=>Object.values(e))]).pipe(nre([G8])),`${jAe.toString()}${JSON.stringify([`browser_click`,`browser_close`,`browser_console_messages`,`browser_drag`,`browser_drop`,`browser_emulate_media`,`browser_evaluate`,`browser_file_upload`,`browser_fill_form`,`browser_find`,`browser_handle_dialog`,`browser_hover`,`browser_navigate`,`browser_navigate_back`,`browser_network_request`,`browser_network_requests`,`browser_press_key`,`browser_resize`,`browser_select_option`,`browser_snapshot`,`browser_tabs`,`browser_take_screenshot`,`browser_type`,`browser_wait_for`])}`,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(x),QX(`agent-registry-apply`),QX(`local-op-security`),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),Ed.cursor,Ed.codex,Ed[`claude-desktop`],t8(()=>{}),Object.freeze({source:`local`,skipStoreHooks:!0,context:Object.freeze({origin:`effect-capture`,paired:!1})}),QX(`external-change-attribution`),QX(`mermaid-validator`),QX(`rename-log`),QX(`history`);function K8(e){return vt.filter(t=>g(j(e,t.hostDir)))}function q8(e,t){return[...Object.entries(e).filter(e=>e[1]!==null).map(([e,t])=>({editor:e,root:t})),{editor:`agents`,root:t}]}q8(pt,_S),[...q8(mt,_S)].sort((e,t)=>{let n=b4.indexOf(e.editor),r=b4.indexOf(t.editor);return(n===-1?b4.length:n)-(r===-1?b4.length:r)||e.editor.localeCompare(t.editor)}),QX(`installed-skills-marker`),QX(`skill-import`),QX(`backlinks`),QX(`local-target-inventory`),QX(`tag-index`),QX(`derived-document-index`);const J8={start:L().int().nonnegative().optional(),end:L().int().nonnegative().optional(),quote:I().min(1).optional(),prefix:I().max(1e3).optional(),suffix:I().max(1e3).optional()};V({docName:I().min(1),...J8,propertyKey:I().min(1).optional(),propertyPath:B(Yi([I(),L().int().nonnegative()])).optional(),body:I(),queue:R().optional(),summary:I().optional()});const Y8=Ri();Xi(`action`,[V({action:W(`edit`),id:Y8,body:I(),summary:I().optional()}),V({action:W(`resolve`),id:Y8,summary:I().optional()}),V({action:W(`reopen`),id:Y8,summary:I().optional()}),V({action:W(`replace`),id:Y8,...J8,summary:I().optional()}),V({action:W(`queue`),id:Y8,summary:I().optional()}),V({action:W(`unqueue`),id:Y8,summary:I().optional()}),V({action:W(`dispatch-prepare`),id:Y8,summary:I().optional()}),V({action:W(`dispatch-complete`),id:Y8,summary:I().optional()}),V({action:W(`dispatch-prepare-batch`),ids:B(Y8).min(1).max(200),summary:I().optional()}),V({action:W(`dispatch-complete-batch`),ids:B(Y8).min(1).max(200),summary:I().optional()})]),QX(`embeddings`),QX(`embeddings`);function MAe(e){try{let t=new URL(e),n=t.pathname.replace(/\/+$/,``);return`${t.protocol}//${t.host.toLowerCase()}${n}`}catch{return e.trim().replace(/\/+$/,``)}}MAe(jl),QX(`embeddings`),QX(`embeddings`);const NAe=/^[A-Za-z0-9-]{8,64}$/;let X8=null;function PAe(e){return j(e??_e(),`.ok`,`machine-id`)}function FAe(e){if(e===void 0&&X8!==null)return X8;let t=PAe(e),n=null;try{let e=S(t,`utf-8`).trim();NAe.test(e)&&(n=e)}catch{}if(n===null){n=Ne();try{v(k(t),{recursive:!0}),re(t,`${n}\n`,{encoding:`utf-8`,mode:384})}catch(e){QX(`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&&(X8=n),n}QX(`process-lock`);function IAe(e,t){return N(e,`${t}.lock`)}function LAe(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 RAe(e,t){if(typeof e.url==`string`&&e.url.length>0){let t=LAe(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}QX(`asset-references`),QX(`file-ops`),QX(`upload-streaming`);const Z8=`Absolute OK project/worktree path. Routed stdio: required until set unless one client root exists. Project-bound HTTP: optional, confined to its root.`,Q8=`Canonical ids: ${iye().map(e=>e.name).join(`, `)}. Call palette({components:[ids]}) before authoring for syntax/props, markdown-native forms, Mermaid and themed html preview for interactive charts/demos. Other JSX stays raw MDX when no canonical fits.`;I().max(200).optional().describe(`Optional one-line user-outcome description (≤80 chars). Appears as a bullet in the timeline.`),I().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."),I().nullable().describe("Route-only preview URL (`/#/<doc>`, no host:port), or null when no UI is running."),I().optional().describe(`How the previewUrl was resolved (e.g. the UI lock).`),I().optional().describe(`Route of the prior/removed path, for closing a stale preview tab.`);const zAe=V({value:I(),truncatedFrom:L().optional(),hint:I().optional()}).describe(`Normalized change-note summary, when one was recorded.`),BAe=B(H(I(),z()));H(I(),z()).optional().describe("Preview-attach hint (`{ action, previewUrl?, message? }`) when relevant."),B(Xd).describe('Outbound internal links in the just-written doc that do not resolve. Always present — `[]` means every link resolves UNLESS `brokenLinkSuppression` is also present, in which case a project policy withheld findings, or `warnings` carries `link-check-deferred`, in which case the links were not checked because the server is still starting or busy with other writes. A withholding that arrives in a shape this build cannot validate is dropped rather than relayed, so `brokenLinkSuppression` stays absent even though findings were withheld. The `audit` tool is the surface that discloses that case, through its `warnings`. 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" | "excluded" }`. `excluded` means the file exists on disk but a .gitignore or .okignore rule keeps it out of the project; a `!` rule in .okignore re-includes it or its folder. Report-only — the write landed regardless; fix in a follow-up edit.'),Qd.optional().describe('Present ONLY when a project policy omitted detected broken links from `brokenLinks` — so an empty `brokenLinks` beside it does NOT mean every link resolves. `{ reason, count }`; `reason` today is `"reserved-log-policy"` (a reserved `log.md` records history whose links are expected not to resolve) and is an open token, so treat one you do not recognize as a withholding policy all the same. `count` is how many findings were withheld; the hrefs are deliberately not returned, because none of them is yours to repair.'),zAe.optional(),B(Jd).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. `link-check-deferred` means links were not checked because the server is still starting or busy with other writes — that doc is re-checked only by a later write or edit of it, or an `audit`, which can time out until startup finishes."),B(V({name:I(),description:I().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 VAe=I().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 $8(e){return{text:VAe,...e}}function HAe(e){return`Machine-readable codes aligned 1:1 with \`warnings\` (\`warnings[i]\` is the display text for \`warningCodes[i]\`) — switch on these, never on the English. Absent when ${e} sent warning text it did not pair with codes, or paired one with a code this build does not recognise; \`warnings\` still carries the full text either way, so treat a missing field as unknown rather than as an all-clear.`}HAe(`the server`);function UAe(e){return`Always emitted, \`[]\` when there were none. \`warningCodes\` accompanies this list 1:1 whenever ${e} paired every warning it sent with a code this build recognises; otherwise \`warningCodes\` is absent and this list still carries the full text. \`content[0].text\` lists every warning either way. A \`warnings\` payload in a shape this build cannot read at all becomes one entry saying so, with \`warningCodes\` absent — \`[]\` never means "unreadable".`}UAe(`the server`),QX(`git-checkout`),QX(`git-worktree-status`),QX(`managed-artifact-persistence`),QX(`timeline`),QX(`suggest-links`),QX(`git-context`),QX(`clone-flow`),Fe(o),B8.project,Object.fromEntries(Object.entries(vS).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(`
|
|
1112
|
-
`),QX(`skills-leaderboard`),QX(`handoff-dispatch`),V({target:U(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:I().min(1).max(4096),workspacePath:I().optional()}),V({}).loose(),QX(`github-permissions`),QX(`github-reference`),QX(`github-reference`),QX(`link-preview.guarded-fetch`),QX(`link-preview.cache`),QX(`saved-themes`),V({enabled:R(),active:R(),git:V({state:U([`not-applicable`,`ready`,`missing`,`conflict`,`unavailable`]),ownership:U([`open-knowledge`,`existing`]).optional()}),applied:R().optional(),reason:U([`git-conflict`,`git-unavailable`,`config-write`]).optional()}),V({enabled:R()}).strict(),QX(`managed-rename`),Object.assign(FDe,{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`}),QX(`search`),QX(`skill-install`),QX(`write-advisory`),QX(`api`),V({principalId:I().optional(),tabSessionId:I().optional(),expectedServerInstanceId:I().optional(),expectedBranch:I().optional(),expectedDocLineageEpoch:I().optional(),clientProtocolVersion:L().optional(),clientRuntimeVersion:I().optional(),clientKind:I().optional()}).loose(),new
|
|
1112
|
+
`),QX(`skills-leaderboard`),QX(`handoff-dispatch`),V({target:U(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:I().min(1).max(4096),workspacePath:I().optional()}),V({}).loose(),QX(`github-permissions`),QX(`github-reference`),QX(`github-reference`),QX(`link-preview.guarded-fetch`),QX(`link-preview.cache`),QX(`saved-themes`),V({enabled:R(),active:R(),git:V({state:U([`not-applicable`,`ready`,`missing`,`conflict`,`unavailable`]),ownership:U([`open-knowledge`,`existing`]).optional()}),applied:R().optional(),reason:U([`git-conflict`,`git-unavailable`,`config-write`]).optional()}),V({enabled:R()}).strict(),QX(`managed-rename`),Object.assign(FDe,{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`}),QX(`search`),QX(`skill-install`),QX(`write-advisory`),QX(`api`),V({principalId:I().optional(),tabSessionId:I().optional(),expectedServerInstanceId:I().optional(),expectedBranch:I().optional(),expectedDocLineageEpoch:I().optional(),clientProtocolVersion:L().optional(),clientRuntimeVersion:I().optional(),clientKind:I().optional()}).loose(),new He,t8(()=>{}),[...Eae],["Read-only validation of markdownlint, frontmatter, OKF and broken internal links. Requires the Hocuspocus server. No args scans all in-scope .md/.mdx; `path` narrows to file/folder. `links` is the navigation/graph tool.","ran names selected `markdownlint`, `frontmatter`, `okf`, `links`. A family absent from `ran` was not checked. A selected family remains in ran if degraded; warnings explain why and it may still have contributed findings. okf covers document and project-tree OKF checks here.",`Broken links are reported under the source doc. Default-on validation.suppressLogLinkAdvisories omits links inside lowercase log.md/log.mdx at any depth; LOG.md is ordinary. brokenLinkSuppression reports reason reserved-log-policy and count without paths/hrefs. Logs are append-only history: never rewrite old entries to clear links. links({kind:'dead'}) reads raw state.`,`Diagnostics carry source, code, message, 0-based LSP range (link columns approximate) and severity. Broken links default to warning; validation.links can raise/hide them. Only problematic files are listed; fileCount/errorCount/warningCount reflect full scan. Output is capped at 10 files × 10 diagnostics each and project-wide at 10 warnings; omittedWarningCount reports dropped warnings. Narrow path reduces competing files; per-file caps still apply. Follow runtime hints for document lint and raw dead links; project-tree OKF findings remain capped.`,`Nothing is modified. Auto-fix document lint with lint({document,fix:true}); fix broken links with edit/write.`].join(`
|
|
1113
1113
|
`),[`Save a project-wide checkpoint of every document. Requires the Hocuspocus server. Optional summary ≤80 chars defaults to "Checkpoint version"; avoid secrets or PII because it persists in git history. Returns version (40-char SHA). Find it with history and restore one doc with restore_version({document,version}).`].join(`
|
|
1114
1114
|
`),[`Read effective config merged defaults → user → project; no running OK server needed. Optional key is a dotted path (content, appearance.theme); omit for the full config. All fields are readable. Re-read after disk changes or before relying on an old value.`,"Removed server.*, mcp.*, github.*, preview.baseUrl and preview.scriptSrc return exists:false; appearance.preview.autoOpen remains live. This is a pure read. Use `install` skillFolders for folder topology."].join(`
|
|
1115
1115
|
`),I().optional().describe(`Dotted config key (e.g. "appearance.theme"). Omit to return the full merged config.`),I().optional().describe(Z8),$8({value:z().describe(`Resolved config value at the requested path (or full config).`),exists:R().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:I().optional().describe(`Echo of the requested dotted key (absent when reading the full config).`)});const WAe=[`lock`],GAe=Yi([no,Ui()]),KAe=Yi([I(),L(),R(),B(z()),H(I(),z()),Ui()]);H(I(),KAe).superRefine((e,t)=>{for(let[n,r]of Object.entries(e))GAe.safeParse(r).success||t.addIssue({code:`custom`,path:[n],message:`invalid frontmatter value — allowed: a scalar (string | number | boolean), a scalar array, a nested object, or an array of objects; a top-level key may be null to delete it, but nested null is not allowed`})}).describe(`Metadata as a key→value map. Values may be a scalar (string | number | boolean), a scalar array, a nested object, or an array of objects. Merge-patch: include a top-level key to set it, set a top-level key to null to delete it; keys you omit are unchanged. A nested object REPLACES the existing subtree at that key (send the full subtree you want). Example: { title: "Q3 Planning", tags: ["planning"], metadata: { version: "1.0", author: "Inkeep" } }.`),U([`append`,`prepend`,`replace`]).describe(`Where content lands. replace = overwrite the whole body (default for a new doc; required for an existing doc). append / prepend = add to the end / start.`),U(Td).describe("File format for a NEW doc: `.md` (default) or `.mdx` (Markdown + JSX components). Honored only on create — an existing doc keeps its on-disk extension. Takes precedence over an extension typed into `path`."),U(wd).describe(`Level: "project" (default — a Project skill: lives in this KB wherever its folder is, shared with teammates via git) or "global" (a Global skill: lives under your user home, available in every project on this machine — not shared, not version-tracked). Pass the literal value "global" for a Global skill.`),new Set(mJ),[`Delete exactly one document, folder, template, skill or asset. Requires the Hocuspocus server. Irreversible; deleting a doc leaves inbound redlinks. Call links({kind:'backlinks',document}) BEFORE deleting.`,`document: path or paths array; folder: recursive folder path; template: {path:'<folder>/<name>'}; asset: {path:'<folder>/<file.ext>'}. skill: {name} deletes the whole bundle, or {name,files:['references/x.md']} deletes selected files. Template/skill deletion is attributed and cleans empty .ok/ directories.`].join(`
|
|
@@ -1544,6 +1544,6 @@ GFS4: `),console.error(e)}),r[c]||(d(r,global[c]||[]),r.close=(function(e){funct
|
|
|
1544
1544
|
`);re(e,o)}function j9(e,t){let n=S(e,`utf-8`);if(n.trim().length!==0)try{let r=k9(JSON.parse(n),t),i=n.endsWith(`
|
|
1545
1545
|
`)?`
|
|
1546
1546
|
`:``;re(e,`${JSON.stringify(r,null,2)}${i}`)}catch{let r=O9(n,t.contentDirSpellings);r!==n&&re(e,r)}}function M9(e,t){let n=S(e,`utf-8`),r=O9(n,t.contentDirSpellings);r!==n&&re(e,r)}function N9(e){try{return w(e,{withFileTypes:!0}).filter(e=>e.isFile()).map(t=>j(e,t.name))}catch{return[]}}const qNe=new Set([`agent-presence.json`,`agent-effects.json`,`runtime.json`]);function P9(e){return/\.log\.\d+$/.test(e)}function JNe(e){return e.endsWith(`.jsonl`)||e.endsWith(`.log`)||P9(e)}const YNe=[`telemetry`,`logs`,`process`,`diagnostic-reports`];function XNe(e){let t={contentDirSpellings:D9(e.contentDir)};for(let n of YNe)for(let r of N9(j(e.stagingDir,n)))JNe(r)?A9(r,t):r.endsWith(`.json`)?j9(r,t):M9(r,t);for(let n of N9(j(e.stagingDir,`state`))){let e=ae(n);n.endsWith(`.jsonl`)?A9(n,t):qNe.has(e)?j9(n,t):M9(n,t)}}const F9=[`.ok`,`local`,`telemetry`],I9=[`.ok`,`local`,`logs`],L9=[`.ok`,`local`,`loss-capture`],R9=`spans-current.jsonl`,z9=`spans-prev.jsonl`,B9=`server-current.jsonl`,V9=`server-prev.jsonl`,H9=`loss-current.jsonl`,U9=`loss-prev.jsonl`;function ZNe(e){return j(e,...F9,R9)}function QNe(e){return j(e,...F9,z9)}function $Ne(e){return j(e,...I9,B9)}function ePe(e){return j(e,...I9,V9)}function tPe(e){return j(e,...L9,H9)}function nPe(e){return j(e,...L9,U9)}const W9=1e3;async function rPe(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/agent-presence`,{signal:AbortSignal.timeout(W9)});return t.ok?await t.text():null}catch{return null}}async function iPe(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/agent-effects`,{signal:AbortSignal.timeout(W9)});return t.ok?await t.text():null}catch{return null}}async function aPe(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/watcher-recent`,{signal:AbortSignal.timeout(W9)});return t.ok?await t.text():null}catch{return null}}function oPe(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(`
|
|
1547
|
-
`)}\n`:null}catch{return null}}function sPe(e){let t=j(e,`.git`,`ok`);if(!g(t))return null;let n=l(`git`,[`-C`,t,`log`,`--oneline`,`-50`],c8({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function cPe(e){let t=j(e,`.git`,`ok`);if(!g(t))return null;let n=l(`git`,[`-C`,t,`for-each-ref`,`--sort=-creatordate`,`--count=50`,`--format=%(refname)%09%(creatordate:iso-strict)%09%(contents:subject)`,`refs/checkpoints/`],c8({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function G9(){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 lPe(){return{nodeVersion:process.version,platform:ye(),arch:me()}}function uPe(){return process.env.OTEL_SDK_DISABLED===`false`}function K9(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function q9(e){if(!g(e))return{};let t;try{t=(0,_s.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(!K9(t))return{};let n=t.telemetry;if(!K9(n))return{};let r=n.localSink;return K9(r)?r:{}}function J9(e){return typeof e==`boolean`?e:void 0}function dPe(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:void 0}function Y9(e){if(K9(e))return dPe(e.maxBytes)}function fPe(e){let t=q9(YJ(`project`,e)),n=q9(YJ(`project-local`,e));return{enabled:J9(n.enabled)??J9(t.enabled)??!0,spansMaxBytes:Y9(n.spans)??Y9(t.spans)??52428800,logsMaxBytes:Y9(n.logs)??Y9(t.logs)??26214400}}function pPe(e){return Me(`sha256`).update(e).digest(`hex`)}function X9(e){let t=S(e),n=0;for(let e=0;e<t.length;e++)t[e]===10&&n++;return n}const mPe=[`"doc.name"`,`"docName"`];function hPe(e){let t=S(e,`utf-8`),n=0;for(let e of mPe){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(k(t),{recursive:!0}),e.endsWith(`.ips`)?re(t,Z5(S(e,`utf-8`))):m(e,t),!0}catch{return!1}}function Q9(e){let t=[],n=e=>{let r=w(e,{withFileTypes:!0});for(let i of r){let r=j(e,i.name);i.isDirectory()?n(r):i.isFile()&&t.push(r)}};return n(e),t.sort()}const gPe=new Set([`.jsonl`]);function _Pe(e){let t=e.lastIndexOf(`.`);return t!==-1&&gPe.has(e.slice(t))}const vPe=new Set([`.jsonl`,`.json`,`.txt`,`.log`,`.lock`,`.yaml`,`.yml`,`.ips`]);function yPe(e){if(P9(e))return!0;let t=e.lastIndexOf(`.`);return t!==-1&&vPe.has(e.slice(t))}function bPe(e){let t=[];for(let n of Q9(e)){let r=$9(e,n);if(!yPe(r))continue;let{redacted:i,patterns:a,lineCount:o}=CP(S(n,`utf-8`));a.length!==0&&(re(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 M(e,t).split(le).join(`/`)}async function xPe(e){let t=N(e.contentDir),n=N(e.projectDir??e.contentDir),r=e.deps??{},i=r.fetchAgentPresence??rPe,a=r.fetchAgentEffects??iPe,o=r.fetchWatcherRecent??aPe,s=r.readShadowHead??sPe,c=r.readCheckpointRefs??cPe,l=r.now??(()=>new Date),u=r.okVersion??(()=>`0.86.0-beta.
|
|
1547
|
+
`)}\n`:null}catch{return null}}function sPe(e){let t=j(e,`.git`,`ok`);if(!g(t))return null;let n=l(`git`,[`-C`,t,`log`,`--oneline`,`-50`],c8({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function cPe(e){let t=j(e,`.git`,`ok`);if(!g(t))return null;let n=l(`git`,[`-C`,t,`for-each-ref`,`--sort=-creatordate`,`--count=50`,`--format=%(refname)%09%(creatordate:iso-strict)%09%(contents:subject)`,`refs/checkpoints/`],c8({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function G9(){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 lPe(){return{nodeVersion:process.version,platform:ye(),arch:me()}}function uPe(){return process.env.OTEL_SDK_DISABLED===`false`}function K9(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function q9(e){if(!g(e))return{};let t;try{t=(0,_s.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(!K9(t))return{};let n=t.telemetry;if(!K9(n))return{};let r=n.localSink;return K9(r)?r:{}}function J9(e){return typeof e==`boolean`?e:void 0}function dPe(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:void 0}function Y9(e){if(K9(e))return dPe(e.maxBytes)}function fPe(e){let t=q9(YJ(`project`,e)),n=q9(YJ(`project-local`,e));return{enabled:J9(n.enabled)??J9(t.enabled)??!0,spansMaxBytes:Y9(n.spans)??Y9(t.spans)??52428800,logsMaxBytes:Y9(n.logs)??Y9(t.logs)??26214400}}function pPe(e){return Me(`sha256`).update(e).digest(`hex`)}function X9(e){let t=S(e),n=0;for(let e=0;e<t.length;e++)t[e]===10&&n++;return n}const mPe=[`"doc.name"`,`"docName"`];function hPe(e){let t=S(e,`utf-8`),n=0;for(let e of mPe){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(k(t),{recursive:!0}),e.endsWith(`.ips`)?re(t,Z5(S(e,`utf-8`))):m(e,t),!0}catch{return!1}}function Q9(e){let t=[],n=e=>{let r=w(e,{withFileTypes:!0});for(let i of r){let r=j(e,i.name);i.isDirectory()?n(r):i.isFile()&&t.push(r)}};return n(e),t.sort()}const gPe=new Set([`.jsonl`]);function _Pe(e){let t=e.lastIndexOf(`.`);return t!==-1&&gPe.has(e.slice(t))}const vPe=new Set([`.jsonl`,`.json`,`.txt`,`.log`,`.lock`,`.yaml`,`.yml`,`.ips`]);function yPe(e){if(P9(e))return!0;let t=e.lastIndexOf(`.`);return t!==-1&&vPe.has(e.slice(t))}function bPe(e){let t=[];for(let n of Q9(e)){let r=$9(e,n);if(!yPe(r))continue;let{redacted:i,patterns:a,lineCount:o}=CP(S(n,`utf-8`));a.length!==0&&(re(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 M(e,t).split(le).join(`/`)}async function xPe(e){let t=N(e.contentDir),n=N(e.projectDir??e.contentDir),r=e.deps??{},i=r.fetchAgentPresence??rPe,a=r.fetchAgentEffects??iPe,o=r.fetchWatcherRecent??aPe,s=r.readShadowHead??sPe,c=r.readCheckpointRefs??cPe,l=r.now??(()=>new Date),u=r.okVersion??(()=>`0.86.0-beta.16`),d=r.readDesktopEnv??G9,f=r.readLanguage??E9,p=r.readRuntime??lPe,h=r.isOtlpPushEnabled??uPe,_=y(j(xe(),`ok-bundle-`));try{v(j(_,`telemetry`),{recursive:!0}),v(j(_,`logs`),{recursive:!0}),v(j(_,`state`),{recursive:!0}),Z9(ZNe(n),j(_,`telemetry`,R9)),Z9(QNe(n),j(_,`telemetry`,z9)),Z9($Ne(n),j(_,`logs`,B9)),Z9(ePe(n),j(_,`logs`,V9));for(let t of e.userLogFiles??[])Z9(t,j(_,`logs`,ae(t)));for(let t of e.userStateFiles??[])Z9(t,j(_,kJ,ae(t)));let y=0;for(let t of e.diagnosticReports?.files??[])Z9(t,j(_,`diagnostic-reports`,ae(t)))&&(y+=1);let b=j(n,`.ok`,`local`),x=j(b,`server.lock`),C=`not-running`,w=`no server.lock`,T=null;if(g(x)){Z9(x,j(_,`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`:(re(j(_,`state`,`agent-presence.json`),e),C=`running`,w=``);let t=await a(T);t!==null&&re(j(_,`state`,`agent-effects.json`),t);let n=await o(T);if(n!==null){let e=oPe(n);e!==null&&re(j(_,`state`,`watcher-recent.jsonl`),e)}}let E=s(t);E!==null&&re(j(_,`state`,`shadow-head.txt`),E);let D=c(t);D!==null&&re(j(_,`state`,`checkpoint-refs.txt`),D),Z9(tPe(n),j(_,`state`,H9)),Z9(nPe(n),j(_,`state`,U9)),Z9(j(b,`last-spawn-error.log`),j(_,`state`,`last-spawn-error.log`)),Z9(j(b,id),j(_,`state`,id)),Z9(j(b,ad),j(_,`state`,ad)),Z9(j(b,rd),j(_,`state`,rd));let ee=p(),ne=d(),ie=f(),k={ok:{version:u(),nodeVersion:ee.nodeVersion,platform:ee.platform,arch:ee.arch},host:{desktop:ne,language:ie}};re(j(_,`state`,`runtime.json`),`${JSON.stringify(k,null,2)}\n`);let oe=C===`running`?`running
|
|
1548
1548
|
`:`not-running (${w})\n`;re(j(_,`state`,`server-status.txt`),oe);let A=e.diagnosticReports===void 0?`not-collected (no collection attempted)`:X5(e.diagnosticReports,y);if(re(j(_,`state`,`diagnostic-reports-status.txt`),`${A}\n`),re(j(_,e7),x7(e.osTerminationEvidence)),e.processDir&&g(e.processDir)){let t=j(_,`process`);v(t,{recursive:!0}),m(e.processDir,t,{recursive:!0})}let se=e.redact===!0;se&&XNe({stagingDir:_,contentDir:t}),e.note&&re(j(_,`note.txt`),e.note);let ce=null;e.scrubSecrets===!0&&(ce=bPe(_));for(let t of e.extraFiles??[]){let e=t.zipName??ae(t.sourcePath);if(!Z9(t.sourcePath,j(_,`extra`,e))){r.logger?.warn({sourcePath:t.sourcePath},`extra file missing; omitted from bundle`);continue}let n=C7(t,`extra/${e}`);n!==null&&(ce??={redactions:[],redactedLineCount:0},ce.redactions.push(n),ce.redactedLineCount+=n.lineCount)}let M=fPe(n),N=Q9(_),le=[],ue=0,de=0;for(let e of N){let t=$9(_,e),n=te(e).size,r=_Pe(t)?X9(e):0;le.push({path:t,bytes:n,lines:r}),ue+=n,(t.startsWith(`telemetry/`)||t.startsWith(`logs/`))&&(de+=hPe(e))}let fe={applied:se};ce!==null&&(fe.secretScrub=ce);let P={schemaVersion:2,createdAt:l().toISOString(),ok:{version:u(),nodeVersion:ee.nodeVersion,platform:ee.platform,arch:ee.arch},host:{desktop:ne,language:ie},contentDir:{pathSha256:pPe(t),absolutePath:se?`<CONTENT_DIR>`:t},telemetry:{localSink:M,otlpPushEnabled:h()},redaction:fe,serverStatus:C,files:le};re(j(_,`manifest.json`),`${JSON.stringify(P,null,2)}\n`);let pe=D9(t),me=N.some(e=>{try{let t=S(e,`utf-8`);return pe.some(e=>t.includes(e))}catch{return!1}}),he={stagedDiagnosticReports:y,totalBytes:ue,fileCount:le.length,docNameCount:de,contentDirVisible:me,redacted:se},ge=!1;return{stagingDir:_,manifest:P,summary:he,cleanup:()=>{ge||(ge=!0,O(_,{recursive:!0,force:!0}))}}}catch(e){throw O(_,{recursive:!0,force:!0}),e}}async function SPe(e){let{collected:t,outputPath:n}=e,r=k(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 JEe.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 CPe(e,t){let n=j(e,`.ok`,`config.yml`);if(g(n))try{let t=(0,_s.parse)(S(n,`utf-8`)),r=hY(t)?t.content:void 0,i=hY(r)?r.dir:void 0;if(typeof i==`string`&&i.length>0)return N(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 N(e)}async function wPe(e,t,n,r,i,a){let o=w7(t,e.logger),s=await xPe({contentDir:CPe(t,e.logger),projectDir:t,redact:e.redact,scrubSecrets:e.redact,note:e.note,extraFiles:e.extraFiles,userLogFiles:[...PMe(o,e.userLogsDir??j(HJ(),`logs`)),...E7(e.cachesDir??j(_e(),`Library`,`Caches`))],userStateFiles:D7(e.bugReportsDir??S7()),diagnosticReports:i,osTerminationEvidence:a,deps:{readDesktopEnv:n,readLanguage:r,logger:e.logger}});try{v(k(e.outputPath),{recursive:!0}),await SPe({collected:s,outputPath:e.outputPath});let t=s.manifest.redaction.secretScrub;return{zipPath:e.outputPath,summary:{level:`full`,systemWide:!1,projectSlug:o,files:s.manifest.files.map(e=>e.path),redactions:t?.redactions??[],redactedLineCount:t?.redactedLineCount??0,generatedAt:s.manifest.createdAt}}}finally{s.cleanup()}}async function TPe(e){let{projectDir:t}=e,n=e.readDesktopEnv??G9,r=e.readLanguage??E9,i=()=>oMe(e.diagnosticReportsDir??j(_e(),`Library`,`Logs`,`DiagnosticReports`),new Date);if(e.level===`full`&&t!==void 0)return wPe(e,t,n,r,i(),await b7(e.osTerminationEvidenceDeps));let{zipPath:a,summary:o}=await zMe({projectDir:t,redact:e.redact,revealDocNames:e.level===`full`,outputPath:e.outputPath,userLogsDir:e.userLogsDir,shipItLogFiles:E7(e.cachesDir??j(_e(),`Library`,`Caches`)),bugReportLedgerFiles:D7(e.bugReportsDir??S7()),diagnosticReports:e.level===`full`?i():void 0,osTerminationEvidence:e.level===`full`?await b7(e.osTerminationEvidenceDeps):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{SY as ALL_EDITOR_IDS,CY as EDITOR_LABELS,$Y as EDITOR_TARGETS,tbe as HOSTS_WITH_USER_SKILL_DIR,Jje as LAUNCH_CONFIG_NAME,kNe as PATH_SHIM_BEGIN,jNe as PATH_SHIM_BLOCK_RE,ANe as PATH_SHIM_END,u5 as ProjectPathSafetyError,Eje as addOkPathsToGitExclude,d5 as assertProjectPathSafe,FY as buildManagedServerEntry,vNe as buildMcpConfigDeclineEvent,yNe as buildMcpConfigMigrateEvent,q5 as classifyExistingMcpEntry,TPe as collectReportBundle,INe as createCliProbeResolver,tY as createTokenStore,jMe as defaultBugReportZipPath,Ke as detectGh,Ye as detectGhAccounts,Qje as detectInstalledEditors,WY as droppedManagedKeys,Sbe as editorConfigPathDisplay,xbe as editorEntryLocator,sNe as ensurePiBridge,fMe as findJetsamKillSync,T5 as formatTrackedRemediation,kje as getExcludedOkPaths,C5 as getInstalledSkillProjectionPaths,ebe as getNativeTomlMcpEditor,S5 as getOkArtifactPaths,NY as isEntryUpToDate,IY as isOwnManagedEntry,ENe as loadConfig,Eye as makeLazyProbeTokenStore,S7 as okBugReportsDir,v9 as parseGitHubBlobUrl,DNe as parseGitHubShareUrl,y9 as parseGitHubTreeUrl,_9 as parseGitUrl,MNe as pathInstallMarkerPath,dje as previewContent,$je as probeOwnManagedEditorMcpEntry,aNe as probePiBridgeState,w5 as probeTrackedOkPaths,G5 as readExistingMcpEntry,Oje as readSharingMode,CP as redactContent,Dje as removeOkPathsFromGitExclude,mNe as removeOwnMcpEntry,Sje as removeProjectSkill,RNe as removeUserGlobalSkillBundle,WNe as removeUserSkill,gje as resolveProjectRoot,CNe as runStop,p9 as truncatePriorEntry,w9 as userGlobalSkillBundleTargets,UNe as userSkillPresentAnywhere,ONe as validateLocalFolderForShare,W5 as writeEditorMcpConfig,VNe as writeProjectAiIntegrations,_5 as writeProjectSkill,Zje as writeUserMcpConfigs,HNe as writeUserSkill};
|
|
1549
1549
|
//# sourceMappingURL=index.mjs.map
|