Skip to main content
Documentation

API Reference

The v1.0.0-alpha.15 surface covers only the 6 consumer packages. Retired alpha packages and internal subpaths are not authoring surfaces.

01 / interface rule

Authoring starts at product packages.

Current documentation, starters and dogfood use the 6 supported interfaces. Loader, action and form semantics are frozen at 0.42.0 (ADR-0122); framework session and active cache are not part of the contract and have no assigned version. Streaming is supported for compiled class pages as an opt-in mode of the compiled server executor (ADR-0158, ADR-0159; the Streaming guide documents its limits) and is deliberately rejected on server function pages, which have no compiled Part Program to backfill (ADR-0169).Streaming guideADR-0158ADR-0159ADR-0169

02 / supported surface

6 packages, one application path.

Each package owns a distinct consumer decision; absorbed implementation packages remain private.

@openelement/protocol

@openelement/protocol
CORE
root./app-model./client-assets./data+19 more

The cross-system contracts: the Part Program IR, the error dialect, and the admission descriptors the compiler, runtime and build share (#1557).

Zero dependencies, contracts only: no logic grows here by charter.You normally consume these through the packages that re-export them.Repository baseline — published on the alpha train.

@openelement/element

@openelement/element
CORE
root./authoring./base./build-utils+8 more

The supported Custom Element authoring surface for JSX, DSD, hydration, signals and styles — the pure runtime package since the #1557 split.

Start here for standalone element authoring.Author compiled elements as `@element`-decorated `OpenElement` classes with `@property` state; `StyleSheet` and signal helpers come from the same root.@experimental additions: the `element`/`property` decorator intrinsics (#1209) and the dangerous-key guards `isDangerousKey`, `injectPropsSafe`, `DANGEROUS_KEYS` (#1214).

@openelement/compiler

@openelement/compiler
BUILD
root./vite

The build-time TSX-to-Part-Program compiler and its Vite plugin boundary; the only package carrying the TypeScript dependency (#1557).

Build tooling only — never part of a browser/runtime graph.You normally drive it through the `@openelement/router` build; the standalone plugin is `@openelement/compiler/vite`.Repository baseline — published on the alpha train.

@openelement/router

@openelement/router
CORE
root./cli/build./cli/start./document+9 more

The application and build surface: pages, routes, islands, request/render semantics, Vite integration, static generation and Nitro output.

Use `definePage` and `defineIslandConfig` for application authoring.Use `openPipeline()`/`openElement()` from `@openelement/router/vite` or the generated build task for builds.Plugin ordering, manifests and content scans are router implementation details.

@openelement/create

@openelement/create
BUILD
root./install-command

The installed starter and zero-context consumer entrypoint.

Generated projects expose `dev`, `check`, `test`, `build`, `start` and `preview`.The starter imports product packages only.

@openelement/ui

@openelement/ui
OPTIONAL
root./instance-state./manifest./open-button+6 more

Optional primitives retained only when they have demonstrated reusable behavior.

UI is not required to use OpenElement.Website-specific brand, hero, lab and layout artifacts are not UI package contracts.

※ Internal subpaths (router request pipeline, element hydration modules) stay importable for tooling but carry no compatibility promise. The public type surface is explicit — no export-star seams on the v1.0.0-alpha.15 line.

Generated from repository truth by pnpm --dir tools/repo run interface:snapshot and machine-checked against each package's exports map.

03 / export reference

Every documented export, anchored.

Each entry below is enumerated from the package exports maps by the reference generator — name, kind, stability class, JSDoc summary, declared signature and option table are generated facts, never hand-copied. The anchor matches the generated search record for the same export.

@openelement/protocol

431 exports
Actiontype · public
@openelement/protocol · root

Route action: handles form submissions for a page route.

Action<T, Env, Platform, Route>
packages/protocol/src/data.ts:64
ACTION_FETCH_HEADERconst · public
@openelement/protocol · root

Request header selecting the action response channel: `true` marks a programmatic caller and selects the serialized ActionResult union; `enhance` marks the built-in morph enhancement and selects the same full-HTML responses the no-JS path receives.

"x-openelement-action"
packages/protocol/src/data.ts:125
ActionContextinterface · public
@openelement/protocol · root

Context passed to a route action function (extends loader context).

ActionContext<Env, Platform, Route>

formData: FormData (required); request: Request (required); params: Record<string, string> (required); env: Env (required); platform: Platform (required); responseHeaders: Headers (required) — Mutable response-only channel merged into the framework response.; route: Route (required)

packages/protocol/src/data.ts:47
ActionResulttype · public
@openelement/protocol · root

Wire shape returned to the JavaScript form-enhancement path. The no-JS path never sees this: it gets the equivalent semantics as plain HTTP (303 on success, 422 with the re-rendered form on validation failure, redirect/error as status codes). Success carries no data envelope. The application-loop contract makes a successful non-GET action answer 303 (PRG) — the framework never answers 200 with a rendered page, or with a success document, for a successful mutation — so the fetch channel answers `{ type: 'redirect' }` naming the PRG target and the authored return value is discarded by design. Success data travels the PRG target instead (query state the loader re-runs with, which the props projector then maps; see the router guide's "Form actions" section). The union previously declared a `{ type: 'success' }` member that no code path ever emitted — removed so the type matches the wire. Error outcomes (CSRF 403, unknown action 404, unparseable body 400, unexpected 500) are NOT part of this union: since #863 they answer RFC 9457 Problem Details with the PROBLEM_JSON_MEDIA_TYPE content type — see ProblemDetails.

ActionResult<Failure>
packages/protocol/src/data.ts:92
ApiRouteDeclinterface · public
@openelement/protocol · root

One API route declaration in the generated entry descriptor.

ApiRouteDecl

kind: "api" (required); path: string (required); varName: string (required); filePath: string (required); importPath: string (required)

packages/protocol/src/ssg.ts:163
AuthoringErrorCodeconst · public
@openelement/protocol · root

Attribute/authoring-surface failures (phase `validation`).

{ readonly INVALID_TAG_NAME: "OE_INVALID_TAG_NAME"; readonly UNSAFE_META_ATTRIBUTE: "OE_UNSAFE_META_ATTRIBUTE"; readonly UNSAFE_ATTRIBUTE_NAME: "OE_UNSAFE_ATTRIBUTE_NAME"; readonly UNSAFE_URL_SINK: "OE_UNSAFE_URL_SINK";…
packages/protocol/src/errors.ts:290
BuildArtifactsinterface · public
@openelement/protocol · root

Result returned by the OpenElement build pipeline.

BuildArtifacts

pages: BuildPageArtifact[] (required) — Generated HTML pages.; manifest: BuildManifestArtifact (required) — Build manifest.; clientAssets: BuildClientAsset[] (required) — Client-side assets (island bundles, CSS, etc).; warnings: string[] (required) — Non-fatal warnings.; errors: string[] (required) — Fatal errors.; success: boolean (required) — Whether the build succeeded.

packages/protocol/src/ssg.ts:527
BuildClientAssetinterface · public
@openelement/protocol · root

A single client asset emitted by the build pipeline.

BuildClientAsset

fileName: string (required); source: string | Uint8Array<ArrayBufferLike> (required); sizeBytes.toString: (radix?: number) => string (required) — Returns a string representation of an object.; sizeBytes.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; sizeBytes.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; sizeBytes.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; sizeBytes.valueOf: () => number (required) — Returns the primitive value of the specified object.; sizeBytes.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.

packages/protocol/src/ssg.ts:520
BuildI18nOptionsinterface · public
@openelement/protocol · root

i18n configuration for the build pipeline.

BuildI18nOptions

locales: string[] (required); defaultLocale?: string (optional)

packages/protocol/src/ssg.ts:473
BuildIslandInputinterface · public
@openelement/protocol · root

A single island input to the build pipeline.

BuildIslandInput

hydrate?: IslandDeliveryStrategy (optional); ssr?: boolean (optional); dsd?: boolean (optional); source?: "local" | "package" | "nested" (optional); reason?: string (optional); tagName: string (required); modulePath: string (required); isPackage?: boolean (optional)

packages/protocol/src/ssg.ts:454
BuildManifestArtifactinterface · public
@openelement/protocol · root

Manifest produced by the build pipeline.

BuildManifestArtifact

routes: { kind: "page" | "api"; path: string; tagName?: string; isDynamic: boolean; }[] (required); islands: BuildIslandInput[] (required); requestTimeRoutes?: string[] (optional) — Paths served at request time (renderIntent mode 'dynamic'). Absent for pure-static builds.

packages/protocol/src/ssg.ts:509
BuildOutputOptionsinterface · public
@openelement/protocol · root

Output configuration for the build pipeline.

BuildOutputOptions

root?: string (optional) — Project root directory.; outDir?: string (optional) — Output directory relative to root.; base?: string (optional) — Base URL path.

packages/protocol/src/ssg.ts:463
BuildPackageIslandOptionsinterface · public
@openelement/protocol · root

Package island configuration for the build pipeline.

BuildPackageIslandOptions

packages?: string[] (optional) — Package names that may expose island declarations.

packages/protocol/src/ssg.ts:479
BuildPageArtifactinterface · public
@openelement/protocol · root

A single generated HTML page artifact.

BuildPageArtifact

path: string (required); html: string (required); errors: { message: string; route?: string; }[] (required) — Errors collected while rendering this page.

packages/protocol/src/ssg.ts:501
BuildPlaninterface · public
@openelement/protocol · root

Framework-agnostic plan consumed by the OpenElement build pipeline.

BuildPlan

options.renderer?: "native" | "lit" (optional) — Page renderer selection (Beta.2.2, #1339). EXPLICIT, never inferred: 'native' (default) renders pages through the compiled Part Program serializer (renderToString); 'lit' renders LitElement pages through; options.routesDir?: string (optional) — Directory the route scanner walks, relative to the Vite root. Defaults to `app/routes`.; options.islandsDir?: string (optional) — Directory island modules are discovered in. Defaults to `app/islands`.; options.packageIslands?: string[] | "auto" | "manual" (optional) — How the build admits component packages whose modules the application imports. - omitted or `'auto'` (the default): the scan derives the admitted set at scan time — every package-owned element module the app's routes, pages, layouts, islands and components really reach (bundler-resolved) is attributed to its owner package (nearest `package.json`), and a package with a valid OpenElement manifest i…; options.layout?: LayoutConfig (optional) — Layout declaration; `false` disables the layout, `'default'` uses the built-in one.; options.layouts?: LayoutsConfig (optional) — Named layout declarations keyed by layout name.; options.headExtras?: string (optional) — @dangerous injected as-is, only use with controlled content; options.html?: { lang?: string; title?: string; } (optional) — Document `<html>` attributes: the `lang` the document declares and the default `<title>`.; options.inject?: { stylesheets?: Array<string | { href: string; integrity?: string; crossorigin?: "anonymous" | "use-credentials"; attrs?: Record<string, string | number | bool… (optional) — Document head/body injection channels: external stylesheets, scripts, and trusted raw head fragments.; options.ssr?: { noExternal?: (string | RegExp)[]; } (optional) — SSR bundling switches; `noExternal` forces the named packages through the SSR bundle instead of an external import.; options.island?: { upgradeStrategy?: HydrationStrategy; } (optional) — Island defaults applied to every island the build discovers.; options.build?: { outDir?: string; manifestBudget?: { islandKB?: number; totalJsKB?: number; pageKB?: number; }; } (optional) — Build output switches: the output directory and the advisory manifest budgets.; options.viewTransition?: boolean (optional) — Enable the View Transitions API for client navigations. Defaults to true.; options.speculation?: boolean | { prerender?: string[]; prefetch?: string[]; exclude?: string[]; eagerness?: "immediate" | "moderate" | "conservative"; } (optional) — Speculation Rules emission: `true` uses framework defaults, or pass prerender/prefetch URL lists, exclusions and an eagerness.; options.middleware?: { cors?: boolean; corsOrigin?: string | string[]; corsOriginModule?: string; requestId?: boolean; logger?: boolean; securityHeaders?: boolean; csp?: { policy?:… (optional) — Request-time middleware switches, composed outside the framework handler.; routes: BuildRouteInput[] (required) — Discovered page and API routes.; islands: BuildIslandInput[] (required) — Discovered local and package islands.; output.root?: string (optional) — Project root directory.; output.outDir?: string (optional) — Output directory relative to root.; output.base?: string (optional) — Base URL path.; i18n?: BuildI18nOptions (optional) — i18n expansion options.; packageIslands.packages?: string[] (optional) — Package names that may expose island declarations.

packages/protocol/src/ssg.ts:485
BuildRouteInputinterface · public
@openelement/protocol · root

A single route input to the build pipeline.

BuildRouteInput

kind: "page" | "api" (required) — Route kind: page or API.; path: string (required) — Route path (e.g. '/about', '/blog/:slug').; filePath: string (required) — Absolute or relative file path of the route module.; importPath: string (required) — Import specifier used by generated entry code.; tagName?: string (optional) — Resolved tag name for page routes.; paramNames?: string[] (optional) — Dynamic segment names.; staticParams?: Record<string, string>[] (optional) — Static generation params produced by getStaticPaths().

packages/protocol/src/ssg.ts:436
camelToKebabfunction · public
@openelement/protocol · root

The one camelCase → kebab-case casing rule for custom-element attribute names, so `<x-el itemCount={5}>` round-trips as `item-count` on every boundary that derives an attribute name from a prop name: the compiler's property metadata, the SSR serializer, and the client attribute handling.

(str: string): string
packages/protocol/src/forbidden-sinks.ts:95
CemCompatibilityReportinterface · public
@openelement/protocol · root

The compatibility classification report for one custom element manifest.

CemCompatibilityReport

totalClassified.toString: (radix?: number) => string (required) — Returns a string representation of an object.; totalClassified.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; totalClassified.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; totalClassified.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; totalClassified.valueOf: () => number (required) — Returns the primitive value of the specified object.; totalClassified.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.; ssrCapableCount: number (required); clientOnlyCount: number (required); rejectedCount: number (required); experimentalDomCount: number (required); classifications: CompatibilityClassification[] (required); summary: string (required)

packages/protocol/src/manifest.ts:115
CemPropertyMetadatainterface · public
@openelement/protocol · root

One property entry of the compiled custom-elements-manifest metadata.

CemPropertyMetadata

name: string (required); fieldName: string (required); type: PropertyValueType (required); attribute: string | null (required); reflect: boolean (required)

packages/protocol/src/part-program.ts:395
ClaimErrorCodeconst · public
@openelement/protocol · root

Claim failures: the existing DOM does not match the program that would own it. The value shipped in 1.0.0-alpha.3 and is kept verbatim; consumers match on it, and `PartProgramHydrationError` is its only raiser.

{ readonly STRUCTURE_MISMATCH: "OPEN_ELEMENT_COMPILED_CLAIM_MISMATCH"; readonly PRE_UPGRADE_EVENTS_INVALID: "OE_CLAIM_PRE_UPGRADE_EVENTS_INVALID"; readonly DYNAMIC_NODE_IN_STATIC_REGION: "OE_CLAIM_DYNAMIC_NODE_IN_STATIC…
packages/protocol/src/errors.ts:254
ClientAssetManifestinterface · public
@openelement/protocol · root

The Phase 2 client build's delivery manifest, keyed by island identity.

ClientAssetManifest

entry: string (required) — The island client entry URL ('' when no client bundle shipped).; islands: Record<string, ClientIslandAsset> (required) — Compile-time island identity (delivery tag) -> emitted asset.; shared: string[] (required) — Shared chunk URLs emitted by the client build (JS, neither entry nor island-dedicated).; styles: string[] (required) — Preloadable island style asset URLs, sorted, base-prefixed. Shadow-component CSS cannot be applied as a document-level stylesheet — it cannot reach shadow trees — so the document channel's only role for these URLs is preload; the sheets themselves are adopted through the sheet adapters.

packages/protocol/src/client-assets.ts:36
ClientIslandAssetinterface · public
@openelement/protocol · root

The client asset one compile-time island identity resolves to.

ClientIslandAsset

file: string (required) — Emitted asset URL (site-root relative, base-prefixed) of the chunk that carries the island module — its dedicated chunk, a shared chunk, or the client entry when the island has no chunk of its own.; strategy: IslandDeliveryStrategy (required) — Delivery strategy resolved from the island declaration at build time.; preload?: boolean (optional) — True when the island's delivery strategy hydrates at load time, so the asset is a modulepreload candidate.

packages/protocol/src/client-assets.ts:19
ClientIslandEntryinterface · public
@openelement/protocol · root

Client island entry shape passed to entry generator.

ClientIslandEntry

exportName?: string (optional) — Optional named export to register as the custom element constructor. When set (package islands whose chunk dropped `export default` per #638), the client island factory reads `mod[exportName]` instead of `mod.default`. When absent, the factory falls back to `mod.default` (local/route islands).; strategy: IslandDeliveryStrategy (required); strategySource?: "default" | "manifest" | "component" | "route" (optional); ssr?: boolean (optional); dsd?: boolean (optional); reason?: string (optional); tagName: string (required); modulePath: string (required); isPackage?: boolean (optional)

packages/protocol/src/ssg.ts:105
CompatibilityClassificationinterface · public
@openelement/protocol · root

The per-tag verdict the compatibility scanner records: the tier a discovered tag was classified as, the human-readable `reason`, where the tag was found (`source`), and the SSR/DSD/hydration facts the verdict was derived from.

CompatibilityClassification

tagName: string (required); tier: CompatibilityTier (required); reason: string (required); source: "local" | "package" | "nested" (required); modulePath?: string (optional); ssr?: boolean (optional); dsd?: boolean (optional); hydrate?: string (optional)

packages/protocol/src/framework.ts:352
CompatibilityTiertype · public
@openelement/protocol · root

How far a discovered tag may participate in the build: 'ssr-capable' renders and hydrates, 'client-only' ships to the browser without server output, 'experimental-dom' is admitted with a downgraded guarantee, and 'rejected' fails the build.

CompatibilityTier
packages/protocol/src/framework.ts:345
COMPILED_MODULE_ABI_VERSIONconst · public
@openelement/protocol · root

Version of the compiled-module ABI: the statics a generated module carries (`__partProgram`, `__compiledProperties`, `__elementMetadata`, `__observedAttributes`, `__computedFields`) and the runtime facade binds. Bump when the generated-module contract changes shape; generated artifacts stamp both this and PART_PROGRAM_VERSION so consumers can tell format drift from release drift. v2: platform lifecycle callback bodies are emitted inside a boundary-capture wrapper calling the base class's `_captureError` — a generated module now requires a runtime facade carrying that protected method (the v1 shape emitted the bodies verbatim).

2
packages/protocol/src/part-program.ts:37
CompiledCemMetadatainterface · public
@openelement/protocol · root

The compiled custom-elements-manifest metadata block of one component.

CompiledCemMetadata

tagName: string (required); className: string (required); declaration: { name: string; module: string; } (required); attributes: { name: string; fieldName: string; type: PropertyValueType; reflect: boolean; }[] (required); members: CemPropertyMetadata[] (required)

packages/protocol/src/part-program.ts:404
CompiledElementMetadatainterface · public
@openelement/protocol · root

The compiled element metadata the program carries for tooling consumers.

CompiledElementMetadata

tag: string (required); className: string (required); sourceFile: string (required); properties: CompiledPropertyMetadata[] (required); observedAttributes: string[] (required); cem: CompiledCemMetadata (required)

packages/protocol/src/part-program.ts:413
CompiledPropertyMetadatainterface · public
@openelement/protocol · root

One compiled

CompiledPropertyMetadata

name: string (required); attribute: string | null (required); type: PropertyValueType (required); converter: PropertyValueType (required); reflect: boolean (required); default: SerializableValue (required); computed?: boolean (optional) — True for computed fields (`= computed(() => ...)` in the source): their signal is derived from other property signals by the generated `__computedFields` factory, never seeded from attributes/props. Always paired with `attribute: null` and `reflect: false`.; deps?: string[] (optional) — Source signal names a computed field reads (declaration order).

packages/protocol/src/part-program.ts:376
CompilerErrorCodeconst · public
@openelement/protocol · root

Compiler (build-time) failures. The per-diagnostic `OEC####` codes stay on each diagnostic; these classify the family so a build failure is catchable as one thing.

{ readonly DIAGNOSTICS: "OE_COMPILER_DIAGNOSTICS"; readonly INVALID_SOURCE: "OE_COMPILER_INVALID_SOURCE"; }
packages/protocol/src/errors.ts:282
ComponentLayertype · public
@openelement/protocol · root

The delivery layer a component belongs to: fully static DSD markup ('dsd-static'), DSD markup with a client island ('dsd-interactive'), a client-only island with no SSR output ('pure-island'), or a light-DOM element ('light-dom'). Recorded per component in the build manifest and consumed by the hydration scheduler.

ComponentLayer
packages/protocol/src/framework.ts:23
conditionLiteralAllowedfunction · public
@openelement/protocol · root

Operator/literal compatibility for when-Block tests (issue #1372). Both wire validators (this module and the server serializer's shared validator) close the space through this one predicate: - ordering operators require a finite numeric literal; - `equals`/`not-equals` admit a finite number, string, or boolean; - `truthy` admits exactly `true` or `false` (the recorded expectation).

(op: unknown, value: unknown): boolean
packages/protocol/src/part-program.ts:274
ConditionOperatortype · public
@openelement/protocol · root

The comparison operators a program condition supports.

ConditionOperator
packages/protocol/src/part-program.ts:250
ContextErrorCodeconst · public
@openelement/protocol · root

Community-context service lifecycle failures (phase `csr`).

{ readonly SERVICE_DISPOSED: "OE_CONTEXT_SERVICE_DISPOSED"; }
packages/protocol/src/errors.ts:222
CorsOriginConfigtype · public
@openelement/protocol · root

The CORS origin policy an API route declares.

CorsOriginConfig
packages/protocol/src/ssg.ts:130
CspConfiginterface · public
@openelement/protocol · root

The content-security-policy directives a route or document declares.

CspConfig

policy?: string (optional); nonce?: boolean (optional); reportOnly?: boolean (optional)

packages/protocol/src/ssg.ts:133
DATA_OE_LIGHTconst · public
@openelement/protocol · root

Internal SSR provenance marker on light-mode host tags (#1148). Present only when the host's light subtree was server-rendered under the in-place activation contract: the client binds the existing DOM instead of clearing it, and a parent's activation walk prunes the nested host's subtree. Client rendering never writes it and it is never removed. The writer (internal/compiled/server) and readers (internal/compiled/runtime) import this constant; nothing writes the literal.

"data-oe-light"
packages/protocol/src/part-program.ts:473
DEFAULT_RENDER_ERROR_CODEconst · public
@openelement/protocol · root

Default code for {@linkcode RenderError }. Deliberately NOT a member of {@linkcode ErrorCode}: that object is the scan target of the documentation site's error catalog, which requires every member to carry a phase/severity family rule. `RENDER_ERROR` is the pre-dialect value `RenderError` has always defaulted to — kept verbatim so callers that observe it keep working, and kept out of the catalogue because it is not a failure this package classifies, only a constructor default a caller may override.

"RENDER_ERROR"
packages/protocol/src/errors.ts:47
DIAGNOSTIC_REPORT_FORMATconst · public
@openelement/protocol · root

The `format` discriminator every report carries. Consumers branch on it instead of guessing: a future shape change mints a new tag rather than reinterpreting old bytes.

"openelement.diagnostics/1"
packages/protocol/src/diagnostics.ts:84
DiagnosticEnvelopeinterface · public
@openelement/protocol · root

One machine-readable diagnostic: the producer's stable code, where the failure sits (`file`, `line`, `column` — absent when the producer has no source location, e.g. a configuration refusal), what happened (`message`), and when known, the fix (`hint`). `line`/`column` are 1-based, matching the diagnostics the compiler records from TypeScript source positions. Unknown envelope fields are tolerated on the wire (forward compat); the required core is exactly these fields.

DiagnosticEnvelope

code: string (required) — The producer's own stable code (`OEC9020`, `OE_PRESET_*`, `OE_SSG_*`).; severity: DiagnosticSeverity (required); phase: DiagnosticPhase (required); message: string (required) — What happened, in the producer's own words.; file?: string (optional) — The source file (or module specifier) the diagnostic points at.; line.toString: (radix?: number) => string (required) — Returns a string representation of an object.; line.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; line.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; line.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; line.valueOf: () => number (required) — Returns the primitive value of the specified object.; line.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.; column?: number (optional) — 1-based authored column, when the producer has a source location.; hint?: string (optional) — The fix, when the producer can name one.

packages/protocol/src/diagnostics.ts:60
DiagnosticPhasetype · public
@openelement/protocol · root

The pipeline phase a diagnostic was raised in — the same vocabulary the error contract's {@linkcode ErrorPhase } uses, so a producer's code, phase and envelope cannot disagree about where a failure happened.

DiagnosticPhase
packages/protocol/src/diagnostics.ts:39
diagnosticReportfunction · public
@openelement/protocol · root

Assemble the exit's report. `ok` derives from the diagnostics' severities, never from a caller's optimism: one `error` severity is enough to fail it.

(diagnostics: DiagnosticEnvelope[]): DiagnosticReport
packages/protocol/src/diagnostics.ts:105
DiagnosticReportinterface · public
@openelement/protocol · root

One build exit's diagnostics: the format tag, whether the run is clean (`ok` is false the moment any diagnostic carries severity `error`), and every diagnostic the exit collected. This is the document the CLI writes to the stream and the diagnostics file — one aggregate containing every code.

DiagnosticReport

format: "openelement.diagnostics/1" (required); ok: boolean (required); diagnostics: DiagnosticEnvelope[] (required)

packages/protocol/src/diagnostics.ts:95
DiagnosticReportFormattype · public
@openelement/protocol · root

One format tag value (kept as a type for the report's `format` field).

"openelement.diagnostics/1"
packages/protocol/src/diagnostics.ts:87
DiagnosticReportParseErrorclass · public
@openelement/protocol · root

Raised by {@linkcode parseDiagnosticReport} when the text is not a consumable report. Fail closed: a consumer that catches this knows the channel answered garbage — never a half-valid report.

class DiagnosticReportParseError extends Error
packages/protocol/src/diagnostics.ts:123
DiagnosticSeveritytype · public
@openelement/protocol · root

How severe one diagnostic is. `error` fails the build, `warning` reports a recoverable defect, `info` is reserved for advisories. The build report's `ok` flag derives from this: any `error` diagnostic makes the report not-ok.

DiagnosticSeverity
packages/protocol/src/diagnostics.ts:32
DocumentConfiginterface · public
@openelement/protocol · root

The document-level facts a build bakes into the generated entry.

DocumentConfig

lang: string (required); title: string (required); headExtras: string (required); allowHeadExtrasScripts: boolean (required)

packages/protocol/src/ssg.ts:258
EachKeyErrorCodeconst · public
@openelement/protocol · root

Keyed-list identity failures. Shared by the server serializer and the client runtime (see `internal/compiled/each-key.ts`), so both executors reject the same data with the same code.

{ readonly ITEM_NOT_A_RECORD: "OE_EACH_ITEM_NOT_A_RECORD"; readonly KEY_NOT_ROUND_TRIPPABLE: "OE_EACH_KEY_NOT_ROUND_TRIPPABLE"; readonly DUPLICATE_KEY: "OE_EACH_KEY_DUPLICATE"; }
packages/protocol/src/errors.ts:159
EMPTY_CLIENT_ASSET_MANIFESTconst · public
@openelement/protocol · root

The manifest a project without a client bundle carries.

ClientAssetManifest
packages/protocol/src/client-assets.ts:54
ENTRY_REGISTRATION_OWNERSconst · public
@openelement/protocol · root

Property on the stub holding the generated entry's registration-ownership map (tag -> class it registered): a route module that self-registers its tag wins over the entry's registration, and on dev re-evaluation a fresh self-registered class must still win (#952).

"__openEntryDefined"
packages/protocol/src/registry-markers.ts:30
EntryDescriptorinterface · public
@openelement/protocol · root

The full build-time description of one generated entry: routes, islands, renderers, middleware, document, and layout plans.

EntryDescriptor

isSSG: boolean (required); renderer?: "native" | "lit" (optional) — Page renderer selection (#1339). Absent/'native' keeps the compiled renderToString page path byte-identical; 'lit' forks page tag resolution, page SSR and the client entry onto; imports: ImportDecl[] (required); middleware: MiddlewareDecl[] (required); fetchMiddleware?: string[] (optional) — `middleware.use` fetch middleware module paths (#858), in user-configured order. The entry renderer emits one `import * as __mw_N from '<path>'` per entry and composes each module's default export around the exported handler in onion order. Absent/empty when the app configures no fetch middleware, keeping the generated entry byte-identical to pre-#858 output.; apiRoutes: ApiRouteDecl[] (required); pageRoutes: PageRouteDecl[] (required); staticComponents: StaticComponentDecl[] (required); islands: IslandDecl[] (required); hasEnhancedForms?: boolean (optional) — True when any page route carries data-open-enhance forms (#569). Drives the dev island client script injection (#951): an island-free app with enhanced forms still needs the client entry in dev HTML.; ssrAdmissionPlan: SsrAdmissionPlan (required); cemClassifications?: CompatibilityClassification[] (optional); renderers: RendererDecl[] (required); middlewareScopes: MiddlewareScopeDecl[] (required); document: DocumentConfig (required); layout: LayoutPlan (required); upgradeStrategy?: "load" | "idle" | "visible" | "only" | "none" (optional); i18n?: { locales: string[]; defaultLocale: string; } (optional) — Declared project locales. Absent for a single-locale site: the generated entry then emits no locale prefixes and the default-locale fallback, which is byte-identical to pre-i18n output.

packages/protocol/src/ssg.ts:282
ERROR_PREFIXconst · public
@openelement/protocol · root

Error message prefix for all openElement errors.

"[openElement]"
packages/protocol/src/errors.ts:50
ErrorCodeconst · public
@openelement/protocol · root

Well-known error code constants for reference. String values are always accepted.

{ readonly SSR_RENDER_ERROR: "SSR_RENDER_ERROR"; readonly BOUNDARY_CAUGHT: "BOUNDARY_CAUGHT"; readonly UNKNOWN: "UNKNOWN"; }
packages/protocol/src/errors.ts:31
ErrorPhasetype · public
@openelement/protocol · root

The pipeline phase an error was raised in.

ErrorPhase
packages/protocol/src/errors.ts:80
ErrorSeveritytype · public
@openelement/protocol · root

How severe a framework error is.

ErrorSeverity
packages/protocol/src/errors.ts:78
ErrorTelemetryHooktype · public
@openelement/protocol · root

Callback receiving every reported {@linkcode OpenElementError} for telemetry.

ErrorTelemetryHook
packages/protocol/src/errors.ts:132
errorToEnvelopefunction · public
@openelement/protocol · root

Map the one error dialect ({@linkcode OpenElementError} — every producer's raiser goes through it) onto the envelope. The error's code, severity and phase ARE the envelope's; the message carries verbatim. Producers with a fix pass it as `hint`.

(error: OpenElementError, options?: { hint?: string; }): DiagnosticEnvelope

code: string (required); severity: ErrorSeverity (required); phase: ErrorPhase (required); recoverable: boolean (required); statusCode.toString: (radix?: number) => string (required) — Returns a string representation of an object.; statusCode.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; statusCode.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; statusCode.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; statusCode.valueOf: () => number (required) — Returns the primitive value of the specified object.; statusCode.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.; toJSON: () => Record<string, unknown> (required); name: string (required); message: string (required); stack?: string (optional); cause?: unknown (optional)

packages/protocol/src/diagnostics.ts:241
FacadeErrorCodeconst · public
@openelement/protocol · root

SSR/bootstrap failures raised by the public entries (phase `ssr` / `csr`).

{ readonly PROGRAM_MISSING: "OE_PROGRAM_MISSING"; readonly COMPOSITION_DEPTH: "OE_SSR_COMPOSITION_DEPTH"; readonly COMPUTED_FACTORY_MISSING: "OE_COMPUTED_FACTORY_MISSING"; readonly COMPUTED_READONLY: "OE_COMPUTED_READON…
packages/protocol/src/errors.ts:317
FORBIDDEN_ATTRIBUTE_NAMESconst · public
@openelement/protocol · root

Forbidden sink names — the ONE canonical deny list for every Part Program boundary: the compiler semantic core, the protocol validator (internal/protocol/part-program.ts), and the compiled server/claim validator (internal/compiled/server/shared.ts). This module is import-free and host-free by design (same base-of-graph contract as void-tags.ts): all consumers import it, so a new forbidden sink cannot be enforced on one boundary and missed on another. This module owns the named-sink deny lists and the attribute-name policy built on them (the one shared safe-attribute-name predicate and the one camelCase→kebab-case casing rule); consumers delegate so the boundary cannot diverge. The lists are fail closed and case-insensitive (attribute and property names are compared lowercase, matching the HTML parser's name folding): - `FORBIDDEN_ATTRIBUTE_NAMES`: attribute names that must never be a static attribute or an `attr`/`bool` sink. `srcdoc` smuggles a full HTML document past attribute escaping; `innerHTML` is admissible only through the dedicated trusted-HTML `html` Part, never as a plain attribute name. - `FORBIDDEN_PROPERTY_NAMES`: `prop` sink names that would re-prototype or re-construct the target element (prototype-pollution primitives). - `RAW_TEXT_TAGS`: raw-text elements are outside the compiled grammar — their content cannot be escaped by the serializer.

ReadonlySet<string>
packages/protocol/src/forbidden-sinks.ts:28
FORBIDDEN_PROPERTY_NAMESconst · public
@openelement/protocol · root

Property names the compiler refuses as

ReadonlySet<string>
packages/protocol/src/forbidden-sinks.ts:31
ForbiddenSinkKindtype · public
@openelement/protocol · root

Sink categories the canonical deny list classifies.

ForbiddenSinkKind
packages/protocol/src/forbidden-sinks.ts:41
forbiddenSinkReasonfunction · public
@openelement/protocol · root

Return a human-readable reason when `name` is a forbidden sink of `kind`, or null when the name is admissible. Unknown kinds fail closed with a reason instead of being waved through.

(kind: ForbiddenSinkKind, name: string): string | null
packages/protocol/src/forbidden-sinks.ts:48
frameworkErrorfunction · public
@openelement/protocol · root

One framework failure: {@linkcode OpenElementError} with the caller's code and the phase/severity/recoverability that phase implies. Every throw site in this package goes through this factory (or the `*ErrorCode` tables above) so a code, a phase and a recoverability answer cannot drift per site.

(code: string, message: string, options?: Omit<OpenElementErrorOptions, "code">): OpenElementError
packages/protocol/src/errors.ts:364
FrameworkOptionsinterface · public
@openelement/protocol · root

The adapter-facing framework options: where routes and islands live, which renderer serializes pages, the default layout and named-layout declarations, the document `<html>`/head injection channels, and the request-time middleware switches. Every field is optional; the adapter applies its documented default. This is the type an application config file's default export is checked against, so the rendered option table and the actual config surface cannot drift.

FrameworkOptions

renderer?: "native" | "lit" (optional) — Page renderer selection (Beta.2.2, #1339). EXPLICIT, never inferred: 'native' (default) renders pages through the compiled Part Program serializer (renderToString); 'lit' renders LitElement pages through; routesDir?: string (optional) — Directory the route scanner walks, relative to the Vite root. Defaults to `app/routes`.; islandsDir?: string (optional) — Directory island modules are discovered in. Defaults to `app/islands`.; packageIslands?: string[] | "auto" | "manual" (optional) — How the build admits component packages whose modules the application imports. - omitted or `'auto'` (the default): the scan derives the admitted set at scan time — every package-owned element module the app's routes, pages, layouts, islands and components really reach (bundler-resolved) is attributed to its owner package (nearest `package.json`), and a package with a valid OpenElement manifest i…; layout?: LayoutConfig (optional) — Layout declaration; `false` disables the layout, `'default'` uses the built-in one.; layouts?: LayoutsConfig (optional) — Named layout declarations keyed by layout name.; headExtras?: string (optional) — @dangerous injected as-is, only use with controlled content; html.lang?: string (optional); html.title?: string (optional); inject.stylesheets?: (string | { href: string; integrity?: string; crossorigin?: "anonymous" | "use-credentials"; attrs?: Record<string, string | number | boolean>; })[] (optional) — Stylesheets linked into the document head; each entry is an href or a link record with integrity/crossorigin/attrs.; inject.scripts?: (string | { src: string; type?: string; async?: boolean; defer?: boolean; integrity?: string; crossorigin?: "anonymous" | "use-credentials"; attrs?: Record<str… (optional) — Scripts emitted into the document; each entry is a src or a script record with type/async/defer/integrity/crossorigin/attrs.; inject.headFragments?: string[] (optional) — @dangerous fragments injected as-is. Trust boundary (same level as `trustedHtml`): never concatenate user-controlled content into these fragments; sanitize untrusted data at your own system boundary first. The framework only enforces no-`<script>` and no-executable-`<style>`.; ssr.noExternal?: (string | RegExp)[] (optional); island.upgradeStrategy?: "load" | "idle" | "visible" | "only" | "none" (optional); build.outDir?: string (optional) — Output directory for the build artifacts. Defaults to `dist`.; build.manifestBudget?: { islandKB?: number; totalJsKB?: number; pageKB?: number; } (optional) — Advisory only: exceeded budgets print build-manifest warnings and never fail the build; enforce them in your own build-output test.; viewTransition?: boolean (optional) — Enable the View Transitions API for client navigations. Defaults to true.; speculation?: boolean | { prerender?: string[]; prefetch?: string[]; exclude?: string[]; eagerness?: "immediate" | "moderate" | "conservative"; } (optional) — Speculation Rules emission: `true` uses framework defaults, or pass prerender/prefetch URL lists, exclusions and an eagerness.; middleware.cors?: boolean (optional) — Built-in CORS middleware. Default-ON; pass `false` to disable.; middleware.corsOrigin?: string | string[] (optional) — Static CORS allowlist data, serialized into the generated entry as JSON. Mutually exclusive with {@link FrameworkOptions.middleware.corsOriginModule }.; middleware.corsOriginModule?: string (optional) — Path to a module that default-exports `(origin: string) => string | undefined`. The generated entry imports the module — the callback is never serialized — so it may close over module scope and import dependencies. Resolved with the same idiom as `layout.import` (e.g. './app/cors-origin.ts'). Mutually exclusive with `corsOrigin`.; middleware.requestId?: boolean (optional) — Emit and honor a per-request id header. Default-ON; pass `false` to disable.; middleware.logger?: boolean (optional) — Log each request through the built-in logger. Default-ON; pass `false` to disable.; middleware.securityHeaders?: boolean (optional) — Attach the built-in security response headers. Default-ON; pass `false` to disable.; middleware.csp?: { policy?: string; nonce?: boolean; reportOnly?: boolean; } (optional) — Content-Security-Policy emission: the policy string, nonce generation, and report-only mode.; middleware.use?: string[] (optional) — Fetch middleware chain (#858), composed around the framework handler in onion order (`use[0]` outermost), outside all built-in middleware above. Each entry is a MODULE PATH (same resolution idiom as `layout.import`, e.g. './app/middleware/auth.ts') whose default export is a {@link Middleware}; the generated entry emits `import * as __mw_N from '<path>'` and composes `__mw_N.default` in configured…

packages/protocol/src/framework.ts:181
HYDRATION_STRATEGIESconst · public
@openelement/protocol · root

Runtime list of supported hydration strategies; the single source of truth for the `HydrationStrategy` union. Consumed by island/registry validation and re-exported from the element root for app and build adapters.

readonly ["load", "idle", "visible", "only", "none"]
packages/protocol/src/framework.ts:28
HydrationHintinterface · public
@openelement/protocol · root

The hydration delivery hint a component or route carries.

HydrationHint

tagName: string (required); layer: ComponentLayer (required); hydrate?: "load" | "idle" | "visible" | "only" | "none" (optional)

packages/protocol/src/render.ts:26
HydrationStrategytype · public
@openelement/protocol · root

Island hydration trigger: 'load' | 'idle' | 'visible' | 'only'.

"load" | "idle" | "visible" | "only" | "none"
packages/protocol/src/framework.ts:30
IDLE_FALLBACK_TIMEOUT_MSconst · public
@openelement/protocol · root

Idle-hydration scheduling fallback (milliseconds) when neither `requestIdleCallback` nor `requestAnimationFrame` is available.

50
packages/protocol/src/policy.ts:70
ImportDeclinterface · public
@openelement/protocol · root

One module import the generated entry emits.

ImportDecl

from: string (required); names: string[] (required); alias?: string (optional)

packages/protocol/src/ssg.ts:123
isAttributeNamefunction · public
@openelement/protocol · root

The wire-validator face of the one canonical attribute-name predicate (delegates to `./forbidden-sinks.ts`); exported for parity tests.

(value: unknown): value is string
packages/protocol/src/part-program.ts:515
ISLAND_ADMISSIONconst · public
@openelement/protocol · root

The static-sidecar descriptor router injects into the element compiler.

StaticSidecarDescriptor
packages/protocol/src/island-admission.ts:18
IslandDeclinterface · public
@openelement/protocol · root

One island the build admits: tag, module path, and delivery facts.

IslandDecl

exportName?: string (optional) — Optional named export to register as the custom element constructor. Set for package islands from the manifest declaration's `className` (the CEM-derived export class name), so the client island factory can read `mod[exportName]` after #638 removed `export default` from UI component chunks. Absent for local/route islands (which use default).; hydrate?: IslandDeliveryStrategy (optional); ssr?: boolean (optional); dsd?: boolean (optional); authoring?: "basic-element" | "third-party-wc" (optional); source?: "local" | "package" | "nested" (optional); reason?: string (optional); tagName: string (required); modulePath: string (required); isPackage?: boolean (optional)

packages/protocol/src/ssg.ts:195
IslandDeliveryStrategytype · public
@openelement/protocol · root

Adapter-owned browser delivery strategy, including media-query admission.

IslandDeliveryStrategy
packages/protocol/src/ssg.ts:31
IslandModuleIdentityinterface · public
@openelement/protocol · root

Shared island module identity (CL-3 convergence: one base, three shapes). Every island record names the same module the same way — the tag it registers as, the module path that owns it, and whether that module is a package (CEM-derived named export) rather than a local file (default export) — so a rename of the identity touches one declaration, not three. The delivery-strategy fields intentionally stay per-shape (`strategy` on the client entry vs `hydrate` on the build decls): they are different stages' vocabularies, not one field spelled two ways.

IslandModuleIdentity

tagName: string (required); modulePath: string (required); isPackage?: boolean (optional)

packages/protocol/src/ssg.ts:98
IslandOptionsinterface · public
@openelement/protocol · root

Per-island delivery options (hydration strategy, SSR/DSD participation).

IslandOptions

hydrate?: "load" | "idle" | "visible" | "only" | "none" (optional) — Hydration strategy: - 'load': load immediately when module is imported - 'idle': defer to requestIdleCallback (default) - 'visible': use IntersectionObserver to defer until element is visible - 'only': client-only render, no DSD/SSR output Named `hydrate` to match `defineIslandConfig()` in the Router package — one option name across both packages.; dsd?: boolean (optional) — Whether to use DSD for SSR rendering of this island. Honored by the build-side island scan (via `defineIslandConfig`), not by `defineIsland()` itself: passing it in `IslandOptions` has no runtime effect.; ssr?: boolean (optional) — Whether this island may be admitted into server rendering. Like `dsd`, decided by the build-side island scan; inert when passed to `defineIsland()`.

packages/protocol/src/island.ts:8
IslandTransformOptionsinterface · public
@openelement/protocol · root

Options for the build-time island source transform.

IslandTransformOptions

islandsDir: string (required) — Directory containing island files (e.g. "app/islands"); filePath: string (required) — Absolute or relative file path of the source being processed; layout?: { path: string; tagName: string; } (optional) — Layout-convention admission (alpha15 R batch 3): the resolved layout module the router convention owns (`app/layout.tsx`, tag `app-layout`, or a project-relative custom `layout: { import }` override). The gate admits this one path with its resolved tag even though it lives outside `islandsDir`. Absent when the project configures no layout module (`layout: false`, or the deletable convention file …

packages/protocol/src/island.ts:42
IslandTransformResultinterface · public
@openelement/protocol · root

The island transform output: rewritten source plus extracted facts.

IslandTransformResult

code: string (required) — Transformed source code with markers; islands: { tagName: string; filePath: string; }[] (required) — Detected island entries; map?: string (optional) — Optional source map

packages/protocol/src/island.ts:64
isSafeAttributeNamefunction · public
@openelement/protocol · root

The one safe-attribute-name predicate (#1033, #602). Attribute *names* are not escaped on any render path, so a name must be valid HTML attribute-name grammar (blocks quote/space injection), must not be an event handler (`on*`, case-insensitive), and must not be a forbidden sink (`innerhtml`/ `srcdoc` — case-insensitive). Every boundary that admits an attribute name — the compiler semantic core, the Part Program validator, the compiled server validator, and the SSR head/meta name checks — delegates here, so the rules cannot diverge per path.

(name: string): boolean
packages/protocol/src/forbidden-sinks.ts:81
ItemEventBindinginterface · public
@openelement/protocol · root

An event binding scoped to each item of an `each` block. The runtime attaches this listener to every item root node created by the block, making per-item handlers (onClick={this.select(row.id)}) expressible without fixed-path event parts.

ItemEventBinding

event: string (required) — DOM event name ('click', 'input', …).; handler: string (required) — Handler method name on the compiled class.; action: ProgramEventAction (required) — The action to dispatch, same union as fixed event parts.; selector?: string (optional) — Optional child selector within the item template (e.g. '.probe-button'). When omitted, the listener attaches to the item root.

packages/protocol/src/part-program.ts:309
KernelErrorCodeconst · public
@openelement/protocol · root

Element-lifecycle failures: the kernel was driven outside its contract (phase `csr`).

{ readonly DISPOSED: "OE_KERNEL_DISPOSED"; readonly TAG_MISMATCH: "OE_KERNEL_TAG_MISMATCH"; readonly CLAIM_EXECUTOR_MISSING: "OE_KERNEL_CLAIM_EXECUTOR_MISSING"; readonly ROOT_NOT_OWNED: "OE_KERNEL_ROOT_NOT_OWNED"; reado…
packages/protocol/src/errors.ts:208
LayoutConfigtype · public
@openelement/protocol · root

Layout declaration: `false` disables the layout entirely, `'default'` uses the built-in layout, and the object form names a tag with the module path that defines it (`import`, resolved like a {@link FrameworkOptions.middleware.use } entry) plus the compiled layout properties the router injects per route.

LayoutConfig
packages/protocol/src/framework.ts:96
LayoutDeclinterface · public
@openelement/protocol · root

The layout module a build resolves: tag, import path, and serialized props.

LayoutDecl

tagName: string (required); importPath: string (required); props: Record<string, unknown> (required)

packages/protocol/src/ssg.ts:266
LayoutPlaninterface · public
@openelement/protocol · root

The resolved layouts a build ships: the default layout plus named layouts.

LayoutPlan

default: ResolvedLayout (required); layouts: Record<string, ResolvedLayout> (required)

packages/protocol/src/ssg.ts:276
Loadertype · public
@openelement/protocol · root

Route loader: fetches data for a page route.

Loader<T, Env, Platform, Route>
packages/protocol/src/data.ts:56
LoaderContextinterface · public
@openelement/protocol · root

Context passed to a request-time ('dynamic') route loader.

LoaderContext<Env, Platform, Route>

request: Request (required); params: Record<string, string> (required); env: Env (required); platform: Platform (required); responseHeaders: Headers (required) — Mutable response-only channel merged into the framework response.; route: Route (required)

packages/protocol/src/data.ts:40
LocalePathinterface · public
@openelement/protocol · root

Locale-aware resolved path contract.

LocalePath

locale: string (required); path: string (required); localizedPath: string (required); isDefaultLocalePath: boolean (required)

packages/protocol/src/framework.ts:82
MAX_ACTION_BODY_BYTESconst · public
@openelement/protocol · root

Request-body bound (bytes) the generated entry applies to action POST routes; larger uploads belong on API routes with explicit limits.

number
packages/protocol/src/policy.ts:57
MAX_COMPOSITION_DEPTHconst · public
@openelement/protocol · root

Nested element expansion depth bound for `renderToString`: cyclic component composition fails closed instead of recursing without end.

8
packages/protocol/src/policy.ts:51
Middlewaretype · public
@openelement/protocol · root

Fetch middleware contract (#858): WinterCG shape, dialect-free — no Hono/h3 context object. Composed at the handler boundary in onion order (`use[0]` is outermost: it sees the request first and the response last), so it runs with identical semantics in the dev server, the `start` CLI, the e2e fixture server, and the Nitro production entry. A middleware may short-circuit by returning a Response without calling `next()`, or post-process the Response that `next()` returns. Module contract: a Middleware is the DEFAULT EXPORT of a module referenced from `middleware.use` by path (e.g. './app/middleware/auth.ts'). The generated server entry imports the module, so the middleware may close over module scope and import local helpers and third-party packages — it is a real module in the server module graph, never serialized source.

Middleware
packages/protocol/src/framework.ts:169
MiddlewareDeclinterface · public
@openelement/protocol · root

One middleware module the generated entry composes.

MiddlewareDecl

kind: "requestId" | "logger" | "cors" | "securityHeaders" | "csp" (required); comment?: string (optional); config.corsOrigin?: CorsOriginConfig (optional); config.corsOriginModule?: string (optional) — Normalized import path of a module default-exporting `(origin: string) => string | undefined`. The generated entry imports the module and passes its default export to `cors({ origin })` — the callback is referenced, never serialized.; config.warnOnDefaultCors?: boolean (optional) — #1411: emit the default-CORS production advisory. Absent means "warn" (production builds); the dev server sets false so the first run is warning-free.; config.csp?: CspConfig (optional)

packages/protocol/src/ssg.ts:140
MiddlewareScopeDeclinterface · public
@openelement/protocol · root

The scope one middleware applies to (all routes or a named route set).

MiddlewareScopeDecl

varName: string (required); scope: string (required); importPath: string (required)

packages/protocol/src/ssg.ts:251
ModuleVocabularyDescriptorinterface · public
@openelement/protocol · root

One module-scan vocabulary entry the host admits: a binding identity (module specifier + exported name, aliases followed) plus the fact a canonical call of that binding contributes. Plain data — the scan consumes the descriptors without learning the caller's package vocabulary, the same direction as the compiler's {@link StaticSidecarDescriptor} admission (#1473 item 3).

ModuleVocabularyDescriptor

moduleSpecifier: string (required) — Canonical module specifier the factory must be imported from.; exportName: string (required) — Exported name of the factory binding.; kind: "page-definition" | "element-registration" (required) — What a canonical call of the binding contributes to the scan.

packages/protocol/src/module-descriptors.ts:33
OpenElementAttributeinterface · public
@openelement/protocol · root

One documented attribute of a custom element declaration.

OpenElementAttribute

name: string (required); type?: string (optional); default?: string (optional); description?: string (optional); reflects?: boolean (optional); fieldName?: string (optional)

packages/protocol/src/manifest.ts:15
OpenElementBlogOptionsinterface · public
@openelement/protocol · root

Blog options stored in the build context by

OpenElementBlogOptions

contentDir?: string (optional); basePath?: string (optional)

packages/protocol/src/framework.ts:37
OpenElementBuildContextLikeinterface · public
@openelement/protocol · root

Minimal build context interface that sub-plugins can use.

OpenElementBuildContextLike

plugins: { [key: string]: unknown; blogOptions: OpenElementBlogOptions | null; navSections: OpenElementNavSection[]; headerNav: OpenElementHeaderNavLink[]; sitemapOptio… (required); registerPlugin: (name: string, instance: unknown) => void (required) — Register plugin data by name. Protocol level uses loose typing; concrete implementations should tighten the generic constraint.

packages/protocol/src/framework.ts:62
OpenElementCssPartinterface · public
@openelement/protocol · root

One documented CSS part of a custom element declaration.

OpenElementCssPart

name: string (required); description?: string (optional)

packages/protocol/src/manifest.ts:38
OpenElementDeclarationinterface · public
@openelement/protocol · root

One custom element declaration in a package manifest: tag, members and delivery metadata.

OpenElementDeclaration

tagName: string (required); className?: string (optional); superclassName?: string (optional); attributes?: OpenElementAttribute[] (optional); events?: OpenElementEvent[] (optional); slots?: OpenElementSlot[] (optional); cssParts?: OpenElementCssPart[] (optional); openElement.ssr?: boolean (optional); openElement.dsd?: boolean (optional); openElement.layer?: ComponentLayer (optional); openElement.hydrate?: "load" | "idle" | "visible" | "only" | "none" (optional); openElement.status?: "stable" | "experimental" (optional) — Stability marker from the owning package's manifest policy.; openElement.module?: string (optional); openElement.export?: string (optional); openElement.tailwind?: OpenElementTailwindDeclaration (optional); description?: string (optional)

packages/protocol/src/manifest.ts:85
OpenElementErrorclass · public
@openelement/protocol · root

Framework error carrying a stable code, severity, phase and recoverability contract.

class OpenElementError extends Error
packages/protocol/src/errors.ts:100
OpenElementErrorOptionsinterface · public
@openelement/protocol · root

Constructor options for {@linkcode OpenElementError}; every field is defaulted.

OpenElementErrorOptions

cause?: Error (optional); code?: string (optional); statusCode.toString: (radix?: number) => string (required) — Returns a string representation of an object.; statusCode.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; statusCode.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; statusCode.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; statusCode.valueOf: () => number (required) — Returns the primitive value of the specified object.; statusCode.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.; severity?: ErrorSeverity (optional); phase?: ErrorPhase (optional); recoverable?: boolean (optional)

packages/protocol/src/errors.ts:90
OpenElementEventinterface · public
@openelement/protocol · root

One documented custom event of a custom element declaration.

OpenElementEvent

name: string (required); type?: string (optional); description?: string (optional)

packages/protocol/src/manifest.ts:25
OpenElementExtensionsinterface · public
@openelement/protocol · root

The openElement-specific extension block of a package manifest declaration.

OpenElementExtensions

ssr?: boolean (optional); dsd?: boolean (optional); layer?: ComponentLayer (optional); hydrate?: "load" | "idle" | "visible" | "only" | "none" (optional); status?: "stable" | "experimental" (optional) — Stability marker from the owning package's manifest policy.; module?: string (optional); export?: string (optional); tailwind.required?: boolean (optional); tailwind.sources?: string[] (optional); tailwind.dialect?: "tailwind4" (optional)

packages/protocol/src/manifest.ts:72
OpenElementI18nContextOptionsinterface · public
@openelement/protocol · root

i18n options stored in the build context by

OpenElementI18nContextOptions
packages/protocol/src/framework.ts:55
OpenElementNavSectioninterface · public
@openelement/protocol · root

Navigation section from

OpenElementNavSection

section: string (required); items: { path: string; label: string; order?: number; }[] (required)

packages/protocol/src/framework.ts:43
OpenElementPackageManifestinterface · public
@openelement/protocol · root

Package manifest of component declarations (not a Custom Elements Manifest).

OpenElementPackageManifest

schemaVersion: string (required); packageName: string (required); version: string (required); description?: string (optional); author?: string (optional); license?: string (optional); homepage?: string (optional); repository?: string (optional); declarations: OpenElementDeclaration[] (required)

packages/protocol/src/manifest.ts:98
OpenElementRequestHandlertype · public
@openelement/protocol · root

The host-neutral request handler every runtime adapter and generated server entry exposes: a WinterCG `(request, context?) => Response` with no server engine dialect baked in.

OpenElementRequestHandler<Env>
packages/protocol/src/runtime.ts:27
OpenElementRouteKindtype · public
@openelement/protocol · root

Host-agnostic route and asset contracts shared by app and build drivers.

OpenElementRouteKind
packages/protocol/src/app-model.ts:2
OpenElementRouteNodeinterface · public
@openelement/protocol · root

One node of the host-agnostic route tree: the matched URL `path` and route kind, the source and module paths the drivers resolve, the optional registered tag and param names, and the nested `children`.

OpenElementRouteNode

kind: OpenElementRouteKind (required); path: string (required); filePath?: string (optional); importPath?: string (optional); tagName?: string (optional); paramNames?: string[] (optional); children?: OpenElementRouteNode[] (optional); meta?: Record<string, unknown> (optional)

packages/protocol/src/app-model.ts:9
OpenElementSlotinterface · public
@openelement/protocol · root

One documented slot of a custom element declaration.

OpenElementSlot

name: string (required); description?: string (optional)

packages/protocol/src/manifest.ts:32
OpenElementTailwindDeclarationinterface · public
@openelement/protocol · root

A declaration's utility-compilation requirement and the package-owned style sources that requirement compiles (the declared-compilation contract; see the router's `style-plan` module for the resolution rules). `required` is the mandatory-compilation dependency: the component's presentation cannot be delivered without the compile, so an application that disables the entry (`tailwind: false`) fails the build with a coded diagnostic instead of shipping an unstyled component. Merely offering a theme source is NOT a requirement — leave `required` unset for a source a consumer may adopt on its own. `sources` are package-relative paths (e.g. `./theme.css`) resolved against THIS package, so a consumer never repeats the owner's declaration. They must exist in the installed package (i.e. ship in the tarball). `dialect` names the CLASS LANGUAGE this component's utility tokens are written in, not the engine that compiles them: the declaration stays provider-neutral, and a selected provider that does not implement the dialect fails the build before any compile. Omitted means `tailwind4` — the language every declaration written before this field existed uses.

OpenElementTailwindDeclaration

required?: boolean (optional); sources?: string[] (optional); dialect?: "tailwind4" (optional)

packages/protocol/src/manifest.ts:65
PageRouteDeclinterface · public
@openelement/protocol · root

One page route declaration in the generated entry descriptor.

PageRouteDecl

kind: "page" (required); path: string (required); varName: string (required); filePath: string (required); defaultTagName: string (required); tagName: string (required); importPath: string (required); isDynamic?: boolean (optional); paramNames?: string[] (optional); streamManifest?: StreamRouteManifest (optional); functionPage?: string (optional) — The server function page fact (alpha15 server lane): the exported server function component the route's `export default definePage(Component)` named — compiled into the module by the server component lane. No element class exists to register; both render channels render through the descriptor's render function (the compiled constructor) and feed the same renderer/layout/document wraps.

packages/protocol/src/ssg.ts:172
parseDiagnosticReportfunction · public
@openelement/protocol · root

Parse one report off the wire. Fails closed: truncated JSON, a foreign format tag, or any structurally broken diagnostic raises {@linkcode DiagnosticReportParseError} instead of returning a partial report a consumer might mistake for the truth.

(text: string): DiagnosticReport
packages/protocol/src/diagnostics.ts:193
PART_PROGRAM_VERSIONconst · public
@openelement/protocol · root

The Part Program IR version this package defines (currently v2).

2
packages/protocol/src/part-program.ts:22
partAnchorEndMarkerfunction · public
@openelement/protocol · root

The comment marker closing a part anchor in serialized program markup.

(index: number): string

toString: (radix?: number) => string (required) — Returns a string representation of an object.; toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; valueOf: () => number (required) — Returns the primitive value of the specified object.; toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.

packages/protocol/src/part-program.ts:451
partAnchorMarkerfunction · public
@openelement/protocol · root

Anchor marker payloads shared by seed runtime consumers.

(index: number): string

toString: (radix?: number) => string (required) — Returns a string representation of an object.; toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; valueOf: () => number (required) — Returns the primitive value of the specified object.; toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.

packages/protocol/src/part-program.ts:446
PartProgramtype · public
@openelement/protocol · root

The serializable Part Program v2: one compiled component as data.

PartProgramV2

version: 2 (required); tag: string (required); root: ProgramRoot (required); template: ProgramTreeNode[] (required); parts: ProgramPart[] (required); blocks: ProgramBlockRecord[] (required); dependencies: ProgramDependencyRecord[] (required); locations: ProgramLocationRecord[] (required); sourceMap: ProgramSourceMap (required) — Compile-time provenance. The canonical in-memory artifact always carries it; the serialized module payload omits it (no runtime consumer reads it), so the validator accepts programs with or without it but still verifies it strictly when present.; metadata: CompiledElementMetadata (required)

packages/protocol/src/part-program.ts:443
PartProgramV2interface · public
@openelement/protocol · root

The one deterministic program consumed by all execution modes.

PartProgramV2

version: 2 (required); tag: string (required); root: ProgramRoot (required); template: ProgramTreeNode[] (required); parts: ProgramPart[] (required); blocks: ProgramBlockRecord[] (required); dependencies: ProgramDependencyRecord[] (required); locations: ProgramLocationRecord[] (required); sourceMap: ProgramSourceMap (required) — Compile-time provenance. The canonical in-memory artifact always carries it; the serialized module payload omits it (no runtime consumer reads it), so the validator accepts programs with or without it but still verifies it strictly when present.; metadata: CompiledElementMetadata (required)

packages/protocol/src/part-program.ts:423
PROBLEM_JSON_MEDIA_TYPEconst · public
@openelement/protocol · root

Media type of the RFC 9457 action error channel (#863).

"application/problem+json"
packages/protocol/src/data.ts:117
ProblemDetailsinterface · public
@openelement/protocol · root

RFC 9457 Problem Details document (#863): the action error channel answers `application/problem+json` instead of the bespoke `{ type: 'error', error: { message } }` JSON, so HTTP tooling recognizes failures natively. With `type: 'about:blank'`, `title` is the HTTP reason phrase and `detail` carries the specific explanation. The wire shape is alpha-unfrozen; the 1.0 acceptance freezes it in this problem+json form.

ProblemDetails

type: string (required) — URI reference identifying the problem type; 'about:blank' when none applies.; title: string (required) — Short human-readable summary (the HTTP reason phrase for 'about:blank').; status.toString: (radix?: number) => string (required) — Returns a string representation of an object.; status.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; status.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; status.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; status.valueOf: () => number (required) — Returns the primitive value of the specified object.; status.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.; detail?: string (optional) — Human-readable explanation specific to this occurrence.

packages/protocol/src/data.ts:105
ProgramAttrPartinterface · public
@openelement/protocol · root

String attribute sink bound to a Signal.

ProgramAttrPart

k: "attr" (required); index.toString: (radix?: number) => string (required) — Returns a string representation of an object.; index.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; index.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; index.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; index.valueOf: () => number (required) — Returns the primitive value of the specified object.; index.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.; signal: string (required); name: string (required); path: number[] (required); location: ProgramLocation (required)

packages/protocol/src/part-program.ts:168
ProgramBlockRecordinterface · public
@openelement/protocol · root

One block the program tracks: the boundaries of a dynamic subtree.

ProgramBlockRecord

id: string (required); index.toString: (radix?: number) => string (required) — Returns a string representation of an object.; index.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; index.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; index.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; index.valueOf: () => number (required) — Returns the primitive value of the specified object.; index.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.; kind: "when" | "each" (required); anchor: string (required); end: string (required); source: string (required)

packages/protocol/src/part-program.ts:356
ProgramBoolPartinterface · public
@openelement/protocol · root

Boolean attribute sink bound to a Signal.

ProgramBoolPart

k: "bool" (required); index.toString: (radix?: number) => string (required) — Returns a string representation of an object.; index.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; index.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; index.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; index.valueOf: () => number (required) — Returns the primitive value of the specified object.; index.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.; signal: string (required); name: string (required); path: number[] (required); location: ProgramLocation (required)

packages/protocol/src/part-program.ts:178
ProgramClassPartinterface · public
@openelement/protocol · root

Specialized fixed sinks make ownership explicit for class and style text.

ProgramClassPart

k: "class" (required); index.toString: (radix?: number) => string (required) — Returns a string representation of an object.; index.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; index.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; index.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; index.valueOf: () => number (required) — Returns the primitive value of the specified object.; index.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.; signal: string (required); path: number[] (required); location: ProgramLocation (required)

packages/protocol/src/part-program.ts:188
ProgramConditioninterface · public
@openelement/protocol · root

One condition clause of a when part.

ProgramCondition

signal: string (required); op: ConditionOperator (required); value: string | number | boolean (required)

packages/protocol/src/part-program.ts:260
ProgramDependencyRecordinterface · public
@openelement/protocol · root

One module dependency the compiled module graph records.

ProgramDependencyRecord

signal: string (required); owner: { kind: "part" | "region"; index: number; } (required); location: string (required)

packages/protocol/src/part-program.ts:366
ProgramEachPartinterface · public
@openelement/protocol · root

A list part: repeats its template node per item of a bound signal.

ProgramEachPart

k: "each" (required); index.toString: (radix?: number) => string (required) — Returns a string representation of an object.; index.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; index.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; index.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; index.valueOf: () => number (required) — Returns the primitive value of the specified object.; index.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.; signal: string (required); key: string (required); field?: string (optional) — Restatement of the item field for single-field templates; omitted when the item template binds multiple fields (each `ival`/`iattrs` slot then carries its own field).; item: ProgramTreeNode[] (required); itemEvents?: ItemEventBinding[] (optional) — Per-item event bindings (#1556 IR v2): listeners attached to each item.; location: ProgramLocation (required)

packages/protocol/src/part-program.ts:324
ProgramElementNodeinterface · public
@openelement/protocol · root

A static element node of the program tree.

ProgramElementNode

k: "el" (required); id: string (required); tag: string (required); attrs: [string, string][] (required); iattrs?: [string, string][] (optional) — Per-item attribute slots ([name, itemField]) — valid only inside an `each` item template. At mount/claim time the value resolves from the current item: `true` emits a bare attribute, `false`/`null`/`undefined` omit it, anything else serializes with String().; children: ProgramTreeNode[] (required)

packages/protocol/src/part-program.ts:104
ProgramErrorCodeconst · public
@openelement/protocol · root

Program-shape failures: a Part Program (or one of its records) is malformed, or carries a value the wire format cannot express. Phase `validation`: these reject data before any DOM work starts.

{ readonly INVALID_PROGRAM: "OE_PROGRAM_INVALID"; readonly NOT_SERIALIZABLE: "OE_PROGRAM_NOT_SERIALIZABLE"; readonly INVALID_SLOT: "OE_PROGRAM_INVALID_SLOT"; readonly INVALID_SOURCE_SEGMENT: "OE_PROGRAM_INVALID_SOURCE_S…
packages/protocol/src/errors.ts:141
ProgramEventActiontype · public
@openelement/protocol · root

The action one event part dispatches.

ProgramEventAction
packages/protocol/src/part-program.ts:231
ProgramEventPartinterface · public
@openelement/protocol · root

An event binding part: listener wiring between DOM event and action.

ProgramEventPart

k: "event" (required); index.toString: (radix?: number) => string (required) — Returns a string representation of an object.; index.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; index.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; index.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; index.valueOf: () => number (required) — Returns the primitive value of the specified object.; index.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.; event: string (required); handler: string (required); action: ProgramEventAction (required); path: number[] (required); location: ProgramLocation (required)

packages/protocol/src/part-program.ts:239
ProgramHtmlPartinterface · public
@openelement/protocol · root

Trusted-HTML content sink (alpha.9). The signal value must carry the runtime TrustedHtml capability; its HTML replaces the target element's content. The target's subtree is opaque to the claim path. The compiler emits this only for an explicit `innerHTML={this.<field>}` sink on an otherwise childless element — there is no implicit or discovery path to raw HTML.

ProgramHtmlPart

k: "html" (required); index.toString: (radix?: number) => string (required) — Returns a string representation of an object.; index.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; index.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; index.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; index.valueOf: () => number (required) — Returns the primitive value of the specified object.; index.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.; signal: string (required); path: number[] (required); location: ProgramLocation (required)

packages/protocol/src/part-program.ts:213
ProgramItemValueNodeinterface · public
@openelement/protocol · root

Item-value text slot; valid only inside an `each` item template. `field` names the item field rendered by this slot — multi-field item templates carry one slot per field, and the compiler always emits it.

ProgramItemValueNode

k: "ival" (required); field: string (required)

packages/protocol/src/part-program.ts:137
ProgramLocationinterface · public
@openelement/protocol · root

Exact compiler-owned location for one dynamic sink or range anchor.

ProgramLocation

id: string (required); kind: "anchor" | "sink" (required); path: number[] (required); node?: string (optional)

packages/protocol/src/part-program.ts:90
ProgramLocationRecordtype · public
@openelement/protocol · root

A location record also makes the identity auditable without inspecting parts.

ProgramLocationRecord
packages/protocol/src/part-program.ts:98
ProgramParttype · public
@openelement/protocol · root

The discriminated union of dynamic parts a program instantiates.

ProgramPart
packages/protocol/src/part-program.ts:342
ProgramPartAnchorNodeinterface · public
@openelement/protocol · root

The anchor node marking where a part binds in the tree.

ProgramPartAnchorNode

k: "part" (required); id: string (required); index.toString: (radix?: number) => string (required) — Returns a string representation of an object.; index.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; index.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; index.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; index.valueOf: () => number (required) — Returns the primitive value of the specified object.; index.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.

packages/protocol/src/part-program.ts:126
ProgramPositioninterface · public
@openelement/protocol · root

Where a part sits relative to its anchor.

ProgramPosition

offset.toString: (radix?: number) => string (required) — Returns a string representation of an object.; offset.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; offset.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; offset.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; offset.valueOf: () => number (required) — Returns the primitive value of the specified object.; offset.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.; line: number (required); column: number (required)

packages/protocol/src/part-program.ts:59
ProgramPropPartinterface · public
@openelement/protocol · root

DOM property sink bound to a Signal; `path` is retained for seed consumers.

ProgramPropPart

k: "prop" (required); index.toString: (radix?: number) => string (required) — Returns a string representation of an object.; index.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; index.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; index.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; index.valueOf: () => number (required) — Returns the primitive value of the specified object.; index.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.; signal: string (required); name: string (required); path: number[] (required); location: ProgramLocation (required)

packages/protocol/src/part-program.ts:158
ProgramRefPartinterface · public
@openelement/protocol · root

A named ref slot is serializable; the generated class supplies the ref value.

ProgramRefPart

k: "ref" (required); index.toString: (radix?: number) => string (required) — Returns a string representation of an object.; index.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; index.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; index.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; index.valueOf: () => number (required) — Returns the primitive value of the specified object.; index.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.; ref: string (required); path: number[] (required); location: ProgramLocation (required)

packages/protocol/src/part-program.ts:222
ProgramRootinterface · public
@openelement/protocol · root

The root of one program tree: element, part anchor, or text.

ProgramRoot

id: "root" (required); kind: RootMode (required); nodes: string[] (required)

packages/protocol/src/part-program.ts:43
ProgramSourceKindtype · public
@openelement/protocol · root

The kind of source record a program source map entry carries.

ProgramSourceKind
packages/protocol/src/part-program.ts:73
ProgramSourceMapinterface · public
@openelement/protocol · root

The program source map: authored spans projected onto emitted records.

ProgramSourceMap

version: 1 (required); file: string (required); records: ProgramSourceRecord[] (required)

packages/protocol/src/part-program.ts:83
ProgramSourceRangeinterface · public
@openelement/protocol · root

A half-open [start, end) range into the authored source text.

ProgramSourceRange

file: string (required); start: ProgramPosition (required); end: ProgramPosition (required)

packages/protocol/src/part-program.ts:66
ProgramSourceRecordinterface · public
@openelement/protocol · root

One source-map record: the authored origin of one emitted node or part.

ProgramSourceRecord

id: string (required); kind: ProgramSourceKind (required); source: ProgramSourceRange (required)

packages/protocol/src/part-program.ts:76
ProgramStylePartinterface · public
@openelement/protocol · root

A style binding part.

ProgramStylePart

k: "style" (required); index.toString: (radix?: number) => string (required) — Returns a string representation of an object.; index.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; index.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; index.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; index.valueOf: () => number (required) — Returns the primitive value of the specified object.; index.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.; signal: string (required); path: number[] (required); location: ProgramLocation (required)

packages/protocol/src/part-program.ts:197
ProgramTextNodeinterface · public
@openelement/protocol · root

A static text node of the program tree.

ProgramTextNode

k: "text" (required); value: string (required)

packages/protocol/src/part-program.ts:120
ProgramTextPartinterface · public
@openelement/protocol · root

A text interpolation part bound to one signal.

ProgramTextPart

k: "text" (required); index.toString: (radix?: number) => string (required) — Returns a string representation of an object.; index.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; index.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; index.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; index.valueOf: () => number (required) — Returns the primitive value of the specified object.; index.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.; signal: string (required); location: ProgramLocation (required)

packages/protocol/src/part-program.ts:150
ProgramTreeNodetype · public
@openelement/protocol · root

The discriminated union of static tree nodes.

ProgramTreeNode
packages/protocol/src/part-program.ts:143
ProgramWhenPartinterface · public
@openelement/protocol · root

A conditional part: swaps template branches on a condition.

ProgramWhenPart

k: "when" (required); index.toString: (radix?: number) => string (required) — Returns a string representation of an object.; index.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; index.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; index.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; index.valueOf: () => number (required) — Returns the primitive value of the specified object.; index.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.; signal: string (required); test: ProgramCondition (required); on: ProgramTreeNode[] (required); off: ProgramTreeNode[] (required); location: ProgramLocation (required)

packages/protocol/src/part-program.ts:293
PropertyValueTypetype · public
@openelement/protocol · root

The serialized value-type tag of a compiled property default.

PropertyValueType
packages/protocol/src/part-program.ts:373
raiseFrameworkErrorfunction · public
@openelement/protocol · root

Raise one framework failure and never return: the throwing companion of {@linkcode frameworkError}. The per-module `fail(code, message)` micro-factories bind their failure surface's fixed {@linkcode ErrorPhase} here — one implementation, the phase as a parameter — so a code and a phase cannot drift apart per throw site.

(phase: ErrorPhase, code: string, message: string): never
packages/protocol/src/errors.ts:385
RAW_TEXT_TAGSconst · public
@openelement/protocol · root

Elements whose text content must never be interpolated as markup.

ReadonlySet<string>
packages/protocol/src/forbidden-sinks.ts:38
ReadonlySignalinterface · public
@openelement/protocol · root

Read-only signal protocol used by computed values.

ReadonlySignal<T>

value: T (required); subscribe: (fn: (value: T) => void) => Unsubscribe (required); __@SIGNAL_BRAND@903.valueOf: () => boolean (required) — Returns the primitive value of the specified object.

packages/protocol/src/signal.ts:26
RendererDeclinterface · public
@openelement/protocol · root

One page renderer module registration.

RendererDecl

varName: string (required); scope: string (required); importPath: string (required); depth.toString: (radix?: number) => string (required) — Returns a string representation of an object.; depth.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; depth.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; depth.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; depth.valueOf: () => number (required) — Returns the primitive value of the specified object.; depth.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.

packages/protocol/src/ssg.ts:243
RenderErrorinterface · public
@openelement/protocol · root

One render failure record the SSR pipeline reports.

RenderError

code: string (required); severity: "error" | "warning" (required); phase: ErrorPhase (required); tagName: string (required); message: string (required); recoverable: boolean (required)

packages/protocol/src/render.ts:16
ResolvedLayouttype · public
@openelement/protocol · root

The resolved layout for one plan slot: disabled (false) or a full declaration.

ResolvedLayout
packages/protocol/src/ssg.ts:273
RootModetype · public
@openelement/protocol · root

How the compiled component attaches its root: light DOM or a shadow root.

RootMode
packages/protocol/src/part-program.ts:40
RouteEntryinterface · public
@openelement/protocol · root

One route admitted by the scanner: URL `path`, source `filePath`, the route `type`, the generated variable name (`varName`) the entry binds it to, and the optional registration tag. {@link RouteEntry.definePage} and {@link RouteEntry.hasEnhancedForms} carry the two source-derived admission facts the generated entries branch on.

RouteEntry

path: string (required); filePath: string (required); type: "page" | "api" | "island" | "special" (required); varName: string (required); tagName?: string (optional); definePage?: boolean (optional) — True when the route module's default export is a definePage() definition (#960 — registration decoupling). The generated entry registers the page class under the path-derived fallback tag and IGNORES the tagName export for registration: on a definePage route the export only names a content element. Plain element routes keep tagName as their registration tag.; functionPage?: string (optional) — The server function page fact (alpha15 server lane): the exported server function component the route's `export default definePage(Component)` was called over. Present only when the argument is a plain identifier resolving to a component THIS module declares — an inline arrow or an unexported local never records it (the R1 admission rule mirrored, so a shape whose JSX would escape to runtime is n…; source?: string (optional) — Source text captured during scanning when includeSource is enabled.; hasEnhancedForms?: boolean (optional) — True when the page route source carries data-open-enhance (#569): the client entry must ship the form-enhancement layer even when the app has zero islands.; special?: SpecialFileType (optional); params?: string[] (optional)

packages/protocol/src/framework.ts:113
RouteInfoEntryinterface · public
@openelement/protocol · root

A single route metadata entry emitted as `routeInfo` by the generated SSG entry module (see entry-render-ssg.ts).

RouteInfoEntry

path: string (required); filePath?: string (optional) — Route module file path. Read by the render pipeline: ssg-render.ts copies it into server-manifest.json for request-time (renderIntent 'dynamic') routes.; tagName: string (required); module?: unknown (optional) — The route module namespace object (typed per-module at codegen time).; isDynamic: boolean (required); paramNames: string[] (required); rendering?: "static" | "dynamic" (optional) — Rendering mode declared via renderIntent.mode ("static" when unset; the "auto" alias is rejected, #609).; hasAction?: boolean (optional) — True when the route module exports an action (request-time form POST).; streamManifest?: StreamRouteManifest (optional); params?: Record<string, string> (optional)

packages/protocol/src/ssg.ts:357
ROUTER_MODULE_VOCABULARYconst · public
@openelement/protocol · root

The module vocabulary router injects into `analyzeModuleSemantics`.

readonly ModuleVocabularyDescriptor[]
packages/protocol/src/module-vocabulary.ts:17
RUNTIME_MESSAGES_ENABLEDconst · public
@openelement/protocol · root

Whether the authored error prose is kept: `true` everywhere except a production client build, the one context that defines `OE_RUNTIME_MESSAGES` to `false`. Stripping is a payload decision, so it belongs to the browser bundle only — server-side failures keep their prose.

boolean
packages/protocol/src/errors.ts:72
RuntimeAdapterinterface · public
@openelement/protocol · root

A host runtime adapter: exposes the fetch handler a server engine dispatches to.

RuntimeAdapter<Env>

name: string (required); fetch: OpenElementRequestHandler<Env> (required); prerender?: (() => AsyncIterable<RuntimePrerenderResult> | Iterable<RuntimePrerenderResult>) (optional)

packages/protocol/src/runtime.ts:32
RuntimeAdapterOptionsinterface · public
@openelement/protocol · root

Options one runtime adapter is constructed with.

RuntimeAdapterOptions<Env>

name: string (required); fetch: OpenElementRequestHandler<Env> (required); prerender?: (() => AsyncIterable<RuntimePrerenderResult> | Iterable<RuntimePrerenderResult>) (optional)

packages/protocol/src/runtime.ts:39
RuntimeContextinterface · public
@openelement/protocol · root

runtime.ts - Runtime adapter protocol. Replacement boundary for Nitro, Workers, Node, Deno, or future fetch-compatible runtimes. Preserves openElement semantics while leaving concrete server engines outside this package.

RuntimeContext<Env>

env?: Env (optional); platform?: unknown (optional); params?: Record<string, string> (optional)

packages/protocol/src/runtime.ts:9
RuntimeErrorCodeconst · public
@openelement/protocol · root

Runtime execution failures raised while a compiled program is serialized, built into fresh DOM, or re-read on a signal write (phase `render`).

{ readonly LIST_VALUE_NOT_ARRAY: "OE_RUNTIME_LIST_VALUE_NOT_ARRAY"; readonly HOST_SIGNAL_MISSING: "OE_RUNTIME_HOST_SIGNAL_MISSING"; readonly HOST_HANDLER_MISSING: "OE_RUNTIME_HOST_HANDLER_MISSING"; readonly HOST_REF_MIS…
packages/protocol/src/errors.ts:172
SafeHtmltype · public
@openelement/protocol · root

Branded type: a string that has been HTML-escaped (safe for text content)

SafeHtml
packages/protocol/src/framework.ts:9
SerializableValuetype · public
@openelement/protocol · root

The JSON-serializable value shape a compiled property default admits.

SerializableValue
packages/protocol/src/part-program.ts:50
serializeClientAssetsModulefunction · public
@openelement/protocol · root

Serialize the manifest as the generated dist/server/client-assets.js module: pure structured data, no injection logic — consumers derive what they need from these values.

(manifest: ClientAssetManifest): string

entry: string (required) — The island client entry URL ('' when no client bundle shipped).; islands: Record<string, ClientIslandAsset> (required) — Compile-time island identity (delivery tag) -> emitted asset.; shared: string[] (required) — Shared chunk URLs emitted by the client build (JS, neither entry nor island-dedicated).; styles: string[] (required) — Preloadable island style asset URLs, sorted, base-prefixed. Shadow-component CSS cannot be applied as a document-level stylesheet — it cannot reach shadow trees — so the document channel's only role for these URLs is preload; the sheets themselves are adopted through the sheet adapters.

packages/protocol/src/client-assets.ts:68
serializeDiagnosticReportfunction · public
@openelement/protocol · root

Serialize a report for the stream/file channel: one line, no trailing newline.

(report: DiagnosticReport): string

format: "openelement.diagnostics/1" (required); ok: boolean (required); diagnostics: DiagnosticEnvelope[] (required)

packages/protocol/src/diagnostics.ts:114
ServerErrorCodeconst · public
@openelement/protocol · root

Compiled server/claim validation failures. The value shipped in 1.0.0-alpha.3 and is kept verbatim; `CompiledProgramValidationError` is its only raiser.

{ readonly PROGRAM_INVALID: "OPEN_ELEMENT_COMPILED_PROGRAM_INVALID"; readonly SINK_REFUSED: "OE_SERVER_SINK_REFUSED"; }
packages/protocol/src/errors.ts:270
ServerRouteContextinterface · public
@openelement/protocol · root

Canonical request-time/SSG server route context.

ServerRouteContext<Env, Platform, Route>

request: Request (required); params: Record<string, string> (required); env: Env (required); platform: Platform (required); responseHeaders: Headers (required) — Mutable response-only channel merged into the framework response.; route: Route (required)

packages/protocol/src/data.ts:25
ServerRouteMetadatainterface · public
@openelement/protocol · root

Context passed to a request-time ('dynamic') route loader. This is the server contract: the loader runs on the server with the Web-standard request, matched route params, the host environment and the platform object, and signals validation failure via fail()/redirect().

ServerRouteMetadata

path: string (required); filePath: string (required)

packages/protocol/src/data.ts:19
Signaltype · public
@openelement/protocol · root

Alias for APIs that accept either writable or read-only signals.

Signal<T>
packages/protocol/src/signal.ts:31
SIGNAL_BRANDconst · public
@openelement/protocol · root

Runtime/type brand for signals created by the configured reactive engine.

typeof SIGNAL_BRAND
packages/protocol/src/signal.ts:11
SignalEngineinterface · public
@openelement/protocol · root

Signal engine protocol used by the framework's built-in adapter. This is a deliberate internal seam, not a public compatibility contract: the framework layer talks to signals only through this narrow interface so its call sites stay implementation-agnostic. The package ships and verifies exactly one engine implementation (`preact-engine`, backed by `@preact/signals-core`). Preact's own API is not Element public API, and arbitrary third-party engines are not promised; any future engine would be added behind this protocol rather than inline (charter decision — see #723).

SignalEngine

signal: <T>(initialValue: T) => WritableSignal<T> (required); computed: <T>(fn: () => T) => ReadonlySignal<T> (required); effect: (fn: () => void | Unsubscribe) => Unsubscribe (required)

packages/protocol/src/signal.ts:46
SignalLikeinterface · public
@openelement/protocol · root

Minimal signal-like object accepted by renderers and bindings.

SignalLike<T>

value: T (required); subscribe: (fn: (value: T) => void) => Unsubscribe (required); __@SIGNAL_BRAND@903.valueOf: () => boolean (required) — Returns the primitive value of the specified object.

packages/protocol/src/signal.ts:14
SpecialFileTypetype · public
@openelement/protocol · root

Special file kinds the route scanner recognizes by filename: `renderer` and `middleware`.

SpecialFileType
packages/protocol/src/framework.ts:79
SpeculationRulesOptionsinterface · public
@openelement/protocol · root

Speculation Rules configuration for SSG post-processing

SpeculationRulesOptions

prerender?: string[] (optional) — URL patterns to prerender (fully render in background before navigation).; prefetch?: string[] (optional) — URL patterns to prefetch (fetch HTML + resources without rendering).; exclude?: string[] (optional) — URL patterns to exclude from both prefetch and prerender.; eagerness?: "immediate" | "moderate" | "conservative" (optional) — Eagerness level for prerender rules.

packages/protocol/src/ssg.ts:410
SsgBehaviorOptionsinterface · public
@openelement/protocol · root

User-facing SSG build behavior switches (OpenElementOptions['ssg']).

SsgBehaviorOptions

dynamicRouteFailure?: "fail" | "warn" (optional) — Policy for dynamic-route render failures during SSG. See {@link SsgRenderOptions.dynamicRouteFailure}.

packages/protocol/src/ssg.ts:63
SsgPageOutputinterface · public
@openelement/protocol · root

Per-page render diagnostics returned by renderRoute()

SsgPageOutput

html: string (required) — Rendered HTML string; status.toString: (radix?: number) => string (required) — Returns a string representation of an object.; status.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; status.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; status.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; status.valueOf: () => number (required) — Returns the primitive value of the specified object.; status.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.; redirect?: { location: string; status: number; } (optional) — Redirect outcome (3xx). When set, `html` holds an interim status page and the result must not be persisted as a normal 200 page.; notFound?: boolean (optional) — True when the route signalled not-found (404).; errors: RenderError[] (required) — Render errors collected during rendering; componentCount: number (required) — Number of DSD components rendered on this page; renderTimeMs: number (required) — Total render time for all components on this page (ms)

packages/protocol/src/ssg.ts:330
SsgRenderEvidenceinterface · public
@openelement/protocol · root

The per-build render evidence record the SSG engine emits for audit.

SsgRenderEvidence

i18nOptions?: { [key: string]: unknown; locales: string[]; defaultLocale?: string; } | null (optional); admissionDecisions?: SsrAdmissionDecision[] (optional) — SSR admission decisions from the plan that rendered the pages.; manifestBudget.islandKB?: number (optional); manifestBudget.totalJsKB?: number (optional); manifestBudget.pageKB?: number (optional); onPrintBuildManifest?: ((input: { root: string; outDir: string; phase: 3; headExtras?: string; budget?: { islandKB?: number; totalJsKB?: number; pageKB?: number; }; }) => void | Prom… (optional)

packages/protocol/src/ssg.ts:388
SsgRenderOptionsinterface · public
@openelement/protocol · root

Options passed to the shared SSG render pipeline.

SsgRenderOptions

root: string (required); outDir: string (required); base?: string (optional); headExtras?: string (optional); html.lang?: string (optional); html.title?: string (optional); middleware.csp?: { policy?: string; reportOnly?: boolean; nonce?: boolean; } (optional); upgradeStrategy?: "load" | "idle" | "visible" | "only" | "none" (optional); viewTransition?: boolean (optional); speculation?: boolean | Record<string, unknown> (optional); islandTagNames?: string[] (optional); routesDir?: string (optional); dynamicRouteFailure?: "fail" | "warn" (optional) — Policy for dynamic-route render failures (HTTP status >= 500, non-empty render errors, or a renderRoute throw) during SSG. - 'fail' (default): abort the build - a failed page must never ship as a normal 200 page. - 'warn': log the failure and skip the page (the page is not written and is not registered in the ISR manifest).

packages/protocol/src/ssg.ts:36
SsgRenderSummaryinterface · public
@openelement/protocol · root

Summary of an SSG render run, returned by ssgRender().

SsgRenderSummary

staticNon200: { path: string; status: number; }[] (required) — Static routes whose handler returned a non-200 status. hono/ssg drops these responses (defaultPlugin), so they are not written to disk; they are listed here and in the build log instead of disappearing silently.; warnings: string[] (required) — Non-fatal warnings collected during the SSG run (sitemap generation failures, etc.). Surfaced here so the build summary / release evidence carries them instead of letting them disappear silently.

packages/protocol/src/ssg.ts:72
SSR_REGISTRY_ORIGINAL_DEFINEconst · public
@openelement/protocol · root

Property on the SSR registry holding the TRUE original `define` method, captured before the generated entry installs its idempotent wrapper. The registry outlives vite dev SSR module re-evaluations, so without this the second evaluation would capture the already-wrapped `define` as its "original" and every forced re-registration would silently early-return through the previous wrapper (#1339 lit dev feedback).

"__openElementOrigDefine"
packages/protocol/src/registry-markers.ts:40
SSR_REGISTRY_STUB_MARKERconst · public
@openelement/protocol · root

Marker property set to `true` on the SSR customElements stub. Readers must treat the marked registry as re-definable.

"__openElementSsrStub"
packages/protocol/src/registry-markers.ts:22
SsrAdmissionDecisioninterface · public
@openelement/protocol · root

The build's admission verdict for one discovered tag: where the declaration lives (`modulePath`), how it was discovered (`source`), which render path it is admitted to, and the reason recorded for the manifest.

SsrAdmissionDecision

tagName: string (required); modulePath: string (required) — Module path of the island declaration. Empty for 'foreign' decisions: a foreign tag is consumed in JSX but declares no module the build owns.; source: "local" | "package" | "nested" | "foreign" (required) — 'foreign' (#979): a third-party WC tag discovered by the foreign-tag scanner in page/island JSX — recorded for visibility only; SSR still treats it as an opaque passthrough (renderPath 'client-only').; renderPath: "client-only" | "rejected" | "ssr+client" (required); reason: string (required)

packages/protocol/src/render.ts:37
SsrAdmissionPlaninterface · public
@openelement/protocol · root

The build-time SSR admission decisions per component tag.

SsrAdmissionPlan

renderableTags: string[] (required); clientOnlyTags: string[] (required); rejectedTags: string[] (required); reasons: Record<string, string> (required); decisions: SsrAdmissionDecision[] (required); cemClassifications?: CompatibilityClassification[] (optional); foreignTags?: string[] (optional) — #979: foreign custom-element tags discovered in page / island JSX that are neither local islands, package-manifest islands, nor openElement-authored elements. Visibility only — each tag also carries a source:'foreign' decision (renderPath 'client-only') and the SSR/behavior is unchanged (opaque passthrough).

packages/protocol/src/ssg.ts:225
SsrBundleinterface · public
@openelement/protocol · root

The server bundle facts the SSG engine consumes for stream rendering.

SsrBundle
packages/protocol/src/ssg.ts:379
STATIC_STYLES_MARKERconst · public
@openelement/protocol · root

The one `<style>` element the server serializer emits as the first DSD template child when the class carries static styles (renderToString parity — pages never upgrade, so their styles must ship in the payload). The claim path skips exactly this marked node; a marked node on a style-less class is claim drift and fails closed.

"data-oe-static-styles"
packages/protocol/src/part-program.ts:462
StaticComponentDeclinterface · public
@openelement/protocol · root

Build-host-only compiled component reached through a route's local import graph. These components participate in recursive SSR/SSG expansion but are not client islands and therefore add no hydration or browser entry.

StaticComponentDecl

tagName: string (required); modulePath: string (required); compilerInteractionEvents: string[] (required) — Compiler-owned interaction events; empty means no inferred browser entry.

packages/protocol/src/ssg.ts:217
StaticSidecarDescriptorinterface · public
@openelement/protocol · root

One static-sidecar descriptor the host injects into the element compiler: the admission granted is a colocated static policy statement (#1473 item 3, the static-sidecar admission pattern).

StaticSidecarDescriptor

moduleSpecifier: string (required) — Canonical module specifier the sidecar export must be imported from.; exportName: string (required) — Exported name of the sidecar factory binding.; kind: "static-sidecar" (required) — The admission granted: a colocated static policy statement.

packages/protocol/src/module-descriptors.ts:16
StrategySourcetype · public
@openelement/protocol · root

Where an island's resolved hydration strategy came from.

StrategySource
packages/protocol/src/framework.ts:32
STREAM_FRAME_FORBIDDEN_TAGSconst · public
@openelement/protocol · root

Tags a deferred frame cannot safely install into an owned Part range: the browser installer rejects any frame whose markup carries one of these.

readonly ["script", "style", "template", "iframe", "object", "embed", "base", "meta", "link"]
packages/protocol/src/stream-frame-policy.ts:26
STREAM_FRAME_UNSAFE_URLconst · public
@openelement/protocol · root

Schemes that make a URL attribute unsafe in a streamed frame.

RegExp
packages/protocol/src/stream-frame-policy.ts:60
STREAM_FRAME_URL_ATTRIBUTESconst · public
@openelement/protocol · root

URL-carrying attributes the frame check screens for script-bearing scheme obfuscation; only these attribute names are value-screened.

readonly ["href", "src", "action", "formaction", "xlink:href"]
packages/protocol/src/stream-frame-policy.ts:42
STREAM_FRAME_URL_CONTROL_MAXconst · public
@openelement/protocol · root

Control characters at or below this code point are stripped before the URL-scheme test, so tab/newline/control obfuscation cannot smuggle a scheme past admission.

32
packages/protocol/src/stream-frame-policy.ts:55
STREAM_MAX_FIELDSconst · public
@openelement/protocol · root

Deferred fields (declared streamed properties) one stream route's manifest may carry. The build scan, the server executor, and the browser seed contract enforce the same bound.

32
packages/protocol/src/policy.ts:24
STREAM_MAX_OWNERSconst · public
@openelement/protocol · root

Part/Block owners one stream route's manifest may address in total across all deferred fields.

64
packages/protocol/src/policy.ts:30
STREAM_MAX_PAYLOAD_LENGTHconst · public
@openelement/protocol · root

Serialized stream payload bound, as a string length in UTF-16 code units: one seed attribute or one deferred frame's markup may not exceed it. The server checks the JSON text and the rendered range before emitting; the browser checks the attribute before parsing.

number
packages/protocol/src/policy.ts:45
STREAM_MAX_SEED_PROPERTIESconst · public
@openelement/protocol · root

Typed properties one streamed seed may carry: the browser seed contract rejects the WHOLE seed above this count, so an oversized component would silently fail to hydrate instead of failing loud at the server.

64
packages/protocol/src/policy.ts:37
STREAM_TIMEOUT_MSconst · public
@openelement/protocol · root

Deferred-field resolution budget (milliseconds) for one streamed response: fields still pending when it expires are failed in place and the stream ends with the shell and whatever resolved.

30000
packages/protocol/src/policy.ts:64
StreamRouteManifestinterface · public
@openelement/protocol · root

Build-only route projection bound to a specific compiled page program.

StreamRouteManifest

program: { version: number; tag: string; sha256: string; } (required); fields: { field: string; signal: string; owners: Array<{ kind: "part" | "region"; index: number; location: string; source: PartProgramV2["sourceMap"]["records"][number… (required)

packages/protocol/src/ssg.ts:13
STYLE_SHEET_LIVEconst · public
@openelement/protocol · root

The one key marking a sheet whose bytes are a LIVE resource rather than an immutable one (alpha15 S lane, S-C1.3). The dev server serves an authored sheet from a mutable endpoint that hot-updates: the sheet object is the copy the live resource re-fills through `replace()`, so every root that adopted it re-renders on an edit. A root whose serialized markup declares the same URL therefore still ADOPTS this sheet — the declarative `<link>` stays the first-paint / no-JavaScript delivery, and the adopted object is the one an edit reaches. Without that, a CSS-only edit could only be delivered by re-fetching the link, which is a DOM write this protocol does not perform. Production sheets never carry this key: their URL is content-addressed, so the link and the sheet can never disagree and one delivery is the whole story. Build-time and runtime cannot drift because the dev adapter generator interpolates this exact name.

"__openElementStyleSheetLive"
packages/protocol/src/style-sheet.ts:64
STYLE_SHEET_READYconst · public
@openelement/protocol · root

The one key under which a sheet carries its readiness promise: the generated client style adapter records it on the sheet it exports, and the element runtime reads the same key to hand styles to roots that are already connected. Build-time and runtime cannot drift because the adapter generator interpolates this exact name. The promise settles once. Fulfillment means the rules were installed through `replace()`; rejection carries the load or replacement failure and keeps its rejected state — an observer may attach its own catch, it must never convert the promise into a fulfilled one.

"__openElementStyleReady"
packages/protocol/src/style-sheet.ts:31
STYLE_SHEET_URLconst · public
@openelement/protocol · root

The one key under which a sheet carries the URL of the external CSS resource that delivers its rules: the generated client style adapter records the emitted asset URL on the sheet it exports, and the element runtime compares it against the declarative `<link rel="stylesheet" data-oe-static-styles>` nodes an SSR/DSD template already carries (alpha15 S lane). A root whose serialized markup already references the sheet's URL keeps that link as the delivery and does NOT adopt a second constructable copy — one stylesheet resource, one delivery, no duplicate application. Build-time and runtime cannot drift because the adapter generator interpolates this exact name.

"__openElementStyleSheetUrl"
packages/protocol/src/style-sheet.ts:44
StyleErrorCodeconst · public
@openelement/protocol · root

Compiled-style application failures (phase `csr`).

{ readonly ADOPTED_STYLES_UNSUPPORTED: "OE_STYLES_ADOPTED_STYLES_UNSUPPORTED"; readonly SHEET_LOAD_FAILED: "OE_STYLES_SHEET_LOAD_FAILED"; readonly INVALID_STYLE_HREF: "OE_STYLES_INVALID_HREF"; readonly SHEET_RULES_UNREA…
packages/protocol/src/errors.ts:228
StyleSheetLikeinterface · public
@openelement/protocol · root

Minimal stylesheet contract (replaceSync + cssRules) satisfied by native and shim sheets.

StyleSheetLike

replaceSync: (text: string) => void (required); cssRules: StyleSheetRule[] (required)

packages/protocol/src/style-sheet.ts:14
StyleSheetRuleinterface · public
@openelement/protocol · root

Cross-environment CSSStyleSheet abstraction. In browsers this delegates to the native CSSStyleSheet API. In SSR runtimes it falls back to a minimal in-memory implementation that exposes the subset used by OpenElement and renderToString().

StyleSheetRule

cssText: string (required)

packages/protocol/src/style-sheet.ts:9
UnsafeHtmltype · public
@openelement/protocol · root

Branded type: a string that is intentionally raw/untrusted HTML

UnsafeHtml
packages/protocol/src/framework.ts:12
unsafeStreamFrameAttributefunction · public
@openelement/protocol · root

Whether a static attribute (name/value as authored into the Part Program) makes a streamed frame unsafely installable: event-handler, seed-spoofing, and srcdoc names fail outright, and URL-carrying names fail when the entity-decoded, control-stripped value carries a script scheme.

(name: string, value: string): boolean
packages/protocol/src/stream-frame-policy.ts:113
Unsubscribetype · public
@openelement/protocol · root

Unsubscribe function returned by subscriptions and effects.

Unsubscribe
packages/protocol/src/signal.ts:8
validatePartProgramfunction · public
@openelement/protocol · root

Validate an unknown value as a Part Program v2. The validator is intentionally strict: unknown instruction kinds, missing ownership records and unsafe paths fail before a runtime can guess at their meaning.

(raw: unknown): asserts raw is PartProgram
packages/protocol/src/part-program.ts:925
VOID_TAGSconst · public
@openelement/protocol · root

HTML void elements — the ONE canonical tag set for every serializer, validator, and compiler in the workspace (issue #1220, M4). This module is import-free and host-free by design: it sits at the base of the module graph so the DOM runtime (internal/core/html-escape.ts), the Part Program exchange artifact (internal/protocol/part-program.ts), and the compiler semantic core can all consume the same definition without an import cycle or a second source of truth. Content is the full HTML Standard void-element list, `param` included. Do not redefine this set anywhere else; internal/core/html-escape.ts and internal/protocol/part-program.ts re-export it, and __tests__/void-tags-convergence.test.ts enforces the single owner.

ReadonlySet<string>
packages/protocol/src/void-tags.ts:16
WritableSignalinterface · public
@openelement/protocol · root

Writable signal protocol used by openElement integrations.

WritableSignal<T>

value: T (required); subscribe: (fn: (value: T) => void) => Unsubscribe (required); __@SIGNAL_BRAND@903.valueOf: () => boolean (required) — Returns the primitive value of the specified object.

packages/protocol/src/signal.ts:21
OpenElementRouteKindtype · public
@openelement/protocol · ./app-model

Host-agnostic route and asset contracts shared by app and build drivers.

OpenElementRouteKind
packages/protocol/src/app-model.ts:2
OpenElementRouteNodeinterface · public
@openelement/protocol · ./app-model

One node of the host-agnostic route tree: the matched URL `path` and route kind, the source and module paths the drivers resolve, the optional registered tag and param names, and the nested `children`.

OpenElementRouteNode

kind: OpenElementRouteKind (required); path: string (required); filePath?: string (optional); importPath?: string (optional); tagName?: string (optional); paramNames?: string[] (optional); children?: OpenElementRouteNode[] (optional); meta?: Record<string, unknown> (optional)

packages/protocol/src/app-model.ts:9
ClientAssetManifestinterface · public
@openelement/protocol · ./client-assets

The Phase 2 client build's delivery manifest, keyed by island identity.

ClientAssetManifest

entry: string (required) — The island client entry URL ('' when no client bundle shipped).; islands: Record<string, ClientIslandAsset> (required) — Compile-time island identity (delivery tag) -> emitted asset.; shared: string[] (required) — Shared chunk URLs emitted by the client build (JS, neither entry nor island-dedicated).; styles: string[] (required) — Preloadable island style asset URLs, sorted, base-prefixed. Shadow-component CSS cannot be applied as a document-level stylesheet — it cannot reach shadow trees — so the document channel's only role for these URLs is preload; the sheets themselves are adopted through the sheet adapters.

packages/protocol/src/client-assets.ts:36
ClientIslandAssetinterface · public
@openelement/protocol · ./client-assets

The client asset one compile-time island identity resolves to.

ClientIslandAsset

file: string (required) — Emitted asset URL (site-root relative, base-prefixed) of the chunk that carries the island module — its dedicated chunk, a shared chunk, or the client entry when the island has no chunk of its own.; strategy: IslandDeliveryStrategy (required) — Delivery strategy resolved from the island declaration at build time.; preload?: boolean (optional) — True when the island's delivery strategy hydrates at load time, so the asset is a modulepreload candidate.

packages/protocol/src/client-assets.ts:19
EMPTY_CLIENT_ASSET_MANIFESTconst · public
@openelement/protocol · ./client-assets

The manifest a project without a client bundle carries.

ClientAssetManifest
packages/protocol/src/client-assets.ts:54
serializeClientAssetsModulefunction · public
@openelement/protocol · ./client-assets

Serialize the manifest as the generated dist/server/client-assets.js module: pure structured data, no injection logic — consumers derive what they need from these values.

(manifest: ClientAssetManifest): string

entry: string (required) — The island client entry URL ('' when no client bundle shipped).; islands: Record<string, ClientIslandAsset> (required) — Compile-time island identity (delivery tag) -> emitted asset.; shared: string[] (required) — Shared chunk URLs emitted by the client build (JS, neither entry nor island-dedicated).; styles: string[] (required) — Preloadable island style asset URLs, sorted, base-prefixed. Shadow-component CSS cannot be applied as a document-level stylesheet — it cannot reach shadow trees — so the document channel's only role for these URLs is preload; the sheets themselves are adopted through the sheet adapters.

packages/protocol/src/client-assets.ts:68
Actiontype · public
@openelement/protocol · ./data

Route action: handles form submissions for a page route.

Action<T, Env, Platform, Route>
packages/protocol/src/data.ts:64
ACTION_FETCH_HEADERconst · public
@openelement/protocol · ./data

Request header selecting the action response channel: `true` marks a programmatic caller and selects the serialized ActionResult union; `enhance` marks the built-in morph enhancement and selects the same full-HTML responses the no-JS path receives.

"x-openelement-action"
packages/protocol/src/data.ts:125
ActionContextinterface · public
@openelement/protocol · ./data

Context passed to a route action function (extends loader context).

ActionContext<Env, Platform, Route>

formData: FormData (required); request: Request (required); params: Record<string, string> (required); env: Env (required); platform: Platform (required); responseHeaders: Headers (required) — Mutable response-only channel merged into the framework response.; route: Route (required)

packages/protocol/src/data.ts:47
ActionResulttype · public
@openelement/protocol · ./data

Wire shape returned to the JavaScript form-enhancement path. The no-JS path never sees this: it gets the equivalent semantics as plain HTTP (303 on success, 422 with the re-rendered form on validation failure, redirect/error as status codes). Success carries no data envelope. The application-loop contract makes a successful non-GET action answer 303 (PRG) — the framework never answers 200 with a rendered page, or with a success document, for a successful mutation — so the fetch channel answers `{ type: 'redirect' }` naming the PRG target and the authored return value is discarded by design. Success data travels the PRG target instead (query state the loader re-runs with, which the props projector then maps; see the router guide's "Form actions" section). The union previously declared a `{ type: 'success' }` member that no code path ever emitted — removed so the type matches the wire. Error outcomes (CSRF 403, unknown action 404, unparseable body 400, unexpected 500) are NOT part of this union: since #863 they answer RFC 9457 Problem Details with the PROBLEM_JSON_MEDIA_TYPE content type — see ProblemDetails.

ActionResult<Failure>
packages/protocol/src/data.ts:92
Loadertype · public
@openelement/protocol · ./data

Route loader: fetches data for a page route.

Loader<T, Env, Platform, Route>
packages/protocol/src/data.ts:56
LoaderContextinterface · public
@openelement/protocol · ./data

Context passed to a request-time ('dynamic') route loader.

LoaderContext<Env, Platform, Route>

request: Request (required); params: Record<string, string> (required); env: Env (required); platform: Platform (required); responseHeaders: Headers (required) — Mutable response-only channel merged into the framework response.; route: Route (required)

packages/protocol/src/data.ts:40
PROBLEM_JSON_MEDIA_TYPEconst · public
@openelement/protocol · ./data

Media type of the RFC 9457 action error channel (#863).

"application/problem+json"
packages/protocol/src/data.ts:117
ProblemDetailsinterface · public
@openelement/protocol · ./data

RFC 9457 Problem Details document (#863): the action error channel answers `application/problem+json` instead of the bespoke `{ type: 'error', error: { message } }` JSON, so HTTP tooling recognizes failures natively. With `type: 'about:blank'`, `title` is the HTTP reason phrase and `detail` carries the specific explanation. The wire shape is alpha-unfrozen; the 1.0 acceptance freezes it in this problem+json form.

ProblemDetails

type: string (required) — URI reference identifying the problem type; 'about:blank' when none applies.; title: string (required) — Short human-readable summary (the HTTP reason phrase for 'about:blank').; status.toString: (radix?: number) => string (required) — Returns a string representation of an object.; status.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; status.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; status.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; status.valueOf: () => number (required) — Returns the primitive value of the specified object.; status.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.; detail?: string (optional) — Human-readable explanation specific to this occurrence.

packages/protocol/src/data.ts:105
ServerRouteContextinterface · public
@openelement/protocol · ./data

Canonical request-time/SSG server route context.

ServerRouteContext<Env, Platform, Route>

request: Request (required); params: Record<string, string> (required); env: Env (required); platform: Platform (required); responseHeaders: Headers (required) — Mutable response-only channel merged into the framework response.; route: Route (required)

packages/protocol/src/data.ts:25
ServerRouteMetadatainterface · public
@openelement/protocol · ./data

Context passed to a request-time ('dynamic') route loader. This is the server contract: the loader runs on the server with the Web-standard request, matched route params, the host environment and the platform object, and signals validation failure via fail()/redirect().

ServerRouteMetadata

path: string (required); filePath: string (required)

packages/protocol/src/data.ts:19
DIAGNOSTIC_REPORT_FORMATconst · public
@openelement/protocol · ./diagnostics

The `format` discriminator every report carries. Consumers branch on it instead of guessing: a future shape change mints a new tag rather than reinterpreting old bytes.

"openelement.diagnostics/1"
packages/protocol/src/diagnostics.ts:84
DiagnosticEnvelopeinterface · public
@openelement/protocol · ./diagnostics

One machine-readable diagnostic: the producer's stable code, where the failure sits (`file`, `line`, `column` — absent when the producer has no source location, e.g. a configuration refusal), what happened (`message`), and when known, the fix (`hint`). `line`/`column` are 1-based, matching the diagnostics the compiler records from TypeScript source positions. Unknown envelope fields are tolerated on the wire (forward compat); the required core is exactly these fields.

DiagnosticEnvelope

code: string (required) — The producer's own stable code (`OEC9020`, `OE_PRESET_*`, `OE_SSG_*`).; severity: DiagnosticSeverity (required); phase: DiagnosticPhase (required); message: string (required) — What happened, in the producer's own words.; file?: string (optional) — The source file (or module specifier) the diagnostic points at.; line.toString: (radix?: number) => string (required) — Returns a string representation of an object.; line.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; line.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; line.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; line.valueOf: () => number (required) — Returns the primitive value of the specified object.; line.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.; column?: number (optional) — 1-based authored column, when the producer has a source location.; hint?: string (optional) — The fix, when the producer can name one.

packages/protocol/src/diagnostics.ts:60
DiagnosticPhasetype · public
@openelement/protocol · ./diagnostics

The pipeline phase a diagnostic was raised in — the same vocabulary the error contract's {@linkcode ErrorPhase } uses, so a producer's code, phase and envelope cannot disagree about where a failure happened.

DiagnosticPhase
packages/protocol/src/diagnostics.ts:39
diagnosticReportfunction · public
@openelement/protocol · ./diagnostics

Assemble the exit's report. `ok` derives from the diagnostics' severities, never from a caller's optimism: one `error` severity is enough to fail it.

(diagnostics: DiagnosticEnvelope[]): DiagnosticReport
packages/protocol/src/diagnostics.ts:105
DiagnosticReportinterface · public
@openelement/protocol · ./diagnostics

One build exit's diagnostics: the format tag, whether the run is clean (`ok` is false the moment any diagnostic carries severity `error`), and every diagnostic the exit collected. This is the document the CLI writes to the stream and the diagnostics file — one aggregate containing every code.

DiagnosticReport

format: "openelement.diagnostics/1" (required); ok: boolean (required); diagnostics: DiagnosticEnvelope[] (required)

packages/protocol/src/diagnostics.ts:95
DiagnosticReportFormattype · public
@openelement/protocol · ./diagnostics

One format tag value (kept as a type for the report's `format` field).

"openelement.diagnostics/1"
packages/protocol/src/diagnostics.ts:87
DiagnosticReportParseErrorclass · public
@openelement/protocol · ./diagnostics

Raised by {@linkcode parseDiagnosticReport} when the text is not a consumable report. Fail closed: a consumer that catches this knows the channel answered garbage — never a half-valid report.

class DiagnosticReportParseError extends Error
packages/protocol/src/diagnostics.ts:123
DiagnosticSeveritytype · public
@openelement/protocol · ./diagnostics

How severe one diagnostic is. `error` fails the build, `warning` reports a recoverable defect, `info` is reserved for advisories. The build report's `ok` flag derives from this: any `error` diagnostic makes the report not-ok.

DiagnosticSeverity
packages/protocol/src/diagnostics.ts:32
errorToEnvelopefunction · public
@openelement/protocol · ./diagnostics

Map the one error dialect ({@linkcode OpenElementError} — every producer's raiser goes through it) onto the envelope. The error's code, severity and phase ARE the envelope's; the message carries verbatim. Producers with a fix pass it as `hint`.

(error: OpenElementError, options?: { hint?: string; }): DiagnosticEnvelope

code: string (required); severity: ErrorSeverity (required); phase: ErrorPhase (required); recoverable: boolean (required); statusCode.toString: (radix?: number) => string (required) — Returns a string representation of an object.; statusCode.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; statusCode.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; statusCode.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; statusCode.valueOf: () => number (required) — Returns the primitive value of the specified object.; statusCode.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.; toJSON: () => Record<string, unknown> (required); name: string (required); message: string (required); stack?: string (optional); cause?: unknown (optional)

packages/protocol/src/diagnostics.ts:241
parseDiagnosticReportfunction · public
@openelement/protocol · ./diagnostics

Parse one report off the wire. Fails closed: truncated JSON, a foreign format tag, or any structurally broken diagnostic raises {@linkcode DiagnosticReportParseError} instead of returning a partial report a consumer might mistake for the truth.

(text: string): DiagnosticReport
packages/protocol/src/diagnostics.ts:193
serializeDiagnosticReportfunction · public
@openelement/protocol · ./diagnostics

Serialize a report for the stream/file channel: one line, no trailing newline.

(report: DiagnosticReport): string

format: "openelement.diagnostics/1" (required); ok: boolean (required); diagnostics: DiagnosticEnvelope[] (required)

packages/protocol/src/diagnostics.ts:114
AuthoringErrorCodeconst · public
@openelement/protocol · ./errors

Attribute/authoring-surface failures (phase `validation`).

{ readonly INVALID_TAG_NAME: "OE_INVALID_TAG_NAME"; readonly UNSAFE_META_ATTRIBUTE: "OE_UNSAFE_META_ATTRIBUTE"; readonly UNSAFE_ATTRIBUTE_NAME: "OE_UNSAFE_ATTRIBUTE_NAME"; readonly UNSAFE_URL_SINK: "OE_UNSAFE_URL_SINK";…
packages/protocol/src/errors.ts:290
ClaimErrorCodeconst · public
@openelement/protocol · ./errors

Claim failures: the existing DOM does not match the program that would own it. The value shipped in 1.0.0-alpha.3 and is kept verbatim; consumers match on it, and `PartProgramHydrationError` is its only raiser.

{ readonly STRUCTURE_MISMATCH: "OPEN_ELEMENT_COMPILED_CLAIM_MISMATCH"; readonly PRE_UPGRADE_EVENTS_INVALID: "OE_CLAIM_PRE_UPGRADE_EVENTS_INVALID"; readonly DYNAMIC_NODE_IN_STATIC_REGION: "OE_CLAIM_DYNAMIC_NODE_IN_STATIC…
packages/protocol/src/errors.ts:254
CompilerErrorCodeconst · public
@openelement/protocol · ./errors

Compiler (build-time) failures. The per-diagnostic `OEC####` codes stay on each diagnostic; these classify the family so a build failure is catchable as one thing.

{ readonly DIAGNOSTICS: "OE_COMPILER_DIAGNOSTICS"; readonly INVALID_SOURCE: "OE_COMPILER_INVALID_SOURCE"; }
packages/protocol/src/errors.ts:282
ContextErrorCodeconst · public
@openelement/protocol · ./errors

Community-context service lifecycle failures (phase `csr`).

{ readonly SERVICE_DISPOSED: "OE_CONTEXT_SERVICE_DISPOSED"; }
packages/protocol/src/errors.ts:222
DEFAULT_RENDER_ERROR_CODEconst · public
@openelement/protocol · ./errors

Default code for {@linkcode RenderError }. Deliberately NOT a member of {@linkcode ErrorCode}: that object is the scan target of the documentation site's error catalog, which requires every member to carry a phase/severity family rule. `RENDER_ERROR` is the pre-dialect value `RenderError` has always defaulted to — kept verbatim so callers that observe it keep working, and kept out of the catalogue because it is not a failure this package classifies, only a constructor default a caller may override.

"RENDER_ERROR"
packages/protocol/src/errors.ts:47
EachKeyErrorCodeconst · public
@openelement/protocol · ./errors

Keyed-list identity failures. Shared by the server serializer and the client runtime (see `internal/compiled/each-key.ts`), so both executors reject the same data with the same code.

{ readonly ITEM_NOT_A_RECORD: "OE_EACH_ITEM_NOT_A_RECORD"; readonly KEY_NOT_ROUND_TRIPPABLE: "OE_EACH_KEY_NOT_ROUND_TRIPPABLE"; readonly DUPLICATE_KEY: "OE_EACH_KEY_DUPLICATE"; }
packages/protocol/src/errors.ts:159
ERROR_PREFIXconst · public
@openelement/protocol · ./errors

Error message prefix for all openElement errors.

"[openElement]"
packages/protocol/src/errors.ts:50
ErrorCodeconst · public
@openelement/protocol · ./errors

Well-known error code constants for reference. String values are always accepted.

{ readonly SSR_RENDER_ERROR: "SSR_RENDER_ERROR"; readonly BOUNDARY_CAUGHT: "BOUNDARY_CAUGHT"; readonly UNKNOWN: "UNKNOWN"; }
packages/protocol/src/errors.ts:31
ErrorPhasetype · public
@openelement/protocol · ./errors

The pipeline phase an error was raised in.

ErrorPhase
packages/protocol/src/errors.ts:80
ErrorSeveritytype · public
@openelement/protocol · ./errors

How severe a framework error is.

ErrorSeverity
packages/protocol/src/errors.ts:78
ErrorTelemetryHooktype · public
@openelement/protocol · ./errors

Callback receiving every reported {@linkcode OpenElementError} for telemetry.

ErrorTelemetryHook
packages/protocol/src/errors.ts:132
FacadeErrorCodeconst · public
@openelement/protocol · ./errors

SSR/bootstrap failures raised by the public entries (phase `ssr` / `csr`).

{ readonly PROGRAM_MISSING: "OE_PROGRAM_MISSING"; readonly COMPOSITION_DEPTH: "OE_SSR_COMPOSITION_DEPTH"; readonly COMPUTED_FACTORY_MISSING: "OE_COMPUTED_FACTORY_MISSING"; readonly COMPUTED_READONLY: "OE_COMPUTED_READON…
packages/protocol/src/errors.ts:317
frameworkErrorfunction · public
@openelement/protocol · ./errors

One framework failure: {@linkcode OpenElementError} with the caller's code and the phase/severity/recoverability that phase implies. Every throw site in this package goes through this factory (or the `*ErrorCode` tables above) so a code, a phase and a recoverability answer cannot drift per site.

(code: string, message: string, options?: Omit<OpenElementErrorOptions, "code">): OpenElementError
packages/protocol/src/errors.ts:364
KernelErrorCodeconst · public
@openelement/protocol · ./errors

Element-lifecycle failures: the kernel was driven outside its contract (phase `csr`).

{ readonly DISPOSED: "OE_KERNEL_DISPOSED"; readonly TAG_MISMATCH: "OE_KERNEL_TAG_MISMATCH"; readonly CLAIM_EXECUTOR_MISSING: "OE_KERNEL_CLAIM_EXECUTOR_MISSING"; readonly ROOT_NOT_OWNED: "OE_KERNEL_ROOT_NOT_OWNED"; reado…
packages/protocol/src/errors.ts:208
OpenElementErrorclass · public
@openelement/protocol · ./errors

Framework error carrying a stable code, severity, phase and recoverability contract.

class OpenElementError extends Error
packages/protocol/src/errors.ts:100
OpenElementErrorOptionsinterface · public
@openelement/protocol · ./errors

Constructor options for {@linkcode OpenElementError}; every field is defaulted.

OpenElementErrorOptions

cause?: Error (optional); code?: string (optional); statusCode.toString: (radix?: number) => string (required) — Returns a string representation of an object.; statusCode.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; statusCode.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; statusCode.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; statusCode.valueOf: () => number (required) — Returns the primitive value of the specified object.; statusCode.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.; severity?: ErrorSeverity (optional); phase?: ErrorPhase (optional); recoverable?: boolean (optional)

packages/protocol/src/errors.ts:90
ProgramErrorCodeconst · public
@openelement/protocol · ./errors

Program-shape failures: a Part Program (or one of its records) is malformed, or carries a value the wire format cannot express. Phase `validation`: these reject data before any DOM work starts.

{ readonly INVALID_PROGRAM: "OE_PROGRAM_INVALID"; readonly NOT_SERIALIZABLE: "OE_PROGRAM_NOT_SERIALIZABLE"; readonly INVALID_SLOT: "OE_PROGRAM_INVALID_SLOT"; readonly INVALID_SOURCE_SEGMENT: "OE_PROGRAM_INVALID_SOURCE_S…
packages/protocol/src/errors.ts:141
raiseFrameworkErrorfunction · public
@openelement/protocol · ./errors

Raise one framework failure and never return: the throwing companion of {@linkcode frameworkError}. The per-module `fail(code, message)` micro-factories bind their failure surface's fixed {@linkcode ErrorPhase} here — one implementation, the phase as a parameter — so a code and a phase cannot drift apart per throw site.

(phase: ErrorPhase, code: string, message: string): never
packages/protocol/src/errors.ts:385
RUNTIME_MESSAGES_ENABLEDconst · public
@openelement/protocol · ./errors

Whether the authored error prose is kept: `true` everywhere except a production client build, the one context that defines `OE_RUNTIME_MESSAGES` to `false`. Stripping is a payload decision, so it belongs to the browser bundle only — server-side failures keep their prose.

boolean
packages/protocol/src/errors.ts:72
RuntimeErrorCodeconst · public
@openelement/protocol · ./errors

Runtime execution failures raised while a compiled program is serialized, built into fresh DOM, or re-read on a signal write (phase `render`).

{ readonly LIST_VALUE_NOT_ARRAY: "OE_RUNTIME_LIST_VALUE_NOT_ARRAY"; readonly HOST_SIGNAL_MISSING: "OE_RUNTIME_HOST_SIGNAL_MISSING"; readonly HOST_HANDLER_MISSING: "OE_RUNTIME_HOST_HANDLER_MISSING"; readonly HOST_REF_MIS…
packages/protocol/src/errors.ts:172
ServerErrorCodeconst · public
@openelement/protocol · ./errors

Compiled server/claim validation failures. The value shipped in 1.0.0-alpha.3 and is kept verbatim; `CompiledProgramValidationError` is its only raiser.

{ readonly PROGRAM_INVALID: "OPEN_ELEMENT_COMPILED_PROGRAM_INVALID"; readonly SINK_REFUSED: "OE_SERVER_SINK_REFUSED"; }
packages/protocol/src/errors.ts:270
StyleErrorCodeconst · public
@openelement/protocol · ./errors

Compiled-style application failures (phase `csr`).

{ readonly ADOPTED_STYLES_UNSUPPORTED: "OE_STYLES_ADOPTED_STYLES_UNSUPPORTED"; readonly SHEET_LOAD_FAILED: "OE_STYLES_SHEET_LOAD_FAILED"; readonly INVALID_STYLE_HREF: "OE_STYLES_INVALID_HREF"; readonly SHEET_RULES_UNREA…
packages/protocol/src/errors.ts:228
camelToKebabfunction · public
@openelement/protocol · ./forbidden-sinks

The one camelCase → kebab-case casing rule for custom-element attribute names, so `<x-el itemCount={5}>` round-trips as `item-count` on every boundary that derives an attribute name from a prop name: the compiler's property metadata, the SSR serializer, and the client attribute handling.

(str: string): string
packages/protocol/src/forbidden-sinks.ts:95
FORBIDDEN_ATTRIBUTE_NAMESconst · public
@openelement/protocol · ./forbidden-sinks

Forbidden sink names — the ONE canonical deny list for every Part Program boundary: the compiler semantic core, the protocol validator (internal/protocol/part-program.ts), and the compiled server/claim validator (internal/compiled/server/shared.ts). This module is import-free and host-free by design (same base-of-graph contract as void-tags.ts): all consumers import it, so a new forbidden sink cannot be enforced on one boundary and missed on another. This module owns the named-sink deny lists and the attribute-name policy built on them (the one shared safe-attribute-name predicate and the one camelCase→kebab-case casing rule); consumers delegate so the boundary cannot diverge. The lists are fail closed and case-insensitive (attribute and property names are compared lowercase, matching the HTML parser's name folding): - `FORBIDDEN_ATTRIBUTE_NAMES`: attribute names that must never be a static attribute or an `attr`/`bool` sink. `srcdoc` smuggles a full HTML document past attribute escaping; `innerHTML` is admissible only through the dedicated trusted-HTML `html` Part, never as a plain attribute name. - `FORBIDDEN_PROPERTY_NAMES`: `prop` sink names that would re-prototype or re-construct the target element (prototype-pollution primitives). - `RAW_TEXT_TAGS`: raw-text elements are outside the compiled grammar — their content cannot be escaped by the serializer.

ReadonlySet<string>
packages/protocol/src/forbidden-sinks.ts:28
FORBIDDEN_PROPERTY_NAMESconst · public
@openelement/protocol · ./forbidden-sinks

Property names the compiler refuses as

ReadonlySet<string>
packages/protocol/src/forbidden-sinks.ts:31
ForbiddenSinkKindtype · public
@openelement/protocol · ./forbidden-sinks

Sink categories the canonical deny list classifies.

ForbiddenSinkKind
packages/protocol/src/forbidden-sinks.ts:41
forbiddenSinkReasonfunction · public
@openelement/protocol · ./forbidden-sinks

Return a human-readable reason when `name` is a forbidden sink of `kind`, or null when the name is admissible. Unknown kinds fail closed with a reason instead of being waved through.

(kind: ForbiddenSinkKind, name: string): string | null
packages/protocol/src/forbidden-sinks.ts:48
isSafeAttributeNamefunction · public
@openelement/protocol · ./forbidden-sinks

The one safe-attribute-name predicate (#1033, #602). Attribute *names* are not escaped on any render path, so a name must be valid HTML attribute-name grammar (blocks quote/space injection), must not be an event handler (`on*`, case-insensitive), and must not be a forbidden sink (`innerhtml`/ `srcdoc` — case-insensitive). Every boundary that admits an attribute name — the compiler semantic core, the Part Program validator, the compiled server validator, and the SSR head/meta name checks — delegates here, so the rules cannot diverge per path.

(name: string): boolean
packages/protocol/src/forbidden-sinks.ts:81
RAW_TEXT_TAGSconst · public
@openelement/protocol · ./forbidden-sinks

Elements whose text content must never be interpolated as markup.

ReadonlySet<string>
packages/protocol/src/forbidden-sinks.ts:38
CompatibilityClassificationinterface · public
@openelement/protocol · ./framework

The per-tag verdict the compatibility scanner records: the tier a discovered tag was classified as, the human-readable `reason`, where the tag was found (`source`), and the SSR/DSD/hydration facts the verdict was derived from.

CompatibilityClassification

tagName: string (required); tier: CompatibilityTier (required); reason: string (required); source: "local" | "package" | "nested" (required); modulePath?: string (optional); ssr?: boolean (optional); dsd?: boolean (optional); hydrate?: string (optional)

packages/protocol/src/framework.ts:352
CompatibilityTiertype · public
@openelement/protocol · ./framework

How far a discovered tag may participate in the build: 'ssr-capable' renders and hydrates, 'client-only' ships to the browser without server output, 'experimental-dom' is admitted with a downgraded guarantee, and 'rejected' fails the build.

CompatibilityTier
packages/protocol/src/framework.ts:345
ComponentLayertype · public
@openelement/protocol · ./framework

The delivery layer a component belongs to: fully static DSD markup ('dsd-static'), DSD markup with a client island ('dsd-interactive'), a client-only island with no SSR output ('pure-island'), or a light-DOM element ('light-dom'). Recorded per component in the build manifest and consumed by the hydration scheduler.

ComponentLayer
packages/protocol/src/framework.ts:23
FrameworkOptionsinterface · public
@openelement/protocol · ./framework

The adapter-facing framework options: where routes and islands live, which renderer serializes pages, the default layout and named-layout declarations, the document `<html>`/head injection channels, and the request-time middleware switches. Every field is optional; the adapter applies its documented default. This is the type an application config file's default export is checked against, so the rendered option table and the actual config surface cannot drift.

FrameworkOptions

renderer?: "native" | "lit" (optional) — Page renderer selection (Beta.2.2, #1339). EXPLICIT, never inferred: 'native' (default) renders pages through the compiled Part Program serializer (renderToString); 'lit' renders LitElement pages through; routesDir?: string (optional) — Directory the route scanner walks, relative to the Vite root. Defaults to `app/routes`.; islandsDir?: string (optional) — Directory island modules are discovered in. Defaults to `app/islands`.; packageIslands?: string[] | "auto" | "manual" (optional) — How the build admits component packages whose modules the application imports. - omitted or `'auto'` (the default): the scan derives the admitted set at scan time — every package-owned element module the app's routes, pages, layouts, islands and components really reach (bundler-resolved) is attributed to its owner package (nearest `package.json`), and a package with a valid OpenElement manifest i…; layout?: LayoutConfig (optional) — Layout declaration; `false` disables the layout, `'default'` uses the built-in one.; layouts?: LayoutsConfig (optional) — Named layout declarations keyed by layout name.; headExtras?: string (optional) — @dangerous injected as-is, only use with controlled content; html.lang?: string (optional); html.title?: string (optional); inject.stylesheets?: (string | { href: string; integrity?: string; crossorigin?: "anonymous" | "use-credentials"; attrs?: Record<string, string | number | boolean>; })[] (optional) — Stylesheets linked into the document head; each entry is an href or a link record with integrity/crossorigin/attrs.; inject.scripts?: (string | { src: string; type?: string; async?: boolean; defer?: boolean; integrity?: string; crossorigin?: "anonymous" | "use-credentials"; attrs?: Record<str… (optional) — Scripts emitted into the document; each entry is a src or a script record with type/async/defer/integrity/crossorigin/attrs.; inject.headFragments?: string[] (optional) — @dangerous fragments injected as-is. Trust boundary (same level as `trustedHtml`): never concatenate user-controlled content into these fragments; sanitize untrusted data at your own system boundary first. The framework only enforces no-`<script>` and no-executable-`<style>`.; ssr.noExternal?: (string | RegExp)[] (optional); island.upgradeStrategy?: "load" | "idle" | "visible" | "only" | "none" (optional); build.outDir?: string (optional) — Output directory for the build artifacts. Defaults to `dist`.; build.manifestBudget?: { islandKB?: number; totalJsKB?: number; pageKB?: number; } (optional) — Advisory only: exceeded budgets print build-manifest warnings and never fail the build; enforce them in your own build-output test.; viewTransition?: boolean (optional) — Enable the View Transitions API for client navigations. Defaults to true.; speculation?: boolean | { prerender?: string[]; prefetch?: string[]; exclude?: string[]; eagerness?: "immediate" | "moderate" | "conservative"; } (optional) — Speculation Rules emission: `true` uses framework defaults, or pass prerender/prefetch URL lists, exclusions and an eagerness.; middleware.cors?: boolean (optional) — Built-in CORS middleware. Default-ON; pass `false` to disable.; middleware.corsOrigin?: string | string[] (optional) — Static CORS allowlist data, serialized into the generated entry as JSON. Mutually exclusive with {@link FrameworkOptions.middleware.corsOriginModule }.; middleware.corsOriginModule?: string (optional) — Path to a module that default-exports `(origin: string) => string | undefined`. The generated entry imports the module — the callback is never serialized — so it may close over module scope and import dependencies. Resolved with the same idiom as `layout.import` (e.g. './app/cors-origin.ts'). Mutually exclusive with `corsOrigin`.; middleware.requestId?: boolean (optional) — Emit and honor a per-request id header. Default-ON; pass `false` to disable.; middleware.logger?: boolean (optional) — Log each request through the built-in logger. Default-ON; pass `false` to disable.; middleware.securityHeaders?: boolean (optional) — Attach the built-in security response headers. Default-ON; pass `false` to disable.; middleware.csp?: { policy?: string; nonce?: boolean; reportOnly?: boolean; } (optional) — Content-Security-Policy emission: the policy string, nonce generation, and report-only mode.; middleware.use?: string[] (optional) — Fetch middleware chain (#858), composed around the framework handler in onion order (`use[0]` outermost), outside all built-in middleware above. Each entry is a MODULE PATH (same resolution idiom as `layout.import`, e.g. './app/middleware/auth.ts') whose default export is a {@link Middleware}; the generated entry emits `import * as __mw_N from '<path>'` and composes `__mw_N.default` in configured…

packages/protocol/src/framework.ts:181
HYDRATION_STRATEGIESconst · public
@openelement/protocol · ./framework

Runtime list of supported hydration strategies; the single source of truth for the `HydrationStrategy` union. Consumed by island/registry validation and re-exported from the element root for app and build adapters.

readonly ["load", "idle", "visible", "only", "none"]
packages/protocol/src/framework.ts:28
HydrationStrategytype · public
@openelement/protocol · ./framework

Island hydration trigger: 'load' | 'idle' | 'visible' | 'only'.

"load" | "idle" | "visible" | "only" | "none"
packages/protocol/src/framework.ts:30
LayoutConfigtype · public
@openelement/protocol · ./framework

Layout declaration: `false` disables the layout entirely, `'default'` uses the built-in layout, and the object form names a tag with the module path that defines it (`import`, resolved like a {@link FrameworkOptions.middleware.use } entry) plus the compiled layout properties the router injects per route.

LayoutConfig
packages/protocol/src/framework.ts:96
LocalePathinterface · public
@openelement/protocol · ./framework

Locale-aware resolved path contract.

LocalePath

locale: string (required); path: string (required); localizedPath: string (required); isDefaultLocalePath: boolean (required)

packages/protocol/src/framework.ts:82
Middlewaretype · public
@openelement/protocol · ./framework

Fetch middleware contract (#858): WinterCG shape, dialect-free — no Hono/h3 context object. Composed at the handler boundary in onion order (`use[0]` is outermost: it sees the request first and the response last), so it runs with identical semantics in the dev server, the `start` CLI, the e2e fixture server, and the Nitro production entry. A middleware may short-circuit by returning a Response without calling `next()`, or post-process the Response that `next()` returns. Module contract: a Middleware is the DEFAULT EXPORT of a module referenced from `middleware.use` by path (e.g. './app/middleware/auth.ts'). The generated server entry imports the module, so the middleware may close over module scope and import local helpers and third-party packages — it is a real module in the server module graph, never serialized source.

Middleware
packages/protocol/src/framework.ts:169
OpenElementBlogOptionsinterface · public
@openelement/protocol · ./framework

Blog options stored in the build context by

OpenElementBlogOptions

contentDir?: string (optional); basePath?: string (optional)

packages/protocol/src/framework.ts:37
OpenElementBuildContextLikeinterface · public
@openelement/protocol · ./framework

Minimal build context interface that sub-plugins can use.

OpenElementBuildContextLike

plugins: { [key: string]: unknown; blogOptions: OpenElementBlogOptions | null; navSections: OpenElementNavSection[]; headerNav: OpenElementHeaderNavLink[]; sitemapOptio… (required); registerPlugin: (name: string, instance: unknown) => void (required) — Register plugin data by name. Protocol level uses loose typing; concrete implementations should tighten the generic constraint.

packages/protocol/src/framework.ts:62
OpenElementI18nContextOptionsinterface · public
@openelement/protocol · ./framework

i18n options stored in the build context by

OpenElementI18nContextOptions
packages/protocol/src/framework.ts:55
OpenElementNavSectioninterface · public
@openelement/protocol · ./framework

Navigation section from

OpenElementNavSection

section: string (required); items: { path: string; label: string; order?: number; }[] (required)

packages/protocol/src/framework.ts:43
RouteEntryinterface · public
@openelement/protocol · ./framework

One route admitted by the scanner: URL `path`, source `filePath`, the route `type`, the generated variable name (`varName`) the entry binds it to, and the optional registration tag. {@link RouteEntry.definePage} and {@link RouteEntry.hasEnhancedForms} carry the two source-derived admission facts the generated entries branch on.

RouteEntry

path: string (required); filePath: string (required); type: "page" | "api" | "island" | "special" (required); varName: string (required); tagName?: string (optional); definePage?: boolean (optional) — True when the route module's default export is a definePage() definition (#960 — registration decoupling). The generated entry registers the page class under the path-derived fallback tag and IGNORES the tagName export for registration: on a definePage route the export only names a content element. Plain element routes keep tagName as their registration tag.; functionPage?: string (optional) — The server function page fact (alpha15 server lane): the exported server function component the route's `export default definePage(Component)` was called over. Present only when the argument is a plain identifier resolving to a component THIS module declares — an inline arrow or an unexported local never records it (the R1 admission rule mirrored, so a shape whose JSX would escape to runtime is n…; source?: string (optional) — Source text captured during scanning when includeSource is enabled.; hasEnhancedForms?: boolean (optional) — True when the page route source carries data-open-enhance (#569): the client entry must ship the form-enhancement layer even when the app has zero islands.; special?: SpecialFileType (optional); params?: string[] (optional)

packages/protocol/src/framework.ts:113
SafeHtmltype · public
@openelement/protocol · ./framework

Branded type: a string that has been HTML-escaped (safe for text content)

SafeHtml
packages/protocol/src/framework.ts:9
SpecialFileTypetype · public
@openelement/protocol · ./framework

Special file kinds the route scanner recognizes by filename: `renderer` and `middleware`.

SpecialFileType
packages/protocol/src/framework.ts:79
StrategySourcetype · public
@openelement/protocol · ./framework

Where an island's resolved hydration strategy came from.

StrategySource
packages/protocol/src/framework.ts:32
UnsafeHtmltype · public
@openelement/protocol · ./framework

Branded type: a string that is intentionally raw/untrusted HTML

UnsafeHtml
packages/protocol/src/framework.ts:12
IslandOptionsinterface · public
@openelement/protocol · ./island

Per-island delivery options (hydration strategy, SSR/DSD participation).

IslandOptions

hydrate?: "load" | "idle" | "visible" | "only" | "none" (optional) — Hydration strategy: - 'load': load immediately when module is imported - 'idle': defer to requestIdleCallback (default) - 'visible': use IntersectionObserver to defer until element is visible - 'only': client-only render, no DSD/SSR output Named `hydrate` to match `defineIslandConfig()` in the Router package — one option name across both packages.; dsd?: boolean (optional) — Whether to use DSD for SSR rendering of this island. Honored by the build-side island scan (via `defineIslandConfig`), not by `defineIsland()` itself: passing it in `IslandOptions` has no runtime effect.; ssr?: boolean (optional) — Whether this island may be admitted into server rendering. Like `dsd`, decided by the build-side island scan; inert when passed to `defineIsland()`.

packages/protocol/src/island.ts:8
IslandTransformOptionsinterface · public
@openelement/protocol · ./island

Options for the build-time island source transform.

IslandTransformOptions

islandsDir: string (required) — Directory containing island files (e.g. "app/islands"); filePath: string (required) — Absolute or relative file path of the source being processed; layout?: { path: string; tagName: string; } (optional) — Layout-convention admission (alpha15 R batch 3): the resolved layout module the router convention owns (`app/layout.tsx`, tag `app-layout`, or a project-relative custom `layout: { import }` override). The gate admits this one path with its resolved tag even though it lives outside `islandsDir`. Absent when the project configures no layout module (`layout: false`, or the deletable convention file …

packages/protocol/src/island.ts:42
IslandTransformResultinterface · public
@openelement/protocol · ./island

The island transform output: rewritten source plus extracted facts.

IslandTransformResult

code: string (required) — Transformed source code with markers; islands: { tagName: string; filePath: string; }[] (required) — Detected island entries; map?: string (optional) — Optional source map

packages/protocol/src/island.ts:64
ISLAND_ADMISSIONconst · public
@openelement/protocol · ./island-admission

The static-sidecar descriptor router injects into the element compiler.

StaticSidecarDescriptor
packages/protocol/src/island-admission.ts:18
CemCompatibilityReportinterface · public
@openelement/protocol · ./manifest

The compatibility classification report for one custom element manifest.

CemCompatibilityReport

totalClassified.toString: (radix?: number) => string (required) — Returns a string representation of an object.; totalClassified.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; totalClassified.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; totalClassified.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; totalClassified.valueOf: () => number (required) — Returns the primitive value of the specified object.; totalClassified.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.; ssrCapableCount: number (required); clientOnlyCount: number (required); rejectedCount: number (required); experimentalDomCount: number (required); classifications: CompatibilityClassification[] (required); summary: string (required)

packages/protocol/src/manifest.ts:115
CompatibilityClassificationinterface · public
@openelement/protocol · ./manifest

The per-tag verdict the compatibility scanner records: the tier a discovered tag was classified as, the human-readable `reason`, where the tag was found (`source`), and the SSR/DSD/hydration facts the verdict was derived from.

CompatibilityClassification

tagName: string (required); tier: CompatibilityTier (required); reason: string (required); source: "local" | "package" | "nested" (required); modulePath?: string (optional); ssr?: boolean (optional); dsd?: boolean (optional); hydrate?: string (optional)

packages/protocol/src/framework.ts:352
CompatibilityTiertype · public
@openelement/protocol · ./manifest

How far a discovered tag may participate in the build: 'ssr-capable' renders and hydrates, 'client-only' ships to the browser without server output, 'experimental-dom' is admitted with a downgraded guarantee, and 'rejected' fails the build.

CompatibilityTier
packages/protocol/src/framework.ts:345
OpenElementAttributeinterface · public
@openelement/protocol · ./manifest

One documented attribute of a custom element declaration.

OpenElementAttribute

name: string (required); type?: string (optional); default?: string (optional); description?: string (optional); reflects?: boolean (optional); fieldName?: string (optional)

packages/protocol/src/manifest.ts:15
OpenElementCssPartinterface · public
@openelement/protocol · ./manifest

One documented CSS part of a custom element declaration.

OpenElementCssPart

name: string (required); description?: string (optional)

packages/protocol/src/manifest.ts:38
OpenElementDeclarationinterface · public
@openelement/protocol · ./manifest

One custom element declaration in a package manifest: tag, members and delivery metadata.

OpenElementDeclaration

tagName: string (required); className?: string (optional); superclassName?: string (optional); attributes?: OpenElementAttribute[] (optional); events?: OpenElementEvent[] (optional); slots?: OpenElementSlot[] (optional); cssParts?: OpenElementCssPart[] (optional); openElement.ssr?: boolean (optional); openElement.dsd?: boolean (optional); openElement.layer?: ComponentLayer (optional); openElement.hydrate?: "load" | "idle" | "visible" | "only" | "none" (optional); openElement.status?: "stable" | "experimental" (optional) — Stability marker from the owning package's manifest policy.; openElement.module?: string (optional); openElement.export?: string (optional); openElement.tailwind?: OpenElementTailwindDeclaration (optional); description?: string (optional)

packages/protocol/src/manifest.ts:85
OpenElementEventinterface · public
@openelement/protocol · ./manifest

One documented custom event of a custom element declaration.

OpenElementEvent

name: string (required); type?: string (optional); description?: string (optional)

packages/protocol/src/manifest.ts:25
OpenElementExtensionsinterface · public
@openelement/protocol · ./manifest

The openElement-specific extension block of a package manifest declaration.

OpenElementExtensions

ssr?: boolean (optional); dsd?: boolean (optional); layer?: ComponentLayer (optional); hydrate?: "load" | "idle" | "visible" | "only" | "none" (optional); status?: "stable" | "experimental" (optional) — Stability marker from the owning package's manifest policy.; module?: string (optional); export?: string (optional); tailwind.required?: boolean (optional); tailwind.sources?: string[] (optional); tailwind.dialect?: "tailwind4" (optional)

packages/protocol/src/manifest.ts:72
OpenElementPackageManifestinterface · public
@openelement/protocol · ./manifest

Package manifest of component declarations (not a Custom Elements Manifest).

OpenElementPackageManifest

schemaVersion: string (required); packageName: string (required); version: string (required); description?: string (optional); author?: string (optional); license?: string (optional); homepage?: string (optional); repository?: string (optional); declarations: OpenElementDeclaration[] (required)

packages/protocol/src/manifest.ts:98
OpenElementSlotinterface · public
@openelement/protocol · ./manifest

One documented slot of a custom element declaration.

OpenElementSlot

name: string (required); description?: string (optional)

packages/protocol/src/manifest.ts:32
OpenElementTailwindDeclarationinterface · public
@openelement/protocol · ./manifest

A declaration's utility-compilation requirement and the package-owned style sources that requirement compiles (the declared-compilation contract; see the router's `style-plan` module for the resolution rules). `required` is the mandatory-compilation dependency: the component's presentation cannot be delivered without the compile, so an application that disables the entry (`tailwind: false`) fails the build with a coded diagnostic instead of shipping an unstyled component. Merely offering a theme source is NOT a requirement — leave `required` unset for a source a consumer may adopt on its own. `sources` are package-relative paths (e.g. `./theme.css`) resolved against THIS package, so a consumer never repeats the owner's declaration. They must exist in the installed package (i.e. ship in the tarball). `dialect` names the CLASS LANGUAGE this component's utility tokens are written in, not the engine that compiles them: the declaration stays provider-neutral, and a selected provider that does not implement the dialect fails the build before any compile. Omitted means `tailwind4` — the language every declaration written before this field existed uses.

OpenElementTailwindDeclaration

required?: boolean (optional); sources?: string[] (optional); dialect?: "tailwind4" (optional)

packages/protocol/src/manifest.ts:65
ModuleVocabularyDescriptorinterface · public
@openelement/protocol · ./module-descriptors

One module-scan vocabulary entry the host admits: a binding identity (module specifier + exported name, aliases followed) plus the fact a canonical call of that binding contributes. Plain data — the scan consumes the descriptors without learning the caller's package vocabulary, the same direction as the compiler's {@link StaticSidecarDescriptor} admission (#1473 item 3).

ModuleVocabularyDescriptor

moduleSpecifier: string (required) — Canonical module specifier the factory must be imported from.; exportName: string (required) — Exported name of the factory binding.; kind: "page-definition" | "element-registration" (required) — What a canonical call of the binding contributes to the scan.

packages/protocol/src/module-descriptors.ts:33
StaticSidecarDescriptorinterface · public
@openelement/protocol · ./module-descriptors

One static-sidecar descriptor the host injects into the element compiler: the admission granted is a colocated static policy statement (#1473 item 3, the static-sidecar admission pattern).

StaticSidecarDescriptor

moduleSpecifier: string (required) — Canonical module specifier the sidecar export must be imported from.; exportName: string (required) — Exported name of the sidecar factory binding.; kind: "static-sidecar" (required) — The admission granted: a colocated static policy statement.

packages/protocol/src/module-descriptors.ts:16
ROUTER_MODULE_VOCABULARYconst · public
@openelement/protocol · ./module-vocabulary

The module vocabulary router injects into `analyzeModuleSemantics`.

readonly ModuleVocabularyDescriptor[]
packages/protocol/src/module-vocabulary.ts:17
CemPropertyMetadatainterface · public
@openelement/protocol · ./part-program

One property entry of the compiled custom-elements-manifest metadata.

CemPropertyMetadata

name: string (required); fieldName: string (required); type: PropertyValueType (required); attribute: string | null (required); reflect: boolean (required)

packages/protocol/src/part-program.ts:395
COMPILED_MODULE_ABI_VERSIONconst · public
@openelement/protocol · ./part-program

Version of the compiled-module ABI: the statics a generated module carries (`__partProgram`, `__compiledProperties`, `__elementMetadata`, `__observedAttributes`, `__computedFields`) and the runtime facade binds. Bump when the generated-module contract changes shape; generated artifacts stamp both this and PART_PROGRAM_VERSION so consumers can tell format drift from release drift. v2: platform lifecycle callback bodies are emitted inside a boundary-capture wrapper calling the base class's `_captureError` — a generated module now requires a runtime facade carrying that protected method (the v1 shape emitted the bodies verbatim).

2
packages/protocol/src/part-program.ts:37
CompiledCemMetadatainterface · public
@openelement/protocol · ./part-program

The compiled custom-elements-manifest metadata block of one component.

CompiledCemMetadata

tagName: string (required); className: string (required); declaration: { name: string; module: string; } (required); attributes: { name: string; fieldName: string; type: PropertyValueType; reflect: boolean; }[] (required); members: CemPropertyMetadata[] (required)

packages/protocol/src/part-program.ts:404
CompiledElementMetadatainterface · public
@openelement/protocol · ./part-program

The compiled element metadata the program carries for tooling consumers.

CompiledElementMetadata

tag: string (required); className: string (required); sourceFile: string (required); properties: CompiledPropertyMetadata[] (required); observedAttributes: string[] (required); cem: CompiledCemMetadata (required)

packages/protocol/src/part-program.ts:413
CompiledPropertyMetadatainterface · public
@openelement/protocol · ./part-program

One compiled

CompiledPropertyMetadata

name: string (required); attribute: string | null (required); type: PropertyValueType (required); converter: PropertyValueType (required); reflect: boolean (required); default: SerializableValue (required); computed?: boolean (optional) — True for computed fields (`= computed(() => ...)` in the source): their signal is derived from other property signals by the generated `__computedFields` factory, never seeded from attributes/props. Always paired with `attribute: null` and `reflect: false`.; deps?: string[] (optional) — Source signal names a computed field reads (declaration order).

packages/protocol/src/part-program.ts:376
conditionLiteralAllowedfunction · public
@openelement/protocol · ./part-program

Operator/literal compatibility for when-Block tests (issue #1372). Both wire validators (this module and the server serializer's shared validator) close the space through this one predicate: - ordering operators require a finite numeric literal; - `equals`/`not-equals` admit a finite number, string, or boolean; - `truthy` admits exactly `true` or `false` (the recorded expectation).

(op: unknown, value: unknown): boolean
packages/protocol/src/part-program.ts:274
ConditionOperatortype · public
@openelement/protocol · ./part-program

The comparison operators a program condition supports.

ConditionOperator
packages/protocol/src/part-program.ts:250
DATA_OE_LIGHTconst · public
@openelement/protocol · ./part-program

Internal SSR provenance marker on light-mode host tags (#1148). Present only when the host's light subtree was server-rendered under the in-place activation contract: the client binds the existing DOM instead of clearing it, and a parent's activation walk prunes the nested host's subtree. Client rendering never writes it and it is never removed. The writer (internal/compiled/server) and readers (internal/compiled/runtime) import this constant; nothing writes the literal.

"data-oe-light"
packages/protocol/src/part-program.ts:473
isAttributeNamefunction · public
@openelement/protocol · ./part-program

The wire-validator face of the one canonical attribute-name predicate (delegates to `./forbidden-sinks.ts`); exported for parity tests.

(value: unknown): value is string
packages/protocol/src/part-program.ts:515
ItemEventBindinginterface · public
@openelement/protocol · ./part-program

An event binding scoped to each item of an `each` block. The runtime attaches this listener to every item root node created by the block, making per-item handlers (onClick={this.select(row.id)}) expressible without fixed-path event parts.

ItemEventBinding

event: string (required) — DOM event name ('click', 'input', …).; handler: string (required) — Handler method name on the compiled class.; action: ProgramEventAction (required) — The action to dispatch, same union as fixed event parts.; selector?: string (optional) — Optional child selector within the item template (e.g. '.probe-button'). When omitted, the listener attaches to the item root.

packages/protocol/src/part-program.ts:309
PART_PROGRAM_VERSIONconst · public
@openelement/protocol · ./part-program

The Part Program IR version this package defines (currently v2).

2
packages/protocol/src/part-program.ts:22
partAnchorEndMarkerfunction · public
@openelement/protocol · ./part-program

The comment marker closing a part anchor in serialized program markup.

(index: number): string

toString: (radix?: number) => string (required) — Returns a string representation of an object.; toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; valueOf: () => number (required) — Returns the primitive value of the specified object.; toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.

packages/protocol/src/part-program.ts:451
partAnchorMarkerfunction · public
@openelement/protocol · ./part-program

Anchor marker payloads shared by seed runtime consumers.

(index: number): string

toString: (radix?: number) => string (required) — Returns a string representation of an object.; toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; valueOf: () => number (required) — Returns the primitive value of the specified object.; toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.

packages/protocol/src/part-program.ts:446
PartProgramtype · public
@openelement/protocol · ./part-program

The serializable Part Program v2: one compiled component as data.

PartProgramV2

version: 2 (required); tag: string (required); root: ProgramRoot (required); template: ProgramTreeNode[] (required); parts: ProgramPart[] (required); blocks: ProgramBlockRecord[] (required); dependencies: ProgramDependencyRecord[] (required); locations: ProgramLocationRecord[] (required); sourceMap: ProgramSourceMap (required) — Compile-time provenance. The canonical in-memory artifact always carries it; the serialized module payload omits it (no runtime consumer reads it), so the validator accepts programs with or without it but still verifies it strictly when present.; metadata: CompiledElementMetadata (required)

packages/protocol/src/part-program.ts:443
PartProgramV2interface · public
@openelement/protocol · ./part-program

The one deterministic program consumed by all execution modes.

PartProgramV2

version: 2 (required); tag: string (required); root: ProgramRoot (required); template: ProgramTreeNode[] (required); parts: ProgramPart[] (required); blocks: ProgramBlockRecord[] (required); dependencies: ProgramDependencyRecord[] (required); locations: ProgramLocationRecord[] (required); sourceMap: ProgramSourceMap (required) — Compile-time provenance. The canonical in-memory artifact always carries it; the serialized module payload omits it (no runtime consumer reads it), so the validator accepts programs with or without it but still verifies it strictly when present.; metadata: CompiledElementMetadata (required)

packages/protocol/src/part-program.ts:423
ProgramAttrPartinterface · public
@openelement/protocol · ./part-program

String attribute sink bound to a Signal.

ProgramAttrPart

k: "attr" (required); index.toString: (radix?: number) => string (required) — Returns a string representation of an object.; index.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; index.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; index.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; index.valueOf: () => number (required) — Returns the primitive value of the specified object.; index.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.; signal: string (required); name: string (required); path: number[] (required); location: ProgramLocation (required)

packages/protocol/src/part-program.ts:168
ProgramBlockRecordinterface · public
@openelement/protocol · ./part-program

One block the program tracks: the boundaries of a dynamic subtree.

ProgramBlockRecord

id: string (required); index.toString: (radix?: number) => string (required) — Returns a string representation of an object.; index.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; index.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; index.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; index.valueOf: () => number (required) — Returns the primitive value of the specified object.; index.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.; kind: "when" | "each" (required); anchor: string (required); end: string (required); source: string (required)

packages/protocol/src/part-program.ts:356
ProgramBoolPartinterface · public
@openelement/protocol · ./part-program

Boolean attribute sink bound to a Signal.

ProgramBoolPart

k: "bool" (required); index.toString: (radix?: number) => string (required) — Returns a string representation of an object.; index.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; index.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; index.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; index.valueOf: () => number (required) — Returns the primitive value of the specified object.; index.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.; signal: string (required); name: string (required); path: number[] (required); location: ProgramLocation (required)

packages/protocol/src/part-program.ts:178
ProgramClassPartinterface · public
@openelement/protocol · ./part-program

Specialized fixed sinks make ownership explicit for class and style text.

ProgramClassPart

k: "class" (required); index.toString: (radix?: number) => string (required) — Returns a string representation of an object.; index.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; index.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; index.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; index.valueOf: () => number (required) — Returns the primitive value of the specified object.; index.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.; signal: string (required); path: number[] (required); location: ProgramLocation (required)

packages/protocol/src/part-program.ts:188
ProgramConditioninterface · public
@openelement/protocol · ./part-program

One condition clause of a when part.

ProgramCondition

signal: string (required); op: ConditionOperator (required); value: string | number | boolean (required)

packages/protocol/src/part-program.ts:260
ProgramDependencyRecordinterface · public
@openelement/protocol · ./part-program

One module dependency the compiled module graph records.

ProgramDependencyRecord

signal: string (required); owner: { kind: "part" | "region"; index: number; } (required); location: string (required)

packages/protocol/src/part-program.ts:366
ProgramEachPartinterface · public
@openelement/protocol · ./part-program

A list part: repeats its template node per item of a bound signal.

ProgramEachPart

k: "each" (required); index.toString: (radix?: number) => string (required) — Returns a string representation of an object.; index.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; index.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; index.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; index.valueOf: () => number (required) — Returns the primitive value of the specified object.; index.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.; signal: string (required); key: string (required); field?: string (optional) — Restatement of the item field for single-field templates; omitted when the item template binds multiple fields (each `ival`/`iattrs` slot then carries its own field).; item: ProgramTreeNode[] (required); itemEvents?: ItemEventBinding[] (optional) — Per-item event bindings (#1556 IR v2): listeners attached to each item.; location: ProgramLocation (required)

packages/protocol/src/part-program.ts:324
ProgramElementNodeinterface · public
@openelement/protocol · ./part-program

A static element node of the program tree.

ProgramElementNode

k: "el" (required); id: string (required); tag: string (required); attrs: [string, string][] (required); iattrs?: [string, string][] (optional) — Per-item attribute slots ([name, itemField]) — valid only inside an `each` item template. At mount/claim time the value resolves from the current item: `true` emits a bare attribute, `false`/`null`/`undefined` omit it, anything else serializes with String().; children: ProgramTreeNode[] (required)

packages/protocol/src/part-program.ts:104
ProgramEventActiontype · public
@openelement/protocol · ./part-program

The action one event part dispatches.

ProgramEventAction
packages/protocol/src/part-program.ts:231
ProgramEventPartinterface · public
@openelement/protocol · ./part-program

An event binding part: listener wiring between DOM event and action.

ProgramEventPart

k: "event" (required); index.toString: (radix?: number) => string (required) — Returns a string representation of an object.; index.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; index.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; index.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; index.valueOf: () => number (required) — Returns the primitive value of the specified object.; index.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.; event: string (required); handler: string (required); action: ProgramEventAction (required); path: number[] (required); location: ProgramLocation (required)

packages/protocol/src/part-program.ts:239
ProgramHtmlPartinterface · public
@openelement/protocol · ./part-program

Trusted-HTML content sink (alpha.9). The signal value must carry the runtime TrustedHtml capability; its HTML replaces the target element's content. The target's subtree is opaque to the claim path. The compiler emits this only for an explicit `innerHTML={this.<field>}` sink on an otherwise childless element — there is no implicit or discovery path to raw HTML.

ProgramHtmlPart

k: "html" (required); index.toString: (radix?: number) => string (required) — Returns a string representation of an object.; index.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; index.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; index.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; index.valueOf: () => number (required) — Returns the primitive value of the specified object.; index.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.; signal: string (required); path: number[] (required); location: ProgramLocation (required)

packages/protocol/src/part-program.ts:213
ProgramItemValueNodeinterface · public
@openelement/protocol · ./part-program

Item-value text slot; valid only inside an `each` item template. `field` names the item field rendered by this slot — multi-field item templates carry one slot per field, and the compiler always emits it.

ProgramItemValueNode

k: "ival" (required); field: string (required)

packages/protocol/src/part-program.ts:137
ProgramLocationinterface · public
@openelement/protocol · ./part-program

Exact compiler-owned location for one dynamic sink or range anchor.

ProgramLocation

id: string (required); kind: "anchor" | "sink" (required); path: number[] (required); node?: string (optional)

packages/protocol/src/part-program.ts:90
ProgramLocationRecordtype · public
@openelement/protocol · ./part-program

A location record also makes the identity auditable without inspecting parts.

ProgramLocationRecord
packages/protocol/src/part-program.ts:98
ProgramParttype · public
@openelement/protocol · ./part-program

The discriminated union of dynamic parts a program instantiates.

ProgramPart
packages/protocol/src/part-program.ts:342
ProgramPartAnchorNodeinterface · public
@openelement/protocol · ./part-program

The anchor node marking where a part binds in the tree.

ProgramPartAnchorNode

k: "part" (required); id: string (required); index.toString: (radix?: number) => string (required) — Returns a string representation of an object.; index.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; index.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; index.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; index.valueOf: () => number (required) — Returns the primitive value of the specified object.; index.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.

packages/protocol/src/part-program.ts:126
ProgramPositioninterface · public
@openelement/protocol · ./part-program

Where a part sits relative to its anchor.

ProgramPosition

offset.toString: (radix?: number) => string (required) — Returns a string representation of an object.; offset.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; offset.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; offset.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; offset.valueOf: () => number (required) — Returns the primitive value of the specified object.; offset.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.; line: number (required); column: number (required)

packages/protocol/src/part-program.ts:59
ProgramPropPartinterface · public
@openelement/protocol · ./part-program

DOM property sink bound to a Signal; `path` is retained for seed consumers.

ProgramPropPart

k: "prop" (required); index.toString: (radix?: number) => string (required) — Returns a string representation of an object.; index.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; index.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; index.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; index.valueOf: () => number (required) — Returns the primitive value of the specified object.; index.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.; signal: string (required); name: string (required); path: number[] (required); location: ProgramLocation (required)

packages/protocol/src/part-program.ts:158
ProgramRefPartinterface · public
@openelement/protocol · ./part-program

A named ref slot is serializable; the generated class supplies the ref value.

ProgramRefPart

k: "ref" (required); index.toString: (radix?: number) => string (required) — Returns a string representation of an object.; index.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; index.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; index.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; index.valueOf: () => number (required) — Returns the primitive value of the specified object.; index.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.; ref: string (required); path: number[] (required); location: ProgramLocation (required)

packages/protocol/src/part-program.ts:222
ProgramRootinterface · public
@openelement/protocol · ./part-program

The root of one program tree: element, part anchor, or text.

ProgramRoot

id: "root" (required); kind: RootMode (required); nodes: string[] (required)

packages/protocol/src/part-program.ts:43
ProgramSourceKindtype · public
@openelement/protocol · ./part-program

The kind of source record a program source map entry carries.

ProgramSourceKind
packages/protocol/src/part-program.ts:73
ProgramSourceMapinterface · public
@openelement/protocol · ./part-program

The program source map: authored spans projected onto emitted records.

ProgramSourceMap

version: 1 (required); file: string (required); records: ProgramSourceRecord[] (required)

packages/protocol/src/part-program.ts:83
ProgramSourceRangeinterface · public
@openelement/protocol · ./part-program

A half-open [start, end) range into the authored source text.

ProgramSourceRange

file: string (required); start: ProgramPosition (required); end: ProgramPosition (required)

packages/protocol/src/part-program.ts:66
ProgramSourceRecordinterface · public
@openelement/protocol · ./part-program

One source-map record: the authored origin of one emitted node or part.

ProgramSourceRecord

id: string (required); kind: ProgramSourceKind (required); source: ProgramSourceRange (required)

packages/protocol/src/part-program.ts:76
ProgramStylePartinterface · public
@openelement/protocol · ./part-program

A style binding part.

ProgramStylePart

k: "style" (required); index.toString: (radix?: number) => string (required) — Returns a string representation of an object.; index.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; index.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; index.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; index.valueOf: () => number (required) — Returns the primitive value of the specified object.; index.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.; signal: string (required); path: number[] (required); location: ProgramLocation (required)

packages/protocol/src/part-program.ts:197
ProgramTextNodeinterface · public
@openelement/protocol · ./part-program

A static text node of the program tree.

ProgramTextNode

k: "text" (required); value: string (required)

packages/protocol/src/part-program.ts:120
ProgramTextPartinterface · public
@openelement/protocol · ./part-program

A text interpolation part bound to one signal.

ProgramTextPart

k: "text" (required); index.toString: (radix?: number) => string (required) — Returns a string representation of an object.; index.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; index.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; index.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; index.valueOf: () => number (required) — Returns the primitive value of the specified object.; index.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.; signal: string (required); location: ProgramLocation (required)

packages/protocol/src/part-program.ts:150
ProgramTreeNodetype · public
@openelement/protocol · ./part-program

The discriminated union of static tree nodes.

ProgramTreeNode
packages/protocol/src/part-program.ts:143
ProgramWhenPartinterface · public
@openelement/protocol · ./part-program

A conditional part: swaps template branches on a condition.

ProgramWhenPart

k: "when" (required); index.toString: (radix?: number) => string (required) — Returns a string representation of an object.; index.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; index.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; index.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; index.valueOf: () => number (required) — Returns the primitive value of the specified object.; index.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.; signal: string (required); test: ProgramCondition (required); on: ProgramTreeNode[] (required); off: ProgramTreeNode[] (required); location: ProgramLocation (required)

packages/protocol/src/part-program.ts:293
PropertyValueTypetype · public
@openelement/protocol · ./part-program

The serialized value-type tag of a compiled property default.

PropertyValueType
packages/protocol/src/part-program.ts:373
RootModetype · public
@openelement/protocol · ./part-program

How the compiled component attaches its root: light DOM or a shadow root.

RootMode
packages/protocol/src/part-program.ts:40
SerializableValuetype · public
@openelement/protocol · ./part-program

The JSON-serializable value shape a compiled property default admits.

SerializableValue
packages/protocol/src/part-program.ts:50
STATIC_STYLES_MARKERconst · public
@openelement/protocol · ./part-program

The one `<style>` element the server serializer emits as the first DSD template child when the class carries static styles (renderToString parity — pages never upgrade, so their styles must ship in the payload). The claim path skips exactly this marked node; a marked node on a style-less class is claim drift and fails closed.

"data-oe-static-styles"
packages/protocol/src/part-program.ts:462
validatePartProgramfunction · public
@openelement/protocol · ./part-program

Validate an unknown value as a Part Program v2. The validator is intentionally strict: unknown instruction kinds, missing ownership records and unsafe paths fail before a runtime can guess at their meaning.

(raw: unknown): asserts raw is PartProgram
packages/protocol/src/part-program.ts:925
VOID_TAGSconst · public
@openelement/protocol · ./part-program

HTML void elements — the ONE canonical tag set for every serializer, validator, and compiler in the workspace (issue #1220, M4). This module is import-free and host-free by design: it sits at the base of the module graph so the DOM runtime (internal/core/html-escape.ts), the Part Program exchange artifact (internal/protocol/part-program.ts), and the compiler semantic core can all consume the same definition without an import cycle or a second source of truth. Content is the full HTML Standard void-element list, `param` included. Do not redefine this set anywhere else; internal/core/html-escape.ts and internal/protocol/part-program.ts re-export it, and __tests__/void-tags-convergence.test.ts enforces the single owner.

ReadonlySet<string>
packages/protocol/src/void-tags.ts:16
IDLE_FALLBACK_TIMEOUT_MSconst · public
@openelement/protocol · ./policy

Idle-hydration scheduling fallback (milliseconds) when neither `requestIdleCallback` nor `requestAnimationFrame` is available.

50
packages/protocol/src/policy.ts:70
MAX_ACTION_BODY_BYTESconst · public
@openelement/protocol · ./policy

Request-body bound (bytes) the generated entry applies to action POST routes; larger uploads belong on API routes with explicit limits.

number
packages/protocol/src/policy.ts:57
MAX_COMPOSITION_DEPTHconst · public
@openelement/protocol · ./policy

Nested element expansion depth bound for `renderToString`: cyclic component composition fails closed instead of recursing without end.

8
packages/protocol/src/policy.ts:51
STREAM_MAX_FIELDSconst · public
@openelement/protocol · ./policy

Deferred fields (declared streamed properties) one stream route's manifest may carry. The build scan, the server executor, and the browser seed contract enforce the same bound.

32
packages/protocol/src/policy.ts:24
STREAM_MAX_OWNERSconst · public
@openelement/protocol · ./policy

Part/Block owners one stream route's manifest may address in total across all deferred fields.

64
packages/protocol/src/policy.ts:30
STREAM_MAX_PAYLOAD_LENGTHconst · public
@openelement/protocol · ./policy

Serialized stream payload bound, as a string length in UTF-16 code units: one seed attribute or one deferred frame's markup may not exceed it. The server checks the JSON text and the rendered range before emitting; the browser checks the attribute before parsing.

number
packages/protocol/src/policy.ts:45
STREAM_MAX_SEED_PROPERTIESconst · public
@openelement/protocol · ./policy

Typed properties one streamed seed may carry: the browser seed contract rejects the WHOLE seed above this count, so an oversized component would silently fail to hydrate instead of failing loud at the server.

64
packages/protocol/src/policy.ts:37
STREAM_TIMEOUT_MSconst · public
@openelement/protocol · ./policy

Deferred-field resolution budget (milliseconds) for one streamed response: fields still pending when it expires are failed in place and the stream ends with the shell and whatever resolved.

30000
packages/protocol/src/policy.ts:64
ENTRY_REGISTRATION_OWNERSconst · public
@openelement/protocol · ./registry-markers

Property on the stub holding the generated entry's registration-ownership map (tag -> class it registered): a route module that self-registers its tag wins over the entry's registration, and on dev re-evaluation a fresh self-registered class must still win (#952).

"__openEntryDefined"
packages/protocol/src/registry-markers.ts:30
SSR_REGISTRY_ORIGINAL_DEFINEconst · public
@openelement/protocol · ./registry-markers

Property on the SSR registry holding the TRUE original `define` method, captured before the generated entry installs its idempotent wrapper. The registry outlives vite dev SSR module re-evaluations, so without this the second evaluation would capture the already-wrapped `define` as its "original" and every forced re-registration would silently early-return through the previous wrapper (#1339 lit dev feedback).

"__openElementOrigDefine"
packages/protocol/src/registry-markers.ts:40
SSR_REGISTRY_STUB_MARKERconst · public
@openelement/protocol · ./registry-markers

Marker property set to `true` on the SSR customElements stub. Readers must treat the marked registry as re-definable.

"__openElementSsrStub"
packages/protocol/src/registry-markers.ts:22
HydrationHintinterface · public
@openelement/protocol · ./render

The hydration delivery hint a component or route carries.

HydrationHint

tagName: string (required); layer: ComponentLayer (required); hydrate?: "load" | "idle" | "visible" | "only" | "none" (optional)

packages/protocol/src/render.ts:26
RenderErrorinterface · public
@openelement/protocol · ./render

One render failure record the SSR pipeline reports.

RenderError

code: string (required); severity: "error" | "warning" (required); phase: ErrorPhase (required); tagName: string (required); message: string (required); recoverable: boolean (required)

packages/protocol/src/render.ts:16
SsrAdmissionDecisioninterface · public
@openelement/protocol · ./render

The build's admission verdict for one discovered tag: where the declaration lives (`modulePath`), how it was discovered (`source`), which render path it is admitted to, and the reason recorded for the manifest.

SsrAdmissionDecision

tagName: string (required); modulePath: string (required) — Module path of the island declaration. Empty for 'foreign' decisions: a foreign tag is consumed in JSX but declares no module the build owns.; source: "local" | "package" | "nested" | "foreign" (required) — 'foreign' (#979): a third-party WC tag discovered by the foreign-tag scanner in page/island JSX — recorded for visibility only; SSR still treats it as an opaque passthrough (renderPath 'client-only').; renderPath: "ssr+client" | "client-only" | "rejected" (required); reason: string (required)

packages/protocol/src/render.ts:37
OpenElementRequestHandlertype · public
@openelement/protocol · ./runtime

The host-neutral request handler every runtime adapter and generated server entry exposes: a WinterCG `(request, context?) => Response` with no server engine dialect baked in.

OpenElementRequestHandler<Env>
packages/protocol/src/runtime.ts:27
RuntimeAdapterinterface · public
@openelement/protocol · ./runtime

A host runtime adapter: exposes the fetch handler a server engine dispatches to.

RuntimeAdapter<Env>

name: string (required); fetch: OpenElementRequestHandler<Env> (required); prerender?: (() => AsyncIterable<RuntimePrerenderResult> | Iterable<RuntimePrerenderResult>) (optional)

packages/protocol/src/runtime.ts:32
RuntimeAdapterOptionsinterface · public
@openelement/protocol · ./runtime

Options one runtime adapter is constructed with.

RuntimeAdapterOptions<Env>

name: string (required); fetch: OpenElementRequestHandler<Env> (required); prerender?: (() => AsyncIterable<RuntimePrerenderResult> | Iterable<RuntimePrerenderResult>) (optional)

packages/protocol/src/runtime.ts:39
RuntimeContextinterface · public
@openelement/protocol · ./runtime

runtime.ts - Runtime adapter protocol. Replacement boundary for Nitro, Workers, Node, Deno, or future fetch-compatible runtimes. Preserves openElement semantics while leaving concrete server engines outside this package.

RuntimeContext<Env>

env?: Env (optional); platform?: unknown (optional); params?: Record<string, string> (optional)

packages/protocol/src/runtime.ts:9
ReadonlySignalinterface · public
@openelement/protocol · ./signal

Read-only signal protocol used by computed values.

ReadonlySignal<T>

value: T (required); subscribe: (fn: (value: T) => void) => Unsubscribe (required); __@SIGNAL_BRAND@3014.valueOf: () => boolean (required) — Returns the primitive value of the specified object.

packages/protocol/src/signal.ts:26
Signaltype · public
@openelement/protocol · ./signal

Alias for APIs that accept either writable or read-only signals.

Signal<T>
packages/protocol/src/signal.ts:31
SIGNAL_BRANDconst · public
@openelement/protocol · ./signal

Runtime/type brand for signals created by the configured reactive engine.

typeof SIGNAL_BRAND
packages/protocol/src/signal.ts:11
SignalEngineinterface · public
@openelement/protocol · ./signal

Signal engine protocol used by the framework's built-in adapter. This is a deliberate internal seam, not a public compatibility contract: the framework layer talks to signals only through this narrow interface so its call sites stay implementation-agnostic. The package ships and verifies exactly one engine implementation (`preact-engine`, backed by `@preact/signals-core`). Preact's own API is not Element public API, and arbitrary third-party engines are not promised; any future engine would be added behind this protocol rather than inline (charter decision — see #723).

SignalEngine

signal: <T>(initialValue: T) => WritableSignal<T> (required); computed: <T>(fn: () => T) => ReadonlySignal<T> (required); effect: (fn: () => void | Unsubscribe) => Unsubscribe (required)

packages/protocol/src/signal.ts:46
SignalLikeinterface · public
@openelement/protocol · ./signal

Minimal signal-like object accepted by renderers and bindings.

SignalLike<T>

value: T (required); subscribe: (fn: (value: T) => void) => Unsubscribe (required); __@SIGNAL_BRAND@3014.valueOf: () => boolean (required) — Returns the primitive value of the specified object.

packages/protocol/src/signal.ts:14
Unsubscribetype · public
@openelement/protocol · ./signal

Unsubscribe function returned by subscriptions and effects.

Unsubscribe
packages/protocol/src/signal.ts:8
WritableSignalinterface · public
@openelement/protocol · ./signal

Writable signal protocol used by openElement integrations.

WritableSignal<T>

value: T (required); subscribe: (fn: (value: T) => void) => Unsubscribe (required); __@SIGNAL_BRAND@3014.valueOf: () => boolean (required) — Returns the primitive value of the specified object.

packages/protocol/src/signal.ts:21
ApiRouteDeclinterface · public
@openelement/protocol · ./ssg

One API route declaration in the generated entry descriptor.

ApiRouteDecl

kind: "api" (required); path: string (required); varName: string (required); filePath: string (required); importPath: string (required)

packages/protocol/src/ssg.ts:163
BuildArtifactsinterface · public
@openelement/protocol · ./ssg

Result returned by the OpenElement build pipeline.

BuildArtifacts

pages: BuildPageArtifact[] (required) — Generated HTML pages.; manifest: BuildManifestArtifact (required) — Build manifest.; clientAssets: BuildClientAsset[] (required) — Client-side assets (island bundles, CSS, etc).; warnings: string[] (required) — Non-fatal warnings.; errors: string[] (required) — Fatal errors.; success: boolean (required) — Whether the build succeeded.

packages/protocol/src/ssg.ts:527
BuildClientAssetinterface · public
@openelement/protocol · ./ssg

A single client asset emitted by the build pipeline.

BuildClientAsset

fileName: string (required); source: string | Uint8Array<ArrayBufferLike> (required); sizeBytes.toString: (radix?: number) => string (required) — Returns a string representation of an object.; sizeBytes.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; sizeBytes.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; sizeBytes.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; sizeBytes.valueOf: () => number (required) — Returns the primitive value of the specified object.; sizeBytes.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.

packages/protocol/src/ssg.ts:520
BuildI18nOptionsinterface · public
@openelement/protocol · ./ssg

i18n configuration for the build pipeline.

BuildI18nOptions

locales: string[] (required); defaultLocale?: string (optional)

packages/protocol/src/ssg.ts:473
BuildIslandInputinterface · public
@openelement/protocol · ./ssg

A single island input to the build pipeline.

BuildIslandInput

hydrate?: IslandDeliveryStrategy (optional); ssr?: boolean (optional); dsd?: boolean (optional); source?: "local" | "package" | "nested" (optional); reason?: string (optional); tagName: string (required); modulePath: string (required); isPackage?: boolean (optional)

packages/protocol/src/ssg.ts:454
BuildManifestArtifactinterface · public
@openelement/protocol · ./ssg

Manifest produced by the build pipeline.

BuildManifestArtifact

routes: { kind: "page" | "api"; path: string; tagName?: string; isDynamic: boolean; }[] (required); islands: BuildIslandInput[] (required); requestTimeRoutes?: string[] (optional) — Paths served at request time (renderIntent mode 'dynamic'). Absent for pure-static builds.

packages/protocol/src/ssg.ts:509
BuildOutputOptionsinterface · public
@openelement/protocol · ./ssg

Output configuration for the build pipeline.

BuildOutputOptions

root?: string (optional) — Project root directory.; outDir?: string (optional) — Output directory relative to root.; base?: string (optional) — Base URL path.

packages/protocol/src/ssg.ts:463
BuildPackageIslandOptionsinterface · public
@openelement/protocol · ./ssg

Package island configuration for the build pipeline.

BuildPackageIslandOptions

packages?: string[] (optional) — Package names that may expose island declarations.

packages/protocol/src/ssg.ts:479
BuildPageArtifactinterface · public
@openelement/protocol · ./ssg

A single generated HTML page artifact.

BuildPageArtifact

path: string (required); html: string (required); errors: { message: string; route?: string; }[] (required) — Errors collected while rendering this page.

packages/protocol/src/ssg.ts:501
BuildPlaninterface · public
@openelement/protocol · ./ssg

Framework-agnostic plan consumed by the OpenElement build pipeline.

BuildPlan

options.renderer?: "native" | "lit" (optional) — Page renderer selection (Beta.2.2, #1339). EXPLICIT, never inferred: 'native' (default) renders pages through the compiled Part Program serializer (renderToString); 'lit' renders LitElement pages through; options.routesDir?: string (optional) — Directory the route scanner walks, relative to the Vite root. Defaults to `app/routes`.; options.islandsDir?: string (optional) — Directory island modules are discovered in. Defaults to `app/islands`.; options.packageIslands?: string[] | "auto" | "manual" (optional) — How the build admits component packages whose modules the application imports. - omitted or `'auto'` (the default): the scan derives the admitted set at scan time — every package-owned element module the app's routes, pages, layouts, islands and components really reach (bundler-resolved) is attributed to its owner package (nearest `package.json`), and a package with a valid OpenElement manifest i…; options.layout?: LayoutConfig (optional) — Layout declaration; `false` disables the layout, `'default'` uses the built-in one.; options.layouts?: LayoutsConfig (optional) — Named layout declarations keyed by layout name.; options.headExtras?: string (optional) — @dangerous injected as-is, only use with controlled content; options.html?: { lang?: string; title?: string; } (optional) — Document `<html>` attributes: the `lang` the document declares and the default `<title>`.; options.inject?: { stylesheets?: Array<string | { href: string; integrity?: string; crossorigin?: "anonymous" | "use-credentials"; attrs?: Record<string, string | number | bool… (optional) — Document head/body injection channels: external stylesheets, scripts, and trusted raw head fragments.; options.ssr?: { noExternal?: (string | RegExp)[]; } (optional) — SSR bundling switches; `noExternal` forces the named packages through the SSR bundle instead of an external import.; options.island?: { upgradeStrategy?: HydrationStrategy; } (optional) — Island defaults applied to every island the build discovers.; options.build?: { outDir?: string; manifestBudget?: { islandKB?: number; totalJsKB?: number; pageKB?: number; }; } (optional) — Build output switches: the output directory and the advisory manifest budgets.; options.viewTransition?: boolean (optional) — Enable the View Transitions API for client navigations. Defaults to true.; options.speculation?: boolean | { prerender?: string[]; prefetch?: string[]; exclude?: string[]; eagerness?: "immediate" | "moderate" | "conservative"; } (optional) — Speculation Rules emission: `true` uses framework defaults, or pass prerender/prefetch URL lists, exclusions and an eagerness.; options.middleware?: { cors?: boolean; corsOrigin?: string | string[]; corsOriginModule?: string; requestId?: boolean; logger?: boolean; securityHeaders?: boolean; csp?: { policy?:… (optional) — Request-time middleware switches, composed outside the framework handler.; routes: BuildRouteInput[] (required) — Discovered page and API routes.; islands: BuildIslandInput[] (required) — Discovered local and package islands.; output.root?: string (optional) — Project root directory.; output.outDir?: string (optional) — Output directory relative to root.; output.base?: string (optional) — Base URL path.; i18n?: BuildI18nOptions (optional) — i18n expansion options.; packageIslands.packages?: string[] (optional) — Package names that may expose island declarations.

packages/protocol/src/ssg.ts:485
BuildRouteInputinterface · public
@openelement/protocol · ./ssg

A single route input to the build pipeline.

BuildRouteInput

kind: "api" | "page" (required) — Route kind: page or API.; path: string (required) — Route path (e.g. '/about', '/blog/:slug').; filePath: string (required) — Absolute or relative file path of the route module.; importPath: string (required) — Import specifier used by generated entry code.; tagName?: string (optional) — Resolved tag name for page routes.; paramNames?: string[] (optional) — Dynamic segment names.; staticParams?: Record<string, string>[] (optional) — Static generation params produced by getStaticPaths().

packages/protocol/src/ssg.ts:436
ClientIslandEntryinterface · public
@openelement/protocol · ./ssg

Client island entry shape passed to entry generator.

ClientIslandEntry

exportName?: string (optional) — Optional named export to register as the custom element constructor. When set (package islands whose chunk dropped `export default` per #638), the client island factory reads `mod[exportName]` instead of `mod.default`. When absent, the factory falls back to `mod.default` (local/route islands).; strategy: IslandDeliveryStrategy (required); strategySource?: "default" | "manifest" | "component" | "route" (optional); ssr?: boolean (optional); dsd?: boolean (optional); reason?: string (optional); tagName: string (required); modulePath: string (required); isPackage?: boolean (optional)

packages/protocol/src/ssg.ts:105
CorsOriginConfigtype · public
@openelement/protocol · ./ssg

The CORS origin policy an API route declares.

CorsOriginConfig
packages/protocol/src/ssg.ts:130
CspConfiginterface · public
@openelement/protocol · ./ssg

The content-security-policy directives a route or document declares.

CspConfig

policy?: string (optional); nonce?: boolean (optional); reportOnly?: boolean (optional)

packages/protocol/src/ssg.ts:133
DocumentConfiginterface · public
@openelement/protocol · ./ssg

The document-level facts a build bakes into the generated entry.

DocumentConfig

lang: string (required); title: string (required); headExtras: string (required); allowHeadExtrasScripts: boolean (required)

packages/protocol/src/ssg.ts:258
EntryDescriptorinterface · public
@openelement/protocol · ./ssg

The full build-time description of one generated entry: routes, islands, renderers, middleware, document, and layout plans.

EntryDescriptor

isSSG: boolean (required); renderer?: "native" | "lit" (optional) — Page renderer selection (#1339). Absent/'native' keeps the compiled renderToString page path byte-identical; 'lit' forks page tag resolution, page SSR and the client entry onto; imports: ImportDecl[] (required); middleware: MiddlewareDecl[] (required); fetchMiddleware?: string[] (optional) — `middleware.use` fetch middleware module paths (#858), in user-configured order. The entry renderer emits one `import * as __mw_N from '<path>'` per entry and composes each module's default export around the exported handler in onion order. Absent/empty when the app configures no fetch middleware, keeping the generated entry byte-identical to pre-#858 output.; apiRoutes: ApiRouteDecl[] (required); pageRoutes: PageRouteDecl[] (required); staticComponents: StaticComponentDecl[] (required); islands: IslandDecl[] (required); hasEnhancedForms?: boolean (optional) — True when any page route carries data-open-enhance forms (#569). Drives the dev island client script injection (#951): an island-free app with enhanced forms still needs the client entry in dev HTML.; ssrAdmissionPlan: SsrAdmissionPlan (required); cemClassifications?: CompatibilityClassification[] (optional); renderers: RendererDecl[] (required); middlewareScopes: MiddlewareScopeDecl[] (required); document: DocumentConfig (required); layout: LayoutPlan (required); upgradeStrategy?: "load" | "idle" | "visible" | "only" | "none" (optional); i18n?: { locales: string[]; defaultLocale: string; } (optional) — Declared project locales. Absent for a single-locale site: the generated entry then emits no locale prefixes and the default-locale fallback, which is byte-identical to pre-i18n output.

packages/protocol/src/ssg.ts:282
ImportDeclinterface · public
@openelement/protocol · ./ssg

One module import the generated entry emits.

ImportDecl

from: string (required); names: string[] (required); alias?: string (optional)

packages/protocol/src/ssg.ts:123
IslandDeclinterface · public
@openelement/protocol · ./ssg

One island the build admits: tag, module path, and delivery facts.

IslandDecl

exportName?: string (optional) — Optional named export to register as the custom element constructor. Set for package islands from the manifest declaration's `className` (the CEM-derived export class name), so the client island factory can read `mod[exportName]` after #638 removed `export default` from UI component chunks. Absent for local/route islands (which use default).; hydrate?: IslandDeliveryStrategy (optional); ssr?: boolean (optional); dsd?: boolean (optional); authoring?: "basic-element" | "third-party-wc" (optional); source?: "local" | "package" | "nested" (optional); reason?: string (optional); tagName: string (required); modulePath: string (required); isPackage?: boolean (optional)

packages/protocol/src/ssg.ts:195
IslandDeliveryStrategytype · public
@openelement/protocol · ./ssg

Adapter-owned browser delivery strategy, including media-query admission.

IslandDeliveryStrategy
packages/protocol/src/ssg.ts:31
IslandModuleIdentityinterface · public
@openelement/protocol · ./ssg

Shared island module identity (CL-3 convergence: one base, three shapes). Every island record names the same module the same way — the tag it registers as, the module path that owns it, and whether that module is a package (CEM-derived named export) rather than a local file (default export) — so a rename of the identity touches one declaration, not three. The delivery-strategy fields intentionally stay per-shape (`strategy` on the client entry vs `hydrate` on the build decls): they are different stages' vocabularies, not one field spelled two ways.

IslandModuleIdentity

tagName: string (required); modulePath: string (required); isPackage?: boolean (optional)

packages/protocol/src/ssg.ts:98
LayoutDeclinterface · public
@openelement/protocol · ./ssg

The layout module a build resolves: tag, import path, and serialized props.

LayoutDecl

tagName: string (required); importPath: string (required); props: Record<string, unknown> (required)

packages/protocol/src/ssg.ts:266
LayoutPlaninterface · public
@openelement/protocol · ./ssg

The resolved layouts a build ships: the default layout plus named layouts.

LayoutPlan

default: ResolvedLayout (required); layouts: Record<string, ResolvedLayout> (required)

packages/protocol/src/ssg.ts:276
MiddlewareDeclinterface · public
@openelement/protocol · ./ssg

One middleware module the generated entry composes.

MiddlewareDecl

kind: "requestId" | "logger" | "cors" | "securityHeaders" | "csp" (required); comment?: string (optional); config.corsOrigin?: CorsOriginConfig (optional); config.corsOriginModule?: string (optional) — Normalized import path of a module default-exporting `(origin: string) => string | undefined`. The generated entry imports the module and passes its default export to `cors({ origin })` — the callback is referenced, never serialized.; config.warnOnDefaultCors?: boolean (optional) — #1411: emit the default-CORS production advisory. Absent means "warn" (production builds); the dev server sets false so the first run is warning-free.; config.csp?: CspConfig (optional)

packages/protocol/src/ssg.ts:140
MiddlewareScopeDeclinterface · public
@openelement/protocol · ./ssg

The scope one middleware applies to (all routes or a named route set).

MiddlewareScopeDecl

varName: string (required); scope: string (required); importPath: string (required)

packages/protocol/src/ssg.ts:251
PageRouteDeclinterface · public
@openelement/protocol · ./ssg

One page route declaration in the generated entry descriptor.

PageRouteDecl

kind: "page" (required); path: string (required); varName: string (required); filePath: string (required); defaultTagName: string (required); tagName: string (required); importPath: string (required); isDynamic?: boolean (optional); paramNames?: string[] (optional); streamManifest?: StreamRouteManifest (optional); functionPage?: string (optional) — The server function page fact (alpha15 server lane): the exported server function component the route's `export default definePage(Component)` named — compiled into the module by the server component lane. No element class exists to register; both render channels render through the descriptor's render function (the compiled constructor) and feed the same renderer/layout/document wraps.

packages/protocol/src/ssg.ts:172
RendererDeclinterface · public
@openelement/protocol · ./ssg

One page renderer module registration.

RendererDecl

varName: string (required); scope: string (required); importPath: string (required); depth.toString: (radix?: number) => string (required) — Returns a string representation of an object.; depth.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; depth.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; depth.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; depth.valueOf: () => number (required) — Returns the primitive value of the specified object.; depth.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.

packages/protocol/src/ssg.ts:243
ResolvedLayouttype · public
@openelement/protocol · ./ssg

The resolved layout for one plan slot: disabled (false) or a full declaration.

ResolvedLayout
packages/protocol/src/ssg.ts:273
RouteInfoEntryinterface · public
@openelement/protocol · ./ssg

A single route metadata entry emitted as `routeInfo` by the generated SSG entry module (see entry-render-ssg.ts).

RouteInfoEntry

path: string (required); filePath?: string (optional) — Route module file path. Read by the render pipeline: ssg-render.ts copies it into server-manifest.json for request-time (renderIntent 'dynamic') routes.; tagName: string (required); module?: unknown (optional) — The route module namespace object (typed per-module at codegen time).; isDynamic: boolean (required); paramNames: string[] (required); rendering?: "static" | "dynamic" (optional) — Rendering mode declared via renderIntent.mode ("static" when unset; the "auto" alias is rejected, #609).; hasAction?: boolean (optional) — True when the route module exports an action (request-time form POST).; streamManifest?: StreamRouteManifest (optional); params?: Record<string, string> (optional)

packages/protocol/src/ssg.ts:357
SpeculationRulesOptionsinterface · public
@openelement/protocol · ./ssg

Speculation Rules configuration for SSG post-processing

SpeculationRulesOptions

prerender?: string[] (optional) — URL patterns to prerender (fully render in background before navigation).; prefetch?: string[] (optional) — URL patterns to prefetch (fetch HTML + resources without rendering).; exclude?: string[] (optional) — URL patterns to exclude from both prefetch and prerender.; eagerness?: "immediate" | "moderate" | "conservative" (optional) — Eagerness level for prerender rules.

packages/protocol/src/ssg.ts:410
SsgBehaviorOptionsinterface · public
@openelement/protocol · ./ssg

User-facing SSG build behavior switches (OpenElementOptions['ssg']).

SsgBehaviorOptions

dynamicRouteFailure?: "fail" | "warn" (optional) — Policy for dynamic-route render failures during SSG. See {@link SsgRenderOptions.dynamicRouteFailure}.

packages/protocol/src/ssg.ts:63
SsgPageOutputinterface · public
@openelement/protocol · ./ssg

Per-page render diagnostics returned by renderRoute()

SsgPageOutput

html: string (required) — Rendered HTML string; status.toString: (radix?: number) => string (required) — Returns a string representation of an object.; status.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; status.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; status.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; status.valueOf: () => number (required) — Returns the primitive value of the specified object.; status.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.; redirect?: { location: string; status: number; } (optional) — Redirect outcome (3xx). When set, `html` holds an interim status page and the result must not be persisted as a normal 200 page.; notFound?: boolean (optional) — True when the route signalled not-found (404).; errors: RenderError[] (required) — Render errors collected during rendering; componentCount: number (required) — Number of DSD components rendered on this page; renderTimeMs: number (required) — Total render time for all components on this page (ms)

packages/protocol/src/ssg.ts:330
SsgRenderEvidenceinterface · public
@openelement/protocol · ./ssg

The per-build render evidence record the SSG engine emits for audit.

SsgRenderEvidence

i18nOptions?: { [key: string]: unknown; locales: string[]; defaultLocale?: string; } | null (optional); admissionDecisions?: SsrAdmissionDecision[] (optional) — SSR admission decisions from the plan that rendered the pages.; manifestBudget.islandKB?: number (optional); manifestBudget.totalJsKB?: number (optional); manifestBudget.pageKB?: number (optional); onPrintBuildManifest?: ((input: { root: string; outDir: string; phase: 3; headExtras?: string; budget?: { islandKB?: number; totalJsKB?: number; pageKB?: number; }; }) => void | Prom… (optional)

packages/protocol/src/ssg.ts:388
SsgRenderOptionsinterface · public
@openelement/protocol · ./ssg

Options passed to the shared SSG render pipeline.

SsgRenderOptions

root: string (required); outDir: string (required); base?: string (optional); headExtras?: string (optional); html.lang?: string (optional); html.title?: string (optional); middleware.csp?: { policy?: string; reportOnly?: boolean; nonce?: boolean; } (optional); upgradeStrategy?: "load" | "idle" | "visible" | "only" | "none" (optional); viewTransition?: boolean (optional); speculation?: boolean | Record<string, unknown> (optional); islandTagNames?: string[] (optional); routesDir?: string (optional); dynamicRouteFailure?: "fail" | "warn" (optional) — Policy for dynamic-route render failures (HTTP status >= 500, non-empty render errors, or a renderRoute throw) during SSG. - 'fail' (default): abort the build - a failed page must never ship as a normal 200 page. - 'warn': log the failure and skip the page (the page is not written and is not registered in the ISR manifest).

packages/protocol/src/ssg.ts:36
SsgRenderSummaryinterface · public
@openelement/protocol · ./ssg

Summary of an SSG render run, returned by ssgRender().

SsgRenderSummary

staticNon200: { path: string; status: number; }[] (required) — Static routes whose handler returned a non-200 status. hono/ssg drops these responses (defaultPlugin), so they are not written to disk; they are listed here and in the build log instead of disappearing silently.; warnings: string[] (required) — Non-fatal warnings collected during the SSG run (sitemap generation failures, etc.). Surfaced here so the build summary / release evidence carries them instead of letting them disappear silently.

packages/protocol/src/ssg.ts:72
SsrAdmissionPlaninterface · public
@openelement/protocol · ./ssg

The build-time SSR admission decisions per component tag.

SsrAdmissionPlan

renderableTags: string[] (required); clientOnlyTags: string[] (required); rejectedTags: string[] (required); reasons: Record<string, string> (required); decisions: SsrAdmissionDecision[] (required); cemClassifications?: CompatibilityClassification[] (optional); foreignTags?: string[] (optional) — #979: foreign custom-element tags discovered in page / island JSX that are neither local islands, package-manifest islands, nor openElement-authored elements. Visibility only — each tag also carries a source:'foreign' decision (renderPath 'client-only') and the SSR/behavior is unchanged (opaque passthrough).

packages/protocol/src/ssg.ts:225
SsrBundleinterface · public
@openelement/protocol · ./ssg

The server bundle facts the SSG engine consumes for stream rendering.

SsrBundle
packages/protocol/src/ssg.ts:379
StaticComponentDeclinterface · public
@openelement/protocol · ./ssg

Build-host-only compiled component reached through a route's local import graph. These components participate in recursive SSR/SSG expansion but are not client islands and therefore add no hydration or browser entry.

StaticComponentDecl

tagName: string (required); modulePath: string (required); compilerInteractionEvents: string[] (required) — Compiler-owned interaction events; empty means no inferred browser entry.

packages/protocol/src/ssg.ts:217
StreamRouteManifestinterface · public
@openelement/protocol · ./ssg

Build-only route projection bound to a specific compiled page program.

StreamRouteManifest

program: { version: number; tag: string; sha256: string; } (required); fields: { field: string; signal: string; owners: Array<{ kind: "part" | "region"; index: number; location: string; source: PartProgramV2["sourceMap"]["records"][number… (required)

packages/protocol/src/ssg.ts:13
STREAM_FRAME_FORBIDDEN_TAGSconst · public
@openelement/protocol · ./stream-frame-policy

Tags a deferred frame cannot safely install into an owned Part range: the browser installer rejects any frame whose markup carries one of these.

readonly ["script", "style", "template", "iframe", "object", "embed", "base", "meta", "link"]
packages/protocol/src/stream-frame-policy.ts:26
STREAM_FRAME_UNSAFE_URLconst · public
@openelement/protocol · ./stream-frame-policy

Schemes that make a URL attribute unsafe in a streamed frame.

RegExp
packages/protocol/src/stream-frame-policy.ts:60
STREAM_FRAME_URL_ATTRIBUTESconst · public
@openelement/protocol · ./stream-frame-policy

URL-carrying attributes the frame check screens for script-bearing scheme obfuscation; only these attribute names are value-screened.

readonly ["href", "src", "action", "formaction", "xlink:href"]
packages/protocol/src/stream-frame-policy.ts:42
STREAM_FRAME_URL_CONTROL_MAXconst · public
@openelement/protocol · ./stream-frame-policy

Control characters at or below this code point are stripped before the URL-scheme test, so tab/newline/control obfuscation cannot smuggle a scheme past admission.

32
packages/protocol/src/stream-frame-policy.ts:55
unsafeStreamFrameAttributefunction · public
@openelement/protocol · ./stream-frame-policy

Whether a static attribute (name/value as authored into the Part Program) makes a streamed frame unsafely installable: event-handler, seed-spoofing, and srcdoc names fail outright, and URL-carrying names fail when the entity-decoded, control-stripped value carries a script scheme.

(name: string, value: string): boolean
packages/protocol/src/stream-frame-policy.ts:113
STYLE_SHEET_LIVEconst · public
@openelement/protocol · ./style-sheet

The one key marking a sheet whose bytes are a LIVE resource rather than an immutable one (alpha15 S lane, S-C1.3). The dev server serves an authored sheet from a mutable endpoint that hot-updates: the sheet object is the copy the live resource re-fills through `replace()`, so every root that adopted it re-renders on an edit. A root whose serialized markup declares the same URL therefore still ADOPTS this sheet — the declarative `<link>` stays the first-paint / no-JavaScript delivery, and the adopted object is the one an edit reaches. Without that, a CSS-only edit could only be delivered by re-fetching the link, which is a DOM write this protocol does not perform. Production sheets never carry this key: their URL is content-addressed, so the link and the sheet can never disagree and one delivery is the whole story. Build-time and runtime cannot drift because the dev adapter generator interpolates this exact name.

"__openElementStyleSheetLive"
packages/protocol/src/style-sheet.ts:64
STYLE_SHEET_READYconst · public
@openelement/protocol · ./style-sheet

The one key under which a sheet carries its readiness promise: the generated client style adapter records it on the sheet it exports, and the element runtime reads the same key to hand styles to roots that are already connected. Build-time and runtime cannot drift because the adapter generator interpolates this exact name. The promise settles once. Fulfillment means the rules were installed through `replace()`; rejection carries the load or replacement failure and keeps its rejected state — an observer may attach its own catch, it must never convert the promise into a fulfilled one.

"__openElementStyleReady"
packages/protocol/src/style-sheet.ts:31
STYLE_SHEET_URLconst · public
@openelement/protocol · ./style-sheet

The one key under which a sheet carries the URL of the external CSS resource that delivers its rules: the generated client style adapter records the emitted asset URL on the sheet it exports, and the element runtime compares it against the declarative `<link rel="stylesheet" data-oe-static-styles>` nodes an SSR/DSD template already carries (alpha15 S lane). A root whose serialized markup already references the sheet's URL keeps that link as the delivery and does NOT adopt a second constructable copy — one stylesheet resource, one delivery, no duplicate application. Build-time and runtime cannot drift because the adapter generator interpolates this exact name.

"__openElementStyleSheetUrl"
packages/protocol/src/style-sheet.ts:44
StyleSheetLikeinterface · public
@openelement/protocol · ./style-sheet

Minimal stylesheet contract (replaceSync + cssRules) satisfied by native and shim sheets.

StyleSheetLike

replaceSync: (text: string) => void (required); cssRules: StyleSheetRule[] (required)

packages/protocol/src/style-sheet.ts:14
StyleSheetRuleinterface · public
@openelement/protocol · ./style-sheet

Cross-environment CSSStyleSheet abstraction. In browsers this delegates to the native CSSStyleSheet API. In SSR runtimes it falls back to a minimal in-memory implementation that exposes the subset used by OpenElement and renderToString().

StyleSheetRule

cssText: string (required)

packages/protocol/src/style-sheet.ts:9
VOID_TAGSconst · public
@openelement/protocol · ./void-tags

HTML void elements — the ONE canonical tag set for every serializer, validator, and compiler in the workspace (issue #1220, M4). This module is import-free and host-free by design: it sits at the base of the module graph so the DOM runtime (internal/core/html-escape.ts), the Part Program exchange artifact (internal/protocol/part-program.ts), and the compiler semantic core can all consume the same definition without an import cycle or a second source of truth. Content is the full HTML Standard void-element list, `param` included. Do not redefine this set anywhere else; internal/core/html-escape.ts and internal/protocol/part-program.ts re-export it, and __tests__/void-tags-convergence.test.ts enforces the single owner.

ReadonlySet<string>
packages/protocol/src/void-tags.ts:16

@openelement/element

430 exports
__setRequestTimeStyleSheetUrlsfunction · public
@openelement/element · root

Set the emitted component stylesheet URLs for this server process. Called by the router's generated SSR/SSG entry (build time and request-time startup) with the base-joined asset addresses Phase 2 emitted.

(urls: readonly string[] | null | undefined): void
packages/element/src/internal/compiled/server/style-links.ts:29
Actiontype · public
@openelement/element · root

Route action: handles form submissions for a page route.

Action<T, Env, Platform, Route>
packages/protocol/src/data.ts:64
ACTION_FETCH_HEADERconst · public
@openelement/element · root

Request header selecting the action response channel: `true` marks a programmatic caller and selects the serialized ActionResult union; `enhance` marks the built-in morph enhancement and selects the same full-HTML responses the no-JS path receives.

"x-openelement-action"
packages/protocol/src/data.ts:125
ActionContextinterface · public
@openelement/element · root

Context passed to a route action function (extends loader context).

ActionContext<Env, Platform, Route>

formData: FormData (required); request: Request (required); params: Record<string, string> (required); env: Env (required); platform: Platform (required); responseHeaders: Headers (required) — Mutable response-only channel merged into the framework response.; route: Route (required)

packages/protocol/src/data.ts:47
ActionResulttype · public
@openelement/element · root

Wire shape returned to the JavaScript form-enhancement path. The no-JS path never sees this: it gets the equivalent semantics as plain HTTP (303 on success, 422 with the re-rendered form on validation failure, redirect/error as status codes). Success carries no data envelope. The application-loop contract makes a successful non-GET action answer 303 (PRG) — the framework never answers 200 with a rendered page, or with a success document, for a successful mutation — so the fetch channel answers `{ type: 'redirect' }` naming the PRG target and the authored return value is discarded by design. Success data travels the PRG target instead (query state the loader re-runs with, which the props projector then maps; see the router guide's "Form actions" section). The union previously declared a `{ type: 'success' }` member that no code path ever emitted — removed so the type matches the wire. Error outcomes (CSRF 403, unknown action 404, unparseable body 400, unexpected 500) are NOT part of this union: since #863 they answer RFC 9457 Problem Details with the PROBLEM_JSON_MEDIA_TYPE content type — see ProblemDetails.

ActionResult<Failure>
packages/protocol/src/data.ts:92
assertValidTagNamefunction · public
@openelement/element · root

Assert that a tag name is a valid custom element name.

(tagName: string): void
packages/element/src/internal/core/tag-utils.ts:50
collectPublicPropsfunction · public
@openelement/element · root

Collect all public (non-internal) own properties from a host object. Keys starting with `__openElement` are framework-internal and excluded. Uses Reflect.get for safe access (respects getters); a getter that throws is skipped with a warning so one bad prop cannot take the tree down.

(host: object): Record<string, unknown>
packages/element/src/internal/core/props-utils.ts:41
CompatibilityClassificationinterface · public
@openelement/element · root

The per-tag verdict the compatibility scanner records: the tier a discovered tag was classified as, the human-readable `reason`, where the tag was found (`source`), and the SSR/DSD/hydration facts the verdict was derived from.

CompatibilityClassification

tagName: string (required); tier: CompatibilityTier (required); reason: string (required); source: "local" | "package" | "nested" (required); modulePath?: string (optional); ssr?: boolean (optional); dsd?: boolean (optional); hydrate?: string (optional)

packages/protocol/src/framework.ts:352
CompatibilityTiertype · public
@openelement/element · root

How far a discovered tag may participate in the build: 'ssr-capable' renders and hydrates, 'client-only' ships to the browser without server output, 'experimental-dom' is admitted with a downgraded guarantee, and 'rejected' fails the build.

CompatibilityTier
packages/protocol/src/framework.ts:345
ComponentLayertype · public
@openelement/element · root

The delivery layer a component belongs to: fully static DSD markup ('dsd-static'), DSD markup with a client island ('dsd-interactive'), a client-only island with no SSR output ('pure-island'), or a light-DOM element ('light-dom'). Recorded per component in the build manifest and consumed by the hydration scheduler.

ComponentLayer
packages/protocol/src/framework.ts:23
computedfunction · public
@openelement/element · root

Create a derived read-only signal recomputed from its dependencies.

<T>(fn: () => T): ReadonlySignal<T>
packages/element/src/internal/signal/framework.ts:23
consumeContextfunction · public
@openelement/element · root

Consumer-local reactive projection of a protocol context value.

<T>(context: Context<T>, host?: HTMLElement): WritableSignal<T>

key.toString: () => string (required) — Returns a string representation of an object.; key.valueOf: () => symbol (required) — Returns the primitive value of the specified object.; key.description: string (required) — Expose the [[Description]] internal slot of a symbol directly.; key.__@toPrimitive@4114: (hint: string) => symbol (required) — Converts a Symbol object to a symbol.; key.__@toStringTag@4116: string (required); defaultValue: T (required)

packages/element/src/internal/core/signal-context.ts:141
Contextinterface · public
@openelement/element · root

A typed context token: protocol identity (`key`) plus its default value.

Context<T>

key.toString: () => string (required) — Returns a string representation of an object.; key.valueOf: () => symbol (required) — Returns the primitive value of the specified object.; key.description: string (required) — Expose the [[Description]] internal slot of a symbol directly.; key.__@toPrimitive@4114: (hint: string) => symbol (required) — Converts a Symbol object to a symbol.; key.__@toStringTag@4116: string (required); defaultValue: T (required)

packages/element/src/internal/core/signal-context.ts:13
createContextfunction · public
@openelement/element · root

Create a typed context token shared between provider and consumer elements.

<T>(key: symbol, defaultValue: T): Context<T>

toString: () => string (required) — Returns a string representation of an object.; valueOf: () => symbol (required) — Returns the primitive value of the specified object.; description: string (required) — Expose the [[Description]] internal slot of a symbol directly.; __@toPrimitive@4114: (hint: string) => symbol (required) — Converts a Symbol object to a symbol.; __@toStringTag@4116: string (required)

packages/element/src/internal/core/signal-context.ts:58
createDocumentStyleResourcesfunction · public
@openelement/element · root

Create the per-render document stylesheet collection.

(): DocumentStyleResources
packages/element/src/internal/core/html-escape.ts:133
createLoggerfunction · public
@openelement/element · root

Create a {@link Logger} that prefixes every message with `[tag]`.

(tag: string): Logger
packages/element/src/internal/core/logger.ts:18
createStreamShellExecutorfunction · public
@openelement/element · root

Create one request-local stream shell from a generated route manifest. The manifest hash is checked against the exact runtime wire program before any shell can be produced.

(options: CreateStreamShellOptions): Promise<StreamShellExecutor>

componentClass: CustomElementConstructor (required); props?: Record<string, unknown> (optional); manifest: StreamShellManifest (required); instanceId: string (required); documentToken?: string (optional); documentStyles?: DocumentStyleSink (optional) — The streamed document's stylesheet collection (see RenderToStringOptions).

packages/element/src/public-runtime.ts:516
CreateStreamShellOptionsinterface · public
@openelement/element · root

Inputs for a request-scoped stream shell executor.

CreateStreamShellOptions

componentClass: CustomElementConstructor (required); props?: Record<string, unknown> (optional); manifest: StreamShellManifest (required); instanceId: string (required); documentToken?: string (optional); documentStyles?: DocumentStyleSink (optional) — The streamed document's stylesheet collection (see RenderToStringOptions).

packages/element/src/public-runtime.ts:441
DANGEROUS_KEYSconst · public
@openelement/element · root

Object prototype keys that must never be injected from untrusted props.

ReadonlySet<string>
packages/element/src/internal/core/security.ts:25
deepGetElementByIdfunction · public
@openelement/element · root

Resolve `id` (a `#hash` or bare id) against `root` and, when the id is not in that root's own tree, recurse into every nested shadow root. Returns the first match or `null`; a malformed percent-encoded id is not an error.

(id: string, root?: Document | ShadowRoot): HTMLElement | null
packages/element/src/internal/core/deep-fragment.ts:20
documentStreamPartsfunction · public
@openelement/element · root

The same document serialization boundary, with only body wrappers left open.

(options?: DocumentWrapOptions): { prefix: string; suffix: string; }

title?: string (optional); lang?: string (optional); clientScript?: string (optional); scripts?: DocumentScriptDescriptor[] (optional); meta.description?: string (optional); meta.tags?: Record<string, string | number | boolean>[] (optional); devScripts?: string (optional); headExtras?: string (optional); dangerouslyHeadFragments?: string[] (optional); allowHeadExtrasScripts?: boolean (optional); links?: { rel: string; href: string; hreflang?: string; }[] (optional); structuredData?: readonly Record<string, unknown>[] (optional); cspNonce?: string (optional); streamBootstrap?: string (optional) — Trusted framework bootstrap emitted synchronously in the document head.; styleLinks?: readonly string[] (optional) — The document's light-root component stylesheets: external resource URLs (alpha15 S lane, S-C1.2) serialized as marked `<link rel="stylesheet">` nodes after `headExtras`, so a light component is styled by the document that contains it — without JavaScript and without a runtime style node.

packages/element/src/internal/core/html-escape.ts:205
DocumentStyleResourcesinterface · public
@openelement/element · root

The document-level stylesheet resources ONE server render discovered (alpha15 S lane, S-C1.2). A light-root component's DOM lives in the document, so its sheet cannot ride the component's own subtree the way a shadow template's link does: the document owns it. This object is the one carrier between the two halves of that render — the compiled serializer, which discovers a component's external sheets while serializing the component, and the document serializer, which writes the head. It is created per render and never shared, so one page's stylesheets can never reach another page's head.

DocumentStyleResources

links: readonly string[] (required) — Discovered resource URLs, deduplicated, in discovery (cascade) order.; add: (urls: readonly string[]) => void (required) — Record the external stylesheet URLs one rendered component contributes.

packages/element/src/internal/core/html-escape.ts:125
effectfunction · public
@openelement/element · root

Run a side effect that re-subscribes whenever its signal dependencies change.

(fn: () => void | Unsubscribe): Unsubscribe
packages/element/src/internal/signal/framework.ts:27
elementfunction · public
@openelement/element · root

Compiler-recognized element decorator; inert no-op at runtime.

(_tag: string, _options?: { root?: "light" | "shadow-open" | "shadow-closed"; delegatesFocus?: boolean; formAssociated?: boolean; }): (target: unknown, context?: unknown) => void
packages/element/src/internal/core/compile-decorators.ts:20
ensureDeepFragmentNavigationfunction · public
@openelement/element · root

Install (once per document) framework-level fragment navigation: a same-document anchor click whose target lives inside a nested shadow root scrolls to it and pushes the hash instead of being dropped by the browser. `{ enabled: false }` opts an application out.

(options?: DeepFragmentOptions): void

enabled?: boolean (optional) — Set false before installation to opt out for an application.

packages/element/src/internal/core/deep-fragment.ts:67
ensurePreHydrationClickCapturefunction · public
@openelement/element · root

Install the bounded pre-upgrade interaction capture on an owning root (default: the document). Generated client entries call this with their declared island tags before any compiled element upgrades; after a successful claim the element replays the captured events whose targets live inside its root (compiled claim capture/replay, internal/compiled/runtime.ts). Idempotent per root (repeat calls merge tags, never reinstall listeners) and a no-op where no DOM exists (SSR). Invariant: the capture itself — one fixed listener set per owning root, installed once per page — is page-lifetime by design and is NOT the leak. The M1 leak was retained event-target records; each element releases exactly its own records at its activation decision (success or failure), while records owned by still-pending elements survive for their delayed/lazy upgrade (#1170). Boundedness: the facade capture passes the declared-island filter, so only interactions under a still-pending DECLARED island tag enter the queue — ordinary events and undeclared third-party custom elements are skipped (nested pending declared islands still capture through their own unsettled host). With no tags declared the legacy dash heuristic applies. The shared queue carries a hard capacity cap (fail closed), detached records are swept when a claim root adopts its share (and under queue pressure), and each activation decision deterministically empties that root's own bucket, so post-hydration traffic and removals never grow retention.

(root?: EventTarget, pendingTags?: readonly string[]): void

addEventListener: (type: string, callback: EventListenerOrEventListenerObject | null, options?: AddEventListenerOptions | boolean) => void (required) — The **`addEventListener()`** method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target. [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener); dispatchEvent: (event: Event) => boolean (required) — The **`dispatchEvent()`** method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order. The normal event processing rules (including the capturing and optional bubbling phase) also apply to events dispatched manually with dispatchEvent(). [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent); removeEventListener: (type: string, callback: EventListenerOrEventListenerObject | null, options?: EventListenerOptions | boolean) => void (required) — The **`removeEventListener()`** method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target. The event listener to be removed is identified using a combination of the event type, the event listener function itself, and various optional options that may affect the matching process; see Matching event listeners for removal.…

packages/element/src/internal/compiled/runtime/pre-upgrade-events.ts:672
ERROR_PREFIXconst · public
@openelement/element · root

Error message prefix for all openElement errors.

"[openElement]"
packages/protocol/src/errors.ts:50
ErrorBoundaryclass · public
@openelement/element · root

Base class for elements that catch descendant render/hydration errors and apply a retry policy.

class ErrorBoundary extends OpenElement
packages/element/src/error-boundary.ts:45
ErrorTelemetryHooktype · public
@openelement/element · root

Callback receiving every reported {@linkcode OpenElementError} for telemetry.

ErrorTelemetryHook
packages/protocol/src/errors.ts:132
escapeAttrfunction · public
@openelement/element · root

Escape an HTML attribute value. Delegates to `escapeHtml` so both share the single `ESCAPE_MAP` and the same single-pass replacement (consolidated in #633). Empty-value conventions remain intentionally distinct by design: - `escapeHtml` returns '' for non-string input. - `escapeAttrValue` (below) coerces via `String()` and is the boundary meant for unknown/variable attribute values.

(value: string): string
packages/element/src/internal/core/html-escape.ts:55
escapeHtmlfunction · public
@openelement/element · root

Escape the five HTML-significant characters in text content.

(str: string): string
packages/element/src/internal/core/html-escape.ts:39
formatErrorfunction · public
@openelement/element · root

Format an unknown thrown value as a human-readable string.

(e: unknown): string
packages/element/src/internal/core/errors.ts:52
FrameworkOptionsinterface · public
@openelement/element · root

The adapter-facing framework options: where routes and islands live, which renderer serializes pages, the default layout and named-layout declarations, the document `<html>`/head injection channels, and the request-time middleware switches. Every field is optional; the adapter applies its documented default. This is the type an application config file's default export is checked against, so the rendered option table and the actual config surface cannot drift.

FrameworkOptions

renderer?: "native" | "lit" (optional) — Page renderer selection (Beta.2.2, #1339). EXPLICIT, never inferred: 'native' (default) renders pages through the compiled Part Program serializer (renderToString); 'lit' renders LitElement pages through; routesDir?: string (optional) — Directory the route scanner walks, relative to the Vite root. Defaults to `app/routes`.; islandsDir?: string (optional) — Directory island modules are discovered in. Defaults to `app/islands`.; packageIslands?: string[] | "auto" | "manual" (optional) — How the build admits component packages whose modules the application imports. - omitted or `'auto'` (the default): the scan derives the admitted set at scan time — every package-owned element module the app's routes, pages, layouts, islands and components really reach (bundler-resolved) is attributed to its owner package (nearest `package.json`), and a package with a valid OpenElement manifest i…; layout?: LayoutConfig (optional) — Layout declaration; `false` disables the layout, `'default'` uses the built-in one.; layouts?: LayoutsConfig (optional) — Named layout declarations keyed by layout name.; headExtras?: string (optional) — @dangerous injected as-is, only use with controlled content; html.lang?: string (optional); html.title?: string (optional); inject.stylesheets?: (string | { href: string; integrity?: string; crossorigin?: "anonymous" | "use-credentials"; attrs?: Record<string, string | number | boolean>; })[] (optional) — Stylesheets linked into the document head; each entry is an href or a link record with integrity/crossorigin/attrs.; inject.scripts?: (string | { src: string; type?: string; async?: boolean; defer?: boolean; integrity?: string; crossorigin?: "anonymous" | "use-credentials"; attrs?: Record<str… (optional) — Scripts emitted into the document; each entry is a src or a script record with type/async/defer/integrity/crossorigin/attrs.; inject.headFragments?: string[] (optional) — @dangerous fragments injected as-is. Trust boundary (same level as `trustedHtml`): never concatenate user-controlled content into these fragments; sanitize untrusted data at your own system boundary first. The framework only enforces no-`<script>` and no-executable-`<style>`.; ssr.noExternal?: (string | RegExp)[] (optional); island.upgradeStrategy?: "load" | "idle" | "visible" | "only" | "none" (optional); build.outDir?: string (optional) — Output directory for the build artifacts. Defaults to `dist`.; build.manifestBudget?: { islandKB?: number; totalJsKB?: number; pageKB?: number; } (optional) — Advisory only: exceeded budgets print build-manifest warnings and never fail the build; enforce them in your own build-output test.; viewTransition?: boolean (optional) — Enable the View Transitions API for client navigations. Defaults to true.; speculation?: boolean | { prerender?: string[]; prefetch?: string[]; exclude?: string[]; eagerness?: "immediate" | "moderate" | "conservative"; } (optional) — Speculation Rules emission: `true` uses framework defaults, or pass prerender/prefetch URL lists, exclusions and an eagerness.; middleware.cors?: boolean (optional) — Built-in CORS middleware. Default-ON; pass `false` to disable.; middleware.corsOrigin?: string | string[] (optional) — Static CORS allowlist data, serialized into the generated entry as JSON. Mutually exclusive with {@link FrameworkOptions.middleware.corsOriginModule }.; middleware.corsOriginModule?: string (optional) — Path to a module that default-exports `(origin: string) => string | undefined`. The generated entry imports the module — the callback is never serialized — so it may close over module scope and import dependencies. Resolved with the same idiom as `layout.import` (e.g. './app/cors-origin.ts'). Mutually exclusive with `corsOrigin`.; middleware.requestId?: boolean (optional) — Emit and honor a per-request id header. Default-ON; pass `false` to disable.; middleware.logger?: boolean (optional) — Log each request through the built-in logger. Default-ON; pass `false` to disable.; middleware.securityHeaders?: boolean (optional) — Attach the built-in security response headers. Default-ON; pass `false` to disable.; middleware.csp?: { policy?: string; nonce?: boolean; reportOnly?: boolean; } (optional) — Content-Security-Policy emission: the policy string, nonce generation, and report-only mode.; middleware.use?: string[] (optional) — Fetch middleware chain (#858), composed around the framework handler in onion order (`use[0]` outermost), outside all built-in middleware above. Each entry is a MODULE PATH (same resolution idiom as `layout.import`, e.g. './app/middleware/auth.ts') whose default export is a {@link Middleware}; the generated entry emits `import * as __mw_N from '<path>'` and composes `__mw_N.default` in configured…

packages/protocol/src/framework.ts:181
HYDRATION_STRATEGIESconst · public
@openelement/element · root

Runtime list of supported hydration strategies; the single source of truth for the `HydrationStrategy` union. Consumed by island/registry validation and re-exported from the element root for app and build adapters.

readonly ["load", "idle", "visible", "only", "none"]
packages/protocol/src/framework.ts:28
HydrationStrategytype · public
@openelement/element · root

Island hydration trigger: 'load' | 'idle' | 'visible' | 'only'.

"load" | "idle" | "visible" | "only" | "none"
packages/protocol/src/framework.ts:30
IDLE_FALLBACK_TIMEOUT_MSconst · public
@openelement/element · root

Idle-hydration scheduling fallback (milliseconds) when neither `requestIdleCallback` nor `requestAnimationFrame` is available.

50
packages/protocol/src/policy.ts:70
injectPropsSafefunction · public
@openelement/element · root

Safely assign caller-supplied props onto a target object, skipping keys that could enable prototype pollution and tolerating read-only properties. The canonical guarded assigner for the canonical dangerous-key rule (#903, #1214): the

(target: Record<string, unknown>, props: Record<string, unknown>, tagName: string, log?: { warn(message: string): void; debug(message: string): void; }): void
packages/element/src/internal/core/security.ts:119
isDangerousKeyfunction · public
@openelement/element · root

Shared dangerous-key predicate (#903, #1214). Prototype-internal keys must never be injected from untrusted props on ANY path: host prop collection (collectPublicProps / normalizePublicProps in props-utils.ts), guarded assignment (injectPropsSafe below — the SPA bootstrap page-projection write boundary in

(key: string): boolean
packages/element/src/internal/core/security.ts:51
IslandOptionsinterface · public
@openelement/element · root

Per-island delivery options (hydration strategy, SSR/DSD participation).

IslandOptions

hydrate?: "load" | "idle" | "visible" | "only" | "none" (optional) — Hydration strategy: - 'load': load immediately when module is imported - 'idle': defer to requestIdleCallback (default) - 'visible': use IntersectionObserver to defer until element is visible - 'only': client-only render, no DSD/SSR output Named `hydrate` to match `defineIslandConfig()` in the Router package — one option name across both packages.; dsd?: boolean (optional) — Whether to use DSD for SSR rendering of this island. Honored by the build-side island scan (via `defineIslandConfig`), not by `defineIsland()` itself: passing it in `IslandOptions` has no runtime effect.; ssr?: boolean (optional) — Whether this island may be admitted into server rendering. Like `dsd`, decided by the build-side island scan; inert when passed to `defineIsland()`.

packages/protocol/src/island.ts:8
isSafeAttributeNamefunction · public
@openelement/element · root

Shared safe-attribute-name predicate (#1033): the SSR face of the one canonical predicate in `../protocol/forbidden-sinks.ts`. A name must be valid HTML attribute-name grammar (blocks quote/space injection, #602), must not be an event handler (`on*`, case-insensitive), and must not be a forbidden sink (`innerhtml`/`srcdoc`). The compiler, protocol validator, and server serializer enforce the same predicate with their own failure strategies; every path delegates to the single implementation, so the boundary cannot diverge.

(name: string): boolean
packages/element/src/internal/core/security.ts:65
isValidTagNamefunction · public
@openelement/element · root

Check if a tag name is a valid custom element name per HTML spec.

(tagName: string): boolean
packages/element/src/internal/core/tag-utils.ts:38
LayoutConfigtype · public
@openelement/element · root

Layout declaration: `false` disables the layout entirely, `'default'` uses the built-in layout, and the object form names a tag with the module path that defines it (`import`, resolved like a {@link FrameworkOptions.middleware.use } entry) plus the compiled layout properties the router injects per route.

LayoutConfig
packages/protocol/src/framework.ts:96
Loadertype · public
@openelement/element · root

Route loader: fetches data for a page route.

Loader<T, Env, Platform, Route>
packages/protocol/src/data.ts:56
LoaderContextinterface · public
@openelement/element · root

Context passed to a request-time ('dynamic') route loader.

LoaderContext<Env, Platform, Route>

request: Request (required); params: Record<string, string> (required); env: Env (required); platform: Platform (required); responseHeaders: Headers (required) — Mutable response-only channel merged into the framework response.; route: Route (required)

packages/protocol/src/data.ts:40
LocalePathinterface · public
@openelement/element · root

Locale-aware resolved path contract.

LocalePath

locale: string (required); path: string (required); localizedPath: string (required); isDefaultLocalePath: boolean (required)

packages/protocol/src/framework.ts:82
Loggerinterface · public
@openelement/element · root

logger.ts - Tagged console logger. Lightweight scoped logger. Returns plain functions so it is tree-shakable and has zero class overhead.

Logger

debug: (msg: string, ...args: unknown[]) => void (required); info: (msg: string, ...args: unknown[]) => void (required); warn: (msg: string, ...args: unknown[]) => void (required); error: (msg: string, ...args: unknown[]) => void (required)

packages/element/src/internal/core/logger.ts:10
MAX_ACTION_BODY_BYTESconst · public
@openelement/element · root

Request-body bound (bytes) the generated entry applies to action POST routes; larger uploads belong on API routes with explicit limits.

number
packages/protocol/src/policy.ts:57
MAX_COMPOSITION_DEPTHconst · public
@openelement/element · root

Nested element expansion depth bound for `renderToString`: cyclic component composition fails closed instead of recursing without end.

8
packages/protocol/src/policy.ts:51
Middlewaretype · public
@openelement/element · root

Fetch middleware contract (#858): WinterCG shape, dialect-free — no Hono/h3 context object. Composed at the handler boundary in onion order (`use[0]` is outermost: it sees the request first and the response last), so it runs with identical semantics in the dev server, the `start` CLI, the e2e fixture server, and the Nitro production entry. A middleware may short-circuit by returning a Response without calling `next()`, or post-process the Response that `next()` returns. Module contract: a Middleware is the DEFAULT EXPORT of a module referenced from `middleware.use` by path (e.g. './app/middleware/auth.ts'). The generated server entry imports the module, so the middleware may close over module scope and import local helpers and third-party packages — it is a real module in the server module graph, never serialized source.

Middleware
packages/protocol/src/framework.ts:169
OpenElementclass · public
@openelement/element · root

Custom Element base class for the compiled Part Program architecture. Subclasses are produced by the compiler; hand-written subclasses that never pass through the compiler fail closed at connect time.

class OpenElement extends OpenElementConfiguration
packages/element/src/open-element-implementation.ts:104
OpenElementAttributeinterface · public
@openelement/element · root

One documented attribute of a custom element declaration.

OpenElementAttribute

name: string (required); type?: string (optional); default?: string (optional); description?: string (optional); reflects?: boolean (optional); fieldName?: string (optional)

packages/protocol/src/manifest.ts:15
OpenElementCssPartinterface · public
@openelement/element · root

One documented CSS part of a custom element declaration.

OpenElementCssPart

name: string (required); description?: string (optional)

packages/protocol/src/manifest.ts:38
OpenElementDeclarationinterface · public
@openelement/element · root

One custom element declaration in a package manifest: tag, members and delivery metadata.

OpenElementDeclaration

tagName: string (required); className?: string (optional); superclassName?: string (optional); attributes?: OpenElementAttribute[] (optional); events?: OpenElementEvent[] (optional); slots?: OpenElementSlot[] (optional); cssParts?: OpenElementCssPart[] (optional); openElement.ssr?: boolean (optional); openElement.dsd?: boolean (optional); openElement.layer?: ComponentLayer (optional); openElement.hydrate?: "load" | "idle" | "visible" | "only" | "none" (optional); openElement.status?: "stable" | "experimental" (optional) — Stability marker from the owning package's manifest policy.; openElement.module?: string (optional); openElement.export?: string (optional); openElement.tailwind?: OpenElementTailwindDeclaration (optional); description?: string (optional)

packages/protocol/src/manifest.ts:85
OpenElementErrorclass · public
@openelement/element · root

Framework error carrying a stable code, severity, phase and recoverability contract.

class OpenElementError extends Error
packages/protocol/src/errors.ts:100
OpenElementEventinterface · public
@openelement/element · root

One documented custom event of a custom element declaration.

OpenElementEvent

name: string (required); type?: string (optional); description?: string (optional)

packages/protocol/src/manifest.ts:25
OpenElementPackageManifestinterface · public
@openelement/element · root

Package manifest of component declarations (not a Custom Elements Manifest).

OpenElementPackageManifest

schemaVersion: string (required); packageName: string (required); version: string (required); description?: string (optional); author?: string (optional); license?: string (optional); homepage?: string (optional); repository?: string (optional); declarations: OpenElementDeclaration[] (required)

packages/protocol/src/manifest.ts:98
OpenElementRouteKindtype · public
@openelement/element · root

Host-agnostic route and asset contracts shared by app and build drivers.

OpenElementRouteKind
packages/protocol/src/app-model.ts:2
OpenElementRouteNodeinterface · public
@openelement/element · root

One node of the host-agnostic route tree: the matched URL `path` and route kind, the source and module paths the drivers resolve, the optional registered tag and param names, and the nested `children`.

OpenElementRouteNode

kind: OpenElementRouteKind (required); path: string (required); filePath?: string (optional); importPath?: string (optional); tagName?: string (optional); paramNames?: string[] (optional); children?: OpenElementRouteNode[] (optional); meta?: Record<string, unknown> (optional)

packages/protocol/src/app-model.ts:9
OpenElementSlotinterface · public
@openelement/element · root

One documented slot of a custom element declaration.

OpenElementSlot

name: string (required); description?: string (optional)

packages/protocol/src/manifest.ts:32
PROBLEM_JSON_MEDIA_TYPEconst · public
@openelement/element · root

Media type of the RFC 9457 action error channel (#863).

"application/problem+json"
packages/protocol/src/data.ts:117
ProblemDetailsinterface · public
@openelement/element · root

RFC 9457 Problem Details document (#863): the action error channel answers `application/problem+json` instead of the bespoke `{ type: 'error', error: { message } }` JSON, so HTTP tooling recognizes failures natively. With `type: 'about:blank'`, `title` is the HTTP reason phrase and `detail` carries the specific explanation. The wire shape is alpha-unfrozen; the 1.0 acceptance freezes it in this problem+json form.

ProblemDetails

type: string (required) — URI reference identifying the problem type; 'about:blank' when none applies.; title: string (required) — Short human-readable summary (the HTTP reason phrase for 'about:blank').; status.toString: (radix?: number) => string (required) — Returns a string representation of an object.; status.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; status.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; status.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; status.valueOf: () => number (required) — Returns the primitive value of the specified object.; status.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.; detail?: string (optional) — Human-readable explanation specific to this occurrence.

packages/protocol/src/data.ts:105
propertyfunction · public
@openelement/element · root

Compiler-recognized property decorator; inert no-op at runtime.

(_options: { reflect: boolean; attribute?: false | string; type?: unknown; converter?: unknown; }): (target: unknown, context?: unknown) => void

reflect: boolean (required); attribute?: string | false (optional); type?: unknown (optional); converter?: unknown (optional)

packages/element/src/internal/core/compile-decorators.ts:34
provideContextfunction · public
@openelement/element · root

Provide a plain protocol value; the provider Signal remains OE-private.

<T>(host: HTMLElement, context: Context<T>, value: T): Unsubscribe
packages/element/src/internal/core/signal-context.ts:109
ReadonlySignalinterface · public
@openelement/element · root

Read-only signal protocol used by computed values.

ReadonlySignal<T>

value: T (required); subscribe: (fn: (value: T) => void) => Unsubscribe (required); __@SIGNAL_BRAND@4267.valueOf: () => boolean (required) — Returns the primitive value of the specified object.

packages/protocol/src/signal.ts:26
RenderErrorclass · public
@openelement/element · root

Recoverable render-phase error carrying the failing component path and tag.

class RenderError extends OpenElementError
packages/element/src/internal/core/errors.ts:95
renderToStringfunction · public
@openelement/element · root

Server-render one compiled element through canonical Element composition: returns the serialized DSD `html` string directly.

(input: string | CustomElementConstructor, options?: RenderToStringOptions): string
packages/element/src/public-runtime.ts:950
RenderToStringOptionsinterface · public
@openelement/element · root

Options for one `renderToString()` call: the compiled component class to serialize, the values projected onto its compiled properties, optional route/source diagnostics metadata, the nested compiled tags the build admitted, and trusted parent-owned light children keyed by slot name.

RenderToStringOptions

componentClass?: CustomElementConstructor (optional); props?: Record<string, unknown> (optional); sourceInfo.route?: string (optional); sourceInfo.source?: string (optional); ssrRenderableTags?: readonly string[] (optional) — Build-admitted nested compiled tags. Omitted means shell-only rendering.; projectedChildren?: ReadonlyMap<string, TrustedHtml> (optional) — Trusted parent-owned light children keyed by slot name.; hostChildren?: TrustedHtml (optional) — Trusted parent-owned light children emitted AFTER the host's DSD template (a shadow-root host's slotted content). This is the shadow-side sibling of `projectedChildren`: a light root substitutes projections into its own `<slot>` elements, a shadow root distributes appended light DOM natively. Both are the compiled children channel — compiler-produced final HTML carrying the trustedHtml brand, nev…; documentStyles?: DocumentStyleSink (optional) — The render's document stylesheet collection (alpha15 S lane, S-C1.2). Every light-root component serialized in this render reports its external sheet URLs here, and the document wrapper declares them in the head. The caller owns the collection's lifetime — one per document render — so styles discovered for one page can never reach another page's head.

packages/element/src/public-runtime.ts:239
reportErrorfunction · public
@openelement/element · root

Report an {@linkcode OpenElementError} to the telemetry hook, or console.error when none is installed.

(error: OpenElementError): void

code: string (required); severity: ErrorSeverity (required); phase: ErrorPhase (required); recoverable: boolean (required); statusCode.toString: (radix?: number) => string (required) — Returns a string representation of an object.; statusCode.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; statusCode.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; statusCode.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; statusCode.valueOf: () => number (required) — Returns the primitive value of the specified object.; statusCode.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.; toJSON: () => Record<string, unknown> (required); name: string (required); message: string (required); stack?: string (optional); cause?: unknown (optional)

packages/element/src/internal/core/errors.ts:139
RouteEntryinterface · public
@openelement/element · root

One route admitted by the scanner: URL `path`, source `filePath`, the route `type`, the generated variable name (`varName`) the entry binds it to, and the optional registration tag. {@link RouteEntry.definePage} and {@link RouteEntry.hasEnhancedForms} carry the two source-derived admission facts the generated entries branch on.

RouteEntry

path: string (required); filePath: string (required); type: "page" | "api" | "island" | "special" (required); varName: string (required); tagName?: string (optional); definePage?: boolean (optional) — True when the route module's default export is a definePage() definition (#960 — registration decoupling). The generated entry registers the page class under the path-derived fallback tag and IGNORES the tagName export for registration: on a definePage route the export only names a content element. Plain element routes keep tagName as their registration tag.; functionPage?: string (optional) — The server function page fact (alpha15 server lane): the exported server function component the route's `export default definePage(Component)` was called over. Present only when the argument is a plain identifier resolving to a component THIS module declares — an inline arrow or an unexported local never records it (the R1 admission rule mirrored, so a shape whose JSX would escape to runtime is n…; source?: string (optional) — Source text captured during scanning when includeSource is enabled.; hasEnhancedForms?: boolean (optional) — True when the page route source carries data-open-enhance (#569): the client entry must ship the form-enhancement layer even when the app has zero islands.; special?: SpecialFileType (optional); params?: string[] (optional)

packages/protocol/src/framework.ts:113
ServerRouteContextinterface · public
@openelement/element · root

Canonical request-time/SSG server route context.

ServerRouteContext<Env, Platform, Route>

request: Request (required); params: Record<string, string> (required); env: Env (required); platform: Platform (required); responseHeaders: Headers (required) — Mutable response-only channel merged into the framework response.; route: Route (required)

packages/protocol/src/data.ts:25
ServerRouteMetadatainterface · public
@openelement/element · root

Context passed to a request-time ('dynamic') route loader. This is the server contract: the loader runs on the server with the Web-standard request, matched route params, the host environment and the platform object, and signals validation failure via fail()/redirect().

ServerRouteMetadata

path: string (required); filePath: string (required)

packages/protocol/src/data.ts:19
setErrorTelemetryHookfunction · public
@openelement/element · root

Install the process-wide error telemetry hook (replaceable for tests, HMR, multi-app pages).

(hook: ErrorTelemetryHook): void
packages/element/src/internal/core/errors.ts:127
signalfunction · public
@openelement/element · root

Create a writable signal through the selected signal engine.

<T>(initialValue: T): WritableSignal<T>
packages/element/src/internal/signal/framework.ts:19
Signaltype · public
@openelement/element · root

Alias for APIs that accept either writable or read-only signals.

Signal<T>
packages/protocol/src/signal.ts:31
SpecialFileTypetype · public
@openelement/element · root

Special file kinds the route scanner recognizes by filename: `renderer` and `middleware`.

SpecialFileType
packages/protocol/src/framework.ts:79
SsrAdmissionDecisioninterface · public
@openelement/element · root

The build's admission verdict for one discovered tag: where the declaration lives (`modulePath`), how it was discovered (`source`), which render path it is admitted to, and the reason recorded for the manifest.

SsrAdmissionDecision

tagName: string (required); modulePath: string (required) — Module path of the island declaration. Empty for 'foreign' decisions: a foreign tag is consumed in JSX but declares no module the build owns.; source: "local" | "package" | "nested" | "foreign" (required) — 'foreign' (#979): a third-party WC tag discovered by the foreign-tag scanner in page/island JSX — recorded for visibility only; SSR still treats it as an opaque passthrough (renderPath 'client-only').; renderPath: "ssr+client" | "client-only" | "rejected" (required); reason: string (required)

packages/protocol/src/render.ts:37
STREAM_FRAME_FORBIDDEN_TAGSconst · public
@openelement/element · root

Tags a deferred frame cannot safely install into an owned Part range: the browser installer rejects any frame whose markup carries one of these.

readonly ["script", "style", "template", "iframe", "object", "embed", "base", "meta", "link"]
packages/protocol/src/stream-frame-policy.ts:26
STREAM_FRAME_UNSAFE_URLconst · public
@openelement/element · root

Schemes that make a URL attribute unsafe in a streamed frame.

RegExp
packages/protocol/src/stream-frame-policy.ts:60
STREAM_FRAME_URL_ATTRIBUTESconst · public
@openelement/element · root

URL-carrying attributes the frame check screens for script-bearing scheme obfuscation; only these attribute names are value-screened.

readonly ["href", "src", "action", "formaction", "xlink:href"]
packages/protocol/src/stream-frame-policy.ts:42
STREAM_FRAME_URL_CONTROL_MAXconst · public
@openelement/element · root

Control characters at or below this code point are stripped before the URL-scheme test, so tab/newline/control obfuscation cannot smuggle a scheme past admission.

32
packages/protocol/src/stream-frame-policy.ts:55
STREAM_MAX_FIELDSconst · public
@openelement/element · root

Deferred fields (declared streamed properties) one stream route's manifest may carry. The build scan, the server executor, and the browser seed contract enforce the same bound.

32
packages/protocol/src/policy.ts:24
STREAM_MAX_OWNERSconst · public
@openelement/element · root

Part/Block owners one stream route's manifest may address in total across all deferred fields.

64
packages/protocol/src/policy.ts:30
STREAM_MAX_PAYLOAD_LENGTHconst · public
@openelement/element · root

Serialized stream payload bound, as a string length in UTF-16 code units: one seed attribute or one deferred frame's markup may not exceed it. The server checks the JSON text and the rendered range before emitting; the browser checks the attribute before parsing.

number
packages/protocol/src/policy.ts:45
STREAM_MAX_SEED_PROPERTIESconst · public
@openelement/element · root

Typed properties one streamed seed may carry: the browser seed contract rejects the WHOLE seed above this count, so an oversized component would silently fail to hydrate instead of failing loud at the server.

64
packages/protocol/src/policy.ts:37
STREAM_TIMEOUT_MSconst · public
@openelement/element · root

Deferred-field resolution budget (milliseconds) for one streamed response: fields still pending when it expires are failed in place and the stream ends with the shell and whatever resolved.

30000
packages/protocol/src/policy.ts:64
StreamShellExecutorinterface · public
@openelement/element · root

Initial shell, typed seed, and bounded updates for a stream shell request.

StreamShellExecutor

shell: string (required); owner: StreamOwner (required); seed: Record<string, { state: "resolved"; type: string; value: unknown; } | { state: "pending"; type: string; } | { state: "missing"; type: string; }> (required); resolvedValue: (field: string, value: unknown) => unknown (required); serializeResolved: (field: string, value: unknown) => string[] (required)

packages/element/src/public-runtime.ts:452
StreamShellManifestinterface · public
@openelement/element · root

Maps route-local deferred fields to the compiled Part or Block owners they update.

StreamShellManifest

program: { version: number; tag: string; sha256: string; } (required); fields: readonly { field: string; signal: string; owners: readonly { kind: "part" | "region"; index: number; }[]; }[] (required)

packages/element/src/public-runtime.ts:431
StyleSheetconst · public
@openelement/element · root

Cross-realm StyleSheet constructor: the native CSSStyleSheet or the internal shim.

new () => StyleSheetLike
packages/element/src/internal/core/style-sheet.ts:110
StyleSheetLikeinterface · public
@openelement/element · root

Minimal stylesheet contract (replaceSync + cssRules) satisfied by native and shim sheets.

StyleSheetLike

replaceSync: (text: string) => void (required); cssRules: StyleSheetRule[] (required)

packages/protocol/src/style-sheet.ts:14
trustedHtmlfunction · public
@openelement/element · root

Mark an HTML string as trusted for explicit `innerHTML` sinks (the trust does not serialize).

(html: string): TrustedHtml
packages/element/src/internal/core/security.ts:86
TrustedHtmlinterface · public
@openelement/element · root

Opaque capability marking HTML the application has explicitly vetted as trusted.

TrustedHtml

html: string (required)

packages/element/src/internal/core/security.ts:81
unsafeStreamFrameAttributefunction · public
@openelement/element · root

Whether a static attribute (name/value as authored into the Part Program) makes a streamed frame unsafely installable: event-handler, seed-spoofing, and srcdoc names fail outright, and URL-carrying names fail when the entity-decoded, control-stripped value carries a script scheme.

(name: string, value: string): boolean
packages/protocol/src/stream-frame-policy.ts:113
wrapInDocumentfunction · public
@openelement/element · root

Wrap rendered HTML in a full HTML document. Adds DOCTYPE, head (title, meta, preload), and body. Supports CSP nonce and dev scripts (e.g. Vite client, route module registration).

(html: string, options?: DocumentWrapOptions): string
packages/element/src/internal/core/html-escape.ts:199
ACTION_FETCH_HEADERconst · public
@openelement/element · ./authoring

Request header selecting the action response channel: `true` marks a programmatic caller and selects the serialized ActionResult union; `enhance` marks the built-in morph enhancement and selects the same full-HTML responses the no-JS path receives.

"x-openelement-action"
packages/protocol/src/data.ts:125
assertValidTagNamefunction · public
@openelement/element · ./authoring

Assert that a tag name is a valid custom element name.

(tagName: string): void
packages/element/src/internal/core/tag-utils.ts:50
DANGEROUS_KEYSconst · public
@openelement/element · ./authoring

Object prototype keys that must never be injected from untrusted props.

ReadonlySet<string>
packages/element/src/internal/core/security.ts:25
ERROR_PREFIXconst · public
@openelement/element · ./authoring

Error message prefix for all openElement errors.

"[openElement]"
packages/protocol/src/errors.ts:50
HYDRATION_STRATEGIESconst · public
@openelement/element · ./authoring

Runtime list of supported hydration strategies; the single source of truth for the `HydrationStrategy` union. Consumed by island/registry validation and re-exported from the element root for app and build adapters.

readonly ["load", "idle", "visible", "only", "none"]
packages/protocol/src/framework.ts:28
HydrationStrategytype · public
@openelement/element · ./authoring

Island hydration trigger: 'load' | 'idle' | 'visible' | 'only'.

"load" | "idle" | "visible" | "only" | "none"
packages/protocol/src/framework.ts:30
injectPropsSafefunction · public
@openelement/element · ./authoring

Safely assign caller-supplied props onto a target object, skipping keys that could enable prototype pollution and tolerating read-only properties. The canonical guarded assigner for the canonical dangerous-key rule (#903, #1214): the

(target: Record<string, unknown>, props: Record<string, unknown>, tagName: string, log?: { warn(message: string): void; debug(message: string): void; }): void
packages/element/src/internal/core/security.ts:119
isDangerousKeyfunction · public
@openelement/element · ./authoring

Shared dangerous-key predicate (#903, #1214). Prototype-internal keys must never be injected from untrusted props on ANY path: host prop collection (collectPublicProps / normalizePublicProps in props-utils.ts), guarded assignment (injectPropsSafe below — the SPA bootstrap page-projection write boundary in

(key: string): boolean
packages/element/src/internal/core/security.ts:51
isSafeAttributeNamefunction · public
@openelement/element · ./authoring

Shared safe-attribute-name predicate (#1033): the SSR face of the one canonical predicate in `../protocol/forbidden-sinks.ts`. A name must be valid HTML attribute-name grammar (blocks quote/space injection, #602), must not be an event handler (`on*`, case-insensitive), and must not be a forbidden sink (`innerhtml`/`srcdoc`). The compiler, protocol validator, and server serializer enforce the same predicate with their own failure strategies; every path delegates to the single implementation, so the boundary cannot diverge.

(name: string): boolean
packages/element/src/internal/core/security.ts:65
isValidTagNamefunction · public
@openelement/element · ./authoring

Check if a tag name is a valid custom element name per HTML spec.

(tagName: string): boolean
packages/element/src/internal/core/tag-utils.ts:38
MAX_ACTION_BODY_BYTESconst · public
@openelement/element · ./authoring

Request-body bound (bytes) the generated entry applies to action POST routes; larger uploads belong on API routes with explicit limits.

number
packages/protocol/src/policy.ts:57
OpenElementErrorclass · public
@openelement/element · ./authoring

Framework error carrying a stable code, severity, phase and recoverability contract.

class OpenElementError extends Error
packages/protocol/src/errors.ts:100
PROBLEM_JSON_MEDIA_TYPEconst · public
@openelement/element · ./authoring

Media type of the RFC 9457 action error channel (#863).

"application/problem+json"
packages/protocol/src/data.ts:117
STREAM_FRAME_FORBIDDEN_TAGSconst · public
@openelement/element · ./authoring

Tags a deferred frame cannot safely install into an owned Part range: the browser installer rejects any frame whose markup carries one of these.

readonly ["script", "style", "template", "iframe", "object", "embed", "base", "meta", "link"]
packages/protocol/src/stream-frame-policy.ts:26
STREAM_FRAME_UNSAFE_URLconst · public
@openelement/element · ./authoring

Schemes that make a URL attribute unsafe in a streamed frame.

RegExp
packages/protocol/src/stream-frame-policy.ts:60
STREAM_FRAME_URL_ATTRIBUTESconst · public
@openelement/element · ./authoring

URL-carrying attributes the frame check screens for script-bearing scheme obfuscation; only these attribute names are value-screened.

readonly ["href", "src", "action", "formaction", "xlink:href"]
packages/protocol/src/stream-frame-policy.ts:42
STREAM_FRAME_URL_CONTROL_MAXconst · public
@openelement/element · ./authoring

Control characters at or below this code point are stripped before the URL-scheme test, so tab/newline/control obfuscation cannot smuggle a scheme past admission.

32
packages/protocol/src/stream-frame-policy.ts:55
STREAM_MAX_FIELDSconst · public
@openelement/element · ./authoring

Deferred fields (declared streamed properties) one stream route's manifest may carry. The build scan, the server executor, and the browser seed contract enforce the same bound.

32
packages/protocol/src/policy.ts:24
STREAM_MAX_OWNERSconst · public
@openelement/element · ./authoring

Part/Block owners one stream route's manifest may address in total across all deferred fields.

64
packages/protocol/src/policy.ts:30
STREAM_MAX_PAYLOAD_LENGTHconst · public
@openelement/element · ./authoring

Serialized stream payload bound, as a string length in UTF-16 code units: one seed attribute or one deferred frame's markup may not exceed it. The server checks the JSON text and the rendered range before emitting; the browser checks the attribute before parsing.

number
packages/protocol/src/policy.ts:45
STREAM_MAX_SEED_PROPERTIESconst · public
@openelement/element · ./authoring

Typed properties one streamed seed may carry: the browser seed contract rejects the WHOLE seed above this count, so an oversized component would silently fail to hydrate instead of failing loud at the server.

64
packages/protocol/src/policy.ts:37
STREAM_TIMEOUT_MSconst · public
@openelement/element · ./authoring

Deferred-field resolution budget (milliseconds) for one streamed response: fields still pending when it expires are failed in place and the stream ends with the shell and whatever resolved.

30000
packages/protocol/src/policy.ts:64
__setRequestTimeStyleSheetUrlsfunction · public
@openelement/element · ./base

Set the emitted component stylesheet URLs for this server process. Called by the router's generated SSR/SSG entry (build time and request-time startup) with the base-joined asset addresses Phase 2 emitted.

(urls: readonly string[] | null | undefined): void
packages/element/src/internal/compiled/server/style-links.ts:29
Actiontype · public
@openelement/element · ./base

Route action: handles form submissions for a page route.

Action<T, Env, Platform, Route>
packages/protocol/src/data.ts:64
ACTION_FETCH_HEADERconst · public
@openelement/element · ./base

Request header selecting the action response channel: `true` marks a programmatic caller and selects the serialized ActionResult union; `enhance` marks the built-in morph enhancement and selects the same full-HTML responses the no-JS path receives.

"x-openelement-action"
packages/protocol/src/data.ts:125
ActionContextinterface · public
@openelement/element · ./base

Context passed to a route action function (extends loader context).

ActionContext<Env, Platform, Route>

formData: FormData (required); request: Request (required); params: Record<string, string> (required); env: Env (required); platform: Platform (required); responseHeaders: Headers (required) — Mutable response-only channel merged into the framework response.; route: Route (required)

packages/protocol/src/data.ts:47
ActionResulttype · public
@openelement/element · ./base

Wire shape returned to the JavaScript form-enhancement path. The no-JS path never sees this: it gets the equivalent semantics as plain HTTP (303 on success, 422 with the re-rendered form on validation failure, redirect/error as status codes). Success carries no data envelope. The application-loop contract makes a successful non-GET action answer 303 (PRG) — the framework never answers 200 with a rendered page, or with a success document, for a successful mutation — so the fetch channel answers `{ type: 'redirect' }` naming the PRG target and the authored return value is discarded by design. Success data travels the PRG target instead (query state the loader re-runs with, which the props projector then maps; see the router guide's "Form actions" section). The union previously declared a `{ type: 'success' }` member that no code path ever emitted — removed so the type matches the wire. Error outcomes (CSRF 403, unknown action 404, unparseable body 400, unexpected 500) are NOT part of this union: since #863 they answer RFC 9457 Problem Details with the PROBLEM_JSON_MEDIA_TYPE content type — see ProblemDetails.

ActionResult<Failure>
packages/protocol/src/data.ts:92
assertValidTagNamefunction · public
@openelement/element · ./base

Assert that a tag name is a valid custom element name.

(tagName: string): void
packages/element/src/internal/core/tag-utils.ts:50
collectPublicPropsfunction · public
@openelement/element · ./base

Collect all public (non-internal) own properties from a host object. Keys starting with `__openElement` are framework-internal and excluded. Uses Reflect.get for safe access (respects getters); a getter that throws is skipped with a warning so one bad prop cannot take the tree down.

(host: object): Record<string, unknown>
packages/element/src/internal/core/props-utils.ts:41
CompatibilityClassificationinterface · public
@openelement/element · ./base

The per-tag verdict the compatibility scanner records: the tier a discovered tag was classified as, the human-readable `reason`, where the tag was found (`source`), and the SSR/DSD/hydration facts the verdict was derived from.

CompatibilityClassification

tagName: string (required); tier: CompatibilityTier (required); reason: string (required); source: "local" | "package" | "nested" (required); modulePath?: string (optional); ssr?: boolean (optional); dsd?: boolean (optional); hydrate?: string (optional)

packages/protocol/src/framework.ts:352
CompatibilityTiertype · public
@openelement/element · ./base

How far a discovered tag may participate in the build: 'ssr-capable' renders and hydrates, 'client-only' ships to the browser without server output, 'experimental-dom' is admitted with a downgraded guarantee, and 'rejected' fails the build.

CompatibilityTier
packages/protocol/src/framework.ts:345
ComponentLayertype · public
@openelement/element · ./base

The delivery layer a component belongs to: fully static DSD markup ('dsd-static'), DSD markup with a client island ('dsd-interactive'), a client-only island with no SSR output ('pure-island'), or a light-DOM element ('light-dom'). Recorded per component in the build manifest and consumed by the hydration scheduler.

ComponentLayer
packages/protocol/src/framework.ts:23
computedfunction · public
@openelement/element · ./base

Create a derived read-only signal recomputed from its dependencies.

<T>(fn: () => T): ReadonlySignal<T>
packages/element/src/internal/signal/framework.ts:23
consumeContextfunction · public
@openelement/element · ./base

Consumer-local reactive projection of a protocol context value.

<T>(context: Context<T>, host?: HTMLElement): WritableSignal<T>

key.toString: () => string (required) — Returns a string representation of an object.; key.valueOf: () => symbol (required) — Returns the primitive value of the specified object.; key.description: string (required) — Expose the [[Description]] internal slot of a symbol directly.; key.__@toPrimitive@5343: (hint: string) => symbol (required) — Converts a Symbol object to a symbol.; key.__@toStringTag@5345: string (required); defaultValue: T (required)

packages/element/src/internal/core/signal-context.ts:141
Contextinterface · public
@openelement/element · ./base

A typed context token: protocol identity (`key`) plus its default value.

Context<T>

key.toString: () => string (required) — Returns a string representation of an object.; key.valueOf: () => symbol (required) — Returns the primitive value of the specified object.; key.description: string (required) — Expose the [[Description]] internal slot of a symbol directly.; key.__@toPrimitive@5343: (hint: string) => symbol (required) — Converts a Symbol object to a symbol.; key.__@toStringTag@5345: string (required); defaultValue: T (required)

packages/element/src/internal/core/signal-context.ts:13
createContextfunction · public
@openelement/element · ./base

Create a typed context token shared between provider and consumer elements.

<T>(key: symbol, defaultValue: T): Context<T>

toString: () => string (required) — Returns a string representation of an object.; valueOf: () => symbol (required) — Returns the primitive value of the specified object.; description: string (required) — Expose the [[Description]] internal slot of a symbol directly.; __@toPrimitive@5343: (hint: string) => symbol (required) — Converts a Symbol object to a symbol.; __@toStringTag@5345: string (required)

packages/element/src/internal/core/signal-context.ts:58
createDocumentStyleResourcesfunction · public
@openelement/element · ./base

Create the per-render document stylesheet collection.

(): DocumentStyleResources
packages/element/src/internal/core/html-escape.ts:133
createLoggerfunction · public
@openelement/element · ./base

Create a {@link Logger} that prefixes every message with `[tag]`.

(tag: string): Logger
packages/element/src/internal/core/logger.ts:18
createStreamShellExecutorfunction · public
@openelement/element · ./base

Create one request-local stream shell from a generated route manifest. The manifest hash is checked against the exact runtime wire program before any shell can be produced.

(options: CreateStreamShellOptions): Promise<StreamShellExecutor>

componentClass: CustomElementConstructor (required); props?: Record<string, unknown> (optional); manifest: StreamShellManifest (required); instanceId: string (required); documentToken?: string (optional); documentStyles?: DocumentStyleSink (optional) — The streamed document's stylesheet collection (see RenderToStringOptions).

packages/element/src/public-runtime.ts:516
CreateStreamShellOptionsinterface · public
@openelement/element · ./base

Inputs for a request-scoped stream shell executor.

CreateStreamShellOptions

componentClass: CustomElementConstructor (required); props?: Record<string, unknown> (optional); manifest: StreamShellManifest (required); instanceId: string (required); documentToken?: string (optional); documentStyles?: DocumentStyleSink (optional) — The streamed document's stylesheet collection (see RenderToStringOptions).

packages/element/src/public-runtime.ts:441
DANGEROUS_KEYSconst · public
@openelement/element · ./base

Object prototype keys that must never be injected from untrusted props.

ReadonlySet<string>
packages/element/src/internal/core/security.ts:25
deepGetElementByIdfunction · public
@openelement/element · ./base

Resolve `id` (a `#hash` or bare id) against `root` and, when the id is not in that root's own tree, recurse into every nested shadow root. Returns the first match or `null`; a malformed percent-encoded id is not an error.

(id: string, root?: Document | ShadowRoot): HTMLElement | null
packages/element/src/internal/core/deep-fragment.ts:20
documentStreamPartsfunction · public
@openelement/element · ./base

The same document serialization boundary, with only body wrappers left open.

(options?: DocumentWrapOptions): { prefix: string; suffix: string; }

title?: string (optional); lang?: string (optional); clientScript?: string (optional); scripts?: DocumentScriptDescriptor[] (optional); meta.description?: string (optional); meta.tags?: Record<string, string | number | boolean>[] (optional); devScripts?: string (optional); headExtras?: string (optional); dangerouslyHeadFragments?: string[] (optional); allowHeadExtrasScripts?: boolean (optional); links?: { rel: string; href: string; hreflang?: string; }[] (optional); structuredData?: readonly Record<string, unknown>[] (optional); cspNonce?: string (optional); streamBootstrap?: string (optional) — Trusted framework bootstrap emitted synchronously in the document head.; styleLinks?: readonly string[] (optional) — The document's light-root component stylesheets: external resource URLs (alpha15 S lane, S-C1.2) serialized as marked `<link rel="stylesheet">` nodes after `headExtras`, so a light component is styled by the document that contains it — without JavaScript and without a runtime style node.

packages/element/src/internal/core/html-escape.ts:205
DocumentStyleResourcesinterface · public
@openelement/element · ./base

The document-level stylesheet resources ONE server render discovered (alpha15 S lane, S-C1.2). A light-root component's DOM lives in the document, so its sheet cannot ride the component's own subtree the way a shadow template's link does: the document owns it. This object is the one carrier between the two halves of that render — the compiled serializer, which discovers a component's external sheets while serializing the component, and the document serializer, which writes the head. It is created per render and never shared, so one page's stylesheets can never reach another page's head.

DocumentStyleResources

links: readonly string[] (required) — Discovered resource URLs, deduplicated, in discovery (cascade) order.; add: (urls: readonly string[]) => void (required) — Record the external stylesheet URLs one rendered component contributes.

packages/element/src/internal/core/html-escape.ts:125
effectfunction · public
@openelement/element · ./base

Run a side effect that re-subscribes whenever its signal dependencies change.

(fn: () => void | Unsubscribe): Unsubscribe
packages/element/src/internal/signal/framework.ts:27
elementfunction · public
@openelement/element · ./base

Compiler-recognized element decorator; inert no-op at runtime.

(_tag: string, _options?: { root?: "light" | "shadow-open" | "shadow-closed"; delegatesFocus?: boolean; formAssociated?: boolean; }): (target: unknown, context?: unknown) => void
packages/element/src/internal/core/compile-decorators.ts:20
ensureDeepFragmentNavigationfunction · public
@openelement/element · ./base

Install (once per document) framework-level fragment navigation: a same-document anchor click whose target lives inside a nested shadow root scrolls to it and pushes the hash instead of being dropped by the browser. `{ enabled: false }` opts an application out.

(options?: DeepFragmentOptions): void

enabled?: boolean (optional) — Set false before installation to opt out for an application.

packages/element/src/internal/core/deep-fragment.ts:67
ensurePreHydrationClickCapturefunction · public
@openelement/element · ./base

Install the bounded pre-upgrade interaction capture on an owning root (default: the document). Generated client entries call this with their declared island tags before any compiled element upgrades; after a successful claim the element replays the captured events whose targets live inside its root (compiled claim capture/replay, internal/compiled/runtime.ts). Idempotent per root (repeat calls merge tags, never reinstall listeners) and a no-op where no DOM exists (SSR). Invariant: the capture itself — one fixed listener set per owning root, installed once per page — is page-lifetime by design and is NOT the leak. The M1 leak was retained event-target records; each element releases exactly its own records at its activation decision (success or failure), while records owned by still-pending elements survive for their delayed/lazy upgrade (#1170). Boundedness: the facade capture passes the declared-island filter, so only interactions under a still-pending DECLARED island tag enter the queue — ordinary events and undeclared third-party custom elements are skipped (nested pending declared islands still capture through their own unsettled host). With no tags declared the legacy dash heuristic applies. The shared queue carries a hard capacity cap (fail closed), detached records are swept when a claim root adopts its share (and under queue pressure), and each activation decision deterministically empties that root's own bucket, so post-hydration traffic and removals never grow retention.

(root?: EventTarget, pendingTags?: readonly string[]): void

addEventListener: (type: string, callback: EventListenerOrEventListenerObject | null, options?: AddEventListenerOptions | boolean) => void (required) — The **`addEventListener()`** method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target. [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener); dispatchEvent: (event: Event) => boolean (required) — The **`dispatchEvent()`** method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order. The normal event processing rules (including the capturing and optional bubbling phase) also apply to events dispatched manually with dispatchEvent(). [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent); removeEventListener: (type: string, callback: EventListenerOrEventListenerObject | null, options?: EventListenerOptions | boolean) => void (required) — The **`removeEventListener()`** method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target. The event listener to be removed is identified using a combination of the event type, the event listener function itself, and various optional options that may affect the matching process; see Matching event listeners for removal.…

packages/element/src/internal/compiled/runtime/pre-upgrade-events.ts:672
ERROR_PREFIXconst · public
@openelement/element · ./base

Error message prefix for all openElement errors.

"[openElement]"
packages/protocol/src/errors.ts:50
ErrorBoundaryclass · public
@openelement/element · ./base

Base class for elements that catch descendant render/hydration errors and apply a retry policy.

class ErrorBoundary extends OpenElement
packages/element/src/error-boundary.ts:45
ErrorTelemetryHooktype · public
@openelement/element · ./base

Callback receiving every reported {@linkcode OpenElementError} for telemetry.

ErrorTelemetryHook
packages/protocol/src/errors.ts:132
escapeAttrfunction · public
@openelement/element · ./base

Escape an HTML attribute value. Delegates to `escapeHtml` so both share the single `ESCAPE_MAP` and the same single-pass replacement (consolidated in #633). Empty-value conventions remain intentionally distinct by design: - `escapeHtml` returns '' for non-string input. - `escapeAttrValue` (below) coerces via `String()` and is the boundary meant for unknown/variable attribute values.

(value: string): string
packages/element/src/internal/core/html-escape.ts:55
escapeHtmlfunction · public
@openelement/element · ./base

Escape the five HTML-significant characters in text content.

(str: string): string
packages/element/src/internal/core/html-escape.ts:39
formatErrorfunction · public
@openelement/element · ./base

Format an unknown thrown value as a human-readable string.

(e: unknown): string
packages/element/src/internal/core/errors.ts:52
FrameworkOptionsinterface · public
@openelement/element · ./base

The adapter-facing framework options: where routes and islands live, which renderer serializes pages, the default layout and named-layout declarations, the document `<html>`/head injection channels, and the request-time middleware switches. Every field is optional; the adapter applies its documented default. This is the type an application config file's default export is checked against, so the rendered option table and the actual config surface cannot drift.

FrameworkOptions

renderer?: "native" | "lit" (optional) — Page renderer selection (Beta.2.2, #1339). EXPLICIT, never inferred: 'native' (default) renders pages through the compiled Part Program serializer (renderToString); 'lit' renders LitElement pages through; routesDir?: string (optional) — Directory the route scanner walks, relative to the Vite root. Defaults to `app/routes`.; islandsDir?: string (optional) — Directory island modules are discovered in. Defaults to `app/islands`.; packageIslands?: string[] | "auto" | "manual" (optional) — How the build admits component packages whose modules the application imports. - omitted or `'auto'` (the default): the scan derives the admitted set at scan time — every package-owned element module the app's routes, pages, layouts, islands and components really reach (bundler-resolved) is attributed to its owner package (nearest `package.json`), and a package with a valid OpenElement manifest i…; layout?: LayoutConfig (optional) — Layout declaration; `false` disables the layout, `'default'` uses the built-in one.; layouts?: LayoutsConfig (optional) — Named layout declarations keyed by layout name.; headExtras?: string (optional) — @dangerous injected as-is, only use with controlled content; html.lang?: string (optional); html.title?: string (optional); inject.stylesheets?: (string | { href: string; integrity?: string; crossorigin?: "anonymous" | "use-credentials"; attrs?: Record<string, string | number | boolean>; })[] (optional) — Stylesheets linked into the document head; each entry is an href or a link record with integrity/crossorigin/attrs.; inject.scripts?: (string | { src: string; type?: string; async?: boolean; defer?: boolean; integrity?: string; crossorigin?: "anonymous" | "use-credentials"; attrs?: Record<str… (optional) — Scripts emitted into the document; each entry is a src or a script record with type/async/defer/integrity/crossorigin/attrs.; inject.headFragments?: string[] (optional) — @dangerous fragments injected as-is. Trust boundary (same level as `trustedHtml`): never concatenate user-controlled content into these fragments; sanitize untrusted data at your own system boundary first. The framework only enforces no-`<script>` and no-executable-`<style>`.; ssr.noExternal?: (string | RegExp)[] (optional); island.upgradeStrategy?: "load" | "idle" | "visible" | "only" | "none" (optional); build.outDir?: string (optional) — Output directory for the build artifacts. Defaults to `dist`.; build.manifestBudget?: { islandKB?: number; totalJsKB?: number; pageKB?: number; } (optional) — Advisory only: exceeded budgets print build-manifest warnings and never fail the build; enforce them in your own build-output test.; viewTransition?: boolean (optional) — Enable the View Transitions API for client navigations. Defaults to true.; speculation?: boolean | { prerender?: string[]; prefetch?: string[]; exclude?: string[]; eagerness?: "immediate" | "moderate" | "conservative"; } (optional) — Speculation Rules emission: `true` uses framework defaults, or pass prerender/prefetch URL lists, exclusions and an eagerness.; middleware.cors?: boolean (optional) — Built-in CORS middleware. Default-ON; pass `false` to disable.; middleware.corsOrigin?: string | string[] (optional) — Static CORS allowlist data, serialized into the generated entry as JSON. Mutually exclusive with {@link FrameworkOptions.middleware.corsOriginModule }.; middleware.corsOriginModule?: string (optional) — Path to a module that default-exports `(origin: string) => string | undefined`. The generated entry imports the module — the callback is never serialized — so it may close over module scope and import dependencies. Resolved with the same idiom as `layout.import` (e.g. './app/cors-origin.ts'). Mutually exclusive with `corsOrigin`.; middleware.requestId?: boolean (optional) — Emit and honor a per-request id header. Default-ON; pass `false` to disable.; middleware.logger?: boolean (optional) — Log each request through the built-in logger. Default-ON; pass `false` to disable.; middleware.securityHeaders?: boolean (optional) — Attach the built-in security response headers. Default-ON; pass `false` to disable.; middleware.csp?: { policy?: string; nonce?: boolean; reportOnly?: boolean; } (optional) — Content-Security-Policy emission: the policy string, nonce generation, and report-only mode.; middleware.use?: string[] (optional) — Fetch middleware chain (#858), composed around the framework handler in onion order (`use[0]` outermost), outside all built-in middleware above. Each entry is a MODULE PATH (same resolution idiom as `layout.import`, e.g. './app/middleware/auth.ts') whose default export is a {@link Middleware}; the generated entry emits `import * as __mw_N from '<path>'` and composes `__mw_N.default` in configured…

packages/protocol/src/framework.ts:181
HYDRATION_STRATEGIESconst · public
@openelement/element · ./base

Runtime list of supported hydration strategies; the single source of truth for the `HydrationStrategy` union. Consumed by island/registry validation and re-exported from the element root for app and build adapters.

readonly ["load", "idle", "visible", "only", "none"]
packages/protocol/src/framework.ts:28
HydrationStrategytype · public
@openelement/element · ./base

Island hydration trigger: 'load' | 'idle' | 'visible' | 'only'.

"load" | "idle" | "visible" | "only" | "none"
packages/protocol/src/framework.ts:30
IDLE_FALLBACK_TIMEOUT_MSconst · public
@openelement/element · ./base

Idle-hydration scheduling fallback (milliseconds) when neither `requestIdleCallback` nor `requestAnimationFrame` is available.

50
packages/protocol/src/policy.ts:70
injectPropsSafefunction · public
@openelement/element · ./base

Safely assign caller-supplied props onto a target object, skipping keys that could enable prototype pollution and tolerating read-only properties. The canonical guarded assigner for the canonical dangerous-key rule (#903, #1214): the

(target: Record<string, unknown>, props: Record<string, unknown>, tagName: string, log?: { warn(message: string): void; debug(message: string): void; }): void
packages/element/src/internal/core/security.ts:119
isDangerousKeyfunction · public
@openelement/element · ./base

Shared dangerous-key predicate (#903, #1214). Prototype-internal keys must never be injected from untrusted props on ANY path: host prop collection (collectPublicProps / normalizePublicProps in props-utils.ts), guarded assignment (injectPropsSafe below — the SPA bootstrap page-projection write boundary in

(key: string): boolean
packages/element/src/internal/core/security.ts:51
IslandOptionsinterface · public
@openelement/element · ./base

Per-island delivery options (hydration strategy, SSR/DSD participation).

IslandOptions

hydrate?: "load" | "idle" | "visible" | "only" | "none" (optional) — Hydration strategy: - 'load': load immediately when module is imported - 'idle': defer to requestIdleCallback (default) - 'visible': use IntersectionObserver to defer until element is visible - 'only': client-only render, no DSD/SSR output Named `hydrate` to match `defineIslandConfig()` in the Router package — one option name across both packages.; dsd?: boolean (optional) — Whether to use DSD for SSR rendering of this island. Honored by the build-side island scan (via `defineIslandConfig`), not by `defineIsland()` itself: passing it in `IslandOptions` has no runtime effect.; ssr?: boolean (optional) — Whether this island may be admitted into server rendering. Like `dsd`, decided by the build-side island scan; inert when passed to `defineIsland()`.

packages/protocol/src/island.ts:8
isSafeAttributeNamefunction · public
@openelement/element · ./base

Shared safe-attribute-name predicate (#1033): the SSR face of the one canonical predicate in `../protocol/forbidden-sinks.ts`. A name must be valid HTML attribute-name grammar (blocks quote/space injection, #602), must not be an event handler (`on*`, case-insensitive), and must not be a forbidden sink (`innerhtml`/`srcdoc`). The compiler, protocol validator, and server serializer enforce the same predicate with their own failure strategies; every path delegates to the single implementation, so the boundary cannot diverge.

(name: string): boolean
packages/element/src/internal/core/security.ts:65
isValidTagNamefunction · public
@openelement/element · ./base

Check if a tag name is a valid custom element name per HTML spec.

(tagName: string): boolean
packages/element/src/internal/core/tag-utils.ts:38
LayoutConfigtype · public
@openelement/element · ./base

Layout declaration: `false` disables the layout entirely, `'default'` uses the built-in layout, and the object form names a tag with the module path that defines it (`import`, resolved like a {@link FrameworkOptions.middleware.use } entry) plus the compiled layout properties the router injects per route.

LayoutConfig
packages/protocol/src/framework.ts:96
Loadertype · public
@openelement/element · ./base

Route loader: fetches data for a page route.

Loader<T, Env, Platform, Route>
packages/protocol/src/data.ts:56
LoaderContextinterface · public
@openelement/element · ./base

Context passed to a request-time ('dynamic') route loader.

LoaderContext<Env, Platform, Route>

request: Request (required); params: Record<string, string> (required); env: Env (required); platform: Platform (required); responseHeaders: Headers (required) — Mutable response-only channel merged into the framework response.; route: Route (required)

packages/protocol/src/data.ts:40
LocalePathinterface · public
@openelement/element · ./base

Locale-aware resolved path contract.

LocalePath

locale: string (required); path: string (required); localizedPath: string (required); isDefaultLocalePath: boolean (required)

packages/protocol/src/framework.ts:82
Loggerinterface · public
@openelement/element · ./base

logger.ts - Tagged console logger. Lightweight scoped logger. Returns plain functions so it is tree-shakable and has zero class overhead.

Logger

debug: (msg: string, ...args: unknown[]) => void (required); info: (msg: string, ...args: unknown[]) => void (required); warn: (msg: string, ...args: unknown[]) => void (required); error: (msg: string, ...args: unknown[]) => void (required)

packages/element/src/internal/core/logger.ts:10
MAX_ACTION_BODY_BYTESconst · public
@openelement/element · ./base

Request-body bound (bytes) the generated entry applies to action POST routes; larger uploads belong on API routes with explicit limits.

number
packages/protocol/src/policy.ts:57
MAX_COMPOSITION_DEPTHconst · public
@openelement/element · ./base

Nested element expansion depth bound for `renderToString`: cyclic component composition fails closed instead of recursing without end.

8
packages/protocol/src/policy.ts:51
Middlewaretype · public
@openelement/element · ./base

Fetch middleware contract (#858): WinterCG shape, dialect-free — no Hono/h3 context object. Composed at the handler boundary in onion order (`use[0]` is outermost: it sees the request first and the response last), so it runs with identical semantics in the dev server, the `start` CLI, the e2e fixture server, and the Nitro production entry. A middleware may short-circuit by returning a Response without calling `next()`, or post-process the Response that `next()` returns. Module contract: a Middleware is the DEFAULT EXPORT of a module referenced from `middleware.use` by path (e.g. './app/middleware/auth.ts'). The generated server entry imports the module, so the middleware may close over module scope and import local helpers and third-party packages — it is a real module in the server module graph, never serialized source.

Middleware
packages/protocol/src/framework.ts:169
OpenElementclass · public
@openelement/element · ./base

Custom Element base class for the compiled Part Program architecture. Subclasses are produced by the compiler; hand-written subclasses that never pass through the compiler fail closed at connect time.

class OpenElement extends OpenElementConfiguration
packages/element/src/open-element-implementation.ts:104
OpenElementAttributeinterface · public
@openelement/element · ./base

One documented attribute of a custom element declaration.

OpenElementAttribute

name: string (required); type?: string (optional); default?: string (optional); description?: string (optional); reflects?: boolean (optional); fieldName?: string (optional)

packages/protocol/src/manifest.ts:15
OpenElementCssPartinterface · public
@openelement/element · ./base

One documented CSS part of a custom element declaration.

OpenElementCssPart

name: string (required); description?: string (optional)

packages/protocol/src/manifest.ts:38
OpenElementDeclarationinterface · public
@openelement/element · ./base

One custom element declaration in a package manifest: tag, members and delivery metadata.

OpenElementDeclaration

tagName: string (required); className?: string (optional); superclassName?: string (optional); attributes?: OpenElementAttribute[] (optional); events?: OpenElementEvent[] (optional); slots?: OpenElementSlot[] (optional); cssParts?: OpenElementCssPart[] (optional); openElement.ssr?: boolean (optional); openElement.dsd?: boolean (optional); openElement.layer?: ComponentLayer (optional); openElement.hydrate?: "load" | "idle" | "visible" | "only" | "none" (optional); openElement.status?: "stable" | "experimental" (optional) — Stability marker from the owning package's manifest policy.; openElement.module?: string (optional); openElement.export?: string (optional); openElement.tailwind?: OpenElementTailwindDeclaration (optional); description?: string (optional)

packages/protocol/src/manifest.ts:85
OpenElementErrorclass · public
@openelement/element · ./base

Framework error carrying a stable code, severity, phase and recoverability contract.

class OpenElementError extends Error
packages/protocol/src/errors.ts:100
OpenElementEventinterface · public
@openelement/element · ./base

One documented custom event of a custom element declaration.

OpenElementEvent

name: string (required); type?: string (optional); description?: string (optional)

packages/protocol/src/manifest.ts:25
OpenElementPackageManifestinterface · public
@openelement/element · ./base

Package manifest of component declarations (not a Custom Elements Manifest).

OpenElementPackageManifest

schemaVersion: string (required); packageName: string (required); version: string (required); description?: string (optional); author?: string (optional); license?: string (optional); homepage?: string (optional); repository?: string (optional); declarations: OpenElementDeclaration[] (required)

packages/protocol/src/manifest.ts:98
OpenElementRouteKindtype · public
@openelement/element · ./base

Host-agnostic route and asset contracts shared by app and build drivers.

OpenElementRouteKind
packages/protocol/src/app-model.ts:2
OpenElementRouteNodeinterface · public
@openelement/element · ./base

One node of the host-agnostic route tree: the matched URL `path` and route kind, the source and module paths the drivers resolve, the optional registered tag and param names, and the nested `children`.

OpenElementRouteNode

kind: OpenElementRouteKind (required); path: string (required); filePath?: string (optional); importPath?: string (optional); tagName?: string (optional); paramNames?: string[] (optional); children?: OpenElementRouteNode[] (optional); meta?: Record<string, unknown> (optional)

packages/protocol/src/app-model.ts:9
OpenElementSlotinterface · public
@openelement/element · ./base

One documented slot of a custom element declaration.

OpenElementSlot

name: string (required); description?: string (optional)

packages/protocol/src/manifest.ts:32
PROBLEM_JSON_MEDIA_TYPEconst · public
@openelement/element · ./base

Media type of the RFC 9457 action error channel (#863).

"application/problem+json"
packages/protocol/src/data.ts:117
ProblemDetailsinterface · public
@openelement/element · ./base

RFC 9457 Problem Details document (#863): the action error channel answers `application/problem+json` instead of the bespoke `{ type: 'error', error: { message } }` JSON, so HTTP tooling recognizes failures natively. With `type: 'about:blank'`, `title` is the HTTP reason phrase and `detail` carries the specific explanation. The wire shape is alpha-unfrozen; the 1.0 acceptance freezes it in this problem+json form.

ProblemDetails

type: string (required) — URI reference identifying the problem type; 'about:blank' when none applies.; title: string (required) — Short human-readable summary (the HTTP reason phrase for 'about:blank').; status.toString: (radix?: number) => string (required) — Returns a string representation of an object.; status.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; status.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; status.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; status.valueOf: () => number (required) — Returns the primitive value of the specified object.; status.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.; detail?: string (optional) — Human-readable explanation specific to this occurrence.

packages/protocol/src/data.ts:105
propertyfunction · public
@openelement/element · ./base

Compiler-recognized property decorator; inert no-op at runtime.

(_options: { reflect: boolean; attribute?: false | string; type?: unknown; converter?: unknown; }): (target: unknown, context?: unknown) => void

reflect: boolean (required); attribute?: string | false (optional); type?: unknown (optional); converter?: unknown (optional)

packages/element/src/internal/core/compile-decorators.ts:34
provideContextfunction · public
@openelement/element · ./base

Provide a plain protocol value; the provider Signal remains OE-private.

<T>(host: HTMLElement, context: Context<T>, value: T): Unsubscribe
packages/element/src/internal/core/signal-context.ts:109
ReadonlySignalinterface · public
@openelement/element · ./base

Read-only signal protocol used by computed values.

ReadonlySignal<T>

value: T (required); subscribe: (fn: (value: T) => void) => Unsubscribe (required); __@SIGNAL_BRAND@5496.valueOf: () => boolean (required) — Returns the primitive value of the specified object.

packages/protocol/src/signal.ts:26
RenderErrorclass · public
@openelement/element · ./base

Recoverable render-phase error carrying the failing component path and tag.

class RenderError extends OpenElementError
packages/element/src/internal/core/errors.ts:95
renderToStringfunction · public
@openelement/element · ./base

Server-render one compiled element through canonical Element composition: returns the serialized DSD `html` string directly.

(input: string | CustomElementConstructor, options?: RenderToStringOptions): string
packages/element/src/public-runtime.ts:950
RenderToStringOptionsinterface · public
@openelement/element · ./base

Options for one `renderToString()` call: the compiled component class to serialize, the values projected onto its compiled properties, optional route/source diagnostics metadata, the nested compiled tags the build admitted, and trusted parent-owned light children keyed by slot name.

RenderToStringOptions

componentClass?: CustomElementConstructor (optional); props?: Record<string, unknown> (optional); sourceInfo.route?: string (optional); sourceInfo.source?: string (optional); ssrRenderableTags?: readonly string[] (optional) — Build-admitted nested compiled tags. Omitted means shell-only rendering.; projectedChildren?: ReadonlyMap<string, TrustedHtml> (optional) — Trusted parent-owned light children keyed by slot name.; hostChildren?: TrustedHtml (optional) — Trusted parent-owned light children emitted AFTER the host's DSD template (a shadow-root host's slotted content). This is the shadow-side sibling of `projectedChildren`: a light root substitutes projections into its own `<slot>` elements, a shadow root distributes appended light DOM natively. Both are the compiled children channel — compiler-produced final HTML carrying the trustedHtml brand, nev…; documentStyles?: DocumentStyleSink (optional) — The render's document stylesheet collection (alpha15 S lane, S-C1.2). Every light-root component serialized in this render reports its external sheet URLs here, and the document wrapper declares them in the head. The caller owns the collection's lifetime — one per document render — so styles discovered for one page can never reach another page's head.

packages/element/src/public-runtime.ts:239
reportErrorfunction · public
@openelement/element · ./base

Report an {@linkcode OpenElementError} to the telemetry hook, or console.error when none is installed.

(error: OpenElementError): void

code: string (required); severity: ErrorSeverity (required); phase: ErrorPhase (required); recoverable: boolean (required); statusCode.toString: (radix?: number) => string (required) — Returns a string representation of an object.; statusCode.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; statusCode.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; statusCode.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; statusCode.valueOf: () => number (required) — Returns the primitive value of the specified object.; statusCode.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.; toJSON: () => Record<string, unknown> (required); name: string (required); message: string (required); stack?: string (optional); cause?: unknown (optional)

packages/element/src/internal/core/errors.ts:139
RouteEntryinterface · public
@openelement/element · ./base

One route admitted by the scanner: URL `path`, source `filePath`, the route `type`, the generated variable name (`varName`) the entry binds it to, and the optional registration tag. {@link RouteEntry.definePage} and {@link RouteEntry.hasEnhancedForms} carry the two source-derived admission facts the generated entries branch on.

RouteEntry

path: string (required); filePath: string (required); type: "page" | "api" | "island" | "special" (required); varName: string (required); tagName?: string (optional); definePage?: boolean (optional) — True when the route module's default export is a definePage() definition (#960 — registration decoupling). The generated entry registers the page class under the path-derived fallback tag and IGNORES the tagName export for registration: on a definePage route the export only names a content element. Plain element routes keep tagName as their registration tag.; functionPage?: string (optional) — The server function page fact (alpha15 server lane): the exported server function component the route's `export default definePage(Component)` was called over. Present only when the argument is a plain identifier resolving to a component THIS module declares — an inline arrow or an unexported local never records it (the R1 admission rule mirrored, so a shape whose JSX would escape to runtime is n…; source?: string (optional) — Source text captured during scanning when includeSource is enabled.; hasEnhancedForms?: boolean (optional) — True when the page route source carries data-open-enhance (#569): the client entry must ship the form-enhancement layer even when the app has zero islands.; special?: SpecialFileType (optional); params?: string[] (optional)

packages/protocol/src/framework.ts:113
ServerRouteContextinterface · public
@openelement/element · ./base

Canonical request-time/SSG server route context.

ServerRouteContext<Env, Platform, Route>

request: Request (required); params: Record<string, string> (required); env: Env (required); platform: Platform (required); responseHeaders: Headers (required) — Mutable response-only channel merged into the framework response.; route: Route (required)

packages/protocol/src/data.ts:25
ServerRouteMetadatainterface · public
@openelement/element · ./base

Context passed to a request-time ('dynamic') route loader. This is the server contract: the loader runs on the server with the Web-standard request, matched route params, the host environment and the platform object, and signals validation failure via fail()/redirect().

ServerRouteMetadata

path: string (required); filePath: string (required)

packages/protocol/src/data.ts:19
setErrorTelemetryHookfunction · public
@openelement/element · ./base

Install the process-wide error telemetry hook (replaceable for tests, HMR, multi-app pages).

(hook: ErrorTelemetryHook): void
packages/element/src/internal/core/errors.ts:127
signalfunction · public
@openelement/element · ./base

Create a writable signal through the selected signal engine.

<T>(initialValue: T): WritableSignal<T>
packages/element/src/internal/signal/framework.ts:19
Signaltype · public
@openelement/element · ./base

Alias for APIs that accept either writable or read-only signals.

Signal<T>
packages/protocol/src/signal.ts:31
SpecialFileTypetype · public
@openelement/element · ./base

Special file kinds the route scanner recognizes by filename: `renderer` and `middleware`.

SpecialFileType
packages/protocol/src/framework.ts:79
SsrAdmissionDecisioninterface · public
@openelement/element · ./base

The build's admission verdict for one discovered tag: where the declaration lives (`modulePath`), how it was discovered (`source`), which render path it is admitted to, and the reason recorded for the manifest.

SsrAdmissionDecision

tagName: string (required); modulePath: string (required) — Module path of the island declaration. Empty for 'foreign' decisions: a foreign tag is consumed in JSX but declares no module the build owns.; source: "local" | "package" | "nested" | "foreign" (required) — 'foreign' (#979): a third-party WC tag discovered by the foreign-tag scanner in page/island JSX — recorded for visibility only; SSR still treats it as an opaque passthrough (renderPath 'client-only').; renderPath: "ssr+client" | "client-only" | "rejected" (required); reason: string (required)

packages/protocol/src/render.ts:37
STREAM_FRAME_FORBIDDEN_TAGSconst · public
@openelement/element · ./base

Tags a deferred frame cannot safely install into an owned Part range: the browser installer rejects any frame whose markup carries one of these.

readonly ["script", "style", "template", "iframe", "object", "embed", "base", "meta", "link"]
packages/protocol/src/stream-frame-policy.ts:26
STREAM_FRAME_UNSAFE_URLconst · public
@openelement/element · ./base

Schemes that make a URL attribute unsafe in a streamed frame.

RegExp
packages/protocol/src/stream-frame-policy.ts:60
STREAM_FRAME_URL_ATTRIBUTESconst · public
@openelement/element · ./base

URL-carrying attributes the frame check screens for script-bearing scheme obfuscation; only these attribute names are value-screened.

readonly ["href", "src", "action", "formaction", "xlink:href"]
packages/protocol/src/stream-frame-policy.ts:42
STREAM_FRAME_URL_CONTROL_MAXconst · public
@openelement/element · ./base

Control characters at or below this code point are stripped before the URL-scheme test, so tab/newline/control obfuscation cannot smuggle a scheme past admission.

32
packages/protocol/src/stream-frame-policy.ts:55
STREAM_MAX_FIELDSconst · public
@openelement/element · ./base

Deferred fields (declared streamed properties) one stream route's manifest may carry. The build scan, the server executor, and the browser seed contract enforce the same bound.

32
packages/protocol/src/policy.ts:24
STREAM_MAX_OWNERSconst · public
@openelement/element · ./base

Part/Block owners one stream route's manifest may address in total across all deferred fields.

64
packages/protocol/src/policy.ts:30
STREAM_MAX_PAYLOAD_LENGTHconst · public
@openelement/element · ./base

Serialized stream payload bound, as a string length in UTF-16 code units: one seed attribute or one deferred frame's markup may not exceed it. The server checks the JSON text and the rendered range before emitting; the browser checks the attribute before parsing.

number
packages/protocol/src/policy.ts:45
STREAM_MAX_SEED_PROPERTIESconst · public
@openelement/element · ./base

Typed properties one streamed seed may carry: the browser seed contract rejects the WHOLE seed above this count, so an oversized component would silently fail to hydrate instead of failing loud at the server.

64
packages/protocol/src/policy.ts:37
STREAM_TIMEOUT_MSconst · public
@openelement/element · ./base

Deferred-field resolution budget (milliseconds) for one streamed response: fields still pending when it expires are failed in place and the stream ends with the shell and whatever resolved.

30000
packages/protocol/src/policy.ts:64
StreamShellExecutorinterface · public
@openelement/element · ./base

Initial shell, typed seed, and bounded updates for a stream shell request.

StreamShellExecutor

shell: string (required); owner: StreamOwner (required); seed: Record<string, { state: "resolved"; type: string; value: unknown; } | { state: "pending"; type: string; } | { state: "missing"; type: string; }> (required); resolvedValue: (field: string, value: unknown) => unknown (required); serializeResolved: (field: string, value: unknown) => string[] (required)

packages/element/src/public-runtime.ts:452
StreamShellManifestinterface · public
@openelement/element · ./base

Maps route-local deferred fields to the compiled Part or Block owners they update.

StreamShellManifest

program: { version: number; tag: string; sha256: string; } (required); fields: readonly { field: string; signal: string; owners: readonly { kind: "part" | "region"; index: number; }[]; }[] (required)

packages/element/src/public-runtime.ts:431
StyleSheetconst · public
@openelement/element · ./base

Cross-realm StyleSheet constructor: the native CSSStyleSheet or the internal shim.

new () => StyleSheetLike
packages/element/src/internal/core/style-sheet.ts:110
StyleSheetLikeinterface · public
@openelement/element · ./base

Minimal stylesheet contract (replaceSync + cssRules) satisfied by native and shim sheets.

StyleSheetLike

replaceSync: (text: string) => void (required); cssRules: StyleSheetRule[] (required)

packages/protocol/src/style-sheet.ts:14
trustedHtmlfunction · public
@openelement/element · ./base

Mark an HTML string as trusted for explicit `innerHTML` sinks (the trust does not serialize).

(html: string): TrustedHtml
packages/element/src/internal/core/security.ts:86
TrustedHtmlinterface · public
@openelement/element · ./base

Opaque capability marking HTML the application has explicitly vetted as trusted.

TrustedHtml

html: string (required)

packages/element/src/internal/core/security.ts:81
unsafeStreamFrameAttributefunction · public
@openelement/element · ./base

Whether a static attribute (name/value as authored into the Part Program) makes a streamed frame unsafely installable: event-handler, seed-spoofing, and srcdoc names fail outright, and URL-carrying names fail when the entity-decoded, control-stripped value carries a script scheme.

(name: string, value: string): boolean
packages/protocol/src/stream-frame-policy.ts:113
wrapInDocumentfunction · public
@openelement/element · ./base

Wrap rendered HTML in a full HTML document. Adds DOCTYPE, head (title, meta, preload), and body. Supports CSP nonce and dev scripts (e.g. Vite client, route module registration).

(html: string, options?: DocumentWrapOptions): string
packages/element/src/internal/core/html-escape.ts:199
composeFetchMiddlewarefunction · public
@openelement/element · ./build-utils

Compose a fetch middleware chain (#858) around a handler, in onion order: `middleware[0]` is outermost — it sees the request first and the response last. A middleware may short-circuit by returning a Response without calling `next()`. Extra arguments (runtime context such as env/platform) thread transparently past the middleware chain to the terminal handler — the WinterCG-shaped middleware itself only ever sees `(request, next)`. Generated server entries call this once at module scope so the dev server, the `start` CLI, the e2e fixture server, and the Nitro production entry all share the same composed handler.

<Args extends unknown[]>(middleware: Middleware[], handler: (request: Request, ...args: Args) => Promise<Response>): (request: Request, ...args: Args) => Promise<Response>
packages/element/src/internal/core/runtime.ts:47
createRuntimeAdapterfunction · public
@openelement/element · ./build-utils

Normalize a runtime adapter declaration: pass the name, fetch handler and optional prerender iterator through unchanged so a host integration only implements the {@link RuntimeAdapter} contract it needs.

<Env extends Record<string, unknown> = Record<string, unknown>>(options: RuntimeAdapterOptions<Env>): RuntimeAdapter<Env>

name: string (required); fetch: OpenElementRequestHandler<Env> (required); prerender?: (() => AsyncIterable<RuntimePrerenderResult> | Iterable<RuntimePrerenderResult>) (optional)

packages/element/src/internal/core/runtime.ts:23
formatJsonfunction · public
@openelement/element · ./build-utils

Serialize a value to pretty-printed JSON ending with a newline.

(value: unknown): string
packages/element/src/internal/core/write-json.ts:11
insertBeforeBodyClosefunction · public
@openelement/element · ./build-utils

Insert markup before a tolerant HTML body close (`</body >`, case-insensitive).

(html: string, content: string): string
packages/element/src/internal/core/html-route-utils.ts:2
normalizeSeparatorsfunction · public
@openelement/element · ./build-utils

Normalize path separators and collapse duplicates. - Backslashes and forward slashes are replaced with the chosen separator. - Repeated separators are collapsed to a single separator.

(path: string, sep?: "/" | "-"): string
packages/element/src/internal/core/path-utils.ts:17
OpenElementRequestHandlertype · public
@openelement/element · ./build-utils

The host-neutral request handler every runtime adapter and generated server entry exposes: a WinterCG `(request, context?) => Response` with no server engine dialect baked in.

OpenElementRequestHandler<Env>
packages/protocol/src/runtime.ts:27
pathToTagNamefunction · public
@openelement/element · ./build-utils

Convert a file path into a kebab-cased custom element tag name. - Removes a leading `./` or `/`. - Strips known file extensions (`ts`, `tsx`, `js`, `jsx`, `mjs`, `mdx`). - Replaces directory separators with hyphens. - Ensures the result starts with a letter and contains at least one hyphen.

(filePath: string): string
packages/element/src/internal/core/path-utils.ts:32
RuntimeContextinterface · public
@openelement/element · ./build-utils

runtime.ts - Runtime adapter protocol. Replacement boundary for Nitro, Workers, Node, Deno, or future fetch-compatible runtimes. Preserves openElement semantics while leaving concrete server engines outside this package.

RuntimeContext<Env>

env?: Env (optional); platform?: unknown (optional); params?: Record<string, string> (optional)

packages/protocol/src/runtime.ts:9
SsrRenderErrorclass · public
@openelement/element · ./build-utils

Thrown by the SSG build pipeline when the SSR bundle fails to load or the pipeline throws; re-exported via `@openelement/element/build-utils`. Carries the failing component path plus the original error as `cause`.

class SsrRenderError extends OpenElementError
packages/element/src/internal/core/errors.ts:74
transformIslandSourcefunction · public
@openelement/element · ./build-utils

Inject island metadata markers into source code. Only transforms files inside the islands directory. Tag names are derived from the file path and normalized to valid custom element names (lowercase letters, digits, and hyphens). Unsafe characters are silently normalized to hyphens.

(source: string, options: IslandTransformOptions): IslandTransformResult
packages/element/src/internal/core/island-transform.ts:20
__setRequestTimeStyleSheetUrlsfunction · public
@openelement/element · ./client-only

Set the emitted component stylesheet URLs for this server process. Called by the router's generated SSR/SSG entry (build time and request-time startup) with the base-joined asset addresses Phase 2 emitted.

(urls: readonly string[] | null | undefined): void
packages/element/src/internal/compiled/server/style-links.ts:29
Actiontype · public
@openelement/element · ./client-only

Route action: handles form submissions for a page route.

Action<T, Env, Platform, Route>
packages/protocol/src/data.ts:64
ACTION_FETCH_HEADERconst · public
@openelement/element · ./client-only

Request header selecting the action response channel: `true` marks a programmatic caller and selects the serialized ActionResult union; `enhance` marks the built-in morph enhancement and selects the same full-HTML responses the no-JS path receives.

"x-openelement-action"
packages/protocol/src/data.ts:125
ActionContextinterface · public
@openelement/element · ./client-only

Context passed to a route action function (extends loader context).

ActionContext<Env, Platform, Route>

formData: FormData (required); request: Request (required); params: Record<string, string> (required); env: Env (required); platform: Platform (required); responseHeaders: Headers (required) — Mutable response-only channel merged into the framework response.; route: Route (required)

packages/protocol/src/data.ts:47
ActionResulttype · public
@openelement/element · ./client-only

Wire shape returned to the JavaScript form-enhancement path. The no-JS path never sees this: it gets the equivalent semantics as plain HTTP (303 on success, 422 with the re-rendered form on validation failure, redirect/error as status codes). Success carries no data envelope. The application-loop contract makes a successful non-GET action answer 303 (PRG) — the framework never answers 200 with a rendered page, or with a success document, for a successful mutation — so the fetch channel answers `{ type: 'redirect' }` naming the PRG target and the authored return value is discarded by design. Success data travels the PRG target instead (query state the loader re-runs with, which the props projector then maps; see the router guide's "Form actions" section). The union previously declared a `{ type: 'success' }` member that no code path ever emitted — removed so the type matches the wire. Error outcomes (CSRF 403, unknown action 404, unparseable body 400, unexpected 500) are NOT part of this union: since #863 they answer RFC 9457 Problem Details with the PROBLEM_JSON_MEDIA_TYPE content type — see ProblemDetails.

ActionResult<Failure>
packages/protocol/src/data.ts:92
assertValidTagNamefunction · public
@openelement/element · ./client-only

Assert that a tag name is a valid custom element name.

(tagName: string): void
packages/element/src/internal/core/tag-utils.ts:50
collectPublicPropsfunction · public
@openelement/element · ./client-only

Collect all public (non-internal) own properties from a host object. Keys starting with `__openElement` are framework-internal and excluded. Uses Reflect.get for safe access (respects getters); a getter that throws is skipped with a warning so one bad prop cannot take the tree down.

(host: object): Record<string, unknown>
packages/element/src/internal/core/props-utils.ts:41
CompatibilityClassificationinterface · public
@openelement/element · ./client-only

The per-tag verdict the compatibility scanner records: the tier a discovered tag was classified as, the human-readable `reason`, where the tag was found (`source`), and the SSR/DSD/hydration facts the verdict was derived from.

CompatibilityClassification

tagName: string (required); tier: CompatibilityTier (required); reason: string (required); source: "local" | "package" | "nested" (required); modulePath?: string (optional); ssr?: boolean (optional); dsd?: boolean (optional); hydrate?: string (optional)

packages/protocol/src/framework.ts:352
CompatibilityTiertype · public
@openelement/element · ./client-only

How far a discovered tag may participate in the build: 'ssr-capable' renders and hydrates, 'client-only' ships to the browser without server output, 'experimental-dom' is admitted with a downgraded guarantee, and 'rejected' fails the build.

CompatibilityTier
packages/protocol/src/framework.ts:345
ComponentLayertype · public
@openelement/element · ./client-only

The delivery layer a component belongs to: fully static DSD markup ('dsd-static'), DSD markup with a client island ('dsd-interactive'), a client-only island with no SSR output ('pure-island'), or a light-DOM element ('light-dom'). Recorded per component in the build manifest and consumed by the hydration scheduler.

ComponentLayer
packages/protocol/src/framework.ts:23
computedfunction · public
@openelement/element · ./client-only

Create a derived read-only signal recomputed from its dependencies.

<T>(fn: () => T): ReadonlySignal<T>
packages/element/src/internal/signal/framework.ts:23
consumeContextfunction · public
@openelement/element · ./client-only

Consumer-local reactive projection of a protocol context value.

<T>(context: Context<T>, host?: HTMLElement): WritableSignal<T>

key.toString: () => string (required) — Returns a string representation of an object.; key.valueOf: () => symbol (required) — Returns the primitive value of the specified object.; key.description: string (required) — Expose the [[Description]] internal slot of a symbol directly.; key.__@toPrimitive@6557: (hint: string) => symbol (required) — Converts a Symbol object to a symbol.; key.__@toStringTag@6559: string (required); defaultValue: T (required)

packages/element/src/internal/core/signal-context.ts:141
Contextinterface · public
@openelement/element · ./client-only

A typed context token: protocol identity (`key`) plus its default value.

Context<T>

key.toString: () => string (required) — Returns a string representation of an object.; key.valueOf: () => symbol (required) — Returns the primitive value of the specified object.; key.description: string (required) — Expose the [[Description]] internal slot of a symbol directly.; key.__@toPrimitive@6557: (hint: string) => symbol (required) — Converts a Symbol object to a symbol.; key.__@toStringTag@6559: string (required); defaultValue: T (required)

packages/element/src/internal/core/signal-context.ts:13
createContextfunction · public
@openelement/element · ./client-only

Create a typed context token shared between provider and consumer elements.

<T>(key: symbol, defaultValue: T): Context<T>

toString: () => string (required) — Returns a string representation of an object.; valueOf: () => symbol (required) — Returns the primitive value of the specified object.; description: string (required) — Expose the [[Description]] internal slot of a symbol directly.; __@toPrimitive@6557: (hint: string) => symbol (required) — Converts a Symbol object to a symbol.; __@toStringTag@6559: string (required)

packages/element/src/internal/core/signal-context.ts:58
createDocumentStyleResourcesfunction · public
@openelement/element · ./client-only

Create the per-render document stylesheet collection.

(): DocumentStyleResources
packages/element/src/internal/core/html-escape.ts:133
createLoggerfunction · public
@openelement/element · ./client-only

Create a {@link Logger} that prefixes every message with `[tag]`.

(tag: string): Logger
packages/element/src/internal/core/logger.ts:18
createStreamShellExecutorfunction · public
@openelement/element · ./client-only

Create one request-local stream shell from a generated route manifest. The manifest hash is checked against the exact runtime wire program before any shell can be produced.

(options: CreateStreamShellOptions): Promise<StreamShellExecutor>

componentClass: CustomElementConstructor (required); props?: Record<string, unknown> (optional); manifest: StreamShellManifest (required); instanceId: string (required); documentToken?: string (optional); documentStyles?: DocumentStyleSink (optional) — The streamed document's stylesheet collection (see RenderToStringOptions).

packages/element/src/public-runtime.ts:516
CreateStreamShellOptionsinterface · public
@openelement/element · ./client-only

Inputs for a request-scoped stream shell executor.

CreateStreamShellOptions

componentClass: CustomElementConstructor (required); props?: Record<string, unknown> (optional); manifest: StreamShellManifest (required); instanceId: string (required); documentToken?: string (optional); documentStyles?: DocumentStyleSink (optional) — The streamed document's stylesheet collection (see RenderToStringOptions).

packages/element/src/public-runtime.ts:441
DANGEROUS_KEYSconst · public
@openelement/element · ./client-only

Object prototype keys that must never be injected from untrusted props.

ReadonlySet<string>
packages/element/src/internal/core/security.ts:25
deepGetElementByIdfunction · public
@openelement/element · ./client-only

Resolve `id` (a `#hash` or bare id) against `root` and, when the id is not in that root's own tree, recurse into every nested shadow root. Returns the first match or `null`; a malformed percent-encoded id is not an error.

(id: string, root?: Document | ShadowRoot): HTMLElement | null
packages/element/src/internal/core/deep-fragment.ts:20
documentStreamPartsfunction · public
@openelement/element · ./client-only

The same document serialization boundary, with only body wrappers left open.

(options?: DocumentWrapOptions): { prefix: string; suffix: string; }

title?: string (optional); lang?: string (optional); clientScript?: string (optional); scripts?: DocumentScriptDescriptor[] (optional); meta.description?: string (optional); meta.tags?: Record<string, string | number | boolean>[] (optional); devScripts?: string (optional); headExtras?: string (optional); dangerouslyHeadFragments?: string[] (optional); allowHeadExtrasScripts?: boolean (optional); links?: { rel: string; href: string; hreflang?: string; }[] (optional); structuredData?: readonly Record<string, unknown>[] (optional); cspNonce?: string (optional); streamBootstrap?: string (optional) — Trusted framework bootstrap emitted synchronously in the document head.; styleLinks?: readonly string[] (optional) — The document's light-root component stylesheets: external resource URLs (alpha15 S lane, S-C1.2) serialized as marked `<link rel="stylesheet">` nodes after `headExtras`, so a light component is styled by the document that contains it — without JavaScript and without a runtime style node.

packages/element/src/internal/core/html-escape.ts:205
DocumentStyleResourcesinterface · public
@openelement/element · ./client-only

The document-level stylesheet resources ONE server render discovered (alpha15 S lane, S-C1.2). A light-root component's DOM lives in the document, so its sheet cannot ride the component's own subtree the way a shadow template's link does: the document owns it. This object is the one carrier between the two halves of that render — the compiled serializer, which discovers a component's external sheets while serializing the component, and the document serializer, which writes the head. It is created per render and never shared, so one page's stylesheets can never reach another page's head.

DocumentStyleResources

links: readonly string[] (required) — Discovered resource URLs, deduplicated, in discovery (cascade) order.; add: (urls: readonly string[]) => void (required) — Record the external stylesheet URLs one rendered component contributes.

packages/element/src/internal/core/html-escape.ts:125
effectfunction · public
@openelement/element · ./client-only

Run a side effect that re-subscribes whenever its signal dependencies change.

(fn: () => void | Unsubscribe): Unsubscribe
packages/element/src/internal/signal/framework.ts:27
elementfunction · public
@openelement/element · ./client-only

Compiler-recognized element decorator; inert no-op at runtime.

(_tag: string, _options?: { root?: "light" | "shadow-open" | "shadow-closed"; delegatesFocus?: boolean; formAssociated?: boolean; }): (target: unknown, context?: unknown) => void
packages/element/src/internal/core/compile-decorators.ts:20
ensureDeepFragmentNavigationfunction · public
@openelement/element · ./client-only

Install (once per document) framework-level fragment navigation: a same-document anchor click whose target lives inside a nested shadow root scrolls to it and pushes the hash instead of being dropped by the browser. `{ enabled: false }` opts an application out.

(options?: DeepFragmentOptions): void

enabled?: boolean (optional) — Set false before installation to opt out for an application.

packages/element/src/internal/core/deep-fragment.ts:67
ensurePreHydrationClickCapturefunction · public
@openelement/element · ./client-only

Install the bounded pre-upgrade interaction capture on an owning root (default: the document). Generated client entries call this with their declared island tags before any compiled element upgrades; after a successful claim the element replays the captured events whose targets live inside its root (compiled claim capture/replay, internal/compiled/runtime.ts). Idempotent per root (repeat calls merge tags, never reinstall listeners) and a no-op where no DOM exists (SSR). Invariant: the capture itself — one fixed listener set per owning root, installed once per page — is page-lifetime by design and is NOT the leak. The M1 leak was retained event-target records; each element releases exactly its own records at its activation decision (success or failure), while records owned by still-pending elements survive for their delayed/lazy upgrade (#1170). Boundedness: the facade capture passes the declared-island filter, so only interactions under a still-pending DECLARED island tag enter the queue — ordinary events and undeclared third-party custom elements are skipped (nested pending declared islands still capture through their own unsettled host). With no tags declared the legacy dash heuristic applies. The shared queue carries a hard capacity cap (fail closed), detached records are swept when a claim root adopts its share (and under queue pressure), and each activation decision deterministically empties that root's own bucket, so post-hydration traffic and removals never grow retention.

(root?: EventTarget, pendingTags?: readonly string[]): void

addEventListener: (type: string, callback: EventListenerOrEventListenerObject | null, options?: AddEventListenerOptions | boolean) => void (required) — The **`addEventListener()`** method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target. [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener); dispatchEvent: (event: Event) => boolean (required) — The **`dispatchEvent()`** method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order. The normal event processing rules (including the capturing and optional bubbling phase) also apply to events dispatched manually with dispatchEvent(). [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent); removeEventListener: (type: string, callback: EventListenerOrEventListenerObject | null, options?: EventListenerOptions | boolean) => void (required) — The **`removeEventListener()`** method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target. The event listener to be removed is identified using a combination of the event type, the event listener function itself, and various optional options that may affect the matching process; see Matching event listeners for removal.…

packages/element/src/internal/compiled/runtime/pre-upgrade-events.ts:672
ERROR_PREFIXconst · public
@openelement/element · ./client-only

Error message prefix for all openElement errors.

"[openElement]"
packages/protocol/src/errors.ts:50
ErrorBoundaryclass · public
@openelement/element · ./client-only

Base class for elements that catch descendant render/hydration errors and apply a retry policy.

class ErrorBoundary extends OpenElement
packages/element/src/error-boundary.ts:45
ErrorTelemetryHooktype · public
@openelement/element · ./client-only

Callback receiving every reported {@linkcode OpenElementError} for telemetry.

ErrorTelemetryHook
packages/protocol/src/errors.ts:132
escapeAttrfunction · public
@openelement/element · ./client-only

Escape an HTML attribute value. Delegates to `escapeHtml` so both share the single `ESCAPE_MAP` and the same single-pass replacement (consolidated in #633). Empty-value conventions remain intentionally distinct by design: - `escapeHtml` returns '' for non-string input. - `escapeAttrValue` (below) coerces via `String()` and is the boundary meant for unknown/variable attribute values.

(value: string): string
packages/element/src/internal/core/html-escape.ts:55
escapeHtmlfunction · public
@openelement/element · ./client-only

Escape the five HTML-significant characters in text content.

(str: string): string
packages/element/src/internal/core/html-escape.ts:39
formatErrorfunction · public
@openelement/element · ./client-only

Format an unknown thrown value as a human-readable string.

(e: unknown): string
packages/element/src/internal/core/errors.ts:52
FrameworkOptionsinterface · public
@openelement/element · ./client-only

The adapter-facing framework options: where routes and islands live, which renderer serializes pages, the default layout and named-layout declarations, the document `<html>`/head injection channels, and the request-time middleware switches. Every field is optional; the adapter applies its documented default. This is the type an application config file's default export is checked against, so the rendered option table and the actual config surface cannot drift.

FrameworkOptions

renderer?: "native" | "lit" (optional) — Page renderer selection (Beta.2.2, #1339). EXPLICIT, never inferred: 'native' (default) renders pages through the compiled Part Program serializer (renderToString); 'lit' renders LitElement pages through; routesDir?: string (optional) — Directory the route scanner walks, relative to the Vite root. Defaults to `app/routes`.; islandsDir?: string (optional) — Directory island modules are discovered in. Defaults to `app/islands`.; packageIslands?: string[] | "auto" | "manual" (optional) — How the build admits component packages whose modules the application imports. - omitted or `'auto'` (the default): the scan derives the admitted set at scan time — every package-owned element module the app's routes, pages, layouts, islands and components really reach (bundler-resolved) is attributed to its owner package (nearest `package.json`), and a package with a valid OpenElement manifest i…; layout?: LayoutConfig (optional) — Layout declaration; `false` disables the layout, `'default'` uses the built-in one.; layouts?: LayoutsConfig (optional) — Named layout declarations keyed by layout name.; headExtras?: string (optional) — @dangerous injected as-is, only use with controlled content; html.lang?: string (optional); html.title?: string (optional); inject.stylesheets?: (string | { href: string; integrity?: string; crossorigin?: "anonymous" | "use-credentials"; attrs?: Record<string, string | number | boolean>; })[] (optional) — Stylesheets linked into the document head; each entry is an href or a link record with integrity/crossorigin/attrs.; inject.scripts?: (string | { src: string; type?: string; async?: boolean; defer?: boolean; integrity?: string; crossorigin?: "anonymous" | "use-credentials"; attrs?: Record<str… (optional) — Scripts emitted into the document; each entry is a src or a script record with type/async/defer/integrity/crossorigin/attrs.; inject.headFragments?: string[] (optional) — @dangerous fragments injected as-is. Trust boundary (same level as `trustedHtml`): never concatenate user-controlled content into these fragments; sanitize untrusted data at your own system boundary first. The framework only enforces no-`<script>` and no-executable-`<style>`.; ssr.noExternal?: (string | RegExp)[] (optional); island.upgradeStrategy?: "load" | "idle" | "visible" | "only" | "none" (optional); build.outDir?: string (optional) — Output directory for the build artifacts. Defaults to `dist`.; build.manifestBudget?: { islandKB?: number; totalJsKB?: number; pageKB?: number; } (optional) — Advisory only: exceeded budgets print build-manifest warnings and never fail the build; enforce them in your own build-output test.; viewTransition?: boolean (optional) — Enable the View Transitions API for client navigations. Defaults to true.; speculation?: boolean | { prerender?: string[]; prefetch?: string[]; exclude?: string[]; eagerness?: "immediate" | "moderate" | "conservative"; } (optional) — Speculation Rules emission: `true` uses framework defaults, or pass prerender/prefetch URL lists, exclusions and an eagerness.; middleware.cors?: boolean (optional) — Built-in CORS middleware. Default-ON; pass `false` to disable.; middleware.corsOrigin?: string | string[] (optional) — Static CORS allowlist data, serialized into the generated entry as JSON. Mutually exclusive with {@link FrameworkOptions.middleware.corsOriginModule }.; middleware.corsOriginModule?: string (optional) — Path to a module that default-exports `(origin: string) => string | undefined`. The generated entry imports the module — the callback is never serialized — so it may close over module scope and import dependencies. Resolved with the same idiom as `layout.import` (e.g. './app/cors-origin.ts'). Mutually exclusive with `corsOrigin`.; middleware.requestId?: boolean (optional) — Emit and honor a per-request id header. Default-ON; pass `false` to disable.; middleware.logger?: boolean (optional) — Log each request through the built-in logger. Default-ON; pass `false` to disable.; middleware.securityHeaders?: boolean (optional) — Attach the built-in security response headers. Default-ON; pass `false` to disable.; middleware.csp?: { policy?: string; nonce?: boolean; reportOnly?: boolean; } (optional) — Content-Security-Policy emission: the policy string, nonce generation, and report-only mode.; middleware.use?: string[] (optional) — Fetch middleware chain (#858), composed around the framework handler in onion order (`use[0]` outermost), outside all built-in middleware above. Each entry is a MODULE PATH (same resolution idiom as `layout.import`, e.g. './app/middleware/auth.ts') whose default export is a {@link Middleware}; the generated entry emits `import * as __mw_N from '<path>'` and composes `__mw_N.default` in configured…

packages/protocol/src/framework.ts:181
HYDRATION_STRATEGIESconst · public
@openelement/element · ./client-only

Runtime list of supported hydration strategies; the single source of truth for the `HydrationStrategy` union. Consumed by island/registry validation and re-exported from the element root for app and build adapters.

readonly ["load", "idle", "visible", "only", "none"]
packages/protocol/src/framework.ts:28
HydrationStrategytype · public
@openelement/element · ./client-only

Island hydration trigger: 'load' | 'idle' | 'visible' | 'only'.

"load" | "idle" | "visible" | "only" | "none"
packages/protocol/src/framework.ts:30
IDLE_FALLBACK_TIMEOUT_MSconst · public
@openelement/element · ./client-only

Idle-hydration scheduling fallback (milliseconds) when neither `requestIdleCallback` nor `requestAnimationFrame` is available.

50
packages/protocol/src/policy.ts:70
injectPropsSafefunction · public
@openelement/element · ./client-only

Safely assign caller-supplied props onto a target object, skipping keys that could enable prototype pollution and tolerating read-only properties. The canonical guarded assigner for the canonical dangerous-key rule (#903, #1214): the

(target: Record<string, unknown>, props: Record<string, unknown>, tagName: string, log?: { warn(message: string): void; debug(message: string): void; }): void
packages/element/src/internal/core/security.ts:119
isDangerousKeyfunction · public
@openelement/element · ./client-only

Shared dangerous-key predicate (#903, #1214). Prototype-internal keys must never be injected from untrusted props on ANY path: host prop collection (collectPublicProps / normalizePublicProps in props-utils.ts), guarded assignment (injectPropsSafe below — the SPA bootstrap page-projection write boundary in

(key: string): boolean
packages/element/src/internal/core/security.ts:51
IslandOptionsinterface · public
@openelement/element · ./client-only

Per-island delivery options (hydration strategy, SSR/DSD participation).

IslandOptions

hydrate?: "load" | "idle" | "visible" | "only" | "none" (optional) — Hydration strategy: - 'load': load immediately when module is imported - 'idle': defer to requestIdleCallback (default) - 'visible': use IntersectionObserver to defer until element is visible - 'only': client-only render, no DSD/SSR output Named `hydrate` to match `defineIslandConfig()` in the Router package — one option name across both packages.; dsd?: boolean (optional) — Whether to use DSD for SSR rendering of this island. Honored by the build-side island scan (via `defineIslandConfig`), not by `defineIsland()` itself: passing it in `IslandOptions` has no runtime effect.; ssr?: boolean (optional) — Whether this island may be admitted into server rendering. Like `dsd`, decided by the build-side island scan; inert when passed to `defineIsland()`.

packages/protocol/src/island.ts:8
isSafeAttributeNamefunction · public
@openelement/element · ./client-only

Shared safe-attribute-name predicate (#1033): the SSR face of the one canonical predicate in `../protocol/forbidden-sinks.ts`. A name must be valid HTML attribute-name grammar (blocks quote/space injection, #602), must not be an event handler (`on*`, case-insensitive), and must not be a forbidden sink (`innerhtml`/`srcdoc`). The compiler, protocol validator, and server serializer enforce the same predicate with their own failure strategies; every path delegates to the single implementation, so the boundary cannot diverge.

(name: string): boolean
packages/element/src/internal/core/security.ts:65
isValidTagNamefunction · public
@openelement/element · ./client-only

Check if a tag name is a valid custom element name per HTML spec.

(tagName: string): boolean
packages/element/src/internal/core/tag-utils.ts:38
LayoutConfigtype · public
@openelement/element · ./client-only

Layout declaration: `false` disables the layout entirely, `'default'` uses the built-in layout, and the object form names a tag with the module path that defines it (`import`, resolved like a {@link FrameworkOptions.middleware.use } entry) plus the compiled layout properties the router injects per route.

LayoutConfig
packages/protocol/src/framework.ts:96
Loadertype · public
@openelement/element · ./client-only

Route loader: fetches data for a page route.

Loader<T, Env, Platform, Route>
packages/protocol/src/data.ts:56
LoaderContextinterface · public
@openelement/element · ./client-only

Context passed to a request-time ('dynamic') route loader.

LoaderContext<Env, Platform, Route>

request: Request (required); params: Record<string, string> (required); env: Env (required); platform: Platform (required); responseHeaders: Headers (required) — Mutable response-only channel merged into the framework response.; route: Route (required)

packages/protocol/src/data.ts:40
LocalePathinterface · public
@openelement/element · ./client-only

Locale-aware resolved path contract.

LocalePath

locale: string (required); path: string (required); localizedPath: string (required); isDefaultLocalePath: boolean (required)

packages/protocol/src/framework.ts:82
Loggerinterface · public
@openelement/element · ./client-only

logger.ts - Tagged console logger. Lightweight scoped logger. Returns plain functions so it is tree-shakable and has zero class overhead.

Logger

debug: (msg: string, ...args: unknown[]) => void (required); info: (msg: string, ...args: unknown[]) => void (required); warn: (msg: string, ...args: unknown[]) => void (required); error: (msg: string, ...args: unknown[]) => void (required)

packages/element/src/internal/core/logger.ts:10
MAX_ACTION_BODY_BYTESconst · public
@openelement/element · ./client-only

Request-body bound (bytes) the generated entry applies to action POST routes; larger uploads belong on API routes with explicit limits.

number
packages/protocol/src/policy.ts:57
MAX_COMPOSITION_DEPTHconst · public
@openelement/element · ./client-only

Nested element expansion depth bound for `renderToString`: cyclic component composition fails closed instead of recursing without end.

8
packages/protocol/src/policy.ts:51
Middlewaretype · public
@openelement/element · ./client-only

Fetch middleware contract (#858): WinterCG shape, dialect-free — no Hono/h3 context object. Composed at the handler boundary in onion order (`use[0]` is outermost: it sees the request first and the response last), so it runs with identical semantics in the dev server, the `start` CLI, the e2e fixture server, and the Nitro production entry. A middleware may short-circuit by returning a Response without calling `next()`, or post-process the Response that `next()` returns. Module contract: a Middleware is the DEFAULT EXPORT of a module referenced from `middleware.use` by path (e.g. './app/middleware/auth.ts'). The generated server entry imports the module, so the middleware may close over module scope and import local helpers and third-party packages — it is a real module in the server module graph, never serialized source.

Middleware
packages/protocol/src/framework.ts:169
OpenElementclass · public
@openelement/element · ./client-only

Custom Element base class for the compiled Part Program architecture. Subclasses are produced by the compiler; hand-written subclasses that never pass through the compiler fail closed at connect time.

class OpenElement extends OpenElementConfiguration
packages/element/src/open-element-implementation.ts:104
OpenElementAttributeinterface · public
@openelement/element · ./client-only

One documented attribute of a custom element declaration.

OpenElementAttribute

name: string (required); type?: string (optional); default?: string (optional); description?: string (optional); reflects?: boolean (optional); fieldName?: string (optional)

packages/protocol/src/manifest.ts:15
OpenElementCssPartinterface · public
@openelement/element · ./client-only

One documented CSS part of a custom element declaration.

OpenElementCssPart

name: string (required); description?: string (optional)

packages/protocol/src/manifest.ts:38
OpenElementDeclarationinterface · public
@openelement/element · ./client-only

One custom element declaration in a package manifest: tag, members and delivery metadata.

OpenElementDeclaration

tagName: string (required); className?: string (optional); superclassName?: string (optional); attributes?: OpenElementAttribute[] (optional); events?: OpenElementEvent[] (optional); slots?: OpenElementSlot[] (optional); cssParts?: OpenElementCssPart[] (optional); openElement.ssr?: boolean (optional); openElement.dsd?: boolean (optional); openElement.layer?: ComponentLayer (optional); openElement.hydrate?: "load" | "idle" | "visible" | "only" | "none" (optional); openElement.status?: "stable" | "experimental" (optional) — Stability marker from the owning package's manifest policy.; openElement.module?: string (optional); openElement.export?: string (optional); openElement.tailwind?: OpenElementTailwindDeclaration (optional); description?: string (optional)

packages/protocol/src/manifest.ts:85
OpenElementErrorclass · public
@openelement/element · ./client-only

Framework error carrying a stable code, severity, phase and recoverability contract.

class OpenElementError extends Error
packages/protocol/src/errors.ts:100
OpenElementEventinterface · public
@openelement/element · ./client-only

One documented custom event of a custom element declaration.

OpenElementEvent

name: string (required); type?: string (optional); description?: string (optional)

packages/protocol/src/manifest.ts:25
OpenElementPackageManifestinterface · public
@openelement/element · ./client-only

Package manifest of component declarations (not a Custom Elements Manifest).

OpenElementPackageManifest

schemaVersion: string (required); packageName: string (required); version: string (required); description?: string (optional); author?: string (optional); license?: string (optional); homepage?: string (optional); repository?: string (optional); declarations: OpenElementDeclaration[] (required)

packages/protocol/src/manifest.ts:98
OpenElementRouteKindtype · public
@openelement/element · ./client-only

Host-agnostic route and asset contracts shared by app and build drivers.

OpenElementRouteKind
packages/protocol/src/app-model.ts:2
OpenElementRouteNodeinterface · public
@openelement/element · ./client-only

One node of the host-agnostic route tree: the matched URL `path` and route kind, the source and module paths the drivers resolve, the optional registered tag and param names, and the nested `children`.

OpenElementRouteNode

kind: OpenElementRouteKind (required); path: string (required); filePath?: string (optional); importPath?: string (optional); tagName?: string (optional); paramNames?: string[] (optional); children?: OpenElementRouteNode[] (optional); meta?: Record<string, unknown> (optional)

packages/protocol/src/app-model.ts:9
OpenElementSlotinterface · public
@openelement/element · ./client-only

One documented slot of a custom element declaration.

OpenElementSlot

name: string (required); description?: string (optional)

packages/protocol/src/manifest.ts:32
PROBLEM_JSON_MEDIA_TYPEconst · public
@openelement/element · ./client-only

Media type of the RFC 9457 action error channel (#863).

"application/problem+json"
packages/protocol/src/data.ts:117
ProblemDetailsinterface · public
@openelement/element · ./client-only

RFC 9457 Problem Details document (#863): the action error channel answers `application/problem+json` instead of the bespoke `{ type: 'error', error: { message } }` JSON, so HTTP tooling recognizes failures natively. With `type: 'about:blank'`, `title` is the HTTP reason phrase and `detail` carries the specific explanation. The wire shape is alpha-unfrozen; the 1.0 acceptance freezes it in this problem+json form.

ProblemDetails

type: string (required) — URI reference identifying the problem type; 'about:blank' when none applies.; title: string (required) — Short human-readable summary (the HTTP reason phrase for 'about:blank').; status.toString: (radix?: number) => string (required) — Returns a string representation of an object.; status.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; status.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; status.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; status.valueOf: () => number (required) — Returns the primitive value of the specified object.; status.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.; detail?: string (optional) — Human-readable explanation specific to this occurrence.

packages/protocol/src/data.ts:105
propertyfunction · public
@openelement/element · ./client-only

Compiler-recognized property decorator; inert no-op at runtime.

(_options: { reflect: boolean; attribute?: false | string; type?: unknown; converter?: unknown; }): (target: unknown, context?: unknown) => void

reflect: boolean (required); attribute?: string | false (optional); type?: unknown (optional); converter?: unknown (optional)

packages/element/src/internal/core/compile-decorators.ts:34
provideContextfunction · public
@openelement/element · ./client-only

Provide a plain protocol value; the provider Signal remains OE-private.

<T>(host: HTMLElement, context: Context<T>, value: T): Unsubscribe
packages/element/src/internal/core/signal-context.ts:109
ReadonlySignalinterface · public
@openelement/element · ./client-only

Read-only signal protocol used by computed values.

ReadonlySignal<T>

value: T (required); subscribe: (fn: (value: T) => void) => Unsubscribe (required); __@SIGNAL_BRAND@6710.valueOf: () => boolean (required) — Returns the primitive value of the specified object.

packages/protocol/src/signal.ts:26
RenderErrorclass · public
@openelement/element · ./client-only

Recoverable render-phase error carrying the failing component path and tag.

class RenderError extends OpenElementError
packages/element/src/internal/core/errors.ts:95
renderToStringfunction · public
@openelement/element · ./client-only

Server-render one compiled element through canonical Element composition: returns the serialized DSD `html` string directly.

(input: string | CustomElementConstructor, options?: RenderToStringOptions): string
packages/element/src/public-runtime.ts:950
RenderToStringOptionsinterface · public
@openelement/element · ./client-only

Options for one `renderToString()` call: the compiled component class to serialize, the values projected onto its compiled properties, optional route/source diagnostics metadata, the nested compiled tags the build admitted, and trusted parent-owned light children keyed by slot name.

RenderToStringOptions

componentClass?: CustomElementConstructor (optional); props?: Record<string, unknown> (optional); sourceInfo.route?: string (optional); sourceInfo.source?: string (optional); ssrRenderableTags?: readonly string[] (optional) — Build-admitted nested compiled tags. Omitted means shell-only rendering.; projectedChildren?: ReadonlyMap<string, TrustedHtml> (optional) — Trusted parent-owned light children keyed by slot name.; hostChildren?: TrustedHtml (optional) — Trusted parent-owned light children emitted AFTER the host's DSD template (a shadow-root host's slotted content). This is the shadow-side sibling of `projectedChildren`: a light root substitutes projections into its own `<slot>` elements, a shadow root distributes appended light DOM natively. Both are the compiled children channel — compiler-produced final HTML carrying the trustedHtml brand, nev…; documentStyles?: DocumentStyleSink (optional) — The render's document stylesheet collection (alpha15 S lane, S-C1.2). Every light-root component serialized in this render reports its external sheet URLs here, and the document wrapper declares them in the head. The caller owns the collection's lifetime — one per document render — so styles discovered for one page can never reach another page's head.

packages/element/src/public-runtime.ts:239
reportErrorfunction · public
@openelement/element · ./client-only

Report an {@linkcode OpenElementError} to the telemetry hook, or console.error when none is installed.

(error: OpenElementError): void

code: string (required); severity: ErrorSeverity (required); phase: ErrorPhase (required); recoverable: boolean (required); statusCode.toString: (radix?: number) => string (required) — Returns a string representation of an object.; statusCode.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; statusCode.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; statusCode.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; statusCode.valueOf: () => number (required) — Returns the primitive value of the specified object.; statusCode.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.; toJSON: () => Record<string, unknown> (required); name: string (required); message: string (required); stack?: string (optional); cause?: unknown (optional)

packages/element/src/internal/core/errors.ts:139
RouteEntryinterface · public
@openelement/element · ./client-only

One route admitted by the scanner: URL `path`, source `filePath`, the route `type`, the generated variable name (`varName`) the entry binds it to, and the optional registration tag. {@link RouteEntry.definePage} and {@link RouteEntry.hasEnhancedForms} carry the two source-derived admission facts the generated entries branch on.

RouteEntry

path: string (required); filePath: string (required); type: "page" | "api" | "island" | "special" (required); varName: string (required); tagName?: string (optional); definePage?: boolean (optional) — True when the route module's default export is a definePage() definition (#960 — registration decoupling). The generated entry registers the page class under the path-derived fallback tag and IGNORES the tagName export for registration: on a definePage route the export only names a content element. Plain element routes keep tagName as their registration tag.; functionPage?: string (optional) — The server function page fact (alpha15 server lane): the exported server function component the route's `export default definePage(Component)` was called over. Present only when the argument is a plain identifier resolving to a component THIS module declares — an inline arrow or an unexported local never records it (the R1 admission rule mirrored, so a shape whose JSX would escape to runtime is n…; source?: string (optional) — Source text captured during scanning when includeSource is enabled.; hasEnhancedForms?: boolean (optional) — True when the page route source carries data-open-enhance (#569): the client entry must ship the form-enhancement layer even when the app has zero islands.; special?: SpecialFileType (optional); params?: string[] (optional)

packages/protocol/src/framework.ts:113
ServerRouteContextinterface · public
@openelement/element · ./client-only

Canonical request-time/SSG server route context.

ServerRouteContext<Env, Platform, Route>

request: Request (required); params: Record<string, string> (required); env: Env (required); platform: Platform (required); responseHeaders: Headers (required) — Mutable response-only channel merged into the framework response.; route: Route (required)

packages/protocol/src/data.ts:25
ServerRouteMetadatainterface · public
@openelement/element · ./client-only

Context passed to a request-time ('dynamic') route loader. This is the server contract: the loader runs on the server with the Web-standard request, matched route params, the host environment and the platform object, and signals validation failure via fail()/redirect().

ServerRouteMetadata

path: string (required); filePath: string (required)

packages/protocol/src/data.ts:19
setErrorTelemetryHookfunction · public
@openelement/element · ./client-only

Install the process-wide error telemetry hook (replaceable for tests, HMR, multi-app pages).

(hook: ErrorTelemetryHook): void
packages/element/src/internal/core/errors.ts:127
signalfunction · public
@openelement/element · ./client-only

Create a writable signal through the selected signal engine.

<T>(initialValue: T): WritableSignal<T>
packages/element/src/internal/signal/framework.ts:19
Signaltype · public
@openelement/element · ./client-only

Alias for APIs that accept either writable or read-only signals.

Signal<T>
packages/protocol/src/signal.ts:31
SpecialFileTypetype · public
@openelement/element · ./client-only

Special file kinds the route scanner recognizes by filename: `renderer` and `middleware`.

SpecialFileType
packages/protocol/src/framework.ts:79
SsrAdmissionDecisioninterface · public
@openelement/element · ./client-only

The build's admission verdict for one discovered tag: where the declaration lives (`modulePath`), how it was discovered (`source`), which render path it is admitted to, and the reason recorded for the manifest.

SsrAdmissionDecision

tagName: string (required); modulePath: string (required) — Module path of the island declaration. Empty for 'foreign' decisions: a foreign tag is consumed in JSX but declares no module the build owns.; source: "local" | "package" | "nested" | "foreign" (required) — 'foreign' (#979): a third-party WC tag discovered by the foreign-tag scanner in page/island JSX — recorded for visibility only; SSR still treats it as an opaque passthrough (renderPath 'client-only').; renderPath: "ssr+client" | "client-only" | "rejected" (required); reason: string (required)

packages/protocol/src/render.ts:37
STREAM_FRAME_FORBIDDEN_TAGSconst · public
@openelement/element · ./client-only

Tags a deferred frame cannot safely install into an owned Part range: the browser installer rejects any frame whose markup carries one of these.

readonly ["script", "style", "template", "iframe", "object", "embed", "base", "meta", "link"]
packages/protocol/src/stream-frame-policy.ts:26
STREAM_FRAME_UNSAFE_URLconst · public
@openelement/element · ./client-only

Schemes that make a URL attribute unsafe in a streamed frame.

RegExp
packages/protocol/src/stream-frame-policy.ts:60
STREAM_FRAME_URL_ATTRIBUTESconst · public
@openelement/element · ./client-only

URL-carrying attributes the frame check screens for script-bearing scheme obfuscation; only these attribute names are value-screened.

readonly ["href", "src", "action", "formaction", "xlink:href"]
packages/protocol/src/stream-frame-policy.ts:42
STREAM_FRAME_URL_CONTROL_MAXconst · public
@openelement/element · ./client-only

Control characters at or below this code point are stripped before the URL-scheme test, so tab/newline/control obfuscation cannot smuggle a scheme past admission.

32
packages/protocol/src/stream-frame-policy.ts:55
STREAM_MAX_FIELDSconst · public
@openelement/element · ./client-only

Deferred fields (declared streamed properties) one stream route's manifest may carry. The build scan, the server executor, and the browser seed contract enforce the same bound.

32
packages/protocol/src/policy.ts:24
STREAM_MAX_OWNERSconst · public
@openelement/element · ./client-only

Part/Block owners one stream route's manifest may address in total across all deferred fields.

64
packages/protocol/src/policy.ts:30
STREAM_MAX_PAYLOAD_LENGTHconst · public
@openelement/element · ./client-only

Serialized stream payload bound, as a string length in UTF-16 code units: one seed attribute or one deferred frame's markup may not exceed it. The server checks the JSON text and the rendered range before emitting; the browser checks the attribute before parsing.

number
packages/protocol/src/policy.ts:45
STREAM_MAX_SEED_PROPERTIESconst · public
@openelement/element · ./client-only

Typed properties one streamed seed may carry: the browser seed contract rejects the WHOLE seed above this count, so an oversized component would silently fail to hydrate instead of failing loud at the server.

64
packages/protocol/src/policy.ts:37
STREAM_TIMEOUT_MSconst · public
@openelement/element · ./client-only

Deferred-field resolution budget (milliseconds) for one streamed response: fields still pending when it expires are failed in place and the stream ends with the shell and whatever resolved.

30000
packages/protocol/src/policy.ts:64
StreamShellExecutorinterface · public
@openelement/element · ./client-only

Initial shell, typed seed, and bounded updates for a stream shell request.

StreamShellExecutor

shell: string (required); owner: StreamOwner (required); seed: Record<string, { state: "resolved"; type: string; value: unknown; } | { state: "pending"; type: string; } | { state: "missing"; type: string; }> (required); resolvedValue: (field: string, value: unknown) => unknown (required); serializeResolved: (field: string, value: unknown) => string[] (required)

packages/element/src/public-runtime.ts:452
StreamShellManifestinterface · public
@openelement/element · ./client-only

Maps route-local deferred fields to the compiled Part or Block owners they update.

StreamShellManifest

program: { version: number; tag: string; sha256: string; } (required); fields: readonly { field: string; signal: string; owners: readonly { kind: "part" | "region"; index: number; }[]; }[] (required)

packages/element/src/public-runtime.ts:431
StyleSheetconst · public
@openelement/element · ./client-only

Cross-realm StyleSheet constructor: the native CSSStyleSheet or the internal shim.

new () => StyleSheetLike
packages/element/src/internal/core/style-sheet.ts:110
StyleSheetLikeinterface · public
@openelement/element · ./client-only

Minimal stylesheet contract (replaceSync + cssRules) satisfied by native and shim sheets.

StyleSheetLike

replaceSync: (text: string) => void (required); cssRules: StyleSheetRule[] (required)

packages/protocol/src/style-sheet.ts:14
trustedHtmlfunction · public
@openelement/element · ./client-only

Mark an HTML string as trusted for explicit `innerHTML` sinks (the trust does not serialize).

(html: string): TrustedHtml
packages/element/src/internal/core/security.ts:86
TrustedHtmlinterface · public
@openelement/element · ./client-only

Opaque capability marking HTML the application has explicitly vetted as trusted.

TrustedHtml

html: string (required)

packages/element/src/internal/core/security.ts:81
unsafeStreamFrameAttributefunction · public
@openelement/element · ./client-only

Whether a static attribute (name/value as authored into the Part Program) makes a streamed frame unsafely installable: event-handler, seed-spoofing, and srcdoc names fail outright, and URL-carrying names fail when the entity-decoded, control-stripped value carries a script scheme.

(name: string, value: string): boolean
packages/protocol/src/stream-frame-policy.ts:113
wrapInDocumentfunction · public
@openelement/element · ./client-only

Wrap rendered HTML in a full HTML document. Adds DOCTYPE, head (title, meta, preload), and body. Supports CSP nonce and dev scripts (e.g. Vite client, route module registration).

(html: string, options?: DocumentWrapOptions): string
packages/element/src/internal/core/html-escape.ts:199
createDocumentStyleResourcesfunction · public
@openelement/element · ./html

Create the per-render document stylesheet collection.

(): DocumentStyleResources
packages/element/src/internal/core/html-escape.ts:133
DocumentStyleResourcesinterface · public
@openelement/element · ./html

The document-level stylesheet resources ONE server render discovered (alpha15 S lane, S-C1.2). A light-root component's DOM lives in the document, so its sheet cannot ride the component's own subtree the way a shadow template's link does: the document owns it. This object is the one carrier between the two halves of that render — the compiled serializer, which discovers a component's external sheets while serializing the component, and the document serializer, which writes the head. It is created per render and never shared, so one page's stylesheets can never reach another page's head.

DocumentStyleResources

links: readonly string[] (required) — Discovered resource URLs, deduplicated, in discovery (cascade) order.; add: (urls: readonly string[]) => void (required) — Record the external stylesheet URLs one rendered component contributes.

packages/element/src/internal/core/html-escape.ts:125
escapeAttrfunction · public
@openelement/element · ./html

Escape an HTML attribute value. Delegates to `escapeHtml` so both share the single `ESCAPE_MAP` and the same single-pass replacement (consolidated in #633). Empty-value conventions remain intentionally distinct by design: - `escapeHtml` returns '' for non-string input. - `escapeAttrValue` (below) coerces via `String()` and is the boundary meant for unknown/variable attribute values.

(value: string): string
packages/element/src/internal/core/html-escape.ts:55
escapeAttrValuefunction · public
@openelement/element · ./html

Escape a string for use as an attribute value (double-quoted)

(value: unknown): string
packages/element/src/internal/core/html-escape.ts:60
escapeHtmlfunction · public
@openelement/element · ./html

Escape the five HTML-significant characters in text content.

(str: string): string
packages/element/src/internal/core/html-escape.ts:39
isComponentStyleHreffunction · public
@openelement/element · ./html

True when an href has the shape a framework-emitted component stylesheet address takes: a site-absolute path or an absolute http(s) URL, without whitespace or markup-significant characters. ONE rule for both sinks that serialize such an address — the DSD template's links and the document head's — so a component's stylesheet reaches a browser the same way whichever root kind the component has.

(href: string): boolean
packages/element/src/internal/core/html-escape.ts:158
SafeHtmltype · public
@openelement/element · ./html

Branded type: a string that has been HTML-escaped (safe for text content)

SafeHtml
packages/protocol/src/framework.ts:9
trustedHtmlfunction · public
@openelement/element · ./html

Mark an HTML string as trusted for explicit `innerHTML` sinks (the trust does not serialize).

(html: string): TrustedHtml
packages/element/src/internal/core/security.ts:86
TrustedHtmlinterface · public
@openelement/element · ./html

Opaque capability marking HTML the application has explicitly vetted as trusted.

TrustedHtml

html: string (required)

packages/element/src/internal/core/security.ts:81
UnsafeHtmltype · public
@openelement/element · ./html

Branded type: a string that is intentionally raw/untrusted HTML

UnsafeHtml
packages/protocol/src/framework.ts:12
wrapInDocumentfunction · public
@openelement/element · ./html

Wrap rendered HTML in a full HTML document. Adds DOCTYPE, head (title, meta, preload), and body. Supports CSP nonce and dev scripts (e.g. Vite client, route module registration).

(html: string, options?: DocumentWrapOptions): string
packages/element/src/internal/core/html-escape.ts:199
Fragmentfunction · public
@openelement/element · ./jsx-dev-runtime

Typechecking-only fragment marker; fails closed when executed at runtime.

(_props?: unknown): JSX.Element
packages/element/src/jsx-dev-runtime.ts:39
JSXnamespace · public
@openelement/element · ./jsx-dev-runtime

JSX type interface consumed by TypeScript's automatic JSX transform.

any
packages/element/src/jsx-dev-runtime.ts:44
jsxDEVfunction · public
@openelement/element · ./jsx-dev-runtime

Typechecking-only factory; fails closed when executed at runtime.

(_type: unknown, _props: unknown, _key: unknown, _isStaticChildren: unknown, _source: unknown, _self: unknown): JSX.Element
packages/element/src/jsx-dev-runtime.ts:27
Fragmentfunction · public
@openelement/element · ./jsx-runtime

Typechecking-only fragment marker; fails closed when executed at runtime.

(_props?: unknown): JSX.Element
packages/element/src/jsx-runtime.ts:40
jsxfunction · public
@openelement/element · ./jsx-runtime

Typechecking-only factory; fails closed when executed at runtime.

(_type: unknown, _props: unknown): JSX.Element
packages/element/src/jsx-runtime.ts:30
JSXnamespace · public
@openelement/element · ./jsx-runtime

JSX type interface consumed by TypeScript's automatic JSX transform.

any
packages/element/src/jsx-runtime.ts:45
jsxsfunction · public
@openelement/element · ./jsx-runtime

Typechecking-only factory; fails closed when executed at runtime.

(_type: unknown, _props: unknown): JSX.Element
packages/element/src/jsx-runtime.ts:35
createLoggerfunction · public
@openelement/element · ./logger

Create a {@link Logger} that prefixes every message with `[tag]`.

(tag: string): Logger
packages/element/src/internal/core/logger.ts:18
createWarnScopefunction · public
@openelement/element · ./logger

Create a fresh, empty warning scope for one render.

(): WarnScope
packages/element/src/internal/core/logger.ts:41
Loggerinterface · public
@openelement/element · ./logger

logger.ts - Tagged console logger. Lightweight scoped logger. Returns plain functions so it is tree-shakable and has zero class overhead.

Logger

debug: (msg: string, ...args: unknown[]) => void (required); info: (msg: string, ...args: unknown[]) => void (required); warn: (msg: string, ...args: unknown[]) => void (required); error: (msg: string, ...args: unknown[]) => void (required)

packages/element/src/internal/core/logger.ts:10
warnOncefunction · public
@openelement/element · ./logger

Warn at most once per `key` for the given render {@link WarnScope}, falling back to a process-wide set when no scope is passed.

(key: string, logger: Logger, msg: string, scope?: WarnScope): void
packages/element/src/internal/core/logger.ts:52
WarnScopeinterface · public
@openelement/element · ./logger

A render-scoped warning tracker. Pass a fresh `WarnScope` (via `createWarnScope()`) into `warnOnce` at a render entry (e.g. once per SSR document in `wrapInDocument`). Suppression is therefore scoped to a single render: the next page/request gets a new scope and the same key can warn again, so one muted key can never silence a diagnostic across all requests/SSG pages (#643).

WarnScope

warned: Set<string> (required)

packages/element/src/internal/core/logger.ts:36
__setRequestTimeStyleSheetUrlsfunction · public
@openelement/element · ./no-blocks

Set the emitted component stylesheet URLs for this server process. Called by the router's generated SSR/SSG entry (build time and request-time startup) with the base-joined asset addresses Phase 2 emitted.

(urls: readonly string[] | null | undefined): void
packages/element/src/internal/compiled/server/style-links.ts:29
Actiontype · public
@openelement/element · ./no-blocks

Route action: handles form submissions for a page route.

Action<T, Env, Platform, Route>
packages/protocol/src/data.ts:64
ACTION_FETCH_HEADERconst · public
@openelement/element · ./no-blocks

Request header selecting the action response channel: `true` marks a programmatic caller and selects the serialized ActionResult union; `enhance` marks the built-in morph enhancement and selects the same full-HTML responses the no-JS path receives.

"x-openelement-action"
packages/protocol/src/data.ts:125
ActionContextinterface · public
@openelement/element · ./no-blocks

Context passed to a route action function (extends loader context).

ActionContext<Env, Platform, Route>

formData: FormData (required); request: Request (required); params: Record<string, string> (required); env: Env (required); platform: Platform (required); responseHeaders: Headers (required) — Mutable response-only channel merged into the framework response.; route: Route (required)

packages/protocol/src/data.ts:47
ActionResulttype · public
@openelement/element · ./no-blocks

Wire shape returned to the JavaScript form-enhancement path. The no-JS path never sees this: it gets the equivalent semantics as plain HTTP (303 on success, 422 with the re-rendered form on validation failure, redirect/error as status codes). Success carries no data envelope. The application-loop contract makes a successful non-GET action answer 303 (PRG) — the framework never answers 200 with a rendered page, or with a success document, for a successful mutation — so the fetch channel answers `{ type: 'redirect' }` naming the PRG target and the authored return value is discarded by design. Success data travels the PRG target instead (query state the loader re-runs with, which the props projector then maps; see the router guide's "Form actions" section). The union previously declared a `{ type: 'success' }` member that no code path ever emitted — removed so the type matches the wire. Error outcomes (CSRF 403, unknown action 404, unparseable body 400, unexpected 500) are NOT part of this union: since #863 they answer RFC 9457 Problem Details with the PROBLEM_JSON_MEDIA_TYPE content type — see ProblemDetails.

ActionResult<Failure>
packages/protocol/src/data.ts:92
assertValidTagNamefunction · public
@openelement/element · ./no-blocks

Assert that a tag name is a valid custom element name.

(tagName: string): void
packages/element/src/internal/core/tag-utils.ts:50
collectPublicPropsfunction · public
@openelement/element · ./no-blocks

Collect all public (non-internal) own properties from a host object. Keys starting with `__openElement` are framework-internal and excluded. Uses Reflect.get for safe access (respects getters); a getter that throws is skipped with a warning so one bad prop cannot take the tree down.

(host: object): Record<string, unknown>
packages/element/src/internal/core/props-utils.ts:41
CompatibilityClassificationinterface · public
@openelement/element · ./no-blocks

The per-tag verdict the compatibility scanner records: the tier a discovered tag was classified as, the human-readable `reason`, where the tag was found (`source`), and the SSR/DSD/hydration facts the verdict was derived from.

CompatibilityClassification

tagName: string (required); tier: CompatibilityTier (required); reason: string (required); source: "local" | "package" | "nested" (required); modulePath?: string (optional); ssr?: boolean (optional); dsd?: boolean (optional); hydrate?: string (optional)

packages/protocol/src/framework.ts:352
CompatibilityTiertype · public
@openelement/element · ./no-blocks

How far a discovered tag may participate in the build: 'ssr-capable' renders and hydrates, 'client-only' ships to the browser without server output, 'experimental-dom' is admitted with a downgraded guarantee, and 'rejected' fails the build.

CompatibilityTier
packages/protocol/src/framework.ts:345
ComponentLayertype · public
@openelement/element · ./no-blocks

The delivery layer a component belongs to: fully static DSD markup ('dsd-static'), DSD markup with a client island ('dsd-interactive'), a client-only island with no SSR output ('pure-island'), or a light-DOM element ('light-dom'). Recorded per component in the build manifest and consumed by the hydration scheduler.

ComponentLayer
packages/protocol/src/framework.ts:23
computedfunction · public
@openelement/element · ./no-blocks

Create a derived read-only signal recomputed from its dependencies.

<T>(fn: () => T): ReadonlySignal<T>
packages/element/src/internal/signal/framework.ts:23
consumeContextfunction · public
@openelement/element · ./no-blocks

Consumer-local reactive projection of a protocol context value.

<T>(context: Context<T>, host?: HTMLElement): WritableSignal<T>

key.toString: () => string (required) — Returns a string representation of an object.; key.valueOf: () => symbol (required) — Returns the primitive value of the specified object.; key.description: string (required) — Expose the [[Description]] internal slot of a symbol directly.; key.__@toPrimitive@7866: (hint: string) => symbol (required) — Converts a Symbol object to a symbol.; key.__@toStringTag@7868: string (required); defaultValue: T (required)

packages/element/src/internal/core/signal-context.ts:141
Contextinterface · public
@openelement/element · ./no-blocks

A typed context token: protocol identity (`key`) plus its default value.

Context<T>

key.toString: () => string (required) — Returns a string representation of an object.; key.valueOf: () => symbol (required) — Returns the primitive value of the specified object.; key.description: string (required) — Expose the [[Description]] internal slot of a symbol directly.; key.__@toPrimitive@7866: (hint: string) => symbol (required) — Converts a Symbol object to a symbol.; key.__@toStringTag@7868: string (required); defaultValue: T (required)

packages/element/src/internal/core/signal-context.ts:13
createContextfunction · public
@openelement/element · ./no-blocks

Create a typed context token shared between provider and consumer elements.

<T>(key: symbol, defaultValue: T): Context<T>

toString: () => string (required) — Returns a string representation of an object.; valueOf: () => symbol (required) — Returns the primitive value of the specified object.; description: string (required) — Expose the [[Description]] internal slot of a symbol directly.; __@toPrimitive@7866: (hint: string) => symbol (required) — Converts a Symbol object to a symbol.; __@toStringTag@7868: string (required)

packages/element/src/internal/core/signal-context.ts:58
createDocumentStyleResourcesfunction · public
@openelement/element · ./no-blocks

Create the per-render document stylesheet collection.

(): DocumentStyleResources
packages/element/src/internal/core/html-escape.ts:133
createLoggerfunction · public
@openelement/element · ./no-blocks

Create a {@link Logger} that prefixes every message with `[tag]`.

(tag: string): Logger
packages/element/src/internal/core/logger.ts:18
createStreamShellExecutorfunction · public
@openelement/element · ./no-blocks

Create one request-local stream shell from a generated route manifest. The manifest hash is checked against the exact runtime wire program before any shell can be produced.

(options: CreateStreamShellOptions): Promise<StreamShellExecutor>

componentClass: CustomElementConstructor (required); props?: Record<string, unknown> (optional); manifest: StreamShellManifest (required); instanceId: string (required); documentToken?: string (optional); documentStyles?: DocumentStyleSink (optional) — The streamed document's stylesheet collection (see RenderToStringOptions).

packages/element/src/public-runtime.ts:516
CreateStreamShellOptionsinterface · public
@openelement/element · ./no-blocks

Inputs for a request-scoped stream shell executor.

CreateStreamShellOptions

componentClass: CustomElementConstructor (required); props?: Record<string, unknown> (optional); manifest: StreamShellManifest (required); instanceId: string (required); documentToken?: string (optional); documentStyles?: DocumentStyleSink (optional) — The streamed document's stylesheet collection (see RenderToStringOptions).

packages/element/src/public-runtime.ts:441
DANGEROUS_KEYSconst · public
@openelement/element · ./no-blocks

Object prototype keys that must never be injected from untrusted props.

ReadonlySet<string>
packages/element/src/internal/core/security.ts:25
deepGetElementByIdfunction · public
@openelement/element · ./no-blocks

Resolve `id` (a `#hash` or bare id) against `root` and, when the id is not in that root's own tree, recurse into every nested shadow root. Returns the first match or `null`; a malformed percent-encoded id is not an error.

(id: string, root?: Document | ShadowRoot): HTMLElement | null
packages/element/src/internal/core/deep-fragment.ts:20
documentStreamPartsfunction · public
@openelement/element · ./no-blocks

The same document serialization boundary, with only body wrappers left open.

(options?: DocumentWrapOptions): { prefix: string; suffix: string; }

title?: string (optional); lang?: string (optional); clientScript?: string (optional); scripts?: DocumentScriptDescriptor[] (optional); meta.description?: string (optional); meta.tags?: Record<string, string | number | boolean>[] (optional); devScripts?: string (optional); headExtras?: string (optional); dangerouslyHeadFragments?: string[] (optional); allowHeadExtrasScripts?: boolean (optional); links?: { rel: string; href: string; hreflang?: string; }[] (optional); structuredData?: readonly Record<string, unknown>[] (optional); cspNonce?: string (optional); streamBootstrap?: string (optional) — Trusted framework bootstrap emitted synchronously in the document head.; styleLinks?: readonly string[] (optional) — The document's light-root component stylesheets: external resource URLs (alpha15 S lane, S-C1.2) serialized as marked `<link rel="stylesheet">` nodes after `headExtras`, so a light component is styled by the document that contains it — without JavaScript and without a runtime style node.

packages/element/src/internal/core/html-escape.ts:205
DocumentStyleResourcesinterface · public
@openelement/element · ./no-blocks

The document-level stylesheet resources ONE server render discovered (alpha15 S lane, S-C1.2). A light-root component's DOM lives in the document, so its sheet cannot ride the component's own subtree the way a shadow template's link does: the document owns it. This object is the one carrier between the two halves of that render — the compiled serializer, which discovers a component's external sheets while serializing the component, and the document serializer, which writes the head. It is created per render and never shared, so one page's stylesheets can never reach another page's head.

DocumentStyleResources

links: readonly string[] (required) — Discovered resource URLs, deduplicated, in discovery (cascade) order.; add: (urls: readonly string[]) => void (required) — Record the external stylesheet URLs one rendered component contributes.

packages/element/src/internal/core/html-escape.ts:125
effectfunction · public
@openelement/element · ./no-blocks

Run a side effect that re-subscribes whenever its signal dependencies change.

(fn: () => void | Unsubscribe): Unsubscribe
packages/element/src/internal/signal/framework.ts:27
elementfunction · public
@openelement/element · ./no-blocks

Compiler-recognized element decorator; inert no-op at runtime.

(_tag: string, _options?: { root?: "light" | "shadow-open" | "shadow-closed"; delegatesFocus?: boolean; formAssociated?: boolean; }): (target: unknown, context?: unknown) => void
packages/element/src/internal/core/compile-decorators.ts:20
ensureDeepFragmentNavigationfunction · public
@openelement/element · ./no-blocks

Install (once per document) framework-level fragment navigation: a same-document anchor click whose target lives inside a nested shadow root scrolls to it and pushes the hash instead of being dropped by the browser. `{ enabled: false }` opts an application out.

(options?: DeepFragmentOptions): void

enabled?: boolean (optional) — Set false before installation to opt out for an application.

packages/element/src/internal/core/deep-fragment.ts:67
ensurePreHydrationClickCapturefunction · public
@openelement/element · ./no-blocks

Install the bounded pre-upgrade interaction capture on an owning root (default: the document). Generated client entries call this with their declared island tags before any compiled element upgrades; after a successful claim the element replays the captured events whose targets live inside its root (compiled claim capture/replay, internal/compiled/runtime.ts). Idempotent per root (repeat calls merge tags, never reinstall listeners) and a no-op where no DOM exists (SSR). Invariant: the capture itself — one fixed listener set per owning root, installed once per page — is page-lifetime by design and is NOT the leak. The M1 leak was retained event-target records; each element releases exactly its own records at its activation decision (success or failure), while records owned by still-pending elements survive for their delayed/lazy upgrade (#1170). Boundedness: the facade capture passes the declared-island filter, so only interactions under a still-pending DECLARED island tag enter the queue — ordinary events and undeclared third-party custom elements are skipped (nested pending declared islands still capture through their own unsettled host). With no tags declared the legacy dash heuristic applies. The shared queue carries a hard capacity cap (fail closed), detached records are swept when a claim root adopts its share (and under queue pressure), and each activation decision deterministically empties that root's own bucket, so post-hydration traffic and removals never grow retention.

(root?: EventTarget, pendingTags?: readonly string[]): void

addEventListener: (type: string, callback: EventListenerOrEventListenerObject | null, options?: AddEventListenerOptions | boolean) => void (required) — The **`addEventListener()`** method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target. [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener); dispatchEvent: (event: Event) => boolean (required) — The **`dispatchEvent()`** method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order. The normal event processing rules (including the capturing and optional bubbling phase) also apply to events dispatched manually with dispatchEvent(). [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent); removeEventListener: (type: string, callback: EventListenerOrEventListenerObject | null, options?: EventListenerOptions | boolean) => void (required) — The **`removeEventListener()`** method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target. The event listener to be removed is identified using a combination of the event type, the event listener function itself, and various optional options that may affect the matching process; see Matching event listeners for removal.…

packages/element/src/internal/compiled/runtime/pre-upgrade-events.ts:672
ERROR_PREFIXconst · public
@openelement/element · ./no-blocks

Error message prefix for all openElement errors.

"[openElement]"
packages/protocol/src/errors.ts:50
ErrorBoundaryclass · public
@openelement/element · ./no-blocks

Base class for elements that catch descendant render/hydration errors and apply a retry policy.

class ErrorBoundary extends OpenElement
packages/element/src/error-boundary.ts:45
ErrorTelemetryHooktype · public
@openelement/element · ./no-blocks

Callback receiving every reported {@linkcode OpenElementError} for telemetry.

ErrorTelemetryHook
packages/protocol/src/errors.ts:132
escapeAttrfunction · public
@openelement/element · ./no-blocks

Escape an HTML attribute value. Delegates to `escapeHtml` so both share the single `ESCAPE_MAP` and the same single-pass replacement (consolidated in #633). Empty-value conventions remain intentionally distinct by design: - `escapeHtml` returns '' for non-string input. - `escapeAttrValue` (below) coerces via `String()` and is the boundary meant for unknown/variable attribute values.

(value: string): string
packages/element/src/internal/core/html-escape.ts:55
escapeHtmlfunction · public
@openelement/element · ./no-blocks

Escape the five HTML-significant characters in text content.

(str: string): string
packages/element/src/internal/core/html-escape.ts:39
formatErrorfunction · public
@openelement/element · ./no-blocks

Format an unknown thrown value as a human-readable string.

(e: unknown): string
packages/element/src/internal/core/errors.ts:52
FrameworkOptionsinterface · public
@openelement/element · ./no-blocks

The adapter-facing framework options: where routes and islands live, which renderer serializes pages, the default layout and named-layout declarations, the document `<html>`/head injection channels, and the request-time middleware switches. Every field is optional; the adapter applies its documented default. This is the type an application config file's default export is checked against, so the rendered option table and the actual config surface cannot drift.

FrameworkOptions

renderer?: "native" | "lit" (optional) — Page renderer selection (Beta.2.2, #1339). EXPLICIT, never inferred: 'native' (default) renders pages through the compiled Part Program serializer (renderToString); 'lit' renders LitElement pages through; routesDir?: string (optional) — Directory the route scanner walks, relative to the Vite root. Defaults to `app/routes`.; islandsDir?: string (optional) — Directory island modules are discovered in. Defaults to `app/islands`.; packageIslands?: string[] | "auto" | "manual" (optional) — How the build admits component packages whose modules the application imports. - omitted or `'auto'` (the default): the scan derives the admitted set at scan time — every package-owned element module the app's routes, pages, layouts, islands and components really reach (bundler-resolved) is attributed to its owner package (nearest `package.json`), and a package with a valid OpenElement manifest i…; layout?: LayoutConfig (optional) — Layout declaration; `false` disables the layout, `'default'` uses the built-in one.; layouts?: LayoutsConfig (optional) — Named layout declarations keyed by layout name.; headExtras?: string (optional) — @dangerous injected as-is, only use with controlled content; html.lang?: string (optional); html.title?: string (optional); inject.stylesheets?: (string | { href: string; integrity?: string; crossorigin?: "anonymous" | "use-credentials"; attrs?: Record<string, string | number | boolean>; })[] (optional) — Stylesheets linked into the document head; each entry is an href or a link record with integrity/crossorigin/attrs.; inject.scripts?: (string | { src: string; type?: string; async?: boolean; defer?: boolean; integrity?: string; crossorigin?: "anonymous" | "use-credentials"; attrs?: Record<str… (optional) — Scripts emitted into the document; each entry is a src or a script record with type/async/defer/integrity/crossorigin/attrs.; inject.headFragments?: string[] (optional) — @dangerous fragments injected as-is. Trust boundary (same level as `trustedHtml`): never concatenate user-controlled content into these fragments; sanitize untrusted data at your own system boundary first. The framework only enforces no-`<script>` and no-executable-`<style>`.; ssr.noExternal?: (string | RegExp)[] (optional); island.upgradeStrategy?: "load" | "idle" | "visible" | "only" | "none" (optional); build.outDir?: string (optional) — Output directory for the build artifacts. Defaults to `dist`.; build.manifestBudget?: { islandKB?: number; totalJsKB?: number; pageKB?: number; } (optional) — Advisory only: exceeded budgets print build-manifest warnings and never fail the build; enforce them in your own build-output test.; viewTransition?: boolean (optional) — Enable the View Transitions API for client navigations. Defaults to true.; speculation?: boolean | { prerender?: string[]; prefetch?: string[]; exclude?: string[]; eagerness?: "immediate" | "moderate" | "conservative"; } (optional) — Speculation Rules emission: `true` uses framework defaults, or pass prerender/prefetch URL lists, exclusions and an eagerness.; middleware.cors?: boolean (optional) — Built-in CORS middleware. Default-ON; pass `false` to disable.; middleware.corsOrigin?: string | string[] (optional) — Static CORS allowlist data, serialized into the generated entry as JSON. Mutually exclusive with {@link FrameworkOptions.middleware.corsOriginModule }.; middleware.corsOriginModule?: string (optional) — Path to a module that default-exports `(origin: string) => string | undefined`. The generated entry imports the module — the callback is never serialized — so it may close over module scope and import dependencies. Resolved with the same idiom as `layout.import` (e.g. './app/cors-origin.ts'). Mutually exclusive with `corsOrigin`.; middleware.requestId?: boolean (optional) — Emit and honor a per-request id header. Default-ON; pass `false` to disable.; middleware.logger?: boolean (optional) — Log each request through the built-in logger. Default-ON; pass `false` to disable.; middleware.securityHeaders?: boolean (optional) — Attach the built-in security response headers. Default-ON; pass `false` to disable.; middleware.csp?: { policy?: string; nonce?: boolean; reportOnly?: boolean; } (optional) — Content-Security-Policy emission: the policy string, nonce generation, and report-only mode.; middleware.use?: string[] (optional) — Fetch middleware chain (#858), composed around the framework handler in onion order (`use[0]` outermost), outside all built-in middleware above. Each entry is a MODULE PATH (same resolution idiom as `layout.import`, e.g. './app/middleware/auth.ts') whose default export is a {@link Middleware}; the generated entry emits `import * as __mw_N from '<path>'` and composes `__mw_N.default` in configured…

packages/protocol/src/framework.ts:181
HYDRATION_STRATEGIESconst · public
@openelement/element · ./no-blocks

Runtime list of supported hydration strategies; the single source of truth for the `HydrationStrategy` union. Consumed by island/registry validation and re-exported from the element root for app and build adapters.

readonly ["load", "idle", "visible", "only", "none"]
packages/protocol/src/framework.ts:28
HydrationStrategytype · public
@openelement/element · ./no-blocks

Island hydration trigger: 'load' | 'idle' | 'visible' | 'only'.

"load" | "idle" | "visible" | "only" | "none"
packages/protocol/src/framework.ts:30
IDLE_FALLBACK_TIMEOUT_MSconst · public
@openelement/element · ./no-blocks

Idle-hydration scheduling fallback (milliseconds) when neither `requestIdleCallback` nor `requestAnimationFrame` is available.

50
packages/protocol/src/policy.ts:70
injectPropsSafefunction · public
@openelement/element · ./no-blocks

Safely assign caller-supplied props onto a target object, skipping keys that could enable prototype pollution and tolerating read-only properties. The canonical guarded assigner for the canonical dangerous-key rule (#903, #1214): the

(target: Record<string, unknown>, props: Record<string, unknown>, tagName: string, log?: { warn(message: string): void; debug(message: string): void; }): void
packages/element/src/internal/core/security.ts:119
isDangerousKeyfunction · public
@openelement/element · ./no-blocks

Shared dangerous-key predicate (#903, #1214). Prototype-internal keys must never be injected from untrusted props on ANY path: host prop collection (collectPublicProps / normalizePublicProps in props-utils.ts), guarded assignment (injectPropsSafe below — the SPA bootstrap page-projection write boundary in

(key: string): boolean
packages/element/src/internal/core/security.ts:51
IslandOptionsinterface · public
@openelement/element · ./no-blocks

Per-island delivery options (hydration strategy, SSR/DSD participation).

IslandOptions

hydrate?: "load" | "idle" | "visible" | "only" | "none" (optional) — Hydration strategy: - 'load': load immediately when module is imported - 'idle': defer to requestIdleCallback (default) - 'visible': use IntersectionObserver to defer until element is visible - 'only': client-only render, no DSD/SSR output Named `hydrate` to match `defineIslandConfig()` in the Router package — one option name across both packages.; dsd?: boolean (optional) — Whether to use DSD for SSR rendering of this island. Honored by the build-side island scan (via `defineIslandConfig`), not by `defineIsland()` itself: passing it in `IslandOptions` has no runtime effect.; ssr?: boolean (optional) — Whether this island may be admitted into server rendering. Like `dsd`, decided by the build-side island scan; inert when passed to `defineIsland()`.

packages/protocol/src/island.ts:8
isSafeAttributeNamefunction · public
@openelement/element · ./no-blocks

Shared safe-attribute-name predicate (#1033): the SSR face of the one canonical predicate in `../protocol/forbidden-sinks.ts`. A name must be valid HTML attribute-name grammar (blocks quote/space injection, #602), must not be an event handler (`on*`, case-insensitive), and must not be a forbidden sink (`innerhtml`/`srcdoc`). The compiler, protocol validator, and server serializer enforce the same predicate with their own failure strategies; every path delegates to the single implementation, so the boundary cannot diverge.

(name: string): boolean
packages/element/src/internal/core/security.ts:65
isValidTagNamefunction · public
@openelement/element · ./no-blocks

Check if a tag name is a valid custom element name per HTML spec.

(tagName: string): boolean
packages/element/src/internal/core/tag-utils.ts:38
LayoutConfigtype · public
@openelement/element · ./no-blocks

Layout declaration: `false` disables the layout entirely, `'default'` uses the built-in layout, and the object form names a tag with the module path that defines it (`import`, resolved like a {@link FrameworkOptions.middleware.use } entry) plus the compiled layout properties the router injects per route.

LayoutConfig
packages/protocol/src/framework.ts:96
Loadertype · public
@openelement/element · ./no-blocks

Route loader: fetches data for a page route.

Loader<T, Env, Platform, Route>
packages/protocol/src/data.ts:56
LoaderContextinterface · public
@openelement/element · ./no-blocks

Context passed to a request-time ('dynamic') route loader.

LoaderContext<Env, Platform, Route>

request: Request (required); params: Record<string, string> (required); env: Env (required); platform: Platform (required); responseHeaders: Headers (required) — Mutable response-only channel merged into the framework response.; route: Route (required)

packages/protocol/src/data.ts:40
LocalePathinterface · public
@openelement/element · ./no-blocks

Locale-aware resolved path contract.

LocalePath

locale: string (required); path: string (required); localizedPath: string (required); isDefaultLocalePath: boolean (required)

packages/protocol/src/framework.ts:82
Loggerinterface · public
@openelement/element · ./no-blocks

logger.ts - Tagged console logger. Lightweight scoped logger. Returns plain functions so it is tree-shakable and has zero class overhead.

Logger

debug: (msg: string, ...args: unknown[]) => void (required); info: (msg: string, ...args: unknown[]) => void (required); warn: (msg: string, ...args: unknown[]) => void (required); error: (msg: string, ...args: unknown[]) => void (required)

packages/element/src/internal/core/logger.ts:10
MAX_ACTION_BODY_BYTESconst · public
@openelement/element · ./no-blocks

Request-body bound (bytes) the generated entry applies to action POST routes; larger uploads belong on API routes with explicit limits.

number
packages/protocol/src/policy.ts:57
MAX_COMPOSITION_DEPTHconst · public
@openelement/element · ./no-blocks

Nested element expansion depth bound for `renderToString`: cyclic component composition fails closed instead of recursing without end.

8
packages/protocol/src/policy.ts:51
Middlewaretype · public
@openelement/element · ./no-blocks

Fetch middleware contract (#858): WinterCG shape, dialect-free — no Hono/h3 context object. Composed at the handler boundary in onion order (`use[0]` is outermost: it sees the request first and the response last), so it runs with identical semantics in the dev server, the `start` CLI, the e2e fixture server, and the Nitro production entry. A middleware may short-circuit by returning a Response without calling `next()`, or post-process the Response that `next()` returns. Module contract: a Middleware is the DEFAULT EXPORT of a module referenced from `middleware.use` by path (e.g. './app/middleware/auth.ts'). The generated server entry imports the module, so the middleware may close over module scope and import local helpers and third-party packages — it is a real module in the server module graph, never serialized source.

Middleware
packages/protocol/src/framework.ts:169
OpenElementclass · public
@openelement/element · ./no-blocks

Custom Element base class for the compiled Part Program architecture. Subclasses are produced by the compiler; hand-written subclasses that never pass through the compiler fail closed at connect time.

class OpenElement extends OpenElementConfiguration
packages/element/src/open-element-implementation.ts:104
OpenElementAttributeinterface · public
@openelement/element · ./no-blocks

One documented attribute of a custom element declaration.

OpenElementAttribute

name: string (required); type?: string (optional); default?: string (optional); description?: string (optional); reflects?: boolean (optional); fieldName?: string (optional)

packages/protocol/src/manifest.ts:15
OpenElementCssPartinterface · public
@openelement/element · ./no-blocks

One documented CSS part of a custom element declaration.

OpenElementCssPart

name: string (required); description?: string (optional)

packages/protocol/src/manifest.ts:38
OpenElementDeclarationinterface · public
@openelement/element · ./no-blocks

One custom element declaration in a package manifest: tag, members and delivery metadata.

OpenElementDeclaration

tagName: string (required); className?: string (optional); superclassName?: string (optional); attributes?: OpenElementAttribute[] (optional); events?: OpenElementEvent[] (optional); slots?: OpenElementSlot[] (optional); cssParts?: OpenElementCssPart[] (optional); openElement.ssr?: boolean (optional); openElement.dsd?: boolean (optional); openElement.layer?: ComponentLayer (optional); openElement.hydrate?: "load" | "idle" | "visible" | "only" | "none" (optional); openElement.status?: "stable" | "experimental" (optional) — Stability marker from the owning package's manifest policy.; openElement.module?: string (optional); openElement.export?: string (optional); openElement.tailwind?: OpenElementTailwindDeclaration (optional); description?: string (optional)

packages/protocol/src/manifest.ts:85
OpenElementErrorclass · public
@openelement/element · ./no-blocks

Framework error carrying a stable code, severity, phase and recoverability contract.

class OpenElementError extends Error
packages/protocol/src/errors.ts:100
OpenElementEventinterface · public
@openelement/element · ./no-blocks

One documented custom event of a custom element declaration.

OpenElementEvent

name: string (required); type?: string (optional); description?: string (optional)

packages/protocol/src/manifest.ts:25
OpenElementPackageManifestinterface · public
@openelement/element · ./no-blocks

Package manifest of component declarations (not a Custom Elements Manifest).

OpenElementPackageManifest

schemaVersion: string (required); packageName: string (required); version: string (required); description?: string (optional); author?: string (optional); license?: string (optional); homepage?: string (optional); repository?: string (optional); declarations: OpenElementDeclaration[] (required)

packages/protocol/src/manifest.ts:98
OpenElementRouteKindtype · public
@openelement/element · ./no-blocks

Host-agnostic route and asset contracts shared by app and build drivers.

OpenElementRouteKind
packages/protocol/src/app-model.ts:2
OpenElementRouteNodeinterface · public
@openelement/element · ./no-blocks

One node of the host-agnostic route tree: the matched URL `path` and route kind, the source and module paths the drivers resolve, the optional registered tag and param names, and the nested `children`.

OpenElementRouteNode

kind: OpenElementRouteKind (required); path: string (required); filePath?: string (optional); importPath?: string (optional); tagName?: string (optional); paramNames?: string[] (optional); children?: OpenElementRouteNode[] (optional); meta?: Record<string, unknown> (optional)

packages/protocol/src/app-model.ts:9
OpenElementSlotinterface · public
@openelement/element · ./no-blocks

One documented slot of a custom element declaration.

OpenElementSlot

name: string (required); description?: string (optional)

packages/protocol/src/manifest.ts:32
PROBLEM_JSON_MEDIA_TYPEconst · public
@openelement/element · ./no-blocks

Media type of the RFC 9457 action error channel (#863).

"application/problem+json"
packages/protocol/src/data.ts:117
ProblemDetailsinterface · public
@openelement/element · ./no-blocks

RFC 9457 Problem Details document (#863): the action error channel answers `application/problem+json` instead of the bespoke `{ type: 'error', error: { message } }` JSON, so HTTP tooling recognizes failures natively. With `type: 'about:blank'`, `title` is the HTTP reason phrase and `detail` carries the specific explanation. The wire shape is alpha-unfrozen; the 1.0 acceptance freezes it in this problem+json form.

ProblemDetails

type: string (required) — URI reference identifying the problem type; 'about:blank' when none applies.; title: string (required) — Short human-readable summary (the HTTP reason phrase for 'about:blank').; status.toString: (radix?: number) => string (required) — Returns a string representation of an object.; status.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; status.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; status.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; status.valueOf: () => number (required) — Returns the primitive value of the specified object.; status.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.; detail?: string (optional) — Human-readable explanation specific to this occurrence.

packages/protocol/src/data.ts:105
propertyfunction · public
@openelement/element · ./no-blocks

Compiler-recognized property decorator; inert no-op at runtime.

(_options: { reflect: boolean; attribute?: false | string; type?: unknown; converter?: unknown; }): (target: unknown, context?: unknown) => void

reflect: boolean (required); attribute?: string | false (optional); type?: unknown (optional); converter?: unknown (optional)

packages/element/src/internal/core/compile-decorators.ts:34
provideContextfunction · public
@openelement/element · ./no-blocks

Provide a plain protocol value; the provider Signal remains OE-private.

<T>(host: HTMLElement, context: Context<T>, value: T): Unsubscribe
packages/element/src/internal/core/signal-context.ts:109
ReadonlySignalinterface · public
@openelement/element · ./no-blocks

Read-only signal protocol used by computed values.

ReadonlySignal<T>

value: T (required); subscribe: (fn: (value: T) => void) => Unsubscribe (required); __@SIGNAL_BRAND@8019.valueOf: () => boolean (required) — Returns the primitive value of the specified object.

packages/protocol/src/signal.ts:26
RenderErrorclass · public
@openelement/element · ./no-blocks

Recoverable render-phase error carrying the failing component path and tag.

class RenderError extends OpenElementError
packages/element/src/internal/core/errors.ts:95
renderToStringfunction · public
@openelement/element · ./no-blocks

Server-render one compiled element through canonical Element composition: returns the serialized DSD `html` string directly.

(input: string | CustomElementConstructor, options?: RenderToStringOptions): string
packages/element/src/public-runtime.ts:950
RenderToStringOptionsinterface · public
@openelement/element · ./no-blocks

Options for one `renderToString()` call: the compiled component class to serialize, the values projected onto its compiled properties, optional route/source diagnostics metadata, the nested compiled tags the build admitted, and trusted parent-owned light children keyed by slot name.

RenderToStringOptions

componentClass?: CustomElementConstructor (optional); props?: Record<string, unknown> (optional); sourceInfo.route?: string (optional); sourceInfo.source?: string (optional); ssrRenderableTags?: readonly string[] (optional) — Build-admitted nested compiled tags. Omitted means shell-only rendering.; projectedChildren?: ReadonlyMap<string, TrustedHtml> (optional) — Trusted parent-owned light children keyed by slot name.; hostChildren?: TrustedHtml (optional) — Trusted parent-owned light children emitted AFTER the host's DSD template (a shadow-root host's slotted content). This is the shadow-side sibling of `projectedChildren`: a light root substitutes projections into its own `<slot>` elements, a shadow root distributes appended light DOM natively. Both are the compiled children channel — compiler-produced final HTML carrying the trustedHtml brand, nev…; documentStyles?: DocumentStyleSink (optional) — The render's document stylesheet collection (alpha15 S lane, S-C1.2). Every light-root component serialized in this render reports its external sheet URLs here, and the document wrapper declares them in the head. The caller owns the collection's lifetime — one per document render — so styles discovered for one page can never reach another page's head.

packages/element/src/public-runtime.ts:239
reportErrorfunction · public
@openelement/element · ./no-blocks

Report an {@linkcode OpenElementError} to the telemetry hook, or console.error when none is installed.

(error: OpenElementError): void

code: string (required); severity: ErrorSeverity (required); phase: ErrorPhase (required); recoverable: boolean (required); statusCode.toString: (radix?: number) => string (required) — Returns a string representation of an object.; statusCode.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; statusCode.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; statusCode.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; statusCode.valueOf: () => number (required) — Returns the primitive value of the specified object.; statusCode.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.; toJSON: () => Record<string, unknown> (required); name: string (required); message: string (required); stack?: string (optional); cause?: unknown (optional)

packages/element/src/internal/core/errors.ts:139
RouteEntryinterface · public
@openelement/element · ./no-blocks

One route admitted by the scanner: URL `path`, source `filePath`, the route `type`, the generated variable name (`varName`) the entry binds it to, and the optional registration tag. {@link RouteEntry.definePage} and {@link RouteEntry.hasEnhancedForms} carry the two source-derived admission facts the generated entries branch on.

RouteEntry

path: string (required); filePath: string (required); type: "page" | "api" | "island" | "special" (required); varName: string (required); tagName?: string (optional); definePage?: boolean (optional) — True when the route module's default export is a definePage() definition (#960 — registration decoupling). The generated entry registers the page class under the path-derived fallback tag and IGNORES the tagName export for registration: on a definePage route the export only names a content element. Plain element routes keep tagName as their registration tag.; functionPage?: string (optional) — The server function page fact (alpha15 server lane): the exported server function component the route's `export default definePage(Component)` was called over. Present only when the argument is a plain identifier resolving to a component THIS module declares — an inline arrow or an unexported local never records it (the R1 admission rule mirrored, so a shape whose JSX would escape to runtime is n…; source?: string (optional) — Source text captured during scanning when includeSource is enabled.; hasEnhancedForms?: boolean (optional) — True when the page route source carries data-open-enhance (#569): the client entry must ship the form-enhancement layer even when the app has zero islands.; special?: SpecialFileType (optional); params?: string[] (optional)

packages/protocol/src/framework.ts:113
ServerRouteContextinterface · public
@openelement/element · ./no-blocks

Canonical request-time/SSG server route context.

ServerRouteContext<Env, Platform, Route>

request: Request (required); params: Record<string, string> (required); env: Env (required); platform: Platform (required); responseHeaders: Headers (required) — Mutable response-only channel merged into the framework response.; route: Route (required)

packages/protocol/src/data.ts:25
ServerRouteMetadatainterface · public
@openelement/element · ./no-blocks

Context passed to a request-time ('dynamic') route loader. This is the server contract: the loader runs on the server with the Web-standard request, matched route params, the host environment and the platform object, and signals validation failure via fail()/redirect().

ServerRouteMetadata

path: string (required); filePath: string (required)

packages/protocol/src/data.ts:19
setErrorTelemetryHookfunction · public
@openelement/element · ./no-blocks

Install the process-wide error telemetry hook (replaceable for tests, HMR, multi-app pages).

(hook: ErrorTelemetryHook): void
packages/element/src/internal/core/errors.ts:127
signalfunction · public
@openelement/element · ./no-blocks

Create a writable signal through the selected signal engine.

<T>(initialValue: T): WritableSignal<T>
packages/element/src/internal/signal/framework.ts:19
Signaltype · public
@openelement/element · ./no-blocks

Alias for APIs that accept either writable or read-only signals.

Signal<T>
packages/protocol/src/signal.ts:31
SpecialFileTypetype · public
@openelement/element · ./no-blocks

Special file kinds the route scanner recognizes by filename: `renderer` and `middleware`.

SpecialFileType
packages/protocol/src/framework.ts:79
SsrAdmissionDecisioninterface · public
@openelement/element · ./no-blocks

The build's admission verdict for one discovered tag: where the declaration lives (`modulePath`), how it was discovered (`source`), which render path it is admitted to, and the reason recorded for the manifest.

SsrAdmissionDecision

tagName: string (required); modulePath: string (required) — Module path of the island declaration. Empty for 'foreign' decisions: a foreign tag is consumed in JSX but declares no module the build owns.; source: "local" | "package" | "nested" | "foreign" (required) — 'foreign' (#979): a third-party WC tag discovered by the foreign-tag scanner in page/island JSX — recorded for visibility only; SSR still treats it as an opaque passthrough (renderPath 'client-only').; renderPath: "ssr+client" | "client-only" | "rejected" (required); reason: string (required)

packages/protocol/src/render.ts:37
STREAM_FRAME_FORBIDDEN_TAGSconst · public
@openelement/element · ./no-blocks

Tags a deferred frame cannot safely install into an owned Part range: the browser installer rejects any frame whose markup carries one of these.

readonly ["script", "style", "template", "iframe", "object", "embed", "base", "meta", "link"]
packages/protocol/src/stream-frame-policy.ts:26
STREAM_FRAME_UNSAFE_URLconst · public
@openelement/element · ./no-blocks

Schemes that make a URL attribute unsafe in a streamed frame.

RegExp
packages/protocol/src/stream-frame-policy.ts:60
STREAM_FRAME_URL_ATTRIBUTESconst · public
@openelement/element · ./no-blocks

URL-carrying attributes the frame check screens for script-bearing scheme obfuscation; only these attribute names are value-screened.

readonly ["href", "src", "action", "formaction", "xlink:href"]
packages/protocol/src/stream-frame-policy.ts:42
STREAM_FRAME_URL_CONTROL_MAXconst · public
@openelement/element · ./no-blocks

Control characters at or below this code point are stripped before the URL-scheme test, so tab/newline/control obfuscation cannot smuggle a scheme past admission.

32
packages/protocol/src/stream-frame-policy.ts:55
STREAM_MAX_FIELDSconst · public
@openelement/element · ./no-blocks

Deferred fields (declared streamed properties) one stream route's manifest may carry. The build scan, the server executor, and the browser seed contract enforce the same bound.

32
packages/protocol/src/policy.ts:24
STREAM_MAX_OWNERSconst · public
@openelement/element · ./no-blocks

Part/Block owners one stream route's manifest may address in total across all deferred fields.

64
packages/protocol/src/policy.ts:30
STREAM_MAX_PAYLOAD_LENGTHconst · public
@openelement/element · ./no-blocks

Serialized stream payload bound, as a string length in UTF-16 code units: one seed attribute or one deferred frame's markup may not exceed it. The server checks the JSON text and the rendered range before emitting; the browser checks the attribute before parsing.

number
packages/protocol/src/policy.ts:45
STREAM_MAX_SEED_PROPERTIESconst · public
@openelement/element · ./no-blocks

Typed properties one streamed seed may carry: the browser seed contract rejects the WHOLE seed above this count, so an oversized component would silently fail to hydrate instead of failing loud at the server.

64
packages/protocol/src/policy.ts:37
STREAM_TIMEOUT_MSconst · public
@openelement/element · ./no-blocks

Deferred-field resolution budget (milliseconds) for one streamed response: fields still pending when it expires are failed in place and the stream ends with the shell and whatever resolved.

30000
packages/protocol/src/policy.ts:64
StreamShellExecutorinterface · public
@openelement/element · ./no-blocks

Initial shell, typed seed, and bounded updates for a stream shell request.

StreamShellExecutor

shell: string (required); owner: StreamOwner (required); seed: Record<string, { state: "resolved"; type: string; value: unknown; } | { state: "pending"; type: string; } | { state: "missing"; type: string; }> (required); resolvedValue: (field: string, value: unknown) => unknown (required); serializeResolved: (field: string, value: unknown) => string[] (required)

packages/element/src/public-runtime.ts:452
StreamShellManifestinterface · public
@openelement/element · ./no-blocks

Maps route-local deferred fields to the compiled Part or Block owners they update.

StreamShellManifest

program: { version: number; tag: string; sha256: string; } (required); fields: readonly { field: string; signal: string; owners: readonly { kind: "part" | "region"; index: number; }[]; }[] (required)

packages/element/src/public-runtime.ts:431
StyleSheetconst · public
@openelement/element · ./no-blocks

Cross-realm StyleSheet constructor: the native CSSStyleSheet or the internal shim.

new () => StyleSheetLike
packages/element/src/internal/core/style-sheet.ts:110
StyleSheetLikeinterface · public
@openelement/element · ./no-blocks

Minimal stylesheet contract (replaceSync + cssRules) satisfied by native and shim sheets.

StyleSheetLike

replaceSync: (text: string) => void (required); cssRules: StyleSheetRule[] (required)

packages/protocol/src/style-sheet.ts:14
trustedHtmlfunction · public
@openelement/element · ./no-blocks

Mark an HTML string as trusted for explicit `innerHTML` sinks (the trust does not serialize).

(html: string): TrustedHtml
packages/element/src/internal/core/security.ts:86
TrustedHtmlinterface · public
@openelement/element · ./no-blocks

Opaque capability marking HTML the application has explicitly vetted as trusted.

TrustedHtml

html: string (required)

packages/element/src/internal/core/security.ts:81
unsafeStreamFrameAttributefunction · public
@openelement/element · ./no-blocks

Whether a static attribute (name/value as authored into the Part Program) makes a streamed frame unsafely installable: event-handler, seed-spoofing, and srcdoc names fail outright, and URL-carrying names fail when the entity-decoded, control-stripped value carries a script scheme.

(name: string, value: string): boolean
packages/protocol/src/stream-frame-policy.ts:113
wrapInDocumentfunction · public
@openelement/element · ./no-blocks

Wrap rendered HTML in a full HTML document. Adds DOCTYPE, head (title, meta, preload), and body. Supports CSP nonce and dev scripts (e.g. Vite client, route module registration).

(html: string, options?: DocumentWrapOptions): string
packages/element/src/internal/core/html-escape.ts:199
__hfunction · public
@openelement/element · ./server

Construct one element's HTML. `attrs` values are the wire truth: `true` emits a bare attribute, `false`/`null`/`undefined` omit it, arrays and records coerce for `class`/`style` exactly like the serializer, and every other value is attribute-escaped through `escapeAttr`. The reserved `innerHTML` key is the trusted-HTML sink: its value must carry the trustedHtml brand and becomes the element's content (children must be empty — the compiler's shared walk already enforces that shape). `children` are FINAL HTML strings (static text is escaped at compile time, dynamic text arrives through `__t`, nested components through `__ssr` or a direct compiled call).

(tag: string, attrs?: Record<string, unknown>, children?: readonly unknown[]): string
packages/element/src/server.ts:127
__ssrfunction · public
@openelement/element · ./server

Render one registered compiled host (an

(tag: string, props?: Record<string, unknown>, sourceInfo?: SsrSourceInfo, composition?: SsrComposition): string
packages/element/src/server.ts:218
__tfunction · public
@openelement/element · ./server

Escape one dynamic text value (the ONLY channel untrusted text may take into a server function component's output). Coercion matches the serializer's text-Part pipeline exactly: displayValue, then the ONE `escapeText`.

(value: unknown): string
packages/element/src/server.ts:108

@openelement/compiler

48 exports
analyzeModuleSemanticsfunction · public
@openelement/compiler · root

Parse one module source and report the semantic facts the compiler boundary and the Vite graph adapters branch on. Pure: it never resolves imports from disk and never throws on foreign or invalid syntax — an unparsable module simply yields no recognized facts. The scan's factory vocabulary is host-injected: the default knows only the element package's own registration factories, and page-definition/registration facts for other packages require the caller's {@link ModuleSemanticsOptions.vocabulary} descriptors.

(source: string, fileName: string, options?: ModuleSemanticsOptions): ModuleSemanticFacts
packages/compiler/src/internal/compiler/semantic-core/module-analysis.ts:550
ClassCandidateRegistryinterface · public
@openelement/compiler · root

One owner's class-candidate facts: the build (or dev server) that created it is the only writer, its stylesheet emitter the only reader.

ClassCandidateRegistry

register: (moduleId: string, candidates: readonly string[], options: { shadow: boolean; }) => void (required) — Register ONE module's statically admitted class candidates. The call is authoritative for that module: an empty list means the module now carries no statically admitted class token, so its previous facts are dropped rather than left to inflate the next stylesheet.; remove: (moduleId: string) => void (required) — Forget one module (a deleted file, a module that left the graph).; forModule: (moduleId: string) => readonly string[] (required) — The candidates one module contributed, or an empty list.; all: () => readonly string[] (required) — Every candidate registered so far, first-seen ordered and deduplicated.; allShadow: () => readonly string[] (required) — The SHADOW-root candidates only. The COMPONENT sheet no longer compiles from this view (a light-root class can render inside a shadow tree, so the sheet takes {@linkcode ClassCandidateRegistry.all}); it stays as the shadow-only view of the facts, for a consumer that wants exactly that.; allLight: () => readonly string[] (required) — The LIGHT-root candidates only — the document sheet's input for an engine that generates its own document CSS (a shadow component's classes are delivered by the component stylesheet and never inflate the document one).; has: () => boolean (required) — True when any module contributed candidates.

packages/compiler/src/internal/compiler/tailwind-candidates.ts:55
clearCompilerDiagnosticsfunction · public
@openelement/compiler · root

Clear without reading — the hygiene a fresh build invocation starts with.

(): void
packages/compiler/src/internal/compiler/semantic-core/diagnostics/index.ts:152
clearStyleRequestsfunction · public
@openelement/compiler · root

Drop every registered edge (a build's bookkeeping is its own lifetime).

(): void
packages/compiler/src/internal/compiler/style-requests.ts:93
compiledArtifactClassCandidatesfunction · public
@openelement/compiler · root

The admitted class candidates of one compiled artifact module, or undefined when the module does not carry the emitted fact. Tolerates both artifact forms the pack pipeline produces (the compiler's raw TypeScript emission and the packed, type-stripped module) — the parse is ScriptKind.TSX for exactly the reason the style-edge recovery documents.

(source: string, fileName: string): readonly string[] | undefined
packages/compiler/src/internal/compiler/compiled-artifact-class-candidates.ts:41
compiledArtifactStyleRequestsfunction · public
@openelement/compiler · root

The `.css` style edges of one compiled artifact module, in authored order — or undefined when the module is not a shape this recovery adopts. Never throws and never guesses: a module without the Part Program marker, without a `.css` specifier, without an arrayed `static styles`, or with a sheet import no class arrays is left entirely to the graph's normal channels, exactly as before this recovery existed. Adoption is all-or-nothing per module, so it can never turn a working module into a fail-closed intercept while half its edges stay unregistered. The read tolerates both artifact forms the pack pipeline produces: the compiler's raw emission (TypeScript syntax, e.g. a `type`-annotated styles member) and the packed module (types stripped by the packer). The AST parse is ScriptKind.TSX for exactly that reason — a diagnostics gate on the file extension would refuse the raw form and silently drop its edges.

(source: string, fileName: string): readonly string[] | undefined
packages/compiler/src/internal/compiler/compiled-artifact-style-requests.ts:104
CompiledElementErrorclass · public
@openelement/compiler · root

Error shape consumed by the Vite plugin and compiler tests.

class CompiledElementError extends CompilerDiagnosticError
packages/compiler/src/internal/compiler/semantic-core/compiler-diagnostics.ts:20
compiledElementPluginfunction · public
@openelement/compiler · root

The `open:compiled-element` Vite plugin: runs at `enforce: 'pre'` so the compiler sees authored TSX before Vite's own TS/JSX lowering, compiles every module with a canonically bound `@element` decorator, and leaves all other modules untouched. `workspaceRoot` anchors generated source-map ids for linked workspace packages.

(options?: CompiledElementPluginOptions): Plugin

workspaceRoot?: string (optional) — Workspace root used as the second identity anchor: Vite ids outside the project root are typically linked workspace packages, and anchoring them on the workspace keeps machine paths out of emitted source maps. Callers that do not know a workspace root omit it and get ids passed through.; typeCheckEmitted?: boolean (optional) — Type-check every module the compiler emits and fail the build when one does not compile (#1386 item 2). Off by default: it runs a TypeScript program per emitted module, which a dev-server transform must not pay. A build or verification pass turns it on, so the emitted program is checked against the declarations the consumer compiles against.; resolutionPaths?: Record<string, string[]> (optional) — Specifier → candidate files map used when `typeCheckEmitted` is on.; staticSidecars?: readonly StaticSidecarDescriptor[] (optional) — Static-sidecar descriptors the host application admits into the compiled module grammar (e.g. its island delivery policy factory). The default core knows none: without an injected descriptor a module carrying a sidecar policy statement fails closed with OEC9008.; candidates?: ClassCandidateRegistry (optional) — The class-candidate registry this plugin instance writes its compiled modules' statically admitted class tokens into (alpha15 S lane). The registry is OWNED by the host that created it — one per build, one per dev server — so two live builds in one process never inherit each other's facts (defect C). Omitted: this instance collects no candidates, which is the right shape for a build that consumes…; resolveServerComponentModule?: ((specifier: string, importer: string) => string | null) (optional) — Host-supplied resolver for the server function component lane's nested imports (`resolveModule` of {@link compileServerComponentModule }): given a specifier and the importing module id, return that module's SOURCE so a nested server function component composes by direct call. Omitting it (or answering undefined) keeps nested composition a coded rejection. The compiler itself never reads the files…; compiledTags?: readonly string[] (optional) — The custom-element host tags the host build admitted as

packages/compiler/src/internal/compiler/plugin.ts:267
compileElementModulefunction · public
@openelement/compiler · root

Compile one opted-in module without binding the caller to Vite. The core adapter hook and the inline SSR/client builds all use this same function, which prevents duplicate compiler implementations from drifting. Returns null for modules without a canonically bound

(code: string, id: string, options?: SemanticCoreOptions): CompileElementResult | null
packages/compiler/src/internal/compiler/plugin.ts:122
compileElementProgramfunction · public
@openelement/compiler · root

Compile one authored TSX module into the compiled Part Program module. `fileName` is used for diagnostics and the emitted source map only — filesystem resolution is the caller's job. Fails closed with a {@link CompiledElementError} carrying the ordered OEC diagnostics. `options.staticSidecars` admits host-declared sidecar policy statements (e.g. an island delivery descriptor); the default core admits none.

(source: string, fileName: string, options?: SemanticCoreOptions): CompileElementResult
packages/compiler/src/internal/compiler/semantic-core/compile.ts:109
CompileElementResultinterface · public
@openelement/compiler · root

The compiled module the transform emits for one authored TSX source: the generated `code`, its Source Map v3, the Part Program facts the runtime consumes, and the ordered diagnostics that did not fail the compile.

CompileElementResult

code: string (required); map: CompiledElementSourceMap (required) — Real Source Map v3 for the emitted module (VLQ line+column segments derived from the compiler's span records and emission provenance). The same map is embedded as the module's inline map; the Vite shell returns it as its `map` output for downstream composition (#1210).; program: PartProgramV2 (required); styleRequests?: readonly string[] (optional) — The module's style edges (#1558): the authored `.css` specifiers the class's `static styles` arrays, in authored order. The host build's style-asset plugin intercepts these edges — a build with no intercepting plugin fails at import resolution, never by silently inlining.; classCandidates?: readonly string[] (optional) — The component's statically admitted class tokens (alpha15 S lane): every whitespace-separated token of a compile-time `class` value the lowering admitted. Opaque strings — the compiler attaches no Tailwind meaning to them; the host build forwards them to the official Tailwind compiler as explicit candidates and emits the generated CSS as an external asset.

packages/compiler/src/internal/compiler/semantic-core/compile.ts:74
compilerDiagnosticsToEnvelopesfunction · public
@openelement/compiler · root

Project the compiler's already-structured diagnostics onto the protocol's {@linkcode DiagnosticEnvelope} shape. An empty list projects to an empty list — the caller keeps its own fallback rather than inventing a record.

(diagnostics: ReadonlyArray<ProjectableCompilerDiagnostic>): DiagnosticEnvelope[]
packages/compiler/src/internal/compiler/semantic-core/diagnostics/index.ts:111
compileServerComponentIfAdmittedfunction · public
@openelement/compiler · root

The host-build admission bridge: compile `code` through the server function component lane when — and only when — this module belongs to it. - a module carrying a compiled-element decorator (or an unsupported decorator spelling, which the class lane compiles so it fails closed with OEC9027) belongs to the class lane: null; - a module with no discovered server function component has nothing to admit: null; - a non-`.tsx` id can never carry the JSX grammar: null; - the cheap `export` + `<` prefilter (the same conservative superset idea the class lane's prefilter uses) keeps plainly inert modules off the parse. Everything else goes through {@link compileServerComponentModule}, whose diagnostics fail the build closed.

(code: string, id: string, options?: ServerComponentCompileOptions): CompileServerComponentResult | null
packages/compiler/src/internal/compiler/semantic-core/server-component.ts:539
compileServerComponentModulefunction · public
@openelement/compiler · root

Compile one authored TSX module's server function components into the generative constructor module. Returns null for modules with no exported JSX-returning function (nothing to admit). Fails closed with a {@link CompiledElementError} carrying the ordered OEC diagnostics.

(source: string, fileName: string, options?: ServerComponentCompileOptions): CompileServerComponentResult | null
packages/compiler/src/internal/compiler/semantic-core/server-component.ts:288
CompileServerComponentResultinterface · public
@openelement/compiler · root

The compiled server function component module.

CompileServerComponentResult

code: string (required) — The generated TS module: verbatim authored content + constructor functions.; map: CompiledElementSourceMap (required) — Real Source Map v3 for the generated component functions.; components: string[] (required) — The compiled component names, sorted.; classCandidates?: string[] (optional) — The statically admitted class tokens (alpha15 S lane), unioned over the compiled components — the host build forwards them to the official Tailwind compiler as explicit candidates.

packages/compiler/src/internal/compiler/semantic-core/server-component.ts:79
createClassCandidateRegistryfunction · public
@openelement/compiler · root

Create one owner's registry (see the lifetime note above).

(): ClassCandidateRegistry
packages/compiler/src/internal/compiler/tailwind-candidates.ts:87
diagnosticPluginErrorfunction · public
@openelement/compiler · root

Project compiler diagnostics onto the adapter's error shape. Returns null for an empty diagnostics list: there is nothing to locate or render, and the caller keeps its own fallback rather than inventing a location.

(diagnostics: CompilerDiagnostic[], source: string, id: string): PluginDiagnosticError | null
packages/compiler/src/internal/compiler/semantic-core/diagnostics/index.ts:209
ElementCompilerDiagnosticinterface · public
@openelement/compiler · root

A source-aware compiler diagnostic: stable OEC code, message and source range.

ElementCompilerDiagnostic

code: string (required); message: string (required); file: string (required); line.toString: (radix?: number) => string (required) — Returns a string representation of an object.; line.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; line.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; line.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; line.valueOf: () => number (required) — Returns the primitive value of the specified object.; line.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.; character: number (required); start: number (required); end: number (required)

packages/compiler/src/internal/compiler/semantic-core/compiler-diagnostics.ts:17
EmittedModuleDiagnosticinterface · public
@openelement/compiler · root

One diagnostic the type checker produced for the emitted module. `file` is the virtual module id the check was given; the remaining fields locate the range inside the EMITTED text.

EmittedModuleDiagnostic

code.toString: (radix?: number) => string (required) — Returns a string representation of an object.; code.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; code.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; code.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; code.valueOf: () => number (required) — Returns the primitive value of the specified object.; code.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.; message: string (required); file: string (required); line: number (required); character: number (required)

packages/compiler/src/internal/compiler/semantic-core/type-check.ts:37
EmittedModuleTypeCheckOptionsinterface · public
@openelement/compiler · root

How the emitted module's imports resolve, and any virtual files to add.

EmittedModuleTypeCheckOptions

paths?: Record<string, string[]> (optional) — Module resolution map for the specifiers the emitted module imports, in TypeScript `paths` form (specifier → candidate files). A caller that resolves `@openelement/element` through the workspace passes that map; omitting it means imported specifiers resolve through `node_modules`, which is what a packed consumer has instead.; compilerOptions?: ts.CompilerOptions (optional) — Extra compiler options, merged over the defaults below.; extraFiles?: Readonly<Record<string, string>> (optional) — Support files the emitted module imports, supplied as text for ids that do not exist on disk (a bundler's other virtual modules). The emitted module itself is added under `fileName`.

packages/compiler/src/internal/compiler/semantic-core/type-check.ts:46
emittedModuleTypeChecksfunction · public
@openelement/compiler · root

`true` when the emitted module type-checks. The boolean form exists so a caller that only needs a verdict does not destructure an empty array; the diagnostics form is for callers that must report what failed.

(code: string, fileName: string, options?: EmittedModuleTypeCheckOptions): boolean
packages/compiler/src/internal/compiler/semantic-core/type-check.ts:178
getStyleRequestfunction · public
@openelement/compiler · root

The edge a resolved sheet module id carries, if any.

(moduleId: string): RegisteredStyleRequest | undefined
packages/compiler/src/internal/compiler/style-requests.ts:65
hasElementDecoratorApplicationfunction · public
@openelement/compiler · root

Precise second stage behind the prefilter: a canonically bound `@element(...)` decorator application on a class declaration (provenance decided by the semantic core's intrinsic-binding model). Modules that only mention the marker in a string literal or comment, or spell it through a foreign/local binding, do not reach the compiler.

(code: string, id: string): boolean
packages/compiler/src/internal/compiler/plugin.ts:107
hasStyleImporterfunction · public
@openelement/compiler · root

True when the importing module has registered edges (query suffixes ignored).

(importerId: string): boolean
packages/compiler/src/internal/compiler/style-requests.ts:70
isCompiledElementModulefunction · public
@openelement/compiler · root

Cheap first stage only — NOT a recognizer. The match keeps plain modules off the AST path and may false-positive (any '@' — inside a string literal, comment, or import specifier — matches); binding provenance and admission are decided exclusively by the semantic core.

(code: string, id: string): boolean
packages/compiler/src/internal/compiler/plugin.ts:96
lightRootScopeTagfunction · public
@openelement/compiler · root

The light-root scope tag of a compiled Part Program — undefined for a shadow-root program, whose sheets ship exactly as authored (they already have a boundary). One reader for the fact, shared by both host bindings of the compiled-element transform (the build plugin and the dev/HMR plugin) and by the compiled-artifact read.

(program: unknown): string | undefined
packages/compiler/src/internal/compiler/style-requests.ts:147
ModuleSemanticFactsinterface · public
@openelement/compiler · root

The bundler-neutral facts one module source yields: its relative imports, the intrinsic bindings it admits ({@link ModuleSemanticFacts.compiledElementDecorator}, {@link ModuleSemanticFacts.exportedTagName}, custom-element tags it defines or references) and the interaction-event names its handlers bind. The Vite graph adapter branches on these without re-parsing the AST.

ModuleSemanticFacts

relativeImports: string[] (required); moduleSpecifiers?: string[] (optional) — Every static import/export specifier the module spells, relative or not — present only when the caller asks for it (`collectSpecifiers`), because a host that walks a module graph through its own resolver (S-C1.4's server-rendered style-edge pass) needs the aliased and package specifiers too, while every other consumer's facts stay exactly as they were.; compiledElementDecorator: boolean (required); unsupportedElementDecorator?: string (optional) — Set when a class decorator spells the `element` intrinsic through unsupported or ambiguous provenance (type-only import, namespace access, default import, conflicting duplicate bindings, or a relative-module re-export). Never set for clearly foreign bindings (third-party packages, local declarations, bare/global spellings) — those modules are simply not OpenElement modules. The plugin gate compil…; exportedTagName?: string (optional); definePage: boolean (required) — True when the module default-exports a page-definition factory call from the host's injected vocabulary, or is an .mdx route. The default scan (no injected vocabulary) never recognizes another package's factories.; pageComponentName?: string (optional) — The server function page fact (alpha15 server lane): the first argument of a default-exported `definePage(…)` call when that argument is an identifier resolving to a server function component THIS module declares. A function component never carries a Part Program, so the route cannot be a compiled class page; the host build renders it through the component function. Spread-conditional: absent for…; serverFunctionComponents: string[] (required) — The exported functions whose body is a single return of JSX — the server-only TSX function components this module declares (alpha15 server lane). Discovery is structural and deterministic: `export function` declarations (named, not default) with exactly one return statement of a JSX element, or `export const` arrows with a JSX expression body. The fact is the cheap graph-walker face; admission an…; usesExportedTagName: boolean (required); enhancedForm: boolean (required); defaultCompiledTag?: string (optional); definedCustomElementTags: string[] (required); referencedCustomElementTags: string[] (required); compilerInteractionEvents: string[] (required)

packages/compiler/src/internal/compiler/semantic-core/module-analysis.ts:12
ModuleSemanticsOptionsinterface · public
@openelement/compiler · root

Host-supplied vocabulary extensions for the module scan.

ModuleSemanticsOptions

vocabulary?: readonly ModuleVocabularyDescriptor[] (optional) — Vocabulary descriptors the host admits beyond the core's own element bindings. The default scan knows no other package: a route module's page-definition export or registration factory is recognized only when the host injects its descriptor.; collectSpecifiers?: boolean (optional) — Collect {@link ModuleSemanticFacts.moduleSpecifiers} (opt-in).

packages/compiler/src/internal/compiler/semantic-core/module-analysis.ts:127
ModuleVocabularyDescriptorinterface · public
@openelement/compiler · root

One module-scan vocabulary entry the host admits: a binding identity (module specifier + exported name, aliases followed) plus the fact a canonical call of that binding contributes. Plain data — the scan consumes the descriptors without learning the caller's package vocabulary, the same direction as the compiler's {@link StaticSidecarDescriptor} admission (#1473 item 3).

ModuleVocabularyDescriptor

moduleSpecifier: string (required) — Canonical module specifier the factory must be imported from.; exportName: string (required) — Exported name of the factory binding.; kind: "page-definition" | "element-registration" (required) — What a canonical call of the binding contributes to the scan.

packages/protocol/src/module-descriptors.ts:33
PluginDiagnosticErrorinterface · public
@openelement/compiler · root

Rollup-compatible error shape emitted by the Vite adapter boundary.

PluginDiagnosticError

id: string (required); loc: { file: string; line: number; column: number; } (required); frame: string (required); message: string (required); diagnostics: CompilerDiagnostic[] (required)

packages/compiler/src/internal/compiler/semantic-core/diagnostics/index.ts:167
readCompiledArtifactStylesfunction · public
@openelement/compiler · root

The same recovery, read once for both facts an artifact states: its edges and its root scope (alpha15 S lane, S-C1.2). The scope comes from the module's own Part Program literal — the emitter writes it verbatim, so the packed form needs no second source of truth and no assumption about which root kind a shipped package used.

(source: string, fileName: string): CompiledArtifactStyleRead | undefined
packages/compiler/src/internal/compiler/compiled-artifact-style-requests.ts:118
recordCompilerDiagnosticsfunction · public
@openelement/compiler · root

Record one compile failure's envelopes for the build exit (#1612).

(diagnostics: ReadonlyArray<ProjectableCompilerDiagnostic>): void
packages/compiler/src/internal/compiler/semantic-core/diagnostics/index.ts:138
RegisteredStyleRequestinterface · public
@openelement/compiler · root

One registered style edge: the authored import's build-graph coordinates.

RegisteredStyleRequest

moduleId: string (required) — Resolved edge module id — the registry key, and what resolveId answers.; importer: string (required) — The importing module's id as the build graph tracks it.; specifier: string (required) — The authored `.css` specifier the generated module imports verbatim.; file: string (required) — The sheet file's absolute path — where the intercepting build reads the bytes.; scopeTag?: string (optional) — The light-root component tag this edge's emitted asset is scoped to (alpha15 S lane, S-C1.2). A light root has no shadow boundary, so its sheets leave the build wrapped in native `@scope (<tag>)`; the tag is therefore part of the edge's identity, not a detail of its bytes — two components sharing one sheet file are two resources with two scopes. Absent for a shadow-root edge, whose bytes ship exa…

packages/compiler/src/internal/compiler/style-requests.ts:21
registerStyleEdgesfunction · public
@openelement/compiler · root

Register one module's style edges (the registry's one write path, S-C1.4). The importing component's root scope is part of every edge it registers (alpha15 S lane, S-C1.2): a light-root component's sheets leave the build wrapped in `@scope (<tag>)`, so the tag travels to the intercept through the registry key. A shipped artifact states the same fact in its Part Program literal. The Vite transform is the caller for a module the bundler processes; a build host that admits a module for its ADMISSION FACTS alone (a Page or Layout the server renders and no island imports) calls the same step with the same compiled program — no second writer, no second registry.

(id: string, specifiers: readonly string[], scopeTag: string | undefined): void
packages/compiler/src/internal/compiler/plugin.ts:244
registerStyleRequestfunction · public
@openelement/compiler · root

Register one generated edge (idempotent per module id — recompiles overwrite).

(request: RegisteredStyleRequest): void

moduleId: string (required) — Resolved edge module id — the registry key, and what resolveId answers.; importer: string (required) — The importing module's id as the build graph tracks it.; specifier: string (required) — The authored `.css` specifier the generated module imports verbatim.; file: string (required) — The sheet file's absolute path — where the intercepting build reads the bytes.; scopeTag?: string (optional) — The light-root component tag this edge's emitted asset is scoped to (alpha15 S lane, S-C1.2). A light root has no shadow boundary, so its sheets leave the build wrapped in native `@scope (<tag>)`; the tag is therefore part of the edge's identity, not a detail of its bytes — two components sharing one sheet file are two resources with two scopes. Absent for a shadow-root edge, whose bytes ship exa…

packages/compiler/src/internal/compiler/style-requests.ts:53
SemanticCoreOptionsinterface · public
@openelement/compiler · root

Host-supplied admission extensions for the semantic core.

SemanticCoreOptions

staticSidecars?: readonly StaticSidecarDescriptor[] (optional) — Static-sidecar descriptors the host admits. The default core knows none: a module carrying a sidecar policy statement fails closed until the host injects its descriptor.

packages/compiler/src/internal/compiler/semantic-core/module-analysis.ts:117
ServerComponentCompileOptionsinterface · public
@openelement/compiler · root

Host-supplied inputs for the server function component compile.

ServerComponentCompileOptions

resolveModule?: ((specifier: string) => string | undefined) (optional) — Resolve one authored import specifier to that module's SOURCE, so a nested server function component composes by direct call to the imported binding (compile-time resolved, deterministic). Absent or returning undefined: importing components from that specifier is a coded rejection. Resolution of specifiers to files stays the host's job — the compiler never reads the filesystem.; compiledTags?: readonly string[] (optional) — The custom-element host tags the host build admitted as

packages/compiler/src/internal/compiler/semantic-core/server-component.ts:60
stableModuleIdfunction · public
@openelement/compiler · root

Compile-time source identity for a module: absolute Vite ids are converted to project-relative POSIX paths so Part Program `metadata.sourceFile` and `sourceMap.file` never embed the build machine's path. Module resolution, diagnostics, and HMR keys keep using the caller's own id. Anchors are explicit, never guessed from path substrings (a checkout living under e.g. `/srv/www/` must not fool the cut): the Vite project root first, then the workspace root when the caller knows it (a module outside the project root is typically a linked workspace package). Callers that hand the compiler a path outside every known root (synthetic ids, projects without a Vite root) get the id back unchanged — there is no correct relative form to invent, and the library boundary must not reject paths it cannot anchor. This module stays runtime-neutral: resolving a workspace root from disk is the caller's job.

(file: string, root: string | undefined, workspaceRoot?: string): string
packages/compiler/src/internal/compiler/plugin.ts:162
StaticSidecarDescriptorinterface · public
@openelement/compiler · root

One static-sidecar descriptor the host injects into the element compiler: the admission granted is a colocated static policy statement (#1473 item 3, the static-sidecar admission pattern).

StaticSidecarDescriptor

moduleSpecifier: string (required) — Canonical module specifier the sidecar export must be imported from.; exportName: string (required) — Exported name of the sidecar factory binding.; kind: "static-sidecar" (required) — The admission granted: a colocated static policy statement.

packages/protocol/src/module-descriptors.ts:16
stripInlineSourceMapCommentfunction · public
@openelement/compiler · root

Strip the inline map comment from a compiled module at the Vite boundary. The core artifact embeds its real Source Map v3 inline for standalone consumers; the Vite transform returns that same map as its `map` output so Vite composes it with the rest of the pipeline — leaving the comment in the served code would create a second, conflicting map story (#1210).

(code: string): string
packages/compiler/src/internal/compiler/plugin.ts:142
styleEdgesForFilefunction · public
@openelement/compiler · root

Every edge whose sheet file is the given path — the dev HMR reverse lookup.

(file: string): RegisteredStyleRequest[]
packages/compiler/src/internal/compiler/style-requests.ts:75
styleRequestFilefunction · public
@openelement/compiler · root

The sheet file's absolute path for one authored edge: the importing module's directory joined with the authored specifier. Relative specifiers only (the compiler refuses bare ones), so the join is total. Parent segments (`../theme.css`) resolve lexically against the directory — the key must be the path the bundler's resolver lands on, never a verbatim `..` id no lookup can match.

(importerId: string, specifier: string): string
packages/compiler/src/internal/compiler/style-requests.ts:162
styleRequestModuleIdfunction · public
@openelement/compiler · root

The registry key for one authored edge: the sheet file's resolved path, plus the importing component's light-root scope tag when it has one. Query suffixes on the importer id (dev-time cache busting) are stripped, so recompiles re-register under one key; the full relative path keeps same-named sheets in sibling subdirectories distinct edges. The scope tag rides the key because the emitted asset is a different resource per scope: a light root's sheet is served wrapped in `@scope (<tag>)`. Registering an edge passes the tag explicitly (the caller is the compile that just proved it); the intercept resolves a `.css` import from `(importer, specifier)` alone, so it reads the same fact back through the importer index. Both paths land on one key for one edge, and a disagreement can only fail closed at the intercept — never emit an unscoped asset.

(importerId: string, specifier: string, scopeTag?: string): string
packages/compiler/src/internal/compiler/style-requests.ts:125
styleRequestsForImporterfunction · public
@openelement/compiler · root

Every edge one importing module declared. The host build uses it to emit the style resources of modules it admitted for their edges alone (S-C1.4: a Page or Layout the server renders and no island imports).

(importerId: string): RegisteredStyleRequest[]
packages/compiler/src/internal/compiler/style-requests.ts:87
takeCompilerDiagnosticsfunction · public
@openelement/compiler · root

Drain the recorded envelopes: the exit reads them exactly once.

(): DiagnosticEnvelope[]
packages/compiler/src/internal/compiler/semantic-core/diagnostics/index.ts:145
typeCheckEmittedModulefunction · public
@openelement/compiler · root

Type-check one emitted compiled module. Returns `[]` when the module type-checks; otherwise every diagnostic the checker reported, in emission order, so a build can print all of them instead of only the first. The `fileName` should be the module's real (virtual) id, not a placeholder: module resolution and `paths` matching both key off it, and the diagnostics quote it back.

(code: string, fileName: string, options?: EmittedModuleTypeCheckOptions): EmittedModuleDiagnostic[]
packages/compiler/src/internal/compiler/semantic-core/type-check.ts:91
validatePartProgramfunction · public
@openelement/compiler · root

Validate an unknown value as a Part Program v2. The validator is intentionally strict: unknown instruction kinds, missing ownership records and unsafe paths fail before a runtime can guess at their meaning.

(raw: unknown): asserts raw is PartProgram
packages/protocol/src/part-program.ts:925
elementfunction · public
@openelement/compiler · ./vite

The `open:compiled-element` Vite plugin: runs at `enforce: 'pre'` so the compiler sees authored TSX before Vite's own TS/JSX lowering, compiles every module with a canonically bound `@element` decorator, and leaves all other modules untouched. `workspaceRoot` anchors generated source-map ids for linked workspace packages.

(options?: CompiledElementPluginOptions): Plugin

workspaceRoot?: string (optional) — Workspace root used as the second identity anchor: Vite ids outside the project root are typically linked workspace packages, and anchoring them on the workspace keeps machine paths out of emitted source maps. Callers that do not know a workspace root omit it and get ids passed through.; typeCheckEmitted?: boolean (optional) — Type-check every module the compiler emits and fail the build when one does not compile (#1386 item 2). Off by default: it runs a TypeScript program per emitted module, which a dev-server transform must not pay. A build or verification pass turns it on, so the emitted program is checked against the declarations the consumer compiles against.; resolutionPaths?: Record<string, string[]> (optional) — Specifier → candidate files map used when `typeCheckEmitted` is on.; staticSidecars?: readonly StaticSidecarDescriptor[] (optional) — Static-sidecar descriptors the host application admits into the compiled module grammar (e.g. its island delivery policy factory). The default core knows none: without an injected descriptor a module carrying a sidecar policy statement fails closed with OEC9008.; candidates?: ClassCandidateRegistry (optional) — The class-candidate registry this plugin instance writes its compiled modules' statically admitted class tokens into (alpha15 S lane). The registry is OWNED by the host that created it — one per build, one per dev server — so two live builds in one process never inherit each other's facts (defect C). Omitted: this instance collects no candidates, which is the right shape for a build that consumes…; resolveServerComponentModule?: ((specifier: string, importer: string) => string | null) (optional) — Host-supplied resolver for the server function component lane's nested imports (`resolveModule` of {@link compileServerComponentModule }): given a specifier and the importing module id, return that module's SOURCE so a nested server function component composes by direct call. Omitting it (or answering undefined) keeps nested composition a coded rejection. The compiler itself never reads the files…; compiledTags?: readonly string[] (optional) — The custom-element host tags the host build admitted as

packages/compiler/src/internal/compiler/plugin.ts:267

@openelement/router

215 exports
Actiontype · public
@openelement/router · root

Route action: handles form submissions for a page route.

Action<T, Env, Platform, Route>
packages/protocol/src/data.ts:64
ACTION_FETCH_HEADERconst · public
@openelement/router · root

Request header selecting the action response channel: `true` marks a programmatic caller and selects the serialized ActionResult union; `enhance` marks the built-in morph enhancement and selects the same full-HTML responses the no-JS path receives.

"x-openelement-action"
packages/protocol/src/data.ts:125
ActionContextinterface · public
@openelement/router · root

Context passed to a route action function (extends loader context).

ActionContext<Env, Platform, Route>

formData: FormData (required); request: Request (required); params: Record<string, string> (required); env: Env (required); platform: Platform (required); responseHeaders: Headers (required) — Mutable response-only channel merged into the framework response.; route: Route (required)

packages/protocol/src/data.ts:47
ActionOutcometype · public
@openelement/router · root

The discriminated result an action returns: `success` carries the action's data; `failure` carries an HTTP status and payload. See `ActionResult` for the canonical classifier that produces it.

ActionOutcome<Data>
packages/router/src/authoring.ts:207
ActionResulttype · public
@openelement/router · root

Wire shape returned to the JavaScript form-enhancement path. The no-JS path never sees this: it gets the equivalent semantics as plain HTTP (303 on success, 422 with the re-rendered form on validation failure, redirect/error as status codes). Success carries no data envelope. The application-loop contract makes a successful non-GET action answer 303 (PRG) — the framework never answers 200 with a rendered page, or with a success document, for a successful mutation — so the fetch channel answers `{ type: 'redirect' }` naming the PRG target and the authored return value is discarded by design. Success data travels the PRG target instead (query state the loader re-runs with, which the props projector then maps; see the router guide's "Form actions" section). The union previously declared a `{ type: 'success' }` member that no code path ever emitted — removed so the type matches the wire. Error outcomes (CSRF 403, unknown action 404, unparseable body 400, unexpected 500) are NOT part of this union: since #863 they answer RFC 9457 Problem Details with the PROBLEM_JSON_MEDIA_TYPE content type — see ProblemDetails.

ActionResult<Failure>
packages/protocol/src/data.ts:92
classifyActionResultfunction · public
@openelement/router · root

Canonical application-level classification for an action return value. Server and SPA executors project this result differently, but neither may redefine validation failure or admit a raw Response as action data.

<Data>(result: Data): ActionOutcome<Data>
packages/router/src/authoring.ts:216
CONVENTION_BASE_DIRconst · public
@openelement/router · root

Default convention base: the directory the tokens/layout/data conventions resolve under when `dirs` is omitted (or has no shared leading segment).

"app"
packages/router/src/config.ts:77
CONVENTION_COMPONENTS_DIRconst · public
@openelement/router · root

Default component directory (`app/components`), the `dirs.components` default.

"app/components"
packages/router/src/config.ts:71
CONVENTION_HEAD_PATHconst · public
@openelement/router · root

Convention path for the structural document-head module (`app/head.tsx`).

"app/head.tsx"
packages/router/src/config.ts:95
CONVENTION_HEAD_SUFFIXconst · public
@openelement/router · root

Convention-relative suffix of the structural document-head module.

"head.tsx"
packages/router/src/config.ts:86
CONVENTION_ISLANDS_DIRconst · public
@openelement/router · root

Default island directory (`app/islands`), the `dirs.islands` default.

"app/islands"
packages/router/src/config.ts:68
CONVENTION_LAYOUT_PATHconst · public
@openelement/router · root

Convention path for the auto-registered layout.

"app/layout.tsx"
packages/router/src/config.ts:92
CONVENTION_LAYOUT_SUFFIXconst · public
@openelement/router · root

Convention-relative suffix of the auto-registered layout.

"layout.tsx"
packages/router/src/config.ts:83
CONVENTION_LAYOUT_TAGconst · public
@openelement/router · root

The tag name the convention layout is registered under.

"app-layout"
packages/router/src/config.ts:98
CONVENTION_PACKAGE_JSONconst · public
@openelement/router · root

The site-title convention source (the package.json `name` field).

"package.json"
packages/router/src/config.ts:101
CONVENTION_ROUTES_DIRconst · public
@openelement/router · root

Default route directory (`app/routes`), the `dirs.routes` default.

"app/routes"
packages/router/src/config.ts:65
CONVENTION_STYLES_SUFFIXconst · public
@openelement/router · root

Convention-relative suffix of the design-token stylesheet.

"styles/tokens.css"
packages/router/src/config.ts:80
CONVENTION_TOKENS_PATHconst · public
@openelement/router · root

Convention path for the design-token stylesheet.

"app/styles/tokens.css"
packages/router/src/config.ts:89
conventionHeadPathfunction · public
@openelement/router · root

The structural document-head convention path for a resolved `dirs` block.

(base: string): string
packages/router/src/config.ts:688
conventionLayoutPathfunction · public
@openelement/router · root

The layout convention path for a resolved `dirs` block.

(base: string): string
packages/router/src/config.ts:683
conventionTokensPathfunction · public
@openelement/router · root

The token stylesheet convention path for a resolved `dirs` block.

(base: string): string
packages/router/src/config.ts:678
createRequestContextfunction · public
@openelement/router · root

Build the canonical OpenElement request context from a platform request event.

<Env extends Record<string, unknown> = Record<string, unknown>>(options: CreateRequestContextOptions<Env>): OpenElementRequestContext<Env>

request: Request (required); params?: Record<string, string> (optional); env?: Env (optional); platform?: unknown (optional)

packages/router/src/model.ts:45
CreateRequestContextOptionsinterface · public
@openelement/router · root

Inputs for building an {@linkcode OpenElementRequestContext} from a platform request event.

CreateRequestContextOptions<Env>

request: Request (required); params?: Record<string, string> (optional); env?: Env (optional); platform?: unknown (optional)

packages/router/src/model.ts:17
defineConfigfunction · public
@openelement/router · root

`defineConfig()` — identity helper that pins the config file's shape.

(config: OpenElementUserConfig): OpenElementUserConfig

renderer?: "native" | "lit" (optional) — Page renderer. Omit to keep the compiled native renderer.; dirs.routes?: string (optional) — Route directory. Defaults to `app/routes`.; dirs.islands?: string (optional) — Island directory. Defaults to `app/islands`.; dirs.components?: string (optional) — Component directory. Defaults to `app/components`.; layout?: false | { import: string; props?: Record<string, unknown>; } (optional) — Layout. `false` opts out of the `layout.tsx` convention; an object registers the named module. `tagName` is derived from the import's basename, so it is not part of the surface.; packageIslands?: string[] | "auto" | "manual" (optional) — How component packages are admitted. Omitted or `'auto'` (the default): the scan derives the set from the package element modules the app really imports, and an array adds explicit entries (explicit outranks a derived claim on a shared tag). `'manual'`: the escape hatch — derivation off, only listed packages are admitted, an imported-but-unlisted package is reported with the explicit fix.; head.title?: string (optional) — Document title; defaults to the package.json `name`.; head.description?: string (optional) — `<meta name="description">` + `og:description`.; head.lang?: string (optional) — `<html lang>`; defaults to `en`.; head.favicon?: string (optional) — Site-root-relative favicon path, emitted as `<link rel="icon">`.; head.ogImage?: string (optional) — `og:image` URL. Absolute (crawlable) or site-root-relative.; head.stylesheets?: string[] (optional) — External stylesheets linked into `<head>`.; head.scripts?: OpenElementHeadScript[] (optional) — External scripts emitted into `<head>`; inline code is not accepted here.; styles.tokens?: string (optional) — Token stylesheet path; defaults to the `styles/tokens.css` convention.; i18n?: OpenElementI18nConfig (optional) — Locale-prefixed build configuration.; viewTransition?: boolean (optional) — Client-navigation View Transitions. Boolean for now; an object form (per-transition types) is a possible future widening of this key.; tailwind?: boolean | TailwindOptions (optional) — The Tailwind entry (alpha15 S lane, opt-in): the config-file home for the same option the inline `openElement(...)` face takes. `true` enables the entry with no declared sources; an object names the style sources that compile into the document stylesheet — see `TailwindOptions` (@openelement/router/vite).; unocss?: boolean | UnocssOptions (optional) — The UnoCSS entry (alpha15 stage 2B, opt-in): the sibling of `tailwind`. Declaring it selects UnoCSS as this application's style engine; declaring both keys is a conflict and fails closed — see `UnocssOptions` (@openelement/router/vite).; speculation?: boolean (optional) — Speculation Rules emission. Boolean for now: `true` uses the framework route-derived defaults, `false` emits none. An object form (explicit prerender/prefetch lists, exclusions, eagerness) is a possible future widening of this key.; build.manifestBudget?: Record<string, number> (optional) — Advisory per-entry manifest budgets in KB, e.g. `{ islandKB: 100, totalJsKB: 300 }`.; middleware.corsOrigin?: string | string[] (optional) — CORS allowlist; omitted means localhost-only reflection (production warning).

packages/router/src/config.ts:291
defineIslandConfigfunction · public
@openelement/router · root

Validate and register an island delivery descriptor; returns the normalized config.

(config: IslandConfig): IslandConfig

ssr?: boolean (optional); dsd?: boolean (optional); hydrate?: IslandDeliveryStrategy (optional) — Delivery strategy for this island: one of the four element hydration triggers ('load' | 'idle' | 'visible' | 'only' — the element package's `HydrationStrategy`), or the router-level 'media' delivery strategy, which fetches the chunk only while the required `media` query matches.; media?: string (optional) — Media query required by the `media` delivery strategy.; root?: "light" | "shadow" (optional) — The root family this island is delivered in: `'shadow'` (the compiled default, DSD markup in a shadow root) or `'light'` (the component's children live in the document tree, which is what lets a light island use utility classes without a shadow-boundary workaround). Declarative only: `@element(tag, { root: 'light' })` on the component class is the single source of truth, and the build fails close…; tags?: readonly string[] (optional) — Custom-element tags delivered by this one capability module.; tagNames?: readonly string[] (optional) — Alias accepted by generated artifact producers.; exportNames?: Readonly<Record<string, string>> (optional) — Named constructor exports keyed by delivered custom-element tag.

packages/router/src/authoring.ts:795
definePagefunction · public
@openelement/router · root

Attach a page descriptor to a compiled page element class. Canonical page authoring: the route module default-exports the compiled class (produced by the open:compiled-element transform) wrapped in definePage(). The descriptor holds head/route/renderIntent metadata plus the optional props/error projectors; it must NOT create classes or hold a render function — the compiled class's Part Program is the render. import { definePage } from '@openelement/router'; import { HomePage } from '../components/page-home.tsx'; export const loader = async (ctx) => ({ ... }); // module named exports export default definePage(HomePage, { head: { title: 'Home' }, props: ({ data }) => ({ heading: data?.heading ?? '' }), }); The server function page form (alpha15 server lane) passes the module's exported TSX component function instead — the compiler has already lowered it to a generative HTML constructor, so the same call admits it as a `kind: 'function-page'` descriptor whose render IS that function: export function Home(props: { heading: string }) { return <main><h1>{props.heading}</h1></main>; } export const loader = async () => ({ heading: 'Home' }); export default definePage(Home, { head: { title: 'Home' } }); Runtime discriminant (one rule, no text sniffing): a first argument that is an element CLASS — a value carrying `__partProgram` (what the compiled- element transform emits) or class syntax (its `prototype` is a non-writable own property; plain functions and arrows are not classes) — takes the class branch; any other function takes the function-page branch. Non-functions fail closed with NOT_COMPILED_CLASS.

<Data = unknown, Params extends Record<string, string> = Record<string, string>>(componentClass: CustomElementConstructor, descriptor?: PageDescriptorInput<Data, Params>): PageComponentConstructor<Data, Params>
packages/router/src/authoring.ts:482
failfunction · public
@openelement/router · root

Return a structured action failure with an HTTP status and typed data payload.

<Data>(status: number, data: Data): OpenElementActionFailure<Data>

toString: (radix?: number) => string (required) — Returns a string representation of an object.; toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; valueOf: () => number (required) — Returns the primitive value of the specified object.; toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.

packages/router/src/authoring.ts:186
FunctionPageComponenttype · public
@openelement/router · root

The route-module default export shape a definePage() component call produces.

FunctionPageComponent<Data, Params>
packages/router/src/authoring.ts:420
isActionFailurefunction · public
@openelement/router · root

Type guard for {@linkcode OpenElementActionFailure}, including its duck-typed cross-realm shape.

(error: unknown): error is OpenElementActionFailure
packages/router/src/authoring.ts:191
IslandConfiginterface · public
@openelement/router · root

Per-island delivery configuration (SSR/DSD participation and hydration strategy).

IslandConfig

ssr?: boolean (optional); dsd?: boolean (optional); hydrate?: IslandDeliveryStrategy (optional) — Delivery strategy for this island: one of the four element hydration triggers ('load' | 'idle' | 'visible' | 'only' — the element package's `HydrationStrategy`), or the router-level 'media' delivery strategy, which fetches the chunk only while the required `media` query matches.; media?: string (optional) — Media query required by the `media` delivery strategy.; root?: "light" | "shadow" (optional) — The root family this island is delivered in: `'shadow'` (the compiled default, DSD markup in a shadow root) or `'light'` (the component's children live in the document tree, which is what lets a light island use utility classes without a shadow-boundary workaround). Declarative only: `@element(tag, { root: 'light' })` on the component class is the single source of truth, and the build fails close…; tags?: readonly string[] (optional) — Custom-element tags delivered by this one capability module.; tagNames?: readonly string[] (optional) — Alias accepted by generated artifact producers.; exportNames?: Readonly<Record<string, string>> (optional) — Named constructor exports keyed by delivered custom-element tag.

packages/router/src/authoring.ts:705
IslandDeliveryStrategytype · public
@openelement/router · root

Adapter-owned browser delivery strategy, including media-query admission.

IslandDeliveryStrategy
packages/protocol/src/ssg.ts:31
isOpenElementNotFoundfunction · public
@openelement/router · root

Type guard for {@linkcode OpenElementNotFound}, including its duck-typed cross-realm shape.

(error: unknown): error is OpenElementNotFound
packages/router/src/authoring.ts:150
isOpenElementRedirectfunction · public
@openelement/router · root

Type guard for {@linkcode OpenElementRedirect}, including its duck-typed cross-realm shape.

(error: unknown): error is OpenElementRedirect
packages/router/src/authoring.ts:134
JsonValuetype · public
@openelement/router · root

A JSON value: the complete set of shapes the structured-data channel admits (JSON primitives, arrays and plain objects, all readonly). Functions, `undefined`, bigint, symbols, class instances, Date, Map and Set are rejected by the runtime normalizer and by this type, so an author cannot write a document the serializer would refuse.

JsonValue
packages/router/src/authoring.ts:237
Loadertype · public
@openelement/router · root

Route loader: fetches data for a page route.

Loader<T, Env, Platform, Route>
packages/protocol/src/data.ts:56
LoaderContextinterface · public
@openelement/router · root

Context passed to a request-time ('dynamic') route loader.

LoaderContext<Env, Platform, Route>

request: Request (required); params: Record<string, string> (required); env: Env (required); platform: Platform (required); responseHeaders: Headers (required) — Mutable response-only channel merged into the framework response.; route: Route (required)

packages/protocol/src/data.ts:40
notFoundfunction · public
@openelement/router · root

Throw an {@linkcode OpenElementNotFound} to render the 404 path.

(message?: string): never
packages/router/src/authoring.ts:129
OPEN_ELEMENT_BUILD_KEYSconst · public
@openelement/router · root

Accepted keys inside `build`.

readonly string[]
packages/router/src/config.ts:365
OPEN_ELEMENT_CONFIG_FILEconst · public
@openelement/router · root

Canonical config-file name, resolved in the project root.

"openelement.config.ts"
packages/router/src/config.ts:62
OPEN_ELEMENT_CONFIG_KEYSconst · public
@openelement/router · root

The exact accepted key set, used by the fail-closed unknown-key check and by the error message (the message must name the accepted surface, never just reject). The nested arrays below are this module's single copy of the sub-key surfaces; the host-tooling loader imports them instead of restating them.

readonly string[]
packages/router/src/config.ts:302
OPEN_ELEMENT_DIRS_KEYSconst · public
@openelement/router · root

Accepted keys inside `dirs`.

readonly string[]
packages/router/src/config.ts:353
OPEN_ELEMENT_HEAD_KEYSconst · public
@openelement/router · root

Accepted keys inside `head`.

readonly string[]
packages/router/src/config.ts:325
OPEN_ELEMENT_HEAD_SCRIPT_KEYSconst · public
@openelement/router · root

Keys of one `head.scripts` entry.

readonly string[]
packages/router/src/config.ts:336
OPEN_ELEMENT_HEAD_STRING_KEYSconst · public
@openelement/router · root

Head keys that carry a plain string value.

readonly string[]
packages/router/src/config.ts:344
OPEN_ELEMENT_I18N_KEYSconst · public
@openelement/router · root

Accepted keys inside `i18n`.

readonly string[]
packages/router/src/config.ts:362
OPEN_ELEMENT_LAYOUT_KEYSconst · public
@openelement/router · root

Accepted keys inside `layout`.

readonly string[]
packages/router/src/config.ts:356
OPEN_ELEMENT_MIDDLEWARE_KEYSconst · public
@openelement/router · root

Accepted keys inside `middleware`.

readonly string[]
packages/router/src/config.ts:368
OPEN_ELEMENT_STYLES_KEYSconst · public
@openelement/router · root

Accepted keys inside `styles`.

readonly string[]
packages/router/src/config.ts:359
OpenElementActionFailureclass · public
@openelement/router · root

Expected-failure channel for actions (decision 0120): validation failures RETURN `fail(status, data)` — never throw — so the server can answer 422 with the form re-rendered and the submitted values echoed back. Thrown values keep the exception channel (redirect/notFound/error page).

class OpenElementActionFailure
packages/router/src/authoring.ts:167
OpenElementBuildConfiginterface · public
@openelement/router · root

Build-output switches.

OpenElementBuildConfig

manifestBudget?: Record<string, number> (optional) — Advisory per-entry manifest budgets in KB, e.g. `{ islandKB: 100, totalJsKB: 300 }`.

packages/router/src/config.ts:157
OpenElementDirsConfiginterface · public
@openelement/router · root

Source roots; see the `dirs` section of the module doc comment.

OpenElementDirsConfig

routes?: string (optional) — Route directory. Defaults to `app/routes`.; islands?: string (optional) — Island directory. Defaults to `app/islands`.; components?: string (optional) — Component directory. Defaults to `app/components`.

packages/router/src/config.ts:147
OpenElementFunctionPageDescriptorinterface · public
@openelement/router · root

The function-page descriptor the pipeline reads (`module.default.openElementPage` with `kind: 'function-page'`): same metadata/projector shape as {@link OpenElementPageDescriptor} plus the compiled component function — no element class exists, so the generated entry registers nothing and renders through the render function.

OpenElementFunctionPageDescriptor<Data, Params>

kind: "function-page" (required); route.id?: string (optional); route.params?: readonly string[] (optional); route.layout?: string | false (optional) — Named layout selection (decision 0123): a string picks one of the `openElement({ layouts })` entries by name (unknown names fall back to the default layout); `false` renders the page without any layout. Unset means the default shell.; head?: PageHead | PageHeadResolver<Data, Params> (optional); renderIntent: NormalizedPageRenderIntent (required); props?: PagePropsProjector<Data, Params> (optional); error?: PageErrorProjector<Data, Params> (optional); render: ServerPageComponent (required)

packages/router/src/authoring.ts:406
OpenElementHeadConfiginterface · public
@openelement/router · root

The document-head channel. Structured only: every entry serializes through the framework's URL/attribute validators, so a raw HTML string has no way in. Structural head content that is not expressible here (font preloads, icons, feed links, inline CSS) belongs in the `app/head.tsx` convention instead.

OpenElementHeadConfig

title?: string (optional) — Document title; defaults to the package.json `name`.; description?: string (optional) — `<meta name="description">` + `og:description`.; lang?: string (optional) — `<html lang>`; defaults to `en`.; favicon?: string (optional) — Site-root-relative favicon path, emitted as `<link rel="icon">`.; ogImage?: string (optional) — `og:image` URL. Absolute (crawlable) or site-root-relative.; stylesheets?: string[] (optional) — External stylesheets linked into `<head>`.; scripts?: OpenElementHeadScript[] (optional) — External scripts emitted into `<head>`; inline code is not accepted here.

packages/router/src/config.ts:121
OpenElementHeadScriptinterface · public
@openelement/router · root

One structured `<script src>` descriptor accepted by `head.scripts`.

OpenElementHeadScript

src: string (required) — Script URL: absolute, or site-root relative (`/theme-init.js`).; defer?: boolean (optional) — Emit `defer`; leave unset for a parser-blocking external script.; crossOrigin?: string (optional) — `crossorigin` attribute value, e.g. `anonymous`.; integrity?: string (optional) — Subresource-integrity digest for the script.

packages/router/src/config.ts:104
OpenElementI18nConfiginterface · public
@openelement/router · root

Locale configuration for a locale-prefixed build.

OpenElementI18nConfig

locales: string[] (required) — Every locale the build emits, default locale included.; defaultLocale: string (required) — The locale served at the unprefixed root.

packages/router/src/config.ts:139
OpenElementNotFoundclass · public
@openelement/router · root

Not-found signal thrown from a loader to render the route's 404 path.

class OpenElementNotFound extends OpenElementError
packages/router/src/authoring.ts:108
OpenElementPageDescriptorinterface · public
@openelement/router · root

The page descriptor the pipeline reads (`module.default.openElementPage`). Attached to the compiled page class by definePage(); the class owns the render program, so the descriptor carries metadata and projectors only.

OpenElementPageDescriptor<Data, Params>

kind: "page" (required); route.id?: string (optional); route.params?: readonly string[] (optional); route.layout?: string | false (optional) — Named layout selection (decision 0123): a string picks one of the `openElement({ layouts })` entries by name (unknown names fall back to the default layout); `false` renders the page without any layout. Unset means the default shell.; head?: PageHead | PageHeadResolver<Data, Params> (optional); renderIntent: NormalizedPageRenderIntent (required); props?: PagePropsProjector<Data, Params> (optional); error?: PageErrorProjector<Data, Params> (optional)

packages/router/src/authoring.ts:369
OpenElementRedirectclass · public
@openelement/router · root

Redirect signal thrown from a loader/action to short-circuit rendering with an HTTP redirect.

class OpenElementRedirect extends OpenElementError
packages/router/src/authoring.ts:80
OpenElementRequestContextinterface · public
@openelement/router · root

Host-agnostic request context shared by App request adapters.

OpenElementRequestContext<Env>

request: Request (required); url: URL (required); path: string (required); method: string (required); params: Record<string, string> (required); searchParams: URLSearchParams (required); env?: Env (optional); platform?: unknown (optional)

packages/router/src/model.ts:3
OpenElementUserConfiginterface · public
@openelement/router · root

Overrides accepted by an `openelement.config.ts` file (unknown keys fail closed).

OpenElementUserConfig

renderer?: "native" | "lit" (optional) — Page renderer. Omit to keep the compiled native renderer.; dirs.routes?: string (optional) — Route directory. Defaults to `app/routes`.; dirs.islands?: string (optional) — Island directory. Defaults to `app/islands`.; dirs.components?: string (optional) — Component directory. Defaults to `app/components`.; layout?: false | { import: string; props?: Record<string, unknown>; } (optional) — Layout. `false` opts out of the `layout.tsx` convention; an object registers the named module. `tagName` is derived from the import's basename, so it is not part of the surface.; packageIslands?: string[] | "auto" | "manual" (optional) — How component packages are admitted. Omitted or `'auto'` (the default): the scan derives the set from the package element modules the app really imports, and an array adds explicit entries (explicit outranks a derived claim on a shared tag). `'manual'`: the escape hatch — derivation off, only listed packages are admitted, an imported-but-unlisted package is reported with the explicit fix.; head.title?: string (optional) — Document title; defaults to the package.json `name`.; head.description?: string (optional) — `<meta name="description">` + `og:description`.; head.lang?: string (optional) — `<html lang>`; defaults to `en`.; head.favicon?: string (optional) — Site-root-relative favicon path, emitted as `<link rel="icon">`.; head.ogImage?: string (optional) — `og:image` URL. Absolute (crawlable) or site-root-relative.; head.stylesheets?: string[] (optional) — External stylesheets linked into `<head>`.; head.scripts?: OpenElementHeadScript[] (optional) — External scripts emitted into `<head>`; inline code is not accepted here.; styles.tokens?: string (optional) — Token stylesheet path; defaults to the `styles/tokens.css` convention.; i18n?: OpenElementI18nConfig (optional) — Locale-prefixed build configuration.; viewTransition?: boolean (optional) — Client-navigation View Transitions. Boolean for now; an object form (per-transition types) is a possible future widening of this key.; tailwind?: boolean | TailwindOptions (optional) — The Tailwind entry (alpha15 S lane, opt-in): the config-file home for the same option the inline `openElement(...)` face takes. `true` enables the entry with no declared sources; an object names the style sources that compile into the document stylesheet — see `TailwindOptions` (@openelement/router/vite).; unocss?: boolean | UnocssOptions (optional) — The UnoCSS entry (alpha15 stage 2B, opt-in): the sibling of `tailwind`. Declaring it selects UnoCSS as this application's style engine; declaring both keys is a conflict and fails closed — see `UnocssOptions` (@openelement/router/vite).; speculation?: boolean (optional) — Speculation Rules emission. Boolean for now: `true` uses the framework route-derived defaults, `false` emits none. An object form (explicit prerender/prefetch lists, exclusions, eagerness) is a possible future widening of this key.; build.manifestBudget?: Record<string, number> (optional) — Advisory per-entry manifest budgets in KB, e.g. `{ islandKB: 100, totalJsKB: 300 }`.; middleware.corsOrigin?: string | string[] (optional) — CORS allowlist; omitted means localhost-only reflection (production warning).

packages/router/src/config.ts:220
PageComponentConstructortype · public
@openelement/router · root

A compiled element class carrying the page descriptor static.

PageComponentConstructor<Data, Params>
packages/router/src/authoring.ts:382
PageErrorProjectortype · public
@openelement/router · root

Maps a caught render/loader/action failure onto the error variant of the page's compiled properties. Its presence declares that the page's compiled markup carries an error variant (the generated entry renders the page with these props and status 500 — the POST/GET error-boundary channel of decision 0121 §7); without it the generic status page answers.

PageErrorProjector<Data, Params>
packages/router/src/authoring.ts:337
PageHeadinterface · public
@openelement/router · root

Page <head> meaning declared by a route descriptor (decision 0143; canonical/alternates in #1326; structured data via the typed JSON-LD channel). Either a static object or — via PageHeadResolver — resolved per render from the request-scoped context by resolvePageDocument (@openelement/router/document) before either serializer runs.

PageHead

title?: string (optional); description?: string (optional); meta?: Record<string, string | number | boolean>[] (optional); canonical?: string (optional) — Canonical URL of this page (#1326), resolved into <link rel="canonical"> by the shared Document seam.; alternates?: { href: string; hreflang?: string; }[] (optional) — Locale alternates of this page (#1326), resolved into <link rel="alternate" hreflang="..."> entries in author order.; structuredData?: StructuredDataEntry[] (optional) — Structured data (JSON-LD) for this page, resolved into one `<script type="application/ld+json">` element per document in <head>. This is a DATA channel, not a markup channel: entries must be JSON data, and resolvePageDocument fails closed on anything JSON cannot represent (functions, undefined, non-finite numbers, non-plain objects, cycles). It is deliberately NOT reachable through `dangerouslyHe…; dangerouslyHeadFragments?: string[] (optional)

packages/router/src/authoring.ts:260
PageHeadResolvertype · public
@openelement/router · root

Resolves a page's head from the request-scoped context (#1326). The resolver receives the same context object the props projector gets and must stay a pure function of it — the Document seam (@openelement/router/ document) never fetches, caches, or schedules loaders on its own.

PageHeadResolver<Data, Params>
packages/router/src/authoring.ts:348
PagePropsContextinterface · public
@openelement/router · root

The request-scoped context handed to a page's props projector. Everything a compiled page can render must pass through here: the compiled render() only reads `this.<property>`, so the projector is the single deterministic seam that maps loader data, action data, params and request onto the page's compiled properties (decision 0143).

PagePropsContext<Data, Params>

data: Data (required); actionData: unknown (required) — The 422 re-render payload of a RETURNED action failure (`fail(status, data)`): the classified `failure.data`, verbatim. It is `undefined` on every other render — a successful action answers 303 (PRG), and the projector runs again only on the redirected GET, where success data arrives through the loader's re-run (read the PRG target's query state there). There is no success envelope on this channe…; params: Params (required); request?: Request (optional); locale?: string (optional) — Resolved application locale for this render, when i18n is configured.; route.path?: string (optional); route.filePath?: string (optional); meta: PageMeta (required)

packages/router/src/authoring.ts:296
PagePropsProjectortype · public
@openelement/router · root

Maps the request-scoped context onto the page's compiled properties. Declared as part of the page descriptor; the generated server entry and the SPA bootstrap call it per render and feed the result to renderToString() props (server) or pre-connect property sets (SPA).

PagePropsProjector<Data, Params>
packages/router/src/authoring.ts:325
PROBLEM_JSON_MEDIA_TYPEconst · public
@openelement/router · root

Media type of the RFC 9457 action error channel (#863).

"application/problem+json"
packages/protocol/src/data.ts:117
ProblemDetailsinterface · public
@openelement/router · root

RFC 9457 Problem Details document (#863): the action error channel answers `application/problem+json` instead of the bespoke `{ type: 'error', error: { message } }` JSON, so HTTP tooling recognizes failures natively. With `type: 'about:blank'`, `title` is the HTTP reason phrase and `detail` carries the specific explanation. The wire shape is alpha-unfrozen; the 1.0 acceptance freezes it in this problem+json form.

ProblemDetails

type: string (required) — URI reference identifying the problem type; 'about:blank' when none applies.; title: string (required) — Short human-readable summary (the HTTP reason phrase for 'about:blank').; status.toString: (radix?: number) => string (required) — Returns a string representation of an object.; status.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; status.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; status.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; status.valueOf: () => number (required) — Returns the primitive value of the specified object.; status.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.; detail?: string (optional) — Human-readable explanation specific to this occurrence.

packages/protocol/src/data.ts:105
projectPagePropsfunction · public
@openelement/router · root

Default request-to-props projection used when a page descriptor declares no props projector: route params first, then loader-data record entries. The compiled serializer consumes only the page's declared compiled properties, so extra entries are ignored. Shared by the generated server entries and the SPA bootstrap (each carries its own copy — generated code cannot import this module's internals). Dangerous keys are filtered through the canonical isDangerousKey predicate (#1214): a hostile loader payload such as JSON.parse('{"__proto__": ...}') can never re-prototype the projection record or the page host it is projected onto. The generated server runtime enforces the same rule with a serialized copy of the canonical DANGEROUS_KEYS list.

(context: { params?: Record<string, string>; data?: unknown; }): Record<string, unknown>

params?: Record<string, string> (optional); data?: unknown (optional)

packages/router/src/authoring.ts:678
redirectfunction · public
@openelement/router · root

Throw an {@linkcode OpenElementRedirect} for `location` (status must be a real 3xx).

(location: string | URL, status?: number): never

hash: string (required) — The **`hash`** property of the URL interface is a string containing a "#" followed by the fragment identifier of the URL. If the URL does not have a fragment identifier, this property contains an empty string, "". [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash); host: string (required) — The **`host`** property of the URL interface is a string containing the host, which is the hostname, and then, if the port of the URL is nonempty, a ":", followed by the port of the URL. If the URL does not have a hostname, this property contains an empty string, "". [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host); hostname: string (required) — The **`hostname`** property of the URL interface is a string containing either the domain name or IP address of the URL. If the URL does not have a hostname, this property contains an empty string, "". IPv4 and IPv6 addresses are normalized, such as stripping leading zeros, and domain names are converted to IDN. [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname); href: string (required) — The **`href`** property of the URL interface is a string containing the whole URL. [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/href); toString: () => string (required); origin: string (required) — The **`origin`** read-only property of the URL interface returns a string containing the Unicode serialization of the origin of the represented URL. [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/origin); password: string (required) — The **`password`** property of the URL interface is a string containing the password component of the URL. If the URL does not have a password, this property contains an empty string, "". [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password); pathname: string (required) — The **`pathname`** property of the URL interface represents a location in a hierarchical structure. It is a string constructed from a list of path segments, each of which is prefixed by a / character. [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname); port: string (required) — The **`port`** property of the URL interface is a string containing the port number of the URL. If the port is the default for the protocol (80 for ws: and http:, 443 for wss: and https:, and 21 for ftp:), this property contains an empty string, "". [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port); protocol: string (required) — The **`protocol`** property of the URL interface is a string containing the protocol or scheme of the URL, including the final ":". [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol); search: string (required) — The **`search`** property of the URL interface is a search string, also called a query string, that is a string containing a "?" followed by the parameters of the URL. If the URL does not have a search query, this property contains an empty string, "". [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search); searchParams: URLSearchParams (required) — The **`searchParams`** read-only property of the URL interface returns a URLSearchParams object allowing access to the GET decoded query arguments contained in the URL. [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/searchParams); username: string (required) — The **`username`** property of the URL interface is a string containing the username component of the URL. If the URL does not have a username, this property contains an empty string, "". [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username); toJSON: () => string (required) — The **`toJSON()`** method of the URL interface returns a string containing a serialized version of the URL, although in practice it seems to have the same effect as URL.toString(). [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/toJSON)

packages/router/src/authoring.ts:124
resolveDirsfunction · public
@openelement/router · root

Resolve `dirs` to the three absolute-in-project roots the scanner reads. Omitted entries take the documented defaults.

(dirs: OpenElementDirsConfig | undefined): { routes: string; islands: string; components: string; base: string; }

routes?: string (optional) — Route directory. Defaults to `app/routes`.; islands?: string (optional) — Island directory. Defaults to `app/islands`.; components?: string (optional) — Component directory. Defaults to `app/components`.

packages/router/src/config.ts:642
ServerPageComponenttype · public
@openelement/router · root

A compiled server page component function (alpha15 server lane): the route module's exported TSX component after the server component lane compiled it — props in, final HTML out. While authoring, the TSX function's inferred type is JSX.Element-returning (the compiler owns the body), so this type admits every function shape; the runtime discriminant in definePage() is the authority on which branch a value takes.

ServerPageComponent
packages/router/src/authoring.ts:397
ServerRouteContextinterface · public
@openelement/router · root

Canonical request-time/SSG server route context.

ServerRouteContext<Env, Platform, Route>

request: Request (required); params: Record<string, string> (required); env: Env (required); platform: Platform (required); responseHeaders: Headers (required) — Mutable response-only channel merged into the framework response.; route: Route (required)

packages/protocol/src/data.ts:25
ServerRouteMetadatainterface · public
@openelement/router · root

Context passed to a request-time ('dynamic') route loader. This is the server contract: the loader runs on the server with the Web-standard request, matched route params, the host environment and the platform object, and signals validation failure via fail()/redirect().

ServerRouteMetadata

path: string (required); filePath: string (required)

packages/protocol/src/data.ts:19
StructuredDataEntrytype · public
@openelement/router · root

One structured-data document — a JSON-LD node such as a schema.org BlogPosting or WebSite. Its values are JSON data (string, finite number, boolean, null, array, plain object) and nothing else: the serializer emits the document as data, so an HTML string is not a document here.

StructuredDataEntry
packages/router/src/authoring.ts:251
runBuildClifunction · public
@openelement/router · ./cli/build

Run the production build and exit with the build's verdict. Shared by the `openelement build` bin subcommand (cli.ts) and this module's own main block, so both faces behave identically.

(argv?: string[]): Promise<void>
packages/router/src/cli/build.ts:28
runServeClifunction · public
@openelement/router · ./cli/start

Run the serve CLI with the arguments that follow the command (the bin's `start` subcommand passes them through verbatim, so `--mode=preview` reaches the mode parser unchanged). Shared by the `openelement` bin (cli.ts) and this module's own main block.

(argv: string[]): Promise<void>
packages/router/src/cli/start.ts:491
ClientScriptDescriptorinterface · public
@openelement/router · ./document

One framework client script a resolved document embeds before `</body>`. Shape-compatible with the serializer's script descriptors, so the document channel routes it through without conversion; entries without src or code are meaningless and rejected at resolution (never silently dropped).

ClientScriptDescriptor

src?: string (optional) — External script URL (attribute-escaped at serialization).; code?: string (optional) — Inline script body. Trusted framework input, never user content.; type?: string (optional) — Script type attribute, e.g. 'module'; omitted means a classic script.

packages/router/src/loading/module/nonce.ts:31
PageHeadAlternateinterface · public
@openelement/router · ./document

One <link rel="alternate"> record, typically carrying an hreflang.

PageHeadAlternate

href: string (required); hreflang?: string (optional)

packages/router/src/document.ts:42
ResolvedDocumentinterface · public
@openelement/router · ./document

A page's resolved document meaning: every <head> field after the head resolver (when the descriptor declares one) has run, plus the normalized `links` projection the serializers consume. Call-site precedence is resolved-document value first, route/build docConfig fallback second.

ResolvedDocument

title?: string (optional); description?: string (optional); meta?: Record<string, string | number | boolean>[] (optional); structuredData?: StructuredDataEntry[] (optional) — Structured data (JSON-LD), one serialized `<script type= "application/ld+json">` element per entry. Normalized here to plain JSON data so the serializer only has to escape, never interpret.; dangerouslyHeadFragments?: string[] (optional); clientScripts?: ClientScriptDescriptor[] (optional) — The framework client scripts this document embeds before `</body>` — structured descriptors rendered by the serializer at document time (#1471), never by post-build HTML surgery. The serializer attaches the per-request CSP nonce; SSG output carries none.; lang?: string (optional) — Document language: the resolved application locale for this render, and ONLY that. It stays undefined on a single-locale site — the seam never defaults it to `'en'` — so the configured document `head.lang` remains the fallback the serializers apply. A project that declared i18n always resolves a locale, and that locale overrides the configured value (the document-language decision record).; canonical?: string (optional); alternates?: PageHeadAlternate[] (optional); links: ResolvedDocumentLink[] (required) — Canonical first, then alternates in author order — deterministic.

packages/router/src/document.ts:60
resolvePageDocumentfunction · public
@openelement/router · ./document

Resolves the descriptor head into the page's ResolvedDocument. A head may be a static object or a resolver receiving the same request-scoped context the props projector gets; resolver output is validated exactly like a static head so malformed page meaning fails loudly at either build time or request time instead of being silently dropped from the serialized document. `clientScripts` carries the framework's client-script descriptors (the build's client asset manifest — the render wiring hands them in, they are never author head data); they are validated like every other field and become part of the resolved document, so every render channel — the SSG render pass included — serializes the final script tags from one place.

(head: PageHead | PageHeadResolver | undefined, context: PagePropsContext, clientScripts?: readonly ClientScriptDescriptor[]): ResolvedDocument

title?: string (optional); description?: string (optional); meta?: Record<string, string | number | boolean>[] (optional); canonical?: string (optional) — Canonical URL of this page (#1326), resolved into <link rel="canonical"> by the shared Document seam.; alternates?: { href: string; hreflang?: string; }[] (optional) — Locale alternates of this page (#1326), resolved into <link rel="alternate" hreflang="..."> entries in author order.; structuredData?: StructuredDataEntry[] (optional) — Structured data (JSON-LD) for this page, resolved into one `<script type="application/ld+json">` element per document in <head>. This is a DATA channel, not a markup channel: entries must be JSON data, and resolvePageDocument fails closed on anything JSON cannot represent (functions, undefined, non-finite numbers, non-plain objects, cycles). It is deliberately NOT reachable through `dangerouslyHe…; dangerouslyHeadFragments?: string[] (optional)

packages/router/src/document.ts:197
createHonoAdapterfunction · public
@openelement/router · ./hono

Wraps a WinterCG handler in a Hono app: every method and path delegates to the handler with the host's env binding and — when the host runtime provides one — its execution context. The generated entry's `openElementRuntimeAdapter` and default export plug in unmodified: ```ts import { createHonoAdapter } from '@openelement/router/hono'; import openElement from './dist/server/entry.js'; const app = await createHonoAdapter(openElement); export default app; ```

(handler: WinterCgHandler): Promise<object>
packages/router/src/hono-adapter.ts:43
WinterCgHandlertype · public
@openelement/router · ./hono

The WinterCG request handler the generated entries export.

WinterCgHandler
packages/router/src/hono-adapter.ts:21
createRouteMiddlewarefunction · public
@openelement/router · ./http

Mount after host middleware/routes; unmatched URLs continue to the host.

(records: readonly HttpRouteRecord[], options?: RouteTableOptions & { methodNotAllowed?: (request: Request, allow: readonly string[]) => Response | Promise<Response>; }): (request: Request, next: () => Promise<Response>…
packages/router/src/http.ts:48
HttpHandlertype · public
@openelement/router · ./http

Dialect-free WinterCG route handler: return a Response to short-circuit, or `next()` to pass control down the method's handler chain; the last handler's `next` is the host middleware chain's own next.

HttpHandler
packages/router/src/http.ts:16
HttpRouteContextinterface · public
@openelement/router · ./http

Route-scoped request context handed to every {@link HttpHandler}.

HttpRouteContext

params: Record<string, string> (required); searchParams: URLSearchParams (required); url: URL (required)

packages/router/src/http.ts:5
HttpRouteRecordinterface · public
@openelement/router · ./http

A route record for the WinterCG middleware ({@link createRouteMiddleware}): the matching fields of a {@link RouteRecord} plus a per-method handler (or handler chain) map, so one path can answer each HTTP method differently.

HttpRouteRecord

handlers: Readonly<Record<string, HttpHandler | readonly HttpHandler[]>> (required); path: string (required); id?: string (optional); pattern.protocol?: string (optional); pattern.username?: string (optional); pattern.password?: string (optional); pattern.hostname?: string (optional); pattern.port?: string (optional); pattern.search?: string (optional); pattern.hash?: string (optional); pattern.baseURL?: string (optional)

packages/router/src/http.ts:27
defineLitPagefunction · public
@openelement/router · ./lit

Attach a page descriptor and host tag to a LitElement page class. import { defineLitPage } from '@openelement/router/lit'; import { NotesListPage } from '../components/notes-list-page.ts'; export const loader = async (ctx) => ({ ... }); export default defineLitPage('notes-list-page', NotesListPage, { renderIntent: { mode: 'dynamic' }, head: { title: 'Notes' }, props: ({ data }) => ({ notes: data?.notes ?? [] }), }); The class is rendered server-side by

<Data = unknown, Params extends Record<string, string> = Record<string, string>>(tag: string, componentClass: CustomElementConstructor, descriptor?: LitPageDescriptorInput<Data, Params>): LitPageConstructor<Data, Params>
packages/router/src/lit.ts:63
LitPageConstructortype · public
@openelement/router · ./lit

A LitElement page class carrying the page descriptor and its host tag.

LitPageConstructor<Data, Params>
packages/router/src/lit.ts:39
OpenElementPageDescriptorinterface · public
@openelement/router · ./lit

The page descriptor the pipeline reads (`module.default.openElementPage`). Attached to the compiled page class by definePage(); the class owns the render program, so the descriptor carries metadata and projectors only.

OpenElementPageDescriptor<Data, Params>

kind: "page" (required); route.id?: string (optional); route.params?: readonly string[] (optional); route.layout?: string | false (optional) — Named layout selection (decision 0123): a string picks one of the `openElement({ layouts })` entries by name (unknown names fall back to the default layout); `false` renders the page without any layout. Unset means the default shell.; head?: PageHead | PageHeadResolver<Data, Params> (optional); renderIntent: NormalizedPageRenderIntent (required); props?: PagePropsProjector<Data, Params> (optional); error?: PageErrorProjector<Data, Params> (optional)

packages/router/src/authoring.ts:369
renderLitPageToHtmlfunction · public
@openelement/router · ./lit-ssr

Render a registered LitElement page host to DSD HTML. Fails closed when the tag is invalid or no element class is registered for it in the SSR registry: the generated entry registers every page/island class explicitly before rendering, so an unregistered host is a pipeline bug, never a silent passthrough.

({ tag, props, }: { tag: string; props?: Record<string, unknown>; }): { html: string; }

tag: string (required); props?: Record<string, unknown> (optional)

packages/router/src/lit-ssr.ts:70
createOpenElementNitroHandlerfunction · public
@openelement/router · ./nitro-mount

Mounts an OpenElement request handler on a Nitro v3 route. Near pass-through: the event's standard `req` goes in, the handler's Response comes out — h3 v2 serves a returned Response as-is.

<Env extends Record<string, unknown> = Record<string, unknown>>(options: OpenElementNitroMountOptions<Env>): (event: NitroRequestEvent<Env>) => Promise<Response>

handler: OpenElementRequestHandler<Env> (required); env?: Env (optional); platform?: unknown (optional); onBeforeRequestContext?: ((context: OpenElementRequestContext<Env>) => void | Promise<void>) (optional) — Observes the normalized OpenElement request context before the application handler runs. Route params are empty here unless the host supplies them on `event.context.params` before dispatch.

packages/router/src/nitro-mount.ts:56
NitroRequestEventinterface · public
@openelement/router · ./nitro-mount

Minimal Nitro v3 route event shape (#857). Nitro v3 is fetch-native: its h3 v2 event carries `req`, a srvx ServerRequest that already IS a standard Request, so the pre-v3 method/path/headers/body translation layer is gone. The mount only wires the OpenElement runtime context around the standard Request → Response seam.

NitroRequestEvent<Env>

req: Request (required); context.params?: Record<string, string> (optional); env?: Env (optional); platform?: unknown (optional)

packages/router/src/nitro-mount.ts:12
OpenElementNitroMountOptionsinterface · public
@openelement/router · ./nitro-mount

Options for mounting an OpenElement request handler under a Nitro/Node server.

OpenElementNitroMountOptions<Env>

handler: OpenElementRequestHandler<Env> (required); env?: Env (optional); platform?: unknown (optional); onBeforeRequestContext?: ((context: OpenElementRequestContext<Env>) => void | Promise<void>) (optional) — Observes the normalized OpenElement request context before the application handler runs. Route params are empty here unless the host supplies them on `event.context.params` before dispatch.

packages/router/src/nitro-mount.ts:20
normalizeRoutePatternForURLPatternfunction · public
@openelement/router · ./router

Convert the framework's Hono-style route dialect to WHATWG URLPattern syntax.

(path: string): string
packages/router/src/internal/router/route-pattern.ts:2
RouteMatchinterface · public
@openelement/router · ./router

One URL matched against the table: the matched `route` record, the identity reported for it, the decoded path `params`, the parsed `searchParams`, and the raw URLPattern `patternResult` the match was derived from.

RouteMatch<T>

route: T (required); id: string (required); params: Record<string, string> (required); searchParams: URLSearchParams (required); patternResult: RoutePatternResult (required)

packages/router/src/internal/router/route-table.ts:67
RouteRecordinterface · public
@openelement/router · ./router

One route as the table stores it: the pathname `path`, an optional stable `id` used in match results, optional non-pathname URL component patterns, and the admitted `methods`.

RouteRecord

path: string (required); id?: string (optional); pattern.protocol?: string (optional); pattern.username?: string (optional); pattern.password?: string (optional); pattern.hostname?: string (optional); pattern.port?: string (optional); pattern.search?: string (optional); pattern.hash?: string (optional); pattern.baseURL?: string (optional); methods?: readonly string[] (optional)

packages/router/src/internal/router/route-table.ts:54
RouteResolutiontype · public
@openelement/router · ./router

The table's verdict for one request: a `match` (with the resolved method), `method-not-allowed` (with the `allow` list the caller answers 405 with), or `not-found` when no path in the table matches at all.

RouteResolution<T>
packages/router/src/internal/router/route-table.ts:80
RouteTableclass · public
@openelement/router · ./router

Immutable route matcher built once from a route list: it freezes every record, rejects duplicate identities and pathname-owning patterns at construction, and answers {@link RouteTable.resolve} with a {@link RouteResolution}. `Pattern` is injectable so callers can pin the URLPattern implementation.

class RouteTable
packages/router/src/internal/router/route-table.ts:168
RouteTableOptionsinterface · public
@openelement/router · ./router

Construction options: a URL prefix every route is mounted under, and whether a trailing slash is significant.

RouteTableOptions

basePath?: string (optional); trailingSlash?: "strict" | "ignore" (optional)

packages/router/src/internal/router/route-table.ts:86
CompiledRouteMatchertype · public
@openelement/router · ./router/client

The matcher surface a client route list compiles to: matching, resolution and candidate count.

CompiledRouteMatcher

match: (input: string | URL, search?: string) => RouteMatch<RouteConfig> | null (required); resolve: (input: string | URL, search?: string, method?: string) => RouteResolution<RouteConfig> (required); candidateCount: (input: string | URL) => number (required)

packages/router/src/internal/router/client-router.ts:82
compileRouteMatcherfunction · public
@openelement/router · ./router/client

Compile a client route list into the canonical {@link RouteTable} matcher, with no router instance attached.

(routes: RouteConfig[]): CompiledRouteMatcher
packages/router/src/internal/router/client-router.ts:110
createRouterfunction · public
@openelement/router · ./router/client

Create the client-side SPA router for `options.mode` over `options.routes`: it matches through the shared RouteTable, owns its navigation listeners and history/hash state, and reports every committed navigation through `onChange`.

(options: RouterOptions): RouterInstance

mode: RouterMode (required); routes: RouteConfig[] (required); onChange?: (() => void | Promise<void>) (optional) — Called after navigation or browser history/hash changes update the current match.; onPending?: (() => void) (optional) — Invalidate pending execution as soon as a newer navigation owns intent.; viewTransitions?: boolean (optional) — Opt in to wrapping the render step of every navigation in document.startViewTransition when the platform offers it (the animation itself is user CSS via ::view-transition-* — the framework ships zero animation code). Default off, NAMED DEVIATION from #1561's wrap-by-default ruling — verified cross-engine platform behavior (2026-10-08, Chromium 147 / Firefox Nightly / WebKit 26.4, deterministic th…

packages/router/src/internal/router/client-router.ts:133
matchRoutefunction · public
@openelement/router · ./router/client

Match a route through the canonical RouteTable.

(pathname: string, search: string, routes: RouteConfig[]): RouteMatch<RouteConfig> | null
packages/router/src/internal/router/client-router.ts:98
RouteConfiginterface · public
@openelement/router · ./router/client

One client route: a {@link RouteRecord} plus the custom element `tagName` SPA mode instantiates for it and an optional `guard` that may veto the navigation by returning `false` or a redirect path.

RouteConfig

tagName: string (required) — Custom element tag to instantiate directly in SPA mode.; guard?: (() => Promise<boolean | string>) (optional); path: string (required); id?: string (optional); pattern.protocol?: string (optional); pattern.username?: string (optional); pattern.password?: string (optional); pattern.hostname?: string (optional); pattern.port?: string (optional); pattern.search?: string (optional); pattern.hash?: string (optional); pattern.baseURL?: string (optional); methods?: readonly string[] (optional)

packages/router/src/internal/router/client-router.ts:29
RouterInstanceinterface · public
@openelement/router · ./router/client

A live client router: the navigation entry points, the current match (`currentPath`/`currentRoute`/`params`/`searchParams`), and `dispose()` to release its listeners.

RouterInstance

navigate: (path: string) => Promise<void> (required); replace: (path: string) => Promise<void> (required); dispose: () => void (required); currentPath: string (required); currentRoute: RouteConfig | null (required); params: Record<string, string> (required); searchParams: URLSearchParams (required)

packages/router/src/internal/router/client-router.ts:69
RouterModetype · public
@openelement/router · ./router/client

Navigation strategy: the History API ('history'), the URL hash ('hash'), or file-protocol auto-detection ('auto').

RouterMode
packages/router/src/internal/router/client-router.ts:22
ACTION_FETCH_HEADERconst · public
@openelement/router · ./server-runtime

Request header selecting the action response channel: `true` marks a programmatic caller and selects the serialized ActionResult union; `enhance` marks the built-in morph enhancement and selects the same full-HTML responses the no-JS path receives.

"x-openelement-action"
packages/protocol/src/data.ts:125
actionErrorResponsefunction · public
@openelement/router · ./server-runtime

The fetch-channel 500 (#863, #558): an unexpected action rejection answers RFC 9457 problem+json with internals scrubbed in production (the detail degrades to the reason phrase; development keeps the message for debugging). The native channel stays on the generated handler's HTML error boundary. `production` is the entry's `import.meta.env.PROD`, injected so this module stays free of build-tool globals.

(context: OpenElementRequestScope, routePath: string, error: unknown, production: boolean): Response

req: RequestScopeRequest (required); headers: Headers (required) — The response-header channel. Headers the handler or the built-in middleware write before a response exists (`Cache-Control`, `Vary`, `X-Request-Id`, the security set) land here and merge into every response the scope builds. Stream routes hand the handler a separate committed stream channel; the scope keeps supplying the framework set.; env: Record<string, unknown> (required) — The runtime env binding (`fetch(request, env)`).; executionCtx: unknown (required) — The host execution context; throws when the host passed none (call sites guard).; header: (name: string, value: string, options?: { append?: boolean; }) => void (required) — Writes one response header on the channel (set by default, append opt-in).; get: (key: string) => unknown (required) — Reads one typed variable (e.g. `cspNonce`).; set: (key: string, value: unknown) => void (required) — Writes one typed variable.; json: (object: unknown, status?: number, headers?: Record<string, string>) => Response (required) — `application/json` response starting from the channel headers.; text: (text: string, status?: number, headers?: Record<string, string>) => Response (required) — `text/plain; charset=UTF-8` response starting from the channel headers.; html: (html: string, status?: number, headers?: Record<string, string>) => Response (required) — `text/html; charset=UTF-8` response starting from the channel headers.; redirect: (location: string, status?: number) => Response (required) — Redirect response (`Location` + status, default 302).; body: (data: BodyInit | null, status?: number, headers?: Record<string, string>) => Response (required) — Raw-body response starting from the channel headers.

packages/router/src/vite/internal/server-runtime/action-runtime.ts:379
ActionExecutioninterface · public
@openelement/router · ./server-runtime

What one protocol run hands back to the generated handler.

ActionExecution

response?: Response (optional) — When set, the handler returns this response and renders nothing.; actionResult?: ActionOutcome (optional) — The classified action outcome for the 422 re-render (native failure path).

packages/router/src/vite/internal/server-runtime/action-runtime.ts:63
ActionLoadContexttype · public
@openelement/router · ./server-runtime

The load context the generated handler built; actions receive it plus `formData`.

ActionLoadContext
packages/router/src/vite/internal/server-runtime/action-runtime.ts:51
ActionProtocolStateinterface · public
@openelement/router · ./server-runtime

The per-request action channel state: mutated by {@linkcode runActionProtocol} before any protocol exit so the generated handler's catch block can branch on the fetch path.

ActionProtocolState

isFetch: boolean (required)

packages/router/src/vite/internal/server-runtime/action-runtime.ts:58
actionRedirectResponsefunction · public
@openelement/router · ./server-runtime

The redirect exit for a POST action: every 3xx an author throws out of an action is coerced to 303 — PRG must be method-safe and non-cacheable. The native form channel answers a real 303; the fetch channel answers HTTP 200 with the redirect carried as the ActionResult body (`{ type: 'redirect', status: 303, location }`) — the serialized client executor matches on the body, not the HTTP status. GET handlers keep the author's status (the generated catch emits that branch itself).

(context: OpenElementRequestScope, location: string, isFetch: boolean): Response

req: RequestScopeRequest (required); headers: Headers (required) — The response-header channel. Headers the handler or the built-in middleware write before a response exists (`Cache-Control`, `Vary`, `X-Request-Id`, the security set) land here and merge into every response the scope builds. Stream routes hand the handler a separate committed stream channel; the scope keeps supplying the framework set.; env: Record<string, unknown> (required) — The runtime env binding (`fetch(request, env)`).; executionCtx: unknown (required) — The host execution context; throws when the host passed none (call sites guard).; header: (name: string, value: string, options?: { append?: boolean; }) => void (required) — Writes one response header on the channel (set by default, append opt-in).; get: (key: string) => unknown (required) — Reads one typed variable (e.g. `cspNonce`).; set: (key: string, value: unknown) => void (required) — Writes one typed variable.; json: (object: unknown, status?: number, headers?: Record<string, string>) => Response (required) — `application/json` response starting from the channel headers.; text: (text: string, status?: number, headers?: Record<string, string>) => Response (required) — `text/plain; charset=UTF-8` response starting from the channel headers.; html: (html: string, status?: number, headers?: Record<string, string>) => Response (required) — `text/html; charset=UTF-8` response starting from the channel headers.; redirect: (location: string, status?: number) => Response (required) — Redirect response (`Location` + status, default 302).; body: (data: BodyInit | null, status?: number, headers?: Record<string, string>) => Response (required) — Raw-body response starting from the channel headers.

packages/router/src/vite/internal/server-runtime/action-runtime.ts:359
ApiRouteFunctiontype · public
@openelement/router · ./server-runtime

A fn-form API handler: the `(ctx) => Response` form an API route module default-exports.

ApiRouteFunction
packages/router/src/vite/internal/server-runtime/wintercg.ts:183
applyCspNoncefunction · public
@openelement/router · ./server-runtime

Instantiates a generated CSP policy template for one request: replaces the first `NONCE_PLACEHOLDER` marker with the request nonce. The template is build-time data (route wiring produced it from the author's `middleware.csp` policy); only this substitution is runtime semantics.

(policyTemplate: string, nonce: string): string
packages/router/src/vite/internal/server-runtime/response-channel.ts:145
assertCompiledStreamRoutefunction · public
@openelement/router · ./server-runtime

Startup guard for a page route under the compiled stream runtime: the route's literal stream declaration must match the build-time manifest (field list, program tag, program version) and the module must carry the compiled Part Program the manifest was derived from. Moved verbatim from the emitted `__assertStreamRoute` body.

(module: unknown, route: string, file: string, manifest: StreamRouteManifestLike | undefined): void
packages/router/src/vite/internal/server-runtime/route-dispatch.ts:37
assertLitStreamRoutefunction · public
@openelement/router · ./server-runtime

Startup guard for a page route under a renderer without compiled-stream support (the lit fork): a route declaring `renderIntent.stream` fails the build loudly instead of silently rendering static.

(module: unknown, route: string, file: string): void
packages/router/src/vite/internal/server-runtime/route-dispatch.ts:21
boundRequestScopefunction · public
@openelement/router · ./server-runtime

The scope accessor the generated handlers and built-in middleware share.

(request: Request): OpenElementRequestScope | undefined

cache: RequestCache (required) — The **`cache`** read-only property of the Request interface contains the cache mode of the request. It controls how the request will interact with the browser's HTTP cache. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/cache); credentials: RequestCredentials (required) — The **`credentials`** read-only property of the Request interface reflects the value given to the Request() constructor in the credentials option. It determines whether or not the browser sends credentials with the request, as well as whether any Set-Cookie response headers are respected. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/credentials); destination: RequestDestination (required) — The **`destination`** read-only property of the Request interface returns a string describing the type of content being requested. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/destination); headers: Headers (required) — The **`headers`** read-only property of the Request interface contains the Headers object associated with the request. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/headers); integrity: string (required) — The **`integrity`** read-only property of the Request interface contains the subresource integrity value of the request. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/integrity); keepalive: boolean (required) — The **`keepalive`** read-only property of the Request interface contains the request's keepalive setting (true or false), which indicates whether the browser will keep the associated request alive if the page that initiated it is unloaded before the request is complete. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/keepalive); method: string (required) — The **`method`** read-only property of the Request interface contains the request's method (GET, POST, etc.) [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/method); mode: RequestMode (required) — The **`mode`** read-only property of the Request interface contains the mode of the request (e.g., cors, no-cors, same-origin, or navigate.) This is used to determine if cross-origin requests lead to valid responses, and which properties of the response are readable. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/mode); redirect: RequestRedirect (required) — The **`redirect`** read-only property of the Request interface contains the mode for how redirects are handled. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/redirect); referrer: string (required) — The **`referrer`** read-only property of the Request interface is set by the user agent to be the referrer of the Request. (e.g., client, no-referrer, or a URL.) [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/referrer); referrerPolicy: ReferrerPolicy (required) — The **`referrerPolicy`** read-only property of the Request interface returns the referrer policy, which governs what referrer information, sent in the Referer header, should be included with the request. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/referrerPolicy); signal: AbortSignal (required) — The read-only **`signal`** property of the Request interface returns the AbortSignal associated with the request. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/signal); url: string (required) — The **`url`** read-only property of the Request interface contains the URL of the request. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/url); clone: () => Request (required) — The **`clone()`** method of the Request interface creates a copy of the current Request object. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/clone); body: ReadableStream<Uint8Array<ArrayBuffer>> | null (required) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/body); bodyUsed: boolean (required) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bodyUsed); arrayBuffer: () => Promise<ArrayBuffer> (required) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/arrayBuffer); blob: () => Promise<Blob> (required) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/blob); bytes: () => Promise<Uint8Array<ArrayBuffer>> (required) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bytes); formData: () => Promise<FormData> (required) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/formData); json: () => Promise<any> (required) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/json); text: () => Promise<string> (required) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/text)

packages/router/src/vite/internal/server-runtime/wintercg.ts:254
CorsOptionsinterface · public
@openelement/router · ./server-runtime

Options for {@linkcode createCorsMiddleware} — the surface the generated entry emits.

CorsOptions

origin?: string | string[] | ((origin: string) => string | undefined | null) (optional) — The `Access-Control-Allow-Origin` value: one origin, a list, or a resolver returning an origin or undefined.; allowMethods?: string[] (optional) — The `Access-Control-Allow-Methods` list.; allowHeaders?: string[] (optional) — The `Access-Control-Allow-Headers` list.; exposeHeaders?: string[] (optional) — The `Access-Control-Expose-Headers` list.; credentials?: boolean (optional) — Emits `Access-Control-Allow-Credentials: true`.; maxAge.toString: (radix?: number) => string (required) — Returns a string representation of an object.; maxAge.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; maxAge.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; maxAge.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; maxAge.valueOf: () => number (required) — Returns the primitive value of the specified object.; maxAge.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.

packages/router/src/vite/internal/server-runtime/middleware.ts:93
createActionBodyLimitfunction · public
@openelement/router · ./server-runtime

The default body-limit handler for action POST routes (#568), bound to the serialized `MAX_ACTION_BODY_BYTES` policy constant (see the module doc): an oversized body answers the fetch channel with problem+json 413 (same fork as the CSRF 403) and the native form channel with plain text. The no-store/Vary negotiation headers ride every 413 like every other action response. Larger uploads belong on API routes with explicit limits. Runs as the first element of the generated POST handler chain (`(request, route, next)` — the {@link HttpHandler } shape of

(maxSize: number): (request: Request, route: unknown, next: () => Promise<Response>) => Promise<Response>

toString: (radix?: number) => string (required) — Returns a string representation of an object.; toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; valueOf: () => number (required) — Returns the primitive value of the specified object.; toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.

packages/router/src/vite/internal/server-runtime/action-runtime.ts:290
createCorsMiddlewarefunction · public
@openelement/router · ./server-runtime

The CORS middleware: non-preflight requests get the allow-origin (and credentials/expose) headers on the channel and an appended `Vary: Origin` when the origin is not `*`; an `OPTIONS` preflight short-circuits with 204 and the full allow set. The origin resolver may return undefined to deny — the generated default reflects only localhost origins and denies everything else.

(options?: CorsOptions): WinterCgFetchMiddleware

origin?: string | string[] | ((origin: string) => string | undefined | null) (optional) — The `Access-Control-Allow-Origin` value: one origin, a list, or a resolver returning an origin or undefined.; allowMethods?: string[] (optional) — The `Access-Control-Allow-Methods` list.; allowHeaders?: string[] (optional) — The `Access-Control-Allow-Headers` list.; exposeHeaders?: string[] (optional) — The `Access-Control-Expose-Headers` list.; credentials?: boolean (optional) — Emits `Access-Control-Allow-Credentials: true`.; maxAge.toString: (radix?: number) => string (required) — Returns a string representation of an object.; maxAge.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; maxAge.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; maxAge.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; maxAge.valueOf: () => number (required) — Returns the primitive value of the specified object.; maxAge.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.

packages/router/src/vite/internal/server-runtime/middleware.ts:118
createCspNoncefunction · public
@openelement/router · ./server-runtime

Creates one per-request CSP nonce: a UUID without its dashes (32 hex characters). The CSP middleware embeds this value into the `script-src 'nonce-…'` policy it sets on the response and exposes it to the handlers as the `cspNonce` request-scope variable.

(): string
packages/router/src/vite/internal/server-runtime/response-channel.ts:135
createGeneratedAppfunction · public
@openelement/router · ./server-runtime

Assembles the generated app from the entry's route descriptor. Pure factory: descriptor data in, handler contract out — every emitted call site in the entry binds a property of the returned record.

(config: GeneratedAppConfig): GeneratedApp

islands: Record<string, string> (required) — Build-time island map: tag -> client module path (#951 upgrade URLs).; layoutPlan: LayoutPlan (required) — The build's layout plan (serialized generated data).; locales: readonly string[] (required) — Declared project locales (serialized generated data).; navSections: readonly unknown[] (required) — Nav sections (serialized generated data; empty on the 1.0 surface).; headerNav: readonly Record<string, unknown>[] (required) — Header nav links (serialized generated data; empty on the 1.0 surface).; defaultLocale: string (required) — The project's default locale (generated data).; devClientScriptSrc: string | null (required) — The dev island-client URL the entry computed from its compile-time `import.meta.env` constants; null when the app ships no client entry.; pageHandlerPaths: readonly string[] (required) — Page route paths, in route order — the handler table's keys.; fetchMiddleware?: readonly FetchMiddleware[] (optional) — `middleware.use` module defaults, user-configured order (use[0] outermost).; pageRuntime?: GeneratedPageRuntime (optional)

packages/router/src/vite/internal/server-runtime/app.ts:146
createLayoutRuntimefunction · public
@openelement/router · ./server-runtime

Binds the layout runtime to the entry's renderer, trust boundary, and serialized layout/nav/locale data. The entry destructures `{ resolveLayout: __resolveLayout, renderLayout: __renderLayout }`.

(deps: LayoutRuntimeDeps): LayoutRuntime

ssr: PageSsrRenderer (required) — The entry's bound page renderer (`__ssr`) — the layout renders through the same seam.; trustedHtml: (html: string) => TrustedHtmlValue (required) — The entry's `trustedHtml` import — the slot projection is an explicit trust boundary.; layoutPlan: LayoutPlan (required) — The build's layout plan (serialized generated data).; locales: readonly string[] (required) — Declared project locales (serialized generated data).; navSections: readonly unknown[] (required) — Nav sections (serialized generated data; empty on the 1.0 surface).; headerNav: readonly Record<string, unknown>[] (required) — Header nav links (serialized generated data; empty on the 1.0 surface).; defaultLocale: string (required) — The project's default locale (generated data).

packages/router/src/vite/internal/server-runtime/document-runtime.ts:113
createLitPageRendererfunction · public
@openelement/router · ./server-runtime

The lit renderer (#1339): render a registered LitElement page host to DSD HTML through

(deps: LitPageRendererDeps): PageSsrRenderer

renderLitPageToHtml: (input: { tag: string; props?: Record<string, unknown>; }) => { html: string; } (required) — `renderLitPageToHtml` — the registered LitElement page host renders to DSD HTML.

packages/router/src/vite/internal/server-runtime/renderer-runtime.ts:152
createLoggerMiddlewarefunction · public
@openelement/router · ./server-runtime

Logs `<-- METHOD /path` before the chain and `--> METHOD /path 200 12ms` after it, with the elapsed time humanized the way the previous built-in logged it. No color support: the color policy read `process.env`, which shipped runtime code must not (P3).

(options?: LoggerOptions): WinterCgFetchMiddleware

print?: ((line: string) => void) (optional) — The print function. Default `console.log`.

packages/router/src/vite/internal/server-runtime/middleware.ts:70
createMethodNotAllowedResponderfunction · public
@openelement/router · ./server-runtime

The 405 responder handed to `createRouteMiddleware` as `methodNotAllowed`: no-store (request-time responses are never cacheable), the action negotiation `Vary`, and the `Allow` header listing the route's methods (#572). Reads the per-request scope bound by the WinterCG composition layer so the WinterCG-side middleware can answer through the scope's text channel with the channel headers merged in.

(): (request: Request, allow: string[]) => Response
packages/router/src/vite/internal/server-runtime/route-dispatch.ts:106
createNativePageRendererfunction · public
@openelement/router · ./server-runtime

The native renderer (default): render a registered compiled element class through Element composition. Fails closed for invalid tags, depth-bound violations, and unregistered hosts — an unknown OpenElement host cannot be server-rendered (client-only and foreign tags pass through per the admission plan).

(deps: NativePageRendererDeps): PageSsrRenderer

renderToString: (tag: string, options: { componentClass?: unknown; props?: Record<string, unknown>; sourceInfo?: PageSsrSourceInfo; ssrRenderableTags?: readonly string[]; proj… (required) — Element's sync compiled serializer (`renderToString`, returning HTML directly).; customElements: { get(tag: string): unknown; } (required) — The SSR registry (the runtime's `customElements` global).; ssrRenderableTags: readonly string[] (required) — Build-admitted nested compiled tags (serialized generated data).

packages/router/src/vite/internal/server-runtime/renderer-runtime.ts:96
createPageHandlerTablefunction · public
@openelement/router · ./server-runtime

Creates the per-path page handler table the generated GET/POST wiring populates: one mutable method record per page path, keyed by the route path literal the wiring emits.

(paths: readonly string[]): Record<string, Record<string, unknown>>
packages/router/src/vite/internal/server-runtime/route-dispatch.ts:92
createPagePropsRuntimefunction · public
@openelement/router · ./server-runtime

Binds the page props projection to the generated entry's serialized dangerous-key list. Returns the three projection seams under their generated binding names (`__pageProps`, `__pageErrorProps` — the entry destructures them).

(deps: PagePropsRuntimeDeps): PagePropsRuntime

dangerousKeys: ReadonlySet<string> (required) — The canonical dangerous-key set (the factory imports it from the kernel-free /authoring leaf): one rule, no second copy.

packages/router/src/vite/internal/server-runtime/page-render.ts:169
createRequestIdMiddlewarefunction · public
@openelement/router · ./server-runtime

Reads the inbound request id (honoring it only when it is present, ≤ `limitLength`, and free of characters outside `[A-Za-z0-9_-=]`), regenerates otherwise, exposes it as the `requestId` scope variable and the response header — the request-id header rides every response the scope builds.

(options?: RequestIdOptions): WinterCgFetchMiddleware

limitLength.toString: (radix?: number) => string (required) — Returns a string representation of an object.; limitLength.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; limitLength.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; limitLength.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; limitLength.valueOf: () => number (required) — Returns the primitive value of the specified object.; limitLength.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.; headerName?: string (optional) — The response header carrying the id. Default `X-Request-Id`.; generator?: ((request: Request) => string) (optional) — The id generator. Default `crypto.randomUUID()`.

packages/router/src/vite/internal/server-runtime/middleware.ts:40
createRequestScopefunction · public
@openelement/router · ./server-runtime

Creates one per-request scope. Exported for the generated wiring's test harnesses; {@linkcode WinterCgApp.fetch} creates and binds one per dispatch.

(request: Request, env?: Record<string, unknown>, platform?: unknown): OpenElementRequestScope

cache: RequestCache (required) — The **`cache`** read-only property of the Request interface contains the cache mode of the request. It controls how the request will interact with the browser's HTTP cache. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/cache); credentials: RequestCredentials (required) — The **`credentials`** read-only property of the Request interface reflects the value given to the Request() constructor in the credentials option. It determines whether or not the browser sends credentials with the request, as well as whether any Set-Cookie response headers are respected. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/credentials); destination: RequestDestination (required) — The **`destination`** read-only property of the Request interface returns a string describing the type of content being requested. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/destination); headers: Headers (required) — The **`headers`** read-only property of the Request interface contains the Headers object associated with the request. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/headers); integrity: string (required) — The **`integrity`** read-only property of the Request interface contains the subresource integrity value of the request. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/integrity); keepalive: boolean (required) — The **`keepalive`** read-only property of the Request interface contains the request's keepalive setting (true or false), which indicates whether the browser will keep the associated request alive if the page that initiated it is unloaded before the request is complete. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/keepalive); method: string (required) — The **`method`** read-only property of the Request interface contains the request's method (GET, POST, etc.) [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/method); mode: RequestMode (required) — The **`mode`** read-only property of the Request interface contains the mode of the request (e.g., cors, no-cors, same-origin, or navigate.) This is used to determine if cross-origin requests lead to valid responses, and which properties of the response are readable. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/mode); redirect: RequestRedirect (required) — The **`redirect`** read-only property of the Request interface contains the mode for how redirects are handled. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/redirect); referrer: string (required) — The **`referrer`** read-only property of the Request interface is set by the user agent to be the referrer of the Request. (e.g., client, no-referrer, or a URL.) [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/referrer); referrerPolicy: ReferrerPolicy (required) — The **`referrerPolicy`** read-only property of the Request interface returns the referrer policy, which governs what referrer information, sent in the Referer header, should be included with the request. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/referrerPolicy); signal: AbortSignal (required) — The read-only **`signal`** property of the Request interface returns the AbortSignal associated with the request. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/signal); url: string (required) — The **`url`** read-only property of the Request interface contains the URL of the request. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/url); clone: () => Request (required) — The **`clone()`** method of the Request interface creates a copy of the current Request object. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/clone); body: ReadableStream<Uint8Array<ArrayBuffer>> | null (required) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/body); bodyUsed: boolean (required) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bodyUsed); arrayBuffer: () => Promise<ArrayBuffer> (required) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/arrayBuffer); blob: () => Promise<Blob> (required) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/blob); bytes: () => Promise<Uint8Array<ArrayBuffer>> (required) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bytes); formData: () => Promise<FormData> (required) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/formData); json: () => Promise<any> (required) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/json); text: () => Promise<string> (required) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/text)

packages/router/src/vite/internal/server-runtime/wintercg.ts:106
createSecureHeadersMiddlewarefunction · public
@openelement/router · ./server-runtime

The security response headers, applied after the response exists so a handler cannot skip them, plus `X-Powered-By` removal. Same names and values (and the same disabled `Cross-Origin-Embedder-Policy` default) as the built-in set they replace.

(): WinterCgFetchMiddleware
packages/router/src/vite/internal/server-runtime/middleware.ts:178
createStatusHtmlfunction · public
@openelement/router · ./server-runtime

Binds the status-page renderer to the entry's `escapeHtml` import. Both the native and the lit entry import the same canonical escaper (@openelement/element[/html]), so the one implementation serves every status channel (404 fallbacks, render failures, SSG redirect pages).

(escapeHtml: (value: string) => string): StatusHtmlRenderer
packages/router/src/vite/internal/server-runtime/document-runtime.ts:48
createStreamBodyfunction · public
@openelement/router · ./server-runtime

Binds the streaming body builder to the entry's injected Element function (and the policy timeout default): the returned builder is the `__streamBody` call site the generated handler invokes once per streamed response.

(config: StreamBodyConfig): StreamBodyFn

escapeAttr: (value: string) => string (required) — The entry's `escapeAttr` import — an Element function, injected so this module stays free of an Element runtime edge.; timeoutMs.toString: (radix?: number) => string (required) — Returns a string representation of an object.; timeoutMs.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; timeoutMs.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; timeoutMs.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; timeoutMs.valueOf: () => number (required) — Returns the primitive value of the specified object.; timeoutMs.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.

packages/router/src/vite/internal/server-runtime/stream-runtime.ts:275
createStreamHeaderChannelfunction · public
@openelement/router · ./server-runtime

Creates the per-request response-header channel for a streamed route: the author-facing `Headers` proxy plus its commitment switch. The proxy guards the mutating members (`append`, `set`, `delete`) after {@linkcode ResponseHeaderChannel.commit}: a late write from a held `context.responseHeaders` reference is a no-op with a structured diagnostic naming the route, header, and operation (the no-op rule; it never throws and never reinterprets a late `Location`/`Set-Cookie` as a protocol decision). Every other member — reads, `forEach` included — behaves exactly like the wrapped `Headers`, and `forEach` hands the callback the proxy itself so a callback-held reference is gated the same way. `route` only feeds the diagnostic payload.

(route: string): ResponseHeaderChannel
packages/router/src/vite/internal/server-runtime/response-channel.ts:60
createStreamPageShellfunction · public
@openelement/router · ./server-runtime

The per-route shell gate the streamed handlers await before any streamed document exists: the route must resolve its build manifest, the page class must carry the compiled Part Program, and both must agree on tag and program version — the gate fails closed with the route before the executor re-verifies the wire hash (#1276 B1.3-F1). Bound to the entry's serialized manifests and its `createStreamShellExecutor` import; the returned gate is the `__createStreamPageShell` call site (Amendment 1 — the last runtime function body that stayed emitted for its oracle pin).

(config: StreamPageShellConfig): (route: string, routeModule: unknown, props: unknown, instanceId: string, documentToken: string, documentStyles?: DocumentStyleSink) => Promise<StreamExecutorView>

streamManifests: Record<string, StreamRouteManifest> (required) — The entry's serialized route→stream-manifest build data (`__streamManifests`).; createStreamShellExecutor: (options: { componentClass: unknown; props?: unknown; manifest: StreamRouteManifest; instanceId: string; documentToken?: string; documentStyles?: DocumentStyle… (required) — The entry's `createStreamShellExecutor` import — the stream shell it produces is the pump's executor view.

packages/router/src/vite/internal/server-runtime/stream-runtime.ts:493
createStreamRequestScopefunction · public
@openelement/router · ./server-runtime

The request scope for one streamed route: the loader's `request.signal` aborts when the client disconnects (upstream abort fan-out), the response body's `cancel()` tears the whole scope down, and {@linkcode * StreamRequestScope.abortWork} aborts pending loader work at the timeout without cancelling the still-open response.

(original: Request): StreamRequestScope

cache: RequestCache (required) — The **`cache`** read-only property of the Request interface contains the cache mode of the request. It controls how the request will interact with the browser's HTTP cache. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/cache); credentials: RequestCredentials (required) — The **`credentials`** read-only property of the Request interface reflects the value given to the Request() constructor in the credentials option. It determines whether or not the browser sends credentials with the request, as well as whether any Set-Cookie response headers are respected. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/credentials); destination: RequestDestination (required) — The **`destination`** read-only property of the Request interface returns a string describing the type of content being requested. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/destination); headers: Headers (required) — The **`headers`** read-only property of the Request interface contains the Headers object associated with the request. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/headers); integrity: string (required) — The **`integrity`** read-only property of the Request interface contains the subresource integrity value of the request. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/integrity); keepalive: boolean (required) — The **`keepalive`** read-only property of the Request interface contains the request's keepalive setting (true or false), which indicates whether the browser will keep the associated request alive if the page that initiated it is unloaded before the request is complete. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/keepalive); method: string (required) — The **`method`** read-only property of the Request interface contains the request's method (GET, POST, etc.) [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/method); mode: RequestMode (required) — The **`mode`** read-only property of the Request interface contains the mode of the request (e.g., cors, no-cors, same-origin, or navigate.) This is used to determine if cross-origin requests lead to valid responses, and which properties of the response are readable. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/mode); redirect: RequestRedirect (required) — The **`redirect`** read-only property of the Request interface contains the mode for how redirects are handled. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/redirect); referrer: string (required) — The **`referrer`** read-only property of the Request interface is set by the user agent to be the referrer of the Request. (e.g., client, no-referrer, or a URL.) [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/referrer); referrerPolicy: ReferrerPolicy (required) — The **`referrerPolicy`** read-only property of the Request interface returns the referrer policy, which governs what referrer information, sent in the Referer header, should be included with the request. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/referrerPolicy); signal: AbortSignal (required) — The read-only **`signal`** property of the Request interface returns the AbortSignal associated with the request. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/signal); url: string (required) — The **`url`** read-only property of the Request interface contains the URL of the request. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/url); clone: () => Request (required) — The **`clone()`** method of the Request interface creates a copy of the current Request object. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/clone); body: ReadableStream<Uint8Array<ArrayBuffer>> | null (required) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/body); bodyUsed: boolean (required) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bodyUsed); arrayBuffer: () => Promise<ArrayBuffer> (required) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/arrayBuffer); blob: () => Promise<Blob> (required) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/blob); bytes: () => Promise<Uint8Array<ArrayBuffer>> (required) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bytes); formData: () => Promise<FormData> (required) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/formData); json: () => Promise<any> (required) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/json); text: () => Promise<string> (required) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/text)

packages/router/src/vite/internal/server-runtime/stream-runtime.ts:125
createWinterCgAppfunction · public
@openelement/router · ./server-runtime

Creates the internal WinterCG app one generated entry assembles. The dispatch builds lazily on the first fetch (registration happens at module scope) and rebuilds if anything registers afterwards.

(): WinterCgApp
packages/router/src/vite/internal/server-runtime/wintercg.ts:270
DANGEROUS_KEYSconst · public
@openelement/router · ./server-runtime

Object prototype keys that must never be injected from untrusted props.

ReadonlySet<string>
packages/element/src/internal/core/security.ts:25
GeneratedAppinterface · public
@openelement/router · ./server-runtime

Everything the generated entry destructures and re-exports.

GeneratedApp

app: WinterCgApp (required) — The internal WinterCG app — the entry's default export.; requestScope: (request: Request) => OpenElementRequestScope (required) — The per-request scope accessor the generated handlers bind (`__requestScope`): one scope per dispatch, keyed by request identity.; handler: (request: Request, context?: { env?: unknown; platform?: unknown; }) => Promise<Response> (required) — The WinterCG request handler: the app's composed dispatch with the fetch-middleware onion composed around it when `middleware.use` is configured (#858).; devFetch?: { fetch: (request: Request, env: unknown, executionContext: unknown) => Promise<Response>; } (optional) — Dev-server boundary export, present only with `middleware.use` (#858).; runtimeAdapter: Record<string, unknown> (required) — Deployment adapter record (`openElementRuntimeAdapter`).; pageHandlers: Record<string, Record<string, unknown>> (required) — Per-path page handler table the generated GET/POST wiring populates.; apiRouteRecords: { id: string; path: string; handlers: unknown; }[] (required) — API route records the generated API wiring pushes into.; methodNotAllowed: (request: Request, allow: string[]) => Response (required) — The 405 responder for `createRouteMiddleware({ methodNotAllowed })` (#572).; actionBodyLimit: (request: Request, route: unknown, next: () => Promise<Response>) => Promise<Response> (required) — The default action body-limit middleware (#568), bound to the policy constant.; registerSsrComponent: (tag: string, ctor: unknown) => void (required) — SSR registration seam (security.ts).; setRequestTimeClientScript: (src: string | null | undefined) => void (required) — Request-time client-script src setter (`dist/server/index.js` startup).; clientScriptDescriptors: () => Array<{ type: "module"; src: string; }> (required) — wrapInDocument `scripts` descriptors for the current runtime mode (#951).; locales: readonly string[] (required); getDefaultLocale: () => string (required); ssr?: PageSsrRenderer (optional) — Page-render bindings — present only when the config carried `pageRuntime`.; pageProps?: ((routeModule: unknown, context: PageContext) => ProjectedProps) (optional); pageErrorProps?: ((routeModule: unknown, error: unknown, context: PageContext) => ProjectedProps) (optional); statusHtml?: StatusHtmlRenderer (optional); resolveLayout?: ((routeMeta?: Record<string, unknown>) => ResolvedLayout) (optional); renderLayout?: ((pageHtml: unknown, routePath: string, options?: { locale?: string; routeMeta?: Record<string, unknown>; documentStyles?: DocumentStyleSink; }) => string) | u… (optional)

packages/router/src/vite/internal/server-runtime/app.ts:96
GeneratedAppConfiginterface · public
@openelement/router · ./server-runtime

The route-descriptor data the generated entry hands the factory.

GeneratedAppConfig

islands: Record<string, string> (required) — Build-time island map: tag -> client module path (#951 upgrade URLs).; layoutPlan: LayoutPlan (required) — The build's layout plan (serialized generated data).; locales: readonly string[] (required) — Declared project locales (serialized generated data).; navSections: readonly unknown[] (required) — Nav sections (serialized generated data; empty on the 1.0 surface).; headerNav: readonly Record<string, unknown>[] (required) — Header nav links (serialized generated data; empty on the 1.0 surface).; defaultLocale: string (required) — The project's default locale (generated data).; devClientScriptSrc: string | null (required) — The dev island-client URL the entry computed from its compile-time `import.meta.env` constants; null when the app ships no client entry.; pageHandlerPaths: readonly string[] (required) — Page route paths, in route order — the handler table's keys.; fetchMiddleware?: readonly FetchMiddleware[] (optional) — `middleware.use` module defaults, user-configured order (use[0] outermost).; pageRuntime?: GeneratedPageRuntime (optional)

packages/router/src/vite/internal/server-runtime/app.ts:70
GeneratedPageRuntimeinterface · public
@openelement/router · ./server-runtime

The page-render seam the entry's Element imports feed (renderer-adapter selected). Present only when the entry has page routes: an API-only entry imports no Element renderer and binds none of it.

GeneratedPageRuntime

mode: "native" | "lit" (required); ssrRenderableTags: readonly string[] (required) — Build-admitted SSR-renderable tags (serialized generated data).; trustedHtml: (html: string) => TrustedHtmlValue (required); escapeHtml: (value: string) => string (required); renderToString?: ((tag: string, options: { componentClass?: unknown; props?: Record<string, unknown>; sourceInfo?: PageSsrSourceInfo; ssrRenderableTags?: readonly string[]; pro… (optional) — native only: the compiled serializer and the SSR registry.; customElements?: { get(tag: string): unknown; } (optional); renderLitPageToHtml?: ((input: { tag: string; props?: Record<string, unknown>; }) => { html: string; }) (optional) — lit only: the lit-ssr page renderer.

packages/router/src/vite/internal/server-runtime/app.ts:56
installSsrRegistryGuardfunction · public
@openelement/router · ./server-runtime

Installs the SSR registry guard and returns its registration seam. Behavior contract (moved verbatim from the generated entry): - The TRUE original `define` is captured ONCE on the registry itself (SSR_REGISTRY_ORIGINAL_DEFINE): the registry outlives vite dev SSR module re-evaluations, so a second installation must never capture the already-wrapped `define` as its "original" (#1339). - On the dev SSR stub registry (SSR_REGISTRY_STUB_MARKER) re-definition WINS — the registry outlives module re-evaluation, so route edits only reach SSR output when define() overwrites the stale class (#952). - `NotSupportedError` from a non-stub registry is swallowed (the shim's duplicate-define rejection is its designed live-reload notice); any other error propagates. - A tag the entry registered itself (ownership map) is re-registered through the TRUE original define — a dev re-evaluation registers a FRESH class for the SAME tag and the new class must win. A registration the entry did NOT make is a genuine conflict and keeps the fail-closed no-op.

(): SsrRegistryGuard
packages/router/src/vite/internal/server-runtime/security.ts:70
isSsgPrerenderDispatchfunction · public
@openelement/router · ./server-runtime

True when the dispatch is an SSG prerender pass. Static build output cannot carry per-request state — the SSG nonce contract (nonce.ts: SSG output carries none, static bytes cannot be per-request) — so the CSP auto-nonce binds nothing on this pass: the handlers' `c.get('cspNonce')` stays undefined and `wrapInDocument` serializes the client script tags nonce-free while the SSG CSP injector writes the policy-only meta.

(env: unknown): boolean
packages/router/src/vite/internal/server-runtime/response-channel.ts:166
LayoutRuntimeinterface · public
@openelement/router · ./server-runtime

The layout runtime bound into the generated entry.

LayoutRuntime

resolveLayout: (routeMeta?: Record<string, unknown>) => ResolvedLayout (required) — Resolve the layout for one route's metadata: `layout: false` disables the layout, a named layout looks up `layoutPlan.layouts`, anything else (and an unset layout) takes the plan default.; renderLayout: (pageHtml: unknown, routePath: string, options?: { locale?: string; routeMeta?: Record<string, unknown>; documentStyles?: DocumentStyleSink; }) => string (required) — Render route content inside the resolved layout: the page HTML is projected into the layout's default slot through the page renderer, so nested admitted islands expand deterministically and route content stays inside the declared layout-main boundary. An unresolved layout returns the content unchanged.

packages/router/src/vite/internal/server-runtime/document-runtime.ts:58
LayoutRuntimeDepsinterface · public
@openelement/router · ./server-runtime

What {@linkcode createLayoutRuntime} binds: the entry's Element imports plus its serialized plan data.

LayoutRuntimeDeps

ssr: PageSsrRenderer (required) — The entry's bound page renderer (`__ssr`) — the layout renders through the same seam.; trustedHtml: (html: string) => TrustedHtmlValue (required) — The entry's `trustedHtml` import — the slot projection is an explicit trust boundary.; layoutPlan: LayoutPlan (required) — The build's layout plan (serialized generated data).; locales: readonly string[] (required) — Declared project locales (serialized generated data).; navSections: readonly unknown[] (required) — Nav sections (serialized generated data; empty on the 1.0 surface).; headerNav: readonly Record<string, unknown>[] (required) — Header nav links (serialized generated data; empty on the 1.0 surface).; defaultLocale: string (required) — The project's default locale (generated data).

packages/router/src/vite/internal/server-runtime/document-runtime.ts:91
LitPageRendererDepsinterface · public
@openelement/router · ./server-runtime

The subset of

LitPageRendererDeps

renderLitPageToHtml: (input: { tag: string; props?: Record<string, unknown>; }) => { html: string; } (required) — `renderLitPageToHtml` — the registered LitElement page host renders to DSD HTML.

packages/router/src/vite/internal/server-runtime/renderer-runtime.ts:139
localeFromPathfunction · public
@openelement/router · ./server-runtime

Path-derived locale resolution: the first non-empty path segment when it is a declared locale, the fallback otherwise. `locales` is the generated entry's `__locales` project declaration, so request-time resolution and the pages the build emits agree (see expandI18nLocales).

(locales: readonly string[], path: unknown, fallback: string): string
packages/router/src/vite/internal/server-runtime/page-render.ts:74
localizeLayoutHreffunction · public
@openelement/router · ./server-runtime

Layout href localization: root-relative hrefs gain the active locale prefix unless they already carry it; locale-neutral, external, and protocol-relative hrefs pass through untouched. Nav data is not part of the 1.0 surface, so the generated `__headerNav` is empty today — the contract keeps its guard.

(href: string, locale: string, defaultLocale: string): string
packages/router/src/vite/internal/server-runtime/document-runtime.ts:26
LoggerOptionsinterface · public
@openelement/router · ./server-runtime

Options for {@linkcode createLoggerMiddleware}.

LoggerOptions

print?: ((line: string) => void) (optional) — The print function. Default `console.log`.

packages/router/src/vite/internal/server-runtime/middleware.ts:59
matchesMiddlewareScopefunction · public
@openelement/router · ./server-runtime

Hono-compatible middleware-scope matching: `'/p/*'` matches `/p` itself and everything beneath it; `'/*'` matches everything; a bare `'/p'` matches only `/p` exactly.

(pattern: string, pathname: string): boolean
packages/router/src/vite/internal/server-runtime/wintercg.ts:236
mergeChannelHeadersfunction · public
@openelement/router · ./server-runtime

Merges the loader/action response-header channel into a response. Channel entries are appended after the framework-set headers, so multi-value `Set-Cookie` accumulates; a protocol header ({@linkcode PROTOCOL_HEADERS}) the response already carries is skipped — the channel cannot override the protocol. An empty channel returns the original `Response` object untouched, so responses that never touch the channel keep their identity (and their streaming body is not rebuilt).

(response: Response, channel: Headers): Response

headers: Headers (required) — The **`headers`** read-only property of the Response interface contains the Headers object associated with the response. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/headers); ok: boolean (required) — The **`ok`** read-only property of the Response interface contains a Boolean stating whether the response was successful (status in the range 200-299) or not. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/ok); redirected: boolean (required) — The **`redirected`** read-only property of the Response interface indicates whether or not the response is the result of a request you made which was redirected. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirected); status.toString: (radix?: number) => string (required) — Returns a string representation of an object.; status.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; status.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; status.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; status.valueOf: () => number (required) — Returns the primitive value of the specified object.; status.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.; statusText: string (required) — The **`statusText`** read-only property of the Response interface contains the status message corresponding to the HTTP status code in Response.status. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/statusText); type: ResponseType (required) — The **`type`** read-only property of the Response interface contains the type of the response. The type determines whether scripts are able to access the response body and headers. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/type); url: string (required) — The **`url`** read-only property of the Response interface contains the URL of the response. The value of the url property will be the final URL obtained after any redirects. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/url); clone: () => Response (required) — The **`clone()`** method of the Response interface creates a clone of a response object, identical in every way, but stored in a different variable. [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/clone); body: ReadableStream<Uint8Array<ArrayBuffer>> | null (required) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/body); bodyUsed: boolean (required) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bodyUsed); arrayBuffer: () => Promise<ArrayBuffer> (required) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/arrayBuffer); blob: () => Promise<Blob> (required) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/blob); bytes: () => Promise<Uint8Array<ArrayBuffer>> (required) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bytes); formData: () => Promise<FormData> (required) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/formData); json: () => Promise<any> (required) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/json); text: () => Promise<string> (required) — [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/text)

packages/router/src/vite/internal/server-runtime/response-channel.ts:111
NativePageRendererDepsinterface · public
@openelement/router · ./server-runtime

The subset of the Element serializer the native renderer needs.

NativePageRendererDeps

renderToString: (tag: string, options: { componentClass?: unknown; props?: Record<string, unknown>; sourceInfo?: PageSsrSourceInfo; ssrRenderableTags?: readonly string[]; proj… (required) — Element's sync compiled serializer (`renderToString`, returning HTML directly).; customElements: { get(tag: string): unknown; } (required) — The SSR registry (the runtime's `customElements` global).; ssrRenderableTags: readonly string[] (required) — Build-admitted nested compiled tags (serialized generated data).

packages/router/src/vite/internal/server-runtime/renderer-runtime.ts:70
OpenElementRequestScopeinterface · public
@openelement/router · ./server-runtime

The per-request scope: one instance per dispatch, bound to its request by the identity registry. Response headers written before the response exists (`header()`) flow into every response the scope constructs — the merge point the Hono context's prepared headers used to own.

OpenElementRequestScope

req: RequestScopeRequest (required); headers: Headers (required) — The response-header channel. Headers the handler or the built-in middleware write before a response exists (`Cache-Control`, `Vary`, `X-Request-Id`, the security set) land here and merge into every response the scope builds. Stream routes hand the handler a separate committed stream channel; the scope keeps supplying the framework set.; env: Record<string, unknown> (required) — The runtime env binding (`fetch(request, env)`).; executionCtx: unknown (required) — The host execution context; throws when the host passed none (call sites guard).; header: (name: string, value: string, options?: { append?: boolean; }) => void (required) — Writes one response header on the channel (set by default, append opt-in).; get: (key: string) => unknown (required) — Reads one typed variable (e.g. `cspNonce`).; set: (key: string, value: unknown) => void (required) — Writes one typed variable.; json: (object: unknown, status?: number, headers?: Record<string, string>) => Response (required) — `application/json` response starting from the channel headers.; text: (text: string, status?: number, headers?: Record<string, string>) => Response (required) — `text/plain; charset=UTF-8` response starting from the channel headers.; html: (html: string, status?: number, headers?: Record<string, string>) => Response (required) — `text/html; charset=UTF-8` response starting from the channel headers.; redirect: (location: string, status?: number) => Response (required) — Redirect response (`Location` + status, default 302).; body: (data: BodyInit | null, status?: number, headers?: Record<string, string>) => Response (required) — Raw-body response starting from the channel headers.

packages/router/src/vite/internal/server-runtime/wintercg.ts:66
PageContextinterface · public
@openelement/router · ./server-runtime

The request-scoped page context the generated handlers build for one render (#1326).

PageContext
packages/router/src/vite/internal/server-runtime/page-render.ts:86
pageDefinitionfunction · public
@openelement/router · ./server-runtime

Canonical page-definition extractor: a route module's default export carries the authoring descriptor on `openElementPage`; anything else projects to the empty descriptor. Kept a hoisted-friendly plain function — the generated entry calls it at module evaluation (route registration, routeInfo) and inside every request handler.

(routeModule: unknown): PageDefinition
packages/router/src/vite/internal/server-runtime/page-render.ts:44
PageDefinitiontype · public
@openelement/router · ./server-runtime

The page descriptor a definePage/defineLitPage route module carries on its default export.

PageDefinition
packages/router/src/vite/internal/server-runtime/page-render.ts:25
PagePropsRuntimeinterface · public
@openelement/router · ./server-runtime

The page props projection runtime: the default projection from route params/loader data plus the descriptor's `props`/`error` projector seams. Every seam filters the canonical dangerous-key set (#1214) so hostile params, loader data, or author projector output can never pollute the props record that flows into the compiled serializer.

PagePropsRuntime

defaultPageProps: (context: PageContext) => ProjectedProps (required) — The descriptor-less fallback: params + plain-object loader data.; pageProps: (routeModule: unknown, context: PageContext) => ProjectedProps (required) — The descriptor `props` projector, falling back to the default projection.; pageErrorProps: (routeModule: unknown, error: unknown, context: PageContext) => ProjectedProps (required) — The descriptor `error` projector for the error-boundary re-render.

packages/router/src/vite/internal/server-runtime/page-render.ts:102
PagePropsRuntimeDepsinterface · public
@openelement/router · ./server-runtime

The binding the generated-app factory hands {@linkcode createPagePropsRuntime}.

PagePropsRuntimeDeps

dangerousKeys: ReadonlySet<string> (required) — The canonical dangerous-key set (the factory imports it from the kernel-free /authoring leaf): one rule, no second copy.

packages/router/src/vite/internal/server-runtime/page-render.ts:112
PageSsrRenderertype · public
@openelement/router · ./server-runtime

The generated entry's `__ssr` binding: render one registered host tag to HTML. `depth` bounds nested island expansion; `projectedChildren` claims external content (the layout slot). Fails closed per the forks below.

PageSsrRenderer
packages/router/src/vite/internal/server-runtime/renderer-runtime.ts:61
PageSsrSourceInfointerface · public
@openelement/router · ./server-runtime

Source metadata the serializer attributes to a render (the `{ route }` seam).

PageSsrSourceInfo

route?: string (optional); source?: string (optional); documentStyles?: DocumentStyleSink (optional) — The render's document stylesheet collection. It rides this per-render object because every emitted `__ssr` call site already builds one, and the collection's lifetime IS the render's.

packages/router/src/vite/internal/server-runtime/renderer-runtime.ts:42
ProjectedChildrentype · public
@openelement/router · ./server-runtime

Trusted parent-owned light children keyed by slot name (the shell slot claim).

ProjectedChildren

forEach: (callbackfn: (value: TrustedHtmlValue, key: string, map: ReadonlyMap<string, TrustedHtmlValue>) => void, thisArg?: any) => void (required); get: (key: string) => TrustedHtmlValue (required); has: (key: string) => boolean (required); size.toString: (radix?: number) => string (required) — Returns a string representation of an object.; size.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; size.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; size.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; size.valueOf: () => number (required) — Returns the primitive value of the specified object.; size.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.; entries: () => MapIterator<[string, TrustedHtmlValue]> (required) — Returns an iterable of key, value pairs for every entry in the map.; keys: () => MapIterator<string> (required) — Returns an iterable of keys in the map; values: () => MapIterator<TrustedHtmlValue> (required) — Returns an iterable of values in the map; __@iterator@11144: () => MapIterator<[string, TrustedHtmlValue]> (required) — Returns an iterable of entries in the map.

packages/router/src/vite/internal/server-runtime/renderer-runtime.ts:54
ProjectedPropstype · public
@openelement/router · ./server-runtime

The projected props record handed to the compiled page host.

ProjectedProps
packages/router/src/vite/internal/server-runtime/page-render.ts:93
PROTOCOL_HEADERSconst · public
@openelement/router · ./server-runtime

Headers the loader/action channel may never override once the response already carries them: the framework protocol always wins on conflict. Compared case-insensitively against the channel entry's name; the channel may still introduce one of these when the response does not set it itself.

ReadonlySet<string>
packages/router/src/vite/internal/server-runtime/response-channel.ts:36
renderFunctionPagefunction · public
@openelement/router · ./server-runtime

The server function page render seam (alpha15 server lane). A function-page descriptor's `render` is the compiled server constructor function (the component lane lowered the authored TSX into `__h`/`__t` composed code) — props in, final HTML out. Two boundary checks live here because this is the ONE place loader-projected props meet the compiled render: - the render must be a function (`OE_PAGE_FUNCTION_RENDER`) — a descriptor whose render never went through the compiler has nothing to call; - the props must NOT carry the reserved `children` key (`OE_PAGE_FUNCTION_PROPS`). The compiled `props.children` channel is trusted final HTML produced by the COMPILER from a caller's own JSX children (the same trust level as an `__ssr` result); page props come from loader/params data, so a `children` key there is a smuggling attempt and is refused before the render function runs. The render function returns a string (the constructors always do); the type is widened to `unknown` so a hostile loader cannot make this seam trust a descriptor the compiler never produced.

(page: unknown, props: ProjectedProps): string
packages/router/src/vite/internal/server-runtime/page-render.ts:142
RequestIdOptionsinterface · public
@openelement/router · ./server-runtime

Options for {@linkcode createRequestIdMiddleware}.

RequestIdOptions

limitLength.toString: (radix?: number) => string (required) — Returns a string representation of an object.; limitLength.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; limitLength.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; limitLength.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; limitLength.valueOf: () => number (required) — Returns the primitive value of the specified object.; limitLength.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.; headerName?: string (optional) — The response header carrying the id. Default `X-Request-Id`.; generator?: ((request: Request) => string) (optional) — The id generator. Default `crypto.randomUUID()`.

packages/router/src/vite/internal/server-runtime/middleware.ts:24
RequestScopeRequestinterface · public
@openelement/router · ./server-runtime

The request view the generated wiring binds as `c.req`.

RequestScopeRequest

raw: Request (required) — The underlying WinterCG request (replaceable — the body limit swaps in a buffered twin).; url: string (required) — The full request URL string.; path: string (required) — The request pathname.; param: () => Record<string, string> (required) — The route-match path params (empty outside a match).; header: (name: string) => string (required) — One request header.

packages/router/src/vite/internal/server-runtime/wintercg.ts:46
resolveCompiledPageTagfunction · public
@openelement/router · ./server-runtime

Native page-tag resolution (#1276, B1.3-F1): the compiled Part Program is the one canonical source for the route→program tag binding. A definePage route module default-exports the compiled page class, whose `__partProgram.tag` carries the

(routeModule: unknown, fallbackTag: string): string
packages/router/src/vite/internal/server-runtime/renderer-runtime.ts:173
resolveLitPageTagfunction · public
@openelement/router · ./server-runtime

Lit page-tag resolution (#1339 lit fork): a defineLitPage route records its host tag on the class's `openElementPageTag` static (there is no compiled Part Program in the lit path); the path-derived tag stays the fallback.

(routeModule: unknown, fallbackTag: string): string
packages/router/src/vite/internal/server-runtime/renderer-runtime.ts:188
ResponseHeaderChannelinterface · public
@openelement/router · ./server-runtime

The per-request response-header channel: the mutable `Headers` instance the loader and the action receive as `context.responseHeaders`, plus the commitment switch the generated stream handler flips when the response is committed.

ResponseHeaderChannel

channel: Headers (required) — Author-facing view of the channel. Before commitment every `Headers` mutator passes through unchanged; after {@linkcode ResponseHeaderChannel.commit} the mutating methods are gated — a late `append`/`set`/`delete` becomes a warn-and-ignore diagnostic naming the route, header, and operation. It never throws and never mutates the committed response.; commit: () => void (required) — The header-commitment point: the generated handler calls this once, immediately before it exposes the response body. Later mutator calls are ignored with a diagnostic. Idempotent.

packages/router/src/vite/internal/server-runtime/types.ts:18
routeMetafunction · public
@openelement/router · ./server-runtime

Canonical route metadata derived from a route module: only the keys the entry consumers read (route, layout, title, description), each present exactly when the descriptor defines it — spread-conditional, so an absent key stays absent instead of becoming `undefined`.

(routeModule: unknown): Record<string, unknown>
packages/router/src/vite/internal/server-runtime/page-render.ts:55
RouteModuleinterface · public
@openelement/router · ./server-runtime

A route module namespace as the generated entry imports it (`import * as $route`).

RouteModule
packages/router/src/vite/internal/server-runtime/page-render.ts:28
runActionProtocolfunction · public
@openelement/router · ./server-runtime

Runs the action POST protocol for one request: resolve the action (named `?/name` map or bare `action` export), enforce the same-origin CSRF floor, parse the form body, classify the outcome, and answer per channel: - fetch callers (`ACTION_FETCH_HEADER: true`) always get JSON — the ActionResult union for outcomes, RFC 9457 problem+json for protocol errors (CSRF 403, unknown action 404, unparseable body 400); - native form callers get PRG 303 on success, the status page on protocol errors, and `{ actionResult }` back for a `fail()` so the handler re-renders the form at the author's status (422).

(context: OpenElementRequestScope, routeModule: unknown, loadContext: ActionLoadContext, renderStatusPage: (title: string, message: string, status: number) => Response, state: ActionProtocolState): Promise<ActionExecuti…

req: RequestScopeRequest (required); headers: Headers (required) — The response-header channel. Headers the handler or the built-in middleware write before a response exists (`Cache-Control`, `Vary`, `X-Request-Id`, the security set) land here and merge into every response the scope builds. Stream routes hand the handler a separate committed stream channel; the scope keeps supplying the framework set.; env: Record<string, unknown> (required) — The runtime env binding (`fetch(request, env)`).; executionCtx: unknown (required) — The host execution context; throws when the host passed none (call sites guard).; header: (name: string, value: string, options?: { append?: boolean; }) => void (required) — Writes one response header on the channel (set by default, append opt-in).; get: (key: string) => unknown (required) — Reads one typed variable (e.g. `cspNonce`).; set: (key: string, value: unknown) => void (required) — Writes one typed variable.; json: (object: unknown, status?: number, headers?: Record<string, string>) => Response (required) — `application/json` response starting from the channel headers.; text: (text: string, status?: number, headers?: Record<string, string>) => Response (required) — `text/plain; charset=UTF-8` response starting from the channel headers.; html: (html: string, status?: number, headers?: Record<string, string>) => Response (required) — `text/html; charset=UTF-8` response starting from the channel headers.; redirect: (location: string, status?: number) => Response (required) — Redirect response (`Location` + status, default 302).; body: (data: BodyInit | null, status?: number, headers?: Record<string, string>) => Response (required) — Raw-body response starting from the channel headers.

packages/router/src/vite/internal/server-runtime/action-runtime.ts:114
SSG_PRERENDER_ENV_KEYconst · public
@openelement/router · ./server-runtime

The env key the SSG prerender pass sets to `true` on every build-time dispatch (ssg-render.ts passes `{ [SSG_PRERENDER_ENV_KEY]: true }` as the request env). Since #1560 the prerender driver is our own static generator, so the key is owned here — this module is the single source; the build side imports the constant, and no second copy exists to drift.

"OPEN_ELEMENT_SSG_CONTEXT"
packages/router/src/vite/internal/server-runtime/response-channel.ts:156
SsrRegistryGuardinterface · public
@openelement/router · ./server-runtime

What the generated entry gets from {@linkcode installSsrRegistryGuard}.

SsrRegistryGuard

register: (tag: string, ctor: unknown) => void (required) — Registers one component class under `tag` with the same ownership/conflict rules the generated entry has always applied (#952, #1339).

packages/router/src/vite/internal/server-runtime/security.ts:36
StatusHtmlRenderertype · public
@openelement/router · ./server-runtime

The generated entry's `__statusHtml` binding: title/message rendered into a minimal status page.

StatusHtmlRenderer
packages/router/src/vite/internal/server-runtime/document-runtime.ts:40
STREAM_BROWSER_BOOTSTRAPconst · public
@openelement/router · ./server-runtime

The browser installer bootstrap — the inline head script of every streamed page: the MutationObserver that scans streaming templates, the typed seed admission against the same policy budgets the server enforced, the anchor range ownership check, the frame markup safety screen, and the pagehide retirement/BFCache contract. The module owns the string so the server pump and the browser installer read the same constants from one place; S4 will re-home it from the per-page inline form to a shared asset.

string
packages/router/src/vite/internal/server-runtime/stream-runtime.ts:558
StreamBodyConfiginterface · public
@openelement/router · ./server-runtime

Binding-time configuration of {@linkcode createStreamBody}.

StreamBodyConfig

escapeAttr: (value: string) => string (required) — The entry's `escapeAttr` import — an Element function, injected so this module stays free of an Element runtime edge.; timeoutMs.toString: (radix?: number) => string (required) — Returns a string representation of an object.; timeoutMs.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; timeoutMs.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; timeoutMs.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; timeoutMs.valueOf: () => number (required) — Returns the primitive value of the specified object.; timeoutMs.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.

packages/router/src/vite/internal/server-runtime/stream-runtime.ts:101
StreamBodyFntype · public
@openelement/router · ./server-runtime

The bound streaming body builder the generated handler calls.

StreamBodyFn
packages/router/src/vite/internal/server-runtime/stream-runtime.ts:116
StreamBodyOptionsinterface · public
@openelement/router · ./server-runtime

Per-request inputs of the streaming body builder.

StreamBodyOptions

scope: StreamRequestScope (required); route: string (required); manifest: StreamRouteManifest (required); executor: StreamExecutorView (required); records: readonly StreamFieldRecord[] (required); document: StreamDocumentParts (required); token: string (required)

packages/router/src/vite/internal/server-runtime/stream-runtime.ts:90
StreamDocumentPartsinterface · public
@openelement/router · ./server-runtime

The streamed document halves the element `documentStreamParts` produced.

StreamDocumentParts

prefix: string (required); suffix: string (required)

packages/router/src/vite/internal/server-runtime/stream-runtime.ts:84
StreamExecutorViewinterface · public
@openelement/router · ./server-runtime

The slice of the element stream executor the pump consumes.

StreamExecutorView

shell: string (required); owner: { readonly instanceId: string; } (required); seed: Record<string, { type: string; }> (required); resolvedValue: (field: string, value: unknown) => unknown (required); serializeResolved: (field: string, value: unknown) => string[] (required)

packages/router/src/vite/internal/server-runtime/stream-runtime.ts:75
StreamFieldRecordinterface · public
@openelement/router · ./server-runtime

One declared deferred field's settlement record (the pump's queue unit).

StreamFieldRecord

entry: { field: string; signal: string; owners: Array<{ kind: "part" | "region"; index: number; location: string; source: PartProgramV2["sourceMap"]["records"][number… (required); settled: boolean (required); failed: boolean (required); error: unknown (required); value: unknown (required); notify?: (() => void) (optional)

packages/router/src/vite/internal/server-runtime/stream-runtime.ts:53
streamFieldsfunction · public
@openelement/router · ./server-runtime

The deferred-field front gate: validates the loader data against the route's build manifest (one plain object, the `STREAM_MAX_FIELDS` / `STREAM_MAX_OWNERS` budget, every declared field present, no undeclared thenable), attaches both settlement observers per field, and hands back the records the pump queues. Every rejection first sweeps the loader's own thenables for observation (see {@linkcode observeThenables}).

(data: unknown, manifest: StreamRouteManifest): StreamFieldRecord[]
packages/router/src/vite/internal/server-runtime/stream-runtime.ts:198
StreamPageShellConfiginterface · public
@openelement/router · ./server-runtime

The entry bindings the stream-shell gate reads. `streamManifests` is the generated `__streamManifests` build data; the executor creator is the entry's `createStreamShellExecutor` Element import, injected so this module stays free of an Element runtime edge (#1339).

StreamPageShellConfig

streamManifests: Record<string, StreamRouteManifest> (required) — The entry's serialized route→stream-manifest build data (`__streamManifests`).; createStreamShellExecutor: (options: { componentClass: unknown; props?: unknown; manifest: StreamRouteManifest; instanceId: string; documentToken?: string; documentStyles?: DocumentStyle… (required) — The entry's `createStreamShellExecutor` import — the stream shell it produces is the pump's executor view.

packages/router/src/vite/internal/server-runtime/stream-runtime.ts:465
StreamRequestScopeinterface · public
@openelement/router · ./server-runtime

The request scope the generated handler builds around a streamed route.

StreamRequestScope

request: Request (required) — The request the loader sees, carrying the scope's abort signal.; upstreamSignal: AbortSignal (required) — The original WinterCG request's signal (the response-cancel source).; abortWork: () => void (required) — Aborts the loader's work without tearing down the scope bridge.; cancel: () => void (required) — Detaches the upstream bridge and aborts the scope (handler-level exit).

packages/router/src/vite/internal/server-runtime/stream-runtime.ts:63
TrustedHtmlValueinterface · public
@openelement/router · ./server-runtime

Opaque capability marking HTML the application has explicitly vetted as trusted.

TrustedHtmlValue

html: string (required)

packages/router/src/vite/internal/server-runtime/renderer-runtime.ts:25
WinterCgAppinterface · public
@openelement/router · ./server-runtime

The internal WinterCG app: the composition surface the generated entry wires.

WinterCgApp

use: (pattern: string, middleware: WinterCgFetchMiddleware) => void (required) — Registers middleware, optionally path-scoped (`'*'`, `'/p/*'`, or a bare `'/p'`).; route: (middleware: WinterCgFetchMiddleware) => void (required) — Registers the route-table layer: theWinterCG middleware that resolves method-keyed records (createRouteMiddleware). It composes after the fn-form mounts — the route layer, not an outer middleware — so a mount and a record at the same path resolve with route specificity, the way the replaced composition ordered them.; all: (path: string, handler: ApiRouteFunction) => void (required) — Mounts a fn-form API handler at a path — every method reaches it, params resolve from the match.; notFound: (handler: (request: Request, scope: OpenElementRequestScope) => Response | Promise<Response>) => void (required) — The 404 terminal: invoked when no middleware or mount produced a response.; fetch: (request: Request, env?: Record<string, unknown>, platform?: unknown) => Promise<Response> (required) — The dispatch: the composed chain over one request. Never rejects.; request: (input: string | URL | Request, init?: RequestInit, env?: Record<string, unknown>) => Promise<Response> (required) — `Request`-convenience dispatch (the SSG prerender and test harnesses).; requestScope: (request: Request) => OpenElementRequestScope (required) — The per-request scope accessor the generated handlers bind (`__requestScope`).; routes: readonly { method: "ALL"; path: string; }[] (required) — The fn-form mounts (the SSG prerender's page-discovery exclusion set).

packages/router/src/vite/internal/server-runtime/wintercg.ts:195
WinterCgFetchMiddlewaretype · public
@openelement/router · ./server-runtime

The dialect-free fetch middleware the whole composition speaks.

WinterCgFetchMiddleware
packages/router/src/vite/internal/server-runtime/wintercg.ts:40
ArtifactInfointerface · public
@openelement/router · ./vite

File size info for a single artifact

ArtifactInfo

name: string (required); path: string (required); sizeBytes.toString: (radix?: number) => string (required) — Returns a string representation of an object.; sizeBytes.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; sizeBytes.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; sizeBytes.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; sizeBytes.valueOf: () => number (required) — Returns the primitive value of the specified object.; sizeBytes.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.; sizeKB: string (required); gzipBytes?: number (optional) — gzip -9 bytes; only computed for JS chunks, not HTML pages.; gzipKB?: string (optional)

packages/router/src/vite/build-manifest.ts:29
buildAppfunction · public
@openelement/router · ./vite

Build an OpenElement application through the supported adapter boundary. Consumers configure the adapter in `vite.config.ts`; this function owns the invocation so CLI callers do not need to know the adapter's internal build phases or Vite plugin ordering. KR-15: this is a PRODUCTION build. Vite derives `import.meta.env.PROD` from ambient `process.env.NODE_ENV`, not from `mode`, so a build launched from a test runner (`NODE_ENV=test`) or a dev shell silently emitted a development-semantics SSR bundle — `PROD=false`, so the production error channel stopped scrubbing and SSG 500 details fell back to stack traces (known-reds KR-15, Release P0 Gate). Pin production for the duration of the Vite call and restore the ambient value afterwards, so programmatic callers (and their tests) cannot leak a production NODE_ENV into the rest of the process. `mode` is made explicit for the same reason: the generated `import.meta.env.MODE` should say production even when a caller's ambient environment disagrees.

(config?: InlineConfig): Promise<unknown>
packages/router/src/vite/index.ts:73
buildHeadExtrasfunction · public
@openelement/router · ./vite

Build the headExtras string from FrameworkOptions.inject. Serializes headFragments, stylesheets, and scripts into a single HTML string to inject into <head>. Validates all URLs and ensures no raw <script> tags bypass the structured injection APIs.

(options: FrameworkOptions): HeadExtrasResult
packages/router/src/vite/head-injection.ts:146
BuildManifestinterface · public
@openelement/router · ./vite

Full build manifest summary

BuildManifest

phase: 1 | 2 | 3 (required); timestamp: string (required); islands: ArtifactInfo[] (required); clientEntry: ArtifactInfo | null (required); sharedChunks: ArtifactInfo[] (required) — JS chunks that are neither an island chunk nor the client entry: the shared runtime chunks every island page eagerly imports, and dynamically fetched chunks like the search combobox.; htmlPages: ArtifactInfo[] (required); totalJsBytes.toString: (radix?: number) => string (required) — Returns a string representation of an object.; totalJsBytes.toFixed: (fractionDigits?: number) => string (required) — Returns a string representing a number in fixed-point notation.; totalJsBytes.toExponential: (fractionDigits?: number) => string (required) — Returns a string containing a number represented in exponential notation.; totalJsBytes.toPrecision: (precision?: number) => string (required) — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.; totalJsBytes.valueOf: () => number (required) — Returns the primitive value of the specified object.; totalJsBytes.toLocaleString: { (locales?: string | string[], options?: Intl.NumberFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string; } (required) — Converts a number to a string by using the current or specified locale.; totalJsGzipBytes: number (required) — Sum of per-file gzip sizes over every scanned JS chunk.; totalHtmlBytes: number (required); headExtrasSize: number (required); warnings: string[] (required) — Budget warnings (files > threshold)

packages/router/src/vite/build-manifest.ts:40
defaultfunction · public
@openelement/router · ./vite

Low-level Vite plugin pipeline: SSR dev server, SSG and islands without the content/i18n conveniences of `openElement()`.

(config?: OpenPipelineConfig): Plugin[]

routes.dir?: string (optional); output.outDir?: string (optional); island.dir?: string (optional); island.upgradeStrategy?: string (optional); viewTransition?: boolean (optional); headExtras?: string (optional)

packages/router/src/vite/index.ts:39
FrameworkOptionstype · public
@openelement/router · ./vite

Adapter options extend Element options with build-only delivery declarations. The element package remains unaware of Vite/SSG policy.

FrameworkOptions
packages/router/src/vite/framework.ts:37
HeadExtrasResultinterface · public
@openelement/router · ./vite

Result of building head extras from FrameworkOptions.

HeadExtrasResult

headExtras: string (required); allowHeadExtrasScripts: boolean (required)

packages/router/src/vite/head-injection.ts:134
mdxPluginfunction · public
@openelement/router · ./vite

Vite plugin compiling `.mdx` route files into compiled page modules.

(options?: OpenMdxPluginOptions): Plugin

routesDir?: string (optional) — Routes directory (as configured in openElement()). The compiled page tag derives from the route-file-relative path so the generated entry's path-derived registration tag matches the program tag.

packages/router/src/vite/plugin-mdx.ts:61
openElementfunction · public
@openelement/router · ./vite

Create the full OpenElement Vite plugin set: route pipeline, SSG and islands.

(options?: OpenElementOptions): Plugin[]

head.title?: string (optional) — Document title; defaults to the package.json `name`.; head.description?: string (optional) — `<meta name="description">` + `og:description`.; head.lang?: string (optional) — `<html lang>`; defaults to `en`.; head.favicon?: string (optional) — Site-root-relative favicon path, emitted as `<link rel="icon">`.; head.ogImage?: string (optional) — `og:image` URL. Absolute (crawlable) or site-root-relative.; head.stylesheets?: string[] (optional) — External stylesheets linked into `<head>`.; head.scripts?: OpenElementHeadScript[] (optional) — External scripts emitted into `<head>`; inline code is not accepted here.; ssg.dynamicRouteFailure?: "fail" | "warn" (optional) — Policy for dynamic-route render failures during SSG. See {@link SsgRenderOptions.dynamicRouteFailure}.; build.outDir?: string (optional) — Output directory for the build artifacts. Defaults to `dist`.; build.manifestBudget?: { islandKB?: number; totalJsKB?: number; pageKB?: number; } (optional) — Advisory only: exceeded budgets print build-manifest warnings and never fail the build; enforce them in your own build-output test.; renderer?: "native" | "lit" (optional) — Page renderer selection (Beta.2.2, #1339). EXPLICIT, never inferred: 'native' (default) renders pages through the compiled Part Program serializer (renderToString); 'lit' renders LitElement pages through; routesDir?: string (optional) — Directory the route scanner walks, relative to the Vite root. Defaults to `app/routes`.; islandsDir?: string (optional) — Directory island modules are discovered in. Defaults to `app/islands`.; packageIslands?: string[] | "auto" | "manual" (optional) — How the build admits component packages whose modules the application imports. - omitted or `'auto'` (the default): the scan derives the admitted set at scan time — every package-owned element module the app's routes, pages, layouts, islands and components really reach (bundler-resolved) is attributed to its owner package (nearest `package.json`), and a package with a valid OpenElement manifest i…; layout?: LayoutConfig (optional) — Layout declaration; `false` disables the layout, `'default'` uses the built-in one.; layouts?: LayoutsConfig (optional) — Named layout declarations keyed by layout name.; headExtras?: string (optional) — @dangerous injected as-is, only use with controlled content; inject.stylesheets?: (string | { href: string; integrity?: string; crossorigin?: "anonymous" | "use-credentials"; attrs?: Record<string, string | number | boolean>; })[] (optional) — Stylesheets linked into the document head; each entry is an href or a link record with integrity/crossorigin/attrs.; inject.scripts?: (string | { src: string; type?: string; async?: boolean; defer?: boolean; integrity?: string; crossorigin?: "anonymous" | "use-credentials"; attrs?: Record<str… (optional) — Scripts emitted into the document; each entry is a src or a script record with type/async/defer/integrity/crossorigin/attrs.; inject.headFragments?: string[] (optional) — @dangerous fragments injected as-is. Trust boundary (same level as `trustedHtml`): never concatenate user-controlled content into these fragments; sanitize untrusted data at your own system boundary first. The framework only enforces no-`<script>` and no-executable-`<style>`.; ssr.noExternal?: (string | RegExp)[] (optional); island.upgradeStrategy?: "load" | "idle" | "visible" | "only" | "none" (optional); viewTransition?: boolean (optional) — Enable the View Transitions API for client navigations. Defaults to true.; speculation?: boolean | { prerender?: string[]; prefetch?: string[]; exclude?: string[]; eagerness?: "immediate" | "moderate" | "conservative"; } (optional) — Speculation Rules emission: `true` uses framework defaults, or pass prerender/prefetch URL lists, exclusions and an eagerness.; middleware.cors?: boolean (optional) — Built-in CORS middleware. Default-ON; pass `false` to disable.; middleware.corsOrigin?: string | string[] (optional) — Static CORS allowlist data, serialized into the generated entry as JSON. Mutually exclusive with {@link FrameworkOptions.middleware.corsOriginModule }.; middleware.corsOriginModule?: string (optional) — Path to a module that default-exports `(origin: string) => string | undefined`. The generated entry imports the module — the callback is never serialized — so it may close over module scope and import dependencies. Resolved with the same idiom as `layout.import` (e.g. './app/cors-origin.ts'). Mutually exclusive with `corsOrigin`.; middleware.requestId?: boolean (optional) — Emit and honor a per-request id header. Default-ON; pass `false` to disable.; middleware.logger?: boolean (optional) — Log each request through the built-in logger. Default-ON; pass `false` to disable.; middleware.securityHeaders?: boolean (optional) — Attach the built-in security response headers. Default-ON; pass `false` to disable.; middleware.csp?: { policy?: string; nonce?: boolean; reportOnly?: boolean; } (optional) — Content-Security-Policy emission: the policy string, nonce generation, and report-only mode.; middleware.use?: string[] (optional) — Fetch middleware chain (#858), composed around the framework handler in onion order (`use[0]` outermost), outside all built-in middleware above. Each entry is a MODULE PATH (same resolution idiom as `layout.import`, e.g. './app/middleware/auth.ts') whose default export is a {@link Middleware}; the generated entry emits `import * as __mw_N from '<path>'` and composes `__mw_N.default` in configured…; criticalAssets.fonts?: CriticalFontAsset[] (optional); criticalAssets.styles?: (string | CriticalStyleAsset)[] (optional); criticalAssets.stylesheets?: (string | CriticalStyleAsset)[] (optional) — Alias for styles accepted by config producers.; criticalAssets.inlineScripts?: (string | CriticalInlineScriptAsset)[] (optional); criticalAssets.allowExternalRenderBlocking?: boolean (optional) — Allow intentional external render-blocking styles/scripts.; criticalAssets.allowRenderBlockingExternal?: boolean (optional) — Alias retained only within this build-side config shape.; criticalAssets.minifyInlineStyles?: boolean (optional) — Minify inline CSS. Defaults to true.; criticalAssets.origin?: string (optional) — Origin used to distinguish same-origin and cross-origin absolute URLs.; critical?: CriticalAssetsOptions (optional); i18n?: OpenElementI18nOptions (optional); tailwind?: boolean | TailwindOptions (optional) — Opt-in Tailwind entry (alpha9 C2, #1505; externalized alpha15 S lane). `true` or an options object declares the style sources that compile through the official `@tailwindcss/vite` pipeline into the linked document stylesheet; absent keeps the build byte-identical to a Tailwind-less pipeline.; unocss?: boolean | UnocssOptions (optional) — Opt-in UnoCSS entry (alpha15 stage 2B): the sibling of `tailwind`, same shape and same meaning. Declaring it selects UnoCSS as this application's style engine; declaring both keys is a conflict and fails closed — see `UnocssOptions` (`@openelement/router/vite`).

packages/router/src/vite/app-vite.ts:39
OpenElementBlogOptionsinterface · public
@openelement/router · ./vite

Blog options stored in the adapter build context.

OpenElementBlogOptions

contentDir?: string (optional); basePath?: string (optional)

packages/router/src/vite/framework.ts:59
OpenElementBuildContextclass · public
@openelement/router · ./vite

The build's shared mutable state: the resolved framework options, the phase-1/phase-3 metadata, the sub-plugin data slots, and the production plan and artifact records the release and deployment adapters read. One instance is threaded through every adapter plugin for a build.

class OpenElementBuildContext
packages/router/src/vite/build-context.ts:182
OpenElementBuildContextLikeinterface · public
@openelement/router · ./vite

Minimal build-context contract available to adapter sub-plugins.

OpenElementBuildContextLike

plugins: { [key: string]: unknown; blogOptions: OpenElementBlogOptions | null; navSections: OpenElementNavSection[]; headerNav: OpenElementHeaderNavLink[]; sitemapOptio… (required); registerPlugin: (name: string, instance: unknown) => void (required)

packages/router/src/vite/framework.ts:84
OpenElementI18nContextOptionsinterface · public
@openelement/router · ./vite

Locale options carried through the build context to the i18n integration.

OpenElementI18nContextOptions
packages/router/src/vite/framework.ts:77
OpenElementI18nOptionsinterface · public
@openelement/router · ./vite

Project locale declaration. The build expands every static and dynamic route under each additional locale prefix (`/zh/docs`), passes the resolved locale to page `head`/`props` hooks and localizes layout navigation. Absent means a single-locale site with no locale prefixing — the pre-i18n output, byte for byte.

OpenElementI18nOptions

locales: string[] (required) — Locale prefixes the build expands, e.g. `['en', 'zh']`.; defaultLocale?: string (optional) — Locale served without a prefix. Defaults to the first entry.

packages/router/src/vite/framework.ts:26
OpenElementNavSectioninterface · public
@openelement/router · ./vite

Navigation section produced by the adapter content pipeline.

OpenElementNavSection

section: string (required); items: { path: string; label: string; order?: number; }[] (required)

packages/router/src/vite/framework.ts:65
OpenElementOptionsinterface · public
@openelement/router · ./vite

Options for the openElement() unified Vite entry. The framework-options face here is deliberately narrower than the internal {@linkcode FrameworkOptions} transfer type: - the document-head channel is spelled `head` (never `html`), the same spelling `openelement.config.ts` uses — passing `html` fails closed and names the replacement; - the source roots keep their explicit spellings (`routesDir`, `islandsDir`), while a config file's `dirs` block is the spelling that also moves the file conventions.

OpenElementOptions

head.title?: string (optional) — Document title; defaults to the package.json `name`.; head.description?: string (optional) — `<meta name="description">` + `og:description`.; head.lang?: string (optional) — `<html lang>`; defaults to `en`.; head.favicon?: string (optional) — Site-root-relative favicon path, emitted as `<link rel="icon">`.; head.ogImage?: string (optional) — `og:image` URL. Absolute (crawlable) or site-root-relative.; head.stylesheets?: string[] (optional) — External stylesheets linked into `<head>`.; head.scripts?: OpenElementHeadScript[] (optional) — External scripts emitted into `<head>`; inline code is not accepted here.; ssg.dynamicRouteFailure?: "fail" | "warn" (optional) — Policy for dynamic-route render failures during SSG. See {@link SsgRenderOptions.dynamicRouteFailure}.; build.outDir?: string (optional) — Output directory for the build artifacts. Defaults to `dist`.; build.manifestBudget?: { islandKB?: number; totalJsKB?: number; pageKB?: number; } (optional) — Advisory only: exceeded budgets print build-manifest warnings and never fail the build; enforce them in your own build-output test.; renderer?: "native" | "lit" (optional) — Page renderer selection (Beta.2.2, #1339). EXPLICIT, never inferred: 'native' (default) renders pages through the compiled Part Program serializer (renderToString); 'lit' renders LitElement pages through; routesDir?: string (optional) — Directory the route scanner walks, relative to the Vite root. Defaults to `app/routes`.; islandsDir?: string (optional) — Directory island modules are discovered in. Defaults to `app/islands`.; packageIslands?: string[] | "auto" | "manual" (optional) — How the build admits component packages whose modules the application imports. - omitted or `'auto'` (the default): the scan derives the admitted set at scan time — every package-owned element module the app's routes, pages, layouts, islands and components really reach (bundler-resolved) is attributed to its owner package (nearest `package.json`), and a package with a valid OpenElement manifest i…; layout?: LayoutConfig (optional) — Layout declaration; `false` disables the layout, `'default'` uses the built-in one.; layouts?: LayoutsConfig (optional) — Named layout declarations keyed by layout name.; headExtras?: string (optional) — @dangerous injected as-is, only use with controlled content; inject.stylesheets?: (string | { href: string; integrity?: string; crossorigin?: "anonymous" | "use-credentials"; attrs?: Record<string, string | number | boolean>; })[] (optional) — Stylesheets linked into the document head; each entry is an href or a link record with integrity/crossorigin/attrs.; inject.scripts?: (string | { src: string; type?: string; async?: boolean; defer?: boolean; integrity?: string; crossorigin?: "anonymous" | "use-credentials"; attrs?: Record<str… (optional) — Scripts emitted into the document; each entry is a src or a script record with type/async/defer/integrity/crossorigin/attrs.; inject.headFragments?: string[] (optional) — @dangerous fragments injected as-is. Trust boundary (same level as `trustedHtml`): never concatenate user-controlled content into these fragments; sanitize untrusted data at your own system boundary first. The framework only enforces no-`<script>` and no-executable-`<style>`.; ssr.noExternal?: (string | RegExp)[] (optional); island.upgradeStrategy?: "load" | "idle" | "visible" | "only" | "none" (optional); viewTransition?: boolean (optional) — Enable the View Transitions API for client navigations. Defaults to true.; speculation?: boolean | { prerender?: string[]; prefetch?: string[]; exclude?: string[]; eagerness?: "immediate" | "moderate" | "conservative"; } (optional) — Speculation Rules emission: `true` uses framework defaults, or pass prerender/prefetch URL lists, exclusions and an eagerness.; middleware.cors?: boolean (optional) — Built-in CORS middleware. Default-ON; pass `false` to disable.; middleware.corsOrigin?: string | string[] (optional) — Static CORS allowlist data, serialized into the generated entry as JSON. Mutually exclusive with {@link FrameworkOptions.middleware.corsOriginModule }.; middleware.corsOriginModule?: string (optional) — Path to a module that default-exports `(origin: string) => string | undefined`. The generated entry imports the module — the callback is never serialized — so it may close over module scope and import dependencies. Resolved with the same idiom as `layout.import` (e.g. './app/cors-origin.ts'). Mutually exclusive with `corsOrigin`.; middleware.requestId?: boolean (optional) — Emit and honor a per-request id header. Default-ON; pass `false` to disable.; middleware.logger?: boolean (optional) — Log each request through the built-in logger. Default-ON; pass `false` to disable.; middleware.securityHeaders?: boolean (optional) — Attach the built-in security response headers. Default-ON; pass `false` to disable.; middleware.csp?: { policy?: string; nonce?: boolean; reportOnly?: boolean; } (optional) — Content-Security-Policy emission: the policy string, nonce generation, and report-only mode.; middleware.use?: string[] (optional) — Fetch middleware chain (#858), composed around the framework handler in onion order (`use[0]` outermost), outside all built-in middleware above. Each entry is a MODULE PATH (same resolution idiom as `layout.import`, e.g. './app/middleware/auth.ts') whose default export is a {@link Middleware}; the generated entry emits `import * as __mw_N from '<path>'` and composes `__mw_N.default` in configured…; criticalAssets.fonts?: CriticalFontAsset[] (optional); criticalAssets.styles?: (string | CriticalStyleAsset)[] (optional); criticalAssets.stylesheets?: (string | CriticalStyleAsset)[] (optional) — Alias for styles accepted by config producers.; criticalAssets.inlineScripts?: (string | CriticalInlineScriptAsset)[] (optional); criticalAssets.allowExternalRenderBlocking?: boolean (optional) — Allow intentional external render-blocking styles/scripts.; criticalAssets.allowRenderBlockingExternal?: boolean (optional) — Alias retained only within this build-side config shape.; criticalAssets.minifyInlineStyles?: boolean (optional) — Minify inline CSS. Defaults to true.; criticalAssets.origin?: string (optional) — Origin used to distinguish same-origin and cross-origin absolute URLs.; critical?: CriticalAssetsOptions (optional); i18n?: OpenElementI18nOptions (optional); tailwind?: boolean | TailwindOptions (optional) — Opt-in Tailwind entry (alpha9 C2, #1505; externalized alpha15 S lane). `true` or an options object declares the style sources that compile through the official `@tailwindcss/vite` pipeline into the linked document stylesheet; absent keeps the build byte-identical to a Tailwind-less pipeline.; unocss?: boolean | UnocssOptions (optional) — Opt-in UnoCSS entry (alpha15 stage 2B): the sibling of `tailwind`, same shape and same meaning. Declaring it selects UnoCSS as this application's style engine; declaring both keys is a conflict and fails closed — see `UnocssOptions` (`@openelement/router/vite`).

packages/router/src/vite/app-vite.ts:31
OpenMdxPluginOptionsinterface · public
@openelement/router · ./vite

Options for the `.mdx` route plugin ({@linkcode mdxPlugin}).

OpenMdxPluginOptions

routesDir?: string (optional) — Routes directory (as configured in openElement()). The compiled page tag derives from the route-file-relative path so the generated entry's path-derived registration tag matches the program tag.

packages/router/src/vite/plugin-mdx.ts:28
openPipelinefunction · public
@openelement/router · ./vite

Low-level Vite plugin pipeline: SSR dev server, SSG and islands without the content/i18n conveniences of `openElement()`.

(config?: OpenPipelineConfig): Plugin[]

routes.dir?: string (optional); output.outDir?: string (optional); island.dir?: string (optional); island.upgradeStrategy?: string (optional); viewTransition?: boolean (optional); headExtras?: string (optional)

packages/router/src/vite/index.ts:39
OpenPipelineConfiginterface · public
@openelement/router · ./vite

Options for the low-level {@linkcode openPipeline} Vite plugin pipeline.

OpenPipelineConfig

routes.dir?: string (optional); output.outDir?: string (optional); island.dir?: string (optional); island.upgradeStrategy?: string (optional); viewTransition?: boolean (optional); headExtras?: string (optional)

packages/router/src/vite/index.ts:30
ResolvedTailwindOptionsinterface · public
@openelement/router · ./vite

The resolved preset options: the declared style sources, in order.

ResolvedTailwindOptions

theme: readonly string[] (required) — The sources the entry `@import`s after Tailwind itself: package CSS specifiers (`@openelement/ui/theme.css`) or app-relative paths. Their `@theme` blocks, `@import`s and `url()` references compile through the official plugin like any other Tailwind CSS source.; documentReset: boolean (required) — WHOSE document the entry is: `true` when the application declared it (`tailwind: true | { theme }`), `false` when an admitted package declaration enabled it (automatic mode, `tailwind: undefined`). The single thing it decides is the DOCUMENT RESET. `@import 'tailwindcss'` carries preflight, and an application that turned the entry on is resetting its own document — that is the pre-S-lane behavior…

packages/router/src/vite/tailwind.ts:59
SpeculationRulesOptionsinterface · public
@openelement/router · ./vite

Speculation Rules configuration for SSG post-processing

SpeculationRulesOptions

prerender?: string[] (optional) — URL patterns to prerender (fully render in background before navigation).; prefetch?: string[] (optional) — URL patterns to prefetch (fetch HTML + resources without rendering).; exclude?: string[] (optional) — URL patterns to exclude from both prefetch and prerender.; eagerness?: "immediate" | "moderate" | "conservative" (optional) — Eagerness level for prerender rules.

packages/protocol/src/ssg.ts:410
SsgBehaviorOptionsinterface · public
@openelement/router · ./vite

User-facing SSG build behavior switches (OpenElementOptions['ssg']).

SsgBehaviorOptions

dynamicRouteFailure?: "fail" | "warn" (optional) — Policy for dynamic-route render failures during SSG. See {@link SsgRenderOptions.dynamicRouteFailure}.

packages/protocol/src/ssg.ts:63
TailwindOptionsinterface · public
@openelement/router · ./vite

Options for the opt-in Tailwind entry (alpha15 S lane; the pre-S "preset" compiled the sources itself — this shape only declares them). `tailwind: true` enables the entry with no declared sources: the document stylesheet is Tailwind's own default compile (`@import 'tailwindcss'`). The shape lives here, on the host-neutral config surface, and the Vite build layer consumes it — the Framework-root declaration graph packed consumers typecheck must never name `vite` (the packed-consumer gate's declaration leak pattern).

TailwindOptions

theme?: string[] (optional) — The style sources the entry `@import`s after Tailwind itself: package CSS specifiers (`@openelement/ui/theme.css`, `tailwindcss/theme.css`) or app-relative paths. Their `@theme` blocks, `@import`s and `url()` assets compile through the official `@tailwindcss/vite` pipeline into the document stylesheet — the router neither scans for classes nor transforms the compiled CSS.

packages/router/src/config.ts:177

@openelement/create

5 exports
CREATE_INSTALL_TAGconst · public
@openelement/create · ./install-command

The dist-tag a versionless documented install resolves: npm's scope alias defaults to `latest`, which the 1.0 line rides since the alpha.11 ruling. The exact version is registry truth; the canonical spelling names no tag.

"latest"
packages/create/src/install-command.ts:33
CREATE_NPM_CREATE_SCOPEconst · public
@openelement/create · ./install-command

The scope `npm create` resolves to {@linkcode CREATE_PACKAGE_SPECIFIER}: npm's initializer alias maps a bare `@scope` (optionally `@scope@<tag>`) to `@scope/create` at the same tag — untagged, at the scope's default dist-tag — so the canonical spelling never repeats the `/create` suffix (owner-verified against npm's init alias rules).

"@openelement"
packages/create/src/install-command.ts:26
CREATE_PACKAGE_SPECIFIERconst · public
@openelement/create · ./install-command

The npm specifier the generator is published under.

"@openelement/create"
packages/create/src/install-command.ts:17
CREATE_PROJECT_PLACEHOLDERconst · public
@openelement/create · ./install-command

Placeholder the usage text and the docs use in place of a project name.

"<project-name>"
packages/create/src/install-command.ts:36
createInstallCommandfunction · public
@openelement/create · ./install-command

The documented install command shapes, all verified against the published two-bin artifact (bins `openelement-create` and `create-openelement`, both `src/cli.js`; npm 11 / pnpm 12): - canonical: `npm create

(projectName?: string, options?: { tag?: string; }): string
packages/create/src/install-command.ts:59

@openelement/ui

19 exports
manifestconst · public
@openelement/ui · root

The build-time generated package manifest (declarations for every UI component).

OpenElementPackageManifest
packages/ui/src/manifest.ts:15
OpenButtonclass · public
@openelement/ui · root

Button or link control: an `href` property switches the compiled anchor branch (no-JS navigation survives SSR), `variant`/`size` pick the styled surface, and the disabled state follows the reflected host attribute.

class OpenButton extends OpenElement
packages/ui/src/open-button.tsx:53
OpenCodeBlockclass · public
@openelement/ui · root

Code block with a copy button.

class OpenCodeBlock extends OpenElement
packages/ui/src/open-code-block.tsx:30
OpenDialogclass · public
@openelement/ui · root

Dialog component using native <dialog> element + popover API.

class OpenDialog extends OpenElement
packages/ui/src/open-dialog.tsx:49
OpenDropdownclass · public
@openelement/ui · root

Popover-API dropdown with CSS Anchor Positioning placement.

class OpenDropdown extends OpenElement
packages/ui/src/open-dropdown.tsx:33
OpenInputclass · public
@openelement/ui · root

Form-associated text input with a label, an inline error slot, and native constraint validation (required → valueMissing via setValidity).

class OpenInput extends OpenElement
packages/ui/src/open-input.tsx:53
OpenThemeToggleclass · public
@openelement/ui · root

Theme toggle button for dark/light mode: reads and flips the document's `data-theme` (with an initialization priority chain) and persists the choice; icon visibility follows the current theme attribute.

class OpenThemeToggle extends OpenElement
packages/ui/src/open-theme-toggle.tsx:32
readInstanceStatefunction · public
@openelement/ui · root

Read the host's `key` slot, initializing it with `init()` on first use.

<T>(host: object, key: string, init: () => T): T
packages/ui/src/instance-state.ts:15
registerOpenUifunction · public
@openelement/ui · root

Explicitly register every first-party UI element. Safe to call repeatedly.

(registry?: CustomElementRegistry | undefined): void

define: (name: string, constructor: CustomElementConstructor, options?: ElementDefinitionOptions) => void (required) — The **`define()`** method of the CustomElementRegistry interface adds a definition for a custom element to the custom element registry, mapping its name to the constructor which will be used to create it. [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomElementRegistry/define); get: (name: string) => CustomElementConstructor (required) — The **`get()`** method of the CustomElementRegistry interface returns the constructor for a previously-defined custom element. [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomElementRegistry/get); getName: (constructor: CustomElementConstructor) => string | null (required) — The **`getName()`** method of the CustomElementRegistry interface returns the name for a previously-defined custom element. [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomElementRegistry/getName); initialize: (root: Node) => void (required); upgrade: (root: Node) => void (required) — The **`upgrade()`** method of the CustomElementRegistry interface upgrades all shadow-containing custom elements in a Node subtree, even before they are connected to the main document. [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomElementRegistry/upgrade); whenDefined: (name: string) => Promise<CustomElementConstructor> (required) — The **`whenDefined()`** method of the CustomElementRegistry interface returns a Promise that resolves when the named element is defined. [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomElementRegistry/whenDefined)

packages/ui/src/register.ts:21
writeInstanceStatefunction · public
@openelement/ui · root

Overwrite the host's `key` slot.

(host: object, key: string, value: unknown): void
packages/ui/src/instance-state.ts:26
readInstanceStatefunction · public
@openelement/ui · ./instance-state

Read the host's `key` slot, initializing it with `init()` on first use.

<T>(host: object, key: string, init: () => T): T
packages/ui/src/instance-state.ts:15
writeInstanceStatefunction · public
@openelement/ui · ./instance-state

Overwrite the host's `key` slot.

(host: object, key: string, value: unknown): void
packages/ui/src/instance-state.ts:26
manifestconst · public
@openelement/ui · ./manifest

The build-time generated package manifest (declarations for every UI component).

OpenElementPackageManifest
packages/ui/src/manifest.ts:15
OpenButtonclass · public
@openelement/ui · ./open-button

Button or link control: an `href` property switches the compiled anchor branch (no-JS navigation survives SSR), `variant`/`size` pick the styled surface, and the disabled state follows the reflected host attribute.

class OpenButton extends OpenElement
packages/ui/src/open-button.tsx:53
OpenCodeBlockclass · public
@openelement/ui · ./open-code-block

Code block with a copy button.

class OpenCodeBlock extends OpenElement
packages/ui/src/open-code-block.tsx:30
OpenDialogclass · public
@openelement/ui · ./open-dialog

Dialog component using native <dialog> element + popover API.

class OpenDialog extends OpenElement
packages/ui/src/open-dialog.tsx:49
OpenDropdownclass · public
@openelement/ui · ./open-dropdown

Popover-API dropdown with CSS Anchor Positioning placement.

class OpenDropdown extends OpenElement
packages/ui/src/open-dropdown.tsx:33
OpenInputclass · public
@openelement/ui · ./open-input

Form-associated text input with a label, an inline error slot, and native constraint validation (required → valueMissing via setValidity).

class OpenInput extends OpenElement
packages/ui/src/open-input.tsx:53
OpenThemeToggleclass · public
@openelement/ui · ./open-theme-toggle

Theme toggle button for dark/light mode: reads and flips the document's `data-theme` (with an initialization priority chain) and persists the choice; icon visibility follows the current theme attribute.

class OpenThemeToggle extends OpenElement
packages/ui/src/open-theme-toggle.tsx:32

05 / config options

The application options type, one row per member.

Rendered from the application options type the config entry is checked against, so the table and the real config surface cannot drift. Nested option bags render with dotted names; the type column is the declared type text.

head.title
string

Document title; defaults to the package.json `name`.

optional
head.description
string

`<meta name="description">` + `og:description`.

optional
head.lang
string

`<html lang>`; defaults to `en`.

optional
head.favicon
string

Site-root-relative favicon path, emitted as `<link rel="icon">`.

optional
head.ogImage
string

`og:image` URL. Absolute (crawlable) or site-root-relative.

optional
head.stylesheets
string[]

External stylesheets linked into `<head>`.

optional
head.scripts
OpenElementHeadScript[]

External scripts emitted into `<head>`; inline code is not accepted here.

optional
ssg.dynamicRouteFailure
"fail" | "warn"

Policy for dynamic-route render failures during SSG. See {@link SsgRenderOptions.dynamicRouteFailure}.

optional
renderer
"native" | "lit"

Page renderer selection (Beta.2.2, #1339). EXPLICIT, never inferred: 'native' (default) renders pages through the compiled Part Program serializer (renderToString); 'lit' renders LitElement pages through

optional
routesDir
string

Directory the route scanner walks, relative to the Vite root. Defaults to `app/routes`.

optional
islandsDir
string

Directory island modules are discovered in. Defaults to `app/islands`.

optional
packageIslands
string[] | "auto" | "manual"

How the build admits component packages whose modules the application imports. - omitted or `'auto'` (the default): the scan derives the admitted set at scan time — every package-owned element module the app's routes, pages, layouts, islands and components really reach (bundler-resolved) is attributed to its owner package (nearest `package.json`), and a package with a valid OpenElement manifest i…

optional
layout
LayoutConfig

Layout declaration; `false` disables the layout, `'default'` uses the built-in one.

optional
layouts
LayoutsConfig

Named layout declarations keyed by layout name.

optional
headExtras
string

@dangerous injected as-is, only use with controlled content

optional
inject.stylesheets
(string | { href: string; integrity?: string; crossorigin?: "anonymous" | "use-credentials"; attrs?: Record<string, string | number | boolean>; })[]

Stylesheets linked into the document head; each entry is an href or a link record with integrity/crossorigin/attrs.

optional
inject.scripts
(string | { src: string; type?: string; async?: boolean; defer?: boolean; integrity?: string; crossorigin?: "anonymous" | "use-credentials"; attrs?: Record<str…

Scripts emitted into the document; each entry is a src or a script record with type/async/defer/integrity/crossorigin/attrs.

optional
inject.headFragments
string[]

@dangerous fragments injected as-is. Trust boundary (same level as `trustedHtml`): never concatenate user-controlled content into these fragments; sanitize untrusted data at your own system boundary first. The framework only enforces no-`<script>` and no-executable-`<style>`.

optional
ssr.noExternal
(string | RegExp)[]

optional
island.upgradeStrategy
"load" | "idle" | "visible" | "only" | "none"

optional
build.outDir
string

Output directory for the build artifacts. Defaults to `dist`.

optional
build.manifestBudget
{ islandKB?: number; totalJsKB?: number; pageKB?: number; }

Advisory only: exceeded budgets print build-manifest warnings and never fail the build; enforce them in your own build-output test.

optional
viewTransition
boolean

Enable the View Transitions API for client navigations. Defaults to true.

optional
speculation
boolean | { prerender?: string[]; prefetch?: string[]; exclude?: string[]; eagerness?: "immediate" | "moderate" | "conservative"; }

Speculation Rules emission: `true` uses framework defaults, or pass prerender/prefetch URL lists, exclusions and an eagerness.

optional
middleware.cors
boolean

Built-in CORS middleware. Default-ON; pass `false` to disable.

optional
middleware.corsOrigin
string | string[]

Static CORS allowlist data, serialized into the generated entry as JSON. Mutually exclusive with {@link FrameworkOptions.middleware.corsOriginModule }.

optional
middleware.corsOriginModule
string

Path to a module that default-exports `(origin: string) => string | undefined`. The generated entry imports the module — the callback is never serialized — so it may close over module scope and import dependencies. Resolved with the same idiom as `layout.import` (e.g. './app/cors-origin.ts'). Mutually exclusive with `corsOrigin`.

optional
middleware.requestId
boolean

Emit and honor a per-request id header. Default-ON; pass `false` to disable.

optional
middleware.logger
boolean

Log each request through the built-in logger. Default-ON; pass `false` to disable.

optional
middleware.securityHeaders
boolean

Attach the built-in security response headers. Default-ON; pass `false` to disable.

optional
middleware.csp
{ policy?: string; nonce?: boolean; reportOnly?: boolean; }

Content-Security-Policy emission: the policy string, nonce generation, and report-only mode.

optional
middleware.use
string[]

Fetch middleware chain (#858), composed around the framework handler in onion order (`use[0]` outermost), outside all built-in middleware above. Each entry is a MODULE PATH (same resolution idiom as `layout.import`, e.g. './app/middleware/auth.ts') whose default export is a {@link Middleware}; the generated entry emits `import * as __mw_N from '<path>'` and composes `__mw_N.default` in configured…

optional
criticalAssets.fonts
CriticalFontAsset[]

optional
criticalAssets.styles
(string | CriticalStyleAsset)[]

optional
criticalAssets.stylesheets
(string | CriticalStyleAsset)[]

Alias for styles accepted by config producers.

optional
criticalAssets.inlineScripts
(string | CriticalInlineScriptAsset)[]

optional
criticalAssets.allowExternalRenderBlocking
boolean

Allow intentional external render-blocking styles/scripts.

optional
criticalAssets.allowRenderBlockingExternal
boolean

Alias retained only within this build-side config shape.

optional
criticalAssets.minifyInlineStyles
boolean

Minify inline CSS. Defaults to true.

optional
criticalAssets.origin
string

Origin used to distinguish same-origin and cross-origin absolute URLs.

optional
critical
CriticalAssetsOptions

optional
i18n
OpenElementI18nOptions

optional
tailwind
boolean | TailwindOptions

Opt-in Tailwind entry (alpha9 C2, #1505; externalized alpha15 S lane). `true` or an options object declares the style sources that compile through the official `@tailwindcss/vite` pipeline into the linked document stylesheet; absent keeps the build byte-identical to a Tailwind-less pipeline.

optional
unocss
boolean | UnocssOptions

Opt-in UnoCSS entry (alpha15 stage 2B): the sibling of `tailwind`, same shape and same meaning. Declaring it selects UnoCSS as this application's style engine; declaring both keys is a conflict and fails closed — see `UnocssOptions` (`@openelement/router/vite`).

optional

04 / element reference

Custom elements from the compiler manifest.

Tag, layer, hydration strategy, attributes, events, slots and CSS parts come from the @openelement/ui compiler manifest — the same truth the SSR/claim pipeline validates against.

<open-button>OpenButtondsd-interactiveload

Button or link control: an `href` property switches the compiled anchor branch (no-JS navigation survives SSR), `variant`/`size` pick the styled surface, and the disabled state follows the reflected host attribute.

@openelement/ui/open-button
Attributesvariant: string — variant attribute; size: string — size attribute; disabled: boolean = false — disabled attribute; href: string — href attribute; target: string — target attribute; type: string — type attributeEventsopen-click: CustomEvent — Fired on open-clickSlots(default) — Default slotCSS partscontrol — The visible button or anchor element
<open-code-block>OpenCodeBlockdsd-staticidle

Code block with a copy button.

@openelement/ui/open-code-block
AttributesEventsSlots(default) — Default slotCSS partscopy — The copy button
<open-dialog>OpenDialogdsd-interactiveidleexperimental

Dialog component using native <dialog> element + popover API.

@openelement/ui/open-dialog
Attributesopen: boolean = false — open attribute; label: string — label attributeEventsopen-dialog-close: CustomEvent — Fired on open-dialog-closeSlots(default) — Default slot; trigger — The 'trigger' slot; footer — The 'footer' slotCSS partsoverlay — The dialog backdrop/element; header — The header bar; close — The close button; body — The content area (<slot>); footer — The optional footer slot
<open-dropdown>OpenDropdowndsd-interactiveloadexperimental

Popover-API dropdown with CSS Anchor Positioning placement.

@openelement/ui/open-dropdown
AttributesEventsSlotstrigger — Control used to toggle the dropdown; (default) — Dropdown contentCSS partstrigger — Trigger wrapper; content — Popover content
<open-input>OpenInputdsd-interactiveloadexperimental

Form-associated text input with a label, an inline error slot, and native constraint validation (required → valueMissing via setValidity).

@openelement/ui/open-input
Attributestype: string — type attribute; placeholder: string — placeholder attribute; label: string — label attribute; name: string — name attribute; value: string — value attribute; disabled: boolean = false — disabled attribute; required: boolean = false — required attribute; error: string — error attributeEventsopen-input: CustomEvent<{ value: unknown }> — Fired on open-input; open-change: CustomEvent<{ value: unknown }> — Fired on open-change; open-focus: CustomEvent — Fired on open-focus; open-blur: CustomEvent — Fired on open-blurSlotsCSS partswrapper — The outer input-wrapper div; label — The label element; control — The input element; error — The error message small element
<open-theme-toggle>OpenThemeToggledsd-interactiveload

Theme toggle button for dark/light mode: reads and flips the document's `data-theme` (with an initialization priority chain) and persists the choice; icon visibility follows the current theme attribute.

@openelement/ui/open-theme-toggle
Attributestheme: string — theme attributeEventsopen:theme-change: CustomEvent<{ theme: unknown }> — Fired on open:theme-changeSlotsCSS partstoggle — The button element; icon-sun — The sun SVG icon; icon-moon — The moon SVG icon