@@ -2166,6 +2166,35 @@ export class ClineProvider
21662166 const mergedDeniedCommands = this . mergeDeniedCommands ( deniedCommands )
21672167 const cwd = this . cwd
21682168 const currentTask = this . getCurrentTask ( )
2169+ let zooCodeState : {
2170+ zooCodeIsAuthenticated : boolean
2171+ zooCodeUserName : string | undefined
2172+ zooCodeUserEmail : string | undefined
2173+ zooCodeUserImage : string | undefined
2174+ zooCodeBaseUrl : string
2175+ } = {
2176+ zooCodeIsAuthenticated : false ,
2177+ zooCodeUserName : undefined ,
2178+ zooCodeUserEmail : undefined ,
2179+ zooCodeUserImage : undefined ,
2180+ zooCodeBaseUrl : "https://www.zoocode.dev" ,
2181+ }
2182+
2183+ try {
2184+ const { isZooCodeAuthenticated, getCachedZooCodeUserInfo, getZooCodeBaseUrl } = await import (
2185+ "../../services/zoo-code-auth"
2186+ )
2187+ const userInfo = getCachedZooCodeUserInfo ( )
2188+ zooCodeState = {
2189+ zooCodeIsAuthenticated : await isZooCodeAuthenticated ( ) ,
2190+ zooCodeUserName : userInfo ?. name ,
2191+ zooCodeUserEmail : userInfo ?. email ,
2192+ zooCodeUserImage : userInfo ?. image ,
2193+ zooCodeBaseUrl : getZooCodeBaseUrl ( ) ,
2194+ }
2195+ } catch {
2196+ // Keep unauthenticated defaults if the optional auth service is unavailable.
2197+ }
21692198
21702199 return {
21712200 version : this . context . extension ?. packageJSON ?. version ?? "" ,
@@ -2289,33 +2318,7 @@ export class ClineProvider
22892318 return false
22902319 }
22912320 } ) ( ) ,
2292- zooCodeIsAuthenticated : await ( async ( ) => {
2293- try {
2294- const { isZooCodeAuthenticated } = await import ( "../../services/zoo-code-auth" )
2295- return await isZooCodeAuthenticated ( )
2296- } catch {
2297- return false
2298- }
2299- } ) ( ) ,
2300- ...( ( ) => {
2301- try {
2302- const { getCachedZooCodeUserInfo, getZooCodeBaseUrl } = require ( "../../services/zoo-code-auth" )
2303- const userInfo = getCachedZooCodeUserInfo ( )
2304- return {
2305- zooCodeUserName : userInfo . name ,
2306- zooCodeUserEmail : userInfo . email ,
2307- zooCodeUserImage : userInfo . image ,
2308- zooCodeBaseUrl : getZooCodeBaseUrl ( ) ,
2309- }
2310- } catch {
2311- return {
2312- zooCodeUserName : undefined ,
2313- zooCodeUserEmail : undefined ,
2314- zooCodeUserImage : undefined ,
2315- zooCodeBaseUrl : "https://www.zoocode.dev" ,
2316- }
2317- }
2318- } ) ( ) ,
2321+ ...zooCodeState ,
23192322 debug : vscode . workspace . getConfiguration ( Package . name ) . get < boolean > ( "debug" , false ) ,
23202323 }
23212324 }
0 commit comments