/** * Copyright (c) 2018-2099, Chill Zhuang 庄骞 (bladejava@qq.com). * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * * @author Chill */ /** * 后端 TdcResponse / blade R 错误码 → LLM-friendly 中文翻译。 * 任何未匹配的 code 返原始 message,前缀"后端错误"。 */ export declare const ERROR_TRANSLATIONS: Record; /** * HTTP 状态码 → 错误码兜底映射。 */ export declare const HTTP_STATUS_FALLBACK: Record; /** * 翻译后端错误为 LLM-friendly ToolResult 错误。 */ export declare function translateError(opts: { httpStatus?: number; backendCode?: string; backendMessage?: string; cause?: unknown; }): { error: true; code: string; message: string; };