Creates a new kernel application instance.
Options for createApplication.
-
plugins: IPlugin[]
Plugins to pre-register before
IApplication.start.
Kernel application extends IApplication with inject() capability.
-
hasPlugin(name: string): boolean
Reports whether a plugin carrying this name is pending.
-
inject(request: InjectRequest): Promise<InjectResponse>
Synthesizes an incoming request and runs it through the full pipeline without requiring a listening server.
-
unregister(name: string): boolean
Removes a pending plugin by name before the application starts.
Inject request shape for IKernelApplication.inject.
-
body: unknown
Request body (will be stringified if not a string).
-
headers: Record<string, string> | Headers
Request headers.
-
method: string
HTTP method.
-
url: string
Full request URL.
Inject response shape returned by IKernelApplication.inject.
-
body: string | null
Raw response body as text. A byte body (from
response.send(bytes)) is UTF-8 decoded;nullonly when the response genuinely has no body. -
headers: Headers
Response headers.
-
json<T>(): T
Parses the response body as JSON.
-
statusCode: number
Response status code.
Usage
import * as Plugin_kernel__plugin_registry__service_registry__middleware_pipeline__router__and_application_lifecycle___Every_export_here_is_public_API_and_documented_in_PUBLIC_API_md__AI_GUIDELINES__10__ from "kernel/src/index.ts";