/**
 * Live-server client for the Channel 2 ctx_reduce ceiling nudge (a synthetic
 * user `<system-reminder>` delivered via `promptAsync`).
 *
 * WHY a separate client instead of the plugin-provided `input.client`:
 * OpenCode's plugin `input.client` routes through `Server.Default().app.fetch`,
 * which uses a SEPARATE Effect `memoMap` from the live HTTP listener the UI
 * uses. `SessionRunState` lives per-memoMap, so a plugin-origin `promptAsync`
 * observes an "idle" runner while the live turn is still running, `ensureRunning`
 * fails to coalesce, and OpenCode persists duplicate assistant children
 * (upstream bug anomalyco/opencode#28202). Building a `createOpencodeClient`
 * aimed at `input.serverUrl` via `globalThis.fetch` enters the SAME live
 * listener, so `ensureRunning` sees the real run and coalesces — the synthetic
 * message lands at the tail after the current assistant step.
 *
 * The live listener is only reachable on OpenCode Desktop (Electron+Node) and
 * TUI launched with `--port 0`; plain TUI binds an internal listener that 404s
 * `/session/*`. We probe once at init and cache per `serverUrl`. When
 * unreachable, Channel 2 is DISABLED (Channel 1 + 85% force-materialization
 * remain the backstop) — MC deliberately does NOT fall back to the in-process
 * client because that would knowingly trigger #28202.
 */
import { createOpencodeClient } from "@opencode-ai/sdk";
export type LiveServerClient = ReturnType<typeof createOpencodeClient>;
/**
 * Cached `createOpencodeClient` aimed at the live HTTP listener for the given
 * `(serverUrl, directory)`. One client is reused across deliveries.
 */
export declare function getLiveServerClient(serverUrl: string, directory: string): LiveServerClient;
/**
 * Probe whether `serverUrl` serves OpenCode's HTTP API within `timeoutMs`.
 * `true` only when `/session` proves the API is usable: any 2xx, or 401/403
 * (auth-protected listener still exists). `false` for 404 (plain TUI internal
 * listener), 5xx, connection refused, DNS failure, timeout, or malformed URL.
 * Records the result + timestamp in the per-serverUrl cache.
 */
export declare function probeServerReachable(serverUrl: string | undefined, timeoutMs?: number): Promise<boolean>;
/** Record a probe result directly (test helper / explicit override). */
export declare function setLiveServerWakeAvailable(serverUrl: string | undefined, available: boolean): void;
/**
 * Should Channel 2 deliver through the live-server client for `serverUrl`?
 * Returns false when never probed or the last probe failed. A stale decision
 * (older than the TTL) returns false so the caller re-probes before delivering.
 */
export declare function useLiveServerWake(serverUrl?: string): boolean;
/** True when a usable (non-stale) probe decision exists, regardless of outcome. */
export declare function hasFreshProbe(serverUrl?: string): boolean;
/** Test helper — reset both caches between cases. */
export declare function __resetLiveServerClientForTests(): void;
//# sourceMappingURL=live-server-client.d.ts.map