@@ -240,8 +240,9 @@ export class ClineProvider
240240
241241 // Create named listener functions so we can remove them later.
242242 const onTaskStarted = ( ) => this . emit ( RooCodeEventName . TaskStarted , instance . taskId )
243- const onTaskCompleted = ( taskId : string , tokenUsage : TokenUsage , toolUsage : ToolUsage ) =>
243+ const onTaskCompleted = ( taskId : string , tokenUsage : TokenUsage , toolUsage : ToolUsage ) => {
244244 this . emit ( RooCodeEventName . TaskCompleted , taskId , tokenUsage , toolUsage )
245+ }
245246 const onTaskAborted = async ( ) => {
246247 this . emit ( RooCodeEventName . TaskAborted , instance . taskId )
247248
@@ -1681,6 +1682,15 @@ export class ClineProvider
16811682 await this . upsertProviderProfile ( currentApiConfigName , newConfiguration )
16821683 }
16831684
1685+ // Zoo Code Auth (for observability telemetry)
1686+
1687+ async handleZooCodeCallback ( token : string ) {
1688+ const { handleAuthCallback } = await import ( "../../services/zoo-code-auth" )
1689+ await handleAuthCallback ( token )
1690+ // Refresh webview state to show updated auth status
1691+ await this . postStateToWebview ( )
1692+ }
1693+
16841694 // Requesty
16851695
16861696 async handleRequestyCallback ( code : string , baseUrl : string | null ) {
@@ -2279,6 +2289,31 @@ export class ClineProvider
22792289 return false
22802290 }
22812291 } ) ( ) ,
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 } = require ( "../../services/zoo-code-auth" )
2303+ const userInfo = getCachedZooCodeUserInfo ( )
2304+ return {
2305+ zooCodeUserName : userInfo . name ,
2306+ zooCodeUserEmail : userInfo . email ,
2307+ zooCodeUserImage : userInfo . image ,
2308+ }
2309+ } catch {
2310+ return {
2311+ zooCodeUserName : undefined ,
2312+ zooCodeUserEmail : undefined ,
2313+ zooCodeUserImage : undefined ,
2314+ }
2315+ }
2316+ } ) ( ) ,
22822317 debug : vscode . workspace . getConfiguration ( Package . name ) . get < boolean > ( "debug" , false ) ,
22832318 }
22842319 }
0 commit comments