/** overrides 注入的 autoload key 前缀(卸载时按前缀批量清理)。 * G-5 (2026-08-14 批D实测发现): autoload 段键名即 Godot 节点名,旧版(≤0.23.x)误带 * 'autoload/' 前缀 → Godot 截断为同名 "autoload" 节点(与 MCPBridge 键冲突,override 未加载)。 * 写入键已去前缀;legacy key = LEGACY_KEY_PREFIX + 新 key(识别/迁移/清理旧项目遗留键)。 */ export declare const OVERRIDE_AUTOLOAD_PREFIX = "MCPOVERRIDE_"; export interface OverrideEntry { /** 写入 project.godot 的 autoload key(如 MCPOVERRIDE_debug_log) */ autoloadKey: string; /** 拷贝到项目根的脚本文件名(如 mcpoverride_debug_log.gd) */ destScriptName: string; /** 目标项目根目录(绝对路径) */ projectRoot: string; /** 拷贝后的目标脚本绝对路径 */ destScriptPath: string; } /** * 从脚本路径派生 autoload key 与目标脚本名(基于文件 basename,去扩展名)。 * 如 /path/to/debug_log.gd → key=MCPOVERRIDE_debug_log, dest=mcpoverride_debug_log.gd */ export declare function deriveOverrideEntry(sourceScriptPath: string, projectRoot: string): OverrideEntry; /** * 安装单个 override 脚本到目标项目的 project.godot [autoload] 段。 * 复用 game-bridge.ts:545-585 的 project.godot 改写模式(find/insert [autoload] + 原子 rename)。 * * @param sourceScriptPath 源脚本绝对路径(必须在白名单内) * @param projectRoot 目标项目根目录(必须含 project.godot 且在白名单内) * @returns OverrideEntry(含写入的 key/路径;内容更新路径带 updated:true); * 完全幂等(已注册且内容一致)返回 null * @throws 路径越权 / project.godot 缺失 / 沙箱扫描失败 / 脚本拷贝失败 */ export declare function installOverride(sourceScriptPath: string, projectRoot: string): (OverrideEntry & { updated?: boolean; }) | null; /** * 卸载单个 override(按 sourceScriptPath 派生的 key)。 * 参 game-bridge.ts:588-621 的 uninstall 模式(filter 行 + 原子写 + 删脚本)。 * * @returns true 若找到并卸载;false 若未注册 */ export declare function uninstallOverride(sourceScriptPath: string, projectRoot: string): boolean; /** * 批量卸载:移除项目里所有 MCPOVERRIDE_* autoload 条目与对应脚本。 * 用于 server 退出时的自动清理(SIGINT/SIGTERM graceful shutdown)。 * * @returns 清理的条目数 */ export declare function uninstallAllOverrides(projectRoot: string): number; /** * 批量安装多个 override(用于 CLI flag --overrides=path1;path2 场景)。 * 源路径列表中任一越权即整体抛错(atomic: 全装或全不装)。 * * @param sourcePaths 源脚本绝对路径数组 * @param projectRoot 目标项目根 * @returns 安装的 OverrideEntry 数组(已注册的跳过,不在结果里) * @note 预校验只覆盖越权+存在性(快速失败);单条沙箱扫描/project.godot 改写失败时 * 已装条目不回滚(非全装或全不装,审查 NIT-6 措辞订正)——单条失败抛错由调用方处置。 */ export declare function installOverrides(sourcePaths: string[], projectRoot: string): (OverrideEntry & { updated?: boolean; })[];