@juspay/yama 1.0.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.
@@ -0,0 +1,64 @@
1
+ /**
2
+ * Enhanced Description Enhancer - Optimized to work with Unified Context
3
+ * Preserves all original functionality from pr-describe.js but optimized
4
+ */
5
+ import { EnhancementOptions, EnhancementResult, AIProviderConfig } from "../types";
6
+ import { UnifiedContext } from "../core/ContextGatherer";
7
+ import { BitbucketProvider } from "../core/providers/BitbucketProvider";
8
+ export declare class DescriptionEnhancer {
9
+ private neurolink;
10
+ private bitbucketProvider;
11
+ private aiConfig;
12
+ private defaultRequiredSections;
13
+ constructor(bitbucketProvider: BitbucketProvider, aiConfig: AIProviderConfig);
14
+ /**
15
+ * Enhance description using pre-gathered unified context (OPTIMIZED)
16
+ */
17
+ enhanceWithContext(context: UnifiedContext, options: EnhancementOptions): Promise<EnhancementResult>;
18
+ /**
19
+ * Analyze existing PR description content
20
+ */
21
+ private analyzeExistingContent;
22
+ /**
23
+ * Extract preservable content (media, files, links)
24
+ */
25
+ private extractPreservableContent;
26
+ /**
27
+ * Validate presence of required sections
28
+ */
29
+ private validateRequiredSections;
30
+ /**
31
+ * Extract content for a specific section
32
+ */
33
+ private extractSectionContent;
34
+ /**
35
+ * Identify content gaps (TODOs, unanswered questions, etc.)
36
+ */
37
+ private identifyContentGaps;
38
+ /**
39
+ * Generate enhanced description using AI and unified context
40
+ */
41
+ private generateEnhancedDescription;
42
+ /**
43
+ * Build comprehensive enhancement prompt using unified context
44
+ */
45
+ private buildEnhancementPrompt;
46
+ /**
47
+ * Update PR description in Bitbucket
48
+ */
49
+ private updatePRDescription;
50
+ /**
51
+ * Show description preview for dry run
52
+ */
53
+ private showDescriptionPreview;
54
+ /**
55
+ * Generate enhancement result summary
56
+ */
57
+ private generateEnhancementResult;
58
+ /**
59
+ * Get enhancement statistics
60
+ */
61
+ getStats(): any;
62
+ }
63
+ export declare function createDescriptionEnhancer(bitbucketProvider: BitbucketProvider, aiConfig: AIProviderConfig): DescriptionEnhancer;
64
+ //# sourceMappingURL=DescriptionEnhancer.d.ts.map
@@ -0,0 +1,448 @@
1
+ "use strict";
2
+ /**
3
+ * Enhanced Description Enhancer - Optimized to work with Unified Context
4
+ * Preserves all original functionality from pr-describe.js but optimized
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.DescriptionEnhancer = void 0;
8
+ exports.createDescriptionEnhancer = createDescriptionEnhancer;
9
+ const types_1 = require("../types");
10
+ const Logger_1 = require("../utils/Logger");
11
+ class DescriptionEnhancer {
12
+ constructor(bitbucketProvider, aiConfig) {
13
+ this.defaultRequiredSections = [
14
+ { key: "changelog", name: "Changelog (Modules Modified)", required: true },
15
+ {
16
+ key: "testcases",
17
+ name: "Test Cases (What to be tested)",
18
+ required: true,
19
+ },
20
+ {
21
+ key: "config_changes",
22
+ name: "CAC Config Or Service Config Changes",
23
+ required: true,
24
+ },
25
+ ];
26
+ this.bitbucketProvider = bitbucketProvider;
27
+ this.aiConfig = aiConfig;
28
+ }
29
+ /**
30
+ * Enhance description using pre-gathered unified context (OPTIMIZED)
31
+ */
32
+ async enhanceWithContext(context, options) {
33
+ const startTime = Date.now();
34
+ try {
35
+ Logger_1.logger.phase("šŸ“ Enhancing PR description...");
36
+ Logger_1.logger.info(`Processing PR #${context.pr.id}: "${context.pr.title}"`);
37
+ // Step 1: Analyze existing content and identify what needs enhancement
38
+ const analysisResult = this.analyzeExistingContent(context.pr.description, options.customSections || this.defaultRequiredSections);
39
+ Logger_1.logger.info(`Content analysis: ${analysisResult.preservedContent.media.length} media items, ` +
40
+ `${analysisResult.missingCount} missing sections`);
41
+ // Step 2: Generate enhanced description using AI
42
+ const enhancedDescription = await this.generateEnhancedDescription(context, analysisResult, options);
43
+ // Step 3: Update PR description if not dry run
44
+ if (!options.dryRun) {
45
+ await this.updatePRDescription(context, enhancedDescription);
46
+ }
47
+ else {
48
+ this.showDescriptionPreview(enhancedDescription, analysisResult);
49
+ }
50
+ const duration = Math.round((Date.now() - startTime) / 1000);
51
+ const result = this.generateEnhancementResult(context.pr.description, enhancedDescription, analysisResult, duration);
52
+ Logger_1.logger.success(`Description enhancement completed in ${duration}s: ` +
53
+ `${result.sectionsAdded.length} sections added, ${result.sectionsEnhanced.length} enhanced`);
54
+ return result;
55
+ }
56
+ catch (error) {
57
+ Logger_1.logger.error(`Description enhancement failed: ${error.message}`);
58
+ throw new types_1.ProviderError(`Description enhancement failed: ${error.message}`);
59
+ }
60
+ }
61
+ /**
62
+ * Analyze existing PR description content
63
+ */
64
+ analyzeExistingContent(description, requiredSections) {
65
+ Logger_1.logger.debug("Analyzing existing PR description content...");
66
+ // Extract preservable content (media, files, links)
67
+ const preservedContent = this.extractPreservableContent(description);
68
+ // Validate required sections
69
+ const sectionsAnalysis = this.validateRequiredSections(description, requiredSections);
70
+ const missingCount = sectionsAnalysis.filter((s) => !s.present).length;
71
+ // Identify content gaps
72
+ const gaps = this.identifyContentGaps(description);
73
+ return {
74
+ requiredSections: sectionsAnalysis,
75
+ missingCount,
76
+ preservedContent,
77
+ gaps,
78
+ };
79
+ }
80
+ /**
81
+ * Extract preservable content (media, files, links)
82
+ */
83
+ extractPreservableContent(description) {
84
+ const preservableContent = {
85
+ media: [],
86
+ files: [],
87
+ links: [],
88
+ originalText: description || "",
89
+ };
90
+ if (!description) {
91
+ return preservableContent;
92
+ }
93
+ // Extract images and media (screenshots, etc.)
94
+ const mediaRegex = /!\[.*?\]\(.*?\)|<img[^>]*>|<video[^>]*>|<audio[^>]*>/g;
95
+ preservableContent.media = description.match(mediaRegex) || [];
96
+ // Extract file attachments
97
+ const fileRegex = /\[.*?\]\([^)]*\.(pdf|doc|docx|xls|xlsx|ppt|pptx|zip|rar|tar|gz)[^)]*\)/gi;
98
+ preservableContent.files = description.match(fileRegex) || [];
99
+ // Extract links (excluding images and files)
100
+ const linkRegex = /\[[^\]]*\]\([^)]+\)/g;
101
+ const allLinks = description.match(linkRegex) || [];
102
+ preservableContent.links = allLinks.filter((link) => !mediaRegex.test(link) && !fileRegex.test(link));
103
+ Logger_1.logger.debug(`Preservable content: ${preservableContent.media.length} media, ` +
104
+ `${preservableContent.files.length} files, ${preservableContent.links.length} links`);
105
+ return preservableContent;
106
+ }
107
+ /**
108
+ * Validate presence of required sections
109
+ */
110
+ validateRequiredSections(description, requiredSections) {
111
+ if (!description) {
112
+ return requiredSections.map((section) => ({
113
+ ...section,
114
+ present: false,
115
+ content: "",
116
+ }));
117
+ }
118
+ const sectionPatterns = {
119
+ changelog: [
120
+ /##.*?[Cc]hangelog/i,
121
+ /##.*?[Mm]odules?\s+[Mm]odified/i,
122
+ /##.*?[Cc]hanges?\s+[Mm]ade/i,
123
+ /šŸ“‹.*?[Cc]hangelog/i,
124
+ ],
125
+ testcases: [
126
+ /##.*?[Tt]est\s+[Cc]ases?/i,
127
+ /##.*?[Tt]esting/i,
128
+ /🧪.*?[Tt]est/i,
129
+ /##.*?[Tt]est\s+[Pp]lan/i,
130
+ ],
131
+ config_changes: [
132
+ /##.*?[Cc]onfig/i,
133
+ /##.*?CAC/i,
134
+ /##.*?[Ss]ervice\s+[Cc]onfig/i,
135
+ /āš™ļø.*?[Cc]onfig/i,
136
+ ],
137
+ };
138
+ return requiredSections.map((section) => {
139
+ const patterns = sectionPatterns[section.key];
140
+ const isPresent = patterns
141
+ ? patterns.some((pattern) => pattern.test(description))
142
+ : false;
143
+ return {
144
+ ...section,
145
+ present: isPresent,
146
+ content: isPresent
147
+ ? this.extractSectionContent(description, patterns || [])
148
+ : "",
149
+ };
150
+ });
151
+ }
152
+ /**
153
+ * Extract content for a specific section
154
+ */
155
+ extractSectionContent(description, patterns) {
156
+ for (const pattern of patterns) {
157
+ const match = description.match(pattern);
158
+ if (match) {
159
+ const startIndex = match.index + match[0].length;
160
+ const nextHeaderIndex = description
161
+ .substring(startIndex)
162
+ .search(/\n##/);
163
+ const endIndex = nextHeaderIndex === -1
164
+ ? description.length
165
+ : startIndex + nextHeaderIndex;
166
+ return description.substring(startIndex, endIndex).trim();
167
+ }
168
+ }
169
+ return "";
170
+ }
171
+ /**
172
+ * Identify content gaps (TODOs, unanswered questions, etc.)
173
+ */
174
+ identifyContentGaps(description) {
175
+ const gaps = [];
176
+ if (!description) {
177
+ gaps.push("No description provided");
178
+ return gaps;
179
+ }
180
+ // Check for unanswered questions and placeholders
181
+ const gapMarkers = [
182
+ { pattern: /\?\s*$/gm, name: "unanswered questions" },
183
+ { pattern: /TODO/gi, name: "TODO items" },
184
+ { pattern: /FIXME/gi, name: "FIXME items" },
185
+ { pattern: /\[TBD\]/gi, name: "TBD placeholders" },
186
+ { pattern: /\[TO BE DETERMINED\]/gi, name: "TBD placeholders" },
187
+ { pattern: /\[PENDING\]/gi, name: "pending items" },
188
+ ];
189
+ gapMarkers.forEach((marker) => {
190
+ const matches = description.match(marker.pattern);
191
+ if (matches) {
192
+ gaps.push(`${matches.length} ${marker.name}`);
193
+ }
194
+ });
195
+ return gaps;
196
+ }
197
+ /**
198
+ * Generate enhanced description using AI and unified context
199
+ */
200
+ async generateEnhancedDescription(context, analysisResult, options) {
201
+ Logger_1.logger.debug("Generating AI-enhanced description...");
202
+ // Initialize NeuroLink with eval-based dynamic import
203
+ if (!this.neurolink) {
204
+ const dynamicImport = eval("(specifier) => import(specifier)");
205
+ const { NeuroLink } = await dynamicImport("@juspay/neurolink");
206
+ this.neurolink = new NeuroLink();
207
+ }
208
+ const enhancementPrompt = this.buildEnhancementPrompt(context, analysisResult, options);
209
+ try {
210
+ const result = await this.neurolink.generate({
211
+ input: { text: enhancementPrompt },
212
+ provider: this.aiConfig.provider,
213
+ model: this.aiConfig.model,
214
+ temperature: this.aiConfig.temperature || 0.7,
215
+ maxTokens: this.aiConfig.maxTokens || 1000000,
216
+ timeout: "8m", // Longer timeout for description generation
217
+ enableAnalytics: this.aiConfig.enableAnalytics,
218
+ enableEvaluation: this.aiConfig.enableEvaluation,
219
+ });
220
+ let enhancedDescription = result.content ||
221
+ result.text ||
222
+ result.response ||
223
+ "";
224
+ // Clean up any markdown code blocks if AI wrapped the response
225
+ enhancedDescription = enhancedDescription
226
+ .replace(/^```markdown\s*/, "")
227
+ .replace(/\s*```$/, "")
228
+ .trim();
229
+ if (!enhancedDescription) {
230
+ throw new Error("AI generated empty description");
231
+ }
232
+ // Validate that required sections are present after enhancement
233
+ const finalValidation = this.validateRequiredSections(enhancedDescription, options.customSections || this.defaultRequiredSections);
234
+ const stillMissing = finalValidation.filter((s) => !s.present);
235
+ if (stillMissing.length > 0) {
236
+ Logger_1.logger.warn(`Warning: ${stillMissing.length} required sections still missing after AI enhancement`);
237
+ }
238
+ return enhancedDescription;
239
+ }
240
+ catch (error) {
241
+ if (error.message?.includes("timeout")) {
242
+ Logger_1.logger.error("ā° Description enhancement timed out after 8 minutes");
243
+ throw new Error("Enhancement timeout - try with smaller diff or adjust timeout");
244
+ }
245
+ Logger_1.logger.error(`AI description generation failed: ${error.message}`);
246
+ throw error;
247
+ }
248
+ }
249
+ /**
250
+ * Build comprehensive enhancement prompt using unified context
251
+ */
252
+ buildEnhancementPrompt(context, analysisResult, _options) {
253
+ // Prepare diff information based on strategy
254
+ let diffInfo = "";
255
+ if (context.diffStrategy.strategy === "whole" && context.prDiff) {
256
+ diffInfo = `**Diff Strategy**: Whole PR diff (${context.diffStrategy.fileCount} files)
257
+ **Changes**: ${JSON.stringify(context.prDiff.fileChanges?.slice(0, 20) || [], null, 2)}`;
258
+ }
259
+ else if (context.diffStrategy.strategy === "file-by-file" &&
260
+ context.fileDiffs) {
261
+ const fileList = Array.from(context.fileDiffs.keys()).slice(0, 20);
262
+ diffInfo = `**Diff Strategy**: File-by-file analysis (${context.diffStrategy.fileCount} files)
263
+ **Modified Files**: ${JSON.stringify(fileList, null, 2)}`;
264
+ }
265
+ return `You are an expert technical writer specializing in comprehensive PR descriptions.
266
+
267
+ ## PR INFORMATION:
268
+ **Title**: ${context.pr.title}
269
+ **Author**: ${context.pr.author}
270
+ **Current Description**:
271
+ ${analysisResult.preservedContent.originalText || "[No existing description]"}
272
+
273
+ ## CODE CHANGES ANALYSIS:
274
+ ${diffInfo}
275
+
276
+ ## PROJECT CONTEXT:
277
+ ${context.projectContext.memoryBank.summary}
278
+
279
+ ## PROJECT RULES:
280
+ ${context.projectContext.clinerules || "No specific rules defined"}
281
+
282
+ ## CONTENT PRESERVATION REQUIREMENTS:
283
+ **CRITICAL**: This is content ENHANCEMENT, not replacement!
284
+
285
+ ### Preserved Content Analysis:
286
+ - **Media Items**: ${analysisResult.preservedContent.media.length} (${analysisResult.preservedContent.media.join(", ")})
287
+ - **File Attachments**: ${analysisResult.preservedContent.files.length} (${analysisResult.preservedContent.files.join(", ")})
288
+ - **Links**: ${analysisResult.preservedContent.links.length}
289
+ - **Content Gaps**: ${analysisResult.gaps.join(", ") || "None identified"}
290
+
291
+ ### PRESERVATION RULES:
292
+ - **NEVER REMOVE**: Screenshots, images, file attachments, existing explanations, or links
293
+ - **PRESERVE EXACTLY**: All media links, file references, and existing valuable content
294
+ - **ONLY ADD**: Missing required sections or enhance clearly incomplete ones
295
+ - **MAINTAIN**: Original structure, tone, and author's explanations
296
+
297
+ ## REQUIRED SECTIONS STATUS:
298
+ ${analysisResult.requiredSections
299
+ .map((section) => `
300
+ **${section.name}**:
301
+ - Present: ${section.present ? "āœ… Yes" : "āŒ Missing"}
302
+ - Content: ${section.content ? `"${section.content.substring(0, 100)}..."` : "None"}
303
+ - Action Needed: ${section.present ? ((section.content?.length || 0) < 50 ? "Enhancement" : "None") : "Add Section"}`)
304
+ .join("")}
305
+
306
+ ## REQUIRED SECTIONS TO IMPLEMENT:
307
+
308
+ ### 1. šŸ“‹ CHANGELOG (Modules Modified)
309
+ **Purpose**: Clear documentation of what changed
310
+ **Content Requirements**:
311
+ - List specific files/modules modified, added, or removed
312
+ - Categorize changes (Features, Bug Fixes, Improvements, Breaking Changes)
313
+ - Mention key components affected
314
+ - Highlight any architectural changes
315
+
316
+ ### 2. 🧪 TEST CASES (What to be tested)
317
+ **Purpose**: Comprehensive testing guidance
318
+ **Content Requirements**:
319
+ - Unit tests to run or add
320
+ - Integration test scenarios
321
+ - Manual testing steps for reviewers
322
+ - Edge cases to verify
323
+ - Regression testing considerations
324
+ - Performance testing if applicable
325
+
326
+ ### 3. āš™ļø CAC CONFIG OR SERVICE CONFIG CHANGES
327
+ **Purpose**: Infrastructure and configuration impact
328
+ **Content Requirements**:
329
+ - Configuration files modified
330
+ - Environment variables added/changed/removed
331
+ - Service configuration updates
332
+ - Database schema changes
333
+ - Deployment considerations
334
+ - If no config changes: explicitly state "No configuration changes required"
335
+
336
+ ## ENHANCEMENT STRATEGY:
337
+
338
+ ### For Missing Sections:
339
+ 1. **START** with the complete existing description
340
+ 2. **ANALYZE** the code changes to understand the scope
341
+ 3. **ADD** each missing required section with comprehensive content
342
+ 4. **EXTRACT** relevant information from the diff to populate sections
343
+
344
+ ### For Incomplete Sections:
345
+ 1. **PRESERVE** all existing content in the section
346
+ 2. **ENHANCE** with additional details based on code analysis
347
+ 3. **MAINTAIN** the original structure and format
348
+
349
+ ### Content Generation Guidelines:
350
+ - **Be Specific**: Use actual file names, function names, and module names from the changes
351
+ - **Be Actionable**: Provide clear, executable test instructions
352
+ - **Be Complete**: Cover all aspects of the change comprehensively
353
+ - **Be Professional**: Maintain technical accuracy and clear communication
354
+
355
+ ## OUTPUT REQUIREMENTS:
356
+ Return the COMPLETE enhanced description as properly formatted markdown text (NOT JSON).
357
+
358
+ **CRITICAL INSTRUCTIONS**:
359
+ 1. **START WITH**: The entire existing description as your foundation
360
+ 2. **PRESERVE**: Every single piece of existing content (media, links, explanations)
361
+ 3. **ADD ONLY**: Missing required sections at appropriate locations
362
+ 4. **ENHANCE ONLY**: Clearly incomplete sections with additional details
363
+ 5. **EXTRACT**: Specific details from the code changes for accuracy
364
+ 6. **MAINTAIN**: Professional tone and clear markdown formatting
365
+
366
+ Generate the enhanced description now, ensuring ALL preservation requirements are met:`;
367
+ }
368
+ /**
369
+ * Update PR description in Bitbucket
370
+ */
371
+ async updatePRDescription(context, enhancedDescription) {
372
+ Logger_1.logger.debug(`Updating PR description for #${context.pr.id}...`);
373
+ try {
374
+ await this.bitbucketProvider.updatePRDescription(context.identifier, enhancedDescription);
375
+ Logger_1.logger.success("āœ… PR description updated successfully");
376
+ }
377
+ catch (error) {
378
+ Logger_1.logger.error(`Failed to update PR description: ${error.message}`);
379
+ throw new types_1.ProviderError(`Description update failed: ${error.message}`);
380
+ }
381
+ }
382
+ /**
383
+ * Show description preview for dry run
384
+ */
385
+ showDescriptionPreview(enhancedDescription, analysisResult) {
386
+ console.log("\n" + "═".repeat(80));
387
+ console.log("šŸ“ ENHANCED PR DESCRIPTION PREVIEW");
388
+ console.log("═".repeat(80));
389
+ console.log(enhancedDescription);
390
+ console.log("═".repeat(80));
391
+ console.log("\nšŸ“Š ENHANCEMENT SUMMARY:");
392
+ console.log(`āœ… Required sections completed: ${analysisResult.requiredSections.filter((s) => s.present).length}/${analysisResult.requiredSections.length}`);
393
+ console.log(`šŸ“Ž Preserved content: ${analysisResult.preservedContent.media.length} media items, ${analysisResult.preservedContent.files.length} files`);
394
+ console.log(`šŸ“ Enhanced description length: ${enhancedDescription.length} characters`);
395
+ if (analysisResult.gaps.length > 0) {
396
+ console.log(`šŸ” Content gaps addressed: ${analysisResult.gaps.join(", ")}`);
397
+ }
398
+ }
399
+ /**
400
+ * Generate enhancement result summary
401
+ */
402
+ generateEnhancementResult(originalDescription, enhancedDescription, analysisResult, _duration) {
403
+ // Determine what sections were added or enhanced
404
+ const originalSections = this.validateRequiredSections(originalDescription, analysisResult.requiredSections);
405
+ const enhancedSections = this.validateRequiredSections(enhancedDescription, analysisResult.requiredSections);
406
+ const sectionsAdded = enhancedSections
407
+ .filter((enhanced, i) => enhanced.present && !originalSections[i].present)
408
+ .map((s) => s.name);
409
+ const sectionsEnhanced = enhancedSections
410
+ .filter((enhanced, i) => enhanced.present &&
411
+ originalSections[i].present &&
412
+ (enhanced.content?.length || 0) >
413
+ (originalSections[i].content?.length || 0) + 50)
414
+ .map((s) => s.name);
415
+ const completedSections = enhancedSections.filter((s) => s.present).length;
416
+ return {
417
+ originalDescription: originalDescription || "",
418
+ enhancedDescription,
419
+ sectionsAdded,
420
+ sectionsEnhanced,
421
+ preservedItems: {
422
+ media: analysisResult.preservedContent.media.length,
423
+ files: analysisResult.preservedContent.files.length,
424
+ links: analysisResult.preservedContent.links.length,
425
+ },
426
+ statistics: {
427
+ originalLength: originalDescription?.length || 0,
428
+ enhancedLength: enhancedDescription.length,
429
+ completedSections,
430
+ totalSections: analysisResult.requiredSections.length,
431
+ },
432
+ };
433
+ }
434
+ /**
435
+ * Get enhancement statistics
436
+ */
437
+ getStats() {
438
+ return {
439
+ defaultSections: this.defaultRequiredSections.length,
440
+ aiProvider: this.aiConfig.provider,
441
+ };
442
+ }
443
+ }
444
+ exports.DescriptionEnhancer = DescriptionEnhancer;
445
+ function createDescriptionEnhancer(bitbucketProvider, aiConfig) {
446
+ return new DescriptionEnhancer(bitbucketProvider, aiConfig);
447
+ }
448
+ //# sourceMappingURL=DescriptionEnhancer.js.map
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Yama - Main package exports
3
+ * Provides both programmatic API and CLI access
4
+ */
5
+ export { Guardian, createGuardian, guardian } from "./core/Guardian";
6
+ export { ContextGatherer, createContextGatherer } from "./core/ContextGatherer";
7
+ export type { UnifiedContext, ProjectContext, DiffStrategy, } from "./core/ContextGatherer";
8
+ export { BitbucketProvider, createBitbucketProvider, } from "./core/providers/BitbucketProvider";
9
+ export { CodeReviewer, createCodeReviewer } from "./features/CodeReviewer";
10
+ export { DescriptionEnhancer, createDescriptionEnhancer, } from "./features/DescriptionEnhancer";
11
+ export { Logger, createLogger, logger } from "./utils/Logger";
12
+ export { Cache, createCache, cache } from "./utils/Cache";
13
+ export { ConfigManager, createConfigManager, configManager, } from "./utils/ConfigManager";
14
+ export * from "./types";
15
+ export { main as cli } from "./cli/index";
16
+ //# sourceMappingURL=index.d.ts.map
package/dist/index.js ADDED
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ /**
3
+ * Yama - Main package exports
4
+ * Provides both programmatic API and CLI access
5
+ */
6
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
+ if (k2 === undefined) k2 = k;
8
+ var desc = Object.getOwnPropertyDescriptor(m, k);
9
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
10
+ desc = { enumerable: true, get: function() { return m[k]; } };
11
+ }
12
+ Object.defineProperty(o, k2, desc);
13
+ }) : (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ o[k2] = m[k];
16
+ }));
17
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
18
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ exports.cli = exports.configManager = exports.createConfigManager = exports.ConfigManager = exports.cache = exports.createCache = exports.Cache = exports.logger = exports.createLogger = exports.Logger = exports.createDescriptionEnhancer = exports.DescriptionEnhancer = exports.createCodeReviewer = exports.CodeReviewer = exports.createBitbucketProvider = exports.BitbucketProvider = exports.createContextGatherer = exports.ContextGatherer = exports.guardian = exports.createGuardian = exports.Guardian = void 0;
22
+ // Core classes
23
+ var Guardian_1 = require("./core/Guardian");
24
+ Object.defineProperty(exports, "Guardian", { enumerable: true, get: function () { return Guardian_1.Guardian; } });
25
+ Object.defineProperty(exports, "createGuardian", { enumerable: true, get: function () { return Guardian_1.createGuardian; } });
26
+ Object.defineProperty(exports, "guardian", { enumerable: true, get: function () { return Guardian_1.guardian; } });
27
+ var ContextGatherer_1 = require("./core/ContextGatherer");
28
+ Object.defineProperty(exports, "ContextGatherer", { enumerable: true, get: function () { return ContextGatherer_1.ContextGatherer; } });
29
+ Object.defineProperty(exports, "createContextGatherer", { enumerable: true, get: function () { return ContextGatherer_1.createContextGatherer; } });
30
+ // Providers
31
+ var BitbucketProvider_1 = require("./core/providers/BitbucketProvider");
32
+ Object.defineProperty(exports, "BitbucketProvider", { enumerable: true, get: function () { return BitbucketProvider_1.BitbucketProvider; } });
33
+ Object.defineProperty(exports, "createBitbucketProvider", { enumerable: true, get: function () { return BitbucketProvider_1.createBitbucketProvider; } });
34
+ // Features
35
+ var CodeReviewer_1 = require("./features/CodeReviewer");
36
+ Object.defineProperty(exports, "CodeReviewer", { enumerable: true, get: function () { return CodeReviewer_1.CodeReviewer; } });
37
+ Object.defineProperty(exports, "createCodeReviewer", { enumerable: true, get: function () { return CodeReviewer_1.createCodeReviewer; } });
38
+ var DescriptionEnhancer_1 = require("./features/DescriptionEnhancer");
39
+ Object.defineProperty(exports, "DescriptionEnhancer", { enumerable: true, get: function () { return DescriptionEnhancer_1.DescriptionEnhancer; } });
40
+ Object.defineProperty(exports, "createDescriptionEnhancer", { enumerable: true, get: function () { return DescriptionEnhancer_1.createDescriptionEnhancer; } });
41
+ // Utilities
42
+ var Logger_1 = require("./utils/Logger");
43
+ Object.defineProperty(exports, "Logger", { enumerable: true, get: function () { return Logger_1.Logger; } });
44
+ Object.defineProperty(exports, "createLogger", { enumerable: true, get: function () { return Logger_1.createLogger; } });
45
+ Object.defineProperty(exports, "logger", { enumerable: true, get: function () { return Logger_1.logger; } });
46
+ var Cache_1 = require("./utils/Cache");
47
+ Object.defineProperty(exports, "Cache", { enumerable: true, get: function () { return Cache_1.Cache; } });
48
+ Object.defineProperty(exports, "createCache", { enumerable: true, get: function () { return Cache_1.createCache; } });
49
+ Object.defineProperty(exports, "cache", { enumerable: true, get: function () { return Cache_1.cache; } });
50
+ var ConfigManager_1 = require("./utils/ConfigManager");
51
+ Object.defineProperty(exports, "ConfigManager", { enumerable: true, get: function () { return ConfigManager_1.ConfigManager; } });
52
+ Object.defineProperty(exports, "createConfigManager", { enumerable: true, get: function () { return ConfigManager_1.createConfigManager; } });
53
+ Object.defineProperty(exports, "configManager", { enumerable: true, get: function () { return ConfigManager_1.configManager; } });
54
+ // Types
55
+ __exportStar(require("./types"), exports);
56
+ // CLI
57
+ var index_1 = require("./cli/index");
58
+ Object.defineProperty(exports, "cli", { enumerable: true, get: function () { return index_1.main; } });
59
+ // Note: Use named import { Guardian } from '@juspay/yama' instead
60
+ //# sourceMappingURL=index.js.map