import type { DesktopExportPdfInput, DesktopExportPdfResult } from '@open-design/sidecar-proto';
import { reportRunCompletedFromDaemon } from './langfuse-bridge.js';
export declare function resolveProjectRoot(moduleDir: string): string;
export declare function resolveDaemonCliPath(env?: NodeJS.ProcessEnv): string;
export declare function setDesktopAuthSecret(secret: Buffer | null): void;
export declare function isDesktopAuthRegistered(): boolean;
export declare function isDesktopAuthGateActive(): boolean;
export declare function resetDesktopAuthForTests(): void;
export declare function signDesktopImportToken(secret: Buffer, baseDir: string, options: {
    nonce: string;
    exp: string;
}): string;
type DesktopImportTokenVerification = {
    ok: true;
    nonce: string;
    exp: number;
} | {
    ok: false;
    reason: string;
};
export declare function verifyDesktopImportToken(secret: Buffer, baseDir: string, token: string, now: number, consumedNonces: Map<string, number>): DesktopImportTokenVerification;
export declare function composeLiveInstructionPrompt({ daemonSystemPrompt, runtimeToolPrompt, clientSystemPrompt, finalPromptOverride, }: {
    daemonSystemPrompt: any;
    runtimeToolPrompt: any;
    clientSystemPrompt: any;
    finalPromptOverride: any;
}): string;
export declare function resolveResearchCommandContract(research: any, message: any): string;
export declare function resolveCodexGeneratedImagesDir(agentId: any, metadata: any, env?: NodeJS.ProcessEnv, homeDir?: string): string | null;
type DirectoryStat = {
    isDirectory(): boolean;
    isSymbolicLink(): boolean;
};
type CodexGeneratedImagesDirValidationOptions = {
    protectedDirs?: Array<string | null | undefined>;
    mkdirSync?: (target: string, options: {
        recursive: true;
    }) => unknown;
    lstatSync?: (target: string) => DirectoryStat;
    statSync?: (target: string) => DirectoryStat;
    realpathSync?: (target: string) => string;
    warn?: (message: string) => void;
};
export declare function validateCodexGeneratedImagesDir(codexGeneratedImagesDir: string | null | undefined, { protectedDirs, mkdirSync, lstatSync, statSync, realpathSync, warn, }?: CodexGeneratedImagesDirValidationOptions): string | null;
export declare function resolveChatExtraAllowedDirs({ agentId, skillsDir, designSystemsDir, linkedDirs, codexGeneratedImagesDir, existsSync, }: {
    agentId?: string | null;
    skillsDir?: string | null;
    designSystemsDir?: string | null;
    linkedDirs?: Array<string | null | undefined>;
    codexGeneratedImagesDir?: string | null;
    existsSync?: (path: string) => boolean;
}): string[];
export declare function resolveGrantedCodexImagegenOverride({ agentId, metadata, codexGeneratedImagesDir, extraAllowedDirs, }: {
    agentId?: string | null;
    metadata?: unknown;
    codexGeneratedImagesDir?: string | null;
    extraAllowedDirs?: string[];
}): string | null;
export declare function normalizeCommentAttachments(input: any): ({
    id: string;
    order: number;
    filePath: string;
    elementId: string;
    selector: string;
    label: string;
    comment: string;
    currentText: string;
    pagePosition: {
        x: number;
        y: number;
        width: number;
        height: number;
    };
    htmlHint: string;
    selectionKind: string;
    memberCount: number;
    podMembers: ({
        elementId: string;
        selector: string;
        label: string;
        text: string;
        position: {
            x: number;
            y: number;
            width: number;
            height: number;
        };
        htmlHint: string;
    } | null)[];
    screenshotPath: string | undefined;
    markKind: any;
    intent: string | undefined;
    source: string;
} | null)[];
export declare function renderCommentAttachmentHint(commentAttachments: any): string;
export declare function resolveDaemonResourceRoot({ configured, safeBases, }?: {
    configured?: string | undefined;
    safeBases?: any[] | undefined;
}): string | null;
export declare function resolveDataDir(raw: any, projectRoot: any): string;
export declare const SSE_KEEPALIVE_INTERVAL_MS = 25000;
export declare function createAgentRuntimeEnv(baseEnv: NodeJS.ProcessEnv | Record<string, string | undefined>, daemonUrl: string, toolTokenGrant?: {
    token?: string;
} | null, nodeBin?: string): NodeJS.ProcessEnv;
export declare function createAgentRuntimeToolPrompt(daemonUrl: string, toolTokenGrant?: {
    token?: string;
} | null): string;
export declare function normalizeProjectDisplayStatus(status: any): any;
export declare function composeProjectDisplayStatus(baseStatus: any, awaitingInputProjects: any, projectId: any): any;
/**
 * @param {ApiErrorCode} code
 * @param {string} message
 * @param {Omit<ApiError, 'code' | 'message'>} [init]
 * @returns {ApiError}
 */
export declare function createCompatApiError(code: any, message: any, init?: {}): {
    code: any;
    message: any;
};
/**
 * @param {ApiErrorCode} code
 * @param {string} message
 * @param {Omit<ApiError, 'code' | 'message'>} [init]
 * @returns {ApiErrorResponse}
 */
export declare function createCompatApiErrorResponse(code: any, message: any, init?: {}): {
    error: {
        code: any;
        message: any;
    };
};
export declare function shouldReportRunCompletedFromMessage(saved: any, body?: {}): boolean;
export declare function telemetryPromptFromRunRequest(message: any, currentPrompt: any): any;
export declare function createFinalizedMessageTelemetryReporter({ design, db, dataDir, reportedRuns, getAppVersion, report, }: {
    design: any;
    db: unknown;
    dataDir: string;
    reportedRuns: Set<string>;
    getAppVersion?: () => any;
    report?: typeof reportRunCompletedFromDaemon;
}): (saved: any, body?: {}) => void;
export declare function createSseResponse(res: any, { keepAliveIntervalMs }?: {
    keepAliveIntervalMs?: number | undefined;
}): {
    /** @param {ChatSseEvent['event'] | ProxySseEvent['event'] | string} event */
    send(event: any, data: any, id?: string | number | null | undefined): boolean;
    writeKeepAlive: () => boolean;
    cleanup: () => void;
    end(): void;
};
export type DesktopPdfExporter = (input: DesktopExportPdfInput) => Promise<DesktopExportPdfResult>;
export interface StartServerOptions {
    desktopPdfExporter?: DesktopPdfExporter | null;
    host?: string;
    port?: number;
    returnServer?: boolean;
}
export declare function startServer({ port, host, returnServer, desktopPdfExporter, }?: StartServerOptions): Promise<unknown>;
export declare function rewriteSkillAssetUrls(html: string, skillId: string): string;
export {};
