/** * The bounded Variant subset Godot's remote debugger speaks on the wire. * * Debugger packets are `[uint32 length][Variant]`, and every Variant the * profiler stream carries is a nil/bool/int/float/string/array or a packed * numeric array. Objects, dictionaries and vectors are deliberately *not* * decoded: an unrelated debugger packet must fail loudly instead of driving * allocation from an attacker-shaped length field. Callers treat a decode * failure as "not a message I care about" and move on. * * 来源:Erodenn-godot-mcp-runtime/src/utils/godot-variant.ts 整文件移植 [上游 license:MIT,2026-10-01 GitHub API 核实,见 THIRD_PARTY_NOTICES.md] * (2026-09-11 P2 批,函数级 profiling 尽调;原文件零依赖,除本注释外逐行一致)。 */ /** Every value this codec can represent. */ export type Variant = null | boolean | number | string | Variant[]; /** Matches the engine's own debugger packet ceiling. */ export declare const MAX_PACKET_BYTES: number; /** * Encode one outgoing debugger command. Only the types the debugger accepts * from us are supported — anything else is a bug in the caller, not a packet * we should try to serialize. */ export declare function encodeVariant(value: Variant): Buffer; /** * Decode one incoming packet payload. Throws on truncation, trailing bytes, * or a type outside the supported subset. */ export declare function decodeVariant(raw: Buffer): Variant;