UNPKG

@wonderwhy-er/desktop-commander

Version:

MCP server for terminal operations and file editing

27 lines (26 loc) 1.11 kB
/** * Sanitizes error objects to remove potentially sensitive information like file paths * @param error Error object or string to sanitize * @returns An object with sanitized message and optional error code */ export declare function sanitizeError(error: any): { message: string; code?: string; }; /** * Send an event to Google Analytics * @param event Event name * @param properties Optional event properties */ export declare const capture: (event: string, properties?: any) => Promise<void>; /** * Executes a promise with a timeout. If the promise doesn't resolve or reject within * the specified timeout, returns the provided default value. * * @param operation The promise to execute * @param timeoutMs Timeout in milliseconds * @param operationName Name of the operation (for logs) * @param defaultValue Value to return if the operation times out * @returns Promise that resolves with the operation result or the default value on timeout */ export declare function withTimeout<T>(operation: Promise<T>, timeoutMs: number, operationName: string, defaultValue: T): Promise<T>;