/** * Structured error/success envelope for Buxfer AI Tools. * * All tool responses use a stable envelope so LLMs can reliably parse results. * Call sites always use `JSON.stringify(wrapSuccess/wrapError(...))`. */ interface ToolEnvelope { schemaVersion: '1'; tool: string; resource: string; operation: string; success: boolean; } export interface SuccessEnvelope extends ToolEnvelope { success: true; result: Record; } export interface ErrorEnvelope extends ToolEnvelope { success: false; error: { errorType: string; message: string; nextAction: string; context?: Record; }; } export declare const ERROR_TYPES: { readonly API_ERROR: "API_ERROR"; readonly ENTITY_NOT_FOUND: "ENTITY_NOT_FOUND"; readonly NO_RESULTS_FOUND: "NO_RESULTS_FOUND"; readonly MISSING_REQUIRED_FIELD: "MISSING_REQUIRED_FIELD"; readonly MISSING_ENTITY_ID: "MISSING_ENTITY_ID"; readonly INVALID_OPERATION: "INVALID_OPERATION"; readonly WRITE_OPERATION_BLOCKED: "WRITE_OPERATION_BLOCKED"; readonly PERMISSION_DENIED: "PERMISSION_DENIED"; readonly VALIDATION_ERROR: "VALIDATION_ERROR"; readonly INTERNAL_ERROR: "INTERNAL_ERROR"; }; export declare function wrapSuccess(resource: string, operation: string, result: Record, mainToolName: string): SuccessEnvelope; export declare function wrapError(resource: string, operation: string, errorType: string, message: string, nextAction: string, context: Record | undefined, mainToolName: string): ErrorEnvelope; export declare function formatApiError(resource: string, operation: string, message: string, mainToolName: string): ErrorEnvelope; export declare function formatMissingIdError(resource: string, operation: string, mainToolName: string): ErrorEnvelope; export declare function formatNotFoundError(resource: string, operation: string, id: number | string, mainToolName: string): ErrorEnvelope; export declare function formatNoResultsFound(resource: string, operation: string, filtersUsed: Record, mainToolName: string): ErrorEnvelope; export {}; //# sourceMappingURL=error-formatter.d.ts.map