import type { InterruptEffect } from "../symbolTable.js"; import type { Logger } from "../logger.js"; import type { RouteResult } from "./http/adapter.js"; export type ServeHandler = (method: string, path: string, body: unknown) => Promise; export type CreateServeHandlerOptions = { /** Module id the compiled functions were stamped with (their `fn.module`). * discoverExports filters exported functions by this, so it MUST match the * value used when the module was compiled. */ moduleId: string; /** Names of the exported nodes to serve. */ exportedNodeNames: string[]; /** Interrupt effects each function/node may raise, for the /list manifest. * Optional — omitted entries surface as empty arrays. */ interruptEffectsByName?: Record; /** Cache-bust token (mtime or content hash). Appended to the import URL so a * re-written module at the same path loads new code instead of Node's * cached module. * * WARNING: Node's ESM loader retains every distinct module URL in its * registry for the process lifetime with no eviction API, so each new * `version` permanently adds a module (and its module-scoped state) to * memory. A long-running host that re-serves many re-uploaded versions grows * unboundedly; a consumer must bound this (e.g. process recycling, or a * child-process execution model). */ version: string; /** Server-side logger for error detail. Defaults to an info logger. */ logger?: Logger; }; /** * Build the HTTP serve dispatcher for a compiled Agency module. Composes the * module import, discoverExports, and createHttpHandler internally so the raw * interrupt helpers never cross the package boundary. */ export declare function createServeHandler(compiledPath: string, options: CreateServeHandlerOptions): Promise;