@inkeep/open-knowledge 0.88.6-beta.2 → 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-CWmsgB4D.mjs → dist-Br5t34YL.mjs} +1 -1
- package/dist/{dist-BO5LOWYA.mjs → dist-DFlcDcjF.mjs} +1 -1
- package/dist/index.mjs +2 -2
- package/dist/{init-DEZvHVW0.mjs → init-CFqa1MvX.mjs} +2 -2
- package/dist/init-D5UpQ70d.mjs +1 -0
- package/dist/{launch-json-removal-BiFnBtfK.mjs → launch-json-removal-BiiU2YFK.mjs} +1 -1
- package/dist/loader-B2fGi6oQ.mjs +1 -0
- package/dist/{loader-CiUplufh.mjs → loader-CpSE6Pb3.mjs} +1 -1
- package/dist/{open-browser-DUUDzeiw.mjs → open-browser-BgcinSRG.mjs} +1 -1
- package/dist/preview-DSJofhni.mjs +1 -0
- package/dist/{preview-BGT8FQ6l.mjs → preview-W1qLrOTN.mjs} +1 -1
- package/dist/public/assets/{AccountSection-B533_CFl.js → AccountSection-LJRd8sB4.js} +1 -1
- package/dist/public/assets/{ActivityModeContent-Bm2TgMK9.js → ActivityModeContent-CQSexLMh.js} +1 -1
- package/dist/public/assets/{AddPropertiesButton-DkHyn0cf.js → AddPropertiesButton-CFKmvgxU.js} +1 -1
- package/dist/public/assets/{AgentDiffPane-BodTaWgj.js → AgentDiffPane-_ihWGbD_.js} +1 -1
- package/dist/public/assets/{AttachmentsSection-64MnxUzI.js → AttachmentsSection-DBsgV2Bw.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-BpVp-E5x.js → CodeMirrorPropInput-CijXVQab.js} +1 -1
- package/dist/public/assets/{ContentRulesSection-DmWfN_iy.js → ContentRulesSection-C6MePblA.js} +1 -1
- package/dist/public/assets/{DocumentContext-Cdsi5u2c.js → DocumentContext-Ckv8SUWG.js} +1 -1
- package/dist/public/assets/{EditorModeToggle-DVVGiGDr.js → EditorModeToggle-N2hyqb1I.js} +1 -1
- package/dist/public/assets/{ExcalidrawDocEditor-CXmmiQYE.js → ExcalidrawDocEditor-CP2HLZRg.js} +1 -1
- package/dist/public/assets/FeedbackForm-DvbVD7xY.js +1 -0
- package/dist/public/assets/{ImportSkillDialog-D94_dDU2.js → ImportSkillDialog-B6FRcFBN.js} +1 -1
- package/dist/public/assets/{LinkPreviewsSection-BcBB5Mr2.js → LinkPreviewsSection-C4BQkoW1.js} +1 -1
- package/dist/public/assets/{LintConfigEditor-dTqg6HBx.js → LintConfigEditor-BZ5RnGQH.js} +1 -1
- package/dist/public/assets/{LintingSection-CNCSP8QA.js → LintingSection-gYcf6zSw.js} +1 -1
- package/dist/public/assets/{ManagedArtifactProperties-BwRDC8sA.js → ManagedArtifactProperties-7BpPCdWC.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-C21i-wVX.js +1 -0
- package/dist/public/assets/{MermaidDocEditor-C1OgCPt4.js → MermaidDocEditor-D8S17k_t.js} +1 -1
- package/dist/public/assets/{NetworkAccessSection-DkX1Ccg2.js → NetworkAccessSection-CfSEDmXg.js} +1 -1
- package/dist/public/assets/{PropertyDisplayRow-vYb8HrL-.js → PropertyDisplayRow-BoNQImBU.js} +1 -1
- package/dist/public/assets/{PublishToGitHubDialog-Cp8YBcmH.js → PublishToGitHubDialog-Bc5NpD70.js} +1 -1
- package/dist/public/assets/{SchemaConfigEditor-WGJhlBCs.js → SchemaConfigEditor-DXzybru5.js} +1 -1
- package/dist/public/assets/{SearchSection-2P2_lNpn.js → SearchSection-C19oEXnN.js} +1 -1
- package/dist/public/assets/{SessionsHost-Dp9DeiAL.js → SessionsHost-Dq18GV-Q.js} +2 -2
- package/dist/public/assets/{SettingsDialogBody-e6zwfLq2.js → SettingsDialogBody-CKMzthec.js} +2 -2
- package/dist/public/assets/{ShareReceiveMissDialog-C3LqR6yF.js → ShareReceiveMissDialog-CjeRKStG.js} +1 -1
- package/dist/public/assets/{SkillToolbarControls-CwJU-tSi.js → SkillToolbarControls-Bw0kbj8T.js} +1 -1
- package/dist/public/assets/{SourceEditor-CH7OXRAW.js → SourceEditor-Cdd0XUzF.js} +1 -1
- package/dist/public/assets/{SyncSection-BJcZEjza.js → SyncSection-uN1z_93L.js} +1 -1
- package/dist/public/assets/{SyncStatusBadge-B50CKijD.js → SyncStatusBadge-DKqP2nFA.js} +1 -1
- package/dist/public/assets/{TerminalSection-izE_v8FN.js → TerminalSection-OQKUYevA.js} +1 -1
- package/dist/public/assets/{TerminalWindowApp-C1epN9CZ.js → TerminalWindowApp-CYJ1Jbl1.js} +1 -1
- package/dist/public/assets/{TextDocEditor-C3xrbdGv.js → TextDocEditor-O7zcpBhs.js} +1 -1
- package/dist/public/assets/{ThreadView-DeLnbOfd.js → ThreadView-DXAtEUVo.js} +1 -1
- package/dist/public/assets/{TimelineDiffPane-PhoLGDyW.js → TimelineDiffPane-DfckigW2.js} +1 -1
- package/dist/public/assets/{client-version-Bn38fidh.js → client-version-BJc8f8RK.js} +1 -1
- package/dist/public/assets/{comment-chips-BulsIGPm.js → comment-chips-D5QcVI38.js} +1 -1
- package/dist/public/assets/{config-provider-CbxzkzQ_.js → config-provider-B2uReVA0.js} +1 -1
- package/dist/public/assets/{doc-undo-manager-D2TgPcLo.js → doc-undo-manager-eVCrXF_j.js} +1 -1
- package/dist/public/assets/{index-CMyXHFY-.js → index-DixZkzDK.js} +7 -7
- package/dist/public/assets/{lint-plugins-9842_I0-.js → lint-plugins-BkTeSxCo.js} +1 -1
- package/dist/public/assets/{pending-receive-nav-store-BMCbYLuG.js → pending-receive-nav-store-Iv87HrBp.js} +1 -1
- package/dist/public/assets/{preferred-session-events-BAlt9BzP.js → preferred-session-events-xfa2uZrO.js} +1 -1
- package/dist/public/assets/{progress-COOClRZR.js → progress-BrArAZHf.js} +1 -1
- package/dist/public/assets/{selection-context-BILpjCfJ.js → selection-context-Dbqj5HIF.js} +1 -1
- package/dist/public/assets/{src-CwpH-C2-.js → src-CY4cyl93.js} +1 -1
- package/dist/public/assets/{telemetry-impl-BY6m4dQu.js → telemetry-impl-CzmRwkV2.js} +1 -1
- package/dist/public/assets/{telemetry-startup-BXj909u4.js → telemetry-startup-6UOhK4H3.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-CvX8VoiX.js → typing-burst-detector-43TkkCGr.js} +1 -1
- package/dist/public/assets/{use-activity-panel-BCtT92Ba.js → use-activity-panel-Bqo7iLoL.js} +1 -1
- package/dist/public/assets/{use-open-skill-DhY4Y0NP.js → use-open-skill-DiaFh1sV.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-eL9XPx7R.js → use-terminal-enabled-D67U-_lT.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-CjTYJ45T.js → use-timeline-entry-diff-KpbAdkg7.js} +1 -1
- package/dist/public/index.html +19 -19
- package/dist/{registry-probes-bcwiwmsg.mjs → registry-probes-DwE2ywLj.mjs} +1 -1
- package/dist/{removal-file-path-vEg6Crwy.mjs → removal-file-path-BB7PGKh9.mjs} +1 -1
- package/dist/{repair-launch-json-DiAuyB8X.mjs → repair-launch-json-BGnKoX_8.mjs} +1 -1
- package/dist/{repair-mcp-configs-BF5SpuqE.mjs → repair-mcp-configs-CnuXQsDL.mjs} +1 -1
- package/dist/src-CMSKsmsA.mjs +1 -0
- package/dist/{src-CIxs_FQO.mjs → src-CbDiPIIp.mjs} +1 -1
- package/dist/{start-D3SEY0yE.mjs → start-Bs7pMN0A.mjs} +3 -3
- package/dist/start-Dx5wqmPM.mjs +1 -0
- package/package.json +4 -4
- package/dist/constants-t9AfZY26.mjs +0 -1
- package/dist/init-CTAfywlr.mjs +0 -1
- package/dist/loader-BVV3rwB9.mjs +0 -1
- package/dist/preview-785_n4-9.mjs +0 -1
- package/dist/public/assets/FeedbackForm-BSIF07lL.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-CcAxjAa9.js +0 -1
- package/dist/src-C6vKy7oA.mjs +0 -1
- package/dist/start-DqBQYZEF.mjs +0 -1
package/dist/index.mjs
CHANGED
|
@@ -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
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as e,o as t,t as n}from"./rolldown-runtime-tZXQYakl.mjs";import{$f as r,Af as i,Gf as a,Hf as o,Id as s,K as c,Kf as l,Lf as u,Nf as d,Pf as f,Qf as p,Rf as m,Uf as h,V as g,Xa as _,Ya as v,Zf as y,_ as b,a as x,al as S,ap as C,ep as w,jf as ee,kc as te,kf as ne,op as re,qf as ie,tt as ae,vd as oe,z as se,zd as ce}from"./md-manager-BGnqyqi1-COpgRhOl.mjs";import{Aa as le,B as ue,Br as de,F as fe,Hs as pe,Kr as me,Ms as T,Nt as he,Pa as ge,Qo as _e,Qr as ve,R as ye,W as be,Xo as xe,_i as Se,at as Ce,ct as we,ds as Te,ea as Ee,ei as De,fs as Oe,hn as ke,ka as Ae,lr as je,ls as Me,m as Ne,mi as Pe,nr as Fe,ps as Ie,qa as Le,qo as Re,us as E,xs as ze,z as Be}from"./dist-
|
|
1
|
+
import{i as e,o as t,t as n}from"./rolldown-runtime-tZXQYakl.mjs";import{$f as r,Af as i,Gf as a,Hf as o,Id as s,K as c,Kf as l,Lf as u,Nf as d,Pf as f,Qf as p,Rf as m,Uf as h,V as g,Xa as _,Ya as v,Zf as y,_ as b,a as x,al as S,ap as C,ep as w,jf as ee,kc as te,kf as ne,op as re,qf as ie,tt as ae,vd as oe,z as se,zd as ce}from"./md-manager-BGnqyqi1-COpgRhOl.mjs";import{Aa as le,B as ue,Br as de,F as fe,Hs as pe,Kr as me,Ms as T,Nt as he,Pa as ge,Qo as _e,Qr as ve,R as ye,W as be,Xo as xe,_i as Se,at as Ce,ct as we,ds as Te,ea as Ee,ei as De,fs as Oe,hn as ke,ka as Ae,lr as je,ls as Me,m as Ne,mi as Pe,nr as Fe,ps as Ie,qa as Le,qo as Re,us as E,xs as ze,z as Be}from"./dist-Br5t34YL.mjs";import{i as Ve,n as D,o as O,r as He,s as k,t as A}from"./colors-r_owlCuY.mjs";import{t as j}from"./is-object-BGze3w87.mjs";import{t as Ue}from"./constants-qWODYpdZ.mjs";import{t as We}from"./preview-W1qLrOTN.mjs";import{createRequire as Ge}from"node:module";import{execFileSync as Ke}from"node:child_process";import qe,{basename as Je,dirname as M,isAbsolute as Ye,join as N,posix as Xe,relative as P,resolve as F,sep as I,win32 as Ze}from"node:path";import L from"node:process";import{fileURLToPath as Qe}from"node:url";import{copyFileSync as $e,existsSync as R,lstatSync as et,mkdirSync as tt,readFileSync as z,readdirSync as nt,readlinkSync as rt,realpathSync as it,rmSync as at,statSync as ot,writeFileSync as st}from"node:fs";import{homedir as B}from"node:os";import{inspect as ct,stripVTControlCharacters as lt,styleText as V}from"node:util";import*as ut from"node:readline";import{AsyncLocalStorage as dt,AsyncResource as ft}from"node:async_hooks";var pt=n((e=>{var t=class extends Error{constructor(e,t,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},n=class extends t{constructor(e){super(1,`commander.invalidArgument`,e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};e.CommanderError=t,e.InvalidArgumentError=n})),mt=n((e=>{let{InvalidArgumentError:t}=pt();var n=class{constructor(e,t){switch(this.description=t||``,this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case`<`:this.required=!0,this._name=e.slice(1,-1);break;case`[`:this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e}this._name.endsWith(`...`)&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,n)=>{if(!this.argChoices.includes(e))throw new t(`Allowed choices are ${this.argChoices.join(`, `)}.`);return this.variadic?this._collectValue(e,n):e},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function r(e){let t=e.name()+(e.variadic===!0?`...`:``);return e.required?`<`+t+`>`:`[`+t+`]`}e.Argument=n,e.humanReadableArgName=r})),ht=n((e=>{let{humanReadableArgName:t}=mt();var n=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let t=e.commands.filter(e=>!e._hidden),n=e._getHelpCommand();return n&&!n._hidden&&t.push(n),this.sortSubcommands&&t.sort((e,t)=>e.name().localeCompare(t.name())),t}compareOptions(e,t){let n=e=>e.short?e.short.replace(/^-/,``):e.long.replace(/^--/,``);return n(e).localeCompare(n(t))}visibleOptions(e){let t=e.options.filter(e=>!e.hidden),n=e._getHelpOption();if(n&&!n.hidden){let r=n.short&&e._findOption(n.short),i=n.long&&e._findOption(n.long);!r&&!i?t.push(n):n.long&&!i?t.push(e.createOption(n.long,n.description)):n.short&&!r&&t.push(e.createOption(n.short,n.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let n=e.parent;n;n=n.parent){let e=n.options.filter(e=>!e.hidden);t.push(...e)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||``}),e.registeredArguments.find(e=>e.description)?e.registeredArguments:[]}subcommandTerm(e){let n=e.registeredArguments.map(e=>t(e)).join(` `);return e._name+(e._aliases[0]?`|`+e._aliases[0]:``)+(e.options.length?` [options]`:``)+(n?` `+n:``)}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleSubcommandTerm(t.subcommandTerm(n)))),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleArgumentTerm(t.argumentTerm(n)))),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+`|`+e._aliases[0]);let n=``;for(let t=e.parent;t;t=t.parent)n=t.name()+` `+n;return n+t+` `+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(`, `)}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue==`boolean`)&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0){let n=`(${t.join(`, `)})`;return e.description?`${e.description} ${n}`:n}return e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(`, `)}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let n=`(${t.join(`, `)})`;return e.description?`${e.description} ${n}`:n}return e.description}formatItemList(e,t,n){return t.length===0?[]:[n.styleTitle(e),...t,``]}groupItems(e,t,n){let r=new Map;return e.forEach(e=>{let t=n(e);r.has(t)||r.set(t,[])}),t.forEach(e=>{let t=n(e);r.has(t)||r.set(t,[]),r.get(t).push(e)}),r}formatHelp(e,t){let n=t.padWidth(e,t),r=t.helpWidth??80;function i(e,r){return t.formatItem(e,n,r,t)}let a=[`${t.styleTitle(`Usage:`)} ${t.styleUsage(t.commandUsage(e))}`,``],o=t.commandDescription(e);o.length>0&&(a=a.concat([t.boxWrap(t.styleCommandDescription(o),r),``]));let s=t.visibleArguments(e).map(e=>i(t.styleArgumentTerm(t.argumentTerm(e)),t.styleArgumentDescription(t.argumentDescription(e))));if(a=a.concat(this.formatItemList(`Arguments:`,s,t)),this.groupItems(e.options,t.visibleOptions(e),e=>e.helpGroupHeading??`Options:`).forEach((e,n)=>{let r=e.map(e=>i(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));a=a.concat(this.formatItemList(n,r,t))}),t.showGlobalOptions){let n=t.visibleGlobalOptions(e).map(e=>i(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));a=a.concat(this.formatItemList(`Global Options:`,n,t))}return this.groupItems(e.commands,t.visibleCommands(e),e=>e.helpGroup()||`Commands:`).forEach((e,n)=>{let r=e.map(e=>i(t.styleSubcommandTerm(t.subcommandTerm(e)),t.styleSubcommandDescription(t.subcommandDescription(e))));a=a.concat(this.formatItemList(n,r,t))}),a.join(`
|
|
2
2
|
`)}displayWidth(e){return r(e).length}styleTitle(e){return e}styleUsage(e){return e.split(` `).map(e=>e===`[options]`?this.styleOptionText(e):e===`[command]`?this.styleSubcommandText(e):e[0]===`[`||e[0]===`<`?this.styleArgumentText(e):this.styleCommandText(e)).join(` `)}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(` `).map(e=>e===`[options]`?this.styleOptionText(e):e[0]===`[`||e[0]===`<`?this.styleArgumentText(e):this.styleSubcommandText(e)).join(` `)}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,t,n,r){let i=` `.repeat(2);if(!n)return i+e;let a=e.padEnd(t+e.length-r.displayWidth(e)),o=(this.helpWidth??80)-t-2-2,s;return s=o<this.minWidthToWrap||r.preformatted(n)?n:r.boxWrap(n,o).replace(/\n/g,`
|
|
3
3
|
`+` `.repeat(t+2)),i+a+` `.repeat(2)+s.replace(/\n/g,`\n${i}`)}boxWrap(e,t){if(t<this.minWidthToWrap)return e;let n=e.split(/\r\n|\n/),r=/[\s]*[^\s]+/g,i=[];return n.forEach(e=>{let n=e.match(r);if(n===null){i.push(``);return}let a=[n.shift()],o=this.displayWidth(a[0]);n.forEach(e=>{let n=this.displayWidth(e);if(o+n<=t){a.push(e),o+=n;return}i.push(a.join(``));let r=e.trimStart();a=[r],o=this.displayWidth(r)}),i.push(a.join(``))}),i.join(`
|
|
4
4
|
`)}};function r(e){return e.replace(/\x1b\[\d*(;\d*)*m/g,``)}e.Help=n,e.stripColor=r})),gt=n((e=>{let{InvalidArgumentError:t}=pt();var n=class{constructor(e,t){this.flags=e,this.description=t||``,this.required=e.includes(`<`),this.optional=e.includes(`[`),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let n=a(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith(`--no-`)),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;return typeof e==`string`&&(t={[e]:!0}),this.implied=Object.assign(this.implied||{},t),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,n)=>{if(!this.argChoices.includes(e))throw new t(`Allowed choices are ${this.argChoices.join(`, `)}.`);return this.variadic?this._collectValue(e,n):e},this}name(){return this.long?this.long.replace(/^--/,``):this.short.replace(/^-/,``)}attributeName(){return this.negate?i(this.name().replace(/^no-/,``)):i(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},r=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(e=>{e.negate?this.negativeOptions.set(e.attributeName(),e):this.positiveOptions.set(e.attributeName(),e)}),this.negativeOptions.forEach((e,t)=>{this.positiveOptions.has(t)&&this.dualOptions.add(t)})}valueFromOption(e,t){let n=t.attributeName();if(!this.dualOptions.has(n))return!0;let r=this.negativeOptions.get(n).presetArg,i=r!==void 0&&r;return t.negate===(i===e)}};function i(e){return e.split(`-`).reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}function a(e){let t,n,r=/^-[^-]$/,i=/^--[^-]/,a=e.split(/[ |,]+/).concat(`guard`);if(r.test(a[0])&&(t=a.shift()),i.test(a[0])&&(n=a.shift()),!t&&r.test(a[0])&&(t=a.shift()),!t&&i.test(a[0])&&(t=n,n=a.shift()),a[0].startsWith(`-`)){let t=a[0],n=`option creation failed due to '${t}' in option flags '${e}'`;throw/^-[^-][^-]/.test(t)?Error(`${n}
|
|
@@ -689,5 +689,5 @@ export default function okBridge(pi: {
|
|
|
689
689
|
`));let g=`${s?``:``}${m}`;return g!==o&&T(e,g,{mode:Ka(e)}),a&&g===o?{kind:`unchanged`}:{kind:d?`overwritten`:`written`}}const zo=e=>e!==`project`,Bo=e=>e!==`user`;async function Vo(){let e=await to({message:`Where should the MCP server be configured?
|
|
690
690
|
`,required:!1,theme:{icon:{checked:`[x]`,unchecked:`[ ]`}},choices:[{name:`User-level (~/.claude.json, ~/.cursor/mcp.json, …)`,value:`user`,checked:!0},{name:`Project-level (.mcp.json, .cursor/mcp.json, …)`,value:`project`,checked:!0}]});return e.includes(`user`)&&e.includes(`project`)?`both`:e.includes(`user`)?`user`:e.includes(`project`)?`project`:null}async function Ho(e){return e.mcp===!1?null:e.scope?e.scope:e.isTTY??process.stdout.isTTY?(e.promptFn??Vo)():`both`}async function Uo(e){return oo({message:`How do you want to handle OpenKnowledge config files (.ok/, .mcp.json)?`,default:e,choices:[{name:`Share with my team (commit alongside content)`,value:`shared`,description:`OK config gets committed alongside your project content.`},{name:`Local only (keep out of git via .git/info/exclude)`,value:`local-only`,description:`OK config stays on this machine only; teammates do not see it. Safe escape hatch via \`${y()} config-sharing share\`.`}]})}async function Wo(e){if(e.sharing!==void 0)return e.sharing;let t=ma(e.projectRoot)===`local-only`||e.freshProject===!0?`local-only`:`shared`;return e.isTTY??process.stdout.isTTY?(e.promptFn??Uo)(t):t}var Go=class extends Error{constructor(e){super(e),this.name=`ContentDirError`}},Ko=class extends Error{constructor(e){super(`A dev MCP entry is written to project config only, never to user-level editor config, so --scope ${e} is not supported with --dev-mcp or OK_CHANNEL=dev. Re-run with --scope project or without --scope.`),this.name=`DevMcpScopeError`}};const qo=`A dev build registers OpenKnowledge MCP in project config only, never in user-level editor config. Run \`${a} init --dev-mcp\` in the project, or set OK_CHANNEL=stable.`;function Jo(e){if(e===void 0||e===!0)return new Set(Ce);if(e===!1)return new Set;let t=e.split(`,`).map(e=>e.trim()).filter(Boolean);return new Set(he.filter(e=>t.includes(e)))}function Yo(e,t,n){let r=F(n,e),i;try{i=ot(r)}catch(e){let t=e.code;throw t===`ENOENT`?new Go(`--content-dir path does not exist: ${r}`):new Go(`--content-dir path is not accessible (${t??`unknown error`}): ${r}`)}if(!i.isDirectory())throw new Go(`--content-dir must be a directory: ${r}`);let a=Xo(t),o=Xo(r),s=P(a,o);if(s.startsWith(`..`)||Ye(s))throw new Go(`--content-dir must be inside the project root (${t}); got ${r}`);return s===``?`.`:s}function Xo(e){try{return it(e)}catch{return e}}const Zo=`open-knowledge-ui`;function Qo(e,t,n){try{let r=e.detectPath?.(t,n)??M(e.configPath(t,n));return R(r)}catch{return!1}}function $o(e,t,n){try{let r=F(M(e.configPath(t,n))),i=F(e.detectPath?.(t,n)??r);return i===r||r.startsWith(i+I)}catch{return!1}}function es(e,t,n,r,i){let a=e.serverName(t),o;try{o=i??e.configPath(t,r)}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:``,serverName:a,error:t instanceof Error?t.message:String(t)}}let s=n.pruneOnly===!0;if(s&&(e.format===`file`||!R(o)))return{editorId:e.id,label:e.label,action:`skipped-flag`,configPath:o,serverName:a,...i===void 0?{}:{configScope:`project`}};let c=!n.skipAvailabilityCheck||e.offerOnlyWhenDetected===!0||$o(e,t,r);if(!i&&c&&!Qo(e,t,r))return{editorId:e.id,label:e.label,action:`skipped-missing`,configPath:o,serverName:a};if(i!==void 0)try{Aa(o,t)}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:t instanceof Error?t.message:String(t),configScope:`project`}}if(e.format===`file`)return ns(e,o,a,n,{isProjectScope:i!==void 0});let l;try{l=e.buildEntry(t,n)}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:t instanceof Error?t.message:String(t),...i===void 0?{}:{configScope:`project`}}}try{s||tt(M(o),{recursive:!0})}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:t instanceof Error?t.message:String(t),...i===void 0?{}:{configScope:`project`}}}let u={action:`written`},d;try{pe(`${o}.lock`,()=>{let t=yo(o).writePath;if(s||tt(M(t),{recursive:!0}),e.format===`toml`){let r=Fo(oi(),t,e.topLevelKey,a,l,n.replaceEntry===!0,n.pruneOnly===!0);u.action=r.kind,r.kind===`declined`&&(u.declineReason=r.reason);return}if(e.format===`yaml`){let r=Ro(t,e.topLevelKey,a,l,n.replaceEntry===!0,n.pruneOnly===!0);u.action=r.kind,r.kind===`declined`&&(u.declineReason=r.reason);return}let r=Po(t,e.topLevelKey,a,l,e.serverMapSubKey,n.replaceEntry===!0,n.pruneOnly===!0);u.action=r.kind,r.kind===`declined`&&(u.declineReason=r.reason)},{onWarn:(e,t)=>process.stderr.write(`[ok] ${e} ${JSON.stringify(t)}\n`)})}catch(e){d=e instanceof Error?e:Error(String(e))}return d?{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:d.message,...i===void 0?{}:{configScope:`project`}}:u.action===`declined`?{editorId:e.id,label:e.label,action:`declined`,configPath:o,serverName:a,declineReason:u.declineReason,...i===void 0?{}:{configScope:`project`}}:{editorId:e.id,label:e.label,action:u.action===`unchanged`?`skipped-flag`:u.action,configPath:o,serverName:a,...i===void 0?{}:{configScope:`project`}}}const ts={pi:uo};function ns(e,t,n,r,i){let a=i.isProjectScope?{configScope:`project`}:{},o=r=>({editorId:e.id,label:e.label,action:`failed`,configPath:t,serverName:n,error:r instanceof Error?r.message:String(r),...a}),s=ts[e.id];if(!s)return o(Error(`No managed-file builder registered for editor "${e.id}" (format: 'file' targets need a MANAGED_FILE_BUILDERS entry).`));let c;try{c=s(r)}catch(e){return o(e)}try{tt(M(t),{recursive:!0})}catch(e){return o(e)}let l={action:`written`};try{pe(`${t}.lock`,()=>{let e=null;try{e=z(t,`utf-8`)}catch{e=null}if(e===c){l.action=`overwritten`;return}T(t,c,e===null?void 0:{mode:Ka(t)}),l.action=e===null?`written`:`overwritten`},{onWarn:(e,t)=>process.stderr.write(`[ok] ${e} ${JSON.stringify(t)}\n`)})}catch(e){return o(e)}return{editorId:e.id,label:e.label,action:l.action,configPath:t,serverName:n,...a}}function rs(e,t){let n=e.projectConfigPath?.(t);if(!(!n||!R(n)))return{editorId:e.id,label:e.label,path:n}}async function is(e){let t=sa(e.editors).filter(e=>e.scope===`global`);if(C())return t.map(t=>({editorId:t.id,label:t.label,action:`failed`,configPath:t.configPath(``,e.home),serverName:t.serverName(``),error:qo}));let n={mode:`published`,skipAvailabilityCheck:!0,...e.replaceEntry===!0?{replaceEntry:!0}:{},...e.pruneOnly===!0?{pruneOnly:!0}:{}};return t.map(t=>es(t,``,n,e.home))}function as(e,t,n,r){let i=ss(e,t,n,r);return i.kind===`present`?i.entry:null}function os(e,t,n,r){let i=No(e,t,r);if(!j(i))return{kind:`no-entry`};let a=i[n];return j(a)?{kind:`present`,entry:a}:{kind:`no-entry`}}function ss(e,t,n,r){let i;try{i=r??e.configPath(t,n)}catch{return{kind:`absent`}}if(!R(i))return{kind:`absent`};try{if(ot(i).size>Do)return{kind:`decline`,reason:`oversize`}}catch(e){return{kind:`decline`,reason:Ha(e)}}let a;try{a=z(i,`utf-8`)}catch(e){return{kind:`decline`,reason:Ha(e)}}if(a.trim()===``)return{kind:`absent`};if(e.format===`file`)return{kind:`present`,entry:lo(a)};let o=e.serverName(t);if(e.format===`toml`){let t;try{t=oi().parseToObject(a)}catch{return{kind:`decline`,reason:`unparseable`}}return os(t,e.topLevelKey,o,e.serverMapSubKey)}if(e.format===`yaml`){let t=(0,qr.parseDocument)(a.charCodeAt(0)===65279?a.slice(1):a);return t.errors.length>0?{kind:`decline`,reason:`unparseable`}:os(t.toJS()??{},e.topLevelKey,o,e.serverMapSubKey)}let s=So(a);return s?Co(s,e.topLevelKey)>1?{kind:`decline`,reason:`duplicate-container`}:os(E(s),e.topLevelKey,o,e.serverMapSubKey):{kind:`decline`,reason:`unparseable`}}async function cs(e={}){let t=F(e.cwd??process.cwd()),n=e.projectRootMode===`cwd`?{projectRoot:t,defaultContentDir:`.`,ancestorPromoted:!1,gitRootPromoted:!1}:mo(t,{homeDir:e.home}),r=n.projectRoot;if(De(r,e.home??B()))throw new be(r);if(ve(r))throw new fe(r);let i=!R(N(r,`.ok`)),a=n.gitRootPromoted?P(r,t):void 0,o=e.contentDir===void 0?n.defaultContentDir:Yo(e.contentDir,r,t);n.ancestorPromoted?console.log(`[ok] Opened existing project at ${r}`):n.gitRootPromoted&&i&&o===`.`&&process.stderr.write(`${k(`[ok] Content scope promoted to the git repo root: ${r}`)}\n Ran in ${a}/, but .ok/ lives at the git root (one .ok/ per git repo),\n so the whole repo is now the content scope. To narrow it, re-run with\n \`${y()} init --content-dir .\`, or set content.dir: ${a} in .ok/config.yml.\n`);let s={mode:e.devMcp?`dev`:`published`},c=e.devMcp===!0||C();if(c&&e.mcp!==!1&&e.scope&&e.scope!==`project`)throw new Ko(e.scope);let l=await je(r),u;try{u=de(r,{contentDir:o})}catch(t){let i=$.claude.configPath(r,e.home);return{projectRoot:r,contentCreated:[],contentUpdated:[],contentSkipped:[],editors:[],projectSkills:[],legacyProjectConfigs:[],didGitInit:l.didInit,rootGitignoreCreated:!1,gitRootPromoted:n.gitRootPromoted,promotedFromDir:a,contentDirRequested:e.contentDir,contentScaffoldFailed:!0,mcpAction:`failed`,mcpPath:i,mcpError:`Content scaffolding failed: ${t instanceof Error?t.message:String(t)}`,sharing:{kind:`no-exclude`,reason:`no-git`,localOnlyRequested:!1}}}let d=u.created.includes(Ue),f=!1;if(l.didInit)try{f=_e(r)===`created`}catch(e){console.warn(`[ok] Skipping .gitignore seed at ${r}: ${e instanceof Error?e.message:String(e)}`)}try{Ae(r)===`removed`&&console.warn(`[ok] Removed the OpenKnowledge project-skill lines from .gitignore. The skill is ordinary project content now — commit it if your team wants it on clone.`)}catch(e){console.warn(`[ok] Skipping project-skill .gitignore cleanup at ${r}: ${e instanceof Error?e.message:String(e)}`)}let p=await Ho({scope:c?`project`:e.scope,mcp:e.mcp,isTTY:e.isTTY,promptFn:e.promptFn}),m=e.editors??ms(r,e.home),h=e.editors??m,g=sa(m),v=sa(h),b=e.mcp===!1||p===null,x=Array.from(new Map([...g,...b?[]:v].map(e=>[e.id,e])).values()),S=g.filter(t=>Qo(t,r,e.home)),w=[],ee=[],te=new Set;for(let t of x){if(b){let n=``;try{n=t.configPath(r,e.home)}catch{}w.push({editorId:t.id,label:t.label,action:`skipped-flag`,configPath:n,serverName:t.serverName(r)});continue}if(zo(p)&&g.includes(t)&&t.scope===`global`&&w.push(es(t,r,s,e.home)),Bo(p)&&v.includes(t)&&t.projectConfigPath){let n=t.projectConfigPath(r),i=es(t,r,s,e.home,n);w.push(i),(i.action===`written`||i.action===`overwritten`)&&te.add(n)}}let ne=new Set;for(let t of v){let n=t.projectSkillPath?.(r);!n||ne.has(n)||(ne.add(n),ee.push(Ba(t,r,{home:e.home})))}let re=za(r,v.map(e=>e.id));re&&ee.push(re);let ie=ee.filter(e=>e.action===`written`||e.action===`overwritten`).map(e=>e.editorId);if(ie.length>0){let t=e.home??B();le({source:_,skills:[Ne.project],agents:ie,scope:r},{home:t,enabled:Le(t).enabled})}let ae=!b&&p!==null&&Bo(p)?v.filter(e=>!e.projectConfigPath&&!e.projectSkillPath).map(e=>e.label):void 0,oe=b?[]:S.map(e=>rs(e,r)).filter(e=>e!==void 0).filter(e=>!te.has(e.path)),se=e.installUserSkill??me,ce=e.home??B(),ue=Jo(e.skills),pe=typeof e.skills!=`string`,T=!1,ge=!1,ye=!1,Ce=!1,we=!1,Te=!1,Oe=!1,ke=[];for(let t of he){if(!ue.has(t))continue;if(T=!0,pe){let e=await Ee(ce,Ne[t]).then(e=>({ok:!0,value:e}),()=>({ok:!1}));if(!e.ok){ke.push({bundleId:t,result:`decision-read-failed`}),Oe=!0;continue}if(e.value===!1){ke.push({bundleId:t,result:`opted-out`}),Te=!0;continue}}await xe(ce,Ne[t],!0).catch(()=>{});let n=await se({home:e.home,bundleId:t,force:!0});ke.push({bundleId:t,result:n}),n===`installed`?ge=!0:n===`failed`?ye=!0:n===`no-hosts`?we=!0:Ce=!0}let Me=ye?`failed`:Oe?`decision-read-failed`:ge?`installed`:T&&Ce?`skip-current`:T&&we?`no-hosts`:Te?`opted-out`:`declined`,Pe=ge?Fe(ce).map(e=>e.editorId):[],Ie=Le(ce).enabled&&!Se(),Re=b?`skipped-flag`:`skipped-missing`,E=w.find(e=>e.editorId===`claude`)??w[0]??{action:Re,configPath:$.claude.configPath(r,e.home)},ze=await ls({projectRoot:r,desiredMode:await Wo({sharing:e.sharing,projectRoot:r,isTTY:e.isTTY,freshProject:i,promptFn:e.sharingPromptFn}),explicitFlag:e.sharing});return{projectRoot:r,contentCreated:u.created,contentUpdated:u.updated,contentSkipped:u.skipped,editors:w,projectSkills:ee,legacyProjectConfigs:oe,skillInstall:Me,skillBundles:ke,skillsRequested:e.skills,skillHosts:Pe,skillInstallsCounted:Ie,didGitInit:l.didInit,rootGitignoreCreated:f,gitRootPromoted:n.gitRootPromoted,promotedFromDir:a,contentDir:d?o:void 0,contentDirRequested:e.contentDir,contentScaffoldFailed:!1,mcpAction:E.action,mcpPath:E.configPath,mcpError:`error`in E?E.error:void 0,projectScopeUnsupportedLabels:ae,sharing:ze}}async function ls(e){let{projectRoot:t,desiredMode:n,explicitFlag:r}=e,i=ma(t);if(i===`no-git`)return{kind:`no-exclude`,reason:`no-git`,localOnlyRequested:r===`local-only`};let a=ua(t);if(n===`local-only`){let e=fa(t,a);if(e.kind===`refused-tracked`){let t=e;return{kind:`refused-tracked`,tracked:t.tracked,remediation:t.remediation}}return e.kind===`no-exclude`?{kind:`no-exclude`,reason:e.reason,localOnlyRequested:r===`local-only`}:us(t,e,`add`)}if(i===`shared`)return{kind:`applied`,mode:`shared`,action:`noop`,appended:[],alreadyPresent:[],removed:[]};let o=pa(t,a);return o.kind===`no-exclude`?{kind:`no-exclude`,reason:o.reason,localOnlyRequested:!1}:us(t,o,`remove`)}function us(e,t,n){let r=ma(e);return n===`add`?{kind:`applied`,mode:r,action:t.appended.length>0?`added`:t.removed.length>0?`cleaned`:`noop`,appended:t.appended,alreadyPresent:t.alreadyPresent,removed:t.removed}:{kind:`applied`,mode:r,action:`removed`,appended:[],alreadyPresent:[],removed:t.removed}}function ds(e){switch(e){case`permission-denied`:return`permission denied; check file and parent-directory permissions`;case`unresolved-symlink`:return`could not resolve the path or symlink; check permissions and symlink cycles`;case`not-a-file`:return`config path is not a regular file`;case`disappeared`:return`config disappeared while being read; retry to check its current state`;case`unreadable`:return`could not read the config file; check that the path is accessible`;case`unparseable`:return`config could not be parsed`;case`oversize`:return`config too large to edit safely`;case`duplicate-container`:return`duplicate server block`;case`no-native-writer`:return`no format-preserving writer available`;case void 0:return`config not readable`;default:throw Error(`unhandled MCP decline reason: ${e}`)}}function fs(e,t){let n=[],i=e.editors.some(e=>e.action===`written`||e.action===`overwritten`),a=e.editors.some(e=>e.action===`failed`)||e.projectSkills.some(e=>e.action===`failed`),o=e.editors.length>0&&e.editors.every(e=>e.action===`skipped-flag`),s=e.editors.length>0&&e.editors.every(e=>e.action===`skipped-missing`);e.didGitInit&&n.push(`Initialized git repo at ${t}/.git/ (default branch: main)`),e.rootGitignoreCreated&&n.push(`Seeded .gitignore at ${t}/.gitignore (.DS_Store)`);let c=N(t,`.ok`);if(e.contentCreated.length>0||e.contentUpdated.length>0?(n.push(A(`Content scaffolded at ${c}/`)),e.contentCreated.length>0&&n.push(` Created: ${e.contentCreated.join(`, `)}`),e.contentUpdated.length>0&&n.push(` Updated: ${e.contentUpdated.join(`, `)}`)):n.push(A(`Content already present at ${c}/`)),e.contentSkipped.length>0&&n.push(` Skipped (already exist): ${e.contentSkipped.join(`, `)}`),n.push(``),e.mcpError&&e.editors.length===0)n.push(`Warning: ${e.mcpError}`);else if(e.editors.length===0){if(n.push(A(`MCP server configuration:`)),e.mcpAction===`skipped-flag`)n.push(` MCP config not written — use without --no-mcp to configure editors`);else if(e.projectScopeUnsupportedLabels&&e.projectScopeUnsupportedLabels.length>0){let t=e.projectScopeUnsupportedLabels.join(`, `),r=e.projectScopeUnsupportedLabels.length===1?`does`:`do`;n.push(` ${t} ${r} not support project-level config; skipped`)}else n.push(` No supported editor config directories detected; skipped MCP registration`)}else if(o)n.push(`MCP config not written — use without --no-mcp to configure editors`);else if(s)n.push(A(`MCP server configuration:`)),n.push(` No supported editor config directories detected; skipped MCP registration`);else{n.push(A(`MCP server configuration:`));for(let i of e.editors){let e=i.configPath.startsWith(t)?P(t,i.configPath):i.configPath.replace(/^\/Users\/[^/]+/,`~`),a=i.serverName===r()?``:` (${i.serverName})`,o=i.configScope===`project`?` (project)`:``,s=`${i.label}${o}`,c=` `.repeat(Math.max(1,20-s.length)),l=i.editorId===`claude-desktop`&&(i.action===`written`||i.action===`overwritten`)?` — quit and relaunch Claude Desktop to activate`:``;switch(i.action){case`written`:n.push(` ${s}${c}${e} ${O(`registered`)}${a}${l}`);break;case`overwritten`:n.push(` ${s}${c}${e} ${O(`updated`)}${a}${l}`);break;case`skipped-missing`:n.push(` ${s}${c}${e} config root missing; skipped`);break;case`failed`:n.push(` ${s}${c}${e} ${He(`FAILED`)}: ${i.error}`);break;case`declined`:n.push(` ${s}${c}${e} left unchanged (${ds(i.declineReason)})`);break;case`skipped-flag`:break;default:i.action}}if(e.projectScopeUnsupportedLabels&&e.projectScopeUnsupportedLabels.length>0){let t=e.projectScopeUnsupportedLabels.join(`, `),r=e.projectScopeUnsupportedLabels.length===1?`does`:`do`;n.push(` ${t} ${r} not support project-level config; skipped`)}let i=l.dev.mcpServerName;e.editors.some(e=>e.serverName===i&&(e.action===`written`||e.action===`overwritten`))&&n.push(` The ${i} entry runs this checkout on this machine only; keep it out of commits.`)}if(e.projectSkills.length>0){n.push(``),n.push(A(`Project-local skills:`));for(let r of e.projectSkills){let e=`${r.label} (project)`,i=` `.repeat(Math.max(1,20-e.length)),a=r.path?P(t,r.path):``;switch(r.action){case`written`:n.push(` ${e}${i}${a} ${O(`installed`)}`);break;case`overwritten`:n.push(` ${e}${i}${a} ${O(`updated`)}`);break;case`skipped-unsupported`:n.push(` ${e}${i}no known project skill surface; skipped`);break;case`skipped-prerequisite`:n.push(` ${e}${i}OpenKnowledge MCP is not configured; skipped`);break;case`failed`:n.push(` ${e}${i}${a} ${He(`FAILED`)}: ${r.error}`)}}}if(a&&(n.push(``),n.push(`For failed editors, add the MCP server entry or project skill manually. See:`),n.push(` https://github.com/inkeep/open-knowledge#mcp-setup`)),e.legacyProjectConfigs.length>0){n.push(``),n.push(`Project MCP configs found:`);for(let r of e.legacyProjectConfigs)n.push(` ${r.label} ${P(t,r.path)}`);n.push(` These project-local files may override the global config. Remove them if you want fully user-scoped MCP setup in this project.`)}if(e.skillInstall===`declined`)n.push(``),n.push(A(`User-global skills:`)),typeof e.skillsRequested==`string`?(n.push(` ${D(`none installed — --skills "${e.skillsRequested}" names no known skill bundle (known: ${he.join(`, `)})`)}`),n.push(` ${D(`No user-global skill was installed or removed.`)}`)):(n.push(` ${D(`none installed — skipped for this run (--no-skills)`)}`),n.push(` ${D(`No user-global skill was installed or removed; any already on this`)}`),n.push(` ${D(`machine are untouched. Run init without the flag to install them:`)}`),n.push(` ${D(` ${y()} init`)}`),n.push(` ${D(`--no-skills covers user-global skills only, not project-local skills.`)}`));else if(e.skillInstall){n.push(``),n.push(A(`User-global skills:`));let t=e.skillBundles??[],r=Math.max(0,...t.map(e=>Ne[e.bundleId].length));for(let i of t){let t=Ne[i.bundleId].padEnd(r);switch(i.result){case`installed`:{let r=(e.skillHosts??[]).map(e=>X[e]??e),i=r.length>0?r.join(`, `):`the shared ~/.agents store`;n.push(` ${t} ${O(`installed for ${i}`)}`);break}case`skip-current`:n.push(` ${t} ${O(`already installed at current version`)}`);break;case`no-hosts`:n.push(` ${t} ${D(`skipped — no supported agent host detected in your home directory`)}`);break;case`failed`:n.push(` ${k(`${t} install failed`)}`);break;case`opted-out`:n.push(` ${t} ${D(`not installed — turned off on this machine; reinstall with ${y()} init --skills ${i.bundleId} or Settings → Skills Studio`)}`);break;case`decision-read-failed`:n.push(` ${k(`${t} not installed — could not read whether it is turned off on this machine; rerun ${y()} init once ${S(b)} is readable`)}`);break;default:i.result}}e.skillInstallsCounted&&t.some(e=>e.result===`installed`)&&(n.push(` ${D(`Counted on skills.sh (skill name + source repo, once per machine).`)}`),n.push(` ${D(`Opt out: DO_NOT_TRACK=1, or Settings → User → Preferences.`)}`)),t.some(e=>e.result===`failed`)&&n.push(` ${k(`Retry with: ${y()} repair-skills`)}`)}e.contentDirRequested!==void 0&&e.contentDir===void 0&&!e.contentScaffoldFailed?(n.push(``),n.push(k(`⚠ --content-dir ${e.contentDirRequested} ignored — .ok/config.yml already exists`)),n.push(` Edit .ok/config.yml → content.dir directly to change the content scope.`)):e.contentDir!==void 0&&e.contentDir!==`.`?(n.push(``),n.push(`Content scope set to ${e.contentDir}/ (content.dir in .ok/config.yml).`)):e.gitRootPromoted&&e.contentDir===`.`&&e.contentDirRequested===void 0&&(n.push(``),n.push(k(`⚠ Content scope promoted to the git repo root`)),n.push(` .ok/ was initialized at ${t} because it contains a .git folder (one .ok/ per git repo),`),n.push(` not the sub-folder you ran \`${y()} init\` in${e.promotedFromDir?` (${e.promotedFromDir})`:``}. The whole repo is now the content scope.`),e.promotedFromDir&&(n.push(` To scope to just that sub-folder, re-run \`${y()} init --content-dir .\` from there, or set`),n.push(` content.dir: ${e.promotedFromDir} in .ok/config.yml.`))),e.preview?(n.push(``),n.push(We(e.preview,t))):e.previewWarning&&(n.push(``),n.push(`Content preview unavailable: ${e.previewWarning}`)),n.push(``),n.push(..._s(e.sharing,t));let u=e=>[`${e}- ${Ve(`${y()} seed --list-packs`)} — browse the starter packs`,`${e}- ${Ve(`${y()} seed`)} — scaffold an empty repo`];if(i){let t=new Set,r=e.editors.filter(e=>e.action===`written`||e.action===`overwritten`).filter(e=>!t.has(e.editorId)&&t.add(e.editorId)).map(e=>e.label);n.push(``),n.push(`${O(`✓`)} ${A(`Next steps:`)}`),n.push(` 1. Open your editor (${Ve(r.join(` / `))})`),n.push(` 2. Approve the MCP server when prompted`);let i=3;e.contentScaffoldFailed||(n.push(` ${i++}. (Optional) scaffold the starter knowledge-base structure:`),n.push(...u(` `))),n.push(` ${i}. Ask your agent to capture a source, research a topic, or build a wiki —`),n.push(` the procedures ship as skills alongside the MCP tools.`)}else e.contentScaffoldFailed||(n.push(``),n.push(`${A(`Next steps:`)} (optional) scaffold the starter knowledge-base structure:`),n.push(...u(` `)));return n.join(`
|
|
691
691
|
`)}function ps(e,t){return{projectRoot:e.projectRoot,gitRootPromoted:e.gitRootPromoted,promotedFromDir:e.promotedFromDir??null,contentDir:t.contentDir,contentDirRequested:e.contentDirRequested??null,contentDirApplied:e.contentDir!==void 0,contentFileCount:t.contentFileCount,previewError:e.previewWarning??null,didGitInit:e.didGitInit,mcpAction:e.mcpAction,editors:e.editors.map(e=>({editorId:e.editorId,label:e.label,action:e.action,configPath:e.configPath,scope:e.configScope===`project`?`project`:`user`}))}}function ms(e,t){let n=[];for(let r of ci)r!==`claude-desktop`&&Qo($[r],e,t)&&n.push(r);return n}function hs(){let e={log:console.log,info:console.info,debug:console.debug},t=(...e)=>{process.stderr.write(`${e.map(e=>typeof e==`string`?e:ct(e)).join(` `)}\n`)};return console.log=t,console.info=t,console.debug=t,()=>{console.log=e.log,console.info=e.info,console.debug=e.debug}}function gs(){return new Et(`init`).description(`Scaffold .ok/ in the current directory and register the MCP server for your editor(s)`).option(`--mcp`,`Register the MCP server for selected editors (default: true)`,!0).option(`--no-mcp`,`Scaffold the .ok/ directory but do not touch MCP config`).option(`--dev-mcp`,`Register a local dev MCP entry (node + packages/cli/dist/cli.mjs, debug logging) in project config only, as the dev channel unless OK_CHANNEL is set`).option(`--content-dir <dir>`,`Limit content to <dir> instead of the whole project. <dir> is interpreted relative to your current directory (e.g. "." = the folder you run the command in), then saved to .ok/config.yml as content.dir.`).option(`--json`,`Emit a structured JSON summary to stdout (diagnostics stay on stderr)`).option(`--skills <ids>`,`Install only the named user-global skill bundles (comma list: discovery,write-skill)`).option(`--no-skills`,`Do not install any user-global skill bundles`).addOption(new Ot(`--scope <scope>`,`Write MCP config at user level, project level, or both`).choices([`user`,`project`,`both`])).addOption(new Ot(`--shared`,`Commit OK config alongside content (the default for fresh repos)`).conflicts(`localOnly`)).addOption(new Ot(`--local-only`,`Keep OK config out of git via .git/info/exclude (per-clone, not committed)`).conflicts(`shared`)).action(async e=>{let t=process.cwd();e.devMcp&&w(process.env);let n=e.shared?`shared`:e.localOnly?`local-only`:void 0,r=e.json?hs():null;try{let r;try{r=await cs({cwd:t,mcp:e.mcp,devMcp:e.devMcp,scope:e.scope,sharing:n,contentDir:e.contentDir,skills:e.skills})}catch(e){if(e instanceof Go||e instanceof Ko||e instanceof be||e instanceof fe){process.stderr.write(`${e.message}\n`),process.exitCode=64;return}if(e instanceof ye||e instanceof Be||e instanceof ue){process.stderr.write(`${e.message}\n`),process.exitCode=78;return}if(e instanceof we){process.stderr.write(`open-knowledge could not initialize a git repo for this project. Re-run, or run 'git init' yourself in the project folder.
|
|
692
|
-
`),e.stderr&&process.stderr.write(`${e.stderr.trim()}\n`),process.exitCode=1;return}throw e}let i=r.contentDir??`.`,a=null,{loadConfig:o}=await import(`./loader-
|
|
692
|
+
`),e.stderr&&process.stderr.write(`${e.stderr.trim()}\n`),process.exitCode=1;return}throw e}let i=r.contentDir??`.`,a=null,{loadConfig:o}=await import(`./loader-B2fGi6oQ.mjs`),{resolveContentDir:s}=await import(`./dist-DFlcDcjF.mjs`),c;try{c=o(r.projectRoot).config,i=c.content.dir}catch(e){r.previewWarning=e instanceof Error?e.message:String(e)}if(c)try{let{previewContent:e}=await import(`./preview-DSJofhni.mjs`),t=s(c,r.projectRoot);r.preview=e({projectDir:r.projectRoot,contentDir:t}),a=r.preview.totalCount}catch(e){r.previewWarning=e instanceof Error?e.message:String(e)}e.json?process.stdout.write(`${JSON.stringify(ps(r,{contentDir:i,contentFileCount:a}),null,2)}\n`):process.stdout.write(`${fs(r,r.projectRoot)}\n`),(r.editors.some(e=>e.action===`failed`)||r.mcpAction===`failed`)&&(process.exitCode=1)}finally{r?.()}})}function _s(e,t){let n=[];switch(e.kind){case`applied`:return n.push(A(`Sharing mode:`)),e.mode===`local-only`?e.action===`added`?(n.push(` ${O(`local-only`)} — appended ${e.appended.length} path(s) to ${A(`${t}/.git/info/exclude`)} (per-clone, not committed).`),e.removed.length>0&&n.push(` cleared ${e.removed.length} stale entry(s) left by an older version: ${e.removed.join(`, `)}.`)):e.action===`cleaned`?n.push(` ${O(`local-only`)} — already excluded; cleared ${e.removed.length} stale entry(s) left by an older version: ${e.removed.join(`, `)}.`):e.action===`noop`&&e.alreadyPresent.length>0?n.push(` ${O(`local-only`)} — already excluded; nothing to do.`):n.push(` ${O(`local-only`)}`):e.action===`removed`?n.push(` ${O(`shared`)} — removed OK paths from ${A(`${t}/.git/info/exclude`)}; commit the files to share with teammates.`):n.push(` ${O(`shared`)} — OK config will be committed alongside content.`),n;case`refused-tracked`:n.push(k(`Sharing mode: switch to local-only deferred`));for(let t of e.remediation.split(`
|
|
693
693
|
`))n.push(t.length>0?` ${t}`:``);return n.push(` Re-run ${Ve(`${y()} config-sharing unshare`)} after resolving to complete the switch.`),n;case`no-exclude`:if(e.localOnlyRequested)n.push(k(`Sharing mode: --local-only requested but no git repo found — option ignored`)),n.push(` Run ${Ve(`git init`)} (or open this folder via OK Desktop, which can scaffold a repo) and then ${Ve(`${y()} config-sharing unshare`)}.`);else if(e.reason===`no-git`)return[];else n.push(k(`Sharing mode unavailable: ${e.reason}.`));return n}}export{Z as $,Ga as A,Da as B,yo as C,Rt as Ct,oo as D,co as E,Ot as Et,Na as F,ua as G,ba as H,Aa as I,pa as J,ga as K,ja as L,Ua as M,Ha as N,to as O,ka as P,li as Q,Va as R,$o as S,U as St,uo as T,wt as Tt,ha as U,fa as V,da as W,X,ci as Y,$ as Z,Wo as _,gr as _t,ls as a,Ei as at,es as b,fn as bt,ms as c,Gi as ct,gs as d,si as dt,Vi as et,Qo as f,oi as ft,Yo as g,Qr as gt,Ho as h,Yr as ht,ts as i,Ci as it,qa as j,Ka as k,fs as l,na as lt,Jo as m,Xr as mt,Ko as n,Hi as nt,ps as o,Wi as ot,as as p,Y as pt,ma as q,Zo as r,Ui as rt,ss as s,Q as st,Go as t,Bi as tt,_s as u,Ai as ut,cs as v,ar as vt,mo as w,Et as wt,is as x,dn as xt,jo as y,hn as yt,Ba as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./dist-Br5t34YL.mjs";import{v as e}from"./init-CFqa1MvX.mjs";export{e as runInit};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Ms as e,ps as t,us as n}from"./dist-
|
|
1
|
+
import{Ms as e,ps as t,us as n}from"./dist-Br5t34YL.mjs";import{N as r,j as i,k as a}from"./init-CFqa1MvX.mjs";import{t as o}from"./is-object-BGze3w87.mjs";import{t as s}from"./removal-file-path-BB7PGKh9.mjs";import{join as c}from"node:path";import{readFileSync as l}from"node:fs";const u={allowTrailingComma:!0,disallowComments:!1};function d(e,t){return e.error===1&&e.offset===0&&t.charCodeAt(0)===65279}function f(o){let f=s(c(o,`.claude`,`launch.json`));if(f.kind!==`ready`)return f;let m=f.path,h;try{h=l(m,`utf-8`)}catch(e){return{kind:`declined`,reason:r(e)}}let g=[],_=t(h,g,u)??void 0;if(g.some(e=>!d(e,h))||_?.type!==`object`)return{kind:`declined`,reason:`unparseable`};let v=n(_).configurations;if(!Array.isArray(v))return{kind:`not-present`};let y=v.findIndex(p);if(y===-1)return{kind:`not-present`};let{text:b,changed:x}=i(h,[`configurations`,y]);return x?(e(m,b,{mode:a(m)}),{kind:`removed`}):{kind:`not-present`}}function p(e){if(!o(e))return!1;let t=e;if(t.name!==`open-knowledge-ui`||!Array.isArray(t.runtimeArgs))return!1;let n=t.runtimeArgs;return t.runtimeExecutable===`/bin/sh`?n.length===3&&n[0]===`-l`&&n[1]===`-c`&&typeof n[2]==`string`&&/^# ok-ui-v[1-9]\d*$/.test(n[2].split(/\r?\n/,1)[0]??``):t.runtimeExecutable===`npx`?m.some(e=>h(n,e)):t.runtimeExecutable===`powershell`&&n.length===4&&n[0]===`-NoProfile`&&n[1]===`-NonInteractive`&&n[2]===`-Command`&&typeof n[3]==`string`&&/^# ok-ui-win-v[1-9]\d*$/.test(n[3].split(/\r?\n/,1)[0]??``)}const m=[[`@inkeep/open-knowledge`,`ui`],[`-y`,`@inkeep/open-knowledge`,`ui`],[`-y`,`@inkeep/open-knowledge@latest`,`ui`]];function h(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}export{f as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./loader-CpSE6Pb3.mjs";export{e as loadConfig};
|