@hasna/domains
Version:
Domain portfolio, registrar, marketplace, and DNS management for AI agents — CLI + MCP + HTTP API + SDK, shared account API and PostgreSQL
46 lines • 1.71 kB
TypeScript
export declare function isStdioMode(argv?: readonly string[], env?: NodeJS.ProcessEnv): boolean;
export declare function isHttpMode(argv?: readonly string[], env?: NodeJS.ProcessEnv): boolean;
export declare function resolveMcpHttpPort(opts?: {
explicit?: number;
argv?: readonly string[];
env?: NodeJS.ProcessEnv;
default?: number;
}): number;
export declare function healthPayload(name: string): {
status: string;
name: string;
};
/** Minimal structural shape the HTTP adapters need from a built MCP server. */
export interface ConnectableMcpServer {
connect(transport: unknown): Promise<void>;
close(): Promise<void>;
}
export type BuildServer = () => ConnectableMcpServer | Promise<ConnectableMcpServer>;
/** Handle returned by the Bun HTTP adapter. */
export interface BunHttpServerHandle {
port: number;
stop: () => void;
}
/**
* Handle one MCP request using Web-standard `Request` / `Response`. Emits a
* JSON-RPC `-32603` 500 on failure.
*/
export declare function handleMcpHttpRequest(req: Request, buildServer: BuildServer, options?: {
enableJsonResponse?: boolean;
}): Promise<Response>;
/**
* Start a `Bun.serve` HTTP server exposing `GET /health` and `POST /mcp`.
* Returns the bound port and a `stop()`.
*/
export declare function startBunHttpServer(buildServer: BuildServer, options: {
port: number;
host?: string;
serviceName: string;
enableJsonResponse?: boolean;
}): BunHttpServerHandle;
/**
* Test helper — kept for API stability. The harness is stateless per-request,
* so there is no shared transport state to reset.
*/
export declare function resetMcpHttpStateForTests(): void;
//# sourceMappingURL=harness.d.ts.map