@tencent-ai/codebuddy-code 1.0.2 → 1.0.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.
@@ -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(80699),a=n(80932),o=n(14083),c=n(96540),i=n(66814),s=n(79413),u=n(30481),E=n(82101),m=n(34209),d=n(53829),g=n(49034),b=n(47693),h=n(83175),y=n(42790),p=e([o,E,d,g,y]);[o,E,d,g,y]=p.then?(await p)():p;const LoginView=()=>{const e=(0,i.i7)(d.Gb,(e=>e.staticKey));return c.createElement(c.Fragment,null,c.createElement(o.jC,{key:`login-view-${e}`,items:[c.createElement(LogoBox,{key:"logo-box"}),c.createElement(NewVersionBox,{key:"new-version-box"})]},(e=>e)),c.createElement(LoginBox,null))},LogoBox=()=>{const e=`Welcome to ${m.KR}`,t=e.length+8;return c.createElement(c.Fragment,null,c.createElement(o.az,{marginBottom:1,paddingLeft:1,borderStyle:"round",borderColor:h.Q.brand,width:t},c.createElement(o.EY,{color:h.Q.brand},"✻ ",e)),c.createElement(y.H,null))},NewVersionBox=()=>{const e="cyan",t=u.CW.getCurrentPackageJson(),n=t.version.includes("beta"),r=t.version.includes("alpha"),l=n?"@beta":r?"@alpha":"";return c.createElement(o.az,{paddingX:1,flexDirection:"column",borderStyle:"round",borderColor:e},c.createElement(o.EY,{color:e},"New Version Updated v",t.version," Release! Please visit ",m.KR," website to read changelog."),c.createElement(o.EY,{color:e},"Run npm install -g ",m.JP,l))},C={iOA:"iOA",WeChat:"internal","Google / Github":"external"},LoginBox=()=>{const{authSession:e,navigate:t}=(0,i.i7)(d.aO,(e=>({authSession:e.authSession,navigate:e.navigate}))),[n,r]=(0,c.useState)("idle"),[m,y]=(0,c.useState)(""),[p,f]=(0,c.useState)(""),[w,G]=(0,c.useState)("iOA"),[S,Y]=(0,c.useState)(!1),A=(0,c.useRef)(new AbortController);(0,c.useEffect)((()=>{const e=(0,b.bi)().urlSubject.subscribe(y);return()=>e.unsubscribe()}),[]),(0,c.useEffect)((()=>{m&&u.E.copyToClipboard(m)}),[m]),(0,c.useEffect)((()=>{(async()=>{try{const e=l.ContainerUtil.get(s.Oc),t=await e.isIntranet();Y(t),t||"iOA"!==w||G("Google / Github")}catch(e){Y(!1),"iOA"===w&&G("Google / Github")}})()}),[w]),(0,o.Ge)(((l,a)=>{if("idle"===n){if(g.Om.RETURN(a))try{r("loading"),f(""),(0,b.Yf)().login({type:C[w],abortController:A.current})}catch(e){r("error"),f(e instanceof Error?e.message:"Unknown error occurred")}else if(a.upArrow||a.downArrow){const e=S?["iOA","Google / Github","WeChat"]:["Google / Github","WeChat"],t=e.indexOf(w);let n;n=a.upArrow?t<=0?e.length-1:t-1:t>=e.length-1?0:t+1,G(e[n])}}else g.Om.ESCAPE(a)&&("loading"===n?(A.current.abort(),r("idle")):e&&t("/chat"))}));const v=S?["iOA","Google / Github","WeChat"]:["Google / Github","WeChat"];return c.createElement(o.az,{paddingX:1,flexDirection:"column",gap:1,borderStyle:"round",borderColor:"grey"},"idle"===n?c.createElement(c.Fragment,null,c.createElement(o.az,null,c.createElement(o.EY,null,"Select login method:")),v.map((e=>c.createElement(o.az,{key:e},c.createElement(o.EY,{color:w===e?"green":"grey"},w===e?a.Ay.bullet:" "," Login with ",e)))),c.createElement(o.az,{justifyContent:"space-between"},c.createElement(o.EY,{color:"grey"},"(Use ↑↓ to select, Enter to login)"))):"loading"===n?c.createElement(o.az,{paddingY:1,gap:1,flexDirection:"column"},c.createElement(o.az,null,c.createElement(o.EY,{color:"grey"},"Browser didn't open? Use the url below to sign in: (Copied link to clipboard)")),m&&c.createElement(o.az,null,c.createElement(o.EY,{color:"grey"},m)),c.createElement(o.az,{marginTop:1,gap:1},c.createElement(o.EY,{color:h.Q.brand},c.createElement(E.y$,{type:"star"})),c.createElement(o.EY,null,"Waiting for auth... (Press ESC to cancel)"))):"error"===n?c.createElement(c.Fragment,null,c.createElement(o.EY,{color:"red"},"Failed to login."),p&&c.createElement(o.EY,{color:"red"},"Message: ",p)):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(66814),i=n(53829),s=n(83175),u=e([a,i]);[a,i]=u.then?(await u)():u;const LogoText=()=>{const e=(0,c.i7)(i.Gb,(e=>e.terminalWidth)),t=(0,o.useRef)((0,l.Ay)(s.Q.GradientColors)),n=(0,o.useCallback)((e=>t.current.multiline(e)),[t]),r=(0,o.useCallback)((()=>e>115?"\n ██████╗ ██████╗ ██████╗ ███████╗██████╗ ██╗ ██╗██████╗ ██████╗ ██╗ ██╗ ██████╗ ██████╗ ██████╗ ███████╗\n██╔════╝██╔═══██╗██╔══██╗██╔════╝██╔══██╗██║ ██║██╔══██╗██╔══██╗╚██╗ ██╔╝ ██╔════╝██╔═══██╗██╔══██╗██╔════╝\n██║ ██║ ██║██║ ██║█████╗ ██████╔╝██║ ██║██║ ██║██║ ██║ ╚████╔╝ ██║ ██║ ██║██║ ██║█████╗ \n██║ ██║ ██║██║ ██║██╔══╝ ██╔══██╗██║ ██║██║ ██║██║ ██║ ╚██╔╝ ██║ ██║ ██║██║ ██║██╔══╝ \n╚██████╗╚██████╔╝██████╔╝███████╗██████╔╝╚██████╔╝██████╔╝██████╔╝ ██║ ╚██████╗╚██████╔╝██████╔╝███████╗\n ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝╚═════╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝\n \n\n . * . * . *\n /\\_/\\ \n ( o.o ) * . * \n > ^ < . \n":" \n ██████╗ ██████╗ ██████╗ ███████╗██████╗ ██╗ ██╗██████╗ ██████╗ ██╗ ██╗\n██╔════╝██╔═══██╗██╔══██╗██╔════╝██╔══██╗██║ ██║██╔══██╗██╔══██╗╚██╗ ██╔╝\n██║ ██║ ██║██║ ██║█████╗ ██████╔╝██║ ██║██║ ██║██║ ██║ ╚████╔╝ \n██║ ██║ ██║██║ ██║██╔══╝ ██╔══██╗██║ ██║██║ ██║██║ ██║ ╚██╔╝ \n╚██████╗╚██████╔╝██████╔╝███████╗██████╔╝╚██████╔╝██████╔╝██████╔╝ ██║ \n ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝╚═════╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚═╝ \n \n ██████╗ ██████╗ ██████╗ ███████╗ \n██╔════╝██╔═══██╗██╔══██╗██╔════╝ \n██║ ██║ ██║██║ ██║█████╗ \n██║ ██║ ██║██║ ██║██╔══╝ \n╚██████╗╚██████╔╝██████╔╝███████╗ \n ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝ \n "),[e]);return o.createElement(a.dL,{transform:n},o.createElement(a.EY,null,r()))};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(80699),a=n(80932),o=n(14083),c=n(96540),i=n(66814),s=n(79413),u=n(30481),E=n(82101),m=n(34209),g=n(53829),d=n(49034),b=n(47693),h=n(83175),y=n(42790),p=e([o,E,g,d,y]);[o,E,g,d,y]=p.then?(await p)():p;const LoginView=()=>{const e=(0,i.i7)(g.Gb,(e=>e.staticKey));return c.createElement(c.Fragment,null,c.createElement(o.jC,{key:`login-view-${e}`,items:[c.createElement(LogoBox,{key:"logo-box"})]},(e=>e)),c.createElement(LoginBox,null))},LogoBox=()=>{const e=`Welcome to ${m.KR}`,t=e.length+8;return c.createElement(c.Fragment,null,c.createElement(o.az,{marginBottom:1,paddingLeft:1,borderStyle:"round",borderColor:h.Q.brand,width:t},c.createElement(o.EY,{color:h.Q.brand},"✻ ",e)),c.createElement(y.H,null))},f={iOA:"iOA",WeChat:"internal","Google / Github":"external"},LoginBox=()=>{const{authSession:e,navigate:t}=(0,i.i7)(g.aO,(e=>({authSession:e.authSession,navigate:e.navigate}))),[n,r]=(0,c.useState)("idle"),[m,y]=(0,c.useState)(""),[p,C]=(0,c.useState)(""),[G,w]=(0,c.useState)("iOA"),[A,S]=(0,c.useState)(!1),Y=(0,c.useRef)(new AbortController);(0,c.useEffect)((()=>{const e=(0,b.bi)().urlSubject.subscribe(y);return()=>e.unsubscribe()}),[]),(0,c.useEffect)((()=>{m&&u.E.copyToClipboard(m)}),[m]),(0,c.useEffect)((()=>{(async()=>{try{const e=l.ContainerUtil.get(s.Oc),t=await e.isIntranet();S(t),t||"iOA"!==G||w("Google / Github")}catch(e){S(!1),"iOA"===G&&w("Google / Github")}})()}),[G]),(0,o.Ge)(((l,a)=>{if("idle"===n){if(d.Om.RETURN(a))try{r("loading"),C(""),(0,b.Yf)().login({type:f[G],abortController:Y.current})}catch(e){r("error"),C(e instanceof Error?e.message:"Unknown error occurred")}else if(a.upArrow||a.downArrow){const e=A?["iOA","Google / Github","WeChat"]:["Google / Github","WeChat"],t=e.indexOf(G);let n;n=a.upArrow?t<=0?e.length-1:t-1:t>=e.length-1?0:t+1,w(e[n])}}else d.Om.ESCAPE(a)&&("loading"===n?(Y.current.abort(),r("idle")):e&&t("/chat"))}));const O=A?["iOA","Google / Github","WeChat"]:["Google / Github","WeChat"];return c.createElement(o.az,{paddingX:1,flexDirection:"column",gap:1,borderStyle:"round",borderColor:"grey"},"idle"===n?c.createElement(c.Fragment,null,c.createElement(o.az,null,c.createElement(o.EY,null,"Select login method:")),O.map((e=>c.createElement(o.az,{key:e},c.createElement(o.EY,{color:G===e?"green":"grey"},G===e?a.Ay.bullet:" "," Login with ",e)))),c.createElement(o.az,{justifyContent:"space-between"},c.createElement(o.EY,{color:"grey"},"(Use ↑↓ to select, Enter to login)"))):"loading"===n?c.createElement(o.az,{paddingY:1,gap:1,flexDirection:"column"},c.createElement(o.az,null,c.createElement(o.EY,{color:"grey"},"Browser didn't open? Use the url below to sign in: (Copied link to clipboard)")),m&&c.createElement(o.az,null,c.createElement(o.EY,{color:"grey"},m)),c.createElement(o.az,{marginTop:1,gap:1},c.createElement(o.EY,{color:h.Q.brand},c.createElement(E.y$,{type:"star"})),c.createElement(o.EY,null,"Waiting for auth... (Press ESC to cancel)"))):"error"===n?c.createElement(c.Fragment,null,c.createElement(o.EY,{color:"red"},"Failed to login."),p&&c.createElement(o.EY,{color:"red"},"Message: ",p)):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(66814),i=n(53829),s=n(83175),u=e([a,i]);[a,i]=u.then?(await u)():u;const LogoText=()=>{const e=(0,c.i7)(i.Gb,(e=>e.terminalWidth)),t=(0,o.useRef)((0,l.Ay)(s.Q.GradientColors)),n=(0,o.useCallback)((e=>t.current.multiline(e)),[t]),r=(0,o.useCallback)((()=>e>115?"\n ██████╗ ██████╗ ██████╗ ███████╗██████╗ ██╗ ██╗██████╗ ██████╗ ██╗ ██╗ ██████╗ ██████╗ ██████╗ ███████╗\n██╔════╝██╔═══██╗██╔══██╗██╔════╝██╔══██╗██║ ██║██╔══██╗██╔══██╗╚██╗ ██╔╝ ██╔════╝██╔═══██╗██╔══██╗██╔════╝\n██║ ██║ ██║██║ ██║█████╗ ██████╔╝██║ ██║██║ ██║██║ ██║ ╚████╔╝ ██║ ██║ ██║██║ ██║█████╗ \n██║ ██║ ██║██║ ██║██╔══╝ ██╔══██╗██║ ██║██║ ██║██║ ██║ ╚██╔╝ ██║ ██║ ██║██║ ██║██╔══╝ \n╚██████╗╚██████╔╝██████╔╝███████╗██████╔╝╚██████╔╝██████╔╝██████╔╝ ██║ ╚██████╗╚██████╔╝██████╔╝███████╗\n ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝╚═════╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝\n \n\n . * . * . *\n /\\_/\\ \n ( o.o ) * . * \n > ^ < . \n":" \n ██████╗ ██████╗ ██████╗ ███████╗██████╗ ██╗ ██╗██████╗ ██████╗ ██╗ ██╗\n██╔════╝██╔═══██╗██╔══██╗██╔════╝██╔══██╗██║ ██║██╔══██╗██╔══██╗╚██╗ ██╔╝\n██║ ██║ ██║██║ ██║█████╗ ██████╔╝██║ ██║██║ ██║██║ ██║ ╚████╔╝ \n██║ ██║ ██║██║ ██║██╔══╝ ██╔══██╗██║ ██║██║ ██║██║ ██║ ╚██╔╝ \n╚██████╗╚██████╔╝██████╔╝███████╗██████╔╝╚██████╔╝██████╔╝██████╔╝ ██║ \n ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝╚═════╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚═╝ \n \n ██████╗ ██████╗ ██████╗ ███████╗ \n██╔════╝██╔═══██╗██╔══██╗██╔════╝ \n██║ ██║ ██║██║ ██║█████╗ \n██║ ██║ ██║██║ ██║██╔══╝ \n╚██████╗╚██████╔╝██████╔╝███████╗ \n ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝ \n "),[e]);return o.createElement(a.dL,{transform:n},o.createElement(a.EY,null,r()))};r()}catch(e){r(e)}}))}};