import type { Tool } from "@modelcontextprotocol/server"; import type { RiskLevel } from '../core/tool-registry.js'; import type { ToolContext, ToolResult } from '../types.js'; import type { ConnectionState } from '../types.js'; export interface ConnectionStatus { editor: { installed: boolean; connected: boolean; state: ConnectionState | null; }; bridge: { note: string; }; } /** Set notification callback (called by GodotServer). */ export declare function setOnGroupsChanged(fn: (() => void) | null): void; /** Set connection status provider (called by GodotServer). */ export declare function setConnectionStatusProvider(fn: (() => ConnectionStatus) | null): void; /** Set reconnect editor handler (called by GodotServer). */ export declare function setReconnectEditor(fn: (() => Promise<{ connected: boolean; detail: string; }>) | null): void; export declare function getToolDefinitions(): Tool[]; export declare function handleTool(toolName: string, args: Record, _ctx: ToolContext): Promise; /** * P3-4 (2026-09-11, beckett doctor 模式): 每 profile 的 tools/list payload 实测字节与 * 近似 token——给 profile 选择加"价格标签"( BuildersGate 105k 基线的对照锚)。 * 必须 Buffer.byteLength(JSON 字符串): string.length 数的是 UTF-16 code unit,对中文描述 * (本 server 全量中文)少报 2/3 字节——beckett 实测 ~100 个非 ASCII 少报 ~200B 同款坑。 * 口径 = name + description + inputSchema 的 JSON 序列化字节(getAllToolDefinitions 返回 * registerAllModules 包装后的定义,即 slimSchema/injectTags 生效后的实际 ships 量)。 */ export declare function profilePriceTags(): Array<{ name: string; tools: number; bytes: number; approxTokens: number; }>; export declare const TOOL_META: Record; }>; export interface EditorConnLike { isConnected(): boolean; connect(): Promise; /** C-RECONNECT-1: 可选,EditorConnection 实现。buildReconnectEditor connect 失败时启动后台重连循环。 */ requestReconnect?(): void; } export interface HealthMonitorLike { getState(): ConnectionState; } export declare function buildConnectionStatus(editorConn: EditorConnLike | null, healthMonitor: HealthMonitorLike | null): ConnectionStatus; export declare function buildReconnectEditor(getEditor: () => EditorConnLike | null, rebuild?: () => Promise<{ connected: boolean; detail: string; }>): () => Promise<{ connected: boolean; detail: string; }>;