@juspay/yama 1.6.0 → 2.1.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.
Files changed (79) hide show
  1. package/.mcp-config.example.json +26 -0
  2. package/CHANGELOG.md +46 -0
  3. package/README.md +311 -685
  4. package/dist/cli/v2.cli.d.ts +13 -0
  5. package/dist/cli/v2.cli.js +359 -0
  6. package/dist/index.d.ts +12 -13
  7. package/dist/index.js +18 -19
  8. package/dist/v2/config/ConfigLoader.d.ts +50 -0
  9. package/dist/v2/config/ConfigLoader.js +205 -0
  10. package/dist/v2/config/DefaultConfig.d.ts +9 -0
  11. package/dist/v2/config/DefaultConfig.js +187 -0
  12. package/dist/v2/core/LearningOrchestrator.d.ts +65 -0
  13. package/dist/v2/core/LearningOrchestrator.js +499 -0
  14. package/dist/v2/core/MCPServerManager.d.ts +22 -0
  15. package/dist/v2/core/MCPServerManager.js +100 -0
  16. package/dist/v2/core/SessionManager.d.ts +72 -0
  17. package/dist/v2/core/SessionManager.js +200 -0
  18. package/dist/v2/core/YamaV2Orchestrator.d.ts +112 -0
  19. package/dist/v2/core/YamaV2Orchestrator.js +549 -0
  20. package/dist/v2/learning/FeedbackExtractor.d.ts +46 -0
  21. package/dist/v2/learning/FeedbackExtractor.js +237 -0
  22. package/dist/v2/learning/KnowledgeBaseManager.d.ts +91 -0
  23. package/dist/v2/learning/KnowledgeBaseManager.js +475 -0
  24. package/dist/v2/learning/types.d.ts +121 -0
  25. package/dist/v2/learning/types.js +15 -0
  26. package/dist/v2/prompts/EnhancementSystemPrompt.d.ts +8 -0
  27. package/dist/v2/prompts/EnhancementSystemPrompt.js +216 -0
  28. package/dist/v2/prompts/LangfusePromptManager.d.ts +48 -0
  29. package/dist/v2/prompts/LangfusePromptManager.js +144 -0
  30. package/dist/v2/prompts/LearningSystemPrompt.d.ts +11 -0
  31. package/dist/v2/prompts/LearningSystemPrompt.js +180 -0
  32. package/dist/v2/prompts/PromptBuilder.d.ts +45 -0
  33. package/dist/v2/prompts/PromptBuilder.js +257 -0
  34. package/dist/v2/prompts/ReviewSystemPrompt.d.ts +8 -0
  35. package/dist/v2/prompts/ReviewSystemPrompt.js +270 -0
  36. package/dist/v2/types/config.types.d.ts +141 -0
  37. package/dist/v2/types/config.types.js +5 -0
  38. package/dist/v2/types/mcp.types.d.ts +191 -0
  39. package/dist/v2/types/mcp.types.js +6 -0
  40. package/dist/v2/types/v2.types.d.ts +182 -0
  41. package/dist/v2/types/v2.types.js +42 -0
  42. package/dist/v2/utils/ObservabilityConfig.d.ts +22 -0
  43. package/dist/v2/utils/ObservabilityConfig.js +48 -0
  44. package/package.json +16 -10
  45. package/yama.config.example.yaml +259 -204
  46. package/dist/cli/index.d.ts +0 -12
  47. package/dist/cli/index.js +0 -538
  48. package/dist/core/ContextGatherer.d.ts +0 -110
  49. package/dist/core/ContextGatherer.js +0 -470
  50. package/dist/core/Guardian.d.ts +0 -81
  51. package/dist/core/Guardian.js +0 -480
  52. package/dist/core/providers/BitbucketProvider.d.ts +0 -105
  53. package/dist/core/providers/BitbucketProvider.js +0 -489
  54. package/dist/features/CodeReviewer.d.ts +0 -173
  55. package/dist/features/CodeReviewer.js +0 -1707
  56. package/dist/features/DescriptionEnhancer.d.ts +0 -70
  57. package/dist/features/DescriptionEnhancer.js +0 -511
  58. package/dist/features/MultiInstanceProcessor.d.ts +0 -74
  59. package/dist/features/MultiInstanceProcessor.js +0 -360
  60. package/dist/types/index.d.ts +0 -624
  61. package/dist/types/index.js +0 -104
  62. package/dist/utils/Cache.d.ts +0 -103
  63. package/dist/utils/Cache.js +0 -444
  64. package/dist/utils/ConfigManager.d.ts +0 -88
  65. package/dist/utils/ConfigManager.js +0 -602
  66. package/dist/utils/ContentSimilarityService.d.ts +0 -74
  67. package/dist/utils/ContentSimilarityService.js +0 -215
  68. package/dist/utils/ExactDuplicateRemover.d.ts +0 -77
  69. package/dist/utils/ExactDuplicateRemover.js +0 -361
  70. package/dist/utils/Logger.d.ts +0 -31
  71. package/dist/utils/Logger.js +0 -214
  72. package/dist/utils/MemoryBankManager.d.ts +0 -73
  73. package/dist/utils/MemoryBankManager.js +0 -310
  74. package/dist/utils/ParallelProcessing.d.ts +0 -140
  75. package/dist/utils/ParallelProcessing.js +0 -333
  76. package/dist/utils/ProviderLimits.d.ts +0 -58
  77. package/dist/utils/ProviderLimits.js +0 -143
  78. package/dist/utils/RetryManager.d.ts +0 -78
  79. package/dist/utils/RetryManager.js +0 -205
@@ -0,0 +1,141 @@
1
+ /**
2
+ * Yama V2 Configuration Type Definitions
3
+ */
4
+ import { FocusArea, BlockingCriteria } from "./v2.types.js";
5
+ export interface YamaV2Config {
6
+ version: number;
7
+ configType: string;
8
+ display: DisplayConfig;
9
+ ai: AIConfig;
10
+ mcpServers: MCPServersConfig;
11
+ review: ReviewConfig;
12
+ descriptionEnhancement: DescriptionEnhancementConfig;
13
+ memoryBank: MemoryBankConfig;
14
+ knowledgeBase: KnowledgeBaseConfig;
15
+ projectStandards?: ProjectStandardsConfig;
16
+ monitoring: MonitoringConfig;
17
+ performance: PerformanceConfig;
18
+ }
19
+ export interface DisplayConfig {
20
+ showBanner: boolean;
21
+ streamingMode: boolean;
22
+ verboseToolCalls: boolean;
23
+ showAIThinking: boolean;
24
+ }
25
+ export interface AIConfig {
26
+ provider: "auto" | "google-ai" | "anthropic" | "openai" | "bedrock" | "azure";
27
+ model: string;
28
+ temperature: number;
29
+ maxTokens: number;
30
+ enableAnalytics: boolean;
31
+ enableEvaluation: boolean;
32
+ timeout: string;
33
+ retryAttempts: number;
34
+ conversationMemory: ConversationMemoryConfig;
35
+ }
36
+ export interface ConversationMemoryConfig {
37
+ enabled: boolean;
38
+ store: "memory" | "redis";
39
+ maxSessions: number;
40
+ maxTurnsPerSession: number;
41
+ enableSummarization: boolean;
42
+ redis?: RedisConfig;
43
+ }
44
+ export interface RedisConfig {
45
+ host: string;
46
+ port: number;
47
+ password?: string;
48
+ keyPrefix?: string;
49
+ ttl?: number;
50
+ }
51
+ export interface MCPServersConfig {
52
+ bitbucket?: {
53
+ /** List of tool names to block from Bitbucket MCP server */
54
+ blockedTools?: string[];
55
+ };
56
+ jira: {
57
+ enabled: boolean;
58
+ /** List of tool names to block from Jira MCP server */
59
+ blockedTools?: string[];
60
+ };
61
+ }
62
+ export interface ReviewConfig {
63
+ enabled: boolean;
64
+ workflowInstructions: string;
65
+ focusAreas: FocusArea[];
66
+ blockingCriteria?: BlockingCriteria[];
67
+ excludePatterns: string[];
68
+ contextLines: number;
69
+ maxFilesPerReview: number;
70
+ fileAnalysisTimeout: string;
71
+ toolPreferences: ToolPreferencesConfig;
72
+ }
73
+ export interface ToolPreferencesConfig {
74
+ lazyLoading: boolean;
75
+ cacheToolResults: boolean;
76
+ parallelToolCalls: boolean;
77
+ maxToolCallsPerFile: number;
78
+ enableCodeSearch: boolean;
79
+ enableDirectoryListing: boolean;
80
+ }
81
+ export interface DescriptionEnhancementConfig {
82
+ enabled: boolean;
83
+ instructions: string;
84
+ requiredSections: RequiredSection[];
85
+ preserveContent: boolean;
86
+ autoFormat: boolean;
87
+ }
88
+ export interface RequiredSection {
89
+ key: string;
90
+ name: string;
91
+ required: boolean;
92
+ description: string;
93
+ }
94
+ export interface MemoryBankConfig {
95
+ enabled: boolean;
96
+ path: string;
97
+ fallbackPaths: string[];
98
+ standardFiles?: string[];
99
+ }
100
+ export interface KnowledgeBaseConfig {
101
+ /** Enable knowledge base feature */
102
+ enabled: boolean;
103
+ /** Path to knowledge base file (relative to project root) */
104
+ path: string;
105
+ /** Patterns to identify AI comment authors (case-insensitive) */
106
+ aiAuthorPatterns: string[];
107
+ /** Number of learnings before auto-summarization triggers */
108
+ maxEntriesBeforeSummarization: number;
109
+ /** Number of entries to retain after summarization */
110
+ summaryRetentionCount: number;
111
+ /** Auto-commit knowledge base changes (default for --commit flag) */
112
+ autoCommit: boolean;
113
+ }
114
+ export interface ProjectStandardsConfig {
115
+ customPromptsPath: string;
116
+ additionalFocusAreas: FocusArea[];
117
+ customBlockingRules: BlockingCriteria[];
118
+ severityOverrides: Record<string, string>;
119
+ }
120
+ export interface MonitoringConfig {
121
+ enabled: boolean;
122
+ logToolCalls: boolean;
123
+ logAIDecisions: boolean;
124
+ logTokenUsage: boolean;
125
+ exportFormat: "json" | "csv";
126
+ exportPath: string;
127
+ }
128
+ export interface PerformanceConfig {
129
+ maxReviewDuration: string;
130
+ tokenBudget: TokenBudgetConfig;
131
+ costControls: CostControlsConfig;
132
+ }
133
+ export interface TokenBudgetConfig {
134
+ maxTokensPerReview: number;
135
+ warningThreshold: number;
136
+ }
137
+ export interface CostControlsConfig {
138
+ maxCostPerReview: number;
139
+ warningThreshold: number;
140
+ }
141
+ //# sourceMappingURL=config.types.d.ts.map
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Yama V2 Configuration Type Definitions
3
+ */
4
+ export {};
5
+ //# sourceMappingURL=config.types.js.map
@@ -0,0 +1,191 @@
1
+ /**
2
+ * MCP Tool Response Type Definitions
3
+ * Types for Bitbucket and Jira MCP tool responses
4
+ */
5
+ export interface MCPStatus {
6
+ totalServers: number;
7
+ totalTools: number;
8
+ servers: MCPServerStatus[];
9
+ }
10
+ export interface MCPServerStatus {
11
+ id: string;
12
+ connected: boolean;
13
+ tools: string[];
14
+ lastHealthCheck?: Date;
15
+ error?: string;
16
+ }
17
+ export interface GetPullRequestResponse {
18
+ id: number;
19
+ title: string;
20
+ description: string;
21
+ author: {
22
+ name: string;
23
+ displayName: string;
24
+ emailAddress?: string;
25
+ };
26
+ state: "OPEN" | "MERGED" | "DECLINED";
27
+ source: {
28
+ branch: {
29
+ name: string;
30
+ };
31
+ commit: {
32
+ id: string;
33
+ };
34
+ };
35
+ destination: {
36
+ branch: {
37
+ name: string;
38
+ };
39
+ commit: {
40
+ id: string;
41
+ };
42
+ };
43
+ createdDate: string;
44
+ updatedDate: string;
45
+ reviewers: Reviewer[];
46
+ active_comments?: Comment[];
47
+ file_changes?: FileChange[];
48
+ }
49
+ export interface Reviewer {
50
+ user: {
51
+ name: string;
52
+ displayName: string;
53
+ emailAddress?: string;
54
+ };
55
+ approved: boolean;
56
+ status: "APPROVED" | "UNAPPROVED" | "NEEDS_WORK";
57
+ }
58
+ export interface Comment {
59
+ id: number;
60
+ text: string;
61
+ author: {
62
+ name: string;
63
+ displayName: string;
64
+ };
65
+ createdDate: string;
66
+ updatedDate: string;
67
+ anchor?: CommentAnchor;
68
+ }
69
+ export interface CommentAnchor {
70
+ filePath: string;
71
+ lineFrom: number;
72
+ lineTo: number;
73
+ lineType: "ADDED" | "REMOVED" | "CONTEXT";
74
+ }
75
+ export interface FileChange {
76
+ path: string;
77
+ file?: string;
78
+ type: "ADD" | "MODIFY" | "DELETE" | "RENAME";
79
+ }
80
+ export interface GetPullRequestDiffResponse {
81
+ diff: string;
82
+ file_changes?: FileChange[];
83
+ additions?: number;
84
+ deletions?: number;
85
+ }
86
+ export interface AddCommentRequest {
87
+ workspace: string;
88
+ repository: string;
89
+ pull_request_id: number;
90
+ comment_text: string;
91
+ file_path?: string;
92
+ code_snippet?: string;
93
+ line_number?: number;
94
+ line_type?: "ADDED" | "REMOVED" | "CONTEXT";
95
+ parent_comment_id?: number;
96
+ }
97
+ export interface AddCommentResponse {
98
+ id: number;
99
+ text: string;
100
+ author: string;
101
+ createdDate: string;
102
+ anchor?: CommentAnchor;
103
+ }
104
+ export interface UpdatePullRequestRequest {
105
+ workspace: string;
106
+ repository: string;
107
+ pull_request_id: number;
108
+ title?: string;
109
+ description?: string;
110
+ reviewers?: string[];
111
+ }
112
+ export interface GetFileContentResponse {
113
+ content: string;
114
+ path: string;
115
+ size: number;
116
+ encoding?: string;
117
+ }
118
+ export interface ListDirectoryContentResponse {
119
+ path: string;
120
+ items: DirectoryItem[];
121
+ }
122
+ export interface DirectoryItem {
123
+ type: "file" | "directory";
124
+ path: string;
125
+ name: string;
126
+ size?: number;
127
+ }
128
+ export interface SearchCodeResponse {
129
+ results: SearchResult[];
130
+ totalCount: number;
131
+ }
132
+ export interface SearchResult {
133
+ file: string;
134
+ line: number;
135
+ content: string;
136
+ matches: string[];
137
+ }
138
+ export interface GetIssueResponse {
139
+ key: string;
140
+ id: string;
141
+ summary: string;
142
+ description: string;
143
+ status: {
144
+ name: string;
145
+ category: string;
146
+ };
147
+ issueType: {
148
+ name: string;
149
+ description: string;
150
+ };
151
+ priority: {
152
+ name: string;
153
+ };
154
+ assignee?: {
155
+ displayName: string;
156
+ emailAddress: string;
157
+ };
158
+ reporter: {
159
+ displayName: string;
160
+ emailAddress: string;
161
+ };
162
+ created: string;
163
+ updated: string;
164
+ customFields?: Record<string, any>;
165
+ }
166
+ export interface SearchIssuesRequest {
167
+ jql: string;
168
+ maxResults?: number;
169
+ startAt?: number;
170
+ }
171
+ export interface SearchIssuesResponse {
172
+ issues: GetIssueResponse[];
173
+ total: number;
174
+ startAt: number;
175
+ maxResults: number;
176
+ }
177
+ export interface GetIssueCommentsResponse {
178
+ comments: JiraComment[];
179
+ total: number;
180
+ }
181
+ export interface JiraComment {
182
+ id: string;
183
+ author: {
184
+ displayName: string;
185
+ emailAddress: string;
186
+ };
187
+ body: string;
188
+ created: string;
189
+ updated: string;
190
+ }
191
+ //# sourceMappingURL=mcp.types.d.ts.map
@@ -0,0 +1,6 @@
1
+ /**
2
+ * MCP Tool Response Type Definitions
3
+ * Types for Bitbucket and Jira MCP tool responses
4
+ */
5
+ export {};
6
+ //# sourceMappingURL=mcp.types.js.map
@@ -0,0 +1,182 @@
1
+ /**
2
+ * Yama V2 TypeScript Type Definitions
3
+ * AI-Native MCP Architecture Types
4
+ */
5
+ export interface ReviewRequest {
6
+ workspace: string;
7
+ repository: string;
8
+ pullRequestId?: number;
9
+ branch?: string;
10
+ dryRun?: boolean;
11
+ verbose?: boolean;
12
+ configPath?: string;
13
+ }
14
+ export interface ReviewResult {
15
+ prId: number;
16
+ decision: "APPROVED" | "CHANGES_REQUESTED" | "BLOCKED";
17
+ statistics: ReviewStatistics;
18
+ summary: string;
19
+ duration: number;
20
+ tokenUsage: TokenUsage;
21
+ costEstimate: number;
22
+ sessionId: string;
23
+ descriptionEnhanced?: boolean;
24
+ totalComments?: number;
25
+ }
26
+ export interface ReviewStatistics {
27
+ filesReviewed: number;
28
+ issuesFound: IssuesBySeverity;
29
+ requirementCoverage: number;
30
+ codeQualityScore: number;
31
+ toolCallsMade: number;
32
+ cacheHits: number;
33
+ totalComments: number;
34
+ }
35
+ export interface IssuesBySeverity {
36
+ critical: number;
37
+ major: number;
38
+ minor: number;
39
+ suggestions: number;
40
+ }
41
+ export interface TokenUsage {
42
+ input: number;
43
+ output: number;
44
+ total: number;
45
+ }
46
+ export interface ReviewUpdate {
47
+ type: "tool_call" | "ai_thinking" | "comment_posted" | "decision" | "progress";
48
+ timestamp: string;
49
+ sessionId: string;
50
+ data: any;
51
+ }
52
+ export interface ToolCallUpdate {
53
+ toolName: string;
54
+ args: any;
55
+ result?: any;
56
+ error?: string;
57
+ duration?: number;
58
+ }
59
+ export interface ProgressUpdate {
60
+ phase: "context_gathering" | "file_analysis" | "decision_making" | "description_enhancement";
61
+ progress: number;
62
+ message: string;
63
+ currentFile?: string;
64
+ filesProcessed?: number;
65
+ totalFiles?: number;
66
+ }
67
+ export interface ReviewSession {
68
+ sessionId: string;
69
+ request: ReviewRequest;
70
+ startTime: Date;
71
+ endTime?: Date;
72
+ status: "running" | "completed" | "failed";
73
+ toolCalls: ToolCallRecord[];
74
+ result?: ReviewResult;
75
+ error?: Error;
76
+ metadata: SessionMetadata;
77
+ }
78
+ export interface ToolCallRecord {
79
+ timestamp: Date;
80
+ toolName: string;
81
+ args: any;
82
+ result: any;
83
+ error?: string;
84
+ duration: number;
85
+ tokenUsage?: TokenUsage;
86
+ }
87
+ export interface SessionMetadata {
88
+ yamaVersion: string;
89
+ aiProvider: string;
90
+ aiModel: string;
91
+ totalTokens: number;
92
+ totalCost: number;
93
+ cacheHitRatio: number;
94
+ }
95
+ export interface MCPToolResponse {
96
+ success: boolean;
97
+ data?: any;
98
+ error?: string;
99
+ metadata?: {
100
+ cached?: boolean;
101
+ duration?: number;
102
+ source?: string;
103
+ };
104
+ }
105
+ export interface BitbucketPRDetails {
106
+ id: number;
107
+ title: string;
108
+ description: string;
109
+ author: string;
110
+ state: "OPEN" | "MERGED" | "DECLINED";
111
+ sourceRef: string;
112
+ targetRef: string;
113
+ createdDate: string;
114
+ updatedDate: string;
115
+ reviewers: any[];
116
+ comments: any[];
117
+ fileChanges: string[];
118
+ }
119
+ export interface JiraTicketDetails {
120
+ key: string;
121
+ summary: string;
122
+ description: string;
123
+ status: string;
124
+ acceptanceCriteria?: string;
125
+ requirements?: string[];
126
+ issueType: string;
127
+ priority: string;
128
+ }
129
+ export interface PromptLayer {
130
+ name: string;
131
+ priority: number;
132
+ content: string;
133
+ source: "base" | "config" | "project";
134
+ }
135
+ export interface FocusArea {
136
+ name: string;
137
+ priority: "CRITICAL" | "MAJOR" | "MINOR";
138
+ description: string;
139
+ }
140
+ export interface BlockingCriteria {
141
+ condition: string;
142
+ action: "BLOCK" | "REQUEST_CHANGES" | "WARN";
143
+ reason: string;
144
+ }
145
+ export interface ToolContext {
146
+ sessionId: string;
147
+ workspace: string;
148
+ repository: string;
149
+ pullRequestId?: number;
150
+ branch?: string;
151
+ dryRun: boolean;
152
+ metadata: {
153
+ yamaVersion: string;
154
+ startTime: string;
155
+ jiraTicket?: string;
156
+ };
157
+ }
158
+ export interface AIAnalysisContext {
159
+ prDetails: BitbucketPRDetails;
160
+ jiraTicket?: JiraTicketDetails;
161
+ projectStandards?: string;
162
+ memoryBankContext?: string;
163
+ clinerules?: string;
164
+ }
165
+ export declare class YamaV2Error extends Error {
166
+ code: string;
167
+ context?: any | undefined;
168
+ constructor(code: string, message: string, context?: any | undefined);
169
+ }
170
+ export declare class MCPServerError extends YamaV2Error {
171
+ constructor(message: string, context?: any);
172
+ }
173
+ export declare class ConfigurationError extends YamaV2Error {
174
+ constructor(message: string, context?: any);
175
+ }
176
+ export declare class ReviewTimeoutError extends YamaV2Error {
177
+ constructor(message: string, context?: any);
178
+ }
179
+ export declare class TokenBudgetExceededError extends YamaV2Error {
180
+ constructor(message: string, context?: any);
181
+ }
182
+ //# sourceMappingURL=v2.types.d.ts.map
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Yama V2 TypeScript Type Definitions
3
+ * AI-Native MCP Architecture Types
4
+ */
5
+ // ============================================================================
6
+ // Error Types
7
+ // ============================================================================
8
+ export class YamaV2Error extends Error {
9
+ code;
10
+ context;
11
+ constructor(code, message, context) {
12
+ super(message);
13
+ this.code = code;
14
+ this.context = context;
15
+ this.name = "YamaV2Error";
16
+ }
17
+ }
18
+ export class MCPServerError extends YamaV2Error {
19
+ constructor(message, context) {
20
+ super("MCP_SERVER_ERROR", message, context);
21
+ this.name = "MCPServerError";
22
+ }
23
+ }
24
+ export class ConfigurationError extends YamaV2Error {
25
+ constructor(message, context) {
26
+ super("CONFIGURATION_ERROR", message, context);
27
+ this.name = "ConfigurationError";
28
+ }
29
+ }
30
+ export class ReviewTimeoutError extends YamaV2Error {
31
+ constructor(message, context) {
32
+ super("REVIEW_TIMEOUT", message, context);
33
+ this.name = "ReviewTimeoutError";
34
+ }
35
+ }
36
+ export class TokenBudgetExceededError extends YamaV2Error {
37
+ constructor(message, context) {
38
+ super("TOKEN_BUDGET_EXCEEDED", message, context);
39
+ this.name = "TokenBudgetExceededError";
40
+ }
41
+ }
42
+ //# sourceMappingURL=v2.types.js.map
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Observability Configuration Builder
3
+ * Builds NeuroLink observability config from environment variables
4
+ */
5
+ export interface ObservabilityConfig {
6
+ langfuse?: {
7
+ publicKey: string;
8
+ secretKey: string;
9
+ baseUrl?: string;
10
+ enabled: boolean;
11
+ };
12
+ }
13
+ /**
14
+ * Build observability config from environment variables
15
+ * Returns null if observability is not configured
16
+ */
17
+ export declare function buildObservabilityConfigFromEnv(): ObservabilityConfig | null;
18
+ /**
19
+ * Validate observability configuration
20
+ */
21
+ export declare function validateObservabilityConfig(config: ObservabilityConfig | null): boolean;
22
+ //# sourceMappingURL=ObservabilityConfig.d.ts.map
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Observability Configuration Builder
3
+ * Builds NeuroLink observability config from environment variables
4
+ */
5
+ /**
6
+ * Build observability config from environment variables
7
+ * Returns null if observability is not configured
8
+ */
9
+ export function buildObservabilityConfigFromEnv() {
10
+ const langfusePublicKey = process.env.LANGFUSE_PUBLIC_KEY;
11
+ const langfuseSecretKey = process.env.LANGFUSE_SECRET_KEY;
12
+ const langfuseBaseUrl = process.env.LANGFUSE_BASE_URL;
13
+ const langfuseEnabled = process.env.LANGFUSE_ENABLED !== "false"; // Default to true if keys present
14
+ // Check if Langfuse is configured
15
+ if (langfusePublicKey && langfuseSecretKey) {
16
+ return {
17
+ langfuse: {
18
+ publicKey: langfusePublicKey,
19
+ secretKey: langfuseSecretKey,
20
+ baseUrl: langfuseBaseUrl || "https://cloud.langfuse.com",
21
+ enabled: langfuseEnabled,
22
+ },
23
+ };
24
+ }
25
+ // No observability configured
26
+ return null;
27
+ }
28
+ /**
29
+ * Validate observability configuration
30
+ */
31
+ export function validateObservabilityConfig(config) {
32
+ if (!config) {
33
+ return true; // No config is valid (observability is optional)
34
+ }
35
+ if (config.langfuse) {
36
+ const { publicKey, secretKey, baseUrl } = config.langfuse;
37
+ if (!publicKey || !secretKey) {
38
+ console.error("❌ Langfuse observability config invalid: missing publicKey or secretKey");
39
+ return false;
40
+ }
41
+ if (baseUrl && !baseUrl.startsWith("http")) {
42
+ console.error("❌ Langfuse observability config invalid: baseUrl must start with http/https");
43
+ return false;
44
+ }
45
+ }
46
+ return true;
47
+ }
48
+ //# sourceMappingURL=ObservabilityConfig.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juspay/yama",
3
- "version": "1.6.0",
3
+ "version": "2.1.0",
4
4
  "description": "Enterprise-grade Pull Request automation toolkit with AI-powered code review and description enhancement",
5
5
  "keywords": [
6
6
  "pr",
@@ -28,10 +28,7 @@
28
28
  "main": "dist/index.js",
29
29
  "types": "dist/index.d.ts",
30
30
  "bin": {
31
- "yama": "dist/cli/index.js",
32
- "pr-guardian": "dist/cli/index.js",
33
- "pr-police": "dist/cli/index.js",
34
- "pr-scribe": "dist/cli/index.js"
31
+ "yama": "dist/cli/v2.cli.js"
35
32
  },
36
33
  "directories": {
37
34
  "test": "tests"
@@ -46,11 +43,14 @@
46
43
  "README.md",
47
44
  "CHANGELOG.md",
48
45
  "LICENSE",
49
- "yama.config.example.yaml"
46
+ "yama.config.example.yaml",
47
+ ".mcp-config.example.json",
48
+ "docs/v2"
50
49
  ],
51
50
  "scripts": {
52
51
  "build": "tsc && tsc-alias",
53
- "dev": "ts-node-dev --respawn --transpile-only src/cli/index.ts",
52
+ "dev": "tsx watch src/cli/v2.cli.ts",
53
+ "dev:run": "tsx src/cli/v2.cli.ts",
54
54
  "test": "jest",
55
55
  "lint": "eslint .",
56
56
  "lint:fix": "eslint . --fix",
@@ -83,8 +83,10 @@
83
83
  "check:all": "npm run lint && npm run format --check && npm run validate && npm run validate:commit"
84
84
  },
85
85
  "dependencies": {
86
- "@juspay/neurolink": "^7.40.1",
87
- "@nexus2520/bitbucket-mcp-server": "^0.10.0",
86
+ "@juspay/neurolink": "^8.23.1",
87
+ "langfuse": "^3.35.0",
88
+ "@nexus2520/bitbucket-mcp-server": "^1.1.2",
89
+ "@nexus2520/jira-mcp-server": "^1.0.1",
88
90
  "chalk": "^4.1.2",
89
91
  "commander": "^11.0.0",
90
92
  "debug": "^4.3.4",
@@ -125,6 +127,7 @@
125
127
  "ts-node": "^10.0.0",
126
128
  "ts-node-dev": "^2.0.0",
127
129
  "tsc-alias": "^1.8.0",
130
+ "tsx": "^4.20.6",
128
131
  "typedoc": "^0.25.0",
129
132
  "typescript": "^5.0.0"
130
133
  },
@@ -148,7 +151,10 @@
148
151
  "pnpm": {
149
152
  "onlyBuiltDependencies": [
150
153
  "esbuild"
151
- ]
154
+ ],
155
+ "overrides": {
156
+ "@semantic-release/npm": "^13.1.2"
157
+ }
152
158
  },
153
159
  "lint-staged": {
154
160
  "*.{ts,tsx,js,jsx}": [