/**
 * Studiograph HTTP Server
 *
 * Hosts:
 *   - Graph API (read-only REST over WorkspaceManager)
 *   - Agent chat via POST /api/chat and SSE GET /api/chat/stream
 *   - Static web UI (SvelteKit build) with SPA fallback
 */
import { type FastifyInstance } from 'fastify';
import { WorkspaceManager } from '../core/workspace-manager.js';
import { GitUser } from '../services/git.js';
import { WorkspaceConfig } from '../core/types.js';
export interface ServerConfig {
    workspaceManager: WorkspaceManager;
    workspacePath: string;
    workspaceConfig: WorkspaceConfig;
    gitUser: GitUser;
    port: number;
    host: string;
    /**
     * Phase 8: master key + version for AuthService's per-user encryption
     * path (oauth_tokens.data_ciphertext, user_preferences.settings_ciphertext).
     * Caller is `serve.ts`. Absent in tests that don't boot the full
     * server (AuthService then stays on the legacy plaintext path).
     */
    authCryptoOptions?: {
        masterKey: Uint8Array;
        keyVersion?: string;
    };
}
export declare function resolveStaticFilePath(webDir: string, urlPath: string): string | null;
export declare function buildAllowedCorsOrigins(workspaceConfig: WorkspaceConfig, port: number): Set<string>;
export declare function isCorsOriginAllowed(origin: string | undefined, allowedOrigins: Set<string>): boolean;
export declare function createServer(config: ServerConfig): Promise<FastifyInstance>;
