import type { Server } from 'node:http';
import type { ExecutionDump } from '@godscene/core';
import type { Agent as PageAgent } from '@godscene/core/agent';
import type { PlaygroundPreviewDescriptor, PlaygroundSessionState, PreparedPlaygroundPlatform } from './platform';
import { type PlaygroundRuntimeInfo } from './runtime-metadata';
import 'dotenv/config';
/**
 * Recursively serialize a Zod field into a plain object that preserves
 * the `_def` metadata the client relies on (typeName, innerType, values,
 * defaultValue, description, shape, etc.).
 */
export declare function serializeZodField(field: any): any;
declare class PlaygroundIpcBase {
    tmpDir: string;
    server?: Server;
    taskExecutionDumps: Record<string, ExecutionDump | null>;
    id: string;
    private _initialized;
    private sessionManager?;
    private sessionSetupState;
    private sessionSetupBlockingReason?;
    private currentTaskId;
    private _agentReady;
    private _configDirty;
    private _lastAiConfigSignature;
    private _baseRuntimeState?;
    private _basePreparedMetadata?;
    private _baseExecutionHooks?;
    private _baseSidecars?;
    private _activeConnection;
    constructor(agent?: PageAgent | (() => PageAgent) | (() => Promise<PageAgent>), id?: string);
    get agent(): PageAgent | null;
    private assertNoActiveSessionForBaseStateUpdate;
    private buildBaseRuntimeState;
    private resetConnectionToBaseState;
    private syncRuntimeState;
    private restoreBaseSessionState;
    setPreparedPlatform(prepared: Pick<PreparedPlaygroundPlatform, 'platformId' | 'title' | 'description' | 'preview' | 'metadata' | 'sessionManager' | 'executionHooks' | 'sidecars'>): void;
    setPreviewDescriptor(preview?: PlaygroundPreviewDescriptor): void;
    setRuntimeMetadata(metadata?: Record<string, unknown>): void;
    getRuntimeInfo(): PlaygroundRuntimeInfo;
    getSessionInfo(): PlaygroundSessionState & {
        setupState: 'required' | 'ready' | 'blocked';
        setupBlockingReason?: string;
    };
    private buildSessionMetadata;
    private startSidecars;
    private stopSidecars;
    private getActiveAgentOrThrow;
    private destroyCurrentAgent;
    private destroyCurrentSession;
    private applyCreatedSession;
    private getSessionSetupSchema;
    private getSessionTargets;
    updateContext(context: any): void;
    /**
     * Initialize Express app with all routes and middleware
     * Called automatically by launch() if not already initialized
     */
    private initializeApp;
    filePathForUuid(uuid: string): string;
    saveContextFile(uuid: string, context: string): string;
    /**
     * Recreate agent instance (for cancellation)
     */
    private recreateAgent;
    /**
     * Setup all API routes
     */
    private setupRoutes;
    /**
     * Launch the server on specified port
     */
    launch(ipcMain: any): Promise<void>;
    /**
     * Close the server and clean up resources
     */
    close(ipcMain: any): Promise<void>;
}
export default PlaygroundIpcBase;
export { PlaygroundIpcBase };
