/** * Miyabi MCP Bundle - Error Utilities * * Standardized error handling and formatting. */ import { ErrorCode, ToolError, ToolResult } from '../types.js'; /** * Create a standardized tool error */ export declare function createError(message: string, code?: ErrorCode, suggestion?: string, details?: Record): ToolError; /** * Create error from caught exception */ export declare function createErrorFromException(error: unknown, code?: ErrorCode, suggestion?: string): ToolError; /** * Create "not found" error */ export declare function notFoundError(resource: string, identifier?: string): ToolError; /** * Create "not installed" error */ export declare function notInstalledError(command: string, installHint?: string): ToolError; /** * Create "invalid input" error */ export declare function invalidInputError(field: string, reason: string): ToolError; /** * Create "validation failed" error */ export declare function validationError(message: string): ToolError; /** * Create "execution failed" error */ export declare function executionError(operation: string, details?: string): ToolError; /** * Create "timeout" error */ export declare function timeoutError(operation: string, timeoutMs: number): ToolError; /** * Create "permission denied" error */ export declare function permissionError(resource: string): ToolError; /** * Check if result is an error */ export declare function isToolError(result: ToolResult): result is ToolError; /** * Wrap async operation with standardized error handling */ export declare function wrapAsync(operation: () => Promise, errorCode?: ErrorCode, suggestion?: string): Promise; /** * Execute handler with try-catch and return standardized result */ export declare function safeExecute(handler: () => Promise): Promise; //# sourceMappingURL=errors.d.ts.map