Classes

c
MalformedRequestBodyError(cause: unknown)

Thrown when a request body cannot be parsed as JSON.

  • name: string

    Discriminant for consumers that cannot use instanceof across realms.

c
UnsupportedFormEncodingError()

Raised when a request body is not a form encoding the framework can parse: a JSON body, a missing content-type, or a multipart/form-data type carrying no boundary=.

  • name: string

    Discriminant for consumers that cannot use instanceof across realms.

Functions

f
assertRealPathContained(
fs: Pick<IFileSystem, "realPath" | "stat">,
root: string,
target: string
): Promise<boolean>

Asserts that a target path is contained within a root by comparing canonical paths.

f
brandErrorResponder(
middleware: object,
responder: IErrorResponder
): void

Brands a middleware function with the application's resolved error responder, so the kernel can reach it at the pre-pipeline sites.

f
causeMessage(cause: unknown): string

Extracts a caller-facing message from an unknown thrown value.

f
composeBehaviorChain<TWork, TResult>(
work: TWork,
behaviors: readonly BehaviorLike<TWork, TResult>[],
terminal: () => Promise<TResult>
): Promise<TResult>

Composes behaviours around a terminal handler — the ONE shared composer for the CQRS pipeline and all four non-HTTP ingress chains.

f
contentTypeFor(path: string): string

Returns the content type for a file based on its extension.

f
contextToTraceparent(context: TelemetryContext): string | null

Formats a context as a W3C traceparent value.

f
f
createCapabilityToken(name: string): CapabilityToken

Creates a custom capability token for third-party plugins.

f
createPathMatcher(patterns: readonly PathPattern[]): (path: string) => boolean

Builds a path-exclusion predicate from a list of literals and patterns.

f
decodeCursor(token: string): CursorPayload | null

Decode a cursor token to its CursorPayload, or null when the token is malformed.

f
decodeFrameData(payload: EncodedPayload): string | Uint8Array

Decodes a payload received from the wire back into its local form.

f
encodeCursor(payload: CursorPayload): string

Encode a CursorPayload as a base64url-encoded JSON token.

f
encodeFrameData(data: string | Uint8Array): EncodedPayload

Encodes a WebSocket payload for the wire.

f
errorResponderOf(middleware: object): IErrorResponder | undefined

Reads the error responder branded onto a middleware function, if any.

f
extractContextFromHeaders(headers: Headers): TelemetryContext

Extracts W3C trace context from web-standard headers.

f
formEncodingOf(contentType: string | null): FormEncoding | undefined

Classifies a request content-type as one of the two form encodings.

f
httpStatusHintOf(error: unknown): HttpStatusHint | undefined

Reads the status hint an error was branded with.

f
isLexicallyContained(relativePath: string): boolean

Checks if a relative path is lexically contained within a root.

f
isPromiseLike<T>(value: T | PromiseLike<T>): value is PromiseLike<T>

Reports whether a value is thenable, by the same duck-typed test the platform serve layers use rather than instanceof Promise.

f
isWebSocketUpgradeRequest(headers: Headers): boolean

Reports whether a set of request headers describes an RFC 6455 WebSocket upgrade.

f
none(): None

Returns the None option.

f
ok<T>(value: T): Ok<T>

Creates a successful Result.

f
parseCookie(header: string | null | undefined): Record<string, string>

Parses a Cookie request header into a name→value record.

f
parseFormBody(
body: Uint8Array,
contentType: string | null
): FormBody

Parses one request body as a form — the ONE parse all three IRequest.formData?() implementations share, and the function every fallback path (a request without the optional accessor) calls directly.

f
parseJsonBody(text: string): unknown

Parses one request-body text as JSON, the ONE parse all three IRequest json() implementations share (X37-1, M90f).

f
replacePrincipal(
request: IRequest,
principal: IPrincipal
): void

Replaces request.user deliberately, bypassing the single-write guard.

f
replaceTenant(
request: IRequest,
tenant: ITenant
): void

Replaces request.tenant deliberately, bypassing the single-write guard.

f
resolveKeysetSort(
orderBy: Readonly<Record<string, OrderDirection>>,
keyColumns: ReadonlyArray<string>
): Record<string, OrderDirection>

The sort a keyset walk actually runs under: the caller's orderBy followed by every primary-key column it does not already carry, each ascending.

f
resolveProbeTiming(runtime: IRuntimeServices): ProbeTiming

Resolves a probe's monotonic clock and timer surface from an injected IRuntimeServices.

f
resolveRegistryEntry<T>(
entry: T | RegistryFactory<T>,
services: IServiceRegistry,
label: string
): T

Resolves one entry of a registration option that accepts either an instance or a RegistryFactory.

f
resolveResponseStatus(
status: number,
target: ErrorResponderTarget
): number

Returns a status the web Response constructor will accept, clamping an unserveable one to 500 and reporting it through the logger capability when one is reachable.

f
respondWithAuthorizationFailure(
target: ErrorResponderTarget,
failure: AuthorizationFailure
): void

Write the framework-standard response for an authorization refusal.

f
respondWithError(
target: ErrorResponderTarget,
init: ErrorResponseInit
): void

Responds to an error in the application's configured format.

f
sealRequestIdentity(request: IRequest): void

Installs the single-write guard over request.user and request.tenant.

f
securityMetadataOf(middleware: MiddlewareFunction): RouteSecurityMetadata | undefined

Reads the security metadata a middleware function was branded with.

f
serializeCookie(
name: string,
value: string,
attrs?: CookieAttributes
): string

Serializes a cookie into a Set-Cookie header value.

f
serializeError(value: unknown): SerializedError

Serializes any thrown value to a plain, serializable object.

f
setUpgradeIntent(
request: IRequest,
intent: WebSocketUpgradeIntent
): void

Brands a request with a WebSocket upgrade intent for the HTTP adapter to act on after the framework handler returns.

f
some<T>(value: T): Some<T>

Creates an Option holding a value.

f
sortFingerprint(orderBy: Readonly<Record<string, OrderDirection>>): string

Build the stable sort fingerprint embedded in every minted cursor.

f
f
unwrap<T, E>(result: Result<T, E>): T

Unwraps a Result, returning the value or throwing the error.

f
upgradeIntentOf(request: IRequest): WebSocketUpgradeIntent | undefined

Reads the WebSocket upgrade intent an adapter should act on, or undefined when the pipeline did not ask for an upgrade.

f
validatedStateKey(target: ValidationTarget): string

Builds the ctx.state key under which the validated value for a target is stored — the cross-package wire format between the writer (validation-plugin's middleware) and any reader (e.g. decorator-plugin's parameter resolvers). Both sides import this helper so the key can never drift between the package that writes it and the one that reads it back.

f
validationMetadataOf(middleware: MiddlewareFunction): RouteValidationMetadata | undefined

Reads the validation metadata a middleware function was branded with.

f
withHttpStatusHint<T extends Error>(
error: T,
hint: HttpStatusHint
): T

Brands an error with the status it should be answered with.

f
withSecurityMetadata<T extends MiddlewareFunction>(
middleware: T,
metadata: RouteSecurityMetadata
): T

Brands a middleware function with the security it enforces, so a documentation generator can read it without importing the plugin that produced it.

f
withValidationMetadata<T extends MiddlewareFunction>(
middleware: T,
metadata: RouteValidationMetadata
): T

Brands a middleware function with the request part and schema it validates, so a documentation generator can read it without importing the plugin that produced it.

Interfaces

I
AddJobOptions

Options accepted when enqueueing a job.

I
AuditEntry

One immutable audit trail entry.

I
BehaviorLike

The structural shape both behaviour contracts satisfy, and the element type of composeBehaviorChain's behaviors array.

I
BulkheadPolicy

Bulkhead policy consumed by the ResiliencePlugin's bulkhead pattern.

I
CachedProbeOptions

Options for createCachedProbe.

I
CircuitBreakerPolicy

Circuit breaker policy consumed by the ResiliencePlugin's breaker pattern.

  • resetTimeout: number

    Cooldown in milliseconds before an open breaker moves to half-open.

  • threshold: number

    Failures within the timeout window that trip the breaker open.

  • timeout: number

    Rolling failure window in milliseconds; failures older than this (measured by the monotonic clock) are dropped before the threshold check.

I
ClassProvider

Provides a service by constructing a class, injecting the listed tokens as constructor arguments.

I
CookieAttributes

Attributes controlling how a browser stores and returns a cookie.

I
CqrsCommand

A command: a request that mutates state and returns a result.

I
CqrsQuery

A query: a request that returns data without side effects.

I
CqrsRequest

A CQRS request identified by a string type and carrying typed data.

I
CursorPayload

The decoded contents of a cursor minted by encodeCursor: the values of every ordered field (in orderBy order) plus the primary-key column values (for tiebreaker lookups) plus a stable fingerprint of the sort specification. The fingerprint is what a fingerprint mismatch on decode detects.

  • keyValues: ReadonlyArray<CursorValue>

    The primary-key column values (in key-column order), from the row the cursor was minted against. Used by keysetPredicate as the tiebreaker fallback when a key column is absent from orderBy.

  • orderedValues: ReadonlyArray<CursorValue>

    The value of every ordered field (in orderBy declaration order), from the row the cursor was minted against. Index i is the value of the i-th entry of Object.entries(orderBy).

  • sortFingerprint: string

    A stable fingerprint of the resolved sort specification: each ordered field paired with its direction, in order. A cursor minted under one sort and presented under another has a different fingerprint, so the caller is refused by name rather than served a silently wrong page.

I
EncodedPayload

A payload as it travels the backplane.

I
EnvVarSpec

Specification of one environment variable for IEnvironmentApi.validate.

I
Err

A failed result carrying an error.

I
ErrorResponderTarget

The minimal context an error responder needs to write a response: the request-scoped state (where the responder itself is published), the response builder to write to, and the request (for the Problem Details instance).

I
ErrorResponseInit

The initialization of an error response produced through the responder seam.

I
FactoryProvider

Provides a service via a factory function.

I
FlagContext

Evaluation context for targeting rules.

I
FormBody

A parsed form body: the read-only view IRequest.formData?() resolves and parseFormBody returns.

  • entries(): IterableIterator<[string, FormValue]>

    Iterates every [name, value] pair in wire order — the enumeration primitive for reading a form whose field names the reader does not know ahead of time (the hand-rolled new URLSearchParams(body) iteration this accessor replaces).

  • get(name: string): FormValue | undefined

    Returns the FIRST value for a name, or undefined when the name is absent — the web standard's get, with undefined (narrowable) in place of null.

  • getAll(name: string): readonly FormValue[]

    Returns every value for a name in wire order — the web standard's getAll, so a repeated field (multi-select, multi-file) keeps the order the client sent.

I
FormFile

One file part of a form body: a field that declared a filename in its Content-Disposition.

I
GraphqlConnectionInfo

Information about a WebSocket connection used for subscription operations.

I
GraphqlExecutionOutcome

The outcome of a GraphQL execution, carrying an HTTP status code for the transport layer to use.

I
GraphqlExecutionResult

The execution result as specified by the GraphQL spec.

I
GraphqlFormattedError

Formatted GraphQL error as returned to the client.

I
GraphqlOperationContext

Context for a subscription operation, carrying either an HTTP request context or a WebSocket connection info.

I
GraphqlRequestParams

Parameters for a GraphQL execution request.

I
GrpcServiceDefinition

A gRPC service definition that satisfies the plugin's expectations. This is a structural constraint satisfied by generated descriptor objects from @bufbuild/protobuf. It contains only the fields the plugin needs to route requests and build reflection data.

I
HandlerResult

Opaque marker returned by IResponse terminal methods and expected back from route handlers. It exists purely so the type system can verify a handler produced a response; only the kernel creates values of this type.

I
HealthCheckResult

The outcome of one health check.

I
HealthReport

The aggregated health report returned by IHealthService.check().

I
HttpStatusHint

How an error should be answered, as decided by the code that threw it.

  • detail: string

    The caller-facing disclosure, served verbatim — required here, where ErrorResponseInit leaves it optional, because a hint that omitted it would fall back to the Error's own message.

  • status: number

    The HTTP status to answer with. Must be an integer in 400599; a hint outside that range is treated as ABSENT and the error takes the ordinary masked-500 path, because a hint says how an ERROR should be answered and a status the platform cannot serve would make the error handler itself throw.

I
IAdapterTransaction

A transaction handle that can also open entity data sources bound to itself.

I
IApplication

The application: registers plugins, owns the router and middleware pipeline, and manages the server lifecycle.

I
IAuditLogger

Immutable audit trail writer.

I
IAuthorizationService

Authorization service for RBAC with role hierarchy.

I
IAuthService

Authentication service that coordinates strategies and provides credential verification for login flows.

I
IAuthStrategy

Authentication strategy interface. Implementations extract credentials from a request and return a principal, or null if the strategy does not apply.

I
ICacheStore

Key/value cache with per-entry TTL.

I
ICircuitBreaker

Circuit breaker protecting calls to an unreliable dependency.

I
ICliApi

CLI command registration surface: a plugin publishes commands here, and the kernel registers each under CAPABILITIES.CLI_COMMAND as a multi-provider token that any consumer can read with getAll.

I
ICommandHandler

Handles one command type.

I
IConfig

Type-safe configuration access. Values originate from environment variables and .env files, validated at startup.

I
IContainer

Dependency injection container.

I
ICounter

Monotonically increasing counter. observe / inc add a non-negative value.

I
ICqrsFacade

Facade combining command and query buses.

I
IDatabaseAdapter

The full database backend port: lifecycle plus data access.

I
IDecoratorApi

Custom decorator registration surface (active only when the DecoratorPlugin is registered; inert otherwise).

I
IDnsResolver

DNS resolution, abstracted across runtimes.

I
IDomainEvent

A domain event.

I
IEnvironmentApi

Environment validation surface: plugins declare the environment variables they need, and the kernel validates them at startup, failing fast on violations.

I
IErrorResponder

A request-scoped error responder: writes an error response in the application's configured format.

I
IEventBus

In-memory publish/subscribe event bus for domain events.

I
IFeatureFlags

Feature flag evaluator. Evaluation is synchronous against the provider's cached state; providers refresh their state out of band.

I
IFileSystem

Runtime-agnostic file system operations. Absent on runtimes without file system access (edge platforms).

I
IGraphqlService

The GraphQL service contract.

I
IGrpcService

The service contract that applications use to register gRPC/Connect services. Provided by the grpc-plugin under the CAPABILITIES.GRPC token.

I
IHealthApi

Health check registration surface.

I
IHealthIndicator

A named health indicator contributing to /health, /live, and /ready.

I
IHealthService

Health service contract for registering and checking health indicators.

I
IHistogram

Histogram: bucketed observation distribution plus sum and count.

I
IHttpAdapter

HTTP server adapter provided by the runtime plugin. No other plugin may create HTTP servers (AI_GUIDELINES §4.3).

I
IIngressBehavior

Cross-cutting behaviour around one unit of non-HTTP ingress work.

I
IJob

A queued job delivered to a processor.

I
IJwtService

JWT sign/verify service.

I
ILifecycleApi

Lifecycle hook registration surface. Hooks run in registration order within each phase.

I
ILogger

Structured logger. All framework and application logging goes through this interface — never console (AI_GUIDELINES §11.6).

I
IMailer

Email sender.

I
IMessageBroker

Message broker for cross-service integration events.

I
IMetadataStore

Metadata captured by decorators, read by the DecoratorPlugin. Stored in plain maps — no reflection (ARCHITECTURE.md §12). The concrete metadata value shapes are owned by the decorator plugin.

I
IMetric

A registered metric.

I
IMetricsApi

Metric registration surface.

I
IMetricsService

Metrics service resolved via ctx.services.get<IMetricsService>('metrics').

I
IMiddleware

Object form of middleware, for implementations that carry state.

I
IMiddlewareApi

Middleware pipeline registration surface exposed to plugins.

I
IMultiTenancyService

Multi-tenancy service — exposes tenant context, repository creation, and cache-key helpers.

I
IngressContext

Transport-neutral envelope for ONE unit of non-HTTP work.

  • attempt: number

    1-based delivery attempt. Present for 'queue' (from IJob.attempts) and 'scheduler' (from ScheduledJob.attempts); ABSENT for 'messaging' and 'websocket'. Absent means "this ingress cannot tell you" — never "first try": brokers redeliver and none tracks a delivery count, so a fabricated 1 would lie on a fifth redelivery.

  • headers: Readonly<Record<string, string>>

    Transport headers, populated on the 'messaging' arm from MessageMetadata.headers and on the 'queue' arm from IJob.headers. {} means the channel carried none; absent means there was no channel.

  • kind: IngressKind

    Which ingress path produced this work item — the discriminator a behaviour branches on.

  • name: string

    The route the work is addressed by: the queue job name, the scheduler job name, the broker topic, or the WebSocket route path.

  • payload: TPayload

    The native work item: an IJob, a ScheduledJob, the message payload, or the frame data.

I
INotifier

Multi-channel notification dispatcher.

I
IOpenApiApi

OpenAPI contribution surface. Schema values are unknown here; the OpenAPI plugin narrows them (Zod schemas by default).

I
IOrmAdapter

ORM adapter port — what the DatabasePlugin requires from any ORM integration.

I
IPipelineBehavior

Wraps a handler with cross-cutting logic (logging, timing, validation, etc.).

I
IPlugin

The plugin contract. Every framework capability implements this interface (AI_GUIDELINES §3.2).

I
IPluginContext

The registration context handed to IPlugin.register — every extension point a plugin can touch.

I
IPrincipal

The authenticated identity attached to a request by authentication middleware.

I
IQueryHandler

Handles one query type.

I
IRealtimeBackplane

A publish/subscribe transport carrying RealtimeFrames between application instances.

I
IRequest

Runtime-agnostic view of an incoming HTTP request.

I
IRequestContext

Per-request context passed to middleware and route handlers. Each request gets a fresh context; request-scoped data lives here, never in globals.

I
IResilienceService

Resilience service registered under CAPABILITIES.RESILIENCE.

I
IResponse

Runtime-agnostic response builder. Configuration methods (status, header) chain; terminal methods (json, text, send, redirect) produce the HandlerResult a route handler returns.

I
IRouterApi

Router registration surface exposed to plugins and applications.

I
IRuntimeServices

Runtime services — every runtime-specific operation the framework needs, abstracted behind one interface. Registered under CAPABILITIES.RUNTIME by the RuntimePlugin, which is mandatory in every application.

I
ISecretManager

Secret manager backed by a provider (AWS KMS, GCP Secret Manager, Azure Key Vault, HashiCorp Vault, or environment variables in development).

I
IServiceDiscovery

Resolves logical service names to reachable instances, balances across them, and learns from reported call outcomes.

I
IServiceRegistry

Maps capability tokens to service instances.

I
ISession

Per-request session handle.

I
ISessionService

Session service registered under CAPABILITIES.SESSION.

I
ISessionStore

Server-side session storage port.

I
ISpan

A span represents a single operation within a trace.

I
ISseConnection

A live SSE connection backed by a ReadableStream.

I
ISseService

Service contract for the SSE hub — registered by the SsePlugin under CAPABILITIES.SSE.

I
ISsrService

Service contract for server-side rendering (SSR).

I
IStorage

Object storage abstraction.

I
ISubscription

An active subscription.

I
ISummary

Summary: per-quantile observations plus sum and count.

I
ITelemetryService

Telemetry service — the primary API for creating spans.

I
ITenant

A resolved tenant.

I
ITenantRepository

Tenant-scoped repository — delegates CRUD to the data store the multi-tenancy plugin was configured with (ITenantDataStore, declared in that plugin), while threading the resolved tenant id.

I
ITenantResolver

Resolves the tenant for an incoming request (by subdomain, header, path, or JWT claim, depending on the implementation).

I
ITransaction

A database transaction handle.

I
ITransactionIsolationSupport

An adapter's explicit declaration of portable transaction isolation support.

I
IValidationService

Data validation service.

I
IViewEngine

View engine contract — renders a view component and its props to HTML.

I
IWebSocketConnection

A live WebSocket connection, as seen by application code.

I
IWebSocketService

Service contract for the WebSocket hub — registered by the WebSocketPlugin under CAPABILITIES.WEBSOCKET.

I
IWebSocketTransport

The runtime-native socket, normalized to the two operations the framework needs. Implemented by each HTTP adapter's upgrader over its platform socket (Deno.upgradeWebSocket's WebSocket, a ws socket on Node, Bun's ServerWebSocket, the server half of a Workers WebSocketPair).

I
IWorkerHandle

Handle to one spawned worker thread, normalized across web Worker (Deno/Bun) and node:worker_threads (Node).

I
IWorkerHost

Thread-spawning primitive provided by runtimes that support worker threads. Absent on runtimes without them (e.g. Cloudflare Workers) — consumers MUST degrade gracefully when it is not provided (see the WorkerPoolPlugin, which fails run() with a typed error when no host exists).

I
IWorkerPool

A pool of worker threads executing task modules off the event loop.

I
JwtSignOptions

Options accepted when signing a JWT.

I
MailMessage

An outgoing email message.

I
MessageMetadata

Transport metadata accompanying a delivered message.

I
MetricConfig

Configuration for registering a metric.

I
MetricOptions

Ergonomic options for the typed factory methods. type is injected by the method name; help defaults to the metric name.

I
MiddlewareOptions

Options accepted when adding middleware to the pipeline.

  • name: string

    Diagnostic name shown in pipeline introspection.

  • priority: number

    Execution priority — lower numbers run earlier. See ARCHITECTURE.md §10 for the conventional priority bands of first-party middleware.

I
None

An Option holding no value.

I
NormalizedQuery

A repository query with every option resolved to a concrete value — the shape a IDataSource evaluates.

I
NotificationMessage

A notification dispatched across one or more channels.

I
Ok

A successful result carrying a value.

I
PageResult

A single page of rows returned by IDataSource.findPage, plus the cursor that continues to the next page (or null when the page is the last).

I
PickOptions

Per-call overrides for IServiceDiscovery.pick.

I
ProbeTiming

The clock-and-timer surface createCachedProbe runs on, bound to a runtime.

I
ProcessOptions

Options accepted when registering a processor.

I
ProviderOptions

Options accepted when registering a provider.

I
PutObjectOptions

Object attributes accepted alongside the bytes when storing an object.

  • contentType: string

    MIME type recorded on the stored object (e.g. 'image/png'). Omitted leaves the backend's own default, which is application/octet-stream on every provider that supports the field.

  • metadata: Readonly<Record<string, string>>

    Arbitrary user metadata recorded alongside the object. Keys and values are passed through to the backend unmodified; backends impose their own limits on size and on which characters a key may contain.

I
RbacConfig

RBAC configuration for role hierarchy and permissions.

I
RealtimeFrame

One broadcast crossing the backplane.

I
RecurringOptions

Options accepted when scheduling a recurring job.

I
RegisterOptions

Options accepted when registering a service.

I
RequestOptions

Options accepted by IMessageBroker.request.

  • timeoutMs: number

    Reply wait budget in milliseconds. When no correlated reply arrives within this window, request rejects. Defaults to 5000 when omitted.

I
RetryOptions

Retry configuration for a scheduled job.

I
RetryPolicy

Retry policy consumed by the ResiliencePlugin's retry pattern.

I
RoleDefinition

Role definition for RBAC configuration.

I
RoomBroadcastOptions

Options for a room broadcast.

I
RouteDefinition

Full route definition, used when a route needs middleware or schemas in addition to its handler.

I
RouteInfo

Route information returned by IRouterApi.listRoutes.

I
RouteSchema

Validation/documentation schemas attached to a route. Schema values are intentionally unknown here — the validation plugin narrows them (Zod schemas by default) so common stays dependency-free.

I
RouteSecurityMetadata

What a middleware function enforces, for documentation generators.

  • authenticated: boolean

    true when the middleware requires an authenticated principal; false when it explicitly marks the route public.

I
RouteValidationMetadata

What a validating middleware checks, branded onto the middleware function so a documentation generator can describe the route without importing the plugin that produced it.

I
ScheduledJob

A scheduled job instance handed to the handler.

I
ScheduleOptions

Options passed when scheduling a job.

I
SerializedError

A plain, serializable representation of a thrown value.

I
ServiceInstance

One reachable instance of a service.

I
SignedUrlOptions

Options accepted when creating a signed URL.

I
Some

An Option holding a value.

I
SpanContext

The return type of ISpan.spanContext.

I
SpanOptions

Options for span creation.

I
SplitWorkerEnv

The two halves of a Workers env record.

I
SrvRecord

One DNS SRV record, normalized across runtimes.

I
SseChannel

A named broadcast channel within the SSE hub.

I
SseMessage

A single SSE event payload.

  • data: JsonValue

    Event data. A string is written literally (split on \n into multiple data: lines); any non-string is JSON.stringify-ed. undefined is forbidden — use {} or omit the message instead.

  • event: string

    Event type name — sent as event: field.

  • id: string

    Unique event identifier — sent as id: field; enables Last-Event-ID resume.

  • retry: number

    Reconnection time in milliseconds — sent as retry: field.

I
StartOptions

Options for starting the application server.

I
StatResult

File metadata returned by IFileSystem.stat.

I
SubscribeOptions

Options accepted when subscribing to a topic.

  • queue: string

    Consumer group / queue name for load-balanced delivery.

I
TaskPoolStats

A snapshot of one task-module pool's state, returned by IWorkerPool.stats.

I
TelemetryContext

Opaque handle representing the parent context for span creation.

I
TransactionOptions

Optional controls for opening a transaction.

I
ValidationIssue

A single validation failure.

I
ValueProvider

Provides a pre-built value.

I
WebSocketCloseEvent

Payload of a WebSocket close, normalized across runtimes.

  • code: number

    The RFC 6455 close code (e.g. 1000 normal, 1001 going away).

  • reason: string

    The close reason; an empty string when the peer supplied none.

I
WebSocketConnectionContext

Details of the upgrade request that opened a connection, handed to WebSocketHandlers.onOpen.

I
WebSocketEventSink

The callbacks an HTTP adapter drives once it has completed a handshake. The WebSocket plugin builds one sink per accepted upgrade and hands it to the adapter inside the accept decision; the adapter binds its native socket events to these methods.

I
WebSocketHandlers

The lifecycle callbacks an application supplies per WebSocket route.

I
WebSocketRoom

A named broadcast group of connections — the bidirectional analogue of the SSE plugin's channels.

I
WebSocketRouteOptions

Per-route configuration supplied alongside the handlers.

  • guards: readonly WebSocketUpgradeGuard[]

    Guards evaluated before this route's WebSocket handshake is accepted.

  • heartbeat: boolean

    Whether this route participates in the shared heartbeat sweep.

  • protocols: readonly string[]

    Subprotocols this route accepts. When non-empty, the first client-requested protocol appearing in this list is echoed back and any request whose Sec-WebSocket-Protocol matches none of them is rejected with 400. When omitted, no protocol is negotiated and none is echoed.

I
WebSocketUpgradeIntent

The WebSocket upgrade intent the kernel terminal handler brands onto an IRequest under UPGRADE_INTENT, for the HTTP adapter to act on once the middleware pipeline has run without short-circuiting.

I
WorkerErrorShape

Serialized shape of an error crossing the thread boundary in a WorkerTaskReply.

I
WorkerReadySignal

Posted once by the worker side (defineWorkerTask) after its message handler is wired; the pool dispatches tasks only to ready workers.

I
WorkerRunOptions

Options for one IWorkerPool.run call.

  • timeoutMs: number

    Per-call task timeout in milliseconds, overriding the pool's configured timeout. 0 disables the timeout for this call.

I
WorkerTaskReply

A task outcome posted by the worker back to the pool.

I
WorkerTaskRequest

A task dispatch posted by the pool to a worker.

I
WrapOptions

Options selecting which resilience patterns wrap a protected call.

Type Aliases

T
AuthorizationFailure =
"authentication-required"
| "not-configured"
| "insufficient-privileges"

The authorization condition that determines a standard refusal response.

T
BackoffStrategy = "fixed" | "exponential"

Backoff strategy applied to a RetryPolicy's base delay.

T
CapabilityToken = string

A capability token: a lowercase kebab-case string that identifies a capability, not a concrete type.

T
Component<P> = (props: P) => unknown

A view component: a pure function from a props bag to something the engine can render to a string — a JSX node (@hono/hono/jsx), an HtmlEscapedString (the html tagged template), or a plain string (a by-name template adapted per §3.6 of the M92 plan).

T
CursorValue = string | number | Date

A scalar value retained by a portable keyset cursor.

T
DecoratorHandler = (
metadata: Readonly<Record<string, unknown>>,
target: object,
propertyKey?: string
) => void

Handler invoked when a custom decorator is applied; receives the metadata the decorator captured.

T
EntityKey = string | number | Readonly<Record<string, string | number>>

A primary key value: a scalar string, a scalar number, or a composite key expressed as a readonly record of named columns to values.

T
FilterOperator = "eq" | "contains" | "gt" | "gte" | "lt" | "lte" | "in"

Operators supported by a portable repository filter comparison.

T
FormEncoding = "urlencoded" | "multipart"

The two request encodings a form body can carry.

T
FormValue = string | FormFile

One form value: a plain field string, or a FormFile.

T
GrpcServingStatus = "unknown" | "serving" | "not-serving" | "service-unknown"

The serving status returned by the health bridge. These values map onto the gRPC v1 Health response enum.

T
HealthIndicatorFn = () => Promise<HealthCheckResult>

Function form of a health indicator.

T
HealthStatus = "up" | "down" | "degraded"

Health state reported by a health indicator.

T
IngressKind = "queue" | "scheduler" | "messaging" | "websocket"

The ingress path a unit of non-HTTP work arrived on.

T
LogLevel = "fatal" | "error" | "warn" | "info" | "debug" | "trace"

Log severity levels, ordered from most to least severe.

T
LogMetadata = Readonly<Record<string, unknown>>

Structured metadata attached to a log entry.

T
MetricType = "counter" | "gauge" | "histogram" | "summary"

Metric instrument kinds supported by the metrics capability.

T
MiddlewareFunction = (
ctx: IRequestContext,
next: NextFunction
) => void | HandlerResult | Promise<void | HandlerResult>

A middleware function: pre-process, call next(), post-process. May short-circuit by returning a response without calling next().

T
NextFunction = () => Promise<void>

Continues the middleware pipeline. Not calling it short-circuits the pipeline (the caller must have produced a response).

T
Option<T> = Some<T> | None

An optional value: either Some or None. Narrow with the present discriminant or the isSome/isNone guards.

T
OrderDirection = "asc" | "desc"

Sort direction for a single field.

T
PathPattern = string | RegExp

One exclusion entry: an exact path, or a pattern tested against the path.

T
RealtimeFrameHandler = (frame: RealtimeFrame) => void

Receives frames published by other instances.

T
RealtimeFrameKind = "ws-room" | "sse-channel"

Which kind of broadcast group a RealtimeFrame addresses.

T
RegistryFactory<T> = (services: IServiceRegistry) => T

A factory that constructs a registry entry from the service registry.

T
RequestHandler<TReq = unknown, TRes = unknown> = (
message: TReq,
metadata: MessageMetadata
) => TRes | Promise<TRes>

Responder for a request topic. Its resolved value is sent back to the caller as the reply, correlated to the originating request.

T
ResilientCall<T> = (signal: AbortSignal) => Promise<T>

A call protected by the resilience patterns.

T
ResponseSnapshotInit = { readonly headers: HeadersInit; }

Native-response initialization data attached to a snapshot by the kernel when its headers have not needed a mutable Headers instance.

T
Result<T, E = Error> = Ok<T> | Err<E>

The result of an operation that can fail: either Ok or Err. Narrow with the success discriminant or the isOk/isErr guards.

T
RouteHandler = (ctx: IRequestContext) => HandlerResult | Promise<HandlerResult>

A route handler: receives the request context and returns a response via the context's response builder.

T
RpcFetchHandler = (request: Request) => Promise<Response | null>

A fetch handler that attempts to handle a gRPC/Connect request. Returns a Response if the request was handled as RPC, otherwise returns null so the adapter falls through to normal Hono handling.

T
RuntimePlatform = "node" | "deno" | "bun" | "cloudflare-workers"

JavaScript runtimes the framework can execute on.

T
RuntimeSignal = "SIGTERM" | "SIGINT"

A process-termination signal an application can shut down gracefully on.

T
SchedulerBackoff = "fixed" | "exponential"

Backoff strategy for retry delays.

T
SecurityRequirement = Readonly<Record<string, readonly string[]>>

A single OpenAPI security requirement: a map of security-scheme name to the scopes that scheme must grant. Scopes are meaningful only for OAuth2 and OpenID Connect schemes; every other scheme type takes an empty array.

T
ServerHandle = unknown

Opaque handle for a running HTTP server, created and consumed only by the runtime's HTTP adapter.

T
ServiceFactory<T> = () => T

A factory invoked lazily on the first lookup of a token registered with IServiceRegistry.registerFactory.

T
ServiceOutcome = "success" | "failure"

How a call to an instance went, as reported by the caller.

T
SessionData = Record<string, unknown>

Arbitrary serializable session payload.

T
SessionView = { readonly id: string; readonly data: Readonly<SessionData>; }

A read-only projection of a session: its identifier and payload, with no mutation surface.

T
SpanAttributeValue =
string
| number
| boolean
| ReadonlyArray<string | number | boolean>

Attribute value — a span attribute can be a primitive or an array of primitives.

T
SpanKind = "internal" | "server" | "client" | "producer" | "consumer"

The kind of span. Maps to OTel SpanKind at the implementation boundary.

T
SpanStatus = "ok" | "error" | "unset"

Span status — whether the span completed successfully or not.

T
StandardCapability = (CAPABILITIES)[keyof CAPABILITIES]

Union of all standard capability token values.

T
TimerHandle = unknown

Opaque handle returned by runtime timer methods. Its concrete shape is runtime-specific (a number on Deno, an object on Node); consumers only ever pass it back to clearTimeout/clearInterval.

T
Unsubscribe = () => void

Removes a subscription when called.

T
ValidationTarget = "body" | "query" | "params" | "headers" | "cookies"

The request part a validation middleware targets.

T
WebSocketGuardDecision = true | { readonly status: number; }

The result of a route-scoped WebSocket upgrade guard.

T
WebSocketReadyState = "connecting" | "open" | "closing" | "closed"

Lifecycle state of a WebSocket, normalized across runtimes to names rather than the numeric codes the web API uses.

T
WebSocketUpgradeRouter = (request: Request) => Promise<WebSocketUpgradeDecision | null>

Consulted by an HTTP adapter for every inbound WebSocket upgrade request.

Variables

v
CAPABILITIES: { RUNTIME: string; LOGGER: string; CONFIG: string; VALIDATION: string; DATABASE: string; CACHE: string; EVENTS: string; MESSAGING: string; AUTH: string; AUTHORIZATION: string; JWT: string; SCHEDULER: string; METRICS: string; HEALTH: string; OPENAPI: string; TELEMETRY: string; SECRETS: string; AUDIT: string; RESILIENCE: string; STORAGE: string; MAIL: string; NOTIFICATION: string; FEATURE_FLAGS: string; QUEUE: string; CQRS: string; COMMAND_BUS: string; QUERY_BUS: string; MULTI_TENANCY: string; WORKER_POOL: string; DI_CONTAINER: string; HTTP_ADAPTER: string; SSE: string; WEBSOCKET: string; REALTIME_BACKPLANE: string; SSR: string; SESSION: string; SERVICE_DISCOVERY: string; HEALTH_INDICATOR: string; METRIC_REGISTRATION: string; OPENAPI_SCHEMA: string; CLI_COMMAND: string; DECORATOR_HANDLER: string; METADATA_STORE: string; GRPC: string; CLOUDFLARE: string; GRAPHQL: string; STATIC_FILES: string; VIEW: string; }

Standard capability tokens provided by the first-party plugins.

v
CLIENT_IP_STATE_KEY: "http-security-plugin:client-ip"

The ctx.state key under which http-security-plugin's ipSecurityMiddleware publishes the resolved client IP, and from which auth-plugin's rateLimitMiddleware reads it back.

v
ERROR_RESPONDER_BRAND: unique symbol

The brand under which an errorHandler middleware function carries its resolved IErrorResponder.

v
ERROR_RESPONDER_STATE_KEY: "exceptions:error-responder"

The ctx.state key under which an application's resolved error responder is published.

v
HTTP_STATUS_HINT: unique symbol

Key under which an Error carries its HttpStatusHint.

v
PLUGIN_PRIORITY: { HIGHEST: number; HIGH: number; NORMAL: number; OPENAPI: number; LOW: number; LOWEST: number; }

Well-known plugin registration priorities. Lower numbers register first.

v
TRACEPARENT_HEADER: "traceparent"

The W3C header carrying a trace parent. @since 0.2.0

v
TRACESTATE_HEADER: "tracestate"

The W3C header carrying vendor trace state. @since 0.2.0

v
UPGRADE_INTENT: unique symbol

Key under which the kernel terminal handler brands an IRequest with a WebSocket upgrade intent.

Usage

import * as Shared_types__interfaces__and_capability_tokens_for_the_Setu_TS_framework__This_package_has_zero_dependencies_and_no_runtime_behavior_beyond_constants_and_pure_type_utilities___Every_export_here_is_public_API_and_documented_in_PUBLIC_API_md__AI_GUIDELINES__10__ from "common/src/index.ts";