@juspay/yama 1.2.0 โ†’ 1.4.0

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/CHANGELOG.md CHANGED
@@ -1,31 +1,39 @@
1
- # [1.2.0](https://github.com/juspay/yama/compare/v1.1.1...v1.2.0) (2025-08-08)
1
+ # [1.4.0](https://github.com/juspay/yama/compare/v1.3.0...v1.4.0) (2025-09-18)
2
+
3
+ ### Features
2
4
 
5
+ - **Multi-Instance:** Added support for Multi-Instance Processing and Deduplication ([2724758](https://github.com/juspay/yama/commit/27247587f44740b26218f23694ebdcde4c323266))
6
+
7
+ # [1.3.0](https://github.com/juspay/yama/compare/v1.2.0...v1.3.0) (2025-09-01)
3
8
 
4
9
  ### Features
5
10
 
6
- * **Memory:** support memory bank path and maxToken from config file ([1bc69d5](https://github.com/juspay/yama/commit/1bc69d5bda3ac5868d7537b881007beaf6916476))
11
+ - **github:** implement comprehensive automation with proper Yama branding ([a03cb7f](https://github.com/juspay/yama/commit/a03cb7f499ea7793d626686beebde907551035d0))
7
12
 
8
- ## [1.1.1](https://github.com/juspay/yama/compare/v1.1.0...v1.1.1) (2025-07-28)
13
+ # [1.2.0](https://github.com/juspay/yama/compare/v1.1.1...v1.2.0) (2025-08-08)
9
14
 
15
+ ### Features
16
+
17
+ - **Memory:** support memory bank path and maxToken from config file ([1bc69d5](https://github.com/juspay/yama/commit/1bc69d5bda3ac5868d7537b881007beaf6916476))
18
+
19
+ ## [1.1.1](https://github.com/juspay/yama/compare/v1.1.0...v1.1.1) (2025-07-28)
10
20
 
11
21
  ### Bug Fixes
12
22
 
13
- * bump version to 1.2.1 ([8964645](https://github.com/juspay/yama/commit/89646450a7dec6ffcc3ad7fb745e1414fc751d4f))
23
+ - bump version to 1.2.1 ([8964645](https://github.com/juspay/yama/commit/89646450a7dec6ffcc3ad7fb745e1414fc751d4f))
14
24
 
15
25
  # [1.1.0](https://github.com/juspay/yama/compare/v1.0.0...v1.1.0) (2025-07-28)
16
26
 
17
-
18
27
  ### Features
19
28
 
20
- * migrate from CommonJS to ESM modules ([b45559f](https://github.com/juspay/yama/commit/b45559f86d37ab3516079becfa56a9f73ff8f062))
29
+ - migrate from CommonJS to ESM modules ([b45559f](https://github.com/juspay/yama/commit/b45559f86d37ab3516079becfa56a9f73ff8f062))
21
30
 
22
31
  # 1.0.0 (2025-07-25)
23
32
 
24
-
25
33
  ### Features
26
34
 
27
- * add enterprise-grade CI/CD pipeline and release automation ([e385d69](https://github.com/juspay/yama/commit/e385d69d135bee72f51ac4462adcfc9a4a4be17b))
28
- * v1.1.0 - Enhanced AI configuration and performance improvements ([e763e93](https://github.com/juspay/yama/commit/e763e9341c2869433097b7a6bcc9080028934e1b))
35
+ - add enterprise-grade CI/CD pipeline and release automation ([e385d69](https://github.com/juspay/yama/commit/e385d69d135bee72f51ac4462adcfc9a4a4be17b))
36
+ - v1.1.0 - Enhanced AI configuration and performance improvements ([e763e93](https://github.com/juspay/yama/commit/e763e9341c2869433097b7a6bcc9080028934e1b))
29
37
 
30
38
  # Changelog
31
39
 
package/README.md CHANGED
@@ -199,6 +199,34 @@ features:
199
199
  - "๐Ÿงช Testing & Error Handling"
200
200
  - "๐Ÿ“– Documentation & Maintainability"
201
201
 
202
+ # Multi-Instance Processing Configuration
203
+ multiInstance:
204
+ enabled: true
205
+ instanceCount: 2
206
+ instances:
207
+ - name: "primary"
208
+ provider: "vertex"
209
+ model: "gemini-2.5-pro"
210
+ temperature: 0.3
211
+ - name: "secondary"
212
+ provider: "vertex"
213
+ model: "gemini-2.5-pro"
214
+ temperature: 0.1
215
+ deduplication:
216
+ enabled: true
217
+ similarityThreshold: 40 # 0-100 percentage scale
218
+ maxCommentsToPost: 30
219
+ prioritizeBy: "severity"
220
+
221
+ # Semantic Deduplication Configuration
222
+ semanticDeduplication:
223
+ enabled: true
224
+ similarityThreshold: 70 # 0-100 percentage scale
225
+ batchSize: 15
226
+ timeout: "5m"
227
+ fallbackOnError: true
228
+ logMatches: true
229
+
202
230
  descriptionEnhancement:
203
231
  enabled: true
204
232
  preserveContent: true # NEVER remove existing content
@@ -477,7 +505,7 @@ await guardian.processPR({
477
505
  });
478
506
  ```
479
507
 
480
- ----
508
+ ---
481
509
 
482
510
  ## ๐Ÿ“‹ **Configurable Description Sections**
483
511
 
@@ -281,7 +281,6 @@ export class Guardian {
281
281
  logger.info("Code review is disabled in configuration");
282
282
  return { skipped: true, reason: "disabled in config" };
283
283
  }
284
- logger.phase("๐Ÿ” Executing code review...");
285
284
  const reviewOptions = {
286
285
  workspace: context.identifier.workspace,
287
286
  repository: context.identifier.repository,
@@ -291,8 +290,12 @@ export class Guardian {
291
290
  excludePatterns: this.config.features.codeReview.excludePatterns,
292
291
  contextLines: this.config.features.codeReview.contextLines,
293
292
  };
294
- // Use the already gathered context instead of gathering again
295
- return await this.codeReviewer.reviewCodeWithContext(context, reviewOptions);
293
+ logger.phase("๐Ÿ” Executing code review...");
294
+ // Check if multi-instance processing is configured
295
+ const multiInstanceConfig = this.config.features?.codeReview
296
+ ?.multiInstance;
297
+ // Use code review with multi-instance support
298
+ return await this.codeReviewer.reviewCodeWithContext(context, reviewOptions, multiInstanceConfig);
296
299
  }
297
300
  /**
298
301
  * Execute description enhancement using shared context
@@ -56,7 +56,7 @@ export declare class BitbucketProvider {
56
56
  message: string;
57
57
  }>;
58
58
  /**
59
- * Add comment to PR with smart positioning
59
+ * Add comment to PR with smart positioning and validation
60
60
  */
61
61
  addComment(identifier: PRIdentifier, commentText: string, options?: {
62
62
  filePath?: string;
@@ -27,7 +27,7 @@ export class BitbucketProvider {
27
27
  }
28
28
  try {
29
29
  logger.debug("Initializing Bitbucket MCP handlers...");
30
- const dynamicImport = eval("(specifier) => import(specifier)");
30
+ const dynamicImport = new Function("specifier", "return import(specifier)");
31
31
  const [{ BitbucketApiClient }, { BranchHandlers }, { PullRequestHandlers }, { ReviewHandlers }, { FileHandlers },] = await Promise.all([
32
32
  dynamicImport("@nexus2520/bitbucket-mcp-server/build/utils/api-client.js"),
33
33
  dynamicImport("@nexus2520/bitbucket-mcp-server/build/handlers/branch-handlers.js"),
@@ -286,7 +286,7 @@ export class BitbucketProvider {
286
286
  }
287
287
  }
288
288
  /**
289
- * Add comment to PR with smart positioning
289
+ * Add comment to PR with smart positioning and validation
290
290
  */
291
291
  async addComment(identifier, commentText, options = {}) {
292
292
  await this.initialize();
@@ -351,6 +351,36 @@ export class BitbucketProvider {
351
351
  }
352
352
  catch (error) {
353
353
  logger.error(`Failed to add comment: ${error.message}`);
354
+ // If inline comment fails, try posting as general comment
355
+ if (options.filePath && options.codeSnippet) {
356
+ logger.debug(`Attempting fallback to general comment...`);
357
+ try {
358
+ const fallbackArgs = {
359
+ workspace,
360
+ repository,
361
+ pull_request_id: pullRequestId,
362
+ comment_text: `**File: ${options.filePath}**\n\n${commentText}`,
363
+ };
364
+ const fallbackResult = await this.pullRequestHandlers.handleAddComment(fallbackArgs);
365
+ let fallbackData;
366
+ if (fallbackResult.content &&
367
+ fallbackResult.content[0] &&
368
+ fallbackResult.content[0].text) {
369
+ fallbackData = JSON.parse(fallbackResult.content[0].text);
370
+ }
371
+ else {
372
+ fallbackData = fallbackResult;
373
+ }
374
+ logger.debug(`Fallback comment posted successfully`);
375
+ return {
376
+ success: true,
377
+ commentId: fallbackData.id || fallbackData.comment_id,
378
+ };
379
+ }
380
+ catch (fallbackError) {
381
+ logger.error(`Fallback comment also failed: ${fallbackError.message}`);
382
+ }
383
+ }
354
384
  throw new ProviderError(`Comment failed: ${error.message}`);
355
385
  }
356
386
  }
@@ -12,17 +12,13 @@ export declare class CodeReviewer {
12
12
  private reviewConfig;
13
13
  constructor(bitbucketProvider: BitbucketProvider, aiConfig: AIProviderConfig, reviewConfig: CodeReviewConfig);
14
14
  /**
15
- * Review code using pre-gathered unified context (OPTIMIZED)
15
+ * Review code using pre-gathered unified context (OPTIMIZED with Multi-Instance and Batch Processing)
16
16
  */
17
- reviewCodeWithContext(context: UnifiedContext, options: ReviewOptions): Promise<ReviewResult>;
17
+ reviewCodeWithContext(context: UnifiedContext, options: ReviewOptions, multiInstanceConfig?: any): Promise<ReviewResult>;
18
18
  /**
19
- * Validate violations to ensure code snippets exist in diff
19
+ * Review code using multiple instances for enhanced analysis
20
20
  */
21
- private validateViolations;
22
- /**
23
- * Try to fix code snippet by finding it in the actual diff
24
- */
25
- private tryFixCodeSnippet;
21
+ reviewWithMultipleInstances(context: UnifiedContext, options: ReviewOptions, multiInstanceConfig: any): Promise<any>;
26
22
  /**
27
23
  * Get system prompt for security-focused code review
28
24
  */
@@ -92,6 +88,58 @@ export declare class CodeReviewer {
92
88
  private groupViolationsByCategory;
93
89
  private calculateStats;
94
90
  private generateReviewResult;
91
+ /**
92
+ * Get batch processing configuration with defaults
93
+ */
94
+ private getBatchProcessingConfig;
95
+ /**
96
+ * Determine if batch processing should be used
97
+ */
98
+ private shouldUseBatchProcessing;
99
+ /**
100
+ * Main batch processing method with parallel processing support
101
+ */
102
+ private reviewWithBatchProcessing;
103
+ /**
104
+ * Process batches in parallel with concurrency control
105
+ */
106
+ private processInParallel;
107
+ /**
108
+ * Process batches serially (original implementation)
109
+ */
110
+ private processSerially;
111
+ /**
112
+ * Process a single batch with concurrency control
113
+ */
114
+ private processBatchWithConcurrency;
115
+ /**
116
+ * Prioritize files based on security importance and file type
117
+ */
118
+ private prioritizeFiles;
119
+ /**
120
+ * Calculate file priority based on path and content
121
+ */
122
+ private calculateFilePriority;
123
+ /**
124
+ * Estimate token count for a file
125
+ */
126
+ private estimateFileTokens;
127
+ /**
128
+ * Create batches from prioritized files
129
+ */
130
+ private createBatches;
131
+ /**
132
+ * Process a single batch of files
133
+ */
134
+ private processBatch;
135
+ /**
136
+ * Create context for a specific batch
137
+ */
138
+ private createBatchContext;
139
+ /**
140
+ * Build analysis prompt for a specific batch
141
+ */
142
+ private buildBatchAnalysisPrompt;
95
143
  /**
96
144
  * Utility methods
97
145
  */
@@ -100,6 +148,10 @@ export declare class CodeReviewer {
100
148
  * Extract line information for comment from context
101
149
  */
102
150
  private extractLineInfoForComment;
151
+ /**
152
+ * Detect programming language from file extension
153
+ */
154
+ private detectLanguageFromFile;
103
155
  /**
104
156
  * Generate all possible path variations for a file
105
157
  */