bitbucket-mcp-server 1.0.3 → 1.0.4
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/build/bitbucket-api.js.map +1 -1
- package/build/config.d.ts +4 -4
- package/build/debug-logger.d.ts +82 -0
- package/build/debug-logger.js +289 -0
- package/build/debug-logger.js.map +1 -0
- package/build/error-context.d.ts +195 -0
- package/build/error-context.js +439 -0
- package/build/error-context.js.map +1 -0
- package/build/index.js +4 -873
- package/build/index.js.map +1 -1
- package/build/monitoring/process-monitor.d.ts +12 -0
- package/build/monitoring/process-monitor.js +235 -0
- package/build/monitoring/process-monitor.js.map +1 -0
- package/build/monitoring/protocol-monitor.d.ts +20 -0
- package/build/monitoring/protocol-monitor.js +154 -0
- package/build/monitoring/protocol-monitor.js.map +1 -0
- package/build/monitoring/transport-monitor.d.ts +8 -0
- package/build/monitoring/transport-monitor.js +165 -0
- package/build/monitoring/transport-monitor.js.map +1 -0
- package/build/resource-monitor.d.ts +9 -0
- package/build/resource-monitor.js +104 -0
- package/build/resource-monitor.js.map +1 -0
- package/build/server.d.ts +8 -0
- package/build/server.js +220 -0
- package/build/server.js.map +1 -0
- package/build/tools/index.d.ts +3 -0
- package/build/tools/index.js +754 -0
- package/build/tools/index.js.map +1 -0
- package/build/utils/memory-utils.d.ts +15 -0
- package/build/utils/memory-utils.js +49 -0
- package/build/utils/memory-utils.js.map +1 -0
- package/build/utils/request-tracking.d.ts +22 -0
- package/build/utils/request-tracking.js +105 -0
- package/build/utils/request-tracking.js.map +1 -0
- package/package.json +5 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bitbucket-api.js","sourceRoot":"","sources":["../src/bitbucket-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAsB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"bitbucket-api.js","sourceRoot":"","sources":["../src/bitbucket-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAsB,MA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Default<z.ZodNumber>;
|
|
21
21
|
}, "strip", z.ZodTypeAny, {
|
|
22
|
-
retryDelay: number;
|
|
23
22
|
timeout: number;
|
|
23
|
+
retryDelay: number;
|
|
24
24
|
baseUrl: string;
|
|
25
25
|
retryAttempts: number;
|
|
26
26
|
rateLimitRequests: number;
|
|
27
27
|
rateLimitWindow: number;
|
|
28
28
|
enableMetrics: boolean;
|
|
29
29
|
maxConcurrentRequests: number;
|
|
30
|
-
logLevel: "error" | "
|
|
30
|
+
logLevel: "error" | "warn" | "info" | "debug";
|
|
31
31
|
enableRequestLogging: boolean;
|
|
32
32
|
enableCache: boolean;
|
|
33
33
|
cacheMaxAge: number;
|
|
@@ -35,8 +35,8 @@ declare const configSchema: z.ZodObject<{
|
|
|
35
35
|
username?: string | undefined;
|
|
36
36
|
appPassword?: string | undefined;
|
|
37
37
|
}, {
|
|
38
|
-
retryDelay?: number | undefined;
|
|
39
38
|
timeout?: number | undefined;
|
|
39
|
+
retryDelay?: number | undefined;
|
|
40
40
|
username?: string | undefined;
|
|
41
41
|
appPassword?: string | undefined;
|
|
42
42
|
baseUrl?: string | undefined;
|
|
@@ -45,7 +45,7 @@ declare const configSchema: z.ZodObject<{
|
|
|
45
45
|
rateLimitWindow?: number | undefined;
|
|
46
46
|
enableMetrics?: boolean | undefined;
|
|
47
47
|
maxConcurrentRequests?: number | undefined;
|
|
48
|
-
logLevel?: "error" | "
|
|
48
|
+
logLevel?: "error" | "warn" | "info" | "debug" | undefined;
|
|
49
49
|
enableRequestLogging?: boolean | undefined;
|
|
50
50
|
enableCache?: boolean | undefined;
|
|
51
51
|
cacheMaxAge?: number | undefined;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Debug logger for Bitbucket MCP Server
|
|
3
|
+
*
|
|
4
|
+
* This utility provides structured logging with timestamps and categories
|
|
5
|
+
* specifically designed to avoid interfering with MCP communication.
|
|
6
|
+
* Enhanced version with file logging, log rotation, and better type safety.
|
|
7
|
+
*/
|
|
8
|
+
export type LogLevel = 'none' | 'error' | 'warn' | 'info' | 'debug' | 'trace';
|
|
9
|
+
/**
|
|
10
|
+
* Interface for structured log entries
|
|
11
|
+
*/
|
|
12
|
+
export interface LogEntry {
|
|
13
|
+
timestamp: string;
|
|
14
|
+
level: LogLevel;
|
|
15
|
+
category: string;
|
|
16
|
+
message: string;
|
|
17
|
+
elapsed: number;
|
|
18
|
+
data?: any;
|
|
19
|
+
processId: number;
|
|
20
|
+
memoryUsage?: NodeJS.MemoryUsage;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Interface for logger configuration
|
|
24
|
+
*/
|
|
25
|
+
export interface LoggerConfig {
|
|
26
|
+
level: LogLevel;
|
|
27
|
+
enableFileLogging: boolean;
|
|
28
|
+
logFile?: string;
|
|
29
|
+
maxFileSize: number;
|
|
30
|
+
maxFiles: number;
|
|
31
|
+
enableStructuredLogs: boolean;
|
|
32
|
+
includeMemoryUsage: boolean;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Get current logger configuration
|
|
36
|
+
*/
|
|
37
|
+
export declare function getLoggerConfig(): LoggerConfig;
|
|
38
|
+
/**
|
|
39
|
+
* Log a debug message with category and timestamp
|
|
40
|
+
*/
|
|
41
|
+
export declare function debug(level: LogLevel, category: string, message: string, data?: any): void;
|
|
42
|
+
/**
|
|
43
|
+
* Set a time marker with a label
|
|
44
|
+
*/
|
|
45
|
+
export declare function mark(label: string): void;
|
|
46
|
+
/**
|
|
47
|
+
* Measure time since a previous mark
|
|
48
|
+
*/
|
|
49
|
+
export declare function measure(label: string, fromMark: string): void;
|
|
50
|
+
/**
|
|
51
|
+
* Reset all timing measurements
|
|
52
|
+
*/
|
|
53
|
+
export declare function resetTiming(): void;
|
|
54
|
+
/**
|
|
55
|
+
* Get current timing information
|
|
56
|
+
*/
|
|
57
|
+
export declare function getTimingInfo(): {
|
|
58
|
+
startTime: number;
|
|
59
|
+
marks: Record<string, number>;
|
|
60
|
+
uptime: number;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Flush any pending log writes
|
|
64
|
+
*/
|
|
65
|
+
export declare function flush(): Promise<void>;
|
|
66
|
+
/**
|
|
67
|
+
* Create specialized debug functions for different log levels
|
|
68
|
+
*/
|
|
69
|
+
export declare const logger: {
|
|
70
|
+
error: (category: string, message: string, data?: any) => void;
|
|
71
|
+
warn: (category: string, message: string, data?: any) => void;
|
|
72
|
+
info: (category: string, message: string, data?: any) => void;
|
|
73
|
+
debug: (category: string, message: string, data?: any) => void;
|
|
74
|
+
trace: (category: string, message: string, data?: any) => void;
|
|
75
|
+
mark: typeof mark;
|
|
76
|
+
measure: typeof measure;
|
|
77
|
+
resetTiming: typeof resetTiming;
|
|
78
|
+
getTimingInfo: typeof getTimingInfo;
|
|
79
|
+
flush: typeof flush;
|
|
80
|
+
getConfig: typeof getLoggerConfig;
|
|
81
|
+
};
|
|
82
|
+
export default logger;
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Debug logger for Bitbucket MCP Server
|
|
3
|
+
*
|
|
4
|
+
* This utility provides structured logging with timestamps and categories
|
|
5
|
+
* specifically designed to avoid interfering with MCP communication.
|
|
6
|
+
* Enhanced version with file logging, log rotation, and better type safety.
|
|
7
|
+
*/
|
|
8
|
+
import * as fs from 'fs';
|
|
9
|
+
import * as path from 'path';
|
|
10
|
+
// Log levels in order of verbosity
|
|
11
|
+
const LEVELS = {
|
|
12
|
+
none: 0,
|
|
13
|
+
error: 1,
|
|
14
|
+
warn: 2,
|
|
15
|
+
info: 3,
|
|
16
|
+
debug: 4,
|
|
17
|
+
trace: 5
|
|
18
|
+
};
|
|
19
|
+
// Environment configuration
|
|
20
|
+
const DEBUG_LEVEL = (process.env.BITBUCKET_MCP_DEBUG_LEVEL || 'info');
|
|
21
|
+
const DEBUG_FILE = process.env.BITBUCKET_MCP_DEBUG_FILE || '';
|
|
22
|
+
const DEBUG_FILE_MAX_SIZE = parseInt(process.env.BITBUCKET_MCP_DEBUG_FILE_MAX_SIZE || '10485760', 10); // 10MB default
|
|
23
|
+
const DEBUG_FILE_MAX_FILES = parseInt(process.env.BITBUCKET_MCP_DEBUG_FILE_MAX_FILES || '5', 10); // 5 files default
|
|
24
|
+
const ENABLE_STRUCTURED_LOGS = process.env.BITBUCKET_MCP_STRUCTURED_LOGS === 'true';
|
|
25
|
+
// Current logging level
|
|
26
|
+
const currentLevel = LEVELS[DEBUG_LEVEL] || LEVELS.info;
|
|
27
|
+
// Track execution flow with timestamps
|
|
28
|
+
let startTime = Date.now();
|
|
29
|
+
const timemarks = {};
|
|
30
|
+
// File logging state
|
|
31
|
+
let logFileHandle = null;
|
|
32
|
+
let currentLogFileSize = 0;
|
|
33
|
+
/**
|
|
34
|
+
* Get current logger configuration
|
|
35
|
+
*/
|
|
36
|
+
export function getLoggerConfig() {
|
|
37
|
+
return {
|
|
38
|
+
level: DEBUG_LEVEL,
|
|
39
|
+
enableFileLogging: !!DEBUG_FILE,
|
|
40
|
+
logFile: DEBUG_FILE,
|
|
41
|
+
maxFileSize: DEBUG_FILE_MAX_SIZE,
|
|
42
|
+
maxFiles: DEBUG_FILE_MAX_FILES,
|
|
43
|
+
enableStructuredLogs: ENABLE_STRUCTURED_LOGS,
|
|
44
|
+
includeMemoryUsage: currentLevel >= LEVELS.debug
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Initialize file logging if configured
|
|
49
|
+
*/
|
|
50
|
+
function initializeFileLogging() {
|
|
51
|
+
if (!DEBUG_FILE)
|
|
52
|
+
return;
|
|
53
|
+
try {
|
|
54
|
+
// Ensure log directory exists
|
|
55
|
+
const logDir = path.dirname(DEBUG_FILE);
|
|
56
|
+
if (!fs.existsSync(logDir)) {
|
|
57
|
+
fs.mkdirSync(logDir, { recursive: true });
|
|
58
|
+
}
|
|
59
|
+
// Check current file size
|
|
60
|
+
if (fs.existsSync(DEBUG_FILE)) {
|
|
61
|
+
const stats = fs.statSync(DEBUG_FILE);
|
|
62
|
+
currentLogFileSize = stats.size;
|
|
63
|
+
// Rotate if file is too large
|
|
64
|
+
if (currentLogFileSize >= DEBUG_FILE_MAX_SIZE) {
|
|
65
|
+
rotateLogFile();
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
// Create write stream
|
|
69
|
+
logFileHandle = fs.createWriteStream(DEBUG_FILE, { flags: 'a' });
|
|
70
|
+
logFileHandle.on('error', (err) => {
|
|
71
|
+
console.error(`[DEBUG-LOGGER] Failed to write to log file: ${err.message}`);
|
|
72
|
+
logFileHandle = null;
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
catch (error) {
|
|
76
|
+
console.error(`[DEBUG-LOGGER] Failed to initialize file logging: ${error}`);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Rotate log files when they get too large
|
|
81
|
+
*/
|
|
82
|
+
function rotateLogFile() {
|
|
83
|
+
if (!DEBUG_FILE)
|
|
84
|
+
return;
|
|
85
|
+
try {
|
|
86
|
+
// Close current handle
|
|
87
|
+
if (logFileHandle) {
|
|
88
|
+
logFileHandle.end();
|
|
89
|
+
logFileHandle = null;
|
|
90
|
+
}
|
|
91
|
+
// Rotate existing files
|
|
92
|
+
for (let i = DEBUG_FILE_MAX_FILES - 1; i >= 1; i--) {
|
|
93
|
+
const oldFile = `${DEBUG_FILE}.${i}`;
|
|
94
|
+
const newFile = `${DEBUG_FILE}.${i + 1}`;
|
|
95
|
+
if (fs.existsSync(oldFile)) {
|
|
96
|
+
if (i === DEBUG_FILE_MAX_FILES - 1) {
|
|
97
|
+
// Delete the oldest file
|
|
98
|
+
fs.unlinkSync(oldFile);
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
fs.renameSync(oldFile, newFile);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
// Move current file to .1
|
|
106
|
+
if (fs.existsSync(DEBUG_FILE)) {
|
|
107
|
+
fs.renameSync(DEBUG_FILE, `${DEBUG_FILE}.1`);
|
|
108
|
+
}
|
|
109
|
+
// Reset size counter
|
|
110
|
+
currentLogFileSize = 0;
|
|
111
|
+
// Reinitialize
|
|
112
|
+
initializeFileLogging();
|
|
113
|
+
}
|
|
114
|
+
catch (error) {
|
|
115
|
+
console.error(`[DEBUG-LOGGER] Failed to rotate log file: ${error}`);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Write to log file if configured
|
|
120
|
+
*/
|
|
121
|
+
function writeToFile(message) {
|
|
122
|
+
if (!logFileHandle)
|
|
123
|
+
return;
|
|
124
|
+
try {
|
|
125
|
+
const logLine = `${message}\n`;
|
|
126
|
+
logFileHandle.write(logLine);
|
|
127
|
+
currentLogFileSize += Buffer.byteLength(logLine, 'utf8');
|
|
128
|
+
// Check if rotation is needed
|
|
129
|
+
if (currentLogFileSize >= DEBUG_FILE_MAX_SIZE) {
|
|
130
|
+
rotateLogFile();
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
catch (error) {
|
|
134
|
+
console.error(`[DEBUG-LOGGER] Failed to write to log file: ${error}`);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Create a structured log entry
|
|
139
|
+
*/
|
|
140
|
+
function createLogEntry(level, category, message, data) {
|
|
141
|
+
const config = getLoggerConfig();
|
|
142
|
+
const entry = {
|
|
143
|
+
timestamp: new Date().toISOString(),
|
|
144
|
+
level,
|
|
145
|
+
category,
|
|
146
|
+
message,
|
|
147
|
+
elapsed: Date.now() - startTime,
|
|
148
|
+
processId: process.pid
|
|
149
|
+
};
|
|
150
|
+
if (data !== undefined) {
|
|
151
|
+
entry.data = data;
|
|
152
|
+
}
|
|
153
|
+
if (config.includeMemoryUsage) {
|
|
154
|
+
entry.memoryUsage = process.memoryUsage();
|
|
155
|
+
}
|
|
156
|
+
return entry;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Format log message for console output
|
|
160
|
+
*/
|
|
161
|
+
function formatConsoleMessage(entry) {
|
|
162
|
+
let logMessage = `[${entry.timestamp}] [${entry.level.toUpperCase()}] [${entry.category}] +${entry.elapsed}ms: ${entry.message}`;
|
|
163
|
+
if (entry.data !== undefined) {
|
|
164
|
+
if (typeof entry.data === 'object') {
|
|
165
|
+
try {
|
|
166
|
+
const dataStr = JSON.stringify(entry.data, null, 2);
|
|
167
|
+
logMessage += `\n${dataStr.length > 1000 ? dataStr.substring(0, 1000) + '...[truncated]' : dataStr}`;
|
|
168
|
+
}
|
|
169
|
+
catch (err) {
|
|
170
|
+
logMessage += '\n[Object cannot be stringified]';
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
logMessage += `\n${entry.data}`;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
if (entry.memoryUsage && currentLevel >= LEVELS.trace) {
|
|
178
|
+
const mem = entry.memoryUsage;
|
|
179
|
+
logMessage += `\n[Memory: RSS=${Math.round(mem.rss / 1024 / 1024)}MB, Heap=${Math.round(mem.heapUsed / 1024 / 1024)}MB/${Math.round(mem.heapTotal / 1024 / 1024)}MB]`;
|
|
180
|
+
}
|
|
181
|
+
return logMessage;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Log a debug message with category and timestamp
|
|
185
|
+
*/
|
|
186
|
+
export function debug(level, category, message, data) {
|
|
187
|
+
if (LEVELS[level] <= currentLevel) {
|
|
188
|
+
const entry = createLogEntry(level, category, message, data);
|
|
189
|
+
// Console output (always to stderr)
|
|
190
|
+
const consoleMessage = formatConsoleMessage(entry);
|
|
191
|
+
console.error(consoleMessage);
|
|
192
|
+
// File output
|
|
193
|
+
if (DEBUG_FILE) {
|
|
194
|
+
const fileMessage = ENABLE_STRUCTURED_LOGS
|
|
195
|
+
? JSON.stringify(entry)
|
|
196
|
+
: consoleMessage;
|
|
197
|
+
writeToFile(fileMessage);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Set a time marker with a label
|
|
203
|
+
*/
|
|
204
|
+
export function mark(label) {
|
|
205
|
+
timemarks[label] = Date.now();
|
|
206
|
+
if (currentLevel >= LEVELS.debug) {
|
|
207
|
+
debug('debug', 'timing', `Mark: ${label}`);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Measure time since a previous mark
|
|
212
|
+
*/
|
|
213
|
+
export function measure(label, fromMark) {
|
|
214
|
+
if (timemarks[fromMark]) {
|
|
215
|
+
const elapsed = Date.now() - timemarks[fromMark];
|
|
216
|
+
debug('info', 'timing', `${label}: ${elapsed}ms since ${fromMark}`, {
|
|
217
|
+
measurementLabel: label,
|
|
218
|
+
fromMark,
|
|
219
|
+
elapsedMs: elapsed
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
else {
|
|
223
|
+
debug('warn', 'timing', `Cannot measure ${label}, mark "${fromMark}" not found`, {
|
|
224
|
+
measurementLabel: label,
|
|
225
|
+
fromMark,
|
|
226
|
+
availableMarks: Object.keys(timemarks)
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Reset all timing measurements
|
|
232
|
+
*/
|
|
233
|
+
export function resetTiming() {
|
|
234
|
+
const oldStartTime = startTime;
|
|
235
|
+
startTime = Date.now();
|
|
236
|
+
const oldMarks = { ...timemarks };
|
|
237
|
+
Object.keys(timemarks).forEach(key => delete timemarks[key]);
|
|
238
|
+
debug('info', 'timing', 'Timing measurements reset', {
|
|
239
|
+
previousStartTime: new Date(oldStartTime).toISOString(),
|
|
240
|
+
newStartTime: new Date(startTime).toISOString(),
|
|
241
|
+
clearedMarks: Object.keys(oldMarks)
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Get current timing information
|
|
246
|
+
*/
|
|
247
|
+
export function getTimingInfo() {
|
|
248
|
+
return {
|
|
249
|
+
startTime,
|
|
250
|
+
marks: { ...timemarks },
|
|
251
|
+
uptime: Date.now() - startTime
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Flush any pending log writes
|
|
256
|
+
*/
|
|
257
|
+
export function flush() {
|
|
258
|
+
return new Promise((resolve) => {
|
|
259
|
+
if (logFileHandle) {
|
|
260
|
+
logFileHandle.once('finish', resolve);
|
|
261
|
+
logFileHandle.end();
|
|
262
|
+
logFileHandle = null;
|
|
263
|
+
}
|
|
264
|
+
else {
|
|
265
|
+
resolve();
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Create specialized debug functions for different log levels
|
|
271
|
+
*/
|
|
272
|
+
export const logger = {
|
|
273
|
+
error: (category, message, data) => debug('error', category, message, data),
|
|
274
|
+
warn: (category, message, data) => debug('warn', category, message, data),
|
|
275
|
+
info: (category, message, data) => debug('info', category, message, data),
|
|
276
|
+
debug: (category, message, data) => debug('debug', category, message, data),
|
|
277
|
+
trace: (category, message, data) => debug('trace', category, message, data),
|
|
278
|
+
mark,
|
|
279
|
+
measure,
|
|
280
|
+
resetTiming,
|
|
281
|
+
getTimingInfo,
|
|
282
|
+
flush,
|
|
283
|
+
getConfig: getLoggerConfig
|
|
284
|
+
};
|
|
285
|
+
// Initialize file logging on module load
|
|
286
|
+
initializeFileLogging();
|
|
287
|
+
// Export for CommonJS compatibility
|
|
288
|
+
export default logger;
|
|
289
|
+
//# sourceMappingURL=debug-logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug-logger.js","sourceRoot":"","sources":["../src/debug-logger.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAK7B,mCAAmC;AACnC,MAAM,MAAM,GAA6B;IACrC,IAAI,EAAE,CAAC;I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,CAAC;IAC/F,IAAI,EAAE,CAAC,QAAgB,EAAE,OAAe,EAAE,IAAU,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,CAAC;IAC/F,KAAK,EAAE,CAAC,QAAgB,EAAE,OAAe,EAAE,IAAU,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,CAAC;IACjG,KAAK,EAAE,CAAC,QAAgB,EAAE,OAAe,EAAE,IAAU,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,CAAC;IACjG,IAAI;IACJ,OAAO;IACP,WAAW;IACX,aAAa;IACb,KAAK;IACL,SAAS,EAAE,eAAe;CAC7B,CAAC;AAEF,yCAAyC;AACzC,qBAAqB,EAAE,CAAC;AAExB,oCAAoC;AACpC,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error Context Enhancement System for Bitbucket MCP Server
|
|
3
|
+
*
|
|
4
|
+
* This module provides comprehensive error logging with:
|
|
5
|
+
* - Full stack traces
|
|
6
|
+
* - Error categorization (network, timeout, protocol, application)
|
|
7
|
+
* - Error frequency and pattern tracking
|
|
8
|
+
* - Context preservation (what was happening when error occurred)
|
|
9
|
+
* - Error correlation across system components
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Error categories for classification
|
|
13
|
+
*/
|
|
14
|
+
export declare enum ErrorCategory {
|
|
15
|
+
NETWORK = "network",
|
|
16
|
+
TIMEOUT = "timeout",
|
|
17
|
+
PROTOCOL = "protocol",
|
|
18
|
+
APPLICATION = "application",
|
|
19
|
+
AUTHENTICATION = "authentication",
|
|
20
|
+
VALIDATION = "validation",
|
|
21
|
+
RATE_LIMIT = "rate_limit",
|
|
22
|
+
UNKNOWN = "unknown"
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Severity levels for errors
|
|
26
|
+
*/
|
|
27
|
+
export declare enum ErrorSeverity {
|
|
28
|
+
LOW = "low",
|
|
29
|
+
MEDIUM = "medium",
|
|
30
|
+
HIGH = "high",
|
|
31
|
+
CRITICAL = "critical"
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Error context information
|
|
35
|
+
*/
|
|
36
|
+
export interface ErrorContext {
|
|
37
|
+
operation: string;
|
|
38
|
+
component: string;
|
|
39
|
+
tool?: string;
|
|
40
|
+
endpoint?: string;
|
|
41
|
+
userId?: string;
|
|
42
|
+
requestId?: string;
|
|
43
|
+
method?: string;
|
|
44
|
+
url?: string;
|
|
45
|
+
headers?: Record<string, string>;
|
|
46
|
+
payload?: any;
|
|
47
|
+
memoryUsage?: NodeJS.MemoryUsage;
|
|
48
|
+
timestamp: number;
|
|
49
|
+
processId: number;
|
|
50
|
+
metadata?: Record<string, any>;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Enhanced error information
|
|
54
|
+
*/
|
|
55
|
+
export interface EnhancedError {
|
|
56
|
+
id: string;
|
|
57
|
+
message: string;
|
|
58
|
+
category: ErrorCategory;
|
|
59
|
+
severity: ErrorSeverity;
|
|
60
|
+
stack?: string;
|
|
61
|
+
cause?: string;
|
|
62
|
+
context: ErrorContext;
|
|
63
|
+
timestamp: number;
|
|
64
|
+
duration?: number;
|
|
65
|
+
correlationId?: string;
|
|
66
|
+
parentErrorId?: string;
|
|
67
|
+
occurrenceCount: number;
|
|
68
|
+
firstOccurrence: number;
|
|
69
|
+
lastOccurrence: number;
|
|
70
|
+
resolved: boolean;
|
|
71
|
+
resolution?: string;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Error pattern for tracking recurring issues
|
|
75
|
+
*/
|
|
76
|
+
export interface ErrorPattern {
|
|
77
|
+
id: string;
|
|
78
|
+
signature: string;
|
|
79
|
+
category: ErrorCategory;
|
|
80
|
+
frequency: number;
|
|
81
|
+
firstSeen: number;
|
|
82
|
+
lastSeen: number;
|
|
83
|
+
examples: string[];
|
|
84
|
+
trend: 'increasing' | 'decreasing' | 'stable';
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Error correlation tracking
|
|
88
|
+
*/
|
|
89
|
+
export interface ErrorCorrelation {
|
|
90
|
+
id: string;
|
|
91
|
+
errors: string[];
|
|
92
|
+
component: string;
|
|
93
|
+
timeWindow: number;
|
|
94
|
+
pattern: string;
|
|
95
|
+
impact: 'low' | 'medium' | 'high';
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Error Context Manager - Central error tracking and enhancement system
|
|
99
|
+
*/
|
|
100
|
+
declare class ErrorContextManager {
|
|
101
|
+
private errors;
|
|
102
|
+
private patterns;
|
|
103
|
+
private correlations;
|
|
104
|
+
private errorCounter;
|
|
105
|
+
private readonly maxErrorHistory;
|
|
106
|
+
private readonly patternDetectionWindow;
|
|
107
|
+
private readonly correlationWindow;
|
|
108
|
+
/**
|
|
109
|
+
* Generate unique error ID
|
|
110
|
+
*/
|
|
111
|
+
private generateErrorId;
|
|
112
|
+
/**
|
|
113
|
+
* Generate error signature for pattern detection
|
|
114
|
+
*/
|
|
115
|
+
private generateErrorSignature;
|
|
116
|
+
/**
|
|
117
|
+
* Categorize error based on type and context
|
|
118
|
+
*/
|
|
119
|
+
private categorizeError;
|
|
120
|
+
/**
|
|
121
|
+
* Determine error severity
|
|
122
|
+
*/
|
|
123
|
+
private determineSeverity;
|
|
124
|
+
/**
|
|
125
|
+
* Record and enhance an error with full context
|
|
126
|
+
*/
|
|
127
|
+
recordError(error: Error, context: ErrorContext, correlationId?: string): EnhancedError;
|
|
128
|
+
/**
|
|
129
|
+
* Update error pattern tracking
|
|
130
|
+
*/
|
|
131
|
+
private updateErrorPattern;
|
|
132
|
+
/**
|
|
133
|
+
* Update pattern trend analysis
|
|
134
|
+
*/
|
|
135
|
+
private updatePatternTrend;
|
|
136
|
+
/**
|
|
137
|
+
* Detect error correlations across components
|
|
138
|
+
*/
|
|
139
|
+
private detectCorrelations;
|
|
140
|
+
/**
|
|
141
|
+
* Determine correlation impact level
|
|
142
|
+
*/
|
|
143
|
+
private determineCorrelationImpact;
|
|
144
|
+
/**
|
|
145
|
+
* Log enhanced error with full context
|
|
146
|
+
*/
|
|
147
|
+
private logEnhancedError;
|
|
148
|
+
/**
|
|
149
|
+
* Cleanup old errors to prevent memory leaks
|
|
150
|
+
*/
|
|
151
|
+
private cleanupOldErrors;
|
|
152
|
+
/**
|
|
153
|
+
* Get error statistics and patterns
|
|
154
|
+
*/
|
|
155
|
+
getErrorStatistics(): {
|
|
156
|
+
totalErrors: number;
|
|
157
|
+
errorsByCategory: Record<ErrorCategory, number>;
|
|
158
|
+
errorsBySeverity: Record<ErrorSeverity, number>;
|
|
159
|
+
errorsByComponent: Record<string, number>;
|
|
160
|
+
topPatterns: ErrorPattern[];
|
|
161
|
+
activeCorrelations: ErrorCorrelation[];
|
|
162
|
+
trendsAnalysis: {
|
|
163
|
+
increasingPatterns: number;
|
|
164
|
+
criticalErrors: number;
|
|
165
|
+
correlatedErrors: number;
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
/**
|
|
169
|
+
* Get specific error by ID
|
|
170
|
+
*/
|
|
171
|
+
getError(errorId: string): EnhancedError | undefined;
|
|
172
|
+
/**
|
|
173
|
+
* Get recent errors
|
|
174
|
+
*/
|
|
175
|
+
getRecentErrors(limit?: number): EnhancedError[];
|
|
176
|
+
/**
|
|
177
|
+
* Mark error as resolved
|
|
178
|
+
*/
|
|
179
|
+
resolveError(errorId: string, resolution: string): boolean;
|
|
180
|
+
}
|
|
181
|
+
declare const errorContextManager: ErrorContextManager;
|
|
182
|
+
/**
|
|
183
|
+
* Helper function to record an error with context
|
|
184
|
+
*/
|
|
185
|
+
export declare function recordError(error: Error, operation: string, component: string, additionalContext?: Partial<ErrorContext>, correlationId?: string): EnhancedError;
|
|
186
|
+
/**
|
|
187
|
+
* Helper function to create error context for tool operations
|
|
188
|
+
*/
|
|
189
|
+
export declare function createToolErrorContext(toolName: string, endpoint: string, method?: string, additionalContext?: Partial<ErrorContext>): Partial<ErrorContext>;
|
|
190
|
+
/**
|
|
191
|
+
* Helper function to create error context for API operations
|
|
192
|
+
*/
|
|
193
|
+
export declare function createApiErrorContext(endpoint: string, method: string, additionalContext?: Partial<ErrorContext>): Partial<ErrorContext>;
|
|
194
|
+
export { errorContextManager, ErrorContextManager };
|
|
195
|
+
export default errorContextManager;
|