@@ -85,7 +85,10 @@ export class DeepCodeReasonerV2 {
85
85
entryPoint : CodeLocation ,
86
86
maxDepth : number = 10 ,
87
87
_includeDataFlow : boolean = true ,
88
- ) : Promise < any > {
88
+ ) : Promise < {
89
+ analysis : string ;
90
+ filesAnalyzed : string [ ] ;
91
+ } > {
89
92
// Get code context around entry point
90
93
const _context = await this . codeReader . readCodeContext ( entryPoint , 100 ) ;
91
94
@@ -117,7 +120,11 @@ export class DeepCodeReasonerV2 {
117
120
async analyzeCrossSystemImpact (
118
121
changeScope : string [ ] ,
119
122
impactTypes ?: string [ ] ,
120
- ) : Promise < any > {
123
+ ) : Promise < {
124
+ analysis : string ;
125
+ filesAnalyzed : string [ ] ;
126
+ impactTypes : string [ ] ;
127
+ } > {
121
128
const codeFiles = new Map < string , string > ( ) ;
122
129
123
130
// Read all files in change scope
@@ -154,7 +161,10 @@ export class DeepCodeReasonerV2 {
154
161
entryPoint : CodeLocation ,
155
162
profileDepth : number = 3 ,
156
163
suspectedIssues ?: string [ ] ,
157
- ) : Promise < any > {
164
+ ) : Promise < {
165
+ analysis : string ;
166
+ filesAnalyzed : string [ ] ;
167
+ } > {
158
168
const codeFiles = new Map < string , string > ( ) ;
159
169
160
170
// Read entry point and related files
@@ -190,7 +200,12 @@ export class DeepCodeReasonerV2 {
190
200
hypothesis : string ,
191
201
codeScope : string [ ] ,
192
202
testApproach : string ,
193
- ) : Promise < any > {
203
+ ) : Promise < {
204
+ hypothesis : string ;
205
+ testApproach : string ;
206
+ analysis : string ;
207
+ filesAnalyzed : string [ ] ;
208
+ } > {
194
209
const codeFiles = new Map < string , string > ( ) ;
195
210
196
211
// Read all files in scope
@@ -353,25 +368,25 @@ export class DeepCodeReasonerV2 {
353
368
try {
354
369
// Create session
355
370
const sessionId = this . conversationManager . createSession ( context ) ;
356
-
371
+
357
372
// Read relevant code files
358
373
const codeFiles = await this . codeReader . readCodeFiles ( context . focusArea ) ;
359
-
374
+
360
375
// Start Gemini conversation
361
376
const { response, suggestedFollowUps } = await this . conversationalGemini . startConversation (
362
377
sessionId ,
363
378
context ,
364
379
analysisType ,
365
380
codeFiles ,
366
- initialQuestion
381
+ initialQuestion ,
367
382
) ;
368
-
383
+
369
384
// Track conversation turn
370
385
this . conversationManager . addTurn ( sessionId , 'gemini' , response , {
371
386
analysisType,
372
387
questions : suggestedFollowUps ,
373
388
} ) ;
374
-
389
+
375
390
return {
376
391
sessionId,
377
392
initialResponse : response ,
@@ -406,25 +421,25 @@ export class DeepCodeReasonerV2 {
406
421
if ( ! session ) {
407
422
throw new SessionNotFoundError ( sessionId ) ;
408
423
}
409
-
424
+
410
425
// Add Claude's message to conversation history
411
426
this . conversationManager . addTurn ( sessionId , 'claude' , message ) ;
412
-
427
+
413
428
// Continue with Gemini
414
429
const { response, analysisProgress, canFinalize } = await this . conversationalGemini . continueConversation (
415
430
sessionId ,
416
431
message ,
417
- includeCodeSnippets
432
+ includeCodeSnippets ,
418
433
) ;
419
-
434
+
420
435
// Track Gemini's response
421
436
this . conversationManager . addTurn ( sessionId , 'gemini' , response ) ;
422
-
437
+
423
438
// Update progress
424
439
this . conversationManager . updateProgress ( sessionId , {
425
440
confidenceLevel : analysisProgress ,
426
441
} ) ;
427
-
442
+
428
443
return {
429
444
response,
430
445
analysisProgress,
@@ -456,16 +471,16 @@ export class DeepCodeReasonerV2 {
456
471
if ( ! session ) {
457
472
throw new SessionNotFoundError ( sessionId ) ;
458
473
}
459
-
474
+
460
475
// Get final analysis from Gemini
461
476
const result = await this . conversationalGemini . finalizeConversation (
462
477
sessionId ,
463
- summaryFormat || 'detailed'
478
+ summaryFormat || 'detailed' ,
464
479
) ;
465
-
480
+
466
481
// Extract additional insights from conversation manager
467
482
const conversationResults = this . conversationManager . extractResults ( sessionId ) ;
468
-
483
+
469
484
// Merge results
470
485
return {
471
486
...result ,
@@ -504,9 +519,9 @@ export class DeepCodeReasonerV2 {
504
519
canFinalize : false ,
505
520
} ;
506
521
}
507
-
522
+
508
523
const canFinalize = this . conversationManager . shouldComplete ( sessionId ) ;
509
-
524
+
510
525
return {
511
526
sessionId,
512
527
status : session . status ,
0 commit comments