import type { Tool } from "@modelcontextprotocol/server"; import type { ToolContext, ToolResult } from '../types.js'; import type { RiskLevel } from '../core/tool-registry.js'; /** * 字符级状态机解析整个 CSV 文档为记录数组。 * I-1(2026-08-19 审查):引号内的 \r\n 是字段内容而非记录分隔(RFC 4180)—— * 按行 split 会把 serializeCsvLine 写出的含换行字段拆成错位记录(write→read 往返损坏)。 */ export declare function parseCsvRecords(content: string): string[][]; /** 序列化单行 CSV(引号包裹含逗号/引号/换行的字段) */ export declare function serializeCsvLine(fields: string[]): string; export interface CsvTranslation { format: 'csv'; languages: string[]; /** entries[key][lang] = text */ entries: Record>; } /** 解析 Godot CSV 翻译表:首行 `keys,lang1,lang2,...`(引号内换行字段按 RFC 4180 保留) */ export declare function parseTranslationCsv(content: string): CsvTranslation; export declare function serializeTranslationCsv(languages: string[], entries: Record>): string; export interface PoTranslation { format: 'po'; language: string | null; /** entries[key] = text(取 msgid[0]/msgid_plural 的 msgstr[0],复数其余忽略) */ entries: Record; } export declare function parseTranslationPo(content: string): PoTranslation; /** * 把翻译资源路径合并进 project.godot 的 internationalization/locale/translations。 * 已有行 → 合并去重;有 [internationalization] 段无该行 → 段内追加;都无 → 追加段。 * 原子写(tmp + rename),未变更时不动文件。 * @returns 变更后的翻译数组(res:// 路径) */ export declare function registerTranslationsInProjectGodot(projectGodotPath: string, resPaths: string[], remove: boolean): { changed: boolean; translations: string[]; }; export declare function getToolDefinitions(): Tool[]; export declare function handleTool(name: string, args: Record, _ctx: ToolContext): Promise; export declare const TOOL_META: Record; }>;