/** * Normalize a raw process exit code to a signed 32-bit value, so a * force-killed process (e.g. `4294967295`) reports as `-1` instead of an * unsigned value that reads like a real Godot exit status. */ export declare function normalizeExitCode(code: number | null): number | null; /** * Normalize a path for cross-platform comparison. * Folds Windows backslashes to forward slashes and strips trailing slashes, * so Node's `path.normalize` output matches Godot's `globalize_path("res://")`. */ export declare function normalizeForCompare(p: string): string; /** * Extract JSON from Godot output by finding the first { or [ and matching to the end. * This strips debug logs, version banners, and other noise. */ export declare function extractJson(output: string): string; /** * Strip Godot banner and debug lines from output, keeping only meaningful content. */ export declare function cleanOutput(output: string): string; export declare function cleanStdout(stdout: string): string; /** * Condense a process's stdout/stderr tail to its diagnostically relevant * lines, capped to the last `maxLines`. Reuses `cleanOutput`'s blank-line / * version-banner / debug-log rules and additionally drops the * renderer/device banner and engine URL. If nothing survives filtering, * falls back to the last non-empty original line so the caller sees * something of the process tail rather than an unexplained empty array. */ export declare function condenseProcessTail(lines: string[], maxLines: number): string[]; export interface StderrDiagnostic { message: string; line?: number; filePath?: string; } /** * Parse Godot script-compiler diagnostics from a raw stderr stream. * * Both the headless `validate` path and the live-bridge `run_script` path hit * the same underlying failure: GDScript compile errors are not returned by * the API call that triggers them (`load()` hands back a placeholder * resource; `GDScript.reload()` returns a bare error code) — the message, * line number, and location are printed to stderr in Godot's canonical * format: * * SCRIPT ERROR: Parse Error: Identifier "x" not declared in the current scope. * at: GDScript::reload (res://scripts/foo.gd:3) * * This is the single shared parser for that format. Behavior: * * - Recognizes `SCRIPT ERROR:` / `USER SCRIPT ERROR:` prefixes (the same * marker set GodotRunner.SCRIPT_ERROR_PATTERNS gates on) plus bare * `Parse Error: ... at line N` lines. * - Extracts the file + line from the `at:` line that follows, tolerating * the ` (path:line)` and bare `path:line` forms. `gdscript://` * URIs (runtime-compiled sources with no res:// identity) yield no * filePath — the line number still applies to the submitted source. * - When a parse/compile error's `at:` line names no path at all, adopts the * path (never the line) from a nearby `Failed to load script "res://..."` * echo, so batch attribution in `validate` can still place the error. A * `gdscript://` URI counts as a path, so a runtime-compiled source is never * relabelled with an unrelated file from surrounding stderr. * - Captures bare `ERROR:` lines (non-script failures — notably scene file * parse errors carrying an inline `[Resource file res://x:N]` location), * while suppressing the redundant `Failed to load/load` echo lines whose * `at:` lines point into Godot's engine source (e.g. * gdscript_resource_format.cpp:46) and would surface as bogus line * numbers for the user's file. */ export declare function parseScriptDiagnostics(stderr: string): StderrDiagnostic[]; //# sourceMappingURL=output-parsing.d.ts.map