atlas-pipeline-mcp 1.0.19 → 1.0.20

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,352 @@
1
+ /**
2
+ * Atlas Server - Resource Management and Cleanup
3
+ *
4
+ * Comprehensive resource lifecycle management to prevent memory leaks:
5
+ * - Automatic cleanup of resources
6
+ * - Graceful shutdown handling
7
+ * - Resource pooling and recycling
8
+ * - Memory usage tracking
9
+ * - File handle management
10
+ *
11
+ * @module resource-manager
12
+ * @version 1.0.0
13
+ */
14
+ import { logger } from '../utils.js';
15
+ /**
16
+ * Git instance wrapper with lifecycle management
17
+ */
18
+ export class ManagedGitInstance {
19
+ repoPath;
20
+ git;
21
+ id;
22
+ type = 'git-instance';
23
+ createdAt;
24
+ lastAccessedAt;
25
+ constructor(repoPath, git) {
26
+ this.repoPath = repoPath;
27
+ this.git = git;
28
+ this.id = `git:${repoPath}`;
29
+ this.createdAt = Date.now();
30
+ this.lastAccessedAt = Date.now();
31
+ }
32
+ /** Get the git instance and update access time */
33
+ getGit() {
34
+ this.lastAccessedAt = Date.now();
35
+ return this.git;
36
+ }
37
+ /** Check if instance is still valid */
38
+ isValid() {
39
+ // Git instances don't expire but can be invalidated
40
+ return this.git !== null;
41
+ }
42
+ /** Cleanup the git instance */
43
+ async cleanup() {
44
+ logger.debug({ repoPath: this.repoPath }, 'Cleaning up git instance');
45
+ // SimpleGit doesn't require explicit cleanup, but we null it out
46
+ this.git = null;
47
+ }
48
+ }
49
+ // ============================================================================
50
+ // Resource Manager
51
+ // ============================================================================
52
+ /**
53
+ * Centralized resource manager for automatic cleanup
54
+ */
55
+ export class ResourceManager {
56
+ options;
57
+ resources = new Map();
58
+ cleanupTimer = null;
59
+ shutdownHandlers = [];
60
+ isShuttingDown = false;
61
+ constructor(options = {}) {
62
+ this.options = options;
63
+ const { cleanupIntervalMs = 60000, // 1 minute
64
+ maxIdleTimeMs = 300000, // 5 minutes
65
+ maxResources = 100, } = options;
66
+ // Start periodic cleanup
67
+ this.cleanupTimer = setInterval(() => {
68
+ this.performCleanup(maxIdleTimeMs, maxResources);
69
+ }, cleanupIntervalMs);
70
+ // Register shutdown handler
71
+ this.registerShutdownHandlers();
72
+ }
73
+ /**
74
+ * Register a resource for management
75
+ */
76
+ register(resource) {
77
+ if (this.isShuttingDown) {
78
+ logger.warn('Cannot register resource during shutdown');
79
+ return;
80
+ }
81
+ this.resources.set(resource.id, resource);
82
+ logger.debug({ id: resource.id, type: resource.type, totalResources: this.resources.size }, 'Resource registered');
83
+ }
84
+ /**
85
+ * Unregister and cleanup a resource
86
+ */
87
+ async unregister(id) {
88
+ const resource = this.resources.get(id);
89
+ if (resource) {
90
+ await this.cleanupResource(resource);
91
+ this.resources.delete(id);
92
+ }
93
+ }
94
+ /**
95
+ * Get a resource by ID
96
+ */
97
+ get(id) {
98
+ const resource = this.resources.get(id);
99
+ if (resource) {
100
+ resource.lastAccessedAt = Date.now();
101
+ return resource;
102
+ }
103
+ return null;
104
+ }
105
+ /**
106
+ * Check if a resource exists
107
+ */
108
+ has(id) {
109
+ return this.resources.has(id);
110
+ }
111
+ /**
112
+ * Get all resources of a specific type
113
+ */
114
+ getByType(type) {
115
+ const results = [];
116
+ for (const resource of this.resources.values()) {
117
+ if (resource.type === type) {
118
+ results.push(resource);
119
+ }
120
+ }
121
+ return results;
122
+ }
123
+ /**
124
+ * Perform periodic cleanup of idle resources
125
+ */
126
+ async performCleanup(maxIdleTimeMs, maxResources) {
127
+ const now = Date.now();
128
+ const resourcesToCleanup = [];
129
+ // Find resources to cleanup
130
+ for (const resource of this.resources.values()) {
131
+ const idleTime = now - resource.lastAccessedAt;
132
+ // Cleanup invalid or idle resources
133
+ if (!resource.isValid() || idleTime > maxIdleTimeMs) {
134
+ resourcesToCleanup.push(resource);
135
+ }
136
+ }
137
+ // If still over limit after idle cleanup, cleanup LRU resources
138
+ if (this.resources.size > maxResources) {
139
+ const sorted = Array.from(this.resources.values())
140
+ .filter((r) => !resourcesToCleanup.includes(r))
141
+ .sort((a, b) => a.lastAccessedAt - b.lastAccessedAt);
142
+ const excess = this.resources.size - maxResources;
143
+ resourcesToCleanup.push(...sorted.slice(0, excess));
144
+ }
145
+ // Cleanup resources
146
+ if (resourcesToCleanup.length > 0) {
147
+ logger.debug({ count: resourcesToCleanup.length, totalResources: this.resources.size }, 'Performing resource cleanup');
148
+ for (const resource of resourcesToCleanup) {
149
+ await this.cleanupResource(resource);
150
+ this.resources.delete(resource.id);
151
+ }
152
+ }
153
+ }
154
+ /**
155
+ * Cleanup a single resource
156
+ */
157
+ async cleanupResource(resource) {
158
+ try {
159
+ await resource.cleanup();
160
+ logger.debug({ id: resource.id, type: resource.type }, 'Resource cleaned up');
161
+ }
162
+ catch (error) {
163
+ logger.error({ error, id: resource.id, type: resource.type }, 'Error cleaning up resource');
164
+ }
165
+ }
166
+ /**
167
+ * Register a custom shutdown handler
168
+ */
169
+ onShutdown(handler) {
170
+ this.shutdownHandlers.push(handler);
171
+ }
172
+ /**
173
+ * Graceful shutdown - cleanup all resources
174
+ */
175
+ async shutdown() {
176
+ if (this.isShuttingDown) {
177
+ logger.warn('Shutdown already in progress');
178
+ return;
179
+ }
180
+ this.isShuttingDown = true;
181
+ logger.info({ resourceCount: this.resources.size }, 'Starting graceful shutdown');
182
+ // Stop cleanup timer
183
+ if (this.cleanupTimer) {
184
+ clearInterval(this.cleanupTimer);
185
+ this.cleanupTimer = null;
186
+ }
187
+ // Run custom shutdown handlers
188
+ for (const handler of this.shutdownHandlers) {
189
+ try {
190
+ await handler();
191
+ }
192
+ catch (error) {
193
+ logger.error({ error }, 'Error in shutdown handler');
194
+ }
195
+ }
196
+ // Cleanup all resources
197
+ const cleanupPromises = Array.from(this.resources.values()).map((resource) => this.cleanupResource(resource));
198
+ await Promise.allSettled(cleanupPromises);
199
+ this.resources.clear();
200
+ logger.info('Graceful shutdown complete');
201
+ }
202
+ /**
203
+ * Register signal handlers for graceful shutdown
204
+ */
205
+ registerShutdownHandlers() {
206
+ const signals = ['SIGINT', 'SIGTERM', 'SIGQUIT'];
207
+ for (const signal of signals) {
208
+ process.once(signal, () => {
209
+ logger.info({ signal }, 'Received shutdown signal');
210
+ this.shutdown()
211
+ .then(() => process.exit(0))
212
+ .catch((error) => {
213
+ logger.error({ error }, 'Error during shutdown');
214
+ process.exit(1);
215
+ });
216
+ });
217
+ }
218
+ // Handle uncaught errors
219
+ process.once('uncaughtException', (error) => {
220
+ logger.error({ error }, 'Uncaught exception');
221
+ this.shutdown()
222
+ .then(() => process.exit(1))
223
+ .catch(() => process.exit(1));
224
+ });
225
+ process.once('unhandledRejection', (reason) => {
226
+ logger.error({ reason }, 'Unhandled rejection');
227
+ this.shutdown()
228
+ .then(() => process.exit(1))
229
+ .catch(() => process.exit(1));
230
+ });
231
+ }
232
+ /**
233
+ * Get resource statistics
234
+ */
235
+ getStats() {
236
+ const byType = {};
237
+ let oldestAge = 0;
238
+ const now = Date.now();
239
+ for (const resource of this.resources.values()) {
240
+ byType[resource.type] = (byType[resource.type] || 0) + 1;
241
+ const age = now - resource.createdAt;
242
+ if (age > oldestAge) {
243
+ oldestAge = age;
244
+ }
245
+ }
246
+ return {
247
+ total: this.resources.size,
248
+ byType: byType,
249
+ oldestResourceAge: oldestAge,
250
+ };
251
+ }
252
+ }
253
+ // ============================================================================
254
+ // Global Resource Manager
255
+ // ============================================================================
256
+ /** Global resource manager instance */
257
+ export const globalResourceManager = new ResourceManager({
258
+ cleanupIntervalMs: 60000, // 1 minute
259
+ maxIdleTimeMs: 300000, // 5 minutes
260
+ maxResources: 100,
261
+ });
262
+ // ============================================================================
263
+ // Helper Functions
264
+ // ============================================================================
265
+ /**
266
+ * Create a managed resource with automatic cleanup
267
+ *
268
+ * @param create - Function to create the resource
269
+ * @param cleanup - Function to cleanup the resource
270
+ * @param options - Resource options
271
+ * @returns The created resource
272
+ */
273
+ export async function withManagedResource(create, cleanup, options) {
274
+ const { id, type, autoRegister = true } = options;
275
+ const resource = await create();
276
+ if (autoRegister) {
277
+ const managedResource = {
278
+ id,
279
+ type,
280
+ createdAt: Date.now(),
281
+ lastAccessedAt: Date.now(),
282
+ cleanup: () => cleanup(resource),
283
+ isValid: () => resource !== null && resource !== undefined,
284
+ };
285
+ globalResourceManager.register(managedResource);
286
+ }
287
+ return resource;
288
+ }
289
+ /**
290
+ * Execute a function with automatic resource cleanup
291
+ *
292
+ * @param fn - Function to execute
293
+ * @param resources - Resources to cleanup after execution
294
+ * @returns Result of the function
295
+ */
296
+ export async function withCleanup(fn, resources) {
297
+ try {
298
+ return await fn();
299
+ }
300
+ finally {
301
+ // Cleanup resources in parallel
302
+ await Promise.allSettled(resources.map((resource) => resource.cleanup()));
303
+ }
304
+ }
305
+ /**
306
+ * Memory usage monitor
307
+ */
308
+ export class MemoryMonitor {
309
+ threshold;
310
+ warnings = 0;
311
+ constructor(thresholdMB = 512) {
312
+ this.threshold = thresholdMB * 1024 * 1024; // Convert to bytes
313
+ }
314
+ /**
315
+ * Check current memory usage
316
+ */
317
+ check() {
318
+ const usage = process.memoryUsage();
319
+ const isOverThreshold = usage.heapUsed > this.threshold;
320
+ if (isOverThreshold) {
321
+ this.warnings++;
322
+ logger.warn({
323
+ heapUsedMB: Math.round(usage.heapUsed / 1024 / 1024),
324
+ heapTotalMB: Math.round(usage.heapTotal / 1024 / 1024),
325
+ thresholdMB: Math.round(this.threshold / 1024 / 1024),
326
+ warnings: this.warnings,
327
+ }, 'Memory usage exceeds threshold');
328
+ }
329
+ return {
330
+ heapUsed: usage.heapUsed,
331
+ heapTotal: usage.heapTotal,
332
+ external: usage.external,
333
+ rss: usage.rss,
334
+ isOverThreshold,
335
+ };
336
+ }
337
+ /**
338
+ * Force garbage collection if available
339
+ */
340
+ forceGC() {
341
+ if (global.gc) {
342
+ global.gc();
343
+ logger.debug('Forced garbage collection');
344
+ return true;
345
+ }
346
+ logger.debug('Garbage collection not available (run with --expose-gc)');
347
+ return false;
348
+ }
349
+ }
350
+ /** Global memory monitor */
351
+ export const globalMemoryMonitor = new MemoryMonitor(512);
352
+ //# sourceMappingURL=resource-manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource-manager.js","sourceRoot":"","sources":["../../src/tools/resource-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAsCrC;;GAEG;AACH,MAAM,OAAO,kBAAkB;IAOlB;IACD;IAPD,EAAE,CAAS;IACX,IAAI,GAAiB,cAAc,CAAC;IACpC,SAAS,CAAS;IAC3B,cAAc,CAAS;IAEvB,YACW,QAAgB,EACjB,GAAc;QADb,aAAQ,GAAR,QAAQ,CAAQ;QACjB,QAAG,GAAH,GAAG,CAAW;QAEtB,IAAI,CAAC,EAAE,GAAG,OAAO,QAAQ,EAAE,CAAC;QAC5B,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAC5B,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IACnC,CAAC;IAED,kDAAkD;IAClD,MAAM;QACJ,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QACjC,OAAO,IAAI,CAAC,GAAG,CAAC;IAClB,CAAC;IAED,uCAAuC;IACvC,OAAO;QACL,oDAAoD;QACpD,OAAO,IAAI,CAAC,GAAG,KAAK,IAAI,CAAC;IAC3B,CAAC;IAED,+BAA+B;IAC/B,KAAK,CAAC,OAAO;QACX,MAAM,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,EAAE,0BAA0B,CAAC,CAAC;QACtE,iEAAiE;QAChE,IAAI,CAAC,GAAe,GAAG,IAAI,CAAC;IAC/B,CAAC;CACF;AAED,+EAA+E;AAC/E,mBAAmB;AACnB,+EAA+E;AAE/E;;GAEG;AACH,MAAM,OAAO,eAAe;IAOP;IANX,SAAS,GAAG,IAAI,GAAG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las Server - Testing Utilities and Fixtures
3
+ *
4
+ * Comprehensive testing infrastructure for all tools:
5
+ * - Mock data generators
6
+ * - Test fixtures and helpers
7
+ * - Performance benchmarking
8
+ * - Integration test utilities
9
+ * - Assertion helpers
10
+ *
11
+ * @module test-utils
12
+ * @version 1.0.0
13
+ */
14
+ import type { IntentAnalysis, PipelineContext, GitContext, ProjectInfo, CodeSnippet, DecompositionResult, SolutionVariant, Critique } from '../types.js';
15
+ /**
16
+ * Generate mock intent analysis for testing
17
+ */
18
+ export declare function mockIntentAnalysis(overrides?: Partial<IntentAnalysis>): IntentAnalysis;
19
+ /**
20
+ * Generate mock project info for testing
21
+ */
22
+ export declare function mockProjectInfo(overrides?: Partial<ProjectInfo>): ProjectInfo;
23
+ /**
24
+ * Generate mock git context for testing
25
+ */
26
+ export declare function mockGitContext(overrides?: Partial<GitContext>): GitContext;
27
+ /**
28
+ * Generate mock code snippet for testing
29
+ */
30
+ export declare function mockCodeSnippet(overrides?: Partial<CodeSnippet>): CodeSnippet;
31
+ /**
32
+ * Generate mock pipeline context for testing
33
+ */
34
+ export declare function mockPipelineContext(overrides?: Partial<PipelineContext>): PipelineContext;
35
+ /**
36
+ * Generate mock decomposition result for testing
37
+ */
38
+ export declare function mockDecompositionResult(overrides?: Partial<DecompositionResult>): DecompositionResult;
39
+ /**
40
+ * Generate mock solution variant for testing
41
+ */
42
+ export declare function mockSolutionVariant(overrides?: Partial<SolutionVariant>): SolutionVariant;
43
+ /**
44
+ * Generate mock critique for testing
45
+ */
46
+ export declare function mockCritique(overrides?: Partial<Critique>): Critique;
47
+ /**
48
+ * Measure async function execution time
49
+ */
50
+ export declare function measureTime<T>(fn: () => Promise<T>): Promise<{
51
+ result: T;
52
+ durationMs: number;
53
+ }>;
54
+ /**
55
+ * Assert that a function throws with a specific message
56
+ */
57
+ export declare function assertThrows(fn: () => Promise<unknown> | unknown, expectedMessage?: string | RegExp): Promise<Error>;
58
+ /**
59
+ * Wait for a condition to be true
60
+ */
61
+ export declare function waitFor(condition: () => boolean | Promise<boolean>, options?: {
62
+ timeout?: number;
63
+ interval?: number;
64
+ }): Promise<void>;
65
+ /**
66
+ * Create a spy function that tracks calls
67
+ */
68
+ export declare function createSpy<T extends (...args: any[]) => any>(): {
69
+ spy: T;
70
+ calls: Array<{
71
+ args: Parameters<T>;
72
+ result?: ReturnType<T>;
73
+ error?: Error;
74
+ }>;
75
+ reset: () => void;
76
+ };
77
+ export interface BenchmarkResult {
78
+ name: string;
79
+ iterations: number;
80
+ totalMs: number;
81
+ avgMs: number;
82
+ minMs: number;
83
+ maxMs: number;
84
+ opsPerSecond: number;
85
+ }
86
+ /**
87
+ * Benchmark a function performance
88
+ */
89
+ export declare function benchmark(name: string, fn: () => Promise<void> | void, iterations?: number): Promise<BenchmarkResult>;
90
+ /**
91
+ * Compare multiple function implementations
92
+ */
93
+ export declare function benchmarkCompare(tests: Array<{
94
+ name: string;
95
+ fn: () => Promise<void> | void;
96
+ }>, iterations?: number): Promise<BenchmarkResult[]>;
97
+ /**
98
+ * Print benchmark results to console
99
+ */
100
+ export declare function printBenchmarkResults(results: BenchmarkResult[]): void;
101
+ /**
102
+ * Create a temporary directory for testing
103
+ */
104
+ export declare function createTempDir(): Promise<string>;
105
+ /**
106
+ * Cleanup a temporary directory
107
+ */
108
+ export declare function cleanupTempDir(dir: string): Promise<void>;
109
+ /**
110
+ * Write test file to a directory
111
+ */
112
+ export declare function writeTestFile(dir: string, filename: string, content: string): Promise<string>;
113
+ /**
114
+ * Execute test with automatic cleanup
115
+ */
116
+ export declare function withTestDir<T>(fn: (dir: string) => Promise<T>): Promise<T>;
117
+ /**
118
+ * Assert that two values are deeply equal
119
+ */
120
+ export declare function assertEqual<T>(actual: T, expected: T, message?: string): void;
121
+ /**
122
+ * Assert that a value is truthy
123
+ */
124
+ export declare function assertTrue(value: unknown, message?: string): void;
125
+ /**
126
+ * Assert that a value is falsy
127
+ */
128
+ export declare function assertFalse(value: unknown, message?: string): void;
129
+ /**
130
+ * Assert that a value is defined (not null or undefined)
131
+ */
132
+ export declare function assertDefined<T>(value: T | null | undefined, message?: string): asserts value is T;
133
+ /**
134
+ * Assert that an array contains a value
135
+ */
136
+ export declare function assertContains<T>(array: T[], value: T, message?: string): void;
137
+ /**
138
+ * Assert that a number is within a range
139
+ */
140
+ export declare function assertInRange(value: number, min: number, max: number, message?: string): void;
141
+ /**
142
+ * Mock LLM provider for testing without actual API calls
143
+ */
144
+ export declare class MockLLMProvider {
145
+ private responses;
146
+ callCount: number;
147
+ /**
148
+ * Set a mock response for a specific prompt pattern
149
+ */
150
+ setResponse(pattern: string | RegExp, response: unknown): void;
151
+ /**
152
+ * Mock complete method
153
+ */
154
+ complete(prompt: string): Promise<string>;
155
+ /**
156
+ * Mock completeJson method
157
+ */
158
+ completeJson<T>(prompt: string): Promise<{
159
+ data: T | null;
160
+ }>;
161
+ /**
162
+ * Reset the mock provider
163
+ */
164
+ reset(): void;
165
+ }
166
+ /**
167
+ * Example test suite demonstrating usage
168
+ */
169
+ export declare function exampleTestSuite(): Promise<void>;
170
+ //# sourceMappingURL=test-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-utils.d.ts","sourceRoot":"","sources":["../../src/tools/test-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EACf,UAAU,EACV,WAAW,EACX,WAAW,EACX,mBAAmB,EACnB,eAAe,EACf,QAAQ,EACT,MAAM,aAAa,CAAC;AAMrB;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,GAAG,cAAc,CAYtF;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,GAAG,WAAW,CAS7E;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,UA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