import type { ToolInstallStatus } from "../types.js";
export declare function setGracefulShutdownFn(fn: (signal: string, preserveSessions: boolean) => Promise<void>): void;
export declare const instanceRouter: import("express-serve-static-core").Router;
export declare function buildConnectionCheckResponse(connectionKeyMd5: string): {
    status: number;
    body: {
        ok: boolean;
        runtimeBridge?: "healthy";
        version: string;
        connectionKeyMatched: boolean;
        connectionKeyRequired: boolean;
        error?: string;
    };
};
export interface SchedulerPingFailureResponse {
    ok: false;
    error: string;
    failureStage: "scheduler_ping";
    runtimeBridge: "healthy";
    schedulerBaseUrl: string;
    hint: string;
}
interface AmbiguousSchedulerBaseUrlResponse {
    ok: false;
    error: "ambiguous_scheduler_base_url";
    failureStage: "scheduler_ping";
    runtimeBridge: "healthy";
    schedulerBaseUrl: string;
    autoRegisterTargetUrls: string[];
    hint: string;
}
/**
 * 构建调度中心 ping 失败响应。
 * 主流程：保留底层错误与 scheduler 地址，同时明确 bridge 本身已连通、失败点在 bridge 回连调度中心。
 */
export declare function buildSchedulerPingFailureResponse(error: Error, configuredSchedulerBaseUrl: string): SchedulerPingFailureResponse;
/**
 * Build the response for ambiguous scheduler targets.
 * Main flow: never silently pick the first target; require an explicit scheduler URL or future scheduler identity routing.
 */
export declare function buildAmbiguousSchedulerBaseUrlResponse(targetUrls: string[]): AmbiguousSchedulerBaseUrlResponse;
/**
 * 构建工具状态检测目标列表。
 * 主流程：合并实例启用工具与配置面板固定展示工具，避免历史状态缺少 Codex 时前端误判为待检测。
 */
export declare function buildToolStatusDetectionTargets(enabledTools: string[]): string[];
/**
 * 汇总卸载后仍可执行的工具，用于避免把部分卸载误报为成功。
 */
export declare function buildUninstallFailureMessage(requestedTools: string[], toolStatus: Record<string, ToolInstallStatus>): string;
export declare function summarizeToolStatus(toolStatus: Record<string, ToolInstallStatus>): Record<string, Pick<ToolInstallStatus, "installed" | "version" | "executable" | "error">>;
export {};
//# sourceMappingURL=instance.d.ts.map