@tencent-ai/codebuddy-code 0.0.1-beta.20 → 0.0.1-beta.21

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/bin/codebuddy CHANGED
@@ -1,2 +1,3 @@
1
1
  #!/usr/bin/env node
2
+ require('events').EventEmitter.defaultMaxListeners = 50;
2
3
  require('../dist/codebuddy');
@@ -1 +1 @@
1
- "use strict";exports.id=422,exports.ids=[422],exports.modules={7422:(e,t,n)=>{n.a(e,(async(e,r)=>{try{n.r(t),n.d(t,{LoginView:()=>LoginView});var l=n(80932),a=n(14083),o=n(96540),c=n(66814),i=n(75101),s=n(82101),u=n(34209),m=n(53829),E=n(49034),d=n(47693),g=n(83175),b=n(42790),y=e([a,s,m,E,b]);[a,s,m,E,b]=y.then?(await y)():y;const LoginView=()=>{const{staticKey:e}=(0,E._W)();return o.createElement(o.Fragment,null,o.createElement(a.jC,{key:`login-view-${e}`,items:[o.createElement(LogoBox,{key:"logo-box"}),o.createElement(NewVersionBox,{key:"new-version-box"})]},(e=>e)),o.createElement(LoginBox,null))},LogoBox=()=>{const e=`Welcome to ${u.KR}`,t=e.length+8;return o.createElement(o.Fragment,null,o.createElement(a.az,{marginBottom:1,paddingLeft:1,borderStyle:"round",borderColor:g.Q.brand,width:t},o.createElement(a.EY,{color:g.Q.brand},"✻ ",e)),o.createElement(b.H,null))},NewVersionBox=()=>{const e="cyan",t=i.CW.getCurrentPackageJson(),n=t.version.includes("beta"),r=t.version.includes("alpha"),l=n?"@beta":r?"@alpha":"";return o.createElement(a.az,{paddingX:1,flexDirection:"column",borderStyle:"round",borderColor:e},o.createElement(a.EY,{color:e},"New Version Updated v",t.version," Release! Please visit ",u.KR," website to read changelog."),o.createElement(a.EY,{color:e},"Run npm install -g ",u.JP,l))},LoginBox=()=>{const{authSession:e,navigate:t}=(0,c.i7)(m.aO,(e=>({authSession:e.authSession,navigate:e.navigate}))),[n,r]=(0,o.useState)("idle"),[i,u]=(0,o.useState)(""),[b,y]=(0,o.useState)(""),h=(0,o.useRef)(new AbortController);return(0,o.useEffect)((()=>{const e=(0,d.bi)().urlSubject.subscribe(u);return()=>e.unsubscribe()}),[]),(0,a.Ge)(((l,a)=>{if(E.Om.RETURN(a)&&"idle"===n)try{r("loading"),y(""),(0,d.Yf)().login(h.current)}catch(e){r("error"),y(e instanceof Error?e.message:"Unknown error occurred")}else E.Om.ESCAPE(a)&&("loading"===n?(h.current.abort(),r("idle")):e&&t("/chat"))})),o.createElement(a.az,{paddingX:1,flexDirection:"column",gap:1,borderStyle:"round",borderColor:"grey"},"idle"===n?o.createElement(o.Fragment,null,o.createElement(a.az,null,o.createElement(a.EY,null,"Select login method:")),o.createElement(a.az,null,o.createElement(a.EY,{color:"green"},l.Ay.bullet," Login with Tencent Cloud CodeBuddy")),o.createElement(a.az,{justifyContent:"space-between"},o.createElement(a.EY,{color:"grey"},"(Press Enter to login)"))):"loading"===n?o.createElement(a.az,{paddingY:1,gap:1,flexDirection:"column"},o.createElement(a.az,null,o.createElement(a.EY,{color:"grey"},"Browser didn't open? User the url below to sign in:")),i&&o.createElement(a.az,null,o.createElement(a.EY,{color:"grey"},i)),o.createElement(a.az,{marginTop:1,gap:1},o.createElement(a.EY,{color:g.Q.brand},o.createElement(s.y$,{type:"star"})),o.createElement(a.EY,null,"Waiting for auth... (Press ESC to cancel)"))):"error"===n?o.createElement(o.Fragment,null,o.createElement(a.EY,{color:"red"},"Failed to login."),b&&o.createElement(a.EY,{color:"red"},"Message: ",b)):void 0)};r()}catch(e){r(e)}}))},42790:(e,t,n)=>{n.a(e,(async(e,r)=>{try{n.d(t,{H:()=>LogoText});var l=n(1597),a=n(14083),o=n(96540),c=n(83175),i=e([a]);a=(i.then?(await i)():i)[0];const LogoText=()=>{const e=(0,o.useRef)((0,l.Ay)(c.Q.GradientColors)),t=(0,o.useCallback)((t=>e.current.multiline(t)),[e]);return o.createElement(a.dL,{transform:t},o.createElement(a.EY,null,"\n ██████╗ ██████╗ ██████╗ ███████╗██████╗ ██╗ ██╗██████╗ ██████╗ ██╗ ██╗ ██████╗ ██████╗ ██████╗ ███████╗\n██╔════╝██╔═══██╗██╔══██╗██╔════╝██╔══██╗██║ ██║██╔══██╗██╔══██╗╚██╗ ██╔╝ ██╔════╝██╔═══██╗██╔══██╗██╔════╝\n██║ ██║ ██║██║ ██║█████╗ ██████╔╝██║ ██║██║ ██║██║ ██║ ╚████╔╝ ██║ ██║ ██║██║ ██║█████╗ \n██║ ██║ ██║██║ ██║██╔══╝ ██╔══██╗██║ ██║██║ ██║██║ ██║ ╚██╔╝ ██║ ██║ ██║██║ ██║██╔══╝ \n╚██████╗╚██████╔╝██████╔╝███████╗██████╔╝╚██████╔╝██████╔╝██████╔╝ ██║ ╚██████╗╚██████╔╝██████╔╝███████╗\n ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝╚═════╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝\n \n\n . * . * . *\n /\\_/\\ \n ( o.o ) * . * \n > ^ < . \n"))};r()}catch(e){r(e)}}))}};
1
+ "use strict";exports.id=422,exports.ids=[422],exports.modules={7422:(e,t,n)=>{n.a(e,(async(e,r)=>{try{n.r(t),n.d(t,{LoginView:()=>LoginView});var l=n(80932),a=n(14083),o=n(96540),c=n(66814),i=n(75101),s=n(82101),u=n(34209),m=n(53829),E=n(49034),d=n(47693),g=n(83175),b=n(42790),y=e([a,s,m,E,b]);[a,s,m,E,b]=y.then?(await y)():y;const LoginView=()=>{const e=(0,c.i7)(m.Gb,(e=>e.staticKey));return o.createElement(o.Fragment,null,o.createElement(a.jC,{key:`login-view-${e}`,items:[o.createElement(LogoBox,{key:"logo-box"}),o.createElement(NewVersionBox,{key:"new-version-box"})]},(e=>e)),o.createElement(LoginBox,null))},LogoBox=()=>{const e=`Welcome to ${u.KR}`,t=e.length+8;return o.createElement(o.Fragment,null,o.createElement(a.az,{marginBottom:1,paddingLeft:1,borderStyle:"round",borderColor:g.Q.brand,width:t},o.createElement(a.EY,{color:g.Q.brand},"✻ ",e)),o.createElement(b.H,null))},NewVersionBox=()=>{const e="cyan",t=i.CW.getCurrentPackageJson(),n=t.version.includes("beta"),r=t.version.includes("alpha"),l=n?"@beta":r?"@alpha":"";return o.createElement(a.az,{paddingX:1,flexDirection:"column",borderStyle:"round",borderColor:e},o.createElement(a.EY,{color:e},"New Version Updated v",t.version," Release! Please visit ",u.KR," website to read changelog."),o.createElement(a.EY,{color:e},"Run npm install -g ",u.JP,l))},LoginBox=()=>{const{authSession:e,navigate:t}=(0,c.i7)(m.aO,(e=>({authSession:e.authSession,navigate:e.navigate}))),[n,r]=(0,o.useState)("idle"),[i,u]=(0,o.useState)(""),[b,y]=(0,o.useState)(""),h=(0,o.useRef)(new AbortController);return(0,o.useEffect)((()=>{const e=(0,d.bi)().urlSubject.subscribe(u);return()=>e.unsubscribe()}),[]),(0,a.Ge)(((l,a)=>{if(E.Om.RETURN(a)&&"idle"===n)try{r("loading"),y(""),(0,d.Yf)().login(h.current)}catch(e){r("error"),y(e instanceof Error?e.message:"Unknown error occurred")}else E.Om.ESCAPE(a)&&("loading"===n?(h.current.abort(),r("idle")):e&&t("/chat"))})),o.createElement(a.az,{paddingX:1,flexDirection:"column",gap:1,borderStyle:"round",borderColor:"grey"},"idle"===n?o.createElement(o.Fragment,null,o.createElement(a.az,null,o.createElement(a.EY,null,"Select login method:")),o.createElement(a.az,null,o.createElement(a.EY,{color:"green"},l.Ay.bullet," Login with Tencent Cloud CodeBuddy")),o.createElement(a.az,{justifyContent:"space-between"},o.createElement(a.EY,{color:"grey"},"(Press Enter to login)"))):"loading"===n?o.createElement(a.az,{paddingY:1,gap:1,flexDirection:"column"},o.createElement(a.az,null,o.createElement(a.EY,{color:"grey"},"Browser didn't open? User the url below to sign in:")),i&&o.createElement(a.az,null,o.createElement(a.EY,{color:"grey"},i)),o.createElement(a.az,{marginTop:1,gap:1},o.createElement(a.EY,{color:g.Q.brand},o.createElement(s.y$,{type:"star"})),o.createElement(a.EY,null,"Waiting for auth... (Press ESC to cancel)"))):"error"===n?o.createElement(o.Fragment,null,o.createElement(a.EY,{color:"red"},"Failed to login."),b&&o.createElement(a.EY,{color:"red"},"Message: ",b)):void 0)};r()}catch(e){r(e)}}))},42790:(e,t,n)=>{n.a(e,(async(e,r)=>{try{n.d(t,{H:()=>LogoText});var l=n(1597),a=n(14083),o=n(96540),c=n(83175),i=e([a]);a=(i.then?(await i)():i)[0];const LogoText=()=>{const e=(0,o.useRef)((0,l.Ay)(c.Q.GradientColors)),t=(0,o.useCallback)((t=>e.current.multiline(t)),[e]);return o.createElement(a.dL,{transform:t},o.createElement(a.EY,null,"\n ██████╗ ██████╗ ██████╗ ███████╗██████╗ ██╗ ██╗██████╗ ██████╗ ██╗ ██╗ ██████╗ ██████╗ ██████╗ ███████╗\n██╔════╝██╔═══██╗██╔══██╗██╔════╝██╔══██╗██║ ██║██╔══██╗██╔══██╗╚██╗ ██╔╝ ██╔════╝██╔═══██╗██╔══██╗██╔════╝\n██║ ██║ ██║██║ ██║█████╗ ██████╔╝██║ ██║██║ ██║██║ ██║ ╚████╔╝ ██║ ██║ ██║██║ ██║█████╗ \n██║ ██║ ██║██║ ██║██╔══╝ ██╔══██╗██║ ██║██║ ██║██║ ██║ ╚██╔╝ ██║ ██║ ██║██║ ██║██╔══╝ \n╚██████╗╚██████╔╝██████╔╝███████╗██████╔╝╚██████╔╝██████╔╝██████╔╝ ██║ ╚██████╗╚██████╔╝██████╔╝███████╗\n ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝╚═════╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝\n \n\n . * . * . *\n /\\_/\\ \n ( o.o ) * . * \n > ^ < . \n"))};r()}catch(e){r(e)}}))}};
@@ -1 +1 @@
1
- "use strict";exports.id=566,exports.ids=[566],exports.modules={19250:(e,t,a)=>{a.a(e,(async(e,n)=>{try{a.d(t,{NH:()=>r.NH,pF:()=>m.pF});var l=a(77146),s=a(89536),c=a(70790),m=a(62875),r=a(82388),i=e([l,s,c,m,r]);[l,s,c,m,r]=i.then?(await i)():i,n()}catch(e){n(e)}}))},90566:(e,t,a)=>{a.a(e,(async(e,n)=>{try{a.r(t),a.d(t,{ChatView:()=>ChatView});var l=a(14083),s=a(96540),c=a(66814),m=a(26730),r=a(53829),i=a(49034),u=a(59505),o=a(19250),g=a(66530),h=a(92709),p=e([l,m,r,i,u,o,g,h]);[l,m,r,i,u,o,g,h]=p.then?(await p)():p;const E=2,d=2,f=s.memo((({availableHeight:e})=>{const t=(0,c.i7)(r.Gb,(e=>e.staticKey)),a=(0,c.i7)(r.rZ,(e=>e.messageGroups)),n=(0,h.A)(a),[m,i]=(0,s.useState)([]),[u,o]=(0,s.useState)([]);(0,s.useEffect)((()=>{i([]),o([]);for(const e of a){if("function_call_group"===e.type){if(!e.messages.find((e=>"function_call"===e.type&&e.status&&["completed","incomplete"].includes(e.status)))){o((t=>(t.push(...e.messages),t)));continue}}i((t=>(t.push(...e.messages),t)))}}),[a]);const p=s.useMemo((()=>[s.createElement(g.f,{key:"chat-header-box"}),...m.map((e=>s.createElement(h.h,{key:`message-item-${e.id}`,msg:e,expanded:n(e.id)})))]),[m,n]);return s.createElement(s.Fragment,null,s.createElement(l.jC,{key:t,items:p},(e=>e)),u.length?s.createElement(l.az,{flexDirection:"column",height:E},...u.map((e=>s.createElement(h.h,{key:`message-item-${e.id}`,msg:e,expanded:n(e.id)})))):s.createElement(s.Fragment,null))})),ChatContainer=()=>{const{terminalHeight:e}=(0,i._W)(),[t,a]=(0,s.useState)(0);return(0,s.useEffect)((()=>{a(e-d)}),[e]),(0,m.o)(),(0,u.f)(),s.createElement(s.Fragment,null,s.createElement(f,{availableHeight:t}),s.createElement(l.az,{flexDirection:"column"},s.createElement(o.NH,null,s.createElement(o.pF,{availableHeight:t}))))},ChatView=()=>s.createElement(r.Fn,null,s.createElement(r.N7,null,s.createElement(r.Y5,null,s.createElement(ChatContainer,null))));n()}catch(e){n(e)}}))}};
1
+ "use strict";exports.id=566,exports.ids=[566],exports.modules={19250:(e,t,a)=>{a.a(e,(async(e,n)=>{try{a.d(t,{NH:()=>r.NH,pF:()=>m.pF});var l=a(77146),s=a(89536),c=a(70790),m=a(62875),r=a(82388),i=e([l,s,c,m,r]);[l,s,c,m,r]=i.then?(await i)():i,n()}catch(e){n(e)}}))},90566:(e,t,a)=>{a.a(e,(async(e,n)=>{try{a.r(t),a.d(t,{ChatView:()=>ChatView});var l=a(14083),s=a(96540),c=a(66814),m=a(26730),r=a(53829),i=a(59505),u=a(19250),o=a(66530),p=a(92709),g=e([l,m,r,i,u,o,p]);[l,m,r,i,u,o,p]=g.then?(await g)():g;const h=2,E=2,d=s.memo((({availableHeight:e})=>{const t=(0,c.i7)(r.Gb,(e=>e.staticKey)),a=(0,c.i7)(r.rZ,(e=>e.messageGroups)),n=(0,p.A)(a),[m,i]=(0,s.useState)([]),[u,g]=(0,s.useState)([]);(0,s.useEffect)((()=>{const e=[],t=[];for(const n of a){if("function_call_group"===n.type){if(!n.messages.find((e=>"function_call"===e.type&&e.status&&["completed","incomplete"].includes(e.status)))){t.push(...n.messages);continue}}e.push(...n.messages)}i(e),g(t)}),[a]);const E=s.useMemo((()=>[s.createElement(o.f,{key:"chat-header-box"}),...m.map((e=>s.createElement(p.h,{key:`message-item-${e.type}-${e.id}`,msg:e,expanded:n(e.id)})))]),[m,n]);return s.createElement(s.Fragment,null,s.createElement(l.jC,{key:t,items:E},(e=>e)),u.length?s.createElement(l.az,{flexDirection:"column",height:h},...u.map((e=>s.createElement(p.h,{key:`message-item-${e.type}-${e.id}`,msg:e,expanded:n(e.id)})))):s.createElement(s.Fragment,null))})),ChatContainer=()=>{const e=(0,c.i7)(r.Gb,(e=>e.terminalHeight)),[t,a]=(0,s.useState)(0);return(0,s.useEffect)((()=>{a(e-E)}),[e]),(0,m.o)(),(0,i.f)(),s.createElement(s.Fragment,null,s.createElement(d,{availableHeight:t}),s.createElement(l.az,{flexDirection:"column"},s.createElement(u.NH,null,s.createElement(u.pF,{availableHeight:t}))))},ChatView=()=>s.createElement(r.Fn,null,s.createElement(r.N7,null,s.createElement(r.Y5,null,s.createElement(ChatContainer,null))));n()}catch(e){n(e)}}))}};
@@ -0,0 +1 @@
1
+ "use strict";exports.id=632,exports.ids=[632],exports.modules={11632:(e,r,t)=>{t.a(e,(async(e,c)=>{try{t.r(r),t.d(r,{McpView:()=>McpView});var l=t(14083),a=t(96540),o=t(66814),n=t(32368),s=t(82101),i=t(34209),u=t(53829),m=t(49034),d=e([l,s,u,m]);[l,s,u,m]=d.then?(await d)():d;const McpView=()=>a.createElement(MultipleServersConfirm,{servers:[{value:"echo-server4",label:"echo-server4",checked:!0},{value:"echo-server5",label:"echo-server5",checked:!1},{value:"Github-MCP-Server6",label:"Github-MCP-Server6",checked:!0}]}),MultipleServersConfirm=({servers:e})=>{const r=(0,o.i7)(u.aO,(e=>e.navigate)),[t,c]=(0,a.useState)(e),d=(0,a.useRef)(void 0),h=(0,a.useCallback)((e=>{d.current=e}),[]);(0,l.Ge)(((e,t)=>{if(m.Om.ESCAPE(t)&&r("/chat")," "===e&&d.current){const e=d.current;c((r=>r.map((r=>r.value===e.value?{...r,checked:!r.checked}:r))))}}));const v=t.length;return a.createElement(a.Fragment,null,a.createElement(l.az,{padding:1,gap:1,flexDirection:"column",borderColor:"yellowBright",borderStyle:"round"},a.createElement(l.EY,{color:"yellowBright"},v," new MCP servers found in ",n.DZ),a.createElement(l.EY,null,"Select any you wish to enable."),a.createElement(l.EY,null,"MCP servers may execute code or access system resources. All tool calls require approval. Learn more in the MCP documentation ( ",i.Je," )."),a.createElement(s.pp,{items:t,limit:5,itemComponent:ServerItemComponent,onHighlight:h})),a.createElement(l.az,{paddingX:2},a.createElement(l.EY,{color:"grey"},"Space to select · Enter to confirm · Esc to reject all")))},ServerItemComponent=({value:e,checked:r})=>a.createElement(l.EY,{color:r?"green":void 0},e," ",r?"✓":"");c()}catch(e){c(e)}}))}};
@@ -1 +1 @@
1
- exports.id=814,exports.ids=[814],exports.modules={8147:(t,r,e)=>{"use strict";const s=e(16928),n=e(54080),o=e(50078),i=e(34489),c="win32"===process.platform,a=/\.(?:com|exe)$/i,l=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function parseNonShell(t){if(!c)return t;const r=function detectShebang(t){t.file=n(t);const r=t.file&&i(t.file);return r?(t.args.unshift(t.file),t.command=r,n(t)):t.file}(t),e=!a.test(r);if(t.options.forceShell||e){const e=l.test(r);t.command=s.normalize(t.command),t.command=o.command(t.command),t.args=t.args.map((t=>o.argument(t,e)));const n=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${n}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}t.exports=function parse(t,r,e){r&&!Array.isArray(r)&&(e=r,r=null);const s={command:t,args:r=r?r.slice(0):[],options:e=Object.assign({},e),file:void 0,original:{command:t,args:r}};return e.shell?s:parseNonShell(s)}},14155:(t,r,e)=>{t.exports=isexe,isexe.sync=function sync(t,r){return checkStat(s.statSync(t),r)};var s=e(79896);function isexe(t,r,e){s.stat(t,(function(t,s){e(t,!t&&checkStat(s,r))}))}function checkStat(t,r){return t.isFile()&&function checkMode(t,r){var e=t.mode,s=t.uid,n=t.gid,o=void 0!==r.uid?r.uid:process.getuid&&process.getuid(),i=void 0!==r.gid?r.gid:process.getgid&&process.getgid(),c=parseInt("100",8),a=parseInt("010",8),l=parseInt("001",8),u=c|a;return e&l||e&a&&n===i||e&c&&s===o||e&u&&0===o}(t,r)}},24326:(t,r,e)=>{const s="win32"===process.platform||"cygwin"===process.env.OSTYPE||"msys"===process.env.OSTYPE,n=e(16928),o=s?";":":",i=e(79882),getNotFoundError=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),getPathInfo=(t,r)=>{const e=r.colon||o,n=t.match(/\//)||s&&t.match(/\\/)?[""]:[...s?[process.cwd()]:[],...(r.path||process.env.PATH||"").split(e)],i=s?r.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",c=s?i.split(e):[""];return s&&-1!==t.indexOf(".")&&""!==c[0]&&c.unshift(""),{pathEnv:n,pathExt:c,pathExtExe:i}},which=(t,r,e)=>{"function"==typeof r&&(e=r,r={}),r||(r={});const{pathEnv:s,pathExt:o,pathExtExe:c}=getPathInfo(t,r),a=[],step=e=>new Promise(((o,i)=>{if(e===s.length)return r.all&&a.length?o(a):i(getNotFoundError(t));const c=s[e],l=/^".*"$/.test(c)?c.slice(1,-1):c,u=n.join(l,t),p=!l&&/^\.[\\\/]/.test(t)?t.slice(0,2)+u:u;o(subStep(p,e,0))})),subStep=(t,e,s)=>new Promise(((n,l)=>{if(s===o.length)return n(step(e+1));const u=o[s];i(t+u,{pathExt:c},((o,i)=>{if(!o&&i){if(!r.all)return n(t+u);a.push(t+u)}return n(subStep(t,e,s+1))}))}));return e?step(0).then((t=>e(null,t)),e):step(0)};t.exports=which,which.sync=(t,r)=>{r=r||{};const{pathEnv:e,pathExt:s,pathExtExe:o}=getPathInfo(t,r),c=[];for(let a=0;a<e.length;a++){const l=e[a],u=/^".*"$/.test(l)?l.slice(1,-1):l,p=n.join(u,t),d=!u&&/^\.[\\\/]/.test(t)?t.slice(0,2)+p:p;for(let t=0;t<s.length;t++){const e=d+s[t];try{if(i.sync(e,{pathExt:o})){if(!r.all)return e;c.push(e)}}catch(t){}}}if(r.all&&c.length)return c;if(r.nothrow)return null;throw getNotFoundError(t)}},34489:(t,r,e)=>{"use strict";const s=e(79896),n=e(50230);t.exports=function readShebang(t){const r=Buffer.alloc(150);let e;try{e=s.openSync(t,"r"),s.readSync(e,r,0,150,0),s.closeSync(e)}catch(t){}return n(r.toString())}},47814:(t,r,e)=>{"use strict";e.r(r),e.d(r,{DEFAULT_INHERITED_ENV_VARS:()=>c,StdioClientTransport:()=>StdioClientTransport,getDefaultEnvironment:()=>getDefaultEnvironment});var s=e(91092),n=e(1708),o=e(57075),i=e(76889);class ReadBuffer{append(t){this._buffer=this._buffer?Buffer.concat([this._buffer,t]):t}readMessage(){if(!this._buffer)return null;const t=this._buffer.indexOf("\n");if(-1===t)return null;const r=this._buffer.toString("utf8",0,t).replace(/\r$/,"");return this._buffer=this._buffer.subarray(t+1),function deserializeMessage(t){return i.JSONRPCMessageSchema.parse(JSON.parse(t))}(r)}clear(){this._buffer=void 0}}const c="win32"===n.platform?["APPDATA","HOMEDRIVE","HOMEPATH","LOCALAPPDATA","PATH","PROCESSOR_ARCHITECTURE","SYSTEMDRIVE","SYSTEMROOT","TEMP","USERNAME","USERPROFILE","PROGRAMFILES"]:["HOME","LOGNAME","PATH","SHELL","TERM","USER"];function getDefaultEnvironment(){const t={};for(const r of c){const e=n.env[r];void 0!==e&&(e.startsWith("()")||(t[r]=e))}return t}class StdioClientTransport{constructor(t){this._abortController=new AbortController,this._readBuffer=new ReadBuffer,this._stderrStream=null,this._serverParams=t,"pipe"!==t.stderr&&"overlapped"!==t.stderr||(this._stderrStream=new o.PassThrough)}async start(){if(this._process)throw new Error("StdioClientTransport already started! If using Client class, note that connect() calls start() automatically.");return new Promise(((t,r)=>{var e,o,i,c,a;this._process=s(this._serverParams.command,null!==(e=this._serverParams.args)&&void 0!==e?e:[],{env:{...getDefaultEnvironment(),...this._serverParams.env},stdio:["pipe","pipe",null!==(o=this._serverParams.stderr)&&void 0!==o?o:"inherit"],shell:!1,signal:this._abortController.signal,windowsHide:"win32"===n.platform&&"type"in n,cwd:this._serverParams.cwd}),this._process.on("error",(t=>{var e,s;"AbortError"!==t.name?(r(t),null===(s=this.onerror)||void 0===s||s.call(this,t)):null===(e=this.onclose)||void 0===e||e.call(this)})),this._process.on("spawn",(()=>{t()})),this._process.on("close",(t=>{var r;this._process=void 0,null===(r=this.onclose)||void 0===r||r.call(this)})),null===(i=this._process.stdin)||void 0===i||i.on("error",(t=>{var r;null===(r=this.onerror)||void 0===r||r.call(this,t)})),null===(c=this._process.stdout)||void 0===c||c.on("data",(t=>{this._readBuffer.append(t),this.processReadBuffer()})),null===(a=this._process.stdout)||void 0===a||a.on("error",(t=>{var r;null===(r=this.onerror)||void 0===r||r.call(this,t)})),this._stderrStream&&this._process.stderr&&this._process.stderr.pipe(this._stderrStream)}))}get stderr(){var t,r;return this._stderrStream?this._stderrStream:null!==(r=null===(t=this._process)||void 0===t?void 0:t.stderr)&&void 0!==r?r:null}get pid(){var t,r;return null!==(r=null===(t=this._process)||void 0===t?void 0:t.pid)&&void 0!==r?r:null}processReadBuffer(){for(var t,r;;)try{const r=this._readBuffer.readMessage();if(null===r)break;null===(t=this.onmessage)||void 0===t||t.call(this,r)}catch(t){null===(r=this.onerror)||void 0===r||r.call(this,t)}}async close(){this._abortController.abort(),this._process=void 0,this._readBuffer.clear()}send(t){return new Promise((r=>{var e;if(!(null===(e=this._process)||void 0===e?void 0:e.stdin))throw new Error("Not connected");const s=function serializeMessage(t){return JSON.stringify(t)+"\n"}(t);this._process.stdin.write(s)?r():this._process.stdin.once("drain",r)}))}}},50078:t=>{"use strict";const r=/([()\][%!^"`<>&|;, *?])/g;t.exports.command=function escapeCommand(t){return t=t.replace(r,"^$1")},t.exports.argument=function escapeArgument(t,e){return t=(t=`"${t=(t=(t=`${t}`).replace(/(?=(\\+?)?)\1"/g,'$1$1\\"')).replace(/(?=(\\+?)?)\1$/,"$1$1")}"`).replace(r,"^$1"),e&&(t=t.replace(r,"^$1")),t}},50230:(t,r,e)=>{"use strict";const s=e(85672);t.exports=(t="")=>{const r=t.match(s);if(!r)return null;const[e,n]=r[0].replace(/#! ?/,"").split(" "),o=e.split("/").pop();return"env"===o?n:n?`${o} ${n}`:o}},54080:(t,r,e)=>{"use strict";const s=e(16928),n=e(24326),o=e(58139);function resolveCommandAttempt(t,r){const e=t.options.env||process.env,i=process.cwd(),c=null!=t.options.cwd,a=c&&void 0!==process.chdir&&!process.chdir.disabled;if(a)try{process.chdir(t.options.cwd)}catch(t){}let l;try{l=n.sync(t.command,{path:e[o({env:e})],pathExt:r?s.delimiter:void 0})}catch(t){}finally{a&&process.chdir(i)}return l&&(l=s.resolve(c?t.options.cwd:"",l)),l}t.exports=function resolveCommand(t){return resolveCommandAttempt(t)||resolveCommandAttempt(t,!0)}},58139:t=>{"use strict";const pathKey=(t={})=>{const r=t.env||process.env;return"win32"!==(t.platform||process.platform)?"PATH":Object.keys(r).reverse().find((t=>"PATH"===t.toUpperCase()))||"Path"};t.exports=pathKey,t.exports.default=pathKey},66095:(t,r,e)=>{t.exports=isexe,isexe.sync=function sync(t,r){return checkStat(s.statSync(t),t,r)};var s=e(79896);function checkStat(t,r,e){return!(!t.isSymbolicLink()&&!t.isFile())&&function checkPathExt(t,r){var e=void 0!==r.pathExt?r.pathExt:process.env.PATHEXT;if(!e)return!0;if(-1!==(e=e.split(";")).indexOf(""))return!0;for(var s=0;s<e.length;s++){var n=e[s].toLowerCase();if(n&&t.substr(-n.length).toLowerCase()===n)return!0}return!1}(r,e)}function isexe(t,r,e){s.stat(t,(function(s,n){e(s,!s&&checkStat(n,t,r))}))}},79882:(t,r,e)=>{var s;e(79896);function isexe(t,r,e){if("function"==typeof r&&(e=r,r={}),!e){if("function"!=typeof Promise)throw new TypeError("callback not provided");return new Promise((function(e,s){isexe(t,r||{},(function(t,r){t?s(t):e(r)}))}))}s(t,r||{},(function(t,s){t&&("EACCES"===t.code||r&&r.ignoreErrors)&&(t=null,s=!1),e(t,s)}))}s="win32"===process.platform||global.TESTING_WINDOWS?e(66095):e(14155),t.exports=isexe,isexe.sync=function sync(t,r){try{return s.sync(t,r||{})}catch(t){if(r&&r.ignoreErrors||"EACCES"===t.code)return!1;throw t}}},85672:t=>{"use strict";t.exports=/^#!(.*)/},90995:t=>{"use strict";const r="win32"===process.platform;function notFoundError(t,r){return Object.assign(new Error(`${r} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${r} ${t.command}`,path:t.command,spawnargs:t.args})}function verifyENOENT(t,e){return r&&1===t&&!e.file?notFoundError(e.original,"spawn"):null}t.exports={hookChildProcess:function hookChildProcess(t,e){if(!r)return;const s=t.emit;t.emit=function(r,n){if("exit"===r){const r=verifyENOENT(n,e);if(r)return s.call(t,"error",r)}return s.apply(t,arguments)}},verifyENOENT,verifyENOENTSync:function verifyENOENTSync(t,e){return r&&1===t&&!e.file?notFoundError(e.original,"spawnSync"):null},notFoundError}},91092:(t,r,e)=>{"use strict";const s=e(35317),n=e(8147),o=e(90995);function spawn(t,r,e){const i=n(t,r,e),c=s.spawn(i.command,i.args,i.options);return o.hookChildProcess(c,i),c}t.exports=spawn,t.exports.spawn=spawn,t.exports.sync=function spawnSync(t,r,e){const i=n(t,r,e),c=s.spawnSync(i.command,i.args,i.options);return c.error=c.error||o.verifyENOENTSync(c.status,i),c},t.exports._parse=n,t.exports._enoent=o}};
1
+ "use strict";exports.id=814,exports.ids=[814],exports.modules={47814:(r,s,e)=>{e.r(s),e.d(s,{DEFAULT_INHERITED_ENV_VARS:()=>a,StdioClientTransport:()=>StdioClientTransport,getDefaultEnvironment:()=>getDefaultEnvironment});var t=e(91092),i=e(1708),o=e(57075),n=e(76889);class ReadBuffer{append(r){this._buffer=this._buffer?Buffer.concat([this._buffer,r]):r}readMessage(){if(!this._buffer)return null;const r=this._buffer.indexOf("\n");if(-1===r)return null;const s=this._buffer.toString("utf8",0,r).replace(/\r$/,"");return this._buffer=this._buffer.subarray(r+1),function deserializeMessage(r){return n.JSONRPCMessageSchema.parse(JSON.parse(r))}(s)}clear(){this._buffer=void 0}}const a="win32"===i.platform?["APPDATA","HOMEDRIVE","HOMEPATH","LOCALAPPDATA","PATH","PROCESSOR_ARCHITECTURE","SYSTEMDRIVE","SYSTEMROOT","TEMP","USERNAME","USERPROFILE","PROGRAMFILES"]:["HOME","LOGNAME","PATH","SHELL","TERM","USER"];function getDefaultEnvironment(){const r={};for(const s of a){const e=i.env[s];void 0!==e&&(e.startsWith("()")||(r[s]=e))}return r}class StdioClientTransport{constructor(r){this._abortController=new AbortController,this._readBuffer=new ReadBuffer,this._stderrStream=null,this._serverParams=r,"pipe"!==r.stderr&&"overlapped"!==r.stderr||(this._stderrStream=new o.PassThrough)}async start(){if(this._process)throw new Error("StdioClientTransport already started! If using Client class, note that connect() calls start() automatically.");return new Promise(((r,s)=>{var e,o,n,a,l;this._process=t(this._serverParams.command,null!==(e=this._serverParams.args)&&void 0!==e?e:[],{env:{...getDefaultEnvironment(),...this._serverParams.env},stdio:["pipe","pipe",null!==(o=this._serverParams.stderr)&&void 0!==o?o:"inherit"],shell:!1,signal:this._abortController.signal,windowsHide:"win32"===i.platform&&"type"in i,cwd:this._serverParams.cwd}),this._process.on("error",(r=>{var e,t;"AbortError"!==r.name?(s(r),null===(t=this.onerror)||void 0===t||t.call(this,r)):null===(e=this.onclose)||void 0===e||e.call(this)})),this._process.on("spawn",(()=>{r()})),this._process.on("close",(r=>{var s;this._process=void 0,null===(s=this.onclose)||void 0===s||s.call(this)})),null===(n=this._process.stdin)||void 0===n||n.on("error",(r=>{var s;null===(s=this.onerror)||void 0===s||s.call(this,r)})),null===(a=this._process.stdout)||void 0===a||a.on("data",(r=>{this._readBuffer.append(r),this.processReadBuffer()})),null===(l=this._process.stdout)||void 0===l||l.on("error",(r=>{var s;null===(s=this.onerror)||void 0===s||s.call(this,r)})),this._stderrStream&&this._process.stderr&&this._process.stderr.pipe(this._stderrStream)}))}get stderr(){var r,s;return this._stderrStream?this._stderrStream:null!==(s=null===(r=this._process)||void 0===r?void 0:r.stderr)&&void 0!==s?s:null}get pid(){var r,s;return null!==(s=null===(r=this._process)||void 0===r?void 0:r.pid)&&void 0!==s?s:null}processReadBuffer(){for(var r,s;;)try{const s=this._readBuffer.readMessage();if(null===s)break;null===(r=this.onmessage)||void 0===r||r.call(this,s)}catch(r){null===(s=this.onerror)||void 0===s||s.call(this,r)}}async close(){this._abortController.abort(),this._process=void 0,this._readBuffer.clear()}send(r){return new Promise((s=>{var e;if(!(null===(e=this._process)||void 0===e?void 0:e.stdin))throw new Error("Not connected");const t=function serializeMessage(r){return JSON.stringify(r)+"\n"}(r);this._process.stdin.write(t)?s():this._process.stdin.once("drain",s)}))}}}};