adkAPI模块(Module)

fun Application.adkApiModule(config: AdkServerConfig)

Installs the ADK agent runtime (health, version, app discovery, sessions, artifacts, the run endpoints including /run_live, and app-info when AdkServerConfig.includeAppInfo or the adk.app.info.enabled property asks for it) with loopback peer and browser-origin guards, installs Ktor WebSockets unless the application already did (install your own WebSockets before this module, or startup fails), registers OpenTelemetry from the standard OTEL_* settings unless the process already has one, and flushes AdkServerConfig.sessionService and buffered telemetry when the application stops, waiting up to 3 seconds for a flush that honors cancellation. Your own WebSockets should set maxFrameSize to at most 16 MiB and bound its outgoing channel: Ktor reads a socket's first frames with the plugin's cap, before /run_live sets its own.

Set AdkServerConfig.allowRemoteRequests and AdkServerConfig.allowOrigins when serving remote or cross-origin callers behind your own authentication.

The Development UI stays unmounted unless AdkServerConfig.webUiEnabled or the adk.web.ui.enabled property asks for it; the development surface is installed separately.

Your engine decides the interface: AdkServerConfig.host is read by AdkApiServer, not here.