/** * Veryfront Core HTTP Handler - Composition Root * * Runtime-agnostic HTTP handler using modular architecture. * This file orchestrates the extracted modules for request handling. * * @module server/runtime-handler */ import type { RuntimeAdapter } from "../../platform/adapters/base.js"; import type { VeryfrontConfig } from "../../config/index.js"; import { RouteRegistry } from "../../routing/registry/index.js"; import type { Handler } from "../../types/index.js"; import { ApiHandlerWrapper } from "../handlers/request/api/index.js"; export { parseProxyEnvironment, type ProxyEnvironment } from "./proxy-environment.js"; /** Handler names in registration order. */ export declare const HANDLER_NAMES: readonly ["AuthHandler", "CsrfHandler", "HMRHandler", "CorsHandler", "HealthHandler", "MetricsHandler", "MemoryDebugHandler", "ClientLogHandler", "DevEndpointsHandler", "StylesCSSHandler", "DebugContextHandler", "OpenAPIHandler", "OpenAPIDocsHandler", "InternalAgentsListHandler", "PublicAgentsListHandler", "PublicAgentMetadataHandler", "AgentStreamHandler", "AgentRunResumeHandler", "AgentRunCancelHandler", "ProjectRunExecuteHandler", "ChannelInvokeHandler", "DevDashboardHandler", "ProjectsHandler", "StudioBridgeModulesHandler", "ProdHydrationModuleHandler", "CSSHandler", "DevFileHandler", "SnippetHandler", "CspReportHandler", "StaticHandler", "LibModulesHandler", "RSCHandler", "ModuleHandler", "ApiHandlerWrapper", "MarkdownPreviewHandler", "SSRHandler", "NotFoundHandler"]; /** Union of all registered handler names. */ export type HandlerName = (typeof HANDLER_NAMES)[number]; /** * Dependencies for handler registry creation. * All fields are optional — when omitted, the real handler implementation is used. * This allows tests to inject mock handlers for specific slots. */ export interface HandlerDependencies { /** Override any handler by its typed name. */ overrides?: Partial>; /** When true, log handler registration details. */ debug?: boolean; } /** * Creates a RouteRegistry populated with the standard handler chain. * * Handlers are instantiated lazily — overridden slots skip construction * of the default handler entirely. * * @param projectDir - Root project directory * @param adapter - Runtime adapter for environment access * @param deps - Optional dependency overrides for testing * @returns Object containing the registry and the api handler (for initialization) */ export declare function createHandlerRegistry(projectDir: string, adapter: RuntimeAdapter, deps?: HandlerDependencies): { registry: RouteRegistry; apiHandler: ApiHandlerWrapper; }; export interface RuntimeHandlerOptions { projectDir: string; /** When true, expose additional debug logging. */ debug?: boolean; /** Module server URL for ESM imports (e.g., 'http://localhost:8765') */ moduleServerUrl?: string; /** Pre-loaded config (avoids re-loading via FSAdapter) */ config?: VeryfrontConfig; /** Map of local project slugs to their filesystem paths (for unified dev server) */ localProjects?: Record; /** Default project slug when not provided via proxy headers (for tests/local mode) */ defaultProjectSlug?: string; /** Default project ID when not provided via proxy headers (for tests/local mode) */ defaultProjectId?: string; /** Default release ID when not provided via proxy headers (for standalone production mode) */ defaultReleaseId?: string; /** Default environment for standalone mode (preview or production). Defaults to preview for safety. */ defaultEnvironment?: "preview" | "production"; /** Host-owned capability for dedicated single-project runtime execution. */ allowHostProjectCodeExecution?: boolean; } export declare function createVeryfrontHandler(projectDir: string, adapter: RuntimeAdapter, opts?: RuntimeHandlerOptions): ((req: Request) => Promise) & { ready?: Promise; }; export type { HandlerContext } from "../handlers/types.js"; export { RouteRegistry } from "../../routing/registry/index.js"; export { BaseHandler } from "../handlers/response/base.js"; //# sourceMappingURL=index.d.ts.map