export declare const APP_KEYS: Readonly<{
    readonly DAEMON: "daemon";
    readonly DESKTOP: "desktop";
    readonly WEB: "web";
}>;
export type AppKey = (typeof APP_KEYS)[keyof typeof APP_KEYS];
export declare const SIDECAR_MODES: Readonly<{
    readonly DEV: "dev";
    readonly RUNTIME: "runtime";
}>;
export type SidecarMode = (typeof SIDECAR_MODES)[keyof typeof SIDECAR_MODES];
export declare const SIDECAR_SOURCES: Readonly<{
    readonly PACKAGED: "packaged";
    readonly TOOLS_DEV: "tools-dev";
    readonly TOOLS_PACK: "tools-pack";
}>;
export type SidecarSource = (typeof SIDECAR_SOURCES)[keyof typeof SIDECAR_SOURCES];
export declare const SIDECAR_ENV: Readonly<{
    readonly BASE: "OD_SIDECAR_BASE";
    readonly DAEMON_CLI_PATH: "OD_DAEMON_CLI_PATH";
    readonly DAEMON_PORT: "OD_PORT";
    readonly IPC_BASE: "OD_SIDECAR_IPC_BASE";
    readonly IPC_PATH: "OD_SIDECAR_IPC_PATH";
    readonly NAMESPACE: "OD_SIDECAR_NAMESPACE";
    readonly SOURCE: "OD_SIDECAR_SOURCE";
    readonly TOOLS_DEV_PARENT_PID: "OD_TOOLS_DEV_PARENT_PID";
    readonly WEB_DIST_DIR: "OD_WEB_DIST_DIR";
    readonly WEB_PORT: "OD_WEB_PORT";
    readonly WEB_TSCONFIG_PATH: "OD_WEB_TSCONFIG_PATH";
}>;
export declare const SIDECAR_RUNTIME_ENV: Readonly<{
    readonly base: "OD_SIDECAR_BASE";
    readonly ipcBase: "OD_SIDECAR_IPC_BASE";
    readonly ipcPath: "OD_SIDECAR_IPC_PATH";
    readonly namespace: "OD_SIDECAR_NAMESPACE";
    readonly source: "OD_SIDECAR_SOURCE";
}>;
export declare const SIDECAR_STAMP_FLAGS: Readonly<{
    readonly app: "--od-stamp-app";
    readonly ipc: "--od-stamp-ipc";
    readonly mode: "--od-stamp-mode";
    readonly namespace: "--od-stamp-namespace";
    readonly source: "--od-stamp-source";
}>;
export declare const STAMP_APP_FLAG: "--od-stamp-app";
export declare const STAMP_IPC_FLAG: "--od-stamp-ipc";
export declare const STAMP_MODE_FLAG: "--od-stamp-mode";
export declare const STAMP_NAMESPACE_FLAG: "--od-stamp-namespace";
export declare const STAMP_SOURCE_FLAG: "--od-stamp-source";
export declare const SIDECAR_STAMP_FIELDS: readonly ["app", "mode", "namespace", "ipc", "source"];
export declare const SIDECAR_DEFAULTS: Readonly<{
    readonly host: "127.0.0.1";
    readonly ipcBase: "/tmp/open-design/ipc";
    readonly namespace: "default";
    readonly projectTmpDirName: ".tmp";
    readonly windowsPipePrefix: "open-design";
}>;
export declare const SIDECAR_MESSAGES: Readonly<{
    readonly CLICK: "click";
    readonly CONSOLE: "console";
    readonly EVAL: "eval";
    readonly EXPORT_PDF: "export-pdf";
    readonly REGISTER_DESKTOP_AUTH: "register-desktop-auth";
    readonly SCREENSHOT: "screenshot";
    readonly SHUTDOWN: "shutdown";
    readonly STATUS: "status";
}>;
export declare const SIDECAR_ERROR_CODES: Readonly<{
    readonly INVALID_MESSAGE: "SIDECAR_INVALID_MESSAGE";
    readonly UNKNOWN_MESSAGE: "SIDECAR_UNKNOWN_MESSAGE";
}>;
export type SidecarErrorCode = (typeof SIDECAR_ERROR_CODES)[keyof typeof SIDECAR_ERROR_CODES];
export declare class SidecarContractError extends Error {
    readonly code: SidecarErrorCode;
    constructor(code: SidecarErrorCode, message: string);
}
export type ServiceRuntimeState = "idle" | "running" | "starting" | "stopped" | "unknown";
export type DaemonStatusSnapshot = {
    pid?: number | null;
    state: ServiceRuntimeState;
    updatedAt?: string;
    url: string | null;
    /**
     * PR #974 round 6 (mrcfps): true when the daemon's
     * `/api/import/folder` route refuses tokenless requests. Surfaced
     * over IPC so `tools-dev start desktop` can detect a daemon that
     * was spawned without `OD_REQUIRE_DESKTOP_AUTH=1` (the split-start
     * dev flow `start daemon` -> `start desktop`) and restart it
     * before launching desktop main, instead of letting a renderer
     * race the registration handshake. Mirrors
     * `apps/daemon/src/server.ts#isDesktopAuthGateActive()` at the
     * moment the STATUS request was answered.
     */
    desktopAuthGateActive: boolean;
};
export type WebStatusSnapshot = {
    pid?: number | null;
    state: ServiceRuntimeState;
    updatedAt?: string;
    url: string | null;
};
export type DesktopRuntimeState = "idle" | "running" | "unknown";
export type DesktopStatusSnapshot = {
    pid?: number | null;
    state: DesktopRuntimeState;
    title?: string | null;
    updatedAt?: string;
    url?: string | null;
    windowVisible?: boolean;
};
export type DesktopEvalInput = {
    expression: string;
};
export type DesktopEvalResult = {
    error?: string;
    ok: boolean;
    value?: unknown;
};
export type DesktopScreenshotInput = {
    path: string;
};
export type DesktopScreenshotResult = {
    path: string;
};
export type DesktopConsoleEntry = {
    level: string;
    text: string;
    timestamp: string;
};
export type DesktopConsoleResult = {
    entries: DesktopConsoleEntry[];
};
export type DesktopClickInput = {
    selector: string;
};
export type DesktopClickResult = {
    clicked: boolean;
    found: boolean;
};
export type DesktopExportPdfInput = {
    baseHref?: string;
    deck: boolean;
    defaultFilename: string;
    html: string;
    title: string;
};
export type DesktopExportPdfResult = {
    canceled?: boolean;
    error?: string;
    ok: boolean;
    path?: string;
};
export type SidecarStatusMessage = {
    type: typeof SIDECAR_MESSAGES.STATUS;
};
export type SidecarShutdownMessage = {
    type: typeof SIDECAR_MESSAGES.SHUTDOWN;
};
export type DesktopEvalMessage = {
    input: DesktopEvalInput;
    type: typeof SIDECAR_MESSAGES.EVAL;
};
export type DesktopScreenshotMessage = {
    input: DesktopScreenshotInput;
    type: typeof SIDECAR_MESSAGES.SCREENSHOT;
};
export type DesktopConsoleMessage = {
    type: typeof SIDECAR_MESSAGES.CONSOLE;
};
export type DesktopClickMessage = {
    input: DesktopClickInput;
    type: typeof SIDECAR_MESSAGES.CLICK;
};
export type DesktopExportPdfMessage = {
    input: DesktopExportPdfInput;
    type: typeof SIDECAR_MESSAGES.EXPORT_PDF;
};
export type RegisterDesktopAuthInput = {
    secret: string;
};
export type RegisterDesktopAuthMessage = {
    input: RegisterDesktopAuthInput;
    type: typeof SIDECAR_MESSAGES.REGISTER_DESKTOP_AUTH;
};
export type RegisterDesktopAuthResult = {
    accepted: true;
};
export type DaemonSidecarMessage = SidecarStatusMessage | SidecarShutdownMessage | RegisterDesktopAuthMessage;
export type WebSidecarMessage = SidecarStatusMessage | SidecarShutdownMessage;
export type DesktopSidecarMessage = SidecarStatusMessage | SidecarShutdownMessage | DesktopEvalMessage | DesktopScreenshotMessage | DesktopConsoleMessage | DesktopClickMessage | DesktopExportPdfMessage;
export type ShutdownResult = {
    accepted: true;
};
export type SidecarStamp = {
    app: AppKey;
    ipc: string;
    mode: SidecarMode;
    namespace: string;
    source: SidecarSource;
};
export type SidecarStampInput = Partial<Record<(typeof SIDECAR_STAMP_FIELDS)[number], unknown>>;
export type SidecarStampCriteria = Partial<SidecarStamp>;
export type OpenDesignSidecarContract = {
    appKeys: typeof APP_KEYS;
    defaults: typeof SIDECAR_DEFAULTS;
    env: typeof SIDECAR_RUNTIME_ENV;
    errorCodes: typeof SIDECAR_ERROR_CODES;
    messages: typeof SIDECAR_MESSAGES;
    modes: typeof SIDECAR_MODES;
    normalizeApp: typeof normalizeAppKey;
    normalizeNamespace: typeof normalizeNamespace;
    normalizeSource: typeof normalizeSidecarSource;
    normalizeStamp: typeof normalizeSidecarStamp;
    normalizeStampCriteria: typeof normalizeSidecarStampCriteria;
    sources: typeof SIDECAR_SOURCES;
    stampFields: typeof SIDECAR_STAMP_FIELDS;
    stampFlags: typeof SIDECAR_STAMP_FLAGS;
};
export declare function normalizeNamespace(namespace: unknown): string;
export declare function isSidecarMode(value: unknown): value is SidecarMode;
export declare function normalizeSidecarMode(mode: unknown): SidecarMode;
export declare function isAppKey(value: unknown): value is AppKey;
export declare function normalizeAppKey(app: unknown): AppKey;
export declare function isSidecarSource(value: unknown): value is SidecarSource;
export declare function normalizeSidecarSource(source: unknown): SidecarSource;
export declare function isWindowsNamedPipePath(value: unknown): boolean;
export declare function normalizeIpcPath(ipc: unknown): string;
export declare function normalizeSidecarStamp(input: unknown): SidecarStamp;
export declare function normalizeSidecarStampCriteria(input?: unknown): SidecarStampCriteria;
export declare function assertSidecarStamp(input: unknown): asserts input is SidecarStamp;
export declare function normalizeDaemonSidecarMessage(input: unknown): DaemonSidecarMessage;
export declare function normalizeWebSidecarMessage(input: unknown): WebSidecarMessage;
export declare function normalizeDesktopSidecarMessage(input: unknown): DesktopSidecarMessage;
export declare const OPEN_DESIGN_SIDECAR_CONTRACT: Readonly<{
    readonly appKeys: Readonly<{
        readonly DAEMON: "daemon";
        readonly DESKTOP: "desktop";
        readonly WEB: "web";
    }>;
    readonly defaults: Readonly<{
        readonly host: "127.0.0.1";
        readonly ipcBase: "/tmp/open-design/ipc";
        readonly namespace: "default";
        readonly projectTmpDirName: ".tmp";
        readonly windowsPipePrefix: "open-design";
    }>;
    readonly env: Readonly<{
        readonly base: "OD_SIDECAR_BASE";
        readonly ipcBase: "OD_SIDECAR_IPC_BASE";
        readonly ipcPath: "OD_SIDECAR_IPC_PATH";
        readonly namespace: "OD_SIDECAR_NAMESPACE";
        readonly source: "OD_SIDECAR_SOURCE";
    }>;
    readonly errorCodes: Readonly<{
        readonly INVALID_MESSAGE: "SIDECAR_INVALID_MESSAGE";
        readonly UNKNOWN_MESSAGE: "SIDECAR_UNKNOWN_MESSAGE";
    }>;
    readonly messages: Readonly<{
        readonly CLICK: "click";
        readonly CONSOLE: "console";
        readonly EVAL: "eval";
        readonly EXPORT_PDF: "export-pdf";
        readonly REGISTER_DESKTOP_AUTH: "register-desktop-auth";
        readonly SCREENSHOT: "screenshot";
        readonly SHUTDOWN: "shutdown";
        readonly STATUS: "status";
    }>;
    readonly modes: Readonly<{
        readonly DEV: "dev";
        readonly RUNTIME: "runtime";
    }>;
    readonly normalizeApp: typeof normalizeAppKey;
    readonly normalizeNamespace: typeof normalizeNamespace;
    readonly normalizeSource: typeof normalizeSidecarSource;
    readonly normalizeStamp: typeof normalizeSidecarStamp;
    readonly normalizeStampCriteria: typeof normalizeSidecarStampCriteria;
    readonly sources: Readonly<{
        readonly PACKAGED: "packaged";
        readonly TOOLS_DEV: "tools-dev";
        readonly TOOLS_PACK: "tools-pack";
    }>;
    readonly stampFields: readonly ["app", "mode", "namespace", "ipc", "source"];
    readonly stampFlags: Readonly<{
        readonly app: "--od-stamp-app";
        readonly ipc: "--od-stamp-ipc";
        readonly mode: "--od-stamp-mode";
        readonly namespace: "--od-stamp-namespace";
        readonly source: "--od-stamp-source";
    }>;
}>;
//# sourceMappingURL=index.d.ts.map