import type { BackgroundProcess } from "@kenkaiiii/gg-engine/internal/core/process-manager.js"; import type { Probe } from "./servers.js"; export type DevUrlResult = { kind: "found"; url: string; command: string; } | { kind: "https"; url: string; command: string; } | { kind: "none"; }; /** The last local URL in some log text, normalised to localhost; null when none. */ export declare function lastLocalUrl(text: string): { url: string; https: boolean; } | null; export interface DetectOptions { /** The window's project. */ cwd?: string; /** Ports of servers running from inside `cwd` that GG didn't start (servers.ts). */ scan?: (cwd: string) => Promise; /** What answers on a port; without it the newest printed URL wins unchecked. */ probe?: (port: number) => Promise; } /** * The project's dev server: from the window's background process logs, then from * servers running inside the project that the user started themselves. With a * probe, only one serving a web page counts (a frontend, never its API). */ export declare function detectDevUrl(processes: readonly BackgroundProcess[], read?: (file: string) => Promise, opts?: DetectOptions): Promise;