@inkeep/open-knowledge 0.88.6-beta.1 → 0.88.6-beta.3
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 +59 -59
- package/dist/constants-qWODYpdZ.mjs +1 -0
- package/dist/{dist-2lLb6-A6.mjs → dist-Br5t34YL.mjs} +2 -2
- package/dist/{dist-BDrQsVYX.mjs → dist-DFlcDcjF.mjs} +1 -1
- package/dist/index.mjs +4 -4
- package/dist/{init-BPIylED-.mjs → init-CFqa1MvX.mjs} +2 -2
- package/dist/init-D5UpQ70d.mjs +1 -0
- package/dist/{launch-json-removal-D2MG5vwV.mjs → launch-json-removal-BiiU2YFK.mjs} +1 -1
- package/dist/loader-B2fGi6oQ.mjs +1 -0
- package/dist/{loader-DgrgTQ37.mjs → loader-CpSE6Pb3.mjs} +1 -1
- package/dist/{md-manager-BGnqyqi1-1WhsA8vv.mjs → md-manager-BGnqyqi1-COpgRhOl.mjs} +175 -173
- package/dist/{open-browser-D6bWSvWe.mjs → open-browser-BgcinSRG.mjs} +1 -1
- package/dist/parse-worker.mjs +1 -1
- package/dist/preview-DSJofhni.mjs +1 -0
- package/dist/{preview-XbQaCJ3P.mjs → preview-W1qLrOTN.mjs} +1 -1
- package/dist/public/assets/{AccountSection-CWruFc04.js → AccountSection-LJRd8sB4.js} +1 -1
- package/dist/public/assets/{ActivityModeContent-OCa-VxAn.js → ActivityModeContent-CQSexLMh.js} +1 -1
- package/dist/public/assets/{AddPropertiesButton-Du0GrCIg.js → AddPropertiesButton-CFKmvgxU.js} +1 -1
- package/dist/public/assets/{AgentConnectionsSection-BNRBe4FT.js → AgentConnectionsSection-BDpKRta5.js} +1 -1
- package/dist/public/assets/{AgentDiffPane-CIHKqaVC.js → AgentDiffPane-_ihWGbD_.js} +1 -1
- package/dist/public/assets/{AttachmentsSection-FFnxL4AC.js → AttachmentsSection-DBsgV2Bw.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-B5qCGGIe.js → CodeMirrorPropInput-CijXVQab.js} +74 -74
- package/dist/public/assets/{ContentRulesSection-CSPiGJ-Q.js → ContentRulesSection-C6MePblA.js} +1 -1
- package/dist/public/assets/{DiffViewBoundary-BSZq1ctS.js → DiffViewBoundary-DE5ZZM6m.js} +1 -1
- package/dist/public/assets/DocumentContext-Ckv8SUWG.js +108 -0
- package/dist/public/assets/EditorModeToggle-N2hyqb1I.js +1 -0
- package/dist/public/assets/{ExcalidrawDocEditor-DDh2F5wX.js → ExcalidrawDocEditor-CP2HLZRg.js} +1 -1
- package/dist/public/assets/FeedbackForm-DvbVD7xY.js +1 -0
- package/dist/public/assets/{ImportSkillDialog-CdnMVTQU.js → ImportSkillDialog-B6FRcFBN.js} +1 -1
- package/dist/public/assets/{LinkPreviewsSection-DaE6CPLZ.js → LinkPreviewsSection-C4BQkoW1.js} +1 -1
- package/dist/public/assets/{LintConfigEditor-B_NGO3_g.js → LintConfigEditor-BZ5RnGQH.js} +1 -1
- package/dist/public/assets/{LintingSection-BLZjpOkj.js → LintingSection-gYcf6zSw.js} +1 -1
- package/dist/public/assets/{ManagedArtifactProperties-DKeTmK4r.js → ManagedArtifactProperties-7BpPCdWC.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-C21i-wVX.js +1 -0
- package/dist/public/assets/MermaidDocEditor-D8S17k_t.js +1 -0
- package/dist/public/assets/{NetworkAccessSection-CNquEJ_U.js → NetworkAccessSection-CfSEDmXg.js} +1 -1
- package/dist/public/assets/{PropertyDisplayRow-C0KKoVKA.js → PropertyDisplayRow-BoNQImBU.js} +1 -1
- package/dist/public/assets/{PublishToGitHubDialog-vRTXJ5mS.js → PublishToGitHubDialog-Bc5NpD70.js} +1 -1
- package/dist/public/assets/{SchemaConfigEditor-BXuzUT87.js → SchemaConfigEditor-DXzybru5.js} +1 -1
- package/dist/public/assets/{SearchSection-BhURm7NP.js → SearchSection-C19oEXnN.js} +1 -1
- package/dist/public/assets/{SessionsHost-CD9QWcqn.js → SessionsHost-Dq18GV-Q.js} +2 -2
- package/dist/public/assets/{SettingsDialogBody-B3DtndlE.js → SettingsDialogBody-CKMzthec.js} +2 -2
- package/dist/public/assets/{ShareReceiveMissDialog-Bh-Pawsk.js → ShareReceiveMissDialog-CjeRKStG.js} +1 -1
- package/dist/public/assets/{SkillToolbarControls-Cj1m3M_D.js → SkillToolbarControls-Bw0kbj8T.js} +1 -1
- package/dist/public/assets/{SlidesToolbarControls-CkfjnfCl.js → SlidesToolbarControls-l-1sv-Cc.js} +1 -1
- package/dist/public/assets/SourceEditor-Cdd0XUzF.js +1 -0
- package/dist/public/assets/{SyncSection-DA2y-Hwu.js → SyncSection-uN1z_93L.js} +1 -1
- package/dist/public/assets/{SyncStatusBadge-CuccsVp8.js → SyncStatusBadge-DKqP2nFA.js} +1 -1
- package/dist/public/assets/{TerminalLaunchContext-C5Rn2V0P.js → TerminalLaunchContext-B_gF4ByT.js} +1 -1
- package/dist/public/assets/{TerminalSection-DV6OfLfp.js → TerminalSection-OQKUYevA.js} +1 -1
- package/dist/public/assets/{TerminalWindowApp-Dttw_-wb.js → TerminalWindowApp-CYJ1Jbl1.js} +1 -1
- package/dist/public/assets/TextDocEditor-O7zcpBhs.js +1 -0
- package/dist/public/assets/{ThreadView-DcGvbYNe.js → ThreadView-DXAtEUVo.js} +1 -1
- package/dist/public/assets/{TimelineDiffPane-B5ihwsfW.js → TimelineDiffPane-DfckigW2.js} +1 -1
- package/dist/public/assets/{bridge-J5ARnBfd.js → bridge-BPIZEBCD.js} +9 -7
- package/dist/public/assets/{client-version-Ds8dKP3S.js → client-version-BJc8f8RK.js} +1 -1
- package/dist/public/assets/cm-theme-DpKmjLo0.js +3 -0
- package/dist/public/assets/{comment-chips-DpV2PLim.js → comment-chips-D5QcVI38.js} +1 -1
- package/dist/public/assets/{config-provider-CYT9QAxv.js → config-provider-B2uReVA0.js} +1 -1
- package/dist/public/assets/{doc-undo-manager-CxrXee0V.js → doc-undo-manager-eVCrXF_j.js} +1 -1
- package/dist/public/assets/{ime-composition-BVJIRkRG.js → ime-composition-Fkxh3sb0.js} +1 -1
- package/dist/public/assets/{index-CRLcSRcP.js → index-DixZkzDK.js} +7 -7
- package/dist/public/assets/{lint-plugins-DT37pCLD.js → lint-plugins-BkTeSxCo.js} +1 -1
- package/dist/public/assets/{markdownlint-rule-browser-DJ3hT7EE.js → markdownlint-rule-browser-BPUY-_hO.js} +1 -1
- package/dist/public/assets/{pending-receive-nav-store-BjPsgYNX.js → pending-receive-nav-store-Iv87HrBp.js} +1 -1
- package/dist/public/assets/{preferred-session-events-v4dLd1D3.js → preferred-session-events-xfa2uZrO.js} +1 -1
- package/dist/public/assets/{progress-Dh17ODC1.js → progress-BrArAZHf.js} +1 -1
- package/dist/public/assets/{selection-context-BaXuwC8q.js → selection-context-Dbqj5HIF.js} +1 -1
- package/dist/public/assets/{src-DErDTvvA.js → src-CY4cyl93.js} +1 -1
- package/dist/public/assets/storage-scope-D0LHO15T.js +1 -0
- package/dist/public/assets/{tag-pill-input-CWGS7aQi.js → tag-pill-input-BSnGPd75.js} +1 -1
- package/dist/public/assets/{telemetry-impl-BufA9jTT.js → telemetry-impl-CzmRwkV2.js} +1 -1
- package/dist/public/assets/{telemetry-startup-BKKVbdkC.js → telemetry-startup-6UOhK4H3.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-CjW6VPCG.js → typing-burst-detector-43TkkCGr.js} +1 -1
- package/dist/public/assets/{use-activity-panel-C9mpIqKR.js → use-activity-panel-Bqo7iLoL.js} +1 -1
- package/dist/public/assets/{use-open-skill-DYEQ1l_s.js → use-open-skill-DiaFh1sV.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-BHb6WGCI.js → use-terminal-enabled-D67U-_lT.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-wagvdoa6.js → use-timeline-entry-diff-KpbAdkg7.js} +1 -1
- package/dist/public/index.html +24 -24
- package/dist/{registry-probes-CL7CtgcH.mjs → registry-probes-DwE2ywLj.mjs} +1 -1
- package/dist/{removal-file-path-Lhdnt_8C.mjs → removal-file-path-BB7PGKh9.mjs} +1 -1
- package/dist/{repair-launch-json-BfhC4Uz3.mjs → repair-launch-json-BGnKoX_8.mjs} +1 -1
- package/dist/{repair-mcp-configs-0EMOXCcV.mjs → repair-mcp-configs-CnuXQsDL.mjs} +1 -1
- package/dist/src-CMSKsmsA.mjs +1 -0
- package/dist/{src-Cryizi3y.mjs → src-CbDiPIIp.mjs} +1 -1
- package/dist/{start-Ii5OzflL.mjs → start-Bs7pMN0A.mjs} +3 -3
- package/dist/start-Dx5wqmPM.mjs +1 -0
- package/package.json +4 -4
- package/dist/constants-CIdryYLD.mjs +0 -1
- package/dist/init-CmKJ4GqI.mjs +0 -1
- package/dist/loader-DPw8HKwV.mjs +0 -1
- package/dist/preview-B-4pTdig.mjs +0 -1
- package/dist/public/assets/DocumentContext-DdwkHm-8.js +0 -108
- package/dist/public/assets/EditorModeToggle-BdSgDYBt.js +0 -1
- package/dist/public/assets/FeedbackForm-kPjpeGxM.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-9H2U3tkI.js +0 -1
- package/dist/public/assets/MermaidDocEditor-CWTrRzU0.js +0 -1
- package/dist/public/assets/SourceEditor-DIwQ0GAl.js +0 -1
- package/dist/public/assets/TextDocEditor-XVYm-eND.js +0 -1
- package/dist/public/assets/cm-theme-ZGYbhAB4.js +0 -3
- package/dist/public/assets/storage-scope-BdMZBgIQ.js +0 -1
- package/dist/src-CeyWeqBH.mjs +0 -1
- package/dist/start-D5IUmX3A.mjs +0 -1
package/dist/index.mjs
CHANGED
|
@@ -398,7 +398,7 @@ ${t.slice(l+2)}`,d+=1;else break}t.push({indent:l,number:parseInt(s,10),content:
|
|
|
398
398
|
`,i);if(e===-1)return null;i=e+1}let a=t.indexOf(`
|
|
399
399
|
`,i),o=a===-1?t.length:a,s=i+r-1;return s<=o?s:null}function Sve(e,t){if(!e)return null;let n=jK(e.start,t),r=jK(e.end,t);return n===null||r===null||r<n?null:t.slice(n,r)}function Cve(e,t){let n=Sve(e.position,t);return{type:`rawMdxFallbackMdast`,originalType:e.type??`unknown`,value:n??``,unresolvedPosition:n===null,position:e.position}}function wve(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``,r=typeof process<`u`&&process.env?.OK_DEBUG_POSITION_SLICE===`1`,i=!1;rp(e,(e,t,a)=>{if(a!==void 0&&typeof t==`number`&&typeof e.type==`string`&&!xve.has(e.type)){let r=Cve(e,n);return a.children[t]=r,Mf}if(`children`in e&&Array.isArray(e.children)){let t=e;t.children.some(e=>e.type===`text`)&&(ave(t,n),uP(t,n))}if(sve(e,n,r,a),dve(e,a)&&(i=!0),e.type===`heading`&&a!==void 0&&typeof t==`number`){let n=e.position?.end?.line,r=a.children[t+1],i=r?.position?.start?.line;if(r?.type===`paragraph`&&typeof n==`number`&&typeof i==`number`&&i===n+1){let t=e;t.data??={},t.data.sourceContiguousNext=!0}}}),i&&bve(e,n)}}function Tve(e,t){let n={type:`mdxJsxFlowElement`,name:`MermaidFence`,attributes:[{type:`mdxJsxAttribute`,name:`chart`,value:e}],children:[]};return t&&(n.position=t),n}function Eve(){return e=>{rp(e,`code`,(e,t,n)=>{if(!n||t==null||e.lang!==`mermaid`)return;let r=Tve(typeof e.value==`string`?e.value:``,e.position);n.children[t]=r})}}function MK(e,t,n){for(let r=t;r<n;r++)e[r]=` `}function Dve(e,t){if(e[t]!==`<`)return null;let n=e.slice(t).toLowerCase();for(let r of[`pre`,`code`]){if(!n.startsWith(`<${r}`))continue;let i=e[t+r.length+1];if(i===`>`||i===`/`||i===` `||i===` `)return r}return null}function Ove(e,t){let n=null;for(let r=t;r<e.length;r++){let t=e[r];if(n!==null)t===n&&(n=null);else if(t===`"`||t===`'`)n=t;else if(t===`>`)return r+1}return null}function NK(e,t,n){let r=RegExp(`</${n}\\s*>`,`i`).exec(e.slice(t));return r?.index===void 0?null:t+r.index+r[0].length}function kve(e,t){let n=0;for(;e[t+n]==="`";)n+=1;if(n===0)return null;let r=t+n,i=r;for(;i<e.length;){if(e[i]!=="`"){i+=1;continue}let t=0;for(;e[i+t]==="`";)t+=1;if(t===n)return i+n;i+=t}return r}function Ave(e){let t=ZU(),n=!1,r=null;return e.map(({text:e,start:i})=>{if(r===null&&!n&&t(e))return{text:` `.repeat(e.length),start:i};let a=e.split(``),o=0;for(;o<e.length;){if(n){let t=e.indexOf(`-->`,o),r=t<0?e.length:t+3;if(MK(a,o,r),o=r,t<0)break;n=!1;continue}if(r!==null){let t=NK(e,o,r);if(MK(a,o,t??e.length),t===null)break;o=t,r=null;continue}let t=e.indexOf(`<!--`,o),i=-1,s=null;for(let t=o;t<e.length;t++){let n=Dve(e,t);if(n!==null){i=t,s=n;break}}let c=e.indexOf("`",o),l=t<0?i:i<0?t:Math.min(t,i);if(c>=0&&(l<0||c<l)){o=kve(e,c)??c+1;continue}if(t<0&&i<0)break;if(t>=0&&(i<0||t<i)){let r=e.indexOf(`-->`,t+4),i=r<0?e.length:r+3;if(MK(a,t,i),o=i,n=r<0,n)break;continue}let u=Ove(e,i);if(u===null||s===null)break;let d=NK(e,u,s),f=d??e.length;if(MK(a,i,f),o=f,r=d===null?s:null,r!==null)break}return{text:a.join(``),start:i}})}function jve(e){let t=[],n=0;for(let r=0;r<e.length;r++){let i=e[r];i===`
|
|
400
400
|
`?(t.push({text:e.slice(n,r),start:n}),n=r+1):i===`\r`&&(t.push({text:e.slice(n,r),start:n}),e[r+1]===`
|
|
401
|
-
`&&(r+=1),n=r+1)}t.push({text:e.slice(n),start:n});let r=Ave(t),i=e.split(``);for(let e of r)for(let t=0;t<e.text.length;t++)i[e.start+t]=e.text[t];return i.join(``)}function Mve(e,t,n,r){return r<=n||e.slice(n,r).trim().length===0?!1:t.slice(n,r).trim().length===0}function Nve(e){return e.type===`link`||e.type===`linkReference`}function Pve(e,t,n,r){let i=n.position?.start.offset,a=n.position?.end.offset;if(i===void 0||a===void 0)return;let o=r.slice(i,a),s={type:`text`,value:o,data:{sourceRaw:o},position:n.position};e.children.splice(t,1,s)}function Fve(){return(e,t)=>{let n=typeof t.value==`string`?t.value:String(t.value??``);if(n.length===0||!n.includes(`<!--`)&&!/<(pre|code)[\s/>]/i.test(n))return;let r=jve(n),i=e=>{for(let t=e.children.length-1;t>=0;t--){let a=e.children[t];if(!a||(`children`in a&&Array.isArray(a.children)&&i(a),!Nve(a)))continue;let o=a.position?.start.offset,s=a.position?.end.offset;o!==void 0&&s!==void 0&&Mve(n,r,o,s)&&Pve(e,t,a,n)}};i(e)}}const Ive=Object.assign(dye,{peek:()=>`$`}),Lve=Object.assign(fye,{peek:()=>`~`}),Rve=(()=>{for(let e of TU.extensions??[]){let t=e?.handlers?.mdxJsxFlowElement;if(typeof t==`function`)return t}throw Error(`mdast-util-mdx-jsx mdxJsxFlowElement to-markdown handler not found — the dirty MDX JSX serialize path cannot bind. Likely a breaking change in mdast-util-mdx-jsx (pinned in the root overrides); re-run the markdown-pipeline upgrade protocol (test:fidelity).`)})(),zve=/^[ \t]*(?:$|#{1,6}(?:[ \t]|[ \t]*$)|>|(?:[-+*]|\d{1,9}[.)])[ \t]|`{3,}|~{3,}|=+[ \t]*$|-+[ \t]*$|(?:\*[ \t]*){3,}$|(?:_[ \t]*){3,}$)/;function Bve(e){let t=e;return t.type===`rawMdxFallback`?{type:`mdxJsxFlowElement`,name:null,attributes:[],children:[],data:{sourceRaw:t.value??``}}:e}const Vve={text(e,t,n,r){if(typeof e.data?.sourceRaw==`string`&&YO(e.data.sourceRaw,e.value??``))return e.data.sourceRaw;let i=WN(e.data);if(i.kind===`malformed`&&typeof process<`u`&&process.env?.OK_DEBUG_POSITION_SLICE===`1`&&console.warn(`[escape-provenance] malformed escapedChars metadata: CommonMark-safe serialization applies`),i.kind===`valid`&&i.data.escapedChars.length>0){let t=e.value??``,a=i.data.escapedChars,o=``,s=0,c,l=(e,t)=>{if(!e)return;let i=c===`<`?e.indexOf(`>`):-1;i>=0&&(o+=VK(n,e.slice(0,i+1),{...r,before:r.before+o,after:e.slice(i+1,i+2)||t},!0),e=e.slice(i+1)),e&&(o+=VK(n,e,{...r,before:r.before+o,after:t}))};for(let{offset:e,char:n}of a)e>s&&l(t.slice(s,e),`\\`),o+=`\\${n}`,s=e+1,c=n;return s<t.length&&l(t.slice(s),r.after),o}return VK(n,e.value??``,r)},emphasis(e,t,n,r){let i=e.data?.sourceDelimiter??`*`,a=n.createTracker(r),o=n.enter(`emphasis`),s=a.move(i);return s+=WK(n.containerPhrasing(e,{before:s,after:i,...a.current()}),r,i),s+=a.move(i),o(),s},strong(e,t,n,r){let i=e.data?.sourceDelimiter??`**`,a=n.createTracker(r),o=n.enter(`strong`),s=a.move(i);return s+=WK(n.containerPhrasing(e,{before:s,after:i,...a.current()}),r,i),s+=a.move(i),o(),s},link(e,t,n,r){if(e.data?.sourceStyle===`autolink`&&Jve(e))return`<${e.url}>`;if(e.data?.sourceStyle===`gfm-autolink`){let i=e.children?.length===1?e.children[0]:null;if(i?.type===`text`&&typeof i.value==`string`){let a=i.value,o=qve(a,e.url);if(o===void 0||$ve(o,Zve(e,t,n,r)))return a;if(o===`protocol`&&eye(a))return`<${a}>`}}let i=n.createTracker(r),a=n.enter(`link`),o=n.enter(`label`),s=i.move(`[`);if(s+=i.move(n.containerPhrasing(e,{before:s,after:`](`,...i.current()})),s+=i.move(`](`),o(),s+=BK(n,i,e),e.title){let t=e.data?.sourceTitleMarker??`double`;s+=i.move(zK(e.title,t))}return s+=i.move(`)`),a(),s},image(e,t,n,r){let i=n.createTracker(r),a=n.enter(`image`),o=n.enter(`label`),s=i.move(`})),s+=i.move(`](`),o(),s+=BK(n,i,e),e.title){let t=n.enter(`titleQuote`);s+=i.move(` "`),s+=i.move(n.safe(e.title,{before:s,after:`"`,...i.current()})),s+=i.move(`"`),t()}return s+=i.move(`)`),a(),s},definition(e,t,n,r){let i=e.data?.sourceLayout??`inline`,a=e.data?.sourceTitleMarker??`double`,o=n.enter(`definition`),s=n.createTracker(r),c=n.enter(`label`),l=s.move(`[`);l+=s.move(n.safe(n.associationId(e),{before:l,after:`]`,...s.current()})),l+=s.move(`]:`),c();let u=i===`multiline`?`
|
|
401
|
+
`&&(r+=1),n=r+1)}t.push({text:e.slice(n),start:n});let r=Ave(t),i=e.split(``);for(let e of r)for(let t=0;t<e.text.length;t++)i[e.start+t]=e.text[t];return i.join(``)}function Mve(e,t,n,r){return r<=n||e.slice(n,r).trim().length===0?!1:t.slice(n,r).trim().length===0}function Nve(e){return e.type===`link`||e.type===`linkReference`}function Pve(e,t,n,r){let i=n.position?.start.offset,a=n.position?.end.offset;if(i===void 0||a===void 0)return;let o=r.slice(i,a),s={type:`text`,value:o,data:{sourceRaw:o},position:n.position};e.children.splice(t,1,s)}function Fve(){return(e,t)=>{let n=typeof t.value==`string`?t.value:String(t.value??``);if(n.length===0||!n.includes(`<!--`)&&!/<(pre|code)[\s/>]/i.test(n))return;let r=jve(n),i=e=>{for(let t=e.children.length-1;t>=0;t--){let a=e.children[t];if(!a||(`children`in a&&Array.isArray(a.children)&&i(a),!Nve(a)))continue;let o=a.position?.start.offset,s=a.position?.end.offset;o!==void 0&&s!==void 0&&Mve(n,r,o,s)&&Pve(e,t,a,n)}};i(e)}}const Ive=Object.assign(dye,{peek:()=>`$`}),Lve=Object.assign(fye,{peek:()=>`~`}),Rve=(()=>{for(let e of TU.extensions??[]){let t=e?.handlers?.mdxJsxFlowElement;if(typeof t==`function`)return t}throw Error(`mdast-util-mdx-jsx mdxJsxFlowElement to-markdown handler not found — the dirty MDX JSX serialize path cannot bind. Likely a breaking change in mdast-util-mdx-jsx (pinned in the root overrides); re-run the markdown-pipeline upgrade protocol (test:fidelity).`)})(),zve=/^[ \t]*(?:$|#{1,6}(?:[ \t]|[ \t]*$)|>|(?:[-+*]|\d{1,9}[.)])[ \t]|`{3,}|~{3,}|=+[ \t]*$|-+[ \t]*$|(?:\*[ \t]*){3,}$|(?:_[ \t]*){3,}$)/;function Bve(e){let t=e;return t.type===`rawMdxFallback`?{type:`mdxJsxFlowElement`,name:null,attributes:[],children:[],data:{sourceRaw:t.value??``}}:e}const Vve={text(e,t,n,r){if(typeof e.data?.sourceRaw==`string`&&YO(e.data.sourceRaw,e.value??``))return e.data.sourceRaw;let i=WN(e.data);if(i.kind===`malformed`&&typeof process<`u`&&process.env?.OK_DEBUG_POSITION_SLICE===`1`&&console.warn(`[escape-provenance] malformed escapedChars metadata: CommonMark-safe serialization applies`),i.kind===`valid`&&i.data.escapedChars.length>0){let t=e.value??``,a=i.data.escapedChars,o=``,s=0,c,l=(e,t)=>{if(!e)return;let i=c===`<`?e.indexOf(`>`):-1;i>=0&&(o+=VK(n,e.slice(0,i+1),{...r,before:r.before+o,after:e.slice(i+1,i+2)||t},!0),e=e.slice(i+1)),e&&(o+=VK(n,e,{...r,before:r.before+o,after:t}))};for(let{offset:e,char:n}of a)e>s&&l(t.slice(s,e),`\\`),o+=`\\${n}`,s=e+1,c=n;return s<t.length&&l(t.slice(s),r.after),o}return VK(n,e.value??``,r)},emphasis(e,t,n,r){let i=e.data?.sourceDelimiter??`*`,a=n.createTracker(r),o=n.enter(`emphasis`),s=a.move(i);return s+=WK(n.containerPhrasing(e,{before:s,after:i,...a.current()}),r,i),s+=a.move(i),o(),s},strong(e,t,n,r){let i=e.data?.sourceDelimiter??`**`,a=n.createTracker(r),o=n.enter(`strong`),s=a.move(i);return s+=WK(n.containerPhrasing(e,{before:s,after:i,...a.current()}),r,i),s+=a.move(i),o(),s},link(e,t,n,r){if(e.data?.sourceStyle===`autolink`&&Jve(e))return`<${e.url}>`;if(e.data?.sourceStyle===`gfm-autolink`){let i=e.children?.length===1?e.children[0]:null;if(i?.type===`text`&&typeof i.value==`string`){let a=i.value,o=qve(a,e.url);if(o===void 0||$ve(o,Zve(a,e,t,n,r)))return a;if(o===`protocol`&&eye(a))return`<${a}>`}}let i=n.createTracker(r),a=n.enter(`link`),o=n.enter(`label`),s=i.move(`[`);if(s+=i.move(n.containerPhrasing(e,{before:s,after:`](`,...i.current()})),s+=i.move(`](`),o(),s+=BK(n,i,e),e.title){let t=e.data?.sourceTitleMarker??`double`;s+=i.move(zK(e.title,t))}return s+=i.move(`)`),a(),s},image(e,t,n,r){let i=n.createTracker(r),a=n.enter(`image`),o=n.enter(`label`),s=i.move(`})),s+=i.move(`](`),o(),s+=BK(n,i,e),e.title){let t=n.enter(`titleQuote`);s+=i.move(` "`),s+=i.move(n.safe(e.title,{before:s,after:`"`,...i.current()})),s+=i.move(`"`),t()}return s+=i.move(`)`),a(),s},definition(e,t,n,r){let i=e.data?.sourceLayout??`inline`,a=e.data?.sourceTitleMarker??`double`,o=n.enter(`definition`),s=n.createTracker(r),c=n.enter(`label`),l=s.move(`[`);l+=s.move(n.safe(n.associationId(e),{before:l,after:`]`,...s.current()})),l+=s.move(`]:`),c();let u=i===`multiline`?`
|
|
402
402
|
`:` `;l+=s.move(u);let d=String(e.url??``);if(l+=BK(n,s,e,!d||/[\0- ]/.test(d)),e.title){let t=i===`multiline`?`
|
|
403
403
|
`:` `;l+=s.move(zK(e.title,a,t))}return o(),l},thematicBreak(e){return e.data?.sourceRaw??`---`},break(e,t,n){let r=e.data?.sourceRaw;return typeof r==`string`&&r.length>0?r:n.stack.includes(`tableCell`)||n.stack.includes(`okAtxHeading`)?`<br />`:e.data?.sourceStyle===`backslash`?`\\
|
|
404
404
|
`:`
|
|
@@ -424,7 +424,7 @@ ${t.slice(l+2)}`,d+=1;else break}t.push({indent:l,number:parseInt(s,10),content:
|
|
|
424
424
|
`:`
|
|
425
425
|
`;return l.join(f)},table(e,t,n,r){let i=n.enter(`table`),a=[],o=[],s=e.children??[];for(let e of s){let t=e.children??[],i=[],s=[];for(let e of t){let t=n.enter(`tableCell`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,{...r,before:` `,after:` `});a(),t(),i.push(o);let c=e.data?.sourcePadding;s.push(c&&typeof c.left==`number`&&typeof c.right==`number`?{left:c.left,right:c.right}:null)}a.push(i),o.push(s)}i();let c=e.align??[],l=e.data?.sourceDashCounts,u=a[0]?.length??0,d=a.slice(1).reduce((e,t)=>Math.max(e,t.length),0),f=Math.max(u,d,c.length);if(f===0)return console.warn(JSON.stringify({event:`table-serialize-dropped-empty`,rows:s.length})),``;let p=[];for(let e=0;e<f;e++){let t=c[e],n=``,r=``;t===`center`?(n=`:`,r=`:`):t===`left`?n=`:`:t===`right`&&(r=`:`);let i=l?.[e],a=typeof i==`number`&&i>=1?i:1;p.push(n+`-`.repeat(a)+r)}let m=(e,t)=>{let n=[];for(let r=0;r<f;r++){let i=e[r]??``,a=t[r]??{left:1,right:1};n.push(` `.repeat(a.left)+i+` `.repeat(a.right))}let r=v&&!v.leading?``:`|`,i=v&&!v.trailing?``:`|`;return`${r}${n.join(`|`)}${i}`},h=e.data?.sourceAlignmentPadding,g=Array.from({length:f},(e,t)=>{let n=h?.[t];return n&&typeof n.left==`number`&&typeof n.right==`number`?n:null}),_=e.data?.sourceOuterPipes,v=_&&f>=2&&a.every(e=>{let t=(e[0]??``).trim(),n=(e[f-1]??``).trim();return(_.leading||t.length>0)&&(_.trailing||n.length>0&&!n.endsWith(`\\`))})?_:null;if(a.length===0)return m(p,g);let y=[];y.push(m(a[0],o[0]??[])),y.push(m(p,g));for(let e=1;e<a.length;e++)y.push(m(a[e],o[e]??[]));return y.join(`
|
|
426
426
|
`)},mdxJsxFlowElement(e,t,n,r){let i=e,a=i.data?.sourceRaw;if(typeof a==`string`)return a;let o=i.data?.htmlBoundary;if(o&&typeof o.opener==`string`&&typeof o.closer==`string`){let e=n.containerFlow({type:`root`,children:i.children??[]},r);return`${o.opener}\n\n${e}\n\n${o.closer}`}let s=i.name??``,c=PK(i.attributes??[]),l=i.data?.sourceBody;if(l&&s&&!c.includes(`
|
|
427
|
-
`))return`${l.leading}<${s}${c?` ${c}`:``}>${l.afterOpenTag}`;if(!i.children||i.children.length===0)return s?c?`<${s} ${c} />`:`<${s} />`:``;let u={...i,attributes:(i.attributes??[]).map(Hve),children:(i.children??[]).map(Bve)};return Rve(u,t,n,r)},mark(e,t,n,r){let i=n.createTracker(r),a=n.enter(`mark`),o=i.move(`==`);return o+=WK(n.containerPhrasing(e,{before:o,after:`==`,...i.current()}),r,`==`),o+=i.move(`==`),a(),o},underline(e,t,n,r){let i=e.data?.sourceForm===`ins`?`<ins>`:`<u>`,a=e.data?.sourceForm===`ins`?`</ins>`:`</u>`,o=n.createTracker(r),s=n.enter(`underline`),c=o.move(i);return c+=n.containerPhrasing(e,{before:c,after:a,...o.current()}),c+=o.move(a),s(),c},comment(e,t,n,r){let i=e.data?.sourceForm,a=i===`html`?`<!-- `:`%%`,o=i===`html`?` -->`:`%%`,s=n.createTracker(r),c=n.enter(`comment`),l=s.move(a);return l+=n.containerPhrasing(e,{before:l,after:o,...s.current()}),l+=s.move(o),c(),l},commentBlock(e,t,n,r){let i=n.createTracker(r),a=n.enter(`commentBlock`),o=e.children??[],s=e.data?.sourceForm,c=e.data?.sourceLayout,l=o.length===1&&o[0]?.type===`paragraph`;if(s===`html`&&l){let e=o[0],t=n.containerPhrasing(e,{before:`<!-- `,after:` -->`,...i.current()});return a(),`<!-- ${t} -->`}if(c===`inline`&&l){let e=o[0],t=n.containerPhrasing(e,{before:`%% `,after:` %%`,...i.current()});return a(),`%% ${t} %%`}let u=n.containerFlow(e,i.current());return a(),`%%\n\n${u}\n\n%%`},mdxJsxTextElement(e){let t=e.data?.sourceRaw;if(typeof t==`string`)return t;let n=e.name??``,r=PK(e.attributes??[]),i=(e.children??[]).map(e=>e&&typeof e==`object`&&`value`in e?String(e.value??``):``).join(``);return i?r?`<${n} ${r}>${i}</${n}>`:`<${n}>${i}</${n}>`:r?`<${n} ${r} />`:`<${n}/>`},rawMdxFallback(e){return e.value??``},blockquote(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.containerFlow(e,a.current());i();let s=e.data?.sourceMarkerSpacings,c=0;return n.indentLines(o,(e,t,n)=>{if(n)return`>`;let r=c++,i=s?.[r];return i===`lazy`&&r>0&&!zve.test(e)?e:i===`none`||i===0?`>${e}`:typeof i==`number`&&i>=2&&!e.startsWith(` `)?`>${` `.repeat(i)}${e}`:`> ${e}`})}};function PK(e){let t=[];for(let n of e){if(n.type===`mdxJsxExpressionAttribute`){t.push(`{${n.value}}`);continue}let e=n.name;if(n.value===null||n.value===void 0){t.push(e);continue}if(typeof n.value==`string`){n.value.includes(`"`)?t.push(`${e}={${FK(n.value)}}`):t.push(`${e}="${n.value}"`);continue}t.push(`${e}={${n.value.value}}`)}return t.join(` `)}function FK(e){return`"${e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}"`}function Hve(e){return e.type===`mdxJsxAttribute`&&typeof e.value==`string`&&e.value.includes(`"`)?{type:`mdxJsxAttribute`,name:e.name,value:{type:`mdxJsxAttributeValueExpression`,value:FK(e.value)}}:e}const Uve=/^https?:\/\//i,Wve=/^www\./i,Gve=/^https?:\/\/[A-Za-z0-9./:?#@+,;()!'-]*$/i,Kve=/www\./i;function qve(e,t){if(e===t&&Uve.test(e))return`protocol`;if(t===`http://${e}`&&Wve.test(e))return`www`;if(t===`mailto:${e}`)return`email`}function Jve(e){let t=``;for(let n of e.children){if(n.type!==`text`)return!1;t+=n.value}return t===e.url}function IK(e){return e>=65&&e<=90||e>=97&&e<=122}function LK(e){return IK(e)||e>=48&&e<=57}function RK(e){return e===45||e===95||LK(e)}function Yve(e){return e===43||e===46||RK(e)}function Xve(e){return e!==47&&!Yve(e)}function Zve(e,t,n,r){let
|
|
427
|
+
`))return`${l.leading}<${s}${c?` ${c}`:``}>${l.afterOpenTag}`;if(!i.children||i.children.length===0)return s?c?`<${s} ${c} />`:`<${s} />`:``;let u={...i,attributes:(i.attributes??[]).map(Hve),children:(i.children??[]).map(Bve)};return Rve(u,t,n,r)},mark(e,t,n,r){let i=n.createTracker(r),a=n.enter(`mark`),o=i.move(`==`);return o+=WK(n.containerPhrasing(e,{before:o,after:`==`,...i.current()}),r,`==`),o+=i.move(`==`),a(),o},underline(e,t,n,r){let i=e.data?.sourceForm===`ins`?`<ins>`:`<u>`,a=e.data?.sourceForm===`ins`?`</ins>`:`</u>`,o=n.createTracker(r),s=n.enter(`underline`),c=o.move(i);return c+=n.containerPhrasing(e,{before:c,after:a,...o.current()}),c+=o.move(a),s(),c},comment(e,t,n,r){let i=e.data?.sourceForm,a=i===`html`?`<!-- `:`%%`,o=i===`html`?` -->`:`%%`,s=n.createTracker(r),c=n.enter(`comment`),l=s.move(a);return l+=n.containerPhrasing(e,{before:l,after:o,...s.current()}),l+=s.move(o),c(),l},commentBlock(e,t,n,r){let i=n.createTracker(r),a=n.enter(`commentBlock`),o=e.children??[],s=e.data?.sourceForm,c=e.data?.sourceLayout,l=o.length===1&&o[0]?.type===`paragraph`;if(s===`html`&&l){let e=o[0],t=n.containerPhrasing(e,{before:`<!-- `,after:` -->`,...i.current()});return a(),`<!-- ${t} -->`}if(c===`inline`&&l){let e=o[0],t=n.containerPhrasing(e,{before:`%% `,after:` %%`,...i.current()});return a(),`%% ${t} %%`}let u=n.containerFlow(e,i.current());return a(),`%%\n\n${u}\n\n%%`},mdxJsxTextElement(e){let t=e.data?.sourceRaw;if(typeof t==`string`)return t;let n=e.name??``,r=PK(e.attributes??[]),i=(e.children??[]).map(e=>e&&typeof e==`object`&&`value`in e?String(e.value??``):``).join(``);return i?r?`<${n} ${r}>${i}</${n}>`:`<${n}>${i}</${n}>`:r?`<${n} ${r} />`:`<${n}/>`},rawMdxFallback(e){return e.value??``},blockquote(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.containerFlow(e,a.current());i();let s=e.data?.sourceMarkerSpacings,c=0;return n.indentLines(o,(e,t,n)=>{if(n)return`>`;let r=c++,i=s?.[r];return i===`lazy`&&r>0&&!zve.test(e)?e:i===`none`||i===0?`>${e}`:typeof i==`number`&&i>=2&&!e.startsWith(` `)?`>${` `.repeat(i)}${e}`:`> ${e}`})}};function PK(e){let t=[];for(let n of e){if(n.type===`mdxJsxExpressionAttribute`){t.push(`{${n.value}}`);continue}let e=n.name;if(n.value===null||n.value===void 0){t.push(e);continue}if(typeof n.value==`string`){n.value.includes(`"`)?t.push(`${e}={${FK(n.value)}}`):t.push(`${e}="${n.value}"`);continue}t.push(`${e}={${n.value.value}}`)}return t.join(` `)}function FK(e){return`"${e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}"`}function Hve(e){return e.type===`mdxJsxAttribute`&&typeof e.value==`string`&&e.value.includes(`"`)?{type:`mdxJsxAttribute`,name:e.name,value:{type:`mdxJsxAttributeValueExpression`,value:FK(e.value)}}:e}const Uve=/^https?:\/\//i,Wve=/^www\./i,Gve=/^https?:\/\/[A-Za-z0-9./:?#@+,;()!'-]*$/i,Kve=/www\./i;function qve(e,t){if(e===t&&Uve.test(e))return`protocol`;if(t===`http://${e}`&&Wve.test(e))return`www`;if(t===`mailto:${e}`)return`email`}function Jve(e){let t=``;for(let n of e.children){if(n.type!==`text`)return!1;t+=n.value}return t===e.url}function IK(e){return e>=65&&e<=90||e>=97&&e<=122}function LK(e){return IK(e)||e>=48&&e<=57}function RK(e){return e===45||e===95||LK(e)}function Yve(e){return e===43||e===46||RK(e)}function Xve(e){return e!==47&&!Yve(e)}function Zve(e,t,n,r,i){let a=n?.children??[],o=a.indexOf(t),s=o>0?a[o-1]:void 0,c=o>=0?a[o+1]:void 0,l=s?.type===`text`?s.value:i.before,u=c===void 0?i.after:r.handle(c,n,r,{...r.createTracker(i).current(),before:e,after:``});return{before:l.charCodeAt(l.length-1),after:u.charCodeAt(0),afterNext:u.charCodeAt(1)}}function Qve(e,t){return RK(e)||e===46&&LK(t)}function $ve(e,{before:t,after:n,afterNext:r}){return e===`email`?Xve(t)&&!Qve(n,r):(e===`protocol`?!IK(t):UK(t)!==`other`)&&UK(n)!==`other`}function eye(e){return Gve.test(e)&&!Kve.test(e)}function zK(e,t,n=` `){return t===`single`?`${n}'${e.replace(/'/g,`\\'`)}'`:t===`paren`?`${n}(${e.replace(/[()]/g,`\\$&`)})`:`${n}"${e.replace(/"/g,`\\"`)}"`}function BK(e,t,n,r=!1){let i=String(n.url??``),a=i.startsWith(`<`)&&i.endsWith(`>`);if(n.data?.sourceUrlForm===`angle-bracketed`&&!a||r){let n=e.enter(`destinationLiteral`),r=t.move(tye(i,e.stack.includes(`tableCell`)));return n(),r}let o=e.enter(`destinationRaw`),s=t.move(nye(i));return o(),s}function tye(e,t=!1){let n=`<`;for(let r=0;r<e.length;r++){let i=e[r];oH(i)||t&&i===`|`?n+=`\\${i}`:n+=i===`
|
|
428
428
|
`?`
`:i===`\r`?`
`:i===`\\`?sH(e[r+1])?`\\\\`:`\\`:i}return`${n}>`}function nye(e){if(!e)return``;let t=0,n=!0;for(let r of e)r===`(`?t++:r===`)`&&(t--,t<0&&(n=!1));return t!==0&&(n=!1),n?e:e.replace(/[\\()]/g,`\\$&`)}function rye(e){return e.replace(/(?<!\\)&(?=(#[0-9]+|#[xX][0-9A-Fa-f]+|[A-Za-z][A-Za-z0-9]*);)/g,(e,t)=>iye(t)?e:`\\${e}`)}function iye(e){if(e.charCodeAt(0)!==35)return!1;let t=e[1]===`x`||e[1]===`X`?Number.parseInt(e.slice(2),16):Number.parseInt(e.slice(1),10);return t===9||t===10||t===11||t===12||t===13||t===32||t===160}const aye=/&#(?:x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);/g;function oye(e){return e.replace(aye,e=>_c(e)?``+e.slice(1):e)}function sye(e){return/[\r\n][\t ]*$/.test(e)}function VK(e,t,n,r=!1){let{matched:i}=hU(t,{escapeAware:!1});if(i.length===0)return HK(e,t,n,r);let a=``,o=0,s=i=>{i>o&&(a+=HK(e,t.slice(o,i),{...n,before:n.before+a,after:t.slice(i,i+1)||n.after},r)),o=i};for(let e of i)s(e.start),!sye(n.before+a)&&(a+=t.slice(e.start,e.end),o=e.end);return s(t.length),a}function HK(e,t,n,r=!1){let i=e.unsafe;e.unsafe=i.filter(e=>!(e.character===`&`&&e.after===`[#A-Za-z]`||e.character===`<`||e.character===`[`||e.character===`(`||e.character===`!`&&e.after===`\\[`&&e.inConstruct===`phrasing`||e.character===`@`&&e.before===`[+\\-.\\w]`||r&&e.character===`:`&&e.before===`[ps]`&&e.after===`\\/`||e.character===`{`&&Array.isArray(e.inConstruct)&&e.inConstruct.includes(`phrasing`)||e.character==="`"||(e.character===`*`||e.character===`_`||e.character===`~`)&&e.inConstruct===`phrasing`||e.character===`=`&&e.atBreak===!0||e.character===` `&&e.inConstruct===`phrasing`&&e.after===`[\\r\\n]`||e.character===` `&&e.inConstruct===`phrasing`&&e.after===`[\\r\\n]`)),e.unsafe=e.unsafe.map(e=>{if(e.character!==`)`||e.atBreak!==!0||e.before!==`\\d+`||e.after!==void 0)return e;let t={...e,after:`(?:[ \r
|
|
429
429
|
]|$)`};return delete t._compiled,t});let a;try{a=e.safe(oye(t),n)}finally{e.unsafe=i}return a=a.replaceAll(``,`\\&`),rye(uye(a,n))}function UK(e){if(Number.isNaN(e))return`ws`;let t=ep(e);return t===1?`ws`:t===2?`punct`:`other`}function cye(e,t,n){let r=UK(t),i=UK(n),a=i!==`ws`&&(i===`other`||r!==`other`),o=r!==`ws`&&(r===`other`||i!==`other`);return e===`_`?a&&(!o||r===`punct`)||o&&(!a||i===`punct`):a||o}function lye(e,t,n){let r=t;for(;r<e.length&&(e[r]===` `||e[r]===` `);)r++;if(r<e.length)return e[r]===`
|
|
430
430
|
`||e[r]===`\r`;let i=n.after.charCodeAt(0);return Number.isNaN(i)||i===10||i===13}function uye(e,t){let n=``,r=0;for(;r<e.length;){let i=e.charAt(r);if(i===`\\`){n+=e.slice(r,r+2),r+=2;continue}if(i===`*`||i===`_`||i===`~`||i===`=`){let a=r+1;for(;a<e.length&&e.charAt(a)===i;)a++;let o=r===0?t.before.charCodeAt(t.before.length-1):e.charCodeAt(r-1);if(i===`=`)n+=(Number.isNaN(o)||o===10||o===13)&&lye(e,a,t)?`\\${e.slice(r,a)}`:e.slice(r,a);else{let s=a<e.length?e.charCodeAt(a):t.after.charCodeAt(0);n+=cye(i,o,s)?`\\${i}`.repeat(a-r):e.slice(r,a)}r=a;continue}n+=i,r+=1}return n}function WK(e,t,n){let r=n.startsWith(`_`)?`_`:`*`,i=t.before??``,a=t.after??``,o=e,s=o.charCodeAt(0);GK(i.charCodeAt(i.length-1),s,r)&&(o=KK(s)+o.slice(1));let c=o.charCodeAt(o.length-1);return GK(a.charCodeAt(0),c,r)&&(o=o.slice(0,-1)+KK(c)),o}function GK(e,t,n){return!(ep(t)!==1||n===`_`&&ep(e)===void 0)}function KK(e){return`&#x${e.toString(16).toUpperCase()};`}function dye(e,t,n,r){let i=e.value??``,a=e.data?.sourceDelimiter,o=typeof a==`string`&&/^\$+$/.test(a)?a.length:2;for(o===1&&!pye(i,r)&&(o=2);RegExp(`(^|[^$])${`\\$`.repeat(o)}([^$]|$)`).test(i);)o++;let s=`$`.repeat(o);/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^\$|\$$/.test(i))&&(i=` ${i} `);let c=-1;for(;++c<n.unsafe.length;){let e=n.unsafe[c];if(!e.atBreak)continue;let t=n.compilePattern(e),r;for(;(r=t.exec(i))!==null;){let e=r.index;i.codePointAt(e)===10&&i.codePointAt(e-1)===13&&e--,i=`${i.slice(0,e)} ${i.slice(r.index+1)}`}}return s+i+s}function fye(e,t,n,r){let i=e.data?.sourceDelimiter===`~`?`~`:`~~`,a=n.createTracker(r),o=n.enter(`strikethrough`),s=a.move(i);return s+=WK(n.containerPhrasing(e,{...a.current(),before:s,after:`~`}),r,i),s+=a.move(i),o(),s}function pye(e,t){return!(e.length===0||!/^\S/.test(e)||!/\S$/.test(e)||/[$\r\n]/.test(e)||e.endsWith(`\\`)||/\\[!-/:-@[-`{-~]/.test(e)||/^\d/.test(t.after)||t.before.endsWith(`\\`))}const qK=[{mode:`protecting`,protect:yH,reservations:_H},{mode:`protecting`,protect:vU,reservations:wH},{mode:`protecting`,protect:pH,reservations:lH},{mode:`serializer-only`,reservations:[{to:``}]}];new Set(qK.flatMap(({reservations:e})=>e.map(({to:e})=>e)));function mye(e,t){switch(t.mode){case`protecting`:return t.protect(e);case`serializer-only`:return e}}function JK(e){return qK.reduce(mye,e)}function YK(e){return e.data?.sourceRaw}function hye(e){return e.type===`text`?e.value===``:e.type===`mdxJsxTextElement`&&YK(e)===``}function XK(e){return e.type===`paragraph`&&(e.children??[]).every(hye)}function ZK(e){let t=e.children??[],n=t[0]?.children?.length??0,r=0;for(let e=1;e<t.length;e++)r=Math.max(r,t[e]?.children?.length??0);let i=e.align??[];return Math.max(n,r,i.length)}function gye(e){switch(e.type){case`table`:return ZK(e)===0;case`code`:return e.data?.sourceStyle===`indented`&&/^\n*$/.test(e.value??``);case`thematicBreak`:return YK(e)===``;case`html`:return(e.value??``)===``;case`mdxJsxFlowElement`:return YK(e)===void 0&&e.data?.htmlBoundary===void 0&&(e.children??[]).length===0&&!e.name;case`list`:return(e.children??[]).length===0;default:return!1}}function _ye(e){let t=[];for(let n of e.children){if(n.type===`table`&&ZK(n)===0){console.warn(JSON.stringify({event:`table-serialize-dropped-empty`,rows:(n.children??[]).length}));continue}gye(n)||(n.type===`paragraph`&&n.children.length>0&&XK(n)&&(n.children=[]),t.push(n))}e.children=t}function vye(e,t){let n=e,r=t;return n.type===`heading`&&n.data?.sourceContiguousNext===!0&&r.type===`paragraph`}const yye=(e,t)=>{if(XK(e)||vye(e,t))return 0;let n=e.position,r=t.position;if(!n||!r)return;let i=r.start.line-n.end.line-1;return i>=1?i:void 0},QK=/(?<!\\)\$(?=\S)([^$\n]*?[^\s$])\$(?!\d)/g;function bye(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;rp(e,`text`,(e,t,r)=>{if(r===void 0||t==null)return;let i=e.value;if(i.indexOf(`$`)===-1)return;let a=XN(e);QK.lastIndex=0;let o=[],s;for(;(s=QK.exec(i))!==null;){let e=s.index,t=e+s[0].length;if(eP(a,e,1)||eP(a,t-1,1)){QK.lastIndex=e+1;continue}o.push(s)}if(o.length===0)return;let c=[],l=0;for(let t of o){let r=t.index,i=r+t[0].length;r>l&&c.push($N(n,e,l,r));let a={type:`inlineMath`,value:t[1]},o=rP(n,e,r,i);o&&(a.position=o),c.push(a),l=i}return l<i.length&&c.push($N(n,e,l,i.length)),r.children.splice(t,1,...c),[Mf,t+c.length]})}}const xye=new Set([`strong`,`emphasis`,`delete`,`link`,`mark`,`comment`]);function Sye(e){if(e?.type!==`break`)return!1;let t=e.data?.sourceRaw;return typeof t!=`string`||t.length===0}function Cye(e){e.data??={},e.data.sourceRaw=`<br />`,e.data.sourceStyle=`html`}function $K(e){if(e?.type!==`text`)return!1;let t=e.data?.sourceRaw;return typeof t!=`string`||t.length===0}const eq=/[ \t]+$/,tq=/^[ \t]*$/;function wye(e){return e.some(e=>!($K(e)&&tq.test(e.value)))}function nq(e,t=!1){for(;e.length>0;){let n=e[e.length-1];if(Sye(n)){Cye(n);break}if(n&&xye.has(n.type)&&`children`in n){let t=n.children;if(nq(t,!0),t.length===0){e.pop();continue}}if(!t&&$K(n)&&eq.test(n.value)){let t=n.value.replace(eq,``);if(t.length>0){n.value=t;continue}if(wye(e.slice(0,-1))){e.pop();continue}if(e.every(e=>$K(e)&&tq.test(e.value))){let t=e[0];t.value=t.value.charAt(0),e.splice(1)}}break}}const Tye=new Set([`paragraph`,`heading`,`tableCell`]);function Eye(e){let t=e=>{if(Tye.has(e.type)&&`children`in e&&nq(e.children),`children`in e)for(let n of e.children)t(n)};t(e)}const rq={handlers:{tag:e=>`#${e.value}`},unsafe:[{character:`#`,inConstruct:[`phrasing`],before:`\\s`,after:`[A-Za-z]|[^\\x00-\\x7F]`}]};function Dye(){let e=this.data();e.toMarkdownExtensions||=[],e.toMarkdownExtensions.some(e=>e===rq)||e.toMarkdownExtensions.push(rq)}const Oye=new Set([`u`,`ins`]);function kye(){return e=>{rp(e,`mdxJsxTextElement`,(e,t,n)=>{if(n===void 0||t==null||e.name===null||!Oye.has(e.name)||(e.attributes??[]).length>0)return;let r={type:`underline`,children:e.children??[],data:{sourceForm:e.name===`ins`?`ins`:`u`}};return e.position&&(r.position=e.position),n.children.splice(t,1,r),t+1})}}function Aye(e){return e.children.some(e=>{let t=e.type;return t!==`yaml`&&t!==`toml`})?e:{...e,children:[...e.children,{type:`paragraph`,children:[]}]}}const jye=[{name:`remark-parse`,plugin:G_},{name:`escape-provenance`,plugin:H_e},{name:`remark-mdx-agnostic`,plugin:EU},{name:`remark-gfm`,plugin:ug},{name:`remark-math`,plugin:EW,options:{singleDollarTextMath:!1}},{name:`remark-wiki-link`,plugin:YU},{name:`remark-github-alerts`,plugin:SW,options:aG},{name:`callout-transformer`,plugin:iG},{name:`restore-from-mdx`,plugin:bU},{name:`void-br-promoter`,plugin:AU},{name:`restore-entity-refs`,plugin:gH},{name:`restore-backslash-escapes`,plugin:bH},{name:`details-accordion-promoter`,plugin:UG},{name:`div-align-promoter`,plugin:QG},{name:`image-promoter`,plugin:K_e},{name:`indented-code-promoter`,plugin:Z_e},{name:`math-promoter`,plugin:ive},{name:`single-dollar-math-promoter`,plugin:bye},{name:`highlight-promoter`,plugin:G_e},{name:`underline-promoter`,plugin:kye},{name:`mermaid-promoter`,plugin:Eve},{name:`comment-promoter`,plugin:cG},{name:`merged-post-parse-walker`,plugin:wve},{name:`empty-task-item-unmint`,plugin:aK},{name:`link-reference-destination`,plugin:rve},{name:`non-rendering-context-demote`,plugin:Fve},{name:`ensure-non-empty-doc`,plugin:()=>Aye}];function Mye(e){let t=jg();for(let e of jye)t=`options`in e&&e.options!==void 0?t.use(e.plugin,e.options):t.use(e.plugin);return t=t.use(mW,{schema:e.schema,handlers:e.handlers}),t.freeze(),t}function Nye(e){let t=jg().use(o_,[`yaml`]).use(ug,{tablePipeAlign:!1}).use(EW,{singleDollarTextMath:!1}).use(EU).use(YU).use(Dye).use(Vz,{bullet:`-`,fences:!0,rule:`-`,join:[yye],...e.toMarkdownHandlers?{handlers:e.toMarkdownHandlers}:{}});return t.freeze(),t}function iq(e){return e.charCodeAt(0)===65279?{source:e.slice(1),hadBom:!0}:{source:e,hadBom:!1}}const aq=/^\n+$/,oq=/^\n{2,}$/;function sq(e,t,n){let r,i,a=e.children;if(a.length>0){let e=a[0]?.position?.start?.offset;if(typeof e==`number`&&e>0){let n=t.slice(0,e);aq.test(n)&&(r=n)}let n=a[a.length-1]?.position?.end?.offset;if(typeof n==`number`&&n<=t.length){let e=t.slice(n);oq.test(e)&&(i=e)}}if(!n&&r===void 0&&i===void 0)return;let o={...n?{bom:!0}:{},...r===void 0?{}:{leading:r},...i===void 0?{}:{trailing:i}};return e.data??={},e.data.sourceDocBoundary=o,o}function Pye(e){if(typeof e!=`object`||!e)return;let t=e,n={};return t.bom===!0&&(n.bom=!0),typeof t.leading==`string`&&aq.test(t.leading)&&(n.leading=t.leading),typeof t.trailing==`string`&&oq.test(t.trailing)&&(n.trailing=t.trailing),n.bom||n.leading||n.trailing?n:void 0}function Fye(e,t){let{source:n,hadBom:r}=iq(e),i=MG(n),a=new Cg(JK(i)),o=t.parse(a);a.value=i;let s=t.runSync(o,a);yK(s,i);let c=sq(s,i,r),l=c?Ms(s,c):void 0,u=t.stringify(s);return l?u.type.create({...u.attrs,sourceDocBoundary:l},u.content,u.marks):u}function Iye(e,t){return cq(e,t,!1)}function Lye(e,t){return cq(e,t,!0)}function cq(e,t,n){let{source:r,hadBom:i}=iq(e),a=MG(r),o=new Cg(JK(a)),s=t.parse(o);o.value=a;let c=t.runSync(s,o);n&&yK(c,a);let l=sq(c,a,i);return n&&l&&Ms(c,l),c}function Rye(e,t,n){let r=gW(e,{schema:n.schema,nodeHandlers:n.pmNodeHandlers,markHandlers:n.pmMarkHandlers});lq(r),rK(r),Eye(r),_ye(r);let i=Pye(e.attrs?.sourceDocBoundary),a=String(t.stringify(r));return i?.leading&&(a=i.leading+a),i?.trailing&&(a=a.replace(/\n+$/,``)+i.trailing),i?.bom&&(a=`\uFEFF${a}`),a}function lq(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)lq(t);for(let t=0;t+1<e.children.length;){let n=e.children[t],r=e.children[t+1],i=n?.data,a=r?.data,o=GN(i)?i.escapedChars:null,s=GN(a)?a.escapedChars:null;if(n?.type!==`text`||r?.type!==`text`||typeof n.data?.sourceRaw==`string`||typeof r.data?.sourceRaw==`string`||o===null&&s===null){t+=1;continue}let c=n.value.length;n.value+=r.value,n.data??={},n.data.escapedChars=[...o??[],...(s??[]).map(e=>({...e,offset:e.offset+c}))],r.data?.entityRefSpans?.length&&(n.data.entityRefSpans=[...n.data.entityRefSpans??[],...r.data.entityRefSpans.map(e=>({...e,offset:e.offset+c}))]),e.children.splice(t+1,1)}}}var zye=class{schema;handlers;pmNodeHandlers;pmMarkHandlers;parseProcessor;serializeProcessor;parseCtx={current:{}};freshnessHolder={checker:void 0};authoredJsxSource=jW(e=>this.schema.nodeFromJSON(this.parseWithFallback(e)));constructor(e){this.schema=mO(e.extensions),this.handlers=Uye(this.schema,this.parseCtx),this.freshnessHolder.checker=e.deriveStructuralFreshness?sc({parse:e=>this.parseWithFallback(e)}):void 0;let{nodeHandlers:t,markHandlers:n}=Wye(this.schema,this.freshnessHolder,this.authoredJsxSource);this.pmNodeHandlers=t,this.pmMarkHandlers=n,this.parseProcessor=Mye({schema:this.schema,handlers:this.handlers,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers}),this.serializeProcessor=Nye({toMarkdownHandlers:Vve})}parse(e,t){if(!e.trim())return{type:`doc`,content:[{type:`paragraph`,content:[]}]};this.parseCtx.current=t??{};try{return Fye(e,this.parseProcessor).toJSON()}finally{this.parseCtx.current={}}}parseToMdast(e){return e.trim()?Iye(e,this.parseProcessor):{type:`root`,children:[]}}parseToEditorMdast(e){return e.trim()?Lye(e,this.parseProcessor):{type:`root`,children:[]}}parseWithFallback(e,t){return e.trim()?PW(e,{parse:e=>this.parse(e,t)}):{type:`doc`,content:[{type:`paragraph`,content:[]}]}}serialize(e,t){let n;try{n=this.schema.nodeFromJSON(e)}catch(t){let n=`MarkdownManager.serialize() failed: schema rejected JSONContent (type=${e.type}, childCount=${e.content?.length??0})`;throw Error(n,{cause:t})}let r=this.freshnessHolder.checker;t?.skipFreshnessDerive&&(this.freshnessHolder.checker=void 0);try{return Rye(n,this.serializeProcessor,{schema:this.schema,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers})}finally{this.freshnessHolder.checker=r}}};const uq=IB();function dq(e,t){let n=new Map;for(let e of t)n.set(e.name,e);let r={};for(let t of e){if(t.type===`mdxJsxExpressionAttribute`)continue;let e=t.name,i=n.get(e);if(t.value===null||t.value===void 0){r[e]=!0;continue}if(typeof t.value==`string`){if(i?.type===`number`){let n=Number(t.value);r[e]=Number.isNaN(n)?t.value:n}else r[e]=i?.type===`boolean`?t.value===`true`:t.value;continue}let a=t.value.value;try{r[e]=JSON.parse(a)}catch{r[e]=a}}return r}function fq(e){let t=!1;return e.descendants(e=>t?!1:e.type.name===`jsxInline`?(e.attrs.sourceDirty&&(t=!0),!1):e.type.name===`jsxComponent`&&e.attrs.sourceDirty?(t=!0,!1):!0),t}function Bye(e,t){return e.attrs.sourceDirty||fq(e)?!0:t?t.isDiverged(e.toJSON()):!1}function Vye(e){if(e.type!==`paragraph`)return!1;let t=e.children??[];return t.length===0||t.every(e=>e.type===`text`&&e.value===``)}function pq(e,t){if(!t)return e;let n={};return t.sourceFenceChar&&(n.sourceFenceChar=t.sourceFenceChar),typeof t.sourceFenceLength==`number`&&(n.sourceFenceLength=t.sourceFenceLength),t.sourcePadded===!0&&(n.sourcePadded=!0),Object.keys(n).length===0?e:{...e,data:n}}function mq(e,t){if(e.length===0)return pq({type:`inlineCode`,value:``},t);if(e.every(e=>e.type===`text`))return pq({type:`inlineCode`,value:e.map(e=>e.value).join(``)},t);if(e.length===1&&`children`in e[0]){let n=e[0];return{...n,children:[mq(n.children,t)]}}return pq({type:`inlineCode`,value:hq(e)},t)}function hq(e){let t=``;for(let n of e)n.type===`text`?t+=n.value:`children`in n&&Array.isArray(n.children)?t+=hq(n.children):`value`in n&&typeof n.value==`string`&&(t+=n.value);return t}const Hye=Uc;function Uye(e,t){let n=e.nodes,r=e.marks,i={};n.paragraph&&(i.paragraph=(e,t,r)=>{let i=r.all(e).flat(),a=i.some(e=>e?.isBlock&&!e?.isInline),o=i.some(e=>e?.isInline||e?.isText||e?.isTextblock);if(a&&!o)return i.length===1?i[0]:i;if(a&&o){let e=i.filter(e=>!e?.isBlock||e?.isInline),t=i.filter(e=>e?.isBlock&&!e?.isInline),r=[],a=n.paragraph.createAndFill(null,e.length>0?e:null);return a&&r.push(a),r.push(...t),r.length===1?r[0]:r}return n.paragraph.createAndFill(null,i.length>0?i:null)}),n.blockquote&&(i.blockquote=dW(n.blockquote,e=>({sourceMarkerSpacings:e.data?.sourceMarkerSpacings??null}))),n.tableCell&&(i.tableCell=(e=>(t,r,i)=>{let a=i.all(t).flat();if(a.length>0&&n.paragraph){let t=n.paragraph.create(null,a);return e.createAndFill(null,[t])}return e.createAndFill(null,null)})(n.tableCell)),n.tableRow&&(i.tableRow=dW(n.tableRow)),n.table&&n.tableRow&&n.tableCell&&(i.table=(e,t,r)=>{let i=e.align??[],a=e.children??[],o=[];for(let e=0;e<a.length;e++){let t=a[e];if(t.type!==`tableRow`)continue;let s=t.children??[],c=[];for(let t=0;t<s.length;t++){let a=s[t];if(a.type!==`tableCell`)continue;let o=r.all(a).flat(),l=o.length>0&&n.paragraph?[n.paragraph.create(null,o)]:null,u=i[t]??null,d=e===0&&n.tableHeader?n.tableHeader:n.tableCell,f=a.data?.sourcePadding??null,p=d.createAndFill({align:u,sourcePadding:f},l);p&&c.push(p)}let l=n.tableRow.createAndFill(null,c.length>0?c:null);l&&o.push(l)}let s=e.data?.sourceDashCounts??null,c=e.data?.sourceOuterPipes??null,l=e.data?.sourceAlignmentPadding??null;return n.table.createAndFill({sourceDashCounts:s,sourceOuterPipes:c,sourceAlignmentPadding:l},o.length>0?o:null)}),n.image&&(i.image=e=>{let r=e.url??``,i=ks(r,t.current.sourcePath);return n.image.createAndFill({src:i,alt:e.alt??null,title:e.title??null,sourceUrl:i===r?null:r,sourceUrlForm:e.data?.sourceUrlForm??null})},i.imageReference=n.imageReference?e=>n.imageReference.createAndFill({alt:e.alt??``,label:e.label??e.identifier??``,identifier:e.identifier??``,referenceType:e.referenceType??`shortcut`}):e=>n.image.createAndFill({src:``,alt:e.alt??null,title:null})),r.escapeMark&&(i.text=t=>{let n=t.value??``,i=typeof t.data?.sourceRaw==`string`?t.data.sourceRaw:null;if(!n&&!i)return null;if(i)return r.sourceLiteral?e.text(n,[r.sourceLiteral.create({sourceRaw:i})]):e.text(n);let a=t.data?.escapedChars,o=t.data?.entityRefSpans;if(!a?.length&&!o?.length)return e.text(n);let s=[...(a??[]).map(e=>({kind:`escape`,offset:e.offset,length:1})),...(o??[]).map(e=>({kind:`entity`,offset:e.offset,length:e.length,raw:e.raw}))];s.sort((e,t)=>e.offset-t.offset);let c=[];for(let e of s){let t=c[c.length-1];e.kind===`entity`&&t?.kind===`entity`&&t.offset+t.length===e.offset&&bc(t.raw)!==null&&_c(e.raw)?c[c.length-1]={kind:`entity`,offset:t.offset,length:t.length+e.length,raw:t.raw+e.raw}:c.push(e)}let l=[],u=0;for(let t of c){if(t.offset>u){let r=n.slice(u,t.offset);r&&l.push(e.text(r))}if(t.offset<n.length){let i=n.slice(t.offset,t.offset+t.length);if(i){if(t.kind===`escape`)l.push(e.text(i,[r.escapeMark.create()]));else if(r.sourceLiteral){let n=bc(t.raw);l.push(e.text(n??i,[r.sourceLiteral.create({sourceRaw:t.raw})]))}else l.push(e.text(i))}u=t.offset+t.length}}if(u<n.length){let t=n.slice(u);t&&l.push(e.text(t))}return l.length===1?l[0]:l}),r.code&&(i.inlineCode=t=>e.text(t.value,[r.code.create({sourceFenceChar:t.data?.sourceFenceChar??"`",sourceFenceLength:typeof t.data?.sourceFenceLength==`number`?t.data.sourceFenceLength:1,sourcePadded:t.data?.sourcePadded===!0})]));let a=r.strike??r.delete;if(a&&(i.delete=fW(a,e=>({sourceDelimiter:e.data?.sourceDelimiter===`~`?`~`:`~~`}))),r.highlight&&(i.mark=fW(r.highlight)),r.underline&&(i.underline=fW(r.underline,e=>({sourceForm:e.data?.sourceForm===`ins`?`ins`:`u`}))),r.comment&&(i.comment=fW(r.comment,e=>({sourceForm:e.data?.sourceForm??`percent`}))),n.commentBlock&&(i.commentBlock=dW(n.commentBlock,e=>({sourceForm:e.data?.sourceForm??`percent`,sourceLayout:e.data?.sourceLayout??`block`}))),r.emphasis&&(i.emphasis=fW(r.emphasis,e=>({sourceDelimiter:e.data?.sourceDelimiter??`*`}))),r.strong&&(i.strong=fW(r.strong,e=>({sourceDelimiter:e.data?.sourceDelimiter??`**`}))),n.heading&&(i.heading=dW(n.heading,e=>({level:e.depth,headingStyle:e.data?.sourceStyle??`atx`,sourceTrailingHashes:e.data?.sourceTrailingHashes??null,sourceUnderlineLength:e.data?.sourceUnderlineLength??null,sourceContiguousNext:e.data?.sourceContiguousNext??!1,sourceLeadingIndent:e.data?.sourceLeadingIndent??null,sourceInteriorSpacing:e.data?.sourceInteriorSpacing??null}))),n.codeBlock&&(i.code=t=>{let r=t.value?[e.text(t.value)]:[];return n.codeBlock.createAndFill({language:t.lang??null,meta:t.meta??null,fenceDelimiter:t.data?.sourceFenceChar??"`",fenceLength:t.data?.sourceFenceLength??3,sourceStyle:t.data?.sourceStyle??`fenced`,sourceClosingFenceLength:t.data?.sourceClosingFenceLength??null,sourceUnclosedFence:t.data?.sourceUnclosedFence??!1,sourceFenceIndent:t.data?.sourceFenceIndent??null,sourceInfoPadding:t.data?.sourceInfoPadding??null,sourceIndents:t.data?.sourceIndents??null},r)}),n.thematicBreak&&(i.thematicBreak=e=>n.thematicBreak.createAndFill({sourceRaw:e.data?.sourceRaw??`---`})),n.hardBreak&&(i.break=e=>n.hardBreak.createAndFill({hardBreakStyle:e.data?.sourceStyle??`spaces`,sourceRaw:e.data?.sourceRaw??null})),n.list&&(i.list=dW(n.list,e=>({ordered:!!e.ordered,start:e.start??1,spread:!!e.spread,bulletMarker:e.data?.bulletMarker??null,listMarkerDelimiter:e.data?.listMarkerDelimiter??null}))),n.listItem&&(i.listItem=dW(n.listItem,e=>({checked:e.checked??null,spread:!!e.spread,sourceMarkerSpacing:e.data?.sourceMarkerSpacing??null,sourceOrdinal:e.data?.sourceOrdinal??null,sourceCheckboxChar:e.data?.sourceCheckboxChar??null,sourceContinuationIndent:e.data?.sourceContinuationIndent??null}))),r.link){let t=r.sourceLiteral;i.link=(n,i,a)=>{if((n.children??[]).length===0){let r=typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:`[](${n.url??``})`;return r?t?e.text(r,[t.create({sourceRaw:r})]):e.text(r):null}let o=a.all(n).flat(),s=r.link.create({href:n.url??``,title:n.title??null,linkStyle:n.data?.sourceStyle??`inline`,refLabel:null,sourceUrlForm:n.data?.sourceUrlForm??null,sourceTitleMarker:n.data?.sourceTitleMarker??null});return o.map(e=>e.mark(s.addToSet(e.marks)))},i.linkReference=(n,i,a)=>{if((n.children??[]).length===0){let r=typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:`[${n.label??``}][${n.identifier??``}]`;return r?t?e.text(r,[t.create({sourceRaw:r})]):e.text(r):null}let o=a.all(n).flat(),s=r.link.create({href:n.data?.resolvedUrl??``,title:n.data?.resolvedTitle??null,linkStyle:n.referenceType??`shortcut`,refLabel:n.label??n.identifier??null});return o.map(e=>e.mark(s.addToSet(e.marks)))}}n.htmlBlock&&(i.html=e=>n.htmlBlock.createAndFill({content:e.value??``}));let o=n.linkDefinition??n.linkRefDef;if(o){let e=!!o.spec.attrs?.url,t=!!o.spec.attrs?.href,n=!!o.spec.attrs?.identifier,r=!!o.spec.attrs?.sourceLayout,a=!!o.spec.attrs?.sourceTitleMarker,s=!!o.spec.attrs?.sourceUrlForm;i.definition=i=>{let c={title:i.title??null};return n&&(c.identifier=i.identifier??``),c.label=i.label??i.identifier??``,e?c.url=i.url??``:t&&(c.href=i.url??``),r&&(c.sourceLayout=i.data?.sourceLayout??null),a&&(c.sourceTitleMarker=i.data?.sourceTitleMarker??null),s&&(c.sourceUrlForm=i.data?.sourceUrlForm??null),o.createAndFill(c)}}if(n.jsxComponent){let r=e=>{if(e&&typeof e==`object`&&`sourceRaw`in e){let t=e.sourceRaw;if(typeof t==`string`)return t}};i.mdxJsxFlowElement=(e,i,a)=>{let o=e.name??``,s=uq.getOrWildcard(o),c=dq(e.attributes,s.props);if(o===`CommonMarkImage`&&typeof c.src==`string`){let e=c.src,n=ks(e,t.current.sourcePath);n!==e&&(c.src=n,c.sourceUrl=e)}let l=a.all(e).flat();return n.jsxComponent.createAndFill({componentName:o,kind:`element`,attributes:e.attributes,sourceRaw:r(e.data)??``,sourceDirty:!1,props:c},l.length?l:void 0)};let a=(e,t)=>{let n=e.attributes?.find(e=>e.type===`mdxJsxAttribute`&&e.name===t);return n&&typeof n.value==`string`?n.value:null};i.mdxJsxTextElement=t=>{if(t.name===`InlineMath`&&n.mathInline){let e=a(t,`formula`)??``,r=a(t,`id`);return n.mathInline.create({formula:e,id:r??null})}if(t.name===`Tag`&&n.tag){let e=a(t,`value`)??``;return n.tag.create({value:e})}let i=t.name??``,o=i?uq.get(i):void 0;if(o&&n.jsxInline){let e=dq(t.attributes,o.props),a=r(t.data)??``,s=(t.children??[]).map(e=>e&&typeof e==`object`&&`value`in e?String(e.value??``):``).join(``);return s&&(e.children=s),n.jsxInline.createAndFill({componentName:i,attributes:t.attributes,sourceRaw:a,sourceDirty:!1,props:e})}if(n.jsxInline){let i=r(t.data)??``;return n.jsxInline.createAndFill({},i?[e.text(i)]:null)}return n.jsxComponent.createAndFill({sourceRaw:r(t.data)??``})},i.mdxFlowExpression=e=>{let t=r(e.data)??`{${e.value??``}}`;return n.jsxComponent.createAndFill({kind:`expression`,sourceRaw:t,sourceDirty:!1})},i.mdxTextExpression=t=>{let n=r(t.data)??`{${t.value??``}}`;return e.text(n)}}return n.wikiLink&&(i.wikiLink=e=>n.wikiLink.createAndFill({target:e.data?.target??``,alias:e.data?.alias??null,anchor:e.data?.anchor??null,sourceTarget:e.data?.sourceTarget??null,sourceAnchor:e.data?.sourceAnchor??null,sourceAlias:e.data?.sourceAlias??null})),n.tag&&(i.tag=e=>n.tag.createAndFill({value:e.value})),n.wikiLinkEmbed&&(i.wikiLinkEmbed=(i,a)=>{let o=i.data?.target??``,s=i.data?.alias??null,c=i.data?.anchor??null,l=i.data?.sourceTarget??null,u=i.data?.sourceAnchor??null,d=i.data?.sourceAlias??null,f=tk(o),{resolveEmbed:p,sourcePath:m}=t.current,h=p&&m?p(o,m)??null:null,g=h?`/${h}`:o,_=a?.type===`paragraph`&&Array.isArray(a.children)&&a.children.length===1;if(_&&Hye.has(f)&&n.jsxComponent&&uq.has(`WikiEmbedImage`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedImage`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:g,alt:s??o,target:o,anchor:c,alias:s,sourceTarget:l,sourceAnchor:u,sourceAlias:d}});if(_&&Wc.has(f)&&n.jsxComponent&&uq.has(`WikiEmbedVideo`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedVideo`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:g,title:s??o,target:o,anchor:c,alias:s,sourceTarget:l,sourceAnchor:u,sourceAlias:d}});if(_&&Kc.has(f)&&n.jsxComponent&&uq.has(`WikiEmbedAudio`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedAudio`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:g,title:s??o,target:o,anchor:c,alias:s,sourceTarget:l,sourceAnchor:u,sourceAlias:d}});if(_&&qc.has(f)&&n.jsxComponent&&uq.has(`WikiEmbedFile`)){let{resolveSize:e}=t.current,r=e&&m?e(o,m)??null:null,i=r===null?null:$U(r);return n.jsxComponent.createAndFill({componentName:`WikiEmbedFile`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:g,target:o,anchor:c,alias:s,size:i,sourceTarget:l,sourceAnchor:u,sourceAlias:d}})}let v=s||(c?`${o}#${c}`:o);if(r.link){let t=r.link.create({href:g,title:null,linkStyle:`inline`,refLabel:null,sourceForm:`wikiembed`,target:o,anchor:c,alias:s,sourceTarget:l,sourceAnchor:u,sourceAlias:d});return e.text(v,[t])}throw Error("[wikiLinkEmbed handler] schema lacks `link` mark — cannot dispatch without violating the STOP rule against emitting PM wikiLinkEmbed server-side")}),n.mathInline&&(i.inlineMath=e=>n.mathInline.create({formula:e.value??``,sourceDelimiter:e.data?.sourceDelimiter??null})),i.math||=t=>{let r=t.value==null?`«unknown:${t.type}»`:t.value;return n.rawMdxFallback?(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.type,reason:`Unhandled block mdast: ${t.type}`})),n.rawMdxFallback.createAndFill({reason:`Unhandled block mdast: ${t.type}`},r?[e.text(r)]:null)):null},i.inlineMath||=t=>(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.type,reason:`Unhandled inline mdast: ${t.type}`})),t.value==null?e.text(`«unknown:${t.type}»`):e.text(t.value)),n.footnoteReference?i.footnoteReference=e=>n.footnoteReference.create({identifier:e.identifier,label:e.label??e.identifier}):i.footnoteReference||=t=>(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:`footnoteReference`,reason:`FootnoteReference extension missing — recovering [^id] source`})),e.text(`[^${t.label??t.identifier}]`)),n.footnoteDefinition?i.footnoteDefinition=dW(n.footnoteDefinition,e=>{let t=e;return{identifier:t.identifier,label:t.label??t.identifier}}):i.footnoteDefinition||=t=>{console.warn(JSON.stringify({event:`unknown-mdast-type`,type:`footnoteDefinition`,reason:`FootnoteDefinition extension missing — recovering [^id]: marker`}));let r=`[^${t.label??t.identifier}]: `;return n.paragraph?n.paragraph.create(null,e.text(r)):null},i.rawMdxFallbackMdast=t=>{if(!n.rawMdxFallback)return null;let r=t.position?{start:t.position.start?.offset??0,end:t.position.end?.offset??0}:{start:0,end:0};return console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.originalType,reason:`Unhandled mdast: ${t.originalType}`,unresolvedPosition:t.unresolvedPosition??!1})),n.rawMdxFallback.createAndFill({reason:`Unhandled mdast: ${t.originalType}`,originalSpan:r},t.value?[e.text(t.value)]:null)},i}function Wye(e,t,n){let r={},i={},a=e.nodes,o=e.marks;a.paragraph&&(r.paragraph=_W(`paragraph`)),a.blockquote&&(r.blockquote=_W(`blockquote`,e=>{let t=e.attrs.sourceMarkerSpacings,n={};return Array.isArray(t)&&t.length>0&&(n.sourceMarkerSpacings=t),Object.keys(n).length>0?{data:n}:{}})),a.heading&&(r.heading=_W(`heading`,e=>({depth:e.attrs.level,data:{sourceStyle:e.attrs.headingStyle,sourceTrailingHashes:e.attrs.sourceTrailingHashes??void 0,sourceUnderlineLength:e.attrs.sourceUnderlineLength??void 0,sourceContiguousNext:e.attrs.sourceContiguousNext===!0||void 0,sourceLeadingIndent:e.attrs.sourceLeadingIndent??void 0,sourceInteriorSpacing:e.attrs.sourceInteriorSpacing??void 0}}))),a.codeBlock&&(r.codeBlock=e=>{let t=e.attrs.sourceStyle===`indented`?`indented`:`fenced`;return{type:`code`,lang:t===`indented`?null:e.attrs.language??null,meta:t===`indented`?null:e.attrs.meta??null,value:e.textContent??``,data:{sourceFenceChar:e.attrs.fenceDelimiter,sourceFenceLength:e.attrs.fenceLength,sourceStyle:t,sourceClosingFenceLength:e.attrs.sourceClosingFenceLength??void 0,sourceUnclosedFence:e.attrs.sourceUnclosedFence===!0||void 0,sourceFenceIndent:e.attrs.sourceFenceIndent??void 0,sourceInfoPadding:e.attrs.sourceInfoPadding??void 0,sourceIndents:e.attrs.sourceIndents??void 0}}}),a.thematicBreak&&(r.thematicBreak=e=>({type:`thematicBreak`,data:{sourceRaw:e.attrs.sourceRaw}})),a.hardBreak&&(r.hardBreak=e=>({type:`break`,data:{sourceStyle:e.attrs.hardBreakStyle,...typeof e.attrs.sourceRaw==`string`&&e.attrs.sourceRaw.length>0?{sourceRaw:e.attrs.sourceRaw}:{}}})),a.list&&(r.list=_W(`list`,e=>({ordered:e.attrs.ordered??!1,start:e.attrs.ordered?e.attrs.start??1:null,spread:e.attrs.spread??!1,data:{bulletMarker:e.attrs.bulletMarker,listMarkerDelimiter:e.attrs.listMarkerDelimiter}}))),a.listItem&&(r.listItem=(e,t,n)=>{let r=n.all(e),i=r.length>1&&Vye(r[0])?r.slice(1):r,a={};return typeof e.attrs.sourceMarkerSpacing==`number`&&(a.sourceMarkerSpacing=e.attrs.sourceMarkerSpacing),typeof e.attrs.sourceOrdinal==`number`&&(a.sourceOrdinal=e.attrs.sourceOrdinal),e.attrs.sourceCheckboxChar===`X`&&(a.sourceCheckboxChar=`X`),typeof e.attrs.sourceContinuationIndent==`number`&&(a.sourceContinuationIndent=e.attrs.sourceContinuationIndent),{type:`listItem`,checked:e.attrs.checked??null,spread:e.attrs.spread??!1,...Object.keys(a).length>0?{data:a}:{},children:i}}),a.table&&(r.table=(e,t,n)=>{let r=n.all(e),i=[],a=e.firstChild;a&&a.forEach(e=>{let t=e.attrs.align;i.push(t===`left`||t===`right`||t===`center`?t:null)});let o=r.filter(e=>e.type===`tableRow`),s=e.attrs.sourceDashCounts,c={};Array.isArray(s)&&s.length>0&&(c.sourceDashCounts=s);let l=e.attrs.sourceOuterPipes;typeof l==`object`&&l&&typeof l.leading==`boolean`&&typeof l.trailing==`boolean`&&(c.sourceOuterPipes=l);let u=e.attrs.sourceAlignmentPadding;Array.isArray(u)&&u.length>0&&(c.sourceAlignmentPadding=u);let d=Object.keys(c).length>0?c:void 0,f={type:`table`,align:i,children:o};return d&&(f.data=d),f}),a.tableRow&&(r.tableRow=_W(`tableRow`));let s=(e,t)=>{let n={type:`tableCell`,children:wP(t)},r=e.attrs.sourcePadding;return typeof r==`object`&&r&&typeof r.left==`number`&&typeof r.right==`number`&&(n.data={sourcePadding:r}),n};if(a.tableCell&&(r.tableCell=(e,t,n)=>s(e,n.all(e))),a.tableHeader&&(r.tableHeader=(e,t,n)=>s(e,n.all(e))),a.image&&(r.image=e=>{let t={type:`image`,url:Os(e.attrs.src,e.attrs.sourceUrl),alt:e.attrs.alt,title:e.attrs.title};return e.attrs.sourceUrlForm===`angle-bracketed`&&(t.data={sourceUrlForm:`angle-bracketed`}),t}),a.imageReference&&(r.imageReference=e=>{let t=e.attrs.label??``,n=e.attrs.identifier??t;return{type:`imageReference`,alt:e.attrs.alt??``,identifier:n,label:t||n,referenceType:e.attrs.referenceType??`shortcut`}}),a.htmlBlock&&(r.htmlBlock=e=>({type:`html`,value:e.attrs.content})),a.linkDefinition??a.linkRefDef){let e=a.linkDefinition?`linkDefinition`:`linkRefDef`;r[e]=e=>{let t={},n=e.attrs.sourceLayout;(n===`multiline`||n===`inline`)&&(t.sourceLayout=n);let r=e.attrs.sourceTitleMarker;(r===`single`||r===`double`||r===`paren`)&&(t.sourceTitleMarker=r),e.attrs.sourceUrlForm===`angle-bracketed`&&(t.sourceUrlForm=`angle-bracketed`);let i={type:`definition`,identifier:e.attrs.identifier??e.attrs.label??``,label:e.attrs.label??e.attrs.identifier??``,url:e.attrs.url??e.attrs.href??``,title:e.attrs.title};return Object.keys(t).length>0&&(i.data=t),i}}if(a.jsxComponent&&(r.jsxComponent=(e,r,i)=>{if(e.attrs.kind===`expression`)return{type:`html`,value:e.attrs.sourceRaw??``};let a=e.attrs.componentName||null,o=Array.isArray(e.attrs.attributes)?e.attrs.attributes:[],s=()=>({type:`mdxJsxFlowElement`,name:a,attributes:o,children:[],data:{sourceRaw:String(e.attrs.sourceRaw)}});if(!Bye(e,t.checker)&&e.attrs.sourceRaw)return s();let c=uq.getOrWildcard(a??`*`),l={all:e=>i.all(e),registry:uq,serializeChildren:()=>{throw Error(`SerializeContext.serializeChildren is not available in the PM→mdast handler. Compat descriptors that need markdown-byte body rendering must emit a marker mdast node and let the to-markdown handler render the body via state.containerFlow.`)}},u=c.serialize(e,l),d=kW(u,a);if(!d||fq(e))return u;let f=n.read(e,d,e=>c.serialize(e,l));return f?f.kind===`verbatim`?s():{...d,data:{...d.data,sourceBody:f.body}}:d}),a.rawMdxFallback&&(r.rawMdxFallback=e=>{let t=e.textContent??``,n=typeof e.attrs.reason==`string`?e.attrs.reason:``,r=e.attrs.originalSpan;return{type:`rawMdxFallback`,value:t,data:{reason:n,originalSpan:r&&typeof r==`object`&&`start`in r&&`end`in r?{start:Number(r.start)||0,end:Number(r.end)||0}:{start:0,end:0}}}}),a.jsxInline&&(r.jsxInline=e=>{let t=e.attrs.componentName||``;if(t&&e.attrs.sourceDirty)return aB(t,e,uq.get(t)?.props);let n=e.attrs.attributes,r=e.attrs.sourceRaw||e.textContent||``;return{type:`mdxJsxTextElement`,name:t||null,attributes:Array.isArray(n)?n:[],children:[],data:{sourceRaw:String(r)}}}),a.mathInline&&(r.mathInline=e=>{let t=e.attrs.formula??``,n=e.attrs.id;if(typeof n==`string`&&n.length>0)return{type:`mdxJsxTextElement`,name:`InlineMath`,attributes:[{type:`mdxJsxAttribute`,name:`formula`,value:t},{type:`mdxJsxAttribute`,name:`id`,value:n}],children:[]};let r=e.attrs.sourceDelimiter;return{type:`inlineMath`,value:t,...typeof r==`string`&&r.length>0?{data:{sourceDelimiter:r}}:{}}}),a.wikiLink&&(r.wikiLink=e=>{let t=e.attrs.target??``,n=e.attrs.anchor??null,r=e.attrs.alias??null,i=r||(n?`${t}#${n}`:t);return{type:`wikiLink`,value:i,data:{target:t,anchor:n,alias:r,sourceTarget:typeof e.attrs.sourceTarget==`string`?e.attrs.sourceTarget:null,sourceAnchor:typeof e.attrs.sourceAnchor==`string`?e.attrs.sourceAnchor:null,sourceAlias:typeof e.attrs.sourceAlias==`string`?e.attrs.sourceAlias:null},children:[{type:`text`,value:i}]}}),a.tag&&(r.tag=e=>({type:`tag`,value:String(e.attrs.value??``)})),a.wikiLinkEmbed&&(r.wikiLinkEmbed=e=>{let t=e.attrs.target??``,n=e.attrs.anchor??null,r=e.attrs.alias??null,i=r||(n?`${t}#${n}`:t);return{type:`wikiLinkEmbed`,value:i,data:{target:t,anchor:n,alias:r},children:[{type:`text`,value:i}]}}),o.emphasis&&(i.emphasis=vW(`emphasis`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),o.strong&&(i.strong=vW(`strong`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),o.code&&(i.code=(e,t,n)=>{let r=e.attrs.sourceFenceChar,i=e.attrs.sourceFenceLength;return mq(n,{sourceFenceChar:r,sourceFenceLength:i,sourcePadded:e.attrs.sourcePadded===!0||void 0})}),o.strike??o.delete){let e=o.strike?`strike`:`delete`;i[e]=vW(`delete`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter===`~`?`~`:`~~`}}))}return o.highlight&&(i.highlight=vW(`mark`)),o.underline&&(i.underline=vW(`underline`,e=>({data:{sourceForm:e.attrs.sourceForm===`ins`?`ins`:`u`}}))),o.comment&&(i.comment=vW(`comment`,e=>({data:{sourceForm:e.attrs.sourceForm===`html`?`html`:`percent`}}))),a.commentBlock&&(r.commentBlock=_W(`commentBlock`,e=>({data:{sourceForm:e.attrs.sourceForm===`html`?`html`:`percent`,sourceLayout:e.attrs.sourceLayout===`inline`?`inline`:`block`}}))),a.footnoteReference&&(r.footnoteReference=e=>{let t=String(e.attrs.identifier??``);return{type:`footnoteReference`,identifier:t,label:e.attrs.label?String(e.attrs.label):t}}),a.footnoteDefinition&&(r.footnoteDefinition=_W(`footnoteDefinition`,e=>({identifier:String(e.attrs.identifier??``),label:e.attrs.label?String(e.attrs.label):String(e.attrs.identifier??``)}))),o.link&&(i.link=(e,t,n)=>{if(e.attrs.sourceForm===`wikiembed`){let t=typeof e.attrs.target==`string`&&e.attrs.target.length>0?e.attrs.target:e.attrs.href??``,r=typeof e.attrs.anchor==`string`&&e.attrs.anchor.length>0?e.attrs.anchor:null,i=typeof e.attrs.alias==`string`&&e.attrs.alias.length>0?e.attrs.alias:null,a=typeof e.attrs.sourceTarget==`string`?e.attrs.sourceTarget:null,o=typeof e.attrs.sourceAnchor==`string`?e.attrs.sourceAnchor:null,s=typeof e.attrs.sourceAlias==`string`?e.attrs.sourceAlias:null,c=i||(r?`${t}#${r}`:t),l=n.map(e=>`value`in e&&typeof e.value==`string`?e.value:``).join(``);return l!==c&&l.trim().length>0&&!l.includes(`]]`)&&(i=l,c=l),{type:`wikiLinkEmbed`,value:c,data:{target:t,anchor:r,alias:i,sourceTarget:a,sourceAnchor:o,sourceAlias:s},children:[{type:`text`,value:c}]}}let r=e.attrs.linkStyle;if(r===`autolink`)return{type:`link`,url:e.attrs.href??``,title:null,children:n,data:{sourceStyle:`autolink`}};if(r===`gfm-autolink`)return{type:`link`,url:e.attrs.href??``,title:null,children:n,data:{sourceStyle:`gfm-autolink`}};if(r===`inline`||!r){let t={};e.attrs.sourceUrlForm===`angle-bracketed`&&(t.sourceUrlForm=`angle-bracketed`);let r=e.attrs.sourceTitleMarker;return(r===`single`||r===`double`||r===`paren`)&&(t.sourceTitleMarker=r),{type:`link`,url:e.attrs.href??``,title:e.attrs.title??null,children:n,...Object.keys(t).length>0?{data:t}:{}}}return{type:`linkReference`,identifier:(e.attrs.refLabel??``).toLowerCase(),label:e.attrs.refLabel,referenceType:r,children:n}}),o.escapeMark&&(i.escapeMark=(e,t,n)=>{for(let e of n)if(e.type===`text`&&e.value){let t=e;t.data??={},t.data.escapedChars??=[];for(let e=0;e<t.value.length;e++)t.data.escapedChars.push({offset:e,char:t.value[e]})}return n.length===1?n[0]:n}),o.sourceLiteral&&(i.sourceLiteral=(e,t,n)=>{let r=typeof e.attrs.sourceRaw==`string`?e.attrs.sourceRaw:``;if(n.length===1&&n[0]?.type===`text`){let e=n[0],t=r||e.value;return YO(t,e.value)&&(e.data??={},e.data.sourceRaw=t),e}return{type:`text`,value:n.filter(e=>e.type===`text`).map(e=>e.value??``).join(``)||r}}),{nodeHandlers:r,markHandlers:i}}const Gye=new Set([`img`,`video`,`audio`,`mark`,`u`,`ins`]);new Map(PB.flatMap(e=>e.surface===`compat`&&Gye.has(e.rendersAs)?[[e.name,e]]:[])),em(`<>`);var gq={SINGLE_TILDE:0,COMPARISON_OPERATORS:5,HTML_TAGS:10,SETEXT_HEADINGS:15,LINKS:20,BOLD_ITALIC:30,BOLD:35,ITALIC_DOUBLE_UNDERSCORE:40,ITALIC_SINGLE_ASTERISK:41,ITALIC_SINGLE_UNDERSCORE:42,INLINE_CODE:50,STRIKETHROUGH:60,KATEX:70,INLINE_KATEX:75,DEFAULT:100};gq.SINGLE_TILDE,gq.COMPARISON_OPERATORS,gq.HTML_TAGS,gq.SETEXT_HEADINGS,gq.LINKS,gq.BOLD_ITALIC,gq.BOLD,gq.ITALIC_DOUBLE_UNDERSCORE,gq.ITALIC_SINGLE_ASTERISK,gq.ITALIC_SINGLE_UNDERSCORE,gq.INLINE_CODE,gq.STRIKETHROUGH,gq.KATEX,gq.INLINE_KATEX,jg().use(G_).use(ug);const _q=U(xt),Kye=U(iee),qye=V({alwaysOn:L().int().nonnegative(),onTrigger:L().int().nonnegative(),onDemand:L().int().nonnegative()}).strict();V({intents:B(V({satisfierId:I().min(1),desired:U([`present`,`absent`])}).loose()),...tf,summary:nf}).loose();const Jye=V({satisfierId:I(),agentId:I(),piece:I(),scope:I(),kind:I(),pathId:I().optional(),desired:U([`present`,`absent`]),action:U(_a),errorId:I().optional()}).loose(),Yye=V({kind:I(),satisfierIds:B(I()),agentIds:B(I()),pathId:I().optional(),blockedReason:I().optional()}).loose(),Xye=V({state:I(),strictness:B(U(ha)).optional()}).loose(),Zye=V({probes:V({env:U([`desktop`,`local-web`,`remote-web`]),satisfiers:H(I(),Xye)}).loose(),detection:V({detected:B(I()),probed:R()}).loose()}).loose();V({actions:B(Jye),conflicts:B(Yye),withheld:B(I()),snapshot:Zye}).loose(),V({entries:B(V({level:U([`info`,`warn`,`error`]),message:I().max(8192),event:I().optional(),fields:H(I(),z()).optional(),ts:L().optional(),sourceId:I().optional(),lineNumber:L().optional()}).loose()).max(100),droppedSinceLastFlush:L().int().min(0).optional()}).loose(),V({accepted:L().int().min(0)}).loose();const Qye=V({exact:I().min(1),prefix:I(),suffix:I(),start:L().int().nonnegative(),end:L().int().nonnegative()}),$ye=B(Qi([I(),L().int().nonnegative()])),ebe=$i(`kind`,[V({kind:W(`body`)}),V({kind:W(`property`),key:I().min(1),path:$ye.default([])})]).default({kind:`body`}),tbe=U([`anchored`,`orphaned`,`resolved`]),vq=V({threadId:I().min(1),docName:I().min(1),target:ebe,anchor:Qye.nullable(),state:tbe,queued:R(),latestComment:I(),createdBy:I().min(1),createdAt:L(),updatedAt:L().optional()}),yq=V({docName:I(),instruction:I(),property:I().nullable(),passage:V({exact:I(),prefix:I(),suffix:I()}).nullable(),anchorLost:R(),passageRepeats:R()}).loose(),bq=V({threadId:I(),ok:W(!0)}),xq=V({threadId:I(),ok:W(!1),error:W(`not-found`)});V({threads:B(vq)}).loose(),V({meta:vq,orphaned:R()}).loose(),V({threadId:I()}).loose(),V({meta:vq,payload:yq}).loose(),V({results:B(Qi([bq.extend({meta:vq,payload:yq}),xq]))}).loose(),V({results:B(Qi([bq.extend({meta:vq}),xq]))}).loose();const Sq=[`ours`,`theirs`],Cq=[`check-failed`,`too-large`,`conflict-markers`,`no-base`,`no-merge-engine`,`outside-settings-applied`,`outside-settings-invalid`],nbe=[`no-history-or-backup`,`keeps-changing`,`not-utf8`,`unreadable`],rbe=V({duplicated:L().int().nonnegative(),restoredDeletedHere:L().int().nonnegative(),restoredDeletedOutside:L().int().nonnegative()}),wq={id:I().min(1),docName:I().min(1),file:I().min(1),firstAt:I().min(1),lastAt:I().min(1),events:L().int().positive(),entries:B(I().min(1))},Tq=$i(`kind`,[V({...wq,kind:W(`both-kept`),kept:rbe}).loose(),V({...wq,kind:W(`moved-to-history`),side:U(Sq),reason:U(Cq)}).loose(),V({...wq,kind:W(`moved-to-backup`),side:U(Sq),reason:U(Cq),backup:I().min(1)}).loose(),V({...wq,kind:W(`save-held`),cause:U(nbe)}).loose()]);V({notices:B(Tq)}).loose(),V({docName:I().min(1),id:I().min(1)}).loose(),V({dismissed:R()}).loose();const ibe=V({status:I().min(1),reason:I()}).loose();V({docName:I().min(1),content:I(),lifecycle:ibe.nullable()}).loose(),V({documents:B(V({kind:U([`document`,`asset`,`folder`,`file`]).default(`document`),docName:I().min(1).optional(),docExt:I().min(1).default(`.md`),size:L().int().nonnegative(),modified:I().min(1),isSymlink:R().default(!1),canonicalDocName:I().nullable().default(null),targetPath:I().nullable().default(null),path:I().min(1).optional(),assetExt:I().min(1).optional(),mediaKind:U([`image`,`video`,`audio`,`pdf`,`text`,`mermaid`,`excalidraw`]).nullable().optional(),referencedBy:B(I().min(1)).optional(),hasChildren:R().optional()}).loose().refine(e=>e.kind===`document`?e.docName!==void 0&&e.path===void 0&&e.assetExt===void 0&&e.mediaKind===void 0&&e.referencedBy===void 0&&e.hasChildren===void 0:e.kind===`folder`?e.docName===void 0&&e.path!==void 0&&e.assetExt===void 0&&e.mediaKind===void 0&&e.referencedBy===void 0:e.kind===`file`?e.path!==void 0&&e.mediaKind===void 0&&e.referencedBy===void 0&&e.hasChildren===void 0:e.path!==void 0&&e.assetExt!==void 0&&e.referencedBy!==void 0&&e.hasChildren===void 0,{message:`document/asset/folder/file kind must match its required fields (document → docName; asset → path+assetExt+referencedBy; folder → path only, no docName; file → path, no mediaKind/referencedBy/hasChildren)`})),truncated:R().optional()}).loose();const abe=V({source:I().min(1),anchor:I().nullable(),title:I(),snippet:I().nullable()}).loose();V({docName:I().min(1),backlinks:B(abe)}).loose(),V({counts:H(I().min(1),L().int().nonnegative())}).loose(),V({counts:H(I().min(1),L().int().nonnegative())}).loose();const obe=$i(`kind`,[V({kind:W(`doc`),docName:I().min(1),anchor:I().nullable(),title:I(),snippet:I().nullable()}).loose(),V({kind:W(`external`),url:I().min(1),title:I(),snippet:I().nullable()}).loose()]),sbe=V({role:I().min(1),sourceForm:I().min(1),targetKind:I().min(1),href:I(),resolvedTarget:I().nullable(),status:I().min(1),reason:I().nullable(),resolutionMethod:I().min(1),fallbackTarget:I().nullable().default(null),range:V({start:L().int().nonnegative(),end:L().int().nonnegative()}),line:L().int().nonnegative(),column:L().int().nonnegative(),definition:V({label:I(),line:L().int().nonnegative()}).nullable().default(null)}).loose();V({docName:I().min(1),forwardLinks:B(obe),localTargets:B(sbe).optional()}).loose();const cbe=$i(`kind`,[V({id:I().min(1),kind:W(`doc`),docName:I().min(1),anchor:I().nullable(),label:I(),cluster:I().nullable(),category:I().nullable(),tags:B(I()).nullable(),managed:R().optional()}).loose(),V({id:I().min(1),kind:W(`external`),url:I().min(1),label:I()}).loose()]),lbe=V({source:I().min(1),target:I().min(1)}).loose();V({nodes:B(cbe),links:B(lbe)}).loose(),V({docNames:B(I().min(1).max(1024)).min(1).max(64)}).loose(),V({checked:L().int().nonnegative(),found:L().int().nonnegative()}).loose();const ube=V({ts:L().int().min(0),url:I(),method:I(),ua:I().optional(),origin:I().optional(),referer:I().optional(),host:I().optional(),remote:I().optional(),secChUa:I().optional(),secChUaMobile:I().optional(),secChUaPlatform:I().optional(),secFetchSite:I().optional(),secFetchDest:I().optional(),secFetchMode:I().optional(),secFetchUser:I().optional()}).loose(),dbe=V({app:Qi([W(`cursor`),W(`codex`),W(`claude`),Ki()]),signals_fired:B(I())}).loose();V({entries:B(ube),count:L().int().min(0),detection:dbe}).loose();const Eq=V({path:I().min(1),code:U([`M`,`A`,`D`,`R`,`C`,`U`,`T`,`?`,`!`,` `]),origPath:I().min(1).optional(),syncScoped:R(),open:$i(`kind`,[V({kind:W(`doc`),docName:I().min(1)}),V({kind:W(`asset`),path:I().min(1)})]).optional()}).loose();V({branch:I().nullable(),detached:R(),upstream:I().nullable(),staged:B(Eq),notStaged:B(Eq),untracked:B(Eq),incoming:B(Eq),truncated:R(),readable:R().default(!0)}).loose();const fbe=U([`AWAITING_CHECKS`,`LOCKED`,`MERGEABLE`,`QUEUED`,`UNMERGEABLE`]),pbe=U([`BEHIND`,`BLOCKED`,`CLEAN`,`DIRTY`,`DRAFT`,`HAS_HOOKS`,`UNKNOWN`,`UNSTABLE`]),mbe=U([`APPROVED`,`CHANGES_REQUESTED`,`REVIEW_REQUIRED`]),hbe=U([`ERROR`,`EXPECTED`,`FAILURE`,`PENDING`,`SUCCESS`]),gbe=V({mergeQueue:V({position:L().int().nonnegative(),state:fbe.nullable().catch(null)}).nullable().catch(null),autoMerge:R(),mergeState:pbe.nullable().catch(null),reviewDecision:mbe.nullable().catch(null),checks:hbe.nullable().catch(null)}).loose(),_be=V({kind:U([`pull`,`issue`]),repo:I().min(1),number:L().int().positive(),title:I(),author:I().nullable(),createdAt:I(),lifecycle:U([`open`,`draft`,`merged`,`closed`,`completed`,`not-planned`]),additions:L().int().nonnegative().optional(),deletions:L().int().nonnegative().optional(),status:gbe.optional()}).loose();V({url:I()}).loose(),$i(`ok`,[V({ok:W(!0),preview:_be}).loose(),V({ok:W(!1),reason:I()}).loose()]),V({writers:B(V({id:I().min(1),name:I().optional(),email:I().optional()}).loose()).optional(),summary:nf,...tf}).loose(),V({checkpointRef:I().min(1)}).loose();const vbe=V({v:L().int().optional(),id:I().min(1),name:I().min(1),colorSeed:I().optional(),docs:B(I()),summaries:B(I()).optional()}).loose();V({entries:B(V({sha:I().min(1),timestamp:I().min(1),author:I(),authorEmail:I(),type:U([`checkpoint`,`wip`,`upstream`,`park`]),message:I(),contributors:B(vbe),checkpoint:z().nullable(),parentSha:I().nullable().optional()}).loose()),total:L().int().nonnegative().optional(),truncated:R().optional(),hasMore:R().optional()}).loose(),V({sha:I().regex(/^[0-9a-f]{40}$/i),content:I(),timestamp:I(),author:I()}).loose(),V({contentDir:I().min(1),pathSeparator:U([`/`,`\\`]),symlinkResolved:R()}).loose(),B($i(`source`,[V({docName:I().min(1),timestamp:I().min(1),size:L().int().nonnegative(),source:W(`flat`)}).loose(),V({docName:I().min(1),timestamp:I().min(1),source:W(`timeline`),sha:I().min(1)}).loose()])).meta({description:"Flat array of rescue buffer entries; discriminated via `source`."});const ybe=V({domain:I().min(1),title:I().optional(),description:I().optional(),siteName:I().optional(),faviconDataUri:I().optional()}).loose();V({url:I()}).loose(),$i(`ok`,[V({ok:W(!0),metadata:ybe}).loose(),V({ok:W(!1),reason:I()}).loose()]),V({orphans:B(V({docName:I().min(1),title:I()}).loose())}).loose(),V({hubs:B(V({docName:I().min(1),title:I(),count:L().int().nonnegative()}).loose())}).loose();const bbe=V({source:I().min(1),title:I(),snippet:I().nullable()}).loose();V({deadLinks:B(V({target:I().min(1),sources:B(bbe)}).loose())}).loose(),V({target:V({docName:I().min(1),title:I(),aliases:B(I())}).loose(),mentions:B(V({source:I().min(1),excerpt:I(),offset:L().int().nonnegative()}).loose()),truncated:R()}).loose(),V({projectPath:I().min(1)}).loose();const xbe=U([`not-a-git-worktree`,`init-failed`]);$i(`ok`,[V({ok:W(!0),projectPath:I().min(1)}).loose(),V({ok:W(!1),reason:xbe,message:I().min(1)}).loose()]),V({host:I().min(1).optional()}).loose(),V({host:I().min(1).optional(),token:I().min(1)}).loose(),V({host:I(),login:I()}).loose(),V({host:I().refine(kc,{message:`Host must be a hostname with an optional :port, with no scheme or path`}),username:I().min(1),token:I().min(1)}).loose(),V({host:I(),login:I()}).loose(),V({key:I().min(1)}).loose(),V({keyPresent:R()}).loose();const Sbe=U([`no_key`,`invalid_endpoint`,`rate_limit`,`timeout`,`http_error`,`network`,`dims_mismatch`,`malformed_response`]);$i(`ok`,[V({ok:W(!0),endpoint:I().min(1),model:I().min(1),dimensions:L().int().positive()}).loose(),V({ok:W(!1),endpoint:I().min(1),model:I().min(1),reason:Sbe,status:L().int().optional()}).loose()]),V({name:I().refine(e=>e.trim().length>0,{message:`name must be non-empty`}),email:I().refine(e=>e.trim().length>0,{message:`email must be non-empty`})}).loose(),V({authenticated:R()}).loose(),V({channel:U([`login`,`gh-login`]).default(`login`)}).loose(),V({}).loose();const Cbe=V({stackIndex:L().int().min(0),ts:L().int().min(0),additions:L().int().min(0),deletions:L().int().min(0)}).loose(),wbe=V({docName:I().min(1),additionsTotal:L().int().min(0),deletionsTotal:L().int().min(0),lastTs:L().int().min(0),bursts:B(Cbe)}).loose(),Tbe=V({displayName:I().min(1),color:I().min(1),icon:I().optional(),connectionId:I().min(1)}).loose();V({sessionAlive:R(),agent:Tbe.nullable(),files:B(wbe)}).loose(),V({diff:I(),before:I(),after:I(),properties:dP,generatedAt:L().int().min(0)}).loose(),V({}).loose(),V({}).loose(),V({}).loose(),V({}).loose(),V({}).loose(),V({}).loose();const Ebe=V({displayName:I().min(1),icon:I(),color:I().min(1),currentDoc:I().nullable(),mode:U([`idle`,`writing`]),ts:L().int().min(0)}).loose();V({presence:H(I().min(1),Ebe)}).loose();const Dbe=V({sessionId:I().min(1),agentType:I().min(1),ts:L().int().min(0),insertedChars:L().int().min(0),deletedChars:L().int().min(0)}).loose();V({effects:B(V({"doc.name":I().min(1),entries:B(Dbe)}).loose())}).loose(),V({decisions:B(V({ts:L().int().min(0),decision:I().min(1),kind:I().min(1),"doc.name":I().min(1),pathRole:I().min(1)}).loose())}).loose(),H(I().min(1),R()).meta({description:`Flat boolean record keyed by agent-scheme name (claude / codex / cursor). True = installed.`}),V({path:I().min(1,`path must be non-empty`)}).loose(),V({}).loose();const Obe=V({fromDocName:I().min(1),toDocName:I().min(1)}).loose(),kbe=V({fromPath:I().min(1),toPath:I().min(1)}).loose();V({}).loose(),V({path:I().min(1),...tf,summary:nf}).loose(),V({docName:I().min(1)}).loose(),V({path:I().min(1),...tf,summary:nf}).loose(),V({path:I().min(1)}).loose(),V({kind:U([`file`,`folder`]),path:I().min(1),...tf,summary:nf}).loose(),V({kind:U([`file`,`folder`]),path:I().min(1),duplicatedDocNames:B(I().min(1))}).loose(),V({pages:B(V({docName:I().min(1),title:I(),docExt:I().min(1),size:L().int().nonnegative(),modified:I().min(1),icon:I().min(1).max(2048).optional()}).loose())}).loose();const Abe=V({level:L().int().min(1).max(6),text:I(),slug:I()}).loose();V({docName:I().min(1),headings:B(Abe)}).loose();const jbe=V({docName:I().min(1),rewrites:L().int().nonnegative()}).loose();V({kind:U([`file`,`folder`,`asset`]),fromPath:I().min(1),toPath:I().min(1),...tf,summary:nf}).loose(),V({renamed:B(Obe),renamedAssets:B(kbe),rewrittenDocs:B(jbe).optional(),summary:of.optional()}).loose(),V({kind:U([`file`,`folder`,`asset`]),path:I().min(1),...tf}).loose(),V({deletedDocNames:B(I().min(1))}).loose(),V({kind:U([`file`,`folder`,`asset`]),path:I().min(1),...tf,summary:nf}).loose(),V({deletedDocNames:B(I().min(1))}).loose(),V({docName:I().min(1),commitSha:I().regex(/^[0-9a-f]{40}$/i,{message:`commitSha must be a 40-char git SHA`}),summary:nf,...tf}).loose(),V({...af,restoredFrom:I().min(1),timestamp:I().min(1),summary:of.optional(),warnings:df.optional()}).loose();const Mbe=/^#[0-9a-fA-F]{6}$/,Nbe=V(Object.fromEntries(gl.map(e=>[e,I().regex(Mbe,`must be a #rrggbb hex color`)]))),Dq=I().min(1).refine(xl,{message:`must contain a non-whitespace character`}),Oq=V({name:Dq,author:Dq.optional(),variant:U([`dark`,`light`]),palette:Nbe}).loose();V({name:I().min(1),scheme:Oq,stem:I().min(1).optional(),extension:U([`.yaml`,`.yml`]).optional()}).loose(),V({id:I().min(1),filename:I().min(1)}).loose(),V({id:I().min(1),scheme:Oq}).loose(),V({id:I().min(1),filename:I().min(1)}).loose(),$i(`existed`,[V({existed:W(!1)}).loose(),V({existed:W(!0),filename:I().min(1),scheme:Oq}).loose()]),V({themes:B($i(`ok`,[V({ok:W(!0),id:I().min(1),filename:I().min(1),scheme:Oq}),V({ok:W(!1),filename:I().min(1),id:I().min(1).optional(),code:I().min(1),conflictingFilenames:B(I().min(1)).min(2).optional()})])),truncated:R()}).loose();function Pbe(e){return e.replace(/\\/g,`/`).split(`/`).filter(e=>e!==``&&e!==`.`)}function Fbe(e){let t=Pbe(e).at(-1);return t!==void 0&&Ic.some(e=>t.toLowerCase().endsWith(e))}V({tags:B(V({name:I().min(1),count:L().int().nonnegative(),isLeaf:R()}).loose())}).loose();const Ibe=V({docName:I().min(1),title:I(),matchingTags:B(I().min(1)),snippet:I().nullable()}).loose();V({name:I().min(1),docs:B(Ibe)}).loose(),V({folder:z(),frontmatter_local:H(I(),z()).nullable(),warnings:B(I()).optional().meta({description:"Non-fatal degradations of this response, one per entry; the field each affects is absent, null, or incomplete — the aligned `warningCodes` entry names which field and how."}),warningCodes:B(U([`symlink-refused`,`malformed-yaml`,`unverifiable`,`templates-symlink-refused`,`templates-unverifiable`])).optional().meta({description:"Machine-readable codes aligned 1:1 with `warnings`; switch on these, never on the English. `symlink-refused` / `malformed-yaml` / `unverifiable`: this folder's own `.ok/frontmatter.yml` (a symlink, malformed YAML, or an lstat failure) — `frontmatter_local` is null. `templates-symlink-refused` / `templates-unverifiable`: the `.ok/templates` directory on this folder, or a `.ok` or `.ok/templates` directory on an ancestor it inherits from — a symlink (wherever it points, dangling included), or a non-ENOTDIR `lstat` failure — `folder.templates_available` omits that directory's templates and may still list others. A non-directory `.ok` / `.ok/templates` (ENOTDIR) is treated as empty and yields no `templates-*` code. This folder's own symlinked `.ok` is a 400, never a warning."})}).loose(),V({path:I(),frontmatter:so(z()).optional()}).loose(),V({applied:z()}).loose();const kq=H(I(),z()).meta({description:`Free-form frontmatter map embedded in template payloads.`});V({template:V({name:I().min(1),folder:I(),scope:U([`local`,`inherited`]),path:I().min(1),frontmatter:kq,body:I()}).strict()}).strict(),V({templates:B(V({name:I().min(1),title:I().optional(),description:I().optional(),path:I().min(1),source_folder:I()}).strict()),truncated:R()}).strict(),V({folder:I(),name:I(),body:Qd.optional(),frontmatter:kq.optional(),...tf,summary:nf}).strict(),V({...af,path:I().min(1),created:R(),warnings:B(I())}).strict(),V({sourcePath:I().min(1),targetFolder:I(),name:I().optional(),title:I().optional(),deleteSource:R().optional(),...tf,summary:nf}).strict(),V({...af,path:I().min(1),created:R(),warnings:B(I())}).strict(),V({existed:R(),path:I().min(1)}).strict(),V({fromFolder:I(),fromName:I(),toFolder:I(),toName:I(),body:Qd.optional(),frontmatter:kq.optional(),...tf,summary:nf}).strict(),V({from:I().min(1),to:I().min(1),committed:R()}).strict();const Aq=U(zd),Lbe=/^[a-z0-9-]+$/,jq=V({name:I(),description:I(),metadata:V({pack:I()}).strict().optional()}).strict();V({skill:V({name:I().min(1),scope:Aq,path:I().min(1),frontmatter:jq,body:I(),files:B(V({path:I().min(1),text:I().nullable()})).optional(),managed:R().optional()}).strict()}).strict();const Rbe=V({source:I().min(1),publisher:I().optional(),skill:I().optional(),marketplaceUrl:I().optional(),importedAt:I().min(1),autoUpdate:R().optional()}).strict(),zbe=V({name:I().min(1),description:I().optional(),scope:Aq,path:I().min(1),canonicalPath:I().min(1).optional(),filePaths:B(I()).optional(),absolutePath:I().min(1).optional(),installed:R(),hosts:B(I()),hostQualifier:I().optional().meta({description:"Set on a GLOBAL entry that shares its name with a distinct-content bundle in another host dir AND is not the by-name default: the host id whose root holds THIS bundle. Doc-name builders append it (`__skill__/global/<name>@<host>`) so each same-named bundle keeps its own tab and its own write-back path; the default bundle keeps the stable unqualified name."}),driftPaths:B(I()).optional().meta({description:`Recorded locations whose on-disk form (copy vs symlink) no longer matches what OK last wrote there — evidence another tool rewrote the path.`}),hostAliases:H(I(),I()).optional().meta({description:`Host skills roots that are symlink ALIASES of another location (host id → base-relative target root). An aliased folder is a derived view — no menu row, never a write target; the host's icon rides the target root's row.`}),conflictHosts:B(I()).optional().meta({description:`Hosts whose dir holds a DIFFERENT same-name skill (fork/conflict) — occupied, not this skill.`}),symlinkedHosts:B(I()).optional(),installableEditors:B(I()).optional(),hubOffered:R().optional().meta({description:"Whether the vendor-neutral `.agents/skills` hub is a live destination at this scope on THIS machine — server-computed via the same predicate that filters the Folders surface, so the install menu and Settings cannot disagree. True when the project already uses the hub OR a host that reads it is installed (`HUB_READER_EDITORS`)."}),linkMode:R().optional(),customPlacements:B(V({path:I(),mode:U([`copy`,`link`])}).strict()).optional(),plugin:V({name:I().min(1),marketplace:I().min(1),provider:I().min(1),url:I().optional()}).strict().optional(),managed:R().optional(),origin:Rbe.optional(),pack:I().optional(),modified:R().optional(),revertable:R().optional(),ignored:R().optional(),size:qye.optional()}).strict();V({name:I().min(1),scope:Aq,apply:R().optional()}).strict(),V({line:I().min(1),gitignorePath:I().min(1),applied:R(),alreadyTracked:R().optional()}).strict(),V({skills:B(zbe),truncated:R()}).strict(),V({scope:Aq.default(`project`),name:I().meta({description:`Managed skill name to create or update.`}),body:Qd.optional(),frontmatter:jq,...tf,summary:nf}).strict();const Mq=[`skill-name-vendor-word`,`skill-body-too-long`],Nq=B(U(Mq)).meta({description:"Machine-readable codes aligned 1:1 with `warnings` (`warnings[i]` is the display text for `warningCodes[i]`)."});V({...af,path:I().min(1),created:R(),warnings:B(I()),warningCodes:Nq}).strict(),V({scope:Aq.default(`project`),name:I(),dryRun:R().optional(),setAutoUpdate:R().optional(),...tf,summary:nf}).strict(),V({name:I().min(1),updated:R(),source:I().min(1),localBody:I().optional(),upstreamBody:I().optional(),gitTracked:R().optional(),warnings:B(I()),warningCodes:Nq}).strict(),V({scope:Aq.default(`project`),name:I(),...tf,summary:nf}).strict(),V({name:I().min(1),baselineRef:I().min(1),restoredFiles:B(I()),warnings:B(I())}).strict();const Pq=`This member also carries the one bookkeeping failure that does not undo the operation: the content change landed, but a state file this server keeps beside it refused to be rewritten because it could not be read, so the install or import records still describe the old state until an operator repairs that file. Absent when there is nothing to report; a server that predates this member omits it, so treat its absence as no warning rather than as an error.`;V({existed:R(),path:I().min(1),warnings:B(I()).optional().meta({description:`Present when this delete removed a directory a retention record ties to a recovery copy an earlier failed move kept, whose source was never verified unchanged — either because this server verified the deleted directory against the copy that record describes, or because it could not read the directory and so could not confirm either way. Each entry says which of the two it is; neither claims more than the check established. ${Pq}`})}).strict(),V({scope:Aq.default(`project`),fromName:I(),toName:I(),body:Qd.optional(),frontmatter:jq.optional(),...tf,summary:nf}).strict(),V({from:I().min(1),to:I().min(1),committed:R(),warnings:B(I()).optional().meta({description:`Present when the rename itself completed but something beside it did not. ${Pq}`})}).strict(),V({name:I(),toName:I().optional().meta({description:"Name for the skill at the destination scope; defaults to `name`. The SKILL.md `name` frontmatter is rewritten to match."}),fromScope:Aq,toScope:Aq,...tf,summary:nf}).strict(),V({scope:Aq,path:I().optional(),droppedLocations:B(I()).default([]).meta({description:"Locations the skill occupied at the source that were removed and not re-created at the destination: the `agents` hub and custom roots, which projection does not cover. Entries are install location ids, so they can be passed straight back as an install `add` list with `scope` set to the destination scope; custom roots resolve against that scope's base."}),warnings:B(I()).optional().meta({description:`Present when the move itself completed but something beside it did not. ${Pq}`})}).strict().meta({description:"Scope-move result. Rename paths deliberately do not emit authoring warnings, consistent with same-scope rename and duplicate. Content-authoring and import responses carry those warnings and their codes. The Skills Studio client parses `droppedLocations` off the wire but deliberately does not render it yet; how a human is told what was removed is an open product decision."}),V({scope:Aq,name:I(),toName:I(),...tf,summary:nf}).strict(),V({name:I().min(1)}).strict(),V({name:I(),home:I().min(1)}).strict(),V({docName:I().min(1)}).strict();const Fq=U([`reference`,`script`,`file`]);V({scope:Aq.default(`project`),name:I(),path:I().min(1),content:I(),...tf,summary:nf}).strict().superRefine((e,t)=>{Fbe(e.path)&&Zd(e.content,t,[`content`])}),V({...af,path:I().min(1),created:R(),kind:Fq,content:R()}).strict(),V({scope:Aq.default(`project`),name:I(),from:I().min(1),to:I().min(1),...tf,summary:nf}).strict(),V({from:I().min(1),to:I().min(1),fromDocName:I().optional(),toDocName:I().optional()}).strict(),V({path:I().min(1),kind:Fq,text:I()}).strict(),V({path:I().min(1),existed:R(),kind:Fq}).strict();const Iq=Qi([Kye,W(`agents`)]),Lq=I().min(1).refine(e=>!e.startsWith(`/`)&&!e.startsWith(`~`)&&!/^[A-Za-z]:/.test(e),{error:`a custom root is base-relative (e.g. ".tim/skills"), not absolute or ~-prefixed`}).refine(e=>e.split(`/`).every(e=>e!==``&&e!==`.`&&e!==`..`),{error:`a custom root may not contain "..", "." or empty path segments`}).refine(e=>e.includes(`/`),{error:`a custom root is a path (e.g. ".tim/skills") — bare editor names are host ids`}),Rq=Qi([Iq,Lq]);V({scope:Aq.default(`project`),name:I(),targets:B(Iq).optional().meta({description:'SET-EXACT install targets (editor ids, plus "agents" for the .agents hub — in-place skills only): the COMPLETE resulting host set. Omit to use project-configured editors; pass [] to uninstall everywhere. Stateless callers should prefer `add`/`remove`.'}),add:B(Rq).optional().meta({description:`Locations to ADD the skill to (everything else untouched). Editor ids fan out a managed copy/symlink; a custom root path (".tim/skills") places the bundle there.`}),remove:B(Rq).optional().meta({description:"Locations to REMOVE the skill from (lossless only — a hand-edited fork is refused, never deleted). The source cannot be removed; move it first with `source`."}),mode:U([`copy`,`link`]).optional().meta({description:`"link": one real folder (the source); every other location becomes a symlink to it. "copy": independent real folders, refreshed from the source until hand-edited (a hand-edit forks that copy). Converts existing locations losslessly. Omit to follow the form the skill already uses.`}),source:Rq.optional().meta({description:`Move the skill's REAL folder to this location (the old source becomes a symlink to it — never a removal). Sticky across rescans.`}),linkMode:R().optional(),setSource:I().min(1).optional(),place:V({dir:I().min(1).meta({description:`Project-relative directory the bundle dir is created under (e.g. ".windsurf/skills").`}),mode:U([`copy`,`link`])}).strict().optional(),convert:V({target:Rq.meta({description:`The installed location to convert — an editor id, "agents", or a recorded custom placement path.`}),mode:U([`copy`,`link`]).meta({description:`"link": replace this location with a symlink to the source. "copy": replace it with an independent real folder.`})}).strict().optional(),unplace:V({path:I().min(1).meta({description:`The recorded placement bundle path (e.g. ".windsurf/skills/my-skill").`})}).strict().optional(),...tf,summary:nf,fork:V({editor:I().min(1),action:U([`align`,`make-source`,`rename`]),toName:I().optional()}).strict().optional()}).strict().refine(e=>e.targets===void 0||e.add===void 0&&e.remove===void 0,{error:"`targets` is set-exact; `add`/`remove` are additive — use one style per call"}).refine(e=>e.fork===void 0||e.targets===void 0&&e.add===void 0&&e.remove===void 0&&e.source===void 0&&e.setSource===void 0,{error:"`fork` is its own operation — run it in a separate call"}).refine(e=>e.fork?.action!==`rename`||e.fork.toName!==void 0,{error:"`fork.rename` requires `toName`"}).refine(e=>e.source===void 0||e.add===void 0&&e.remove===void 0,{error:"a `source` move is its own operation — run it in a separate call from `add`/`remove`"}).refine(e=>[e.targets!==void 0||e.add!==void 0||e.remove!==void 0,e.place!==void 0,e.unplace!==void 0,e.convert!==void 0,e.source!==void 0||e.setSource!==void 0,e.fork!==void 0].filter(Boolean).length<=1,{error:"one operation per call — membership (`targets`/`add`/`remove`), `place`, `unplace`, `convert`, `source`, and `fork` are mutually exclusive"});const zq=[`no-targets`,`scripts-present`,`name-conflict`,`no-description`,`skill-fork-name-unpatched`,`place-path-invalid`,`place-fork-refused`,`links-not-permitted`];V({name:I().min(1).meta({description:`Managed skill name installed or uninstalled.`}),hosts:B(I()).meta({description:`Editor ids the skill is projected into after the operation; [] is expected after uninstall.`}),scripts:R().meta({description:`True when the skill ships executable scripts, projected but never run.`}),warnings:B(I()).meta({description:`Non-fatal install/uninstall warnings from target projection.`}),warningCodes:B(U(zq)).meta({description:"Machine-readable warning codes aligned with `warnings`."}),placedAt:I().optional(),sourceMovedTo:I().optional()}).strict(),V({scope:Aq.default(`project`),name:I().meta({description:`Managed skill name to uninstall without deleting source.`})}).strict(),V({name:I().min(1).meta({description:`Managed skill name requested for uninstall.`}),uninstalled:R().meta({description:`True when an install marker existed and was removed; false for an idempotent no-op.`})}).strict(),V({targets:B(_q),configured:R(),folders:B(V({scope:Aq,host:I(),root:I(),state:U([`own`,`linked`,`linked-parent`,`absent`]),target:I().optional(),drift:W(!0).optional(),expected:I().optional()}).strict()).optional()}).strict();const Bq=V({action:W(`link`),scope:Aq,root:I().min(1).meta({description:`The folder to link (e.g. ".codex/skills").`}),target:I().min(1).meta({description:`The root it merges into (e.g. ".agents/skills"). Required.`})}),Vq=V({action:W(`unlink`),scope:Aq,root:I().min(1).meta({description:`The linked folder to materialize back.`}),exclude:B(I().min(1)).optional().meta({description:`Skill names to LEAVE OUT when materializing — the folder keeps every other skill it currently sees (as per-skill links) and stops auto-following the target root.`})}).strict(),Hq=V({action:W(`add-root`),scope:Aq,root:Lq.meta({description:`New custom skills root to declare (base-relative, e.g. ".team/skills").`})}).strict(),Bbe=$i(`action`,[Bq.extend({preview:R().optional().meta({description:`Return the merge plan only (moves, drops, removes, conflicts, strays) — nothing is written.`})}).strict(),Vq,Hq]);$i(`action`,[Bq.strict(),Vq,Hq]),V({folderAction:Bbe}).strict();const Vbe=V({moves:B(I()),drops:B(I()),removes:B(I()),replaces:B(I()),conflicts:B(I()),strays:B(I())}).strict();V({targets:B(_q),reprojected:B(V({name:I(),hosts:B(I())}).strict()),bundleHosts:B(I()),removedFrom:B(I()),folder:V({moved:B(I()),dropped:B(I()),linked:B(I())}).strict().optional(),preview:Vbe.optional()}).strict(),V({scope:Aq.default(`project`),name:I(),version:I().regex(/^[0-9a-f]{40}$/i),...tf,summary:nf}).strict(),V({name:I().min(1),version:I(),restoredFiles:B(I()),warnings:B(I())}).strict(),V({query:I().optional(),intent:U([`autocomplete`,`full_text`,`omnibar`]).optional(),ranking:U([`navigation`,`relevance`]).optional(),scopes:B(U([`page`,`folder`,`content`,`file`])).optional(),scope:I().optional(),limit:L().int().nonnegative().optional(),semantic:R().optional(),source:U([`omnibar`,`mcp`,`http`]).optional()}).loose();const Hbe=V({kind:U([`page`,`folder`,`content`,`file`]),path:I().min(1),title:I(),score:L(),signals:H(I(),z()),snippet:I().optional()}).loose(),Ube=U([`applied`,`no_match`,`warming`,`incapable`,`provider_error`,`restart_required`,`query_too_short`]),Uq=U([`warm`,`corpus`,`query`,`dimensions`,`configured_dimensions`]),Wq=V({capable:R(),applied:R(),outcome:Ube,providerErrorReason:Uq.nullable().optional().catch(null),coverage:V({embedded:L().int().nonnegative(),total:L().int().nonnegative()})}).loose();V({enabled:R(),keyPresent:R(),keyNotRequired:R(),keySource:U([`project`,`file`,`env`]).nullable(),keyHint:I().nullable(),ready:R(),capable:R(),providerError:R().optional(),providerErrorReason:Uq.nullable().optional().catch(null),embedded:L().int().nonnegative(),total:L().int().nonnegative()}).loose(),V({query:I(),intent:U([`autocomplete`,`full_text`,`omnibar`]),results:B(Hbe),elapsedMs:L().nonnegative(),semantic:Wq.optional(),truncated:R().optional(),ready:R().optional()}).loose();const Wbe=V({version:I().min(1),recordedAt:I().min(1)}).loose();V({currentVersion:I().min(1),targets:H(I(),Wbe.nullable())}).loose(),V({scope:Aq.default(`project`),source:I().min(1).meta({description:`External skill source: full skills.sh skill-page URL (https://www.skills.sh/<owner>/<repo>/<skill>, or https://www.skills.sh/site/<hostname>/<skill> for a website catalog), GitHub owner/repo[/subpath], git URL, or local/file path.`}),skill:I().min(1).optional().meta({description:`Specific skill name to import from a multi-skill source.`}),install:R().optional().meta({description:`Pass false to import WITHOUT the default-editor auto-projection (the caller installs explicitly afterwards). Default true.`}),marketplace:R().optional().meta({description:"The source came from a skills.sh listing the user chose (the Explore tab), so the install is reported to skills.sh and counts toward that listing. Off by default: a hand-typed repo must not be announced to skills.sh. Honors the `telemetry.skillInstallReports.enabled` setting and DO_NOT_TRACK."}),...tf,summary:nf}).strict(),V({scope:Aq.default(`project`),source:I().min(1).meta({description:`External skill source: full skills.sh skill-page URL, GitHub owner/repo[/subpath], git URL, or local/file path.`}),skills:B(I().min(1)).min(1).max(100).meta({description:`Skill names to import from the source.`}),install:R().optional().meta({description:`Pass false to import WITHOUT the default-editor auto-projection. Default true.`}),marketplace:R().optional().meta({description:"The source came from a skills.sh listing the user chose (a marketplace plugin bundle), so the import is reported to skills.sh as one batched install event and counts toward that listing. Off by default: a hand-typed repo must not be announced to skills.sh. Honors the `telemetry.skillInstallReports.enabled` setting and DO_NOT_TRACK."}),...tf,summary:nf}).strict(),V({results:B(V({requested:I(),status:U([`imported`,`already-imported`,`not-found`,`failed`]),name:I().optional(),collisionRenamedFrom:I().optional(),warnings:B(I()),warningCodes:Nq,error:I().optional()}).loose()),imported:L(),alreadyImported:L(),failed:L()}).loose(),V({scope:Aq.default(`project`),names:B(I().min(1)).min(1).max(100).meta({description:`Managed skill names to refresh from their recorded upstreams.`}),...tf,summary:nf}).strict(),V({results:B(V({requested:I(),status:U([`updated`,`up-to-date`,`not-found`,`failed`]),source:I().optional(),warnings:B(I()),warningCodes:Nq,error:I().optional()}).loose()),updated:L(),upToDate:L(),failed:L()}).loose();const Gbe=V({source:I(),ref:I().optional(),contentHash:I(),publisher:I().optional()}).loose();V({name:I().min(1).meta({description:`Managed skill name created or matched.`}),path:I().min(1).meta({description:`Store-relative path to the imported skill source.`}),created:R().meta({description:`True when this request created new source files.`}),alreadyImported:R().meta({description:`True when identical content was already present and no files changed.`}),collisionRenamedFrom:I().optional().meta({description:`Original source name when collision handling renamed the import.`}),provenance:Gbe,warnings:B(I()).meta({description:`Non-fatal import warnings, such as skipped unsupported files.`}),warningCodes:Nq}).loose();const Kbe=U([`files`,`backlinks`,`graph`,`sync-status`,`session-activity`,`tags`,`comments`,`lint-config`,`local-targets`]);V({v:W(1),ch:W(`server-info`),seq:L(),serverInstanceId:I().min(1),currentBranch:I().min(1).optional()}).loose(),V({v:W(1),ch:W(`branch-switched`),seq:L(),branch:I().min(1)}).loose(),V({v:W(1),ch:Kbe,seq:L()}).loose(),V({v:W(1),ch:W(`disk-ack`),seq:L(),docName:I().min(1),sv:I().min(1)}).loose(),V({v:W(1),ch:W(`config-validation-rejected`),seq:L(),docName:I().min(1),error:bae}).loose(),V({v:W(1),ch:W(`config-ignore-nested-error`),seq:L(),path:I().min(1),error:I().min(1)}).loose(),(()=>{let e=globalThis.Intl.Segmenter;return e?new e(`en`,{granularity:`word`}):null})();const qbe=Xi({name:I(),description:I(),files:Xi({skillMd:I(),scripts:B(I()),references:B(I())})}),Jbe=Xi({pluginProvider:I().optional(),plugin:I().optional(),marketplace:I().optional(),repositoryUrl:I().optional(),version:I().optional(),gitCommitSha:I().optional(),scope:I().optional(),projectPath:I().optional()}),Ybe=Xi({commands:R(),hooks:R(),mcp:R()}),Xbe=Xi({...qbe.shape,sourceHarness:I(),sourceHarnesses:B(I()),home:I(),provenance:Jbe,inert:Ybe,outsideProject:R().optional()}),Zbe=Xi({schema:W(1),name:I(),version:I(),description:I().optional(),author:Xi({name:I()}).optional(),skills:B(I()),hostCompatibility:B(I()).optional(),capabilities:Xi({scripts:I(),network:I(),inert:B(I())}).optional(),provenance:Xi({source:I(),ref:I(),contentHash:I()}).optional()});V({skills:B(Xbe),packs:B(Zbe)}).loose(),V({results:B(V({id:I().min(1),name:I().min(1),source:I().min(1),description:I(),installs:L().int().nonnegative().nullable(),publisher:I().nullable()}).loose()),backend:U([`skills.sh`,`github-fallback`]),degraded:R()}).loose(),V({title:I(),description:I(),image:I().nullable(),skillsUrl:I().nullable(),sourceKind:U([`github`,`site`]),sourceUrl:I()}).loose(),V({skills:B(V({name:I(),description:I().nullable()}).loose())}).loose(),V({kind:U([`local`,`import`,`none`]),scope:U(zd).optional(),name:I().optional(),dir:I().optional(),source:I().optional(),ref:I().optional(),via:U([`source`,`publisher`]).optional()}).loose();const Qbe=V({relPath:I(),content:I().nullable()}).loose(),$be=V({provider:I(),plugin:I(),version:I().optional(),marketplace:I().optional(),repositoryUrl:I().optional()}).loose(),exe=V({provider:I(),plugin:I(),version:I().optional(),description:I().optional(),repositoryUrl:I().optional(),bundledSkills:B(I()),capabilities:V({commands:R(),hooks:R(),mcp:R(),agents:R()}),setupSupported:R()}).loose();V({name:I(),description:I().nullable(),skillMd:I(),files:B(Qbe),plugin:$be.optional(),pluginBundle:exe.optional()}).loose();const txe=[`auth-error`,`detached-head`,`dirty-tree`,`diverged-local-commits`,`external-changes-pending`,`git-index-locked`,`git-operation-in-progress`,`no-commits-yet`,`no-push-permission`,`non-content-merge-failure`,`protected-branch`,`unsafe-incoming-symlinks`],Gq=e=>e*8+4;Gq(92),Gq(40),(()=>{let e=globalThis.Intl.Segmenter;return e?new e(void 0,{granularity:`grapheme`}):null})(),Array.from({length:256},(e,t)=>(t+256).toString(16).slice(1));const Kq={fileSystem:`File System`,gitUpstream:`Git (upstream)`,service:`OpenKnowledge (service)`,generator:`OpenKnowledge (generated)`},qq=`state/bug-reports`,nxe=Xi({at:I(),transport:I(),outcome:I(),reference:I().optional(),error:I().optional(),errorCode:I().optional()}),rxe=Xi({reason:I(),at:I(),errorCode:I().optional()});Xi({version:L().int().catch(1),id:I(),createdAt:I(),bundleLevel:I(),zipBytes:L().int().nonnegative().catch(0),zipDeleted:R().optional(),state:I(),systemWide:R().optional(),projectSlug:I().nullable().optional(),reference:I().optional(),lastError:rxe.optional(),attempts:B(nxe).optional(),note:I().optional()}),Xi({version:L().int().catch(1),id:I().optional(),sentAt:I().optional(),reference:I().optional()});const ixe=new Map([[`PORT`,[`server`,`port`]],[`OK_BIND`,[`server`,`bind`]],[`OK_EXTERNAL_URL`,[`server`,`externalUrl`]],[`OK_ALLOW_EXTERNAL`,[`server`,`allowExternal`]],[`OK_OPEN_BROWSER`,[`server`,`openBrowser`]],[`OK_IDLE_SHUTDOWN`,[`server`,`idleShutdown`]]]);function axe(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1_$2`).toUpperCase()}function oxe(e){return`OK_${(e[0]===`server`?e.slice(1):e).map(axe).join(`_`)}`}function sxe(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function cxe(e){let{value:t,file:n,source:r,doc:i}=e,a=[],o=(e,t)=>{if(t.length>0){let e=tu(eu,t);if(e!==void 0){if(e.scope===`project-local`){let e=oxe(t),o;i!=null&&r!=null&&n!=null&&(o=cd({file:n,source:r,doc:i,path:t})),a.push({path:[...t],...ixe.has(e)?{envVar:e}:{},...o===void 0?{}:{source:o}})}return}}if(sxe(e))for(let[n,r]of Object.entries(e))o(r,[...t,n])};return o(t,[]),a}const Jq=`(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)`;RegExp(`^127\\.${Jq}\\.${Jq}\\.${Jq}$`);function Yq(e,t){return e===`unix-chain`?`# ok-mcp${t}-v`:`# ok-mcp${t}-win-v`}function Xq(e){return e.replace(/\/+/g,`/`).replace(/\/+$/,``)}function lxe(e){return it[e].userHomeDirName}function uxe(e,t,n=`darwin`,r){return e===`stable`?n===`linux`?`${Xq(r?.startsWith(`/`)?r:`${Xq(t)}/.config`)}/OpenKnowledge/path-install.json`:`${Xq(t)}/Library/Application Support/OpenKnowledge/path-install.json`:`${Xq(t)}/${lxe(e)}/path-install.json`}const dxe=[`.ok`,xd,`installed-skills.json`],fxe=U(zd),pxe=Xi({hosts:B(I()),scope:fxe,scripts:R(),installedAt:Ti(),projection:U([`symlink`,`copy`]).optional(),contentHash:I().optional()}),mxe=Xi({schema:W(1),skills:H(I(),pxe).default({})});function hxe(e){let t;try{t=JSON.parse(e)}catch{return null}let n=mxe.safeParse(t);return n.success?n.data:null}function Zq(e){if(e===``)throw Error(`toPathspec: empty path. ":(literal)" is an empty pattern that matches every tracked path; pass "." if you meant the repo root.`);return`:(literal)${e}`}function gxe(e){if(e.length===0)throw Error(`pathspecArgs: empty path list. A bare "--" removes the pathspec restriction rather than selecting nothing.`);return[`--`,...e.map(e=>Zq(e))]}const Qq=[{tagName:`Mirror`,attrName:`src`,resolution:`bare-doc-name`},{tagName:`Excalidraw`,attrName:`src`,resolution:`doc-relative`}];for(let e of Qq){let t=PB.find(t=>t.name===e.tagName);if(!t)throw Error(`JSX_SRC_REF_TAGS: no built-in component descriptor named '${e.tagName}' — the rename-rewrite and backlink passes for this entry would silently never match. Fix the tagName to match a descriptor in builtInComponents.`);if(!t.props.some(t=>t.name===e.attrName))throw Error(`JSX_SRC_REF_TAGS: component '${e.tagName}' declares no prop named '${e.attrName}' — the rename-rewrite and backlink passes for this entry would silently never match. Fix the attrName to match one of the descriptor's props.`)}QV(),gV(),_V();function _xe(){return PB.filter(e=>e.surface===`canonical`&&e.name!==`*`)}function vxe(){return _xe().filter(e=>{let t=yxe(e);return t!==`fence`&&t!==`html`})}function yxe(e){return e.name===`MermaidFence`?`fence`:e.name===`HtmlAlignBlock`?`html`:e.hasChildren?`jsx-block`:`jsx-void`}const $q=Symbol.for(`@inkeep/open-knowledge/skill-state-field-registry`),eJ=globalThis;eJ[$q]===void 0&&(eJ[$q]=lr());const tJ=eJ[$q],nJ=Xi({version:I().regex(/^\d+\.\d+\.\d+(?:[-+][\w.-]+)?$/,`version must match /^\\d+\\.\\d+\\.\\d+(?:[-+][\\w.-]+)?$/`).register(tJ,{description:`Recorded skill version for this target.`}),recordedAt:Ti().register(tJ,{description:`ISO 8601 timestamp of the most recent successful write. Updated on every write, including reinstalls of the same version.`}),surface:U([`server-build-and-open`,`electron-build-and-open`,`cli-npx-skills-add`,`desktop-direct`,`cli-start`]).register(tJ,{description:`Install-source surface that recorded this entry.`}).optional()}),bxe=Xi({enabled:R().register(tJ,{description:`Whether this user-global skill bundle is opted in.`}),decidedAt:Ti().register(tJ,{description:`ISO 8601 timestamp of the opt-in / opt-out decision.`})});Xi({schema:W(1).register(tJ,{description:`Schema major version. Bumped only on breaking shape changes.`}),targets:Xi({"claude-cowork":nJ.optional(),"cli-hosts":nJ.optional()}).register(tJ,{description:`Per-target install-state entries. Absent target = no recorded install.`}).default({}),bundles:H(I(),bxe).register(tJ,{description:`Per-bundle opt-in decisions keyed by install name. Absent key = no recorded decision.`}).optional(),installsReported:B(I()).register(tJ,{description:"Skill installs already reported to skills.sh from this machine, as `<owner/repo>#<skill>`. Append-only; presence suppresses a re-report."}).optional()});const xxe=/<script(?![^>]*\ssrc\s*=)[^>]*>([\s\S]*?)<\/script>/gi;function Sxe(e){return[[`script-src 'self' 'unsafe-eval' 'wasm-unsafe-eval'`,...[...e.matchAll(xxe)].map(e=>`'sha256-${Ee(`sha256`).update(e[1]??``).digest(`base64`)}'`)].join(` `),`worker-src 'self' blob:`,`object-src 'none'`,`base-uri 'self'`].join(`; `)}Sxe(``);function Cxe(e,t,n,r){return e.success?{code:`UNKNOWN`,message:`unexpected success in error path`}:{code:`SCHEMA_INVALID`,issues:e.error.issues.map(e=>{let i=e.path.map(e=>typeof e==`symbol`?String(e):e),a=cd({file:r,source:n,doc:t,path:i});return{path:i,message:e.message,issueCode:e.code,...a===void 0?{}:{source:a}}})}}function rJ(e,t,n){let r=`${e}.invalid-${t.replace(/[:.]/g,`-`)}`;try{return ee(e,r),r}catch(t){n(`[config] Could not sideline invalid config file ${e} → ${r}: ${t instanceof Error?t.message:String(t)}. File left in place; using schema defaults.`);return}}function iJ(e,t){let n=e;for(let e of t){if(typeof n!=`object`||!n||Array.isArray(n))return;n=Reflect.get(n,e)}return n}function wxe(e){let t=[],n=[[`maxBatchSize`,1,Gl],[`maxBatchChars`,1,Kl],[`docTimeoutMs`,1,ql]];for(let[r,i,a]of n){let n=[`search`,`semantic`,r],o=iJ(e.rawConfig,n),s=e.config.search.semantic[r];if(o===void 0||o===s)continue;let c=`Expected an integer between ${i} and ${a}; using default ${s}.`,l=cd({file:e.absPath,source:e.source,doc:e.doc,path:n});t.push({path:n,message:c,...l===void 0?{}:{source:{file:l.file,line:l.line,column:l.column}}})}return t.length>0?[{code:`VALUE_FALLBACK`,issues:t}]:[]}function Txe(e){let t=iJ(e.rawConfig,[`git`,`hosts`]);if(t===void 0)return[];let n=jie.safeParse(t);return n.success?[]:[{code:`VALUE_FALLBACK`,issues:n.error.issues.map(t=>{let n=[`git`,`hosts`,...t.path.map(String)],r=cd({file:e.absPath,source:e.source,doc:e.doc,path:n});return{path:n,message:`${t.message}; ignoring this git-host declaration.`,...r===void 0?{}:{source:{file:r.file,line:r.line,column:r.column}}}})}]}function Exe(e){let t=iJ(e.rawConfig,[`autolinks`]);if(t===void 0)return[];let n=Mie.safeParse(t);return n.success?[]:[{code:`VALUE_FALLBACK`,issues:n.error.issues.map(t=>{let n=[`autolinks`,...t.path.map(String)],r=cd({file:e.absPath,source:e.source,doc:e.doc,path:n});return{path:n,message:t.path.length===0?`${t.message}; ignoring autolinks.`:`${t.message}; ignoring this autolink entry.`,...r===void 0?{}:{source:{file:r.file,line:r.line,column:r.column}}}})}]}function aJ(e){let{absPath:t,sideline:n=!0,timestamp:r=new Date().toISOString()}=e,i=e.warn??(e=>console.warn(e)),a=eu.parse({});if(!_(t))return{valid:!0,value:a,source:void 0,diagnostics:[]};let o;try{o=C(t,`utf-8`)}catch(e){let n=e instanceof Error?e.message:String(e);i(`[config] Could not read ${t}: ${n}. Using schema defaults.`);let r={code:`UNREADABLE`,detail:n};return{valid:!1,value:a,error:r,diagnostics:[{...r}]}}let s=(0,xs.parseDocument)(o);if(s.errors.length>0){let e=s.errors.map(e=>e.message).join(`; `);i(`[config] ${t} contains invalid YAML (${e}). Using schema defaults.`+(n?``:` Pass-through mode: file left in place.`));let o=n?rJ(t,r,i):void 0,c={code:`YAML_PARSE`,detail:e};return{valid:!1,value:a,error:c,diagnostics:[{...c}],...o===void 0?{}:{sidelinedTo:o}}}let c=s.toJSON()??{},l=pd({value:c,file:t,source:o,doc:s}),u=l.length>0?hd(c):c,d=[...Txe({rawConfig:u,doc:s,source:o,absPath:t}),...Exe({rawConfig:u,doc:s,source:o,absPath:t})];for(let e of d)for(let n of e.issues)i(`[config] ${t} ${n.path.join(`.`)}: ${n.message}`);let f=eu.safeParse(u);if(!f.success){let e=Cxe(f,s,o,t),c=eu.shape.git.safeParse(iJ(u,[`git`])).data??a.git,p=Object.keys(c.hosts).length>0?`Using schema defaults while preserving valid git-host declarations.`:`Using schema defaults.`;i(`[config] ${t} fails schema validation (${f.error.issues.length} issue(s)). ${p}`+(n?``:` Pass-through mode: file left in place.`));let m=n?rJ(t,r,i):void 0,h=[...l,...d,...Id(e)&&e.code===`SCHEMA_INVALID`?[{...e}]:[]];return{valid:!1,value:{...a,git:c},error:e,diagnostics:h,...m===void 0?{}:{sidelinedTo:m}}}let p=[...l,...d,...wxe({rawConfig:u,config:f.data,doc:s,source:o,absPath:t})];return{valid:!0,value:f.data,source:t,diagnostics:p}}function oJ(e=ve()){return j(e,pt().userHomeDirName)}const sJ=`.tmp.`,cJ=[8,4,4,4,12];function Dxe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}const Oxe=cJ.map(e=>`[0-9a-f]`.repeat(e)).join(`-`),kxe=cJ.map(e=>`[0-9a-f]{${e}}`).join(`-`);`${Oxe}`,RegExp(`${Dxe(sJ)}${kxe}$`);function Axe(e){return`${e}${sJ}${De()}`}function jxe(e){try{let t=k(e),n=`${oe(e)}${sJ}`,r=Date.now()-3e4;for(let e of T(t)){if(!e.startsWith(n))continue;let i=j(t,e);try{re(i).mtimeMs<r&&ie(i)}catch{}}}catch{}}function lJ(e,t,n={}){jxe(e);let r=Axe(e);try{O(r,t,{encoding:`utf-8`,mode:n.mode??420}),ee(r,e)}catch(e){try{ie(r)}catch{}throw e}}var uJ=class extends Error{code=`LOCK_TIMEOUT`;lockPath;timeoutMs;constructor(e,t){super(`Could not acquire file lock at ${e} within ${t}ms`),this.name=`FileLockTimeoutError`,this.lockPath=e,this.timeoutMs=t}};async function Mxe(e,t,n={}){let r=n.timeoutMs??5e3,i=n.retryIntervalMs??25,a=r*2,o=Date.now()+r,s=!0;for(;;){if(!s&&Date.now()>=o)throw new uJ(e,r);s=!1;let c;try{c=x(e,`wx`,384)}catch(t){if(t.code!==`EEXIST`)throw t;let s;try{let t=re(e);s=Date.now()-t.mtimeMs}catch{continue}let c=!1;if(s>a){n.onWarn?.(`cleared stale file lock`,{lockPath:e,ageMs:s,staleThresholdMs:a});try{ie(e),c=!0}catch{}}if(c)continue;if(Date.now()>=o)throw new uJ(e,r);await pae(i);continue}try{return await t()}finally{try{f(c)}catch{}try{ie(e)}catch{}}}}function Nxe(e){let t=Date.now()+e;for(;Date.now()<t;);}function dJ(e,t,n={}){let r=n.timeoutMs??5e3,i=n.retryIntervalMs??25,a=r*2,o=Date.now()+r,s=!0;for(;;){if(!s&&Date.now()>=o)throw new uJ(e,r);s=!1;let c;try{c=x(e,`wx`,384)}catch(t){if(t.code!==`EEXIST`)throw t;let s;try{let t=re(e);s=Date.now()-t.mtimeMs}catch{continue}let c=!1;if(s>a){n.onWarn?.(`cleared stale file lock`,{lockPath:e,ageMs:s,staleThresholdMs:a});try{ie(e),c=!0}catch{}}if(c)continue;if(Date.now()>=o)throw new uJ(e,r);Nxe(i);continue}try{return t()}finally{try{f(c)}catch{}try{ie(e)}catch{}}}}const fJ=`config.yml`;function pJ(e,t,n){if(e===`user`)return le(oJ(n??ve()),`global.yml`);let r=se(t)?t:le(t);return e===`project-local`?le(r,`.ok`,xd,fJ):le(r,`.ok`,fJ)}const Pxe=[`LC_ALL`,`LC_MESSAGES`,`LANG`];function mJ(e){let t=e.trim().split(`@`)[0].split(`.`)[0];return t===``||t===`C`||t===`POSIX`?null:pP(t.replaceAll(`_`,`-`))}function Fxe(e){for(let t of Pxe){let n=e[t]?.trim();if(n!==void 0&&n!==``)return mJ(n)}return null}function Ixe(e){let t=e.OK_LANG?.trim();if(t!==void 0&&t!==``)return pP(t)??void 0}function Lxe(e=process.env){let t=Ixe(e),n=Fxe(e);if(n===null)return{override:t,preferenceList:[]};let r=[],i=e.LANGUAGE;if(i!==void 0)for(let e of i.split(`:`)){let t=mJ(e);t!==null&&r.push(t)}return{override:t,preferenceList:[...r,n]}}function Rxe(e){return Ee(`sha256`).update(e).digest(`hex`)}function zxe(e,t){return j(hJ(e,t),gd)}function hJ(e,t){let n=le(e);try{n=D.native(n)}catch{}let r=Rxe(n);return j(oJ(t),`logs`,`projects`,r)}function gJ(){return Ed(Cd)}function _J(){return pt().keyringService}function vJ(e){try{e()}catch{}}var Bxe=class{backend=`keyring`;onKeychainRead;constructor(e){this.onKeychainRead=e}async get(e){let{Entry:t}=await import(`@napi-rs/keyring`),n;try{n=new t(_J(),e).getPassword()}catch(t){return vJ(()=>this.onKeychainRead?.({kind:`read-error`,host:e,error:t instanceof Error?t.name:`unknown`})),null}if(n==null)return vJ(()=>this.onKeychainRead?.({kind:`absent`,host:e})),null;try{return JSON.parse(n)}catch{return vJ(()=>this.onKeychainRead?.({kind:`corrupt-entry`,host:e,error:`corrupt-entry`})),null}}async set(e,t,n,r){let{Entry:i}=await import(`@napi-rs/keyring`),a=new i(_J(),e),o={login:t,token:n,...r};a.setPassword(JSON.stringify(o))}async clear(e){let{Entry:t}=await import(`@napi-rs/keyring`);try{new t(_J(),e).deletePassword()}catch{}}},yJ=class{backend=`file`;authFile;constructor(e){this.authFile=e??j(oJ(),`auth.yml`)}read(){if(!_(this.authFile))return{};try{let e=C(this.authFile,`utf-8`);return(0,xs.parse)(e)??{}}catch(e){let t=e instanceof Error?e.message:`unknown error`;return process.stderr.write(`[auth] Failed to parse ${this.authFile}: ${t}. Starting with empty credentials.\n`),{}}}write(e){let t=k(this.authFile);_(t)||y(t,{recursive:!0,mode:448}),lJ(this.authFile,(0,xs.stringify)(e),{mode:384})}async get(e){return this.read()[e]??null}async set(e,t,n,r){let i=this.read();i[e]={login:t,token:n,...r},this.write(i)}async clear(e){let t=this.read();delete t[e],this.write(t)}},Vxe=class{backend=`keyring`;keychain;file;constructor(e,t){this.keychain=e,this.file=t}async get(e){let t=await this.keychain.get(e);if(t!=null)return t;let n=await this.file.get(e);if(n==null)return null;try{await this.keychain.set(e,n.login,n.token,{gitProtocol:n.gitProtocol,name:n.name,email:n.email}),await this.file.clear(e),process.stderr.write(`[auth] migrated ${e} credential from ${gJ()} to the OS keychain\n`)}catch{}return n}set(e,t,n,r){return this.keychain.set(e,t,n,r)}async clear(e){await this.keychain.clear(e),await this.file.get(e)!=null&&await this.file.clear(e)}};async function bJ(e,t){try{let{Entry:n}=await import(`@napi-rs/keyring`);return new n(_J(),`__probe__`),process.stderr.write(`[auth] token storage: OS keychain
|
|
@@ -720,7 +720,7 @@ caused by: `+i(o,t)):a},a=e=>i(e,new Set),o=(e,t,i)=>{if(!n(e))return``;let a=i?
|
|
|
720
720
|
`}){let r=e.split(/\r?\n/);for(let e=1;e<r.length;e+=1)r[e]=t+r[e];return r.join(n)}})),fCe=DY(((e,t)=>{t.exports=s;let{LEVEL_NAMES:n}=qY(),r=YY(),i=aX(),a=iX(),o=JY();function s(e){let t=e.crlf?`\r
|
|
721
721
|
`:`
|
|
722
722
|
`,{customPrettifiers:s,errorLikeObjectKeys:c,hideObject:l,levelFirst:u,levelKey:d,levelLabel:f,messageFormat:p,messageKey:m,minimumLevel:h,singleLine:g,timestampKey:_,translateTime:v}=e,y=e.errorProps.split(`,`),b=typeof e.useOnlyCustomProps==`boolean`?e.useOnlyCustomProps:e.useOnlyCustomProps===`true`,x=i(e.customLevels),S=a(e.customLevels),C=o(b,x,S),w;if(e.customColors){if(typeof e.customColors==`string`)w=e.customColors.split(`,`).reduce((t,r)=>{let[i,a]=r.split(`:`),o=(b?e.customLevels:S[i]!==void 0)?S[i]:n[i],s=o===void 0?i:o;return t.push([s,a]),t},[]);else if(typeof e.customColors==`object`)w=Object.keys(e.customColors).reduce((t,r)=>{let[i,a]=[r,e.customColors[r]],o=(b?e.customLevels:S[i]!==void 0)?S[i]:n[i],s=o===void 0?i:o;return t.push([s,a]),t},[]);else throw Error(`options.customColors must be of type string or object.`)}let T={customLevels:x,customLevelNames:S};b===!0&&!e.customLevels&&(T.customLevels=void 0,T.customLevelNames=void 0);let E=e.include===void 0?void 0:new Set(e.include.split(`,`)),D=!E&&e.ignore?new Set(e.ignore.split(`,`)):void 0,ee=r(e.colorize,w,b),te=e.colorizeObjects?ee:r(!1,[],!1);return{EOL:t,IDENT:` `,colorizer:ee,customColors:w,customLevelNames:S,customLevels:x,customPrettifiers:s,customProperties:T,errorLikeObjectKeys:c,errorProps:y,getLevelLabelData:C,hideObject:l,ignoreKeys:D,includeKeys:E,levelFirst:u,levelKey:d,levelLabel:f,messageFormat:p,messageKey:m,minimumLevel:h,objectColorizer:te,singleLine:g,timestampKey:_,translateTime:v,useOnlyCustomProps:b}}})),pCe=DY(((e,t)=>{t.exports=s,s.default=s,s.stable=d,s.stableStringify=d;var n=`[...]`,r=`[Circular]`,i=[],a=[];function o(){return{depthLimit:2**53-1,edgesLimit:2**53-1}}function s(e,t,n,r){r===void 0&&(r=o()),l(e,``,0,[],void 0,0,r);var s;try{s=a.length===0?JSON.stringify(e,t,n):JSON.stringify(e,p(t),n)}catch{return JSON.stringify(`[unable to serialize, circular reference is too complex to analyze]`)}finally{for(;i.length!==0;){var c=i.pop();c.length===4?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}}return s}function c(e,t,n,r){var o=Object.getOwnPropertyDescriptor(r,n);o.get===void 0?(r[n]=e,i.push([r,n,t])):o.configurable?(Object.defineProperty(r,n,{value:e}),i.push([r,n,t,o])):a.push([t,n,e])}function l(e,t,i,a,o,s,u){s+=1;var d;if(typeof e==`object`&&e){for(d=0;d<a.length;d++)if(a[d]===e){c(r,e,t,o);return}if(u.depthLimit!==void 0&&s>u.depthLimit){c(n,e,t,o);return}if(u.edgesLimit!==void 0&&i+1>u.edgesLimit){c(n,e,t,o);return}if(a.push(e),Array.isArray(e))for(d=0;d<e.length;d++)l(e[d],d,d,a,e,s,u);else{var f=Object.keys(e);for(d=0;d<f.length;d++){var p=f[d];l(e[p],p,d,a,e,s,u)}}a.pop()}}function u(e,t){return e<t?-1:+(e>t)}function d(e,t,n,r){r===void 0&&(r=o());var s=f(e,``,0,[],void 0,0,r)||e,c;try{c=a.length===0?JSON.stringify(s,t,n):JSON.stringify(s,p(t),n)}catch{return JSON.stringify(`[unable to serialize, circular reference is too complex to analyze]`)}finally{for(;i.length!==0;){var l=i.pop();l.length===4?Object.defineProperty(l[0],l[1],l[3]):l[0][l[1]]=l[2]}}return c}function f(e,t,a,o,s,l,d){l+=1;var p;if(typeof e==`object`&&e){for(p=0;p<o.length;p++)if(o[p]===e){c(r,e,t,s);return}try{if(typeof e.toJSON==`function`)return}catch{return}if(d.depthLimit!==void 0&&l>d.depthLimit){c(n,e,t,s);return}if(d.edgesLimit!==void 0&&a+1>d.edgesLimit){c(n,e,t,s);return}if(o.push(e),Array.isArray(e))for(p=0;p<e.length;p++)f(e[p],p,p,o,e,l,d);else{var m={},h=Object.keys(e).sort(u);for(p=0;p<h.length;p++){var g=h[p];f(e[g],g,p,o,e,l,d),m[g]=e[g]}if(s!==void 0)i.push([s,t,e]),s[t]=m;else return m}o.pop()}}function p(e){return e=e===void 0?function(e,t){return t}:e,function(t,n){if(a.length>0)for(var r=0;r<a.length;r++){var i=a[r];if(i[1]===t&&i[0]===n){n=i[2],a.splice(r,1);break}}return e.call(this,t,n)}}})),lX=DY(((e,t)=>{t.exports=r;let n=cX();function r({keyName:e,lines:t,eol:r,ident:i}){let a=``,o=`${i}${e}: ${n({input:t,ident:i,eol:r})}${r}`.split(r);for(let e=0;e<o.length;e+=1){e!==0&&(a+=r);let t=o[e];if(/^\s*"stack"/.test(t)){let e=/^(\s*"stack":)\s*(".*"),?$/.exec(t);if(e&&e.length===3){let n=/^\s*/.exec(t)[0].length+4,i=` `.repeat(n),o=e[2];a+=e[1]+r+i+JSON.parse(o).replace(/\n/g,r+i)}else a+=t}else a+=t}return a}})),uX=DY(((e,t)=>{t.exports=o;let{LOGGER_KEYS:n}=qY(),r=pCe(),i=cX(),a=lX();function o({log:e,excludeLoggerKeys:t=!0,skipKeys:o=[],context:s}){let{EOL:c,IDENT:l,customPrettifiers:u,errorLikeObjectKeys:d,objectColorizer:f,singleLine:p,colorizer:m}=s,h=[].concat(o);t===!0&&Array.prototype.push.apply(h,n);let g=``,{plain:_,errors:v}=Object.entries(e).reduce(({plain:t,errors:n},[r,i])=>{if(h.includes(r)===!1){let a=typeof u[r]==`function`?u[r](i,r,e,{colors:m.colors}):i;d.includes(r)?n[r]=a:t[r]=a}return{plain:t,errors:n}},{plain:{},errors:{}});return p?(Object.keys(_).length>0&&(g+=f.greyMessage(r(_))),g+=c,g=g.replace(/\\\\/gi,`\\`)):Object.entries(_).forEach(([e,t])=>{let n=typeof u[e]==`function`?t:r(t,null,2);if(n===void 0)return;n=n.replace(/\\\\/gi,`\\`);let a=i({input:n,ident:l,eol:c});g+=`${l}${f.property(e)}:${a.startsWith(c)?``:` `}${a}${c}`}),Object.entries(v).forEach(([e,t])=>{let n=typeof u[e]==`function`?t:r(t,null,2);n!==void 0&&(g+=a({keyName:e,lines:n,eol:c,ident:l}))}),g}})),dX=DY(((e,t)=>{t.exports=o;let{LOGGER_KEYS:n}=qY(),r=sX(),i=cX(),a=uX();function o({log:e,context:t}){let{EOL:o,IDENT:s,errorProps:c,messageKey:l}=t,u=e.stack,d=`${s}${i({input:u,ident:s,eol:o})}${o}`;if(c.length>0){let i=n.concat(l,`type`,`stack`),u;u=c[0]===`*`?Object.keys(e).filter(e=>i.includes(e)===!1):c.filter(e=>i.includes(e)===!1);for(let n=0;n<u.length;n+=1){let i=u[n];if(i in e){if(r(e[i])){let n=a({log:e[i],excludeLoggerKeys:!1,context:{...t,IDENT:s+s}});d=`${d}${s}${i}: {${o}${n}${s}}${o}`;continue}d=`${d}${s}${i}: ${e[i]}${o}`}}}return d}})),fX=DY(((e,t)=>{t.exports=r;let n=eX();function r({log:e,context:t}){let{colorizer:r,customLevels:i,customLevelNames:a,levelKey:o,getLevelLabelData:s}=t,c=t.customPrettifiers?.level,l=n(e,o);if(l===void 0)return;let u=r(l,{customLevels:i,customLevelNames:a});if(c){let[t]=s(l);return c(l,o,e,{label:t,labelColorized:u,colors:r.colors})}return u}})),pX=DY(((e,t)=>{t.exports=a;let{LEVELS:n}=qY(),r=eX(),i=oX();function a({log:e,context:t}){let{colorizer:a,customLevels:o,levelKey:s,levelLabel:c,messageFormat:l,messageKey:u,useOnlyCustomProps:d}=t;if(l&&typeof l==`string`){let t=i(l,e),u=String(t).replace(/{([^{}]+)}/g,function(t,i){let a;if(i===c&&(a=r(e,s))!==void 0)return(d?o===void 0:o[a]===void 0)?n[a]:o[a];let l=r(e,i);return l===void 0?``:l});return a.message(u)}if(l&&typeof l==`function`){let t=l(e,u,c,{colors:a.colors});return a.message(t)}if(u in e&&(typeof e[u]==`string`||typeof e[u]==`number`||typeof e[u]==`boolean`))return a.message(e[u])}})),mX=DY(((e,t)=>{t.exports=n;function n({log:e,context:t}){let{customPrettifiers:n,colorizer:r}=t,i=``;if(e.name||e.pid||e.hostname){if(i+=`(`,e.name&&(i+=n.name?n.name(e.name,`name`,e,{colors:r.colors}):e.name),e.pid){let t=n.pid?n.pid(e.pid,`pid`,e,{colors:r.colors}):e.pid;e.name&&e.pid?i+=`/`+t:i+=t}if(e.hostname){let t=n.hostname?n.hostname(e.hostname,`hostname`,e,{colors:r.colors}):e.hostname;i+=`${i===`(`?`on`:` on`} ${t}`}i+=`)`}if(e.caller){let t=n.caller?n.caller(e.caller,`caller`,e,{colors:r.colors}):e.caller;i+=`${i===``?``:` `}<${t}>`}if(i!==``)return i}})),hX=DY(((e,t)=>{t.exports=r;let n=rX();function r({log:e,context:t}){let{timestampKey:r,translateTime:i}=t,a=t.customPrettifiers?.time,o=null;if(r in e?o=e[r]:`timestamp`in e&&(o=e.timestamp),o===null)return;let s=i?n(o,i):o;return a?a(s):`[${s}]`}})),mCe=DY(((e,t)=>{t.exports={buildSafeSonicBoom:lCe(),createDate:QY(),deleteLogProperty:tX(),filterLog:nX(),formatTime:rX(),getPropertyValue:eX(),handleCustomLevelsNamesOpts:iX(),handleCustomLevelsOpts:aX(),interpretConditionals:oX(),isObject:sX(),isValidDate:ZY(),joinLinesWithIndentation:cX(),noop:XY(),parseFactoryOptions:fCe(),prettifyErrorLog:dX(),prettifyError:lX(),prettifyLevel:fX(),prettifyMessage:pX(),prettifyMetadata:mX(),prettifyObject:uX(),prettifyTime:hX(),splitPropertyKey:$Y(),getLevelLabelData:JY()}})),hCe=DY(((e,t)=>{let n=typeof Buffer<`u`,r=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,i=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function a(e,t,a){a==null&&typeof t==`object`&&t&&(a=t,t=void 0),n&&Buffer.isBuffer(e)&&(e=e.toString()),e&&e.charCodeAt(0)===65279&&(e=e.slice(1));let s=JSON.parse(e,t);if(typeof s!=`object`||!s)return s;let c=a&&a.protoAction||`error`,l=a&&a.constructorAction||`error`;if(c===`ignore`&&l===`ignore`)return s;if(c!==`ignore`&&l!==`ignore`){if(r.test(e)===!1&&i.test(e)===!1)return s}else if(c!==`ignore`&&l===`ignore`){if(r.test(e)===!1)return s}else if(i.test(e)===!1)return s;return o(s,{protoAction:c,constructorAction:l,safe:a&&a.safe})}function o(e,{protoAction:t=`error`,constructorAction:n=`error`,safe:r}={}){let i=[e];for(;i.length;){let e=i;i=[];for(let a of e){if(t!==`ignore`&&Object.prototype.hasOwnProperty.call(a,`__proto__`)){if(r===!0)return null;if(t===`error`)throw SyntaxError(`Object contains forbidden prototype property`);delete a.__proto__}if(n!==`ignore`&&Object.prototype.hasOwnProperty.call(a,`constructor`)&&a.constructor!==null&&typeof a.constructor==`object`&&Object.prototype.hasOwnProperty.call(a.constructor,`prototype`)){if(r===!0)return null;if(n===`error`)throw SyntaxError(`Object contains forbidden prototype property`);delete a.constructor}for(let e in a){let t=a[e];t&&typeof t==`object`&&i.push(t)}}}return e}function s(e,t,n){let{stackTraceLimit:r}=Error;Error.stackTraceLimit=0;try{return a(e,t,n)}finally{Error.stackTraceLimit=r}}function c(e,t){let{stackTraceLimit:n}=Error;Error.stackTraceLimit=0;try{return a(e,t,{safe:!0})}catch{return}finally{Error.stackTraceLimit=n}}t.exports=s,t.exports.default=s,t.exports.parse=s,t.exports.safeParse=c,t.exports.scan=o})),gCe=DY(((e,t)=>{t.exports=h;let n=hCe(),r=sX(),i=dX(),a=fX(),o=pX(),s=mX(),c=uX(),l=hX(),u=nX(),{LEVELS:d,LEVEL_KEY:f,LEVEL_NAMES:p}=qY(),m=e=>{try{return{value:n.parse(e,{protoAction:`remove`})}}catch(e){return{err:e}}};function h(e){let t;if(r(e))t=e;else{let n=m(e);if(n.err||!r(n.value))return e+this.EOL;t=n.value}if(this.minimumLevel){let e;e=this.useOnlyCustomProps?this.customLevels:this.customLevelNames[this.minimumLevel]!==void 0;let n;if(n=e?this.customLevelNames[this.minimumLevel]:p[this.minimumLevel],n||=typeof this.minimumLevel==`string`?p[this.minimumLevel]:p[d[this.minimumLevel].toLowerCase()],t[this.levelKey===void 0?f:this.levelKey]<n)return}let n=o({log:t,context:this.context});(this.ignoreKeys||this.includeKeys)&&(t=u({log:t,context:this.context}));let h=a({log:t,context:{...this.context,...this.context.customProperties}}),g=s({log:t,context:this.context}),_=l({log:t,context:this.context}),v=``;if(this.levelFirst&&h&&(v=`${h}`),_&&v===``?v=`${_}`:_&&(v=`${v} ${_}`),!this.levelFirst&&h&&(v=v.length>0?`${v} ${h}`:h),g&&(v=v.length>0?`${v} ${g}:`:g),v.endsWith(`:`)===!1&&v!==``&&(v+=`:`),n!==void 0&&(v=v.length>0?`${v} ${n}`:n),v.length>0&&!this.singleLine&&(v+=this.EOL),t.type===`Error`&&typeof t.stack==`string`){let e=i({log:t,context:this.context});this.singleLine&&(v+=this.EOL),v+=e}else if(this.hideObject===!1){let e=[this.messageKey,this.levelKey,this.timestampKey].map(e=>e.replaceAll(/\\/g,``)).filter(e=>typeof t[e]==`string`||typeof t[e]==`number`||typeof t[e]==`boolean`),n=c({log:t,skipKeys:e,context:this.context});this.singleLine&&!/^\s$/.test(n)&&(v+=` `),v+=n}return v}})),_Ce=DY(((e,t)=>{let{isColorSupported:n}=GY(),r=oCe(),{Transform:i}=kY(`node:stream`),a=cCe(),o=YY(),{ERROR_LIKE_KEYS:s,LEVEL_KEY:c,LEVEL_LABEL:l,MESSAGE_KEY:u,TIMESTAMP_KEY:d}=qY(),{buildSafeSonicBoom:f,parseFactoryOptions:p}=mCe(),m=gCe(),h={colorize:n,colorizeObjects:!0,crlf:!1,customColors:null,customLevels:null,customPrettifiers:{},errorLikeObjectKeys:s,errorProps:``,hideObject:!1,ignore:`hostname`,include:void 0,levelFirst:!1,levelKey:c,levelLabel:l,messageFormat:null,messageKey:u,minimumLevel:void 0,outputStream:process.stdout,singleLine:!1,timestampKey:d,translateTime:!0,useOnlyCustomProps:!0};function g(e){let t=p(Object.assign({},h,e));return m.bind({...t,context:t})}function _(e={}){let t=g(e),n;return a(function(a){a.on(`message`,function n(r){!r||r.code!==`PINO_CONFIG`||(Object.assign(e,{messageKey:r.config.messageKey,errorLikeObjectKeys:Array.from(new Set([...e.errorLikeObjectKeys||s,r.config.errorKey])),customLevels:r.config.levels.values}),t=g(e),a.off(`message`,n))});let o=new i({objectMode:!0,autoDestroy:!0,transform(e,n,r){r(null,t(e))}});return n=typeof e.destination==`object`&&typeof e.destination.write==`function`?e.destination:f({dest:e.destination||1,append:e.append,mkdir:e.mkdir,sync:e.sync}),a.on(`unknown`,function(e){n.write(e+`
|
|
723
|
-
`)}),r(a,o,n),o},{parse:`lines`,close(e,t){n.on(`close`,()=>{t(e)})}})}t.exports=_,t.exports.build=_,t.exports.PinoPretty=_,t.exports.prettyFactory=g,t.exports.colorizerFactory=o,t.exports.isColorSupported=n,t.exports.default=_})),gX=OY(WY(),1),vCe=OY(_Ce(),1);const _X=new Map;function yCe(e){let t=_X.get(e);return t||(t={chain:Promise.resolve(),parentDirEnsured:!1},_X.set(e,t)),t}var bCe=class{#e;#t;#n;#r;constructor(e){this.#e=e.currentPath,this.#t=e.previousPath,this.#n=e.maxBytes,this.#r=yCe(e.currentPath)}append(e){let t=this.#r.chain.catch(()=>void 0).then(()=>this.#i(e));return this.#r.chain=t,t}async drain(){await this.#r.chain.catch(()=>void 0)}async#i(e){this.#r.parentDirEnsured||(await Oe(k(this.#e),{recursive:!0,mode:448}),this.#r.parentDirEnsured=!0);try{await Pe(this.#e,e,{flag:`a`})}catch(t){if(t.code!==`ENOENT`)throw t;this.#r.parentDirEnsured=!1,await Oe(k(this.#e),{recursive:!0,mode:448}),this.#r.parentDirEnsured=!0,await Pe(this.#e,e,{flag:`a`})}let t;try{t=re(this.#e).size}catch{this.#r.parentDirEnsured=!1;return}if(t>this.#n)try{await Me(this.#e,this.#t)}catch(e){if(e?.code!==`ENOENT`)throw e}}};function xCe(e){return j(hJ(e),_d.spansCurrent)}function SCe(e){return j(hJ(e),_d.spansPrevious)}function vX(e){return j(hJ(e),_d.logsCurrent)}function yX(e){return j(hJ(e),_d.logsPrevious)}var bX=class extends Re{#e;#t=0;#n=0;constructor(e){super({decodeStrings:!1}),this.#e=new bCe({currentPath:vX(e.projectDir),previousPath:yX(e.projectDir),maxBytes:e.maxBytes})}_write(e,t,n){this.#e.append(e).then(()=>n(),e=>{this.#r(e),n()})}#r(e){let t=Date.now();if(t-this.#t<5e3){this.#n++;return}this.#i(e instanceof Error?e.message:String(e),t)}#i(e,t){let n=this.#n;this.#n=0,this.#t=t,console.error(JSON.stringify({event:`pino-file-sink-write-dropped`,error:e,suppressed:n}))}async drain(){await this.#e.drain(),this.#n>0&&this.#i(`flushed at drain`,Date.now())}};function CCe(){let e=ad.getSpan(nd.active());if(!e)return{};let t=e.spanContext();return{trace_id:t.traceId,span_id:t.spanId,trace_flags:t.traceFlags}}function wCe(){return process.env.NO_COLOR&&process.env.NO_COLOR!==``?!1:process.stdout.isTTY??!1}const xX=new Set([`fatal`,`error`,`warn`,`info`,`debug`,`trace`,`silent`]);function SX(e){return e===`silent`?1/0:gX.default.levels.values[e]??gX.default.levels.values.info}function CX(e,t){return SX(e)<=SX(t)?e:t}var TCe=class{name;transportConfigs=[];fileSinkOpts;redactPaths;activeFileSink;pinoInstance;options;constructor(e,t={}){this.name=e,this.options={name:this.name,level:process.env.LOG_LEVEL||(process.env.NODE_ENV===`test`?`silent`:`info`),serializers:{err:gX.default.stdSerializers.err,error:gX.default.stdSerializers.err},mixin:CCe,...t.options},t.transportConfigs&&(this.transportConfigs=t.transportConfigs),t.fileSink&&(this.fileSinkOpts=t.fileSink),t.redactPaths&&t.redactPaths.length>0&&(this.redactPaths=t.redactPaths,this.options={...this.options,redact:{paths:[...t.redactPaths],censor:`[REDACTED]`}}),this.pinoInstance=this.buildInstance()}resolveStreamLevels(){let e=this.options.level??`info`,t=process.env.OK_FILE_LEVEL?.toLowerCase(),n=t&&xX.has(t)?t:e===`silent`?`silent`:CX(e,`debug`),r=process.env.OK_CONSOLE_LEVEL?.toLowerCase(),i=r&&xX.has(r)?r:e;return{fileLevel:n,consoleLevel:i,instanceLevel:CX(n,i)}}buildInstance(){this.activeFileSink=void 0;let{fileLevel:e,consoleLevel:t,instanceLevel:n}=this.resolveStreamLevels();if(this.transportConfigs.length>0)return(0,gX.default)(this.options,gX.default.transport({targets:this.transportConfigs}));let r;try{r=(0,vCe.default)({colorize:wCe(),translateTime:`HH:MM:ss`,ignore:`pid,hostname`})}catch(r){if(console.warn(`[PinoLogger] pino-pretty failed, falling back to JSON:`,r),this.fileSinkOpts){let t=new bX(this.fileSinkOpts);return this.activeFileSink=t,(0,gX.default)({...this.options,level:n},gX.default.multistream([{stream:t,level:e}]))}return(0,gX.default)({...this.options,level:t})}if(this.fileSinkOpts){let i=new bX(this.fileSinkOpts);return this.activeFileSink=i,(0,gX.default)({...this.options,level:n},gX.default.multistream([{stream:r,level:t},{stream:i,level:e}]))}return(0,gX.default)({...this.options,level:t},r)}recreateInstance(){typeof this.pinoInstance.flush==`function`&&this.pinoInstance.flush(),this.pinoInstance=this.buildInstance()}addTransport(e){this.transportConfigs.push(e),this.recreateInstance()}removeTransport(e){e>=0&&e<this.transportConfigs.length&&(this.transportConfigs.splice(e,1),this.recreateInstance())}getTransports(){return[...this.transportConfigs]}updateOptions(e){this.options={...this.options,...e},this.recreateInstance()}reconfigure(e){e.options&&(this.options={...this.options,...e.options}),e.transportConfigs&&(this.transportConfigs=e.transportConfigs),e.fileSink&&(this.fileSinkOpts=e.fileSink),e.redactPaths&&e.redactPaths.length>0&&(this.redactPaths=e.redactPaths,this.options={...this.options,redact:{paths:[...e.redactPaths],censor:`[REDACTED]`}}),this.recreateInstance()}getPinoInstance(){return this.pinoInstance}async flushFileSink(){this.activeFileSink&&await this.activeFileSink.drain()}error(e,t){this.pinoInstance.error(e,t)}warn(e,t){this.pinoInstance.warn(e,t)}info(e,t){this.pinoInstance.info(e,t)}debug(e,t){this.pinoInstance.debug(e,t)}};const ECe=new class{config={};loggers=new Map;configure(e){if(this.config=e,e.pinoConfig&&!e.defaultLogger&&!e.loggerFactory){for(let t of this.loggers.values())t.reconfigure(e.pinoConfig);return}this.loggers.clear()}getLogger(e){let t=this.loggers.get(e);if(t)return t;let n;return n=this.config.loggerFactory?this.config.loggerFactory(e):this.config.defaultLogger?this.config.defaultLogger:new TCe(e,this.config.pinoConfig),this.loggers.set(e,n),n}reset(){this.config={},this.loggers.clear()}async flushAllFileSinks(){let e=[];for(let t of this.loggers.values())e.push(t.flushFileSink());await Promise.all(e)}};function wX(e){return ECe.getLogger(e)}new zye({extensions:UN,deriveStructuralFreshness:!0}),mO(UN);var TX=class{kind;projectRoot;projectSubPath;gitPath;gitDir;cachedCommonDir;constructor(e,t,n,r,i){this.kind=e,this.projectRoot=t,this.projectSubPath=n,this.gitPath=r,this.gitDir=i}readCommonDir(){if(this.cachedCommonDir!==void 0)return{kind:`resolved`,path:this.cachedCommonDir};let e=this.gitDir;try{let t=C(j(this.gitDir,`commondir`),`utf-8`).trim();t.length>0&&(e=se(t)?t:le(this.gitDir,t))}catch(e){if(!DX(e))return{kind:`unreadable`,cause:e}}return this.cachedCommonDir=e,{kind:`resolved`,path:e}}readHead(){let e;try{e=C(j(this.gitDir,`HEAD`),`utf-8`).trim()}catch(e){return DX(e)?{kind:`absent`}:{kind:`unreadable`,cause:e}}let t=/^ref:[ \t]*(refs\/heads\/(.+))$/.exec(e);return t?.[2]?{kind:`branch`,branch:t[2],ref:t[1]}:kX(e)?{kind:`detached`,oid:e}:{kind:`malformed`,raw:e}}readRemoteUrl(e){let t=this.readCommonDir();if(t.kind===`unreadable`)return t;let n;try{n=C(j(t.path,`config`),`utf-8`)}catch(e){return DX(e)?{kind:`absent`,reason:`config-missing`}:{kind:`unreadable`,cause:e}}let r=kCe(n,e);return r===null?{kind:`absent`,reason:`remote-missing`}:{kind:`configured`,url:r}}readRef(e){if(!OX(e))return{kind:`invalid`};let t=this.readCommonDir();if(t.kind===`unreadable`)return t;let n=le(t.path,e),r=N(t.path,n);if(r.startsWith(`..`)||se(r))return{kind:`invalid`};try{let e=C(n,`utf-8`).trim(),t=MCe(e);return t===null?{kind:`malformed`,raw:e}:{kind:`present`,storage:`loose`,value:t}}catch(e){if(!DX(e))return{kind:`unreadable`,cause:e}}let i;try{i=C(j(t.path,`packed-refs`),`utf-8`)}catch(e){return DX(e)?{kind:`absent`}:{kind:`unreadable`,cause:e}}for(let t of i.split(/\r?\n/)){let n=t.trim();if(n.length===0||n.startsWith(`#`)||n.startsWith(`^`))continue;let r=n.split(/\s+/);if(r.length===2&&r[1]===e)return kX(r[0])?{kind:`present`,storage:`packed`,value:{kind:`oid`,oid:r[0]}}:{kind:`malformed`,raw:n}}return{kind:`absent`}}};function DCe(e){return EX(le(e),``)}function OCe(e){let t=le(e),n=le(ve());if(t===n)return{kind:`absent`};let r=EX(t,``);if(r.kind!==`absent`)return r;let i=t;for(let e=0;e<64;e++){if(i===n)return{kind:`absent`};let e=k(i);if(e===i||e===n)return{kind:`absent`};let r=EX(e,N(e,t));if(r.kind!==`absent`)return r;i=e}return{kind:`absent`}}function EX(e,t){let n=j(e,`.git`),r;try{r=re(n)}catch(e){return DX(e)?{kind:`absent`}:{kind:`inaccessible`,gitPath:n,cause:e}}if(r.isDirectory())return{kind:`repository`,repository:new TX(`directory`,e,t,n,n)};if(!r.isFile())return{kind:`absent`};let i;try{i=C(n,`utf-8`).trim()}catch(e){return{kind:`malformed-pointer`,gitPath:n,target:``,cause:e}}let a=/^gitdir:[ \t]*(.+)$/.exec(i);if(!a)return{kind:`malformed-pointer`,gitPath:n,target:``};let o=a[1].trim(),s=se(o)?o:le(e,o);try{if(!re(s).isDirectory())return{kind:`malformed-pointer`,gitPath:n,target:s}}catch(e){return{kind:`malformed-pointer`,gitPath:n,target:s,cause:e}}return{kind:`repository`,repository:new TX(`linked`,e,t,n,s)}}function kCe(e,t){let n=!1;for(let r of e.split(/\r?\n/)){let e=ACe(r);if(e.length===0)continue;if(e.startsWith(`[`)){n=/^\[\s*remote\s+["'](.+)["']\s*\]$/.exec(e)?.[1]===t;continue}if(!n)continue;let i=/^url\s*=\s*(.*)$/.exec(e);if(!i)continue;let a=jCe(i[1]);if(a.length>0)return a}return null}function ACe(e){let t=e.search(/[;#]/);return(t===-1?e:e.slice(0,t)).trim()}function jCe(e){let t=e.trim();return t.startsWith(`"`)&&t.endsWith(`"`)||t.startsWith(`'`)&&t.endsWith(`'`)?t.slice(1,-1):t}function DX(e){let t=e?.code;return t===`ENOENT`||t===`ENOTDIR`}function OX(e){return e.startsWith(`refs/`)&&!e.includes(`\0`)&&!e.includes(`\\`)&&!e.includes(`..`)&&!e.includes(`//`)&&!e.endsWith(`/`)}function MCe(e){if(e.length===0)return null;let t=/^ref:[ \t]*(refs\/.+)$/.exec(e);return t?OX(t[1])?{kind:`symbolic`,target:t[1]}:null:kX(e)?{kind:`oid`,oid:e}:null}function kX(e){return/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/.test(e)}process.platform===`darwin`||process.platform,new Set(kae);const NCe=Object.values(it).map(e=>e.mcpServerName.slice(Oae.length)).filter(e=>e!==``);RegExp(`^open[-_ ]?knowledge(?:${NCe.join(`|`)})?$`),new Set(Object.values(it).map(Et));const AX={initialize:`initialize`,authenticate:`authenticate`,providers_list:`providers/list`,providers_set:`providers/set`,providers_disable:`providers/disable`,session_new:`session/new`,session_load:`session/load`,session_set_mode:`session/set_mode`,session_set_config_option:`session/set_config_option`,session_prompt:`session/prompt`,session_cancel:`session/cancel`,mcp_message:`mcp/message`,session_list:`session/list`,session_delete:`session/delete`,session_fork:`session/fork`,session_resume:`session/resume`,session_close:`session/close`,logout:`logout`,nes_start:`nes/start`,nes_suggest:`nes/suggest`,nes_accept:`nes/accept`,nes_reject:`nes/reject`,nes_close:`nes/close`,document_did_open:`document/didOpen`,document_did_change:`document/didChange`,document_did_close:`document/didClose`,document_did_save:`document/didSave`,document_did_focus:`document/didFocus`},jX={session_request_permission:`session/request_permission`,session_update:`session/update`,fs_write_text_file:`fs/write_text_file`,fs_read_text_file:`fs/read_text_file`,terminal_create:`terminal/create`,terminal_output:`terminal/output`,terminal_release:`terminal/release`,terminal_wait_for_exit:`terminal/wait_for_exit`,terminal_kill:`terminal/kill`,mcp_connect:`mcp/connect`,mcp_message:`mcp/message`,mcp_disconnect:`mcp/disconnect`,elicitation_create:`elicitation/create`,elicitation_complete:`elicitation/complete`},PCe={cancel_request:`$/cancel_request`},MX=Symbol(`skippedItem`);function $(e,t){return e.catch(t)}function NX(e,t){let n=e.catch(t);return z().transform((e,t)=>e===void 0?(t.addIssue({code:`custom`,message:`Required value is missing`}),Ot):n.parse(e))}function PX(e,t){if(typeof e!=`object`||!e||Array.isArray(e))return;let n=e[t];return typeof n==`string`?n:void 0}function FX(e,t,n){return e.superRefine((e,r)=>{let i=PX(e,t);i!==void 0&&n.includes(i)&&r.addIssue({code:`custom`,path:[t],message:`${t} ${JSON.stringify(i)} is reserved by a known variant, but the value does not match that variant's schema`})})}function IX(e,t,n){return z().transform((r,i)=>{let a=e.safeParse(r);if(!a.success){for(let e of a.error.issues)i.addIssue({...e,input:r});return Ot}let o=a.data,s=PX(r,t);if(s!==void 0&&!n.includes(s)){let e=r;for(let[t,n]of Object.entries(e))t!==`__proto__`&&(Object.hasOwn(o,t)||(o[t]=n))}return o})}function LX(e){return B(e.catch(MX)).transform(e=>e.filter(e=>e!==MX))}const RX=Qi([L(),I()]).nullable(),zX=I(),BX=V({sessionId:zX,path:I(),content:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),VX=V({sessionId:zX,path:I(),line:$(Gi().gte(0).max(4294967295,{error:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),()=>void 0),limit:$(Gi().gte(0).max(4294967295,{error:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),HX=I(),UX=Qi([W(`read`),W(`edit`),W(`delete`),W(`move`),W(`search`),W(`execute`),W(`think`),W(`fetch`),W(`switch_mode`),W(`other`)]),WX=Qi([W(`pending`),W(`in_progress`),W(`completed`),W(`failed`)]),GX=V({audience:$(LX(Qi([W(`assistant`),W(`user`)])).nullish(),()=>void 0),lastModified:$(I().nullish(),()=>void 0),priority:$(L().nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),FCe=V({annotations:$(GX.nullish(),()=>void 0),text:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),ICe=V({annotations:$(GX.nullish(),()=>void 0),data:I(),mimeType:I(),uri:$(I().nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),LCe=V({annotations:$(GX.nullish(),()=>void 0),data:I(),mimeType:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),RCe=V({annotations:$(GX.nullish(),()=>void 0),description:$(I().nullish(),()=>void 0),mimeType:$(I().nullish(),()=>void 0),name:I(),size:$(L().nullish(),()=>void 0),title:$(I().nullish(),()=>void 0),uri:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),zCe=Qi([V({mimeType:$(I().nullish(),()=>void 0),text:I(),uri:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),V({blob:I(),mimeType:$(I().nullish(),()=>void 0),uri:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)})]),BCe=V({annotations:$(GX.nullish(),()=>void 0),resource:zCe,_meta:$(H(I(),z()).nullish(),()=>void 0)}),KX=Qi([FCe.and(V({type:W(`text`)})),ICe.and(V({type:W(`image`)})),LCe.and(V({type:W(`audio`)})),RCe.and(V({type:W(`resource_link`)})),BCe.and(V({type:W(`resource`)}))]),VCe=V({content:KX,_meta:$(H(I(),z()).nullish(),()=>void 0)}),HCe=V({path:I(),oldText:$(I().nullish(),()=>void 0),newText:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),qX=I(),UCe=V({terminalId:qX,_meta:$(H(I(),z()).nullish(),()=>void 0)}),JX=Qi([VCe.and(V({type:W(`content`)})),HCe.and(V({type:W(`diff`)})),UCe.and(V({type:W(`terminal`)}))]),YX=V({path:I(),line:$(Gi().gte(0).max(4294967295,{error:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),XX=V({toolCallId:HX,kind:$(UX.nullish(),()=>void 0),status:$(WX.nullish(),()=>void 0),title:$(I().nullish(),()=>void 0),content:$(LX(JX).nullish(),()=>void 0),locations:$(LX(YX).nullish(),()=>void 0),rawInput:$(z().optional(),()=>void 0),rawOutput:$(z().optional(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),ZX=I(),WCe=Qi([W(`allow_once`),W(`allow_always`),W(`reject_once`),W(`reject_always`)]),QX=V({sessionId:zX,toolCall:XX,options:B(V({optionId:ZX,name:I(),kind:WCe,_meta:$(H(I(),z()).nullish(),()=>void 0)})),_meta:$(H(I(),z()).nullish(),()=>void 0)}),$X=V({name:I(),value:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),eZ=V({sessionId:zX,command:I(),args:$(LX(I()).optional(),()=>[]),env:$(LX($X).optional(),()=>[]),cwd:$(I().nullish(),()=>void 0),outputByteLimit:$(L().nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),tZ=V({sessionId:zX,terminalId:qX,_meta:$(H(I(),z()).nullish(),()=>void 0)}),nZ=V({sessionId:zX,terminalId:qX,_meta:$(H(I(),z()).nullish(),()=>void 0)}),rZ=V({sessionId:zX,terminalId:qX,_meta:$(H(I(),z()).nullish(),()=>void 0)}),iZ=V({sessionId:zX,terminalId:qX,_meta:$(H(I(),z()).nullish(),()=>void 0)}),aZ=V({sessionId:zX,toolCallId:$(HX.nullish(),()=>void 0)}),oZ=V({requestId:RX}),GCe=W(`object`),KCe=Qi([W(`email`),W(`uri`),W(`date`),W(`date-time`)]),sZ=V({const:I(),title:I(),description:$(I().nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),cZ=V({title:$(I().nullish(),()=>void 0),description:$(I().nullish(),()=>void 0),minLength:Gi().gte(0).max(4294967295,{error:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),maxLength:Gi().gte(0).max(4294967295,{error:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),pattern:I().nullish(),format:KCe.nullish(),default:$(I().nullish(),()=>void 0),enum:B(I()).nullish(),oneOf:B(sZ).nullish(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),lZ=V({title:$(I().nullish(),()=>void 0),description:$(I().nullish(),()=>void 0),minimum:L().nullish(),maximum:L().nullish(),default:$(L().nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),uZ=V({title:$(I().nullish(),()=>void 0),description:$(I().nullish(),()=>void 0),minimum:L().nullish(),maximum:L().nullish(),default:$(L().nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),dZ=V({title:$(I().nullish(),()=>void 0),description:$(I().nullish(),()=>void 0),default:$(R().nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),fZ=V({enum:B(I()),_meta:$(H(I(),z()).nullish(),()=>void 0)}),qCe=V({anyOf:B(sZ),_meta:$(H(I(),z()).nullish(),()=>void 0)}),JCe=IX(Qi([fZ.and(V({type:W(`string`)})),FX(V({type:I()}),`type`,[`string`]),qCe]),`type`,[`string`]),pZ=V({title:$(I().nullish(),()=>void 0),description:$(I().nullish(),()=>void 0),minItems:L().nullish(),maxItems:L().nullish(),items:JCe,default:$(LX(I()).nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),YCe=IX(Qi([cZ.and(V({type:W(`string`)})),lZ.and(V({type:W(`number`)})),uZ.and(V({type:W(`integer`)})),dZ.and(V({type:W(`boolean`)})),pZ.and(V({type:W(`array`)})),FX(V({type:I()}),`type`,[`array`,`boolean`,`integer`,`number`,`string`])]),`type`,[`array`,`boolean`,`integer`,`number`,`string`]),XCe=V({type:$(GCe.optional().default(`object`),()=>`object`),title:$(I().nullish(),()=>void 0),properties:H(I(),YCe).optional().default({}),required:B(I()).nullish(),description:$(I().nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),mZ=ea(Qi([aZ,oZ]),V({requestedSchema:XCe})),hZ=I(),gZ=ea(Qi([aZ,oZ]),V({elicitationId:hZ,url:Ui()})),_Z=IX(ea(Qi([mZ.and(V({mode:W(`form`)})),gZ.and(V({mode:W(`url`)})),FX(ea(Qi([aZ,oZ]),V({mode:I()})),`mode`,[`form`,`url`])]),V({message:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)})),`mode`,[`form`,`url`]),vZ=I(),ZCe=V({serverId:vZ,_meta:$(H(I(),z()).nullish(),()=>void 0)}),yZ=I(),bZ=V({connectionId:yZ,method:I(),params:H(I(),z()).nullish(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),QCe=V({connectionId:yZ,_meta:$(H(I(),z()).nullish(),()=>void 0)}),xZ=z();V({id:RX,method:I(),params:Qi([BX,VX,QX,eZ,tZ,nZ,rZ,iZ,_Z,ZCe,bZ,QCe,xZ]).nullish()});const SZ=Gi().gte(0).lte(65535),$Ce=V({image:$(R().optional().default(!1),()=>!1),audio:$(R().optional().default(!1),()=>!1),embeddedContext:$(R().optional().default(!1),()=>!1),_meta:$(H(I(),z()).nullish(),()=>void 0)}),ewe=V({http:$(R().optional().default(!1),()=>!1),sse:$(R().optional().default(!1),()=>!1),acp:$(R().optional().default(!1),()=>!1),_meta:$(H(I(),z()).nullish(),()=>void 0)}),twe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),nwe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),rwe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),iwe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),awe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),owe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),swe=V({list:$(twe.nullish(),()=>void 0),delete:$(nwe.nullish(),()=>void 0),additionalDirectories:$(rwe.nullish(),()=>void 0),fork:$(iwe.nullish(),()=>void 0),resume:$(awe.nullish(),()=>void 0),close:$(owe.nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),cwe=V({logout:$(V({_meta:$(H(I(),z()).nullish(),()=>void 0)}).nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),lwe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),uwe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),dwe=V({syncKind:Qi([W(`full`),W(`incremental`)]),_meta:$(H(I(),z()).nullish(),()=>void 0)}),fwe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),pwe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),mwe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),hwe=V({document:$(V({didOpen:$(uwe.nullish(),()=>void 0),didChange:$(dwe.nullish(),()=>void 0),didClose:$(fwe.nullish(),()=>void 0),didSave:$(pwe.nullish(),()=>void 0),didFocus:$(mwe.nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}).nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),gwe=V({maxCount:$(Gi().gte(0).max(4294967295,{error:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),_we=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),vwe=V({maxCount:$(Gi().gte(0).max(4294967295,{error:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),ywe=V({maxCount:$(Gi().gte(0).max(4294967295,{error:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),bwe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),xwe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),Swe=V({recentFiles:$(gwe.nullish(),()=>void 0),relatedSnippets:$(_we.nullish(),()=>void 0),editHistory:$(vwe.nullish(),()=>void 0),userActions:$(ywe.nullish(),()=>void 0),openFiles:$(bwe.nullish(),()=>void 0),diagnostics:$(xwe.nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),Cwe=V({events:$(hwe.nullish(),()=>void 0),context:$(Swe.nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),CZ=Qi([W(`utf-16`),W(`utf-32`),W(`utf-8`)]),wwe=V({loadSession:$(R().optional().default(!1),()=>!1),promptCapabilities:$($Ce.optional().default({image:!1,audio:!1,embeddedContext:!1}),()=>({image:!1,audio:!1,embeddedContext:!1})),mcpCapabilities:$(ewe.optional().default({http:!1,sse:!1,acp:!1}),()=>({http:!1,sse:!1,acp:!1})),sessionCapabilities:$(swe.optional().default({}),()=>({})),auth:$(cwe.optional().default({}),()=>({})),providers:$(lwe.nullish(),()=>void 0),nes:$(Cwe.nullish(),()=>void 0),positionEncoding:$(CZ.nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),wZ=I(),Twe=V({name:I(),label:$(I().nullish(),()=>void 0),secret:$(R().optional().default(!0),()=>!0),optional:$(R().optional().default(!1),()=>!1),_meta:$(H(I(),z()).nullish(),()=>void 0)}),Ewe=V({id:wZ,name:I(),description:$(I().nullish(),()=>void 0),vars:NX(LX(Twe),()=>[]),link:$(I().nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),Dwe=V({id:wZ,name:I(),description:$(I().nullish(),()=>void 0),args:$(LX(I()).optional(),()=>[]),env:$(H(I(),I()).optional(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),Owe=V({id:wZ,name:I(),description:$(I().nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),kwe=Qi([Ewe.and(V({type:W(`env_var`)})),Dwe.and(V({type:W(`terminal`)})),Owe]),TZ=V({name:I(),title:$(I().nullish(),()=>void 0),version:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),Awe=V({protocolVersion:SZ,agentCapabilities:$(wwe.optional().default({loadSession:!1,promptCapabilities:{image:!1,audio:!1,embeddedContext:!1},mcpCapabilities:{http:!1,sse:!1,acp:!1},sessionCapabilities:{},auth:{}}),()=>({loadSession:!1,promptCapabilities:{image:!1,audio:!1,embeddedContext:!1},mcpCapabilities:{http:!1,sse:!1,acp:!1},sessionCapabilities:{},auth:{}})),authMethods:$(LX(kwe).optional().default([]),()=>[]),agentInfo:$(TZ.nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),jwe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),EZ=I(),DZ=Qi([W(`anthropic`),W(`openai`),W(`azure`),W(`vertex`),W(`bedrock`),I()]),Mwe=V({apiType:DZ,baseUrl:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),Nwe=V({providers:B(V({providerId:EZ,supported:NX(LX(DZ),()=>[]),required:R(),current:Mwe.nullish(),_meta:$(H(I(),z()).nullish(),()=>void 0)})),_meta:$(H(I(),z()).nullish(),()=>void 0)}),Pwe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),Fwe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),Iwe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),OZ=I(),kZ=V({currentModeId:OZ,availableModes:NX(LX(V({id:OZ,name:I(),description:$(I().nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)})),()=>[]),_meta:$(H(I(),z()).nullish(),()=>void 0)}),AZ=I(),Lwe=Qi([W(`mode`),W(`model`),W(`model_config`),W(`thought_level`),I()]),jZ=I(),MZ=V({value:jZ,name:I(),description:$(I().nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),Rwe=V({group:I(),name:I(),options:NX(LX(MZ),()=>[]),_meta:$(H(I(),z()).nullish(),()=>void 0)}),zwe=V({currentValue:jZ,options:Qi([B(MZ),B(Rwe)])}),Bwe=V({currentValue:R()}),NZ=ea(Qi([zwe.and(V({type:W(`select`)})),Bwe.and(V({type:W(`boolean`)}))]),V({id:AZ,name:I(),description:$(I().nullish(),()=>void 0),category:$(Lwe.nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)})),Vwe=V({sessionId:zX,modes:$(kZ.nullish(),()=>void 0),configOptions:$(LX(NZ).nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),Hwe=V({modes:$(kZ.nullish(),()=>void 0),configOptions:$(LX(NZ).nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),Uwe=V({sessions:NX(LX(V({sessionId:zX,cwd:I(),additionalDirectories:$(LX(I()).optional(),()=>[]),title:$(I().nullish(),()=>void 0),updatedAt:$(I().nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)})),()=>[]),nextCursor:$(I().nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),Wwe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),Gwe=V({sessionId:zX,modes:$(kZ.nullish(),()=>void 0),configOptions:$(LX(NZ).nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),Kwe=V({modes:$(kZ.nullish(),()=>void 0),configOptions:$(LX(NZ).nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),qwe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),Jwe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),Ywe=V({configOptions:NX(LX(NZ),()=>[]),_meta:$(H(I(),z()).nullish(),()=>void 0)}),Xwe=V({stopReason:Qi([W(`end_turn`),W(`max_tokens`),W(`max_turn_requests`),W(`refusal`),W(`cancelled`)]),usage:$(V({totalTokens:L(),inputTokens:L(),outputTokens:L(),thoughtTokens:$(L().nullish(),()=>void 0),cachedReadTokens:$(L().nullish(),()=>void 0),cachedWriteTokens:$(L().nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}).nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),Zwe=V({sessionId:zX,_meta:$(H(I(),z()).nullish(),()=>void 0)}),PZ=I(),FZ=V({line:Gi().gte(0).max(4294967295,{error:`Invalid value: Expected uint32 to be <= 4294967295`}),character:Gi().gte(0).max(4294967295,{error:`Invalid value: Expected uint32 to be <= 4294967295`}),_meta:$(H(I(),z()).nullish(),()=>void 0)}),IZ=V({start:FZ,end:FZ,_meta:$(H(I(),z()).nullish(),()=>void 0)}),Qwe=V({range:IZ,newText:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),$we=V({id:PZ,uri:I(),edits:B(Qwe),cursorPosition:$(FZ.nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),eTe=V({id:PZ,uri:I(),position:FZ,_meta:$(H(I(),z()).nullish(),()=>void 0)}),tTe=V({id:PZ,uri:I(),position:FZ,newName:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),nTe=V({id:PZ,uri:I(),search:I(),replace:I(),isRegex:R().nullish(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),rTe=V({suggestions:B(Qi([$we.and(V({kind:W(`edit`)})),eTe.and(V({kind:W(`jump`)})),tTe.and(V({kind:W(`rename`)})),nTe.and(V({kind:W(`searchAndReplace`)}))])),_meta:$(H(I(),z()).nullish(),()=>void 0)}),iTe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),LZ=z(),RZ=z(),zZ=V({code:Qi([W(-32700),W(-32600),W(-32601),W(-32602),W(-32603),W(-32800),W(-32e3),W(-32002),Gi().min(-2147483648,{error:`Invalid value: Expected int32 to be >= -2147483648`}).max(2147483647,{error:`Invalid value: Expected int32 to be <= 2147483647`})]),message:I(),data:$(z().optional(),()=>void 0)});Qi([V({id:RX,result:Qi([Awe,jwe,Nwe,Pwe,Fwe,Iwe,Vwe,Hwe,Uwe,Wwe,Gwe,Kwe,qwe,Jwe,Ywe,Xwe,Zwe,rTe,iTe,LZ,RZ])}),V({id:RX,error:zZ})]);const BZ=V({content:KX,messageId:$(I().nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),aTe=V({toolCallId:HX,title:I(),kind:$(UX.optional(),()=>void 0),status:$(WX.optional(),()=>void 0),content:$(LX(JX).optional(),()=>[]),locations:$(LX(YX).optional(),()=>[]),rawInput:$(z().optional(),()=>void 0),rawOutput:$(z().optional(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),oTe=Qi([W(`high`),W(`medium`),W(`low`)]),sTe=Qi([W(`pending`),W(`in_progress`),W(`completed`)]),VZ=V({content:I(),priority:oTe,status:sTe,_meta:$(H(I(),z()).nullish(),()=>void 0)}),cTe=V({entries:NX(LX(VZ),()=>[]),_meta:$(H(I(),z()).nullish(),()=>void 0)}),HZ=I(),lTe=V({planId:HZ,entries:NX(LX(VZ),()=>[]),_meta:$(H(I(),z()).nullish(),()=>void 0)}),uTe=V({planId:HZ,uri:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),dTe=V({planId:HZ,content:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),fTe=V({plan:Qi([lTe.and(V({type:W(`items`)})),uTe.and(V({type:W(`file`)})),dTe.and(V({type:W(`markdown`)}))]),_meta:$(H(I(),z()).nullish(),()=>void 0)}),pTe=V({planId:HZ,_meta:$(H(I(),z()).nullish(),()=>void 0)}),mTe=V({hint:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),hTe=V({availableCommands:NX(LX(V({name:I(),description:I(),input:$(mTe.nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)})),()=>[]),_meta:$(H(I(),z()).nullish(),()=>void 0)}),gTe=V({currentModeId:OZ,_meta:$(H(I(),z()).nullish(),()=>void 0)}),_Te=V({configOptions:NX(LX(NZ),()=>[]),_meta:$(H(I(),z()).nullish(),()=>void 0)}),vTe=V({title:$(I().nullish(),()=>void 0),updatedAt:$(I().nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),yTe=V({amount:L(),currency:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),bTe=V({used:L(),size:L(),cost:$(yTe.nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),UZ=V({sessionId:zX,update:Qi([BZ.and(V({sessionUpdate:W(`user_message_chunk`)})),BZ.and(V({sessionUpdate:W(`agent_message_chunk`)})),BZ.and(V({sessionUpdate:W(`agent_thought_chunk`)})),aTe.and(V({sessionUpdate:W(`tool_call`)})),XX.and(V({sessionUpdate:W(`tool_call_update`)})),cTe.and(V({sessionUpdate:W(`plan`)})),fTe.and(V({sessionUpdate:W(`plan_update`)})),pTe.and(V({sessionUpdate:W(`plan_removed`)})),hTe.and(V({sessionUpdate:W(`available_commands_update`)})),gTe.and(V({sessionUpdate:W(`current_mode_update`)})),_Te.and(V({sessionUpdate:W(`config_option_update`)})),vTe.and(V({sessionUpdate:W(`session_info_update`)})),bTe.and(V({sessionUpdate:W(`usage_update`)}))]),_meta:$(H(I(),z()).nullish(),()=>void 0)}),WZ=V({elicitationId:hZ,_meta:$(H(I(),z()).nullish(),()=>void 0)}),GZ=V({connectionId:yZ,method:I(),params:$(H(I(),z()).nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),KZ=z();V({method:I(),params:Qi([UZ,WZ,GZ,KZ]).nullish()});const xTe=V({readTextFile:$(R().optional().default(!1),()=>!1),writeTextFile:$(R().optional().default(!1),()=>!1),_meta:$(H(I(),z()).nullish(),()=>void 0)}),STe=V({configOptions:$(V({boolean:$(V({_meta:$(H(I(),z()).nullish(),()=>void 0)}).nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}).nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),CTe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),wTe=V({terminal:$(R().optional().default(!1),()=>!1),_meta:$(H(I(),z()).nullish(),()=>void 0)}),TTe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),ETe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),DTe=V({form:$(TTe.nullish(),()=>void 0),url:$(ETe.nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),OTe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),kTe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),ATe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),jTe=V({jump:$(OTe.nullish(),()=>void 0),rename:$(kTe.nullish(),()=>void 0),searchAndReplace:$(ATe.nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),qZ=V({protocolVersion:SZ,clientCapabilities:$(V({fs:$(xTe.optional().default({readTextFile:!1,writeTextFile:!1}),()=>({readTextFile:!1,writeTextFile:!1})),terminal:$(R().optional().default(!1),()=>!1),session:$(STe.nullish(),()=>void 0),plan:$(CTe.nullish(),()=>void 0),auth:$(wTe.optional().default({terminal:!1}),()=>({terminal:!1})),elicitation:$(DTe.nullish(),()=>void 0),nes:$(jTe.nullish(),()=>void 0),positionEncodings:$(LX(CZ).optional(),()=>[]),_meta:$(H(I(),z()).nullish(),()=>void 0)}).optional().default({fs:{readTextFile:!1,writeTextFile:!1},terminal:!1,auth:{terminal:!1}}),()=>({fs:{readTextFile:!1,writeTextFile:!1},terminal:!1,auth:{terminal:!1}})),clientInfo:$(TZ.nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),JZ=V({methodId:wZ,_meta:$(H(I(),z()).nullish(),()=>void 0)}),YZ=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),XZ=V({providerId:EZ,apiType:DZ,baseUrl:I(),headers:H(I(),I()).optional(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),ZZ=V({providerId:EZ,_meta:$(H(I(),z()).nullish(),()=>void 0)}),QZ=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),$Z=V({name:I(),value:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),MTe=V({name:I(),url:I(),headers:B($Z),_meta:$(H(I(),z()).nullish(),()=>void 0)}),NTe=V({name:I(),url:I(),headers:B($Z),_meta:$(H(I(),z()).nullish(),()=>void 0)}),PTe=V({name:I(),serverId:vZ,_meta:$(H(I(),z()).nullish(),()=>void 0)}),FTe=V({name:I(),command:I(),args:B(I()),env:B($X),_meta:$(H(I(),z()).nullish(),()=>void 0)}),eQ=Qi([MTe.and(V({type:W(`http`)})),NTe.and(V({type:W(`sse`)})),PTe.and(V({type:W(`acp`)})),FTe]),tQ=V({cwd:I(),additionalDirectories:$(LX(I()).optional(),()=>[]),mcpServers:NX(LX(eQ),()=>[]),_meta:$(H(I(),z()).nullish(),()=>void 0)}),nQ=V({mcpServers:NX(LX(eQ),()=>[]),cwd:I(),additionalDirectories:$(LX(I()).optional(),()=>[]),sessionId:zX,_meta:$(H(I(),z()).nullish(),()=>void 0)}),rQ=V({cwd:I().nullish(),cursor:I().nullish(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),iQ=V({sessionId:zX,_meta:$(H(I(),z()).nullish(),()=>void 0)}),aQ=V({sessionId:zX,cwd:I(),additionalDirectories:$(LX(I()).optional(),()=>[]),mcpServers:$(LX(eQ).optional(),()=>[]),_meta:$(H(I(),z()).nullish(),()=>void 0)}),oQ=V({sessionId:zX,cwd:I(),additionalDirectories:$(LX(I()).optional(),()=>[]),mcpServers:$(LX(eQ).optional(),()=>[]),_meta:$(H(I(),z()).nullish(),()=>void 0)}),sQ=V({sessionId:zX,_meta:$(H(I(),z()).nullish(),()=>void 0)}),cQ=V({sessionId:zX,modeId:OZ,_meta:$(H(I(),z()).nullish(),()=>void 0)}),lQ=ea(Qi([V({value:R(),type:W(`boolean`)}),V({value:jZ})]),V({sessionId:zX,configId:AZ,_meta:$(H(I(),z()).nullish(),()=>void 0)})),uQ=V({sessionId:zX,prompt:B(KX),_meta:$(H(I(),z()).nullish(),()=>void 0)}),ITe=V({uri:I(),name:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),LTe=V({name:I(),owner:I(),remoteUrl:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),dQ=V({workspaceUri:$(I().nullish(),()=>void 0),workspaceFolders:B(ITe).nullish(),repository:$(LTe.nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),RTe=Qi([W(`automatic`),W(`diagnostic`),W(`manual`)]),zTe=V({uri:I(),languageId:I(),text:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),BTe=V({startLine:Gi().gte(0).max(4294967295,{error:`Invalid value: Expected uint32 to be <= 4294967295`}),endLine:Gi().gte(0).max(4294967295,{error:`Invalid value: Expected uint32 to be <= 4294967295`}),text:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),VTe=V({uri:I(),excerpts:B(BTe),_meta:$(H(I(),z()).nullish(),()=>void 0)}),HTe=V({uri:I(),diff:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),UTe=V({action:I(),uri:I(),position:FZ,timestampMs:L(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),WTe=V({uri:I(),languageId:I(),visibleRange:$(IZ.nullish(),()=>void 0),lastFocusedMs:$(L().nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),GTe=Qi([W(`error`),W(`warning`),W(`information`),W(`hint`)]),KTe=V({uri:I(),range:IZ,severity:GTe,message:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),qTe=V({recentFiles:B(zTe).nullish(),relatedSnippets:B(VTe).nullish(),editHistory:B(HTe).nullish(),userActions:B(UTe).nullish(),openFiles:B(WTe).nullish(),diagnostics:B(KTe).nullish(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),fQ=V({sessionId:zX,uri:I(),version:L(),position:FZ,selection:IZ.nullish(),triggerKind:RTe,context:qTe.nullish(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),pQ=V({sessionId:zX,_meta:$(H(I(),z()).nullish(),()=>void 0)});V({id:RX,method:I(),params:Qi([qZ,JZ,YZ,XZ,ZZ,QZ,tQ,nQ,rQ,iQ,aQ,oQ,sQ,cQ,lQ,uQ,dQ,fQ,pQ,bZ,xZ]).nullish()});const JTe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),YTe=V({content:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),XTe=V({optionId:ZX,_meta:$(H(I(),z()).nullish(),()=>void 0)}),ZTe=V({outcome:Qi([V({outcome:W(`cancelled`)}),XTe.and(V({outcome:W(`selected`)}))]),_meta:$(H(I(),z()).nullish(),()=>void 0)}),QTe=V({terminalId:qX,_meta:$(H(I(),z()).nullish(),()=>void 0)}),$Te=V({exitCode:$(Gi().gte(0).max(4294967295,{error:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),()=>void 0),signal:$(I().nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),eEe=V({output:I(),truncated:R(),exitStatus:$($Te.nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),tEe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),nEe=V({exitCode:$(Gi().gte(0).max(4294967295,{error:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),()=>void 0),signal:$(I().nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),rEe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),iEe=Qi([I(),L(),L(),R(),B(I())]),mQ=V({content:H(I(),iEe).nullish()});Qi([V({id:RX,result:Qi([JTe,YTe,ZTe,QTe,eEe,tEe,nEe,rEe,IX(ea(Qi([mQ.and(V({action:W(`accept`)})),V({action:W(`decline`)}),V({action:W(`cancel`)}),FX(V({action:I()}),`action`,[`accept`,`cancel`,`decline`])]),V({_meta:$(H(I(),z()).nullish(),()=>void 0)})),`action`,[`accept`,`cancel`,`decline`]),V({connectionId:yZ,_meta:$(H(I(),z()).nullish(),()=>void 0)}),V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),RZ,LZ])}),V({id:RX,error:zZ})]);const hQ=V({sessionId:zX,_meta:$(H(I(),z()).nullish(),()=>void 0)}),gQ=V({sessionId:zX,uri:I(),languageId:I(),version:L(),text:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),aEe=V({range:IZ.nullish(),text:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),_Q=V({sessionId:zX,uri:I(),version:L(),contentChanges:NX(LX(aEe),()=>[]),_meta:$(H(I(),z()).nullish(),()=>void 0)}),vQ=V({sessionId:zX,uri:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),yQ=V({sessionId:zX,uri:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),bQ=V({sessionId:zX,uri:I(),version:L(),position:FZ,visibleRange:IZ,_meta:$(H(I(),z()).nullish(),()=>void 0)}),xQ=V({sessionId:zX,id:PZ,_meta:$(H(I(),z()).nullish(),()=>void 0)}),SQ=V({sessionId:zX,id:PZ,reason:$(Qi([W(`rejected`),W(`ignored`),W(`replaced`),W(`cancelled`)]).nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)});V({method:I(),params:Qi([hQ,gQ,_Q,vQ,yQ,bQ,xQ,SQ,GZ,KZ]).nullish()}),V({requestId:RX,_meta:$(H(I(),z()).nullish(),()=>void 0)}),mZ.and(V({mode:W(`form`)})).and(V({message:I()})),gZ.and(V({mode:W(`url`)})).and(V({message:I()})),Qi([aZ,oZ]).and(V({message:I()})),cZ.and(V({type:W(`string`)})),lZ.and(V({type:W(`number`)})),uZ.and(V({type:W(`integer`)})),dZ.and(V({type:W(`boolean`)})),pZ.and(V({type:W(`array`)})),fZ.and(V({type:W(`string`)})),mQ.and(V({action:W(`accept`)})),V({action:W(`decline`)}),V({action:W(`cancel`)});function CQ(e){return e??{}}AX.initialize,AX.authenticate,AX.logout,AX.providers_list,AX.providers_set,AX.providers_disable,AX.session_new,AX.session_load,AX.session_list,AX.session_delete,AX.session_fork,AX.session_resume,AX.session_close,AX.session_set_mode,AX.session_set_config_option,AX.session_prompt,AX.session_cancel,AX.nes_start,AX.nes_suggest,AX.nes_accept,AX.nes_reject,AX.nes_close,AX.document_did_open,AX.document_did_change,AX.document_did_close,AX.document_did_save,AX.document_did_focus,jX.session_request_permission,jX.session_update,jX.fs_write_text_file,jX.fs_read_text_file,jX.terminal_create,jX.terminal_output,jX.terminal_release,jX.terminal_wait_for_exit,jX.terminal_kill,jX.elicitation_create,jX.elicitation_complete,PCe.cancel_request;function wQ(e,t,n){return{method:e,params:t,mapResponse:n}}function TQ(e,t){return{method:e,params:t}}function EQ(e){let t={};for(let n of Object.values(e))t[n.method]=n;return t}const oEe={initialize:wQ(AX.initialize,qZ),newSession:wQ(AX.session_new,tQ),loadSession:wQ(AX.session_load,nQ,CQ),unstable_forkSession:wQ(AX.session_fork,aQ),listSessions:wQ(AX.session_list,rQ),deleteSession:wQ(AX.session_delete,iQ,CQ),resumeSession:wQ(AX.session_resume,oQ),closeSession:wQ(AX.session_close,sQ,CQ),setSessionMode:wQ(AX.session_set_mode,cQ,CQ),setSessionConfigOption:wQ(AX.session_set_config_option,lQ),authenticate:wQ(AX.authenticate,JZ,CQ),unstable_listProviders:wQ(AX.providers_list,YZ),unstable_setProvider:wQ(AX.providers_set,XZ,CQ),unstable_disableProvider:wQ(AX.providers_disable,ZZ,CQ),logout:wQ(AX.logout,QZ,CQ),prompt:wQ(AX.session_prompt,uQ),unstable_startNes:wQ(AX.nes_start,dQ),unstable_suggestNes:wQ(AX.nes_suggest,fQ),unstable_closeNes:wQ(AX.nes_close,pQ,CQ)},sEe={cancel:TQ(AX.session_cancel,hQ),unstable_didOpenDocument:TQ(AX.document_did_open,gQ),unstable_didChangeDocument:TQ(AX.document_did_change,_Q),unstable_didCloseDocument:TQ(AX.document_did_close,vQ),unstable_didSaveDocument:TQ(AX.document_did_save,yQ),unstable_didFocusDocument:TQ(AX.document_did_focus,bQ),unstable_acceptNes:TQ(AX.nes_accept,xQ),unstable_rejectNes:TQ(AX.nes_reject,SQ)},cEe={requestPermission:wQ(jX.session_request_permission,QX),writeTextFile:wQ(jX.fs_write_text_file,BX,CQ),readTextFile:wQ(jX.fs_read_text_file,VX),createTerminal:wQ(jX.terminal_create,eZ),terminalOutput:wQ(jX.terminal_output,tZ),releaseTerminal:wQ(jX.terminal_release,nZ,CQ),waitForTerminalExit:wQ(jX.terminal_wait_for_exit,rZ),killTerminal:wQ(jX.terminal_kill,iZ,CQ),unstable_createElicitation:wQ(jX.elicitation_create,_Z)},lEe={sessionUpdate:TQ(jX.session_update,UZ),unstable_completeElicitation:TQ(jX.elicitation_complete,WZ)};EQ(oEe),EQ(sEe),EQ(cEe),EQ(lEe),AX.initialize,AX.authenticate,AX.providers_list,AX.providers_set,AX.providers_disable,AX.session_new,AX.session_load,AX.session_set_mode,AX.session_set_config_option,AX.session_prompt,AX.session_list,AX.session_delete,AX.session_fork,AX.session_resume,AX.session_close,AX.logout,AX.nes_start,AX.nes_suggest,AX.nes_close,AX.session_cancel,AX.nes_accept,AX.nes_reject,AX.document_did_open,AX.document_did_change,AX.document_did_close,AX.document_did_save,AX.document_did_focus,jX.session_request_permission,jX.fs_write_text_file,jX.fs_read_text_file,jX.terminal_create,jX.terminal_output,jX.terminal_release,jX.terminal_wait_for_exit,jX.terminal_kill,jX.elicitation_create,jX.session_update,jX.elicitation_complete;var uEe=i(((e,t)=>{function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}let r=new Int32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117]);function i(e){if(Buffer.isBuffer(e))return e;if(typeof e==`number`)return Buffer.alloc(e);if(typeof e==`string`)return Buffer.from(e);throw Error(`input must be buffer, number, or string, received `+typeof e)}function a(e){let t=i(4);return t.writeInt32BE(e,0),t}function o(e,t){e=i(e),Buffer.isBuffer(t)&&(t=t.readUInt32BE(0));let n=~~t^-1;for(var a=0;a<e.length;a++)n=r[(n^e[a])&255]^n>>>8;return n^-1}function s(){return a(o.apply(null,arguments))}s.signed=function(){return o.apply(null,arguments)},s.unsigned=function(){return o.apply(null,arguments)>>>0},t.exports=n(s)})),DQ=i((e=>{var n=t(`fs`),r=t(`stream`).Transform,i=t(`stream`).PassThrough,a=t(`zlib`),o=t(`util`),s=t(`events`).EventEmitter,c=t(`events`).errorMonitor,l=uEe();e.ZipFile=u,e.dateToDosDateTime=se,o.inherits(u,s);function u(){this.outputStream=new i,this.entries=[],this.outputStreamCursor=0,this.ended=!1,this.allDone=!1,this.forceZip64Eocd=!1,this.errored=!1,this.on(c,function(){this.errored=!0})}u.prototype.addFile=function(e,t,r){var i=this;if(t=S(t,!1),r??={},!_(i)){var a=new w(t,!1,r);i.entries.push(a),n.stat(e,function(t,o){if(t)return i.emit(`error`,t);if(!o.isFile())return i.emit(`error`,Error(`not a file: `+e));a.uncompressedSize=o.size,r.mtime??a.setLastModDate(o.mtime),r.mode??a.setFileAttributesMode(o.mode),a.setFileDataPumpFunction(function(){var t=n.createReadStream(e);a.state=w.FILE_DATA_IN_PROGRESS,t.on(`error`,function(e){i.emit(`error`,e)}),p(i,a,t)}),h(i)})}},u.prototype.addReadStream=function(e,t,n){this.addReadStreamLazy(t,n,function(t){t(null,e)})},u.prototype.addReadStreamLazy=function(e,t,n){var r=this;if(typeof t==`function`&&(n=t,t=null),t??={},e=S(e,!1),!_(r)){var i=new w(e,!1,t);r.entries.push(i),i.setFileDataPumpFunction(function(){i.state=w.FILE_DATA_IN_PROGRESS,n(function(e,t){if(e)return r.emit(`error`,e);p(r,i,t)})}),h(r)}},u.prototype.addBuffer=function(e,t,n){var r=this;if(t=S(t,!1),e.length>1073741823)throw Error(`buffer too large: `+e.length+` > 1073741823`);if(n??={},n.size!=null)throw Error(`options.size not allowed`);if(_(r))return;var i=new w(t,!1,n);i.uncompressedSize=e.length,i.crc32=l.unsigned(e),i.crcAndFileSizeKnown=!0,r.entries.push(i),i.compressionLevel===0?o(e):a.deflateRaw(e,{level:i.compressionLevel},function(e,t){o(t)});function o(e){i.compressedSize=e.length,i.setFileDataPumpFunction(function(){f(r,e),f(r,i.getDataDescriptor()),i.state=w.FILE_DATA_DONE,setImmediate(function(){h(r)})}),h(r)}},u.prototype.addEmptyDirectory=function(e,t){var n=this;if(e=S(e,!0),t??={},t.size!=null)throw Error(`options.size not allowed`);if(t.compress!=null)throw Error(`options.compress not allowed`);if(t.compressionLevel!=null)throw Error(`options.compressionLevel not allowed`);if(!_(n)){var r=new w(e,!0,t);n.entries.push(r),r.setFileDataPumpFunction(function(){f(n,r.getDataDescriptor()),r.state=w.FILE_DATA_DONE,h(n)}),h(n)}};var d=fe([80,75,5,6]);u.prototype.end=function(e,t){if(typeof e==`function`&&(t=e,e=null),e??={},!this.ended&&(this.ended=!0,!this.errored)){if(this.calculatedTotalSizeCallback=t,this.forceZip64Eocd=!!e.forceZip64Format,e.comment){if(this.comment=typeof e.comment==`string`?ue(e.comment):e.comment,this.comment.length>65535)throw Error(`comment is too large`);if(P(this.comment,d))throw Error(`comment contains end of central directory record signature`)}else this.comment=C;h(this)}};function f(e,t){e.outputStream.write(t),e.outputStreamCursor+=t.length}function p(e,t,n){var r=new M,o=new ce,s=t.compressionLevel===0?new i:new a.DeflateRaw({level:t.compressionLevel}),c=new ce;n.pipe(r).pipe(o).pipe(s).pipe(c).pipe(e.outputStream,{end:!1}),c.on(`end`,function(){if(t.crc32=r.crc32,t.uncompressedSize==null)t.uncompressedSize=o.byteCount;else if(t.uncompressedSize!==o.byteCount)return e.emit(`error`,Error(`file data stream has unexpected number of bytes`));t.compressedSize=c.byteCount,e.outputStreamCursor+=t.compressedSize,f(e,t.getDataDescriptor()),t.state=w.FILE_DATA_DONE,h(e)})}function m(e){if(e.compress!=null&&e.compressionLevel!=null&&!!e.compress!=!!e.compressionLevel)throw Error(`conflicting settings for compress and compressionLevel`);return e.compressionLevel==null?e.compress===!1?0:6:e.compressionLevel}function h(e){if(e.allDone||e.errored)return;if(e.ended&&e.calculatedTotalSizeCallback!=null){var t=g(e);t!=null&&(e.calculatedTotalSizeCallback(t),e.calculatedTotalSizeCallback=null)}var n=r();function r(){for(var t=0;t<e.entries.length;t++){var n=e.entries[t];if(n.state<w.FILE_DATA_DONE)return n}return null}if(n!=null){if(n.state<w.READY_TO_PUMP_FILE_DATA||n.state===w.FILE_DATA_IN_PROGRESS)return;n.relativeOffsetOfLocalHeader=e.outputStreamCursor,f(e,n.getLocalFileHeader()),n.doFileDataPump()}else e.ended&&(e.offsetOfStartOfCentralDirectory=e.outputStreamCursor,e.entries.forEach(function(t){f(e,t.getCentralDirectoryRecord())}),f(e,x(e)),e.outputStream.end(),e.allDone=!0)}function g(e){for(var t=0,n=0,r=0;r<e.entries.length;r++){var i=e.entries[r];if(i.compressionLevel!==0)return-1;if(i.state>=w.READY_TO_PUMP_FILE_DATA){if(i.uncompressedSize==null)return-1}else if(i.uncompressedSize==null)return null;i.relativeOffsetOfLocalHeader=t;var a=i.useZip64Format();t+=T+i.utf8FileName.length,t+=i.uncompressedSize,i.crcAndFileSizeKnown||(t+=a?ie:re),n+=O+i.utf8FileName.length+i.fileComment.length,i.forceDosTimestamp||(n+=ae),a&&(n+=oe)}var o=0;return(e.forceZip64Eocd||e.entries.length>=65535||n>=65535||t>=4294967295)&&(o+=v+y),o+=b+e.comment.length,t+n+o}function _(e){if(e.ended)throw Error(`cannot add entries after calling end()`);return!!e.errored}var v=56,y=20,b=22;function x(e,t){var n=!1,r=e.entries.length;(e.forceZip64Eocd||e.entries.length>=65535)&&(r=65535,n=!0);var i=e.outputStreamCursor-e.offsetOfStartOfCentralDirectory,a=i;(e.forceZip64Eocd||i>=4294967295)&&(a=4294967295,n=!0);var o=e.offsetOfStartOfCentralDirectory;if((e.forceZip64Eocd||e.offsetOfStartOfCentralDirectory>=4294967295)&&(o=4294967295,n=!0),t)return n?v+y+b:b;var s=de(b+e.comment.length);if(s.writeUInt32LE(101010256,0),s.writeUInt16LE(0,4),s.writeUInt16LE(0,6),s.writeUInt16LE(r,8),s.writeUInt16LE(r,10),s.writeUInt32LE(a,12),s.writeUInt32LE(o,16),s.writeUInt16LE(e.comment.length,20),e.comment.copy(s,22),!n)return s;var c=de(v);c.writeUInt32LE(101075792,0),j(c,v-12,4),c.writeUInt16LE(ee,12),c.writeUInt16LE(D,14),c.writeUInt32LE(0,16),c.writeUInt32LE(0,20),j(c,e.entries.length,24),j(c,e.entries.length,32),j(c,i,40),j(c,e.offsetOfStartOfCentralDirectory,48);var l=de(y);return l.writeUInt32LE(117853008,0),l.writeUInt32LE(0,4),j(l,e.outputStreamCursor,8),l.writeUInt32LE(1,16),Buffer.concat([c,l,s])}function S(e,t){if(e===``)throw Error(`empty metadataPath`);if(e=e.replace(/\\/g,`/`),/^[a-zA-Z]:/.test(e)||/^\//.test(e))throw Error(`absolute path: `+e);if(e.split(`/`).indexOf(`..`)!==-1)throw Error(`invalid relative path: `+e);var n=/\/$/.test(e);if(t)n||(e+=`/`);else if(n)throw Error(`file path cannot end with '/': `+e);return e}var C=de(0);function w(e,t,n){if(this.utf8FileName=fe(e),this.utf8FileName.length>65535)throw Error(`utf8 file name too long. `+utf8FileName.length+` > 65535`);if(this.isDirectory=t,this.state=w.WAITING_FOR_METADATA,this.setLastModDate(n.mtime==null?new Date:n.mtime),this.forceDosTimestamp=!!n.forceDosTimestamp,n.mode==null?this.setFileAttributesMode(t?16893:33204):this.setFileAttributesMode(n.mode),t?(this.crcAndFileSizeKnown=!0,this.crc32=0,this.uncompressedSize=0,this.compressedSize=0):(this.crcAndFileSizeKnown=!1,this.crc32=null,this.uncompressedSize=null,this.compressedSize=null,n.size!=null&&(this.uncompressedSize=n.size)),this.compressionLevel=t?0:m(n),this.forceZip64Format=!!n.forceZip64Format,n.fileComment){if(this.fileComment=typeof n.fileComment==`string`?fe(n.fileComment,`utf-8`):n.fileComment,this.fileComment.length>65535)throw Error(`fileComment is too large`)}else this.fileComment=C}w.WAITING_FOR_METADATA=0,w.READY_TO_PUMP_FILE_DATA=1,w.FILE_DATA_IN_PROGRESS=2,w.FILE_DATA_DONE=3,w.prototype.setLastModDate=function(e){this.mtime=e;var t=se(e);this.lastModFileTime=t.time,this.lastModFileDate=t.date},w.prototype.setFileAttributesMode=function(e){if((e&65535)!==e)throw Error(`invalid mode. expected: 0 <= `+e+` <= 65535`);this.externalFileAttributes=e<<16>>>0},w.prototype.setFileDataPumpFunction=function(e){this.doFileDataPump=e,this.state=w.READY_TO_PUMP_FILE_DATA},w.prototype.useZip64Format=function(){return this.forceZip64Format||this.uncompressedSize!=null&&this.uncompressedSize>4294967294||this.compressedSize!=null&&this.compressedSize>4294967294||this.relativeOffsetOfLocalHeader!=null&&this.relativeOffsetOfLocalHeader>4294967294};var T=30,E=20,D=45,ee=831,te=2048,ne=8;w.prototype.getLocalFileHeader=function(){var e=0,t=0,n=0;this.crcAndFileSizeKnown&&(e=this.crc32,t=this.compressedSize,n=this.uncompressedSize);var r=de(T),i=te;return this.crcAndFileSizeKnown||(i|=ne),r.writeUInt32LE(67324752,0),r.writeUInt16LE(E,4),r.writeUInt16LE(i,6),r.writeUInt16LE(this.getCompressionMethod(),8),r.writeUInt16LE(this.lastModFileTime,10),r.writeUInt16LE(this.lastModFileDate,12),r.writeUInt32LE(e,14),r.writeUInt32LE(t,18),r.writeUInt32LE(n,22),r.writeUInt16LE(this.utf8FileName.length,26),r.writeUInt16LE(0,28),Buffer.concat([r,this.utf8FileName])};var re=16,ie=24;w.prototype.getDataDescriptor=function(){if(this.crcAndFileSizeKnown)return C;if(this.useZip64Format()){var e=de(ie);return e.writeUInt32LE(134695760,0),e.writeUInt32LE(this.crc32,4),j(e,this.compressedSize,8),j(e,this.uncompressedSize,16),e}var e=de(re);return e.writeUInt32LE(134695760,0),e.writeUInt32LE(this.crc32,4),e.writeUInt32LE(this.compressedSize,8),e.writeUInt32LE(this.uncompressedSize,12),e};var O=46,ae=9,oe=28;w.prototype.getCentralDirectoryRecord=function(){var e=de(O),t=te;this.crcAndFileSizeKnown||(t|=ne);var n=C;if(!this.forceDosTimestamp){n=de(ae),n.writeUInt16LE(21589,0),n.writeUInt16LE(ae-4,2),n.writeUInt8(3,4);var r=Math.floor(this.mtime.getTime()/1e3);r<-2147483648&&(r=-2147483648),r>2147483647&&(r=2147483647),n.writeUInt32LE(r,5)}var i=this.compressedSize,a=this.uncompressedSize,o=this.relativeOffsetOfLocalHeader,s=E,c=C;return this.useZip64Format()&&(i=4294967295,a=4294967295,o=4294967295,s=D,c=de(oe),c.writeUInt16LE(1,0),c.writeUInt16LE(oe-4,2),j(c,this.uncompressedSize,4),j(c,this.compressedSize,12),j(c,this.relativeOffsetOfLocalHeader,20)),e.writeUInt32LE(33639248,0),e.writeUInt16LE(ee,4),e.writeUInt16LE(s,6),e.writeUInt16LE(t,8),e.writeUInt16LE(this.getCompressionMethod(),10),e.writeUInt16LE(this.lastModFileTime,12),e.writeUInt16LE(this.lastModFileDate,14),e.writeUInt32LE(this.crc32,16),e.writeUInt32LE(i,20),e.writeUInt32LE(a,24),e.writeUInt16LE(this.utf8FileName.length,28),e.writeUInt16LE(n.length+c.length,30),e.writeUInt16LE(this.fileComment.length,32),e.writeUInt16LE(0,34),e.writeUInt16LE(0,36),e.writeUInt32LE(this.externalFileAttributes,38),e.writeUInt32LE(o,42),Buffer.concat([e,this.utf8FileName,n,c,this.fileComment])},w.prototype.getCompressionMethod=function(){return this.compressionLevel===0?0:8};var k=new Date(1980,0,1),A=new Date(2107,11,31,23,59,58);function se(e){e<k?e=k:e>A&&(e=A);var t=0;t|=e.getDate()&31,t|=(e.getMonth()+1&15)<<5,t|=(e.getFullYear()-1980&127)<<9;var n=0;return n|=Math.floor(e.getSeconds()/2),n|=(e.getMinutes()&63)<<5,n|=(e.getHours()&31)<<11,{date:t,time:n}}function j(e,t,n){var r=Math.floor(t/4294967296),i=t%4294967296;e.writeUInt32LE(i,n),e.writeUInt32LE(r,n+4)}o.inherits(ce,r);function ce(e){r.call(this,e),this.byteCount=0}ce.prototype._transform=function(e,t,n){this.byteCount+=e.length,n(null,e)},o.inherits(M,r);function M(e){r.call(this,e),this.crc32=0}M.prototype._transform=function(e,t,n){this.crc32=l.unsigned(e,this.crc32),n(null,e)};var N=`\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■\xA0`;if(N.length!==256)throw Error(`assertion failure`);var le=null;function ue(e){if(/^[\x20-\x7e]*$/.test(e))return fe(e,`utf-8`);if(le==null){le={};for(var t=0;t<N.length;t++)le[N[t]]=t}for(var n=de(e.length),t=0;t<e.length;t++){var r=le[e[t]];if(r==null)throw Error(`character not encodable in CP437: `+JSON.stringify(e[t]));n[t]=r}return n}function de(e){de=t;try{return de(e)}catch{return de=n,de(e)}function t(e){return Buffer.allocUnsafe(e)}function n(e){return new Buffer(e)}}function fe(e,t){fe=n;try{return fe(e,t)}catch{return fe=r,fe(e,t)}function n(e,t){return Buffer.from(e,t)}function r(e,t){return new Buffer(e,t)}}function P(e,t){P=n;try{return P(e,t)}catch{return P=r,P(e,t)}function n(e,t){return e.includes(t)}function r(e,t){for(var n=0;n<=e.length-t.length;n++)for(var r=0;;r++){if(r===t.length)return!0;if(e[n+r]!==t[r])break}return!1}}})),dEe=i(((e,t)=>{function n(e){return Array.isArray(e)?e:[e]}let r=/^\s+$/,i=/(?:[^\\]|^)\\$/,a=/^\\!/,o=/^\\#/,s=/\r?\n/g,c=/^\.*\/|^\.+$/,l=`node-ignore`;typeof Symbol<`u`&&(l=Symbol.for(`node-ignore`));let u=l,d=(e,t,n)=>Object.defineProperty(e,t,{value:n}),f=/([0-z])-([0-z])/g,p=()=>!1,m=e=>e.replace(f,(e,t,n)=>t.charCodeAt(0)<=n.charCodeAt(0)?e:``),h=e=>{let{length:t}=e;return e.slice(0,t-t%2)},g=[[/^\uFEFF/,()=>``],[/((?:\\\\)*?)(\\?\s+)$/,(e,t,n)=>t+(n.indexOf(`\\`)===0?` `:``)],[/(\\+?)\s/g,(e,t)=>{let{length:n}=t;return t.slice(0,n-n%2)+` `}],[/[\\$.|*+(){^]/g,e=>`\\${e}`],[/(?!\\)\?/g,()=>`[^/]`],[/^\//,()=>`^`],[/\//g,()=>`\\/`],[/^\^*\\\*\\\*\\\//,()=>`^(?:.*\\/)?`],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?`^`:`(?:^|\\/)`}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(e,t,n)=>t+6<n.length?`(?:\\/[^\\/]+)*`:`\\/.+`],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(e,t,n)=>t+n.replace(/\\\*/g,`[^\\/]*`)],[/\\\\\\(?=[$.|*+(){^])/g,()=>`\\`],[/\\\\/g,()=>`\\`],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,n,r,i)=>t===`\\`?`\\[${n}${h(r)}${i}`:i===`]`&&r.length%2==0?`[${m(n)}${r}]`:`[]`],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(e,t)=>`${t?`${t}[^/]+`:`[^/]*`}(?=$|\\/$)`]],_=Object.create(null),v=(e,t)=>{let n=_[e];return n||(n=g.reduce((t,[n,r])=>t.replace(n,r.bind(e)),e),_[e]=n),t?new RegExp(n,`i`):new RegExp(n)},y=e=>typeof e==`string`,b=e=>e&&y(e)&&!r.test(e)&&!i.test(e)&&e.indexOf(`#`)!==0,x=e=>e.split(s);var S=class{constructor(e,t,n,r){this.origin=e,this.pattern=t,this.negative=n,this.regex=r}};let C=(e,t)=>{let n=e,r=!1;e.indexOf(`!`)===0&&(r=!0,e=e.substr(1)),e=e.replace(a,`!`).replace(o,`#`);let i=v(e,t);return new S(n,e,r,i)},w=(e,t)=>{throw new t(e)},T=(e,t,n)=>y(e)?e?!T.isNotRelative(e)||n(`path should be a \`path.relative()\`d string, but got "${t}"`,RangeError):n(`path must not be empty`,TypeError):n(`path must be a string, but got \`${t}\``,TypeError),E=e=>c.test(e);T.isNotRelative=E,T.convert=e=>e;var D=class{constructor({ignorecase:e=!0,ignoreCase:t=e,allowRelativePaths:n=!1}={}){d(this,u,!0),this._rules=[],this._ignoreCase=t,this._allowRelativePaths=n,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}_addPattern(e){if(e&&e[u]){this._rules=this._rules.concat(e._rules),this._added=!0;return}if(b(e)){let t=C(e,this._ignoreCase);this._added=!0,this._rules.push(t)}}add(e){return this._added=!1,n(y(e)?x(e):e).forEach(this._addPattern,this),this._added&&this._initCache(),this}addPattern(e){return this.add(e)}_testOne(e,t){let n=!1,r=!1;return this._rules.forEach(i=>{let{negative:a}=i;r===a&&n!==r||a&&!n&&!r&&!t||i.regex.test(e)&&(n=!a,r=a)}),{ignored:n,unignored:r}}_test(e,t,n,r){let i=e&&T.convert(e);return T(i,e,this._allowRelativePaths?p:w),this._t(i,t,n,r)}_t(e,t,n,r){if(e in t)return t[e];if(r||=e.split(`/`),r.pop(),!r.length)return t[e]=this._testOne(e,n);let i=this._t(r.join(`/`)+`/`,t,n,r);return t[e]=i.ignored?i:this._testOne(e,n)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return n(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}};let ee=e=>new D(e);if(ee.isPathValid=e=>T(e&&T.convert(e),e,p),ee.default=ee,t.exports=ee,typeof process<`u`&&(process.env&&process.env.IGNORE_TEST_WIN32||process.platform===`win32`)){T.convert=e=>/^\\\\\?\\/.test(e)||/["<>|\u0000-\u001F]+/u.test(e)?e:e.replace(/\\/g,`/`);let e=/^[a-z]:\//i;T.isNotRelative=t=>e.test(t)||E(t)}})),fEe=i(((e,t)=>{var n=1e3,r=n*60,i=r*60,a=i*24,o=a*7,s=a*365.25;t.exports=function(e,t){t||={};var n=typeof e;if(n===`string`&&e.length>0)return c(e);if(n===`number`&&isFinite(e))return t.long?u(e):l(e);throw Error(`val is not a non-empty string or a valid number. val=`+JSON.stringify(e))};function c(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var c=parseFloat(t[1]);switch((t[2]||`ms`).toLowerCase()){case`years`:case`year`:case`yrs`:case`yr`:case`y`:return c*s;case`weeks`:case`week`:case`w`:return c*o;case`days`:case`day`:case`d`:return c*a;case`hours`:case`hour`:case`hrs`:case`hr`:case`h`:return c*i;case`minutes`:case`minute`:case`mins`:case`min`:case`m`:return c*r;case`seconds`:case`second`:case`secs`:case`sec`:case`s`:return c*n;case`milliseconds`:case`millisecond`:case`msecs`:case`msec`:case`ms`:return c;default:return}}}}function l(e){var t=Math.abs(e);return t>=a?Math.round(e/a)+`d`:t>=i?Math.round(e/i)+`h`:t>=r?Math.round(e/r)+`m`:t>=n?Math.round(e/n)+`s`:e+`ms`}function u(e){var t=Math.abs(e);return t>=a?d(e,t,a,`day`):t>=i?d(e,t,i,`hour`):t>=r?d(e,t,r,`minute`):t>=n?d(e,t,n,`second`):e+` ms`}function d(e,t,n,r){var i=t>=n*1.5;return Math.round(e/n)+` `+r+(i?`s`:``)}})),OQ=i(((e,t)=>{function n(e){n.debug=n,n.default=n,n.coerce=c,n.disable=o,n.enable=i,n.enabled=s,n.humanize=fEe(),n.destroy=l,Object.keys(e).forEach(t=>{n[t]=e[t]}),n.names=[],n.skips=[],n.formatters={};function t(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return n.colors[Math.abs(t)%n.colors.length]}n.selectColor=t;function n(e){let t,i=null,a,o;function s(...e){if(!s.enabled)return;let r=s,i=Number(new Date);r.diff=i-(t||i),r.prev=t,r.curr=i,t=i,e[0]=n.coerce(e[0]),typeof e[0]!=`string`&&e.unshift(`%O`);let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(t,i)=>{if(t===`%%`)return`%`;a++;let o=n.formatters[i];if(typeof o==`function`){let n=e[a];t=o.call(r,n),e.splice(a,1),a--}return t}),n.formatArgs.call(r,e),(r.log||n.log).apply(r,e)}return s.namespace=e,s.useColors=n.useColors(),s.color=n.selectColor(e),s.extend=r,s.destroy=n.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>i===null?(a!==n.namespaces&&(a=n.namespaces,o=n.enabled(e)),o):i,set:e=>{i=e}}),typeof n.init==`function`&&n.init(s),s}function r(e,t){let r=n(this.namespace+(t===void 0?`:`:t)+e);return r.log=this.log,r}function i(e){n.save(e),n.namespaces=e,n.names=[],n.skips=[];let t=(typeof e==`string`?e:``).trim().replace(/\s+/g,`,`).split(`,`).filter(Boolean);for(let e of t)e[0]===`-`?n.skips.push(e.slice(1)):n.names.push(e)}function a(e,t){let n=0,r=0,i=-1,a=0;for(;n<e.length;)if(r<t.length&&(t[r]===e[n]||t[r]===`*`))t[r]===`*`?(i=r,a=n,r++):(n++,r++);else if(i!==-1)r=i+1,a++,n=a;else return!1;for(;r<t.length&&t[r]===`*`;)r++;return r===t.length}function o(){let e=[...n.names,...n.skips.map(e=>`-`+e)].join(`,`);return n.enable(``),e}function s(e){for(let t of n.skips)if(a(e,t))return!1;for(let t of n.names)if(a(e,t))return!0;return!1}function c(e){return e instanceof Error?e.stack||e.message:e}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}t.exports=n})),pEe=i(((e,t)=>{e.formatArgs=r,e.save=i,e.load=a,e.useColors=n,e.storage=o(),e.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=`#0000CC.#0000FF.#0033CC.#0033FF.#0066CC.#0066FF.#0099CC.#0099FF.#00CC00.#00CC33.#00CC66.#00CC99.#00CCCC.#00CCFF.#3300CC.#3300FF.#3333CC.#3333FF.#3366CC.#3366FF.#3399CC.#3399FF.#33CC00.#33CC33.#33CC66.#33CC99.#33CCCC.#33CCFF.#6600CC.#6600FF.#6633CC.#6633FF.#66CC00.#66CC33.#9900CC.#9900FF.#9933CC.#9933FF.#99CC00.#99CC33.#CC0000.#CC0033.#CC0066.#CC0099.#CC00CC.#CC00FF.#CC3300.#CC3333.#CC3366.#CC3399.#CC33CC.#CC33FF.#CC6600.#CC6633.#CC9900.#CC9933.#CCCC00.#CCCC33.#FF0000.#FF0033.#FF0066.#FF0099.#FF00CC.#FF00FF.#FF3300.#FF3333.#FF3366.#FF3399.#FF33CC.#FF33FF.#FF6600.#FF6633.#FF9900.#FF9933.#FFCC00.#FFCC33`.split(`.`);function n(){if(typeof window<`u`&&window.process&&(window.process.type===`renderer`||window.process.__nwjs))return!0;if(typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<`u`&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<`u`&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<`u`&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(e){if(e[0]=(this.useColors?`%c`:``)+this.namespace+(this.useColors?` %c`:` `)+e[0]+(this.useColors?`%c `:` `)+`+`+t.exports.humanize(this.diff),!this.useColors)return;let n=`color: `+this.color;e.splice(1,0,n,`color: inherit`);let r=0,i=0;e[0].replace(/%[a-zA-Z%]/g,e=>{e!==`%%`&&(r++,e===`%c`&&(i=r))}),e.splice(i,0,n)}e.log=console.debug||console.log||(()=>{});function i(t){try{t?e.storage.setItem(`debug`,t):e.storage.removeItem(`debug`)}catch{}}function a(){let t;try{t=e.storage.getItem(`debug`)||e.storage.getItem(`DEBUG`)}catch{}return!t&&typeof process<`u`&&`env`in process&&(t=process.env.DEBUG),t}function o(){try{return localStorage}catch{}}t.exports=OQ()(e);let{formatters:s}=t.exports;s.j=function(e){try{return JSON.stringify(e)}catch(e){return`[UnexpectedJSONParseError]: `+e.message}}})),mEe=i(((e,t)=>{t.exports=(e,t=process.argv)=>{let n=e.startsWith(`-`)?``:e.length===1?`-`:`--`,r=t.indexOf(n+e),i=t.indexOf(`--`);return r!==-1&&(i===-1||r<i)}})),hEe=i(((e,n)=>{let r=t(`os`),i=t(`tty`),a=mEe(),{env:o}=process,s;a(`no-color`)||a(`no-colors`)||a(`color=false`)||a(`color=never`)?s=0:(a(`color`)||a(`colors`)||a(`color=true`)||a(`color=always`))&&(s=1),`FORCE_COLOR`in o&&(s=o.FORCE_COLOR===`true`?1:o.FORCE_COLOR===`false`?0:o.FORCE_COLOR.length===0?1:Math.min(parseInt(o.FORCE_COLOR,10),3));function c(e){return e!==0&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function l(e,t){if(s===0)return 0;if(a(`color=16m`)||a(`color=full`)||a(`color=truecolor`))return 3;if(a(`color=256`))return 2;if(e&&!t&&s===void 0)return 0;let n=s||0;if(o.TERM===`dumb`)return n;if(process.platform===`win32`){let e=r.release().split(`.`);return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if(`CI`in o)return[`TRAVIS`,`CIRCLECI`,`APPVEYOR`,`GITLAB_CI`,`GITHUB_ACTIONS`,`BUILDKITE`].some(e=>e in o)||o.CI_NAME===`codeship`?1:n;if(`TEAMCITY_VERSION`in o)return+!!/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(o.TEAMCITY_VERSION);if(o.COLORTERM===`truecolor`)return 3;if(`TERM_PROGRAM`in o){let e=parseInt((o.TERM_PROGRAM_VERSION||``).split(`.`)[0],10);switch(o.TERM_PROGRAM){case`iTerm.app`:return e>=3?3:2;case`Apple_Terminal`:return 2}}return/-256(color)?$/i.test(o.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(o.TERM)||`COLORTERM`in o?1:n}function u(e){return c(l(e,e&&e.isTTY))}n.exports={supportsColor:u,stdout:c(l(!0,i.isatty(1))),stderr:c(l(!0,i.isatty(2)))}})),gEe=i(((e,n)=>{let r=t(`tty`),i=t(`util`);e.init=d,e.log=c,e.formatArgs=o,e.save=l,e.load=u,e.useColors=a,e.destroy=i.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),e.colors=[6,2,3,4,5,1];try{let t=hEe();t&&(t.stderr||t).level>=2&&(e.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}e.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let n=t.substring(6).toLowerCase().replace(/_([a-z])/g,(e,t)=>t.toUpperCase()),r=process.env[t];return r=/^(yes|on|true|enabled)$/i.test(r)?!0:/^(no|off|false|disabled)$/i.test(r)?!1:r===`null`?null:Number(r),e[n]=r,e},{});function a(){return`colors`in e.inspectOpts?!!e.inspectOpts.colors:r.isatty(process.stderr.fd)}function o(e){let{namespace:t,useColors:r}=this;if(r){let r=this.color,i=`\x1B[3`+(r<8?r:`8;5;`+r),a=` ${i};1m${t} \u001B[0m`;e[0]=a+e[0].split(`
|
|
723
|
+
`)}),r(a,o,n),o},{parse:`lines`,close(e,t){n.on(`close`,()=>{t(e)})}})}t.exports=_,t.exports.build=_,t.exports.PinoPretty=_,t.exports.prettyFactory=g,t.exports.colorizerFactory=o,t.exports.isColorSupported=n,t.exports.default=_})),gX=OY(WY(),1),vCe=OY(_Ce(),1);const _X=new Map;function yCe(e){let t=_X.get(e);return t||(t={chain:Promise.resolve(),parentDirEnsured:!1},_X.set(e,t)),t}var bCe=class{#e;#t;#n;#r;constructor(e){this.#e=e.currentPath,this.#t=e.previousPath,this.#n=e.maxBytes,this.#r=yCe(e.currentPath)}append(e){let t=this.#r.chain.catch(()=>void 0).then(()=>this.#i(e));return this.#r.chain=t,t}async drain(){await this.#r.chain.catch(()=>void 0)}async#i(e){this.#r.parentDirEnsured||(await Oe(k(this.#e),{recursive:!0,mode:448}),this.#r.parentDirEnsured=!0);try{await Pe(this.#e,e,{flag:`a`})}catch(t){if(t.code!==`ENOENT`)throw t;this.#r.parentDirEnsured=!1,await Oe(k(this.#e),{recursive:!0,mode:448}),this.#r.parentDirEnsured=!0,await Pe(this.#e,e,{flag:`a`})}let t;try{t=re(this.#e).size}catch{this.#r.parentDirEnsured=!1;return}if(t>this.#n)try{await Me(this.#e,this.#t)}catch(e){if(e?.code!==`ENOENT`)throw e}}};function xCe(e){return j(hJ(e),_d.spansCurrent)}function SCe(e){return j(hJ(e),_d.spansPrevious)}function vX(e){return j(hJ(e),_d.logsCurrent)}function yX(e){return j(hJ(e),_d.logsPrevious)}var bX=class extends Re{#e;#t=0;#n=0;constructor(e){super({decodeStrings:!1}),this.#e=new bCe({currentPath:vX(e.projectDir),previousPath:yX(e.projectDir),maxBytes:e.maxBytes})}_write(e,t,n){this.#e.append(e).then(()=>n(),e=>{this.#r(e),n()})}#r(e){let t=Date.now();if(t-this.#t<5e3){this.#n++;return}this.#i(e instanceof Error?e.message:String(e),t)}#i(e,t){let n=this.#n;this.#n=0,this.#t=t,console.error(JSON.stringify({event:`pino-file-sink-write-dropped`,error:e,suppressed:n}))}async drain(){await this.#e.drain(),this.#n>0&&this.#i(`flushed at drain`,Date.now())}};function CCe(){let e=ad.getSpan(nd.active());if(!e)return{};let t=e.spanContext();return{trace_id:t.traceId,span_id:t.spanId,trace_flags:t.traceFlags}}function wCe(e){return process.env.NO_COLOR&&process.env.NO_COLOR!==``?!1:(e===2?process.stderr:process.stdout).isTTY??!1}const xX=new Set([`fatal`,`error`,`warn`,`info`,`debug`,`trace`,`silent`]);function SX(e){return e===`silent`?1/0:gX.default.levels.values[e]??gX.default.levels.values.info}function CX(e,t){return SX(e)<=SX(t)?e:t}var TCe=class{name;transportConfigs=[];fileSinkOpts;redactPaths;consoleDestination=1;activeFileSink;pinoInstance;options;constructor(e,t={}){this.name=e,this.options={name:this.name,level:process.env.LOG_LEVEL||(process.env.NODE_ENV===`test`?`silent`:`info`),serializers:{err:gX.default.stdSerializers.err,error:gX.default.stdSerializers.err},mixin:CCe,...t.options},t.transportConfigs&&(this.transportConfigs=t.transportConfigs),t.fileSink&&(this.fileSinkOpts=t.fileSink),t.consoleDestination!==void 0&&(this.consoleDestination=t.consoleDestination),t.redactPaths&&t.redactPaths.length>0&&(this.redactPaths=t.redactPaths,this.options={...this.options,redact:{paths:[...t.redactPaths],censor:`[REDACTED]`}}),this.pinoInstance=this.buildInstance()}resolveStreamLevels(){let e=this.options.level??`info`,t=process.env.OK_FILE_LEVEL?.toLowerCase(),n=t&&xX.has(t)?t:e===`silent`?`silent`:CX(e,`debug`),r=process.env.OK_CONSOLE_LEVEL?.toLowerCase(),i=r&&xX.has(r)?r:e;return{fileLevel:n,consoleLevel:i,instanceLevel:CX(n,i)}}buildInstance(){this.activeFileSink=void 0;let{fileLevel:e,consoleLevel:t,instanceLevel:n}=this.resolveStreamLevels();if(this.transportConfigs.length>0)return(0,gX.default)(this.options,gX.default.transport({targets:this.transportConfigs}));let r;try{r=(0,vCe.default)({colorize:wCe(this.consoleDestination),translateTime:`HH:MM:ss`,ignore:`pid,hostname`,destination:this.consoleDestination})}catch(r){if(console.warn(`[PinoLogger] pino-pretty failed, falling back to JSON:`,r),this.fileSinkOpts){let t=new bX(this.fileSinkOpts);return this.activeFileSink=t,(0,gX.default)({...this.options,level:n},gX.default.multistream([{stream:t,level:e}]))}return(0,gX.default)({...this.options,level:t},gX.default.destination(this.consoleDestination))}if(this.fileSinkOpts){let i=new bX(this.fileSinkOpts);return this.activeFileSink=i,(0,gX.default)({...this.options,level:n},gX.default.multistream([{stream:r,level:t},{stream:i,level:e}]))}return(0,gX.default)({...this.options,level:t},r)}recreateInstance(){typeof this.pinoInstance.flush==`function`&&this.pinoInstance.flush(),this.pinoInstance=this.buildInstance()}addTransport(e){this.transportConfigs.push(e),this.recreateInstance()}removeTransport(e){e>=0&&e<this.transportConfigs.length&&(this.transportConfigs.splice(e,1),this.recreateInstance())}getTransports(){return[...this.transportConfigs]}updateOptions(e){this.options={...this.options,...e},this.recreateInstance()}reconfigure(e){e.options&&(this.options={...this.options,...e.options}),e.transportConfigs&&(this.transportConfigs=e.transportConfigs),e.fileSink&&(this.fileSinkOpts=e.fileSink),e.consoleDestination!==void 0&&(this.consoleDestination=e.consoleDestination),e.redactPaths&&e.redactPaths.length>0&&(this.redactPaths=e.redactPaths,this.options={...this.options,redact:{paths:[...e.redactPaths],censor:`[REDACTED]`}}),this.recreateInstance()}getPinoInstance(){return this.pinoInstance}async flushFileSink(){this.activeFileSink&&await this.activeFileSink.drain()}error(e,t){this.pinoInstance.error(e,t)}warn(e,t){this.pinoInstance.warn(e,t)}info(e,t){this.pinoInstance.info(e,t)}debug(e,t){this.pinoInstance.debug(e,t)}};const ECe=new class{config={};loggers=new Map;configure(e){if(this.config=e,e.pinoConfig&&!e.defaultLogger&&!e.loggerFactory){for(let t of this.loggers.values())t.reconfigure(e.pinoConfig);return}this.loggers.clear()}getLogger(e){let t=this.loggers.get(e);if(t)return t;let n;return n=this.config.loggerFactory?this.config.loggerFactory(e):this.config.defaultLogger?this.config.defaultLogger:new TCe(e,this.config.pinoConfig),this.loggers.set(e,n),n}reset(){this.config={},this.loggers.clear()}async flushAllFileSinks(){let e=[];for(let t of this.loggers.values())e.push(t.flushFileSink());await Promise.all(e)}};function wX(e){return ECe.getLogger(e)}new zye({extensions:UN,deriveStructuralFreshness:!0}),mO(UN);var TX=class{kind;projectRoot;projectSubPath;gitPath;gitDir;cachedCommonDir;constructor(e,t,n,r,i){this.kind=e,this.projectRoot=t,this.projectSubPath=n,this.gitPath=r,this.gitDir=i}readCommonDir(){if(this.cachedCommonDir!==void 0)return{kind:`resolved`,path:this.cachedCommonDir};let e=this.gitDir;try{let t=C(j(this.gitDir,`commondir`),`utf-8`).trim();t.length>0&&(e=se(t)?t:le(this.gitDir,t))}catch(e){if(!DX(e))return{kind:`unreadable`,cause:e}}return this.cachedCommonDir=e,{kind:`resolved`,path:e}}readHead(){let e;try{e=C(j(this.gitDir,`HEAD`),`utf-8`).trim()}catch(e){return DX(e)?{kind:`absent`}:{kind:`unreadable`,cause:e}}let t=/^ref:[ \t]*(refs\/heads\/(.+))$/.exec(e);return t?.[2]?{kind:`branch`,branch:t[2],ref:t[1]}:kX(e)?{kind:`detached`,oid:e}:{kind:`malformed`,raw:e}}readRemoteUrl(e){let t=this.readCommonDir();if(t.kind===`unreadable`)return t;let n;try{n=C(j(t.path,`config`),`utf-8`)}catch(e){return DX(e)?{kind:`absent`,reason:`config-missing`}:{kind:`unreadable`,cause:e}}let r=kCe(n,e);return r===null?{kind:`absent`,reason:`remote-missing`}:{kind:`configured`,url:r}}readRef(e){if(!OX(e))return{kind:`invalid`};let t=this.readCommonDir();if(t.kind===`unreadable`)return t;let n=le(t.path,e),r=N(t.path,n);if(r.startsWith(`..`)||se(r))return{kind:`invalid`};try{let e=C(n,`utf-8`).trim(),t=MCe(e);return t===null?{kind:`malformed`,raw:e}:{kind:`present`,storage:`loose`,value:t}}catch(e){if(!DX(e))return{kind:`unreadable`,cause:e}}let i;try{i=C(j(t.path,`packed-refs`),`utf-8`)}catch(e){return DX(e)?{kind:`absent`}:{kind:`unreadable`,cause:e}}for(let t of i.split(/\r?\n/)){let n=t.trim();if(n.length===0||n.startsWith(`#`)||n.startsWith(`^`))continue;let r=n.split(/\s+/);if(r.length===2&&r[1]===e)return kX(r[0])?{kind:`present`,storage:`packed`,value:{kind:`oid`,oid:r[0]}}:{kind:`malformed`,raw:n}}return{kind:`absent`}}};function DCe(e){return EX(le(e),``)}function OCe(e){let t=le(e),n=le(ve());if(t===n)return{kind:`absent`};let r=EX(t,``);if(r.kind!==`absent`)return r;let i=t;for(let e=0;e<64;e++){if(i===n)return{kind:`absent`};let e=k(i);if(e===i||e===n)return{kind:`absent`};let r=EX(e,N(e,t));if(r.kind!==`absent`)return r;i=e}return{kind:`absent`}}function EX(e,t){let n=j(e,`.git`),r;try{r=re(n)}catch(e){return DX(e)?{kind:`absent`}:{kind:`inaccessible`,gitPath:n,cause:e}}if(r.isDirectory())return{kind:`repository`,repository:new TX(`directory`,e,t,n,n)};if(!r.isFile())return{kind:`absent`};let i;try{i=C(n,`utf-8`).trim()}catch(e){return{kind:`malformed-pointer`,gitPath:n,target:``,cause:e}}let a=/^gitdir:[ \t]*(.+)$/.exec(i);if(!a)return{kind:`malformed-pointer`,gitPath:n,target:``};let o=a[1].trim(),s=se(o)?o:le(e,o);try{if(!re(s).isDirectory())return{kind:`malformed-pointer`,gitPath:n,target:s}}catch(e){return{kind:`malformed-pointer`,gitPath:n,target:s,cause:e}}return{kind:`repository`,repository:new TX(`linked`,e,t,n,s)}}function kCe(e,t){let n=!1;for(let r of e.split(/\r?\n/)){let e=ACe(r);if(e.length===0)continue;if(e.startsWith(`[`)){n=/^\[\s*remote\s+["'](.+)["']\s*\]$/.exec(e)?.[1]===t;continue}if(!n)continue;let i=/^url\s*=\s*(.*)$/.exec(e);if(!i)continue;let a=jCe(i[1]);if(a.length>0)return a}return null}function ACe(e){let t=e.search(/[;#]/);return(t===-1?e:e.slice(0,t)).trim()}function jCe(e){let t=e.trim();return t.startsWith(`"`)&&t.endsWith(`"`)||t.startsWith(`'`)&&t.endsWith(`'`)?t.slice(1,-1):t}function DX(e){let t=e?.code;return t===`ENOENT`||t===`ENOTDIR`}function OX(e){return e.startsWith(`refs/`)&&!e.includes(`\0`)&&!e.includes(`\\`)&&!e.includes(`..`)&&!e.includes(`//`)&&!e.endsWith(`/`)}function MCe(e){if(e.length===0)return null;let t=/^ref:[ \t]*(refs\/.+)$/.exec(e);return t?OX(t[1])?{kind:`symbolic`,target:t[1]}:null:kX(e)?{kind:`oid`,oid:e}:null}function kX(e){return/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/.test(e)}process.platform===`darwin`||process.platform,new Set(kae);const NCe=Object.values(it).map(e=>e.mcpServerName.slice(Oae.length)).filter(e=>e!==``);RegExp(`^open[-_ ]?knowledge(?:${NCe.join(`|`)})?$`),new Set(Object.values(it).map(Et));const AX={initialize:`initialize`,authenticate:`authenticate`,providers_list:`providers/list`,providers_set:`providers/set`,providers_disable:`providers/disable`,session_new:`session/new`,session_load:`session/load`,session_set_mode:`session/set_mode`,session_set_config_option:`session/set_config_option`,session_prompt:`session/prompt`,session_cancel:`session/cancel`,mcp_message:`mcp/message`,session_list:`session/list`,session_delete:`session/delete`,session_fork:`session/fork`,session_resume:`session/resume`,session_close:`session/close`,logout:`logout`,nes_start:`nes/start`,nes_suggest:`nes/suggest`,nes_accept:`nes/accept`,nes_reject:`nes/reject`,nes_close:`nes/close`,document_did_open:`document/didOpen`,document_did_change:`document/didChange`,document_did_close:`document/didClose`,document_did_save:`document/didSave`,document_did_focus:`document/didFocus`},jX={session_request_permission:`session/request_permission`,session_update:`session/update`,fs_write_text_file:`fs/write_text_file`,fs_read_text_file:`fs/read_text_file`,terminal_create:`terminal/create`,terminal_output:`terminal/output`,terminal_release:`terminal/release`,terminal_wait_for_exit:`terminal/wait_for_exit`,terminal_kill:`terminal/kill`,mcp_connect:`mcp/connect`,mcp_message:`mcp/message`,mcp_disconnect:`mcp/disconnect`,elicitation_create:`elicitation/create`,elicitation_complete:`elicitation/complete`},PCe={cancel_request:`$/cancel_request`},MX=Symbol(`skippedItem`);function $(e,t){return e.catch(t)}function NX(e,t){let n=e.catch(t);return z().transform((e,t)=>e===void 0?(t.addIssue({code:`custom`,message:`Required value is missing`}),Ot):n.parse(e))}function PX(e,t){if(typeof e!=`object`||!e||Array.isArray(e))return;let n=e[t];return typeof n==`string`?n:void 0}function FX(e,t,n){return e.superRefine((e,r)=>{let i=PX(e,t);i!==void 0&&n.includes(i)&&r.addIssue({code:`custom`,path:[t],message:`${t} ${JSON.stringify(i)} is reserved by a known variant, but the value does not match that variant's schema`})})}function IX(e,t,n){return z().transform((r,i)=>{let a=e.safeParse(r);if(!a.success){for(let e of a.error.issues)i.addIssue({...e,input:r});return Ot}let o=a.data,s=PX(r,t);if(s!==void 0&&!n.includes(s)){let e=r;for(let[t,n]of Object.entries(e))t!==`__proto__`&&(Object.hasOwn(o,t)||(o[t]=n))}return o})}function LX(e){return B(e.catch(MX)).transform(e=>e.filter(e=>e!==MX))}const RX=Qi([L(),I()]).nullable(),zX=I(),BX=V({sessionId:zX,path:I(),content:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),VX=V({sessionId:zX,path:I(),line:$(Gi().gte(0).max(4294967295,{error:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),()=>void 0),limit:$(Gi().gte(0).max(4294967295,{error:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),HX=I(),UX=Qi([W(`read`),W(`edit`),W(`delete`),W(`move`),W(`search`),W(`execute`),W(`think`),W(`fetch`),W(`switch_mode`),W(`other`)]),WX=Qi([W(`pending`),W(`in_progress`),W(`completed`),W(`failed`)]),GX=V({audience:$(LX(Qi([W(`assistant`),W(`user`)])).nullish(),()=>void 0),lastModified:$(I().nullish(),()=>void 0),priority:$(L().nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),FCe=V({annotations:$(GX.nullish(),()=>void 0),text:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),ICe=V({annotations:$(GX.nullish(),()=>void 0),data:I(),mimeType:I(),uri:$(I().nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),LCe=V({annotations:$(GX.nullish(),()=>void 0),data:I(),mimeType:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),RCe=V({annotations:$(GX.nullish(),()=>void 0),description:$(I().nullish(),()=>void 0),mimeType:$(I().nullish(),()=>void 0),name:I(),size:$(L().nullish(),()=>void 0),title:$(I().nullish(),()=>void 0),uri:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),zCe=Qi([V({mimeType:$(I().nullish(),()=>void 0),text:I(),uri:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),V({blob:I(),mimeType:$(I().nullish(),()=>void 0),uri:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)})]),BCe=V({annotations:$(GX.nullish(),()=>void 0),resource:zCe,_meta:$(H(I(),z()).nullish(),()=>void 0)}),KX=Qi([FCe.and(V({type:W(`text`)})),ICe.and(V({type:W(`image`)})),LCe.and(V({type:W(`audio`)})),RCe.and(V({type:W(`resource_link`)})),BCe.and(V({type:W(`resource`)}))]),VCe=V({content:KX,_meta:$(H(I(),z()).nullish(),()=>void 0)}),HCe=V({path:I(),oldText:$(I().nullish(),()=>void 0),newText:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),qX=I(),UCe=V({terminalId:qX,_meta:$(H(I(),z()).nullish(),()=>void 0)}),JX=Qi([VCe.and(V({type:W(`content`)})),HCe.and(V({type:W(`diff`)})),UCe.and(V({type:W(`terminal`)}))]),YX=V({path:I(),line:$(Gi().gte(0).max(4294967295,{error:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),XX=V({toolCallId:HX,kind:$(UX.nullish(),()=>void 0),status:$(WX.nullish(),()=>void 0),title:$(I().nullish(),()=>void 0),content:$(LX(JX).nullish(),()=>void 0),locations:$(LX(YX).nullish(),()=>void 0),rawInput:$(z().optional(),()=>void 0),rawOutput:$(z().optional(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),ZX=I(),WCe=Qi([W(`allow_once`),W(`allow_always`),W(`reject_once`),W(`reject_always`)]),QX=V({sessionId:zX,toolCall:XX,options:B(V({optionId:ZX,name:I(),kind:WCe,_meta:$(H(I(),z()).nullish(),()=>void 0)})),_meta:$(H(I(),z()).nullish(),()=>void 0)}),$X=V({name:I(),value:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),eZ=V({sessionId:zX,command:I(),args:$(LX(I()).optional(),()=>[]),env:$(LX($X).optional(),()=>[]),cwd:$(I().nullish(),()=>void 0),outputByteLimit:$(L().nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),tZ=V({sessionId:zX,terminalId:qX,_meta:$(H(I(),z()).nullish(),()=>void 0)}),nZ=V({sessionId:zX,terminalId:qX,_meta:$(H(I(),z()).nullish(),()=>void 0)}),rZ=V({sessionId:zX,terminalId:qX,_meta:$(H(I(),z()).nullish(),()=>void 0)}),iZ=V({sessionId:zX,terminalId:qX,_meta:$(H(I(),z()).nullish(),()=>void 0)}),aZ=V({sessionId:zX,toolCallId:$(HX.nullish(),()=>void 0)}),oZ=V({requestId:RX}),GCe=W(`object`),KCe=Qi([W(`email`),W(`uri`),W(`date`),W(`date-time`)]),sZ=V({const:I(),title:I(),description:$(I().nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),cZ=V({title:$(I().nullish(),()=>void 0),description:$(I().nullish(),()=>void 0),minLength:Gi().gte(0).max(4294967295,{error:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),maxLength:Gi().gte(0).max(4294967295,{error:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),pattern:I().nullish(),format:KCe.nullish(),default:$(I().nullish(),()=>void 0),enum:B(I()).nullish(),oneOf:B(sZ).nullish(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),lZ=V({title:$(I().nullish(),()=>void 0),description:$(I().nullish(),()=>void 0),minimum:L().nullish(),maximum:L().nullish(),default:$(L().nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),uZ=V({title:$(I().nullish(),()=>void 0),description:$(I().nullish(),()=>void 0),minimum:L().nullish(),maximum:L().nullish(),default:$(L().nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),dZ=V({title:$(I().nullish(),()=>void 0),description:$(I().nullish(),()=>void 0),default:$(R().nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),fZ=V({enum:B(I()),_meta:$(H(I(),z()).nullish(),()=>void 0)}),qCe=V({anyOf:B(sZ),_meta:$(H(I(),z()).nullish(),()=>void 0)}),JCe=IX(Qi([fZ.and(V({type:W(`string`)})),FX(V({type:I()}),`type`,[`string`]),qCe]),`type`,[`string`]),pZ=V({title:$(I().nullish(),()=>void 0),description:$(I().nullish(),()=>void 0),minItems:L().nullish(),maxItems:L().nullish(),items:JCe,default:$(LX(I()).nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),YCe=IX(Qi([cZ.and(V({type:W(`string`)})),lZ.and(V({type:W(`number`)})),uZ.and(V({type:W(`integer`)})),dZ.and(V({type:W(`boolean`)})),pZ.and(V({type:W(`array`)})),FX(V({type:I()}),`type`,[`array`,`boolean`,`integer`,`number`,`string`])]),`type`,[`array`,`boolean`,`integer`,`number`,`string`]),XCe=V({type:$(GCe.optional().default(`object`),()=>`object`),title:$(I().nullish(),()=>void 0),properties:H(I(),YCe).optional().default({}),required:B(I()).nullish(),description:$(I().nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),mZ=ea(Qi([aZ,oZ]),V({requestedSchema:XCe})),hZ=I(),gZ=ea(Qi([aZ,oZ]),V({elicitationId:hZ,url:Ui()})),_Z=IX(ea(Qi([mZ.and(V({mode:W(`form`)})),gZ.and(V({mode:W(`url`)})),FX(ea(Qi([aZ,oZ]),V({mode:I()})),`mode`,[`form`,`url`])]),V({message:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)})),`mode`,[`form`,`url`]),vZ=I(),ZCe=V({serverId:vZ,_meta:$(H(I(),z()).nullish(),()=>void 0)}),yZ=I(),bZ=V({connectionId:yZ,method:I(),params:H(I(),z()).nullish(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),QCe=V({connectionId:yZ,_meta:$(H(I(),z()).nullish(),()=>void 0)}),xZ=z();V({id:RX,method:I(),params:Qi([BX,VX,QX,eZ,tZ,nZ,rZ,iZ,_Z,ZCe,bZ,QCe,xZ]).nullish()});const SZ=Gi().gte(0).lte(65535),$Ce=V({image:$(R().optional().default(!1),()=>!1),audio:$(R().optional().default(!1),()=>!1),embeddedContext:$(R().optional().default(!1),()=>!1),_meta:$(H(I(),z()).nullish(),()=>void 0)}),ewe=V({http:$(R().optional().default(!1),()=>!1),sse:$(R().optional().default(!1),()=>!1),acp:$(R().optional().default(!1),()=>!1),_meta:$(H(I(),z()).nullish(),()=>void 0)}),twe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),nwe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),rwe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),iwe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),awe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),owe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),swe=V({list:$(twe.nullish(),()=>void 0),delete:$(nwe.nullish(),()=>void 0),additionalDirectories:$(rwe.nullish(),()=>void 0),fork:$(iwe.nullish(),()=>void 0),resume:$(awe.nullish(),()=>void 0),close:$(owe.nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),cwe=V({logout:$(V({_meta:$(H(I(),z()).nullish(),()=>void 0)}).nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),lwe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),uwe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),dwe=V({syncKind:Qi([W(`full`),W(`incremental`)]),_meta:$(H(I(),z()).nullish(),()=>void 0)}),fwe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),pwe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),mwe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),hwe=V({document:$(V({didOpen:$(uwe.nullish(),()=>void 0),didChange:$(dwe.nullish(),()=>void 0),didClose:$(fwe.nullish(),()=>void 0),didSave:$(pwe.nullish(),()=>void 0),didFocus:$(mwe.nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}).nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),gwe=V({maxCount:$(Gi().gte(0).max(4294967295,{error:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),_we=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),vwe=V({maxCount:$(Gi().gte(0).max(4294967295,{error:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),ywe=V({maxCount:$(Gi().gte(0).max(4294967295,{error:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),bwe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),xwe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),Swe=V({recentFiles:$(gwe.nullish(),()=>void 0),relatedSnippets:$(_we.nullish(),()=>void 0),editHistory:$(vwe.nullish(),()=>void 0),userActions:$(ywe.nullish(),()=>void 0),openFiles:$(bwe.nullish(),()=>void 0),diagnostics:$(xwe.nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),Cwe=V({events:$(hwe.nullish(),()=>void 0),context:$(Swe.nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),CZ=Qi([W(`utf-16`),W(`utf-32`),W(`utf-8`)]),wwe=V({loadSession:$(R().optional().default(!1),()=>!1),promptCapabilities:$($Ce.optional().default({image:!1,audio:!1,embeddedContext:!1}),()=>({image:!1,audio:!1,embeddedContext:!1})),mcpCapabilities:$(ewe.optional().default({http:!1,sse:!1,acp:!1}),()=>({http:!1,sse:!1,acp:!1})),sessionCapabilities:$(swe.optional().default({}),()=>({})),auth:$(cwe.optional().default({}),()=>({})),providers:$(lwe.nullish(),()=>void 0),nes:$(Cwe.nullish(),()=>void 0),positionEncoding:$(CZ.nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),wZ=I(),Twe=V({name:I(),label:$(I().nullish(),()=>void 0),secret:$(R().optional().default(!0),()=>!0),optional:$(R().optional().default(!1),()=>!1),_meta:$(H(I(),z()).nullish(),()=>void 0)}),Ewe=V({id:wZ,name:I(),description:$(I().nullish(),()=>void 0),vars:NX(LX(Twe),()=>[]),link:$(I().nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),Dwe=V({id:wZ,name:I(),description:$(I().nullish(),()=>void 0),args:$(LX(I()).optional(),()=>[]),env:$(H(I(),I()).optional(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),Owe=V({id:wZ,name:I(),description:$(I().nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),kwe=Qi([Ewe.and(V({type:W(`env_var`)})),Dwe.and(V({type:W(`terminal`)})),Owe]),TZ=V({name:I(),title:$(I().nullish(),()=>void 0),version:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),Awe=V({protocolVersion:SZ,agentCapabilities:$(wwe.optional().default({loadSession:!1,promptCapabilities:{image:!1,audio:!1,embeddedContext:!1},mcpCapabilities:{http:!1,sse:!1,acp:!1},sessionCapabilities:{},auth:{}}),()=>({loadSession:!1,promptCapabilities:{image:!1,audio:!1,embeddedContext:!1},mcpCapabilities:{http:!1,sse:!1,acp:!1},sessionCapabilities:{},auth:{}})),authMethods:$(LX(kwe).optional().default([]),()=>[]),agentInfo:$(TZ.nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),jwe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),EZ=I(),DZ=Qi([W(`anthropic`),W(`openai`),W(`azure`),W(`vertex`),W(`bedrock`),I()]),Mwe=V({apiType:DZ,baseUrl:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),Nwe=V({providers:B(V({providerId:EZ,supported:NX(LX(DZ),()=>[]),required:R(),current:Mwe.nullish(),_meta:$(H(I(),z()).nullish(),()=>void 0)})),_meta:$(H(I(),z()).nullish(),()=>void 0)}),Pwe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),Fwe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),Iwe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),OZ=I(),kZ=V({currentModeId:OZ,availableModes:NX(LX(V({id:OZ,name:I(),description:$(I().nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)})),()=>[]),_meta:$(H(I(),z()).nullish(),()=>void 0)}),AZ=I(),Lwe=Qi([W(`mode`),W(`model`),W(`model_config`),W(`thought_level`),I()]),jZ=I(),MZ=V({value:jZ,name:I(),description:$(I().nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),Rwe=V({group:I(),name:I(),options:NX(LX(MZ),()=>[]),_meta:$(H(I(),z()).nullish(),()=>void 0)}),zwe=V({currentValue:jZ,options:Qi([B(MZ),B(Rwe)])}),Bwe=V({currentValue:R()}),NZ=ea(Qi([zwe.and(V({type:W(`select`)})),Bwe.and(V({type:W(`boolean`)}))]),V({id:AZ,name:I(),description:$(I().nullish(),()=>void 0),category:$(Lwe.nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)})),Vwe=V({sessionId:zX,modes:$(kZ.nullish(),()=>void 0),configOptions:$(LX(NZ).nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),Hwe=V({modes:$(kZ.nullish(),()=>void 0),configOptions:$(LX(NZ).nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),Uwe=V({sessions:NX(LX(V({sessionId:zX,cwd:I(),additionalDirectories:$(LX(I()).optional(),()=>[]),title:$(I().nullish(),()=>void 0),updatedAt:$(I().nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)})),()=>[]),nextCursor:$(I().nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),Wwe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),Gwe=V({sessionId:zX,modes:$(kZ.nullish(),()=>void 0),configOptions:$(LX(NZ).nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),Kwe=V({modes:$(kZ.nullish(),()=>void 0),configOptions:$(LX(NZ).nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),qwe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),Jwe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),Ywe=V({configOptions:NX(LX(NZ),()=>[]),_meta:$(H(I(),z()).nullish(),()=>void 0)}),Xwe=V({stopReason:Qi([W(`end_turn`),W(`max_tokens`),W(`max_turn_requests`),W(`refusal`),W(`cancelled`)]),usage:$(V({totalTokens:L(),inputTokens:L(),outputTokens:L(),thoughtTokens:$(L().nullish(),()=>void 0),cachedReadTokens:$(L().nullish(),()=>void 0),cachedWriteTokens:$(L().nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}).nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),Zwe=V({sessionId:zX,_meta:$(H(I(),z()).nullish(),()=>void 0)}),PZ=I(),FZ=V({line:Gi().gte(0).max(4294967295,{error:`Invalid value: Expected uint32 to be <= 4294967295`}),character:Gi().gte(0).max(4294967295,{error:`Invalid value: Expected uint32 to be <= 4294967295`}),_meta:$(H(I(),z()).nullish(),()=>void 0)}),IZ=V({start:FZ,end:FZ,_meta:$(H(I(),z()).nullish(),()=>void 0)}),Qwe=V({range:IZ,newText:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),$we=V({id:PZ,uri:I(),edits:B(Qwe),cursorPosition:$(FZ.nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),eTe=V({id:PZ,uri:I(),position:FZ,_meta:$(H(I(),z()).nullish(),()=>void 0)}),tTe=V({id:PZ,uri:I(),position:FZ,newName:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),nTe=V({id:PZ,uri:I(),search:I(),replace:I(),isRegex:R().nullish(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),rTe=V({suggestions:B(Qi([$we.and(V({kind:W(`edit`)})),eTe.and(V({kind:W(`jump`)})),tTe.and(V({kind:W(`rename`)})),nTe.and(V({kind:W(`searchAndReplace`)}))])),_meta:$(H(I(),z()).nullish(),()=>void 0)}),iTe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),LZ=z(),RZ=z(),zZ=V({code:Qi([W(-32700),W(-32600),W(-32601),W(-32602),W(-32603),W(-32800),W(-32e3),W(-32002),Gi().min(-2147483648,{error:`Invalid value: Expected int32 to be >= -2147483648`}).max(2147483647,{error:`Invalid value: Expected int32 to be <= 2147483647`})]),message:I(),data:$(z().optional(),()=>void 0)});Qi([V({id:RX,result:Qi([Awe,jwe,Nwe,Pwe,Fwe,Iwe,Vwe,Hwe,Uwe,Wwe,Gwe,Kwe,qwe,Jwe,Ywe,Xwe,Zwe,rTe,iTe,LZ,RZ])}),V({id:RX,error:zZ})]);const BZ=V({content:KX,messageId:$(I().nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),aTe=V({toolCallId:HX,title:I(),kind:$(UX.optional(),()=>void 0),status:$(WX.optional(),()=>void 0),content:$(LX(JX).optional(),()=>[]),locations:$(LX(YX).optional(),()=>[]),rawInput:$(z().optional(),()=>void 0),rawOutput:$(z().optional(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),oTe=Qi([W(`high`),W(`medium`),W(`low`)]),sTe=Qi([W(`pending`),W(`in_progress`),W(`completed`)]),VZ=V({content:I(),priority:oTe,status:sTe,_meta:$(H(I(),z()).nullish(),()=>void 0)}),cTe=V({entries:NX(LX(VZ),()=>[]),_meta:$(H(I(),z()).nullish(),()=>void 0)}),HZ=I(),lTe=V({planId:HZ,entries:NX(LX(VZ),()=>[]),_meta:$(H(I(),z()).nullish(),()=>void 0)}),uTe=V({planId:HZ,uri:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),dTe=V({planId:HZ,content:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),fTe=V({plan:Qi([lTe.and(V({type:W(`items`)})),uTe.and(V({type:W(`file`)})),dTe.and(V({type:W(`markdown`)}))]),_meta:$(H(I(),z()).nullish(),()=>void 0)}),pTe=V({planId:HZ,_meta:$(H(I(),z()).nullish(),()=>void 0)}),mTe=V({hint:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),hTe=V({availableCommands:NX(LX(V({name:I(),description:I(),input:$(mTe.nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)})),()=>[]),_meta:$(H(I(),z()).nullish(),()=>void 0)}),gTe=V({currentModeId:OZ,_meta:$(H(I(),z()).nullish(),()=>void 0)}),_Te=V({configOptions:NX(LX(NZ),()=>[]),_meta:$(H(I(),z()).nullish(),()=>void 0)}),vTe=V({title:$(I().nullish(),()=>void 0),updatedAt:$(I().nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),yTe=V({amount:L(),currency:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),bTe=V({used:L(),size:L(),cost:$(yTe.nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),UZ=V({sessionId:zX,update:Qi([BZ.and(V({sessionUpdate:W(`user_message_chunk`)})),BZ.and(V({sessionUpdate:W(`agent_message_chunk`)})),BZ.and(V({sessionUpdate:W(`agent_thought_chunk`)})),aTe.and(V({sessionUpdate:W(`tool_call`)})),XX.and(V({sessionUpdate:W(`tool_call_update`)})),cTe.and(V({sessionUpdate:W(`plan`)})),fTe.and(V({sessionUpdate:W(`plan_update`)})),pTe.and(V({sessionUpdate:W(`plan_removed`)})),hTe.and(V({sessionUpdate:W(`available_commands_update`)})),gTe.and(V({sessionUpdate:W(`current_mode_update`)})),_Te.and(V({sessionUpdate:W(`config_option_update`)})),vTe.and(V({sessionUpdate:W(`session_info_update`)})),bTe.and(V({sessionUpdate:W(`usage_update`)}))]),_meta:$(H(I(),z()).nullish(),()=>void 0)}),WZ=V({elicitationId:hZ,_meta:$(H(I(),z()).nullish(),()=>void 0)}),GZ=V({connectionId:yZ,method:I(),params:$(H(I(),z()).nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),KZ=z();V({method:I(),params:Qi([UZ,WZ,GZ,KZ]).nullish()});const xTe=V({readTextFile:$(R().optional().default(!1),()=>!1),writeTextFile:$(R().optional().default(!1),()=>!1),_meta:$(H(I(),z()).nullish(),()=>void 0)}),STe=V({configOptions:$(V({boolean:$(V({_meta:$(H(I(),z()).nullish(),()=>void 0)}).nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}).nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),CTe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),wTe=V({terminal:$(R().optional().default(!1),()=>!1),_meta:$(H(I(),z()).nullish(),()=>void 0)}),TTe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),ETe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),DTe=V({form:$(TTe.nullish(),()=>void 0),url:$(ETe.nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),OTe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),kTe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),ATe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),jTe=V({jump:$(OTe.nullish(),()=>void 0),rename:$(kTe.nullish(),()=>void 0),searchAndReplace:$(ATe.nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),qZ=V({protocolVersion:SZ,clientCapabilities:$(V({fs:$(xTe.optional().default({readTextFile:!1,writeTextFile:!1}),()=>({readTextFile:!1,writeTextFile:!1})),terminal:$(R().optional().default(!1),()=>!1),session:$(STe.nullish(),()=>void 0),plan:$(CTe.nullish(),()=>void 0),auth:$(wTe.optional().default({terminal:!1}),()=>({terminal:!1})),elicitation:$(DTe.nullish(),()=>void 0),nes:$(jTe.nullish(),()=>void 0),positionEncodings:$(LX(CZ).optional(),()=>[]),_meta:$(H(I(),z()).nullish(),()=>void 0)}).optional().default({fs:{readTextFile:!1,writeTextFile:!1},terminal:!1,auth:{terminal:!1}}),()=>({fs:{readTextFile:!1,writeTextFile:!1},terminal:!1,auth:{terminal:!1}})),clientInfo:$(TZ.nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),JZ=V({methodId:wZ,_meta:$(H(I(),z()).nullish(),()=>void 0)}),YZ=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),XZ=V({providerId:EZ,apiType:DZ,baseUrl:I(),headers:H(I(),I()).optional(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),ZZ=V({providerId:EZ,_meta:$(H(I(),z()).nullish(),()=>void 0)}),QZ=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),$Z=V({name:I(),value:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),MTe=V({name:I(),url:I(),headers:B($Z),_meta:$(H(I(),z()).nullish(),()=>void 0)}),NTe=V({name:I(),url:I(),headers:B($Z),_meta:$(H(I(),z()).nullish(),()=>void 0)}),PTe=V({name:I(),serverId:vZ,_meta:$(H(I(),z()).nullish(),()=>void 0)}),FTe=V({name:I(),command:I(),args:B(I()),env:B($X),_meta:$(H(I(),z()).nullish(),()=>void 0)}),eQ=Qi([MTe.and(V({type:W(`http`)})),NTe.and(V({type:W(`sse`)})),PTe.and(V({type:W(`acp`)})),FTe]),tQ=V({cwd:I(),additionalDirectories:$(LX(I()).optional(),()=>[]),mcpServers:NX(LX(eQ),()=>[]),_meta:$(H(I(),z()).nullish(),()=>void 0)}),nQ=V({mcpServers:NX(LX(eQ),()=>[]),cwd:I(),additionalDirectories:$(LX(I()).optional(),()=>[]),sessionId:zX,_meta:$(H(I(),z()).nullish(),()=>void 0)}),rQ=V({cwd:I().nullish(),cursor:I().nullish(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),iQ=V({sessionId:zX,_meta:$(H(I(),z()).nullish(),()=>void 0)}),aQ=V({sessionId:zX,cwd:I(),additionalDirectories:$(LX(I()).optional(),()=>[]),mcpServers:$(LX(eQ).optional(),()=>[]),_meta:$(H(I(),z()).nullish(),()=>void 0)}),oQ=V({sessionId:zX,cwd:I(),additionalDirectories:$(LX(I()).optional(),()=>[]),mcpServers:$(LX(eQ).optional(),()=>[]),_meta:$(H(I(),z()).nullish(),()=>void 0)}),sQ=V({sessionId:zX,_meta:$(H(I(),z()).nullish(),()=>void 0)}),cQ=V({sessionId:zX,modeId:OZ,_meta:$(H(I(),z()).nullish(),()=>void 0)}),lQ=ea(Qi([V({value:R(),type:W(`boolean`)}),V({value:jZ})]),V({sessionId:zX,configId:AZ,_meta:$(H(I(),z()).nullish(),()=>void 0)})),uQ=V({sessionId:zX,prompt:B(KX),_meta:$(H(I(),z()).nullish(),()=>void 0)}),ITe=V({uri:I(),name:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),LTe=V({name:I(),owner:I(),remoteUrl:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),dQ=V({workspaceUri:$(I().nullish(),()=>void 0),workspaceFolders:B(ITe).nullish(),repository:$(LTe.nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),RTe=Qi([W(`automatic`),W(`diagnostic`),W(`manual`)]),zTe=V({uri:I(),languageId:I(),text:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),BTe=V({startLine:Gi().gte(0).max(4294967295,{error:`Invalid value: Expected uint32 to be <= 4294967295`}),endLine:Gi().gte(0).max(4294967295,{error:`Invalid value: Expected uint32 to be <= 4294967295`}),text:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),VTe=V({uri:I(),excerpts:B(BTe),_meta:$(H(I(),z()).nullish(),()=>void 0)}),HTe=V({uri:I(),diff:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),UTe=V({action:I(),uri:I(),position:FZ,timestampMs:L(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),WTe=V({uri:I(),languageId:I(),visibleRange:$(IZ.nullish(),()=>void 0),lastFocusedMs:$(L().nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),GTe=Qi([W(`error`),W(`warning`),W(`information`),W(`hint`)]),KTe=V({uri:I(),range:IZ,severity:GTe,message:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),qTe=V({recentFiles:B(zTe).nullish(),relatedSnippets:B(VTe).nullish(),editHistory:B(HTe).nullish(),userActions:B(UTe).nullish(),openFiles:B(WTe).nullish(),diagnostics:B(KTe).nullish(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),fQ=V({sessionId:zX,uri:I(),version:L(),position:FZ,selection:IZ.nullish(),triggerKind:RTe,context:qTe.nullish(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),pQ=V({sessionId:zX,_meta:$(H(I(),z()).nullish(),()=>void 0)});V({id:RX,method:I(),params:Qi([qZ,JZ,YZ,XZ,ZZ,QZ,tQ,nQ,rQ,iQ,aQ,oQ,sQ,cQ,lQ,uQ,dQ,fQ,pQ,bZ,xZ]).nullish()});const JTe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),YTe=V({content:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),XTe=V({optionId:ZX,_meta:$(H(I(),z()).nullish(),()=>void 0)}),ZTe=V({outcome:Qi([V({outcome:W(`cancelled`)}),XTe.and(V({outcome:W(`selected`)}))]),_meta:$(H(I(),z()).nullish(),()=>void 0)}),QTe=V({terminalId:qX,_meta:$(H(I(),z()).nullish(),()=>void 0)}),$Te=V({exitCode:$(Gi().gte(0).max(4294967295,{error:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),()=>void 0),signal:$(I().nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),eEe=V({output:I(),truncated:R(),exitStatus:$($Te.nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),tEe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),nEe=V({exitCode:$(Gi().gte(0).max(4294967295,{error:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),()=>void 0),signal:$(I().nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)}),rEe=V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),iEe=Qi([I(),L(),L(),R(),B(I())]),mQ=V({content:H(I(),iEe).nullish()});Qi([V({id:RX,result:Qi([JTe,YTe,ZTe,QTe,eEe,tEe,nEe,rEe,IX(ea(Qi([mQ.and(V({action:W(`accept`)})),V({action:W(`decline`)}),V({action:W(`cancel`)}),FX(V({action:I()}),`action`,[`accept`,`cancel`,`decline`])]),V({_meta:$(H(I(),z()).nullish(),()=>void 0)})),`action`,[`accept`,`cancel`,`decline`]),V({connectionId:yZ,_meta:$(H(I(),z()).nullish(),()=>void 0)}),V({_meta:$(H(I(),z()).nullish(),()=>void 0)}),RZ,LZ])}),V({id:RX,error:zZ})]);const hQ=V({sessionId:zX,_meta:$(H(I(),z()).nullish(),()=>void 0)}),gQ=V({sessionId:zX,uri:I(),languageId:I(),version:L(),text:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),aEe=V({range:IZ.nullish(),text:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),_Q=V({sessionId:zX,uri:I(),version:L(),contentChanges:NX(LX(aEe),()=>[]),_meta:$(H(I(),z()).nullish(),()=>void 0)}),vQ=V({sessionId:zX,uri:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),yQ=V({sessionId:zX,uri:I(),_meta:$(H(I(),z()).nullish(),()=>void 0)}),bQ=V({sessionId:zX,uri:I(),version:L(),position:FZ,visibleRange:IZ,_meta:$(H(I(),z()).nullish(),()=>void 0)}),xQ=V({sessionId:zX,id:PZ,_meta:$(H(I(),z()).nullish(),()=>void 0)}),SQ=V({sessionId:zX,id:PZ,reason:$(Qi([W(`rejected`),W(`ignored`),W(`replaced`),W(`cancelled`)]).nullish(),()=>void 0),_meta:$(H(I(),z()).nullish(),()=>void 0)});V({method:I(),params:Qi([hQ,gQ,_Q,vQ,yQ,bQ,xQ,SQ,GZ,KZ]).nullish()}),V({requestId:RX,_meta:$(H(I(),z()).nullish(),()=>void 0)}),mZ.and(V({mode:W(`form`)})).and(V({message:I()})),gZ.and(V({mode:W(`url`)})).and(V({message:I()})),Qi([aZ,oZ]).and(V({message:I()})),cZ.and(V({type:W(`string`)})),lZ.and(V({type:W(`number`)})),uZ.and(V({type:W(`integer`)})),dZ.and(V({type:W(`boolean`)})),pZ.and(V({type:W(`array`)})),fZ.and(V({type:W(`string`)})),mQ.and(V({action:W(`accept`)})),V({action:W(`decline`)}),V({action:W(`cancel`)});function CQ(e){return e??{}}AX.initialize,AX.authenticate,AX.logout,AX.providers_list,AX.providers_set,AX.providers_disable,AX.session_new,AX.session_load,AX.session_list,AX.session_delete,AX.session_fork,AX.session_resume,AX.session_close,AX.session_set_mode,AX.session_set_config_option,AX.session_prompt,AX.session_cancel,AX.nes_start,AX.nes_suggest,AX.nes_accept,AX.nes_reject,AX.nes_close,AX.document_did_open,AX.document_did_change,AX.document_did_close,AX.document_did_save,AX.document_did_focus,jX.session_request_permission,jX.session_update,jX.fs_write_text_file,jX.fs_read_text_file,jX.terminal_create,jX.terminal_output,jX.terminal_release,jX.terminal_wait_for_exit,jX.terminal_kill,jX.elicitation_create,jX.elicitation_complete,PCe.cancel_request;function wQ(e,t,n){return{method:e,params:t,mapResponse:n}}function TQ(e,t){return{method:e,params:t}}function EQ(e){let t={};for(let n of Object.values(e))t[n.method]=n;return t}const oEe={initialize:wQ(AX.initialize,qZ),newSession:wQ(AX.session_new,tQ),loadSession:wQ(AX.session_load,nQ,CQ),unstable_forkSession:wQ(AX.session_fork,aQ),listSessions:wQ(AX.session_list,rQ),deleteSession:wQ(AX.session_delete,iQ,CQ),resumeSession:wQ(AX.session_resume,oQ),closeSession:wQ(AX.session_close,sQ,CQ),setSessionMode:wQ(AX.session_set_mode,cQ,CQ),setSessionConfigOption:wQ(AX.session_set_config_option,lQ),authenticate:wQ(AX.authenticate,JZ,CQ),unstable_listProviders:wQ(AX.providers_list,YZ),unstable_setProvider:wQ(AX.providers_set,XZ,CQ),unstable_disableProvider:wQ(AX.providers_disable,ZZ,CQ),logout:wQ(AX.logout,QZ,CQ),prompt:wQ(AX.session_prompt,uQ),unstable_startNes:wQ(AX.nes_start,dQ),unstable_suggestNes:wQ(AX.nes_suggest,fQ),unstable_closeNes:wQ(AX.nes_close,pQ,CQ)},sEe={cancel:TQ(AX.session_cancel,hQ),unstable_didOpenDocument:TQ(AX.document_did_open,gQ),unstable_didChangeDocument:TQ(AX.document_did_change,_Q),unstable_didCloseDocument:TQ(AX.document_did_close,vQ),unstable_didSaveDocument:TQ(AX.document_did_save,yQ),unstable_didFocusDocument:TQ(AX.document_did_focus,bQ),unstable_acceptNes:TQ(AX.nes_accept,xQ),unstable_rejectNes:TQ(AX.nes_reject,SQ)},cEe={requestPermission:wQ(jX.session_request_permission,QX),writeTextFile:wQ(jX.fs_write_text_file,BX,CQ),readTextFile:wQ(jX.fs_read_text_file,VX),createTerminal:wQ(jX.terminal_create,eZ),terminalOutput:wQ(jX.terminal_output,tZ),releaseTerminal:wQ(jX.terminal_release,nZ,CQ),waitForTerminalExit:wQ(jX.terminal_wait_for_exit,rZ),killTerminal:wQ(jX.terminal_kill,iZ,CQ),unstable_createElicitation:wQ(jX.elicitation_create,_Z)},lEe={sessionUpdate:TQ(jX.session_update,UZ),unstable_completeElicitation:TQ(jX.elicitation_complete,WZ)};EQ(oEe),EQ(sEe),EQ(cEe),EQ(lEe),AX.initialize,AX.authenticate,AX.providers_list,AX.providers_set,AX.providers_disable,AX.session_new,AX.session_load,AX.session_set_mode,AX.session_set_config_option,AX.session_prompt,AX.session_list,AX.session_delete,AX.session_fork,AX.session_resume,AX.session_close,AX.logout,AX.nes_start,AX.nes_suggest,AX.nes_close,AX.session_cancel,AX.nes_accept,AX.nes_reject,AX.document_did_open,AX.document_did_change,AX.document_did_close,AX.document_did_save,AX.document_did_focus,jX.session_request_permission,jX.fs_write_text_file,jX.fs_read_text_file,jX.terminal_create,jX.terminal_output,jX.terminal_release,jX.terminal_wait_for_exit,jX.terminal_kill,jX.elicitation_create,jX.session_update,jX.elicitation_complete;var uEe=i(((e,t)=>{function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}let r=new Int32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117]);function i(e){if(Buffer.isBuffer(e))return e;if(typeof e==`number`)return Buffer.alloc(e);if(typeof e==`string`)return Buffer.from(e);throw Error(`input must be buffer, number, or string, received `+typeof e)}function a(e){let t=i(4);return t.writeInt32BE(e,0),t}function o(e,t){e=i(e),Buffer.isBuffer(t)&&(t=t.readUInt32BE(0));let n=~~t^-1;for(var a=0;a<e.length;a++)n=r[(n^e[a])&255]^n>>>8;return n^-1}function s(){return a(o.apply(null,arguments))}s.signed=function(){return o.apply(null,arguments)},s.unsigned=function(){return o.apply(null,arguments)>>>0},t.exports=n(s)})),DQ=i((e=>{var n=t(`fs`),r=t(`stream`).Transform,i=t(`stream`).PassThrough,a=t(`zlib`),o=t(`util`),s=t(`events`).EventEmitter,c=t(`events`).errorMonitor,l=uEe();e.ZipFile=u,e.dateToDosDateTime=se,o.inherits(u,s);function u(){this.outputStream=new i,this.entries=[],this.outputStreamCursor=0,this.ended=!1,this.allDone=!1,this.forceZip64Eocd=!1,this.errored=!1,this.on(c,function(){this.errored=!0})}u.prototype.addFile=function(e,t,r){var i=this;if(t=S(t,!1),r??={},!_(i)){var a=new w(t,!1,r);i.entries.push(a),n.stat(e,function(t,o){if(t)return i.emit(`error`,t);if(!o.isFile())return i.emit(`error`,Error(`not a file: `+e));a.uncompressedSize=o.size,r.mtime??a.setLastModDate(o.mtime),r.mode??a.setFileAttributesMode(o.mode),a.setFileDataPumpFunction(function(){var t=n.createReadStream(e);a.state=w.FILE_DATA_IN_PROGRESS,t.on(`error`,function(e){i.emit(`error`,e)}),p(i,a,t)}),h(i)})}},u.prototype.addReadStream=function(e,t,n){this.addReadStreamLazy(t,n,function(t){t(null,e)})},u.prototype.addReadStreamLazy=function(e,t,n){var r=this;if(typeof t==`function`&&(n=t,t=null),t??={},e=S(e,!1),!_(r)){var i=new w(e,!1,t);r.entries.push(i),i.setFileDataPumpFunction(function(){i.state=w.FILE_DATA_IN_PROGRESS,n(function(e,t){if(e)return r.emit(`error`,e);p(r,i,t)})}),h(r)}},u.prototype.addBuffer=function(e,t,n){var r=this;if(t=S(t,!1),e.length>1073741823)throw Error(`buffer too large: `+e.length+` > 1073741823`);if(n??={},n.size!=null)throw Error(`options.size not allowed`);if(_(r))return;var i=new w(t,!1,n);i.uncompressedSize=e.length,i.crc32=l.unsigned(e),i.crcAndFileSizeKnown=!0,r.entries.push(i),i.compressionLevel===0?o(e):a.deflateRaw(e,{level:i.compressionLevel},function(e,t){o(t)});function o(e){i.compressedSize=e.length,i.setFileDataPumpFunction(function(){f(r,e),f(r,i.getDataDescriptor()),i.state=w.FILE_DATA_DONE,setImmediate(function(){h(r)})}),h(r)}},u.prototype.addEmptyDirectory=function(e,t){var n=this;if(e=S(e,!0),t??={},t.size!=null)throw Error(`options.size not allowed`);if(t.compress!=null)throw Error(`options.compress not allowed`);if(t.compressionLevel!=null)throw Error(`options.compressionLevel not allowed`);if(!_(n)){var r=new w(e,!0,t);n.entries.push(r),r.setFileDataPumpFunction(function(){f(n,r.getDataDescriptor()),r.state=w.FILE_DATA_DONE,h(n)}),h(n)}};var d=fe([80,75,5,6]);u.prototype.end=function(e,t){if(typeof e==`function`&&(t=e,e=null),e??={},!this.ended&&(this.ended=!0,!this.errored)){if(this.calculatedTotalSizeCallback=t,this.forceZip64Eocd=!!e.forceZip64Format,e.comment){if(this.comment=typeof e.comment==`string`?ue(e.comment):e.comment,this.comment.length>65535)throw Error(`comment is too large`);if(P(this.comment,d))throw Error(`comment contains end of central directory record signature`)}else this.comment=C;h(this)}};function f(e,t){e.outputStream.write(t),e.outputStreamCursor+=t.length}function p(e,t,n){var r=new M,o=new ce,s=t.compressionLevel===0?new i:new a.DeflateRaw({level:t.compressionLevel}),c=new ce;n.pipe(r).pipe(o).pipe(s).pipe(c).pipe(e.outputStream,{end:!1}),c.on(`end`,function(){if(t.crc32=r.crc32,t.uncompressedSize==null)t.uncompressedSize=o.byteCount;else if(t.uncompressedSize!==o.byteCount)return e.emit(`error`,Error(`file data stream has unexpected number of bytes`));t.compressedSize=c.byteCount,e.outputStreamCursor+=t.compressedSize,f(e,t.getDataDescriptor()),t.state=w.FILE_DATA_DONE,h(e)})}function m(e){if(e.compress!=null&&e.compressionLevel!=null&&!!e.compress!=!!e.compressionLevel)throw Error(`conflicting settings for compress and compressionLevel`);return e.compressionLevel==null?e.compress===!1?0:6:e.compressionLevel}function h(e){if(e.allDone||e.errored)return;if(e.ended&&e.calculatedTotalSizeCallback!=null){var t=g(e);t!=null&&(e.calculatedTotalSizeCallback(t),e.calculatedTotalSizeCallback=null)}var n=r();function r(){for(var t=0;t<e.entries.length;t++){var n=e.entries[t];if(n.state<w.FILE_DATA_DONE)return n}return null}if(n!=null){if(n.state<w.READY_TO_PUMP_FILE_DATA||n.state===w.FILE_DATA_IN_PROGRESS)return;n.relativeOffsetOfLocalHeader=e.outputStreamCursor,f(e,n.getLocalFileHeader()),n.doFileDataPump()}else e.ended&&(e.offsetOfStartOfCentralDirectory=e.outputStreamCursor,e.entries.forEach(function(t){f(e,t.getCentralDirectoryRecord())}),f(e,x(e)),e.outputStream.end(),e.allDone=!0)}function g(e){for(var t=0,n=0,r=0;r<e.entries.length;r++){var i=e.entries[r];if(i.compressionLevel!==0)return-1;if(i.state>=w.READY_TO_PUMP_FILE_DATA){if(i.uncompressedSize==null)return-1}else if(i.uncompressedSize==null)return null;i.relativeOffsetOfLocalHeader=t;var a=i.useZip64Format();t+=T+i.utf8FileName.length,t+=i.uncompressedSize,i.crcAndFileSizeKnown||(t+=a?ie:re),n+=O+i.utf8FileName.length+i.fileComment.length,i.forceDosTimestamp||(n+=ae),a&&(n+=oe)}var o=0;return(e.forceZip64Eocd||e.entries.length>=65535||n>=65535||t>=4294967295)&&(o+=v+y),o+=b+e.comment.length,t+n+o}function _(e){if(e.ended)throw Error(`cannot add entries after calling end()`);return!!e.errored}var v=56,y=20,b=22;function x(e,t){var n=!1,r=e.entries.length;(e.forceZip64Eocd||e.entries.length>=65535)&&(r=65535,n=!0);var i=e.outputStreamCursor-e.offsetOfStartOfCentralDirectory,a=i;(e.forceZip64Eocd||i>=4294967295)&&(a=4294967295,n=!0);var o=e.offsetOfStartOfCentralDirectory;if((e.forceZip64Eocd||e.offsetOfStartOfCentralDirectory>=4294967295)&&(o=4294967295,n=!0),t)return n?v+y+b:b;var s=de(b+e.comment.length);if(s.writeUInt32LE(101010256,0),s.writeUInt16LE(0,4),s.writeUInt16LE(0,6),s.writeUInt16LE(r,8),s.writeUInt16LE(r,10),s.writeUInt32LE(a,12),s.writeUInt32LE(o,16),s.writeUInt16LE(e.comment.length,20),e.comment.copy(s,22),!n)return s;var c=de(v);c.writeUInt32LE(101075792,0),j(c,v-12,4),c.writeUInt16LE(ee,12),c.writeUInt16LE(D,14),c.writeUInt32LE(0,16),c.writeUInt32LE(0,20),j(c,e.entries.length,24),j(c,e.entries.length,32),j(c,i,40),j(c,e.offsetOfStartOfCentralDirectory,48);var l=de(y);return l.writeUInt32LE(117853008,0),l.writeUInt32LE(0,4),j(l,e.outputStreamCursor,8),l.writeUInt32LE(1,16),Buffer.concat([c,l,s])}function S(e,t){if(e===``)throw Error(`empty metadataPath`);if(e=e.replace(/\\/g,`/`),/^[a-zA-Z]:/.test(e)||/^\//.test(e))throw Error(`absolute path: `+e);if(e.split(`/`).indexOf(`..`)!==-1)throw Error(`invalid relative path: `+e);var n=/\/$/.test(e);if(t)n||(e+=`/`);else if(n)throw Error(`file path cannot end with '/': `+e);return e}var C=de(0);function w(e,t,n){if(this.utf8FileName=fe(e),this.utf8FileName.length>65535)throw Error(`utf8 file name too long. `+utf8FileName.length+` > 65535`);if(this.isDirectory=t,this.state=w.WAITING_FOR_METADATA,this.setLastModDate(n.mtime==null?new Date:n.mtime),this.forceDosTimestamp=!!n.forceDosTimestamp,n.mode==null?this.setFileAttributesMode(t?16893:33204):this.setFileAttributesMode(n.mode),t?(this.crcAndFileSizeKnown=!0,this.crc32=0,this.uncompressedSize=0,this.compressedSize=0):(this.crcAndFileSizeKnown=!1,this.crc32=null,this.uncompressedSize=null,this.compressedSize=null,n.size!=null&&(this.uncompressedSize=n.size)),this.compressionLevel=t?0:m(n),this.forceZip64Format=!!n.forceZip64Format,n.fileComment){if(this.fileComment=typeof n.fileComment==`string`?fe(n.fileComment,`utf-8`):n.fileComment,this.fileComment.length>65535)throw Error(`fileComment is too large`)}else this.fileComment=C}w.WAITING_FOR_METADATA=0,w.READY_TO_PUMP_FILE_DATA=1,w.FILE_DATA_IN_PROGRESS=2,w.FILE_DATA_DONE=3,w.prototype.setLastModDate=function(e){this.mtime=e;var t=se(e);this.lastModFileTime=t.time,this.lastModFileDate=t.date},w.prototype.setFileAttributesMode=function(e){if((e&65535)!==e)throw Error(`invalid mode. expected: 0 <= `+e+` <= 65535`);this.externalFileAttributes=e<<16>>>0},w.prototype.setFileDataPumpFunction=function(e){this.doFileDataPump=e,this.state=w.READY_TO_PUMP_FILE_DATA},w.prototype.useZip64Format=function(){return this.forceZip64Format||this.uncompressedSize!=null&&this.uncompressedSize>4294967294||this.compressedSize!=null&&this.compressedSize>4294967294||this.relativeOffsetOfLocalHeader!=null&&this.relativeOffsetOfLocalHeader>4294967294};var T=30,E=20,D=45,ee=831,te=2048,ne=8;w.prototype.getLocalFileHeader=function(){var e=0,t=0,n=0;this.crcAndFileSizeKnown&&(e=this.crc32,t=this.compressedSize,n=this.uncompressedSize);var r=de(T),i=te;return this.crcAndFileSizeKnown||(i|=ne),r.writeUInt32LE(67324752,0),r.writeUInt16LE(E,4),r.writeUInt16LE(i,6),r.writeUInt16LE(this.getCompressionMethod(),8),r.writeUInt16LE(this.lastModFileTime,10),r.writeUInt16LE(this.lastModFileDate,12),r.writeUInt32LE(e,14),r.writeUInt32LE(t,18),r.writeUInt32LE(n,22),r.writeUInt16LE(this.utf8FileName.length,26),r.writeUInt16LE(0,28),Buffer.concat([r,this.utf8FileName])};var re=16,ie=24;w.prototype.getDataDescriptor=function(){if(this.crcAndFileSizeKnown)return C;if(this.useZip64Format()){var e=de(ie);return e.writeUInt32LE(134695760,0),e.writeUInt32LE(this.crc32,4),j(e,this.compressedSize,8),j(e,this.uncompressedSize,16),e}var e=de(re);return e.writeUInt32LE(134695760,0),e.writeUInt32LE(this.crc32,4),e.writeUInt32LE(this.compressedSize,8),e.writeUInt32LE(this.uncompressedSize,12),e};var O=46,ae=9,oe=28;w.prototype.getCentralDirectoryRecord=function(){var e=de(O),t=te;this.crcAndFileSizeKnown||(t|=ne);var n=C;if(!this.forceDosTimestamp){n=de(ae),n.writeUInt16LE(21589,0),n.writeUInt16LE(ae-4,2),n.writeUInt8(3,4);var r=Math.floor(this.mtime.getTime()/1e3);r<-2147483648&&(r=-2147483648),r>2147483647&&(r=2147483647),n.writeUInt32LE(r,5)}var i=this.compressedSize,a=this.uncompressedSize,o=this.relativeOffsetOfLocalHeader,s=E,c=C;return this.useZip64Format()&&(i=4294967295,a=4294967295,o=4294967295,s=D,c=de(oe),c.writeUInt16LE(1,0),c.writeUInt16LE(oe-4,2),j(c,this.uncompressedSize,4),j(c,this.compressedSize,12),j(c,this.relativeOffsetOfLocalHeader,20)),e.writeUInt32LE(33639248,0),e.writeUInt16LE(ee,4),e.writeUInt16LE(s,6),e.writeUInt16LE(t,8),e.writeUInt16LE(this.getCompressionMethod(),10),e.writeUInt16LE(this.lastModFileTime,12),e.writeUInt16LE(this.lastModFileDate,14),e.writeUInt32LE(this.crc32,16),e.writeUInt32LE(i,20),e.writeUInt32LE(a,24),e.writeUInt16LE(this.utf8FileName.length,28),e.writeUInt16LE(n.length+c.length,30),e.writeUInt16LE(this.fileComment.length,32),e.writeUInt16LE(0,34),e.writeUInt16LE(0,36),e.writeUInt32LE(this.externalFileAttributes,38),e.writeUInt32LE(o,42),Buffer.concat([e,this.utf8FileName,n,c,this.fileComment])},w.prototype.getCompressionMethod=function(){return this.compressionLevel===0?0:8};var k=new Date(1980,0,1),A=new Date(2107,11,31,23,59,58);function se(e){e<k?e=k:e>A&&(e=A);var t=0;t|=e.getDate()&31,t|=(e.getMonth()+1&15)<<5,t|=(e.getFullYear()-1980&127)<<9;var n=0;return n|=Math.floor(e.getSeconds()/2),n|=(e.getMinutes()&63)<<5,n|=(e.getHours()&31)<<11,{date:t,time:n}}function j(e,t,n){var r=Math.floor(t/4294967296),i=t%4294967296;e.writeUInt32LE(i,n),e.writeUInt32LE(r,n+4)}o.inherits(ce,r);function ce(e){r.call(this,e),this.byteCount=0}ce.prototype._transform=function(e,t,n){this.byteCount+=e.length,n(null,e)},o.inherits(M,r);function M(e){r.call(this,e),this.crc32=0}M.prototype._transform=function(e,t,n){this.crc32=l.unsigned(e,this.crc32),n(null,e)};var N=`\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■\xA0`;if(N.length!==256)throw Error(`assertion failure`);var le=null;function ue(e){if(/^[\x20-\x7e]*$/.test(e))return fe(e,`utf-8`);if(le==null){le={};for(var t=0;t<N.length;t++)le[N[t]]=t}for(var n=de(e.length),t=0;t<e.length;t++){var r=le[e[t]];if(r==null)throw Error(`character not encodable in CP437: `+JSON.stringify(e[t]));n[t]=r}return n}function de(e){de=t;try{return de(e)}catch{return de=n,de(e)}function t(e){return Buffer.allocUnsafe(e)}function n(e){return new Buffer(e)}}function fe(e,t){fe=n;try{return fe(e,t)}catch{return fe=r,fe(e,t)}function n(e,t){return Buffer.from(e,t)}function r(e,t){return new Buffer(e,t)}}function P(e,t){P=n;try{return P(e,t)}catch{return P=r,P(e,t)}function n(e,t){return e.includes(t)}function r(e,t){for(var n=0;n<=e.length-t.length;n++)for(var r=0;;r++){if(r===t.length)return!0;if(e[n+r]!==t[r])break}return!1}}})),dEe=i(((e,t)=>{function n(e){return Array.isArray(e)?e:[e]}let r=/^\s+$/,i=/(?:[^\\]|^)\\$/,a=/^\\!/,o=/^\\#/,s=/\r?\n/g,c=/^\.*\/|^\.+$/,l=`node-ignore`;typeof Symbol<`u`&&(l=Symbol.for(`node-ignore`));let u=l,d=(e,t,n)=>Object.defineProperty(e,t,{value:n}),f=/([0-z])-([0-z])/g,p=()=>!1,m=e=>e.replace(f,(e,t,n)=>t.charCodeAt(0)<=n.charCodeAt(0)?e:``),h=e=>{let{length:t}=e;return e.slice(0,t-t%2)},g=[[/^\uFEFF/,()=>``],[/((?:\\\\)*?)(\\?\s+)$/,(e,t,n)=>t+(n.indexOf(`\\`)===0?` `:``)],[/(\\+?)\s/g,(e,t)=>{let{length:n}=t;return t.slice(0,n-n%2)+` `}],[/[\\$.|*+(){^]/g,e=>`\\${e}`],[/(?!\\)\?/g,()=>`[^/]`],[/^\//,()=>`^`],[/\//g,()=>`\\/`],[/^\^*\\\*\\\*\\\//,()=>`^(?:.*\\/)?`],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?`^`:`(?:^|\\/)`}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(e,t,n)=>t+6<n.length?`(?:\\/[^\\/]+)*`:`\\/.+`],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(e,t,n)=>t+n.replace(/\\\*/g,`[^\\/]*`)],[/\\\\\\(?=[$.|*+(){^])/g,()=>`\\`],[/\\\\/g,()=>`\\`],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,n,r,i)=>t===`\\`?`\\[${n}${h(r)}${i}`:i===`]`&&r.length%2==0?`[${m(n)}${r}]`:`[]`],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(e,t)=>`${t?`${t}[^/]+`:`[^/]*`}(?=$|\\/$)`]],_=Object.create(null),v=(e,t)=>{let n=_[e];return n||(n=g.reduce((t,[n,r])=>t.replace(n,r.bind(e)),e),_[e]=n),t?new RegExp(n,`i`):new RegExp(n)},y=e=>typeof e==`string`,b=e=>e&&y(e)&&!r.test(e)&&!i.test(e)&&e.indexOf(`#`)!==0,x=e=>e.split(s);var S=class{constructor(e,t,n,r){this.origin=e,this.pattern=t,this.negative=n,this.regex=r}};let C=(e,t)=>{let n=e,r=!1;e.indexOf(`!`)===0&&(r=!0,e=e.substr(1)),e=e.replace(a,`!`).replace(o,`#`);let i=v(e,t);return new S(n,e,r,i)},w=(e,t)=>{throw new t(e)},T=(e,t,n)=>y(e)?e?!T.isNotRelative(e)||n(`path should be a \`path.relative()\`d string, but got "${t}"`,RangeError):n(`path must not be empty`,TypeError):n(`path must be a string, but got \`${t}\``,TypeError),E=e=>c.test(e);T.isNotRelative=E,T.convert=e=>e;var D=class{constructor({ignorecase:e=!0,ignoreCase:t=e,allowRelativePaths:n=!1}={}){d(this,u,!0),this._rules=[],this._ignoreCase=t,this._allowRelativePaths=n,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}_addPattern(e){if(e&&e[u]){this._rules=this._rules.concat(e._rules),this._added=!0;return}if(b(e)){let t=C(e,this._ignoreCase);this._added=!0,this._rules.push(t)}}add(e){return this._added=!1,n(y(e)?x(e):e).forEach(this._addPattern,this),this._added&&this._initCache(),this}addPattern(e){return this.add(e)}_testOne(e,t){let n=!1,r=!1;return this._rules.forEach(i=>{let{negative:a}=i;r===a&&n!==r||a&&!n&&!r&&!t||i.regex.test(e)&&(n=!a,r=a)}),{ignored:n,unignored:r}}_test(e,t,n,r){let i=e&&T.convert(e);return T(i,e,this._allowRelativePaths?p:w),this._t(i,t,n,r)}_t(e,t,n,r){if(e in t)return t[e];if(r||=e.split(`/`),r.pop(),!r.length)return t[e]=this._testOne(e,n);let i=this._t(r.join(`/`)+`/`,t,n,r);return t[e]=i.ignored?i:this._testOne(e,n)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return n(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}};let ee=e=>new D(e);if(ee.isPathValid=e=>T(e&&T.convert(e),e,p),ee.default=ee,t.exports=ee,typeof process<`u`&&(process.env&&process.env.IGNORE_TEST_WIN32||process.platform===`win32`)){T.convert=e=>/^\\\\\?\\/.test(e)||/["<>|\u0000-\u001F]+/u.test(e)?e:e.replace(/\\/g,`/`);let e=/^[a-z]:\//i;T.isNotRelative=t=>e.test(t)||E(t)}})),fEe=i(((e,t)=>{var n=1e3,r=n*60,i=r*60,a=i*24,o=a*7,s=a*365.25;t.exports=function(e,t){t||={};var n=typeof e;if(n===`string`&&e.length>0)return c(e);if(n===`number`&&isFinite(e))return t.long?u(e):l(e);throw Error(`val is not a non-empty string or a valid number. val=`+JSON.stringify(e))};function c(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var c=parseFloat(t[1]);switch((t[2]||`ms`).toLowerCase()){case`years`:case`year`:case`yrs`:case`yr`:case`y`:return c*s;case`weeks`:case`week`:case`w`:return c*o;case`days`:case`day`:case`d`:return c*a;case`hours`:case`hour`:case`hrs`:case`hr`:case`h`:return c*i;case`minutes`:case`minute`:case`mins`:case`min`:case`m`:return c*r;case`seconds`:case`second`:case`secs`:case`sec`:case`s`:return c*n;case`milliseconds`:case`millisecond`:case`msecs`:case`msec`:case`ms`:return c;default:return}}}}function l(e){var t=Math.abs(e);return t>=a?Math.round(e/a)+`d`:t>=i?Math.round(e/i)+`h`:t>=r?Math.round(e/r)+`m`:t>=n?Math.round(e/n)+`s`:e+`ms`}function u(e){var t=Math.abs(e);return t>=a?d(e,t,a,`day`):t>=i?d(e,t,i,`hour`):t>=r?d(e,t,r,`minute`):t>=n?d(e,t,n,`second`):e+` ms`}function d(e,t,n,r){var i=t>=n*1.5;return Math.round(e/n)+` `+r+(i?`s`:``)}})),OQ=i(((e,t)=>{function n(e){n.debug=n,n.default=n,n.coerce=c,n.disable=o,n.enable=i,n.enabled=s,n.humanize=fEe(),n.destroy=l,Object.keys(e).forEach(t=>{n[t]=e[t]}),n.names=[],n.skips=[],n.formatters={};function t(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return n.colors[Math.abs(t)%n.colors.length]}n.selectColor=t;function n(e){let t,i=null,a,o;function s(...e){if(!s.enabled)return;let r=s,i=Number(new Date);r.diff=i-(t||i),r.prev=t,r.curr=i,t=i,e[0]=n.coerce(e[0]),typeof e[0]!=`string`&&e.unshift(`%O`);let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(t,i)=>{if(t===`%%`)return`%`;a++;let o=n.formatters[i];if(typeof o==`function`){let n=e[a];t=o.call(r,n),e.splice(a,1),a--}return t}),n.formatArgs.call(r,e),(r.log||n.log).apply(r,e)}return s.namespace=e,s.useColors=n.useColors(),s.color=n.selectColor(e),s.extend=r,s.destroy=n.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>i===null?(a!==n.namespaces&&(a=n.namespaces,o=n.enabled(e)),o):i,set:e=>{i=e}}),typeof n.init==`function`&&n.init(s),s}function r(e,t){let r=n(this.namespace+(t===void 0?`:`:t)+e);return r.log=this.log,r}function i(e){n.save(e),n.namespaces=e,n.names=[],n.skips=[];let t=(typeof e==`string`?e:``).trim().replace(/\s+/g,`,`).split(`,`).filter(Boolean);for(let e of t)e[0]===`-`?n.skips.push(e.slice(1)):n.names.push(e)}function a(e,t){let n=0,r=0,i=-1,a=0;for(;n<e.length;)if(r<t.length&&(t[r]===e[n]||t[r]===`*`))t[r]===`*`?(i=r,a=n,r++):(n++,r++);else if(i!==-1)r=i+1,a++,n=a;else return!1;for(;r<t.length&&t[r]===`*`;)r++;return r===t.length}function o(){let e=[...n.names,...n.skips.map(e=>`-`+e)].join(`,`);return n.enable(``),e}function s(e){for(let t of n.skips)if(a(e,t))return!1;for(let t of n.names)if(a(e,t))return!0;return!1}function c(e){return e instanceof Error?e.stack||e.message:e}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}t.exports=n})),pEe=i(((e,t)=>{e.formatArgs=r,e.save=i,e.load=a,e.useColors=n,e.storage=o(),e.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=`#0000CC.#0000FF.#0033CC.#0033FF.#0066CC.#0066FF.#0099CC.#0099FF.#00CC00.#00CC33.#00CC66.#00CC99.#00CCCC.#00CCFF.#3300CC.#3300FF.#3333CC.#3333FF.#3366CC.#3366FF.#3399CC.#3399FF.#33CC00.#33CC33.#33CC66.#33CC99.#33CCCC.#33CCFF.#6600CC.#6600FF.#6633CC.#6633FF.#66CC00.#66CC33.#9900CC.#9900FF.#9933CC.#9933FF.#99CC00.#99CC33.#CC0000.#CC0033.#CC0066.#CC0099.#CC00CC.#CC00FF.#CC3300.#CC3333.#CC3366.#CC3399.#CC33CC.#CC33FF.#CC6600.#CC6633.#CC9900.#CC9933.#CCCC00.#CCCC33.#FF0000.#FF0033.#FF0066.#FF0099.#FF00CC.#FF00FF.#FF3300.#FF3333.#FF3366.#FF3399.#FF33CC.#FF33FF.#FF6600.#FF6633.#FF9900.#FF9933.#FFCC00.#FFCC33`.split(`.`);function n(){if(typeof window<`u`&&window.process&&(window.process.type===`renderer`||window.process.__nwjs))return!0;if(typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<`u`&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<`u`&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<`u`&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(e){if(e[0]=(this.useColors?`%c`:``)+this.namespace+(this.useColors?` %c`:` `)+e[0]+(this.useColors?`%c `:` `)+`+`+t.exports.humanize(this.diff),!this.useColors)return;let n=`color: `+this.color;e.splice(1,0,n,`color: inherit`);let r=0,i=0;e[0].replace(/%[a-zA-Z%]/g,e=>{e!==`%%`&&(r++,e===`%c`&&(i=r))}),e.splice(i,0,n)}e.log=console.debug||console.log||(()=>{});function i(t){try{t?e.storage.setItem(`debug`,t):e.storage.removeItem(`debug`)}catch{}}function a(){let t;try{t=e.storage.getItem(`debug`)||e.storage.getItem(`DEBUG`)}catch{}return!t&&typeof process<`u`&&`env`in process&&(t=process.env.DEBUG),t}function o(){try{return localStorage}catch{}}t.exports=OQ()(e);let{formatters:s}=t.exports;s.j=function(e){try{return JSON.stringify(e)}catch(e){return`[UnexpectedJSONParseError]: `+e.message}}})),mEe=i(((e,t)=>{t.exports=(e,t=process.argv)=>{let n=e.startsWith(`-`)?``:e.length===1?`-`:`--`,r=t.indexOf(n+e),i=t.indexOf(`--`);return r!==-1&&(i===-1||r<i)}})),hEe=i(((e,n)=>{let r=t(`os`),i=t(`tty`),a=mEe(),{env:o}=process,s;a(`no-color`)||a(`no-colors`)||a(`color=false`)||a(`color=never`)?s=0:(a(`color`)||a(`colors`)||a(`color=true`)||a(`color=always`))&&(s=1),`FORCE_COLOR`in o&&(s=o.FORCE_COLOR===`true`?1:o.FORCE_COLOR===`false`?0:o.FORCE_COLOR.length===0?1:Math.min(parseInt(o.FORCE_COLOR,10),3));function c(e){return e!==0&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function l(e,t){if(s===0)return 0;if(a(`color=16m`)||a(`color=full`)||a(`color=truecolor`))return 3;if(a(`color=256`))return 2;if(e&&!t&&s===void 0)return 0;let n=s||0;if(o.TERM===`dumb`)return n;if(process.platform===`win32`){let e=r.release().split(`.`);return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if(`CI`in o)return[`TRAVIS`,`CIRCLECI`,`APPVEYOR`,`GITLAB_CI`,`GITHUB_ACTIONS`,`BUILDKITE`].some(e=>e in o)||o.CI_NAME===`codeship`?1:n;if(`TEAMCITY_VERSION`in o)return+!!/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(o.TEAMCITY_VERSION);if(o.COLORTERM===`truecolor`)return 3;if(`TERM_PROGRAM`in o){let e=parseInt((o.TERM_PROGRAM_VERSION||``).split(`.`)[0],10);switch(o.TERM_PROGRAM){case`iTerm.app`:return e>=3?3:2;case`Apple_Terminal`:return 2}}return/-256(color)?$/i.test(o.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(o.TERM)||`COLORTERM`in o?1:n}function u(e){return c(l(e,e&&e.isTTY))}n.exports={supportsColor:u,stdout:c(l(!0,i.isatty(1))),stderr:c(l(!0,i.isatty(2)))}})),gEe=i(((e,n)=>{let r=t(`tty`),i=t(`util`);e.init=d,e.log=c,e.formatArgs=o,e.save=l,e.load=u,e.useColors=a,e.destroy=i.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),e.colors=[6,2,3,4,5,1];try{let t=hEe();t&&(t.stderr||t).level>=2&&(e.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}e.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let n=t.substring(6).toLowerCase().replace(/_([a-z])/g,(e,t)=>t.toUpperCase()),r=process.env[t];return r=/^(yes|on|true|enabled)$/i.test(r)?!0:/^(no|off|false|disabled)$/i.test(r)?!1:r===`null`?null:Number(r),e[n]=r,e},{});function a(){return`colors`in e.inspectOpts?!!e.inspectOpts.colors:r.isatty(process.stderr.fd)}function o(e){let{namespace:t,useColors:r}=this;if(r){let r=this.color,i=`\x1B[3`+(r<8?r:`8;5;`+r),a=` ${i};1m${t} \u001B[0m`;e[0]=a+e[0].split(`
|
|
724
724
|
`).join(`
|
|
725
725
|
`+a),e.push(i+`m+`+n.exports.humanize(this.diff)+`\x1B[0m`)}else e[0]=s()+t+` `+e[0]}function s(){return e.inspectOpts.hideDate?``:new Date().toISOString()+` `}function c(...t){return process.stderr.write(i.formatWithOptions(e.inspectOpts,...t)+`
|
|
726
726
|
`)}function l(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function u(){return process.env.DEBUG}function d(t){t.inspectOpts={};let n=Object.keys(e.inspectOpts);for(let r=0;r<n.length;r++)t.inspectOpts[n[r]]=e.inspectOpts[n[r]]}n.exports=OQ()(e);let{formatters:f}=n.exports;f.o=function(e){return this.inspectOpts.colors=this.useColors,i.inspect(e,this.inspectOpts).split(`
|
|
@@ -1550,6 +1550,6 @@ GFS4: `),console.error(e)}),r[c]||(d(r,global[c]||[]),r.close=(function(e){funct
|
|
|
1550
1550
|
`);O(e,o)}function A9(e,t){let n=C(e,`utf-8`);if(n.trim().length!==0)try{let r=O9(JSON.parse(n),t),i=n.endsWith(`
|
|
1551
1551
|
`)?`
|
|
1552
1552
|
`:``;O(e,`${JSON.stringify(r,null,2)}${i}`)}catch{let r=D9(n,t.contentDirSpellings);r!==n&&O(e,r)}}function j9(e,t){let n=C(e,`utf-8`),r=D9(n,t.contentDirSpellings);r!==n&&O(e,r)}function M9(e){try{return T(e,{withFileTypes:!0}).filter(e=>e.isFile()).map(t=>j(e,t.name))}catch{return[]}}const WIe=new Set([`agent-presence.json`,`agent-effects.json`,`runtime.json`]);function N9(e){return/\.log\.\d+$/.test(e)}function GIe(e){return e.endsWith(`.jsonl`)||e.endsWith(`.log`)||N9(e)}const KIe=[`telemetry`,`logs`,`process`,`diagnostic-reports`];function P9(e){let t={contentDirSpellings:E9(e.contentDir)};for(let n of KIe)for(let r of M9(j(e.stagingDir,n)))GIe(r)?k9(r,t):r.endsWith(`.json`)?A9(r,t):j9(r,t);for(let n of M9(j(e.stagingDir,`state`))){let e=oe(n);n.endsWith(`.jsonl`)?k9(n,t):WIe.has(e)?A9(n,t):j9(n,t)}}const F9=[`.ok`,`local`,`telemetry`],I9=[`.ok`,`local`,`logs`],L9=[`.ok`,`local`,`loss-capture`],R9=_d.spansCurrent,z9=_d.spansPrevious,B9=_d.logsCurrent,V9=_d.logsPrevious,H9=`loss-current.jsonl`,U9=`loss-prev.jsonl`;function qIe(e){return j(e,...L9,H9)}function JIe(e){return j(e,...L9,U9)}const W9=1e3;async function YIe(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 XIe(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 ZIe(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 QIe(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(`
|
|
1553
|
-
`)}\n`:null}catch{return null}}function $Ie(e){let t=j(e,`.git`,`ok`);if(!_(t))return null;let n=l(`git`,[`-C`,t,`log`,`--oneline`,`-50`],P6({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function eLe(e){let t=j(e,`.git`,`ok`);if(!_(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/`],P6({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 tLe(){return{nodeVersion:process.version,platform:be(),arch:he()}}function nLe(){return process.env.OTEL_SDK_DISABLED===`false`}function K9(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function q9(e){if(!_(e))return{};let t;try{t=(0,xs.parse)(C(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 rLe(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:void 0}function Y9(e){if(K9(e))return rLe(e.maxBytes)}function iLe(e){let t=q9(pJ(`project`,e)),n=q9(pJ(`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 aLe(e){return Ee(`sha256`).update(e).digest(`hex`)}function oLe(e){let t=C(e),n=0;for(let e=0;e<t.length;e++)t[e]===10&&n++;return n}const sLe=[`"doc.name"`,`"docName"`];function cLe(e){let t=C(e,`utf-8`),n=0;for(let e of sLe){let r=t.indexOf(e);for(;r!==-1;)n++,r=t.indexOf(e,r+e.length)}return n}function X9(e,t){if(!_(e))return!1;try{return y(k(t),{recursive:!0}),e.endsWith(`.ips`)?O(t,K5(C(e,`utf-8`))):h(e,t),!0}catch{return!1}}function Z9(e,t,n,r){let i=_(e);X9(e,j(n,r)),X9(t,i?j(n,`legacy`,r):j(n,r))}function Q9(e){let t=[],n=e=>{let r=T(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 lLe=new Set([`.jsonl`]);function uLe(e){let t=e.lastIndexOf(`.`);return t!==-1&&lLe.has(e.slice(t))}const dLe=new Set([`.jsonl`,`.json`,`.txt`,`.log`,`.lock`,`.yaml`,`.yml`,`.ips`]);function fLe(e){if(N9(e))return!0;let t=e.lastIndexOf(`.`);return t!==-1&&dLe.has(e.slice(t))}function pLe(e){let t=[];for(let n of Q9(e)){let r=$9(e,n);if(!fLe(r))continue;let{redacted:i,patterns:a,lineCount:o}=SP(C(n,`utf-8`));a.length!==0&&(O(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 N(e,t).split(ue).join(`/`)}async function mLe(e){let t=le(e.contentDir),n=le(e.projectDir??e.contentDir),r=e.deps??{},i=r.fetchAgentPresence??YIe,a=r.fetchAgentEffects??XIe,o=r.fetchWatcherRecent??ZIe,s=r.readShadowHead??$Ie,c=r.readCheckpointRefs??eLe,l=r.now??(()=>new Date),u=r.okVersion??(()=>`0.88.6-beta.
|
|
1553
|
+
`)}\n`:null}catch{return null}}function $Ie(e){let t=j(e,`.git`,`ok`);if(!_(t))return null;let n=l(`git`,[`-C`,t,`log`,`--oneline`,`-50`],P6({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function eLe(e){let t=j(e,`.git`,`ok`);if(!_(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/`],P6({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 tLe(){return{nodeVersion:process.version,platform:be(),arch:he()}}function nLe(){return process.env.OTEL_SDK_DISABLED===`false`}function K9(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function q9(e){if(!_(e))return{};let t;try{t=(0,xs.parse)(C(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 rLe(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:void 0}function Y9(e){if(K9(e))return rLe(e.maxBytes)}function iLe(e){let t=q9(pJ(`project`,e)),n=q9(pJ(`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 aLe(e){return Ee(`sha256`).update(e).digest(`hex`)}function oLe(e){let t=C(e),n=0;for(let e=0;e<t.length;e++)t[e]===10&&n++;return n}const sLe=[`"doc.name"`,`"docName"`];function cLe(e){let t=C(e,`utf-8`),n=0;for(let e of sLe){let r=t.indexOf(e);for(;r!==-1;)n++,r=t.indexOf(e,r+e.length)}return n}function X9(e,t){if(!_(e))return!1;try{return y(k(t),{recursive:!0}),e.endsWith(`.ips`)?O(t,K5(C(e,`utf-8`))):h(e,t),!0}catch{return!1}}function Z9(e,t,n,r){let i=_(e);X9(e,j(n,r)),X9(t,i?j(n,`legacy`,r):j(n,r))}function Q9(e){let t=[],n=e=>{let r=T(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 lLe=new Set([`.jsonl`]);function uLe(e){let t=e.lastIndexOf(`.`);return t!==-1&&lLe.has(e.slice(t))}const dLe=new Set([`.jsonl`,`.json`,`.txt`,`.log`,`.lock`,`.yaml`,`.yml`,`.ips`]);function fLe(e){if(N9(e))return!0;let t=e.lastIndexOf(`.`);return t!==-1&&dLe.has(e.slice(t))}function pLe(e){let t=[];for(let n of Q9(e)){let r=$9(e,n);if(!fLe(r))continue;let{redacted:i,patterns:a,lineCount:o}=SP(C(n,`utf-8`));a.length!==0&&(O(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 N(e,t).split(ue).join(`/`)}async function mLe(e){let t=le(e.contentDir),n=le(e.projectDir??e.contentDir),r=e.deps??{},i=r.fetchAgentPresence??YIe,a=r.fetchAgentEffects??XIe,o=r.fetchWatcherRecent??ZIe,s=r.readShadowHead??$Ie,c=r.readCheckpointRefs??eLe,l=r.now??(()=>new Date),u=r.okVersion??(()=>`0.88.6-beta.3`),d=r.readDesktopEnv??G9,f=r.readLanguage??T9,p=r.readRuntime??tLe,m=r.isOtlpPushEnabled??nLe,g=b(j(Se(),`ok-bundle-`));try{y(j(g,`telemetry`),{recursive:!0}),y(j(g,`logs`),{recursive:!0}),y(j(g,`state`),{recursive:!0}),Z9(xCe(n),j(n,...F9,R9),g,j(`telemetry`,R9)),Z9(SCe(n),j(n,...F9,z9),g,j(`telemetry`,z9)),Z9(vX(n),j(n,...I9,B9),g,j(`logs`,B9)),Z9(yX(n),j(n,...I9,V9),g,j(`logs`,V9));for(let t of e.userLogFiles??[])X9(t,j(g,`logs`,oe(t)));for(let t of e.userStateFiles??[])X9(t,j(g,qq,oe(t)));let v=0;for(let t of e.diagnosticReports?.files??[])X9(t,j(g,`diagnostic-reports`,oe(t)))&&(v+=1);let b=j(n,`.ok`,`local`),x=j(b,`server.lock`),S=`not-running`,w=`no server.lock`,T=null;if(_(x)){X9(x,j(g,`state`,`server.lock`));try{let e=C(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`:(O(j(g,`state`,`agent-presence.json`),e),S=`running`,w=``);let t=await a(T);t!==null&&O(j(g,`state`,`agent-effects.json`),t);let n=await o(T);if(n!==null){let e=QIe(n);e!==null&&O(j(g,`state`,`watcher-recent.jsonl`),e)}}let E=s(t);E!==null&&O(j(g,`state`,`shadow-head.txt`),E);let D=c(t);D!==null&&O(j(g,`state`,`checkpoint-refs.txt`),D),X9(qIe(n),j(g,`state`,H9)),X9(JIe(n),j(g,`state`,U9)),Z9(zxe(n),j(b,gd),g,`state/last-spawn-error.log`),X9(j(b,yd),j(g,`state`,yd)),X9(j(b,bd),j(g,`state`,bd)),X9(j(b,vd),j(g,`state`,vd));let ee=p(),ne=d(),ie=f(),ae={ok:{version:u(),nodeVersion:ee.nodeVersion,platform:ee.platform,arch:ee.arch},host:{desktop:ne,language:ie}};O(j(g,`state`,`runtime.json`),`${JSON.stringify(ae,null,2)}\n`);let k=S===`running`?`running
|
|
1554
1554
|
`:`not-running (${w})\n`;O(j(g,`state`,`server-status.txt`),k);let A=e.diagnosticReports===void 0?`not-collected (no collection attempted)`:G5(e.diagnosticReports,v);if(O(j(g,`state`,`diagnostic-reports-status.txt`),`${A}\n`),O(j(g,Y5),g7(e.osTerminationEvidence)),e.processDir&&_(e.processDir)){let t=j(g,`process`);y(t,{recursive:!0}),h(e.processDir,t,{recursive:!0})}let se=e.redact===!0;se&&(P9({stagingDir:g,contentDir:t}),P9({stagingDir:j(g,`legacy`),contentDir:t})),e.note&&O(j(g,`note.txt`),e.note);let ce=null;e.scrubSecrets===!0&&(ce=pLe(g));for(let t of e.extraFiles??[]){let e=t.zipName??oe(t.sourcePath);if(!X9(t.sourcePath,j(g,`extra`,e))){r.logger?.warn({sourcePath:t.sourcePath},`extra file missing; omitted from bundle`);continue}let n=v7(t,`extra/${e}`);n!==null&&(ce??={redactions:[],redactedLineCount:0},ce.redactions.push(n),ce.redactedLineCount+=n.lineCount)}let M=iLe(n),N=Q9(g),le=[],ue=0,de=0;for(let e of N){let t=$9(g,e),n=re(e).size,r=uLe(t)?oLe(e):0;le.push({path:t,bytes:n,lines:r}),ue+=n;let i=t.startsWith(`legacy/`)?t.slice(7):t;(i.startsWith(`telemetry/`)||i.startsWith(`logs/`))&&(de+=cLe(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:aLe(t),absolutePath:se?`<CONTENT_DIR>`:t},telemetry:{localSink:{...M,directory:Ed(`logs`,`projects`)},otlpPushEnabled:m()},redaction:fe,serverStatus:S,files:le};O(j(g,`manifest.json`),`${JSON.stringify(P,null,2)}\n`);let pe=E9(t),me=N.some(e=>{try{let t=C(e,`utf-8`);return pe.some(e=>t.includes(e))}catch{return!1}}),he={stagedDiagnosticReports:v,totalBytes:ue,fileCount:le.length,docNameCount:de,contentDirVisible:me,redacted:se},ge=!1;return{stagingDir:g,manifest:P,summary:he,cleanup:()=>{ge||(ge=!0,te(g,{recursive:!0,force:!0}))}}}catch(e){throw te(g,{recursive:!0,force:!0}),e}}async function hLe(e){let{collected:t,outputPath:n}=e,r=k(n);if(!_(r))throw Error(`ok diagnose bundle: parent directory does not exist: ${r}. Create it or pass --out with an existing parent.`);let i=new yEe.ZipFile,a=Q9(t.stagingDir);for(let e of a){let n=$9(t.stagingDir,e);i.addFile(e,n)}i.end();let o=g(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 gLe(e,t){let n=j(e,`.ok`,`config.yml`);if(_(n))try{let t=(0,xs.parse)(C(n,`utf-8`)),r=PJ(t)?t.content:void 0,i=PJ(r)?r.dir:void 0;if(typeof i==`string`&&i.length>0)return le(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 le(e)}async function _Le(e,t,n,r,i,a){let o=y7(t,e.logger),s=await mLe({contentDir:gLe(t,e.logger),projectDir:t,redact:e.redact,scrubSecrets:e.redact,note:e.note,extraFiles:e.extraFiles,userLogFiles:[...bFe(o,e.userLogsDir??j(oJ(),`logs`)),...x7(e.cachesDir??j(ve(),`Library`,`Caches`))],userStateFiles:S7(e.bugReportsDir??_7()),diagnosticReports:i,osTerminationEvidence:a,deps:{readDesktopEnv:n,readLanguage:r,logger:e.logger}});try{y(k(e.outputPath),{recursive:!0}),await hLe({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 vLe(e){let{projectDir:t}=e,n=e.readDesktopEnv??G9,r=e.readLanguage??T9,i=()=>KPe(e.diagnosticReportsDir??j(ve(),`Library`,`Logs`,`DiagnosticReports`),new Date);if(e.level===`full`&&t!==void 0)return _Le(e,t,n,r,i(),await h7(e.osTerminationEvidenceDeps));let{zipPath:a,summary:o}=await TFe({projectDir:t,redact:e.redact,revealDocNames:e.level===`full`,outputPath:e.outputPath,userLogsDir:e.userLogsDir,shipItLogFiles:x7(e.cachesDir??j(ve(),`Library`,`Caches`)),bugReportLedgerFiles:S7(e.bugReportsDir??_7()),diagnosticReports:e.level===`full`?i():void 0,osTerminationEvidence:e.level===`full`?await h7(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{UJ as ALL_EDITOR_IDS,WJ as EDITOR_LABELS,wY as EDITOR_TARGETS,gSe as HOSTS_WITH_USER_SKILL_DIR,I5 as LAUNCH_CONFIG_NAME,EIe as PATH_SHIM_BEGIN,OIe as PATH_SHIM_BLOCK_RE,DIe as PATH_SHIM_END,a5 as ProjectPathSafetyError,fPe as addOkPathsToGitExclude,o5 as assertProjectPathSafe,aY as buildManagedServerEntry,cIe as buildMcpConfigDeclineEvent,lIe as buildMcpConfigMigrateEvent,hY as canonicalEntryFor,H5 as classifyExistingMcpEntry,vLe as collectReportBundle,NIe as createCliProbeResolver,bJ as createTokenStore,_Fe as defaultBugReportZipPath,qe as detectGh,Xe as detectGhAccounts,RPe as detectInstalledEditors,mY as droppedManagedKeys,LSe as editorConfigPathDisplay,ISe as editorEntryLocator,ZFe as ensurePiBridge,QPe as findJetsamKillSync,y5 as formatTrackedRemediation,hPe as getExcludedOkPaths,_5 as getInstalledSkillProjectionPaths,hSe as getNativeTomlMcpEditor,g5 as getOkArtifactPaths,rY as isEntryUpToDate,oY as isOwnManagedEntry,CIe as loadConfig,Uxe as makeLazyProbeTokenStore,_7 as okBugReportsDir,_9 as parseGitHubBlobUrl,wIe as parseGitHubShareUrl,v9 as parseGitHubTreeUrl,g9 as parseGitUrl,kIe as pathInstallMarkerPath,ZNe as previewContent,zPe as probeOwnManagedEditorMcpEntry,YFe as probePiBridgeState,v5 as probeTrackedOkPaths,B5 as readExistingMcpEntry,mPe as readSharingMode,SP as redactContent,kFe as registerWindowsProcessStartReader,pPe as removeOkPathsFromGitExclude,iIe as removeOwnMcpEntry,cPe as removeProjectSkill,FIe as removeUserGlobalSkillBundle,VIe as removeUserSkill,nPe as resolveProjectRoot,_Ie as runStop,u9 as truncatePriorEntry,C9 as userGlobalSkillBundleTargets,BIe as userSkillPresentAnywhere,TIe as validateLocalFolderForShare,z5 as writeEditorMcpConfig,RIe as writeProjectAiIntegrations,d5 as writeProjectSkill,LPe as writeUserMcpConfigs,zIe as writeUserSkill};
|
|
1555
1555
|
//# sourceMappingURL=index.mjs.map
|